summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc18
-rw-r--r--ObsoleteFiles.inc3
-rw-r--r--bin/pkill/tests/pgrep-j_test.sh84
-rw-r--r--bin/pkill/tests/pkill-j_test.sh75
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/dtrace.c45
-rw-r--r--contrib/binutils/gas/config/tc-arm.c34
-rw-r--r--contrib/netbsd-tests/FREEBSD-upgrade38
-rw-r--r--contrib/netbsd-tests/bin/cat/d_align.in3
-rw-r--r--contrib/netbsd-tests/bin/cat/d_align.out3
-rwxr-xr-xcontrib/netbsd-tests/bin/cat/t_cat.sh59
-rwxr-xr-xcontrib/netbsd-tests/bin/cp/t_cp.sh294
-rwxr-xr-xcontrib/netbsd-tests/bin/dd/t_dd.sh130
-rw-r--r--contrib/netbsd-tests/bin/df/getmntinfo.c218
-rwxr-xr-xcontrib/netbsd-tests/bin/df/t_df.sh148
-rwxr-xr-xcontrib/netbsd-tests/bin/expr/t_expr.sh228
-rwxr-xr-xcontrib/netbsd-tests/bin/pax/t_pax.sh54
-rw-r--r--contrib/netbsd-tests/bin/ps/keywords123
-rwxr-xr-xcontrib/netbsd-tests/bin/ps/t_ps.sh404
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_for.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_subshell.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_until.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_while.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_for.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_subshell.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_until.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_while.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_case.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_compound.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_file.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_for.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_func.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_subshell.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_until.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_while.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_for.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_subshell.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_until.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_while.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_for.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_subshell.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_until.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_while.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_case.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_compound.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_file.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_for.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_func.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_subshell.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_until.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_while.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_case.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_compound.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_file.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_for.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_func.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_subshell.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_until.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_while.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_case.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_compound.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_file.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_for.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_func.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_subshell.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_until.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_while.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_case.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_compound.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_file.out3
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_for.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_func.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_subshell.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_until.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_while.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_case.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_compound.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_file.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_for.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_func.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_until.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_while.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_for.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_until.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_while.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_case.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_compound.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_file.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_for.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_func.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_until.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_while.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_for.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_subshell.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_until.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_while.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_for.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_subshell.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_until.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_while.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_case.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_compound.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_file.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_for.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_func.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_subshell.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_until.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_while.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_for.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_subshell.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_until.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_while.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_for.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_subshell.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_until.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_while.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_case.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_compound.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_file.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_for.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_func.out7
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_subshell.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_until.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_while.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_case.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_compound.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_file.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_for.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_func.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_until.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_while.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_for.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_until.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_while.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_case.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_compound.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_file.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_for.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_func.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_until.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_while.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_case.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_compound.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_file.out4
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_for.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_func.out5
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_until.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_while.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_case.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_compound.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_file.out6
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_for.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_func.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_until.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_while.out14
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_case.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_compound.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_file.out8
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_for.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_func.out12
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_subshell.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_until.out10
-rw-r--r--contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_while.out10
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/dotcmd/scoped_command129
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh76
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_compexit.sh63
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_evaltested.sh60
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_exit.sh105
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_expand.sh142
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_fsplit.sh186
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_here.sh73
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_set_e.sh289
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_ulimit.sh46
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_varquote.sh81
-rwxr-xr-xcontrib/netbsd-tests/bin/sh/t_wait.sh59
-rwxr-xr-xcontrib/netbsd-tests/bin/sleep/t_sleep.sh72
-rwxr-xr-xcontrib/netbsd-tests/bin/tar/t_tar.sh51
-rw-r--r--contrib/netbsd-tests/crypto/libcrypto/conf/d_conf.out94
-rw-r--r--contrib/netbsd-tests/crypto/libcrypto/conf/d_conf_ssleay.cnf78
-rwxr-xr-xcontrib/netbsd-tests/crypto/libcrypto/t_certs.sh41
-rwxr-xr-xcontrib/netbsd-tests/crypto/libcrypto/t_ciphers.sh122
-rwxr-xr-xcontrib/netbsd-tests/crypto/libcrypto/t_hashes.sh108
-rwxr-xr-xcontrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh107
-rwxr-xr-xcontrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh110
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_aesctr1.c250
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_aesctr2.c97
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_arc4.c80
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_camellia.c87
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_cbcdes.c82
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_comp.c90
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_comp_zlib.c92
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_comp_zlib_rnd.c96
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_gcm.c126
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_md5.c109
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_md5hmac.c181
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_null.c76
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_sha1hmac.c191
-rw-r--r--contrib/netbsd-tests/crypto/opencrypto/h_xcbcmac.c109
-rwxr-xr-xcontrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh272
-rw-r--r--contrib/netbsd-tests/dev/audio/h_pad.c76
-rw-r--r--contrib/netbsd-tests/dev/audio/h_pad_musa.c344
-rwxr-xr-xcontrib/netbsd-tests/dev/audio/t_pad.sh47
-rw-r--r--contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue998
-rw-r--r--contrib/netbsd-tests/dev/cgd/paramsfile8
-rwxr-xr-xcontrib/netbsd-tests/dev/cgd/t_cgd.sh159
-rw-r--r--contrib/netbsd-tests/dev/dm/dm_targets_cmd.plist20
-rw-r--r--contrib/netbsd-tests/dev/dm/dm_version_cmd.plist20
-rw-r--r--contrib/netbsd-tests/dev/dm/h_dm.c146
-rwxr-xr-xcontrib/netbsd-tests/dev/dm/t_dm.sh47
-rw-r--r--contrib/netbsd-tests/dev/md/h_mdserv.c109
-rwxr-xr-xcontrib/netbsd-tests/dev/md/t_md.sh65
-rwxr-xr-xcontrib/netbsd-tests/dev/raidframe/t_raid.sh323
-rw-r--r--contrib/netbsd-tests/dev/scsipi/libscsitest/SCSITEST.ioconf12
-rw-r--r--contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest.c259
-rw-r--r--contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest.h38
-rw-r--r--contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest_component.c46
-rw-r--r--contrib/netbsd-tests/dev/scsipi/t_cd.c81
-rwxr-xr-xcontrib/netbsd-tests/dev/sysmon/t_swsensor.sh398
-rw-r--r--contrib/netbsd-tests/dev/sysmon/t_swwdog.c192
-rw-r--r--contrib/netbsd-tests/fs/cd9660/pr_48787.image.bz2.uue103
-rwxr-xr-xcontrib/netbsd-tests/fs/cd9660/t_high_ino_big_file.sh118
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_ext2fs.c139
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_ffs.c156
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_lfs.c192
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_msdosfs.c140
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_nfs.c326
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_puffs.c452
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_rumpfs.c90
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_sysvbfs.c139
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_tmpfs.c112
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_udf.c153
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_v7fs.c140
-rw-r--r--contrib/netbsd-tests/fs/common/fstest_zfs.c134
-rw-r--r--contrib/netbsd-tests/fs/common/h_fsmacros.h337
-rw-r--r--contrib/netbsd-tests/fs/common/snapshot.c228
-rwxr-xr-xcontrib/netbsd-tests/fs/ffs/ffs_common.sh99
-rw-r--r--contrib/netbsd-tests/fs/ffs/h_ffs_server.c113
-rw-r--r--contrib/netbsd-tests/fs/ffs/h_quota2_tests.c468
-rwxr-xr-xcontrib/netbsd-tests/fs/ffs/quotas_common.sh12
-rwxr-xr-xcontrib/netbsd-tests/fs/ffs/t_clearquota.sh91
-rw-r--r--contrib/netbsd-tests/fs/ffs/t_fifos.c158
-rwxr-xr-xcontrib/netbsd-tests/fs/ffs/t_getquota.sh112
-rwxr-xr-xcontrib/netbsd-tests/fs/ffs/t_miscquota.sh213
-rw-r--r--contrib/netbsd-tests/fs/ffs/t_mount.c138
-rw-r--r--contrib/netbsd-tests/fs/ffs/t_quota2_1.c114
-rw-r--r--contrib/netbsd-tests/fs/ffs/t_quota2_remount.c139
-rwxr-xr-xcontrib/netbsd-tests/fs/ffs/t_quotalimit.sh345
-rwxr-xr-xcontrib/netbsd-tests/fs/ffs/t_setquota.sh203
-rw-r--r--contrib/netbsd-tests/fs/ffs/t_snapshot.c43
-rw-r--r--contrib/netbsd-tests/fs/ffs/t_snapshot_log.c46
-rw-r--r--contrib/netbsd-tests/fs/ffs/t_snapshot_v2.c43
-rw-r--r--contrib/netbsd-tests/fs/fifofs/t_fifo.c237
-rw-r--r--contrib/netbsd-tests/fs/h_funcs.subr63
-rw-r--r--contrib/netbsd-tests/fs/hfs/colon.hfs.bz2.uue35
-rw-r--r--contrib/netbsd-tests/fs/hfs/t_pathconvert.c83
-rw-r--r--contrib/netbsd-tests/fs/kernfs/t_basic.c133
-rw-r--r--contrib/netbsd-tests/fs/lfs/t_pr.c60
-rw-r--r--contrib/netbsd-tests/fs/msdosfs/t_snapshot.c51
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/README16
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/exports12
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/getmntinfo.c85
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c2575
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c571
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/pathnames.h37
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/check_bound.c231
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c366
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_stat.c206
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc.c232
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_4.c455
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_com.c1460
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.8127
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.c613
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.h146
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/security.c282
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/util.c401
-rw-r--r--contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c165
-rw-r--r--contrib/netbsd-tests/fs/nfs/t_mountd.c121
-rwxr-xr-xcontrib/netbsd-tests/fs/nfs/t_rquotad.sh142
-rw-r--r--contrib/netbsd-tests/fs/nullfs/t_basic.c174
-rw-r--r--contrib/netbsd-tests/fs/psshfs/h_have_puffs.c58
-rw-r--r--contrib/netbsd-tests/fs/psshfs/ssh_config.in14
-rw-r--r--contrib/netbsd-tests/fs/psshfs/ssh_host_key15
-rw-r--r--contrib/netbsd-tests/fs/psshfs/ssh_host_key.pub1
-rw-r--r--contrib/netbsd-tests/fs/psshfs/sshd_config.in40
-rwxr-xr-xcontrib/netbsd-tests/fs/psshfs/t_psshfs.sh274
-rw-r--r--contrib/netbsd-tests/fs/ptyfs/t_nullpts.c128
-rw-r--r--contrib/netbsd-tests/fs/ptyfs/t_ptyfs.c62
-rw-r--r--contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs.c255
-rw-r--r--contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs.h127
-rw-r--r--contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_subr.c358
-rw-r--r--contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_vfsops.c298
-rw-r--r--contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_vnops.c586
-rw-r--r--contrib/netbsd-tests/fs/puffs/t_basic.c455
-rw-r--r--contrib/netbsd-tests/fs/puffs/t_fuzz.c283
-rw-r--r--contrib/netbsd-tests/fs/puffs/t_io.c61
-rw-r--r--contrib/netbsd-tests/fs/tmpfs/README17
-rw-r--r--contrib/netbsd-tests/fs/tmpfs/h_funcs.subr96
-rw-r--r--contrib/netbsd-tests/fs/tmpfs/h_tools.c299
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_create.sh122
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_devices.sh60
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_dots.sh67
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_exec.sh52
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_link.sh129
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_mkdir.sh159
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_mknod.sh143
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_mount.sh140
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_pipes.sh52
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_read_write.sh87
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_readdir.sh116
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_remove.sh110
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_rename.sh278
-rw-r--r--contrib/netbsd-tests/fs/tmpfs/t_renamerace.c115
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_rmdir.sh204
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_setattr.sh216
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_sizes.sh131
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_sockets.sh52
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_statvfs.sh59
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_symlink.sh114
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_times.sh141
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_trail_slash.sh52
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_truncate.sh56
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_vnd.sh78
-rwxr-xr-xcontrib/netbsd-tests/fs/tmpfs/t_vnode_leak.sh60
-rw-r--r--contrib/netbsd-tests/fs/umapfs/t_basic.c145
-rw-r--r--contrib/netbsd-tests/fs/union/t_pr.c130
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_full.c101
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_io.c250
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_renamerace.c190
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_rmdirrace.c106
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_ro.c203
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_union.c204
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_unpriv.c241
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_vfsops.c211
-rw-r--r--contrib/netbsd-tests/fs/vfs/t_vnops.c1001
-rwxr-xr-xcontrib/netbsd-tests/fs/zfs/t_zpool.sh66
-rwxr-xr-xcontrib/netbsd-tests/games/t_factor.sh58
-rw-r--r--contrib/netbsd-tests/h_macros.h85
-rw-r--r--contrib/netbsd-tests/include/d_bitstring_27.out263
-rw-r--r--contrib/netbsd-tests/include/d_bitstring_32.out303
-rw-r--r--contrib/netbsd-tests/include/d_bitstring_49.out439
-rw-r--r--contrib/netbsd-tests/include/d_bitstring_64.out559
-rw-r--r--contrib/netbsd-tests/include/d_bitstring_67.out583
-rw-r--r--contrib/netbsd-tests/include/d_bitstring_8.out111
-rw-r--r--contrib/netbsd-tests/include/machine/t_bswap.c178
-rw-r--r--contrib/netbsd-tests/include/sys/t_bitops.c238
-rw-r--r--contrib/netbsd-tests/include/sys/t_bootblock.c73
-rw-r--r--contrib/netbsd-tests/include/sys/t_cdefs.c267
-rw-r--r--contrib/netbsd-tests/include/sys/t_socket.c205
-rw-r--r--contrib/netbsd-tests/include/sys/t_tree.c124
-rw-r--r--contrib/netbsd-tests/include/sys/t_types.c144
-rw-r--r--contrib/netbsd-tests/include/t_bitstring.c298
-rw-r--r--contrib/netbsd-tests/include/t_errno.c765
-rw-r--r--contrib/netbsd-tests/include/t_glob.c75
-rw-r--r--contrib/netbsd-tests/include/t_inttypes.c250
-rw-r--r--contrib/netbsd-tests/include/t_limits.c287
-rw-r--r--contrib/netbsd-tests/include/t_netdb.c244
-rw-r--r--contrib/netbsd-tests/include/t_paths.c205
-rw-r--r--contrib/netbsd-tests/include/t_stdint.c57
-rw-r--r--contrib/netbsd-tests/ipf/expected/.cvsignore1
-rw-r--r--contrib/netbsd-tests/ipf/expected/bpf-f120
-rw-r--r--contrib/netbsd-tests/ipf/expected/bpf14
-rw-r--r--contrib/netbsd-tests/ipf/expected/f120
-rw-r--r--contrib/netbsd-tests/ipf/expected/f10126
-rw-r--r--contrib/netbsd-tests/ipf/expected/f11283
-rw-r--r--contrib/netbsd-tests/ipf/expected/f1260
-rw-r--r--contrib/netbsd-tests/ipf/expected/f13180
-rw-r--r--contrib/netbsd-tests/ipf/expected/f1448
-rw-r--r--contrib/netbsd-tests/ipf/expected/f159
-rw-r--r--contrib/netbsd-tests/ipf/expected/f169
-rw-r--r--contrib/netbsd-tests/ipf/expected/f177
-rw-r--r--contrib/netbsd-tests/ipf/expected/f1827
-rw-r--r--contrib/netbsd-tests/ipf/expected/f1910
-rw-r--r--contrib/netbsd-tests/ipf/expected/f242
-rw-r--r--contrib/netbsd-tests/ipf/expected/f203
-rw-r--r--contrib/netbsd-tests/ipf/expected/f215
-rw-r--r--contrib/netbsd-tests/ipf/expected/f225
-rw-r--r--contrib/netbsd-tests/ipf/expected/f245
-rw-r--r--contrib/netbsd-tests/ipf/expected/f2535
-rw-r--r--contrib/netbsd-tests/ipf/expected/f2684
-rw-r--r--contrib/netbsd-tests/ipf/expected/f2790
-rw-r--r--contrib/netbsd-tests/ipf/expected/f2832
-rw-r--r--contrib/netbsd-tests/ipf/expected/f2964
-rw-r--r--contrib/netbsd-tests/ipf/expected/f348
-rw-r--r--contrib/netbsd-tests/ipf/expected/f3068
-rw-r--r--contrib/netbsd-tests/ipf/expected/f448
-rw-r--r--contrib/netbsd-tests/ipf/expected/f51392
-rw-r--r--contrib/netbsd-tests/ipf/expected/f61392
-rw-r--r--contrib/netbsd-tests/ipf/expected/f7144
-rw-r--r--contrib/netbsd-tests/ipf/expected/f842
-rw-r--r--contrib/netbsd-tests/ipf/expected/f9180
-rw-r--r--contrib/netbsd-tests/ipf/expected/i117
-rw-r--r--contrib/netbsd-tests/ipf/expected/i105
-rw-r--r--contrib/netbsd-tests/ipf/expected/i1112
-rw-r--r--contrib/netbsd-tests/ipf/expected/i1239
-rw-r--r--contrib/netbsd-tests/ipf/expected/i132
-rw-r--r--contrib/netbsd-tests/ipf/expected/i1415
-rw-r--r--contrib/netbsd-tests/ipf/expected/i154
-rw-r--r--contrib/netbsd-tests/ipf/expected/i163
-rw-r--r--contrib/netbsd-tests/ipf/expected/i1729
-rw-r--r--contrib/netbsd-tests/ipf/expected/i1811
-rw-r--r--contrib/netbsd-tests/ipf/expected/i19.dist22
-rw-r--r--contrib/netbsd-tests/ipf/expected/i29
-rw-r--r--contrib/netbsd-tests/ipf/expected/i204
-rw-r--r--contrib/netbsd-tests/ipf/expected/i2116
-rw-r--r--contrib/netbsd-tests/ipf/expected/i225
-rw-r--r--contrib/netbsd-tests/ipf/expected/i230
-rw-r--r--contrib/netbsd-tests/ipf/expected/i311
-rw-r--r--contrib/netbsd-tests/ipf/expected/i49
-rw-r--r--contrib/netbsd-tests/ipf/expected/i59
-rw-r--r--contrib/netbsd-tests/ipf/expected/i612
-rw-r--r--contrib/netbsd-tests/ipf/expected/i714
-rw-r--r--contrib/netbsd-tests/ipf/expected/i866
-rw-r--r--contrib/netbsd-tests/ipf/expected/i917
-rw-r--r--contrib/netbsd-tests/ipf/expected/in131
-rw-r--r--contrib/netbsd-tests/ipf/expected/in1003
-rw-r--r--contrib/netbsd-tests/ipf/expected/in100_63
-rw-r--r--contrib/netbsd-tests/ipf/expected/in1014
-rw-r--r--contrib/netbsd-tests/ipf/expected/in101_64
-rw-r--r--contrib/netbsd-tests/ipf/expected/in1025
-rw-r--r--contrib/netbsd-tests/ipf/expected/in102_65
-rw-r--r--contrib/netbsd-tests/ipf/expected/in1_629
-rw-r--r--contrib/netbsd-tests/ipf/expected/in271
-rw-r--r--contrib/netbsd-tests/ipf/expected/in2_671
-rw-r--r--contrib/netbsd-tests/ipf/expected/in35
-rw-r--r--contrib/netbsd-tests/ipf/expected/in3_65
-rw-r--r--contrib/netbsd-tests/ipf/expected/in45
-rw-r--r--contrib/netbsd-tests/ipf/expected/in4_65
-rw-r--r--contrib/netbsd-tests/ipf/expected/in524
-rw-r--r--contrib/netbsd-tests/ipf/expected/in5_624
-rw-r--r--contrib/netbsd-tests/ipf/expected/in68
-rw-r--r--contrib/netbsd-tests/ipf/expected/in6_68
-rw-r--r--contrib/netbsd-tests/ipf/expected/in70
-rw-r--r--contrib/netbsd-tests/ipf/expected/in8_66
-rw-r--r--contrib/netbsd-tests/ipf/expected/ip168
-rw-r--r--contrib/netbsd-tests/ipf/expected/ip22
-rw-r--r--contrib/netbsd-tests/ipf/expected/ip314
-rw-r--r--contrib/netbsd-tests/ipf/expected/ipv6.14
-rw-r--r--contrib/netbsd-tests/ipf/expected/ipv6.215
-rw-r--r--contrib/netbsd-tests/ipf/expected/ipv6.36
-rw-r--r--contrib/netbsd-tests/ipf/expected/ipv6.451
-rw-r--r--contrib/netbsd-tests/ipf/expected/ipv6.56
-rw-r--r--contrib/netbsd-tests/ipf/expected/ipv6.610
-rw-r--r--contrib/netbsd-tests/ipf/expected/l156
-rw-r--r--contrib/netbsd-tests/ipf/expected/l1.b56
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1197
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1072
-rw-r--r--contrib/netbsd-tests/ipf/expected/n10033
-rw-r--r--contrib/netbsd-tests/ipf/expected/n10129
-rw-r--r--contrib/netbsd-tests/ipf/expected/n10229
-rw-r--r--contrib/netbsd-tests/ipf/expected/n10333
-rw-r--r--contrib/netbsd-tests/ipf/expected/n10450
-rw-r--r--contrib/netbsd-tests/ipf/expected/n10525
-rw-r--r--contrib/netbsd-tests/ipf/expected/n10625
-rw-r--r--contrib/netbsd-tests/ipf/expected/n11124
-rw-r--r--contrib/netbsd-tests/ipf/expected/n11_6124
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1228
-rw-r--r--contrib/netbsd-tests/ipf/expected/n12_628
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1332
-rw-r--r--contrib/netbsd-tests/ipf/expected/n13_632
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1430
-rw-r--r--contrib/netbsd-tests/ipf/expected/n14_630
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1547
-rw-r--r--contrib/netbsd-tests/ipf/expected/n15_647
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1629
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1724
-rw-r--r--contrib/netbsd-tests/ipf/expected/n18111
-rw-r--r--contrib/netbsd-tests/ipf/expected/n1_6197
-rw-r--r--contrib/netbsd-tests/ipf/expected/n2191
-rw-r--r--contrib/netbsd-tests/ipf/expected/n20025
-rw-r--r--contrib/netbsd-tests/ipf/expected/n2_6191
-rw-r--r--contrib/netbsd-tests/ipf/expected/n366
-rw-r--r--contrib/netbsd-tests/ipf/expected/n4190
-rw-r--r--contrib/netbsd-tests/ipf/expected/n4_6190
-rw-r--r--contrib/netbsd-tests/ipf/expected/n5533
-rw-r--r--contrib/netbsd-tests/ipf/expected/n5_6533
-rw-r--r--contrib/netbsd-tests/ipf/expected/n6173
-rw-r--r--contrib/netbsd-tests/ipf/expected/n6_6173
-rw-r--r--contrib/netbsd-tests/ipf/expected/n798
-rw-r--r--contrib/netbsd-tests/ipf/expected/n7_698
-rw-r--r--contrib/netbsd-tests/ipf/expected/n830
-rw-r--r--contrib/netbsd-tests/ipf/expected/n8_630
-rw-r--r--contrib/netbsd-tests/ipf/expected/n929
-rw-r--r--contrib/netbsd-tests/ipf/expected/n9_629
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni119
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni108
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni118
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni128
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni1363
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni1463
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni1563
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni1663
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni177
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni185
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni1943
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni219
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni2069
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni216
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni2337
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni37
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni47
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni596
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni663
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni75
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni89
-rw-r--r--contrib/netbsd-tests/ipf/expected/ni99
-rw-r--r--contrib/netbsd-tests/ipf/expected/p130
-rw-r--r--contrib/netbsd-tests/ipf/expected/p1040
-rw-r--r--contrib/netbsd-tests/ipf/expected/p1140
-rw-r--r--contrib/netbsd-tests/ipf/expected/p1240
-rw-r--r--contrib/netbsd-tests/ipf/expected/p1330
-rw-r--r--contrib/netbsd-tests/ipf/expected/p235
-rw-r--r--contrib/netbsd-tests/ipf/expected/p345
-rw-r--r--contrib/netbsd-tests/ipf/expected/p438
-rw-r--r--contrib/netbsd-tests/ipf/expected/p521
-rw-r--r--contrib/netbsd-tests/ipf/expected/p624
-rw-r--r--contrib/netbsd-tests/ipf/expected/p740
-rw-r--r--contrib/netbsd-tests/ipf/expected/p940
-rwxr-xr-xcontrib/netbsd-tests/ipf/h_common.sh100
-rw-r--r--contrib/netbsd-tests/ipf/input/f14
-rw-r--r--contrib/netbsd-tests/ipf/input/f106
-rw-r--r--contrib/netbsd-tests/ipf/input/f1116
-rw-r--r--contrib/netbsd-tests/ipf/input/f1244
-rw-r--r--contrib/netbsd-tests/ipf/input/f1395
-rw-r--r--contrib/netbsd-tests/ipf/input/f145
-rw-r--r--contrib/netbsd-tests/ipf/input/f158
-rw-r--r--contrib/netbsd-tests/ipf/input/f168
-rw-r--r--contrib/netbsd-tests/ipf/input/f1739
-rw-r--r--contrib/netbsd-tests/ipf/input/f184
-rw-r--r--contrib/netbsd-tests/ipf/input/f194
-rw-r--r--contrib/netbsd-tests/ipf/input/f26
-rw-r--r--contrib/netbsd-tests/ipf/input/f202
-rw-r--r--contrib/netbsd-tests/ipf/input/f2131
-rw-r--r--contrib/netbsd-tests/ipf/input/f2231
-rw-r--r--contrib/netbsd-tests/ipf/input/f2427
-rw-r--r--contrib/netbsd-tests/ipf/input/f2541
-rw-r--r--contrib/netbsd-tests/ipf/input/f2613
-rw-r--r--contrib/netbsd-tests/ipf/input/f2784
-rw-r--r--contrib/netbsd-tests/ipf/input/f287
-rw-r--r--contrib/netbsd-tests/ipf/input/f2911
-rw-r--r--contrib/netbsd-tests/ipf/input/f35
-rw-r--r--contrib/netbsd-tests/ipf/input/f3016
-rw-r--r--contrib/netbsd-tests/ipf/input/f45
-rw-r--r--contrib/netbsd-tests/ipf/input/f528
-rw-r--r--contrib/netbsd-tests/ipf/input/f628
-rw-r--r--contrib/netbsd-tests/ipf/input/f715
-rw-r--r--contrib/netbsd-tests/ipf/input/f86
-rw-r--r--contrib/netbsd-tests/ipf/input/f99
-rw-r--r--contrib/netbsd-tests/ipf/input/ip2.data3
-rw-r--r--contrib/netbsd-tests/ipf/input/ipv6.145
-rw-r--r--contrib/netbsd-tests/ipf/input/ipv6.226
-rw-r--r--contrib/netbsd-tests/ipf/input/ipv6.330
-rw-r--r--contrib/netbsd-tests/ipf/input/ipv6.4522
-rw-r--r--contrib/netbsd-tests/ipf/input/ipv6.514
-rw-r--r--contrib/netbsd-tests/ipf/input/ipv6.631
-rw-r--r--contrib/netbsd-tests/ipf/input/l164
-rw-r--r--contrib/netbsd-tests/ipf/input/n134
-rw-r--r--contrib/netbsd-tests/ipf/input/n106
-rw-r--r--contrib/netbsd-tests/ipf/input/n1008
-rw-r--r--contrib/netbsd-tests/ipf/input/n1018
-rw-r--r--contrib/netbsd-tests/ipf/input/n1028
-rw-r--r--contrib/netbsd-tests/ipf/input/n1038
-rw-r--r--contrib/netbsd-tests/ipf/input/n10448
-rw-r--r--contrib/netbsd-tests/ipf/input/n1058
-rw-r--r--contrib/netbsd-tests/ipf/input/n1068
-rw-r--r--contrib/netbsd-tests/ipf/input/n10_66
-rw-r--r--contrib/netbsd-tests/ipf/input/n1116
-rw-r--r--contrib/netbsd-tests/ipf/input/n11_616
-rw-r--r--contrib/netbsd-tests/ipf/input/n1218
-rw-r--r--contrib/netbsd-tests/ipf/input/n12_618
-rw-r--r--contrib/netbsd-tests/ipf/input/n134
-rw-r--r--contrib/netbsd-tests/ipf/input/n13_64
-rw-r--r--contrib/netbsd-tests/ipf/input/n144
-rw-r--r--contrib/netbsd-tests/ipf/input/n14_64
-rw-r--r--contrib/netbsd-tests/ipf/input/n152
-rw-r--r--contrib/netbsd-tests/ipf/input/n15_62
-rw-r--r--contrib/netbsd-tests/ipf/input/n1640
-rw-r--r--contrib/netbsd-tests/ipf/input/n1724
-rw-r--r--contrib/netbsd-tests/ipf/input/n188
-rw-r--r--contrib/netbsd-tests/ipf/input/n1_634
-rw-r--r--contrib/netbsd-tests/ipf/input/n219
-rw-r--r--contrib/netbsd-tests/ipf/input/n2006
-rw-r--r--contrib/netbsd-tests/ipf/input/n2_619
-rw-r--r--contrib/netbsd-tests/ipf/input/n35
-rw-r--r--contrib/netbsd-tests/ipf/input/n410
-rw-r--r--contrib/netbsd-tests/ipf/input/n4_610
-rw-r--r--contrib/netbsd-tests/ipf/input/n554
-rw-r--r--contrib/netbsd-tests/ipf/input/n5_654
-rw-r--r--contrib/netbsd-tests/ipf/input/n613
-rw-r--r--contrib/netbsd-tests/ipf/input/n6_613
-rw-r--r--contrib/netbsd-tests/ipf/input/n79
-rw-r--r--contrib/netbsd-tests/ipf/input/n7_69
-rw-r--r--contrib/netbsd-tests/ipf/input/n834
-rw-r--r--contrib/netbsd-tests/ipf/input/n8_637
-rw-r--r--contrib/netbsd-tests/ipf/input/n934
-rw-r--r--contrib/netbsd-tests/ipf/input/n9_634
-rw-r--r--contrib/netbsd-tests/ipf/input/ni159
-rw-r--r--contrib/netbsd-tests/ipf/input/ni1029
-rw-r--r--contrib/netbsd-tests/ipf/input/ni1126
-rw-r--r--contrib/netbsd-tests/ipf/input/ni1226
-rw-r--r--contrib/netbsd-tests/ipf/input/ni13231
-rw-r--r--contrib/netbsd-tests/ipf/input/ni14235
-rw-r--r--contrib/netbsd-tests/ipf/input/ni15235
-rw-r--r--contrib/netbsd-tests/ipf/input/ni16235
-rw-r--r--contrib/netbsd-tests/ipf/input/ni176
-rw-r--r--contrib/netbsd-tests/ipf/input/ni184
-rw-r--r--contrib/netbsd-tests/ipf/input/ni19157
-rw-r--r--contrib/netbsd-tests/ipf/input/ni2143
-rw-r--r--contrib/netbsd-tests/ipf/input/ni20157
-rw-r--r--contrib/netbsd-tests/ipf/input/ni213
-rw-r--r--contrib/netbsd-tests/ipf/input/ni233
-rw-r--r--contrib/netbsd-tests/ipf/input/ni320
-rw-r--r--contrib/netbsd-tests/ipf/input/ni418
-rw-r--r--contrib/netbsd-tests/ipf/input/ni5363
-rw-r--r--contrib/netbsd-tests/ipf/input/ni654
-rw-r--r--contrib/netbsd-tests/ipf/input/ni713
-rw-r--r--contrib/netbsd-tests/ipf/input/ni827
-rw-r--r--contrib/netbsd-tests/ipf/input/ni927
-rw-r--r--contrib/netbsd-tests/ipf/input/p18
-rw-r--r--contrib/netbsd-tests/ipf/input/p1010
-rw-r--r--contrib/netbsd-tests/ipf/input/p1110
-rw-r--r--contrib/netbsd-tests/ipf/input/p1210
-rw-r--r--contrib/netbsd-tests/ipf/input/p138
-rw-r--r--contrib/netbsd-tests/ipf/input/p28
-rw-r--r--contrib/netbsd-tests/ipf/input/p312
-rw-r--r--contrib/netbsd-tests/ipf/input/p412
-rw-r--r--contrib/netbsd-tests/ipf/input/p58
-rw-r--r--contrib/netbsd-tests/ipf/input/p62
-rw-r--r--contrib/netbsd-tests/ipf/input/p710
-rw-r--r--contrib/netbsd-tests/ipf/input/p910
-rw-r--r--contrib/netbsd-tests/ipf/regress/bpf-f14
-rw-r--r--contrib/netbsd-tests/ipf/regress/bpf14
-rw-r--r--contrib/netbsd-tests/ipf/regress/f14
-rw-r--r--contrib/netbsd-tests/ipf/regress/f1018
-rw-r--r--contrib/netbsd-tests/ipf/regress/f117
-rw-r--r--contrib/netbsd-tests/ipf/regress/f126
-rw-r--r--contrib/netbsd-tests/ipf/regress/f139
-rw-r--r--contrib/netbsd-tests/ipf/regress/f148
-rw-r--r--contrib/netbsd-tests/ipf/regress/f158
-rw-r--r--contrib/netbsd-tests/ipf/regress/f1610
-rw-r--r--contrib/netbsd-tests/ipf/regress/f174
-rw-r--r--contrib/netbsd-tests/ipf/regress/f184
-rw-r--r--contrib/netbsd-tests/ipf/regress/f192
-rw-r--r--contrib/netbsd-tests/ipf/regress/f26
-rw-r--r--contrib/netbsd-tests/ipf/regress/f204
-rw-r--r--contrib/netbsd-tests/ipf/regress/f212
-rw-r--r--contrib/netbsd-tests/ipf/regress/f222
-rw-r--r--contrib/netbsd-tests/ipf/regress/f241
-rw-r--r--contrib/netbsd-tests/ipf/regress/f251
-rw-r--r--contrib/netbsd-tests/ipf/regress/f266
-rw-r--r--contrib/netbsd-tests/ipf/regress/f276
-rw-r--r--contrib/netbsd-tests/ipf/regress/f28.ipf2
-rw-r--r--contrib/netbsd-tests/ipf/regress/f28.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/f29.ipf2
-rw-r--r--contrib/netbsd-tests/ipf/regress/f29.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/f38
-rw-r--r--contrib/netbsd-tests/ipf/regress/f304
-rw-r--r--contrib/netbsd-tests/ipf/regress/f48
-rw-r--r--contrib/netbsd-tests/ipf/regress/f548
-rw-r--r--contrib/netbsd-tests/ipf/regress/f648
-rw-r--r--contrib/netbsd-tests/ipf/regress/f79
-rw-r--r--contrib/netbsd-tests/ipf/regress/f86
-rw-r--r--contrib/netbsd-tests/ipf/regress/f918
-rw-r--r--contrib/netbsd-tests/ipf/regress/i118
-rw-r--r--contrib/netbsd-tests/ipf/regress/i105
-rw-r--r--contrib/netbsd-tests/ipf/regress/i1112
-rw-r--r--contrib/netbsd-tests/ipf/regress/i1210
-rw-r--r--contrib/netbsd-tests/ipf/regress/i138
-rw-r--r--contrib/netbsd-tests/ipf/regress/i1415
-rw-r--r--contrib/netbsd-tests/ipf/regress/i154
-rw-r--r--contrib/netbsd-tests/ipf/regress/i163
-rw-r--r--contrib/netbsd-tests/ipf/regress/i1713
-rw-r--r--contrib/netbsd-tests/ipf/regress/i183
-rw-r--r--contrib/netbsd-tests/ipf/regress/i1922
-rw-r--r--contrib/netbsd-tests/ipf/regress/i29
-rw-r--r--contrib/netbsd-tests/ipf/regress/i204
-rw-r--r--contrib/netbsd-tests/ipf/regress/i217
-rw-r--r--contrib/netbsd-tests/ipf/regress/i225
-rw-r--r--contrib/netbsd-tests/ipf/regress/i231
-rw-r--r--contrib/netbsd-tests/ipf/regress/i314
-rw-r--r--contrib/netbsd-tests/ipf/regress/i49
-rw-r--r--contrib/netbsd-tests/ipf/regress/i59
-rw-r--r--contrib/netbsd-tests/ipf/regress/i612
-rw-r--r--contrib/netbsd-tests/ipf/regress/i714
-rw-r--r--contrib/netbsd-tests/ipf/regress/i862
-rw-r--r--contrib/netbsd-tests/ipf/regress/i917
-rw-r--r--contrib/netbsd-tests/ipf/regress/in131
-rw-r--r--contrib/netbsd-tests/ipf/regress/in1003
-rw-r--r--contrib/netbsd-tests/ipf/regress/in100_63
-rw-r--r--contrib/netbsd-tests/ipf/regress/in1014
-rw-r--r--contrib/netbsd-tests/ipf/regress/in101_64
-rw-r--r--contrib/netbsd-tests/ipf/regress/in1025
-rw-r--r--contrib/netbsd-tests/ipf/regress/in102_65
-rw-r--r--contrib/netbsd-tests/ipf/regress/in1_629
-rw-r--r--contrib/netbsd-tests/ipf/regress/in271
-rw-r--r--contrib/netbsd-tests/ipf/regress/in2_671
-rw-r--r--contrib/netbsd-tests/ipf/regress/in35
-rw-r--r--contrib/netbsd-tests/ipf/regress/in3_65
-rw-r--r--contrib/netbsd-tests/ipf/regress/in45
-rw-r--r--contrib/netbsd-tests/ipf/regress/in4_65
-rw-r--r--contrib/netbsd-tests/ipf/regress/in524
-rw-r--r--contrib/netbsd-tests/ipf/regress/in5_624
-rw-r--r--contrib/netbsd-tests/ipf/regress/in68
-rw-r--r--contrib/netbsd-tests/ipf/regress/in6_68
-rw-r--r--contrib/netbsd-tests/ipf/regress/in71
-rw-r--r--contrib/netbsd-tests/ipf/regress/in8_66
-rw-r--r--contrib/netbsd-tests/ipf/regress/ip178
-rw-r--r--contrib/netbsd-tests/ipf/regress/ip22
-rw-r--r--contrib/netbsd-tests/ipf/regress/ip314
-rw-r--r--contrib/netbsd-tests/ipf/regress/ipv6.11
-rw-r--r--contrib/netbsd-tests/ipf/regress/ipv6.23
-rw-r--r--contrib/netbsd-tests/ipf/regress/ipv6.31
-rw-r--r--contrib/netbsd-tests/ipf/regress/ipv6.43
-rw-r--r--contrib/netbsd-tests/ipf/regress/ipv6.52
-rw-r--r--contrib/netbsd-tests/ipf/regress/ipv6.62
-rw-r--r--contrib/netbsd-tests/ipf/regress/l16
-rw-r--r--contrib/netbsd-tests/ipf/regress/n13
-rw-r--r--contrib/netbsd-tests/ipf/regress/n103
-rw-r--r--contrib/netbsd-tests/ipf/regress/n1001
-rw-r--r--contrib/netbsd-tests/ipf/regress/n1011
-rw-r--r--contrib/netbsd-tests/ipf/regress/n1021
-rw-r--r--contrib/netbsd-tests/ipf/regress/n1031
-rw-r--r--contrib/netbsd-tests/ipf/regress/n1041
-rw-r--r--contrib/netbsd-tests/ipf/regress/n1051
-rw-r--r--contrib/netbsd-tests/ipf/regress/n1061
-rw-r--r--contrib/netbsd-tests/ipf/regress/n10_63
-rw-r--r--contrib/netbsd-tests/ipf/regress/n113
-rw-r--r--contrib/netbsd-tests/ipf/regress/n11_63
-rw-r--r--contrib/netbsd-tests/ipf/regress/n121
-rw-r--r--contrib/netbsd-tests/ipf/regress/n12_61
-rw-r--r--contrib/netbsd-tests/ipf/regress/n131
-rw-r--r--contrib/netbsd-tests/ipf/regress/n13_61
-rw-r--r--contrib/netbsd-tests/ipf/regress/n141
-rw-r--r--contrib/netbsd-tests/ipf/regress/n14_61
-rw-r--r--contrib/netbsd-tests/ipf/regress/n152
-rw-r--r--contrib/netbsd-tests/ipf/regress/n15_62
-rw-r--r--contrib/netbsd-tests/ipf/regress/n161
-rw-r--r--contrib/netbsd-tests/ipf/regress/n16_61
-rw-r--r--contrib/netbsd-tests/ipf/regress/n171
-rw-r--r--contrib/netbsd-tests/ipf/regress/n183
-rw-r--r--contrib/netbsd-tests/ipf/regress/n1_63
-rw-r--r--contrib/netbsd-tests/ipf/regress/n24
-rw-r--r--contrib/netbsd-tests/ipf/regress/n2001
-rw-r--r--contrib/netbsd-tests/ipf/regress/n2_64
-rw-r--r--contrib/netbsd-tests/ipf/regress/n32
-rw-r--r--contrib/netbsd-tests/ipf/regress/n46
-rw-r--r--contrib/netbsd-tests/ipf/regress/n4_66
-rw-r--r--contrib/netbsd-tests/ipf/regress/n56
-rw-r--r--contrib/netbsd-tests/ipf/regress/n5_66
-rw-r--r--contrib/netbsd-tests/ipf/regress/n65
-rw-r--r--contrib/netbsd-tests/ipf/regress/n6_65
-rw-r--r--contrib/netbsd-tests/ipf/regress/n73
-rw-r--r--contrib/netbsd-tests/ipf/regress/n7_63
-rw-r--r--contrib/netbsd-tests/ipf/regress/n81
-rw-r--r--contrib/netbsd-tests/ipf/regress/n8_61
-rw-r--r--contrib/netbsd-tests/ipf/regress/n91
-rw-r--r--contrib/netbsd-tests/ipf/regress/n9_61
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni1.ipf4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni1.nat3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni10.ipf4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni10.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni11.ipf4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni11.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni12.ipf4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni12.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni13.ipf3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni13.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni14.ipf3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni14.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni15.ipf3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni15.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni16.ipf3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni16.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni17.ipf0
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni17.nat4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni18.ipf0
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni18.nat4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni19.ipf3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni19.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni2.ipf1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni2.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni20.ipf3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni20.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni21.ipf1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni21.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni23.ipf3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni23.nat2
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni3.ipf4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni3.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni4.ipf4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni4.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni5.ipf3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni5.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni6.ipf9
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni6.nat3
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni7.ipf4
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni7.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni8.ipf1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni8.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni9.ipf1
-rw-r--r--contrib/netbsd-tests/ipf/regress/ni9.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p1.ipf1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p1.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p10.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p10.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p11.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p11.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p12.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p12.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p13.ipf1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p13.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p2.ipf2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p3.ipf6
-rw-r--r--contrib/netbsd-tests/ipf/regress/p3.pool4
-rw-r--r--contrib/netbsd-tests/ipf/regress/p4.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p4.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p5.ipf1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p5.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p6.ipf1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p6.pool1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p6.whois241
-rw-r--r--contrib/netbsd-tests/ipf/regress/p7.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p7.pool2
-rw-r--r--contrib/netbsd-tests/ipf/regress/p9.nat1
-rw-r--r--contrib/netbsd-tests/ipf/regress/p9.pool2
-rwxr-xr-xcontrib/netbsd-tests/ipf/t_bpf.sh68
-rwxr-xr-xcontrib/netbsd-tests/ipf/t_filter_exec.sh175
-rwxr-xr-xcontrib/netbsd-tests/ipf/t_filter_parse.sh135
-rwxr-xr-xcontrib/netbsd-tests/ipf/t_logging.sh80
-rwxr-xr-xcontrib/netbsd-tests/ipf/t_nat_exec.sh140
-rwxr-xr-xcontrib/netbsd-tests/ipf/t_nat_ipf_exec.sh120
-rwxr-xr-xcontrib/netbsd-tests/ipf/t_nat_parse.sh83
-rwxr-xr-xcontrib/netbsd-tests/ipf/t_pools.sh103
-rwxr-xr-xcontrib/netbsd-tests/kernel/gen_t_subr_prf134
-rw-r--r--contrib/netbsd-tests/kernel/h_ps_strings1.c74
-rw-r--r--contrib/netbsd-tests/kernel/h_ps_strings2.c69
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c98
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/read/t_file.c139
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/read/t_file2.c79
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c84
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c144
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/t_ioctl.c115
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/t_proc1.c154
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/t_proc2.c138
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/t_proc3.c99
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/t_sig.c133
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/write/t_fifo.c102
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/write/t_pipe.c147
-rw-r--r--contrib/netbsd-tests/kernel/kqueue/write/t_ttypty.c130
-rw-r--r--contrib/netbsd-tests/kernel/t_extattrctl.c28
-rw-r--r--contrib/netbsd-tests/kernel/t_extent.c385
-rw-r--r--contrib/netbsd-tests/kernel/t_filedesc.c108
-rw-r--r--contrib/netbsd-tests/kernel/t_kauth_pr_47598.c169
-rw-r--r--contrib/netbsd-tests/kernel/t_lock.c87
-rw-r--r--contrib/netbsd-tests/kernel/t_lockf.c262
-rw-r--r--contrib/netbsd-tests/kernel/t_mqueue.c137
-rwxr-xr-xcontrib/netbsd-tests/kernel/t_ps_strings.sh85
-rw-r--r--contrib/netbsd-tests/kernel/t_pty.c351
-rw-r--r--contrib/netbsd-tests/kernel/t_rnd.c95
-rw-r--r--contrib/netbsd-tests/kernel/t_sysctl.c74
-rw-r--r--contrib/netbsd-tests/kernel/t_sysv.c854
-rwxr-xr-xcontrib/netbsd-tests/kernel/t_umount.sh95
-rwxr-xr-xcontrib/netbsd-tests/kernel/t_umountstress.sh209
-rw-r--r--contrib/netbsd-tests/kernel/tty/t_pr.c186
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/alpha/h_initfini_align.S16
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/arm/h_initfini_align.S20
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/hppa/h_initfini_align.S12
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/i386/h_initfini_align.S12
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/ia64/h_initfini_align.S37
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/mips/h_initfini_align.S19
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/powerpc/h_initfini_align.S17
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/sparc/h_initfini_align.S10
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/sparc64/h_initfini_align.S11
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/vax/h_initfini_align.S17
-rw-r--r--contrib/netbsd-tests/lib/csu/arch/x86_64/h_initfini_align.S13
-rw-r--r--contrib/netbsd-tests/lib/csu/dso/h_initfini3_dso.cxx37
-rw-r--r--contrib/netbsd-tests/lib/csu/h_initfini1.cxx9
-rw-r--r--contrib/netbsd-tests/lib/csu/h_initfini3.cxx22
-rw-r--r--contrib/netbsd-tests/lib/csu/h_initfini_common.cxx37
-rwxr-xr-xcontrib/netbsd-tests/lib/csu/t_crt0.sh104
-rw-r--r--contrib/netbsd-tests/lib/libbluetooth/t_bluetooth.c87
-rw-r--r--contrib/netbsd-tests/lib/libbluetooth/t_sdp_data.c136
-rw-r--r--contrib/netbsd-tests/lib/libbluetooth/t_sdp_get.c643
-rw-r--r--contrib/netbsd-tests/lib/libbluetooth/t_sdp_match.c87
-rw-r--r--contrib/netbsd-tests/lib/libbluetooth/t_sdp_put.c875
-rw-r--r--contrib/netbsd-tests/lib/libbluetooth/t_sdp_set.c359
-rw-r--r--contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c3975
-rw-r--r--contrib/netbsd-tests/lib/libbpfjit/t_cop.c657
-rw-r--r--contrib/netbsd-tests/lib/libbpfjit/t_extmem.c483
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/aarch64/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/aarch64/return_one.S10
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/alpha/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/alpha/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/arm/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/arm/return_one.S11
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/hppa/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/hppa/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/i386/exec_prot_support.c65
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/i386/return_one.S10
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/ia64/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/m68k/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/m68k/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/mips/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/mips/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/or1k/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/or1k/return_one.S12
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/powerpc/exec_prot_support.c52
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S11
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/powerpc64/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/powerpc64/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/riscv/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S11
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/sh3/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/sh3/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/sparc/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/sparc/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/sparc64/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/sparc64/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/vax/exec_prot_support.c41
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/vax/return_one.S8
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/x86_64/exec_prot_support.c50
-rw-r--r--contrib/netbsd-tests/lib/libc/arch/x86_64/return_one.S10
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_faccessat.c185
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c197
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_fchownat.c247
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_fexecve.c94
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_fstatat.c196
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_linkat.c217
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_mkdirat.c120
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c124
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_mknodat.c150
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_o_search.c278
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_openat.c165
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c157
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_renameat.c152
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_symlinkat.c150
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c176
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_utimensat.c212
-rw-r--r--contrib/netbsd-tests/lib/libc/common/exec_prot.h61
-rw-r--r--contrib/netbsd-tests/lib/libc/db/README66
-rw-r--r--contrib/netbsd-tests/lib/libc/db/h_db.c731
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/db/t_db.sh920
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c58
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/isqemu.h63
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_fileactions.c104
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/gen/posix_spawn/h_nonexec.sh3
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_spawn.c50
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_spawnattr.c90
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c385
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c184
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c173
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_alarm.c150
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_assert.c132
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_basedirname.c200
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_closefrom.c173
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_cpuset.c114
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_dir.c165
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c136
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_fmtcheck.c117
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c167
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_fpclassify.c206
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c355
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_fpsetround.c163
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_ftok.c107
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_getcwd.c151
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_getgrent.c181
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_glob.c273
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c312
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_isnan.c67
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_nice.c193
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_pause.c114
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_raise.c190
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_randomid.c93
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_realpath.c152
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c132
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_sethostname.c132
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_siginfo.c500
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_sleep.c337
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_syslog.c56
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_time.c114
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_ttyname.c188
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_vis.c155
-rw-r--r--contrib/netbsd-tests/lib/libc/hash/data/md5test-in7
-rw-r--r--contrib/netbsd-tests/lib/libc/hash/data/md5test-out7
-rw-r--r--contrib/netbsd-tests/lib/libc/hash/data/sha1test-in2
-rw-r--r--contrib/netbsd-tests/lib/libc/hash/data/sha1test-out2
-rw-r--r--contrib/netbsd-tests/lib/libc/hash/data/sha1test2-out1
-rw-r--r--contrib/netbsd-tests/lib/libc/hash/h_hash.c167
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/hash/t_hash.sh67
-rw-r--r--contrib/netbsd-tests/lib/libc/hash/t_sha2.c243
-rw-r--r--contrib/netbsd-tests/lib/libc/inet/t_inet_network.c170
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_io.c178
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c267
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_mbsnrtowcs.c98
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c202
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c143
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_wcscspn.c58
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_wcspbrk.c62
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_wcsspn.c60
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_wcstod.c456
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_wctomb.c205
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/net/gen_ether_subr25
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/README7
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/basics_v4.exp36
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/basics_v4v6.exp42
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/h_gai.c186
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_host_v4.exp38
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_host_v4v6.exp56
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_serv_v4.exp14
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_serv_v4v6.exp16
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/scoped.exp4
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/sock_raw_v4.exp13
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/sock_raw_v4v6.exp15
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/spec_fam_v4.exp6
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/spec_fam_v4v6.exp8
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh198
-rw-r--r--contrib/netbsd-tests/lib/libc/net/getaddrinfo/unsup_fam.exp2
-rw-r--r--contrib/netbsd-tests/lib/libc/net/h_dns_server.c298
-rw-r--r--contrib/netbsd-tests/lib/libc/net/h_hostent.c195
-rw-r--r--contrib/netbsd-tests/lib/libc/net/h_nsd_recurse.c107
-rw-r--r--contrib/netbsd-tests/lib/libc/net/h_protoent.c97
-rw-r--r--contrib/netbsd-tests/lib/libc/net/h_servent.c100
-rw-r--r--contrib/netbsd-tests/lib/libc/net/hosts11
-rw-r--r--contrib/netbsd-tests/lib/libc/net/resolv.conf1
-rw-r--r--contrib/netbsd-tests/lib/libc/net/t_ether_aton.c104
-rw-r--r--contrib/netbsd-tests/lib/libc/net/t_getprotoent.c233
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/net/t_hostent.sh240
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/net/t_nsdispatch.sh51
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/net/t_protoent.sh91
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/net/t_servent.sh93
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/README33
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/anchor.in33
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/att/README8
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/att/basic.dat216
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/att/categorization.dat62
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/att/forcedassoc.dat30
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/att/leftassoc.dat16
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/att/nullsubexpr.dat73
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/att/repetition.dat140
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/att/rightassoc.dat16
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/backref.in21
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/basic.in5
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/bracket.in55
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/c_comments.in17
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/complex.in23
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/error.in30
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/meta.in21
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/nospec.in7
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/paren.in19
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/regress.in9
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/repet_bounded.in45
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/repet_multi.in21
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/repet_ordinary.in10
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/startend.in9
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/subexp.in57
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/subtle.in21
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/word_bound.in13
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/data/zero.in7
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/debug.c266
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/main.c523
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/split.c344
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/t_exhaust.c210
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/regex/t_regex.sh73
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/t_regex_att.c629
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/test_regex.h44
-rw-r--r--contrib/netbsd-tests/lib/libc/rpc/h_testbits.x21
-rw-r--r--contrib/netbsd-tests/lib/libc/rpc/t_rpc.c157
-rw-r--r--contrib/netbsd-tests/lib/libc/rpc/t_xdr.c129
-rw-r--r--contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c196
-rw-r--r--contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c218
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_fgets.c46
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_getcwd.c47
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_gets.c43
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_memcpy.c48
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_memmove.c48
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_memset.c45
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_raw.c57
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_read.c47
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_readlink.c47
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c45
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_sprintf.c43
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_stpcpy.c49
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_stpncpy.c56
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_strcat.c46
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_strcpy.c45
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_strncat.c48
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_strncpy.c47
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_vsnprintf.c57
-rw-r--r--contrib/netbsd-tests/lib/libc/ssp/h_vsprintf.c55
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/ssp/t_ssp.sh308
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_clearerr.c93
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_fflush.c171
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c1166
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_fopen.c442
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_fputc.c194
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_mktemp.c54
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_popen.c135
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_printf.c194
-rw-r--r--contrib/netbsd-tests/lib/libc/stdio/t_scanf.c81
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c178
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c127
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c239
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_abs.c154
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/stdlib/t_atexit.sh54
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_atoi.c121
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_div.c98
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_exit.c186
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c199
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_getenv_thread.c250
-rwxr-xr-xcontrib/netbsd-tests/lib/libc/stdlib/t_getopt.sh123
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c399
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_mi_vector_hash.c95
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c88
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_random.c82
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c335
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c234
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_system.c83
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_bm.c102
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_memchr.c194
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_memcpy.c150
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_memmem.c100
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_memset.c207
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_popcount.c198
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strcat.c153
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strchr.c292
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strcmp.c136
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strcpy.c124
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strcspn.c58
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strerror.c135
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_stresep.c72
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strlen.c199
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strpbrk.c62
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strrchr.c257
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strspn.c60
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_swab.c95
-rw-r--r--contrib/netbsd-tests/lib/libc/sync/all_sync_ops_linkable.c168
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_access.c210
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_chroot.c313
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c212
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_clone.c252
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_connect.c99
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_dup.c385
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_fsync.c120
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getcontext.c129
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getgroups.c171
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getitimer.c211
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getlogin.c237
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getpid.c134
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getrusage.c197
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getsid.c119
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c86
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_issetugid.c148
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_kevent.c180
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_kill.c312
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_link.c229
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_listen.c134
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_lwp_create.c247
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_lwp_ctl.c74
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_mincore.c318
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_minherit.c200
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_mkdir.c210
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_mkfifo.c276
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_mknod.c192
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_mlock.c244
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_mmap.c505
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_mprotect.c359
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msgctl.c358
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msgget.c292
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c342
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c338
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msync.c237
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c187
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_pipe.c163
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_pipe2.c188
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_poll.c392
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_posix_fadvise.c165
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_recvmmsg.c161
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_revoke.c186
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_select.c215
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c522
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_setuid.c122
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_sigaction.c154
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c103
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_sigtimedwait.c126
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_socketpair.c137
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_stat.c417
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_swapcontext.c133
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_timer_create.c207
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_truncate.c175
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_ucontext.c76
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_umask.c205
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_unlink.c158
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_write.c226
-rw-r--r--contrib/netbsd-tests/lib/libc/t_cdb.c158
-rw-r--r--contrib/netbsd-tests/lib/libc/t_convfp.c155
-rw-r--r--contrib/netbsd-tests/lib/libc/t_gdtoa.c67
-rw-r--r--contrib/netbsd-tests/lib/libc/termios/t_tcsetpgrp.c87
-rw-r--r--contrib/netbsd-tests/lib/libc/time/t_mktime.c155
-rw-r--r--contrib/netbsd-tests/lib/libc/time/t_strptime.c252
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c60
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c113
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c105
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/t_tls_static.c93
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c53
-rw-r--r--contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c56
-rw-r--r--contrib/netbsd-tests/lib/libc/ttyio/t_ptm.c174
-rw-r--r--contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c163
-rw-r--r--contrib/netbsd-tests/lib/libcrypt/t_crypt.c145
-rw-r--r--contrib/netbsd-tests/lib/libcurses/atf.terminfo44
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/addch.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/addchstr.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/addstr.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/attributes.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/background1.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/background2.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/background3.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/background4.chk6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/background5.chk3
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/bell.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/box_standout.chk5
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/chgat1.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/chgat2.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/chgat3.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear1.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear10.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear2.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear3.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear4.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear5.chk23
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear6.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear7.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear8.chk6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/clear9.chk6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/color_blank_draw.chk24
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/color_blue_back.chk24
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/color_default.chk24
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/color_red_fore.chk24
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/color_set.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/color_start.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin1.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin10.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin11.chk4
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin12.chk4
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin13.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin14.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin2.chk6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin3.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin4.chk6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin5.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin6.chk6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin7.chk6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin8.chk4
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/copywin9.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/curs_set1.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/curs_set2.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/curs_set3.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/curses_start.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/fill.chk23
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/home.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/timeout.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/wborder.chk6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/wborder_refresh.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/wgetstr.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/wgetstr_refresh.chk2
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/window.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/wprintw_refresh.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/wscrl1.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/check_files/wscrl2.chk1
-rw-r--r--contrib/netbsd-tests/lib/libcurses/director/director.c279
-rw-r--r--contrib/netbsd-tests/lib/libcurses/director/returns.h66
-rw-r--r--contrib/netbsd-tests/lib/libcurses/director/testlang_conf.l437
-rw-r--r--contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y1617
-rw-r--r--contrib/netbsd-tests/lib/libcurses/slave/command_table.h397
-rw-r--r--contrib/netbsd-tests/lib/libcurses/slave/commands.c243
-rw-r--r--contrib/netbsd-tests/lib/libcurses/slave/curses_commands.c7165
-rw-r--r--contrib/netbsd-tests/lib/libcurses/slave/curses_commands.h422
-rw-r--r--contrib/netbsd-tests/lib/libcurses/slave/slave.c177
-rw-r--r--contrib/netbsd-tests/lib/libcurses/slave/slave.h50
-rwxr-xr-xcontrib/netbsd-tests/lib/libcurses/t_curses.sh294
-rw-r--r--contrib/netbsd-tests/lib/libcurses/testframe.txt241
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/addch4
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/addchnstr5
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/addchstr4
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/addnstr5
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/addstr4
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/assume_default_colors19
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/attributes23
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/background23
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/beep5
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/box8
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/can_change_color3
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/cbreak18
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/chgat15
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/clear57
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/color_content12
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/color_set11
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/copywin81
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/curs_set7
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/fill_screen29
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/getch3
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/getstr6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/mvwin12
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/start3
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/start_color5
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/std_defines138
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/termattrs3
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/timeout21
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/wborder6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/window2
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/window_create4
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/wprintw6
-rw-r--r--contrib/netbsd-tests/lib/libcurses/tests/wscrl11
-rw-r--r--contrib/netbsd-tests/lib/libdes/t_des.c989
-rwxr-xr-xcontrib/netbsd-tests/lib/libevent/t_event.sh67
-rw-r--r--contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c168
-rw-r--r--contrib/netbsd-tests/lib/libm/t_acos.c105
-rw-r--r--contrib/netbsd-tests/lib/libm/t_asin.c296
-rw-r--r--contrib/netbsd-tests/lib/libm/t_atan.c101
-rw-r--r--contrib/netbsd-tests/lib/libm/t_cbrt.c366
-rw-r--r--contrib/netbsd-tests/lib/libm/t_ceil.c931
-rw-r--r--contrib/netbsd-tests/lib/libm/t_cos.c263
-rw-r--r--contrib/netbsd-tests/lib/libm/t_cosh.c270
-rw-r--r--contrib/netbsd-tests/lib/libm/t_erf.c299
-rw-r--r--contrib/netbsd-tests/lib/libm/t_exp.c567
-rw-r--r--contrib/netbsd-tests/lib/libm/t_fmod.c63
-rw-r--r--contrib/netbsd-tests/lib/libm/t_infinity.c119
-rw-r--r--contrib/netbsd-tests/lib/libm/t_ldexp.c481
-rw-r--r--contrib/netbsd-tests/lib/libm/t_libm.h62
-rw-r--r--contrib/netbsd-tests/lib/libm/t_log.c885
-rw-r--r--contrib/netbsd-tests/lib/libm/t_modf.c68
-rw-r--r--contrib/netbsd-tests/lib/libm/t_pow.c669
-rw-r--r--contrib/netbsd-tests/lib/libm/t_precision.c76
-rw-r--r--contrib/netbsd-tests/lib/libm/t_round.c85
-rw-r--r--contrib/netbsd-tests/lib/libm/t_scalbn.c523
-rw-r--r--contrib/netbsd-tests/lib/libm/t_sin.c263
-rw-r--r--contrib/netbsd-tests/lib/libm/t_sinh.c273
-rw-r--r--contrib/netbsd-tests/lib/libm/t_sqrt.c368
-rw-r--r--contrib/netbsd-tests/lib/libm/t_tan.c260
-rw-r--r--contrib/netbsd-tests/lib/libm/t_tanh.c207
-rw-r--r--contrib/netbsd-tests/lib/libobjc/t_threads.m136
-rw-r--r--contrib/netbsd-tests/lib/libposix/t_rename.c89
-rw-r--r--contrib/netbsd-tests/lib/libppath/personnel.plist26
-rwxr-xr-xcontrib/netbsd-tests/lib/libppath/plist_to_c20
-rw-r--r--contrib/netbsd-tests/lib/libppath/t_ppath.c1548
-rw-r--r--contrib/netbsd-tests/lib/libprop/t_basic.c203
-rw-r--r--contrib/netbsd-tests/lib/libpthread/d_mach92
-rw-r--r--contrib/netbsd-tests/lib/libpthread/dlopen/dso/h_pthread_dlopen.c86
-rw-r--r--contrib/netbsd-tests/lib/libpthread/dlopen/t_dlopen.c171
-rw-r--r--contrib/netbsd-tests/lib/libpthread/dlopen/t_dso_pthread_create.c96
-rw-r--r--contrib/netbsd-tests/lib/libpthread/dlopen/t_main_pthread_create.c106
-rw-r--r--contrib/netbsd-tests/lib/libpthread/h_atexit.c183
-rw-r--r--contrib/netbsd-tests/lib/libpthread/h_cancel.c58
-rw-r--r--contrib/netbsd-tests/lib/libpthread/h_common.h12
-rw-r--r--contrib/netbsd-tests/lib/libpthread/h_exit.c47
-rw-r--r--contrib/netbsd-tests/lib/libpthread/h_resolv.c208
-rwxr-xr-xcontrib/netbsd-tests/lib/libpthread/t_atexit.sh49
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_barrier.c110
-rwxr-xr-xcontrib/netbsd-tests/lib/libpthread/t_cancel.sh44
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_cond.c563
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_condwait.c142
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_detach.c91
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_equal.c74
-rwxr-xr-xcontrib/netbsd-tests/lib/libpthread/t_exit.sh41
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_fork.c107
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_fpu.c148
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_join.c174
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_kill.c147
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_mutex.c316
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_name.c103
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_once.c196
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_preempt.c128
-rwxr-xr-xcontrib/netbsd-tests/lib/libpthread/t_resolv.sh42
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_rwlock.c125
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_sem.c307
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_sigalarm.c107
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_siglongjmp.c109
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_sigmask.c261
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_sigsuspend.c90
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_sleep.c104
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_swapcontext.c112
-rw-r--r--contrib/netbsd-tests/lib/librt/t_sched.c256
-rw-r--r--contrib/netbsd-tests/lib/librt/t_sem.c175
-rw-r--r--contrib/netbsd-tests/lib/librumpclient/h_exec.c132
-rw-r--r--contrib/netbsd-tests/lib/librumpclient/h_execthr.c187
-rwxr-xr-xcontrib/netbsd-tests/lib/librumpclient/t_exec.sh154
-rw-r--r--contrib/netbsd-tests/lib/librumpclient/t_fd.c146
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/h_client.c138
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/h_cwd.c168
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/h_netget.c101
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/index.html5
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/netstat.expout6
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/ssh_config.in14
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/ssh_host_key15
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/ssh_host_key.pub1
-rw-r--r--contrib/netbsd-tests/lib/librumphijack/sshd_config.in39
-rwxr-xr-xcontrib/netbsd-tests/lib/librumphijack/t_asyncio.sh94
-rwxr-xr-xcontrib/netbsd-tests/lib/librumphijack/t_config.sh54
-rwxr-xr-xcontrib/netbsd-tests/lib/librumphijack/t_cwd.sh72
-rwxr-xr-xcontrib/netbsd-tests/lib/librumphijack/t_sh.sh91
-rwxr-xr-xcontrib/netbsd-tests/lib/librumphijack/t_tcpip.sh268
-rwxr-xr-xcontrib/netbsd-tests/lib/librumphijack/t_vfs.sh223
-rw-r--r--contrib/netbsd-tests/lib/libskey/t_algorithms.c121
-rwxr-xr-xcontrib/netbsd-tests/lib/libsljit/t_sljit.sh45
-rw-r--r--contrib/netbsd-tests/lib/libutil/t_efun.c135
-rw-r--r--contrib/netbsd-tests/lib/libutil/t_parsedate.c142
-rw-r--r--contrib/netbsd-tests/lib/libutil/t_pidfile.c363
-rw-r--r--contrib/netbsd-tests/lib/libutil/t_snprintb.c117
-rw-r--r--contrib/netbsd-tests/lib/libutil/t_sockaddr_snprintf.c185
-rw-r--r--contrib/netbsd-tests/lib/semaphore/pthread/t_sem_pth.c17
-rw-r--r--contrib/netbsd-tests/lib/semaphore/sem.c332
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v00
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v10
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v20
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v01
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v10
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v20
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v01
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v11
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v20
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v01
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v11
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v21
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v00
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v11
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v21
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v00
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v10
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v21
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/h_df_1_noopen.c46
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/h_dl_symver.c42
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/h_ifunc.c43
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/h_locking.c149
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c70
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/helper_dso2/h_helper_dso2.c57
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c52
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso0/h_helper_symver_dso0.c39
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/h_helper_symver_dso1.c41
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/h_helper_symver_dso1.map5
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/h_helper_symver_dso2.c59
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/h_helper_symver_dso2.map13
-rwxr-xr-xcontrib/netbsd-tests/libexec/ld.elf_so/t_df_1_noopen.sh63
-rwxr-xr-xcontrib/netbsd-tests/libexec/ld.elf_so/t_dl_symver.sh55
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/t_dlerror-cleared.c67
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/t_dlerror-false.c79
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/t_dlinfo.c120
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/t_dlvsym.c203
-rw-r--r--contrib/netbsd-tests/libexec/ld.elf_so/t_ifunc.c92
-rw-r--r--contrib/netbsd-tests/modules/k_helper/k_helper.c202
-rw-r--r--contrib/netbsd-tests/modules/k_helper2/k_helper2.c115
-rw-r--r--contrib/netbsd-tests/modules/k_helper3/k_helper3.c102
-rw-r--r--contrib/netbsd-tests/modules/k_uvm/k_uvm.c113
-rwxr-xr-xcontrib/netbsd-tests/modules/t_abi_uvm.sh70
-rw-r--r--contrib/netbsd-tests/modules/t_builtin.c194
-rw-r--r--contrib/netbsd-tests/modules/t_modctl.c493
-rwxr-xr-xcontrib/netbsd-tests/modules/t_modload.sh205
-rw-r--r--contrib/netbsd-tests/net/bpf/h_bpf.h171
-rw-r--r--contrib/netbsd-tests/net/bpf/t_bpf.c177
-rw-r--r--contrib/netbsd-tests/net/bpf/t_div-by-zero.c52
-rw-r--r--contrib/netbsd-tests/net/bpf/t_mbuf.c961
-rw-r--r--contrib/netbsd-tests/net/bpfilter/t_bpfilter.c400
-rw-r--r--contrib/netbsd-tests/net/bpfjit/t_bpfjit.c3979
-rw-r--r--contrib/netbsd-tests/net/bpfjit/t_cop.c757
-rw-r--r--contrib/netbsd-tests/net/bpfjit/t_extmem.c506
-rw-r--r--contrib/netbsd-tests/net/bpfjit/t_mbuf.c982
-rw-r--r--contrib/netbsd-tests/net/carp/t_basic.c221
-rw-r--r--contrib/netbsd-tests/net/config/netconfig.c231
-rw-r--r--contrib/netbsd-tests/net/fdpass/fdpass.c231
-rwxr-xr-xcontrib/netbsd-tests/net/fdpass/t_fdpass.sh99
-rw-r--r--contrib/netbsd-tests/net/icmp/t_forward.c169
-rw-r--r--contrib/netbsd-tests/net/icmp/t_ping.c438
-rwxr-xr-xcontrib/netbsd-tests/net/icmp/t_ping2.sh78
-rw-r--r--contrib/netbsd-tests/net/if/t_compat.c83
-rwxr-xr-xcontrib/netbsd-tests/net/if_bridge/t_bridge.sh312
-rw-r--r--contrib/netbsd-tests/net/if_loop/t_pr.c229
-rwxr-xr-xcontrib/netbsd-tests/net/mpls/t_ldp_regen.sh178
-rwxr-xr-xcontrib/netbsd-tests/net/mpls/t_mpls_fw.sh188
-rwxr-xr-xcontrib/netbsd-tests/net/mpls/t_rfc4182.sh165
-rw-r--r--contrib/netbsd-tests/net/net/t_pktinfo.c194
-rw-r--r--contrib/netbsd-tests/net/net/t_raw.c41
-rw-r--r--contrib/netbsd-tests/net/net/t_tcp.c220
-rw-r--r--contrib/netbsd-tests/net/net/t_udp.c110
-rw-r--r--contrib/netbsd-tests/net/net/t_unix.c328
-rwxr-xr-xcontrib/netbsd-tests/net/npf/t_npf.sh63
-rwxr-xr-xcontrib/netbsd-tests/net/route/t_change.sh65
-rw-r--r--contrib/netbsd-tests/net/sys/t_rfc6056.c152
-rw-r--r--contrib/netbsd-tests/rump/kernspace/alloc.c122
-rw-r--r--contrib/netbsd-tests/rump/kernspace/busypage.c94
-rw-r--r--contrib/netbsd-tests/rump/kernspace/kernspace.h47
-rw-r--r--contrib/netbsd-tests/rump/kernspace/lockme.c92
-rw-r--r--contrib/netbsd-tests/rump/kernspace/sendsig.c82
-rw-r--r--contrib/netbsd-tests/rump/kernspace/thread.c108
-rw-r--r--contrib/netbsd-tests/rump/kernspace/tsleep.c100
-rw-r--r--contrib/netbsd-tests/rump/modautoload/t_modautoload.c75
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/h_client/h_forkcli.c169
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/h_client/h_reconcli.c121
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/h_client/h_sigcli.c84
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/h_client/h_simplecli.c30
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/h_client/h_stresscli.c219
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c63
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_copy.c139
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_kern.c119
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_lwproc.c316
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_modcmd.c182
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_modlinkset.c73
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_signals.c127
-rwxr-xr-xcontrib/netbsd-tests/rump/rumpkern/t_sp.sh128
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_threads.c81
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_tsleep.c63
-rw-r--r--contrib/netbsd-tests/rump/rumpkern/t_vm.c91
-rwxr-xr-xcontrib/netbsd-tests/rump/rumpnet/t_shmif.sh80
-rw-r--r--contrib/netbsd-tests/rump/rumpvfs/t_basic.c81
-rw-r--r--contrib/netbsd-tests/rump/rumpvfs/t_etfs.c302
-rw-r--r--contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c92
-rwxr-xr-xcontrib/netbsd-tests/sbin/fsck_ffs/quotas_common.sh44
-rwxr-xr-xcontrib/netbsd-tests/sbin/fsck_ffs/t_check_quotas.sh73
-rwxr-xr-xcontrib/netbsd-tests/sbin/fsck_ffs/t_enable_quotas.sh105
-rwxr-xr-xcontrib/netbsd-tests/sbin/ifconfig/t_nonexistent.sh45
-rwxr-xr-xcontrib/netbsd-tests/sbin/newfs/quotas_common.sh68
-rwxr-xr-xcontrib/netbsd-tests/sbin/newfs/t_enable_quotas.sh57
-rwxr-xr-xcontrib/netbsd-tests/sbin/newfs_msdos/t_create.sh45
-rwxr-xr-xcontrib/netbsd-tests/sbin/resize_ffs/common.sh159
-rwxr-xr-xcontrib/netbsd-tests/sbin/resize_ffs/t_grow.sh221
-rwxr-xr-xcontrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh220
-rwxr-xr-xcontrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh185
-rwxr-xr-xcontrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh185
-rw-r--r--contrib/netbsd-tests/sbin/resize_ffs/testdata.md518
-rw-r--r--contrib/netbsd-tests/sbin/resize_ffs/testdata.tar.gz.base6410938
-rwxr-xr-xcontrib/netbsd-tests/sbin/route/t_missing.sh45
-rwxr-xr-xcontrib/netbsd-tests/sbin/sysctl/t_perm.sh209
-rwxr-xr-xcontrib/netbsd-tests/sbin/sysctl/t_sysctl.sh45
-rwxr-xr-xcontrib/netbsd-tests/share/examples/t_asm.sh74
-rw-r--r--contrib/netbsd-tests/share/mk/common.subr132
-rwxr-xr-xcontrib/netbsd-tests/share/mk/t_lib.sh54
-rwxr-xr-xcontrib/netbsd-tests/share/mk/t_own.sh72
-rwxr-xr-xcontrib/netbsd-tests/share/mk/t_prog.sh87
-rwxr-xr-xcontrib/netbsd-tests/share/mk/t_test.sh111
-rwxr-xr-xcontrib/netbsd-tests/sys/rc/h_args.sh64
-rwxr-xr-xcontrib/netbsd-tests/sys/rc/h_simple.sh45
-rwxr-xr-xcontrib/netbsd-tests/sys/rc/t_rc_d_cli.sh250
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_assign_NF.awk16
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_assign_NF.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_assign_NF.out9
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_big_regexp.awk3
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_big_regexp.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_big_regexp.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_end1.awk5
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_end1.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_end1.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_end2.awk5
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_end2.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_end2.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_period.awk1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_period.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_period.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_string1.awk7
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_string1.out2
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_tolower.awk5
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_tolower.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_tolower.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_toupper.awk5
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_toupper.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/awk/d_toupper.out1
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/awk/t_awk.sh378
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/basename/t_basename.sh62
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/bzip2/t_bzip2.sh52
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/cc/t_hello.sh144
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/cmp/t_cmp.sh67
-rw-r--r--contrib/netbsd-tests/usr.bin/config/d_deffs_redef10
-rw-r--r--contrib/netbsd-tests/usr.bin/config/d_loop23
-rw-r--r--contrib/netbsd-tests/usr.bin/config/d_loop216
-rw-r--r--contrib/netbsd-tests/usr.bin/config/d_no_pseudo14
-rw-r--r--contrib/netbsd-tests/usr.bin/config/d_postponed_orphan21
-rw-r--r--contrib/netbsd-tests/usr.bin/config/d_pseudo_parent13
-rw-r--r--contrib/netbsd-tests/usr.bin/config/d_shadow_instance25
-rw-r--r--contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/files.regress2
-rw-r--r--contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/std.regress1
-rw-r--r--contrib/netbsd-tests/usr.bin/config/support/conf/files26
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/config/t_config.sh91
-rw-r--r--contrib/netbsd-tests/usr.bin/cut/d_basic.out88
-rw-r--r--contrib/netbsd-tests/usr.bin/cut/d_cut.in10
-rw-r--r--contrib/netbsd-tests/usr.bin/cut/d_dflag.out88
-rw-r--r--contrib/netbsd-tests/usr.bin/cut/d_dsflag.out32
-rw-r--r--contrib/netbsd-tests/usr.bin/cut/d_latin1.in4
-rw-r--r--contrib/netbsd-tests/usr.bin/cut/d_sflag.out32
-rw-r--r--contrib/netbsd-tests/usr.bin/cut/d_utf8.in4
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/cut/t_cut.sh130
-rw-r--r--contrib/netbsd-tests/usr.bin/diff/d_mallocv1.in5
-rw-r--r--contrib/netbsd-tests/usr.bin/diff/d_mallocv2.in5
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/diff/t_diff.sh75
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/dirname/t_dirname.sh49
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/find/t_find.sh73
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_basic.out20
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_begin_end_a.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_begin_end_b.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_binary.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context2_a.outbin0 -> 47 bytes
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context2_b.outbin0 -> 52 bytes
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context2_c.outbin0 -> 76 bytes
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context_a.in10
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context_a.out5
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context_b.in3
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context_b.out4
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context_c.out5
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_context_d.out13
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_egrep.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_file_exp.in2
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_file_exp.out6
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_ignore_case.out2
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_input12
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_invert.in10
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_invert.out5
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_recurse.out2
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_recurse_symlink.err1
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_recurse_symlink.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_whole_line.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_word_regexps.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/grep/d_zgrep.out2
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/grep/t_grep.sh246
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/gzip/t_gzip.sh110
-rw-r--r--contrib/netbsd-tests/usr.bin/id/pwgr.c187
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/id/t_groups.sh71
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/id/t_id.sh305
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/id/t_whoami.sh75
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/infocmp/t_terminfo.sh62
-rw-r--r--contrib/netbsd-tests/usr.bin/jot/d_basic.out21
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/jot/t_jot.sh56
-rw-r--r--contrib/netbsd-tests/usr.bin/m4/d_ff_after_dnl.m4.uue9
-rw-r--r--contrib/netbsd-tests/usr.bin/m4/d_ff_after_dnl.out2
-rw-r--r--contrib/netbsd-tests/usr.bin/m4/d_m4wrap-P.m45
-rw-r--r--contrib/netbsd-tests/usr.bin/m4/d_m4wrap-P.out2
-rw-r--r--contrib/netbsd-tests/usr.bin/m4/d_m4wrap.m45
-rw-r--r--contrib/netbsd-tests/usr.bin/m4/d_m4wrap.out2
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/m4/t_m4.sh50
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/make/t_make.sh74
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/mkdep/t_mkdep.sh83
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/nbperf/h_nbperf.sh32
-rw-r--r--contrib/netbsd-tests/usr.bin/nbperf/hash_driver.c53
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/nbperf/t_nbperf.sh110
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh8907
-rw-r--r--contrib/netbsd-tests/usr.bin/pr/d_basic.in2
-rw-r--r--contrib/netbsd-tests/usr.bin/pr/d_basic.out1
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/pr/t_basic.sh46
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/rump_server/t_disk.sh130
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_dot.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_flags_l.out102
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_flags_s.out79
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_flags_w.out102
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_iflags_a1.out100
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_iflags_a2.out96
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_iflags_b1.out69
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_iflags_b2.out65
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_iflags_c1.out99
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_iflags_c2.out94
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_iflags_d1.out69
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_iflags_d2.out65
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_input172
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_input269
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_oneline.in1
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_oneline_a.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_oneline_b.out1
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_same.out72
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_short.out15
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_tabends.in17
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_tabends_a.out17
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_tabends_b.out17
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_tabends_c.out17
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_tabs.out102
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_tabs1.in72
-rw-r--r--contrib/netbsd-tests/usr.bin/sdiff/d_tabs2.in69
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/sdiff/t_sdiff.sh206
-rw-r--r--contrib/netbsd-tests/usr.bin/sed/d_c2048.in1
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/sed/t_sed.sh127
-rw-r--r--contrib/netbsd-tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue104
-rw-r--r--contrib/netbsd-tests/usr.bin/shmif_dumpbus/d_pkthdrs.out.bz2.uue297
-rw-r--r--contrib/netbsd-tests/usr.bin/shmif_dumpbus/shmbus.bz2.uue620
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/shmif_dumpbus/t_basic.sh86
-rw-r--r--contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt1
-rw-r--r--contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt1
-rw-r--r--contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt1
-rw-r--r--contrib/netbsd-tests/usr.bin/sort/d_any_char_in.txtbin0 -> 1530 bytes
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/sort/t_sort.sh1023
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/tmux/t_tmux.sh49
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/tr/t_basic.sh195
-rw-r--r--contrib/netbsd-tests/usr.bin/unifdef/d_basic.in25
-rw-r--r--contrib/netbsd-tests/usr.bin/unifdef/d_basic.out6
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/unifdef/t_basic.sh62
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/vmstat/t_vmstat.sh48
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_alignof.c6
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_complex_num.c7
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_complex_split.c8
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c5
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c6
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c5
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_for_loops.c15
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_func.c7
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_recursive_init.c13
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_struct_init.c10
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init1.c8
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init2.c8
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init3.c8
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c9x_array_init.c6
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_c9x_recursive_init.c16
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_init.c27
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_init2.c7
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_lhs.c7
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals1.c11
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals2.c18
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_constant_conv1.c9
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_constant_conv2.c9
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_cvt_constant.c8
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_cvt_in_ternary.c13
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c11
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c7
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements2.c14
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements3.c10
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_extension.c6
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_func.c7
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_variable_array_init.c7
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_incorrect_array_size.c3
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_long_double_int.c7
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_nested_structs.c21
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_nolimit_init.c4
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c35
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_shift_to_narrower_type.c24
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv1.c11
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv2.c11
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv3.c10
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_typename_as_var.c14
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c3
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/xlint/lint1/t_integration.sh132
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/d_convert.in40
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/d_convert_C.out14
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/d_convert_C_S.out14
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/d_convert_D.out14
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/d_convert_D_S.out14
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/d_merge.in27
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/d_merge_C_M.out13
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/d_merge_C_M_S.out13
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/mtree_d_create.out55
-rw-r--r--contrib/netbsd-tests/usr.sbin/mtree/netbsd6_d_create.out55
-rwxr-xr-xcontrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh422
-rwxr-xr-xcontrib/netbsd-tests/usr.sbin/tcpdump/t_tcpdump.sh59
-rwxr-xr-xcontrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh128
-rwxr-xr-xcontrib/netbsd-tests/usr.sbin/useradd/t_useradd.sh50
-rw-r--r--contrib/tcpdump/tcpdump.c7
-rw-r--r--etc/devd/usb.conf128
-rw-r--r--etc/mtree/BSD.tests.dist2
-rw-r--r--etc/rc.subr43
-rw-r--r--games/factor/factor.63
-rw-r--r--games/factor/factor.c3
-rw-r--r--games/primes/primes.c21
-rw-r--r--games/primes/primes.h4
-rw-r--r--gnu/lib/csu/Makefile2
-rw-r--r--gnu/lib/libgcc/Makefile10
-rw-r--r--gnu/lib/libgcov/Makefile2
-rw-r--r--gnu/lib/libstdc++/Makefile5
-rw-r--r--gnu/lib/libsupc++/Makefile5
-rw-r--r--gnu/usr.bin/cc/Makefile.inc2
-rw-r--r--gnu/usr.bin/cc/cc_tools/Makefile4
-rw-r--r--lib/clang/clang.build.mk7
-rw-r--r--lib/libc/arm/Makefile.inc7
-rw-r--r--lib/libc/arm/Symbol_oabi.map16
-rw-r--r--lib/libc/arm/aeabi/Makefile.inc2
-rw-r--r--lib/libc/arm/gen/Makefile.inc4
-rw-r--r--lib/libc/powerpc/gen/_ctx_start.S1
-rw-r--r--lib/libc/powerpc/gen/_setjmp.S2
-rw-r--r--lib/libc/powerpc/gen/eabi.S1
-rw-r--r--lib/libc/powerpc/gen/fabs.S1
-rw-r--r--lib/libc/powerpc/gen/setjmp.S2
-rw-r--r--lib/libc/powerpc/gen/sigsetjmp.S2
-rw-r--r--lib/libc/powerpc/sys/brk.S1
-rw-r--r--lib/libc/powerpc/sys/exect.S1
-rw-r--r--lib/libc/powerpc/sys/pipe.S1
-rw-r--r--lib/libc/powerpc/sys/ptrace.S1
-rw-r--r--lib/libc/powerpc/sys/sbrk.S1
-rw-r--r--lib/libc/powerpc64/gen/_ctx_start.S1
-rw-r--r--lib/libc/powerpc64/gen/_setjmp.S2
-rw-r--r--lib/libc/powerpc64/gen/fabs.S1
-rw-r--r--lib/libc/powerpc64/gen/setjmp.S2
-rw-r--r--lib/libc/powerpc64/gen/sigsetjmp.S2
-rw-r--r--lib/libc/powerpc64/sys/brk.S1
-rw-r--r--lib/libc/powerpc64/sys/exect.S1
-rw-r--r--lib/libc/powerpc64/sys/pipe.S1
-rw-r--r--lib/libc/powerpc64/sys/ptrace.S1
-rw-r--r--lib/libc/powerpc64/sys/sbrk.S1
-rw-r--r--lib/libc/quad/Makefile.inc2
-rw-r--r--lib/libc/stdtime/strptime.316
-rw-r--r--lib/libc/stdtime/strptime.c130
-rw-r--r--lib/libc/sys/connect.24
-rw-r--r--lib/libcompiler_rt/Makefile9
-rw-r--r--lib/libpam/modules/pam_login_access/pam_login_access.c12
-rw-r--r--lib/libstand/Makefile4
-rw-r--r--lib/msun/src/e_lgamma_r.c26
-rw-r--r--libexec/rtld-elf/Makefile2
-rw-r--r--release/Makefile61
-rwxr-xr-xrelease/amd64/mk-vmimage.sh188
-rwxr-xr-xrelease/i386/mk-vmimage.sh188
-rw-r--r--release/release.conf.sample21
-rwxr-xr-xrelease/release.sh10
-rw-r--r--rescue/rescue/Makefile1
-rw-r--r--sbin/fdisk_pc98/Makefile4
-rw-r--r--sbin/ifconfig/ifconfig.845
-rw-r--r--sbin/ifconfig/iflagg.c85
-rw-r--r--share/man/man4/icmp.46
-rw-r--r--share/man/man4/ipheth.421
-rw-r--r--share/man/man4/lagg.48
-rw-r--r--share/man/man4/sfxge.435
-rw-r--r--share/man/man4/ucom.44
-rw-r--r--share/man/man4/udplite.418
-rw-r--r--share/man/man4/urndis.48
-rw-r--r--share/man/man4/urtwn.45
-rw-r--r--share/man/man7/release.765
-rw-r--r--share/man/man9/sleepqueue.92
-rw-r--r--share/mk/bsd.dep.mk4
-rw-r--r--share/mk/bsd.endian.mk7
-rw-r--r--share/mk/bsd.port.mk14
-rw-r--r--share/mk/bsd.port.subdir.mk14
-rw-r--r--share/mk/src.opts.mk7
-rw-r--r--sys/amd64/amd64/machdep.c1
-rw-r--r--sys/amd64/vmm/intel/vmx.c72
-rw-r--r--sys/amd64/vmm/io/vatpic.c25
-rw-r--r--sys/arm/allwinner/timer.c2
-rw-r--r--sys/arm/arm/cpufunc_asm_armv7.S68
-rw-r--r--sys/arm/arm/physmem.c6
-rw-r--r--sys/arm/arm/syscall.c196
-rw-r--r--sys/arm/arm/trap.c135
-rw-r--r--sys/arm/at91/at91rm9200.c3
-rw-r--r--sys/arm/at91/at91sam9g45reg.h9
-rw-r--r--sys/arm/include/sysreg.h232
-rw-r--r--sys/boot/Makefile.pc983
-rw-r--r--sys/boot/arm/ixp425/boot2/Makefile2
-rw-r--r--sys/boot/i386/boot2/Makefile2
-rw-r--r--sys/boot/i386/libfirewire/fwohcireg.h2
-rw-r--r--sys/boot/libstand32/Makefile4
-rw-r--r--sys/boot/pc98/boot2/Makefile7
-rw-r--r--sys/boot/pc98/cdboot/cdboot.S3
-rw-r--r--sys/boot/pc98/libpc98/Makefile3
-rw-r--r--sys/boot/pc98/loader/Makefile2
-rw-r--r--sys/cam/ctl/ctl.c18
-rw-r--r--sys/cam/ctl/ctl_tpc.c17
-rw-r--r--sys/cam/scsi/scsi_xpt.c122
-rw-r--r--sys/cddl/boot/zfs/lz4.c19
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c23
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c24
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c11
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c1
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c18
-rw-r--r--sys/conf/Makefile.arm6
-rw-r--r--sys/conf/files11
-rw-r--r--sys/conf/files.amd642
-rw-r--r--sys/conf/files.arm1
-rw-r--r--sys/conf/files.i3861
-rw-r--r--sys/conf/kern.opts.mk1
-rwxr-xr-xsys/contrib/dev/acpica/acpica_prep.sh11
-rw-r--r--sys/contrib/dev/acpica/changes.txt917
-rw-r--r--sys/contrib/dev/acpica/common/acgetline.c440
-rw-r--r--sys/contrib/dev/acpica/common/adfile.c31
-rw-r--r--sys/contrib/dev/acpica/common/adisasm.c229
-rw-r--r--sys/contrib/dev/acpica/common/adwalk.c96
-rw-r--r--sys/contrib/dev/acpica/common/ahids.c240
-rw-r--r--sys/contrib/dev/acpica/common/ahpredef.c39
-rw-r--r--sys/contrib/dev/acpica/common/ahuuids.c132
-rw-r--r--sys/contrib/dev/acpica/common/cmfsize.c113
-rw-r--r--sys/contrib/dev/acpica/common/dmextern.c718
-rw-r--r--sys/contrib/dev/acpica/common/dmrestag.c3
-rw-r--r--sys/contrib/dev/acpica/common/dmtable.c151
-rw-r--r--sys/contrib/dev/acpica/common/dmtbdump.c396
-rw-r--r--sys/contrib/dev/acpica/common/dmtbinfo.c282
-rw-r--r--sys/contrib/dev/acpica/common/getopt.c16
-rw-r--r--sys/contrib/dev/acpica/compiler/aslanalyze.c51
-rw-r--r--sys/contrib/dev/acpica/compiler/aslascii.c349
-rw-r--r--sys/contrib/dev/acpica/compiler/aslbtypes.c5
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcodegen.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompile.c745
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.h190
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.l18
-rw-r--r--sys/contrib/dev/acpica/compiler/asldefine.h10
-rw-r--r--sys/contrib/dev/acpica/compiler/aslerror.c223
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfileio.c53
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfiles.c12
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfold.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/aslglobal.h50
-rw-r--r--sys/contrib/dev/acpica/compiler/aslhex.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/asllength.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/asllisting.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asllistsup.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslload.c33
-rw-r--r--sys/contrib/dev/acpica/compiler/asllookup.c59
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmain.c129
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmap.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmapenter.c346
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmapoutput.c661
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmaputils.c402
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmessages.c409
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmessages.h273
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmethod.c52
-rw-r--r--sys/contrib/dev/acpica/compiler/aslnamesp.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/asloffset.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslopcodes.c20
-rw-r--r--sys/contrib/dev/acpica/compiler/asloperands.c10
-rw-r--r--sys/contrib/dev/acpica/compiler/aslopt.c22
-rw-r--r--sys/contrib/dev/acpica/compiler/asloptions.c50
-rw-r--r--sys/contrib/dev/acpica/compiler/aslparser.y131
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpredef.c12
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprepkg.c73
-rw-r--r--sys/contrib/dev/acpica/compiler/aslresource.c181
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype1.c105
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype1i.c83
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2.c44
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2d.c54
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2e.c57
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2q.c54
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2s.c82
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2w.c54
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrules.y (renamed from sys/contrib/dev/acpica/compiler/aslcompiler.y)834
-rw-r--r--sys/contrib/dev/acpica/compiler/aslstartup.c194
-rw-r--r--sys/contrib/dev/acpica/compiler/aslstubs.c29
-rw-r--r--sys/contrib/dev/acpica/compiler/aslsupport.l20
-rw-r--r--sys/contrib/dev/acpica/compiler/aslsupport.y120
-rw-r--r--sys/contrib/dev/acpica/compiler/asltokens.y386
-rw-r--r--sys/contrib/dev/acpica/compiler/asltransform.c13
-rw-r--r--sys/contrib/dev/acpica/compiler/asltree.c28
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.h51
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.y381
-rw-r--r--sys/contrib/dev/acpica/compiler/aslutils.c109
-rw-r--r--sys/contrib/dev/acpica/compiler/asluuid.c76
-rw-r--r--sys/contrib/dev/acpica/compiler/aslwalks.c7
-rw-r--r--sys/contrib/dev/acpica/compiler/aslxref.c236
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompile.c26
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompiler.h57
-rw-r--r--sys/contrib/dev/acpica/compiler/dtexpress.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtfield.c41
-rw-r--r--sys/contrib/dev/acpica/compiler/dtio.c30
-rw-r--r--sys/contrib/dev/acpica/compiler/dtparser.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtsubtable.c8
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable.c476
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.c9
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.h196
-rw-r--r--sys/contrib/dev/acpica/compiler/dtutils.c188
-rw-r--r--sys/contrib/dev/acpica/compiler/preprocess.h4
-rw-r--r--sys/contrib/dev/acpica/compiler/prexpress.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/prmacros.c15
-rw-r--r--sys/contrib/dev/acpica/compiler/prparser.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/prparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/prscan.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/prutils.c13
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbcmds.c59
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbconvert.c3
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbdisply.c7
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbexec.c47
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbfileio.c323
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbhistry.c38
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbinput.c53
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbmethod.c209
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbnames.c23
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbstats.c5
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbtest.c1138
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbutils.c3
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbxface.c7
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmbuffer.c335
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmdeferred.c3
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmnames.c3
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmobject.c3
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmopcode.c206
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrc.c12
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcl.c43
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c93
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcs.c35
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmutils.c3
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmwalk.c45
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsargs.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dscontrol.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsfield.c6
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsinit.c63
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsmethod.c158
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsobject.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsopcode.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsutils.c18
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswexec.c5
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswload.c21
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswload2.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswscope.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswstate.c3
-rw-r--r--sys/contrib/dev/acpica/components/events/evevent.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evglock.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpe.c49
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeblk.c37
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeinit.c15
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeutil.c23
-rw-r--r--sys/contrib/dev/acpica/components/events/evhandler.c3
-rw-r--r--sys/contrib/dev/acpica/components/events/evmisc.c4
-rw-r--r--sys/contrib/dev/acpica/components/events/evregion.c61
-rw-r--r--sys/contrib/dev/acpica/components/events/evrgnini.c3
-rw-r--r--sys/contrib/dev/acpica/components/events/evsci.c4
-rw-r--r--sys/contrib/dev/acpica/components/events/evxface.c69
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfevnt.c45
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfgpe.c100
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfregn.c3
-rw-r--r--sys/contrib/dev/acpica/components/executer/exconfig.c81
-rw-r--r--sys/contrib/dev/acpica/components/executer/exconvrt.c3
-rw-r--r--sys/contrib/dev/acpica/components/executer/excreate.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exdebug.c13
-rw-r--r--sys/contrib/dev/acpica/components/executer/exdump.c227
-rw-r--r--sys/contrib/dev/acpica/components/executer/exfield.c172
-rw-r--r--sys/contrib/dev/acpica/components/executer/exfldio.c3
-rw-r--r--sys/contrib/dev/acpica/components/executer/exmisc.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exmutex.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exnames.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg1.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg2.c3
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg3.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg6.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exprep.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exregion.c3
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresnte.c6
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresolv.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresop.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstore.c170
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstoren.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstorob.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exsystem.c14
-rw-r--r--sys/contrib/dev/acpica/components/executer/exutils.c92
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwacpi.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwesleep.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwgpe.c10
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwpci.c15
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwregs.c10
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwsleep.c16
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwtimer.c4
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwvalid.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxface.c12
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxfsleep.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsaccess.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsalloc.c22
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsarguments.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsconvert.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsdump.c9
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsdumpdv.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nseval.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsinit.c8
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsload.c6
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsnames.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsobject.c22
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsparse.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nspredef.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsprepkg.c82
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsrepair.c27
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsrepair2.c40
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nssearch.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsutils.c20
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nswalk.c3
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfeval.c22
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfname.c3
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfobj.c4
-rw-r--r--sys/contrib/dev/acpica/components/parser/psargs.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psloop.c8
-rw-r--r--sys/contrib/dev/acpica/components/parser/psobject.c10
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopcode.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopinfo.c55
-rw-r--r--sys/contrib/dev/acpica/components/parser/psparse.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/psscope.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/pstree.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/psutils.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/pswalk.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/psxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsaddr.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rscalc.c10
-rw-r--r--sys/contrib/dev/acpica/components/resources/rscreate.c59
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsdump.c5
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsdumpinfo.c5
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsinfo.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsio.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsirq.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rslist.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsmemory.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsmisc.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsserial.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsutils.c5
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsxface.c4
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbdata.c855
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbfadt.c365
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbfind.c4
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbinstal.c890
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbprint.c21
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbutils.c228
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxface.c13
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxfload.c97
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxfroot.c39
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utaddress.c16
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utalloc.c143
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utbuffer.c137
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utcache.c14
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utcopy.c15
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdebug.c67
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdecode.c112
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdelete.c18
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uterror.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uteval.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utexcep.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utfileio.c361
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utglobal.c192
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uthex.c113
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utids.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utinit.c159
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utlock.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmath.c3
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmisc.c3
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmutex.c3
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utobject.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utosi.c31
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utownerid.c3
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utpredef.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utprint.c811
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utresrc.c9
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstate.c3
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstring.c83
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uttrack.c34
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utuuid.c103
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxface.c6
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxferror.c7
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxfinit.c22
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxfmutex.c2
-rw-r--r--sys/contrib/dev/acpica/include/acapps.h25
-rw-r--r--sys/contrib/dev/acpica/include/acbuffer.h2
-rw-r--r--sys/contrib/dev/acpica/include/accommon.h2
-rw-r--r--sys/contrib/dev/acpica/include/acconfig.h25
-rw-r--r--sys/contrib/dev/acpica/include/acdebug.h16
-rw-r--r--sys/contrib/dev/acpica/include/acdisasm.h88
-rw-r--r--sys/contrib/dev/acpica/include/acdispat.h17
-rw-r--r--sys/contrib/dev/acpica/include/acevents.h12
-rw-r--r--sys/contrib/dev/acpica/include/acexcep.h2
-rw-r--r--sys/contrib/dev/acpica/include/acglobal.h424
-rw-r--r--sys/contrib/dev/acpica/include/achware.h2
-rw-r--r--sys/contrib/dev/acpica/include/acinterp.h14
-rw-r--r--sys/contrib/dev/acpica/include/aclocal.h49
-rw-r--r--sys/contrib/dev/acpica/include/acmacros.h42
-rw-r--r--sys/contrib/dev/acpica/include/acnames.h33
-rw-r--r--sys/contrib/dev/acpica/include/acnamesp.h2
-rw-r--r--sys/contrib/dev/acpica/include/acobject.h6
-rw-r--r--sys/contrib/dev/acpica/include/acopcode.h2
-rw-r--r--sys/contrib/dev/acpica/include/acoutput.h2
-rw-r--r--sys/contrib/dev/acpica/include/acparser.h3
-rw-r--r--sys/contrib/dev/acpica/include/acpi.h3
-rw-r--r--sys/contrib/dev/acpica/include/acpiosxf.h169
-rw-r--r--sys/contrib/dev/acpica/include/acpixf.h586
-rw-r--r--sys/contrib/dev/acpica/include/acpredef.h29
-rw-r--r--sys/contrib/dev/acpica/include/acresrc.h7
-rw-r--r--sys/contrib/dev/acpica/include/acrestyp.h2
-rw-r--r--sys/contrib/dev/acpica/include/acstruct.h5
-rw-r--r--sys/contrib/dev/acpica/include/actables.h97
-rw-r--r--sys/contrib/dev/acpica/include/actbl.h28
-rw-r--r--sys/contrib/dev/acpica/include/actbl1.h113
-rw-r--r--sys/contrib/dev/acpica/include/actbl2.h119
-rw-r--r--sys/contrib/dev/acpica/include/actbl3.h154
-rw-r--r--sys/contrib/dev/acpica/include/actypes.h126
-rw-r--r--sys/contrib/dev/acpica/include/acutils.h142
-rw-r--r--sys/contrib/dev/acpica/include/amlcode.h2
-rw-r--r--sys/contrib/dev/acpica/include/amlresrc.h56
-rw-r--r--sys/contrib/dev/acpica/include/platform/acenv.h73
-rw-r--r--sys/contrib/dev/acpica/include/platform/acenvex.h63
-rw-r--r--sys/contrib/dev/acpica/include/platform/acfreebsd.h2
-rw-r--r--sys/contrib/dev/acpica/include/platform/acgcc.h15
-rw-r--r--sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c255
-rw-r--r--sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c236
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h3
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c23
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c73
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c7
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h3
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c1
-rw-r--r--sys/dev/acpica/Osd/OsdSchedule.c11
-rw-r--r--sys/dev/acpica/Osd/OsdTable.c4
-rw-r--r--sys/dev/acpica/acpi.c18
-rw-r--r--sys/dev/acpica/acpi_pci.c2
-rw-r--r--sys/dev/ahci/ahci.c10
-rw-r--r--sys/dev/ath/ath_hal/ah.c7
-rw-r--r--sys/dev/ath/ath_hal/ah.h4
-rw-r--r--sys/dev/ath/ath_hal/ah_internal.h1
-rw-r--r--sys/dev/ath/ath_hal/ar5210/ar5210_attach.c2
-rw-r--r--sys/dev/ath/ath_hal/ar5211/ar5211_attach.c2
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_attach.c2
-rw-r--r--sys/dev/ath/ath_hal/ar5312/ar5312_attach.c2
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_attach.c2
-rw-r--r--sys/dev/ath/ath_hal/ar9001/ar9130_attach.c4
-rw-r--r--sys/dev/ath/ath_hal/ar9001/ar9160_attach.c1
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9280_attach.c1
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_attach.c1
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_attach.c1
-rw-r--r--sys/dev/ath/if_ath.c89
-rw-r--r--sys/dev/ath/if_ath_lna_div.c4
-rw-r--r--sys/dev/ath/if_ath_pci.c98
-rw-r--r--sys/dev/ath/if_ath_pci_devlist.h669
-rw-r--r--sys/dev/ath/if_athvar.h22
-rw-r--r--sys/dev/bge/if_bge.c2
-rw-r--r--sys/dev/ce/if_ce.c7
-rw-r--r--sys/dev/cp/if_cp.c2
-rw-r--r--sys/dev/ctau/if_ct.c2
-rw-r--r--sys/dev/cx/if_cx.c2
-rw-r--r--sys/dev/cxgb/cxgb_adapter.h2
-rw-r--r--sys/dev/cxgb/cxgb_main.c122
-rw-r--r--sys/dev/cxgb/cxgb_sge.c4
-rw-r--r--sys/dev/cxgbe/adapter.h7
-rw-r--r--sys/dev/cxgbe/t4_main.c137
-rw-r--r--sys/dev/dwc/if_dwc.c2
-rw-r--r--sys/dev/e1000/if_em.c8
-rw-r--r--sys/dev/e1000/if_lem.c8
-rw-r--r--sys/dev/firewire/firewire.c675
-rw-r--r--sys/dev/firewire/firewire.h20
-rw-r--r--sys/dev/firewire/firewire_phy.h2
-rw-r--r--sys/dev/firewire/firewirereg.h42
-rw-r--r--sys/dev/firewire/fwcrom.c82
-rw-r--r--sys/dev/firewire/fwdev.c138
-rw-r--r--sys/dev/firewire/fwdma.c30
-rw-r--r--sys/dev/firewire/fwdma.h16
-rw-r--r--sys/dev/firewire/fwmem.c63
-rw-r--r--sys/dev/firewire/fwohci.c524
-rw-r--r--sys/dev/firewire/fwohci_pci.c21
-rw-r--r--sys/dev/firewire/fwohcireg.h29
-rw-r--r--sys/dev/firewire/fwohcivar.h2
-rw-r--r--sys/dev/firewire/iec68113.h2
-rw-r--r--sys/dev/firewire/if_fwe.c23
-rw-r--r--sys/dev/firewire/if_fwip.c23
-rw-r--r--sys/dev/firewire/sbp.c185
-rw-r--r--sys/dev/firewire/sbp.h6
-rw-r--r--sys/dev/firewire/sbp_targ.c72
-rw-r--r--sys/dev/fxp/if_fxp.c8
-rw-r--r--sys/dev/ie/if_ie.c9
-rw-r--r--sys/dev/iscsi_initiator/isc_cam.c33
-rw-r--r--sys/dev/ixgb/if_ixgb.c51
-rw-r--r--sys/dev/ixgbe/ixgbe.c52
-rw-r--r--sys/dev/ixgbe/ixv.c10
-rwxr-xr-xsys/dev/ixl/i40e_osdep.h13
-rwxr-xr-xsys/dev/ixl/if_ixl.c44
-rw-r--r--sys/dev/ixl/if_ixlv.c5
-rw-r--r--sys/dev/ixl/ixl.h43
-rwxr-xr-xsys/dev/ixl/ixl_txrx.c45
-rw-r--r--sys/dev/ixl/ixlvc.c37
-rw-r--r--sys/dev/nfe/if_nfe.c4
-rw-r--r--sys/dev/sfxge/common/efsys.h44
-rw-r--r--sys/dev/sfxge/sfxge.c84
-rw-r--r--sys/dev/sfxge/sfxge.h52
-rw-r--r--sys/dev/sfxge/sfxge_dma.c13
-rw-r--r--sys/dev/sfxge/sfxge_ev.c52
-rw-r--r--sys/dev/sfxge/sfxge_intr.c20
-rw-r--r--sys/dev/sfxge/sfxge_port.c56
-rw-r--r--sys/dev/sfxge/sfxge_rx.c94
-rw-r--r--sys/dev/sfxge/sfxge_rx.h29
-rw-r--r--sys/dev/sfxge/sfxge_tx.c207
-rw-r--r--sys/dev/sfxge/sfxge_tx.h30
-rw-r--r--sys/dev/sound/usb/uaudio.c59
-rw-r--r--sys/dev/sound/usb/uaudioreg.h8
-rw-r--r--sys/dev/uart/uart.h1
-rw-r--r--sys/dev/uart/uart_bus_fdt.c1
-rw-r--r--sys/dev/uart/uart_dev_imx.c42
-rw-r--r--sys/dev/uart/uart_dev_msm.c568
-rw-r--r--sys/dev/uart/uart_dev_msm.h229
-rw-r--r--sys/dev/usb/controller/xhci.c21
-rw-r--r--sys/dev/usb/controller/xhci.h3
-rw-r--r--sys/dev/usb/usb_dev.c21
-rw-r--r--sys/dev/usb/usbdevs1
-rw-r--r--sys/dev/usb/wlan/if_urtwn.c1
-rw-r--r--sys/dev/vt/vt.h1
-rw-r--r--sys/dev/vt/vt_core.c251
-rw-r--r--sys/dev/xen/balloon/balloon.c90
-rw-r--r--sys/dev/xen/blkback/blkback.c117
-rw-r--r--sys/dev/xen/xenstore/xenstore.c (renamed from sys/xen/xenstore/xenstore.c)69
-rw-r--r--sys/dev/xen/xenstore/xenstore_dev.c (renamed from sys/xen/xenstore/xenstore_dev.c)69
-rw-r--r--sys/dev/xen/xenstore/xenstored_dev.c169
-rw-r--r--sys/fs/autofs/autofs.c25
-rw-r--r--sys/fs/autofs/autofs.h28
-rw-r--r--sys/fs/autofs/autofs_vfsops.c11
-rw-r--r--sys/fs/autofs/autofs_vnops.c25
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c29
-rw-r--r--sys/fs/nfs/nfs_var.h4
-rw-r--r--sys/fs/nfs/nfsproto.h6
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c13
-rw-r--r--sys/fs/nfsserver/nfs_nfsdserv.c42
-rw-r--r--sys/fs/nfsserver/nfs_nfsdstate.c29
-rw-r--r--sys/geom/geom_dev.c23
-rw-r--r--sys/i386/i386/machdep.c3
-rw-r--r--sys/kern/kern_exec.c23
-rw-r--r--sys/kern/kern_mbuf.c2
-rw-r--r--sys/kern/kern_poll.c17
-rw-r--r--sys/kern/sys_process.c2
-rw-r--r--sys/kern/tty.c12
-rw-r--r--sys/kern/vfs_subr.c9
-rw-r--r--sys/mips/atheros/ar724x_pci.c24
-rw-r--r--sys/mips/conf/TP-MR302065
-rw-r--r--sys/mips/conf/TP-MR3020.hints101
-rw-r--r--sys/modules/acpi/acpi/Makefile129
-rw-r--r--sys/modules/ncr/Makefile2
-rw-r--r--sys/modules/zfs/Makefile6
-rw-r--r--sys/net/ieee8023ad_lacp.c69
-rw-r--r--sys/net/if.c89
-rw-r--r--sys/net/if_lagg.c370
-rw-r--r--sys/net/if_lagg.h44
-rw-r--r--sys/net/if_var.h35
-rw-r--r--sys/net/if_vlan.c9
-rw-r--r--sys/net/ifq.h24
-rw-r--r--sys/net/radix.c16
-rw-r--r--sys/netinet/in_mcast.c6
-rw-r--r--sys/netinet/in_rmx.c4
-rw-r--r--sys/netinet/ip_icmp.c6
-rw-r--r--sys/netinet/ip_input.c2
-rw-r--r--sys/netinet/ip_output.c20
-rw-r--r--sys/netinet/tcp_subr.c118
-rw-r--r--sys/netinet/tcp_syncache.c46
-rw-r--r--sys/netinet/tcp_var.h6
-rw-r--r--sys/netinet/udp_usrreq.c21
-rw-r--r--sys/netinet6/in6.h2
-rw-r--r--sys/netinet6/in6_cksum.c28
-rw-r--r--sys/netinet6/in6_rmx.c4
-rw-r--r--sys/netinet6/ip6_forward.c15
-rw-r--r--sys/netinet6/ip6_output.c19
-rw-r--r--sys/netinet6/udp6_usrreq.c43
-rw-r--r--sys/netipsec/ipsec_input.c12
-rw-r--r--sys/netpfil/pf/pf_table.c12
-rw-r--r--sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c16
-rw-r--r--sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c14
-rw-r--r--sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c4
-rw-r--r--sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c10
-rw-r--r--sys/pc98/conf/GENERIC221
-rw-r--r--sys/sys/fdcio.h10
-rw-r--r--sys/sys/vnode.h4
-rw-r--r--sys/x86/include/init.h1
-rw-r--r--sys/x86/x86/local_apic.c3
-rw-r--r--sys/x86/xen/pv.c3
-rw-r--r--sys/x86/xen/xen_intr.c60
-rw-r--r--sys/x86/xen/xen_msi.c125
-rw-r--r--sys/x86/xen/xen_nexus.c45
-rw-r--r--sys/x86/xen/xen_pci.c132
-rw-r--r--sys/xen/interface/physdev.h1
-rw-r--r--sys/xen/xen_intr.h22
-rw-r--r--sys/xen/xen_msi.h39
-rw-r--r--sys/xen/xenstore/xenstore_internal.h3
-rw-r--r--tools/sched/schedgraph.py2
-rw-r--r--usr.bin/at/at.c3
-rw-r--r--usr.bin/mkimg/Makefile2
-rw-r--r--usr.bin/mkimg/image.c678
-rw-r--r--usr.bin/mkimg/mkimg.130
-rw-r--r--usr.bin/mkimg/mkimg.c115
-rw-r--r--usr.bin/mkimg/vhd.c4
-rw-r--r--usr.bin/sort/sort.c2
-rw-r--r--usr.bin/systat/ifstat.c20
-rw-r--r--usr.sbin/acpi/acpiconf/Makefile1
-rw-r--r--usr.sbin/acpi/acpidb/Makefile22
-rw-r--r--usr.sbin/acpi/acpidb/acpidb.c17
-rw-r--r--usr.sbin/acpi/acpidump/Makefile1
-rw-r--r--usr.sbin/acpi/acpidump/acpi.c4
-rw-r--r--usr.sbin/acpi/iasl/Makefile65
-rw-r--r--usr.sbin/bhyve/acpi.c5
-rw-r--r--usr.sbin/bhyvectl/bhyvectl.c2
-rw-r--r--usr.sbin/bsdinstall/distextract/distextract.c301
-rw-r--r--usr.sbin/bsdinstall/distfetch/distfetch.c72
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot2
-rw-r--r--usr.sbin/fdread/fdutil.c26
-rw-r--r--usr.sbin/pw/Makefile6
-rw-r--r--usr.sbin/pw/tests/Makefile10
-rw-r--r--usr.sbin/pw/tests/group3
-rwxr-xr-xusr.sbin/pw/tests/helper_functions.shin15
-rw-r--r--usr.sbin/pw/tests/master.passwd4
-rwxr-xr-xusr.sbin/pw/tests/pw_delete.sh24
2411 files changed, 222882 insertions, 10367 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 333c734..3b92aef 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -336,11 +336,11 @@ XFLAGS+= -B${CROSS_BINUTILS_PREFIX}
.else
XFLAGS+= -B${WORLDTMP}/usr/bin
.endif
-.if ${TARGET} == "arm" && ${MK_ARM_EABI} != "no"
-.if ${TARGET_ARCH:M*eb*} == ""
-TARGET_ABI= gnueabi
-.elif ${TARGET_ARCH} == "armv6hf"
+.if ${TARGET} == "arm"
+.if ${TARGET_ARCH:M*hf*} != ""
TARGET_ABI= gnueabihf
+.else
+TARGET_ABI= gnueabi
.endif
.endif
TARGET_ABI?= unknown
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 95b2e87..e69a31a 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -43,6 +43,9 @@ OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz
OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz
# 20140917: hv_kvpd rc.d script removed in favor of devd configuration
OLD_FILES+=etc/rc.d/hv_kvpd
+# 20140917: libnv was accidentally being installed to /usr/lib instead of /lib
+OLD_LIBS+=usr/lib/libnv.a
+OLD_LIBS+=usr/lib/libnv.so.0
# 20140814: libopie version bump
OLD_LIBS+=usr/lib/libopie.so.7
OLD_LIBS+=usr/lib32/libopie.so.7
diff --git a/bin/pkill/tests/pgrep-j_test.sh b/bin/pkill/tests/pgrep-j_test.sh
index 6656a9b..6acfb4b 100644
--- a/bin/pkill/tests/pgrep-j_test.sh
+++ b/bin/pkill/tests/pgrep-j_test.sh
@@ -1,7 +1,23 @@
#!/bin/sh
# $FreeBSD$
-base=`basename $0`
+jail_name_to_jid()
+{
+ local check_name="$1"
+ (
+ line="$(jls -n 2> /dev/null | grep name=$check_name )"
+ for nv in $line; do
+ local name="${nv%=*}"
+ if [ "${name}" = "jid" ]; then
+ eval $nv
+ echo $jid
+ break
+ fi
+ done
+ )
+}
+
+base=pgrep_j_test
echo "1..3"
@@ -9,21 +25,25 @@ name="pgrep -j <jid>"
if [ `id -u` -eq 0 ]; then
sleep=$(pwd)/sleep.txt
ln -sf /bin/sleep $sleep
- jail / $base-1 127.0.0.1 $sleep 5 &
- chpid=$!
- jail / $base-2 127.0.0.1 $sleep 5 &
- chpid2=$!
- $sleep 5 &
- chpid3=$!
- sleep 0.5
- jid=`jls | awk "/127\\.0\\.0\\.1.*${base}-1/ {print \$1}"`
- pid=`pgrep -f -j $jid $sleep`
- if [ "$pid" = "$chpid" ]; then
+ jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 &
+
+ jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 &
+
+ jid1=$(jail_name_to_jid ${base}_1_1)
+ jid2=$(jail_name_to_jid ${base}_1_2)
+ jid="${jid1},${jid2}"
+ pid1="$(pgrep -f -x -j $jid "$sleep 5" | sort)"
+ pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \
+ $(cat ${PWD}/${base}_1_2.pid) | sort)
+ if [ "$pid1" = "$pid2" ]; then
echo "ok 1 - $name"
else
echo "not ok 1 - $name"
fi
- kill $chpid $chpid2 $chpid3
+ [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid)
+ [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid)
rm -f $sleep
else
echo "ok 1 - $name # skip Test needs uid 0."
@@ -33,21 +53,23 @@ name="pgrep -j any"
if [ `id -u` -eq 0 ]; then
sleep=$(pwd)/sleep.txt
ln -sf /bin/sleep $sleep
- jail / $base-1 127.0.0.1 $sleep 5 &
- chpid=$!
- jail / $base-2 127.0.0.1 $sleep 5 &
- chpid2=$!
- $sleep 5 &
- chpid3=$!
- sleep 0.5
- pids=`pgrep -f -j any $sleep | sort`
- refpids=`{ echo $chpid; echo $chpid2; } | sort`
- if [ "$pids" = "$refpids" ]; then
+ jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 &
+
+ jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 &
+
+ sleep 2
+ pid1="$(pgrep -f -x -j any "$sleep 5" | sort)"
+ pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_2_1.pid)" \
+ $(cat ${PWD}/${base}_2_2.pid) | sort)
+ if [ "$pid1" = "$pid2" ]; then
echo "ok 2 - $name"
else
echo "not ok 2 - $name"
fi
- kill $chpid $chpid2 $chpid3
+ [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid)
+ [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid)
rm -f $sleep
else
echo "ok 2 - $name # skip Test needs uid 0."
@@ -57,19 +79,19 @@ name="pgrep -j none"
if [ `id -u` -eq 0 ]; then
sleep=$(pwd)/sleep.txt
ln -sf /bin/sleep $sleep
- $sleep 5 &
- chpid=$!
- jail / $base 127.0.0.1 $sleep 5 &
- chpid2=$!
- sleep 0.5
- pid=`pgrep -f -j none $sleep`
- if [ "$pid" = "$chpid" ]; then
+ daemon -p ${PWD}/${base}_3_1.pid $sleep 5 &
+ jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_3_2.pid $sleep 5 &
+ sleep 2
+ pid="$(pgrep -f -x -j none "$sleep 5")"
+ if [ "$pid" = "$(cat ${PWD}/${base}_3_1.pid)" ]; then
echo "ok 3 - $name"
else
echo "not ok 3 - $name"
fi
- kill $chpid $chpid2
rm -f $sleep
+ [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat $PWD/${base}_3_1.pid)
+ [ -f ${PWD}/${base}_3_2.pid ] && kill $(cat $PWD/${base}_3_2.pid)
else
echo "ok 3 - $name # skip Test needs uid 0."
fi
diff --git a/bin/pkill/tests/pkill-j_test.sh b/bin/pkill/tests/pkill-j_test.sh
index 48e7c72..a844149 100644
--- a/bin/pkill/tests/pkill-j_test.sh
+++ b/bin/pkill/tests/pkill-j_test.sh
@@ -1,7 +1,23 @@
#!/bin/sh
# $FreeBSD$
-base=`basename $0`
+jail_name_to_jid()
+{
+ local check_name="$1"
+ (
+ line="$(jls -n 2> /dev/null | grep name=$check_name )"
+ for nv in $line; do
+ local name="${nv%=*}"
+ if [ "${name}" = "jid" ]; then
+ eval $nv
+ echo $jid
+ break
+ fi
+ done
+ )
+}
+
+base=pkill_j_test
echo "1..3"
@@ -9,21 +25,28 @@ name="pkill -j <jid>"
if [ `id -u` -eq 0 ]; then
sleep=$(pwd)/sleep.txt
ln -sf /bin/sleep $sleep
- jail / $base-1 127.0.0.1 $sleep 5 &
- chpid=$!
- jail / $base-2 127.0.0.1 $sleep 5 &
- chpid2=$!
+ jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 &
+
+ jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 &
+
$sleep 5 &
- chpid3=$!
sleep 0.5
- jid=`jls | awk "/127\\.0\\.0\\.1.*${base}-1/ {print \$1}"`
- if pkill -f -j $jid $sleep && sleep 0.5 &&
- ! kill $chpid && kill $chpid2 $chpid3; then
+ jid1=$(jail_name_to_jid ${base}_1_1)
+ jid2=$(jail_name_to_jid ${base}_1_2)
+ jid="${jid1},${jid2}"
+ if pkill -f -j "$jid" $sleep && sleep 0.5 &&
+ ! -f ${PWD}/${base}_1_1.pid &&
+ ! -f ${PWD}/${base}_1_2.pid ; then
echo "ok 1 - $name"
else
echo "not ok 1 - $name"
fi 2>/dev/null
rm -f $sleep
+ [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid)
+ [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid)
+ wait
else
echo "ok 1 - $name # skip Test needs uid 0."
fi
@@ -32,20 +55,26 @@ name="pkill -j any"
if [ `id -u` -eq 0 ]; then
sleep=$(pwd)/sleep.txt
ln -sf /bin/sleep $sleep
- jail / $base-1 127.0.0.1 $sleep 5 &
- chpid=$!
- jail / $base-2 127.0.0.1 $sleep 5 &
- chpid2=$!
+ jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 &
+
+ jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 &
+
$sleep 5 &
- chpid3=$!
sleep 0.5
+ chpid3=$!
if pkill -f -j any $sleep && sleep 0.5 &&
- ! kill $chpid && ! kill $chpid2 && kill $chpid3; then
+ [ ! -f ${PWD}/${base}_2_1.pid -a
+ ! -f ${PWD}/${base}_2_2.pid ] && kill $chpid3; then
echo "ok 2 - $name"
else
echo "not ok 2 - $name"
fi 2>/dev/null
rm -f $sleep
+ [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid)
+ [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid)
+ wait
else
echo "ok 2 - $name # skip Test needs uid 0."
fi
@@ -54,18 +83,20 @@ name="pkill -j none"
if [ `id -u` -eq 0 ]; then
sleep=$(pwd)/sleep.txt
ln -sf /bin/sleep $sleep
- $sleep 5 &
- chpid=$!
- jail / $base 127.0.0.1 $sleep 5 &
- chpid2=$!
- sleep 0.5
- if pkill -f -j none $sleep && sleep 0.5 &&
- ! kill $chpid && kill $chpid2; then
+ daemon -p ${PWD}/${base}_3_1.pid $sleep 5
+ jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_3_2.pid $sleep 5 &
+ sleep 1
+ if pkill -f -j none "$sleep 5" && sleep 1 &&
+ [ ! -f ${PWD}/${base}_3_1.pid -a -f ${PWD}/${base}_3_2.pid ] ; then
echo "ok 3 - $name"
else
+ ls ${PWD}/*.pid
echo "not ok 3 - $name"
fi 2>/dev/null
rm -f $sleep
+ [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat ${base}_3_1.pid)
+ [ -f ${PWD}/${base}_3_2.pid ] && kill $(cat ${base}_3_2.pid)
else
echo "ok 3 - $name # skip Test needs uid 0."
fi
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
index 4cbb866..3a954ed 100644
--- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
+++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
@@ -710,6 +710,9 @@ list_probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *arg)
if (g_verbose && dtrace_probe_info(dtp, pdp, &p) == 0)
print_probe_info(&p);
+ if (g_intr != 0)
+ return (1);
+
return (0);
}
@@ -1220,11 +1223,34 @@ intr(int signo)
g_impatient = 1;
}
+static void
+installsighands(void)
+{
+ struct sigaction act, oact;
+
+ (void) sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ act.sa_handler = intr;
+
+ if (sigaction(SIGINT, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
+ (void) sigaction(SIGINT, &act, NULL);
+
+ if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
+ (void) sigaction(SIGTERM, &act, NULL);
+
+#if !defined(sun)
+ if (sigaction(SIGPIPE, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
+ (void) sigaction(SIGPIPE, &act, NULL);
+
+ if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
+ (void) sigaction(SIGUSR1, &act, NULL);
+#endif
+}
+
int
main(int argc, char *argv[])
{
dtrace_bufdesc_t buf;
- struct sigaction act, oact;
dtrace_status_t status[2];
dtrace_optval_t opt;
dtrace_cmd_t *dcp;
@@ -1776,6 +1802,8 @@ main(int argc, char *argv[])
if (g_ofile != NULL && (g_ofp = fopen(g_ofile, "a")) == NULL)
fatal("failed to open output file '%s'", g_ofile);
+ installsighands();
+
oprintf("%5s %10s %17s %33s %s\n",
"ID", "PROVIDER", "MODULE", "FUNCTION", "NAME");
@@ -1861,20 +1889,7 @@ main(int argc, char *argv[])
if (opt != DTRACEOPT_UNSET)
notice("allowing destructive actions\n");
- (void) sigemptyset(&act.sa_mask);
- act.sa_flags = 0;
- act.sa_handler = intr;
-
- if (sigaction(SIGINT, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
- (void) sigaction(SIGINT, &act, NULL);
-
- if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
- (void) sigaction(SIGTERM, &act, NULL);
-
-#if !defined(sun)
- if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
- (void) sigaction(SIGUSR1, &act, NULL);
-#endif
+ installsighands();
/*
* Now that tracing is active and we are ready to consume trace data,
diff --git a/contrib/binutils/gas/config/tc-arm.c b/contrib/binutils/gas/config/tc-arm.c
index 08dbb6f..1d9e27c 100644
--- a/contrib/binutils/gas/config/tc-arm.c
+++ b/contrib/binutils/gas/config/tc-arm.c
@@ -4688,6 +4688,23 @@ parse_address_main (char **str, int i, int group_relocations,
return PARSE_OPERAND_FAIL;
}
}
+ else if (skip_past_char (&p, ':') == SUCCESS)
+ {
+ /* FIXME: '@' should be used here, but it's filtered out by generic
+ code before we get to see it here. This may be subject to
+ change. */
+ expressionS exp;
+ my_get_expression (&exp, &p, GE_NO_PREFIX);
+ if (exp.X_op != O_constant)
+ {
+ inst.error = _("alignment must be constant");
+ return PARSE_OPERAND_FAIL;
+ }
+ inst.operands[i].imm = exp.X_add_number << 8;
+ inst.operands[i].immisalign = 1;
+ /* Alignments are not pre-indexes. */
+ inst.operands[i].preind = 0;
+ }
if (skip_past_char (&p, ']') == FAIL)
{
@@ -6571,6 +6588,7 @@ do_barrier (void)
if (inst.operands[0].present)
{
constraint ((inst.instruction & 0xf0) != 0x40
+ && (inst.instruction & 0xf0) != 0x50
&& inst.operands[0].imm != 0xf,
"bad barrier type");
inst.instruction |= inst.operands[0].imm;
@@ -14694,10 +14712,18 @@ static const struct asm_cond conds[] =
static struct asm_barrier_opt barrier_opt_names[] =
{
- { "sy", 0xf },
- { "un", 0x7 },
- { "st", 0xe },
- { "unst", 0x6 }
+ { "sy", 0xf },
+ { "un", 0x7 },
+ { "st", 0xe },
+ { "unst", 0x6 },
+ { "ish", 0xb },
+ { "sh", 0xb },
+ { "ishst", 0xa },
+ { "shst", 0xa },
+ { "nsh", 0x7 },
+ { "nshst", 0x6 },
+ { "osh", 0x3 },
+ { "oshst", 0x2 }
};
/* Table of ARM-format instructions. */
diff --git a/contrib/netbsd-tests/FREEBSD-upgrade b/contrib/netbsd-tests/FREEBSD-upgrade
new file mode 100644
index 0000000..edeba70
--- /dev/null
+++ b/contrib/netbsd-tests/FREEBSD-upgrade
@@ -0,0 +1,38 @@
+$FreeBSD$
+
+This document contains a collection of notes specific to the import
+of the NetBSD test suite into head. These notes are built on the instructions
+in the FreeBSD Subversion Primer that detail how to deal with vendor
+branches and you are supposed to follow those:
+
+ http://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html
+
+The NetBSD test source code was originally obtained via NetBSD anoncvs as
+described in the NetBSD handbook:
+
+ http://www.netbsd.org/docs/guide/en/chap-fetch.html#chap-fetch-cvs
+
+and is imported into the NetBSD/tests vendor branch (see
+base/vendor/NetBSD/tests/).
+
+The process used to bootstrap the vendor tree was similar to the following:
+
+ /bin/sh
+ export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"
+ cvs -z9 co -D "09/30/2014 20:45" -P src/tests
+ mv src/tests/* tests/dist/.
+
+Please adjust the checkout date spec (the argument passed via -D) to match
+the desired checkout time.
+
+To merge the vendor branch into head do something like this:
+
+ cd .../base/head/contrib/netbsd-tests
+ svn merge --accept=postpone \
+ svn+ssh://svn.freebsd.org/base/vendor/NetBSD/tests/dist .
+ find . -name Makefile\* | xargs svn rm --force
+
+and resolve any conflicts that may arise at this point.
+
+Lastly, with the list of old and new files in this import, make sure
+to update the reachover Makefiles accordingly.
diff --git a/contrib/netbsd-tests/bin/cat/d_align.in b/contrib/netbsd-tests/bin/cat/d_align.in
new file mode 100644
index 0000000..31bf4a7
--- /dev/null
+++ b/contrib/netbsd-tests/bin/cat/d_align.in
@@ -0,0 +1,3 @@
+a b c
+1 2 3
+x y z
diff --git a/contrib/netbsd-tests/bin/cat/d_align.out b/contrib/netbsd-tests/bin/cat/d_align.out
new file mode 100644
index 0000000..fd32469
--- /dev/null
+++ b/contrib/netbsd-tests/bin/cat/d_align.out
@@ -0,0 +1,3 @@
+ 1 a b c$
+ 2 1 2 3$
+ 3 x y z$
diff --git a/contrib/netbsd-tests/bin/cat/t_cat.sh b/contrib/netbsd-tests/bin/cat/t_cat.sh
new file mode 100755
index 0000000..1b7a930
--- /dev/null
+++ b/contrib/netbsd-tests/bin/cat/t_cat.sh
@@ -0,0 +1,59 @@
+# $NetBSD: t_cat.sh,v 1.2 2012/03/27 17:57:02 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case align
+align_head() {
+ atf_set "descr" "Test that cat(1) aligns the output " \
+ "right with options '-be' (PR bin/4841)"
+}
+
+align_body() {
+
+ atf_check -s ignore -o file:$(atf_get_srcdir)/d_align.out \
+ -x "cat -be $(atf_get_srcdir)/d_align.in"
+}
+
+atf_test_case nonexistent
+nonexistent_head() {
+ atf_set "descr" "Test that cat(1) doesn't return zero exit " \
+ "status for a nonexistent file (PR bin/3538)"
+}
+
+nonexistent_body() {
+
+ atf_check -s not-exit:0 -o empty -e not-empty \
+ -x "cat /some/name/that/does/not/exist"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case align
+ atf_add_test_case nonexistent
+}
diff --git a/contrib/netbsd-tests/bin/cp/t_cp.sh b/contrib/netbsd-tests/bin/cp/t_cp.sh
new file mode 100755
index 0000000..be55c7c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/cp/t_cp.sh
@@ -0,0 +1,294 @@
+# $NetBSD: t_cp.sh,v 1.1 2012/03/17 16:33:10 jruoho Exp $
+#
+# Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+FILES="file file2 file3 link dir dir2 dirlink target"
+
+cleanup() {
+ rm -fr ${FILES}
+}
+
+cp_compare() {
+ echo "Ensuring that $2 and $3 are identical"
+ cmp -s $2 $3 || atf_fail "$2 and $3 are different"
+}
+
+reset() {
+ cleanup
+ echo "I'm a file" > file
+ echo "I'm a file, 2" > file2
+ echo "I'm a file, 3" > file3
+ ln -s file link
+ mkdir dir
+ ln -s dir dirlink
+}
+
+atf_test_case file_to_file
+file_to_file_head() {
+ atf_set "descr" "Checks the copy of a file to a file"
+}
+file_to_file_body() {
+ reset
+
+ file_to_file_simple
+ file_to_file_preserve
+ file_to_file_noflags
+}
+
+file_to_file_simple() {
+ rm -f file2
+ umask 022
+ chmod 777 file
+ atf_check -s eq:0 -o empty -e empty cp file file2
+ cp_compare file_to_file_simple file file2
+ if [ `stat -f "%Lp" file2` != "755" ]; then
+ atf_fail "new file not created with umask"
+ fi
+
+ chmod 644 file
+ chmod 777 file2
+ cp_compare file_to_file_simple file file2
+ if [ `stat -f "%Lp" file2` != "777" ]; then
+ atf_fail "existing files permissions not retained"
+ fi
+}
+
+file_to_file_preserve() {
+ rm file3
+ chmod 644 file
+ chflags nodump file
+ atf_check -s eq:0 -o empty -e empty cp -p file file3
+ finfo=`stat -f "%p%u%g%m%z%f" file`
+ f3info=`stat -f "%p%u%g%m%z%f" file3`
+ if [ $finfo != $f3info ]; then
+ atf_fail "attributes not preserved"
+ fi
+}
+
+file_to_file_noflags() {
+ rm file3
+ chmod 644 file
+ chflags nodump file
+ atf_check -s eq:0 -o empty -e empty cp -p -N file file3
+ finfo=`stat -f "%f" file`
+ f3info=`stat -f "%f" file3`
+ if [ $finfo = $f3info ]; then
+ atf_fail "-p -N preserved file flags"
+ fi
+}
+
+atf_test_case file_to_link
+file_to_link_head() {
+ atf_set "descr" "Checks the copy of a file to a symbolic link"
+}
+file_to_link_body() {
+ reset
+ atf_check -s eq:0 -o empty -e empty cp file2 link
+ cp_compare file_to_link file file2
+}
+
+atf_test_case link_to_file
+link_to_file_head() {
+ atf_set "descr" "Checks the copy of a symbolic link to a file"
+}
+link_to_file_body() {
+ reset
+ # file and link are identical (not copied).
+ atf_check -s eq:1 -o empty -e ignore cp link file
+ atf_check -s eq:0 -o empty -e empty cp link file2
+ cp_compare link_to_file file file2
+}
+
+atf_test_case file_over_link
+file_over_link_head() {
+ atf_set "descr" "Checks the copy of a file to a symbolic link" \
+ "without following it"
+}
+file_over_link_body() {
+ reset
+ atf_check -s eq:0 -o empty -e empty cp -P file link
+ cp_compare file_over_link file link
+}
+
+atf_test_case link_over_file
+link_over_file_head() {
+ atf_set "descr" "Checks the copy of a symbolic link to a file" \
+ "without following the former"
+}
+link_over_file_body() {
+ reset
+ atf_check -s eq:0 -o empty -e empty cp -P link file
+ if [ `readlink link` != `readlink file` ]; then
+ atf_fail "readlink link != readlink file"
+ fi
+}
+
+atf_test_case files_to_dir
+files_to_dir_head() {
+ atf_set "descr" "Checks the copy of multiple files into a directory"
+}
+files_to_dir_body() {
+ reset
+ # can't copy multiple files to a file
+ atf_check -s eq:1 -o empty -e ignore cp file file2 file3
+ atf_check -s eq:0 -o empty -e empty cp file file2 link dir
+ cp_compare files_to_dir file "dir/file"
+}
+
+atf_test_case dir_to_file
+dir_to_file_head() {
+ atf_set "descr" "Checks the copy of a directory onto a file, which" \
+ "should not work"
+}
+dir_to_file_body() {
+ reset
+ # can't copy a dir onto a file
+ atf_check -s eq:1 -o empty -e ignore cp dir file
+ atf_check -s eq:1 -o empty -e ignore cp -R dir file
+}
+
+atf_test_case file_to_linkdir
+file_to_linkdir_head() {
+ atf_set "descr" "Checks the copy of a file to a symbolic link that" \
+ "points to a directory"
+}
+file_to_linkdir_body() {
+ reset
+ atf_check -s eq:0 -o empty -e empty cp file dirlink
+ cp_compare file_to_linkdir file "dir/file"
+
+ # overwrite the link
+ atf_check -s eq:0 -o empty -e empty cp -P file dirlink
+ atf_check -s eq:1 -o empty -e empty readlink dirlink
+ cp_compare file_to_linkdir file dirlink
+}
+
+atf_test_case linkdir_to_file
+linkdir_to_file_head() {
+ atf_set "descr" "Checks the copy of a symbolic link that points to" \
+ "a directory onto a file"
+}
+linkdir_to_file_body() {
+ reset
+ # cannot copy a dir onto a file
+ atf_check -s eq:1 -o empty -e ignore cp dirlink file
+
+ # overwrite the link
+ atf_check -s eq:0 -o empty -e empty cp -P dirlink file
+ if [ `readlink file` != `readlink dirlink` ]; then
+ atf_fail "readlink link != readlink file"
+ fi
+}
+
+dir_to_dne_no_R() {
+ atf_check -s eq:1 -o empty -e ignore cp dir dir2
+}
+
+dir_to_dne() {
+ atf_check -s eq:0 -o empty -e empty cp -R dir dir2
+ cp_compare dir_to_dne "dir/file" "dir2/file"
+ readlink dir2/link >/dev/null
+ if [ $? -gt 0 ]; then
+ atf_fail "-R didn't copy a link as a link"
+ fi
+}
+
+dir_to_dir_H() {
+ dir_to_dir_setup
+ atf_check -s eq:0 -o empty -e empty cp -R dir dir2
+
+ chmod 777 dir
+
+ # copy a dir into a dir, only command-line links are followed
+ atf_check -s eq:0 -o empty -e empty cp -R -H dirlink dir2
+ cp_compare dir_to_dir_H "dir/file" "dir2/dirlink/file"
+ readlink dir2/dirlink/link >/dev/null
+ if [ $? -gt 0 ]; then
+ atf_fail "didn't copy a link as a link"
+ fi
+
+ # Created directories have the same mode as the corresponding
+ # source directory, unmodified by the process's umask.
+ if [ `stat -f "%Lp" dir2/dirlink` != "777" ]; then
+ atf_fail "-R modified dir perms with umask"
+ fi
+}
+
+dir_to_dir_L() {
+ dir_to_dir_setup
+ atf_check -s eq:0 -o empty -e empty cp -R dir dir2
+ atf_check -s eq:0 -o empty -e empty cp -R -H dirlink dir2
+
+ # copy a dir into a dir, following all links
+ atf_check -s eq:0 -o empty -e empty cp -R -H -L dirlink dir2/dirlink
+ cp_compare dir_to_dir_L "dir/file" "dir2/dirlink/dirlink/file"
+ # fail if -R -L copied a link as a link
+ atf_check -s eq:1 -o ignore -e empty readlink dir2/dirlink/dirlink/link
+}
+
+dir_to_dir_subdir_exists() {
+ # recursively copy a dir into another dir, with some subdirs already
+ # existing
+ cleanup
+
+ mkdir -p dir/1 dir/2 dir/3 target/2
+ echo "file" > dir/2/file
+ atf_check -s eq:0 -o empty -e empty cp -R dir/* target
+ cp_compare dir_to_dir_subdir_exists "dir/2/file" "target/2/file"
+}
+
+dir_to_dir_setup() {
+ reset
+ umask 077
+ cp -P file file2 file3 link dir
+}
+
+atf_test_case dir_to_dir
+dir_to_dir_head() {
+ atf_set "descr" "Checks the copy of a directory onto another directory"
+}
+dir_to_dir_body() {
+ dir_to_dir_setup
+ dir_to_dne_no_R
+ dir_to_dne
+ dir_to_dir_H
+ dir_to_dir_L
+ dir_to_dir_subdir_exists
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case file_to_file
+ atf_add_test_case file_to_link
+ atf_add_test_case link_to_file
+ atf_add_test_case file_over_link
+ atf_add_test_case link_over_file
+ atf_add_test_case files_to_dir
+ atf_add_test_case file_to_linkdir
+ atf_add_test_case linkdir_to_file
+ atf_add_test_case dir_to_file
+ atf_add_test_case dir_to_dir
+}
diff --git a/contrib/netbsd-tests/bin/dd/t_dd.sh b/contrib/netbsd-tests/bin/dd/t_dd.sh
new file mode 100755
index 0000000..d713ad9
--- /dev/null
+++ b/contrib/netbsd-tests/bin/dd/t_dd.sh
@@ -0,0 +1,130 @@
+# $NetBSD: t_dd.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+test_dd_length() {
+ result=$1
+ cmd=$2
+ set -- x `eval $cmd | wc -c`
+ res=$2
+ if [ x"$res" != x"$result" ]; then
+ atf_fail "Expected $result bytes of output, got $res: $cmd"
+ fi
+}
+
+atf_test_case length
+length_head() {
+ # XXX The PR should be stored in a tag.
+ atf_set "descr" "Test for result messages accidentally pumped into" \
+ "the output file if the standard IO descriptors are" \
+ "closed. The last of the three following tests is" \
+ "the one expected to fail. (NetBSD PR bin/8521)"
+}
+length_body() {
+ test_dd_length 512 \
+ "dd if=/dev/zero of=/dev/fd/5 count=1 5>&1 >/dev/null 2>/dev/null"
+ test_dd_length 512 \
+ "dd if=/dev/zero of=/dev/fd/5 count=1 5>&1 >&- 2>/dev/null"
+ test_dd_length 512 \
+ "dd if=/dev/zero of=/dev/fd/5 count=1 5>&1 >&- 2>&-"
+}
+
+test_dd_io() {
+ res="`echo -n "$2" | eval $1`"
+ if [ x"$res" != x"$3" ]; then
+ atf_fail "Expected \"$3\", got \"$res\": $1"
+ fi
+}
+
+allbits1="\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"
+
+ebcdicbits1="\000\001\002\003\067\055\056\057\026\005\045\013\014\015\016\017\020\021\022\023\074\075\062\046\030\031\077\047\034\035\036\037\100\132\177\173\133\154\120\175\115\135\134\116\153\140\113\141\360\361\362\363\364\365\366\367\370\371\172\136\114\176\156\157\174\301\302\303\304\305\306\307\310\311\321\322\323\324\325\326\327\330\331\342\343\344\345\346\347\350\351\255\340\275\232\155\171\201\202\203\204\205\206\207\210\211\221\222\223\224\225\226\227\230\231\242\243\244\245\246\247\250\251\300\117\320\137\007\040\041\042\043\044\025\006\027\050\051\052\053\054\011\012\033\060\061\032\063\064\065\066\010\070\071\072\073\004\024\076\341\101\102\103\104\105\106\107\110\111\121\122\123\124\125\126\127\130\131\142\143\144\145\146\147\150\151\160\161\162\163\164\165\166\167\170\200\212\213\214\215\216\217\220\152\233\234\235\236\237\240\252\253\254\112\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\241\276\277\312\313\314\315\316\317\332\333\334\335\336\337\352\353\354\355\356\357\372\373\374\375\376\377"
+
+allvisbits=`echo -n "$allbits1" | unvis | vis`
+ebcdicvisbits=`echo -n "$ebcdicbits1" | unvis | vis`
+
+atf_test_case io
+io_head() {
+ atf_set "descr" "This checks the combination of bs= with" \
+ "conv=ebcdic. Prior to revision 1.24 of dd's" \
+ "args.c, the conv option would be ignored."
+}
+io_body() {
+ test_dd_io "unvis | dd 2>/dev/null | vis" \
+ "$allvisbits" "$allvisbits"
+ test_dd_io "unvis | dd ibs=1 2>/dev/null | vis" \
+ "$allvisbits" "$allvisbits"
+ test_dd_io "unvis | dd obs=1 2>/dev/null | vis" \
+ "$allvisbits" "$allvisbits"
+ test_dd_io "unvis | dd bs=1 2>/dev/null | vis" \
+ "$allvisbits" "$allvisbits"
+
+ test_dd_io "unvis | dd conv=ebcdic 2>/dev/null | vis" \
+ "$allvisbits" "$ebcdicvisbits"
+ test_dd_io "unvis | dd conv=ebcdic ibs=512 2>/dev/null | vis" \
+ "$allvisbits" "$ebcdicvisbits"
+ test_dd_io "unvis | dd conv=ebcdic obs=512 2>/dev/null | vis" \
+ "$allvisbits" "$ebcdicvisbits"
+ test_dd_io "unvis | dd conv=ebcdic bs=512 2>/dev/null | vis" \
+ "$allvisbits" "$ebcdicvisbits"
+
+ test_dd_io "unvis | dd conv=ebcdic 2>/dev/null | vis" \
+ "$allvisbits" "$ebcdicvisbits"
+ test_dd_io "unvis | dd conv=ebcdic ibs=1 2>/dev/null | vis" \
+ "$allvisbits" "$ebcdicvisbits"
+ test_dd_io "unvis | dd conv=ebcdic obs=1 2>/dev/null | vis" \
+ "$allvisbits" "$ebcdicvisbits"
+ test_dd_io "unvis | dd conv=ebcdic bs=1 2>/dev/null | vis" \
+ "$allvisbits" "$ebcdicvisbits"
+}
+
+atf_test_case seek
+seek_head() {
+ atf_set "descr" "Tests output file seeking"
+}
+
+seek_body() {
+ echo TEST1234 > testfile
+ atf_check -s exit:0 -e ignore \
+ dd if=/dev/zero of=testfile seek=1 bs=8k count=1
+ atf_check -s exit:0 -e ignore -o match:'^TEST1234$' dd if=testfile
+ eval $(stat -s testfile)
+ atf_check_equal $st_size $((2*8192))
+
+ echo -n TEST1234 > tf2
+ atf_check -s exit:0 -e ignore -x \
+ 'dd bs=4 if=/dev/zero count=1 | tr \\0 \\n | dd of=tf2 bs=4 seek=1'
+ atf_check -s exit:0 -e ignore -o match:'^TEST$' dd if=tf2
+ eval $(stat -s tf2)
+ atf_check_equal $st_size 8
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case length
+ atf_add_test_case io
+ atf_add_test_case seek
+}
diff --git a/contrib/netbsd-tests/bin/df/getmntinfo.c b/contrib/netbsd-tests/bin/df/getmntinfo.c
new file mode 100644
index 0000000..4ad1f40
--- /dev/null
+++ b/contrib/netbsd-tests/bin/df/getmntinfo.c
@@ -0,0 +1,218 @@
+/* $NetBSD: getmntinfo.c,v 1.1 2012/03/17 16:33:11 jruoho Exp $ */
+/*
+ * Copyright (c) 2007 The NetBSD Foundation, 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 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/ucred.h>
+#include <sys/mount.h>
+
+#include <err.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define KB * 1024
+#define MB * 1024 KB
+#define GB * 1024 MB
+
+static struct statvfs *getnewstatvfs(void);
+static void other_variants(const struct statvfs *, const int *, int,
+ const int *, int);
+static void setup_filer(void);
+static void setup_ld0g(void);
+static void setup_strpct(void);
+
+static struct statvfs *allstatvfs;
+static int sftotal, sfused;
+
+struct statvfs *
+getnewstatvfs(void)
+{
+
+ if (sftotal == sfused) {
+ sftotal = sftotal ? sftotal * 2 : 1;
+ allstatvfs = realloc(allstatvfs,
+ sftotal * sizeof(struct statvfs));
+ if (allstatvfs == NULL)
+ err(EXIT_FAILURE, "realloc");
+ }
+
+ return (&allstatvfs[sfused++]);
+}
+
+void
+other_variants(const struct statvfs *tmpl, const int *minfree, int minfreecnt,
+ const int *consumed, int consumedcnt)
+{
+ int64_t total, used;
+ struct statvfs *sf;
+ int i, j;
+
+ for (i = 0; i < minfreecnt; i++)
+ for (j = 0; j < consumedcnt; j++) {
+ sf = getnewstatvfs();
+ *sf = *tmpl;
+ total = (int64_t)(u_long)sf->f_blocks * sf->f_bsize;
+ used = total * consumed[j] / 100;
+ sf->f_bfree = (total - used) / sf->f_bsize;
+ sf->f_bavail = (total * (100 - minfree[i]) / 100 -
+ used) / (int)sf->f_bsize;
+ sf->f_bresvd = sf->f_bfree - sf->f_bavail;
+ }
+}
+
+/*
+ * Parameter taken from:
+ * http://mail-index.NetBSD.org/tech-userlevel/2004/03/24/0001.html
+ */
+void
+setup_filer(void)
+{
+ static const struct statvfs tmpl = {
+#define BSIZE 512
+#define TOTAL 1147ULL GB
+#define USED 132ULL MB
+ .f_bsize = BSIZE,
+ .f_frsize = BSIZE,
+ .f_blocks = TOTAL / BSIZE,
+ .f_bfree = (TOTAL - USED) / BSIZE,
+ .f_bavail = (TOTAL - USED) / BSIZE,
+ .f_bresvd = 0,
+ .f_mntfromname = "filer:/",
+ .f_mntonname = "/filer",
+#undef USED
+#undef TOTAL
+#undef BSIZE
+ };
+ static const int minfree[] = { 0, 5, 10, 15, };
+ static const int consumed[] = { 0, 20, 60, 95, 100 };
+
+ *getnewstatvfs() = tmpl;
+ other_variants(&tmpl, minfree, sizeof(minfree) / sizeof(minfree[0]),
+ consumed, sizeof(consumed) / sizeof(consumed[0]));
+}
+
+/*
+ * Parameter taken from:
+ * http://mail-index.NetBSD.org/current-users/2004/03/01/0038.html
+ */
+void
+setup_ld0g(void)
+{
+ static const struct statvfs tmpl = {
+#define BSIZE 4096 /* Guess */
+#define TOTAL 1308726116ULL KB
+#define USED 17901268ULL KB
+#define AVAIL 1225388540ULL KB
+ .f_bsize = BSIZE,
+ .f_frsize = BSIZE,
+ .f_blocks = TOTAL / BSIZE,
+ .f_bfree = (TOTAL - USED) / BSIZE,
+ .f_bavail = AVAIL / BSIZE,
+ .f_bresvd = (TOTAL - USED) / BSIZE - AVAIL / BSIZE,
+ .f_mntfromname = "/dev/ld0g",
+ .f_mntonname = "/anon-root",
+#undef AVAIL
+#undef USED
+#undef TOTAL
+#undef BSIZE
+ };
+ static const int minfree[] = { 0, 5, 10, 15, };
+ static const int consumed[] = { 0, 20, 60, 95, 100 };
+
+ *getnewstatvfs() = tmpl;
+ other_variants(&tmpl, minfree, sizeof(minfree) / sizeof(minfree[0]),
+ consumed, sizeof(consumed) / sizeof(consumed[0]));
+}
+
+/*
+ * Test of strpct() with huge number.
+ */
+void
+setup_strpct(void)
+{
+ static const struct statvfs tmpl = {
+#define BSIZE 4096 /* Guess */
+#define TOTAL 0x4ffffffffULL KB
+#define USED (TOTAL / 2)
+#define AVAIL (TOTAL / 2)
+ .f_bsize = BSIZE,
+ .f_frsize = BSIZE,
+ .f_blocks = TOTAL / BSIZE,
+ .f_bfree = (TOTAL - USED) / BSIZE,
+ .f_bavail = AVAIL / BSIZE,
+ .f_bresvd = (TOTAL - USED) / BSIZE - AVAIL / BSIZE,
+ .f_mntfromname = "/dev/strpct",
+ .f_mntonname = "/strpct",
+#undef AVAIL
+#undef USED
+#undef TOTAL
+#undef BSIZE
+ };
+
+ *getnewstatvfs() = tmpl;
+}
+
+/*
+ * Parameter taken from:
+ * http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=23600
+ */
+static void
+setup_pr23600(void)
+{
+ static const struct statvfs tmpl = {
+#define BSIZE 512
+#define TOTAL 20971376ULL
+#define USED 5719864ULL
+#define AVAIL 15251512ULL
+ .f_bsize = BSIZE,
+ .f_frsize = BSIZE,
+ .f_blocks = TOTAL,
+ .f_bfree = TOTAL - USED,
+ .f_bavail = AVAIL,
+ .f_bresvd = TOTAL - USED - AVAIL,
+ .f_mntfromname = "/dev/wd0e",
+ .f_mntonname = "/mount/windows/C",
+#undef AVAIL
+#undef USED
+#undef TOTAL
+#undef BSIZE
+ };
+
+ *getnewstatvfs() = tmpl;
+}
+
+int
+getmntinfo(struct statvfs **mntbuf, int flags)
+{
+
+ setup_filer();
+ setup_ld0g();
+ setup_strpct();
+ setup_pr23600();
+
+ *mntbuf = allstatvfs;
+ return (sfused);
+}
diff --git a/contrib/netbsd-tests/bin/df/t_df.sh b/contrib/netbsd-tests/bin/df/t_df.sh
new file mode 100755
index 0000000..ffb5aad
--- /dev/null
+++ b/contrib/netbsd-tests/bin/df/t_df.sh
@@ -0,0 +1,148 @@
+# $NetBSD: t_df.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case normal
+normal_head() {
+ atf_set "descr" "Checks that the output of df without flags is" \
+ "correct according to some already-known, sane" \
+ "output"
+}
+normal_body() {
+ cat >expout <<EOF
+Filesystem 1K-blocks Used Avail %Cap Mounted on
+filer:/ 1202716672 135168 1202581504 0% /filer
+filer:/ 1202716672 0 1202716672 0% /filer
+filer:/ 1202716672 240543334 962173337 20% /filer
+filer:/ 1202716672 721630003 481086668 60% /filer
+filer:/ 1202716672 1142580838 60135833 95% /filer
+filer:/ 1202716672 1202716672 0 100% /filer
+filer:/ 1202716672 0 1142580838 0% /filer
+filer:/ 1202716672 240543334 902037504 21% /filer
+filer:/ 1202716672 721630003 420950835 63% /filer
+filer:/ 1202716672 1142580838 0 100% /filer
+filer:/ 1202716672 1202716672 -60135833 105% /filer
+filer:/ 1202716672 0 1082445004 0% /filer
+filer:/ 1202716672 240543334 841901670 22% /filer
+filer:/ 1202716672 721630003 360815001 66% /filer
+filer:/ 1202716672 1142580838 -60135833 105% /filer
+filer:/ 1202716672 1202716672 -120271667 111% /filer
+filer:/ 1202716672 0 1022309171 0% /filer
+filer:/ 1202716672 240543334 781765836 23% /filer
+filer:/ 1202716672 721630003 300679168 70% /filer
+filer:/ 1202716672 1142580838 -120271667 111% /filer
+filer:/ 1202716672 1202716672 -180407500 117% /filer
+/dev/ld0g 1308726116 17901268 1225388540 1% /anon-root
+/dev/ld0g 1308726116 0 1308726116 0% /anon-root
+/dev/ld0g 1308726116 261745224 1046980892 20% /anon-root
+/dev/ld0g 1308726116 785235672 523490444 60% /anon-root
+/dev/ld0g 1308726116 1243289812 65436304 95% /anon-root
+/dev/ld0g 1308726116 1308726116 0 100% /anon-root
+/dev/ld0g 1308726116 0 1243289808 0% /anon-root
+/dev/ld0g 1308726116 261745224 981544584 21% /anon-root
+/dev/ld0g 1308726116 785235672 458054140 63% /anon-root
+/dev/ld0g 1308726116 1243289812 0 100% /anon-root
+/dev/ld0g 1308726116 1308726116 -65436304 105% /anon-root
+/dev/ld0g 1308726116 0 1177853504 0% /anon-root
+/dev/ld0g 1308726116 261745224 916108280 22% /anon-root
+/dev/ld0g 1308726116 785235672 392617832 66% /anon-root
+/dev/ld0g 1308726116 1243289812 -65436304 105% /anon-root
+/dev/ld0g 1308726116 1308726116 -130872608 111% /anon-root
+/dev/ld0g 1308726116 0 1112417196 0% /anon-root
+/dev/ld0g 1308726116 261745224 850671972 23% /anon-root
+/dev/ld0g 1308726116 785235672 327181528 70% /anon-root
+/dev/ld0g 1308726116 1243289812 -130872608 111% /anon-root
+/dev/ld0g 1308726116 1308726116 -196308916 117% /anon-root
+/dev/strpct 21474836476 10737418240 10737418236 50% /strpct
+/dev/wd0e 10485688 2859932 7625756 27% /mount/windows/C
+EOF
+ atf_check -s eq:0 -o file:expout -e empty \
+ -x "BLOCKSIZE=1k $(atf_get_srcdir)/h_df -n"
+}
+
+atf_test_case hflag
+hflag_head() {
+ atf_set "descr" "Checks that the output of df is correct according" \
+ "to some already-known, sane output when using the" \
+ "human readable format"
+}
+hflag_body() {
+ cat >expout <<EOF
+Filesystem Size Used Avail %Cap Mounted on
+filer:/ 1.1T 132M 1.1T 0% /filer
+filer:/ 1.1T 0B 1.1T 0% /filer
+filer:/ 1.1T 229G 918G 20% /filer
+filer:/ 1.1T 688G 459G 60% /filer
+filer:/ 1.1T 1.1T 57G 95% /filer
+filer:/ 1.1T 1.1T 0B 100% /filer
+filer:/ 1.1T 0B 1.1T 0% /filer
+filer:/ 1.1T 229G 860G 21% /filer
+filer:/ 1.1T 688G 401G 63% /filer
+filer:/ 1.1T 1.1T 0B 100% /filer
+filer:/ 1.1T 1.1T -57G 105% /filer
+filer:/ 1.1T 0B 1.0T 0% /filer
+filer:/ 1.1T 229G 803G 22% /filer
+filer:/ 1.1T 688G 344G 66% /filer
+filer:/ 1.1T 1.1T -57G 105% /filer
+filer:/ 1.1T 1.1T -115G 111% /filer
+filer:/ 1.1T 0B 975G 0% /filer
+filer:/ 1.1T 229G 746G 23% /filer
+filer:/ 1.1T 688G 287G 70% /filer
+filer:/ 1.1T 1.1T -115G 111% /filer
+filer:/ 1.1T 1.1T -172G 117% /filer
+/dev/ld0g 1.2T 17G 1.1T 1% /anon-root
+/dev/ld0g 1.2T 0B 1.2T 0% /anon-root
+/dev/ld0g 1.2T 250G 998G 20% /anon-root
+/dev/ld0g 1.2T 749G 499G 60% /anon-root
+/dev/ld0g 1.2T 1.2T 62G 95% /anon-root
+/dev/ld0g 1.2T 1.2T 0B 100% /anon-root
+/dev/ld0g 1.2T 0B 1.2T 0% /anon-root
+/dev/ld0g 1.2T 250G 936G 21% /anon-root
+/dev/ld0g 1.2T 749G 437G 63% /anon-root
+/dev/ld0g 1.2T 1.2T 0B 100% /anon-root
+/dev/ld0g 1.2T 1.2T -62G 105% /anon-root
+/dev/ld0g 1.2T 0B 1.1T 0% /anon-root
+/dev/ld0g 1.2T 250G 874G 22% /anon-root
+/dev/ld0g 1.2T 749G 374G 66% /anon-root
+/dev/ld0g 1.2T 1.2T -62G 105% /anon-root
+/dev/ld0g 1.2T 1.2T -125G 111% /anon-root
+/dev/ld0g 1.2T 0B 1.0T 0% /anon-root
+/dev/ld0g 1.2T 250G 811G 23% /anon-root
+/dev/ld0g 1.2T 749G 312G 70% /anon-root
+/dev/ld0g 1.2T 1.2T -125G 111% /anon-root
+/dev/ld0g 1.2T 1.2T -187G 117% /anon-root
+/dev/strpct 20T 10T 10T 50% /strpct
+/dev/wd0e 10G 2.7G 7.3G 27% /mount/windows/C
+EOF
+ atf_check -s eq:0 -o file:expout -e empty \
+ -x "BLOCKSIZE=1k $(atf_get_srcdir)/h_df -hn"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case normal
+ atf_add_test_case hflag
+}
diff --git a/contrib/netbsd-tests/bin/expr/t_expr.sh b/contrib/netbsd-tests/bin/expr/t_expr.sh
new file mode 100755
index 0000000..4f9d596
--- /dev/null
+++ b/contrib/netbsd-tests/bin/expr/t_expr.sh
@@ -0,0 +1,228 @@
+# $NetBSD: t_expr.sh,v 1.3 2012/03/27 07:23:06 jruoho Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+# The first arg will get eval'd so escape any meta characters
+# The 2nd arg is an expected string/response from expr for that op.
+test_expr() {
+ echo "Expression '${1}', expecting '${2}'"
+ res=`eval expr $1 2>&1`
+ if [ "$res" != "$2" ]; then
+ atf_fail "Expected $2, got $res from expression: " \
+ "`eval echo $1`"
+ fi
+}
+
+atf_test_case lang
+lang_ops_head() {
+ atf_set "descr" "Test that expr(1) works with non-C LANG (PR bin/2486)"
+}
+lang_body() {
+
+ export LANG=nonexistent
+ atf_check -s exit:0 -o inline:"21\n" -e empty -x "expr 10 + 11"
+
+ export LANG=ru_RU.KOI8-R
+ atf_check -s exit:0 -o inline:"21\n" -e empty -x "expr 10 + 11"
+}
+
+atf_test_case overflow
+overflow_head() {
+ atf_set "descr" "Test overflow cases"
+}
+overflow_body() {
+ test_expr '4611686018427387904 + 4611686018427387903' \
+ '9223372036854775807'
+ test_expr '4611686018427387904 + 4611686018427387904' \
+ "expr: integer overflow or underflow occurred for operation '4611686018427387904 + 4611686018427387904'"
+ test_expr '4611686018427387904 - -4611686018427387904' \
+ "expr: integer overflow or underflow occurred for operation '4611686018427387904 - -4611686018427387904'"
+ test_expr '-4611686018427387904 - 4611686018427387903' \
+ '-9223372036854775807'
+ test_expr '-4611686018427387904 - 4611686018427387905' \
+ "expr: integer overflow or underflow occurred for operation '-4611686018427387904 - 4611686018427387905'"
+ test_expr '-4611686018427387904 \* 1' '-4611686018427387904'
+ test_expr '-4611686018427387904 \* -1' '4611686018427387904'
+ test_expr '-4611686018427387904 \* 2' '-9223372036854775808'
+ test_expr '-4611686018427387904 \* 3' \
+ "expr: integer overflow or underflow occurred for operation '-4611686018427387904 * 3'"
+ test_expr '-4611686018427387904 \* -2' \
+ "expr: integer overflow or underflow occurred for operation '-4611686018427387904 * -2'"
+ test_expr '4611686018427387904 \* 1' '4611686018427387904'
+ test_expr '4611686018427387904 \* 2' \
+ "expr: integer overflow or underflow occurred for operation '4611686018427387904 * 2'"
+ test_expr '4611686018427387904 \* 3' \
+ "expr: integer overflow or underflow occurred for operation '4611686018427387904 * 3'"
+}
+
+atf_test_case gtkmm
+gtkmm_head() {
+ atf_set "descr" "Test from gtk-- configure that cause problems on old expr"
+}
+gtkmm_body() {
+ test_expr '3 \> 3 \| 3 = 3 \& 4 \> 4 \| 3 = 3 \& 4 = 4 \& 5 \>= 5' '1'
+ test_expr '3 \> 3 \| 3 = 3 \& 4 \> 4 \| 3 = 3 \& 4 = 4 \& 5 \>= 6' '0'
+ test_expr '3 \> 3 \| 3 = 3 \& 4 \> 4 \| 3 = 3 \& 4 = 3 \& 5 \>= 5' '0'
+ test_expr '3 \> 3 \| 3 = 3 \& 4 \> 4 \| 3 = 2 \& 4 = 4 \& 5 \>= 5' '0'
+ test_expr '3 \> 2 \| 3 = 3 \& 4 \> 4 \| 3 = 3 \& 4 = 4 \& 5 \>= 6' '1'
+ test_expr '3 \> 3 \| 3 = 3 \& 4 \> 3 \| 3 = 3 \& 4 = 4 \& 5 \>= 5' '1'
+}
+
+atf_test_case colon_vs_math
+colon_vs_math_head() {
+ atf_set "descr" "Basic precendence test with the : operator vs. math"
+}
+colon_vs_math_body() {
+ test_expr '2 : 4 / 2' '0'
+ test_expr '4 : 4 % 3' '1'
+}
+
+atf_test_case arithmetic_ops
+arithmetic_ops_head() {
+ atf_set "descr" "Dangling arithemtic operator"
+}
+arithmetic_ops_body() {
+ test_expr '.java_wrapper : /' '0'
+ test_expr '4 : \*' '0'
+ test_expr '4 : +' '0'
+ test_expr '4 : -' '0'
+ test_expr '4 : /' '0'
+ test_expr '4 : %' '0'
+}
+
+atf_test_case basic_math
+basic_math_head() {
+ atf_set "descr" "Basic math test"
+}
+basic_math_body() {
+ test_expr '2 + 4 \* 5' '22'
+}
+
+atf_test_case basic_functional
+basic_functional_head() {
+ atf_set "descr" "Basic functional tests"
+}
+basic_functional_body() {
+ test_expr '2' '2'
+ test_expr '-4' '-4'
+ test_expr 'hello' 'hello'
+}
+
+atf_test_case compare_ops_precedence
+compare_ops_precedence_head() {
+ atf_set "descr" "Compare operator precendence test"
+}
+compare_ops_precedence_body() {
+ test_expr '2 \> 1 \* 17' '0'
+}
+
+atf_test_case compare_ops
+compare_ops_head() {
+ atf_set "descr" "Compare operator tests"
+}
+compare_ops_body() {
+ test_expr '2 \!= 5' '1'
+ test_expr '2 \!= 2' '0'
+ test_expr '2 \<= 3' '1'
+ test_expr '2 \<= 2' '1'
+ test_expr '2 \<= 1' '0'
+ test_expr '2 \< 3' '1'
+ test_expr '2 \< 2' '0'
+ test_expr '2 = 2' '1'
+ test_expr '2 = 4' '0'
+ test_expr '2 \>= 1' '1'
+ test_expr '2 \>= 2' '1'
+ test_expr '2 \>= 3' '0'
+ test_expr '2 \> 1' '1'
+ test_expr '2 \> 2' '0'
+}
+
+atf_test_case multiply
+multiply_head() {
+ atf_set "descr" "Test the multiply operator (PR bin/12838)"
+}
+multiply_body() {
+ test_expr '1 \* -1' '-1'
+ test_expr '2 \> 1 \* 17' '0'
+}
+
+atf_test_case negative
+negative_head() {
+ atf_set "descr" "Test the additive inverse"
+}
+negative_body() {
+ test_expr '-1 + 5' '4'
+ test_expr '- 1 + 5' 'expr: syntax error'
+
+ test_expr '5 + -1' '4'
+ test_expr '5 + - 1' 'expr: syntax error'
+
+ test_expr '1 - -5' '6'
+}
+
+atf_test_case math_precedence
+math_precedence_head() {
+ atf_set "descr" "More complex math test for precedence"
+}
+math_precedence_body() {
+ test_expr '-3 + -1 \* 4 + 3 / -6' '-7'
+}
+
+atf_test_case precedence
+precedence_head() {
+ atf_set "descr" "Test precedence"
+}
+precedence_body() {
+ # This is messy but the shell escapes cause that
+ test_expr 'X1/2/3 : X\\\(.\*[^/]\\\)//\*[^/][^/]\*/\*$ \| . : \\\(.\\\)' '1/2'
+}
+
+atf_test_case regex
+regex_head() {
+ atf_set "descr" "Test proper () returning \1 from a regex"
+}
+regex_body() {
+ # This is messy but the shell escapes cause that
+ test_expr '1/2 : .\*/\\\(.\*\\\)' '2'
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case lang
+ atf_add_test_case overflow
+ atf_add_test_case gtkmm
+ atf_add_test_case colon_vs_math
+ atf_add_test_case arithmetic_ops
+ atf_add_test_case basic_math
+ atf_add_test_case basic_functional
+ atf_add_test_case compare_ops_precedence
+ atf_add_test_case compare_ops
+ atf_add_test_case multiply
+ atf_add_test_case negative
+ atf_add_test_case math_precedence
+ atf_add_test_case precedence
+ atf_add_test_case regex
+}
diff --git a/contrib/netbsd-tests/bin/pax/t_pax.sh b/contrib/netbsd-tests/bin/pax/t_pax.sh
new file mode 100755
index 0000000..63ae7f8
--- /dev/null
+++ b/contrib/netbsd-tests/bin/pax/t_pax.sh
@@ -0,0 +1,54 @@
+# $NetBSD: t_pax.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case append
+append_head() {
+ atf_set "descr" "Ensure that appending a file to an archive" \
+ "produces the same results as if the file" \
+ "had been there during the archive's creation"
+}
+append_body() {
+ touch foo bar
+
+ # store both foo and bar into file1.tar
+ atf_check -s eq:0 -o empty -e empty \
+ pax -w -b 512 -x ustar -f file1.tar foo bar
+
+ # store foo into file2.tar, then append bar to file2.tar
+ atf_check -s eq:0 -o empty -e empty \
+ pax -w -b 512 -x ustar -f file2.tar foo
+ atf_check -s eq:0 -o empty -e empty \
+ pax -w -b 512 -x ustar -f file2.tar -a bar
+
+ # ensure that file1.tar and file2.tar are equal
+ atf_check -s eq:0 -o empty -e empty cmp file1.tar file2.tar
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case append
+}
diff --git a/contrib/netbsd-tests/bin/ps/keywords b/contrib/netbsd-tests/bin/ps/keywords
new file mode 100644
index 0000000..3f05f54
--- /dev/null
+++ b/contrib/netbsd-tests/bin/ps/keywords
@@ -0,0 +1,123 @@
+# $NetBSD: keywords,v 1.2 2014/01/16 04:16:32 mlelstv Exp $
+#
+# Table of keywords for use with ps "-o" option.
+#
+# The first column (keyword) is the name of a keyword.
+#
+# The second column (header) is the default column header associated
+# with the keyword, except if the keyword is an alias, in which case the
+# second column is the name of another keyword.
+#
+# The third column (flag) may be blank, "LJUST", or "ALIAS". "ALIAS"
+# means that the keyword is an alias. "LJUST" means that the keyword
+# should be displayed in a left-justified column. The default is that
+# the keyword should be displayed in a right-justified column.
+#
+# keyword header flag
+#
+ktracep KTRACEP
+nwchan WCHAN
+p_ru P_RU
+paddr PADDR
+rlink RLINK
+%cpu %CPU
+%mem %MEM
+acflag ACFLG
+acflg acflag ALIAS
+args command ALIAS
+blocked sigmask ALIAS
+caught sigcatch ALIAS
+comm COMMAND LJUST
+command COMMAND LJUST
+cpu CPU
+cputime time ALIAS
+ctime CTIME
+egid EGID
+egroup EGROUP LJUST
+etime ELAPSED
+euid EUID
+euser EUSER LJUST
+f F
+flags f ALIAS
+gid GID
+group GROUP LJUST
+groupnames GROUPNAMES LJUST
+groups GROUPS LJUST
+holdcnt HOLDCNT
+ignored sigignore ALIAS
+inblk INBLK
+inblock inblk ALIAS
+jobc JOBC
+ktrace KTRACE
+laddr LADDR
+lid LID
+lim LIM
+login LOGIN LJUST
+logname login ALIAS
+lstart STARTED LJUST
+lstate STAT LJUST
+ltime LTIME
+majflt MAJFLT
+minflt MINFLT
+msgrcv MSGRCV
+msgsnd MSGSND
+ni nice ALIAS
+nice NI
+nivcsw NIVCSW
+nlwp NLWP
+nsignals nsigs ALIAS
+nsigs NSIGS
+nswap NSWAP
+nvcsw NVCSW
+oublk OUBLK
+oublock oublk ALIAS
+pagein PAGEIN
+pcpu %cpu ALIAS
+pending sig ALIAS
+pgid PGID
+pid PID
+pmem %mem ALIAS
+ppid PPID
+pri PRI
+re RE
+rgid RGID
+rgroup RGROUP LJUST
+rlwp RLWP
+rss RSS
+rssize rsz ALIAS
+rsz RSZ
+ruid RUID
+ruser RUSER LJUST
+sess SESS
+sid SID
+sig PENDING
+sigcatch CAUGHT
+sigignore IGNORED
+sigmask BLOCKED
+sl SL
+start STARTED
+stat state ALIAS
+state STAT LJUST
+stime STIME
+svgid SVGID
+svgroup SVGROUP LJUST
+svuid SVUID
+svuser SVUSER LJUST
+tdev TDEV
+time TIME
+tpgid TPGID
+tsess TSESS
+tsiz TSIZ
+tt TTY LJUST
+tty TTY LJUST
+uaddr UADDR
+ucomm UCOMM LJUST
+uid UID
+upr UPR
+user USER LJUST
+usrpri upr ALIAS
+utime UTIME
+vsize vsz ALIAS
+vsz VSZ
+wchan WCHAN LJUST
+xstat XSTAT
diff --git a/contrib/netbsd-tests/bin/ps/t_ps.sh b/contrib/netbsd-tests/bin/ps/t_ps.sh
new file mode 100755
index 0000000..8f8829b
--- /dev/null
+++ b/contrib/netbsd-tests/bin/ps/t_ps.sh
@@ -0,0 +1,404 @@
+# $NetBSD: t_ps.sh,v 1.2 2014/01/16 04:16:32 mlelstv Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+# the implementation of "ps" to test
+: ${TEST_PS:="ps"}
+# tab and newline characters
+tab="$(printf '\t')"
+# nl="$(printf '\n')" doesn't work
+nl='
+'
+
+#
+# Parse the "keywords" file into a load of shell variables
+#
+setup_keywords()
+{
+ # Set variables representing the header text
+ # for all normal keywords (except aliases), and
+ # for regular expressions to match the text in left- or
+ # right-justified columns.
+ # For example, head_text_p_cpu="%CPU" head_regexp_p_cpu=" *%CPU".
+ while read keyword heading flag
+ do
+ case "$keyword" in
+ ''|\#*) continue
+ ;;
+ esac
+ [ x"$flag" = x"ALIAS" ] && continue
+ kvar="${keyword}"
+ case "${keyword}" in
+ %*) kvar="p_${keyword#%}"
+ ;;
+ esac
+ eval head_text_${kvar}=\'"${heading}"\'
+ case "${flag}" in
+ '') # right justified
+ eval head_regexp_${kvar}=\'" *${heading}"\'
+ ;;
+ LJUST) # left justified
+ eval head_regexp_${kvar}=\'"${heading} *"\'
+ ;;
+ *) atf_fail "unknown flag in keywords"
+ ;;
+ esac
+ done <"$(atf_get_srcdir)/keywords"
+
+ # Now do the aliases.
+ while read keyword heading flag
+ do
+ case "$keyword" in
+ ''|\#*) continue
+ ;;
+ esac
+ [ x"$flag" != x"ALIAS" ] && continue
+ kvar="${keyword}"
+ avar="${heading}"
+ case "${keyword}" in
+ %*) kvar="p_${keyword#%}"
+ ;;
+ esac
+ case "${heading}" in
+ %*) avar="p_${heading#%}"
+ ;;
+ esac
+ eval head_text_${kvar}=\"\$head_text_${avar}\"
+ eval head_regexp_${kvar}=\"\$head_regexp_${avar}\"
+ done <"$(atf_get_srcdir)/keywords"
+
+ # default sets of keywords
+ default_keywords='pid tty stat time command'
+ j_keywords='user pid ppid pgid sess jobc state tt time command'
+ l_keywords='uid pid ppid cpu pri nice vsz rss wchan state tt time command'
+ s_keywords='uid pid ppid cpu lid nlwp pri nice vsz rss wchan lstate tt ltime command'
+ u_keywords='user pid %cpu %mem vsz rss tt state start time command'
+ v_keywords='pid state time sl re pagein vsz rss lim tsiz %cpu %mem command'
+}
+
+# Convert a list of keywords like "pid comm" to a regexp
+# like " *PID COMMAND *"
+heading_keywords_to_regexp()
+{
+ local keywords="$1"
+ local regexp
+ regexp="$(echo "$keywords" | \
+ sed -E -e 's/\%/p_/g' -e 's/(^| )/\1\$head_regexp_/g')"
+ eval regexp=\""${regexp}"\"
+ regexp="^${regexp}\$"
+ echo "$regexp"
+}
+
+#
+# Check that a string matches a regexp; use the specified id
+# in error or success messages.
+#
+check_regexp() {
+ local id="$1" string="$2" regexp="$3"
+ if ! expr "$string" : "$regexp" >/dev/null
+ then
+ atf_fail "${id}: expected [${regexp}], got [${string}]"
+ false
+ fi
+}
+
+#
+# Run "ps $args -p $$"; check that only one line is printed,
+# without a preceding header line.
+#
+check_no_heading_line()
+{
+ local args="$1"
+ local output="$(eval "${TEST_PS} $args -p $$")"
+ case "$output" in
+ *"$nl"*)
+ local firstline="${output%%${nl}*}"
+ atf_fail "check_no_heading_line [$args] got [$firstline]"
+ ;;
+ *)
+ ;;
+ esac
+}
+
+#
+# Run "ps $args"; check that the heading matches the expected regexp.
+#
+check_heading_regexp()
+{
+ args="$1"
+ regexp="$2"
+ actual="$( eval "${TEST_PS} $args" | sed -e 1q )"
+ check_regexp "heading [$args]" "${actual}" "${regexp}"
+}
+
+#
+# Run "ps $args"; check that the heading matches a regexp constructed
+# from the specified keywords.
+#
+check_heading_keywords()
+{
+ args="$1"
+ keywords="$2"
+ check_heading_regexp "$args" "$(heading_keywords_to_regexp "$keywords")"
+}
+
+#
+# Try several variations on "ps $flag", "ps -$flag", etc.,
+# and check that the heading always has the correct keywords.
+#
+check_heading_variations()
+{
+ flag="$1"
+ keywords="$2"
+ for args in "$flag" "-$flag" "-$flag$flag -$flag"; do
+ check_heading_keywords "$args" "$keywords"
+ done
+}
+
+atf_test_case default_columns
+default_columns_head()
+{
+ atf_set "descr" "Checks that the default set of columns is correct" \
+ "and also check that the columns printed by the -j," \
+ "-l, -s, -u and -v flags alone are correct"
+}
+default_columns_body()
+{
+ setup_keywords
+ check_heading_keywords '' "$default_keywords"
+ check_heading_variations 'j' "$j_keywords"
+ check_heading_variations 'l' "$l_keywords"
+ check_heading_variations 's' "$s_keywords"
+ check_heading_variations 'u' "$u_keywords"
+ check_heading_variations 'v' "$v_keywords"
+}
+
+atf_test_case minus_O
+minus_O_head()
+{
+ atf_set "descr" "Checks that 'ps -O foo' inserts columns just after" \
+ "the pid column"
+}
+minus_O_body()
+{
+ setup_keywords
+ check_heading_keywords '-O %cpu,%mem' \
+ "$(echo "${default_keywords}" | sed -e 's/pid/pid %cpu %mem/')"
+ check_heading_keywords '-O %cpu -O %mem' \
+ "$(echo "${default_keywords}" | sed -e 's/pid/pid %cpu %mem/')"
+ check_heading_keywords '-O%cpu -O%mem' \
+ "$(echo "${default_keywords}" | sed -e 's/pid/pid %cpu %mem/')"
+}
+
+atf_test_case minus_o
+minus_o_head()
+{
+ atf_set "descr" "Checks simple cases of 'ps -o foo' to control which" \
+ "columns are printed; this does not test header" \
+ "overriding via 'ps -o foo=BAR'"
+}
+minus_o_body()
+{
+ setup_keywords
+ # Keywords for "-o name" override the default display
+ check_heading_keywords '-o pid,%cpu,%mem' \
+ "pid %cpu %mem"
+ check_heading_keywords '-o pid -o %cpu,%mem' \
+ "pid %cpu %mem"
+ check_heading_keywords '-opid -o %cpu,%mem' \
+ "pid %cpu %mem"
+ # Space works like comma
+ check_heading_keywords '-opid -o "%cpu %mem"' \
+ "pid %cpu %mem"
+ # Check missing pid
+ check_heading_keywords '-o comm' \
+ "comm"
+ # Check pid present but not first
+ check_heading_keywords '-o comm,pid' \
+ "comm pid"
+}
+
+atf_test_case override_heading_simple
+override_heading_simple_head()
+{
+ atf_set "descr" "Tests simple uses of header overriding via" \
+ "'ps -o foo=BAR'. This does not test columns " \
+ "with null headings, or headings with embedded" \
+ "space, ',' or '='."
+}
+override_heading_simple_body()
+{
+ setup_keywords
+ check_heading_regexp '-o pid=PPP -o comm' \
+ '^ *PPP '"${head_text_comm}"'$' # no trailing space
+ check_heading_regexp '-o pid=PPP -o comm=CCC' \
+ '^ *PPP CCC$'
+ check_heading_regexp '-o pid,comm=CCC' \
+ '^'"${head_regexp_pid}"' CCC$'
+ check_heading_regexp '-o pid -o comm=CCC' \
+ '^'"${head_regexp_pid}"' CCC$'
+ # Check missing pid
+ check_heading_regexp '-o comm=CCC' \
+ '^CCC$'
+ # Check pid present but not first
+ check_heading_regexp '-o comm=CCC -o pid=PPP' \
+ '^CCC *PPP$'
+ check_heading_regexp '-o comm,pid=PPP' \
+ '^'"${head_regexp_comm}"' *PPP$'
+}
+
+atf_test_case override_heading_embedded_specials
+override_heading_embedded_specials_head()
+{
+ atf_set "descr" "Tests header overriding with embedded space," \
+ "',' or '='. Everything after the first '='" \
+ "is part of the heading."
+}
+override_heading_embedded_specials_body()
+{
+ setup_keywords
+ # Check embedded "," or "=" in override header.
+ check_heading_regexp '-o comm,pid==' \
+ '^'"${head_regexp_comm}"' *=$'
+ check_heading_regexp '-o comm,pid=,' \
+ '^'"${head_regexp_comm}"' *,$'
+ check_heading_regexp '-o pid=PPP,comm' \
+ '^ *PPP,comm$' # not like '-o pid=PPP -o comm'
+ check_heading_regexp '-o pid=PPP,comm=CCC' \
+ '^ *PPP,comm=CCC$' # not like '-o pid=PPP -o comm=CCC'
+ check_heading_regexp '-o comm,pid=PPP,QQQ' \
+ '^'"${head_regexp_comm}"' *PPP,QQQ$'
+ check_heading_regexp '-o comm,pid=ppid,tty=state' \
+ '^'"${head_regexp_comm}"' *ppid,tty=state$'
+ # Check embedded space or tab in override header.
+ check_heading_regexp '-o comm,pid="PPP QQQ"' \
+ '^'"${head_regexp_comm}"' *PPP QQQ$'
+ check_heading_regexp '-o comm,pid="PPP${tab}QQQ"' \
+ '^'"${head_regexp_comm}"' *PPP'"${tab}"'QQQ$'
+}
+
+atf_test_case override_heading_some_null
+override_heading_some_null_head()
+{
+ atf_set "descr" "Tests simple uses of null column headings" \
+ "overriding via 'ps -o foo=BAR -o baz='. This" \
+ "does not test the case where all columns have" \
+ "null headings."
+}
+override_heading_some_null_body()
+{
+ setup_keywords
+ check_heading_regexp '-o pid=PPP -o comm=' \
+ '^ *PPP *$'
+ check_heading_regexp '-o pid= -o comm=CCC' \
+ '^ * CCC$'
+ check_heading_regexp '-o pid -o comm=' \
+ '^'"${head_regexp_pid}"' *$'
+ # Check missing pid
+ check_heading_regexp '-o ppid= -o comm=CCC' \
+ '^ * CCC$'
+ check_heading_regexp '-o ppid=PPP -o comm=' \
+ '^ *PPP *$'
+ # Check pid present but not first
+ check_heading_regexp '-o comm= -o pid=PPP' \
+ '^ * PPP$'
+ check_heading_regexp '-o comm,pid=' \
+ '^'"${head_regexp_comm}"' *$'
+ # A field with a null custom heading retains a minimum width
+ # derived from the default heading. This does not apply
+ # to a field with a very short (non-null) custom heading.
+ #
+ # We choose "holdcnt" as a column whose width is likely to be
+ # determined entirely by the header width, because the values
+ # are likely to be very small.
+ check_heading_regexp '-o holdcnt -o holdcnt -o holdcnt' \
+ '^HOLDCNT HOLDCNT HOLDCNT$'
+ check_heading_regexp '-o holdcnt -o holdcnt= -o holdcnt' \
+ '^HOLDCNT HOLDCNT$'
+ check_heading_regexp '-o holdcnt -o holdcnt=HH -o holdcnt' \
+ '^HOLDCNT HH HOLDCNT$'
+}
+
+atf_test_case override_heading_all_null
+override_heading_all_null_head()
+{
+ atf_set "descr" "Tests the use of 'ps -o foo= -o bar=' (with a" \
+ "null heading for every column). The heading" \
+ "should not be printed at all in this case."
+}
+override_heading_all_null_body()
+{
+ setup_keywords
+ # A heading with a space is not a null heading,
+ # so should not be suppressed
+ check_heading_regexp '-o comm=" "' \
+ '^ *$'
+ # Null headings should be suppressed
+ check_no_heading_line '-o pid= -o comm='
+ check_no_heading_line '-o pid= -o comm='
+ # Check missing pid
+ check_no_heading_line '-o ppid='
+ check_no_heading_line '-o comm='
+ check_no_heading_line '-o command='
+ check_no_heading_line '-o ppid= -o comm='
+ check_no_heading_line '-o comm= -o ppid='
+ # Check pid present but not first
+ check_no_heading_line '-o comm= -o pid='
+ check_no_heading_line '-o ppid= -o pid= -o command='
+}
+
+atf_test_case duplicate_column
+duplicate_column_head()
+{
+ atf_set "descr" "Tests the use of -o options to display the" \
+ "same column more than once"
+}
+duplicate_column_body()
+{
+ setup_keywords
+ # two custom headers
+ check_heading_regexp '-o pid=PPP -o pid=QQQ' \
+ '^ *PPP *QQQ$'
+ # one custom header, before and after default header
+ check_heading_regexp '-o pid=PPP -o pid' \
+ '^ *PPP '"${head_regexp_pid}"'$'
+ check_heading_regexp '-o pid -o pid=QQQ' \
+ '^'"${head_regexp_pid}"' *QQQ$'
+ # custom headers both before and after default header
+ check_heading_regexp '-o pid=PPP -o pid -o pid=QQQ' \
+ '^ *PPP '"${head_regexp_pid}"' *QQQ$'
+}
+
+atf_init_test_cases() {
+ atf_add_test_case default_columns
+ atf_add_test_case minus_O
+ atf_add_test_case minus_o
+ atf_add_test_case override_heading_simple
+ atf_add_test_case override_heading_embedded_specials
+ atf_add_test_case override_heading_some_null
+ atf_add_test_case override_heading_all_null
+ atf_add_test_case duplicate_column
+}
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_case.out
new file mode 100644
index 0000000..4c42055
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_case.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+before case
+before break
+after break, return value: 0
+after case
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_compound.out
new file mode 100644
index 0000000..01113ca
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_compound.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+compound start
+before break
+after break, return value: 0
+compound end
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_file.out
new file mode 100644
index 0000000..5264020
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_file.out
@@ -0,0 +1,6 @@
+before case
+before dotcmd
+before break
+after break, return value: 0
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_for.out
new file mode 100644
index 0000000..e116ee2
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_for.out
@@ -0,0 +1,7 @@
+before case
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_func.out
new file mode 100644
index 0000000..906a804
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_func.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+before function
+before break
+after break
+after function
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_subshell.out
new file mode 100644
index 0000000..073caff
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_subshell.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+subshell start
+before break
+after break, return value: 0
+subshell end
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_until.out
new file mode 100644
index 0000000..f47bd43
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_until.out
@@ -0,0 +1,7 @@
+before case
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_while.out
new file mode 100644
index 0000000..e9a73f8
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_break_while.out
@@ -0,0 +1,7 @@
+before case
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_case.out
new file mode 100644
index 0000000..7919427
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_case.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+before case
+before continue
+after continue, return value: 0
+after case
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_compound.out
new file mode 100644
index 0000000..9195e08
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_compound.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+compound start
+before continue
+after continue, return value: 0
+compound end
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_file.out
new file mode 100644
index 0000000..100a590
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_file.out
@@ -0,0 +1,6 @@
+before case
+before dotcmd
+before continue
+after continue, return value: 0
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_for.out
new file mode 100644
index 0000000..9a078d0
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_for.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_func.out
new file mode 100644
index 0000000..6282c89
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_func.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+before function
+before continue
+after continue
+after function
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_subshell.out
new file mode 100644
index 0000000..b066ab6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_subshell.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+subshell start
+before continue
+after continue, return value: 0
+subshell end
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_until.out
new file mode 100644
index 0000000..afc85b6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_until.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_while.out
new file mode 100644
index 0000000..cb4137d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_continue_while.out
@@ -0,0 +1,8 @@
+before case
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_case.out
new file mode 100644
index 0000000..734369d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_case.out
@@ -0,0 +1,6 @@
+before case
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_compound.out
new file mode 100644
index 0000000..2fae84e
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_compound.out
@@ -0,0 +1,6 @@
+before case
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_file.out
new file mode 100644
index 0000000..f97ecc6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_file.out
@@ -0,0 +1,5 @@
+before case
+before dotcmd
+before return
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_for.out
new file mode 100644
index 0000000..d863537
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_for.out
@@ -0,0 +1,6 @@
+before case
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_func.out
new file mode 100644
index 0000000..aed8fa4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_func.out
@@ -0,0 +1,7 @@
+before case
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_subshell.out
new file mode 100644
index 0000000..364d245
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_subshell.out
@@ -0,0 +1,6 @@
+before case
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_until.out
new file mode 100644
index 0000000..daf3811
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_until.out
@@ -0,0 +1,6 @@
+before case
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_while.out
new file mode 100644
index 0000000..ef6a676
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/case_return_while.out
@@ -0,0 +1,6 @@
+before case
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+after case
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_case.out
new file mode 100644
index 0000000..144bcd6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_case.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+before case
+before break
+after break, return value: 0
+after case
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_compound.out
new file mode 100644
index 0000000..3fd7b2f
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_compound.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+compound start
+before break
+after break, return value: 0
+compound end
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_file.out
new file mode 100644
index 0000000..5ad5ed3
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_file.out
@@ -0,0 +1,6 @@
+compound start
+before dotcmd
+before break
+after break, return value: 0
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_for.out
new file mode 100644
index 0000000..7f03e49
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_for.out
@@ -0,0 +1,7 @@
+compound start
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_func.out
new file mode 100644
index 0000000..82e86b3
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_func.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+before function
+before break
+after break
+after function
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_subshell.out
new file mode 100644
index 0000000..e26e980
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_subshell.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+subshell start
+before break
+after break, return value: 0
+subshell end
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_until.out
new file mode 100644
index 0000000..34dd25a
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_until.out
@@ -0,0 +1,7 @@
+compound start
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_while.out
new file mode 100644
index 0000000..7019045
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_break_while.out
@@ -0,0 +1,7 @@
+compound start
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_case.out
new file mode 100644
index 0000000..206548c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_case.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+before case
+before continue
+after continue, return value: 0
+after case
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_compound.out
new file mode 100644
index 0000000..a8c7efc
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_compound.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+compound start
+before continue
+after continue, return value: 0
+compound end
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_file.out
new file mode 100644
index 0000000..c619ad5
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_file.out
@@ -0,0 +1,6 @@
+compound start
+before dotcmd
+before continue
+after continue, return value: 0
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_for.out
new file mode 100644
index 0000000..35b092a
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_for.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_func.out
new file mode 100644
index 0000000..198dbd6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_func.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+before function
+before continue
+after continue
+after function
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_subshell.out
new file mode 100644
index 0000000..1ecaa96
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_subshell.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+subshell start
+before continue
+after continue, return value: 0
+subshell end
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_until.out
new file mode 100644
index 0000000..4a74a8e
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_until.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_while.out
new file mode 100644
index 0000000..b2d939e
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_continue_while.out
@@ -0,0 +1,8 @@
+compound start
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_case.out
new file mode 100644
index 0000000..995d5b5
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_case.out
@@ -0,0 +1,6 @@
+compound start
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_compound.out
new file mode 100644
index 0000000..f6e4858
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_compound.out
@@ -0,0 +1,6 @@
+compound start
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_file.out
new file mode 100644
index 0000000..84347b2
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_file.out
@@ -0,0 +1,5 @@
+compound start
+before dotcmd
+before return
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_for.out
new file mode 100644
index 0000000..ec23447
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_for.out
@@ -0,0 +1,6 @@
+compound start
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_func.out
new file mode 100644
index 0000000..12798d0
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_func.out
@@ -0,0 +1,7 @@
+compound start
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_subshell.out
new file mode 100644
index 0000000..af0ab78
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_subshell.out
@@ -0,0 +1,6 @@
+compound start
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_until.out
new file mode 100644
index 0000000..a108f50
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_until.out
@@ -0,0 +1,6 @@
+compound start
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_while.out
new file mode 100644
index 0000000..ef34c03
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/compound_return_while.out
@@ -0,0 +1,6 @@
+compound start
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+compound end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_case.out
new file mode 100644
index 0000000..2f34f10
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_case.out
@@ -0,0 +1,6 @@
+before dotcmd
+before case
+before break
+after break, return value: 0
+after case
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_compound.out
new file mode 100644
index 0000000..0c7300d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_compound.out
@@ -0,0 +1,6 @@
+before dotcmd
+compound start
+before break
+after break, return value: 0
+compound end
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_file.out
new file mode 100644
index 0000000..fb4db19
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_file.out
@@ -0,0 +1,4 @@
+before dotcmd
+before break
+after break, return value: 0
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_for.out
new file mode 100644
index 0000000..66f4452
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_for.out
@@ -0,0 +1,5 @@
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_func.out
new file mode 100644
index 0000000..c5488ab
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_func.out
@@ -0,0 +1,6 @@
+before dotcmd
+before function
+before break
+after break
+after function
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_subshell.out
new file mode 100644
index 0000000..47e2394
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_subshell.out
@@ -0,0 +1,6 @@
+before dotcmd
+subshell start
+before break
+after break, return value: 0
+subshell end
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_until.out
new file mode 100644
index 0000000..b51ff19
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_until.out
@@ -0,0 +1,5 @@
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_while.out
new file mode 100644
index 0000000..0fd3a83
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_break_while.out
@@ -0,0 +1,5 @@
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_case.out
new file mode 100644
index 0000000..2cf3be6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_case.out
@@ -0,0 +1,6 @@
+before dotcmd
+before case
+before continue
+after continue, return value: 0
+after case
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_compound.out
new file mode 100644
index 0000000..7bec420
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_compound.out
@@ -0,0 +1,6 @@
+before dotcmd
+compound start
+before continue
+after continue, return value: 0
+compound end
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_file.out
new file mode 100644
index 0000000..2f8806c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_file.out
@@ -0,0 +1,4 @@
+before dotcmd
+before continue
+after continue, return value: 0
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_for.out
new file mode 100644
index 0000000..e8da239
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_for.out
@@ -0,0 +1,6 @@
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_func.out
new file mode 100644
index 0000000..da683c0
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_func.out
@@ -0,0 +1,6 @@
+before dotcmd
+before function
+before continue
+after continue
+after function
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_subshell.out
new file mode 100644
index 0000000..388558b
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_subshell.out
@@ -0,0 +1,6 @@
+before dotcmd
+subshell start
+before continue
+after continue, return value: 0
+subshell end
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_until.out
new file mode 100644
index 0000000..bb0f281
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_until.out
@@ -0,0 +1,6 @@
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_while.out
new file mode 100644
index 0000000..6333823
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_continue_while.out
@@ -0,0 +1,6 @@
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_case.out
new file mode 100644
index 0000000..4866852
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_case.out
@@ -0,0 +1,4 @@
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_compound.out
new file mode 100644
index 0000000..6b83145
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_compound.out
@@ -0,0 +1,4 @@
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_file.out
new file mode 100644
index 0000000..2d67423
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_file.out
@@ -0,0 +1,3 @@
+before dotcmd
+before return
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_for.out
new file mode 100644
index 0000000..83f8e00
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_for.out
@@ -0,0 +1,4 @@
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_func.out
new file mode 100644
index 0000000..a0db2c9
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_func.out
@@ -0,0 +1,5 @@
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_subshell.out
new file mode 100644
index 0000000..83cd0e4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_subshell.out
@@ -0,0 +1,4 @@
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_until.out
new file mode 100644
index 0000000..fdf2449
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_until.out
@@ -0,0 +1,4 @@
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_while.out
new file mode 100644
index 0000000..a733aa3
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/file_return_while.out
@@ -0,0 +1,4 @@
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_case.out
new file mode 100644
index 0000000..262db24
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_case.out
@@ -0,0 +1,5 @@
+before for
+before dotcmd
+before case
+before break
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_compound.out
new file mode 100644
index 0000000..418a4de
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_compound.out
@@ -0,0 +1,5 @@
+before for
+before dotcmd
+compound start
+before break
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_file.out
new file mode 100644
index 0000000..752c95c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_file.out
@@ -0,0 +1,4 @@
+before for
+before dotcmd
+before break
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_for.out
new file mode 100644
index 0000000..20af622
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_for.out
@@ -0,0 +1,12 @@
+before for
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_func.out
new file mode 100644
index 0000000..fe0cab4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_func.out
@@ -0,0 +1,5 @@
+before for
+before dotcmd
+before function
+before break
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_subshell.out
new file mode 100644
index 0000000..985aab6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_subshell.out
@@ -0,0 +1,10 @@
+before for
+before dotcmd
+subshell start
+before break
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before break
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_until.out
new file mode 100644
index 0000000..b47c901
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_until.out
@@ -0,0 +1,12 @@
+before for
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_while.out
new file mode 100644
index 0000000..deb4ceb
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_break_while.out
@@ -0,0 +1,12 @@
+before for
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_case.out
new file mode 100644
index 0000000..e989063
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_case.out
@@ -0,0 +1,8 @@
+before for
+before dotcmd
+before case
+before continue
+before dotcmd
+before case
+before continue
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_compound.out
new file mode 100644
index 0000000..0fd23b6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_compound.out
@@ -0,0 +1,8 @@
+before for
+before dotcmd
+compound start
+before continue
+before dotcmd
+compound start
+before continue
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_file.out
new file mode 100644
index 0000000..286bb88
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_file.out
@@ -0,0 +1,6 @@
+before for
+before dotcmd
+before continue
+before dotcmd
+before continue
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_for.out
new file mode 100644
index 0000000..044d5a3
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_for.out
@@ -0,0 +1,14 @@
+before for
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_func.out
new file mode 100644
index 0000000..a0cc6cc
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_func.out
@@ -0,0 +1,8 @@
+before for
+before dotcmd
+before function
+before continue
+before dotcmd
+before function
+before continue
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_subshell.out
new file mode 100644
index 0000000..f1ae7aa
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_subshell.out
@@ -0,0 +1,10 @@
+before for
+before dotcmd
+subshell start
+before continue
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before continue
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_until.out
new file mode 100644
index 0000000..b1c4147
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_until.out
@@ -0,0 +1,14 @@
+before for
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_while.out
new file mode 100644
index 0000000..f8e5c5d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_continue_while.out
@@ -0,0 +1,14 @@
+before for
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_case.out
new file mode 100644
index 0000000..24b7145
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_case.out
@@ -0,0 +1,10 @@
+before for
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_compound.out
new file mode 100644
index 0000000..30b4dac
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_compound.out
@@ -0,0 +1,10 @@
+before for
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_file.out
new file mode 100644
index 0000000..8855562
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_file.out
@@ -0,0 +1,8 @@
+before for
+before dotcmd
+before return
+after dotcmd, return value: 0
+before dotcmd
+before return
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_for.out
new file mode 100644
index 0000000..52a72a9
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_for.out
@@ -0,0 +1,10 @@
+before for
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_func.out
new file mode 100644
index 0000000..4f0fee2
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_func.out
@@ -0,0 +1,12 @@
+before for
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_subshell.out
new file mode 100644
index 0000000..4b8f36c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_subshell.out
@@ -0,0 +1,10 @@
+before for
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_until.out
new file mode 100644
index 0000000..3eaf9df
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_until.out
@@ -0,0 +1,10 @@
+before for
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_while.out
new file mode 100644
index 0000000..8cbad95
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/for_return_while.out
@@ -0,0 +1,10 @@
+before for
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+after for
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_case.out
new file mode 100644
index 0000000..7373371
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_case.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+before case
+before break
+after break, return value: 0
+after case
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_compound.out
new file mode 100644
index 0000000..e87b4a2
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_compound.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+compound start
+before break
+after break, return value: 0
+compound end
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_file.out
new file mode 100644
index 0000000..cf14422
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_file.out
@@ -0,0 +1,6 @@
+before function
+before dotcmd
+before break
+after break, return value: 0
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_for.out
new file mode 100644
index 0000000..c385348
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_for.out
@@ -0,0 +1,7 @@
+before function
+before dotcmd
+before for
+before break
+after for
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_func.out
new file mode 100644
index 0000000..5c1c4c8
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_func.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+before function
+before break
+after break
+after function
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_subshell.out
new file mode 100644
index 0000000..affe3e4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_subshell.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+subshell start
+before break
+after break, return value: 0
+subshell end
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_until.out
new file mode 100644
index 0000000..b0f942a
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_until.out
@@ -0,0 +1,7 @@
+before function
+before dotcmd
+before until
+before break
+after until
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_while.out
new file mode 100644
index 0000000..d687aa7
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_break_while.out
@@ -0,0 +1,7 @@
+before function
+before dotcmd
+before while
+before break
+after while
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_case.out
new file mode 100644
index 0000000..b1ad4be
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_case.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+before case
+before continue
+after continue, return value: 0
+after case
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_compound.out
new file mode 100644
index 0000000..d6a5edd
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_compound.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+compound start
+before continue
+after continue, return value: 0
+compound end
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_file.out
new file mode 100644
index 0000000..f300d6a
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_file.out
@@ -0,0 +1,6 @@
+before function
+before dotcmd
+before continue
+after continue, return value: 0
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_for.out
new file mode 100644
index 0000000..d46095d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_for.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_func.out
new file mode 100644
index 0000000..3ff73a2
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_func.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+before function
+before continue
+after continue
+after function
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_subshell.out
new file mode 100644
index 0000000..fd295aa
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_subshell.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+subshell start
+before continue
+after continue, return value: 0
+subshell end
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_until.out
new file mode 100644
index 0000000..7a65083
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_until.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_while.out
new file mode 100644
index 0000000..6ecbe82
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_continue_while.out
@@ -0,0 +1,8 @@
+before function
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_case.out
new file mode 100644
index 0000000..8f0c094
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_case.out
@@ -0,0 +1,6 @@
+before function
+before dotcmd
+before case
+before return
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_compound.out
new file mode 100644
index 0000000..e3d8670
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_compound.out
@@ -0,0 +1,6 @@
+before function
+before dotcmd
+compound start
+before return
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_file.out
new file mode 100644
index 0000000..95e3415
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_file.out
@@ -0,0 +1,5 @@
+before function
+before dotcmd
+before return
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_for.out
new file mode 100644
index 0000000..511cc39
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_for.out
@@ -0,0 +1,6 @@
+before function
+before dotcmd
+before for
+before return
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_func.out
new file mode 100644
index 0000000..a87d3a7
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_func.out
@@ -0,0 +1,7 @@
+before function
+before dotcmd
+before function
+before return
+after function
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_subshell.out
new file mode 100644
index 0000000..fdb37b2
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_subshell.out
@@ -0,0 +1,6 @@
+before function
+before dotcmd
+subshell start
+before return
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_until.out
new file mode 100644
index 0000000..08b45be
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_until.out
@@ -0,0 +1,6 @@
+before function
+before dotcmd
+before until
+before return
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_while.out
new file mode 100644
index 0000000..27fbcaf
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/func_return_while.out
@@ -0,0 +1,6 @@
+before function
+before dotcmd
+before while
+before return
+after dotcmd
+after function
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_case.out
new file mode 100644
index 0000000..155daea
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_case.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+before case
+before break
+after break, return value: 0
+after case
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_compound.out
new file mode 100644
index 0000000..a643ac0
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_compound.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+compound start
+before break
+after break, return value: 0
+compound end
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_file.out
new file mode 100644
index 0000000..2556d89
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_file.out
@@ -0,0 +1,6 @@
+subshell start
+before dotcmd
+before break
+after break, return value: 0
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_for.out
new file mode 100644
index 0000000..27040a9
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_for.out
@@ -0,0 +1,7 @@
+subshell start
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_func.out
new file mode 100644
index 0000000..83ec062
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_func.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+before function
+before break
+after break
+after function
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_subshell.out
new file mode 100644
index 0000000..8a53ac5
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_subshell.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+subshell start
+before break
+after break, return value: 0
+subshell end
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_until.out
new file mode 100644
index 0000000..a31fa5b
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_until.out
@@ -0,0 +1,7 @@
+subshell start
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_while.out
new file mode 100644
index 0000000..42eb970
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_break_while.out
@@ -0,0 +1,7 @@
+subshell start
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_case.out
new file mode 100644
index 0000000..4d74b7b
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_case.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+before case
+before continue
+after continue, return value: 0
+after case
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_compound.out
new file mode 100644
index 0000000..4328df3
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_compound.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+compound start
+before continue
+after continue, return value: 0
+compound end
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_file.out
new file mode 100644
index 0000000..a4a6e4a
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_file.out
@@ -0,0 +1,6 @@
+subshell start
+before dotcmd
+before continue
+after continue, return value: 0
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_for.out
new file mode 100644
index 0000000..e829889
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_for.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_func.out
new file mode 100644
index 0000000..e0ead4c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_func.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+before function
+before continue
+after continue
+after function
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_subshell.out
new file mode 100644
index 0000000..dfcdfb4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_subshell.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+subshell start
+before continue
+after continue, return value: 0
+subshell end
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_until.out
new file mode 100644
index 0000000..66e8f9f
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_until.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_while.out
new file mode 100644
index 0000000..f1c83f4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_continue_while.out
@@ -0,0 +1,8 @@
+subshell start
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_case.out
new file mode 100644
index 0000000..008d9396
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_case.out
@@ -0,0 +1,6 @@
+subshell start
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_compound.out
new file mode 100644
index 0000000..bdab231
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_compound.out
@@ -0,0 +1,6 @@
+subshell start
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_file.out
new file mode 100644
index 0000000..43d011d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_file.out
@@ -0,0 +1,5 @@
+subshell start
+before dotcmd
+before return
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_for.out
new file mode 100644
index 0000000..7cfed89
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_for.out
@@ -0,0 +1,6 @@
+subshell start
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_func.out
new file mode 100644
index 0000000..b695c53
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_func.out
@@ -0,0 +1,7 @@
+subshell start
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_subshell.out
new file mode 100644
index 0000000..c5ccf59
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_subshell.out
@@ -0,0 +1,6 @@
+subshell start
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_until.out
new file mode 100644
index 0000000..64737ad
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_until.out
@@ -0,0 +1,6 @@
+subshell start
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_while.out
new file mode 100644
index 0000000..de520c4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/subshell_return_while.out
@@ -0,0 +1,6 @@
+subshell start
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+subshell end
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_case.out
new file mode 100644
index 0000000..f0483b4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_case.out
@@ -0,0 +1,5 @@
+before until
+before dotcmd
+before case
+before break
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_compound.out
new file mode 100644
index 0000000..a5e37ba
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_compound.out
@@ -0,0 +1,5 @@
+before until
+before dotcmd
+compound start
+before break
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_file.out
new file mode 100644
index 0000000..a2fde4d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_file.out
@@ -0,0 +1,4 @@
+before until
+before dotcmd
+before break
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_for.out
new file mode 100644
index 0000000..8b3faf5
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_for.out
@@ -0,0 +1,12 @@
+before until
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_func.out
new file mode 100644
index 0000000..a83ce2b
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_func.out
@@ -0,0 +1,5 @@
+before until
+before dotcmd
+before function
+before break
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_subshell.out
new file mode 100644
index 0000000..008d30d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_subshell.out
@@ -0,0 +1,10 @@
+before until
+before dotcmd
+subshell start
+before break
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before break
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_until.out
new file mode 100644
index 0000000..05fb94a
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_until.out
@@ -0,0 +1,12 @@
+before until
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_while.out
new file mode 100644
index 0000000..6ae1f9c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_break_while.out
@@ -0,0 +1,12 @@
+before until
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_case.out
new file mode 100644
index 0000000..40028fb
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_case.out
@@ -0,0 +1,8 @@
+before until
+before dotcmd
+before case
+before continue
+before dotcmd
+before case
+before continue
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_compound.out
new file mode 100644
index 0000000..3641e1e
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_compound.out
@@ -0,0 +1,8 @@
+before until
+before dotcmd
+compound start
+before continue
+before dotcmd
+compound start
+before continue
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_file.out
new file mode 100644
index 0000000..c9f5193
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_file.out
@@ -0,0 +1,6 @@
+before until
+before dotcmd
+before continue
+before dotcmd
+before continue
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_for.out
new file mode 100644
index 0000000..fd58240
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_for.out
@@ -0,0 +1,14 @@
+before until
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_func.out
new file mode 100644
index 0000000..6beb163
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_func.out
@@ -0,0 +1,8 @@
+before until
+before dotcmd
+before function
+before continue
+before dotcmd
+before function
+before continue
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_subshell.out
new file mode 100644
index 0000000..534509e
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_subshell.out
@@ -0,0 +1,10 @@
+before until
+before dotcmd
+subshell start
+before continue
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before continue
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_until.out
new file mode 100644
index 0000000..ddfeb27
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_until.out
@@ -0,0 +1,14 @@
+before until
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_while.out
new file mode 100644
index 0000000..5707821
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_continue_while.out
@@ -0,0 +1,14 @@
+before until
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_case.out
new file mode 100644
index 0000000..70dd420
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_case.out
@@ -0,0 +1,10 @@
+before until
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_compound.out
new file mode 100644
index 0000000..145d2c5
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_compound.out
@@ -0,0 +1,10 @@
+before until
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_file.out
new file mode 100644
index 0000000..5b0adb1
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_file.out
@@ -0,0 +1,8 @@
+before until
+before dotcmd
+before return
+after dotcmd, return value: 0
+before dotcmd
+before return
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_for.out
new file mode 100644
index 0000000..b113e8c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_for.out
@@ -0,0 +1,10 @@
+before until
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_func.out
new file mode 100644
index 0000000..1ab16ab
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_func.out
@@ -0,0 +1,12 @@
+before until
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_subshell.out
new file mode 100644
index 0000000..d444631
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_subshell.out
@@ -0,0 +1,10 @@
+before until
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_until.out
new file mode 100644
index 0000000..3998017
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_until.out
@@ -0,0 +1,10 @@
+before until
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_while.out
new file mode 100644
index 0000000..9b140cf
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/until_return_while.out
@@ -0,0 +1,10 @@
+before until
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+after until
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_case.out
new file mode 100644
index 0000000..1b0731f
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_case.out
@@ -0,0 +1,5 @@
+before while
+before dotcmd
+before case
+before break
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_compound.out
new file mode 100644
index 0000000..05c23eb
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_compound.out
@@ -0,0 +1,5 @@
+before while
+before dotcmd
+compound start
+before break
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_file.out
new file mode 100644
index 0000000..cb70ae1
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_file.out
@@ -0,0 +1,4 @@
+before while
+before dotcmd
+before break
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_for.out
new file mode 100644
index 0000000..b94eac1
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_for.out
@@ -0,0 +1,12 @@
+before while
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+before dotcmd
+before for
+before break
+after for
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_func.out
new file mode 100644
index 0000000..7d54c15
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_func.out
@@ -0,0 +1,5 @@
+before while
+before dotcmd
+before function
+before break
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_subshell.out
new file mode 100644
index 0000000..234cd66
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_subshell.out
@@ -0,0 +1,10 @@
+before while
+before dotcmd
+subshell start
+before break
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before break
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_until.out
new file mode 100644
index 0000000..f360230
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_until.out
@@ -0,0 +1,12 @@
+before while
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+before dotcmd
+before until
+before break
+after until
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_while.out
new file mode 100644
index 0000000..451b0a2
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_break_while.out
@@ -0,0 +1,12 @@
+before while
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+before dotcmd
+before while
+before break
+after while
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_case.out
new file mode 100644
index 0000000..d7f412c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_case.out
@@ -0,0 +1,8 @@
+before while
+before dotcmd
+before case
+before continue
+before dotcmd
+before case
+before continue
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_compound.out
new file mode 100644
index 0000000..0019047
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_compound.out
@@ -0,0 +1,8 @@
+before while
+before dotcmd
+compound start
+before continue
+before dotcmd
+compound start
+before continue
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_file.out
new file mode 100644
index 0000000..9070dea
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_file.out
@@ -0,0 +1,6 @@
+before while
+before dotcmd
+before continue
+before dotcmd
+before continue
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_for.out
new file mode 100644
index 0000000..98696ee
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_for.out
@@ -0,0 +1,14 @@
+before while
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+before dotcmd
+before for
+before continue
+before continue
+after for
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_func.out
new file mode 100644
index 0000000..77efc2c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_func.out
@@ -0,0 +1,8 @@
+before while
+before dotcmd
+before function
+before continue
+before dotcmd
+before function
+before continue
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_subshell.out
new file mode 100644
index 0000000..b4106a1
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_subshell.out
@@ -0,0 +1,10 @@
+before while
+before dotcmd
+subshell start
+before continue
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before continue
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_until.out
new file mode 100644
index 0000000..7f893a0
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_until.out
@@ -0,0 +1,14 @@
+before while
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+before dotcmd
+before until
+before continue
+before continue
+after until
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_while.out
new file mode 100644
index 0000000..317be17
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_continue_while.out
@@ -0,0 +1,14 @@
+before while
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+before dotcmd
+before while
+before continue
+before continue
+after while
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_case.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_case.out
new file mode 100644
index 0000000..abb6a4a
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_case.out
@@ -0,0 +1,10 @@
+before while
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+before dotcmd
+before case
+before return
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_compound.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_compound.out
new file mode 100644
index 0000000..b37418b
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_compound.out
@@ -0,0 +1,10 @@
+before while
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+before dotcmd
+compound start
+before return
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_file.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_file.out
new file mode 100644
index 0000000..1c4791e
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_file.out
@@ -0,0 +1,8 @@
+before while
+before dotcmd
+before return
+after dotcmd, return value: 0
+before dotcmd
+before return
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_for.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_for.out
new file mode 100644
index 0000000..0569d6f
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_for.out
@@ -0,0 +1,10 @@
+before while
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+before dotcmd
+before for
+before return
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_func.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_func.out
new file mode 100644
index 0000000..cb5a308
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_func.out
@@ -0,0 +1,12 @@
+before while
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+before dotcmd
+before function
+before return
+after function
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_subshell.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_subshell.out
new file mode 100644
index 0000000..161a227
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_subshell.out
@@ -0,0 +1,10 @@
+before while
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+before dotcmd
+subshell start
+before return
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_until.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_until.out
new file mode 100644
index 0000000..d84a5f7
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_until.out
@@ -0,0 +1,10 @@
+before while
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+before dotcmd
+before until
+before return
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_while.out b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_while.out
new file mode 100644
index 0000000..4eeaaa9
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/out/while_return_while.out
@@ -0,0 +1,10 @@
+before while
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+before dotcmd
+before while
+before return
+after dotcmd, return value: 0
+after while
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command b/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command
new file mode 100755
index 0000000..fda4e53
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command
@@ -0,0 +1,129 @@
+#!/bin/sh
+#
+# $NetBSD: scoped_command,v 1.1 2014/05/31 14:29:06 christos Exp $
+#
+# Copyright (c) 2014 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jarmo Jaakkola.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+set -e
+
+# USAGE:
+# scoped_command scope cmd msg var_suffix
+#
+# Write to stdout a piece of Bourne Shell script with _cmd_ in specific
+# _scope_. The execution of _cmd_ is bracketed by prints of "before _msg_"
+# and "after _msg_, return value ${?}". If the generated script uses
+# variables, __var_suffix_ is appended to their names to allow nesting of
+# scripts generated this way.
+#
+# _scope_ should be one of: case, compound, file, for, func, subshell,
+# until, while.
+# _cmd_ is the command line to execute. Remember proper quoting!
+# _msg_ is text that will be used inside single quotes.
+# _var_suffix_ is a syntactically valid identifier name.
+
+# don't rely on command lists (';')
+cmd="echo 'before ${3}'
+${2}
+echo 'after ${3}, return value:' ${?}"
+
+echo "#!/bin/sh"
+
+[ 'func' = "${1}" ] && cat <<EOF
+func()
+{
+ echo 'before ${3}'
+ \${1}
+ echo 'after ${3}'
+}
+
+echo 'before function'
+func "${2}" "${3}" # don't rely on 'shift'
+echo 'after function'
+EOF
+
+[ 'case' = "${1}" ] && cat <<EOF
+echo 'before case'
+case 'a' in
+ a) ${cmd};;
+esac
+echo 'after case'
+EOF
+
+[ 'file' = "${1}" ] && cat <<EOF
+${cmd}
+EOF
+
+[ 'while' = "${1}" ] && cat <<EOF
+echo 'before while'
+cond_${4}='true true false'
+while \${cond_${4}}
+do
+ cond_${4}="\${cond_${4}#* }"
+ ${cmd}
+done
+echo 'after while'
+EOF
+
+[ 'until' = "${1}" ] && cat <<EOF
+echo 'before until'
+cond_${4}='false false true'
+until \${cond_${4}}
+do
+ cond_${4}="\${cond_${4}#* }"
+ ${cmd}
+done
+echo 'after until'
+EOF
+
+[ 'for' = "${1}" ] && cat <<EOF
+echo 'before for'
+for i_${4} in 1 2
+do
+ ${cmd}
+done
+echo 'after for'
+EOF
+
+[ 'subshell' = "${1}" ] && cat <<EOF
+(
+ echo 'subshell start'
+ ${cmd}
+ echo 'subshell end'
+)
+EOF
+
+[ 'compound' = "${1}" ] && cat <<EOF
+{
+ echo 'compound start'
+ ${cmd};
+ echo 'compound end'
+}
+EOF
+
+exit 0
diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh b/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh
new file mode 100755
index 0000000..b365b1d
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh
@@ -0,0 +1,76 @@
+# $NetBSD: t_dotcmd.sh,v 1.1 2014/05/31 14:29:06 christos Exp $
+#
+# Copyright (c) 2014 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jarmo Jaakkola.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# Test loop and function flow control statements in various scopes in a file
+# sourced by a dotcmd in various scopes. Basically, dotcmd is like #include
+# in C/C++ so, for example, if the dotcmd is in a loop's body, a break in
+# the sourced file can be used to break out of that loop.
+
+cmds='return break continue'
+scopes='case compound file for func subshell until while'
+
+case_ids=''
+
+for dot_scope in ${scopes}
+do
+ for cmd in ${cmds}
+ do
+ for cmd_scope in ${scopes}
+ do
+ case_id="${dot_scope}_${cmd}_${cmd_scope}"
+ case_ids="${case_ids} ${case_id}"
+ atf_test_case "${case_id}"
+ eval "
+${case_id}_head()
+{
+ atf_set 'descr' \\
+ 'dotcmd in ${dot_scope}, file contains ${cmd} in ${cmd_scope}'
+}
+
+${case_id}_body()
+{
+ srcdir=\$(atf_get_srcdir)
+ # for dotcmd to find the sourced files
+ PATH=\"\${PATH}:\${srcdir}\"
+ atf_check -o file:\"\${srcdir}/out/${case_id}.out\" \\
+ \"\${srcdir}/${case_id}\"
+}
+" # end eval
+ done
+ done
+done
+
+atf_init_test_cases()
+{
+ for case_id in ${case_ids}
+ do
+ atf_add_test_case "${case_id}"
+ done
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_compexit.sh b/contrib/netbsd-tests/bin/sh/t_compexit.sh
new file mode 100755
index 0000000..019b740
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_compexit.sh
@@ -0,0 +1,63 @@
+# $NetBSD: t_compexit.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+# The standard
+# http://www.opengroup.org/onlinepubs/007904975/utilities/set.html
+# says:
+#
+# -e
+#
+# When this option is on, if a simple command fails for any of the
+# reasons listed in Consequences of Shell Errors or returns an exit
+# status value >0, and is not part of the compound list following a
+# while, until, or if keyword, and is not a part of an AND or OR list,
+# and is not a pipeline preceded by the ! reserved word, then the shell
+# shall immediately exit.
+
+crud() {
+ set -e
+ for x in a
+ do
+ BAR="foo"
+ false && echo true
+ echo mumble
+ done
+}
+
+atf_test_case set_e
+set_e_head() {
+ atf_set "descr" "Tests that 'set -e' turns on error detection" \
+ "and that it behaves as defined by the standard"
+}
+set_e_body() {
+ foo=`crud`
+ atf_check_equal 'x$foo' 'xmumble'
+}
+
+atf_init_test_cases() {
+ atf_add_test_case set_e
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_evaltested.sh b/contrib/netbsd-tests/bin/sh/t_evaltested.sh
new file mode 100755
index 0000000..e40f8bd
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_evaltested.sh
@@ -0,0 +1,60 @@
+# $NetBSD: t_evaltested.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case evaltested
+
+evaltested_head() {
+ atf_set "descr" "Tests that eval in a tested context does not exit"
+}
+
+evaltested_body() {
+ set -e
+cat > helper.sh << EOF
+set -e
+if eval false
+then
+ echo "'eval false' returned true"
+ exit 1
+fi
+echo "passed"
+exit 0
+EOF
+ output="$(/bin/sh helper.sh)"
+ [ $? = 0 ] && return
+
+ if [ -n "$output" ]
+ then
+ atf_fail "$output"
+ else
+ atf_fail "'eval false' exited from a tested context"
+ fi
+
+}
+
+atf_init_test_cases() {
+ atf_add_test_case evaltested
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_exit.sh b/contrib/netbsd-tests/bin/sh/t_exit.sh
new file mode 100755
index 0000000..62c5869
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_exit.sh
@@ -0,0 +1,105 @@
+# $NetBSD: t_exit.sh,v 1.3 2012/04/13 06:12:32 jruoho Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+crud() {
+ test yes = no
+
+ cat <<EOF
+$?
+EOF
+}
+
+atf_test_case background
+background_head() {
+ atf_set "descr" "Tests that sh(1) sets '$?' properly when running " \
+ "a command in the background (PR bin/46327)"
+}
+background_body() {
+ atf_check -s exit:0 -o ignore -e ignore -x "true; true & echo $?"
+ atf_check -s exit:0 -o ignore -e ignore -x "false; true & echo $?"
+}
+
+atf_test_case function
+function_head() {
+ atf_set "descr" "Tests that \$? is correctly updated inside" \
+ "a function"
+}
+function_body() {
+ foo=`crud`
+ atf_check_equal 'x$foo' 'x1'
+}
+
+atf_test_case readout
+readout_head() {
+ atf_set "descr" "Tests that \$? is correctly updated in a" \
+ "compound expression"
+}
+readout_body() {
+ atf_check_equal '$( true && ! true | false; echo $? )' '0'
+}
+
+atf_test_case trap_subshell
+trap_subshell_head() {
+ atf_set "descr" "Tests that the trap statement in a subshell" \
+ "works when the subshell exits"
+}
+trap_subshell_body() {
+ atf_check -s eq:0 -o inline:'exiting\n' -x \
+ '( trap "echo exiting" EXIT; /usr/bin/true )'
+}
+
+atf_test_case trap_zero__implicit_exit
+trap_zero__implicit_exit_body() {
+ # PR bin/6764: sh works but ksh does not"
+ echo '( trap "echo exiting" 0 )' >helper.sh
+ atf_check -s eq:0 -o match:exiting -e empty /bin/sh helper.sh
+ atf_check -s eq:0 -o match:exiting -e empty /bin/ksh helper.sh
+}
+
+atf_test_case trap_zero__explicit_exit
+trap_zero__explicit_exit_body() {
+ echo '( trap "echo exiting" 0; exit )' >helper.sh
+ atf_check -s eq:0 -o match:exiting -e empty /bin/sh helper.sh
+ atf_check -s eq:0 -o match:exiting -e empty /bin/ksh helper.sh
+}
+
+atf_test_case trap_zero__explicit_return
+trap_zero__explicit_return_body() {
+ echo '( trap "echo exiting" 0; return )' >helper.sh
+ atf_check -s eq:0 -o match:exiting -e empty /bin/sh helper.sh
+ atf_check -s eq:0 -o match:exiting -e empty /bin/ksh helper.sh
+}
+
+atf_init_test_cases() {
+ atf_add_test_case background
+ atf_add_test_case function
+ atf_add_test_case readout
+ atf_add_test_case trap_subshell
+ atf_add_test_case trap_zero__implicit_exit
+ atf_add_test_case trap_zero__explicit_exit
+ atf_add_test_case trap_zero__explicit_return
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_expand.sh b/contrib/netbsd-tests/bin/sh/t_expand.sh
new file mode 100755
index 0000000..eeaad5f
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_expand.sh
@@ -0,0 +1,142 @@
+# $NetBSD: t_expand.sh,v 1.2 2013/10/06 21:05:50 ast Exp $
+#
+# Copyright (c) 2007, 2009 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# This file tests the functions in expand.c.
+#
+
+delim_argv() {
+ str=
+ while [ $# -gt 0 ]; do
+ if [ -z "${str}" ]; then
+ str=">$1<"
+ else
+ str="${str} >$1<"
+ fi
+ shift
+ done
+ echo ${str}
+}
+
+atf_test_case dollar_at
+dollar_at_head() {
+ atf_set "descr" "Somewhere between 2.0.2 and 3.0 the expansion" \
+ "of the \$@ variable had been broken. Check for" \
+ "this behavior."
+}
+dollar_at_body() {
+ # This one should work everywhere.
+ got=`echo "" "" | sed 's,$,EOL,'`
+ atf_check_equal ' EOL' '$got'
+
+ # This code triggered the bug.
+ set -- "" ""
+ got=`echo "$@" | sed 's,$,EOL,'`
+ atf_check_equal ' EOL' '$got'
+
+ set -- -
+ shift
+ n_arg() { echo $#; }
+ n_args=`n_arg "$@"`
+ atf_check_equal '0' '$n_args'
+}
+
+atf_test_case dollar_at_with_text
+dollar_at_with_text_head() {
+ atf_set "descr" "Test \$@ expansion when it is surrounded by text" \
+ "within the quotes. PR bin/33956."
+}
+dollar_at_with_text_body() {
+ set --
+ atf_check_equal '' "$(delim_argv "$@")"
+ atf_check_equal '>foobar<' "$(delim_argv "foo$@bar")"
+ atf_check_equal '>foo bar<' "$(delim_argv "foo $@ bar")"
+
+ set -- a b c
+ atf_check_equal '>a< >b< >c<' "$(delim_argv "$@")"
+ atf_check_equal '>fooa< >b< >cbar<' "$(delim_argv "foo$@bar")"
+ atf_check_equal '>foo a< >b< >c bar<' "$(delim_argv "foo $@ bar")"
+}
+
+atf_test_case strip
+strip_head() {
+ atf_set "descr" "Checks that the %% operator works and strips" \
+ "the contents of a variable from the given point" \
+ "to the end"
+}
+strip_body() {
+ line='#define bindir "/usr/bin" /* comment */'
+ stripped='#define bindir "/usr/bin" '
+ atf_expect_fail "PR bin/43469"
+ atf_check_equal '$stripped' '${line%%/\**}'
+}
+
+atf_test_case varpattern_backslashes
+varpattern_backslashes_head() {
+ atf_set "descr" "Tests that protecting wildcards with backslashes" \
+ "works in variable patterns."
+}
+varpattern_backslashes_body() {
+ line='/foo/bar/*/baz'
+ stripped='/foo/bar/'
+ atf_check_equal $stripped ${line%%\**}
+}
+
+atf_test_case arithmetic
+arithmetic_head() {
+ atf_set "descr" "POSIX requires shell arithmetic to use signed" \
+ "long or a wider type. We use intmax_t, so at" \
+ "least 64 bits should be available. Make sure" \
+ "this is true."
+}
+arithmetic_body() {
+ atf_check_equal '3' '$((1 + 2))'
+ atf_check_equal '2147483647' '$((0x7fffffff))'
+ atf_check_equal '9223372036854775807' '$(((1 << 63) - 1))'
+}
+
+atf_test_case iteration_on_null_parameter
+iteration_on_null_parameter_head() {
+ atf_set "descr" "Check iteration of \$@ in for loop when set to null;" \
+ "the error \"sh: @: parameter not set\" is incorrect." \
+ "PR bin/48202."
+}
+iteration_on_null_parameter_body() {
+ s1=`/bin/sh -uc 'N=; set -- ${N}; for X; do echo "[$X]"; done' 2>&1`
+ s2=`/bin/sh -uc 'N=; set -- ${N:-}; for X; do echo "[$X]"; done' 2>&1`
+ atf_check_equal '' '$s1'
+ atf_check_equal '[]' '$s2'
+}
+
+atf_init_test_cases() {
+ atf_add_test_case dollar_at
+ atf_add_test_case dollar_at_with_text
+ atf_add_test_case strip
+ atf_add_test_case varpattern_backslashes
+ atf_add_test_case arithmetic
+ atf_add_test_case iteration_on_null_parameter
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_fsplit.sh b/contrib/netbsd-tests/bin/sh/t_fsplit.sh
new file mode 100755
index 0000000..2c3dbae
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_fsplit.sh
@@ -0,0 +1,186 @@
+# $NetBSD: t_fsplit.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+# The standard
+# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
+# explains (section 2.6) that Field splitting should be performed on the
+# result of variable expansions.
+# In particular this means that in ${x-word}, 'word' must be expanded as if
+# the "${x-" and "}" were absent from the input line.
+#
+# So: sh -c 'set ${x-a b c}; echo $#' should give 3.
+#
+
+nl='
+'
+
+check()
+{
+ result="$(eval $1)"
+ # Remove newlines
+ oifs="$IFS"
+ IFS="$nl"
+ result="$(echo $result)"
+ IFS="$oifs"
+ if [ "$2" != "$result" ]
+ then
+ atf_fail "expected [$2], found [$result]"
+ fi
+}
+
+atf_test_case for
+for_head() {
+ atf_set "descr" "Checks field splitting in for loops"
+}
+for_body() {
+ unset x
+
+ # Since I managed to break this, leave the test in
+ check 'for f in $x; do echo x${f}y; done' ''
+}
+
+atf_test_case default_val
+default_val_head() {
+ atf_set "descr" "Checks field splitting in variable default values"
+}
+default_val_body() {
+ unset x
+
+ # Check that IFS is applied to text from ${x-...} unless it is inside
+ # any set of "..."
+ check 'set ${x-a b c}; echo $#' 3
+ check 'for i in ${x-a b c}; do echo "z${i}z"; done' 'zaz zbz zcz'
+ check 'for i in ${x-"a b" c}; do echo "z${i}z"; done' 'za bz zcz'
+ check 'for i in ${x-"a ${x-b c}" d}; do echo "z${i}z"; done' 'za b cz zdz'
+ check 'for i in ${x-"a ${x-"b c"}" d}; do echo "z${i}z"; done' 'za b cz zdz'
+ check 'for i in ${x-a ${x-"b c"} d}; do echo "z${i}z"; done' 'zaz zb cz zdz'
+ check 'for i in ${x-a ${x-b c} d}; do echo "z${i}z"; done' 'zaz zbz zcz zdz'
+}
+
+atf_test_case ifs_alpha
+ifs_alpha_head() {
+ atf_set "descr" "Checks that field splitting works with alphabetic" \
+ "characters"
+}
+ifs_alpha_body() {
+ unset x
+
+ # repeat with an alphabetic in IFS
+ check 'IFS=q; set ${x-aqbqc}; echo $#' 3
+ check 'IFS=q; for i in ${x-aqbqc}; do echo "z${i}z"; done' 'zaz zbz zcz'
+ check 'IFS=q; for i in ${x-"aqb"qc}; do echo "z${i}z"; done' 'zaqbz zcz'
+ check 'IFS=q; for i in ${x-"aq${x-bqc}"qd}; do echo "z${i}z"; done' 'zaqbqcz zdz'
+ check 'IFS=q; for i in ${x-"aq${x-"bqc"}"qd}; do echo "z${i}z"; done' 'zaqbqcz zdz'
+ check 'IFS=q; for i in ${x-aq${x-"bqc"}qd}; do echo "z${i}z"; done' 'zaz zbqcz zdz'
+}
+
+atf_test_case quote
+quote_head() {
+ atf_set "descr" "Checks that field splitting works with multi-word" \
+ "fields"
+}
+quote_body() {
+ unset x
+
+ # Some quote propagation checks
+ check 'set "${x-a b c}"; echo $#' 1
+ check 'set "${x-"a b" c}"; echo $1' 'a b c'
+ check 'for i in "${x-a b c}"; do echo "z${i}z"; done' 'za b cz'
+}
+
+atf_test_case dollar_at
+dollar_at_head() {
+ atf_set "descr" "Checks that field splitting works when expanding" \
+ "\$@"
+}
+dollar_at_body() {
+ unset x
+
+ # Check we get "$@" right
+ check 'set ""; for i; do echo "z${i}z"; done' 'zz'
+ check 'set ""; for i in "$@"; do echo "z${i}z"; done' 'zz'
+ check 'set "" ""; for i; do echo "z${i}z"; done' 'zz zz'
+ check 'set "" ""; for i in "$@"; do echo "z${i}z"; done' 'zz zz'
+ check 'set "" ""; for i in $@; do echo "z${i}z"; done' ''
+ check 'set "a b" c; for i; do echo "z${i}z"; done' 'za bz zcz'
+ check 'set "a b" c; for i in "$@"; do echo "z${i}z"; done' 'za bz zcz'
+ check 'set "a b" c; for i in $@; do echo "z${i}z"; done' 'zaz zbz zcz'
+ check 'set " a b " c; for i in "$@"; do echo "z${i}z"; done' 'z a b z zcz'
+ check 'set --; for i in x"$@"x; do echo "z${i}z"; done' 'zxxz'
+ check 'set a; for i in x"$@"x; do echo "z${i}z"; done' 'zxaxz'
+ check 'set a b; for i in x"$@"x; do echo "z${i}z"; done' 'zxaz zbxz'
+}
+
+atf_test_case ifs
+ifs_head() {
+ atf_set "descr" "Checks that IFS correctly configures field" \
+ "splitting behavior"
+}
+ifs_body() {
+ unset x
+
+ # Some IFS tests
+ check 't="-- "; IFS=" "; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '0'
+ check 't=" x"; IFS=" x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '1'
+ check 't=" x "; IFS=" x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '1'
+ check 't=axb; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '2 a:b'
+ check 't="a x b"; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '2 a : b'
+ check 't="a xx b"; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '3 a :: b'
+ check 't="a xx b"; IFS="x "; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '3 a::b'
+ # A recent 'clarification' means that a single trailing IFS non-whitespace
+ # doesn't generate an empty parameter
+ check 't="xax"; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '2 :a'
+ check 't="xax "; IFS="x "; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '2 :a'
+ # Verify that IFS isn't being applied where it shouldn't be.
+ check 'IFS="x"; set axb; IFS=":"; r="$*"; IFS=; echo $# $r' '1 axb'
+}
+
+atf_test_case var_length
+var_length_head() {
+ atf_set "descr" "Checks that field splitting works when expanding" \
+ "a variable's length"
+}
+var_length_body() {
+ unset x
+
+ # Check that we apply IFS to ${#var}
+ long=12345678123456781234567812345678
+ long=$long$long$long$long
+ check 'echo ${#long}; IFS=2; echo ${#long}; set 1 ${#long};echo $#' '128 1 8 3'
+ check 'IFS=2; set ${x-${#long}}; IFS=" "; echo $* $#' '1 8 2'
+ check 'IFS=2; set ${x-"${#long}"}; IFS=" "; echo $* $#' '128 1'
+}
+
+atf_init_test_cases() {
+ atf_add_test_case for
+ atf_add_test_case default_val
+ atf_add_test_case ifs_alpha
+ atf_add_test_case quote
+ atf_add_test_case dollar_at
+ atf_add_test_case ifs
+ atf_add_test_case var_length
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_here.sh b/contrib/netbsd-tests/bin/sh/t_here.sh
new file mode 100755
index 0000000..250c686
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_here.sh
@@ -0,0 +1,73 @@
+# $NetBSD: t_here.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+nl='
+'
+
+check()
+{
+ SVIFS="$IFS"
+ result="$(eval $1)"
+ # Remove newlines
+ oifs="$IFS"
+ IFS="$nl"
+ result="$(echo $result)"
+ IFS="$oifs"
+ if [ "$2" != "$result" ]
+ then
+ atf_fail "expected [$2], found [$result]"
+ fi
+ IFS="$SVIFS"
+}
+
+atf_test_case all
+all_head() {
+ atf_set "descr" "Basic tests for here documents"
+}
+all_body() {
+ y=x
+
+ IFS=
+ check 'x=`cat <<EOF'$nl'text'${nl}EOF$nl'`; echo $x' 'text'
+ check 'x=`cat <<\EOF'$nl'text'${nl}EOF$nl'`; echo $x' 'text'
+
+ check 'x=`cat <<EOF'$nl'te${y}t'${nl}EOF$nl'`; echo $x' 'text'
+ check 'x=`cat <<\EOF'$nl'te${y}t'${nl}EOF$nl'`; echo $x' 'te${y}t'
+ check 'x=`cat <<"EOF"'$nl'te${y}t'${nl}EOF$nl'`; echo $x' 'te${y}t'
+ check 'x=`cat <<'"'EOF'"$nl'te${y}t'${nl}EOF$nl'`; echo $x' 'te${y}t'
+
+ check 'x=`cat <<EOF'$nl'te'"'"'xt'${nl}EOF$nl'`; echo $x' 'te'"'"'xt'
+ check 'x=`cat <<\EOF'$nl'te'"'"'xt'${nl}EOF$nl'`; echo $x' 'te'"'"'xt'
+ check 'x=`cat <<"EOF"'$nl'te'"'"'xt'${nl}EOF$nl'`; echo $x' 'te'"'"'xt'
+
+ check 'x=`cat <<EOF'$nl'te'"'"'${y}t'${nl}EOF$nl'`; echo $x' 'te'"'"'xt'
+ check 'x=`cat <<EOF'$nl'te'"''"'${y}t'${nl}EOF$nl'`; echo $x' 'te'"''"'xt'
+}
+
+atf_init_test_cases() {
+ atf_add_test_case all
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_set_e.sh b/contrib/netbsd-tests/bin/sh/t_set_e.sh
new file mode 100755
index 0000000..8dfe6e4
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_set_e.sh
@@ -0,0 +1,289 @@
+# $NetBSD: t_set_e.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+# references:
+# http://www.opengroup.org/onlinepubs/009695399/utilities/set.html
+# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
+
+# the implementation of "sh" to test
+: ${TEST_SH:="sh"}
+
+failwith()
+{
+ case "$SH_FAILS" in
+ "") SH_FAILS=`echo "$1"`;;
+ *) SH_FAILS="$SH_FAILS"`echo; echo "$1"`;;
+ esac
+}
+
+check1()
+{
+ #echo "$TEST_SH -c $1"
+ result=`$TEST_SH -c "$1" 2>/dev/null | tr '\n' ' ' | sed 's/ *$//'`
+ if [ "$result" != "$2" ]; then
+ MSG=`printf "%-56s %-8s %s" "$3" "$result" "$2"`
+ failwith "$MSG"
+ failcount=`expr $failcount + 1`
+ fi
+ count=`expr $count + 1`
+}
+
+# direct check: try the given expression.
+dcheck()
+{
+ check1 "$1" "$2" "$1"
+}
+
+# eval check: indirect through eval.
+# as of this writing, this changes the behavior pretty drastically and
+# is thus important to test. (PR bin/29861)
+echeck()
+{
+ check1 'eval '"'($1)'" "$2" "eval '($1)'"
+}
+
+atf_test_case all
+all_head() {
+ atf_set "descr" "Tests that 'set -e' works correctly"
+}
+all_body() {
+ count=0
+ failcount=0
+
+ # make sure exiting from a subshell behaves as expected
+ dcheck '(set -e; exit 1; echo ERR$?); echo OK$?' 'OK1'
+ echeck '(set -e; exit 1; echo ERR$?); echo OK$?' 'OK1'
+
+ # first, check basic functioning.
+ # The ERR shouldn't print; the result of the () should be 1.
+ # Henceforth we'll assume that we don't need to check $?.
+ dcheck '(set -e; false; echo ERR$?); echo -n OK$?' 'OK1'
+ echeck '(set -e; false; echo ERR$?); echo -n OK$?' 'OK1'
+
+ # these cases should be equivalent to the preceding.
+ dcheck '(set -e; /nonexistent; echo ERR); echo OK' 'OK'
+ echeck '(set -e; /nonexistent; echo ERR); echo OK' 'OK'
+ dcheck '(set -e; nonexistent-program-on-path; echo ERR); echo OK' 'OK'
+ echeck '(set -e; nonexistent-program-on-path; echo ERR); echo OK' 'OK'
+ dcheck 'f() { false; }; (set -e; f; echo ERR); echo OK' 'OK'
+ echeck 'f() { false; }; (set -e; f; echo ERR); echo OK' 'OK'
+ dcheck 'f() { return 1; }; (set -e; f; echo ERR); echo OK' 'OK'
+ echeck 'f() { return 1; }; (set -e; f; echo ERR); echo OK' 'OK'
+
+ # but! with set -e, the false should cause an *immediate* exit.
+ # The return form should not, as such, but there's no way to
+ # distinguish it.
+ dcheck 'f() { false; echo ERR; }; (set -e; f); echo OK' 'OK'
+ echeck 'f() { false; echo ERR; }; (set -e; f); echo OK' 'OK'
+
+ # set is not scoped, so these should not exit at all.
+ dcheck 'f() { set +e; false; echo OK; }; (set -e; f); echo OK' 'OK OK'
+ echeck 'f() { set +e; false; echo OK; }; (set -e; f); echo OK' 'OK OK'
+
+ # according to the standard, only failing *simple* commands
+ # cause an exit under -e. () is not a simple command.
+ # Correct (per POSIX):
+ #dcheck '(set -e; (set +e; false; echo OK; false); echo OK)' 'OK OK'
+ #echeck '(set -e; (set +e; false; echo OK; false); echo OK)' 'OK OK'
+ # Wrong current behavior:
+ dcheck '(set -e; (set +e; false; echo OK; false); echo OK)' 'OK'
+ echeck '(set -e; (set +e; false; echo OK; false); echo OK)' 'OK'
+
+ # make sure an inner nested shell does exit though.
+ dcheck '(set -e; (false; echo ERR)); echo OK' 'OK'
+
+ # The left hand side of an || or && is explicitly tested and
+ # thus should not cause an exit. Furthermore, because a || or
+ # && expression is not a simple command, there should be no
+ # exit even if the overall result is false.
+ dcheck '(set -e; false || true; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; false || true; echo OK); echo OK' 'OK OK'
+ dcheck '(set -e; false && true; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; false && true; echo OK); echo OK' 'OK OK'
+
+ # However, the right hand side is not tested, so a failure
+ # there *should* cause an exit, regardless of whether it
+ # appears inside a non-simple command.
+ #
+ # Note that in at least one place the standard does not
+ # distinguish between the left and right hand sides of
+ # logical operators. It is possible that for strict
+ # compliance these need to not exit; however, if so that
+ # should probably be limited to when some strict-posix setting
+ # is in effect and tested accordingly.
+ #
+ dcheck '(set -e; false || false; echo ERR); echo OK' 'OK'
+ dcheck '(set -e; true && false; echo ERR); echo OK' 'OK'
+ echeck '(set -e; false || false; echo ERR); echo OK' 'OK'
+ echeck '(set -e; true && false; echo ERR); echo OK' 'OK'
+
+ # correct:
+ #dcheck '(set -e; false && false; echo ERR); echo OK' 'OK'
+ #echeck '(set -e; false && false; echo ERR); echo OK' 'OK'
+
+ # wrong current behavior:
+ dcheck '(set -e; false && false; echo ERR); echo OK' 'ERR OK'
+ echeck '(set -e; false && false; echo ERR); echo OK' 'ERR OK'
+
+ # A failure that is not reached because of short-circuit
+ # evaluation should not cause an exit, however.
+ dcheck '(set -e; true || false; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; true || false; echo OK); echo OK' 'OK OK'
+
+ # For completeness, test the other two combinations.
+ dcheck '(set -e; true || true; echo OK); echo OK' 'OK OK'
+ dcheck '(set -e; true && true; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; true || true; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; true && true; echo OK); echo OK' 'OK OK'
+
+ # likewise, none of these should exit.
+ dcheck '(set -e; while false; do :; done; echo OK); echo OK' 'OK OK'
+ dcheck '(set -e; if false; then :; fi; echo OK); echo OK' 'OK OK'
+ # problematic :-)
+ #dcheck '(set -e; until false; do :; done; echo OK); echo OK' 'OK OK'
+ dcheck '(set -e; until [ "$t" = 1 ]; do t=1; done; echo OK); echo OK' \
+ 'OK OK'
+ echeck '(set -e; while false; do :; done; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; if false; then :; fi; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; until [ "$t" = 1 ]; do t=1; done; echo OK); echo OK' \
+ 'OK OK'
+
+ # the bang operator tests its argument and thus the argument
+ # should not cause an exit. it is also not a simple command (I
+ # believe) so it also shouldn't exit even if it yields a false
+ # result.
+ dcheck '(set -e; ! false; echo OK); echo OK' 'OK OK'
+ dcheck '(set -e; ! true; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; ! false; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; ! true; echo OK); echo OK' 'OK OK'
+
+ # combined case with () and &&; the inner expression is false
+ # but does not itself exit, and the () should not cause an
+ # exit even when failing.
+ # correct:
+ #dcheck '(set -e; (false && true); echo OK); echo OK' 'OK OK'
+ #echeck '(set -e; (false && true); echo OK); echo OK' 'OK OK'
+ # wrong current behavior:
+ dcheck '(set -e; (false && true); echo OK); echo OK' 'OK'
+ echeck '(set -e; (false && true); echo OK); echo OK' 'OK'
+
+ # pipelines. only the right-hand end is significant.
+ dcheck '(set -e; false | true; echo OK); echo OK' 'OK OK'
+ echeck '(set -e; false | true; echo OK); echo OK' 'OK OK'
+ dcheck '(set -e; true | false; echo ERR); echo OK' 'OK'
+ echeck '(set -e; true | false; echo ERR); echo OK' 'OK'
+
+ dcheck '(set -e; while true | false; do :; done; echo OK); echo OK' \
+ 'OK OK'
+ dcheck '(set -e; if true | false; then :; fi; echo OK); echo OK' \
+ 'OK OK'
+
+
+ # According to dsl@ in PR bin/32282, () is not defined as a
+ # subshell, only as a grouping operator [and a scope, I guess]
+ # so the nested false ought to cause the whole shell to exit,
+ # not just the subshell. dholland@ would like to see C&V,
+ # because that seems like a bad idea. (Among other things, it
+ # would break all the above test logic, which relies on being
+ # able to isolate set -e behavior inside ().) However, I'm
+ # going to put these tests here to make sure the issue gets
+ # dealt with sometime.
+ #
+ # XXX: the second set has been disabled in the name of making
+ # all tests "pass".
+
+ # 1. error if the whole shell exits (current behavior)
+ dcheck 'echo OK; (set -e; false); echo OK' 'OK OK'
+ echeck 'echo OK; (set -e; false); echo OK' 'OK OK'
+ # 2. error if the whole shell does not exit (dsl's suggested behavior)
+ #dcheck 'echo OK; (set -e; false); echo ERR' 'OK'
+ #echeck 'echo OK; (set -e; false); echo ERR' 'OK'
+
+ # The current behavior of the shell is that it exits out as
+ # far as -e is set and then stops. This is probably a
+ # consequence of it handling () wrong, but it's a somewhat
+ # curious compromise position between 1. and 2. above.
+ dcheck '(set -e; (false; echo ERR); echo ERR); echo OK' 'OK'
+ echeck '(set -e; (false; echo ERR); echo ERR); echo OK' 'OK'
+
+ # backquote expansion (PR bin/17514)
+
+ # correct
+ #dcheck '(set -e; echo ERR `false`; echo ERR); echo OK' 'OK'
+ #dcheck '(set -e; echo ERR $(false); echo ERR); echo OK' 'OK'
+ #dcheck '(set -e; echo ERR `exit 3`; echo ERR); echo OK' 'OK'
+ #dcheck '(set -e; echo ERR $(exit 3); echo ERR); echo OK' 'OK'
+ # wrong current behavior
+ dcheck '(set -e; echo ERR `false`; echo ERR); echo OK' 'ERR ERR OK'
+ dcheck '(set -e; echo ERR $(false); echo ERR); echo OK' 'ERR ERR OK'
+ dcheck '(set -e; echo ERR `exit 3`; echo ERR); echo OK' 'ERR ERR OK'
+ dcheck '(set -e; echo ERR $(exit 3); echo ERR); echo OK' 'ERR ERR OK'
+
+ dcheck '(set -e; x=`false`; echo ERR); echo OK' 'OK'
+ dcheck '(set -e; x=$(false); echo ERR); echo OK' 'OK'
+ dcheck '(set -e; x=`exit 3`; echo ERR); echo OK' 'OK'
+ dcheck '(set -e; x=$(exit 3); echo ERR); echo OK' 'OK'
+
+ # correct
+ #echeck '(set -e; echo ERR `false`; echo ERR); echo OK' 'OK'
+ #echeck '(set -e; echo ERR $(false); echo ERR); echo OK' 'OK'
+ #echeck '(set -e; echo ERR `exit 3`; echo ERR); echo OK' 'OK'
+ #echeck '(set -e; echo ERR $(exit 3); echo ERR); echo OK' 'OK'
+
+ # wrong current behavior
+ echeck '(set -e; echo ERR `false`; echo ERR); echo OK' 'ERR ERR OK'
+ echeck '(set -e; echo ERR $(false); echo ERR); echo OK' 'ERR ERR OK'
+ echeck '(set -e; echo ERR `exit 3`; echo ERR); echo OK' 'ERR ERR OK'
+ echeck '(set -e; echo ERR $(exit 3); echo ERR); echo OK' 'ERR ERR OK'
+
+ echeck '(set -e; x=`false`; echo ERR); echo OK' 'OK'
+ echeck '(set -e; x=$(false); echo ERR); echo OK' 'OK'
+ echeck '(set -e; x=`exit 3`; echo ERR); echo OK' 'OK'
+ echeck '(set -e; x=$(exit 3); echo ERR); echo OK' 'OK'
+
+ # shift (PR bin/37493)
+ # correct
+ #dcheck '(set -e; shift || true; echo OK); echo OK' 'OK OK'
+ #echeck '(set -e; shift || true; echo OK); echo OK' 'OK OK'
+ # wrong current behavior
+ dcheck '(set -e; shift || true; echo OK); echo OK' 'OK'
+ echeck '(set -e; shift || true; echo OK); echo OK' 'OK'
+
+ # Done.
+
+ if [ "x$SH_FAILS" != x ]; then
+ printf '%-56s %-8s %s\n' "Expression" "Result" "Should be"
+ echo "$SH_FAILS"
+ atf_fail "$failcount of $count failed cases"
+ else
+ atf_pass
+ fi
+}
+
+atf_init_test_cases() {
+ atf_add_test_case all
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_ulimit.sh b/contrib/netbsd-tests/bin/sh/t_ulimit.sh
new file mode 100755
index 0000000..3e7c0a6
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_ulimit.sh
@@ -0,0 +1,46 @@
+# $NetBSD: t_ulimit.sh,v 1.1 2012/06/11 18:32:59 njoly Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, 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 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.
+#
+
+# ulimit builtin test.
+
+atf_test_case limits
+limits_head() {
+ atf_set "descr" "Checks for limits flags"
+}
+limits_body() {
+ atf_check -s eq:0 -o ignore -e empty \
+ /bin/sh -c "ulimit -a"
+ for l in $(ulimit -a | sed 's,^.*(,,;s, .*$,,');
+ do
+ atf_check -s eq:0 -o ignore -e empty \
+ /bin/sh -c "ulimit $l"
+ done
+}
+
+atf_init_test_cases() {
+ atf_add_test_case limits
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_varquote.sh b/contrib/netbsd-tests/bin/sh/t_varquote.sh
new file mode 100755
index 0000000..1768777
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_varquote.sh
@@ -0,0 +1,81 @@
+# $NetBSD: t_varquote.sh,v 1.2 2012/03/25 18:50:19 christos Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+# Variable quoting test.
+
+check() {
+ if [ "$1" != "$2" ]
+ then
+ atf_fail "expected [$2], found [$1]" 1>&2
+ fi
+}
+
+atf_test_case all
+all_head() {
+ atf_set "descr" "Basic checks for variable quoting"
+}
+all_body() {
+ foo='${a:-foo}'
+ check "$foo" '${a:-foo}'
+
+ foo="${a:-foo}"
+ check "$foo" "foo"
+
+ foo=${a:-"'{}'"}
+ check "$foo" "'{}'"
+
+ foo=${a:-${b:-"'{}'"}}
+ check "$foo" "'{}'"
+
+ foo="${a:-"'{}'"}"
+ check "$foo" "'{}'"
+
+ foo="${a:-${b:-"${c:-${d:-"x}"}}y}"}}z}"
+ # " z*"
+ # ${a:- }
+ # ${b:- }
+ # " y*"
+ # ${c:- }
+ # ${d:- }
+ # "x*"
+ check "$foo" "x}y}z}"
+}
+
+atf_test_case nested_quotes_multiword
+nested_quotes_multiword_head() {
+ atf_set "descr" "Tests that having nested quoting in a multi-word" \
+ "string works (PR bin/43597)"
+}
+nested_quotes_multiword_body() {
+ atf_check -s eq:0 -o match:"first-word second-word" -e empty \
+ /bin/sh -c 'echo "${foo:="first-word"} second-word"'
+}
+
+atf_init_test_cases() {
+ atf_add_test_case all
+ atf_add_test_case nested_quotes_multiword
+}
diff --git a/contrib/netbsd-tests/bin/sh/t_wait.sh b/contrib/netbsd-tests/bin/sh/t_wait.sh
new file mode 100755
index 0000000..99b47df
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sh/t_wait.sh
@@ -0,0 +1,59 @@
+# $NetBSD: t_wait.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case individual
+individual_head() {
+ atf_set "descr" "Tests that waiting for individual jobs works"
+}
+individual_body() {
+ # atf-sh confuses wait for some reason; work it around by creating
+ # a helper script that executes /bin/sh directly.
+ cat >helper.sh <<EOF
+sleep 3 &
+sleep 1 &
+
+wait %1
+if [ \$? -ne 0 ]; then
+ echo "Waiting of first job failed"
+ exit 1
+fi
+
+wait %2
+if [ \$? -ne 0 ]; then
+ echo "Waiting of second job failed"
+ exit 1
+fi
+
+exit 0
+EOF
+ output=$(/bin/sh helper.sh)
+ [ $? -eq 0 ] || atf_fail "${output}"
+}
+
+atf_init_test_cases() {
+ atf_add_test_case individual
+}
diff --git a/contrib/netbsd-tests/bin/sleep/t_sleep.sh b/contrib/netbsd-tests/bin/sleep/t_sleep.sh
new file mode 100755
index 0000000..d79ab67
--- /dev/null
+++ b/contrib/netbsd-tests/bin/sleep/t_sleep.sh
@@ -0,0 +1,72 @@
+# $NetBSD: t_sleep.sh,v 1.1 2012/03/30 09:27:10 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case fraction
+fraction_head() {
+ atf_set "descr" "Test that sleep(1) handles " \
+ "fractions of a second (PR bin/3914)"
+}
+
+fraction_body() {
+
+ atf_check -s exit:0 -o empty -e empty -x "sleep 0.1"
+ atf_check -s exit:0 -o empty -e empty -x "sleep 0.2"
+ atf_check -s exit:0 -o empty -e empty -x "sleep 0.3"
+}
+
+atf_test_case hex
+hex_head() {
+ atf_set "descr" "Test that sleep(1) handles hexadecimal arguments"
+}
+
+hex_body() {
+
+ atf_check -s exit:0 -o empty -e empty -x "sleep 0x01"
+}
+
+atf_test_case nonnumeric
+nonnumeric_head() {
+ atf_set "descr" "Test that sleep(1) errors out with " \
+ "non-numeric argument (PR bin/27140)"
+}
+
+nonnumeric_body() {
+
+ atf_check -s not-exit:0 -o empty -e not-empty -x "sleep xyz"
+ atf_check -s not-exit:0 -o empty -e not-empty -x "sleep x21"
+ atf_check -s not-exit:0 -o empty -e not-empty -x "sleep /3"
+}
+
+atf_init_test_cases() {
+
+ atf_add_test_case fraction
+ atf_add_test_case hex
+ atf_add_test_case nonnumeric
+}
diff --git a/contrib/netbsd-tests/bin/tar/t_tar.sh b/contrib/netbsd-tests/bin/tar/t_tar.sh
new file mode 100755
index 0000000..133d39c
--- /dev/null
+++ b/contrib/netbsd-tests/bin/tar/t_tar.sh
@@ -0,0 +1,51 @@
+# $NetBSD: t_tar.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+#
+# Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case append
+append_head() {
+ atf_set "descr" "Ensure that appending a file to an archive" \
+ "produces the same results as if the file" \
+ "had been there during the archive's creation"
+}
+append_body() {
+ touch foo bar
+
+ # store both foo and bar into file1.tar
+ atf_check -s eq:0 -o empty -e empty tar -cf file1.tar foo bar
+
+ # store foo into file2.tar, then append bar to file2.tar
+ atf_check -s eq:0 -o empty -e empty tar -cf file2.tar foo
+ atf_check -s eq:0 -o empty -e empty tar -rf file2.tar bar
+
+ # ensure that file1.tar and file2.tar are equal
+ atf_check -s eq:0 -o empty -e empty cmp file1.tar file2.tar
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case append
+}
diff --git a/contrib/netbsd-tests/crypto/libcrypto/conf/d_conf.out b/contrib/netbsd-tests/crypto/libcrypto/conf/d_conf.out
new file mode 100644
index 0000000..6bd76a2
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/libcrypto/conf/d_conf.out
@@ -0,0 +1,94 @@
+num_items = 47
+num_nodes = 24
+num_alloc_nodes = 32
+num_expands = 16
+num_expand_reallocs = 1
+num_contracts = 0
+num_contract_reallocs = 0
+num_hash_calls = 60
+num_comp_calls = 5
+num_insert = 47
+num_replace = 0
+num_delete = 0
+num_no_delete = 0
+num_retrieve = 5
+num_retrieve_miss = 8
+num_hash_comps = 132
+node 0 -> 4
+node 1 -> 1
+node 2 -> 1
+node 3 -> 4
+node 4 -> 0
+node 5 -> 2
+node 6 -> 1
+node 7 -> 1
+node 8 -> 6
+node 9 -> 2
+node 10 -> 1
+node 11 -> 1
+node 12 -> 3
+node 13 -> 1
+node 14 -> 4
+node 15 -> 3
+node 16 -> 5
+node 17 -> 0
+node 18 -> 2
+node 19 -> 0
+node 20 -> 2
+node 21 -> 2
+node 22 -> 0
+node 23 -> 1
+20 nodes used out of 24
+47 items
+load 1.95 actual load 2.35
+init2=10
+cipher1=NULL
+s_client:cipher1=DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5cipher2 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+---------------------------- DUMP ------------------------
+[req] Attribute_text_7=Email Address
+[req] Attribute_text_2=State or Province Name (full name)
+[default] tmp_cert_dir=/tmp/eay/.ca_certs
+[req] Attribute_text_1=Country Name (2 letter code)
+[[genrsa]]
+[req] Attribute_default_5=TR
+[req] Attribute_text_6=Common Name (eg, YOUR name)
+[req] Attribute_default_1=AU
+[[req]]
+[[special]]
+[[gendh]]
+[req] Attribute_text_3=Locality Name (eg, city)
+[req] Attribute_type_1=countryName
+[default] init5==10' again
+[req] Attribute_type_3=localityName
+[s_client] cipher3=DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[default] in\#it1=10
+[req] Attribute_text_4=Organization Name (eg, company)
+[req] Attribute_type_7=emailAddress
+[gendh] def_generator=2
+[default] HOME=/tmp/eay
+[s_client] cipher4=DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[default] init=5
+[SSLeay] version=0.5.0
+[req] Attribute_type_4=organizationName
+[default] tmp2_cert_dir=thisis/tmp/eaystuff
+[req] Attribute_type_5=organizationalUnitName
+[[SSLEAY]]
+[default] init4=10'
+[[default]]
+[default] LOGNAME=Eric Young (home=/tmp/eay)
+[special] RANDFILE=/tmp/eay/.rand
+[req] default_keyfile=privkey.pem
+[req] Attribute_default_4=Mincom Pty Ltd
+[req] Attribute_default_2=Queensland
+[gendh] default_bits=512
+[req] default_bits=512
+[default] init2=10
+[SSLEAY] version=0.5.0
+[s_client] cipher1=DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5cipher2 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[req] Attribute_text_5=Organizational Unit Name (eg, section)
+[req] Attribute_type_2=stateOrProvinceName
+[genrsa] default_bits=512
+[default] init3=10'
+[[SSLeay]]
+[[s_client]]
+[req] Attribute_type_6=commonName
diff --git a/contrib/netbsd-tests/crypto/libcrypto/conf/d_conf_ssleay.cnf b/contrib/netbsd-tests/crypto/libcrypto/conf/d_conf_ssleay.cnf
new file mode 100644
index 0000000..3fdde34
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/libcrypto/conf/d_conf_ssleay.cnf
@@ -0,0 +1,78 @@
+#
+# This is a test configuration file for use in SSLeay etc...
+#
+
+init = 5
+in\#it1 =10
+init2='10'
+init3='10\''
+init4="10'"
+init5='='10\'' again'
+
+SSLeay::version = 0.5.0
+
+[genrsa]
+default_bits = 512
+SSLEAY::version = 0.5.0
+
+[gendh]
+default_bits = 512
+def_generator = 2
+
+[s_client]
+cipher1 = DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5\
+cipher2 = 'DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5'
+cipher3 = "DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5"
+cipher4 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+
+[ default ]
+#cert_dir = $ENV::HOME/.ca_certs
+
+HOME = /tmp/eay
+
+tmp_cert_dir = $HOME/.ca_certs
+tmp2_cert_dir = thisis$(HOME)stuff
+
+LOGNAME = Eric Young (home=$HOME)
+
+[ special ]
+
+#H=$HOME
+#H=$default::HOME
+#H=$ENV::HOME
+#
+# SSLeay example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+RANDFILE = $HOME/.rand
+
+[ req ]
+default_bits = 512
+default_keyfile = privkey.pem
+
+Attribute_type_1 = countryName
+Attribute_text_1 = Country Name (2 letter code)
+Attribute_default_1 = AU
+
+Attribute_type_2 = stateOrProvinceName
+Attribute_text_2 = State or Province Name (full name)
+Attribute_default_2 = Queensland
+
+Attribute_type_3 = localityName
+Attribute_text_3 = Locality Name (eg, city)
+
+Attribute_type_4 = organizationName
+Attribute_text_4 = Organization Name (eg, company)
+Attribute_default_4 = Mincom Pty Ltd
+
+Attribute_type_5 = organizationalUnitName
+Attribute_text_5 = Organizational Unit Name (eg, section)
+Attribute_default_5 = TR
+
+Attribute_type_6 = commonName
+Attribute_text_6 = Common Name (eg, YOUR name)
+
+Attribute_type_7 = emailAddress
+Attribute_text_7 = Email Address
+
diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_certs.sh b/contrib/netbsd-tests/crypto/libcrypto/t_certs.sh
new file mode 100755
index 0000000..6965a57
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/libcrypto/t_certs.sh
@@ -0,0 +1,41 @@
+# $NetBSD: t_certs.sh,v 1.1 2010/07/10 16:43:25 jmmv Exp $
+#
+# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case x509v3
+x509v3_head()
+{
+ atf_set "descr" "Checks x509v3 certificates"
+}
+x509v3_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_x509v3test"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case x509v3
+}
diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_ciphers.sh b/contrib/netbsd-tests/crypto/libcrypto/t_ciphers.sh
new file mode 100755
index 0000000..1270407
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/libcrypto/t_ciphers.sh
@@ -0,0 +1,122 @@
+# $NetBSD: t_ciphers.sh,v 1.4 2012/07/14 16:04:06 spz Exp $
+#
+# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case bf
+bf_head()
+{
+ atf_set "descr" "Checks blowfish cipher"
+}
+bf_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_bftest"
+}
+
+atf_test_case cast
+cast_head()
+{
+ atf_set "descr" "Checks CAST cipher"
+ atf_set "timeout" "300"
+}
+cast_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_casttest"
+}
+
+atf_test_case des
+des_head()
+{
+ atf_set "descr" "Checks DES cipher (libdes)"
+}
+des_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_destest"
+}
+
+atf_test_case evp
+evp_head()
+{
+ atf_set "descr" "Checks EVP cipher"
+}
+evp_body()
+{
+ atf_check -o ignore -e ignore $(atf_get_srcdir)/h_evp_test $(atf_get_srcdir)/evptests.txt
+}
+
+atf_test_case rc2
+rc2_head()
+{
+ atf_set "descr" "Checks RC2 cipher"
+}
+rc2_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_rc2test"
+}
+
+atf_test_case rc4
+rc4_head()
+{
+ atf_set "descr" "Checks RC4 cipher"
+}
+rc4_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_rc4test"
+}
+
+atf_test_case idea
+idea_head()
+{
+ atf_set "descr" "Checks IDEA cipher"
+}
+idea_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_ideatest"
+}
+
+atf_test_case rc5
+rc5_head()
+{
+ atf_set "descr" "Checks RC5 cipher"
+}
+rc5_body()
+{
+ [ -x "$(atf_get_srcdir)/h_rc5test" ] \
+ || atf_skip "RC5 support not available; system built" \
+ "with MKCRYPTO_RC5=no"
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_rc5test"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case bf
+ atf_add_test_case cast
+ atf_add_test_case des
+ atf_add_test_case evp
+ atf_add_test_case rc2
+ atf_add_test_case rc4
+ atf_add_test_case idea
+ atf_add_test_case rc5
+}
diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_hashes.sh b/contrib/netbsd-tests/crypto/libcrypto/t_hashes.sh
new file mode 100755
index 0000000..700dbdb
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/libcrypto/t_hashes.sh
@@ -0,0 +1,108 @@
+# $NetBSD: t_hashes.sh,v 1.2 2012/07/14 16:04:06 spz Exp $
+#
+# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case hmac
+hmac_head()
+{
+ atf_set "descr" "Checks HMAC message authentication code"
+}
+hmac_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_hmactest"
+}
+
+atf_test_case md2
+md2_head()
+{
+ atf_set "descr" "Checks MD2 digest"
+}
+md2_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_md2test"
+}
+
+atf_test_case md4
+md4_head()
+{
+ atf_set "descr" "Checks MD4 digest"
+}
+md4_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_md4test"
+}
+
+atf_test_case md5
+md5_head()
+{
+ atf_set "descr" "Checks MD5 digest"
+}
+md5_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_md5test"
+}
+
+atf_test_case ripemd
+ripemd_head()
+{
+ atf_set "descr" "Checks RMD-160 digest"
+}
+ripemd_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_ripemdtest"
+}
+
+atf_test_case sha
+sha_head()
+{
+ atf_set "descr" "Checks SHA-1 digest"
+}
+sha_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_shatest"
+}
+
+
+atf_test_case mdc2
+mdc2_head()
+{
+ atf_set "descr" "Checks MDC2 digest"
+}
+mdc2_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_mdc2test"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case hmac
+ atf_add_test_case md2
+ atf_add_test_case md4
+ atf_add_test_case md5
+ atf_add_test_case ripemd
+ atf_add_test_case sha
+ atf_add_test_case mdc2
+}
diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh b/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh
new file mode 100755
index 0000000..aa7af27
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh
@@ -0,0 +1,107 @@
+# $NetBSD: t_libcrypto.sh,v 1.3 2010/11/08 19:06:12 pooka Exp $
+#
+# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case engine
+engine_head()
+{
+ atf_set "descr" "Checks ENGINE framework"
+}
+engine_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_enginetest"
+}
+
+atf_test_case rand
+rand_head()
+{
+ atf_set "descr" "Checks peudo-random number generator"
+}
+rand_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_randtest"
+}
+
+atf_test_case bn
+bn_head()
+{
+ atf_set "descr" "Checks BIGNUM library"
+ atf_set "timeout" "300"
+}
+bn_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_bntest"
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_divtest"
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_exptest"
+}
+
+atf_test_case conf
+conf_head()
+{
+ atf_set "descr" "Checks configuration modules"
+}
+conf_body()
+{
+ cp $(atf_get_srcdir)/d_conf_ssleay.cnf ssleay.cnf
+
+ atf_check -o file:$(atf_get_srcdir)/d_conf.out \
+ $(atf_get_srcdir)/h_conftest
+}
+
+atf_test_case lhash
+lhash_head()
+{
+ atf_set "descr" "Checks lhash - dynamic hash tables"
+}
+lhash_body()
+{
+ atf_check -o ignore -e ignore -x \
+ "echo hoge | $(atf_get_srcdir)/h_lhashtest"
+}
+
+atf_test_case threads
+threads_head()
+{
+ atf_set "descr" "Checks threading"
+}
+threads_body()
+{
+ $(atf_get_srcdir)/h_threadstest \
+ -cert $(atf_get_srcdir)/d_server.pem \
+ -ccert $(atf_get_srcdir)/d_client.pem \
+ 2>&1 | tee out
+ atf_check -s eq:1 -o empty -e empty grep :error: out
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case engine
+ atf_add_test_case rand
+ atf_add_test_case bn
+ atf_add_test_case conf
+ atf_add_test_case lhash
+ atf_add_test_case threads
+}
diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh b/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh
new file mode 100755
index 0000000..1453e75
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh
@@ -0,0 +1,110 @@
+# $NetBSD: t_pubkey.sh,v 1.3 2011/06/09 05:25:21 spz Exp $
+#
+# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case dsa
+dsa_head()
+{
+ atf_set "descr" "Checks DSA cipher"
+}
+dsa_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_dsatest"
+}
+
+atf_test_case dh
+dh_head()
+{
+ atf_set "descr" "Checks Diffie-Hellman key agreement protocol"
+}
+dh_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_dhtest"
+}
+
+atf_test_case rsa
+rsa_head()
+{
+ atf_set "descr" "Checks RSA"
+ atf_set "timeout" "300"
+}
+rsa_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_rsatest"
+}
+
+atf_test_case ec
+ec_head()
+{
+ atf_set "descr" "Checks EC cipher"
+ atf_set "timeout" "300"
+}
+ec_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_ectest"
+}
+
+atf_test_case ecdh
+ecdh_head()
+{
+ atf_set "descr" "Checks ECDH key agreement protocol"
+}
+ecdh_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_ecdhtest"
+}
+
+atf_test_case ecdsa
+ecdsa_head()
+{
+ atf_set "descr" "Checks ECDSA algorithm"
+ atf_set "timeout" "300"
+}
+ecdsa_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_ecdsatest"
+}
+
+atf_test_case srp
+srp_head()
+{
+ atf_set "descr" "Checks SRP key agreement protocol"
+}
+srp_body()
+{
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_srptest"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case dsa
+ atf_add_test_case dh
+ atf_add_test_case rsa
+ atf_add_test_case ec
+ atf_add_test_case ecdh
+ atf_add_test_case ecdsa
+ atf_add_test_case srp
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_aesctr1.c b/contrib/netbsd-tests/crypto/opencrypto/h_aesctr1.c
new file mode 100644
index 0000000..41d866c
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_aesctr1.c
@@ -0,0 +1,250 @@
+/* $NetBSD: h_aesctr1.c,v 1.4 2014/01/19 13:40:59 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+/*
+ * Test vectors from RFC 3686
+ *
+ * Test vectors 3, 6, and 9 are disabled because we don't support
+ * 36-byte (ie, unpadded) operations.
+ */
+
+const struct {
+ size_t len;
+ size_t key_len;
+ unsigned char key[36]; /* Includes 32-bit nonce */
+ unsigned char iv[8];
+ unsigned char plaintx[36];
+ unsigned char ciphertx[36];
+} tests[] = {
+ /* Test Vector #1: Encrypting 16 octets using AES-CTR w/ 128-bit key*/
+ { 16, 20,
+ { 0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC,
+ 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E,
+ 0x00, 0x00, 0x00, 0x30 },
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62,
+ 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67 },
+ { 0xE4, 0x09, 0x5D, 0x4F, 0xB7, 0xA7, 0xB3, 0x79,
+ 0x2D, 0x61, 0x75, 0xA3, 0x26, 0x13, 0x11, 0xB8 }
+ },
+
+ /* Test Vector #2: Encrypting 32 octets using AES-CTR w/ 128-bit key */
+ { 32, 20,
+ { 0x7E, 0x24, 0x06, 0x78, 0x17, 0xFA, 0xE0, 0xD7,
+ 0x43, 0xD6, 0xCE, 0x1F, 0x32, 0x53, 0x91, 0x63,
+ 0x00, 0x6C, 0xB6, 0xDB },
+ { 0xC0, 0x54, 0x3B, 0x59, 0xDA, 0x48, 0xD9, 0x0B },
+ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F },
+ { 0x51, 0x04, 0xA1, 0x06, 0x16, 0x8A, 0x72, 0xD9,
+ 0x79, 0x0D, 0x41, 0xEE, 0x8E, 0xDA, 0xD3, 0x88,
+ 0xEB, 0x2E, 0x1E, 0xFC, 0x46, 0xDA, 0x57, 0xC8,
+ 0xFC, 0xE6, 0x30, 0xDF, 0x91, 0x41, 0xBE, 0x28 }
+ },
+
+ /* Test Vector #3: Encrypting 36 octets using AES-CTR w/ 128-bit key */
+/* { 36, 20,
+ { 0x76, 0x91, 0xBE, 0x03, 0x5E, 0x50, 0x20, 0xA8,
+ 0xAC, 0x6E, 0x61, 0x85, 0x29, 0xF9, 0xA0, 0xDC,
+ 0x00, 0xE0, 0x01, 0x7B },
+ { 0x27, 0x77, 0x7F, 0x3F, 0x4A, 0x17, 0x86, 0xF0 },
+ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+ 0x20, 0x21, 0x22, 0x23 },
+ { 0xC1, 0xCF, 0x48, 0xA8, 0x9F, 0x2F, 0xFD, 0xD9,
+ 0xCF, 0x46, 0x52, 0xE9, 0xEF, 0xDB, 0x72, 0xD7,
+ 0x45, 0x40, 0xA4, 0x2B, 0xDE, 0x6D, 0x78, 0x36,
+ 0xD5, 0x9A, 0x5C, 0xEA, 0xAE, 0xF3, 0x10, 0x53,
+ 0x25, 0xB2, 0x07, 0x2F }
+ },
+*/
+ /* Test Vector #4: Encrypting 16 octets using AES-CTR w/ 192-bit key */
+ { 16, 28,
+ { 0x16, 0xAF, 0x5B, 0x14, 0x5F, 0xC9, 0xF5, 0x79,
+ 0xC1, 0x75, 0xF9, 0x3E, 0x3B, 0xFB, 0x0E, 0xED,
+ 0x86, 0x3D, 0x06, 0xCC, 0xFD, 0xB7, 0x85, 0x15,
+ 0x00, 0x00, 0x00, 0x48 },
+ { 0x36, 0x73, 0x3C, 0x14, 0x7D, 0x6D, 0x93, 0xCB },
+ { 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62,
+ 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67 },
+ { 0x4B, 0x55, 0x38, 0x4F, 0xE2, 0x59, 0xC9, 0xC8,
+ 0x4E, 0x79, 0x35, 0xA0, 0x03, 0xCB, 0xE9, 0x28 }
+ },
+
+ /* Test Vector #5: Encrypting 32 octets using AES-CTR w/ 192-bit key */
+ { 32, 28,
+ { 0x7C, 0x5C, 0xB2, 0x40, 0x1B, 0x3D, 0xC3, 0x3C,
+ 0x19, 0xE7, 0x34, 0x08, 0x19, 0xE0, 0xF6, 0x9C,
+ 0x67, 0x8C, 0x3D, 0xB8, 0xE6, 0xF6, 0xA9, 0x1A,
+ 0x00, 0x96, 0xB0, 0x3B },
+ { 0x02, 0x0C, 0x6E, 0xAD, 0xC2, 0xCB, 0x50, 0x0D },
+ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F },
+ { 0x45, 0x32, 0x43, 0xFC, 0x60, 0x9B, 0x23, 0x32,
+ 0x7E, 0xDF, 0xAA, 0xFA, 0x71, 0x31, 0xCD, 0x9F,
+ 0x84, 0x90, 0x70, 0x1C, 0x5A, 0xD4, 0xA7, 0x9C,
+ 0xFC, 0x1F, 0xE0, 0xFF, 0x42, 0xF4, 0xFB, 0x00 }
+ },
+
+ /* Test Vector #6: Encrypting 36 octets using AES-CTR w/ 192-bit key */
+/*
+ { 36, 28,
+ { 0x02, 0xBF, 0x39, 0x1E, 0xE8, 0xEC, 0xB1, 0x59,
+ 0xB9, 0x59, 0x61, 0x7B, 0x09, 0x65, 0x27, 0x9B,
+ 0xF5, 0x9B, 0x60, 0xA7, 0x86, 0xD3, 0xE0, 0xFE,
+ 0x00, 0x07, 0xBD, 0xFD },
+ { 0x5C, 0xBD, 0x60, 0x27, 0x8D, 0xCC, 0x09, 0x12 },
+ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+ 0x20, 0x21, 0x22, 0x23 },
+ { 0x96, 0x89, 0x3F, 0xC5, 0x5E, 0x5C, 0x72, 0x2F,
+ 0x54, 0x0B, 0x7D, 0xD1, 0xDD, 0xF7, 0xE7, 0x58,
+ 0xD2, 0x88, 0xBC, 0x95, 0xC6, 0x91, 0x65, 0x88,
+ 0x45, 0x36, 0xC8, 0x11, 0x66, 0x2F, 0x21, 0x88,
+ 0xAB, 0xEE, 0x09, 0x35 },
+ },
+*/
+ /* Test Vector #7: Encrypting 16 octets using AES-CTR w/ 256-bit key */
+ { 16, 36,
+ { 0x77, 0x6B, 0xEF, 0xF2, 0x85, 0x1D, 0xB0, 0x6F,
+ 0x4C, 0x8A, 0x05, 0x42, 0xC8, 0x69, 0x6F, 0x6C,
+ 0x6A, 0x81, 0xAF, 0x1E, 0xEC, 0x96, 0xB4, 0xD3,
+ 0x7F, 0xC1, 0xD6, 0x89, 0xE6, 0xC1, 0xC1, 0x04,
+ 0x00, 0x00, 0x00, 0x60 },
+ { 0xDB, 0x56, 0x72, 0xC9, 0x7A, 0xA8, 0xF0, 0xB2 },
+ { 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62,
+ 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67 },
+ { 0x14, 0x5A, 0xD0, 0x1D, 0xBF, 0x82, 0x4E, 0xC7,
+ 0x56, 0x08, 0x63, 0xDC, 0x71, 0xE3, 0xE0, 0xC0 },
+ },
+
+ /* Test Vector #8: Encrypting 32 octets using AES-CTR w/ 256-bit key */
+ { 32, 36,
+ { 0xF6, 0xD6, 0x6D, 0x6B, 0xD5, 0x2D, 0x59, 0xBB,
+ 0x07, 0x96, 0x36, 0x58, 0x79, 0xEF, 0xF8, 0x86,
+ 0xC6, 0x6D, 0xD5, 0x1A, 0x5B, 0x6A, 0x99, 0x74,
+ 0x4B, 0x50, 0x59, 0x0C, 0x87, 0xA2, 0x38, 0x84,
+ 0x00, 0xFA, 0xAC, 0x24 },
+ { 0xC1, 0x58, 0x5E, 0xF1, 0x5A, 0x43, 0xD8, 0x75 },
+ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F },
+ { 0xF0, 0x5E, 0x23, 0x1B, 0x38, 0x94, 0x61, 0x2C,
+ 0x49, 0xEE, 0x00, 0x0B, 0x80, 0x4E, 0xB2, 0xA9,
+ 0xB8, 0x30, 0x6B, 0x50, 0x8F, 0x83, 0x9D, 0x6A,
+ 0x55, 0x30, 0x83, 0x1D, 0x93, 0x44, 0xAF, 0x1C },
+ },
+
+ /* Test Vector #9: Encrypting 36 octets using AES-CTR w/ 256-bit key */
+/*
+ { 36, 36,
+ { 0xFF 0x7A 0x61 0x7C 0xE6 0x91 0x48 0xE4,
+ 0xF1 0x72 0x6E 0x2F 0x43 0x58 0x1D 0xE2,
+ 0xAA 0x62 0xD9 0xF8 0x05 0x53 0x2E 0xDF,
+ 0xF1 0xEE 0xD6 0x87 0xFB 0x54 0x15 0x3D,
+ 0x00 0x1C 0xC5 0xB7 },
+ { 0x51 0xA5 0x1D 0x70 0xA1 0xC1 0x11 0x48 },
+ { 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07,
+ 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F,
+ 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17,
+ 0x18 0x19 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F,
+ 0x20 0x21 0x22 0x23 },
+ { 0xEB 0x6C 0x52 0x82 0x1D 0x0B 0xBB 0xF7,
+ 0xCE 0x75 0x94 0x46 0x2A 0xCA 0x4F 0xAA,
+ 0xB4 0x07 0xDF 0x86 0x65 0x69 0xFD 0x07,
+ 0xF4 0x8C 0xC0 0xB5 0x83 0xD6 0x07 0x1F,
+ 0x1E 0xC0 0xE6 0xB8 },
+ },
+*/
+};
+
+int
+main(void)
+{
+ int fd, res;
+ size_t i;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[36];
+
+ for (i = 0; i < __arraycount(tests); i++) {
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open %zu", i);
+ memset(&cs, 0, sizeof(cs));
+ cs.cipher = CRYPTO_AES_CTR;
+ cs.keylen = tests[i].key_len;
+ cs.key = __UNCONST(&tests[i].key);
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION %zu", i);
+
+ memset(&co, 0, sizeof(co));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = tests[i].len;
+ co.src = __UNCONST(&tests[i].plaintx);
+ co.dst = buf;
+ co.dst_len = sizeof(buf);
+ co.iv = __UNCONST(&tests[i].iv);
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT %zu", i);
+
+ if (memcmp(co.dst, tests[i].ciphertx, tests[i].len)) {
+ size_t j;
+ printf(" Loc Actual Golden\n");
+ for (j = 0; j < tests[i].len; j++)
+ printf("0x%2zu: 0x%2x 0x%2x\n", j,
+ buf[j], tests[i].ciphertx[j]);
+ warnx("verification failed %zu", i);
+ }
+ close(fd);
+ }
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_aesctr2.c b/contrib/netbsd-tests/crypto/opencrypto/h_aesctr2.c
new file mode 100644
index 0000000..4bbd30e
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_aesctr2.c
@@ -0,0 +1,97 @@
+/* $NetBSD: h_aesctr2.c,v 1.2 2014/01/17 14:16:08 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+unsigned char key[20] = {0xae, 0x68, 0x52, 0xf8, 0x12, 0x10, 0x67, 0xcc,
+ 0x4b, 0xf7, 0xa5, 0x76, 0x55, 0x77, 0xf3, 0x9e,
+ 0x00, 0x00, 0x00, 0x30};
+unsigned char iv[8] = {0};
+char plaintx[16] = "Single block msg";
+const unsigned char ciphertx[16] = {
+ 0xe4, 0x09, 0x5d, 0x4f, 0xb7, 0xa7, 0xb3, 0x79,
+ 0x2d, 0x61, 0x75, 0xa3, 0x26, 0x13, 0x11, 0xb8
+};
+
+int
+main(void)
+{
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char ibuf[24];
+ unsigned char obuf[24];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.cipher = CRYPTO_AES_CTR;
+ cs.keylen = 20;
+ cs.key = key;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memcpy(ibuf, iv, 8);
+ memcpy(ibuf + 8, plaintx, 16);
+ memset(&co, 0, sizeof(co));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = sizeof(ibuf);
+ co.src = ibuf;
+ co.dst = obuf;
+ co.dst_len = sizeof(obuf);
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+ memset(ibuf, 0, sizeof(ibuf));
+ memset(&co, 0, sizeof(co));
+ co.ses = cs.ses;
+ co.op = COP_DECRYPT;
+ co.len = sizeof(obuf);
+ co.src = obuf;
+ co.dst = ibuf;
+ co.dst_len = sizeof(ibuf);
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+
+ if (memcmp((char *)co.dst + 8, plaintx, sizeof(plaintx)))
+ warnx("verification failed");
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_arc4.c b/contrib/netbsd-tests/crypto/opencrypto/h_arc4.c
new file mode 100644
index 0000000..4bf8428
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_arc4.c
@@ -0,0 +1,80 @@
+/* $NetBSD: h_arc4.c,v 1.2 2014/01/17 14:16:08 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+unsigned char key[] = "abcdefgh";
+char plaintx[16] = "1234567890123456";
+const unsigned char ciphertx[16] = {
+ 0x21, 0xc6, 0x0d, 0xa5, 0x34, 0x24, 0x8b, 0xce,
+ 0x95, 0x86, 0x64, 0xb3, 0x66, 0x77, 0x9b, 0x4c
+};
+
+int
+main(void)
+{
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[16];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.cipher = CRYPTO_ARC4;
+ cs.keylen = 8;
+ cs.key = key;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memset(&co, 0, sizeof(co));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = sizeof(plaintx);
+ co.src = plaintx;
+ co.dst = buf;
+ co.dst_len = sizeof(buf);
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+
+ if (memcmp(co.dst, ciphertx, sizeof(ciphertx)))
+ errx(1, "verification failed");
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_camellia.c b/contrib/netbsd-tests/crypto/opencrypto/h_camellia.c
new file mode 100644
index 0000000..bb489e7
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_camellia.c
@@ -0,0 +1,87 @@
+/* $NetBSD: h_camellia.c,v 1.3 2014/01/17 19:39:51 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+/* Test vector from RFC3713 */
+unsigned char key[32] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
+ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
+unsigned char iv[16] = {0};
+char plaintx[16] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10};
+const unsigned char ciphertx[16] = {
+ 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c,
+ 0x20, 0xef, 0x7c, 0x91, 0x9e, 0x3a, 0x75, 0x09
+};
+
+int
+main(void)
+{
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[16];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.cipher = CRYPTO_CAMELLIA_CBC;
+ cs.keylen = 32;
+ cs.key = key;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memset(&co, 0, sizeof(co));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = sizeof(plaintx);
+ co.src = plaintx;
+ co.dst = buf;
+ co.dst_len = sizeof(buf);
+ co.iv = iv;
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+
+ if (memcmp(co.dst, ciphertx, sizeof(ciphertx)))
+ warnx("verification failed");
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_cbcdes.c b/contrib/netbsd-tests/crypto/opencrypto/h_cbcdes.c
new file mode 100644
index 0000000..4861d78
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_cbcdes.c
@@ -0,0 +1,82 @@
+/* $NetBSD: h_cbcdes.c,v 1.2 2014/01/17 14:16:08 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+unsigned char key[] = "abcdefgh";
+unsigned char iv[8] = {0};
+char plaintx[16] = "1234567890123456";
+const unsigned char ciphertx[16] = {
+ 0x21, 0xc6, 0x0d, 0xa5, 0x34, 0x24, 0x8b, 0xce,
+ 0x95, 0x86, 0x64, 0xb3, 0x66, 0x77, 0x9b, 0x4c
+};
+
+int
+main(void)
+{
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[16];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.cipher = CRYPTO_DES_CBC;
+ cs.keylen = 8;
+ cs.key = key;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memset(&co, 0, sizeof(co));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = sizeof(plaintx);
+ co.src = plaintx;
+ co.dst = buf;
+ co.dst_len = sizeof(buf);
+ co.iv = iv;
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+
+ if (memcmp(co.dst, ciphertx, sizeof(ciphertx)))
+ errx(1, "verification failed");
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_comp.c b/contrib/netbsd-tests/crypto/opencrypto/h_comp.c
new file mode 100644
index 0000000..dd5f647
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_comp.c
@@ -0,0 +1,90 @@
+/* $NetBSD: h_comp.c,v 1.1 2014/01/14 17:51:39 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+char text[100000] = {0};
+
+int
+main(void)
+{
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co1, co2;
+ unsigned char buf1[10000], buf2[100000];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.comp_alg = CRYPTO_GZIP_COMP;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memset(&co1, 0, sizeof(co1));
+ co1.ses = cs.ses;
+ co1.op = COP_COMP;
+ co1.len = sizeof(text);
+ co1.src = text;
+ co1.dst = buf1;
+ co1.dst_len = sizeof(buf1);
+ res = ioctl(fd, CIOCCRYPT, &co1);
+ if (res < 0)
+ err(1, "CIOCCRYPT1");
+ fprintf(stderr, "len %d/%d\n", co1.len, co1.dst_len);
+#if 0
+ buf1[co1.dst_len - 8]++; /* modify CRC */
+#endif
+ write(1, buf1, co1.dst_len);
+ memset(&co2, 0, sizeof(co2));
+ co2.ses = cs.ses;
+ co2.op = COP_DECOMP;
+ co2.len = co1.dst_len;
+ co2.src = buf1;
+ co2.dst = buf2;
+ co2.dst_len = sizeof(buf2);
+ buf2[10] = 0x33;
+ res = ioctl(fd, CIOCCRYPT, &co2);
+ fprintf(stderr, "canary: %x\n", buf2[10]);
+ if (res < 0)
+ err(1, "CIOCCRYPT2");
+ fprintf(stderr, "len %d/%d\n", co2.len, co2.dst_len);
+ if (memcmp(text, buf2, co2.dst_len))
+ errx(1, "memcmp");
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_comp_zlib.c b/contrib/netbsd-tests/crypto/opencrypto/h_comp_zlib.c
new file mode 100644
index 0000000..7a57ceb
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_comp_zlib.c
@@ -0,0 +1,92 @@
+/* $NetBSD: h_comp_zlib.c,v 1.1 2014/01/14 17:51:39 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <string.h>
+#include <zlib.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+char text[10000] = {0};
+
+int
+main(void)
+{
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co1;
+ unsigned char buf1[10000], buf2[10000];
+ z_stream z;
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.comp_alg = CRYPTO_DEFLATE_COMP;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memset(&co1, 0, sizeof(co1));
+ co1.ses = cs.ses;
+ co1.op = COP_COMP;
+ co1.len = sizeof(text);
+ co1.src = text;
+ co1.dst = buf1;
+ co1.dst_len = sizeof(buf1);
+ co1.flags = COP_F_BATCH;
+ res = ioctl(fd, CIOCCRYPT, &co1);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+
+ memset(&z, 0, sizeof(z));
+ z.next_in = buf1;
+ z.avail_in = co1.dst_len;
+ z.zalloc = Z_NULL;
+ z.zfree = Z_NULL;
+ z.opaque = 0;
+ z.next_out = buf2;
+ z.avail_out = sizeof(buf2);
+ res = inflateInit2(&z, -15);
+ if (res != Z_OK)
+ errx(1, "inflateInit: %d", res);
+ do {
+ res = inflate(&z, Z_SYNC_FLUSH);
+ } while (res == Z_OK);
+ if (res != Z_STREAM_END)
+ errx(1, "inflate: %d", res);
+ if (z.total_out != sizeof(text))
+ errx(1, "decomp len %lu", z.total_out);
+ if (memcmp(buf2, text, sizeof(text)))
+ errx(1, "decomp data mismatch");
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_comp_zlib_rnd.c b/contrib/netbsd-tests/crypto/opencrypto/h_comp_zlib_rnd.c
new file mode 100644
index 0000000..86ed55a
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_comp_zlib_rnd.c
@@ -0,0 +1,96 @@
+/* $NetBSD: h_comp_zlib_rnd.c,v 1.1 2014/01/14 17:51:39 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <zlib.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+char text[1000];
+
+int
+main(void)
+{
+ unsigned int i;
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co1;
+ unsigned char buf1[10000], buf2[10000];
+ z_stream z;
+
+ for (i = 0; i < sizeof(text)/sizeof(long); i++)
+ *(long *)(text + i * sizeof(long)) = random();
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.comp_alg = CRYPTO_DEFLATE_COMP;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memset(&co1, 0, sizeof(co1));
+ co1.ses = cs.ses;
+ co1.op = COP_COMP;
+ co1.len = sizeof(text);
+ co1.src = text;
+ co1.dst = buf1;
+ co1.dst_len = sizeof(buf1);
+ res = ioctl(fd, CIOCCRYPT, &co1);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+
+ memset(&z, 0, sizeof(z));
+ z.next_in = buf1;
+ z.avail_in = co1.dst_len;
+ z.zalloc = Z_NULL;
+ z.zfree = Z_NULL;
+ z.opaque = 0;
+ z.next_out = buf2;
+ z.avail_out = sizeof(buf2);
+ res = inflateInit2(&z, -15);
+ if (res != Z_OK)
+ errx(1, "inflateInit: %d", res);
+ do {
+ res = inflate(&z, Z_SYNC_FLUSH);
+ } while (res == Z_OK);
+ if (res != Z_STREAM_END)
+ errx(1, "inflate: %d", res);
+ if (z.total_out != sizeof(text))
+ errx(1, "decomp len %lu", z.total_out);
+ if (memcmp(buf2, text, sizeof(text)))
+ errx(1, "decomp data mismatch");
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_gcm.c b/contrib/netbsd-tests/crypto/opencrypto/h_gcm.c
new file mode 100644
index 0000000..33f41f0
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_gcm.c
@@ -0,0 +1,126 @@
+/* $NetBSD: h_gcm.c,v 1.2 2014/01/17 14:16:08 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+unsigned char key[20] = { 0 };
+char plaintx[16] = { 0 };
+unsigned char iv[16] = { 0 };
+const unsigned char ciphertx[16] = {
+ 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92,
+ 0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78
+};
+const unsigned char hash[16] = {
+ 0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd,
+ 0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf
+};
+
+int
+main(void)
+{
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char databuf[16];
+ unsigned char macbuf[16];
+ unsigned char databuf2[16];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.mac = CRYPTO_AES_128_GMAC;
+ cs.mackeylen = sizeof(key);
+ cs.mackey = key;
+ cs.cipher = CRYPTO_AES_GCM_16;
+ cs.key = key;
+ cs.keylen = sizeof(key);
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memset(&co, 0, sizeof(co));
+ memset(databuf, 0, sizeof(databuf));
+ memset(macbuf, 0, sizeof(macbuf));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = sizeof(plaintx);
+ co.src = plaintx;
+ co.dst = databuf;
+ co.mac = macbuf;
+ co.iv = iv;
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+#if 1
+ if (memcmp(co.dst, ciphertx, sizeof(ciphertx)))
+ errx(1, "verification failed");
+ if (memcmp(macbuf, hash, sizeof(hash)))
+ errx(1, "hash failed");
+#else
+ {
+ int i;
+ for (i = 0; i < sizeof(databuf); i++)
+ printf("%02x ", databuf[i]);
+ printf("\n");
+ }
+ {
+ int i;
+ for (i = 0; i < sizeof(macbuf); i++)
+ printf("%02x ", macbuf[i]);
+ printf("\n");
+ }
+#endif
+ memset(databuf2, 0, sizeof(databuf2));
+ memset(macbuf, 0, sizeof(macbuf));
+ co.ses = cs.ses;
+ co.op = COP_DECRYPT;
+ co.len = sizeof(databuf);
+ co.src = databuf;
+ co.dst = databuf2;
+ co.mac = macbuf;
+ co.iv = iv;
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+
+ if (memcmp(co.dst, plaintx, sizeof(plaintx)))
+ errx(1, "verification failed");
+ if (memcmp(macbuf, hash, sizeof(hash)))
+ errx(1, "hash failed");
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_md5.c b/contrib/netbsd-tests/crypto/opencrypto/h_md5.c
new file mode 100644
index 0000000..98379c7
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_md5.c
@@ -0,0 +1,109 @@
+/* $NetBSD: h_md5.c,v 1.5 2014/01/18 20:10:34 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+/* Test vectors from RFC1321 */
+
+const struct {
+ size_t len;
+ unsigned char plaintx[80];
+ unsigned char digest[16];
+} tests[] = {
+ { 0, "",
+ { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04,
+ 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e } },
+ { 1, "a",
+ { 0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8,
+ 0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 } },
+ { 3, "abc",
+ { 0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0,
+ 0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72 } },
+ { 14, "message digest",
+ { 0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d,
+ 0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0 } },
+ { 26, "abcdefghijklmnopqrstuvwxyz",
+ { 0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00,
+ 0x7d, 0xfb, 0x49, 0x6c, 0xca, 0x67, 0xe1, 0x3b } },
+ { 62, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
+ { 0xd1, 0x74, 0xab, 0x98, 0xd2, 0x77, 0xd9, 0xf5,
+ 0xa5, 0x61, 0x1c, 0x2c, 0x9f, 0x41, 0x9d, 0x9f } },
+ { 80, "123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890",
+ { 0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55,
+ 0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a } },
+};
+
+int
+main(void)
+{
+ int fd, res;
+ size_t i;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[16];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.mac = CRYPTO_MD5;
+
+ for (i = 0; i < __arraycount(tests); i++) {
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION test %zu", i);
+
+ memset(&co, 0, sizeof(co));
+ memset(&buf, 0, sizeof(buf));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = tests[i].len;
+ co.src = __UNCONST(&tests[i].plaintx);
+ co.mac = buf;
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT test %zu", i);
+
+ if (memcmp(co.mac, tests[i].digest, sizeof(tests[i].digest)))
+ errx(1, "verification failed test %zu", i);
+
+ res = ioctl(fd, CIOCFSESSION, &cs.ses);
+ if (res < 0)
+ err(1, "CIOCFSESSION test %zu", i);
+ }
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_md5hmac.c b/contrib/netbsd-tests/crypto/opencrypto/h_md5hmac.c
new file mode 100644
index 0000000..6753094
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_md5hmac.c
@@ -0,0 +1,181 @@
+/* $NetBSD: h_md5hmac.c,v 1.4 2014/01/18 02:31:14 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+#define MD5_HMAC_KEYLEN 16 /* Fixed key length supported */
+
+/* Test data from RFC2202 */
+const struct {
+ int num;
+ size_t key_len;
+ size_t len;
+ unsigned char key[80];
+ unsigned char data[80];
+ unsigned char mac[16];
+} tests[] = {
+ /* Test #1 */
+ { 1, 16, 8,
+ { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b },
+ "Hi There",
+ { 0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c,
+ 0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d }
+ },
+ /* Test #2 */
+ { 2, 4, 28,
+ "Jefe",
+ "what do ya want for nothing?",
+ { 0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03,
+ 0xea, 0xa8, 0x6e, 0x31, 0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x61, 0xb9, 0xd0, 0xcd }
+ },
+ /* Test #7 */
+ { 7, 80, 73,
+ { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
+ "Test Using Larger Than Block-Size Key and Larger "
+ "Than One Block-Size Data",
+ { 0x6f, 0x63, 0x0f, 0xad, 0x67, 0xcd, 0xa0, 0xee,
+ 0x1f, 0xb1, 0xf5, 0x62, 0xdb, 0x3a, 0xa5, 0x3e }
+ },
+};
+
+int
+main(void)
+{
+ size_t i;
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[16];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ for (i = 0; i < __arraycount(tests); i++) {
+ if (tests[i].key_len != MD5_HMAC_KEYLEN)
+ continue;
+
+ memset(&cs, 0, sizeof(cs));
+ cs.mac = CRYPTO_MD5_HMAC;
+ cs.mackeylen = tests[i].key_len;
+ cs.mackey = __UNCONST(&tests[i].key);
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION test %d", tests[i].num);
+
+ memset(&co, 0, sizeof(co));
+ memset(buf, 0, sizeof(buf));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = tests[i].len;
+ co.src = __UNCONST(&tests[i].data);
+ co.mac = buf;
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT test %d", tests[i].num);
+
+ if (memcmp(co.mac, tests[i].mac, sizeof(tests[i].mac)))
+ errx(1, "verification failed test %d", tests[i].num);
+
+ res = ioctl(fd, CIOCFSESSION, &cs.ses);
+ if (res < 0)
+ err(1, "CIOCFSESSION test %d", tests[i].num);
+ }
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_null.c b/contrib/netbsd-tests/crypto/opencrypto/h_null.c
new file mode 100644
index 0000000..85e4805
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_null.c
@@ -0,0 +1,76 @@
+/* $NetBSD: h_null.c,v 1.3 2014/01/17 19:35:33 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+unsigned char key[] = "abcdefgh";
+char plaintx[16] = "1234567890123456";
+
+int
+main(void)
+{
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[16];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.cipher = CRYPTO_NULL_CBC;
+ cs.keylen = 8;
+ cs.key = key;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ memset(&co, 0, sizeof(co));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = sizeof(plaintx);
+ co.src = plaintx;
+ co.dst = buf;
+ co.dst_len = sizeof(buf);
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT");
+
+ if (memcmp(co.dst, plaintx, sizeof(plaintx)))
+ errx(1, "verification failed");
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_sha1hmac.c b/contrib/netbsd-tests/crypto/opencrypto/h_sha1hmac.c
new file mode 100644
index 0000000..c153f76
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_sha1hmac.c
@@ -0,0 +1,191 @@
+/* $NetBSD: h_sha1hmac.c,v 1.2 2014/01/18 02:31:14 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+#define SHA1_HMAC_KEYLEN 20 /* Only key-length we support */
+
+/* Test data from RFC2202 */
+const struct {
+ int num;
+ size_t key_len;
+ size_t len;
+ unsigned char key[80];
+ unsigned char data[80];
+ unsigned char mac[20];
+} tests[] = {
+ /* Test #1 */
+ { 1, 20, 8,
+ { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+ 0x0b, 0x0b, 0x0b, 0x0b },
+ "Hi There",
+ { 0xb6, 0x17, 0x31, 0x86, 0x55, 0x05, 0x72, 0x64,
+ 0xe2, 0x8b, 0xc0, 0xb6, 0xfb, 0x37, 0x8c, 0x8e,
+ 0xf1, 0x46, 0xbe, 0x00 }
+ },
+ /* Test #2 */
+ { 2, 4, 28,
+ "Jefe",
+ "what do ya want for nothing?",
+ { 0xef, 0xfc, 0xdf, 0x6a, 0xe5, 0xeb, 0x2f, 0xa2,
+ 0xd2, 0x74, 0x16, 0xd5, 0xf1, 0x84, 0xdf, 0x9c,
+ 0x25, 0x9a, 0x7c, 0x79 }
+ },
+ /* Test #3 */
+ { 3, 20, 50,
+ { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa },
+ { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd },
+ { 0x12, 0x5d, 0x73, 0x42, 0xb9, 0xac, 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a, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
+ "Test Using Larger Than Block-Size Key and Larger Than "
+ "One Block-Size Data",
+ { 0xe8, 0xe9, 0x9d, 0x0f, 0x45, 0x23, 0x7d, 0x78,
+ 0x6d, 0x6b, 0xba, 0xa7, 0x96, 0x5c, 0x78, 0x08,
+ 0xbb, 0xff, 0x1a, 0x91 }
+ },
+};
+
+int
+main(void)
+{
+ size_t i;
+ int fd, res;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[20];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ for (i = 0; i < __arraycount(tests); i++) {
+ if (tests[i].key_len != SHA1_HMAC_KEYLEN)
+ continue;
+
+ memset(&cs, 0, sizeof(cs));
+ cs.mac = CRYPTO_SHA1_HMAC;
+ cs.mackeylen = tests[i].key_len;
+ cs.mackey = __UNCONST(&tests[i].key);
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION test %d", tests[i].num);
+
+ memset(&co, 0, sizeof(co));
+ memset(buf, 0, sizeof(buf));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = tests[i].len;
+ co.src = __UNCONST(&tests[i].data);
+ co.mac = buf;
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT test %d", tests[i].num);
+
+ if (memcmp(co.mac, &tests[i].mac, sizeof(tests[i].mac)))
+ errx(1, "verification failed test %d", tests[i].num);
+
+ res = ioctl(fd, CIOCFSESSION, &cs.ses);
+ if (res < 0)
+ err(1, "CIOCFSESSION test %d", tests[i].num);
+ }
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/h_xcbcmac.c b/contrib/netbsd-tests/crypto/opencrypto/h_xcbcmac.c
new file mode 100644
index 0000000..3f89c6e
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/h_xcbcmac.c
@@ -0,0 +1,109 @@
+/* $NetBSD: h_xcbcmac.c,v 1.4 2014/01/16 23:56:04 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <crypto/cryptodev.h>
+
+
+/* test vectors from RFC3566 */
+unsigned char key[16] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
+};
+char plaintx[1000] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21
+};
+const struct {
+ size_t len;
+ unsigned char mac[12];
+} tests[] = {
+ { 0, { 0x75, 0xf0, 0x25, 0x1d, 0x52, 0x8a,
+ 0xc0, 0x1c, 0x45, 0x73, 0xdf, 0xd5 } },
+ { 3, { 0x5b, 0x37, 0x65, 0x80, 0xae, 0x2f,
+ 0x19, 0xaf, 0xe7, 0x21, 0x9c, 0xee } },
+ { 16, { 0xd2, 0xa2, 0x46, 0xfa, 0x34, 0x9b,
+ 0x68, 0xa7, 0x99, 0x98, 0xa4, 0x39 } },
+ { 20, { 0x47, 0xf5, 0x1b, 0x45, 0x64, 0x96,
+ 0x62, 0x15, 0xb8, 0x98, 0x5c, 0x63 } },
+ { 32, { 0xf5, 0x4f, 0x0e, 0xc8, 0xd2, 0xb9,
+ 0xf3, 0xd3, 0x68, 0x07, 0x73, 0x4b } },
+ { 34, { 0xbe, 0xcb, 0xb3, 0xbc, 0xcd, 0xb5,
+ 0x18, 0xa3, 0x06, 0x77, 0xd5, 0x48 } },
+ { 1000, { 0xf0, 0xda, 0xfe, 0xe8, 0x95, 0xdb,
+ 0x30, 0x25, 0x37, 0x61, 0x10, 0x3b } },
+};
+
+int
+main(void)
+{
+ int fd, res;
+ size_t i;
+ struct session_op cs;
+ struct crypt_op co;
+ unsigned char buf[16];
+
+ fd = open("/dev/crypto", O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open");
+ memset(&cs, 0, sizeof(cs));
+ cs.mac = CRYPTO_AES_XCBC_MAC_96;
+ cs.mackeylen = sizeof(key);
+ cs.mackey = key;
+ res = ioctl(fd, CIOCGSESSION, &cs);
+ if (res < 0)
+ err(1, "CIOCGSESSION");
+
+ for (i = 0; i < __arraycount(tests); i++) {
+ memset(&co, 0, sizeof(co));
+ memset(buf, 0, sizeof(buf));
+ if (tests[i].len == sizeof(plaintx))
+ memset(&plaintx, 0, sizeof(plaintx));
+ co.ses = cs.ses;
+ co.op = COP_ENCRYPT;
+ co.len = tests[i].len;
+ co.src = plaintx;
+ co.mac = buf;
+ res = ioctl(fd, CIOCCRYPT, &co);
+ if (res < 0)
+ err(1, "CIOCCRYPT test %zu", i);
+ if (memcmp(buf, &tests[i].mac, sizeof(tests[i].mac)))
+ errx(1, "verification failed test %zu", i);
+ }
+ return 0;
+}
diff --git a/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh b/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh
new file mode 100755
index 0000000..f7faa3a
--- /dev/null
+++ b/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh
@@ -0,0 +1,272 @@
+# $NetBSD: t_opencrypto.sh,v 1.4 2014/01/18 15:15:16 pgoyette Exp $
+#
+# Copyright (c) 2014 The NetBSD Foundation, 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 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.
+#
+
+# Start a rumpserver, load required modules, and set requires sysctl vars
+
+start_rump() {
+ rump_libs="-l rumpvfs -l rumpdev -l rumpdev_opencrypto"
+ rump_libs="${rump_libs} -l rumpkern_z -l rumpkern_crypto"
+
+ rump_server ${rump_libs} ${RUMP_SERVER} || \
+ return 1
+
+ rump.sysctl -w kern.cryptodevallowsoft=-1 && \
+ return 0
+
+ rump.halt
+
+ return 1
+}
+
+common_head() {
+ atf_set descr "$1"
+ atf_set timeout 10
+ atf_set require.progs rump_server rump.sysctl rump.halt
+}
+
+common_body() {
+ local status
+
+ start_rump || atf_skip "Cannot set-up rump environment"
+ LD_PRELOAD="/usr/lib/librumphijack.so" ; export LD_PRELOAD
+ RUMPHIJACK="blanket=/dev/crypto" ; export RUMPHIJACK
+ $(atf_get_srcdir)/$1
+ status=$?
+ unset RUMPHIJACK
+ unset LD_PRELOAD
+ if [ $status -ne 0 ] ; then
+ atf_fail "$1 returned non-zero status, check output/error"
+ fi
+}
+
+common_cleanup() {
+ unset RUMPHIJACK
+ unset LD_PRELOAD
+ rump.halt
+}
+
+atf_test_case arc4 cleanup
+arc4_head() {
+ common_head "Test ARC4 crypto"
+}
+
+arc4_body() {
+ atf_skip "ARC4 not implemented by swcrypto"
+ common_body h_arc4
+}
+
+arc4_cleanup() {
+ common_cleanup
+}
+
+atf_test_case camellia cleanup
+camellia_head() {
+ common_head "Test CAMELLIA_CBC crypto"
+}
+
+camellia_body() {
+ common_body h_camellia
+}
+
+camellia_cleanup() {
+ common_cleanup
+}
+
+atf_test_case cbcdes cleanup
+cbcdes_head() {
+ common_head "Test ARC4 crypto"
+}
+
+cbcdes_body() {
+ common_body h_cbcdes
+}
+
+cbcdes_cleanup() {
+ common_cleanup
+}
+
+atf_test_case comp cleanup
+comp_head() {
+ common_head "Test GZIP_COMP Compression"
+}
+
+comp_body() {
+ common_body h_comp
+}
+
+comp_cleanup() {
+ common_cleanup
+}
+
+atf_test_case comp_deflate cleanup
+comp_deflate_head() {
+ common_head "Test DEFLATE_COMP Compression"
+}
+
+comp_deflate_body() {
+ common_body h_comp_zlib
+}
+
+comp_deflate_cleanup() {
+ common_cleanup
+}
+
+atf_test_case comp_zlib_rnd cleanup
+comp_zlib_rnd_head() {
+ common_head "Test DEFLATE_COMP Compression with random data"
+}
+
+comp_zlib_rnd_body() {
+ common_body h_comp_zlib_rnd
+}
+
+comp_zlib_rnd_cleanup() {
+ common_cleanup
+}
+
+atf_test_case aesctr1 cleanup
+aesctr1_head() {
+ common_head "Test AES_CTR crypto"
+}
+
+aesctr1_body() {
+ common_body h_aesctr1
+}
+
+aesctr1_cleanup() {
+ common_cleanup
+}
+
+atf_test_case aesctr2 cleanup
+aesctr2_head() {
+ common_head "Test AES_CTR crypto"
+}
+
+aesctr2_body() {
+ common_body h_aesctr2
+}
+
+aesctr2_cleanup() {
+ common_cleanup
+}
+
+atf_test_case gcm cleanup
+gcm_head() {
+ common_head "Test AES_GCM_16 crypto"
+}
+
+gcm_body() {
+ common_body h_gcm
+}
+
+gcm_cleanup() {
+ common_cleanup
+}
+
+atf_test_case md5 cleanup
+md5_head() {
+ common_head "Test MD5 crypto"
+}
+
+md5_body() {
+ common_body h_md5
+}
+
+md5_cleanup() {
+ common_cleanup
+}
+
+atf_test_case md5_hmac cleanup
+md5_hmac_head() {
+ common_head "Test MD5_HMAC crypto"
+}
+
+md5_hmac_body() {
+ common_body h_md5hmac
+}
+
+md5_hmac_cleanup() {
+ common_cleanup
+}
+
+atf_test_case null cleanup
+null_head() {
+ common_head "Test NULL_CBC crypto"
+}
+
+null_body() {
+ common_body h_null
+}
+
+null_cleanup() {
+ common_cleanup
+}
+
+atf_test_case sha1_hmac cleanup
+sha1_hmac_head() {
+ common_head "Test SHA1_HMAC crypto"
+}
+
+sha1_hmac_body() {
+ common_body h_sha1hmac
+}
+
+sha1_hmac_cleanup() {
+ common_cleanup
+}
+
+atf_test_case xcbcmac cleanup
+xcbcmac_head() {
+ common_head "Test XCBC_MAC_96 crypto"
+}
+
+xcbcmac_body() {
+ common_body h_xcbcmac
+}
+
+xcbcmac_cleanup() {
+ common_cleanup
+}
+
+atf_init_test_cases() {
+ RUMP_SERVER="unix://t_opencrypto_socket" ; export RUMP_SERVER
+
+ atf_add_test_case arc4
+ atf_add_test_case camellia
+ atf_add_test_case cbcdes
+ atf_add_test_case comp
+ atf_add_test_case comp_deflate
+ atf_add_test_case comp_zlib_rnd
+ atf_add_test_case aesctr1
+ atf_add_test_case aesctr2
+ atf_add_test_case gcm
+ atf_add_test_case md5
+ atf_add_test_case md5_hmac
+ atf_add_test_case null
+ atf_add_test_case sha1_hmac
+ atf_add_test_case xcbcmac
+}
diff --git a/contrib/netbsd-tests/dev/audio/h_pad.c b/contrib/netbsd-tests/dev/audio/h_pad.c
new file mode 100644
index 0000000..dd481ac
--- /dev/null
+++ b/contrib/netbsd-tests/dev/audio/h_pad.c
@@ -0,0 +1,76 @@
+/* $NetBSD: h_pad.c,v 1.1 2010/08/04 13:15:15 pooka Exp $ */
+
+/*
+ * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "h_pad_musa.c"
+
+/*
+ * Stuff some audio into /dev/audio, read it from /dev/pad. Use in
+ * conjunction with t_pad, which tests that we got sensible output
+ * by comparing against a previous audibly good result.
+ */
+
+#define BUFSIZE 1024
+
+int
+main(int argc, char *argv[])
+{
+ char buf[BUFSIZE];
+ char zeros[BUFSIZE];
+ int padfd, audiofd;
+ ssize_t n;
+
+ rump_init();
+ audiofd = rump_sys_open("/dev/audio0", O_RDWR);
+ if (audiofd == -1)
+ err(1, "open audio");
+
+ padfd = rump_sys_open("/dev/pad0", O_RDONLY);
+ if (padfd == -1)
+ err(1, "open pad");
+
+ if ((n = rump_sys_write(audiofd, musa, sizeof(musa))) != sizeof(musa))
+ err(1, "write");
+
+ memset(zeros, 0, sizeof(zeros));
+ while ((n = rump_sys_read(padfd, buf, sizeof(buf))) > 0) {
+ if (memcmp(buf, zeros, sizeof(buf)) == 0)
+ break;
+ write(STDOUT_FILENO, buf, n);
+ }
+}
diff --git a/contrib/netbsd-tests/dev/audio/h_pad_musa.c b/contrib/netbsd-tests/dev/audio/h_pad_musa.c
new file mode 100644
index 0000000..322305e
--- /dev/null
+++ b/contrib/netbsd-tests/dev/audio/h_pad_musa.c
@@ -0,0 +1,344 @@
+unsigned char musa[] = {
+0x46, 0xdb, 0x76, 0x67, 0x61, 0xff, 0xfc, 0x67, 0xff, 0xe9, 0xdb, 0x79,
+0x5d, 0x53, 0x5b, 0x79, 0xef, 0x65, 0x67, 0x5b, 0x67, 0x67, 0x72, 0x66,
+0x4f, 0x5b, 0xe7, 0xf5, 0x5e, 0x53, 0x61, 0xe7, 0x5c, 0x53, 0x67, 0x67,
+0x67, 0x5b, 0x54, 0x60, 0x4e, 0xec, 0xef, 0x5b, 0x5b, 0x6f, 0x69, 0xff,
+0x71, 0x53, 0x77, 0x67, 0x67, 0x5b, 0x5b, 0x5b, 0x75, 0x6c, 0x67, 0x6d,
+0x67, 0x7e, 0xff, 0x63, 0x66, 0x61, 0x67, 0x5b, 0x5b, 0x67, 0x67, 0x5f,
+0x5b, 0x64, 0x5b, 0x5b, 0x55, 0x53, 0x5c, 0x5d, 0x67, 0x53, 0x63, 0x5e,
+0xe7, 0xf5, 0x51, 0x5b, 0x5e, 0x5e, 0x67, 0x5b, 0x67, 0xff, 0x67, 0x67,
+0xe9, 0x6e, 0x67, 0x5c, 0x60, 0x67, 0x7a, 0xff, 0xe7, 0xff, 0x58, 0x5b,
+0x64, 0x6e, 0x67, 0x55, 0x5f, 0xff, 0xff, 0xff, 0xff, 0x56, 0x5b, 0x53,
+0x5b, 0x67, 0x54, 0x58, 0x67, 0x67, 0x6e, 0x67, 0x5c, 0x58, 0x67, 0x67,
+0x5b, 0x65, 0x64, 0x70, 0x5b, 0x5b, 0x67, 0xfc, 0xf7, 0xf2, 0xff, 0xec,
+0x73, 0x67, 0x67, 0xff, 0x67, 0x74, 0xff, 0x67, 0x5e, 0x5e, 0x67, 0x72,
+0x77, 0x7c, 0x67, 0x5d, 0x5b, 0x67, 0x5b, 0x55, 0x67, 0x5c, 0x67, 0x60,
+0x5b, 0x5b, 0x61, 0x54, 0x67, 0x5b, 0xe8, 0x75, 0xe2, 0x67, 0xff, 0x62,
+0x5b, 0x5b, 0xff, 0xe8, 0xff, 0xe7, 0x6a, 0xee, 0x78, 0x67, 0xff, 0x67,
+0x7a, 0xff, 0x6a, 0xff, 0xff, 0x67, 0xff, 0x71, 0xfd, 0x6c, 0x5e, 0xfe,
+0xff, 0x6d, 0xe7, 0xff, 0xec, 0x68, 0x5b, 0xff, 0x5c, 0x6a, 0xeb, 0x69,
+0x60, 0xff, 0x67, 0x67, 0x67, 0x7a, 0xdf, 0xec, 0x55, 0x5b, 0x5b, 0x5b,
+0x71, 0x5c, 0x77, 0x72, 0x68, 0xe7, 0x6d, 0xff, 0xff, 0xff, 0xdb, 0xe7,
+0xde, 0xdb, 0xff, 0xff, 0x69, 0xee, 0x78, 0x67, 0xef, 0xea, 0x5b, 0x5b,
+0x67, 0x5d, 0x6f, 0xff, 0xff, 0x67, 0x67, 0x67, 0x61, 0x54, 0x5b, 0xff,
+0x67, 0x67, 0x5b, 0x67, 0xf4, 0x67, 0x67, 0x67, 0x5b, 0x65, 0xf2, 0x67,
+0xff, 0xe7, 0xe7, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xfc,
+0xf7, 0xf2, 0x7d, 0x5b, 0x56, 0x67, 0x5e, 0xe2, 0x7f, 0x67, 0x75, 0x67,
+0x6d, 0x63, 0x66, 0x67, 0x5b, 0x5b, 0x5b, 0x5b, 0x65, 0xf0, 0x6a, 0xe7,
+0x5f, 0x67, 0xff, 0x6f, 0x7b, 0x67, 0x5b, 0xff, 0xff, 0x72, 0x67, 0xff,
+0xff, 0xff, 0xff, 0x67, 0x7e, 0x6d, 0xff, 0xff, 0xff, 0x67, 0xff, 0xee,
+0xe7, 0xff, 0xff, 0x6a, 0xe7, 0xe7, 0x7a, 0x67, 0xff, 0xff, 0xff, 0x67,
+0x67, 0xff, 0xff, 0x67, 0x67, 0x67, 0x5c, 0x5b, 0x67, 0x7f, 0x67, 0xdb,
+0xfe, 0xde, 0xec, 0x5c, 0x61, 0x5b, 0x67, 0x6e, 0x67, 0x67, 0xfe, 0xff,
+0xe7, 0xff, 0xe7, 0xff, 0xff, 0xe6, 0xd9, 0xe7, 0xff, 0xff, 0x73, 0x68,
+0x6c, 0x55, 0xe7, 0xe7, 0xec, 0x67, 0x5b, 0x71, 0xfd, 0xff, 0xff, 0xff,
+0x71, 0x67, 0x5b, 0x53, 0x5e, 0x5e, 0x5b, 0x5d, 0x79, 0x70, 0x67, 0x67,
+0x60, 0x5c, 0x67, 0xff, 0x7d, 0x75, 0xff, 0xff, 0xe7, 0xec, 0xff, 0xff,
+0xe7, 0xfd, 0x67, 0xf7, 0xdc, 0xf1, 0x6b, 0xe9, 0xff, 0x79, 0x7a, 0x6f,
+0xfa, 0xf9, 0xff, 0x5b, 0x53, 0x5b, 0x67, 0x77, 0x67, 0x66, 0x67, 0x5b,
+0x67, 0x5b, 0x67, 0x67, 0x74, 0x75, 0x7e, 0xf3, 0x67, 0x5c, 0x67, 0x67,
+0x5c, 0x67, 0x6a, 0xea, 0xff, 0xff, 0x67, 0xff, 0x7b, 0x78, 0xdf, 0xff,
+0xdd, 0xee, 0xfd, 0xf6, 0x67, 0xe7, 0xff, 0x74, 0x67, 0x67, 0xe7, 0xfe,
+0xff, 0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, 0x7b, 0xf0, 0xea, 0x67, 0xff, 0x67, 0x79, 0xff, 0xe7, 0xf8, 0x6e,
+0xe9, 0xff, 0x61, 0xff, 0x58, 0x67, 0x5b, 0x75, 0x67, 0xff, 0x5b, 0x67,
+0x67, 0x6d, 0x5b, 0x5b, 0x5f, 0x5d, 0x67, 0x5b, 0x53, 0x5b, 0x67, 0x79,
+0xff, 0xf0, 0xe9, 0x67, 0x60, 0x5b, 0x67, 0x6e, 0x67, 0xff, 0xe7, 0xe8,
+0x6c, 0xf4, 0x67, 0x67, 0xf5, 0xdc, 0x6d, 0xff, 0xff, 0x6e, 0x67, 0xff,
+0x65, 0xf8, 0xf7, 0x5c, 0xea, 0xff, 0xd7, 0xff, 0xff, 0x70, 0x5b, 0x5d,
+0xff, 0x66, 0x53, 0x6e, 0x66, 0x76, 0xff, 0x67, 0x67, 0x53, 0x5b, 0x73,
+0x76, 0x67, 0xe7, 0xdd, 0x67, 0xff, 0x5b, 0x65, 0x67, 0x67, 0xff, 0x6f,
+0x7a, 0x79, 0x67, 0x69, 0xe7, 0xee, 0xe7, 0xe7, 0xe7, 0xff, 0x4d, 0xe7,
+0xe8, 0xff, 0x67, 0x7f, 0xff, 0x67, 0x67, 0x6d, 0x58, 0xe7, 0x67, 0x6b,
+0xff, 0x5b, 0x67, 0x5d, 0x5b, 0x52, 0x59, 0xfe, 0x53, 0x78, 0xff, 0x53,
+0x63, 0x72, 0x5b, 0x51, 0x5b, 0x5c, 0xec, 0xf4, 0xe7, 0xd9, 0xd6, 0xfe,
+0xed, 0x63, 0x5b, 0xff, 0x67, 0x7c, 0xff, 0x67, 0xe9, 0x6f, 0x67, 0x67,
+0xff, 0xdb, 0xe4, 0x67, 0x5c, 0x67, 0x5f, 0x5b, 0x5b, 0x5b, 0x5b, 0x75,
+0x67, 0x67, 0x67, 0xe7, 0x67, 0x5b, 0x67, 0x67, 0x5f, 0x67, 0xe9, 0xff,
+0x5b, 0x65, 0xe7, 0xea, 0x7a, 0xff, 0x7a, 0x67, 0x5f, 0x67, 0x6b, 0x5b,
+0x67, 0x67, 0x61, 0x67, 0x67, 0xff, 0xe8, 0x5b, 0xff, 0xe7, 0xe7, 0xe7,
+0xe7, 0xe7, 0x67, 0x5c, 0x5b, 0x5b, 0x67, 0xff, 0x67, 0xea, 0x6f, 0x67,
+0x67, 0x67, 0x4e, 0x53, 0xe9, 0x79, 0x59, 0xdd, 0xd4, 0xe3, 0xdd, 0xe8,
+0x5b, 0x62, 0x7f, 0xd1, 0x6d, 0x53, 0xed, 0x6e, 0x66, 0x67, 0x67, 0x67,
+0x67, 0xff, 0x69, 0x67, 0xea, 0x5d, 0x6f, 0xdb, 0x5f, 0x5b, 0xe7, 0xf7,
+0xd0, 0xe8, 0xec, 0x73, 0x5b, 0x67, 0xf4, 0x67, 0x74, 0x67, 0x5b, 0x5b,
+0x5b, 0x66, 0x53, 0x55, 0x5b, 0x71, 0x5b, 0x5c, 0x70, 0xed, 0x4e, 0x4d,
+0x6a, 0xe7, 0x6f, 0xfb, 0xd5, 0xdf, 0x67, 0x77, 0x72, 0xfd, 0xe7, 0xed,
+0x68, 0xff, 0x74, 0x67, 0x61, 0xff, 0x68, 0x6e, 0x53, 0x5b, 0x67, 0x5a,
+0x5a, 0xff, 0xdd, 0x5e, 0x57, 0xea, 0xff, 0x4d, 0x6b, 0xf8, 0x53, 0x67,
+0x67, 0xf2, 0x7b, 0x53, 0x58, 0x5b, 0x56, 0x67, 0xe7, 0xf4, 0x6c, 0xff,
+0xe7, 0xff, 0x68, 0xee, 0x77, 0x7c, 0xf1, 0x67, 0xe7, 0x5f, 0x6a, 0xff,
+0xff, 0xff, 0xff, 0x60, 0xfc, 0xe7, 0x72, 0x54, 0x76, 0x67, 0x67, 0x67,
+0xd9, 0xdb, 0x4f, 0x67, 0x5b, 0x5b, 0x56, 0x67, 0xe7, 0x4e, 0xea, 0x7b,
+};
diff --git a/contrib/netbsd-tests/dev/audio/t_pad.sh b/contrib/netbsd-tests/dev/audio/t_pad.sh
new file mode 100755
index 0000000..8caf23a
--- /dev/null
+++ b/contrib/netbsd-tests/dev/audio/t_pad.sh
@@ -0,0 +1,47 @@
+# $NetBSD: t_pad.sh,v 1.3 2010/11/07 17:51:17 jmmv Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case pad_output
+pad_output_head()
+{
+
+ atf_set "descr" "Check pad driver output against known-good output"
+}
+
+pad_output_body()
+{
+
+ atf_check -s exit:0 uudecode $(atf_get_srcdir)/t_pad_output.bz2.uue
+ atf_check -s exit:0 bunzip2 t_pad_output.bz2
+ atf_check -s exit:0 -o file:t_pad_output $(atf_get_srcdir)/h_pad
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case pad_output
+}
diff --git a/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue b/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue
new file mode 100644
index 0000000..0aadfa7
--- /dev/null
+++ b/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue
@@ -0,0 +1,998 @@
+begin 644 t_pad_output.bz2
+M0EIH.3%!629368,\S/H`A(]_____________________________________
+M________X)/JWW=]LJ1DQ(V-I-I+:VTPD*VTAK31))5F;9)60#$TK+5K#:U*
+M-:*D!0Q6EMLA*CJG75+322@`44*+KJ[*:U%`=]N\V@VVF]YP#E5K*A78P,S#
+MZT/(+W<.M[<YW=V9MW;N[N7O=>>RM[LO9>]N>KVVVVU[MVU7+6MC5M6U%;5E
+ML)MD:LTBI`6RBM)!"VL!D))"-@4VJM56U;9JFF@VK`!M@#+8S0%3:-K6VU,V
+MQK&@`*!FV;6S9MLU5K8:M9K62MA;`J:+:(V9I2W6NUFUK,VJ:NMVZVSK;O96
+M[N]W=W=>WO>;6M[W;W=[WO>\Y]SN]#??>>'&P/6$<PP9:BH<L>RM"O;IU+34
+MFG(=*=!IK(YZ=U(J4%`]!0#1IC5NTN.DU1;44F&#1HUEELQ;`VK&UJE(JJ:8
+MYP:41,@3``T!,"::&F!`9#3)@33331IH-``TT9`U,&@TR&0R833`$T,F$Q#$
+M8`$T9&C1IDR,F(--&3330#0(-)(1H`!H``````````"8`3`3(P3$P$8!!HT$
+MP#(TT:$P``)@$G@)HTP)IZ$QI,$,`%!II*(3``P8":::!&`F@$P308@3$-4\
+MP1-3]3$CR9$8;4U/*&T;4F3$S2:>IDR9#!&0T,U`:`&AZ)Y)ZC0QJ;4]0S4>
+MIH9&@"34E*2)E&R>I[;8$CTH8"3!)X4]-,30:!&3)J>BGDP*::-I,AC*:-#0
+M-&F@`!IH`:::!D>H````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V3YR(NU(3Z&/-6M70(BN9+N\'
+ML6C@L['=3AH(!OA(W687;HO@OIEU!I<8"+%8DSU=CH3+KG7])+2RW&G9)9!$
+MQ3;ITH2B6!BN`1`O#JF@(/QQ`10C/`7':QDX8,LL'T0#(.<RO77&7`"7TND]
+MB3#&)*^X(@C]?40_AQI`"*$=J4ZF2=X>-2M,NJR,(=0>`1/&Y[*7J[B?1AG%
+M9-1B$-Z+7N*DI('6:N>R8MBAV_Z_7(O.3=5P8[)($D+5KG$;E14J\-D@R_UF
+MLF&AA&/2@6)ZJ;TZ"\7E;.)/TN*8W)V^ICH>)^QR\OC]+_7M)4#V.("KGD7?
+M9_&Y+>H95?]3-GMO9,YO+``27<Z\Q6W&F/^V)_'S\;WA9@B)C2K;'J2$XYJ'
+M6,^A+32M&#?!-0$4GCT:W#8.8:0157)LZ[SXM<IZ]4V5REDT:W-^;J.#0+Z@
+M0@$O[!9UG\+Z,Z(XGV:&C_K';"L4JO#2@1!<,VI[*P&%\;0?O//I^I0NM2<E
+M)9.J;,?7['@""ZT5=+Y?V54^30D\<>79/YN6']*5(!!*+T\?CMLH@"7+1>[/
+MD0(#@&)QD)H9/ODAR$DD)/>;%E;NN8`?8H>.\=GM&$A]>FMMU]R]\GP4Z;Z?
+M&K\1"`'8'_&H2<YBP-$K*P("\2`R7L-([!)>9W967@\S[B@0/F@@@$"@$$$"
+M[H'M:I>M='#:"WN/&D).V0(?^EY+-1M?,[Z5E14BV`0Q$FYY5JF1__B[DBG"
+&A(09YF?0
+`
+end
diff --git a/contrib/netbsd-tests/dev/cgd/paramsfile b/contrib/netbsd-tests/dev/cgd/paramsfile
new file mode 100644
index 0000000..066eab6
--- /dev/null
+++ b/contrib/netbsd-tests/dev/cgd/paramsfile
@@ -0,0 +1,8 @@
+algorithm aes-cbc;
+iv-method encblkno1;
+keylength 128;
+verify_method none;
+keygen pkcs5_pbkdf2/sha1 {
+ iterations 42;
+ salt AAAAgKajcCnHR7sR1k1RKQ9Q0uY=;
+};
diff --git a/contrib/netbsd-tests/dev/cgd/t_cgd.sh b/contrib/netbsd-tests/dev/cgd/t_cgd.sh
new file mode 100755
index 0000000..9cd50a5
--- /dev/null
+++ b/contrib/netbsd-tests/dev/cgd/t_cgd.sh
@@ -0,0 +1,159 @@
+# $NetBSD: t_cgd.sh,v 1.11 2013/02/19 21:08:24 joerg Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, 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 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.
+#
+
+rawpart=`sysctl -n kern.rawpartition | tr '01234' 'abcde'`
+rawcgd=/dev/rcgd0${rawpart}
+cgdserver=\
+"rump_server -lrumpvfs -lrumpkern_crypto -lrumpdev -lrumpdev_disk -lrumpdev_cgd"
+
+atf_test_case basic cleanup
+basic_head()
+{
+
+ atf_set "descr" "Tests that encrypt/decrypt works"
+ atf_set "require.progs" "rump_server"
+}
+
+basic_body()
+{
+
+ d=$(atf_get_srcdir)
+ atf_check -s exit:0 \
+ ${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
+
+ export RUMP_SERVER=unix://csock
+ atf_check -s exit:0 -x "echo 12345 | \
+ rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile"
+ atf_check -s exit:0 -e ignore -x \
+ "dd if=${d}/t_cgd count=2 | rump.dd of=${rawcgd}"
+ atf_check -s exit:0 -e ignore dd if=${d}/t_cgd of=testfile count=2
+ atf_check -s exit:0 -e ignore -o file:testfile \
+ rump.dd if=${rawcgd} count=2
+}
+
+basic_cleanup()
+{
+
+ env RUMP_SERVER=unix://csock rump.halt || true
+}
+
+atf_test_case wrongpass cleanup
+wrongpass_head()
+{
+
+ atf_set "descr" "Tests that wrong password does not give original " \
+ "plaintext"
+ atf_set "require.progs" "rump_server"
+}
+
+wrongpass_body()
+{
+
+ d=$(atf_get_srcdir)
+ atf_check -s exit:0 \
+ ${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
+
+ export RUMP_SERVER=unix://csock
+ atf_check -s exit:0 -x "echo 12345 | \
+ rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile"
+ atf_check -s exit:0 -e ignore -x \
+ "dd if=${d}/t_cgd | rump.dd of=${rawcgd} count=2"
+
+ # unconfig and reconfig cgd
+ atf_check -s exit:0 rump.cgdconfig -u cgd0
+ atf_check -s exit:0 -x "echo 54321 | \
+ rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile"
+
+ atf_check -s exit:0 -e ignore dd if=${d}/t_cgd of=testfile count=2
+ atf_check -s exit:0 -e ignore -o not-file:testfile \
+ rump.dd if=${rawcgd} count=2
+}
+
+wrongpass_cleanup()
+{
+
+ env RUMP_SERVER=unix://csock rump.halt || true
+}
+
+
+atf_test_case unaligned_write cleanup
+unaligned_write_head()
+{
+
+ atf_set "descr" "Attempt unaligned writes to a raw cgd device"
+ atf_set "require.progs" "rump_server"
+}
+
+unaligned_write_body()
+{
+ d=$(atf_get_srcdir)
+ atf_check -s exit:0 \
+ ${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
+
+ export RUMP_SERVER=unix://csock
+ atf_check -s exit:0 -x "echo 12345 | \
+ rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile"
+
+ # Check that cgd rejects writes of totally bogus lengths.
+ atf_check -s not-exit:0 -e ignore -x \
+ "echo die hard | rump.dd of=${rawcgd} bs=123 conv=sync"
+
+ # Check that cgd rejects non-sector-length writes even if they
+ # are integral multiples of the block size.
+ atf_check -s not-exit:0 -e ignore -x \
+ "echo die hard | rump.dd of=${rawcgd} bs=64 conv=sync"
+ atf_check -s not-exit:0 -e ignore -x \
+ "echo die hard | rump.dd of=${rawcgd} bs=256 conv=sync"
+
+ # Check that cgd rejects misaligned buffers, produced by
+ # packetizing the input on bogus boundaries and using the
+ # bizarre behaviour of `bs=N' in dd.
+ atf_check -s not-exit:0 -e ignore -x \
+ "(echo -n x && sleep 1 && head -c 511 </dev/zero) \
+ | rump.dd of=${rawcgd} bs=512"
+
+ # Check that cgd rejects sector-length writes if they are not
+ # on sector boundaries. Doesn't work because dd can't be
+ # persuaded to seek a non-integral multiple of the output
+ # buffer size and I can't be arsed to find the another way to
+ # do that.
+ #atf_check -s not-exit:0 -e ignore -x \
+ # "echo die hard | rump.dd of=${rawcgd} seek=1 bs=512 conv=sync"
+}
+
+unaligned_write_cleanup()
+{
+ env RUMP_SERVER=unix://csock rump.halt || true
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case basic
+ atf_add_test_case wrongpass
+ atf_add_test_case unaligned_write
+}
diff --git a/contrib/netbsd-tests/dev/dm/dm_targets_cmd.plist b/contrib/netbsd-tests/dev/dm/dm_targets_cmd.plist
new file mode 100644
index 0000000..f029dfb
--- /dev/null
+++ b/contrib/netbsd-tests/dev/dm/dm_targets_cmd.plist
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>cmd_data</key>
+ <array/>
+ <key>command</key>
+ <string>targets</string>
+ <key>event_nr</key>
+ <integer>0x0</integer>
+ <key>flags</key>
+ <integer>0x4</integer>
+ <key>version</key>
+ <array>
+ <integer>0x4</integer>
+ <integer>0x1</integer>
+ <integer>0x0</integer>
+ </array>
+</dict>
+</plist> \ No newline at end of file
diff --git a/contrib/netbsd-tests/dev/dm/dm_version_cmd.plist b/contrib/netbsd-tests/dev/dm/dm_version_cmd.plist
new file mode 100644
index 0000000..e40e53e
--- /dev/null
+++ b/contrib/netbsd-tests/dev/dm/dm_version_cmd.plist
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>cmd_data</key>
+ <array/>
+ <key>command</key>
+ <string>version</string>
+ <key>event_nr</key>
+ <integer>0x0</integer>
+ <key>flags</key>
+ <integer>0x4</integer>
+ <key>version</key>
+ <array>
+ <integer>0x4</integer>
+ <integer>0x0</integer>
+ <integer>0x0</integer>
+ </array>
+</dict>
+</plist> \ No newline at end of file
diff --git a/contrib/netbsd-tests/dev/dm/h_dm.c b/contrib/netbsd-tests/dev/dm/h_dm.c
new file mode 100644
index 0000000..3380ad3
--- /dev/null
+++ b/contrib/netbsd-tests/dev/dm/h_dm.c
@@ -0,0 +1,146 @@
+/* $NetBSD: h_dm.c,v 1.1 2010/10/06 11:24:55 haad Exp $ */
+
+/*
+ * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/disklabel.h>
+
+#include <ctype.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <util.h>
+
+#include <dev/dm/netbsd-dm.h>
+
+int dm_test_targets(void);
+int dm_test_versions(void);
+
+/*
+ * Test simple dm versions command on device-mapper device.
+ */
+int
+dm_test_versions(void) {
+ int fd;
+ int error;
+ prop_dictionary_t dict_in, dict_out;
+ struct plistref prefp;
+ char *xml;
+
+ error = 0;
+
+ error = rump_init();
+ if (error != 0)
+ err(1, "Rump init failed");
+
+ fd = rump_sys_open("/dev/mapper/control", O_RDWR, 0);
+ if (fd == -1)
+ err(1, "Open dm device failed");
+
+ dict_in = prop_dictionary_internalize_from_file("dm_version_cmd.plist");
+ dict_out = prop_dictionary_create();
+
+ prop_dictionary_externalize_to_pref(dict_in, &prefp);
+
+ error = rump_sys_ioctl(fd, NETBSD_DM_IOCTL, &prefp);
+ if (error < 0)
+ err(1, "Dm control ioctl failed");
+
+ dict_out = prop_dictionary_internalize(prefp.pref_plist);
+
+ xml = prop_dictionary_externalize(dict_out);
+
+ rump_sys_close(fd);
+
+ return error;
+}
+
+/*
+ * Test simple dm targets command on device-mapper device.
+ */
+int
+dm_test_targets(void) {
+ int fd;
+ int error;
+ prop_dictionary_t dict_in, dict_out;
+ struct plistref prefp;
+ char *xml;
+
+ error = 0;
+
+ error = rump_init();
+ if (error != 0)
+ err(1, "Rump init failed");
+
+ fd = rump_sys_open("/dev/mapper/control", O_RDWR, 0);
+ if (fd == -1)
+ err(1, "Open dm device failed");
+
+ dict_in = prop_dictionary_internalize_from_file("dm_targets_cmd.plist");
+ dict_out = prop_dictionary_create();
+
+ prop_dictionary_externalize_to_pref(dict_in, &prefp);
+
+ error = rump_sys_ioctl(fd, NETBSD_DM_IOCTL, &prefp);
+ if (error < 0)
+ err(1, "Dm control ioctl failed");
+
+ dict_out = prop_dictionary_internalize(prefp.pref_plist);
+
+ xml = prop_dictionary_externalize(dict_out);
+
+ rump_sys_close(fd);
+
+ return error;
+}
+
+int
+main(int argc, char **argv) {
+ int error;
+
+ error = 0;
+
+ error = dm_test_versions();
+ if (error != 0)
+ err(1, "dm_test_versions failed");
+
+ error = dm_test_targets();
+ if (error != 0)
+ err(1, "dm_test_targets failed");
+
+ return error;
+}
diff --git a/contrib/netbsd-tests/dev/dm/t_dm.sh b/contrib/netbsd-tests/dev/dm/t_dm.sh
new file mode 100755
index 0000000..02d1ee3
--- /dev/null
+++ b/contrib/netbsd-tests/dev/dm/t_dm.sh
@@ -0,0 +1,47 @@
+# $NetBSD: t_dm.sh,v 1.2 2010/11/07 17:51:17 jmmv Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case dm_test
+dm_test_head()
+{
+ atf_set "descr" "Check dm driver routines and create lineary, stripe mapped disks"
+}
+
+dm_test_body()
+{
+ # XXX Actually we need disks than 1 for stripe check let it leave for later now.
+ #atf_check -s exit:0 uudecode $(atf_get_srcdir)/t_dm_disk_1.bz2.uue
+ #atf_check -s exit:0 bunzip2 t_dm_disk_1.bz2
+ #atf_check -s exit:0 -o file:t_dm_disk_1 $(atf_get_srcdir)/h_dm
+ atf_check -s exit:0 $(atf_get_srcdir)/h_dm
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case dm_test
+}
diff --git a/contrib/netbsd-tests/dev/md/h_mdserv.c b/contrib/netbsd-tests/dev/md/h_mdserv.c
new file mode 100644
index 0000000..f5ac6a9
--- /dev/null
+++ b/contrib/netbsd-tests/dev/md/h_mdserv.c
@@ -0,0 +1,109 @@
+/* $NetBSD: h_mdserv.c,v 1.4 2011/02/10 13:29:02 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+
+#include <dev/md.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#define MDSIZE (1024*1024)
+
+#define REQUIRE(a, msg) if ((a) != 0) err(1, msg);
+
+static void *
+prober(void *arg)
+{
+ int fd, error;
+ char buf[4];
+ ssize_t n;
+
+ fd = rump_sys_open(arg, O_RDONLY);
+ for (;;) {
+ n = rump_sys_read(fd, buf, sizeof(buf));
+
+ switch (n) {
+ case 4:
+ error = 0;
+ goto out;
+
+ case -1:
+ if (errno == ENXIO) {
+ usleep(1000);
+ continue;
+ }
+
+ /* FALLTHROUGH */
+ default:
+ error = EPIPE;
+ goto out;
+ }
+ }
+ out:
+
+ error = rump_daemonize_done(error);
+ REQUIRE(error, "rump_daemonize_done");
+
+ if (error)
+ exit(1);
+
+ return NULL;
+}
+
+int
+main(int argc, char *argv[])
+{
+ pthread_t pt;
+ struct md_conf md;
+ int fd, error;
+
+ if (argc != 2)
+ exit(1);
+
+ md.md_addr = calloc(1, MDSIZE);
+ md.md_size = MDSIZE;
+ md.md_type = MD_UMEM_SERVER;
+
+ error = rump_daemonize_begin();
+ REQUIRE(error, "rump_daemonize_begin");
+
+ error = rump_init();
+ REQUIRE(error, "rump_init");
+
+ error = rump_init_server("unix://commsock");
+ REQUIRE(error, "init server");
+
+ if ((fd = rump_sys_open(argv[1], O_RDWR)) == -1)
+ err(1, "open");
+
+ /*
+ * Now, configuring the md driver also causes our process
+ * to start acting as the worker for the md. Splitting it
+ * into two steps in the driver is not easy, since md is
+ * supposed to be unconfigured when the process dies
+ * (process may exit between calling ioctl1 and ioctl2).
+ * So, start a probe thread which attempts to read the md
+ * and declares the md as configured when the read is
+ * succesful.
+ */
+ error = pthread_create(&pt, NULL, prober, argv[1]);
+ REQUIRE(error, "pthread_create");
+ pthread_detach(pt);
+
+ if (rump_sys_ioctl(fd, MD_SETCONF, &md) == -1) {
+ rump_daemonize_done(errno);
+ exit(1);
+ }
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/dev/md/t_md.sh b/contrib/netbsd-tests/dev/md/t_md.sh
new file mode 100755
index 0000000..85de73e
--- /dev/null
+++ b/contrib/netbsd-tests/dev/md/t_md.sh
@@ -0,0 +1,65 @@
+# $NetBSD: t_md.sh,v 1.7 2011/05/14 17:42:28 jmmv Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, 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 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.
+#
+
+rawpart=`sysctl -n kern.rawpartition | tr '01234' 'abcde'`
+rawmd=/dev/rmd0${rawpart}
+
+atf_test_case basic cleanup
+basic_head()
+{
+
+ atf_set "descr" "Check that md can be created, read and written"
+}
+
+basic_body()
+{
+
+ # Scope out raw part. This is actually the *host* raw partition,
+ # but just let it slide for now, since they *should* be the same.
+ rawpart=`sysctl -n kern.rawpartition | tr '01234' 'abcde'`
+
+ atf_check -s exit:0 $(atf_get_srcdir)/h_mdserv ${rawmd}
+
+ export RUMP_SERVER=unix://commsock
+ atf_check -s exit:0 -e ignore -x \
+ "dd if=/bin/ls count=10 | rump.dd of=${rawmd} seek=100"
+ atf_check -s exit:0 -e ignore -x \
+ "rump.dd if=${rawmd} skip=100 count=10 | dd of=testfile"
+ atf_check -s exit:0 -e ignore -o file:testfile dd if=/bin/ls count=10
+}
+
+basic_cleanup()
+{
+
+ env RUMP_SERVER=unix://commsock rump.halt
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/dev/raidframe/t_raid.sh b/contrib/netbsd-tests/dev/raidframe/t_raid.sh
new file mode 100755
index 0000000..ae21eed
--- /dev/null
+++ b/contrib/netbsd-tests/dev/raidframe/t_raid.sh
@@ -0,0 +1,323 @@
+#! /usr/bin/atf-sh
+# $NetBSD: t_raid.sh,v 1.12 2013/02/19 21:08:24 joerg Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, 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 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.
+#
+
+rawpart=`sysctl -n kern.rawpartition | tr '01234' 'abcde'`
+rawraid=/dev/rraid0${rawpart}
+raidserver="rump_server -lrumpvfs -lrumpdev -lrumpdev_disk -lrumpdev_raidframe"
+
+makecfg()
+{
+ level=${1}
+ ncol=${2}
+
+ printf "START array\n1 ${ncol} 0\nSTART disks\n" > raid.conf
+ diskn=0
+ while [ ${ncol} -gt ${diskn} ] ; do
+ echo "/disk${diskn}" >> raid.conf
+ diskn=$((diskn+1))
+ done
+
+ printf "START layout\n32 1 1 ${level}\nSTART queue\nfifo 100\n" \
+ >> raid.conf
+}
+
+atf_test_case smalldisk cleanup
+smalldisk_head()
+{
+ atf_set "descr" "Checks the raidframe works on small disks " \
+ "(PR kern/44239)"
+ atf_set "require.progs" "rump_server"
+}
+
+smalldisk_body()
+{
+ makecfg 1 2
+ export RUMP_SERVER=unix://sock
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=1m \
+ -d key=/disk1,hostpath=disk1.img,size=1m \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -C raid.conf raid0
+}
+
+smalldisk_cleanup()
+{
+ export RUMP_SERVER=unix://sock
+ rump.halt
+}
+
+
+# make this smaller once 44239 is fixed
+export RAID_MEDIASIZE=32m
+
+atf_test_case raid1_compfail cleanup
+raid1_compfail_head()
+{
+ atf_set "descr" "Checks that RAID1 works after component failure"
+ atf_set "require.progs" "rump_server"
+}
+
+raid1_compfail_body()
+{
+ makecfg 1 2
+ export RUMP_SERVER=unix://sock
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -C raid.conf raid0
+ atf_check -s exit:0 rump.raidctl -I 12345 raid0
+ atf_check -s exit:0 -o ignore rump.raidctl -iv raid0
+
+ # put some data there
+ atf_check -s exit:0 -e ignore \
+ dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
+ atf_check -s exit:0 -e ignore -x \
+ "dd if=testfile | rump.dd of=${rawraid} conv=sync"
+
+ # restart server with failed component
+ rump.halt
+ rm disk1.img # FAIL
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -c raid.conf raid0
+
+ # check if we we get what we wrote
+ atf_check -s exit:0 -o file:testfile -e ignore \
+ rump.dd if=${rawraid} count=4
+}
+
+raid1_compfail_cleanup()
+{
+ export RUMP_SERVER=unix://sock
+ rump.halt
+}
+
+
+
+atf_test_case raid1_comp0fail cleanup
+raid1_comp0fail_head()
+{
+ atf_set "descr" "Checks configuring RAID1 after component 0 fails" \
+ "(PR kern/44251)"
+ atf_set "require.progs" "rump_server"
+}
+
+raid1_comp0fail_body()
+{
+ makecfg 1 2
+ export RUMP_SERVER=unix://sock
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -C raid.conf raid0
+ atf_check -s exit:0 rump.raidctl -I 12345 raid0
+ atf_check -s exit:0 -o ignore rump.raidctl -iv raid0
+
+ # restart server with failed component
+ rump.halt
+ rm disk0.img # FAIL
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -c raid.conf raid0
+}
+
+raid1_comp0fail_cleanup()
+{
+ export RUMP_SERVER=unix://sock
+ rump.halt
+}
+
+atf_test_case raid1_normal cleanup
+raid1_normal_head()
+{
+ atf_set "descr" "Checks that RAID1 -c configurations work " \
+ "in the normal case"
+ atf_set "require.progs" "rump_server"
+}
+
+raid1_normal_body()
+{
+ makecfg 1 2
+ export RUMP_SERVER=unix://sock
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -C raid.conf raid0
+ atf_check -s exit:0 rump.raidctl -I 12345 raid0
+ atf_check -s exit:0 -o ignore rump.raidctl -iv raid0
+
+ # put some data there
+ atf_check -s exit:0 -e ignore \
+ dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
+ atf_check -s exit:0 -e ignore -x \
+ "dd if=testfile | rump.dd of=${rawraid} conv=sync"
+
+ # restart server, disks remain normal
+ rump.halt
+
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -c raid.conf raid0
+
+ # check if we we get what we wrote
+ atf_check -s exit:0 -o file:testfile -e ignore \
+ rump.dd if=${rawraid} count=4
+
+}
+
+raid1_normal_cleanup()
+{
+ export RUMP_SERVER=unix://sock
+ rump.halt
+}
+
+
+atf_test_case raid5_compfail cleanup
+raid5_compfail_head()
+{
+ atf_set "descr" "Checks that RAID5 works after component failure"
+ atf_set "require.progs" "rump_server"
+}
+
+raid5_compfail_body()
+{
+ makecfg 5 3
+ export RUMP_SERVER=unix://sock
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk2,hostpath=disk2.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -C raid.conf raid0
+ atf_check -s exit:0 rump.raidctl -I 12345 raid0
+ atf_check -s exit:0 -o ignore rump.raidctl -iv raid0
+
+ # put some data there
+ atf_check -s exit:0 -e ignore \
+ dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
+ atf_check -s exit:0 -e ignore -x \
+ "dd if=testfile | rump.dd of=${rawraid} conv=sync"
+
+ # restart server with failed component
+ rump.halt
+ rm disk2.img # FAIL
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk2,hostpath=disk2.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -c raid.conf raid0
+
+ # check if we we get what we wrote
+ atf_check -s exit:0 -o file:testfile -e ignore \
+ rump.dd if=${rawraid} count=4
+}
+
+raid5_compfail_cleanup()
+{
+ export RUMP_SERVER=unix://sock
+ rump.halt
+}
+
+atf_test_case raid5_normal cleanup
+raid5_normal_head()
+{
+ atf_set "descr" "Checks that RAID5 works after normal shutdown " \
+ "and 'raidctl -c' startup"
+ atf_set "require.progs" "rump_server"
+}
+
+raid5_normal_body()
+{
+ makecfg 5 3
+ export RUMP_SERVER=unix://sock
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk2,hostpath=disk2.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -C raid.conf raid0
+ atf_check -s exit:0 rump.raidctl -I 12345 raid0
+ atf_check -s exit:0 -o ignore rump.raidctl -iv raid0
+
+ # put some data there
+ atf_check -s exit:0 -e ignore \
+ dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
+ atf_check -s exit:0 -e ignore -x \
+ "dd if=testfile | rump.dd of=${rawraid} conv=sync"
+
+ # restart server after normal shutdown
+ rump.halt
+
+ atf_check -s exit:0 ${raidserver} \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk2,hostpath=disk2.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -c raid.conf raid0
+
+ # check if we we get what we wrote
+ atf_check -s exit:0 -o file:testfile -e ignore \
+ rump.dd if=${rawraid} count=4
+}
+
+raid5_normal_cleanup()
+{
+ export RUMP_SERVER=unix://sock
+ rump.halt
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case smalldisk
+ atf_add_test_case raid1_normal
+ atf_add_test_case raid1_comp0fail
+ atf_add_test_case raid1_compfail
+ atf_add_test_case raid5_normal
+ atf_add_test_case raid5_compfail
+}
diff --git a/contrib/netbsd-tests/dev/scsipi/libscsitest/SCSITEST.ioconf b/contrib/netbsd-tests/dev/scsipi/libscsitest/SCSITEST.ioconf
new file mode 100644
index 0000000..afee6c8
--- /dev/null
+++ b/contrib/netbsd-tests/dev/scsipi/libscsitest/SCSITEST.ioconf
@@ -0,0 +1,12 @@
+# $NetBSD: SCSITEST.ioconf,v 1.1 2014/04/24 21:46:44 pooka Exp $
+#
+
+ioconf scsitest
+
+include "conf/files"
+include "dev/scsipi/files.scsipi"
+include "rump/dev/files.rump"
+
+pseudo-root mainbus*
+
+scsitest0 at mainbus?
diff --git a/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest.c b/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest.c
new file mode 100644
index 0000000..8f214f7
--- /dev/null
+++ b/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest.c
@@ -0,0 +1,259 @@
+/* $NetBSD: scsitest.c,v 1.2 2014/04/25 00:24:39 pooka Exp $ */
+
+/*
+ * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * A SCSI target which is useful for debugging our scsipi driver stack.
+ * Currently it pretends to be a single CD.
+ *
+ * Freely add the necessary features for your tests. Just remember to
+ * run the atf test suite to make sure you didn't cause regressions to
+ * other tests.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: scsitest.c,v 1.2 2014/04/25 00:24:39 pooka Exp $");
+
+#include <sys/param.h>
+#include <sys/atomic.h>
+#include <sys/buf.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+#include <sys/fcntl.h>
+
+#include <dev/scsipi/scsiconf.h>
+#include <dev/scsipi/scsipiconf.h>
+#include <dev/scsipi/scsi_disk.h>
+#include <dev/scsipi/scsipi_cd.h>
+#include <dev/scsipi/scsipi_all.h>
+
+#include <rump/rumpuser.h>
+
+#include "scsitest.h"
+
+int scsitest_match(device_t, cfdata_t, void *);
+void scsitest_attach(device_t, device_t, void *);
+
+struct scsitest {
+ struct scsipi_channel sc_channel;
+ struct scsipi_adapter sc_adapter;
+};
+
+CFATTACH_DECL_NEW(scsitest, sizeof(struct scsitest), scsitest_match,
+ scsitest_attach, NULL, NULL);
+
+/*
+ * tosi.iso can be used to deliver CD requests to a host file with the
+ * name in USE_TOSI_ISO (yes, it's extrasimplistic).
+ */
+//#define USE_TOSI_ISO
+
+#define CDBLOCKSIZE 2048
+static uint32_t mycdsize = 2048;
+static int isofd;
+
+#define MYCDISO "tosi.iso"
+
+unsigned rump_scsitest_err[RUMP_SCSITEST_MAXERROR];
+
+static void
+sense_notready(struct scsipi_xfer *xs)
+{
+ struct scsi_sense_data *sense = &xs->sense.scsi_sense;
+
+ xs->error = XS_SENSE;
+
+ sense->response_code = 0x70;
+ sense->flags = SKEY_NOT_READY;
+ sense->asc = 0x3A;
+ sense->ascq = 0x00;
+ sense->extra_len = 6;
+}
+
+/*
+ * This is pretty much a CD target for now
+ */
+static void
+scsitest_request(struct scsipi_channel *chan,
+ scsipi_adapter_req_t req, void *arg)
+{
+ struct scsipi_xfer *xs = arg;
+ struct scsipi_generic *cmd = xs->cmd;
+#ifdef USE_TOSI_ISO
+ int error;
+#endif
+
+ if (req != ADAPTER_REQ_RUN_XFER)
+ return;
+
+ //show_scsipi_xs(xs);
+
+ switch (cmd->opcode) {
+ case SCSI_TEST_UNIT_READY:
+ if (isofd == -1)
+ sense_notready(xs);
+
+ break;
+ case INQUIRY: {
+ struct scsipi_inquiry_data *inqbuf = (void *)xs->data;
+
+ memset(inqbuf, 0, sizeof(*inqbuf));
+ inqbuf->device = T_CDROM;
+ inqbuf->dev_qual2 = SID_REMOVABLE;
+ strcpy(inqbuf->vendor, "RUMPHOBO");
+ strcpy(inqbuf->product, "It's a LIE");
+ strcpy(inqbuf->revision, "0.00");
+ break;
+ }
+ case READ_CD_CAPACITY: {
+ struct scsipi_read_cd_cap_data *ret = (void *)xs->data;
+
+ _lto4b(CDBLOCKSIZE, ret->length);
+ _lto4b(mycdsize, ret->addr);
+
+ break;
+ }
+ case READ_DISCINFO: {
+ struct scsipi_read_discinfo_data *ret = (void *)xs->data;
+
+ memset(ret, 0, sizeof(*ret));
+ break;
+ }
+ case READ_TRACKINFO: {
+ struct scsipi_read_trackinfo_data *ret = (void *)xs->data;
+
+ _lto4b(mycdsize, ret->track_size);
+ break;
+ }
+ case READ_TOC: {
+ struct scsipi_toc_header *ret = (void *)xs->data;
+
+ memset(ret, 0, sizeof(*ret));
+ break;
+ }
+ case START_STOP: {
+ struct scsipi_start_stop *param = (void *)cmd;
+
+ if (param->how & SSS_LOEJ) {
+#ifdef USE_TOSI_ISO
+ rumpuser_close(isofd, &error);
+#endif
+ isofd = -1;
+ }
+ break;
+ }
+ case SCSI_SYNCHRONIZE_CACHE_10: {
+ if (isofd == -1) {
+ if ((xs->xs_control & XS_CTL_SILENT) == 0)
+ atomic_inc_uint(&rump_scsitest_err
+ [RUMP_SCSITEST_NOISYSYNC]);
+
+ sense_notready(xs);
+ }
+
+ break;
+ }
+ case GET_CONFIGURATION: {
+ memset(xs->data, 0, sizeof(struct scsipi_get_conf_data));
+ break;
+ }
+ case SCSI_READ_6_COMMAND: {
+#ifdef USE_TOSI_ISO
+ struct scsi_rw_6 *param = (void *)cmd;
+
+ printf("reading %d bytes from %d\n",
+ param->length * CDBLOCKSIZE,
+ _3btol(param->addr) * CDBLOCKSIZE);
+ rumpuser_pread(isofd, xs->data,
+ param->length * CDBLOCKSIZE,
+ _3btol(param->addr) * CDBLOCKSIZE,
+ &error);
+#endif
+
+ break;
+ }
+ case SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL:
+ /* hardcoded for now */
+ break;
+ default:
+ printf("unhandled opcode 0x%x\n", cmd->opcode);
+ break;
+ }
+
+ scsipi_done(xs);
+}
+
+int
+scsitest_match(device_t parent, cfdata_t match, void *aux)
+{
+#ifdef USE_TOSI_ISO
+ uint64_t fsize;
+ int error, ft;
+
+ if (rumpuser_getfileinfo(MYCDISO, &fsize, &ft, &error))
+ return 0;
+ if (ft != RUMPUSER_FT_REG)
+ return 0;
+ mycdsize = fsize / CDBLOCKSIZE;
+
+ if ((isofd = rumpuser_open(MYCDISO, RUMPUSER_OPEN_RDWR, &error)) == -1)
+ return 0;
+#else
+ /*
+ * We pretend to have a medium present initially, so != -1.
+ */
+ isofd = -2;
+#endif
+
+ return 1;
+}
+
+void
+scsitest_attach(device_t parent, device_t self, void *aux)
+{
+ struct scsitest *sc = device_private(self);
+
+ aprint_naive("\n");
+ aprint_normal("\n");
+
+ memset(&sc->sc_adapter, 0, sizeof(sc->sc_adapter));
+ sc->sc_adapter.adapt_nchannels = 1;
+ sc->sc_adapter.adapt_request = scsitest_request;
+ sc->sc_adapter.adapt_minphys = minphys;
+ sc->sc_adapter.adapt_dev = self;
+ sc->sc_adapter.adapt_max_periph = 1;
+ sc->sc_adapter.adapt_openings = 1;
+
+ memset(&sc->sc_channel, 0, sizeof(sc->sc_channel));
+ sc->sc_channel.chan_bustype = &scsi_bustype;
+ sc->sc_channel.chan_ntargets = 2;
+ sc->sc_channel.chan_nluns = 1;
+ sc->sc_channel.chan_id = 0;
+ sc->sc_channel.chan_flags = SCSIPI_CHAN_NOSETTLE;
+ sc->sc_channel.chan_adapter = &sc->sc_adapter;
+
+ config_found_ia(self, "scsi", &sc->sc_channel, scsiprint);
+}
diff --git a/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest.h b/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest.h
new file mode 100644
index 0000000..ba9b84a
--- /dev/null
+++ b/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest.h
@@ -0,0 +1,38 @@
+/* $NetBSD: scsitest.h,v 1.1 2014/04/25 00:24:39 pooka Exp $ */
+
+/*
+ * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 _RUMP_SCSITEST_H_
+#define _RUMP_SCSITEST_H_
+
+enum {
+ RUMP_SCSITEST_NOISYSYNC,
+ RUMP_SCSITEST_MAXERROR
+};
+
+extern unsigned rump_scsitest_err[RUMP_SCSITEST_MAXERROR];
+
+#endif /* _RUMP_SCSITEST_H_ */
diff --git a/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest_component.c b/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest_component.c
new file mode 100644
index 0000000..db0e209
--- /dev/null
+++ b/contrib/netbsd-tests/dev/scsipi/libscsitest/scsitest_component.c
@@ -0,0 +1,46 @@
+/* $NetBSD: scsitest_component.c,v 1.1 2014/04/24 21:46:44 pooka Exp $ */
+
+/*
+ * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: scsitest_component.c,v 1.1 2014/04/24 21:46:44 pooka Exp $");
+
+#include <sys/param.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/mbuf.h>
+#include <sys/stat.h>
+
+#include "ioconf.c"
+
+#include "rump_private.h"
+
+RUMP_COMPONENT(RUMP_COMPONENT_DEV)
+{
+
+ config_init_component(cfdriver_ioconf_scsitest,
+ cfattach_ioconf_scsitest, cfdata_ioconf_scsitest);
+}
diff --git a/contrib/netbsd-tests/dev/scsipi/t_cd.c b/contrib/netbsd-tests/dev/scsipi/t_cd.c
new file mode 100644
index 0000000..58e61a5
--- /dev/null
+++ b/contrib/netbsd-tests/dev/scsipi/t_cd.c
@@ -0,0 +1,81 @@
+/* $NetBSD: t_cd.c,v 1.7 2014/04/25 00:24:39 pooka Exp $ */
+
+/*
+ * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+#include <sys/ioctl.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <util.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "scsitest.h"
+
+#include "../../h_macros.h"
+
+ATF_TC(noisyeject);
+ATF_TC_HEAD(noisyeject, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test for CD eject noisyness "
+ "(PR kern/43785)");
+}
+
+ATF_TC_BODY(noisyeject, tc)
+{
+ static char fname[] = "/dev/rcd0_";
+ int part, fd, arg = 0;
+
+ RL(part = getrawpartition());
+ fname[strlen(fname)-1] = 'a' + part;
+ rump_init();
+ /*
+ * Rump CD emulation has been fixed, so no longer a problem.
+ *
+ atf_tc_expect_signal(SIGSEGV, "PR kern/47646: Broken test or "
+ "a real problem in rump or the driver");
+ */
+ RL(fd = rump_sys_open(fname, O_RDWR));
+ RL(rump_sys_ioctl(fd, DIOCEJECT, &arg));
+
+ ATF_REQUIRE_EQ(rump_scsitest_err[RUMP_SCSITEST_NOISYSYNC], 0);
+ RL(rump_sys_close(fd));
+ // atf_tc_expect_fail("PR kern/43785");
+ ATF_REQUIRE_EQ(rump_scsitest_err[RUMP_SCSITEST_NOISYSYNC], 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, noisyeject);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh b/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh
new file mode 100755
index 0000000..5b54431
--- /dev/null
+++ b/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh
@@ -0,0 +1,398 @@
+# $NetBSD: t_swsensor.sh,v 1.7 2013/04/14 16:07:46 martin Exp $
+
+get_sensor_info() {
+ rump.envstat -x | \
+ sed -e "\;swsensor;,\;/array;p" -e "d"
+}
+
+get_sensor_key() {
+ get_sensor_info | grep -A1 $1 | grep integer | sed -e 's;<[/a-z]*>;;g'
+}
+
+get_powerd_event_count() {
+ grep "not running" powerd.log | wc -l
+}
+
+get_rnd_bits_count() {
+ env RUMPHIJACK=blanket=/dev/random:/dev/urandom \
+ RUMP_SERVER=unix://t_swsensor_socket \
+ LD_PRELOAD=/usr/lib/librumphijack.so rndctl -l | \
+ grep "swsensor-sensor" | \
+ awk '{print $2}'
+}
+
+check_powerd_event() {
+ event=$(grep "not running" powerd.log | \
+ sed -e "$1p" -e "d" )
+ event=${event##*//}
+ script=${event%% *}
+ event=${event#* }
+ device=${event%% *}
+ event=${event#* }
+ state=${event%% *}
+ sensor=${event#* }
+ sensor=${sensor% *}
+
+ if [ "${script}" != "sensor_indicator" ] ; then
+ echo "Event uses wrong script: ${script}"
+ elif [ "${device}" != "swsensor" ] ; then
+ echo "Event uses wrong device: ${device}"
+ elif [ "${sensor}" != "sensor" ] ; then
+ echo "Event uses wrong sensor: ${sensor}"
+ elif [ "${state}" != "$2" ] ; then
+ echo "Event uses wrong state: ${state}"
+ fi
+}
+
+# Start the rump server, then load the swsensor module with the
+# requested properties
+
+start_rump() {
+ rump_allserver -l rumpvfs -l rumpdev -l rumpdev_sysmon ${RUMP_SERVER}
+ if [ $( get_sensor_info | wc -l ) -ne 0 ] ; then
+ rump.modunload swsensor
+ rump.modload -f $1 swsensor
+ else
+ rump.modload $1 swsensor
+ fi
+ return $?
+}
+
+common_head() {
+ atf_set descr "$1"
+ atf_set timeout 60
+ atf_set require.progs rump.powerd rump.envstat rump.modload \
+ rump.halt rump.sysctl rump_server \
+ sed grep awk \
+ rndctl expr
+}
+
+common_cleanup() {
+ rump.modunload swsensor
+ rump.halt
+}
+
+create_envsys_conf_files() {
+ cat << ENV0 > env0.conf
+ swsensor {
+ refresh-timeout = 2s;
+ }
+ENV0
+ cat << ENV1 > env1.conf
+ swsensor {
+ sensor0 { critical-min = $(( $1 - $2 )); }
+ }
+ENV1
+ cat << ENV2 > env2.conf
+ swsensor {
+ sensor0 { critical-min = $1; }
+ }
+ENV2
+}
+
+# Test body common to all sensors
+# $1 sensor mode
+# $2 initial sensor value
+# $3 initial limit
+# $4 amount to lower limit
+# $5 difference from limit to trigger event
+# $6 sensor flags, for FHAS_ENTROPY and FMONNOTSUPP
+
+common_body() {
+ # Start the rump-server process and load the module
+ modload_args="-i mode=$1 -i value=$2 -i limit=$3 ${6:+-i flags=$6}"
+ start_rump "$modload_args"
+
+ # create configuration files for updates
+ create_envsys_conf_files $3 $4
+
+ if [ $? -ne 0 ] ; then
+ atf_skip "Cannot set-up rump environment"
+ fi
+
+ # start powerd so we can detect sensor events
+ rump.powerd -n -d > powerd.log 2>&1 &
+ if [ -z "$(jobs)" ] ; then
+ skip_events=1
+ echo "Skipping event sub-tests - powerd did not start"
+ else
+ skip_events=0
+ expected_event=1
+ fi
+
+ # Step 0 - verify that sensor is registered
+ get_sensor_info | grep -q swsensor ||
+ atf_fail "0: Device swsensor not registered"
+
+ # Step 1 - update the refresh-timeout and verify
+ # (use $(( ... )) since the timeout is displayed in hex!)
+ rump.envstat -c env0.conf
+ if [ $(( $( get_sensor_key refresh-timeout ) )) -ne 2 ] ; then
+ atf_fail "1: Could not set refresh-timout to 2s"
+ fi
+
+ # Step 2 - verify that we can read sensor's value
+ if [ $1 -ne 0 -a $( get_sensor_key cur-value ) -ne $2 ] ; then
+ atf_fail "2: Value not available"
+ fi
+
+ # Step 3 - verify that changes in sensor value are seen
+ rump.sysctl -w hw.swsensor.cur_value=$(( $2 + 1 ))
+ if [ $( get_sensor_key cur-value ) -ne $(( $2 + 1 )) ] ; then
+ atf_fail "3: Value not updated"
+ fi
+
+ # Step 4 - if sensor provides hw limit, make sure we can read it
+ if [ $1 -ne 0 ] ; then
+ if [ $( get_sensor_key critical-min ) -ne $3 ] ; then
+ atf_fail "4: Limit not set by device"
+ fi
+ fi
+
+ # Step 5 - if sensor provides hw limit, make sure it works
+ if [ $1 -ne 0 -a ${skip_events} -eq 0 ] ; then
+ rump.sysctl -w hw.swsensor.cur_value=$(( $3 - $5 ))
+ sleep 5
+ cnt=$(get_powerd_event_count)
+ if [ ${cnt} -lt ${expected_event} ] ; then
+ atf_fail "5: No event triggered"
+ elif [ ${cnt} -gt ${expected_event} ] ; then
+ atf_fail "5: Multiple events triggered"
+ fi
+ evt=$( check_powerd_event ${cnt} "critical-under")
+ if [ -n "${evt}" ] ; then
+ atf_fail "5: ${evt}"
+ fi
+ expected_event=$(( 1 + ${expected_event} ))
+ fi
+
+ # Step 6 - verify that we return to normal state
+ if [ $1 -ne 0 -a ${skip_events} -eq 0 ] ; then
+ rump.sysctl -w hw.swsensor.cur_value=$(( $3 + $5 ))
+ sleep 5
+ cnt=$(get_powerd_event_count)
+ if [ ${cnt} -lt ${expected_event} ] ; then
+ atf_fail "6: No event triggered"
+ elif [ ${cnt} -gt ${expected_event} ] ; then
+ atf_fail "6: Multiple events triggered"
+ fi
+ evt=$( check_powerd_event ${cnt} "normal")
+ if [ -n "${evt}" ] ; then
+ atf_fail "6: ${evt}"
+ fi
+ expected_event=$(( 1 + ${expected_event} ))
+ fi
+
+ # Step 7 - verify that we can set our own limit
+
+ # Steps 7 thru 12 are skipped if the sensor cannot be monitored
+ if [ $( expr \( 0$6 / 2048 \) % 2 ) -ne 1 ] ; then
+ rump.envstat -c env1.conf
+ if [ $( get_sensor_key critical-min ) -ne $(( $3 - $4 )) ] ; then
+ atf_fail "7: Limit not set by envstat -c"
+ fi
+
+ # Step 8 - make sure user-set limit works
+ if [ ${skip_events} -eq 0 ] ; then
+ rump.sysctl -w hw.swsensor.cur_value=$(( $3 - $4 - $5 ))
+ sleep 5
+ cnt=$(get_powerd_event_count)
+ if [ ${cnt} -lt ${expected_event} ] ; then
+ atf_fail "8: No event triggered"
+ elif [ ${cnt} -gt ${expected_event} ] ; then
+ atf_fail "8: Multiple events triggered"
+ fi
+ evt=$( check_powerd_event ${cnt} "critical-under")
+ if [ -n "${evt}" ] ; then
+ atf_fail "8: ${evt}"
+ fi
+ expected_event=$(( 1 + ${expected_event} ))
+ fi
+
+ # Step 9 - verify that we return to normal state
+ if [ ${skip_events} -eq 0 ] ; then
+ rump.sysctl -w hw.swsensor.cur_value=$(( $3 - $4 + $5 ))
+ sleep 5
+ cnt=$(get_powerd_event_count)
+ if [ ${cnt} -lt ${expected_event} ] ; then
+ atf_fail "9: No event triggered"
+ elif [ ${cnt} -gt ${expected_event} ] ; then
+ atf_fail "9: Multiple events triggered"
+ fi
+ evt=$( check_powerd_event ${cnt} "normal")
+ if [ -n "${evt}" ] ; then
+ atf_fail "9: ${evt}"
+ fi
+ expected_event=$(( 1 + ${expected_event} ))
+ fi
+
+ # Step 10 - reset to defaults
+ rump.envstat -S
+ if [ $1 -eq 0 ] ; then
+ get_sensor_info | grep -q critical-min &&
+ atf_fail "10: Failed to clear a limit with envstat -S"
+ else
+ if [ $( get_sensor_key critical-min ) -ne $3 ] ; then
+ atf_fail "10: Limit not reset to initial value"
+ fi
+ fi
+
+ # Step 11 - see if more events occur
+ if [ ${skip_events} -eq 0 ] ; then
+ rump.envstat -c env0.conf
+ rump.sysctl -w hw.swsensor.cur_value=$(( $3 - $4 - $5 ))
+ sleep 5
+ cnt=$(get_powerd_event_count)
+ if [ ${cnt} -ge ${expected_event} ] ; then
+ if [ $1 -ne 2 ] ; then
+ atf_fail "11b Event triggered after reset"
+ fi
+ evt=$( check_powerd_event ${cnt} "critical-under")
+ if [ -n "${evt}" ] ; then
+ atf_fail "11a: ${evt}"
+ fi
+ fi
+ fi
+
+ # Step 12 - make sure we can set new limits once more
+ rump.envstat -c env2.conf
+ if [ $( get_sensor_key critical-min ) -ne $3 ] ; then
+ atf_fail "12a: Limit not reset to same value"
+ fi
+ rump.envstat -c env1.conf
+ if [ $( get_sensor_key critical-min ) -ne $(( $3 - $4 )) ] ; then
+ atf_fail "12b: Limit not reset to new value"
+ fi
+ fi
+
+ # Step 13 - confirm registration (or lack thereof) with rndctl
+ rnd_bits=$( get_rnd_bits_count )
+ if [ $( expr \( 0$6 / 8192 \) % 2 ) -eq 1 ] ; then
+ if [ -z "$rnd_bits" ] ; then
+ atf_fail "13a: Not registered with rndctl"
+ fi
+ else
+ if [ -n "$rnd_bits" ] ; then
+ atf_fail "13b: Wrongly registered with rndctl"
+ fi
+ fi
+
+ # Steps 14 and 15 are only if sensor is providing entropy
+ if [ $( expr \( 0$6 / 8192 \) % 2 ) -ne 1 ] ; then
+ return
+ fi
+
+ # Step 14 - make sure entropy collected when device is being polled
+ rump.envstat -c env0.conf
+ rump.sysctl -w hw.swsensor.cur_value=$3
+ sleep 5
+ rump.sysctl -w hw.swsensor.cur_value=$(( $3 + $4 ))
+ sleep 5
+ new_rnd_bits=$( get_rnd_bits_count )
+ if [ $new_rnd_bits -le $rnd_bits ] ; then
+ atf_expect_fail "PR kern/47661"
+ atf_fail "14a: entropy bits did not increase after polling"
+ fi
+ rnd_bits=$new_rnd_bits
+ sleep 5
+ new_rnd_bits=$( get_rnd_bits_count )
+ if [ $new_rnd_bits -gt $rnd_bits ] ; then
+ atf_expect_fail "PR kern/47661"
+ atf_fail "14b: entropy bits increased after poll with no value change"
+ fi
+
+ # Step 15 - make sure entropy collected when device is interrogated
+ #
+ rump.envstat -c env0.conf
+ rump.sysctl -w hw.swsensor.cur_value=$3
+ get_sensor_key cur-value
+ rnd_bits=$( get_rnd_bits_count )
+ rump.sysctl -w hw.swsensor.cur_value=$(( $3 + $4 ))
+ get_sensor_key cur-value
+ new_rnd_bits=$( get_rnd_bits_count )
+ if [ $new_rnd_bits -le $rnd_bits ] ; then
+ atf_expect_fail "PR kern/47661"
+ atf_fail "15a: entropy bits did not increase after interrogation"
+ fi
+ rnd_bits=$new_rnd_bits
+ get_sensor_key cur-value
+ new_rnd_bits=$( get_rnd_bits_count )
+ if [ $new_rnd_bits -gt $rnd_bits ] ; then
+ atf_expect_fail "PR kern/47661"
+ atf_fail "15b: entropy bits increased after interrogation with no value change"
+ fi
+}
+
+atf_test_case simple_sensor cleanup
+simple_sensor_head() {
+ common_head "Test a simple sensor"
+}
+
+simple_sensor_body() {
+ common_body 0 50 30 10 1
+}
+
+simple_sensor_cleanup() {
+ common_cleanup
+}
+
+atf_test_case limit_sensor cleanup
+limit_sensor_head() {
+ common_head "Test a sensor with internal limit"
+}
+
+limit_sensor_body() {
+ common_body 1 45 25 8 2
+}
+
+limit_sensor_cleanup() {
+ common_cleanup
+}
+
+atf_test_case alarm_sensor cleanup
+alarm_sensor_head() {
+ common_head "Test a sensor with internal checking"
+}
+
+alarm_sensor_body() {
+ common_body 2 40 20 6 3
+}
+
+alarm_sensor_cleanup() {
+ common_cleanup
+}
+
+atf_test_case entropy_polled_sensor cleanup
+entropy_polled_sensor_head() {
+ common_head "Test a simple sensor that provides entropy"
+}
+
+entropy_polled_sensor_body() {
+ common_body 0 50 30 10 1 8192
+}
+
+entropy_polled_sensor_cleanup() {
+ common_cleanup
+}
+
+atf_test_case entropy_interrupt_sensor cleanup
+entropy_interrupt_sensor_head() {
+ common_head "Test a sensor that provides entropy without polling"
+}
+
+entropy_interrupt_sensor_body() {
+ common_body 0 50 30 10 1 10240
+}
+
+entropy_interrupt_sensor_cleanup() {
+ common_cleanup
+}
+
+atf_init_test_cases() {
+ RUMP_SERVER="unix://t_swsensor_socket" ; export RUMP_SERVER
+ atf_add_test_case simple_sensor
+ atf_add_test_case limit_sensor
+ atf_add_test_case alarm_sensor
+ atf_add_test_case entropy_polled_sensor
+ atf_add_test_case entropy_interrupt_sensor
+}
diff --git a/contrib/netbsd-tests/dev/sysmon/t_swwdog.c b/contrib/netbsd-tests/dev/sysmon/t_swwdog.c
new file mode 100644
index 0000000..19e3795
--- /dev/null
+++ b/contrib/netbsd-tests/dev/sysmon/t_swwdog.c
@@ -0,0 +1,192 @@
+/* $NetBSD: t_swwdog.c,v 1.5 2011/06/26 12:14:59 christos Exp $ */
+
+/*
+ * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+#include <sys/wait.h>
+#include <sys/wdog.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+
+static volatile sig_atomic_t tcount;
+
+static void
+sigcount(int sig)
+{
+
+ assert(sig == SIGUSR1);
+ tcount++;
+}
+
+/*
+ * Since we are testing for swwdog's ability to reboot/panic, we need
+ * to fork and monitor the exit status from the parent and report
+ * something sensible back to atf.
+ */
+static int
+testbody(int max)
+{
+ char wname[WDOG_NAMESIZE];
+ struct wdog_conf wc;
+ struct wdog_mode wm;
+ pid_t p1, p2;
+ int status;
+ int fd;
+
+ signal(SIGUSR1, sigcount);
+
+ switch ((p1 = fork())) {
+ case 0:
+ break;
+ case -1:
+ atf_tc_fail_errno("fork");
+ break;
+ default:
+ p2 = wait(&status);
+ ATF_REQUIRE_EQ(p1, p2);
+ ATF_REQUIRE_EQ(tcount, max);
+ return status;
+ }
+
+ rump_init();
+
+ fd = rump_sys_open("/dev/watchdog", O_RDWR);
+ if (fd == -1)
+ err(1, "open watchdog");
+
+ wc.wc_count = 1;
+ wc.wc_names = wname;
+
+ if (rump_sys_ioctl(fd, WDOGIOC_GWDOGS, &wc) == -1)
+ err(1, "can't fetch watchdog names");
+
+ if (wc.wc_count) {
+ assert(wc.wc_count == 1);
+
+ strlcpy(wm.wm_name, wc.wc_names, sizeof(wm.wm_name));
+ wm.wm_mode = WDOG_MODE_ETICKLE;
+ wm.wm_period = 1;
+ if (rump_sys_ioctl(fd, WDOGIOC_SMODE, &wm) == -1)
+ atf_tc_fail_errno("failed to set tickle");
+
+ usleep(400000);
+ if (max == 1)
+ rump_sys_ioctl(fd, WDOGIOC_TICKLE);
+ else {
+ wm.wm_mode = WDOG_MODE_DISARMED;
+ rump_sys_ioctl(fd, WDOGIOC_SMODE, &wm);
+ }
+ kill(getppid(), SIGUSR1);
+
+ sleep(2);
+ printf("staying alive\n");
+ kill(getppid(), SIGUSR1);
+ _exit(2);
+ }
+ /* fail */
+ _exit(1);
+}
+
+ATF_TC(reboot);
+ATF_TC_HEAD(reboot, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check swwdog reboot capability");
+}
+
+ATF_TC_BODY(reboot, tc)
+{
+ extern bool rumpns_swwdog_reboot;
+ int status;
+
+ /* XXX: should use sysctl */
+ rumpns_swwdog_reboot = true;
+ status = testbody(1);
+
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE_EQ(WEXITSTATUS(status), 0);
+}
+
+ATF_TC(panic);
+ATF_TC_HEAD(panic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check swwdog panic capability");
+}
+
+ATF_TC_BODY(panic, tc)
+{
+ extern bool rumpns_swwdog_reboot;
+ int status;
+
+ /* XXX: should use sysctl */
+ rumpns_swwdog_reboot = false;
+ status = testbody(1);
+
+ ATF_REQUIRE(WIFSIGNALED(status));
+ ATF_REQUIRE_EQ(WTERMSIG(status), SIGABRT);
+}
+
+ATF_TC(disarm);
+ATF_TC_HEAD(disarm, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check swwdog disarm capability");
+}
+
+ATF_TC_BODY(disarm, tc)
+{
+ int status;
+
+ status = testbody(2);
+
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE_EQ(WEXITSTATUS(status), 2);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, panic);
+ ATF_TP_ADD_TC(tp, reboot);
+ ATF_TP_ADD_TC(tp, disarm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/cd9660/pr_48787.image.bz2.uue b/contrib/netbsd-tests/fs/cd9660/pr_48787.image.bz2.uue
new file mode 100644
index 0000000..d8f7488
--- /dev/null
+++ b/contrib/netbsd-tests/fs/cd9660/pr_48787.image.bz2.uue
@@ -0,0 +1,103 @@
+begin 644 pr_48787.image.bz2
+M0EIH.3%!62936>D^3`0``+M_V?_7U17T!W_H/^_?8..V$"1DB`0``B$`0I-H
+MP`+N-!HLI8)131H4](]3TC(VH`S4;4````T&@R&C0R:!*$1D(8B:C!,(Q-&3
+M-`!,``"&:`FC'&AH&C3(TT:9`8F"``&@-`:9`8$R`J1(A&A$R&391FA#TC0V
+MHQ'J8@&T@VHT`QII&Z!"B5;S7YT+1"ZB8Y+5"M,5_J`!]Y:[$2%,%W`ZAA2@
+MVE)'DK^*?'3QU`DFQ4@22)(B[N3GZN?E<)`DDB.C)7\X71*B1K*2))(DD1HI
+MU5$TUVF[4JP89^FHY$B*FEBC(RN$5"8O'XO]1++(._=;ZKXR%:QK3^W7/>RT
+M8EODZ#MX53U8C0F]6O.G4J/9YNQA$B2))$<[<CT.C.)G[#NK)A3#\KM]#AP,
+M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$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2
+MU(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q
+M;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``8
+M0":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"L
+MDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@
+M```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4
+MA4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O
+M@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`
+M)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3
+M*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&``
+M``00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%
+M0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`
+MK\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`F
+MHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),I
+MK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```
+M!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`
+M2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"O
+MQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C
+M(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFL
+MAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$
+M$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+
+MF*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'
+M(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A
+M4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'
+M!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00
+M`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8
+MH*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@
+M`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0
+M$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$
+M\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``
+M&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@
+MK),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``
+M8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2
+MU(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q
+M;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``8
+M0":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"L
+MDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@
+M```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4
+MA4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O
+M@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`
+M)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3
+M*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&``
+M``00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%
+M0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),IK(<$\6^`
+MK\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```!!``&$`F
+MHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`2YB@K),I
+MK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"OQR``8```
+M!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C(5`2U(5`
+M2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFLAP3Q;X"O
+MQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$$``80":C
+M(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+F*"LDRFL
+MAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'(`!@```$
+M$``80":C(5`2U(5`2YB@K),IK(<$\6^`K\<@`&````00`!A`)J,A4!+4A4!+
+MF*"LDRFLAP3Q;X"OQR``8```!!``&$`FHR%0$M2%0$N8H*R3*:R'!/%O@*_'
+M(`!@```$$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z%;4P):4`FG@`X=YHB%#"PIU084Y4
+M<J@33)%J*]&*'15=HQ"PK3%#K"--<BB@FF*H%$2]4Y]`\FT7`^32RN'76OEC
+M>@/JFD\8E9G8Y\8:0TJYP'=17J(:!3R>)1/FE%'Z2XBYRI259/935.OC-50:
+M#[&,:!IG0R$A"P8>:89+I+'"&$B")A'5G8B+ZJ14JXH:'.:@IH0&T(0($A+"
+/#6J,VO\7<D4X4)!E$I5"
+`
+end
diff --git a/contrib/netbsd-tests/fs/cd9660/t_high_ino_big_file.sh b/contrib/netbsd-tests/fs/cd9660/t_high_ino_big_file.sh
new file mode 100755
index 0000000..c38f103
--- /dev/null
+++ b/contrib/netbsd-tests/fs/cd9660/t_high_ino_big_file.sh
@@ -0,0 +1,118 @@
+# $NetBSD: t_high_ino_big_file.sh,v 1.4 2014/07/07 22:06:02 pgoyette Exp $
+#
+# Copyright (c) 2014 The NetBSD Foundation, 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 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.
+#
+
+# The image used in these tests has been provided by Thomas Schmitt under
+# the following license (see PR kern/48787 for details how to recreate it):
+#
+# Copyright (c) 1999 - 2008, Thomas Schmitt (scdbackup@gmx.net)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# Neither the name of Thomas Schmitt nor the names of his contributors
+# may be used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# 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.
+#
+# ------------------------------------------------------------------------
+# This is the BSD license as stated July 22 1999 with
+# <OWNER>="Thomas Schmitt (scdbackup@gmx.net)",
+# <ORGANIZATION>="Thomas Schmitt" and <YEAR>="1999"
+# an Open Source license approved by opensource.org
+#
+
+mntpnt=""
+
+atf_test_case pr_kern_48787 cleanup
+pr_kern_48787_head() {
+ atf_set "descr" "Verifies 32bit overflow isssues from PR kern/48787 are fixed"
+ atf_set "require.user" "root"
+ atf_set "require.progs" "rump_cd9660 bunzip2 stat"
+ atf_set "timeout" 6000
+}
+
+pr_kern_48787_body() {
+ avail=$( df -Pk . | awk '{if (NR==2) print $4}' )
+ if [ $avail -lt 4500000 ]; then
+ atf_skip "not enough free disk space, have ${avail} Kbytes, need ~ 4500000 Kbytes"
+ fi
+ bunzip2 < $(atf_get_srcdir)/pr_48787.image.bz2 > pr_48787.image
+ mntpnt=$(pwd)/mnt
+ mkdir ${mntpnt}
+ rump_cd9660 -o norrip ./pr_48787.image ${mntpnt}
+ if [ ! -r ${mntpnt}/small_file ]; then
+ atf_fail "${mntpnt}/small_file does not exist"
+ fi
+ if [ ! -r ${mntpnt}/my/large_file ]; then
+ atf_fail "${mntpnt}/my/large_file does not exist"
+ fi
+ umount ${mntpnt}
+ rump_cd9660 ./pr_48787.image ${mntpnt}
+ if [ ! -r ${mntpnt}/small_file ]; then
+ atf_fail "${mntpnt}/small_file does not exist"
+ fi
+ if [ ! -r ${mntpnt}/my/large_file ]; then
+ atf_fail "${mntpnt}/my/large_file does not exist"
+ fi
+ echo "this assumes current cd9660 inode encoding - adapt on changes"
+ atf_check -o match:"^4329541966$" stat -f "%i" ${mntpnt}/small_file
+ atf_check -o match:"^4329545920$" stat -f "%i" ${mntpnt}/my/large_file
+ umount ${mntpnt}
+ touch "done"
+}
+
+pr_kern_48787_cleanup() {
+ if [ ! -f done ]; then
+ if [ "x${mntpnt}" != "x" ]; then
+ umount -f ${mntpnt} || true
+ fi
+ fi
+}
+
+atf_init_test_cases() {
+ atf_add_test_case pr_kern_48787
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_ext2fs.c b/contrib/netbsd-tests/fs/common/fstest_ext2fs.c
new file mode 100644
index 0000000..85bb79f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_ext2fs.c
@@ -0,0 +1,139 @@
+/* $NetBSD: fstest_ext2fs.c,v 1.2 2010/07/30 16:15:05 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+struct ext2fstestargs {
+ struct ufs_args ta_uargs;
+ char ta_devpath[MAXPATHLEN];
+ char ta_imgpath[MAXPATHLEN];
+};
+
+int
+ext2fs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+ off_t size, void *fspriv)
+{
+ char cmd[1024];
+ int res;
+ static unsigned int num = 0;
+ struct ext2fstestargs *args;
+
+ size /= 512;
+ snprintf(cmd, 1024, "newfs_ext2fs -F -s %"PRId64" %s >/dev/null",
+ size, image);
+ res = system(cmd);
+ if (res != 0)
+ return res;
+
+ res = rump_init();
+ if (res != 0)
+ return res;
+
+ args = calloc(1, sizeof(*args));
+ if (args == NULL)
+ return -1;
+
+ snprintf(args->ta_devpath, MAXPATHLEN, "/dev/device%d.ext2fs", num);
+ snprintf(args->ta_imgpath, MAXPATHLEN, "%s", image);
+ args->ta_uargs.fspec = args->ta_devpath;
+
+ res = rump_pub_etfs_register(args->ta_devpath, image, RUMP_ETFS_BLK);
+ if (res != 0) {
+ free(args);
+ return res;
+ }
+
+ *buf = args;
+ num++;
+
+ return res;
+}
+
+int
+ext2fs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+ int res;
+ struct ext2fstestargs *args = buf;
+
+ res = rump_pub_etfs_remove(args->ta_devpath);
+ if (res != 0)
+ return res;
+
+ res = unlink(args->ta_imgpath);
+ if (res != 0)
+ return res;
+
+ free(args);
+
+ return 0;
+}
+
+int
+ext2fs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ int res;
+ struct ext2fstestargs *args = buf;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_mount(MOUNT_EXT2FS, path, flags, &args->ta_uargs,
+ sizeof(args->ta_uargs));
+ return res;
+}
+
+int
+ext2fs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_rmdir(path);
+ return res;
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_ffs.c b/contrib/netbsd-tests/fs/common/fstest_ffs.c
new file mode 100644
index 0000000..7ae4e8f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_ffs.c
@@ -0,0 +1,156 @@
+/* $NetBSD: fstest_ffs.c,v 1.6 2012/08/05 02:03:05 riastradh Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+struct ffstestargs {
+ struct ufs_args ta_uargs;
+ char ta_devpath[MAXPATHLEN];
+ char ta_imgpath[MAXPATHLEN];
+};
+
+int
+ffs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image, off_t size,
+ void *fspriv)
+{
+ char cmd[1024];
+ int res;
+ static unsigned int num = 0;
+ struct ffstestargs *args;
+ struct sigaction act, oact;
+
+ size /= 512;
+ snprintf(cmd, 1024, "newfs -F -s %"PRId64" %s >/dev/null", size, image);
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = SIG_DFL;
+ sigaction(SIGCHLD, &act, &oact);
+ res = system(cmd);
+ sigaction(SIGCHLD, &oact, NULL);
+ if (res != 0)
+ return res;
+
+ res = rump_init();
+ if (res != 0)
+ return res;
+
+ args = calloc(1, sizeof(*args));
+ if (args == NULL)
+ return -1;
+
+ snprintf(args->ta_devpath, MAXPATHLEN, "/dev/device%d.ffs", num);
+ snprintf(args->ta_imgpath, MAXPATHLEN, "%s", image);
+ args->ta_uargs.fspec = args->ta_devpath;
+
+ res = rump_pub_etfs_register(args->ta_devpath, image, RUMP_ETFS_BLK);
+ if (res != 0) {
+ free(args);
+ return res;
+ }
+
+ *buf = args;
+ num++;
+
+ return 0;
+}
+__strong_alias(ffslog_fstest_newfs,ffs_fstest_newfs);
+
+int
+ffs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+ int res;
+ struct ffstestargs *args = buf;
+
+ res = rump_pub_etfs_remove(args->ta_devpath);
+ if (res != 0) {
+ errno = res;
+ return -1;
+ }
+
+ res = unlink(args->ta_imgpath);
+ if (res != 0)
+ return res;
+
+ free(args);
+
+ return 0;
+}
+__strong_alias(ffslog_fstest_delfs,ffs_fstest_delfs);
+
+int
+ffs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ int res;
+ struct ffstestargs *args = buf;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_mount(MOUNT_FFS, path, flags, &args->ta_uargs,
+ sizeof(args->ta_uargs));
+ return res;
+}
+
+int
+ffslog_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+
+ return ffs_fstest_mount(tc, buf, path, flags | MNT_LOG);
+}
+
+int
+ffs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_rmdir(path);
+ return res;
+}
+__strong_alias(ffslog_fstest_unmount,ffs_fstest_unmount);
diff --git a/contrib/netbsd-tests/fs/common/fstest_lfs.c b/contrib/netbsd-tests/fs/common/fstest_lfs.c
new file mode 100644
index 0000000..fd131cf
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_lfs.c
@@ -0,0 +1,192 @@
+/* $NetBSD: fstest_lfs.c,v 1.4 2010/07/30 16:15:05 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+#include "mount_lfs.h"
+
+sem_t lfs_clearnerloop;
+
+struct lfstestargs {
+ struct ufs_args ta_uargs;
+ pthread_t ta_cleanerthread;
+ sem_t ta_cleanerloop;
+ char ta_devpath[MAXPATHLEN];
+ char ta_imgpath[MAXPATHLEN];
+ char ta_mntpath[MAXPATHLEN];
+ char ta_hostpath[MAXPATHLEN];
+};
+
+int
+lfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image, off_t size,
+ void *fspriv)
+{
+ char cmd[1024];
+ int res;
+ static unsigned int num = 0;
+ struct lfstestargs *args;
+
+ size /= 512;
+ snprintf(cmd, 1024, "newfs_lfs -D -F -s %"PRId64" ./%s >/dev/null",
+ size, image);
+ res = system(cmd);
+ if (res != 0)
+ return res;
+
+ res = rump_init();
+ if (res != 0)
+ return res;
+
+ args = calloc(1, sizeof(*args));
+ if (args == NULL)
+ return -1;
+
+ strcpy(args->ta_hostpath, image);
+ snprintf(args->ta_devpath, MAXPATHLEN, "/dev/device%d.lfs", num);
+ snprintf(args->ta_imgpath, MAXPATHLEN, "%s", image);
+ args->ta_uargs.fspec = args->ta_devpath;
+ sem_init(&args->ta_cleanerloop, 0, 0);
+
+ res = rump_pub_etfs_register(args->ta_devpath, image, RUMP_ETFS_BLK);
+ if (res != 0) {
+ free(args);
+ return res;
+ }
+
+ *buf = args;
+ num++;
+
+ return 0;
+}
+
+int
+lfs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+ int res;
+ struct lfstestargs *args = buf;
+
+ res = rump_pub_etfs_remove(args->ta_devpath);
+ if (res != 0)
+ return res;
+
+ res = unlink(args->ta_imgpath);
+ if (res != 0)
+ return res;
+
+ pthread_join(args->ta_cleanerthread, NULL);
+ free(args);
+
+ return 0;
+}
+
+static void *
+cleaner(void *arg)
+{
+ char thepath[MAXPATHLEN];
+ struct lfstestargs *args = arg;
+ const char *the_argv[7];
+ char buf[64];
+
+ /* this inspired by the cleaner code. fixme */
+ sprintf(thepath, "/dev/r%s", args->ta_devpath+5);
+ rump_pub_etfs_register(thepath, args->ta_hostpath, RUMP_ETFS_CHR);
+ sprintf(buf, "%p", &args->ta_cleanerloop);
+
+ the_argv[0] = "megamaid";
+ the_argv[1] = "-D"; /* don't fork() & detach */
+ the_argv[2] = "-S";
+ the_argv[3] = buf;
+ the_argv[4] = args->ta_mntpath;
+ the_argv[5] = NULL;
+
+ /* xxxatf */
+ optind = 1;
+ opterr = 1;
+
+ lfs_cleaner_main(5, __UNCONST(the_argv));
+
+ return NULL;
+}
+
+int
+lfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ struct lfstestargs *args = buf;
+ int res;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_mount(MOUNT_LFS, path, flags, &args->ta_uargs,
+ sizeof(args->ta_uargs));
+ if (res == -1)
+ return res;
+
+ strcpy(args->ta_mntpath, path);
+ res = pthread_create(&args->ta_cleanerthread, NULL, cleaner, args);
+ if (res)
+ return res;
+
+ /* wait for cleaner to initialize */
+ sem_wait(&args->ta_cleanerloop);
+
+ return 0;
+}
+
+int
+lfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1) {
+ return res;
+ }
+
+ res = rump_sys_rmdir(path);
+ return res;
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_msdosfs.c b/contrib/netbsd-tests/fs/common/fstest_msdosfs.c
new file mode 100644
index 0000000..2c94e3f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_msdosfs.c
@@ -0,0 +1,140 @@
+/* $NetBSD: fstest_msdosfs.c,v 1.3 2012/03/26 15:10:26 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <msdosfs/msdosfsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+struct msdosfstestargs {
+ struct msdosfs_args ta_uargs;
+ char ta_devpath[MAXPATHLEN];
+ char ta_imgpath[MAXPATHLEN];
+};
+
+int
+msdosfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+ off_t size, void *fspriv)
+{
+ char cmd[1024];
+ int res;
+ static unsigned int num = 0;
+ struct msdosfstestargs *args;
+
+ size /= 512; size -= (size % 63);
+ snprintf(cmd, 1024, "newfs_msdos -C %"PRId64"s %s >/dev/null",
+ size, image);
+ res = system(cmd);
+ if (res != 0)
+ return res;
+
+ res = rump_init();
+ if (res != 0)
+ return res;
+
+ args = calloc(1, sizeof(*args));
+ if (args == NULL)
+ return -1;
+
+ snprintf(args->ta_devpath, MAXPATHLEN, "/dev/device%d.msdosfs", num);
+ snprintf(args->ta_imgpath, MAXPATHLEN, "%s", image);
+ args->ta_uargs.fspec = args->ta_devpath;
+ args->ta_uargs.mask = 0755;
+
+ res = rump_pub_etfs_register(args->ta_devpath, image, RUMP_ETFS_BLK);
+ if (res != 0) {
+ free(args);
+ return res;
+ }
+
+ *buf = args;
+ num++;
+
+ return 0;
+}
+
+int
+msdosfs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+ int res;
+ struct msdosfstestargs *args = buf;
+
+ res = rump_pub_etfs_remove(args->ta_devpath);
+ if (res != 0)
+ return res;
+
+ res = unlink(args->ta_imgpath);
+ if (res != 0)
+ return res;
+
+ free(args);
+
+ return 0;
+}
+
+int
+msdosfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ int res;
+ struct msdosfstestargs *args = buf;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_mount(MOUNT_MSDOS, path, flags, &args->ta_uargs,
+ sizeof(args->ta_uargs));
+ return res;
+}
+
+int
+msdosfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_rmdir(path);
+ return res;
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_nfs.c b/contrib/netbsd-tests/fs/common/fstest_nfs.c
new file mode 100644
index 0000000..5ef256f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_nfs.c
@@ -0,0 +1,326 @@
+/* $NetBSD: fstest_nfs.c,v 1.9 2011/02/28 21:08:46 pooka Exp $ */
+
+/*
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+#include <sys/statvfs.h>
+#include <sys/wait.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <pthread.h>
+#include <puffs.h>
+#include <puffsdump.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+#include "mount_nfs.h"
+#include "../../net/config/netconfig.c"
+
+#define SERVERADDR "10.3.2.1"
+#define SERVERROADDR "10.4.2.1"
+#define CLIENTADDR "10.3.2.2"
+#define CLIENTROADDR "10.4.2.2"
+#define NETNETMASK "255.255.255.0"
+#define EXPORTPATH "/myexport"
+
+static void
+childfail(int status)
+{
+
+ atf_tc_fail("child died");
+}
+
+/* fork rump nfsd, configure interface */
+static int
+donewfs(const atf_tc_t *tc, void **argp,
+ const char *image, off_t size, void *fspriv)
+{
+ const char *srcdir;
+ char *nfsdargv[16];
+ char nfsdpath[MAXPATHLEN];
+ char imagepath[MAXPATHLEN];
+ char ethername[MAXPATHLEN], ethername_ro[MAXPATHLEN];
+ char ifname[IFNAMSIZ], ifname_ro[IFNAMSIZ];
+ char cwd[MAXPATHLEN];
+ struct nfstestargs *args;
+ pid_t childpid;
+ int pipes[2];
+ int devnull;
+
+ /*
+ * First, we start the nfs service.
+ */
+ srcdir = atf_tc_get_config_var(tc, "srcdir");
+ sprintf(nfsdpath, "%s/../nfs/nfsservice/rumpnfsd", srcdir);
+ sprintf(ethername, "/%s/%s.etherbus", getcwd(cwd, sizeof(cwd)), image);
+ sprintf(ethername_ro, "%s_ro", ethername);
+ sprintf(imagepath, "/%s/%s", cwd, image);
+
+ nfsdargv[0] = nfsdpath;
+ nfsdargv[1] = ethername;
+ nfsdargv[2] = ethername_ro;
+ nfsdargv[3] = __UNCONST(SERVERADDR);
+ nfsdargv[4] = __UNCONST(SERVERROADDR);
+ nfsdargv[5] = __UNCONST(NETNETMASK);
+ nfsdargv[6] = __UNCONST(EXPORTPATH);
+ nfsdargv[7] = imagepath;
+ nfsdargv[8] = NULL;
+
+ signal(SIGCHLD, childfail);
+ if (pipe(pipes) == -1)
+ return errno;
+
+ switch ((childpid = fork())) {
+ case 0:
+ if (chdir(dirname(nfsdpath)) == -1)
+ err(1, "chdir");
+ close(pipes[0]);
+ if (dup2(pipes[1], 3) == -1)
+ err(1, "dup2");
+ if (execvp(nfsdargv[0], nfsdargv) == -1)
+ err(1, "execvp");
+ case -1:
+ return errno;
+ default:
+ close(pipes[1]);
+ break;
+ }
+
+ /*
+ * Ok, nfsd has been run. The following sleep helps with the
+ * theoretical problem that nfsd can't start fast enough to
+ * process our mount request and we end up doing a timeout
+ * before the mount. This would take several seconds. So
+ * try to make sure nfsd is up&running already at this stage.
+ */
+ if (read(pipes[0], &devnull, 4) == -1)
+ return errno;
+
+ /*
+ * Configure our networking interface.
+ */
+ rump_init();
+ netcfg_rump_makeshmif(ethername, ifname);
+ netcfg_rump_if(ifname, CLIENTADDR, NETNETMASK);
+ netcfg_rump_makeshmif(ethername_ro, ifname_ro);
+ netcfg_rump_if(ifname_ro, CLIENTROADDR, NETNETMASK);
+
+ /*
+ * That's it. The rest is done in mount, since we don't have
+ * the mountpath available here.
+ */
+ args = malloc(sizeof(*args));
+ if (args == NULL)
+ return errno;
+ memset(args, 0, sizeof(*args));
+ args->ta_childpid = childpid;
+ strcpy(args->ta_ethername, ethername);
+
+ *argp = args;
+
+ return 0;
+}
+
+int
+nfs_fstest_newfs(const atf_tc_t *tc, void **argp,
+ const char *image, off_t size, void *fspriv)
+{
+
+ return donewfs(tc, argp, image, size, fspriv);
+}
+
+int
+nfsro_fstest_newfs(const atf_tc_t *tc, void **argp,
+ const char *image, off_t size, void *fspriv)
+{
+
+ return donewfs(tc, argp, image, size, fspriv);
+}
+
+/* mount the file system */
+static int
+domount(const atf_tc_t *tc, void *arg, const char *serverpath,
+ const char *path, int flags)
+{
+ char canon_dev[MAXPATHLEN], canon_dir[MAXPATHLEN];
+ const char *nfscliargs[] = {
+ "nfsclient",
+ serverpath,
+ path,
+ NULL,
+ };
+ struct nfs_args args;
+ int mntflags;
+
+ if (rump_sys_mkdir(path, 0777) == -1)
+ return errno;
+
+ /* XXX: atf does not reset values */
+ optind = 1;
+ opterr = 1;
+
+ /*
+ * We use nfs parseargs here, since as a side effect it
+ * takes care of the RPC hulabaloo.
+ */
+ mount_nfs_parseargs(__arraycount(nfscliargs)-1, __UNCONST(nfscliargs),
+ &args, &mntflags, canon_dev, canon_dir);
+
+ if (rump_sys_mount(MOUNT_NFS, path, flags, &args, sizeof(args)) == -1) {
+ return errno;
+ }
+
+ return 0;
+}
+
+int
+nfs_fstest_mount(const atf_tc_t *tc, void *arg, const char *path, int flags)
+{
+
+ return domount(tc, arg, SERVERADDR ":" EXPORTPATH, path, flags);
+}
+
+/*
+ * This is where the magic happens!
+ *
+ * If we are mounting r/w, do the normal thing. However, if we are
+ * doing a r/o mount, switch use the r/o server export address
+ * and do a r/w mount. This way we end up testing the r/o export policy
+ * of the server! (yes, slightly questionable semantics, but at least
+ * we notice very quickly if our assumption is broken in the future ;)
+ */
+int
+nfsro_fstest_mount(const atf_tc_t *tc, void *arg, const char *path, int flags)
+{
+
+ if (flags & MNT_RDONLY) {
+ flags &= ~MNT_RDONLY;
+ return domount(tc, arg, SERVERROADDR":"EXPORTPATH, path, flags);
+ } else {
+ return domount(tc, arg, SERVERADDR":"EXPORTPATH, path, flags);
+ }
+}
+
+static int
+dodelfs(const atf_tc_t *tc, void *arg)
+{
+
+ /*
+ * XXX: no access to "args" since we're called from "cleanup".
+ * Trust atf to kill nfsd process and remove etherfile.
+ */
+#if 0
+ /*
+ * It's highly expected that the child will die next, so we
+ * don't need that information anymore thank you very many.
+ */
+ signal(SIGCHLD, SIG_IGN);
+
+ /*
+ * Just KILL it. Sending it SIGTERM first causes it to try
+ * to send some unmount RPCs, leading to sticky situations.
+ */
+ kill(args->ta_childpid, SIGKILL);
+ wait(&status);
+
+ /* remove ethernet bus */
+ if (unlink(args->ta_ethername) == -1)
+ atf_tc_fail_errno("unlink ethername");
+#endif
+
+ return 0;
+}
+
+int
+nfs_fstest_delfs(const atf_tc_t *tc, void *arg)
+{
+
+ return dodelfs(tc, arg);
+}
+
+int
+nfsro_fstest_delfs(const atf_tc_t *tc, void *arg)
+{
+
+ return dodelfs(tc, arg);
+}
+
+static int
+dounmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int status, i, sverrno;
+
+ /*
+ * NFS handles sillyrenames in an workqueue. Some of them might
+ * be still in the queue even if all user activity has ceased.
+ * We try to unmount for 2 seconds to give them a chance
+ * to flush out.
+ *
+ * PR kern/43799
+ */
+ for (i = 0; i < 20; i++) {
+ if ((status = rump_sys_unmount(path, flags)) == 0)
+ break;
+ sverrno = errno;
+ if (sverrno != EBUSY)
+ break;
+ usleep(100000);
+ }
+ if (status == -1)
+ return sverrno;
+
+ if (rump_sys_rmdir(path) == -1)
+ return errno;
+
+ return 0;
+}
+
+int
+nfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+
+ return dounmount(tc, path, flags);
+}
+
+int
+nfsro_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+
+ return dounmount(tc, path, flags);
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_puffs.c b/contrib/netbsd-tests/fs/common/fstest_puffs.c
new file mode 100644
index 0000000..14e4bfb
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_puffs.c
@@ -0,0 +1,452 @@
+/* $NetBSD: fstest_puffs.c,v 1.11 2013/09/09 19:47:38 pooka Exp $ */
+
+/*
+ * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+#include <sys/statvfs.h>
+#include <sys/wait.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <puffs.h>
+#include <puffsdump.h>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+#define BUFSIZE (128*1024)
+#define DTFS_DUMP "-o","dump"
+
+static bool mayquit = false;
+
+static ssize_t
+xread(int fd, void *vp, size_t n)
+{
+ size_t left;
+
+ left = n;
+ do {
+ ssize_t ssz;
+
+ ssz = read(fd, vp, left);
+ if (ssz == -1) {
+ return ssz;
+ }
+ left -= ssz;
+ vp = (char *)vp + ssz;
+ } while (left > 0);
+ return n;
+}
+
+static ssize_t
+xwrite(int fd, const void *vp, size_t n)
+{
+ size_t left;
+
+ left = n;
+ do {
+ ssize_t ssz;
+
+ ssz = write(fd, vp, left);
+ if (ssz == -1) {
+ return ssz;
+ }
+ left -= ssz;
+ vp = (const char *)vp + ssz;
+ } while (left > 0);
+ return n;
+}
+
+/*
+ * Threads which shovel data between comfd and /dev/puffs.
+ * (cannot use polling since fd's are in different namespaces)
+ */
+static void *
+readshovel(void *arg)
+{
+ struct putter_hdr *phdr;
+ struct puffs_req *preq;
+ struct puffstestargs *args = arg;
+ char buf[BUFSIZE];
+ ssize_t n;
+ int comfd, puffsfd;
+
+ comfd = args->pta_servfd;
+ puffsfd = args->pta_rumpfd;
+
+ phdr = (void *)buf;
+ preq = (void *)buf;
+
+ rump_pub_lwproc_newlwp(1);
+
+ for (;;) {
+ n = rump_sys_read(puffsfd, buf, sizeof(*phdr));
+ if (n <= 0) {
+ fprintf(stderr, "readshovel r1 %zd / %d\n", n, errno);
+ break;
+ }
+
+ assert(phdr->pth_framelen < BUFSIZE);
+ n = rump_sys_read(puffsfd, buf+sizeof(*phdr),
+ phdr->pth_framelen - sizeof(*phdr));
+ if (n <= 0) {
+ fprintf(stderr, "readshovel r2 %zd / %d\n", n, errno);
+ break;
+ }
+
+ /* Analyze request */
+ if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VFS) {
+ assert(preq->preq_optype < PUFFS_VFS_MAX);
+ args->pta_vfs_toserv_ops[preq->preq_optype]++;
+ } else if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VN) {
+ assert(preq->preq_optype < PUFFS_VN_MAX);
+ args->pta_vn_toserv_ops[preq->preq_optype]++;
+ }
+
+ n = phdr->pth_framelen;
+ if (xwrite(comfd, buf, n) != n) {
+ fprintf(stderr, "readshovel write %zd / %d\n", n, errno);
+ break;
+ }
+ }
+
+ if (n != 0 && mayquit == false)
+ abort();
+ return NULL;
+}
+
+static void *
+writeshovel(void *arg)
+{
+ struct puffstestargs *args = arg;
+ struct putter_hdr *phdr;
+ struct puffs_req *preq;
+ char buf[BUFSIZE];
+ size_t toread;
+ ssize_t n;
+ int comfd, puffsfd;
+
+ rump_pub_lwproc_newlwp(1);
+
+ comfd = args->pta_servfd;
+ puffsfd = args->pta_rumpfd;
+
+ phdr = (struct putter_hdr *)buf;
+ preq = (void *)buf;
+
+ for (;;) {
+ uint64_t off;
+
+ /*
+ * Need to write everything to the "kernel" in one chunk,
+ * so make sure we have it here.
+ */
+ off = 0;
+ toread = sizeof(struct putter_hdr);
+ assert(toread < BUFSIZE);
+ do {
+ n = xread(comfd, buf+off, toread);
+ if (n <= 0) {
+ fprintf(stderr, "writeshovel read %zd / %d\n",
+ n, errno);
+ goto out;
+ }
+ off += n;
+ if (off >= sizeof(struct putter_hdr))
+ toread = phdr->pth_framelen - off;
+ else
+ toread = off - sizeof(struct putter_hdr);
+ } while (toread);
+
+ if (__predict_false(
+ PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VFS
+ && preq->preq_optype == PUFFS_VFS_UNMOUNT)) {
+ if (preq->preq_rv == 0)
+ mayquit = true;
+ }
+
+ n = rump_sys_write(puffsfd, buf, phdr->pth_framelen);
+ if ((size_t)n != phdr->pth_framelen) {
+ fprintf(stderr, "writeshovel wr %zd / %d\n", n, errno);
+ break;
+ }
+ }
+
+ out:
+ if (n != 0)
+ abort();
+ return NULL;
+}
+
+static void
+rumpshovels(struct puffstestargs *args)
+{
+ pthread_t pt;
+ int rv;
+
+ if ((rv = rump_init()) == -1)
+ err(1, "rump_init");
+
+ if (pthread_create(&pt, NULL, readshovel, args) == -1)
+ err(1, "read shovel");
+ pthread_detach(pt);
+
+ if (pthread_create(&pt, NULL, writeshovel, args) == -1)
+ err(1, "write shovel");
+ pthread_detach(pt);
+}
+
+static void
+childfail(int sign)
+{
+
+ atf_tc_fail("child died"); /* almost signal-safe */
+}
+
+struct puffstestargs *theargs; /* XXX */
+
+/* XXX: we don't support size */
+static int
+donewfs(const atf_tc_t *tc, void **argp,
+ const char *image, off_t size, void *fspriv, char **theargv)
+{
+ struct puffstestargs *args;
+ pid_t childpid;
+ int *pflags;
+ char comfd[16];
+ int sv[2];
+ int mntflags;
+ size_t len;
+ ssize_t n;
+
+ *argp = NULL;
+
+ args = malloc(sizeof(*args));
+ if (args == NULL)
+ return errno;
+ memset(args, 0, sizeof(*args));
+
+ pflags = &args->pta_pflags;
+
+ /* Create sucketpair for communication with the real file server */
+ if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sv) == -1)
+ return errno;
+
+ signal(SIGCHLD, childfail);
+
+ switch ((childpid = fork())) {
+ case 0:
+ close(sv[1]);
+ snprintf(comfd, sizeof(sv[0]), "%d", sv[0]);
+ if (setenv("PUFFS_COMFD", comfd, 1) == -1)
+ return errno;
+
+ if (execvp(theargv[0], theargv) == -1)
+ return errno;
+ case -1:
+ return errno;
+ default:
+ close(sv[0]);
+ break;
+ }
+
+ /* read args */
+ if ((n = xread(sv[1], &len, sizeof(len))) != sizeof(len))
+ err(1, "mp 1 %zd", n);
+ if (len > MAXPATHLEN)
+ err(1, "mntpath > MAXPATHLEN");
+ if ((size_t)xread(sv[1], args->pta_dir, len) != len)
+ err(1, "mp 2");
+ if (xread(sv[1], &len, sizeof(len)) != sizeof(len))
+ err(1, "fn 1");
+ if (len > MAXPATHLEN)
+ err(1, "devpath > MAXPATHLEN");
+ if ((size_t)xread(sv[1], args->pta_dev, len) != len)
+ err(1, "fn 2");
+ if (xread(sv[1], &mntflags, sizeof(mntflags)) != sizeof(mntflags))
+ err(1, "mntflags");
+ if (xread(sv[1], &args->pta_pargslen, sizeof(args->pta_pargslen))
+ != sizeof(args->pta_pargslen))
+ err(1, "puffstest_args len");
+ args->pta_pargs = malloc(args->pta_pargslen);
+ if (args->pta_pargs == NULL)
+ err(1, "malloc");
+ if (xread(sv[1], args->pta_pargs, args->pta_pargslen)
+ != (ssize_t)args->pta_pargslen)
+ err(1, "puffstest_args");
+ if (xread(sv[1], pflags, sizeof(*pflags)) != sizeof(*pflags))
+ err(1, "pflags");
+
+ args->pta_childpid = childpid;
+ args->pta_servfd = sv[1];
+ strlcpy(args->pta_dev, image, sizeof(args->pta_dev));
+
+ *argp = theargs = args;
+
+ return 0;
+}
+
+int
+puffs_fstest_newfs(const atf_tc_t *tc, void **argp,
+ const char *image, off_t size, void *fspriv)
+{
+ char dtfs_path[MAXPATHLEN];
+ char *dtfsargv[6];
+ char **theargv;
+
+ /* build dtfs exec path from atf test dir */
+ sprintf(dtfs_path, "%s/../puffs/h_dtfs/h_dtfs",
+ atf_tc_get_config_var(tc, "srcdir"));
+
+ if (fspriv) {
+ theargv = fspriv;
+ theargv[0] = dtfs_path;
+ } else {
+ dtfsargv[0] = dtfs_path;
+ dtfsargv[1] = __UNCONST("-i");
+ dtfsargv[2] = __UNCONST("-s");
+ dtfsargv[3] = __UNCONST("dtfs");
+ dtfsargv[4] = __UNCONST("fictional");
+ dtfsargv[5] = NULL;
+
+ theargv = dtfsargv;
+ }
+
+ return donewfs(tc, argp, image, size, fspriv, theargv);
+}
+
+int
+p2k_ffs_fstest_newfs(const atf_tc_t *tc, void **argp,
+ const char *image, off_t size, void *fspriv)
+{
+ char *rumpffs_argv[5];
+ int rv;
+
+ rump_init();
+ if ((rv = ffs_fstest_newfs(tc, argp, image, size, fspriv)) != 0)
+ return rv;
+ if (mkdir("p2kffsfake", 0777) == -1 && errno != EEXIST)
+ return errno;
+
+ setenv("P2K_NODETACH", "1", 1);
+ rumpffs_argv[0] = __UNCONST("rump_ffs");
+ rumpffs_argv[1] = __UNCONST(image);
+ rumpffs_argv[2] = __UNCONST("p2kffsfake"); /* NOTUSED */
+ rumpffs_argv[3] = NULL;
+
+ if ((rv = donewfs(tc, argp, image, size, fspriv, rumpffs_argv)) != 0)
+ ffs_fstest_delfs(tc, argp);
+ return rv;
+}
+
+int
+puffs_fstest_mount(const atf_tc_t *tc, void *arg, const char *path, int flags)
+{
+ struct puffstestargs *pargs = arg;
+ int fd;
+
+ rump_init();
+ fd = rump_sys_open("/dev/puffs", O_RDWR);
+ if (fd == -1)
+ return fd;
+
+ if (rump_sys_mkdir(path, 0777) == -1)
+ return -1;
+
+ if (rump_sys_mount(MOUNT_PUFFS, path, flags,
+ pargs->pta_pargs, pargs->pta_pargslen) == -1) {
+ /* apply "to kill a child" to avoid atf hang (kludge) */
+ kill(pargs->pta_childpid, SIGKILL);
+ return -1;
+ }
+
+ pargs->pta_rumpfd = fd;
+ rumpshovels(pargs);
+
+ return 0;
+}
+__strong_alias(p2k_ffs_fstest_mount,puffs_fstest_mount);
+
+int
+puffs_fstest_delfs(const atf_tc_t *tc, void *arg)
+{
+
+ /* useless ... */
+ return 0;
+}
+
+int
+p2k_ffs_fstest_delfs(const atf_tc_t *tc, void *arg)
+{
+
+ return ffs_fstest_delfs(tc, arg);
+}
+
+int
+puffs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ struct puffstestargs *pargs = theargs;
+ int status;
+ int rv;
+
+ /* ok, child might exit here */
+ signal(SIGCHLD, SIG_IGN);
+
+ rv = rump_sys_unmount(path, flags);
+ if (rv)
+ return rv;
+
+ if ((rv = rump_sys_rmdir(path)) != 0)
+ return rv;
+
+ if (waitpid(pargs->pta_childpid, &status, WNOHANG) > 0)
+ return 0;
+ kill(pargs->pta_childpid, SIGTERM);
+ usleep(10);
+ if (waitpid(pargs->pta_childpid, &status, WNOHANG) > 0)
+ return 0;
+ kill(pargs->pta_childpid, SIGKILL);
+ usleep(500);
+ wait(&status);
+
+ rmdir("p2kffsfake");
+
+ return 0;
+}
+__strong_alias(p2k_ffs_fstest_unmount,puffs_fstest_unmount);
diff --git a/contrib/netbsd-tests/fs/common/fstest_rumpfs.c b/contrib/netbsd-tests/fs/common/fstest_rumpfs.c
new file mode 100644
index 0000000..e4003db
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_rumpfs.c
@@ -0,0 +1,90 @@
+/* $NetBSD: fstest_rumpfs.c,v 1.2 2014/03/16 10:28:03 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+int
+rumpfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+ off_t size, void *fspriv)
+{
+ char tmp[64];
+ int res;
+
+ snprintf(tmp, sizeof(tmp), "%"PRId64, size);
+ res = setenv("RUMP_MEMLIMIT", tmp, 0);
+ if (res == -1)
+ return res;
+
+ return rump_init();
+}
+
+int
+rumpfs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+
+ return 0;
+}
+
+int
+rumpfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ return rump_sys_mount(MOUNT_RUMPFS, path, flags, NULL, 0);
+}
+
+int
+rumpfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1)
+ return res;
+
+ return rump_sys_rmdir(path);
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_sysvbfs.c b/contrib/netbsd-tests/fs/common/fstest_sysvbfs.c
new file mode 100644
index 0000000..a7cf7f4
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_sysvbfs.c
@@ -0,0 +1,139 @@
+/* $NetBSD: fstest_sysvbfs.c,v 1.2 2010/07/30 16:15:05 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+struct sysvbfstestargs {
+ struct ufs_args ta_uargs;
+ char ta_devpath[MAXPATHLEN];
+ char ta_imgpath[MAXPATHLEN];
+};
+
+int
+sysvbfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+ off_t size, void *fspriv)
+{
+ char cmd[1024];
+ int res;
+ static unsigned int num = 0;
+ struct sysvbfstestargs *args;
+
+ size /= 512;
+ snprintf(cmd, 1024, "newfs_sysvbfs -F -s %"PRId64" %s >/dev/null",
+ size, image);
+ res = system(cmd);
+ if (res != 0)
+ return res;
+
+ res = rump_init();
+ if (res != 0)
+ return res;
+
+ args = calloc(1, sizeof(*args));
+ if (args == NULL)
+ return -1;
+
+ snprintf(args->ta_devpath, MAXPATHLEN, "/dev/device%d.sysvbfs", num);
+ snprintf(args->ta_imgpath, MAXPATHLEN, "%s", image);
+ args->ta_uargs.fspec = args->ta_devpath;
+
+ res = rump_pub_etfs_register(args->ta_devpath, image, RUMP_ETFS_BLK);
+ if (res != 0) {
+ free(args);
+ return res;
+ }
+
+ *buf = args;
+ num++;
+
+ return 0;
+}
+
+int
+sysvbfs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+ int res;
+ struct sysvbfstestargs *args = buf;
+
+ res = rump_pub_etfs_remove(args->ta_devpath);
+ if (res != 0)
+ return res;
+
+ res = unlink(args->ta_imgpath);
+ if (res != 0)
+ return res;
+
+ free(args);
+
+ return 0;
+}
+
+int
+sysvbfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ int res;
+ struct sysvbfstestargs *args = buf;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_mount(MOUNT_SYSVBFS, path, flags, &args->ta_uargs,
+ sizeof(args->ta_uargs));
+ return res;
+}
+
+int
+sysvbfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_rmdir(path);
+ return res;
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_tmpfs.c b/contrib/netbsd-tests/fs/common/fstest_tmpfs.c
new file mode 100644
index 0000000..8384843
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_tmpfs.c
@@ -0,0 +1,112 @@
+/* $NetBSD: fstest_tmpfs.c,v 1.2 2010/07/30 16:15:05 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <fs/tmpfs/tmpfs_args.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+struct tmpfstestargs {
+ struct tmpfs_args ta_uargs;
+};
+
+int
+tmpfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+ off_t size, void *fspriv)
+{
+ int res;
+ struct tmpfstestargs *args;
+
+ res = rump_init();
+ if (res != 0)
+ return res;
+
+ args = calloc(1, sizeof(*args));
+ if (args == NULL)
+ return -1;
+
+ args->ta_uargs.ta_version = TMPFS_ARGS_VERSION;
+ args->ta_uargs.ta_root_mode = 0777;
+ args->ta_uargs.ta_size_max = size;
+
+ *buf = args;
+
+ return 0;
+}
+
+int
+tmpfs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+ struct tmpfstestargs *args = buf;
+
+ free(args);
+
+ return 0;
+}
+
+int
+tmpfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ int res;
+ struct tmpfstestargs *args = buf;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_mount(MOUNT_TMPFS, path, flags, &args->ta_uargs,
+ sizeof(args->ta_uargs));
+ return res;
+}
+
+int
+tmpfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_rmdir(path);
+ return res;
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_udf.c b/contrib/netbsd-tests/fs/common/fstest_udf.c
new file mode 100644
index 0000000..3c9e017
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_udf.c
@@ -0,0 +1,153 @@
+/* $NetBSD: fstest_udf.c,v 1.4 2013/07/02 15:00:55 reinoud Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <fs/udf/udf_mount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+struct udftestargs {
+ struct udf_args ta_uargs;
+ char ta_devpath[MAXPATHLEN];
+ char ta_imgpath[MAXPATHLEN];
+};
+
+int
+udf_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image, off_t size,
+ void *fspriv)
+{
+ char cmd[1024];
+ int res;
+ static unsigned int num = 0;
+ struct udftestargs *args;
+ struct sigaction act, oact;
+
+ /*
+ * Sectorsize can be specified with -S, as a multiple of 512.
+ * newfs_udf takes humanized number as size in bytes as -s parameter!
+ */
+ snprintf(cmd, 1024, "newfs_udf -F -s %"PRId64" %s >/dev/null", size, image);
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = SIG_DFL;
+ sigaction(SIGCHLD, &act, &oact);
+ res = system(cmd);
+ sigaction(SIGCHLD, &oact, NULL);
+ if (res != 0)
+ return res;
+
+ res = rump_init();
+ if (res != 0)
+ return res;
+
+ args = calloc(1, sizeof(*args));
+ if (args == NULL)
+ return -1;
+
+ snprintf(args->ta_devpath, MAXPATHLEN, "/dev/device%d.udf", num);
+ snprintf(args->ta_imgpath, MAXPATHLEN, "%s", image);
+ args->ta_uargs.fspec = args->ta_devpath;
+ args->ta_uargs.version = UDFMNT_VERSION;
+
+ res = rump_pub_etfs_register(args->ta_devpath, image, RUMP_ETFS_BLK);
+ if (res != 0) {
+ free(args);
+ return res;
+ }
+
+ *buf = args;
+ num++;
+
+ return 0;
+}
+__strong_alias(udflog_fstest_newfs,udf_fstest_newfs);
+
+int
+udf_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+ int res;
+ struct udftestargs *args = buf;
+
+ res = rump_pub_etfs_remove(args->ta_devpath);
+ if (res != 0) {
+ errno = res;
+ return -1;
+ }
+
+ res = unlink(args->ta_imgpath);
+ if (res != 0)
+ return res;
+
+ free(args);
+
+ return 0;
+}
+__strong_alias(udflog_fstest_delfs,udf_fstest_delfs);
+
+int
+udf_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ int res;
+ struct udftestargs *args = buf;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_mount(MOUNT_UDF, path, flags, &args->ta_uargs,
+ sizeof(args->ta_uargs));
+ return res;
+}
+
+int
+udf_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_rmdir(path);
+ return res;
+}
+__strong_alias(udflog_fstest_unmount,udf_fstest_unmount);
diff --git a/contrib/netbsd-tests/fs/common/fstest_v7fs.c b/contrib/netbsd-tests/fs/common/fstest_v7fs.c
new file mode 100644
index 0000000..92110e4
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_v7fs.c
@@ -0,0 +1,140 @@
+/* $NetBSD: fstest_v7fs.c,v 1.1 2011/08/11 10:52:12 uch Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <fs/v7fs/v7fs_args.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+struct v7fstestargs {
+ struct v7fs_args ta_uargs;
+ char ta_devpath[MAXPATHLEN];
+ char ta_imgpath[MAXPATHLEN];
+};
+
+int
+v7fs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+ off_t size, void *fspriv)
+{
+ char cmd[1024];
+ int res;
+ static unsigned int num = 0;
+ struct v7fstestargs *args;
+
+ size /= 512;
+ snprintf(cmd, 1024, "newfs_v7fs -F -s %"PRId64" %s >/dev/null",
+ size, image);
+ res = system(cmd);
+ if (res != 0)
+ return res;
+
+ res = rump_init();
+ if (res != 0)
+ return res;
+
+ args = calloc(1, sizeof(*args));
+ if (args == NULL)
+ return -1;
+
+ snprintf(args->ta_devpath, MAXPATHLEN, "/dev/device%d.v7fs", num);
+ snprintf(args->ta_imgpath, MAXPATHLEN, "%s", image);
+ args->ta_uargs.fspec = args->ta_devpath;
+ args->ta_uargs.endian = _BYTE_ORDER;
+
+ res = rump_pub_etfs_register(args->ta_devpath, image, RUMP_ETFS_BLK);
+ if (res != 0) {
+ free(args);
+ return res;
+ }
+
+ *buf = args;
+ num++;
+
+ return 0;
+}
+
+int
+v7fs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+ int res;
+ struct v7fstestargs *args = buf;
+
+ res = rump_pub_etfs_remove(args->ta_devpath);
+ if (res != 0)
+ return res;
+
+ res = unlink(args->ta_imgpath);
+ if (res != 0)
+ return res;
+
+ free(args);
+
+ return 0;
+}
+
+int
+v7fs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ int res;
+ struct v7fstestargs *args = buf;
+
+ res = rump_sys_mkdir(path, 0777);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_mount(MOUNT_V7FS, path, flags, &args->ta_uargs,
+ sizeof(args->ta_uargs));
+ return res;
+}
+
+int
+v7fs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+ int res;
+
+ res = rump_sys_unmount(path, flags);
+ if (res == -1)
+ return res;
+
+ res = rump_sys_rmdir(path);
+ return res;
+}
diff --git a/contrib/netbsd-tests/fs/common/fstest_zfs.c b/contrib/netbsd-tests/fs/common/fstest_zfs.c
new file mode 100644
index 0000000..88aa05f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/fstest_zfs.c
@@ -0,0 +1,134 @@
+/* $NetBSD: fstest_zfs.c,v 1.1 2012/08/20 16:37:35 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "h_fsmacros.h"
+
+#define SRVPATH "zfssurvo"
+#define SRVURL "unix://" SRVPATH
+#define ZFSDEV "/zfsdev"
+
+int
+zfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+ off_t size, void *fspriv)
+{
+ int res;
+ int fd;
+
+ /* XXX: hardcoded zfs minimum size */
+ size = MAX(64*1024*1024, size);
+
+ res = rump_init();
+ if (res != 0) {
+ errno = res;
+ return -1;
+ }
+
+ /* create backing image, sparse file is enough */
+ if ((fd = open(image, O_RDWR | O_CREAT, 0777)) == -1)
+ return -1;
+ if (ftruncate(fd, size) == -1) {
+ close(fd);
+ return -1;
+ }
+ close(fd);
+
+ res = rump_pub_etfs_register(ZFSDEV, image, RUMP_ETFS_BLK);
+ if (res != 0) {
+ errno = res;
+ return -1;
+ }
+
+ res = rump_init_server(SRVURL);
+ if (res != 0) {
+ errno = res;
+ return -1;
+ }
+ *buf = NULL;
+
+ return 0;
+}
+
+int
+zfs_fstest_delfs(const atf_tc_t *tc, void *buf)
+{
+
+ unlink(SRVPATH);
+ return 0;
+}
+
+int
+zfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+ char tmpbuf[128];
+ int error;
+
+ /* set up the hijack env for running zpool */
+ setenv("RUMP_SERVER", SRVURL, 1);
+ snprintf(tmpbuf, sizeof(tmpbuf)-1, "blanket=/dev/zfs:%s:%s",
+ ZFSDEV, path);
+ setenv("RUMPHIJACK", tmpbuf, 1);
+ setenv("LD_PRELOAD", "/usr/lib/librumphijack.so", 1);
+
+ while (*path == '/')
+ path++;
+
+ /* run zpool create */
+ snprintf(tmpbuf, sizeof(tmpbuf)-1, "zpool create %s %s",
+ path, ZFSDEV);
+ if ((error = system(tmpbuf)) != 0) {
+ errno = error;
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+zfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
+{
+
+ unmount(path, flags);
+ unlink(SRVPATH);
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/common/h_fsmacros.h b/contrib/netbsd-tests/fs/common/h_fsmacros.h
new file mode 100644
index 0000000..b47a708
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/h_fsmacros.h
@@ -0,0 +1,337 @@
+/* $NetBSD: h_fsmacros.h,v 1.38 2013/06/26 19:29:24 reinoud Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __H_FSMACROS_H_
+#define __H_FSMACROS_H_
+
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <puffsdump.h>
+#include <string.h>
+
+#include <rump/rump.h>
+
+#include "../../h_macros.h"
+
+#define FSPROTOS(_fs_) \
+int _fs_##_fstest_newfs(const atf_tc_t *, void **, const char *, \
+ off_t, void *); \
+int _fs_##_fstest_delfs(const atf_tc_t *, void *); \
+int _fs_##_fstest_mount(const atf_tc_t *, void *, const char *, int); \
+int _fs_##_fstest_unmount(const atf_tc_t *, const char *, int);
+
+FSPROTOS(ext2fs);
+FSPROTOS(ffs);
+FSPROTOS(ffslog);
+FSPROTOS(lfs);
+FSPROTOS(msdosfs);
+FSPROTOS(nfs);
+FSPROTOS(nfsro);
+FSPROTOS(p2k_ffs);
+FSPROTOS(puffs);
+FSPROTOS(rumpfs);
+FSPROTOS(sysvbfs);
+FSPROTOS(tmpfs);
+FSPROTOS(udf);
+FSPROTOS(v7fs);
+FSPROTOS(zfs);
+
+#ifndef FSTEST_IMGNAME
+#define FSTEST_IMGNAME "image.fs"
+#endif
+#ifndef FSTEST_IMGSIZE
+#define FSTEST_IMGSIZE (10000 * 512)
+#endif
+#ifndef FSTEST_MNTNAME
+#define FSTEST_MNTNAME "/mnt"
+#endif
+
+#define FSTEST_CONSTRUCTOR(_tc_, _fs_, _args_) \
+do { \
+ if (_fs_##_fstest_newfs(_tc_, &_args_, \
+ FSTEST_IMGNAME, FSTEST_IMGSIZE, NULL) != 0) \
+ atf_tc_fail_errno("newfs failed"); \
+ if (_fs_##_fstest_mount(_tc_, _args_, FSTEST_MNTNAME, 0) != 0) \
+ atf_tc_fail_errno("mount failed"); \
+} while (/*CONSTCOND*/0);
+
+#define FSTEST_CONSTRUCTOR_FSPRIV(_tc_, _fs_, _args_, _privargs_) \
+do { \
+ if (_fs_##_fstest_newfs(_tc_, &_args_, \
+ FSTEST_IMGNAME, FSTEST_IMGSIZE, _privargs_) != 0) \
+ atf_tc_fail_errno("newfs failed"); \
+ if (_fs_##_fstest_mount(_tc_, _args_, FSTEST_MNTNAME, 0) != 0) \
+ atf_tc_fail_errno("mount failed"); \
+} while (/*CONSTCOND*/0);
+
+#define FSTEST_DESTRUCTOR(_tc_, _fs_, _args_) \
+do { \
+ if (_fs_##_fstest_unmount(_tc_, FSTEST_MNTNAME, 0) != 0) { \
+ rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1); \
+ atf_tc_fail_errno("unmount failed"); \
+ } \
+ if (_fs_##_fstest_delfs(_tc_, _args_) != 0) \
+ atf_tc_fail_errno("delfs failed"); \
+} while (/*CONSTCOND*/0);
+
+#define ATF_TC_FSADD(fs,type,func,desc) \
+ ATF_TC(fs##_##func); \
+ ATF_TC_HEAD(fs##_##func,tc) \
+ { \
+ atf_tc_set_md_var(tc, "descr", type " test for " desc); \
+ atf_tc_set_md_var(tc, "X-fs.type", #fs); \
+ atf_tc_set_md_var(tc, "X-fs.mntname", type); \
+ if (strcmp(#fs, "zfs") == 0) { \
+ /* This should not be necessary. */ \
+ atf_tc_set_md_var(tc, "require.user", "root"); \
+ } \
+ } \
+ void *fs##func##tmp; \
+ \
+ ATF_TC_BODY(fs##_##func,tc) \
+ { \
+ if (!atf_check_fstype(tc, #fs)) \
+ atf_tc_skip("filesystem not selected"); \
+ FSTEST_CONSTRUCTOR(tc,fs,fs##func##tmp); \
+ func(tc,FSTEST_MNTNAME); \
+ if (fs##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) { \
+ rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1); \
+ atf_tc_fail_errno("unmount failed"); \
+ } \
+ }
+
+#define ATF_TC_FSADD_RO(_fs_,_type_,_func_,_desc_,_gen_) \
+ ATF_TC(_fs_##_##_func_); \
+ ATF_TC_HEAD(_fs_##_##_func_,tc) \
+ { \
+ atf_tc_set_md_var(tc, "descr",_type_" test for "_desc_);\
+ atf_tc_set_md_var(tc, "X-fs.type", #_fs_); \
+ atf_tc_set_md_var(tc, "X-fs.mntname", _type_); \
+ if (strcmp(#_fs_, "zfs") == 0) { \
+ /* This should not be necessary. */ \
+ atf_tc_set_md_var(tc, "require.user", "root"); \
+ } \
+ } \
+ void *_fs_##_func_##tmp; \
+ \
+ ATF_TC_BODY(_fs_##_##_func_,tc) \
+ { \
+ if (!atf_check_fstype(tc, #_fs_)) \
+ atf_tc_skip("filesystem not selected"); \
+ FSTEST_CONSTRUCTOR(tc,_fs_,_fs_##_func_##tmp); \
+ _gen_(tc,FSTEST_MNTNAME); \
+ if (_fs_##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) \
+ atf_tc_fail_errno("unmount r/w failed"); \
+ if (_fs_##_fstest_mount(tc, _fs_##_func_##tmp, \
+ FSTEST_MNTNAME, MNT_RDONLY) != 0) \
+ atf_tc_fail_errno("mount ro failed"); \
+ _func_(tc,FSTEST_MNTNAME); \
+ if (_fs_##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) {\
+ rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1); \
+ atf_tc_fail_errno("unmount failed"); \
+ } \
+ }
+
+#define ATF_TP_FSADD(fs,func) \
+ ATF_TP_ADD_TC(tp,fs##_##func)
+
+#define ATF_TC_FSAPPLY_NOZFS(func,desc) \
+ ATF_TC_FSADD(ext2fs,MOUNT_EXT2FS,func,desc) \
+ ATF_TC_FSADD(ffs,MOUNT_FFS,func,desc) \
+ ATF_TC_FSADD(ffslog,MOUNT_FFS,func,desc) \
+ ATF_TC_FSADD(lfs,MOUNT_LFS,func,desc) \
+ ATF_TC_FSADD(msdosfs,MOUNT_MSDOS,func,desc) \
+ ATF_TC_FSADD(nfs,MOUNT_NFS,func,desc) \
+ ATF_TC_FSADD(puffs,MOUNT_PUFFS,func,desc) \
+ ATF_TC_FSADD(p2k_ffs,MOUNT_PUFFS,func,desc) \
+ ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc) \
+ ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc) \
+ ATF_TC_FSADD(tmpfs,MOUNT_TMPFS,func,desc) \
+ ATF_TC_FSADD(udf,MOUNT_UDF,func,desc) \
+ ATF_TC_FSADD(v7fs,MOUNT_V7FS,func,desc)
+
+#define ATF_TP_FSAPPLY_NOZFS(func) \
+ ATF_TP_FSADD(ext2fs,func); \
+ ATF_TP_FSADD(ffs,func); \
+ ATF_TP_FSADD(ffslog,func); \
+ ATF_TP_FSADD(lfs,func); \
+ ATF_TP_FSADD(msdosfs,func); \
+ ATF_TP_FSADD(nfs,func); \
+ ATF_TP_FSADD(puffs,func); \
+ ATF_TP_FSADD(p2k_ffs,func); \
+ ATF_TP_FSADD(rumpfs,func); \
+ ATF_TP_FSADD(sysvbfs,func); \
+ ATF_TP_FSADD(tmpfs,func); \
+ ATF_TP_FSADD(udf,func); \
+ ATF_TP_FSADD(v7fs,func);
+
+/* XXX: this will not scale */
+#ifdef WANT_ZFS_TESTS
+#define ATF_TC_FSAPPLY(func,desc) \
+ ATF_TC_FSAPPLY_NOZFS(func,desc) \
+ ATF_TC_FSADD(zfs,MOUNT_ZFS,func,desc)
+#define ATF_TP_FSAPPLY(func) \
+ ATF_TP_FSAPPLY_NOZFS(func) \
+ ATF_TP_FSADD(zfs,func);
+
+#else /* !WANT_ZFS_TESTS */
+
+#define ATF_TC_FSAPPLY(func,desc) \
+ ATF_TC_FSAPPLY_NOZFS(func,desc)
+#define ATF_TP_FSAPPLY(func) \
+ ATF_TP_FSAPPLY_NOZFS(func)
+
+#endif /* WANT_ZFS_TESTS */
+
+/*
+ * Same as above, but generate a file system image first and perform
+ * tests for a r/o mount.
+ *
+ * Missing the following file systems:
+ * + lfs (fstest_lfs routines cannot handle remount. FIXME!)
+ * + tmpfs (memory backend)
+ * + rumpfs (memory backend)
+ * + puffs (memory backend, but could be run in theory)
+ */
+
+#define ATF_TC_FSAPPLY_RO(func,desc,gen) \
+ ATF_TC_FSADD_RO(ext2fs,MOUNT_EXT2FS,func,desc,gen) \
+ ATF_TC_FSADD_RO(ffs,MOUNT_FFS,func,desc,gen) \
+ ATF_TC_FSADD_RO(ffslog,MOUNT_FFS,func,desc,gen) \
+ ATF_TC_FSADD_RO(msdosfs,MOUNT_MSDOS,func,desc,gen) \
+ ATF_TC_FSADD_RO(nfs,MOUNT_NFS,func,desc,gen) \
+ ATF_TC_FSADD_RO(nfsro,MOUNT_NFS,func,desc,gen) \
+ ATF_TC_FSADD_RO(sysvbfs,MOUNT_SYSVBFS,func,desc,gen) \
+ ATF_TC_FSADD_RO(udf,MOUNT_UDF,func,desc,gen) \
+ ATF_TC_FSADD_RO(v7fs,MOUNT_V7FS,func,desc,gen)
+
+#define ATF_TP_FSAPPLY_RO(func) \
+ ATF_TP_FSADD(ext2fs,func); \
+ ATF_TP_FSADD(ffs,func); \
+ ATF_TP_FSADD(ffslog,func); \
+ ATF_TP_FSADD(msdosfs,func); \
+ ATF_TP_FSADD(nfs,func); \
+ ATF_TP_FSADD(nfsro,func); \
+ ATF_TP_FSADD(sysvbfs,func); \
+ ATF_TP_FSADD(udf,func); \
+ ATF_TP_FSADD(v7fs,func);
+
+#define ATF_FSAPPLY(func,desc) \
+ ATF_TC_FSAPPLY(func,desc); \
+ ATF_TP_ADD_TCS(tp) \
+ { \
+ ATF_TP_FSAPPLY(func); \
+ return atf_no_error(); \
+ }
+
+static __inline bool
+atf_check_fstype(const atf_tc_t *tc, const char *fs)
+{
+ const char *fstype;
+
+ if (!atf_tc_has_config_var(tc, "fstype"))
+ return true;
+
+ fstype = atf_tc_get_config_var(tc, "fstype");
+ if (strcmp(fstype, fs) == 0)
+ return true;
+ return false;
+}
+
+#define FSTYPE_EXT2FS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "ext2fs") == 0)
+#define FSTYPE_FFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "ffs") == 0)
+#define FSTYPE_FFSLOG(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "ffslog") == 0)
+#define FSTYPE_LFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "lfs") == 0)
+#define FSTYPE_MSDOS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "msdosfs") == 0)
+#define FSTYPE_NFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "nfs") == 0)
+#define FSTYPE_NFSRO(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "nfsro") == 0)
+#define FSTYPE_P2K_FFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "p2k_ffs") == 0)
+#define FSTYPE_PUFFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "puffs") == 0)
+#define FSTYPE_RUMPFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "rumpfs") == 0)
+#define FSTYPE_SYSVBFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "sysvbfs") == 0)
+#define FSTYPE_TMPFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "tmpfs") == 0)
+#define FSTYPE_UDF(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "udf") == 0)
+#define FSTYPE_V7FS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "v7fs") == 0)
+#define FSTYPE_ZFS(tc)\
+ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), "zfs") == 0)
+
+#define FSTEST_ENTER() \
+ if (rump_sys_chdir(FSTEST_MNTNAME) == -1) \
+ atf_tc_fail_errno("failed to cd into test mount")
+
+#define FSTEST_EXIT() \
+ if (rump_sys_chdir("/") == -1) \
+ atf_tc_fail_errno("failed to cd out of test mount")
+
+/*
+ * file system args structures
+ */
+
+struct nfstestargs {
+ pid_t ta_childpid;
+ char ta_ethername[MAXPATHLEN];
+};
+
+struct puffstestargs {
+ uint8_t *pta_pargs;
+ size_t pta_pargslen;
+
+ int pta_pflags;
+ pid_t pta_childpid;
+
+ int pta_rumpfd;
+ int pta_servfd;
+
+ char pta_dev[MAXPATHLEN];
+ char pta_dir[MAXPATHLEN];
+
+ int pta_mntflags;
+
+ int pta_vfs_toserv_ops[PUFFS_VFS_MAX];
+ int pta_vn_toserv_ops[PUFFS_VN_MAX];
+};
+
+#endif /* __H_FSMACROS_H_ */
diff --git a/contrib/netbsd-tests/fs/common/snapshot.c b/contrib/netbsd-tests/fs/common/snapshot.c
new file mode 100644
index 0000000..7baf611
--- /dev/null
+++ b/contrib/netbsd-tests/fs/common/snapshot.c
@@ -0,0 +1,228 @@
+/* $NetBSD: snapshot.c,v 1.7 2013/02/06 09:05:01 hannken Exp $ */
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+
+#include <dev/fssvar.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+ATF_TC_WITH_CLEANUP(snapshot);
+ATF_TC_HEAD(snapshot, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "basic snapshot features");
+}
+
+static void
+makefile(const char *path)
+{
+ int fd;
+
+ fd = rump_sys_open(path, O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create %s", path);
+ rump_sys_close(fd);
+}
+
+ATF_TC_BODY(snapshot, tc)
+{
+ char buf[1024];
+ struct fss_set fss;
+ int fssfd;
+ int fd, fd2, i;
+
+ if (system(NEWFS) == -1)
+ atf_tc_fail_errno("cannot create file system");
+
+ rump_init();
+ begin();
+
+ if (rump_sys_mkdir("/mnt", 0777) == -1)
+ atf_tc_fail_errno("mount point create");
+ if (rump_sys_mkdir("/snap", 0777) == -1)
+ atf_tc_fail_errno("mount point 2 create");
+
+ rump_pub_etfs_register("/diskdev", IMGNAME, RUMP_ETFS_BLK);
+
+ mount_diskfs("/diskdev", "/mnt");
+
+#define TESTSTR1 "huihai\n"
+#define TESTSZ1 (sizeof(TESTSTR1)-1)
+#define TESTSTR2 "baana liten\n"
+#define TESTSZ2 (sizeof(TESTSTR2)-1)
+
+ fd = rump_sys_open("/mnt/myfile", O_RDWR | O_CREAT, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create file");
+ if (rump_sys_write(fd, TESTSTR1, TESTSZ1) != TESTSZ1)
+ atf_tc_fail_errno("write fail");
+
+ fssfd = rump_sys_open("/dev/rfss0", O_RDWR);
+ if (fssfd == -1)
+ atf_tc_fail_errno("cannot open fss");
+ makefile(BAKNAME);
+ memset(&fss, 0, sizeof(fss));
+ fss.fss_mount = __UNCONST("/mnt");
+ fss.fss_bstore = __UNCONST(BAKNAME);
+ fss.fss_csize = 0;
+ if (rump_sys_ioctl(fssfd, FSSIOCSET, &fss) == -1)
+ atf_tc_fail_errno("create snapshot");
+
+ for (i = 0; i < 10000; i++) {
+ if (rump_sys_write(fd, TESTSTR2, TESTSZ2) != TESTSZ2)
+ atf_tc_fail_errno("write fail");
+ }
+ rump_sys_sync();
+
+ /* technically we should fsck it first? */
+ mount_diskfs("/dev/fss0", "/snap");
+
+ /* check for old contents */
+ fd2 = rump_sys_open("/snap/myfile", O_RDONLY);
+ if (fd2 == -1)
+ atf_tc_fail_errno("fail");
+ memset(buf, 0, sizeof(buf));
+ if (rump_sys_read(fd2, buf, sizeof(buf)) == -1)
+ atf_tc_fail_errno("read snap");
+ ATF_CHECK(strcmp(buf, TESTSTR1) == 0);
+
+ /* check that new files are invisible in the snapshot */
+ makefile("/mnt/newfile");
+ if (rump_sys_open("/snap/newfile", O_RDONLY) != -1)
+ atf_tc_fail("newfile exists in snapshot");
+ if (errno != ENOENT)
+ atf_tc_fail_errno("newfile open should fail with ENOENT");
+
+ /* check that removed files are still visible in the snapshot */
+ rump_sys_unlink("/mnt/myfile");
+ if (rump_sys_open("/snap/myfile", O_RDONLY) == -1)
+ atf_tc_fail_errno("unlinked file no longer in snapshot");
+
+ /* done for now */
+}
+
+ATF_TC_CLEANUP(snapshot, tc)
+{
+
+ unlink(IMGNAME);
+}
+
+ATF_TC_WITH_CLEANUP(snapshotstress);
+ATF_TC_HEAD(snapshotstress, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "snapshot on active file system");
+}
+
+#define NACTIVITY 4
+
+static bool activity_stop = false;
+static pid_t wrkpid;
+
+static void *
+fs_activity(void *arg)
+{
+ int di, fi;
+ char *prefix = arg, path[128];
+
+ rump_pub_lwproc_newlwp(wrkpid);
+
+ RL(rump_sys_mkdir(prefix, 0777));
+ while (! activity_stop) {
+ for (di = 0; di < 5; di++) {
+ snprintf(path, sizeof(path), "%s/d%d", prefix, di);
+ RL(rump_sys_mkdir(path, 0777));
+ for (fi = 0; fi < 5; fi++) {
+ snprintf(path, sizeof(path), "%s/d%d/f%d",
+ prefix, di, fi);
+ makefile(path);
+ }
+ }
+ for (di = 0; di < 5; di++) {
+ for (fi = 0; fi < 5; fi++) {
+ snprintf(path, sizeof(path), "%s/d%d/f%d",
+ prefix, di, fi);
+ RL(rump_sys_unlink(path));
+ }
+ snprintf(path, sizeof(path), "%s/d%d", prefix, di);
+ RL(rump_sys_rmdir(path));
+ }
+ }
+ RL(rump_sys_rmdir(prefix));
+
+ rump_pub_lwproc_releaselwp();
+
+ return NULL;
+}
+
+ATF_TC_BODY(snapshotstress, tc)
+{
+ pthread_t at[NACTIVITY];
+ struct fss_set fss;
+ char prefix[NACTIVITY][128];
+ int i, fssfd;
+
+ if (system(NEWFS) == -1)
+ atf_tc_fail_errno("cannot create file system");
+ /* Force SMP so the stress makes sense. */
+ RL(setenv("RUMP_NCPU", "4", 1));
+ RZ(rump_init());
+ /* Prepare for fsck to use the RUMP /dev/fss0. */
+ RL(rump_init_server("unix://commsock"));
+ RL(setenv("LD_PRELOAD", "/usr/lib/librumphijack.so", 1));
+ RL(setenv("RUMP_SERVER", "unix://commsock", 1));
+ RL(setenv("RUMPHIJACK", "blanket=/dev/rfss0", 1));
+ begin();
+
+ RL(rump_sys_mkdir("/mnt", 0777));
+
+ rump_pub_etfs_register("/diskdev", IMGNAME, RUMP_ETFS_BLK);
+
+ mount_diskfs("/diskdev", "/mnt");
+
+ /* Start file system activity. */
+ RL(wrkpid = rump_sys_getpid());
+ for (i = 0; i < NACTIVITY; i++) {
+ snprintf(prefix[i], sizeof(prefix[i]), "/mnt/a%d", i);
+ RL(pthread_create(&at[i], NULL, fs_activity, prefix[i]));
+ sleep(1);
+ }
+
+ fssfd = rump_sys_open("/dev/rfss0", O_RDWR);
+ if (fssfd == -1)
+ atf_tc_fail_errno("cannot open fss");
+ makefile(BAKNAME);
+ memset(&fss, 0, sizeof(fss));
+ fss.fss_mount = __UNCONST("/mnt");
+ fss.fss_bstore = __UNCONST(BAKNAME);
+ fss.fss_csize = 0;
+ if (rump_sys_ioctl(fssfd, FSSIOCSET, &fss) == -1)
+ atf_tc_fail_errno("create snapshot");
+
+ activity_stop = true;
+ for (i = 0; i < NACTIVITY; i++)
+ RL(pthread_join(at[i], NULL));
+
+ RL(system(FSCK " /dev/rfss0"));
+}
+
+ATF_TC_CLEANUP(snapshotstress, tc)
+{
+
+ unlink(IMGNAME);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, snapshot);
+ ATF_TP_ADD_TC(tp, snapshotstress);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/ffs/ffs_common.sh b/contrib/netbsd-tests/fs/ffs/ffs_common.sh
new file mode 100755
index 0000000..eaf7142
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/ffs_common.sh
@@ -0,0 +1,99 @@
+# $NetBSD: ffs_common.sh,v 1.2 2013/07/29 13:15:24 skrll Exp $
+
+create_ffs()
+{
+ local endian=$1; shift
+ local vers=$1; shift
+ local type=$1; shift
+ local op;
+ if [ ${type} = "both" ]; then
+ op="-q user -q group"
+ else
+ op="-q ${type}"
+ fi
+ atf_check -o ignore -e ignore newfs ${op} \
+ -B ${endian} -O ${vers} -s 4000 -F ${IMG}
+}
+
+create_ffs_server()
+{
+ local sarg=$1; shift
+ create_ffs $*
+ atf_check -o ignore -e ignore $(atf_get_srcdir)/h_ffs_server \
+ ${sarg} ${IMG} ${RUMP_SERVER}
+}
+
+rump_shutdown()
+{
+ for s in ${RUMP_SOCKETS_LIST}; do
+ atf_check -s exit:0 env RUMP_SERVER=unix://${s} rump.halt;
+ done
+# check that the quota inode creation didn't corrupt the filesystem
+ atf_check -s exit:0 -o "match:already clean" \
+ -o "match:Phase 6 - Check Quotas" \
+ fsck_ffs -nf -F ${IMG}
+}
+
+# from tests/ipf/h_common.sh via tests/sbin/resize_ffs
+test_case()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+ local descr="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+
+ eval "${name}_head() { \
+ atf_set "descr" "${descr}"
+ atf_set "timeout" "60"
+ }"
+ eval "${name}_body() { \
+ RUMP_SOCKETS_LIST=\${RUMP_SOCKET}; \
+ export RUMP_SERVER=unix://\${RUMP_SOCKET}; \
+ ${check_function} " "${@}" "; \
+ }"
+ eval "${name}_cleanup() { \
+ for s in \${RUMP_SOCKETS_LIST}; do \
+ export RUMP_SERVER=unix://\${s}; \
+ atf_check -s exit:1 -o ignore -e ignore rump.halt; \
+ done; \
+ }"
+ tests="${tests} ${name}"
+}
+
+test_case_root()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+ local descr="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+
+ eval "${name}_head() { \
+ atf_set "descr" "${descr}"
+ atf_set "require.user" "root"
+ atf_set "timeout" "360"
+ }"
+ eval "${name}_body() { \
+ RUMP_SOCKETS_LIST=\${RUMP_SOCKET}; \
+ export RUMP_SERVER=unix://\${RUMP_SOCKET}; \
+ ${check_function} " "${@}" "; \
+ }"
+ eval "${name}_cleanup() { \
+ for s in \${RUMP_SOCKETS_LIST}; do \
+ export RUMP_SERVER=unix://\${s}; \
+ atf_check -s exit:1 -o ignore -e ignore rump.halt; \
+ done; \
+ }"
+ tests="${tests} ${name}"
+}
+
+atf_init_test_cases()
+{
+ IMG=fsimage
+ DIR=target
+ RUMP_SOCKET=test;
+ for i in ${tests}; do
+ atf_add_test_case $i
+ done
+}
diff --git a/contrib/netbsd-tests/fs/ffs/h_ffs_server.c b/contrib/netbsd-tests/fs/ffs/h_ffs_server.c
new file mode 100644
index 0000000..dd22d9f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/h_ffs_server.c
@@ -0,0 +1,113 @@
+/* $NetBSD: h_ffs_server.c,v 1.2 2012/08/24 20:25:50 jmmv Exp $ */
+
+/*
+ * rump server for advanced quota tests
+ */
+
+#include "../common/h_fsmacros.h"
+
+#include <err.h>
+#include <semaphore.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+int background = 0;
+
+static void
+usage(void)
+{
+ fprintf(stderr, "usage: %s [-b] [-l] diskimage bindurl\n",
+ getprogname());
+ exit(1);
+}
+
+static void
+die(const char *reason, int error)
+{
+
+ warnx("%s: %s", reason, strerror(error));
+ if (background)
+ rump_daemonize_done(error);
+ exit(1);
+}
+
+static sem_t sigsem;
+static void
+sigreboot(int sig)
+{
+
+ sem_post(&sigsem);
+}
+
+int
+main(int argc, char **argv)
+{
+ int error;
+ struct ufs_args uargs;
+ const char *filename;
+ const char *serverurl;
+ int log = 0;
+ int ch;
+
+ while ((ch = getopt(argc, argv, "bl")) != -1) {
+ switch(ch) {
+ case 'b':
+ background = 1;
+ break;
+ case 'l':
+ log = 1;
+ break;
+ default:
+ usage();
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 2)
+ usage();
+
+ filename = argv[0];
+ serverurl = argv[1];
+
+ if (background) {
+ error = rump_daemonize_begin();
+ if (error)
+ errx(1, "rump daemonize: %s", strerror(error));
+ }
+
+ error = rump_init();
+ if (error)
+ die("rump init failed", error);
+
+ if (rump_sys_mkdir(FSTEST_MNTNAME, 0777) == -1)
+ die("mount point create", errno);
+ rump_pub_etfs_register("/diskdev", filename, RUMP_ETFS_BLK);
+ uargs.fspec = __UNCONST("/diskdev");
+ if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME, (log) ? MNT_LOG : 0,
+ &uargs, sizeof(uargs)) == -1)
+ die("mount ffs", errno);
+
+ error = rump_init_server(serverurl);
+ if (error)
+ die("rump server init failed", error);
+ if (background)
+ rump_daemonize_done(RUMP_DAEMONIZE_SUCCESS);
+
+ sem_init(&sigsem, 0, 0);
+ signal(SIGTERM, sigreboot);
+ signal(SIGINT, sigreboot);
+ sem_wait(&sigsem);
+
+ rump_sys_reboot(0, NULL);
+ /*NOTREACHED*/
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/ffs/h_quota2_tests.c b/contrib/netbsd-tests/fs/ffs/h_quota2_tests.c
new file mode 100644
index 0000000..59f3ea3
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/h_quota2_tests.c
@@ -0,0 +1,468 @@
+/* $NetBSD: h_quota2_tests.c,v 1.4 2012/09/30 21:26:57 bouyer Exp $ */
+
+/*
+ * rump server for advanced quota tests
+ * this one includes functions to run against the filesystem before
+ * starting to handle rump requests from clients.
+ */
+
+#include "../common/h_fsmacros.h"
+
+#include <err.h>
+#include <semaphore.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <ufs/ufs/ufsmount.h>
+#include <dev/fssvar.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+
+int background = 0;
+
+#define TEST_NONROOT_ID 1
+
+static int
+quota_test0(const char *testopts)
+{
+ static char buf[512];
+ int fd;
+ int error;
+ unsigned int i;
+ int chowner = 1;
+ for (i =0; testopts && i < strlen(testopts); i++) {
+ switch(testopts[i]) {
+ case 'C':
+ chowner = 0;
+ break;
+ default:
+ errx(1, "test4: unknown option %c", testopts[i]);
+ }
+ }
+ if (chowner)
+ rump_sys_chown(".", TEST_NONROOT_ID, TEST_NONROOT_ID);
+ rump_sys_chmod(".", 0777);
+ if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
+ error = errno;
+ warn("rump_sys_setegid");
+ return error;
+ }
+ if (rump_sys_seteuid(TEST_NONROOT_ID) != 0) {
+ error = errno;
+ warn("rump_sys_seteuid");
+ return error;
+ }
+ fd = rump_sys_open("test_fillup", O_CREAT | O_RDWR, 0644);
+ if (fd < 0) {
+ error = errno;
+ warn("rump_sys_open");
+ } else {
+ while (rump_sys_write(fd, buf, sizeof(buf)) == sizeof(buf))
+ error = 0;
+ error = errno;
+ }
+ rump_sys_close(fd);
+ rump_sys_seteuid(0);
+ rump_sys_setegid(0);
+ return error;
+}
+
+static int
+quota_test1(const char *testopts)
+{
+ static char buf[512];
+ int fd;
+ int error;
+ rump_sys_chown(".", TEST_NONROOT_ID, TEST_NONROOT_ID);
+ rump_sys_chmod(".", 0777);
+ if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
+ error = errno;
+ warn("rump_sys_setegid");
+ return error;
+ }
+ if (rump_sys_seteuid(TEST_NONROOT_ID) != 0) {
+ error = errno;
+ warn("rump_sys_seteuid");
+ return error;
+ }
+ fd = rump_sys_open("test_fillup", O_CREAT | O_RDWR, 0644);
+ if (fd < 0) {
+ error = errno;
+ warn("rump_sys_open");
+ } else {
+ /*
+ * write up to the soft limit, wait a bit, an try to
+ * keep on writing
+ */
+ int i;
+
+ /* write 2k: with the directory this makes 2.5K */
+ for (i = 0; i < 4; i++) {
+ error = rump_sys_write(fd, buf, sizeof(buf));
+ if (error != sizeof(buf))
+ err(1, "write failed early");
+ }
+ sleep(2);
+ /* now try to write an extra .5k */
+ if (rump_sys_write(fd, buf, sizeof(buf)) != sizeof(buf))
+ error = errno;
+ else
+ error = 0;
+ }
+ rump_sys_close(fd);
+ rump_sys_seteuid(0);
+ rump_sys_setegid(0);
+ return error;
+}
+
+static int
+quota_test2(const char *testopts)
+{
+ static char buf[512];
+ int fd;
+ int error;
+ int i;
+ rump_sys_chown(".", TEST_NONROOT_ID, TEST_NONROOT_ID);
+ rump_sys_chmod(".", 0777);
+ if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
+ error = errno;
+ warn("rump_sys_setegid");
+ return error;
+ }
+ if (rump_sys_seteuid(TEST_NONROOT_ID) != 0) {
+ error = errno;
+ warn("rump_sys_seteuid");
+ return error;
+ }
+
+ for (i = 0; ; i++) {
+ sprintf(buf, "file%d", i);
+ fd = rump_sys_open(buf, O_CREAT | O_RDWR, 0644);
+ if (fd < 0)
+ break;
+ sprintf(buf, "test file no %d", i);
+ rump_sys_write(fd, buf, strlen(buf));
+ rump_sys_close(fd);
+ }
+ error = errno;
+
+ rump_sys_close(fd);
+ rump_sys_seteuid(0);
+ rump_sys_setegid(0);
+ return error;
+}
+
+static int
+quota_test3(const char *testopts)
+{
+ static char buf[512];
+ int fd;
+ int error;
+ int i;
+ rump_sys_chown(".", TEST_NONROOT_ID, TEST_NONROOT_ID);
+ rump_sys_chmod(".", 0777);
+ if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
+ error = errno;
+ warn("rump_sys_setegid");
+ return error;
+ }
+ if (rump_sys_seteuid(TEST_NONROOT_ID) != 0) {
+ error = errno;
+ warn("rump_sys_seteuid");
+ return error;
+ }
+
+ /*
+ * create files one past the soft limit: one less as we already own the
+ * root directory
+ */
+ for (i = 0; i < 4; i++) {
+ sprintf(buf, "file%d", i);
+ fd = rump_sys_open(buf, O_EXCL| O_CREAT | O_RDWR, 0644);
+ if (fd < 0)
+ err(1, "file create failed early");
+ sprintf(buf, "test file no %d", i);
+ rump_sys_write(fd, buf, strlen(buf));
+ rump_sys_close(fd);
+ }
+ /* now create an extra file after grace time: this should fail */
+ sleep(2);
+ sprintf(buf, "file%d", i);
+ fd = rump_sys_open(buf, O_EXCL| O_CREAT | O_RDWR, 0644);
+ if (fd < 0)
+ error = errno;
+ else
+ error = 0;
+
+ rump_sys_close(fd);
+ rump_sys_seteuid(0);
+ rump_sys_setegid(0);
+ return error;
+}
+
+static int
+quota_test4(const char *testopts)
+{
+ static char buf[512];
+ int fd, fssfd;
+ struct fss_set fss;
+ unsigned int i;
+ int unl=0;
+ int unconf=0;
+
+ /*
+ * take an internal snapshot of the filesystem, and create a new
+ * file with some data
+ */
+ rump_sys_chown(".", 0, 0);
+ rump_sys_chmod(".", 0777);
+
+ for (i =0; testopts && i < strlen(testopts); i++) {
+ switch(testopts[i]) {
+ case 'L':
+ unl++;
+ break;
+ case 'C':
+ unconf++;
+ break;
+ default:
+ errx(1, "test4: unknown option %c", testopts[i]);
+ }
+ }
+
+ /* first create the snapshot */
+
+ fd = rump_sys_open(FSTEST_MNTNAME "/le_snap", O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ err(1, "create " FSTEST_MNTNAME "/le_snap");
+ rump_sys_close(fd);
+ fssfd = rump_sys_open("/dev/rfss0", O_RDWR);
+ if (fssfd == -1)
+ err(1, "cannot open fss");
+ memset(&fss, 0, sizeof(fss));
+ fss.fss_mount = __UNCONST("/mnt");
+ fss.fss_bstore = __UNCONST(FSTEST_MNTNAME "/le_snap");
+ fss.fss_csize = 0;
+ if (rump_sys_ioctl(fssfd, FSSIOCSET, &fss) == -1)
+ err(1, "create snapshot");
+ if (unl) {
+ if (rump_sys_unlink(FSTEST_MNTNAME "/le_snap") == -1)
+ err(1, "unlink snapshot");
+ }
+
+ /* now create some extra files */
+
+ for (i = 0; i < 4; i++) {
+ sprintf(buf, "file%d", i);
+ fd = rump_sys_open(buf, O_EXCL| O_CREAT | O_RDWR, 0644);
+ if (fd < 0)
+ err(1, "create %s", buf);
+ sprintf(buf, "test file no %d", i);
+ rump_sys_write(fd, buf, strlen(buf));
+ rump_sys_close(fd);
+ }
+ if (unconf)
+ if (rump_sys_ioctl(fssfd, FSSIOCCLR, NULL) == -1)
+ err(1, "unconfigure snapshot");
+ return 0;
+}
+
+static int
+quota_test5(const char *testopts)
+{
+ static char buf[512];
+ int fd;
+ int remount = 0;
+ int unlnk = 0;
+ int log = 0;
+ unsigned int i;
+
+ for (i =0; testopts && i < strlen(testopts); i++) {
+ switch(testopts[i]) {
+ case 'L':
+ log++;
+ break;
+ case 'R':
+ remount++;
+ break;
+ case 'U':
+ unlnk++;
+ break;
+ default:
+ errx(1, "test4: unknown option %c", testopts[i]);
+ }
+ }
+ if (remount) {
+ struct ufs_args uargs;
+ uargs.fspec = __UNCONST("/diskdev");
+ /* remount the fs read/write */
+ if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME,
+ MNT_UPDATE | (log ? MNT_LOG : 0),
+ &uargs, sizeof(uargs)) == -1)
+ err(1, "mount ffs rw %s", FSTEST_MNTNAME);
+ }
+
+ if (unlnk) {
+ /*
+ * open and unlink a file
+ */
+
+ fd = rump_sys_open("unlinked_file",
+ O_EXCL| O_CREAT | O_RDWR, 0644);
+ if (fd < 0)
+ err(1, "create %s", "unlinked_file");
+ sprintf(buf, "test unlinked_file");
+ rump_sys_write(fd, buf, strlen(buf));
+ if (rump_sys_unlink("unlinked_file") == -1)
+ err(1, "unlink unlinked_file");
+ if (rump_sys_fsync(fd) == -1)
+ err(1, "fsync unlinked_file");
+ rump_sys_reboot(RUMP_RB_NOSYNC, NULL);
+ errx(1, "reboot failed");
+ return 1;
+ }
+ return 0;
+}
+
+struct quota_test {
+ int (*func)(const char *);
+ const char *desc;
+};
+
+struct quota_test quota_tests[] = {
+ { quota_test0, "write up to hard limit"},
+ { quota_test1, "write beyond the soft limit after grace time"},
+ { quota_test2, "create file up to hard limit"},
+ { quota_test3, "create file beyond the soft limit after grace time"},
+ { quota_test4, "take a snapshot and add some data"},
+ { quota_test5, "open and unlink a file"},
+};
+
+static void
+usage(void)
+{
+ unsigned int test;
+ fprintf(stderr, "usage: %s [-b] [-l] test# diskimage bindurl\n",
+ getprogname());
+ fprintf(stderr, "available tests:\n");
+ for (test = 0; test < sizeof(quota_tests) / sizeof(quota_tests[0]);
+ test++)
+ fprintf(stderr, "\t%d: %s\n", test, quota_tests[test].desc);
+ exit(1);
+}
+
+static void
+die(const char *reason, int error)
+{
+
+ warnx("%s: %s", reason, strerror(error));
+ if (background)
+ rump_daemonize_done(error);
+ exit(1);
+}
+
+static sem_t sigsem;
+static void
+sigreboot(int sig)
+{
+
+ sem_post(&sigsem);
+}
+
+int
+main(int argc, char **argv)
+{
+ int error;
+ u_long test;
+ char *end;
+ struct ufs_args uargs;
+ const char *filename;
+ const char *serverurl;
+ const char *topts = NULL;
+ int mntopts = 0;
+ int ch;
+
+ while ((ch = getopt(argc, argv, "blo:r")) != -1) {
+ switch(ch) {
+ case 'b':
+ background = 1;
+ break;
+ case 'l':
+ mntopts |= MNT_LOG;
+ break;
+ case 'r':
+ mntopts |= MNT_RDONLY;
+ break;
+ case 'o':
+ topts = optarg;
+ break;
+ default:
+ usage();
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 3)
+ usage();
+
+ filename = argv[1];
+ serverurl = argv[2];
+
+ test = strtoul(argv[0], &end, 10);
+ if (*end != '\0') {
+ usage();
+ }
+ if (test > sizeof(quota_tests) / sizeof(quota_tests[0])) {
+ usage();
+ }
+
+ if (background) {
+ error = rump_daemonize_begin();
+ if (error)
+ errx(1, "rump daemonize: %s", strerror(error));
+ }
+
+ error = rump_init();
+ if (error)
+ die("rump init failed", error);
+
+ if (rump_sys_mkdir(FSTEST_MNTNAME, 0777) == -1)
+ err(1, "mount point create");
+ rump_pub_etfs_register("/diskdev", filename, RUMP_ETFS_BLK);
+ uargs.fspec = __UNCONST("/diskdev");
+ if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME, mntopts,
+ &uargs, sizeof(uargs)) == -1)
+ die("mount ffs", errno);
+
+ if (rump_sys_chdir(FSTEST_MNTNAME) == -1)
+ err(1, "cd %s", FSTEST_MNTNAME);
+ error = quota_tests[test].func(topts);
+ if (error) {
+ fprintf(stderr, " test %lu: %s returned %d: %s\n",
+ test, quota_tests[test].desc, error, strerror(error));
+ }
+ if (rump_sys_chdir("/") == -1)
+ err(1, "cd /");
+
+ error = rump_init_server(serverurl);
+ if (error)
+ die("rump server init failed", error);
+ if (background)
+ rump_daemonize_done(RUMP_DAEMONIZE_SUCCESS);
+
+ sem_init(&sigsem, 0, 0);
+ signal(SIGTERM, sigreboot);
+ signal(SIGINT, sigreboot);
+ sem_wait(&sigsem);
+
+ rump_sys_reboot(0, NULL);
+ /*NOTREACHED*/
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/ffs/quotas_common.sh b/contrib/netbsd-tests/fs/ffs/quotas_common.sh
new file mode 100755
index 0000000..0ad002f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/quotas_common.sh
@@ -0,0 +1,12 @@
+# $NetBSD: quotas_common.sh,v 1.4 2012/01/18 20:51:23 bouyer Exp $
+
+rump_quota_shutdown()
+{
+ for s in ${RUMP_SOCKETS_LIST}; do
+ atf_check -s exit:0 env RUMP_SERVER=unix://${s} rump.halt;
+ done
+# check that the quota inode creation didn't corrupt the filesystem
+ atf_check -s exit:0 -o "match:already clean" \
+ -o "match:Phase 6 - Check Quotas" \
+ fsck_ffs -nf -F ${IMG}
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_clearquota.sh b/contrib/netbsd-tests/fs/ffs/t_clearquota.sh
new file mode 100755
index 0000000..f62a494
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_clearquota.sh
@@ -0,0 +1,91 @@
+# $NetBSD: t_clearquota.sh,v 1.4 2012/01/18 20:51:23 bouyer Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+for e in le be; do
+ for v in 1 2; do
+ for q in "user" "group"; do
+ test_case_root clear_${e}_${v}_${q} clear_quota \
+ "clear quota with ${q} enabled" -b ${e} ${v} ${q}
+ done
+ test_case_root clear_${e}_${v}_"both" clear_quota \
+ "clear quota with both enabled" -b ${e} ${v} "both"
+ test_case_root clear_${e}_${v}_"both_log" clear_quota \
+ "clear quota for new id with both enabled, WAPBL" -bl ${e} ${v} "both"
+ done
+done
+
+clear_quota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local fail
+ local id=1
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+#set and check the expected quota
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
+ -t 2W/3D ${id}
+ atf_check -s exit:0 \
+-o "match:/mnt 0 10 40960 2weeks 0 20 51200 3days" \
+-o "match:Disk quotas for .*: $" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
+ done
+#now clear the quotas
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -c ${id}
+ done;
+
+#check that we do not get positive reply for any quota type
+ for q in u g ; do
+ atf_check -s exit:0 -o "not-match:/mnt" \
+ -o "not-match:Disk quotas for .*: $" \
+ -o "match:Disk quotas for .*: none$" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
+ done
+ rump_quota_shutdown
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_fifos.c b/contrib/netbsd-tests/fs/ffs/t_fifos.c
new file mode 100644
index 0000000..fe1d425
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_fifos.c
@@ -0,0 +1,158 @@
+/* $NetBSD: t_fifos.c,v 1.5 2010/11/07 17:51:17 jmmv Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include "../../h_macros.h"
+
+ATF_TC_WITH_CLEANUP(fifos);
+ATF_TC_HEAD(fifos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test fifo support in ffs");
+ atf_tc_set_md_var(tc, "timeout", "5");
+}
+
+#define teststr1 "raving & drooling"
+#define teststr2 "haha, charade"
+
+static void *
+w1(void *arg)
+{
+ int fd;
+
+ fd = rump_sys_open("sheep", O_WRONLY);
+ if (fd == -1)
+ atf_tc_fail_errno("w1 open");
+ if (rump_sys_write(fd, teststr1, sizeof(teststr1)) != sizeof(teststr1))
+ atf_tc_fail_errno("w1 write");
+ rump_sys_close(fd);
+
+ return NULL;
+}
+
+static void *
+w2(void *arg)
+{
+ int fd;
+
+ fd = rump_sys_open("pigs", O_WRONLY);
+ if (fd == -1)
+ atf_tc_fail_errno("w2 open");
+ if (rump_sys_write(fd, teststr2, sizeof(teststr2)) != sizeof(teststr2))
+ atf_tc_fail_errno("w2 write");
+ rump_sys_close(fd);
+
+ return NULL;
+}
+
+static void *
+r1(void *arg)
+{
+ char buf[32];
+ int fd;
+
+ fd = rump_sys_open("sheep", O_RDONLY);
+ if (fd == -1)
+ atf_tc_fail_errno("r1 open");
+ if (rump_sys_read(fd, buf, sizeof(buf)) != sizeof(teststr1))
+ atf_tc_fail_errno("r1 read");
+ rump_sys_close(fd);
+
+ if (strcmp(teststr1, buf) != 0)
+ atf_tc_fail("got invalid str, %s vs. %s", buf, teststr1);
+
+ return NULL;
+}
+
+static void *
+r2(void *arg)
+{
+ char buf[32];
+ int fd;
+
+ fd = rump_sys_open("pigs", O_RDONLY);
+ if (fd == -1)
+ atf_tc_fail_errno("r2 open");
+ if (rump_sys_read(fd, buf, sizeof(buf)) != sizeof(teststr2))
+ atf_tc_fail_errno("r2 read");
+ rump_sys_close(fd);
+
+ if (strcmp(teststr2, buf) != 0)
+ atf_tc_fail("got invalid str, %s vs. %s", buf, teststr2);
+
+ return NULL;
+}
+
+#define IMGNAME "atf.img"
+
+const char *newfs = "newfs -F -s 10000 " IMGNAME;
+#define FAKEBLK "/dev/sp00ka"
+
+ATF_TC_BODY(fifos, tc)
+{
+ struct ufs_args args;
+ pthread_t ptw1, ptw2, ptr1, ptr2;
+
+ if (system(newfs) == -1)
+ atf_tc_fail_errno("newfs failed");
+
+ memset(&args, 0, sizeof(args));
+ args.fspec = __UNCONST(FAKEBLK);
+
+ rump_init();
+ if (rump_sys_mkdir("/animals", 0777) == -1)
+ atf_tc_fail_errno("cannot create mountpoint");
+ rump_pub_etfs_register(FAKEBLK, IMGNAME, RUMP_ETFS_BLK);
+ if (rump_sys_mount(MOUNT_FFS, "/animals", 0, &args, sizeof(args))==-1)
+ atf_tc_fail_errno("rump_sys_mount failed");
+
+ /* create fifos */
+ if (rump_sys_chdir("/animals") == 1)
+ atf_tc_fail_errno("chdir");
+ if (rump_sys_mkfifo("pigs", S_IFIFO | 0777) == -1)
+ atf_tc_fail_errno("mknod1");
+ if (rump_sys_mkfifo("sheep", S_IFIFO | 0777) == -1)
+ atf_tc_fail_errno("mknod2");
+
+ pthread_create(&ptw1, NULL, w1, NULL);
+ pthread_create(&ptw2, NULL, w2, NULL);
+ pthread_create(&ptr1, NULL, r1, NULL);
+ pthread_create(&ptr2, NULL, r2, NULL);
+
+ pthread_join(ptw1, NULL);
+ pthread_join(ptw2, NULL);
+ pthread_join(ptr1, NULL);
+ pthread_join(ptr2, NULL);
+
+ if (rump_sys_chdir("/") == 1)
+ atf_tc_fail_errno("chdir");
+
+ if (rump_sys_unmount("/animals", 0) == -1)
+ atf_tc_fail_errno("unmount failed");
+}
+
+ATF_TC_CLEANUP(fifos, tc)
+{
+
+ unlink(IMGNAME);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, fifos);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_getquota.sh b/contrib/netbsd-tests/fs/ffs/t_getquota.sh
new file mode 100755
index 0000000..80f3cc7
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_getquota.sh
@@ -0,0 +1,112 @@
+# $NetBSD: t_getquota.sh,v 1.4 2012/01/18 20:51:23 bouyer Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+for e in le be; do
+ for v in 1 2; do
+ for q in "user" "group"; do
+ test_case get_${e}_${v}_${q} get_quota \
+ "get quota with ${q} enabled" -b ${e} ${v} ${q}
+ done
+ test_case get_${e}_${v}_"both" get_quota \
+ "get quota with both enabled" -b ${e} ${v} "both"
+ done
+done
+
+get_quota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local fail
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+#check that we can get the expected quota
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+-o "match:/mnt 0 - - 7days 1 - - 7days" \
+-o "match:Disk quotas for .*: $" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
+ atf_check -s exit:0 \
+-o "match:-- 0 - - 1 - -" \
+-o "not-match:\+\+" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
+ done
+
+#check that we do not get positive reply for non-expected quota
+ for q in ${fail} ; do
+ atf_check -s exit:0 -o "not-match:/mnt" \
+ -o "not-match:Disk quotas for .*: $" \
+ -o "match:Disk quotas for .*: none$" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
+ atf_check -s exit:0 \
+-o "not-match:-- 0 - - 1 - -" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
+ done
+ rump_quota_shutdown
+}
+
+quota_walk_list()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_miscquota.sh b/contrib/netbsd-tests/fs/ffs/t_miscquota.sh
new file mode 100755
index 0000000..904ea37
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_miscquota.sh
@@ -0,0 +1,213 @@
+# $NetBSD: t_miscquota.sh,v 1.8 2013/01/22 06:24:11 dholland Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+test_case_root walk_list_user quota_walk_list \
+ "walk user quota list over several disk blocks" -b le 1 user
+
+test_case_root psnapshot_user quota_snap \
+ "create a persistent shapshot of quota-enabled fs, and do some writes" \
+ -b le 1 user
+
+test_case_root npsnapshot_user quota_snap \
+ "create a non-persistent shapshot of quota-enabled fs, and do some writes" \
+ -boL le 1 user
+
+test_case_root psnapshot_unconf_user quota_snap \
+ "create a persistent shapshot of quota-enabled fs, and do some writes and unconf" \
+ -boC le 1 user
+
+test_case_root npsnapshot_unconf_user quota_snap \
+ "create a non-persistent shapshot of quota-enabled fs, and do some writes and unconf" \
+ -boLC le 1 user
+
+test_case log_unlink quota_log \
+ "an unlinked file cleaned by the log replay should update quota" \
+ -l le 1 user
+
+test_case log_unlink_remount quota_log \
+ "an unlinked file cleaned by the log replay after remount" \
+ -oRL le 1 user
+
+
+test_case_root default_deny_user quota_default_deny \
+ "new quota entry denied by default entry" 5 -b le 1 user
+
+test_case_root default_deny_user_big quota_default_deny \
+ "new quota entry denied by default entry, with list on more than one block" 5000 -b le 1 user
+
+
+quota_walk_list()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ # create 100 users, all in the same hash list
+ local i=1;
+ while [ $i -lt 101 ]; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -${expect} \
+ -s10k/20 -h40M/50k -t 2W/3D $((i * 4096))
+ i=$((i + 1))
+ done
+ # do a repquota
+ atf_check -s exit:0 -o 'match:user 409600 block *81920 20 0' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -x -${expect} /mnt
+ rump_quota_shutdown
+}
+
+quota_snap()
+{
+ local flag=$1; shift
+ create_ffs $*
+ local q=$3
+ local expect
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ #start our server which takes a snapshot
+ atf_check -s exit:0 -o ignore \
+ $(atf_get_srcdir)/h_quota2_tests ${flag} 4 ${IMG} ${RUMP_SERVER}
+ # create a few users
+ local i=1;
+ while [ $i -lt 11 ]; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -${expect} \
+ -s10k/20 -h40M/50k -t 2W/3D $i
+ i=$((i + 1))
+ done
+ # we should have 5 files (root + 4 regular files)
+ atf_check -s exit:0 \
+ -o 'match:- - 7days 5 - - 7days' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -av
+ #shutdown and check filesystem
+ rump_quota_shutdown
+}
+
+quota_log()
+{
+ local srv2args=$1; shift
+ create_ffs $*
+ local q=$3
+ local expect
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ #start our server which create a file and unlink while keeping
+ # it open. The server halts itself without flush
+ atf_check -s exit:0 -o ignore \
+ $(atf_get_srcdir)/h_quota2_tests -loU 5 ${IMG} ${RUMP_SERVER}
+ # we should have one unlinked file, but the log covers it.
+ atf_check -s exit:0 -o match:'3 files' -e ignore \
+ fsck_ffs -nf -F ${IMG}
+ # have a kernel mount the fs again; it should cleanup the
+ # unlinked file
+ atf_check -o ignore -e ignore $(atf_get_srcdir)/h_quota2_tests \
+ ${srv2args} -b 5 ${IMG} ${RUMP_SERVER}
+ #shutdown and check filesystem
+ rump_quota_shutdown
+}
+
+quota_default_deny()
+{
+ local nusers=$1; shift
+ create_ffs_server $*
+ local q=$4
+ local expect
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ # create $nusers users, so we are sure the free list has entries
+ # from block 1. Start from 10, as non-root id is 1.
+ # set default to deny all
+ ( echo "@format netbsd-quota-dump v1"
+ echo "# idtype id objtype hard soft usage expire grace"
+ echo "$q default block 0 0 0 0 0"
+ echo "$q default file 0 0 0 0 0"
+ local i=10;
+ while [ $i -lt $(($nusers + 10)) ]; do
+ echo "$q $i block 0 0 0 0 0"
+ echo "$q $i file 0 0 0 0 0"
+ i=$((i + 1))
+ done
+ ) | atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quotarestore -d /mnt
+ atf_check -s exit:0 rump.halt
+ #now start the server which does the limits tests
+ $(atf_get_srcdir)/h_quota2_tests -oC -b 0 ${IMG} ${RUMP_SERVER}
+ rump_quota_shutdown
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_mount.c b/contrib/netbsd-tests/fs/ffs/t_mount.c
new file mode 100644
index 0000000..6a8f74f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_mount.c
@@ -0,0 +1,138 @@
+/* $NetBSD: t_mount.c,v 1.13 2012/11/27 16:01:49 jakllsch Exp $ */
+
+/*
+ * Basic tests for mounting
+ */
+
+/*
+ * 48Kimage:
+ * Adapted for rump and atf from a testcase supplied
+ * by Hubert Feyrer on netbsd-users@
+ */
+
+#include <atf-c.h>
+
+#define FSTEST_IMGSIZE (96 * 512)
+#include "../common/h_fsmacros.h"
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <stdlib.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(48Kimage);
+ATF_TC_HEAD(48Kimage, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "mount small 48K ffs image");
+}
+
+ATF_TC_BODY(48Kimage, tc)
+{
+ void *tmp;
+
+ atf_tc_expect_fail("PR kern/43573");
+ FSTEST_CONSTRUCTOR(tc, ffs, tmp);
+ atf_tc_expect_pass();
+
+ FSTEST_DESTRUCTOR(tc, ffs, tmp);
+}
+
+ATF_TC(fsbsizeovermaxphys);
+ATF_TC_HEAD(fsbsizeovermaxphys, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "mounts file system with "
+ "blocksize > MAXPHYS");
+ /* PR kern/43727 */
+}
+
+ATF_TC_BODY(fsbsizeovermaxphys, tc)
+{
+ char cmd[1024];
+ struct ufs_args args;
+ struct statvfs svb;
+
+ /*
+ * We cannot pass newfs parameters via the fstest interface,
+ * so do things the oldfashioned manual way.
+ */
+ snprintf(cmd, sizeof(cmd), "newfs -G -b %d -F -s 10000 "
+ "ffs.img > /dev/null", MAXPHYS * 2);
+ if (system(cmd))
+ atf_tc_fail("cannot create file system");
+
+ rump_init();
+ if (rump_pub_etfs_register("/devdisk", "ffs.img", RUMP_ETFS_BLK))
+ atf_tc_fail("cannot register rump fake device");
+
+ args.fspec = __UNCONST("/devdisk");
+
+ if (rump_sys_mkdir("/mp", 0777) == -1)
+ atf_tc_fail_errno("create mountpoint");
+
+ /* mount succeeded? bad omen. confirm we're in trouble. */
+ if (rump_sys_mount(MOUNT_FFS, "/mp", 0, &args, sizeof(args)) != -1) {
+ rump_sys_statvfs1("/mp", &svb, ST_WAIT);
+ atf_tc_fail("not expecting to be alive");
+ }
+
+ /* otherwise we're do-ne */
+}
+
+ATF_TC(fsbsizeovermaxbsize);
+ATF_TC_HEAD(fsbsizeovermaxbsize, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "mounts file system with "
+ "blocksize > MAXBSIZE");
+}
+
+ATF_TC_BODY(fsbsizeovermaxbsize, tc)
+{
+ char cmd[1024];
+ struct ufs_args args;
+ struct statvfs svb;
+
+ /*
+ * We cannot pass newfs parameters via the fstest interface,
+ * so do things the oldfashioned manual way.
+ */
+ snprintf(cmd, sizeof(cmd), "newfs -G -b %d -F -s 10000 "
+ "ffs.img > /dev/null", MAXBSIZE * 2);
+ if (system(cmd))
+ atf_tc_fail("cannot create file system");
+
+ rump_init();
+ if (rump_pub_etfs_register("/devdisk", "ffs.img", RUMP_ETFS_BLK))
+ atf_tc_fail("cannot register rump fake device");
+
+ args.fspec = __UNCONST("/devdisk");
+
+ if (rump_sys_mkdir("/mp", 0777) == -1)
+ atf_tc_fail_errno("create mountpoint");
+
+ /* mount succeeded? bad omen. confirm we're in trouble. */
+ if (rump_sys_mount(MOUNT_FFS, "/mp", 0, &args, sizeof(args)) != -1) {
+ rump_sys_statvfs1("/mp", &svb, ST_WAIT);
+ atf_tc_fail("not expecting to be alive");
+ }
+
+ /* otherwise we're do-ne */
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, 48Kimage);
+ ATF_TP_ADD_TC(tp, fsbsizeovermaxphys);
+ ATF_TP_ADD_TC(tp, fsbsizeovermaxbsize);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_quota2_1.c b/contrib/netbsd-tests/fs/ffs/t_quota2_1.c
new file mode 100644
index 0000000..333f3c7
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_quota2_1.c
@@ -0,0 +1,114 @@
+/* $NetBSD: t_quota2_1.c,v 1.4 2012/03/15 02:02:22 joerg Exp $ */
+
+/*
+ * Basic tests for quota2
+ */
+
+#include <atf-c.h>
+
+#include "../common/h_fsmacros.h"
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <stdlib.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+
+static void
+do_quota(const atf_tc_t *tc, int n, const char *newfs_opts, int log)
+{
+ int i;
+ char buf[1024];
+ int res;
+ int fd;
+ struct ufs_args uargs;
+
+ snprintf(buf, sizeof(buf), "newfs -q user -q group -F -s 4000 -n %d "
+ "%s %s", (n + 3), newfs_opts, FSTEST_IMGNAME);
+ if (system(buf) == -1)
+ atf_tc_fail_errno("cannot create file system");
+
+ rump_init();
+ if (rump_sys_mkdir(FSTEST_MNTNAME, 0777) == -1)
+ atf_tc_fail_errno("mount point create");
+
+ rump_pub_etfs_register("/diskdev", FSTEST_IMGNAME, RUMP_ETFS_BLK);
+
+ uargs.fspec = __UNCONST("/diskdev");
+ if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME, (log) ? MNT_LOG : 0,
+ &uargs, sizeof(uargs)) == -1)
+ atf_tc_fail_errno("mount ffs %s", FSTEST_MNTNAME);
+
+ atf_tc_expect_pass();
+ FSTEST_ENTER();
+ RL(rump_sys_chown(".", 0, 0));
+ for (i = 0 ; i < n; i++) {
+ sprintf(buf, "file%d", i);
+ RL(fd = rump_sys_open(buf, O_CREAT | O_RDWR, 0755));
+ sprintf(buf, "test file no %d", i);
+ RL(rump_sys_write(fd, buf, strlen(buf)));
+ RL(rump_sys_fchown(fd, i, i+80000));
+ rump_sys_close(fd);
+ }
+ FSTEST_EXIT();
+ if (rump_sys_unmount(FSTEST_MNTNAME, 0) != 0) {
+ rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1);
+ atf_tc_fail_errno("unmount failed");
+ }
+ snprintf(buf, 1024, "fsck_ffs -fn -F %s", FSTEST_IMGNAME);
+ res = system(buf);
+ if (res != 0)
+ atf_tc_fail("fsck returned %d", res);
+}
+
+#define DECL_TEST(nent, newops, name, descr, log) \
+ATF_TC(quota_##name); \
+ \
+ATF_TC_HEAD(quota_##name, tc) \
+{ \
+ atf_tc_set_md_var(tc, "descr", \
+ "test quotas with %d users and groups, %s", \
+ nent, descr); \
+} \
+ \
+ATF_TC_BODY(quota_##name, tc) \
+{ \
+ do_quota(tc, nent, newops, log); \
+}
+
+DECL_TEST(40, "-O1 -B le", 40_O1_le, "UFS1 little-endian", 0)
+DECL_TEST(40, "-O1 -B be", 40_O1_be, "UFS1 big-endian", 0)
+
+DECL_TEST(40, "-O2 -B le", 40_O2_le, "UFS2 little-endian", 0)
+DECL_TEST(40, "-O2 -B be", 40_O2_be, "UFS2 big-endian", 0)
+
+DECL_TEST(40, "-O1", 40_O1_log, "UFS1 log", 1)
+DECL_TEST(40, "-O2", 40_O2_log, "UFS2 log", 1)
+
+DECL_TEST(1000, "-O1 -B le", 1000_O1_le, "UFS1 little-endian", 0)
+DECL_TEST(1000, "-O1 -B be", 1000_O1_be, "UFS1 big-endian", 0)
+
+DECL_TEST(1000, "-O2 -B le", 1000_O2_le, "UFS2 little-endian", 0)
+DECL_TEST(1000, "-O2 -B be", 1000_O2_be, "UFS2 big-endian", 0)
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, quota_40_O1_le);
+ ATF_TP_ADD_TC(tp, quota_40_O1_be);
+ ATF_TP_ADD_TC(tp, quota_40_O2_le);
+ ATF_TP_ADD_TC(tp, quota_40_O2_be);
+ ATF_TP_ADD_TC(tp, quota_40_O1_log);
+ ATF_TP_ADD_TC(tp, quota_40_O2_log);
+ ATF_TP_ADD_TC(tp, quota_1000_O1_le);
+ ATF_TP_ADD_TC(tp, quota_1000_O1_be);
+ ATF_TP_ADD_TC(tp, quota_1000_O2_le);
+ ATF_TP_ADD_TC(tp, quota_1000_O2_be);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_quota2_remount.c b/contrib/netbsd-tests/fs/ffs/t_quota2_remount.c
new file mode 100644
index 0000000..f648856
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_quota2_remount.c
@@ -0,0 +1,139 @@
+/* $NetBSD: t_quota2_remount.c,v 1.4 2012/03/15 02:02:22 joerg Exp $ */
+
+/*
+ * Basic tests for quota2
+ */
+
+#include <atf-c.h>
+
+#include "../common/h_fsmacros.h"
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/statvfs.h>
+
+#include <stdlib.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+
+static void
+do_quota(const atf_tc_t *tc, int n, const char *newfs_opts, int log)
+{
+ int i;
+ char buf[1024];
+ int res;
+ int fd;
+ struct ufs_args uargs;
+ struct statvfs fst;
+
+ snprintf(buf, sizeof(buf), "newfs -q user -q group -F -s 4000 -n %d "
+ "%s %s", (n + 3), newfs_opts, FSTEST_IMGNAME);
+ if (system(buf) == -1)
+ atf_tc_fail_errno("cannot create file system");
+
+ rump_init();
+ if (rump_sys_mkdir(FSTEST_MNTNAME, 0777) == -1)
+ atf_tc_fail_errno("mount point create");
+
+ rump_pub_etfs_register("/diskdev", FSTEST_IMGNAME, RUMP_ETFS_BLK);
+
+ uargs.fspec = __UNCONST("/diskdev");
+
+ /* read-only doens't have quota enabled */
+ if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME, MNT_RDONLY,
+ &uargs, sizeof(uargs)) == -1)
+ atf_tc_fail_errno("mount ffs ro %s", FSTEST_MNTNAME);
+
+ if (rump_sys_statvfs1(FSTEST_MNTNAME, &fst, 0) != 0)
+ atf_tc_fail_errno("statbfs %s (1)", FSTEST_MNTNAME);
+
+ if ((fst.f_flag & ST_QUOTA) != 0)
+ atf_tc_fail("R/O filesystem has quota");
+
+ /* updating to read-write enables quota */
+ if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME,
+ MNT_UPDATE | (log ? MNT_LOG : 0), &uargs, sizeof(uargs)) == -1)
+ atf_tc_fail_errno("mount ffs rw %s", FSTEST_MNTNAME);
+
+ if (rump_sys_statvfs1(FSTEST_MNTNAME, &fst, 0) != 0)
+ atf_tc_fail_errno("statbfs %s (2)", FSTEST_MNTNAME);
+
+ if ((fst.f_flag & ST_QUOTA) == 0)
+ atf_tc_fail("R/W filesystem has no quota");
+
+ /* we can update a second time */
+ if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME,
+ MNT_UPDATE | (log ? MNT_LOG : 0), &uargs, sizeof(uargs)) == -1)
+ atf_tc_fail_errno("mount ffs rw(2) %s", FSTEST_MNTNAME);
+
+ if (rump_sys_statvfs1(FSTEST_MNTNAME, &fst, 0) != 0)
+ atf_tc_fail_errno("statbfs %s (3)", FSTEST_MNTNAME);
+
+ if ((fst.f_flag & ST_QUOTA) == 0)
+ atf_tc_fail("R/W filesystem has no quota");
+
+ /* create some files so fsck has something to check */
+ FSTEST_ENTER();
+ RL(rump_sys_chown(".", 0, 0));
+ for (i = 0 ; i < n; i++) {
+ sprintf(buf, "file%d", i);
+ RL(fd = rump_sys_open(buf, O_CREAT | O_RDWR, 0755));
+ sprintf(buf, "test file no %d", i);
+ RL(rump_sys_write(fd, buf, strlen(buf)));
+ RL(rump_sys_fchown(fd, i, i+80000));
+ rump_sys_close(fd);
+ }
+ FSTEST_EXIT();
+ if (rump_sys_unmount(FSTEST_MNTNAME, 0) != 0) {
+ rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1);
+ atf_tc_fail_errno("unmount failed");
+ }
+ snprintf(buf, 1024, "fsck_ffs -fn -F %s", FSTEST_IMGNAME);
+ res = system(buf);
+ if (res != 0)
+ atf_tc_fail("fsck returned %d", res);
+}
+
+#define DECL_TEST(nent, newops, name, descr, log) \
+ATF_TC(quota_##name); \
+ \
+ATF_TC_HEAD(quota_##name, tc) \
+{ \
+ atf_tc_set_md_var(tc, "descr", \
+ "test filesystem remount with quotas, %s", descr); \
+} \
+ \
+ATF_TC_BODY(quota_##name, tc) \
+{ \
+ do_quota(tc, nent, newops, log); \
+}
+
+DECL_TEST(10, "-O1 -B le", 10_O1_le, "UFS1 little-endian", 0)
+DECL_TEST(10, "-O1 -B be", 10_O1_be, "UFS1 big-endian", 0)
+
+#if 0
+/*
+ * this cause fsck to complain about summaries at the end.
+ * This sems to be related to -o log (reproductible on a fs with no
+ * quota enabled). not reproductible with a real kernel ...
+ */
+DECL_TEST(10, "-O1", 10_O1_log, "UFS1 log", 1)
+DECL_TEST(10, "-O2", 10_O2_log, "UFS2 log", 1)
+#endif
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, quota_10_O1_le);
+ ATF_TP_ADD_TC(tp, quota_10_O1_be);
+#if 0
+ ATF_TP_ADD_TC(tp, quota_10_O1_log);
+ ATF_TP_ADD_TC(tp, quota_10_O2_log);
+#endif
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_quotalimit.sh b/contrib/netbsd-tests/fs/ffs/t_quotalimit.sh
new file mode 100755
index 0000000..16e47b7
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_quotalimit.sh
@@ -0,0 +1,345 @@
+# $NetBSD: t_quotalimit.sh,v 1.4 2012/01/18 20:51:23 bouyer Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+for e in le; do
+ for v in 1; do
+ for q in "user" "group"; do
+ test_case_root limit_${e}_${v}_${q} limit_quota \
+ "hit hard limit quota with ${q} enabled" -b ${e} ${v} ${q}
+ test_case_root limit_${e}_${v}_${q}_log limit_quota \
+ "hit hard limit quota with ${q} enabled, WAPBL" -bl ${e} ${v} ${q}
+ test_case_root slimit_${e}_${v}_${q} limit_softquota \
+ "hit soft limit quota with ${q} enabled after grace time" \
+ -b ${e} ${v} ${q}
+ test_case_root inolimit_${e}_${v}_${q} limit_iquota \
+ "hit hard limit ino quota with ${q} enabled" -b ${e} ${v} ${q}
+ test_case_root inolimit_${e}_${v}_${q}_log limit_iquota \
+ "hit hard limit ino quota with ${q} enabled, WAPBL" -bl ${e} ${v} ${q}
+ test_case_root sinolimit_${e}_${v}_${q} limit_softiquota \
+ "hit soft limit ino quota with ${q} enabled after grace time" \
+ -b ${e} ${v} ${q}
+ test_case_root herit_defq_${e}_${v}_${q} inherit_defaultquota \
+ "new id herit from default for ${q} quota" -b ${e} ${v} ${q}
+ test_case_root herit_defq_${e}_${v}_${q}_log inherit_defaultquota \
+ "new id herit from default for ${q} quota, WAPBL" -bl ${e} ${v} ${q}
+ test_case_root herit_idefq_${e}_${v}_${q}_log inherit_defaultiquota \
+ "new id herit from default for ${q} ino quota, WAPBL" -bl ${e} ${v} ${q}
+ done
+ done
+done
+
+limit_quota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local id=1
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2k/4 -h3k/6 \
+ -t 2h/2h ${id}
+ done
+ atf_check -s exit:0 rump.halt
+
+ #now start the server which does the limits tests
+ atf_check -s exit:0 -o ignore \
+-e match:'test 0: write up to hard limit returned 69: Disc quota exceeded' \
+ $(atf_get_srcdir)/h_quota2_tests -b 0 ${IMG} ${RUMP_SERVER}
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ -o match:'/mnt 3072 B\* 2048 B 3072 B 2:0 2 4 6 ' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
+ atf_check -s exit:0 \
+ -o match:'daemon \+- 3 2 3 2:0 2 4 6' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
+ done
+ rump_quota_shutdown
+}
+
+limit_softquota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local id=1
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2k/4 -h3k/6 \
+ -t 1s/1d ${id}
+ done
+ atf_check -s exit:0 rump.halt
+
+ #now start the server which does the limits tests
+ atf_check -s exit:0 -o ignore \
+-e match:'test 1: write beyond the soft limit after grace time returned 69: Disc quota exceeded' \
+ $(atf_get_srcdir)/h_quota2_tests -b 1 ${IMG} ${RUMP_SERVER}
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ -o match:'/mnt 2560 B\* 2048 B 3072 B none 2 4 6 ' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
+ atf_check -s exit:0 \
+ -o match:'daemon \+- 2 2 3 none 2 4 6' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
+ done
+ rump_quota_shutdown
+}
+
+limit_iquota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local id=1
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2m/4 -h3m/6 \
+ -t 2h/2h ${id}
+ done
+ atf_check -s exit:0 rump.halt
+
+ #now start the server which does the limits tests
+ atf_check -s exit:0 -o ignore \
+-e match:'test 2: create file up to hard limit returned 69: Disc quota exceeded' \
+ $(atf_get_srcdir)/h_quota2_tests -b 2 ${IMG} ${RUMP_SERVER}
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ -o match:'/mnt 3072 B 2048 K 3072 K 6 \* 4 6 2:0' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
+ atf_check -s exit:0 \
+ -o match:'daemon -\+ 3 2048 3072 6 4 6 2:0' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
+ done
+ rump_quota_shutdown
+}
+
+limit_softiquota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local id=1
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2m/4 -h3m/6 \
+ -t 1d/1s ${id}
+ done
+ atf_check -s exit:0 rump.halt
+
+ #now start the server which does the limits tests
+ atf_check -s exit:0 -o ignore \
+-e match:'test 3: create file beyond the soft limit after grace time returned 69: Disc quota exceeded' \
+ $(atf_get_srcdir)/h_quota2_tests -b 3 ${IMG} ${RUMP_SERVER}
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ -o match:'/mnt 2560 B 2048 K 3072 K 5 \* 4 6 none' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
+ atf_check -s exit:0 \
+ -o match:'daemon -\+ 2 2048 3072 5 4 6 none' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
+ done
+ rump_quota_shutdown
+}
+
+inherit_defaultquota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local id=1
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2k/4 -h3k/6 \
+ -t 2h/2h -d
+ done
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ -o match:'Disk quotas for .*id 1\): none' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -v ${id}
+ done
+ atf_check -s exit:0 rump.halt
+
+ #now start the server which does the limits tests
+ atf_check -s exit:0 -o ignore \
+-e match:'test 0: write up to hard limit returned 69: Disc quota exceeded' \
+ $(atf_get_srcdir)/h_quota2_tests -b 0 ${IMG} ${RUMP_SERVER}
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ -o match:'/mnt 3072 B\* 2048 B 3072 B 2:0 2 4 6 ' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
+ atf_check -s exit:0 \
+ -o match:'daemon \+- 3 2 3 2:0 2 4 6' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
+ done
+ rump_quota_shutdown
+}
+
+inherit_defaultiquota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local id=1
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2m/4 -h3m/6 \
+ -t 2h/2h -d
+ done
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ -o match:'Disk quotas for .*id 1\): none' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -v ${id}
+ done
+ atf_check -s exit:0 rump.halt
+
+ #now start the server which does the limits tests
+ atf_check -s exit:0 -o ignore \
+-e match:'test 2: create file up to hard limit returned 69: Disc quota exceeded' \
+ $(atf_get_srcdir)/h_quota2_tests -b 2 ${IMG} ${RUMP_SERVER}
+ for q in ${expect} ; do
+ atf_check -s exit:0 \
+ -o match:'/mnt 3072 B 2048 K 3072 K 6 \* 4 6 2:0' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
+ atf_check -s exit:0 \
+ -o match:'daemon -\+ 3 2048 3072 6 4 6 2:0' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
+ done
+ rump_quota_shutdown
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_setquota.sh b/contrib/netbsd-tests/fs/ffs/t_setquota.sh
new file mode 100755
index 0000000..5795fe4
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_setquota.sh
@@ -0,0 +1,203 @@
+# $NetBSD: t_setquota.sh,v 1.4 2012/01/18 20:51:23 bouyer Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+for e in le be; do
+ for v in 1 2; do
+ for q in "user" "group"; do
+ test_case_root set_${e}_${v}_${q} set_quota \
+ "set quota with ${q} enabled" -b ${e} ${v} ${q}
+ test_case_root set_new_${e}_${v}_${q} set_quota_new \
+ "set quota for new id with ${q} enabled" -b ${e} ${v} ${q}
+ test_case_root set_default_${e}_${v}_${q} set_quota_default \
+ "set default quota with ${q} enabled" -b ${e} ${v} ${q}
+ done
+ test_case_root set_${e}_${v}_"both" set_quota \
+ "set quota with both enabled" -b ${e} ${v} "both"
+ test_case_root set_new_${e}_${v}_"both" set_quota_new \
+ "set quota for new id with both enabled" -b ${e} ${v} "both"
+ test_case_root set_new_${e}_${v}_"both_log" set_quota_new \
+ "set quota for new id with both enabled, WAPBL" -bl ${e} ${v} "both"
+ test_case_root set_default_${e}_${v}_"both" set_quota_default \
+ "set default quota with both enabled" -b ${e} ${v} "both"
+ done
+done
+
+set_quota()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local fail
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+#check that we can set the expected quota
+ for q in ${expect} ; do
+ local id=$(id -${q})
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
+ -t 2W/3D ${id}
+ atf_check -s exit:0 \
+-o "match:/mnt 0 10 40960 2weeks 1 20 51200 3days" \
+-o "match:Disk quotas for .*: $" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
+ atf_check -s exit:0 \
+-o "match:-- 0 10 40960 1 20 51200" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
+ done
+
+#check that we do not get positive reply for non-expected quota
+ for q in ${fail} ; do
+ local id=$(id -${q})
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k ${id}
+ atf_check -s exit:0 -o "not-match:/mnt" \
+ -o "not-match:Disk quotas for .*: $" \
+ -o "match:Disk quotas for .*: none$" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
+ atf_check -s exit:0 \
+-o "not-match:-- 0 - -" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
+ done
+ rump_quota_shutdown
+}
+
+set_quota_new()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local fail
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+#check that we can set the expected quota
+ for q in ${expect} ; do
+ local id=1
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
+ -t 120W/255D ${id}
+ atf_check -s exit:0 \
+-o "match:/mnt 0 10 40960 2years 0 20 51200 9months" \
+-o "match:Disk quotas for .*: $" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
+ done
+
+#check that we do not get positive reply for non-expected quota
+ for q in ${fail} ; do
+ local id=$(id -${q})
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k ${id}
+ atf_check -s exit:0 -o "not-match:/mnt" \
+ -o "not-match:Disk quotas for .*: $" \
+ -o "match:Disk quotas for .*: none$" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
+ done
+ rump_quota_shutdown
+}
+
+set_quota_default()
+{
+ create_ffs_server $*
+ local q=$4
+ local expect
+ local fail
+
+ case ${q} in
+ user)
+ expect=u
+ fail=g
+ ;;
+ group)
+ expect=g
+ fail=u
+ ;;
+ both)
+ expect="u g"
+ fail=""
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+#check that we can set the expected quota
+ for q in ${expect} ; do
+ local id="-d"
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
+ -t 2H2M/3540 ${id}
+ atf_check -s exit:0 \
+-o "match:/mnt 0 10 40960 2:2 0 20 51200 59" \
+-o "match:Default (user|group) disk quotas: $" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
+ done
+
+#check that we do not get positive reply for non-expected quota
+ for q in ${fail} ; do
+ local id="-d"
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k ${id}
+ atf_check -s exit:0 -o "not-match:/mnt" \
+ -o "not-match:Default (user|group) disk quotas: $" \
+ -o "match:Default (user|group) disk quotas: none$" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
+ done
+ rump_quota_shutdown
+}
diff --git a/contrib/netbsd-tests/fs/ffs/t_snapshot.c b/contrib/netbsd-tests/fs/ffs/t_snapshot.c
new file mode 100644
index 0000000..180a8cc
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_snapshot.c
@@ -0,0 +1,43 @@
+/* $NetBSD: t_snapshot.c,v 1.6 2013/02/06 09:05:01 hannken Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+
+#define IMGNAME "ffs.img"
+#define NEWFS "newfs -F -s 10000 " IMGNAME
+#define FSCK "fsck_ffs -fn -F"
+#define BAKNAME "/mnt/le_snapp"
+
+static void
+mount_diskfs(const char *fspec, const char *path)
+{
+ struct ufs_args uargs;
+
+ uargs.fspec = __UNCONST(fspec);
+
+ if (rump_sys_mount(MOUNT_FFS, path, 0, &uargs, sizeof(uargs)) == -1)
+ atf_tc_fail_errno("mount ffs %s", path);
+}
+
+static void
+begin(void)
+{
+
+ /* empty */
+}
+
+#include "../common/snapshot.c"
diff --git a/contrib/netbsd-tests/fs/ffs/t_snapshot_log.c b/contrib/netbsd-tests/fs/ffs/t_snapshot_log.c
new file mode 100644
index 0000000..e1ce17e
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_snapshot_log.c
@@ -0,0 +1,46 @@
+/* $NetBSD: t_snapshot_log.c,v 1.2 2013/02/06 09:05:01 hannken Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+
+#define IMGNAME "ffs.img"
+#define NEWFS "newfs -F -s 10000 " IMGNAME
+#define FSCK "fsck_ffs -fn -F"
+#define BAKNAME "/mnt/le_snapp"
+
+static void
+mount_diskfs(const char *fspec, const char *path)
+{
+ struct ufs_args uargs;
+ static int flags = MNT_LOG;
+
+ uargs.fspec = __UNCONST(fspec);
+
+ if (rump_sys_mount(MOUNT_FFS,
+ path, flags, &uargs, sizeof(uargs)) == -1)
+ atf_tc_fail_errno("mount ffs %s", path);
+ flags = 0;
+}
+
+static void
+begin(void)
+{
+
+ /* empty */
+}
+
+#include "../common/snapshot.c"
diff --git a/contrib/netbsd-tests/fs/ffs/t_snapshot_v2.c b/contrib/netbsd-tests/fs/ffs/t_snapshot_v2.c
new file mode 100644
index 0000000..393f3d4
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ffs/t_snapshot_v2.c
@@ -0,0 +1,43 @@
+/* $NetBSD: t_snapshot_v2.c,v 1.2 2013/02/06 09:05:01 hannken Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+
+#define IMGNAME "ffs.img"
+#define NEWFS "newfs -F -s 10000 -O 2 " IMGNAME
+#define FSCK "fsck_ffs -fn -F"
+#define BAKNAME "/mnt/le_snapp"
+
+static void
+mount_diskfs(const char *fspec, const char *path)
+{
+ struct ufs_args uargs;
+
+ uargs.fspec = __UNCONST(fspec);
+
+ if (rump_sys_mount(MOUNT_FFS, path, 0, &uargs, sizeof(uargs)) == -1)
+ atf_tc_fail_errno("mount ffs %s", path);
+}
+
+static void
+begin(void)
+{
+
+ /* empty */
+}
+
+#include "../common/snapshot.c"
diff --git a/contrib/netbsd-tests/fs/fifofs/t_fifo.c b/contrib/netbsd-tests/fs/fifofs/t_fifo.c
new file mode 100644
index 0000000..c4a2060
--- /dev/null
+++ b/contrib/netbsd-tests/fs/fifofs/t_fifo.c
@@ -0,0 +1,237 @@
+/* Test case written by Bharat Joshi */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fifo.c,v 1.1 2011/12/21 00:17:07 christos Exp $");
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <err.h>
+#include <signal.h>
+
+#ifndef STANDALONE
+#include <atf-c.h>
+#endif
+
+#define FIFO_FILE_PATH "./fifo_file"
+#define NUM_MESSAGES 20
+#define MSG_SIZE 240
+#define MESSAGE "I am fine"
+
+static int verbose = 0;
+
+/*
+ * child_writer
+ *
+ * Function that runs in child context and opens and write to the FIFO.
+ */
+static void
+child_writer(void)
+{
+ ssize_t rv;
+ int fd;
+ size_t count;
+ char message[MSG_SIZE] = MESSAGE;
+ static const struct timespec ts = { 0, 10000 };
+
+ /* Open the fifo in write-mode */
+ for (;;) {
+ fd = open(FIFO_FILE_PATH, O_WRONLY, 0);
+ if (fd == -1) {
+ if (errno == EINTR)
+ continue;
+ err(1, "Child: can't open fifo in write mode");
+ }
+ break;
+ }
+
+ for (count = 0; count < NUM_MESSAGES; count++) {
+ rv = write(fd, message, MSG_SIZE);
+ if (rv == -1) {
+ warn("Child: Failed to write");
+ break;
+ }
+ if (rv != MSG_SIZE)
+ warnx("Child: wrote only %zd", rv);
+ nanosleep(&ts, NULL);
+ }
+
+ close(fd);
+ if (verbose) {
+ printf("Child: Closed the fifo file\n");
+ fflush(stdout);
+ }
+}
+
+/*
+ * _sigchild_handler
+ *
+ * Called when a sigchild is delivered
+ */
+static void
+sigchild_handler(int signo)
+{
+ if (verbose) {
+ if (signo == SIGCHLD) {
+ printf("Got sigchild\n");
+ } else {
+ printf("Got %d signal\n", signo);
+ }
+ fflush(stdout);
+ }
+
+}
+
+static int
+run(void)
+{
+ pid_t pid;
+ ssize_t rv;
+ int fd, status;
+ size_t buf_size = MSG_SIZE;
+ char buf[MSG_SIZE];
+ struct sigaction action;
+ static const struct timespec ts = { 0, 500000000 };
+
+ /* Catch sigchild Signal */
+ memset(&action, 0, sizeof(action));
+ action.sa_handler = sigchild_handler;
+ sigemptyset(&action.sa_mask);
+
+ if (sigaction(SIGCHLD, &action, NULL) == -1)
+ err(1, "sigaction");
+
+ (void)unlink(FIFO_FILE_PATH);
+ /* First create a fifo */
+ if (mkfifo(FIFO_FILE_PATH, S_IRUSR | S_IWUSR) == -1)
+ err(1, "mkfifo");
+
+ switch ((pid = fork())) {
+ case -1:
+ err(1, "fork");
+ case 0:
+ /* Open the file in write mode so that subsequent read
+ * from parent side does not block the parent..
+ */
+ if ((fd = open(FIFO_FILE_PATH, O_WRONLY, 0)) == -1)
+ err(1, "failed to open fifo");
+
+ /* In child */
+ child_writer();
+ return 0;
+
+ default:
+ break;
+ }
+
+ if (verbose) {
+ printf("Child pid is %d\n", pid );
+ fflush(stdout);
+ }
+
+ /* In parent */
+ for (;;) {
+ if ((fd = open(FIFO_FILE_PATH, O_RDONLY, 0)) == -1) {
+ if (errno == EINTR)
+ continue;
+ else
+ err(1, "Failed to open the fifo in read mode");
+ }
+ /* Read mode is opened */
+ break;
+
+ }
+
+ nanosleep(&ts, NULL);
+ if (verbose) {
+ printf("Was sleeping...\n");
+ fflush(stdout);
+ }
+
+ for (;;) {
+ rv = read(fd, buf, buf_size);
+
+ if (rv == -1) {
+ warn("Failed to read");
+ if (errno == EINTR) {
+ if (verbose) {
+ printf("Parent interrupted, "
+ "continuing...\n");
+ fflush(stdout);
+ }
+ continue;
+ }
+
+ break;
+ }
+
+ if (rv == 0) {
+ if (verbose) {
+ printf("Writers have closed, looks like we "
+ "are done\n");
+ fflush(stdout);
+ }
+ break;
+ }
+
+ if (verbose) {
+ printf("Received %zd bytes message '%s'\n", rv, buf);
+ fflush(stdout);
+ }
+ }
+
+ close(fd);
+
+ if (verbose) {
+ printf("We are done.. now reap the child");
+ fflush(stdout);
+ }
+
+ // Read the child...
+ while (waitpid(pid, &status, 0) == -1)
+ if (errno != EINTR) {
+ warn("Failed to reap the child");
+ return 1;
+ }
+
+ if (verbose) {
+ printf("We are done completely\n");
+ fflush(stdout);
+ }
+ return 0;
+}
+
+#ifndef STANDALONE
+ATF_TC(parent_child);
+
+ATF_TC_HEAD(parent_child, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that when a fifo is shared "
+ "between a reader parent and a writer child, that read will "
+ "return EOF, and not get stuck after the child exits");
+}
+
+ATF_TC_BODY(parent_child, tc)
+{
+ ATF_REQUIRE(run() == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, parent_child);
+
+ return atf_no_error();
+}
+#else
+int
+main(void)
+{
+ verbose = 1;
+ return run();
+}
+#endif
diff --git a/contrib/netbsd-tests/fs/h_funcs.subr b/contrib/netbsd-tests/fs/h_funcs.subr
new file mode 100644
index 0000000..1216aaf
--- /dev/null
+++ b/contrib/netbsd-tests/fs/h_funcs.subr
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# $NetBSD: h_funcs.subr,v 1.3 2010/06/23 11:19:17 pooka Exp $
+#
+# Copyright (c) 2007 The NetBSD Foundation, 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 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.
+#
+
+#
+# require_fs name
+#
+# Checks that the given file system is built into the kernel and
+# that its corresponding mount(8) utility is available. Otherwise
+# skips the test.
+#
+require_fs() {
+ local name
+ local autoload
+ name="${1}"
+
+ atf_require_prog mount
+ atf_require_prog mount_${name}
+ atf_require_prog umount
+
+ # if we have autoloadable modules, just assume the file system
+ atf_require_prog sysctl
+ autoload=$(sysctl -n kern.module.autoload)
+ [ "${autoload}" = "1" ] && return 0
+
+ set -- $(sysctl -n vfs.generic.fstypes)
+ found=no
+ while [ ${#} -gt 1 ]; do
+ if [ ${1} = ${name} ]; then
+ found=yes
+ break
+ fi
+ shift
+ done
+ [ ${found} = yes ] || \
+ atf_skip "The kernel does not include support the " \
+ "\`${name}' file system"
+}
diff --git a/contrib/netbsd-tests/fs/hfs/colon.hfs.bz2.uue b/contrib/netbsd-tests/fs/hfs/colon.hfs.bz2.uue
new file mode 100644
index 0000000..9240e7b
--- /dev/null
+++ b/contrib/netbsd-tests/fs/hfs/colon.hfs.bz2.uue
@@ -0,0 +1,35 @@
+begin 644 colon.hfs.bz2
+M0EIH.3%!629363%?)5P``$+____[_UOQ>_]__^_O\+____1K30045,CBA$'P
+M'DA:2!KIT`3V\VRA*<ZPAUVK`E%-)E,IME3T33U--DFRCU,T33T@]-1HQ&1M
+M(/2&@&TGI&@9#1B#0&F@TT:``R9/4$I$4PTF$Q,B8T)IY(VD:9&`3(80T>B&
+M`$,"8C$P$T9!HR:81B,":`D20A3T:GI`9``#(>H-`:-```:`````````````
+M08!#1B:`R:83)ID`&$:-,`F`)A!H9`Q,@#``"8F3`3`30%241HC(4_4GJ>U-
+M1Y31IM)ID`]3(T>H`#0#0T`:!H!A&@!H`````*9A\>L.>@+P;@Y:4C2%YM29
+M)Z`H>8SU&'"0U30JHOQ^.'A/7!GQK%#<GT'!B0OU+G:^>A5RVH"2$4VDL&T@
+M65#T*A/GU+(_VI$+*$`TJ"4J1(B1S&-YV+\J^"\Z6EK+@TU[0OQJ+;*HW.MN
+M=HTL,CQHCE$C3#EW'>#8!IGYY[*)]U$!0W6L;#U:*4X6IT<@^*5!16E)%(:*
+MA["$B&JX1022R8T4#20D@+ZHA_2_9$72HDSJ-FJ"7Z15%U2`@<>BJGD5'+*A
+M@M6>?K^MS^LOC8I)EI6[`O3`#CCKU:M6F6A00-$/:LH+!E7(G33<)<I*5Q&T
+M4[$M.$5OJZQKO59^7&LNANB-1PEMLB*TT\<[=;@7C@EYFG#:K@GL&R8^48"Y
+MU*QN%C56,Q?,.BW;"R9.7;9Z;2,+07U,QGK13C,!FYO^3/?)>)OZ27I4`@;=
+M4C<-$,N=UX98G_0DK)BTS-^)R+8NZ,B3JU:@85&-MM@</$$"."U>FCNQW/?=
+M'ZL4BR[\&3S\>.K"S#1Z&>2I>^+16EM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(
+%&*^2K@"^
+`
+end
diff --git a/contrib/netbsd-tests/fs/hfs/t_pathconvert.c b/contrib/netbsd-tests/fs/hfs/t_pathconvert.c
new file mode 100644
index 0000000..307de70
--- /dev/null
+++ b/contrib/netbsd-tests/fs/hfs/t_pathconvert.c
@@ -0,0 +1,83 @@
+/* $NetBSD: t_pathconvert.c,v 1.5 2011/02/25 20:54:18 martin Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <fs/hfs/hfs.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(colonslash);
+ATF_TC_HEAD(colonslash, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "HFS+ colons/slashes (PR kern/44523)");
+ atf_tc_set_md_var(tc, "timeout", "20");
+}
+
+#define IMGNAME "colon.hfs"
+#define FAKEBLK "/dev/blk"
+#define FUNNY_FILENAME "foo:bar"
+ATF_TC_BODY(colonslash, tc)
+{
+ struct hfs_args args;
+ int dirfd, fd;
+ char thecmd[1024];
+ char buf[DIRBLKSIZ];
+ struct dirent *dirent;
+ int offset, nbytes;
+ bool ok = false;
+
+ snprintf(thecmd, sizeof(thecmd), "uudecode %s/colon.hfs.bz2.uue",
+ atf_tc_get_config_var(tc, "srcdir"));
+ RZ(system(thecmd));
+
+ snprintf(thecmd, sizeof(thecmd), "bunzip2 " IMGNAME ".bz2");
+ RZ(system(thecmd));
+
+ memset(&args, 0, sizeof args);
+ args.fspec = __UNCONST(FAKEBLK);
+ RZ(rump_init());
+
+ RL(rump_sys_mkdir("/mp", 0777));
+ RZ(rump_pub_etfs_register(FAKEBLK, IMGNAME, RUMP_ETFS_BLK));
+ RL(rump_sys_mount(MOUNT_HFS, "/mp", 0, &args, sizeof args));
+
+ RL(dirfd = rump_sys_open("/mp", O_RDONLY));
+
+ RL(nbytes = rump_sys_getdents(dirfd, buf, sizeof buf));
+
+ for (offset = 0; offset < nbytes; offset += dirent->d_reclen) {
+ dirent = (struct dirent *)(buf + offset);
+ if (strchr(dirent->d_name, '/'))
+ atf_tc_fail("dirent with slash: %s", dirent->d_name);
+ if (0 == strcmp(FUNNY_FILENAME, dirent->d_name))
+ ok = true;
+ }
+
+ if (!ok)
+ atf_tc_fail("no dirent for file: %s", FUNNY_FILENAME);
+
+ RL(rump_sys_close(dirfd));
+ RL(fd = rump_sys_open("/mp/" FUNNY_FILENAME, O_RDONLY));
+ RL(rump_sys_close(fd));
+ RL(rump_sys_unmount("/mp", 0));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, colonslash);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/kernfs/t_basic.c b/contrib/netbsd-tests/fs/kernfs/t_basic.c
new file mode 100644
index 0000000..e5ba4a7
--- /dev/null
+++ b/contrib/netbsd-tests/fs/kernfs/t_basic.c
@@ -0,0 +1,133 @@
+/* $NetBSD: t_basic.c,v 1.3 2010/05/31 23:44:54 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/module.h>
+#include <sys/dirent.h>
+#include <sys/sysctl.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <miscfs/kernfs/kernfs.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(getdents);
+ATF_TC_HEAD(getdents, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "kernfs directory contains files");
+}
+
+static void
+mountkernfs(void)
+{
+
+ rump_init();
+
+ if (rump_sys_mkdir("/kern", 0777) == -1)
+ atf_tc_fail_errno("mkdir /kern");
+ if (rump_sys_mount(MOUNT_KERNFS, "/kern", 0, NULL, 0) == -1)
+ atf_tc_fail_errno("could not mount kernfs");
+}
+
+ATF_TC_BODY(getdents, tc)
+{
+ struct dirent *dent;
+ char buf[8192];
+ int dfd;
+
+ mountkernfs();
+
+ if ((dfd = rump_sys_open("/kern", O_RDONLY)) == -1)
+ atf_tc_fail_errno("can't open directory");
+ if (rump_sys_getdents(dfd, buf, sizeof(buf)) == -1)
+ atf_tc_fail_errno("getdents");
+
+ /*
+ * Check that we get the first three values (., .., boottime).
+ * Make more complete by autogenerating list from kernfs_vnops.c?
+ */
+ dent = (void *)buf;
+ ATF_REQUIRE_STREQ(dent->d_name, ".");
+ dent = _DIRENT_NEXT(dent);
+ ATF_REQUIRE_STREQ(dent->d_name, "..");
+ dent = _DIRENT_NEXT(dent);
+ ATF_REQUIRE_STREQ(dent->d_name, "boottime");
+
+ /* done */
+}
+
+ATF_TC(hostname);
+ATF_TC_HEAD(hostname, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "/kern/hostname changes hostname");
+}
+
+static char *
+getthehost(void)
+{
+ static char buf[8192];
+ int mib[2];
+ size_t blen;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_HOSTNAME;
+ blen = sizeof(buf);
+ if (rump_sys___sysctl(mib, 2, buf, &blen, NULL, 0) == -1)
+ atf_tc_fail_errno("sysctl gethostname");
+
+ return buf;
+}
+
+#define NEWHOSTNAME "turboton roos-berg"
+ATF_TC_BODY(hostname, tc)
+{
+ char buf[8192];
+ char *shost, *p;
+ int fd;
+
+ mountkernfs();
+ if ((fd = rump_sys_open("/kern/hostname", O_RDWR)) == -1)
+ atf_tc_fail_errno("open hostname");
+
+ /* check initial match */
+ shost = getthehost();
+ buf[0] = '\0';
+ if (rump_sys_read(fd, buf, sizeof(buf)) == -1)
+ atf_tc_fail_errno("read hostname");
+ p = strchr(buf, '\n');
+ if (p)
+ *p = '\0';
+ ATF_REQUIRE_STREQ_MSG(buf, shost, "initial hostname mismatch");
+
+ /* check changing hostname works */
+ if (rump_sys_pwrite(fd, NEWHOSTNAME, strlen(NEWHOSTNAME), 0)
+ != strlen(NEWHOSTNAME)) {
+ atf_tc_fail_errno("write new hostname");
+ }
+
+ shost = getthehost();
+ ATF_REQUIRE_STREQ_MSG(NEWHOSTNAME, shost, "modified hostname mismatch");
+
+ /* done */
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, hostname);
+ ATF_TP_ADD_TC(tp, getdents);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/lfs/t_pr.c b/contrib/netbsd-tests/fs/lfs/t_pr.c
new file mode 100644
index 0000000..97cb1db
--- /dev/null
+++ b/contrib/netbsd-tests/fs/lfs/t_pr.c
@@ -0,0 +1,60 @@
+/* $NetBSD: t_pr.c,v 1.6 2011/02/22 18:41:05 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(mknod);
+ATF_TC_HEAD(mknod, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "mknod(2) hangs on LFS (PR kern/43503)");
+ atf_tc_set_md_var(tc, "timeout", "20");
+}
+
+#define IMGNAME "disk.img"
+#define FAKEBLK "/dev/blk"
+ATF_TC_BODY(mknod, tc)
+{
+ struct ufs_args args;
+
+ /* hmm, maybe i should fix newfs_lfs instead? */
+ if (system("newfs_lfs -D -F -s 10000 ./" IMGNAME) == -1)
+ atf_tc_fail_errno("newfs failed");
+
+ memset(&args, 0, sizeof(args));
+ args.fspec = __UNCONST(FAKEBLK);
+
+ rump_init();
+ if (rump_sys_mkdir("/mp", 0777) == -1)
+ atf_tc_fail_errno("cannot create mountpoint");
+ rump_pub_etfs_register(FAKEBLK, IMGNAME, RUMP_ETFS_BLK);
+ if (rump_sys_mount(MOUNT_LFS, "/mp", 0, &args, sizeof(args)) == -1)
+ atf_tc_fail_errno("rump_sys_mount failed");
+
+ //atf_tc_expect_timeout("PR kern/43503");
+ if (rump_sys_mknod("/mp/node", S_IFCHR | 0777, 0) == -1)
+ atf_tc_fail_errno("mknod failed");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mknod);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/msdosfs/t_snapshot.c b/contrib/netbsd-tests/fs/msdosfs/t_snapshot.c
new file mode 100644
index 0000000..8b5708f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/msdosfs/t_snapshot.c
@@ -0,0 +1,51 @@
+/* $NetBSD: t_snapshot.c,v 1.3 2014/06/10 13:15:18 martin Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <fs/tmpfs/tmpfs_args.h>
+#include <msdosfs/msdosfsmount.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+
+#define IMGNAME "msdosfs.img"
+#define NEWFS "newfs_msdos -C 5M " IMGNAME
+#define FSCK "fsck_msdos -fn"
+#define BAKNAME "/stor/snap"
+
+static void
+mount_diskfs(const char *fspec, const char *path)
+{
+ struct msdosfs_args margs;
+
+ memset(&margs, 0, sizeof(margs));
+ margs.fspec = __UNCONST(fspec);
+ margs.version = MSDOSFSMNT_VERSION;
+
+ if (rump_sys_mount(MOUNT_MSDOS, path, 0, &margs, sizeof(margs)) == -1)
+ err(1, "mount msdosfs %s", path);
+}
+
+static void
+begin(void)
+{
+ struct tmpfs_args targs = { .ta_version = TMPFS_ARGS_VERSION, };
+
+ if (rump_sys_mkdir("/stor", 0777) == -1)
+ atf_tc_fail_errno("mkdir /stor");
+ if (rump_sys_mount(MOUNT_TMPFS, "/stor", 0, &targs,sizeof(targs)) == -1)
+ atf_tc_fail_errno("mount storage");
+}
+
+#include "../common/snapshot.c"
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/README b/contrib/netbsd-tests/fs/nfs/nfsservice/README
new file mode 100644
index 0000000..8cfa8af
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/README
@@ -0,0 +1,16 @@
+ $NetBSD: README,v 1.1 2010/07/26 15:53:00 pooka Exp $
+
+This directory contains the necessary bits to get an NFS server
+running in a rump kernel. In essence, it's:
+
+ * rpcbind
+ * mountd
+ * nfsd
+
+Additionally, you need the libc rpc code which is in
+tests/fs/common/nfsrpc.
+
+TODO: make the standard nfs userspace services usable (the challenge
+comes from rpc being in libc).
+
+questions? ==> pooka@netbsd.org
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/exports b/contrib/netbsd-tests/fs/nfs/nfsservice/exports
new file mode 100644
index 0000000..6cc8c5f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/exports
@@ -0,0 +1,12 @@
+# $NetBSD: exports,v 1.2 2010/12/31 18:11:27 pooka Exp $
+#
+
+#
+# The export dir is currently hardcoded and is exposed to the
+# world, where "world" in this case means inside the rump shmif
+# IP network, i.e. not a very big world. Probably needs some
+# adjustments if we want to test NFS features more carefully,
+# but this is enough for the current VFS level tests.
+#
+/myexport -noresvport -noresvmnt -maproot=0:0 10.3.2.2
+/myexport -ro -noresvport -noresvmnt -maproot=0:0 10.4.2.2
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/getmntinfo.c b/contrib/netbsd-tests/fs/nfs/nfsservice/getmntinfo.c
new file mode 100644
index 0000000..0c0587a
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/getmntinfo.c
@@ -0,0 +1,85 @@
+/* $NetBSD: getmntinfo.c,v 1.1 2010/07/26 15:53:00 pooka Exp $ */
+
+/*
+ * 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. 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.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+static char sccsid[] = "@(#)getmntinfo.c 8.1 (Berkeley) 6/4/93";
+#else
+__RCSID("$NetBSD: getmntinfo.c,v 1.1 2010/07/26 15:53:00 pooka Exp $");
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/param.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#define getvfsstat(a,b,c) rump_sys_getvfsstat(a,b,c)
+
+/*
+ * Return information about mounted filesystems.
+ */
+int
+getmntinfo(mntbufp, flags)
+ struct statvfs **mntbufp;
+ int flags;
+{
+ static struct statvfs *mntbuf;
+ static int mntsize;
+ static size_t bufsize;
+
+ _DIAGASSERT(mntbufp != NULL);
+
+ if (mntsize <= 0 &&
+ (mntsize = getvfsstat(NULL, (size_t)0, MNT_NOWAIT)) == -1)
+ return (0);
+ if (bufsize > 0 &&
+ (mntsize = getvfsstat(mntbuf, bufsize, flags)) == -1)
+ return (0);
+ while (bufsize <= mntsize * sizeof(struct statvfs)) {
+ if (mntbuf)
+ free(mntbuf);
+ bufsize = (mntsize + 1) * sizeof(struct statvfs);
+ if ((mntbuf = malloc(bufsize)) == NULL)
+ return (0);
+ if ((mntsize = getvfsstat(mntbuf, bufsize, flags)) == -1)
+ return (0);
+ }
+ *mntbufp = mntbuf;
+ return (mntsize);
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c b/contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c
new file mode 100644
index 0000000..b3625f6
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c
@@ -0,0 +1,2575 @@
+/* $NetBSD: mountd.c,v 1.8 2013/10/19 17:45:00 christos Exp $ */
+
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Herb Hasler and Rick Macklem at The University of Guelph.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 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.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__COPYRIGHT("@(#) Copyright (c) 1989, 1993\
+ The Regents of the University of California. All rights reserved.");
+#endif /* not lint */
+
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
+#else
+__RCSID("$NetBSD: mountd.c,v 1.8 2013/10/19 17:45:00 christos Exp $");
+#endif
+#endif /* not lint */
+
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <syslog.h>
+#include <sys/ucred.h>
+
+#include <rpc/rpc.h>
+#include <rpc/pmap_clnt.h>
+#include <rpc/pmap_prot.h>
+#include <rpcsvc/mount.h>
+#include <nfs/rpcv2.h>
+#include <nfs/nfsproto.h>
+#include <nfs/nfs.h>
+#include <nfs/nfsmount.h>
+
+#include <arpa/inet.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <grp.h>
+#include <netdb.h>
+#include <pwd.h>
+#include <netgroup.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <err.h>
+#include <util.h>
+#include "pathnames.h"
+
+#ifdef IPSEC
+#include <netinet6/ipsec.h>
+#ifndef IPSEC_POLICY_IPSEC /* no ipsec support on old ipsec */
+#undef IPSEC
+#endif
+#include "ipsec.h"
+#endif
+
+#include "svc_fdset.h"
+
+#include <stdarg.h>
+
+/*
+ * Structures for keeping the mount list and export list
+ */
+struct mountlist {
+ struct mountlist *ml_next;
+ char ml_host[RPCMNT_NAMELEN + 1];
+ char ml_dirp[RPCMNT_PATHLEN + 1];
+ int ml_flag;/* XXX more flags (same as dp_flag) */
+};
+
+struct dirlist {
+ struct dirlist *dp_left;
+ struct dirlist *dp_right;
+ int dp_flag;
+ struct hostlist *dp_hosts; /* List of hosts this dir exported to */
+ char dp_dirp[1]; /* Actually malloc'd to size of dir */
+};
+/* dp_flag bits */
+#define DP_DEFSET 0x1
+#define DP_HOSTSET 0x2
+#define DP_KERB 0x4
+#define DP_NORESMNT 0x8
+
+struct exportlist {
+ struct exportlist *ex_next;
+ struct dirlist *ex_dirl;
+ struct dirlist *ex_defdir;
+ int ex_flag;
+ fsid_t ex_fs;
+ char *ex_fsdir;
+ char *ex_indexfile;
+};
+/* ex_flag bits */
+#define EX_LINKED 0x1
+
+struct netmsk {
+ struct sockaddr_storage nt_net;
+ int nt_len;
+ char *nt_name;
+};
+
+union grouptypes {
+ struct addrinfo *gt_addrinfo;
+ struct netmsk gt_net;
+};
+
+struct grouplist {
+ int gr_type;
+ union grouptypes gr_ptr;
+ struct grouplist *gr_next;
+};
+/* Group types */
+#define GT_NULL 0x0
+#define GT_HOST 0x1
+#define GT_NET 0x2
+
+struct hostlist {
+ int ht_flag;/* Uses DP_xx bits */
+ struct grouplist *ht_grp;
+ struct hostlist *ht_next;
+};
+
+struct fhreturn {
+ int fhr_flag;
+ int fhr_vers;
+ size_t fhr_fhsize;
+ union {
+ uint8_t v2[NFSX_V2FH];
+ uint8_t v3[NFSX_V3FHMAX];
+ } fhr_fh;
+};
+
+/* Global defs */
+static char *add_expdir __P((struct dirlist **, char *, int));
+static void add_dlist __P((struct dirlist **, struct dirlist *,
+ struct grouplist *, int));
+static void add_mlist __P((char *, char *, int));
+static int check_dirpath __P((const char *, size_t, char *));
+static int check_options __P((const char *, size_t, struct dirlist *));
+static int chk_host __P((struct dirlist *, struct sockaddr *, int *, int *));
+static int del_mlist __P((char *, char *, struct sockaddr *));
+static struct dirlist *dirp_search __P((struct dirlist *, char *));
+static int do_nfssvc __P((const char *, size_t, struct exportlist *,
+ struct grouplist *, int, struct uucred *, char *, int, struct statvfs *));
+static int do_opt __P((const char *, size_t, char **, char **,
+ struct exportlist *, struct grouplist *, int *, int *, struct uucred *));
+static struct exportlist *ex_search __P((fsid_t *));
+static int parse_directory __P((const char *, size_t, struct grouplist *,
+ int, char *, struct exportlist **, struct statvfs *));
+static int parse_host_netgroup __P((const char *, size_t, struct exportlist *,
+ struct grouplist *, char *, int *, struct grouplist **));
+static struct exportlist *get_exp __P((void));
+static void free_dir __P((struct dirlist *));
+static void free_exp __P((struct exportlist *));
+static void free_grp __P((struct grouplist *));
+static void free_host __P((struct hostlist *));
+void get_exportlist __P((int));
+static int get_host __P((const char *, size_t, const char *,
+ struct grouplist *));
+static struct hostlist *get_ht __P((void));
+static void get_mountlist __P((void));
+static int get_net __P((char *, struct netmsk *, int));
+static void free_exp_grp __P((struct exportlist *, struct grouplist *));
+static struct grouplist *get_grp __P((void));
+static void hang_dirp __P((struct dirlist *, struct grouplist *,
+ struct exportlist *, int));
+static void mntsrv __P((struct svc_req *, SVCXPRT *));
+static void nextfield __P((char **, char **));
+static void parsecred __P((char *, struct uucred *));
+static int put_exlist __P((struct dirlist *, XDR *, struct dirlist *, int *));
+static int scan_tree __P((struct dirlist *, struct sockaddr *));
+static void send_umntall __P((int));
+#if 0
+static int umntall_each __P((caddr_t, struct sockaddr_in *));
+#endif
+static int xdr_dir __P((XDR *, char *));
+static int xdr_explist __P((XDR *, caddr_t));
+static int xdr_fhs __P((XDR *, caddr_t));
+static int xdr_mlist __P((XDR *, caddr_t));
+static int bitcmp __P((void *, void *, int));
+static int netpartcmp __P((struct sockaddr *, struct sockaddr *, int));
+static int sacmp __P((struct sockaddr *, struct sockaddr *));
+static int allones __P((struct sockaddr_storage *, int));
+static int countones __P((struct sockaddr *));
+static void bind_resv_port __P((int, sa_family_t, in_port_t));
+static void no_nfs(int);
+static struct exportlist *exphead;
+static struct mountlist *mlhead;
+static struct grouplist *grphead;
+static char *exname;
+static struct uucred def_anon = {
+ 1,
+ (uid_t) -2,
+ (gid_t) -2,
+ 0,
+ { 0 }
+};
+
+static int opt_flags;
+static int have_v6 = 1;
+static const int ninumeric = NI_NUMERICHOST;
+
+/* Bits for above */
+#define OP_MAPROOT 0x001
+#define OP_MAPALL 0x002
+#define OP_KERB 0x004
+#define OP_MASK 0x008
+#define OP_NET 0x010
+#define OP_ALLDIRS 0x040
+#define OP_NORESPORT 0x080
+#define OP_NORESMNT 0x100
+#define OP_MASKLEN 0x200
+
+static int debug = 1;
+#if 0
+static void SYSLOG __P((int, const char *,...));
+#endif
+int main __P((int, char *[]));
+
+/*
+ * If this is non-zero, -noresvport and -noresvmnt are implied for
+ * each export.
+ */
+static int noprivports;
+
+#define C2FD(_c_) ((int)(uintptr_t)(_c_))
+static int
+rumpread(void *cookie, char *buf, int count)
+{
+
+ return rump_sys_read(C2FD(cookie), buf, count);
+}
+
+static int
+rumpwrite(void *cookie, const char *buf, int count)
+{
+
+ return rump_sys_write(C2FD(cookie), buf, count);
+}
+
+static off_t
+rumpseek(void *cookie, off_t off, int whence)
+{
+
+ return rump_sys_lseek(C2FD(cookie), off, whence);
+}
+
+static int
+rumpclose(void *cookie)
+{
+
+ return rump_sys_close(C2FD(cookie));
+}
+
+int __sflags(const char *, int *); /* XXX */
+static FILE *
+rumpfopen(const char *path, const char *opts)
+{
+ int fd, oflags;
+
+ __sflags(opts, &oflags);
+ fd = rump_sys_open(path, oflags, 0777);
+ if (fd == -1)
+ return NULL;
+
+ return funopen((void *)(uintptr_t)fd,
+ rumpread, rumpwrite, rumpseek, rumpclose);
+}
+
+/*
+ * Make sure mountd signal handler is executed from a thread context
+ * instead of the signal handler. This avoids the signal handler
+ * ruining our kernel context.
+ */
+static sem_t exportsem;
+static void
+signal_get_exportlist(int sig)
+{
+
+ sem_post(&exportsem);
+}
+
+static void *
+exportlist_thread(void *arg)
+{
+
+ for (;;) {
+ sem_wait(&exportsem);
+ get_exportlist(0);
+ }
+
+ return NULL;
+}
+
+/*
+ * Mountd server for NFS mount protocol as described in:
+ * NFS: Network File System Protocol Specification, RFC1094, Appendix A
+ * The optional arguments are the exports file name
+ * default: _PATH_EXPORTS
+ * "-d" to enable debugging
+ * and "-n" to allow nonroot mount.
+ */
+void *mountd_main(void *);
+void *
+mountd_main(void *arg)
+{
+ SVCXPRT *udptransp, *tcptransp;
+ struct netconfig *udpconf, *tcpconf;
+ int udpsock, tcpsock;
+ int xcreated = 0;
+ int maxrec = RPC_MAXDATASIZE;
+ in_port_t forcedport = 0;
+ extern sem_t gensem;
+ pthread_t ptdummy;
+
+ alloc_fdset();
+
+#if 0
+ while ((c = getopt(argc, argv, "dNnrp:" ADDOPTS)) != -1)
+ switch (c) {
+#ifdef IPSEC
+ case 'P':
+ if (ipsecsetup_test(policy = optarg))
+ errx(1, "Invalid ipsec policy `%s'", policy);
+ break;
+#endif
+ case 'p':
+ /* A forced port "0" will dynamically allocate a port */
+ forcedport = atoi(optarg);
+ break;
+ case 'd':
+ debug = 1;
+ break;
+ case 'N':
+ noprivports = 1;
+ break;
+ /* Compatibility */
+ case 'n':
+ case 'r':
+ break;
+ default:
+ fprintf(stderr, "usage: %s [-dNn]"
+#ifdef IPSEC
+ " [-P policy]"
+#endif
+ " [-p port] [exportsfile]\n", getprogname());
+ exit(1);
+ };
+ argc -= optind;
+ argv += optind;
+#endif
+
+ sem_init(&exportsem, 0, 0);
+ pthread_create(&ptdummy, NULL, exportlist_thread, NULL);
+
+ grphead = NULL;
+ exphead = NULL;
+ mlhead = NULL;
+ exname = _PATH_EXPORTS;
+ openlog("mountd", LOG_PID | (debug ? LOG_PERROR : 0), LOG_DAEMON);
+ (void)signal(SIGSYS, no_nfs);
+
+ if (debug)
+ (void)fprintf(stderr, "Getting export list.\n");
+ get_exportlist(0);
+ if (debug)
+ (void)fprintf(stderr, "Getting mount list.\n");
+ get_mountlist();
+ if (debug)
+ (void)fprintf(stderr, "Here we go.\n");
+ if (debug == 0) {
+ daemon(0, 0);
+ (void)signal(SIGINT, SIG_IGN);
+ (void)signal(SIGQUIT, SIG_IGN);
+ }
+ (void)signal(SIGHUP, signal_get_exportlist);
+ (void)signal(SIGTERM, send_umntall);
+ pidfile(NULL);
+
+ rpcb_unset(RPCPROG_MNT, RPCMNT_VER1, NULL);
+ rpcb_unset(RPCPROG_MNT, RPCMNT_VER3, NULL);
+
+ udpsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ tcpsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+
+ udpconf = getnetconfigent("udp");
+ tcpconf = getnetconfigent("tcp");
+
+ rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec);
+
+ if (udpsock != -1 && udpconf != NULL) {
+ bind_resv_port(udpsock, AF_INET, forcedport);
+#ifdef IPSEC
+ if (policy)
+ ipsecsetup(AF_INET, udpsock, policy);
+#endif
+ udptransp = svc_dg_create(udpsock, 0, 0);
+ if (udptransp != NULL) {
+ if (!svc_reg(udptransp, RPCPROG_MNT, RPCMNT_VER1,
+ mntsrv, udpconf) ||
+ !svc_reg(udptransp, RPCPROG_MNT, RPCMNT_VER3,
+ mntsrv, udpconf)) {
+ syslog(LOG_WARNING, "can't register UDP service");
+ }
+ else {
+ xcreated++;
+ }
+ } else {
+ syslog(LOG_WARNING, "can't create UDP service");
+ }
+
+ }
+
+ if (tcpsock != -1 && tcpconf != NULL) {
+ bind_resv_port(tcpsock, AF_INET, forcedport);
+#ifdef IPSEC
+ if (policy)
+ ipsecsetup(AF_INET, tcpsock, policy);
+#endif
+ listen(tcpsock, SOMAXCONN);
+ tcptransp = svc_vc_create(tcpsock, RPC_MAXDATASIZE,
+ RPC_MAXDATASIZE);
+ if (tcptransp != NULL) {
+ if (!svc_reg(tcptransp, RPCPROG_MNT, RPCMNT_VER1,
+ mntsrv, tcpconf) ||
+ !svc_reg(tcptransp, RPCPROG_MNT, RPCMNT_VER3,
+ mntsrv, tcpconf))
+ syslog(LOG_WARNING, "can't register TCP service");
+ else
+ xcreated++;
+ } else
+ syslog(LOG_WARNING, "can't create TCP service");
+
+ }
+
+ if (xcreated == 0) {
+ syslog(LOG_ERR, "could not create any services");
+ exit(1);
+ }
+
+ sem_post(&gensem);
+ svc_run();
+ syslog(LOG_ERR, "Mountd died");
+ exit(1);
+}
+
+/*
+ * The mount rpc service
+ */
+void
+mntsrv(rqstp, transp)
+ struct svc_req *rqstp;
+ SVCXPRT *transp;
+{
+ struct exportlist *ep;
+ struct dirlist *dp;
+ struct fhreturn fhr;
+ struct stat stb;
+ struct statvfs fsb;
+ char host[NI_MAXHOST], numerichost[NI_MAXHOST];
+ int lookup_failed = 1;
+ struct sockaddr *saddr;
+ u_short sport;
+ char rpcpath[RPCMNT_PATHLEN + 1], dpath[MAXPATHLEN];
+ long bad = EACCES;
+ int defset, hostset, ret;
+ sigset_t sighup_mask;
+ struct sockaddr_in6 *sin6;
+ struct sockaddr_in *sin;
+ size_t fh_size;
+ int error = 0;
+
+ (void)sigemptyset(&sighup_mask);
+ (void)sigaddset(&sighup_mask, SIGHUP);
+ saddr = svc_getrpccaller(transp)->buf;
+ switch (saddr->sa_family) {
+ case AF_INET6:
+ sin6 = (struct sockaddr_in6 *)saddr;
+ sport = ntohs(sin6->sin6_port);
+ break;
+ case AF_INET:
+ sin = (struct sockaddr_in *)saddr;
+ sport = ntohs(sin->sin_port);
+ break;
+ default:
+ syslog(LOG_ERR, "request from unknown address family");
+ return;
+ }
+ lookup_failed = getnameinfo(saddr, saddr->sa_len, host, sizeof host,
+ NULL, 0, 0);
+ if (getnameinfo(saddr, saddr->sa_len, numerichost,
+ sizeof numerichost, NULL, 0, ninumeric) != 0)
+ strlcpy(numerichost, "?", sizeof(numerichost));
+ ret = 0;
+ switch (rqstp->rq_proc) {
+ case NULLPROC:
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
+ syslog(LOG_ERR, "Can't send reply");
+ return;
+ case MOUNTPROC_MNT:
+ if (debug)
+ fprintf(stderr,
+ "got mount request from %s\n", numerichost);
+ if (!svc_getargs(transp, xdr_dir, rpcpath)) {
+ if (debug)
+ fprintf(stderr, "-> garbage args\n");
+ svcerr_decode(transp);
+ return;
+ }
+ if (debug)
+ fprintf(stderr,
+ "-> rpcpath: %s\n", rpcpath);
+ /*
+ * Get the real pathname and make sure it is a file or
+ * directory that exists.
+ */
+#if 0
+ if (realpath(rpcpath, dpath) == 0 ||
+#endif
+ strcpy(dpath, rpcpath);
+ if (rump_sys_stat(dpath, &stb) < 0 ||
+ (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) ||
+ rump_sys_statvfs1(dpath, &fsb, ST_WAIT) < 0) {
+ (void)chdir("/"); /* Just in case realpath doesn't */
+ if (debug)
+ (void)fprintf(stderr, "-> stat failed on %s\n",
+ dpath);
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_long, (caddr_t) &bad))
+ syslog(LOG_ERR, "Can't send reply");
+ return;
+ }
+ if (debug)
+ fprintf(stderr,
+ "-> dpath: %s\n", dpath);
+ /* Check in the exports list */
+ (void)sigprocmask(SIG_BLOCK, &sighup_mask, NULL);
+ ep = ex_search(&fsb.f_fsidx);
+ hostset = defset = 0;
+ if (ep && (chk_host(ep->ex_defdir, saddr, &defset,
+ &hostset) || ((dp = dirp_search(ep->ex_dirl, dpath)) &&
+ chk_host(dp, saddr, &defset, &hostset)) ||
+ (defset && scan_tree(ep->ex_defdir, saddr) == 0 &&
+ scan_tree(ep->ex_dirl, saddr) == 0))) {
+ if ((hostset & DP_HOSTSET) == 0) {
+ hostset = defset;
+ }
+ if (sport >= IPPORT_RESERVED &&
+ !(hostset & DP_NORESMNT)) {
+ syslog(LOG_NOTICE,
+ "Refused mount RPC from host %s port %d",
+ numerichost, sport);
+ svcerr_weakauth(transp);
+ goto out;
+ }
+ fhr.fhr_flag = hostset;
+ fhr.fhr_vers = rqstp->rq_vers;
+ /* Get the file handle */
+ memset(&fhr.fhr_fh, 0, sizeof(fhr.fhr_fh)); /* for v2 */
+ fh_size = sizeof(fhr.fhr_fh);
+ error = 0;
+ if (rump_sys_getfh(dpath, &fhr.fhr_fh, &fh_size) < 0) {
+ bad = error;
+ //syslog(LOG_ERR, "Can't get fh for %s %d %d", dpath, error, fh_size);
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_long,
+ (char *)&bad))
+ syslog(LOG_ERR, "Can't send reply");
+ goto out;
+ }
+ if ((fhr.fhr_vers == 1 && fh_size > NFSX_V2FH) ||
+ fh_size > NFSX_V3FHMAX) {
+ bad = EINVAL; /* XXX */
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_long,
+ (char *)&bad))
+ syslog(LOG_ERR, "Can't send reply");
+ goto out;
+ }
+ fhr.fhr_fhsize = fh_size;
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_fhs, (char *) &fhr))
+ syslog(LOG_ERR, "Can't send reply");
+ if (!lookup_failed)
+ add_mlist(host, dpath, hostset);
+ else
+ add_mlist(numerichost, dpath, hostset);
+ if (debug)
+ (void)fprintf(stderr, "Mount successful.\n");
+ } else {
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_long, (caddr_t) &bad))
+ syslog(LOG_ERR, "Can't send reply");
+ }
+out:
+ (void)sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL);
+ return;
+ case MOUNTPROC_DUMP:
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_mlist, NULL))
+ syslog(LOG_ERR, "Can't send reply");
+ return;
+ case MOUNTPROC_UMNT:
+ if (!svc_getargs(transp, xdr_dir, dpath)) {
+ svcerr_decode(transp);
+ return;
+ }
+ if (!lookup_failed)
+ ret = del_mlist(host, dpath, saddr);
+ ret |= del_mlist(numerichost, dpath, saddr);
+ if (ret) {
+ svcerr_weakauth(transp);
+ return;
+ }
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
+ syslog(LOG_ERR, "Can't send reply");
+ return;
+ case MOUNTPROC_UMNTALL:
+ if (!lookup_failed)
+ ret = del_mlist(host, NULL, saddr);
+ ret |= del_mlist(numerichost, NULL, saddr);
+ if (ret) {
+ svcerr_weakauth(transp);
+ return;
+ }
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
+ syslog(LOG_ERR, "Can't send reply");
+ return;
+ case MOUNTPROC_EXPORT:
+ case MOUNTPROC_EXPORTALL:
+ if (!svc_sendreply(transp, (xdrproc_t)xdr_explist, NULL))
+ syslog(LOG_ERR, "Can't send reply");
+ return;
+
+
+ default:
+ svcerr_noproc(transp);
+ return;
+ }
+}
+
+/*
+ * Xdr conversion for a dpath string
+ */
+static int
+xdr_dir(xdrsp, dirp)
+ XDR *xdrsp;
+ char *dirp;
+{
+
+ return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN));
+}
+
+/*
+ * Xdr routine to generate file handle reply
+ */
+static int
+xdr_fhs(xdrsp, cp)
+ XDR *xdrsp;
+ caddr_t cp;
+{
+ struct fhreturn *fhrp = (struct fhreturn *) cp;
+ long ok = 0, len, auth;
+
+ if (!xdr_long(xdrsp, &ok))
+ return (0);
+ switch (fhrp->fhr_vers) {
+ case 1:
+ return (xdr_opaque(xdrsp, (caddr_t)&fhrp->fhr_fh, NFSX_V2FH));
+ case 3:
+ len = fhrp->fhr_fhsize;
+ if (!xdr_long(xdrsp, &len))
+ return (0);
+ if (!xdr_opaque(xdrsp, (caddr_t)&fhrp->fhr_fh, len))
+ return (0);
+ if (fhrp->fhr_flag & DP_KERB)
+ auth = RPCAUTH_KERB4;
+ else
+ auth = RPCAUTH_UNIX;
+ len = 1;
+ if (!xdr_long(xdrsp, &len))
+ return (0);
+ return (xdr_long(xdrsp, &auth));
+ };
+ return (0);
+}
+
+int
+xdr_mlist(xdrsp, cp)
+ XDR *xdrsp;
+ caddr_t cp;
+{
+ struct mountlist *mlp;
+ int trueval = 1;
+ int falseval = 0;
+ char *strp;
+
+ mlp = mlhead;
+ while (mlp) {
+ if (!xdr_bool(xdrsp, &trueval))
+ return (0);
+ strp = &mlp->ml_host[0];
+ if (!xdr_string(xdrsp, &strp, RPCMNT_NAMELEN))
+ return (0);
+ strp = &mlp->ml_dirp[0];
+ if (!xdr_string(xdrsp, &strp, RPCMNT_PATHLEN))
+ return (0);
+ mlp = mlp->ml_next;
+ }
+ if (!xdr_bool(xdrsp, &falseval))
+ return (0);
+ return (1);
+}
+
+/*
+ * Xdr conversion for export list
+ */
+int
+xdr_explist(xdrsp, cp)
+ XDR *xdrsp;
+ caddr_t cp;
+{
+ struct exportlist *ep;
+ int falseval = 0;
+ int putdef;
+ sigset_t sighup_mask;
+
+ (void)sigemptyset(&sighup_mask);
+ (void)sigaddset(&sighup_mask, SIGHUP);
+ (void)sigprocmask(SIG_BLOCK, &sighup_mask, NULL);
+ ep = exphead;
+ while (ep) {
+ putdef = 0;
+ if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, &putdef))
+ goto errout;
+ if (ep->ex_defdir && putdef == 0 &&
+ put_exlist(ep->ex_defdir, xdrsp, NULL, &putdef))
+ goto errout;
+ ep = ep->ex_next;
+ }
+ (void)sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL);
+ if (!xdr_bool(xdrsp, &falseval))
+ return (0);
+ return (1);
+errout:
+ (void)sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL);
+ return (0);
+}
+
+/*
+ * Called from xdr_explist() to traverse the tree and export the
+ * directory paths. Assumes SIGHUP has already been masked.
+ */
+int
+put_exlist(dp, xdrsp, adp, putdefp)
+ struct dirlist *dp;
+ XDR *xdrsp;
+ struct dirlist *adp;
+ int *putdefp;
+{
+ struct grouplist *grp;
+ struct hostlist *hp;
+ int trueval = 1;
+ int falseval = 0;
+ int gotalldir = 0;
+ char *strp;
+
+ if (dp) {
+ if (put_exlist(dp->dp_left, xdrsp, adp, putdefp))
+ return (1);
+ if (!xdr_bool(xdrsp, &trueval))
+ return (1);
+ strp = dp->dp_dirp;
+ if (!xdr_string(xdrsp, &strp, RPCMNT_PATHLEN))
+ return (1);
+ if (adp && !strcmp(dp->dp_dirp, adp->dp_dirp)) {
+ gotalldir = 1;
+ *putdefp = 1;
+ }
+ if ((dp->dp_flag & DP_DEFSET) == 0 &&
+ (gotalldir == 0 || (adp->dp_flag & DP_DEFSET) == 0)) {
+ hp = dp->dp_hosts;
+ while (hp) {
+ grp = hp->ht_grp;
+ if (grp->gr_type == GT_HOST) {
+ if (!xdr_bool(xdrsp, &trueval))
+ return (1);
+ strp =
+ grp->gr_ptr.gt_addrinfo->ai_canonname;
+ if (!xdr_string(xdrsp, &strp,
+ RPCMNT_NAMELEN))
+ return (1);
+ } else if (grp->gr_type == GT_NET) {
+ if (!xdr_bool(xdrsp, &trueval))
+ return (1);
+ strp = grp->gr_ptr.gt_net.nt_name;
+ if (!xdr_string(xdrsp, &strp,
+ RPCMNT_NAMELEN))
+ return (1);
+ }
+ hp = hp->ht_next;
+ if (gotalldir && hp == NULL) {
+ hp = adp->dp_hosts;
+ gotalldir = 0;
+ }
+ }
+ }
+ if (!xdr_bool(xdrsp, &falseval))
+ return (1);
+ if (put_exlist(dp->dp_right, xdrsp, adp, putdefp))
+ return (1);
+ }
+ return (0);
+}
+
+static int
+parse_host_netgroup(line, lineno, ep, tgrp, cp, has_host, grp)
+ const char *line;
+ size_t lineno;
+ struct exportlist *ep;
+ struct grouplist *tgrp;
+ char *cp;
+ int *has_host;
+ struct grouplist **grp;
+{
+ const char *hst, *usr, *dom;
+ int netgrp;
+
+ if (ep == NULL) {
+ syslog(LOG_ERR, "\"%s\", line %ld: No current export",
+ line, (unsigned long)lineno);
+ return 0;
+ }
+ setnetgrent(cp);
+ netgrp = getnetgrent(&hst, &usr, &dom);
+ do {
+ if (*has_host) {
+ (*grp)->gr_next = get_grp();
+ *grp = (*grp)->gr_next;
+ }
+ if (netgrp) {
+ if (hst == NULL) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: No host in netgroup %s",
+ line, (unsigned long)lineno, cp);
+ goto bad;
+ }
+ if (get_host(line, lineno, hst, *grp))
+ goto bad;
+ } else if (get_host(line, lineno, cp, *grp))
+ goto bad;
+ *has_host = TRUE;
+ } while (netgrp && getnetgrent(&hst, &usr, &dom));
+
+ endnetgrent();
+ return 1;
+bad:
+ endnetgrent();
+ return 0;
+
+}
+
+static int
+parse_directory(line, lineno, tgrp, got_nondir, cp, ep, fsp)
+ const char *line;
+ size_t lineno;
+ struct grouplist *tgrp;
+ int got_nondir;
+ char *cp;
+ struct exportlist **ep;
+ struct statvfs *fsp;
+{
+ int error = 0;
+
+ if (!check_dirpath(line, lineno, cp))
+ return 0;
+
+ if (rump_sys_statvfs1(cp, fsp, ST_WAIT) == -1) {
+ syslog(LOG_ERR, "\"%s\", line %ld: statvfs for `%s' failed: %m %d",
+ line, (unsigned long)lineno, cp, error);
+ return 0;
+ }
+
+ if (got_nondir) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Directories must precede files",
+ line, (unsigned long)lineno);
+ return 0;
+ }
+ if (*ep) {
+ if ((*ep)->ex_fs.__fsid_val[0] != fsp->f_fsidx.__fsid_val[0] ||
+ (*ep)->ex_fs.__fsid_val[1] != fsp->f_fsidx.__fsid_val[1]) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: filesystem ids disagree",
+ line, (unsigned long)lineno);
+ return 0;
+ }
+ } else {
+ /*
+ * See if this directory is already
+ * in the list.
+ */
+ *ep = ex_search(&fsp->f_fsidx);
+ if (*ep == NULL) {
+ *ep = get_exp();
+ (*ep)->ex_fs = fsp->f_fsidx;
+ (*ep)->ex_fsdir = estrdup(fsp->f_mntonname);
+ if (debug)
+ (void)fprintf(stderr,
+ "Making new ep fs=0x%x,0x%x\n",
+ fsp->f_fsidx.__fsid_val[0], fsp->f_fsidx.__fsid_val[1]);
+ } else {
+ if (debug)
+ (void)fprintf(stderr,
+ "Found ep fs=0x%x,0x%x\n",
+ fsp->f_fsidx.__fsid_val[0], fsp->f_fsidx.__fsid_val[1]);
+ }
+ }
+
+ return 1;
+}
+
+
+/*
+ * Get the export list
+ */
+/* ARGSUSED */
+void
+get_exportlist(n)
+ int n;
+{
+ struct exportlist *ep, *ep2;
+ struct grouplist *grp, *tgrp;
+ struct exportlist **epp;
+ struct dirlist *dirhead;
+ struct statvfs fsb, *fsp;
+ struct addrinfo *ai;
+ struct uucred anon;
+ char *cp, *endcp, *dirp, savedc;
+ int has_host, exflags, got_nondir, dirplen, num, i;
+ FILE *exp_file;
+ char *line;
+ size_t lineno = 0, len;
+
+
+ /*
+ * First, get rid of the old list
+ */
+ ep = exphead;
+ while (ep) {
+ ep2 = ep;
+ ep = ep->ex_next;
+ free_exp(ep2);
+ }
+ exphead = NULL;
+
+ dirp = NULL;
+ dirplen = 0;
+ grp = grphead;
+ while (grp) {
+ tgrp = grp;
+ grp = grp->gr_next;
+ free_grp(tgrp);
+ }
+ grphead = NULL;
+
+ /*
+ * And delete exports that are in the kernel for all local
+ * file systems.
+ */
+ num = getmntinfo(&fsp, MNT_NOWAIT);
+ for (i = 0; i < num; i++) {
+ struct mountd_exports_list mel;
+
+ /* Delete all entries from the export list. */
+ mel.mel_path = fsp->f_mntonname;
+ mel.mel_nexports = 0;
+ if (rump_sys_nfssvc(NFSSVC_SETEXPORTSLIST, &mel) == -1 &&
+ errno != EOPNOTSUPP)
+ syslog(LOG_ERR, "Can't delete exports for %s (%m)",
+ fsp->f_mntonname);
+
+ fsp++;
+ }
+
+ /*
+ * Read in the exports file and build the list, calling
+ * mount() as we go along to push the export rules into the kernel.
+ */
+ exname = _PATH_EXPORTS;
+ if ((exp_file = rumpfopen(exname, "r")) == NULL) {
+ /*
+ * Don't exit here; we can still reload the config
+ * after a SIGHUP.
+ */
+ if (debug)
+ (void)fprintf(stderr, "Can't open %s: %s\n", exname,
+ strerror(errno));
+ return;
+ }
+ dirhead = NULL;
+ while ((line = fparseln(exp_file, &len, &lineno, NULL, 0)) != NULL) {
+ if (debug)
+ (void)fprintf(stderr, "Got line %s\n", line);
+ cp = line;
+ nextfield(&cp, &endcp);
+ if (cp == endcp)
+ goto nextline; /* skip empty line */
+ /*
+ * Set defaults.
+ */
+ has_host = FALSE;
+ anon = def_anon;
+ exflags = MNT_EXPORTED;
+ got_nondir = 0;
+ opt_flags = 0;
+ ep = NULL;
+
+ if (noprivports) {
+ opt_flags |= OP_NORESMNT | OP_NORESPORT;
+ exflags |= MNT_EXNORESPORT;
+ }
+
+ /*
+ * Create new exports list entry
+ */
+ len = endcp - cp;
+ tgrp = grp = get_grp();
+ while (len > 0) {
+ if (len > RPCMNT_NAMELEN) {
+ *endcp = '\0';
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: name `%s' is too long",
+ line, (unsigned long)lineno, cp);
+ goto badline;
+ }
+ switch (*cp) {
+ case '-':
+ /*
+ * Option
+ */
+ if (ep == NULL) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: No current export list",
+ line, (unsigned long)lineno);
+ goto badline;
+ }
+ if (debug)
+ (void)fprintf(stderr, "doing opt %s\n",
+ cp);
+ got_nondir = 1;
+ if (do_opt(line, lineno, &cp, &endcp, ep, grp,
+ &has_host, &exflags, &anon))
+ goto badline;
+ break;
+
+ case '/':
+ /*
+ * Directory
+ */
+ savedc = *endcp;
+ *endcp = '\0';
+
+ if (!parse_directory(line, lineno, tgrp,
+ got_nondir, cp, &ep, &fsb))
+ goto badline;
+ /*
+ * Add dirpath to export mount point.
+ */
+ dirp = add_expdir(&dirhead, cp, len);
+ dirplen = len;
+
+ *endcp = savedc;
+ break;
+
+ default:
+ /*
+ * Host or netgroup.
+ */
+ savedc = *endcp;
+ *endcp = '\0';
+
+ if (!parse_host_netgroup(line, lineno, ep,
+ tgrp, cp, &has_host, &grp))
+ goto badline;
+
+ got_nondir = 1;
+
+ *endcp = savedc;
+ break;
+ }
+
+ cp = endcp;
+ nextfield(&cp, &endcp);
+ len = endcp - cp;
+ }
+ if (check_options(line, lineno, dirhead))
+ goto badline;
+
+ if (!has_host) {
+ grp->gr_type = GT_HOST;
+ if (debug)
+ (void)fprintf(stderr,
+ "Adding a default entry\n");
+ /* add a default group and make the grp list NULL */
+ ai = emalloc(sizeof(struct addrinfo));
+ ai->ai_flags = 0;
+ ai->ai_family = AF_INET; /* XXXX */
+ ai->ai_socktype = SOCK_DGRAM;
+ /* setting the length to 0 will match anything */
+ ai->ai_addrlen = 0;
+ ai->ai_flags = AI_CANONNAME;
+ ai->ai_canonname = estrdup("Default");
+ ai->ai_addr = NULL;
+ ai->ai_next = NULL;
+ grp->gr_ptr.gt_addrinfo = ai;
+
+ } else if ((opt_flags & OP_NET) && tgrp->gr_next) {
+ /*
+ * Don't allow a network export coincide with a list of
+ * host(s) on the same line.
+ */
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Mixed exporting of networks and hosts is disallowed",
+ line, (unsigned long)lineno);
+ goto badline;
+ }
+ /*
+ * Loop through hosts, pushing the exports into the kernel.
+ * After loop, tgrp points to the start of the list and
+ * grp points to the last entry in the list.
+ */
+ grp = tgrp;
+ do {
+ if (do_nfssvc(line, lineno, ep, grp, exflags, &anon,
+ dirp, dirplen, &fsb))
+ goto badline;
+ } while (grp->gr_next && (grp = grp->gr_next));
+
+ /*
+ * Success. Update the data structures.
+ */
+ if (has_host) {
+ hang_dirp(dirhead, tgrp, ep, opt_flags);
+ grp->gr_next = grphead;
+ grphead = tgrp;
+ } else {
+ hang_dirp(dirhead, NULL, ep, opt_flags);
+ free_grp(tgrp);
+ }
+ tgrp = NULL;
+ dirhead = NULL;
+ if ((ep->ex_flag & EX_LINKED) == 0) {
+ ep2 = exphead;
+ epp = &exphead;
+
+ /*
+ * Insert in the list in alphabetical order.
+ */
+ while (ep2 && strcmp(ep2->ex_fsdir, ep->ex_fsdir) < 0) {
+ epp = &ep2->ex_next;
+ ep2 = ep2->ex_next;
+ }
+ if (ep2)
+ ep->ex_next = ep2;
+ *epp = ep;
+ ep->ex_flag |= EX_LINKED;
+ }
+ goto nextline;
+badline:
+ free_exp_grp(ep, grp);
+nextline:
+ if (dirhead) {
+ free_dir(dirhead);
+ dirhead = NULL;
+ }
+ free(line);
+ }
+ (void)fclose(exp_file);
+}
+
+/*
+ * Allocate an export list element
+ */
+static struct exportlist *
+get_exp()
+{
+ struct exportlist *ep;
+
+ ep = emalloc(sizeof(struct exportlist));
+ (void)memset(ep, 0, sizeof(struct exportlist));
+ return (ep);
+}
+
+/*
+ * Allocate a group list element
+ */
+static struct grouplist *
+get_grp()
+{
+ struct grouplist *gp;
+
+ gp = emalloc(sizeof(struct grouplist));
+ (void)memset(gp, 0, sizeof(struct grouplist));
+ return (gp);
+}
+
+/*
+ * Clean up upon an error in get_exportlist().
+ */
+static void
+free_exp_grp(ep, grp)
+ struct exportlist *ep;
+ struct grouplist *grp;
+{
+ struct grouplist *tgrp;
+
+ if (ep && (ep->ex_flag & EX_LINKED) == 0)
+ free_exp(ep);
+ while (grp) {
+ tgrp = grp;
+ grp = grp->gr_next;
+ free_grp(tgrp);
+ }
+}
+
+/*
+ * Search the export list for a matching fs.
+ */
+static struct exportlist *
+ex_search(fsid)
+ fsid_t *fsid;
+{
+ struct exportlist *ep;
+
+ ep = exphead;
+ return ep;
+ while (ep) {
+ if (ep->ex_fs.__fsid_val[0] == fsid->__fsid_val[0] &&
+ ep->ex_fs.__fsid_val[1] == fsid->__fsid_val[1])
+ return (ep);
+ ep = ep->ex_next;
+ }
+ return (ep);
+}
+
+/*
+ * Add a directory path to the list.
+ */
+static char *
+add_expdir(dpp, cp, len)
+ struct dirlist **dpp;
+ char *cp;
+ int len;
+{
+ struct dirlist *dp;
+
+ dp = emalloc(sizeof(struct dirlist) + len);
+ dp->dp_left = *dpp;
+ dp->dp_right = NULL;
+ dp->dp_flag = 0;
+ dp->dp_hosts = NULL;
+ (void)strcpy(dp->dp_dirp, cp);
+ *dpp = dp;
+ return (dp->dp_dirp);
+}
+
+/*
+ * Hang the dir list element off the dirpath binary tree as required
+ * and update the entry for host.
+ */
+void
+hang_dirp(dp, grp, ep, flags)
+ struct dirlist *dp;
+ struct grouplist *grp;
+ struct exportlist *ep;
+ int flags;
+{
+ struct hostlist *hp;
+ struct dirlist *dp2;
+
+ if (flags & OP_ALLDIRS) {
+ if (ep->ex_defdir)
+ free(dp);
+ else
+ ep->ex_defdir = dp;
+ if (grp == NULL) {
+ ep->ex_defdir->dp_flag |= DP_DEFSET;
+ if (flags & OP_KERB)
+ ep->ex_defdir->dp_flag |= DP_KERB;
+ if (flags & OP_NORESMNT)
+ ep->ex_defdir->dp_flag |= DP_NORESMNT;
+ } else
+ while (grp) {
+ hp = get_ht();
+ if (flags & OP_KERB)
+ hp->ht_flag |= DP_KERB;
+ if (flags & OP_NORESMNT)
+ hp->ht_flag |= DP_NORESMNT;
+ hp->ht_grp = grp;
+ hp->ht_next = ep->ex_defdir->dp_hosts;
+ ep->ex_defdir->dp_hosts = hp;
+ grp = grp->gr_next;
+ }
+ } else {
+
+ /*
+ * Loop through the directories adding them to the tree.
+ */
+ while (dp) {
+ dp2 = dp->dp_left;
+ add_dlist(&ep->ex_dirl, dp, grp, flags);
+ dp = dp2;
+ }
+ }
+}
+
+/*
+ * Traverse the binary tree either updating a node that is already there
+ * for the new directory or adding the new node.
+ */
+static void
+add_dlist(dpp, newdp, grp, flags)
+ struct dirlist **dpp;
+ struct dirlist *newdp;
+ struct grouplist *grp;
+ int flags;
+{
+ struct dirlist *dp;
+ struct hostlist *hp;
+ int cmp;
+
+ dp = *dpp;
+ if (dp) {
+ cmp = strcmp(dp->dp_dirp, newdp->dp_dirp);
+ if (cmp > 0) {
+ add_dlist(&dp->dp_left, newdp, grp, flags);
+ return;
+ } else if (cmp < 0) {
+ add_dlist(&dp->dp_right, newdp, grp, flags);
+ return;
+ } else
+ free(newdp);
+ } else {
+ dp = newdp;
+ dp->dp_left = NULL;
+ *dpp = dp;
+ }
+ if (grp) {
+
+ /*
+ * Hang all of the host(s) off of the directory point.
+ */
+ do {
+ hp = get_ht();
+ if (flags & OP_KERB)
+ hp->ht_flag |= DP_KERB;
+ if (flags & OP_NORESMNT)
+ hp->ht_flag |= DP_NORESMNT;
+ hp->ht_grp = grp;
+ hp->ht_next = dp->dp_hosts;
+ dp->dp_hosts = hp;
+ grp = grp->gr_next;
+ } while (grp);
+ } else {
+ dp->dp_flag |= DP_DEFSET;
+ if (flags & OP_KERB)
+ dp->dp_flag |= DP_KERB;
+ if (flags & OP_NORESMNT)
+ dp->dp_flag |= DP_NORESMNT;
+ }
+}
+
+/*
+ * Search for a dirpath on the export point.
+ */
+static struct dirlist *
+dirp_search(dp, dirp)
+ struct dirlist *dp;
+ char *dirp;
+{
+ int cmp;
+
+ if (dp) {
+ cmp = strcmp(dp->dp_dirp, dirp);
+ if (cmp > 0)
+ return (dirp_search(dp->dp_left, dirp));
+ else if (cmp < 0)
+ return (dirp_search(dp->dp_right, dirp));
+ else
+ return (dp);
+ }
+ return (dp);
+}
+
+/*
+ * Some helper functions for netmasks. They all assume masks in network
+ * order (big endian).
+ */
+static int
+bitcmp(void *dst, void *src, int bitlen)
+{
+ int i;
+ u_int8_t *p1 = dst, *p2 = src;
+ u_int8_t bitmask;
+ int bytelen, bitsleft;
+
+ bytelen = bitlen / 8;
+ bitsleft = bitlen % 8;
+
+ if (debug) {
+ printf("comparing:\n");
+ for (i = 0; i < (bitsleft ? bytelen + 1 : bytelen); i++)
+ printf("%02x", p1[i]);
+ printf("\n");
+ for (i = 0; i < (bitsleft ? bytelen + 1 : bytelen); i++)
+ printf("%02x", p2[i]);
+ printf("\n");
+ }
+
+ for (i = 0; i < bytelen; i++) {
+ if (*p1 != *p2)
+ return 1;
+ p1++;
+ p2++;
+ }
+
+ for (i = 0; i < bitsleft; i++) {
+ bitmask = 1 << (7 - i);
+ if ((*p1 & bitmask) != (*p2 & bitmask))
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+netpartcmp(struct sockaddr *s1, struct sockaddr *s2, int bitlen)
+{
+ void *src, *dst;
+
+ if (s1->sa_family != s2->sa_family)
+ return 1;
+
+ switch (s1->sa_family) {
+ case AF_INET:
+ src = &((struct sockaddr_in *)s1)->sin_addr;
+ dst = &((struct sockaddr_in *)s2)->sin_addr;
+ if (bitlen > sizeof(((struct sockaddr_in *)s1)->sin_addr) * 8)
+ return 1;
+ break;
+ case AF_INET6:
+ src = &((struct sockaddr_in6 *)s1)->sin6_addr;
+ dst = &((struct sockaddr_in6 *)s2)->sin6_addr;
+ if (((struct sockaddr_in6 *)s1)->sin6_scope_id !=
+ ((struct sockaddr_in6 *)s2)->sin6_scope_id)
+ return 1;
+ if (bitlen > sizeof(((struct sockaddr_in6 *)s1)->sin6_addr) * 8)
+ return 1;
+ break;
+ default:
+ return 1;
+ }
+
+ return bitcmp(src, dst, bitlen);
+}
+
+static int
+allones(struct sockaddr_storage *ssp, int bitlen)
+{
+ u_int8_t *p;
+ int bytelen, bitsleft, i;
+ int zerolen;
+
+ switch (ssp->ss_family) {
+ case AF_INET:
+ p = (u_int8_t *)&((struct sockaddr_in *)ssp)->sin_addr;
+ zerolen = sizeof (((struct sockaddr_in *)ssp)->sin_addr);
+ break;
+ case AF_INET6:
+ p = (u_int8_t *)&((struct sockaddr_in6 *)ssp)->sin6_addr;
+ zerolen = sizeof (((struct sockaddr_in6 *)ssp)->sin6_addr);
+ break;
+ default:
+ return -1;
+ }
+
+ memset(p, 0, zerolen);
+
+ bytelen = bitlen / 8;
+ bitsleft = bitlen % 8;
+
+ if (bytelen > zerolen)
+ return -1;
+
+ for (i = 0; i < bytelen; i++)
+ *p++ = 0xff;
+
+ for (i = 0; i < bitsleft; i++)
+ *p |= 1 << (7 - i);
+
+ return 0;
+}
+
+static int
+countones(struct sockaddr *sa)
+{
+ void *mask;
+ int i, bits = 0, bytelen;
+ u_int8_t *p;
+
+ switch (sa->sa_family) {
+ case AF_INET:
+ mask = (u_int8_t *)&((struct sockaddr_in *)sa)->sin_addr;
+ bytelen = 4;
+ break;
+ case AF_INET6:
+ mask = (u_int8_t *)&((struct sockaddr_in6 *)sa)->sin6_addr;
+ bytelen = 16;
+ break;
+ default:
+ return 0;
+ }
+
+ p = mask;
+
+ for (i = 0; i < bytelen; i++, p++) {
+ if (*p != 0xff) {
+ for (bits = 0; bits < 8; bits++) {
+ if (!(*p & (1 << (7 - bits))))
+ break;
+ }
+ break;
+ }
+ }
+
+ return (i * 8 + bits);
+}
+
+static int
+sacmp(struct sockaddr *sa1, struct sockaddr *sa2)
+{
+ void *p1, *p2;
+ int len;
+
+ if (sa1->sa_family != sa2->sa_family)
+ return 1;
+
+ switch (sa1->sa_family) {
+ case AF_INET:
+ p1 = &((struct sockaddr_in *)sa1)->sin_addr;
+ p2 = &((struct sockaddr_in *)sa2)->sin_addr;
+ len = 4;
+ break;
+ case AF_INET6:
+ p1 = &((struct sockaddr_in6 *)sa1)->sin6_addr;
+ p2 = &((struct sockaddr_in6 *)sa2)->sin6_addr;
+ len = 16;
+ if (((struct sockaddr_in6 *)sa1)->sin6_scope_id !=
+ ((struct sockaddr_in6 *)sa2)->sin6_scope_id)
+ return 1;
+ break;
+ default:
+ return 1;
+ }
+
+ return memcmp(p1, p2, len);
+}
+
+/*
+ * Scan for a host match in a directory tree.
+ */
+static int
+chk_host(dp, saddr, defsetp, hostsetp)
+ struct dirlist *dp;
+ struct sockaddr *saddr;
+ int *defsetp;
+ int *hostsetp;
+{
+ struct hostlist *hp;
+ struct grouplist *grp;
+ struct addrinfo *ai;
+
+ if (dp) {
+ if (dp->dp_flag & DP_DEFSET)
+ *defsetp = dp->dp_flag;
+ hp = dp->dp_hosts;
+ while (hp) {
+ grp = hp->ht_grp;
+ switch (grp->gr_type) {
+ case GT_HOST:
+ ai = grp->gr_ptr.gt_addrinfo;
+ for (; ai; ai = ai->ai_next) {
+ if (!sacmp(ai->ai_addr, saddr)) {
+ *hostsetp =
+ (hp->ht_flag | DP_HOSTSET);
+ return (1);
+ }
+ }
+ break;
+ case GT_NET:
+ if (!netpartcmp(saddr,
+ (struct sockaddr *)
+ &grp->gr_ptr.gt_net.nt_net,
+ grp->gr_ptr.gt_net.nt_len)) {
+ *hostsetp = (hp->ht_flag | DP_HOSTSET);
+ return (1);
+ }
+ break;
+ };
+ hp = hp->ht_next;
+ }
+ }
+ return (0);
+}
+
+/*
+ * Scan tree for a host that matches the address.
+ */
+static int
+scan_tree(dp, saddr)
+ struct dirlist *dp;
+ struct sockaddr *saddr;
+{
+ int defset, hostset;
+
+ if (dp) {
+ if (scan_tree(dp->dp_left, saddr))
+ return (1);
+ if (chk_host(dp, saddr, &defset, &hostset))
+ return (1);
+ if (scan_tree(dp->dp_right, saddr))
+ return (1);
+ }
+ return (0);
+}
+
+/*
+ * Traverse the dirlist tree and free it up.
+ */
+static void
+free_dir(dp)
+ struct dirlist *dp;
+{
+
+ if (dp) {
+ free_dir(dp->dp_left);
+ free_dir(dp->dp_right);
+ free_host(dp->dp_hosts);
+ free(dp);
+ }
+}
+
+/*
+ * Parse the option string and update fields.
+ * Option arguments may either be -<option>=<value> or
+ * -<option> <value>
+ */
+static int
+do_opt(line, lineno, cpp, endcpp, ep, grp, has_hostp, exflagsp, cr)
+ const char *line;
+ size_t lineno;
+ char **cpp, **endcpp;
+ struct exportlist *ep;
+ struct grouplist *grp;
+ int *has_hostp;
+ int *exflagsp;
+ struct uucred *cr;
+{
+ char *cpoptarg, *cpoptend;
+ char *cp, *cpopt, savedc, savedc2;
+ char *endcp = NULL; /* XXX: GCC */
+ int allflag, usedarg;
+
+ cpopt = *cpp;
+ cpopt++;
+ cp = *endcpp;
+ savedc = *cp;
+ *cp = '\0';
+ while (cpopt && *cpopt) {
+ allflag = 1;
+ usedarg = -2;
+ savedc2 = '\0';
+ if ((cpoptend = strchr(cpopt, ',')) != NULL) {
+ *cpoptend++ = '\0';
+ if ((cpoptarg = strchr(cpopt, '=')) != NULL)
+ *cpoptarg++ = '\0';
+ } else {
+ if ((cpoptarg = strchr(cpopt, '=')) != NULL)
+ *cpoptarg++ = '\0';
+ else {
+ *cp = savedc;
+ nextfield(&cp, &endcp);
+ **endcpp = '\0';
+ if (endcp > cp && *cp != '-') {
+ cpoptarg = cp;
+ savedc2 = *endcp;
+ *endcp = '\0';
+ usedarg = 0;
+ }
+ }
+ }
+ if (!strcmp(cpopt, "ro") || !strcmp(cpopt, "o")) {
+ *exflagsp |= MNT_EXRDONLY;
+ } else if (cpoptarg && (!strcmp(cpopt, "maproot") ||
+ !(allflag = strcmp(cpopt, "mapall")) ||
+ !strcmp(cpopt, "root") || !strcmp(cpopt, "r"))) {
+ usedarg++;
+ parsecred(cpoptarg, cr);
+ if (allflag == 0) {
+ *exflagsp |= MNT_EXPORTANON;
+ opt_flags |= OP_MAPALL;
+ } else
+ opt_flags |= OP_MAPROOT;
+ } else if (!strcmp(cpopt, "kerb") || !strcmp(cpopt, "k")) {
+ *exflagsp |= MNT_EXKERB;
+ opt_flags |= OP_KERB;
+ } else if (cpoptarg && (!strcmp(cpopt, "mask") ||
+ !strcmp(cpopt, "m"))) {
+ if (get_net(cpoptarg, &grp->gr_ptr.gt_net, 1)) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Bad mask: %s",
+ line, (unsigned long)lineno, cpoptarg);
+ return (1);
+ }
+ usedarg++;
+ opt_flags |= OP_MASK;
+ } else if (cpoptarg && (!strcmp(cpopt, "network") ||
+ !strcmp(cpopt, "n"))) {
+ if (strchr(cpoptarg, '/') != NULL) {
+ if (debug)
+ fprintf(stderr, "setting OP_MASKLEN\n");
+ opt_flags |= OP_MASKLEN;
+ }
+ if (grp->gr_type != GT_NULL) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Network/host conflict",
+ line, (unsigned long)lineno);
+ return (1);
+ } else if (get_net(cpoptarg, &grp->gr_ptr.gt_net, 0)) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Bad net: %s",
+ line, (unsigned long)lineno, cpoptarg);
+ return (1);
+ }
+ grp->gr_type = GT_NET;
+ *has_hostp = 1;
+ usedarg++;
+ opt_flags |= OP_NET;
+ } else if (!strcmp(cpopt, "alldirs")) {
+ opt_flags |= OP_ALLDIRS;
+ } else if (!strcmp(cpopt, "noresvmnt")) {
+ opt_flags |= OP_NORESMNT;
+ } else if (!strcmp(cpopt, "noresvport")) {
+ opt_flags |= OP_NORESPORT;
+ *exflagsp |= MNT_EXNORESPORT;
+ } else if (!strcmp(cpopt, "public")) {
+ *exflagsp |= (MNT_EXNORESPORT | MNT_EXPUBLIC);
+ opt_flags |= OP_NORESPORT;
+ } else if (!strcmp(cpopt, "webnfs")) {
+ *exflagsp |= (MNT_EXNORESPORT | MNT_EXPUBLIC |
+ MNT_EXRDONLY | MNT_EXPORTANON);
+ opt_flags |= (OP_MAPALL | OP_NORESPORT);
+ } else if (cpoptarg && !strcmp(cpopt, "index")) {
+ ep->ex_indexfile = strdup(cpoptarg);
+ } else {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Bad opt %s",
+ line, (unsigned long)lineno, cpopt);
+ return (1);
+ }
+ if (usedarg >= 0) {
+ *endcp = savedc2;
+ **endcpp = savedc;
+ if (usedarg > 0) {
+ *cpp = cp;
+ *endcpp = endcp;
+ }
+ return (0);
+ }
+ cpopt = cpoptend;
+ }
+ **endcpp = savedc;
+ return (0);
+}
+
+/*
+ * Translate a character string to the corresponding list of network
+ * addresses for a hostname.
+ */
+static int
+get_host(line, lineno, cp, grp)
+ const char *line;
+ size_t lineno;
+ const char *cp;
+ struct grouplist *grp;
+{
+ struct addrinfo *ai, hints;
+ int ecode;
+ char host[NI_MAXHOST];
+
+ if (grp->gr_type != GT_NULL) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Bad netgroup type for ip host %s",
+ line, (unsigned long)lineno, cp);
+ return (1);
+ }
+ memset(&hints, 0, sizeof hints);
+ hints.ai_flags = AI_CANONNAME;
+ hints.ai_protocol = IPPROTO_UDP;
+ ecode = getaddrinfo(cp, NULL, &hints, &ai);
+ if (ecode != 0) {
+ syslog(LOG_ERR, "\"%s\", line %ld: can't get address info for "
+ "host %s",
+ line, (long)lineno, cp);
+ return 1;
+ }
+ grp->gr_type = GT_HOST;
+ grp->gr_ptr.gt_addrinfo = ai;
+ while (ai != NULL) {
+ if (ai->ai_canonname == NULL) {
+ if (getnameinfo(ai->ai_addr, ai->ai_addrlen, host,
+ sizeof host, NULL, 0, ninumeric) != 0)
+ strlcpy(host, "?", sizeof(host));
+ ai->ai_canonname = estrdup(host);
+ ai->ai_flags |= AI_CANONNAME;
+ } else
+ ai->ai_flags &= ~AI_CANONNAME;
+ if (debug)
+ (void)fprintf(stderr, "got host %s\n", ai->ai_canonname);
+ ai = ai->ai_next;
+ }
+ return (0);
+}
+
+/*
+ * Free up an exports list component
+ */
+static void
+free_exp(ep)
+ struct exportlist *ep;
+{
+
+ if (ep->ex_defdir) {
+ free_host(ep->ex_defdir->dp_hosts);
+ free(ep->ex_defdir);
+ }
+ if (ep->ex_fsdir)
+ free(ep->ex_fsdir);
+ if (ep->ex_indexfile)
+ free(ep->ex_indexfile);
+ free_dir(ep->ex_dirl);
+ free(ep);
+}
+
+/*
+ * Free hosts.
+ */
+static void
+free_host(hp)
+ struct hostlist *hp;
+{
+ struct hostlist *hp2;
+
+ while (hp) {
+ hp2 = hp;
+ hp = hp->ht_next;
+ free(hp2);
+ }
+}
+
+static struct hostlist *
+get_ht()
+{
+ struct hostlist *hp;
+
+ hp = emalloc(sizeof(struct hostlist));
+ hp->ht_next = NULL;
+ hp->ht_flag = 0;
+ return (hp);
+}
+
+/*
+ * Do the nfssvc syscall to push the export info into the kernel.
+ */
+static int
+do_nfssvc(line, lineno, ep, grp, exflags, anoncrp, dirp, dirplen, fsb)
+ const char *line;
+ size_t lineno;
+ struct exportlist *ep;
+ struct grouplist *grp;
+ int exflags;
+ struct uucred *anoncrp;
+ char *dirp;
+ int dirplen;
+ struct statvfs *fsb;
+{
+ struct sockaddr *addrp;
+ struct sockaddr_storage ss;
+ struct addrinfo *ai;
+ int addrlen;
+ int done;
+ struct export_args export;
+
+ export.ex_flags = exflags;
+ export.ex_anon = *anoncrp;
+ export.ex_indexfile = ep->ex_indexfile;
+ if (grp->gr_type == GT_HOST) {
+ ai = grp->gr_ptr.gt_addrinfo;
+ addrp = ai->ai_addr;
+ addrlen = ai->ai_addrlen;
+ } else {
+ addrp = NULL;
+ ai = NULL; /* XXXGCC -Wuninitialized */
+ addrlen = 0; /* XXXGCC -Wuninitialized */
+ }
+ done = FALSE;
+ while (!done) {
+ struct mountd_exports_list mel;
+
+ switch (grp->gr_type) {
+ case GT_HOST:
+ if (addrp != NULL && addrp->sa_family == AF_INET6 &&
+ have_v6 == 0)
+ goto skip;
+ export.ex_addr = addrp;
+ export.ex_addrlen = addrlen;
+ export.ex_masklen = 0;
+ break;
+ case GT_NET:
+ export.ex_addr = (struct sockaddr *)
+ &grp->gr_ptr.gt_net.nt_net;
+ if (export.ex_addr->sa_family == AF_INET6 &&
+ have_v6 == 0)
+ goto skip;
+ export.ex_addrlen = export.ex_addr->sa_len;
+ memset(&ss, 0, sizeof ss);
+ ss.ss_family = export.ex_addr->sa_family;
+ ss.ss_len = export.ex_addr->sa_len;
+ if (allones(&ss, grp->gr_ptr.gt_net.nt_len) != 0) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Bad network flag",
+ line, (unsigned long)lineno);
+ return (1);
+ }
+ export.ex_mask = (struct sockaddr *)&ss;
+ export.ex_masklen = ss.ss_len;
+ break;
+ default:
+ syslog(LOG_ERR, "\"%s\", line %ld: Bad netgroup type",
+ line, (unsigned long)lineno);
+ return (1);
+ };
+
+ /*
+ * XXX:
+ * Maybe I should just use the fsb->f_mntonname path?
+ */
+
+ mel.mel_path = dirp;
+ mel.mel_nexports = 1;
+ mel.mel_exports = &export;
+
+ if (rump_sys_nfssvc(NFSSVC_SETEXPORTSLIST, &mel) != 0) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: Can't change attributes for %s to %s: %m %d",
+ line, (unsigned long)lineno,
+ dirp, (grp->gr_type == GT_HOST) ?
+ grp->gr_ptr.gt_addrinfo->ai_canonname :
+ (grp->gr_type == GT_NET) ?
+ grp->gr_ptr.gt_net.nt_name :
+ "Unknown", errno);
+ return (1);
+ }
+skip:
+ if (addrp) {
+ ai = ai->ai_next;
+ if (ai == NULL)
+ done = TRUE;
+ else {
+ addrp = ai->ai_addr;
+ addrlen = ai->ai_addrlen;
+ }
+ } else
+ done = TRUE;
+ }
+ return (0);
+}
+
+/*
+ * Translate a net address.
+ */
+static int
+get_net(cp, net, maskflg)
+ char *cp;
+ struct netmsk *net;
+ int maskflg;
+{
+ struct netent *np;
+ char *thename, *p, *prefp;
+ struct sockaddr_in sin, *sinp;
+ struct sockaddr *sa;
+ struct addrinfo hints, *ai = NULL;
+ char netname[NI_MAXHOST];
+ long preflen;
+ int ecode;
+
+ (void)memset(&sin, 0, sizeof(sin));
+ if ((opt_flags & OP_MASKLEN) && !maskflg) {
+ p = strchr(cp, '/');
+ *p = '\0';
+ prefp = p + 1;
+ } else {
+ p = NULL; /* XXXGCC -Wuninitialized */
+ prefp = NULL; /* XXXGCC -Wuninitialized */
+ }
+
+ if ((np = getnetbyname(cp)) != NULL) {
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof sin;
+ sin.sin_addr = inet_makeaddr(np->n_net, 0);
+ sa = (struct sockaddr *)&sin;
+ } else if (isdigit((unsigned char)*cp)) {
+ memset(&hints, 0, sizeof hints);
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_flags = AI_NUMERICHOST;
+ if (getaddrinfo(cp, NULL, &hints, &ai) != 0) {
+ /*
+ * If getaddrinfo() failed, try the inet4 network
+ * notation with less than 3 dots.
+ */
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof sin;
+ sin.sin_addr = inet_makeaddr(inet_network(cp),0);
+ if (debug)
+ fprintf(stderr, "get_net: v4 addr %x\n",
+ sin.sin_addr.s_addr);
+ sa = (struct sockaddr *)&sin;
+ } else
+ sa = ai->ai_addr;
+ } else if (isxdigit((unsigned char)*cp) || *cp == ':') {
+ memset(&hints, 0, sizeof hints);
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_flags = AI_NUMERICHOST;
+ if (getaddrinfo(cp, NULL, &hints, &ai) == 0)
+ sa = ai->ai_addr;
+ else
+ goto fail;
+ } else
+ goto fail;
+
+ /*
+ * Only allow /pref notation for v6 addresses.
+ */
+ if (sa->sa_family == AF_INET6 && (!(opt_flags & OP_MASKLEN) || maskflg))
+ return 1;
+
+ ecode = getnameinfo(sa, sa->sa_len, netname, sizeof netname,
+ NULL, 0, ninumeric);
+ if (ecode != 0)
+ goto fail;
+
+ if (maskflg)
+ net->nt_len = countones(sa);
+ else {
+ if (opt_flags & OP_MASKLEN) {
+ errno = 0;
+ preflen = strtol(prefp, NULL, 10);
+ if (preflen == LONG_MIN && errno == ERANGE)
+ goto fail;
+ net->nt_len = (int)preflen;
+ *p = '/';
+ }
+
+ if (np)
+ thename = np->n_name;
+ else {
+ if (getnameinfo(sa, sa->sa_len, netname, sizeof netname,
+ NULL, 0, ninumeric) != 0)
+ strlcpy(netname, "?", sizeof(netname));
+ thename = netname;
+ }
+ net->nt_name = estrdup(thename);
+ memcpy(&net->nt_net, sa, sa->sa_len);
+ }
+
+ if (!maskflg && sa->sa_family == AF_INET &&
+ !(opt_flags & (OP_MASK|OP_MASKLEN))) {
+ sinp = (struct sockaddr_in *)sa;
+ if (IN_CLASSA(sinp->sin_addr.s_addr))
+ net->nt_len = 8;
+ else if (IN_CLASSB(sinp->sin_addr.s_addr))
+ net->nt_len = 16;
+ else if (IN_CLASSC(sinp->sin_addr.s_addr))
+ net->nt_len = 24;
+ else if (IN_CLASSD(sinp->sin_addr.s_addr))
+ net->nt_len = 28;
+ else
+ net->nt_len = 32; /* XXX */
+ }
+
+ if (ai)
+ freeaddrinfo(ai);
+ return 0;
+
+fail:
+ if (ai)
+ freeaddrinfo(ai);
+ return 1;
+}
+
+/*
+ * Parse out the next white space separated field
+ */
+static void
+nextfield(cp, endcp)
+ char **cp;
+ char **endcp;
+{
+ char *p;
+
+ p = *cp;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ if (*p == '\n' || *p == '\0')
+ *cp = *endcp = p;
+ else {
+ *cp = p++;
+ while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0')
+ p++;
+ *endcp = p;
+ }
+}
+
+/*
+ * Parse a description of a credential.
+ */
+static void
+parsecred(namelist, cr)
+ char *namelist;
+ struct uucred *cr;
+{
+ char *thename;
+ int cnt;
+ char *names;
+ struct passwd *pw;
+ struct group *gr;
+ int ngroups;
+ gid_t grps[NGROUPS + 1];
+
+ /*
+ * Set up the unprivileged user.
+ */
+ *cr = def_anon;
+ /*
+ * Get the user's password table entry.
+ */
+ names = strsep(&namelist, " \t\n");
+ thename = strsep(&names, ":");
+ if (isdigit((unsigned char)*thename) || *thename == '-')
+ pw = getpwuid(atoi(thename));
+ else
+ pw = getpwnam(thename);
+ /*
+ * Credentials specified as those of a user.
+ */
+ if (names == NULL) {
+ if (pw == NULL) {
+ syslog(LOG_ERR, "Unknown user: %s", thename);
+ return;
+ }
+ cr->cr_uid = pw->pw_uid;
+ ngroups = NGROUPS + 1;
+ if (getgrouplist(pw->pw_name, pw->pw_gid, grps, &ngroups))
+ syslog(LOG_ERR, "Too many groups for user %s", thename);
+ /*
+ * Convert from int's to gid_t's and compress out duplicate
+ */
+ cr->cr_ngroups = ngroups - 1;
+ cr->cr_gid = grps[0];
+ for (cnt = 1; cnt < ngroups; cnt++)
+ cr->cr_groups[cnt - 1] = grps[cnt];
+ return;
+ }
+ /*
+ * Explicit credential specified as a colon separated list:
+ * uid:gid:gid:...
+ */
+ if (pw != NULL)
+ cr->cr_uid = pw->pw_uid;
+ else if (isdigit((unsigned char)*thename) || *thename == '-')
+ cr->cr_uid = atoi(thename);
+ else {
+ syslog(LOG_ERR, "Unknown user: %s", thename);
+ return;
+ }
+ cr->cr_ngroups = 0;
+ while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS) {
+ thename = strsep(&names, ":");
+ if (isdigit((unsigned char)*thename) || *thename == '-') {
+ cr->cr_groups[cr->cr_ngroups++] = atoi(thename);
+ } else {
+ if ((gr = getgrnam(thename)) == NULL) {
+ syslog(LOG_ERR, "Unknown group: %s", thename);
+ continue;
+ }
+ cr->cr_groups[cr->cr_ngroups++] = gr->gr_gid;
+ }
+ }
+ if (names != NULL && *names != '\0' && cr->cr_ngroups == NGROUPS)
+ syslog(LOG_ERR, "Too many groups");
+}
+
+#define STRSIZ (RPCMNT_NAMELEN+RPCMNT_PATHLEN+50)
+/*
+ * Routines that maintain the remote mounttab
+ */
+static void
+get_mountlist()
+{
+ struct mountlist *mlp, **mlpp;
+ char *host, *dirp, *cp;
+ char str[STRSIZ];
+ FILE *mlfile;
+
+ if ((mlfile = rumpfopen(_PATH_RMOUNTLIST, "r")) == NULL) {
+ syslog(LOG_ERR, "Can't open %s: %m", _PATH_RMOUNTLIST);
+ return;
+ }
+ mlpp = &mlhead;
+ while (fgets(str, STRSIZ, mlfile) != NULL) {
+ cp = str;
+ host = strsep(&cp, " \t\n");
+ dirp = strsep(&cp, " \t\n");
+ if (host == NULL || dirp == NULL)
+ continue;
+ mlp = emalloc(sizeof(*mlp));
+ (void)strncpy(mlp->ml_host, host, RPCMNT_NAMELEN);
+ mlp->ml_host[RPCMNT_NAMELEN] = '\0';
+ (void)strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN);
+ mlp->ml_dirp[RPCMNT_PATHLEN] = '\0';
+ mlp->ml_next = NULL;
+ *mlpp = mlp;
+ mlpp = &mlp->ml_next;
+ }
+ (void)fclose(mlfile);
+}
+
+static int
+del_mlist(hostp, dirp, saddr)
+ char *hostp, *dirp;
+ struct sockaddr *saddr;
+{
+ struct mountlist *mlp, **mlpp;
+ struct mountlist *mlp2;
+ u_short sport;
+ FILE *mlfile;
+ int fnd = 0, ret = 0;
+ char host[NI_MAXHOST];
+
+ switch (saddr->sa_family) {
+ case AF_INET6:
+ sport = ntohs(((struct sockaddr_in6 *)saddr)->sin6_port);
+ break;
+ case AF_INET:
+ sport = ntohs(((struct sockaddr_in *)saddr)->sin_port);
+ break;
+ default:
+ return -1;
+ }
+ mlpp = &mlhead;
+ mlp = mlhead;
+ while (mlp) {
+ if (!strcmp(mlp->ml_host, hostp) &&
+ (!dirp || !strcmp(mlp->ml_dirp, dirp))) {
+ if (!(mlp->ml_flag & DP_NORESMNT) &&
+ sport >= IPPORT_RESERVED) {
+ if (getnameinfo(saddr, saddr->sa_len, host,
+ sizeof host, NULL, 0, ninumeric) != 0)
+ strlcpy(host, "?", sizeof(host));
+ syslog(LOG_NOTICE,
+ "Umount request for %s:%s from %s refused\n",
+ mlp->ml_host, mlp->ml_dirp, host);
+ ret = -1;
+ goto cont;
+ }
+ fnd = 1;
+ mlp2 = mlp;
+ *mlpp = mlp = mlp->ml_next;
+ free(mlp2);
+ } else {
+cont:
+ mlpp = &mlp->ml_next;
+ mlp = mlp->ml_next;
+ }
+ }
+ if (fnd) {
+ if ((mlfile = rumpfopen(_PATH_RMOUNTLIST, "w")) == NULL) {
+ syslog(LOG_ERR, "Can't update %s: %m",
+ _PATH_RMOUNTLIST);
+ return ret;
+ }
+ mlp = mlhead;
+ while (mlp) {
+ (void)fprintf(mlfile, "%s %s\n", mlp->ml_host,
+ mlp->ml_dirp);
+ mlp = mlp->ml_next;
+ }
+ (void)fclose(mlfile);
+ }
+ return ret;
+}
+
+static void
+add_mlist(hostp, dirp, flags)
+ char *hostp, *dirp;
+ int flags;
+{
+ struct mountlist *mlp, **mlpp;
+ FILE *mlfile;
+
+ mlpp = &mlhead;
+ mlp = mlhead;
+ while (mlp) {
+ if (!strcmp(mlp->ml_host, hostp) && !strcmp(mlp->ml_dirp, dirp))
+ return;
+ mlpp = &mlp->ml_next;
+ mlp = mlp->ml_next;
+ }
+ mlp = emalloc(sizeof(*mlp));
+ strncpy(mlp->ml_host, hostp, RPCMNT_NAMELEN);
+ mlp->ml_host[RPCMNT_NAMELEN] = '\0';
+ strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN);
+ mlp->ml_dirp[RPCMNT_PATHLEN] = '\0';
+ mlp->ml_flag = flags;
+ mlp->ml_next = NULL;
+ *mlpp = mlp;
+ if ((mlfile = rumpfopen(_PATH_RMOUNTLIST, "a")) == NULL) {
+ syslog(LOG_ERR, "Can't update %s: %m", _PATH_RMOUNTLIST);
+ return;
+ }
+ (void)fprintf(mlfile, "%s %s\n", mlp->ml_host, mlp->ml_dirp);
+ (void)fclose(mlfile);
+}
+
+/*
+ * This function is called via. SIGTERM when the system is going down.
+ * It sends a broadcast RPCMNT_UMNTALL.
+ */
+/* ARGSUSED */
+static void
+send_umntall(n)
+ int n;
+{
+#if 0
+ (void)clnt_broadcast(RPCPROG_MNT, RPCMNT_VER1, RPCMNT_UMNTALL,
+ xdr_void, NULL, xdr_void, NULL, (resultproc_t)umntall_each);
+#endif
+ exit(0);
+}
+
+#if 0
+static int
+umntall_each(resultsp, raddr)
+ caddr_t resultsp;
+ struct sockaddr_in *raddr;
+{
+ return (1);
+}
+#endif
+
+/*
+ * Free up a group list.
+ */
+static void
+free_grp(grp)
+ struct grouplist *grp;
+{
+
+ if (grp->gr_type == GT_HOST) {
+ if (grp->gr_ptr.gt_addrinfo != NULL)
+ freeaddrinfo(grp->gr_ptr.gt_addrinfo);
+ } else if (grp->gr_type == GT_NET) {
+ if (grp->gr_ptr.gt_net.nt_name)
+ free(grp->gr_ptr.gt_net.nt_name);
+ }
+ free(grp);
+}
+
+#if 0
+static void
+SYSLOG(int pri, const char *fmt,...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+
+ if (debug)
+ vfprintf(stderr, fmt, ap);
+ else
+ vsyslog(pri, fmt, ap);
+
+ va_end(ap);
+}
+#endif
+
+/*
+ * Check options for consistency.
+ */
+static int
+check_options(line, lineno, dp)
+ const char *line;
+ size_t lineno;
+ struct dirlist *dp;
+{
+
+ if (dp == NULL) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: missing directory list",
+ line, (unsigned long)lineno);
+ return (1);
+ }
+ if ((opt_flags & (OP_MAPROOT|OP_MAPALL)) == (OP_MAPROOT|OP_MAPALL) ||
+ (opt_flags & (OP_MAPROOT|OP_KERB)) == (OP_MAPROOT|OP_KERB) ||
+ (opt_flags & (OP_MAPALL|OP_KERB)) == (OP_MAPALL|OP_KERB)) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: -mapall, -maproot and -kerb mutually exclusive",
+ line, (unsigned long)lineno);
+ return (1);
+ }
+ if ((opt_flags & OP_MASK) && (opt_flags & OP_NET) == 0) {
+ syslog(LOG_ERR, "\"%s\", line %ld: -mask requires -net",
+ line, (unsigned long)lineno);
+ return (1);
+ }
+ if ((opt_flags & OP_MASK) && (opt_flags & OP_MASKLEN) != 0) {
+ syslog(LOG_ERR, "\"%s\", line %ld: /pref and -mask mutually"
+ " exclusive",
+ line, (unsigned long)lineno);
+ return (1);
+ }
+ if ((opt_flags & OP_ALLDIRS) && dp->dp_left) {
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: -alldirs has multiple directories",
+ line, (unsigned long)lineno);
+ return (1);
+ }
+ return (0);
+}
+
+/*
+ * Check an absolute directory path for any symbolic links. Return true
+ * if no symbolic links are found.
+ */
+static int
+check_dirpath(line, lineno, dirp)
+ const char *line;
+ size_t lineno;
+ char *dirp;
+{
+ char *cp;
+ struct stat sb;
+ char *file = "";
+
+ for (cp = dirp + 1; *cp; cp++) {
+ if (*cp == '/') {
+ *cp = '\0';
+ if (rump_sys_lstat(dirp, &sb) == -1)
+ goto bad;
+ if (!S_ISDIR(sb.st_mode))
+ goto bad1;
+ *cp = '/';
+ }
+ }
+
+ cp = NULL;
+ if (rump_sys_lstat(dirp, &sb) == -1)
+ goto bad;
+
+ if (!S_ISDIR(sb.st_mode) && !S_ISREG(sb.st_mode)) {
+ file = " file or a";
+ goto bad1;
+ }
+
+ return 1;
+
+bad:
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: lstat for `%s' failed: %m",
+ line, (unsigned long)lineno, dirp);
+ if (cp)
+ *cp = '/';
+ return 0;
+
+bad1:
+ syslog(LOG_ERR,
+ "\"%s\", line %ld: `%s' is not a%s directory",
+ line, (unsigned long)lineno, dirp, file);
+ abort();
+ if (cp)
+ *cp = '/';
+ return 0;
+}
+
+static void
+bind_resv_port(int sock, sa_family_t family, in_port_t port)
+{
+ struct sockaddr *sa;
+ struct sockaddr_in sasin;
+ struct sockaddr_in6 sasin6;
+
+ switch (family) {
+ case AF_INET:
+ (void)memset(&sasin, 0, sizeof(sasin));
+ sasin.sin_len = sizeof(sasin);
+ sasin.sin_family = family;
+ sasin.sin_port = htons(port);
+ sa = (struct sockaddr *)(void *)&sasin;
+ break;
+ case AF_INET6:
+ (void)memset(&sasin6, 0, sizeof(sasin6));
+ sasin6.sin6_len = sizeof(sasin6);
+ sasin6.sin6_family = family;
+ sasin6.sin6_port = htons(port);
+ sa = (struct sockaddr *)(void *)&sasin6;
+ break;
+ default:
+ syslog(LOG_ERR, "Unsupported address family %d", family);
+ return;
+ }
+ if (bindresvport_sa(sock, sa) == -1)
+ syslog(LOG_ERR, "Cannot bind to reserved port %d (%m)", port);
+}
+
+/* ARGSUSED */
+static void
+no_nfs(int sig)
+{
+ syslog(LOG_ERR, "kernel NFS support not present; exiting");
+ exit(1);
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c b/contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c
new file mode 100644
index 0000000..b062501
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c
@@ -0,0 +1,571 @@
+/* $NetBSD: nfsd.c,v 1.4 2013/10/19 17:45:00 christos Exp $ */
+
+/*
+ * Copyright (c) 1989, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Rick Macklem at The University of Guelph.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 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.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\
+ The Regents of the University of California. All rights reserved.");
+#endif /* not lint */
+
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)nfsd.c 8.9 (Berkeley) 3/29/95";
+#else
+__RCSID("$NetBSD: nfsd.c,v 1.4 2013/10/19 17:45:00 christos Exp $");
+#endif
+#endif /* not lint */
+
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/uio.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <poll.h>
+
+#include <rpc/rpc.h>
+#include <rpc/pmap_clnt.h>
+#include <rpc/pmap_prot.h>
+
+#include <nfs/rpcv2.h>
+#include <nfs/nfsproto.h>
+#include <nfs/nfs.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <pwd.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+#include <netdb.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+/* Global defs */
+#ifdef DEBUG
+#define syslog(e, s, args...) \
+do { \
+ fprintf(stderr,(s), ## args); \
+ fprintf(stderr, "\n"); \
+} while (/*CONSTCOND*/0)
+int debug = 1;
+#else
+int debug = 0;
+#endif
+
+int main __P((int, char **));
+void nonfs __P((int));
+void usage __P((void));
+
+static void *
+child(void *arg)
+{
+ struct nfsd_srvargs nsd;
+ int nfssvc_flag;
+
+ nfssvc_flag = NFSSVC_NFSD;
+ memset(&nsd, 0, sizeof(nsd));
+ while (rump_sys_nfssvc(nfssvc_flag, &nsd) < 0) {
+ if (errno != ENEEDAUTH) {
+ syslog(LOG_ERR, "nfssvc: %m %d", errno);
+ exit(1);
+ }
+ nfssvc_flag = NFSSVC_NFSD | NFSSVC_AUTHINFAIL;
+ }
+
+ return NULL;
+}
+
+/*
+ * Nfs server daemon mostly just a user context for nfssvc()
+ *
+ * 1 - do file descriptor and signal cleanup
+ * 2 - create the nfsd thread(s)
+ * 3 - create server socket(s)
+ * 4 - register socket with portmap
+ *
+ * For connectionless protocols, just pass the socket into the kernel via
+ * nfssvc().
+ * For connection based sockets, loop doing accepts. When you get a new
+ * socket from accept, pass the msgsock into the kernel via nfssvc().
+ * The arguments are:
+ * -c - support iso cltp clients
+ * -r - reregister with portmapper
+ * -t - support tcp nfs clients
+ * -u - support udp nfs clients
+ * followed by "n" which is the number of nfsd threads to create
+ */
+int nfsd_main(int, char**);
+int
+nfsd_main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ struct nfsd_args nfsdargs;
+ struct addrinfo *ai_udp, *ai_tcp, *ai_udp6, *ai_tcp6, hints;
+ struct netconfig *nconf_udp, *nconf_tcp, *nconf_udp6, *nconf_tcp6;
+ struct netbuf nb_udp, nb_tcp, nb_udp6, nb_tcp6;
+ struct sockaddr_in inetpeer;
+ struct pollfd set[4];
+ socklen_t len;
+ int ch, connect_type_cnt, i, msgsock;
+ int nfsdcnt, on = 1, reregister, sock, tcpflag, tcpsock;
+ int tcp6sock, ip6flag;
+ int tp4cnt, tp4flag, tpipcnt, udpflag, ecode, s;
+ int error = 0;
+
+#define DEFNFSDCNT 4
+ nfsdcnt = DEFNFSDCNT;
+ reregister = tcpflag = tp4cnt = tp4flag = tpipcnt = 0;
+ udpflag = ip6flag = 0;
+ nconf_udp = nconf_tcp = nconf_udp6 = nconf_tcp6 = NULL;
+ tcpsock = tcp6sock = -1;
+#define GETOPT "6n:rtu"
+#define USAGE "[-rtu] [-n num_servers]"
+ while ((ch = getopt(argc, argv, GETOPT)) != -1) {
+ switch (ch) {
+ case '6':
+ ip6flag = 1;
+ s = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
+ if (s < 0 && (errno == EPROTONOSUPPORT ||
+ errno == EPFNOSUPPORT || errno == EAFNOSUPPORT))
+ ip6flag = 0;
+ else
+ close(s);
+ break;
+ case 'n':
+ nfsdcnt = atoi(optarg);
+ if (nfsdcnt < 1) {
+ warnx("nfsd count %d; reset to %d", nfsdcnt, DEFNFSDCNT);
+ nfsdcnt = DEFNFSDCNT;
+ }
+ break;
+ case 'r':
+ reregister = 1;
+ break;
+ case 't':
+ tcpflag = 1;
+ break;
+ case 'u':
+ udpflag = 1;
+ break;
+ default:
+ case '?':
+ usage();
+ };
+ }
+ argv += optind;
+ argc -= optind;
+
+ /*
+ * XXX
+ * Backward compatibility, trailing number is the count of daemons.
+ */
+ if (argc > 1)
+ usage();
+ if (argc == 1) {
+ nfsdcnt = atoi(argv[0]);
+ if (nfsdcnt < 1) {
+ warnx("nfsd count %d; reset to %d", nfsdcnt, DEFNFSDCNT);
+ nfsdcnt = DEFNFSDCNT;
+ }
+ }
+
+ /*
+ * If none of TCP or UDP are specified, default to UDP only.
+ */
+ if (tcpflag == 0 && udpflag == 0)
+ udpflag = 1;
+
+ if (debug == 0) {
+ fprintf(stderr, "non-debug not supported here\n");
+ exit(1);
+
+#ifdef not_the_debug_man
+ daemon(0, 0);
+ (void)signal(SIGHUP, SIG_IGN);
+ (void)signal(SIGINT, SIG_IGN);
+ (void)signal(SIGQUIT, SIG_IGN);
+ (void)signal(SIGSYS, nonfs);
+#endif
+ }
+
+ if (udpflag) {
+ memset(&hints, 0, sizeof hints);
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_family = PF_INET;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+
+ ecode = getaddrinfo(NULL, "nfs", &hints, &ai_udp);
+ if (ecode != 0) {
+ syslog(LOG_ERR, "getaddrinfo udp: %s",
+ gai_strerror(ecode));
+ exit(1);
+ }
+
+ nconf_udp = getnetconfigent("udp");
+
+ if (nconf_udp == NULL)
+ err(1, "getnetconfigent udp failed");
+
+ nb_udp.buf = ai_udp->ai_addr;
+ nb_udp.len = nb_udp.maxlen = ai_udp->ai_addrlen;
+ if (reregister)
+ if (!rpcb_set(RPCPROG_NFS, 2, nconf_udp, &nb_udp))
+ err(1, "rpcb_set udp failed");
+ }
+
+ if (tcpflag) {
+ memset(&hints, 0, sizeof hints);
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_family = PF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
+
+ ecode = getaddrinfo(NULL, "nfs", &hints, &ai_tcp);
+ if (ecode != 0) {
+ syslog(LOG_ERR, "getaddrinfo tcp: %s",
+ gai_strerror(ecode));
+ exit(1);
+ }
+
+ nconf_tcp = getnetconfigent("tcp");
+
+ if (nconf_tcp == NULL)
+ err(1, "getnetconfigent tcp failed");
+
+ nb_tcp.buf = ai_tcp->ai_addr;
+ nb_tcp.len = nb_tcp.maxlen = ai_tcp->ai_addrlen;
+ if (reregister)
+ if (!rpcb_set(RPCPROG_NFS, 2, nconf_tcp, &nb_tcp))
+ err(1, "rpcb_set tcp failed");
+ }
+
+ if (udpflag && ip6flag) {
+ memset(&hints, 0, sizeof hints);
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_family = PF_INET6;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+
+ ecode = getaddrinfo(NULL, "nfs", &hints, &ai_udp6);
+ if (ecode != 0) {
+ syslog(LOG_ERR, "getaddrinfo udp: %s",
+ gai_strerror(ecode));
+ exit(1);
+ }
+
+ nconf_udp6 = getnetconfigent("udp6");
+
+ if (nconf_udp6 == NULL)
+ err(1, "getnetconfigent udp6 failed");
+
+ nb_udp6.buf = ai_udp6->ai_addr;
+ nb_udp6.len = nb_udp6.maxlen = ai_udp6->ai_addrlen;
+ if (reregister)
+ if (!rpcb_set(RPCPROG_NFS, 2, nconf_udp6, &nb_udp6))
+ err(1, "rpcb_set udp6 failed");
+ }
+
+ if (tcpflag && ip6flag) {
+ memset(&hints, 0, sizeof hints);
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_family = PF_INET6;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
+
+ ecode = getaddrinfo(NULL, "nfs", &hints, &ai_tcp6);
+ if (ecode != 0) {
+ syslog(LOG_ERR, "getaddrinfo tcp: %s",
+ gai_strerror(ecode));
+ exit(1);
+ }
+
+ nconf_tcp6 = getnetconfigent("tcp6");
+
+ if (nconf_tcp6 == NULL)
+ err(1, "getnetconfigent tcp6 failed");
+
+ nb_tcp6.buf = ai_tcp6->ai_addr;
+ nb_tcp6.len = nb_tcp6.maxlen = ai_tcp6->ai_addrlen;
+ if (reregister)
+ if (!rpcb_set(RPCPROG_NFS, 2, nconf_tcp6, &nb_tcp6))
+ err(1, "rpcb_set tcp6 failed");
+ }
+
+ openlog("nfsd", LOG_PID, LOG_DAEMON);
+
+ for (i = 0; i < nfsdcnt; i++) {
+ pthread_t t;
+ pthread_create(&t, NULL, child, NULL);
+ }
+
+ /* If we are serving udp, set up the socket. */
+ if (udpflag) {
+ if ((sock = rump_sys_socket(ai_udp->ai_family, ai_udp->ai_socktype,
+ ai_udp->ai_protocol)) < 0) {
+ syslog(LOG_ERR, "can't create udp socket");
+ exit(1);
+ }
+ if (bind(sock, ai_udp->ai_addr, ai_udp->ai_addrlen) < 0) {
+ syslog(LOG_ERR, "can't bind udp addr");
+ exit(1);
+ }
+ if (!rpcb_set(RPCPROG_NFS, 2, nconf_udp, &nb_udp) ||
+ !rpcb_set(RPCPROG_NFS, 3, nconf_udp, &nb_udp)) {
+ syslog(LOG_ERR, "can't register with udp portmap");
+ exit(1);
+ }
+ nfsdargs.sock = sock;
+ nfsdargs.name = NULL;
+ nfsdargs.namelen = 0;
+ if (rump_sys_nfssvc(NFSSVC_ADDSOCK, &nfsdargs) < 0) {
+ syslog(LOG_ERR, "can't add UDP socket");
+ exit(1);
+ }
+ (void)rump_sys_close(sock);
+ }
+
+ if (udpflag &&ip6flag) {
+ if ((sock = rump_sys_socket(ai_udp6->ai_family, ai_udp6->ai_socktype,
+ ai_udp6->ai_protocol)) < 0) {
+ syslog(LOG_ERR, "can't create udp socket");
+ exit(1);
+ }
+ if (rump_sys_setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
+ &on, sizeof on) < 0) {
+ syslog(LOG_ERR, "can't set v6-only binding for udp6 "
+ "socket: %m");
+ exit(1);
+ }
+ if (rump_sys_bind(sock, ai_udp6->ai_addr, ai_udp6->ai_addrlen) < 0) {
+ syslog(LOG_ERR, "can't bind udp addr");
+ exit(1);
+ }
+ if (!rpcb_set(RPCPROG_NFS, 2, nconf_udp6, &nb_udp6) ||
+ !rpcb_set(RPCPROG_NFS, 3, nconf_udp6, &nb_udp6)) {
+ syslog(LOG_ERR, "can't register with udp portmap");
+ exit(1);
+ }
+ nfsdargs.sock = sock;
+ nfsdargs.name = NULL;
+ nfsdargs.namelen = 0;
+ if (rump_sys_nfssvc(NFSSVC_ADDSOCK, &nfsdargs) < 0) {
+ syslog(LOG_ERR, "can't add UDP6 socket");
+ exit(1);
+ }
+ (void)rump_sys_close(sock);
+ }
+
+ /* Now set up the master server socket waiting for tcp connections. */
+ on = 1;
+ connect_type_cnt = 0;
+ if (tcpflag) {
+ if ((tcpsock = rump_sys_socket(ai_tcp->ai_family, ai_tcp->ai_socktype,
+ ai_tcp->ai_protocol)) < 0) {
+ syslog(LOG_ERR, "can't create tcp socket");
+ exit(1);
+ }
+ if (setsockopt(tcpsock,
+ SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) < 0)
+ syslog(LOG_ERR, "setsockopt SO_REUSEADDR: %m");
+ if (bind(tcpsock, ai_tcp->ai_addr, ai_tcp->ai_addrlen) < 0) {
+ syslog(LOG_ERR, "can't bind tcp addr");
+ exit(1);
+ }
+ if (rump_sys_listen(tcpsock, 5) < 0) {
+ syslog(LOG_ERR, "listen failed");
+ exit(1);
+ }
+ if (!rpcb_set(RPCPROG_NFS, 2, nconf_tcp, &nb_tcp) ||
+ !rpcb_set(RPCPROG_NFS, 3, nconf_tcp, &nb_tcp)) {
+ syslog(LOG_ERR, "can't register tcp with rpcbind");
+ exit(1);
+ }
+ set[0].fd = tcpsock;
+ set[0].events = POLLIN;
+ connect_type_cnt++;
+ } else
+ set[0].fd = -1;
+
+ if (tcpflag && ip6flag) {
+ if ((tcp6sock = socket(ai_tcp6->ai_family, ai_tcp6->ai_socktype,
+ ai_tcp6->ai_protocol)) < 0) {
+ syslog(LOG_ERR, "can't create tcp socket");
+ exit(1);
+ }
+ if (setsockopt(tcp6sock,
+ SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) < 0)
+ syslog(LOG_ERR, "setsockopt SO_REUSEADDR: %m");
+ if (setsockopt(tcp6sock, IPPROTO_IPV6, IPV6_V6ONLY,
+ &on, sizeof on) < 0) {
+ syslog(LOG_ERR, "can't set v6-only binding for tcp6 "
+ "socket: %m");
+ exit(1);
+ }
+ if (bind(tcp6sock, ai_tcp6->ai_addr, ai_tcp6->ai_addrlen) < 0) {
+ syslog(LOG_ERR, "can't bind tcp6 addr");
+ exit(1);
+ }
+ if (listen(tcp6sock, 5) < 0) {
+ syslog(LOG_ERR, "listen failed");
+ exit(1);
+ }
+ if (!rpcb_set(RPCPROG_NFS, 2, nconf_tcp6, &nb_tcp6) ||
+ !rpcb_set(RPCPROG_NFS, 3, nconf_tcp6, &nb_tcp6)) {
+ syslog(LOG_ERR, "can't register tcp6 with rpcbind");
+ exit(1);
+ }
+ set[1].fd = tcp6sock;
+ set[1].events = POLLIN;
+ connect_type_cnt++;
+ } else
+ set[1].fd = -1;
+
+ set[2].fd = -1;
+ set[3].fd = -1;
+
+ if (connect_type_cnt == 0) {
+ pause();
+ exit(0);
+ }
+
+ /*
+ * Loop forever accepting connections and passing the sockets
+ * into the kernel for the mounts.
+ */
+ for (;;) {
+ if (rump_sys_poll(set, 4, INFTIM) < 1) {
+ syslog(LOG_ERR, "poll failed: %m");
+ exit(1);
+ }
+
+ len = sizeof(inetpeer);
+ if ((msgsock = accept(tcpsock,
+ (struct sockaddr *)&inetpeer, &len)) < 0) {
+ syslog(LOG_ERR, "accept failed: %d", error);
+ exit(1);
+ }
+ memset(inetpeer.sin_zero, 0, sizeof(inetpeer.sin_zero));
+ if (setsockopt(msgsock, SOL_SOCKET,
+ SO_KEEPALIVE, (char *)&on, sizeof(on)) < 0)
+ syslog(LOG_ERR,
+ "setsockopt SO_KEEPALIVE: %m");
+ nfsdargs.sock = msgsock;
+ nfsdargs.name = (caddr_t)&inetpeer;
+ nfsdargs.namelen = sizeof(inetpeer);
+ rump_sys_nfssvc(NFSSVC_ADDSOCK, &nfsdargs);
+ (void)rump_sys_close(msgsock);
+
+#ifdef notyet
+ if (set[1].revents & POLLIN) {
+ len = sizeof(inet6peer);
+ if ((msgsock = rump_sys_accept(tcp6sock,
+ (struct sockaddr *)&inet6peer, &len, &error)) < 0) {
+ syslog(LOG_ERR, "accept failed: %m");
+ exit(1);
+ }
+ if (rump_sys_setsockopt(msgsock, SOL_SOCKET,
+ SO_KEEPALIVE, (char *)&on, sizeof(on), &error) < 0)
+ syslog(LOG_ERR,
+ "setsockopt SO_KEEPALIVE: %m");
+ nfsdargs.sock = msgsock;
+ nfsdargs.name = (caddr_t)&inet6peer;
+ nfsdargs.namelen = sizeof(inet6peer);
+ rump_sys_nfssvc(NFSSVC_ADDSOCK, &nfsdargs, &error);
+ (void)rump_sys_close(msgsock, &error);
+ }
+
+ if (set[2].revents & POLLIN) {
+ len = sizeof(isopeer);
+ if ((msgsock = rump_sys_accept(tp4sock,
+ (struct sockaddr *)&isopeer, &len, &error)) < 0) {
+ syslog(LOG_ERR, "accept failed: %m");
+ exit(1);
+ }
+ if (rump_sys_setsockopt(msgsock, SOL_SOCKET,
+ SO_KEEPALIVE, (char *)&on, sizeof(on), &error) < 0)
+ syslog(LOG_ERR,
+ "setsockopt SO_KEEPALIVE: %m");
+ nfsdargs.sock = msgsock;
+ nfsdargs.name = (caddr_t)&isopeer;
+ nfsdargs.namelen = len;
+ rump_sys_nfssvc(NFSSVC_ADDSOCK, &nfsdargs, &error);
+ (void)rump_sys_close(msgsock, &error);
+ }
+
+ if (set[3].revents & POLLIN) {
+ len = sizeof(inetpeer);
+ if ((msgsock = rump_sys_accept(tpipsock,
+ (struct sockaddr *)&inetpeer, &len)) < 0) {
+ syslog(LOG_ERR, "accept failed: %m");
+ exit(1);
+ }
+ if (setsockopt(msgsock, SOL_SOCKET,
+ SO_KEEPALIVE, (char *)&on, sizeof(on)) < 0)
+ syslog(LOG_ERR, "setsockopt SO_KEEPALIVE: %m");
+ nfsdargs.sock = msgsock;
+ nfsdargs.name = (caddr_t)&inetpeer;
+ nfsdargs.namelen = len;
+ rump_sys_nfssvc(NFSSVC_ADDSOCK, &nfsdargs);
+ (void)rump_sys_close(msgsock);
+ }
+#endif /* notyet */
+ }
+}
+
+void
+usage()
+{
+ (void)fprintf(stderr, "usage: nfsd %s\n", USAGE);
+ exit(1);
+}
+
+void
+nonfs(signo)
+ int signo;
+{
+ syslog(LOG_ERR, "missing system call: NFS not available.");
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/pathnames.h b/contrib/netbsd-tests/fs/nfs/nfsservice/pathnames.h
new file mode 100644
index 0000000..3985af9
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/pathnames.h
@@ -0,0 +1,37 @@
+/* $NetBSD: pathnames.h,v 1.1 2010/07/26 15:53:00 pooka Exp $ */
+
+/*
+ * 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. 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.
+ *
+ * @(#)pathnames.h 8.1 (Berkeley) 6/5/93
+ */
+
+#include <paths.h>
+
+#define _PATH_EXPORTS "/etc/exports"
+#define _PATH_RMOUNTLIST "/var/db/mountdtab"
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/check_bound.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/check_bound.c
new file mode 100644
index 0000000..2ea7c31
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/check_bound.c
@@ -0,0 +1,231 @@
+/* $NetBSD: check_bound.c,v 1.1 2010/07/26 15:53:00 pooka Exp $ */
+
+/*
+ * 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
+ */
+/*
+ * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
+ */
+
+/* #ident "@(#)check_bound.c 1.15 93/07/05 SMI" */
+
+#if 0
+#ifndef lint
+static char sccsid[] = "@(#)check_bound.c 1.11 89/04/21 Copyr 1989 Sun Micro";
+#endif
+#endif
+
+/*
+ * check_bound.c
+ * Checks to see whether the program is still bound to the
+ * claimed address and returns the univeral merged address
+ *
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <rpc/rpc.h>
+#include <stdio.h>
+#include <netconfig.h>
+#include <syslog.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "rpcbind.h"
+
+struct fdlist {
+ int fd;
+ struct netconfig *nconf;
+ struct fdlist *next;
+ int check_binding;
+};
+
+static struct fdlist *fdhead; /* Link list of the check fd's */
+static struct fdlist *fdtail;
+static const char emptystring[] = "";
+
+static bool_t check_bound(struct fdlist *, const char *uaddr);
+
+/*
+ * Returns 1 if the given address is bound for the given addr & transport
+ * For all error cases, we assume that the address is bound
+ * Returns 0 for success.
+ */
+static bool_t
+check_bound(struct fdlist *fdl, const char *uaddr)
+{
+ int fd;
+ struct netbuf *na;
+ int ans;
+
+ if (fdl->check_binding == FALSE)
+ return (TRUE);
+
+ na = uaddr2taddr(fdl->nconf, uaddr);
+ if (!na)
+ return (TRUE); /* punt, should never happen */
+
+ fd = __rpc_nconf2fd(fdl->nconf);
+ if (fd < 0) {
+ free(na);
+ return (TRUE);
+ }
+
+ ans = bind(fd, (struct sockaddr *)na->buf, na->len);
+
+ rump_sys_close(fd);
+ free(na);
+
+ return (ans == 0 ? FALSE : TRUE);
+}
+
+int
+add_bndlist(struct netconfig *nconf, struct netbuf *baddr)
+{
+ struct fdlist *fdl;
+ struct netconfig *newnconf;
+
+ newnconf = getnetconfigent(nconf->nc_netid);
+ if (newnconf == NULL)
+ return (-1);
+ fdl = (struct fdlist *)malloc((u_int)sizeof (struct fdlist));
+ if (fdl == NULL) {
+ freenetconfigent(newnconf);
+ syslog(LOG_ERR, "no memory!");
+ return (-1);
+ }
+ fdl->nconf = newnconf;
+ fdl->next = NULL;
+ if (fdhead == NULL) {
+ fdhead = fdl;
+ fdtail = fdl;
+ } else {
+ fdtail->next = fdl;
+ fdtail = fdl;
+ }
+ /* XXX no bound checking for now */
+ fdl->check_binding = FALSE;
+
+ return 0;
+}
+
+bool_t
+is_bound(const char *netid, const char *uaddr)
+{
+ struct fdlist *fdl;
+
+ for (fdl = fdhead; fdl; fdl = fdl->next)
+ if (strcmp(fdl->nconf->nc_netid, netid) == 0)
+ break;
+ if (fdl == NULL)
+ return (TRUE);
+ return (check_bound(fdl, uaddr));
+}
+
+/*
+ * Returns NULL if there was some system error.
+ * Returns "" if the address was not bound, i.e the server crashed.
+ * Returns the merged address otherwise.
+ */
+char *
+mergeaddr(SVCXPRT *xprt, char *netid, char *uaddr, char *saddr)
+{
+ struct fdlist *fdl;
+ char *c_uaddr, *s_uaddr, *m_uaddr, *allocated_uaddr = NULL;
+
+ for (fdl = fdhead; fdl; fdl = fdl->next)
+ if (strcmp(fdl->nconf->nc_netid, netid) == 0)
+ break;
+ if (fdl == NULL)
+ return (NULL);
+ if (check_bound(fdl, uaddr) == FALSE)
+ /* that server died */
+ return strdup(emptystring);
+ /*
+ * If saddr is not NULL, the remote client may have included the
+ * address by which it contacted us. Use that for the "client" uaddr,
+ * otherwise use the info from the SVCXPRT.
+ */
+ if (saddr != NULL) {
+ c_uaddr = saddr;
+ } else {
+ c_uaddr = taddr2uaddr(fdl->nconf, svc_getrpccaller(xprt));
+ if (c_uaddr == NULL) {
+ syslog(LOG_ERR, "taddr2uaddr failed for %s",
+ fdl->nconf->nc_netid);
+ return (NULL);
+ }
+ allocated_uaddr = c_uaddr;
+ }
+
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ if (saddr == NULL) {
+ fprintf(stderr, "mergeaddr: client uaddr = %s\n",
+ c_uaddr);
+ } else {
+ fprintf(stderr, "mergeaddr: contact uaddr = %s\n",
+ c_uaddr);
+ }
+ }
+#endif
+ s_uaddr = uaddr;
+ /*
+ * This is all we should need for IP 4 and 6
+ */
+ m_uaddr = addrmerge(svc_getrpccaller(xprt), s_uaddr, c_uaddr, netid);
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "mergeaddr: uaddr = %s, merged uaddr = %s\n",
+ uaddr, m_uaddr);
+#endif
+ if (allocated_uaddr != NULL)
+ free(allocated_uaddr);
+ return (m_uaddr);
+}
+
+/*
+ * Returns a netconf structure from its internal list. This
+ * structure should not be freed.
+ */
+struct netconfig *
+rpcbind_get_conf(const char *netid)
+{
+ struct fdlist *fdl;
+
+ for (fdl = fdhead; fdl; fdl = fdl->next)
+ if (strcmp(fdl->nconf->nc_netid, netid) == 0)
+ break;
+ if (fdl == NULL)
+ return (NULL);
+ return (fdl->nconf);
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c
new file mode 100644
index 0000000..3f9eb47
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c
@@ -0,0 +1,366 @@
+/* $NetBSD: pmap_svc.c,v 1.2 2013/10/19 17:45:00 christos Exp $ */
+
+/*
+ * 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
+ */
+/*
+ * Copyright (c) 1984 - 1991 by Sun Microsystems, Inc.
+ */
+
+/* #ident "@(#)pmap_svc.c 1.14 93/07/05 SMI" */
+
+#if 0
+#ifndef lint
+static char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro";
+#endif
+#endif
+
+/*
+ * pmap_svc.c
+ * The server procedure for the version 2 portmapper.
+ * All the portmapper related interface from the portmap side.
+ */
+
+#ifdef PORTMAP
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <rpc/rpc.h>
+#include <rpc/pmap_prot.h>
+#include <rpc/rpcb_prot.h>
+#ifdef RPCBIND_DEBUG
+#include <stdlib.h>
+#endif
+#include "rpcbind.h"
+
+static struct pmaplist *find_service_pmap(rpcprog_t, rpcvers_t, rpcprot_t);
+static bool_t pmapproc_change(struct svc_req *, SVCXPRT *, u_long);
+static bool_t pmapproc_getport(struct svc_req *, SVCXPRT *);
+static bool_t pmapproc_dump(struct svc_req *, SVCXPRT *);
+
+/*
+ * Called for all the version 2 inquiries.
+ */
+void
+pmap_service(struct svc_req *rqstp, SVCXPRT *xprt)
+{
+ rpcbs_procinfo(RPCBVERS_2_STAT, rqstp->rq_proc);
+ switch (rqstp->rq_proc) {
+ case PMAPPROC_NULL:
+ /*
+ * Null proc call
+ */
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "PMAPPROC_NULL\n");
+#endif
+ check_access(xprt, rqstp->rq_proc, NULL, PMAPVERS);
+ if ((!svc_sendreply(xprt, (xdrproc_t) xdr_void, NULL)) &&
+ debugging) {
+ if (doabort) {
+ rpcbind_abort();
+ }
+ }
+ break;
+
+ case PMAPPROC_SET:
+ /*
+ * Set a program, version to port mapping
+ */
+ pmapproc_change(rqstp, xprt, rqstp->rq_proc);
+ break;
+
+ case PMAPPROC_UNSET:
+ /*
+ * Remove a program, version to port mapping.
+ */
+ pmapproc_change(rqstp, xprt, rqstp->rq_proc);
+ break;
+
+ case PMAPPROC_GETPORT:
+ /*
+ * Lookup the mapping for a program, version and return its
+ * port number.
+ */
+ pmapproc_getport(rqstp, xprt);
+ break;
+
+ case PMAPPROC_DUMP:
+ /*
+ * Return the current set of mapped program, version
+ */
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "PMAPPROC_DUMP\n");
+#endif
+ pmapproc_dump(rqstp, xprt);
+ break;
+
+ case PMAPPROC_CALLIT:
+ /*
+ * Calls a procedure on the local machine. If the requested
+ * procedure is not registered this procedure does not return
+ * error information!!
+ * This procedure is only supported on rpc/udp and calls via
+ * rpc/udp. It passes null authentication parameters.
+ */
+ rpcbproc_callit_com(rqstp, xprt, PMAPPROC_CALLIT, PMAPVERS);
+ break;
+
+ default:
+ svcerr_noproc(xprt);
+ break;
+ }
+}
+
+/*
+ * returns the item with the given program, version number. If that version
+ * number is not found, it returns the item with that program number, so that
+ * the port number is now returned to the caller. The caller when makes a
+ * call to this program, version number, the call will fail and it will
+ * return with PROGVERS_MISMATCH. The user can then determine the highest
+ * and the lowest version number for this program using clnt_geterr() and
+ * use those program version numbers.
+ */
+static struct pmaplist *
+find_service_pmap(rpcprog_t prog, rpcvers_t vers, rpcprot_t prot)
+{
+ register struct pmaplist *hit = NULL;
+ register struct pmaplist *pml;
+
+ for (pml = list_pml; pml != NULL; pml = pml->pml_next) {
+ if ((pml->pml_map.pm_prog != prog) ||
+ (pml->pml_map.pm_prot != prot))
+ continue;
+ hit = pml;
+ if (pml->pml_map.pm_vers == vers)
+ break;
+ }
+ return (hit);
+}
+
+static bool_t
+pmapproc_change(struct svc_req *rqstp, SVCXPRT *xprt, unsigned long op)
+{
+ struct pmap reg;
+ RPCB rpcbreg;
+ long ans;
+ struct sockcred *sc;
+ char uidbuf[32];
+
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "%s request for (%lu, %lu) : ",
+ op == PMAPPROC_SET ? "PMAP_SET" : "PMAP_UNSET",
+ reg.pm_prog, reg.pm_vers);
+#endif
+
+ if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
+ svcerr_decode(xprt);
+ return (FALSE);
+ }
+
+ if (!check_access(xprt, op, &reg, PMAPVERS)) {
+ svcerr_weakauth(xprt);
+ return FALSE;
+ }
+
+ (void)svc_getcaller(xprt);
+ sc = __svc_getcallercreds(xprt);
+
+ /*
+ * Can't use getpwnam here. We might end up calling ourselves
+ * and looping.
+ */
+ if (sc == NULL)
+ rpcbreg.r_owner = __UNCONST(rpcbind_unknown);
+ else if (sc->sc_uid == 0)
+ rpcbreg.r_owner = __UNCONST(rpcbind_superuser);
+ else {
+ /* r_owner will be strdup-ed later */
+ snprintf(uidbuf, sizeof uidbuf, "%d", sc->sc_uid);
+ rpcbreg.r_owner = uidbuf;
+ }
+
+ rpcbreg.r_prog = reg.pm_prog;
+ rpcbreg.r_vers = reg.pm_vers;
+
+ if (op == PMAPPROC_SET) {
+ char buf[32];
+
+ snprintf(buf, sizeof(buf), "0.0.0.0.%d.%d",
+ (int)((reg.pm_port >> 8) & 0xff),
+ (int)(reg.pm_port & 0xff));
+ rpcbreg.r_addr = buf;
+ if (reg.pm_prot == IPPROTO_UDP) {
+ rpcbreg.r_netid = __UNCONST(udptrans);
+ } else if (reg.pm_prot == IPPROTO_TCP) {
+ rpcbreg.r_netid = __UNCONST(tcptrans);
+ } else {
+ ans = FALSE;
+ goto done_change;
+ }
+ ans = map_set(&rpcbreg, rpcbreg.r_owner);
+ } else if (op == PMAPPROC_UNSET) {
+ bool_t ans1, ans2;
+
+ rpcbreg.r_addr = NULL;
+ rpcbreg.r_netid = __UNCONST(tcptrans);
+ ans1 = map_unset(&rpcbreg, rpcbreg.r_owner);
+ rpcbreg.r_netid = __UNCONST(udptrans);
+ ans2 = map_unset(&rpcbreg, rpcbreg.r_owner);
+ ans = ans1 || ans2;
+ } else {
+ ans = FALSE;
+ }
+done_change:
+ if ((!svc_sendreply(xprt, (xdrproc_t) xdr_long, (caddr_t) &ans)) &&
+ debugging) {
+ fprintf(stderr, "portmap: svc_sendreply\n");
+ if (doabort) {
+ rpcbind_abort();
+ }
+ }
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "%s\n", ans == TRUE ? "succeeded" : "failed");
+#endif
+ if (op == PMAPPROC_SET)
+ rpcbs_set(RPCBVERS_2_STAT, ans);
+ else
+ rpcbs_unset(RPCBVERS_2_STAT, ans);
+ return (TRUE);
+}
+
+/* ARGSUSED */
+static bool_t
+pmapproc_getport(struct svc_req *rqstp, SVCXPRT *xprt)
+{
+ struct pmap reg;
+ long lport;
+ int port = 0;
+ struct pmaplist *fnd;
+#ifdef RPCBIND_DEBUG
+ char *uaddr;
+#endif
+
+ if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
+ svcerr_decode(xprt);
+ return (FALSE);
+ }
+
+ if (!check_access(xprt, PMAPPROC_GETPORT, &reg, PMAPVERS)) {
+ svcerr_weakauth(xprt);
+ return FALSE;
+ }
+
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ uaddr = taddr2uaddr(rpcbind_get_conf(xprt->xp_netid),
+ svc_getrpccaller(xprt));
+ fprintf(stderr, "PMAP_GETPORT req for (%lu, %lu, %s) from %s :",
+ reg.pm_prog, reg.pm_vers,
+ reg.pm_prot == IPPROTO_UDP ? "udp" : "tcp", uaddr);
+ free(uaddr);
+ }
+#endif
+ fnd = find_service_pmap(reg.pm_prog, reg.pm_vers, reg.pm_prot);
+ if (fnd) {
+ char serveuaddr[32];
+ int h1, h2, h3, h4, p1, p2;
+ const char *netid, *ua;
+
+ if (reg.pm_prot == IPPROTO_UDP) {
+ ua = udp_uaddr;
+ netid = udptrans;
+ } else {
+ ua = tcp_uaddr; /* To get the len */
+ netid = tcptrans;
+ }
+ if (ua == NULL) {
+ goto sendreply;
+ }
+ if (sscanf(ua, "%d.%d.%d.%d.%d.%d", &h1, &h2, &h3,
+ &h4, &p1, &p2) == 6) {
+ p1 = (fnd->pml_map.pm_port >> 8) & 0xff;
+ p2 = (fnd->pml_map.pm_port) & 0xff;
+ snprintf(serveuaddr, sizeof(serveuaddr),
+ "%d.%d.%d.%d.%d.%d", h1, h2, h3, h4, p1, p2);
+ if (is_bound(netid, serveuaddr)) {
+ port = fnd->pml_map.pm_port;
+ } else { /* this service is dead; delete it */
+ delete_prog(reg.pm_prog);
+ }
+ }
+ }
+sendreply:
+ lport = port;
+ if ((!svc_sendreply(xprt, (xdrproc_t) xdr_long, (caddr_t)&lport)) &&
+ debugging) {
+ (void) fprintf(stderr, "portmap: svc_sendreply\n");
+ if (doabort) {
+ rpcbind_abort();
+ }
+ }
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "port = %d\n", port);
+#endif
+ rpcbs_getaddr(RPCBVERS_2_STAT, reg.pm_prog, reg.pm_vers,
+ reg.pm_prot == IPPROTO_UDP ? udptrans : tcptrans,
+ port ? udptrans : "");
+
+ return (TRUE);
+}
+
+/* ARGSUSED */
+static bool_t
+pmapproc_dump(struct svc_req *rqstp, SVCXPRT *xprt)
+{
+ if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL)) {
+ svcerr_decode(xprt);
+ return (FALSE);
+ }
+
+ if (!check_access(xprt, PMAPPROC_DUMP, NULL, PMAPVERS)) {
+ svcerr_weakauth(xprt);
+ return FALSE;
+ }
+
+ if ((!svc_sendreply(xprt, (xdrproc_t) xdr_pmaplist_ptr,
+ (caddr_t)&list_pml)) && debugging) {
+ if (debugging)
+ (void) fprintf(stderr, "portmap: svc_sendreply\n");
+ if (doabort) {
+ rpcbind_abort();
+ }
+ }
+ return (TRUE);
+}
+
+#endif /* PORTMAP */
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_stat.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_stat.c
new file mode 100644
index 0000000..5bc5a0f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_stat.c
@@ -0,0 +1,206 @@
+/* $NetBSD: rpcb_stat.c,v 1.1 2010/07/26 15:53:00 pooka Exp $ */
+
+/*
+ * 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
+ */
+/* #pragma ident "@(#)rpcb_stat.c 1.7 94/04/25 SMI" */
+
+/*
+ * rpcb_stat.c
+ * Allows for gathering of statistics
+ *
+ * Copyright (c) 1990 by Sun Microsystems, Inc.
+ */
+
+#include <stdio.h>
+#include <netconfig.h>
+#include <rpc/rpc.h>
+#include <rpc/rpcb_prot.h>
+#include <sys/stat.h>
+#ifdef PORTMAP
+#include <rpc/pmap_prot.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include "rpcbind.h"
+
+static rpcb_stat_byvers inf;
+
+void
+rpcbs_init(void)
+{
+
+}
+
+void
+rpcbs_procinfo(rpcvers_t rtype, rpcproc_t proc)
+{
+ switch (rtype + 2) {
+#ifdef PORTMAP
+ case PMAPVERS: /* version 2 */
+ if (proc > rpcb_highproc_2)
+ return;
+ break;
+#endif
+ case RPCBVERS: /* version 3 */
+ if (proc > rpcb_highproc_3)
+ return;
+ break;
+ case RPCBVERS4: /* version 4 */
+ if (proc > rpcb_highproc_4)
+ return;
+ break;
+ default: return;
+ }
+ inf[rtype].info[proc]++;
+ return;
+}
+
+void
+rpcbs_set(rpcvers_t rtype, bool_t success)
+{
+ if ((rtype >= RPCBVERS_STAT) || (success == FALSE))
+ return;
+ inf[rtype].setinfo++;
+ return;
+}
+
+void
+rpcbs_unset(rpcvers_t rtype, bool_t success)
+{
+ if ((rtype >= RPCBVERS_STAT) || (success == FALSE))
+ return;
+ inf[rtype].unsetinfo++;
+ return;
+}
+
+void
+rpcbs_getaddr(rpcvers_t rtype, rpcprog_t prog, rpcvers_t vers,
+ const char *netid, const char *uaddr)
+{
+ rpcbs_addrlist *al;
+ struct netconfig *nconf;
+
+ if (rtype >= RPCBVERS_STAT)
+ return;
+ for (al = inf[rtype].addrinfo; al; al = al->next) {
+
+ if(al->netid == NULL)
+ return;
+ if ((al->prog == prog) && (al->vers == vers) &&
+ (strcmp(al->netid, netid) == 0)) {
+ if ((uaddr == NULL) || (uaddr[0] == 0))
+ al->failure++;
+ else
+ al->success++;
+ return;
+ }
+ }
+ nconf = rpcbind_get_conf(netid);
+ if (nconf == NULL) {
+ return;
+ }
+ al = (rpcbs_addrlist *) malloc(sizeof (rpcbs_addrlist));
+ if (al == NULL) {
+ return;
+ }
+ al->prog = prog;
+ al->vers = vers;
+ al->netid = nconf->nc_netid;
+ if ((uaddr == NULL) || (uaddr[0] == 0)) {
+ al->failure = 1;
+ al->success = 0;
+ } else {
+ al->failure = 0;
+ al->success = 1;
+ }
+ al->next = inf[rtype].addrinfo;
+ inf[rtype].addrinfo = al;
+}
+
+void
+rpcbs_rmtcall(rpcvers_t rtype, rpcproc_t rpcbproc, rpcprog_t prog,
+ rpcvers_t vers, rpcproc_t proc, char *netid, rpcblist_ptr rbl)
+{
+ rpcbs_rmtcalllist *rl;
+ struct netconfig *nconf;
+
+ if (rtype >= RPCBVERS_STAT)
+ return;
+ for (rl = inf[rtype].rmtinfo; rl; rl = rl->next) {
+
+ if(rl->netid == NULL)
+ return;
+
+ if ((rl->prog == prog) && (rl->vers == vers) &&
+ (rl->proc == proc) &&
+ (strcmp(rl->netid, netid) == 0)) {
+ if ((rbl == NULL) ||
+ (rbl->rpcb_map.r_vers != vers))
+ rl->failure++;
+ else
+ rl->success++;
+ if (rpcbproc == RPCBPROC_INDIRECT)
+ rl->indirect++;
+ return;
+ }
+ }
+ nconf = rpcbind_get_conf(netid);
+ if (nconf == NULL) {
+ return;
+ }
+ rl = (rpcbs_rmtcalllist *) malloc(sizeof (rpcbs_rmtcalllist));
+ if (rl == NULL) {
+ return;
+ }
+ rl->prog = prog;
+ rl->vers = vers;
+ rl->proc = proc;
+ rl->netid = nconf->nc_netid;
+ if ((rbl == NULL) ||
+ (rbl->rpcb_map.r_vers != vers)) {
+ rl->failure = 1;
+ rl->success = 0;
+ } else {
+ rl->failure = 0;
+ rl->success = 1;
+ }
+ rl->indirect = 1;
+ rl->next = inf[rtype].rmtinfo;
+ inf[rtype].rmtinfo = rl;
+ return;
+}
+
+/*
+ */
+void *
+rpcbproc_getstat(void *arg, struct svc_req *req, SVCXPRT *xprt,
+ rpcvers_t versnum)
+{
+ return (void *)&inf;
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc.c
new file mode 100644
index 0000000..16c86f6
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc.c
@@ -0,0 +1,232 @@
+/* $NetBSD: rpcb_svc.c,v 1.2 2011/09/16 16:13:18 plunky Exp $ */
+
+/*
+ * 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
+ */
+/*
+ * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
+ */
+
+/* #ident "@(#)rpcb_svc.c 1.16 93/07/05 SMI" */
+
+/*
+ * rpcb_svc.c
+ * The server procedure for the version 3 rpcbind (TLI).
+ *
+ * It maintains a separate list of all the registered services with the
+ * version 3 of rpcbind.
+ */
+#include <sys/types.h>
+#include <rpc/rpc.h>
+#include <rpc/rpcb_prot.h>
+#include <netconfig.h>
+#include <syslog.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "rpcbind.h"
+
+static void *rpcbproc_getaddr_3_local(void *, struct svc_req *, SVCXPRT *,
+ rpcvers_t);
+static void *rpcbproc_dump_3_local(void *, struct svc_req *, SVCXPRT *,
+ rpcvers_t);
+
+/*
+ * Called by svc_getreqset. There is a separate server handle for
+ * every transport that it waits on.
+ */
+void
+rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
+{
+ union {
+ RPCB rpcbproc_set_3_arg;
+ RPCB rpcbproc_unset_3_arg;
+ RPCB rpcbproc_getaddr_3_local_arg;
+ struct rpcb_rmtcallargs rpcbproc_callit_3_arg;
+ char *rpcbproc_uaddr2taddr_3_arg;
+ struct netbuf rpcbproc_taddr2uaddr_3_arg;
+ } argument;
+ char *result;
+ xdrproc_t xdr_argument, xdr_result;
+ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+
+ rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc);
+
+ switch (rqstp->rq_proc) {
+ case NULLPROC:
+ /*
+ * Null proc call
+ */
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_NULL\n");
+#endif
+ /* This call just logs, no actual checks */
+ check_access(transp, rqstp->rq_proc, NULL, RPCBVERS);
+ (void) svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
+ return;
+
+ case RPCBPROC_SET:
+ xdr_argument = (xdrproc_t )xdr_rpcb;
+ xdr_result = (xdrproc_t )xdr_bool;
+ local = rpcbproc_set_com;
+ break;
+
+ case RPCBPROC_UNSET:
+ xdr_argument = (xdrproc_t)xdr_rpcb;
+ xdr_result = (xdrproc_t)xdr_bool;
+ local = rpcbproc_unset_com;
+ break;
+
+ case RPCBPROC_GETADDR:
+ xdr_argument = (xdrproc_t)xdr_rpcb;
+ xdr_result = (xdrproc_t)xdr_wrapstring;
+ local = rpcbproc_getaddr_3_local;
+ break;
+
+ case RPCBPROC_DUMP:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_DUMP\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_void;
+ xdr_result = (xdrproc_t)xdr_rpcblist_ptr;
+ local = rpcbproc_dump_3_local;
+ break;
+
+ case RPCBPROC_CALLIT:
+ rpcbproc_callit_com(rqstp, transp, rqstp->rq_proc, RPCBVERS);
+ return;
+
+ case RPCBPROC_GETTIME:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_GETTIME\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_void;
+ xdr_result = (xdrproc_t)xdr_u_long;
+ local = rpcbproc_gettime_com;
+ break;
+
+ case RPCBPROC_UADDR2TADDR:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_UADDR2TADDR\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_wrapstring;
+ xdr_result = (xdrproc_t)xdr_netbuf;
+ local = rpcbproc_uaddr2taddr_com;
+ break;
+
+ case RPCBPROC_TADDR2UADDR:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_TADDR2UADDR\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_netbuf;
+ xdr_result = (xdrproc_t)xdr_wrapstring;
+ local = rpcbproc_taddr2uaddr_com;
+ break;
+
+ default:
+ svcerr_noproc(transp);
+ return;
+ }
+ (void) memset((char *)&argument, 0, sizeof (argument));
+ if (!svc_getargs(transp, (xdrproc_t) xdr_argument,
+ (char *) &argument)) {
+ svcerr_decode(transp);
+ if (debugging)
+ (void) fprintf(stderr, "rpcbind: could not decode\n");
+ return;
+ }
+ if (!check_access(transp, rqstp->rq_proc, &argument, RPCBVERS)) {
+ svcerr_weakauth(transp);
+ goto done;
+ }
+ result = (*local)(&argument, rqstp, transp, RPCBVERS);
+ if (result != NULL && !svc_sendreply(transp, (xdrproc_t)xdr_result,
+ result)) {
+ svcerr_systemerr(transp);
+ if (debugging) {
+ (void) fprintf(stderr, "rpcbind: svc_sendreply\n");
+ if (doabort) {
+ rpcbind_abort();
+ }
+ }
+ }
+done:
+ if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, (char *)
+ &argument)) {
+ if (debugging) {
+ (void) fprintf(stderr, "unable to free arguments\n");
+ if (doabort) {
+ rpcbind_abort();
+ }
+ }
+ }
+}
+
+/*
+ * Lookup the mapping for a program, version and return its
+ * address. Assuming that the caller wants the address of the
+ * server running on the transport on which the request came.
+ *
+ * We also try to resolve the universal address in terms of
+ * address of the caller.
+ */
+/* ARGSUSED */
+static void *
+rpcbproc_getaddr_3_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t versnum)
+{
+ RPCB *regp = (RPCB *)arg;
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ char *uaddr;
+
+ uaddr = taddr2uaddr(rpcbind_get_conf(transp->xp_netid),
+ svc_getrpccaller(transp));
+ fprintf(stderr, "RPCB_GETADDR req for (%lu, %lu, %s) from %s: ",
+ (unsigned long)regp->r_prog, (unsigned long)regp->r_vers,
+ regp->r_netid, uaddr);
+ free(uaddr);
+ }
+#endif
+ return (rpcbproc_getaddr_com(regp, rqstp, transp, RPCBVERS,
+ RPCB_ALLVERS));
+}
+
+/* ARGSUSED */
+static void *
+rpcbproc_dump_3_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t versnum)
+{
+ return ((void *)&list_rbl);
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_4.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_4.c
new file mode 100644
index 0000000..c4e8edb
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_4.c
@@ -0,0 +1,455 @@
+/* $NetBSD: rpcb_svc_4.c,v 1.2 2011/09/16 16:13:18 plunky Exp $ */
+
+/*
+ * 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
+ */
+/*
+ * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
+ */
+
+/* #ident "@(#)rpcb_svc_4.c 1.8 93/07/05 SMI" */
+
+/*
+ * rpcb_svc_4.c
+ * The server procedure for the version 4 rpcbind.
+ *
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <rpc/rpc.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <netconfig.h>
+#include <syslog.h>
+#include <string.h>
+#include <stdlib.h>
+#include "rpcbind.h"
+
+static void *rpcbproc_getaddr_4_local(void *, struct svc_req *, SVCXPRT *,
+ rpcvers_t);
+static void *rpcbproc_getversaddr_4_local(void *, struct svc_req *, SVCXPRT *,
+ rpcvers_t);
+static void *rpcbproc_getaddrlist_4_local(void *, struct svc_req *, SVCXPRT *,
+ rpcvers_t);
+static void free_rpcb_entry_list(rpcb_entry_list_ptr *);
+static void *rpcbproc_dump_4_local(void *, struct svc_req *, SVCXPRT *,
+ rpcvers_t);
+
+/*
+ * Called by svc_getreqset. There is a separate server handle for
+ * every transport that it waits on.
+ */
+void
+rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
+{
+ union {
+ rpcb rpcbproc_set_4_arg;
+ rpcb rpcbproc_unset_4_arg;
+ rpcb rpcbproc_getaddr_4_local_arg;
+ char *rpcbproc_uaddr2taddr_4_arg;
+ struct netbuf rpcbproc_taddr2uaddr_4_arg;
+ } argument;
+ char *result;
+ xdrproc_t xdr_argument, xdr_result;
+ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+
+ rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc);
+
+ switch (rqstp->rq_proc) {
+ case NULLPROC:
+ /*
+ * Null proc call
+ */
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_NULL\n");
+#endif
+ check_access(transp, rqstp->rq_proc, NULL, RPCBVERS4);
+ (void) svc_sendreply(transp, (xdrproc_t) xdr_void, NULL);
+ return;
+
+ case RPCBPROC_SET:
+ /*
+ * Check to see whether the message came from
+ * loopback transports (for security reasons)
+ */
+ xdr_argument = (xdrproc_t)xdr_rpcb;
+ xdr_result = (xdrproc_t)xdr_bool;
+ local = rpcbproc_set_com;
+ break;
+
+ case RPCBPROC_UNSET:
+ /*
+ * Check to see whether the message came from
+ * loopback transports (for security reasons)
+ */
+ xdr_argument = (xdrproc_t)xdr_rpcb;
+ xdr_result = (xdrproc_t)xdr_bool;
+ local = rpcbproc_unset_com;
+ break;
+
+ case RPCBPROC_GETADDR:
+ xdr_argument = (xdrproc_t)xdr_rpcb;
+ xdr_result = (xdrproc_t)xdr_wrapstring;
+ local = rpcbproc_getaddr_4_local;
+ break;
+
+ case RPCBPROC_GETVERSADDR:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_GETVERSADDR\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_rpcb;
+ xdr_result = (xdrproc_t)xdr_wrapstring;
+ local = rpcbproc_getversaddr_4_local;
+ break;
+
+ case RPCBPROC_DUMP:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_DUMP\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_void;
+ xdr_result = (xdrproc_t)xdr_rpcblist_ptr;
+ local = rpcbproc_dump_4_local;
+ break;
+
+ case RPCBPROC_INDIRECT:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_INDIRECT\n");
+#endif
+ rpcbproc_callit_com(rqstp, transp, rqstp->rq_proc, RPCBVERS4);
+ return;
+
+/* case RPCBPROC_CALLIT: */
+ case RPCBPROC_BCAST:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_BCAST\n");
+#endif
+ rpcbproc_callit_com(rqstp, transp, rqstp->rq_proc, RPCBVERS4);
+ return;
+
+ case RPCBPROC_GETTIME:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_GETTIME\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_void;
+ xdr_result = (xdrproc_t)xdr_u_long;
+ local = rpcbproc_gettime_com;
+ break;
+
+ case RPCBPROC_UADDR2TADDR:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_UADDR2TADDR\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_wrapstring;
+ xdr_result = (xdrproc_t)xdr_netbuf;
+ local = rpcbproc_uaddr2taddr_com;
+ break;
+
+ case RPCBPROC_TADDR2UADDR:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_TADDR2UADDR\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_netbuf;
+ xdr_result = (xdrproc_t)xdr_wrapstring;
+ local = rpcbproc_taddr2uaddr_com;
+ break;
+
+ case RPCBPROC_GETADDRLIST:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_GETADDRLIST\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_rpcb;
+ xdr_result = (xdrproc_t)xdr_rpcb_entry_list_ptr;
+ local = rpcbproc_getaddrlist_4_local;
+ break;
+
+ case RPCBPROC_GETSTAT:
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCBPROC_GETSTAT\n");
+#endif
+ xdr_argument = (xdrproc_t)xdr_void;
+ xdr_result = (xdrproc_t)xdr_rpcb_stat_byvers;
+ local = rpcbproc_getstat;
+ break;
+
+ default:
+ svcerr_noproc(transp);
+ return;
+ }
+ memset((char *)&argument, 0, sizeof (argument));
+ if (!svc_getargs(transp, (xdrproc_t) xdr_argument,
+ (char *)&argument)) {
+ svcerr_decode(transp);
+ if (debugging)
+ (void) fprintf(stderr, "rpcbind: could not decode\n");
+ return;
+ }
+ if (!check_access(transp, rqstp->rq_proc, &argument, RPCBVERS4)) {
+ svcerr_weakauth(transp);
+ goto done;
+ }
+ result = (*local)(&argument, rqstp, transp, RPCBVERS4);
+ if (result != NULL && !svc_sendreply(transp, (xdrproc_t) xdr_result,
+ result)) {
+ svcerr_systemerr(transp);
+ if (debugging) {
+ (void) fprintf(stderr, "rpcbind: svc_sendreply\n");
+ if (doabort) {
+ rpcbind_abort();
+ }
+ }
+ }
+done:
+ if (!svc_freeargs(transp, (xdrproc_t) xdr_argument,
+ (char *)&argument)) {
+ if (debugging) {
+ (void) fprintf(stderr, "unable to free arguments\n");
+ if (doabort) {
+ rpcbind_abort();
+ }
+ }
+ }
+ return;
+}
+
+/*
+ * Lookup the mapping for a program, version and return its
+ * address. Assuming that the caller wants the address of the
+ * server running on the transport on which the request came.
+ * Even if a service with a different version number is available,
+ * it will return that address. The client should check with an
+ * clnt_call to verify whether the service is the one that is desired.
+ * We also try to resolve the universal address in terms of
+ * address of the caller.
+ */
+/* ARGSUSED */
+static void *
+rpcbproc_getaddr_4_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t rpcbversnum)
+{
+ RPCB *regp = (RPCB *)arg;
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ char *uaddr;
+
+ uaddr = taddr2uaddr(rpcbind_get_conf(transp->xp_netid),
+ svc_getrpccaller(transp));
+ fprintf(stderr, "RPCB_GETADDR req for (%lu, %lu, %s) from %s: ",
+ (unsigned long)regp->r_prog, (unsigned long)regp->r_vers,
+ regp->r_netid, uaddr);
+ free(uaddr);
+ }
+#endif
+ return (rpcbproc_getaddr_com(regp, rqstp, transp, RPCBVERS4,
+ RPCB_ALLVERS));
+}
+
+/*
+ * Lookup the mapping for a program, version and return its
+ * address. Assuming that the caller wants the address of the
+ * server running on the transport on which the request came.
+ *
+ * We also try to resolve the universal address in terms of
+ * address of the caller.
+ */
+/* ARGSUSED */
+static void *
+rpcbproc_getversaddr_4_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t versnum)
+{
+ RPCB *regp = (RPCB *)arg;
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ char *uaddr;
+
+ uaddr = taddr2uaddr(rpcbind_get_conf(transp->xp_netid),
+ svc_getrpccaller(transp));
+ fprintf(stderr, "RPCB_GETVERSADDR rqst for (%lu, %lu, %s)"
+ " from %s : ",
+ (unsigned long)regp->r_prog, (unsigned long)regp->r_vers,
+ regp->r_netid, uaddr);
+ free(uaddr);
+ }
+#endif
+ return (rpcbproc_getaddr_com(regp, rqstp, transp, RPCBVERS4,
+ RPCB_ONEVERS));
+}
+
+/*
+ * Lookup the mapping for a program, version and return the
+ * addresses for all transports in the current transport family.
+ * We return a merged address.
+ */
+/* ARGSUSED */
+static void *
+rpcbproc_getaddrlist_4_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t versnum)
+{
+ RPCB *regp = (RPCB *)arg;
+ static rpcb_entry_list_ptr rlist;
+ register rpcblist_ptr rbl;
+ rpcb_entry_list_ptr rp, tail = NULL;
+ rpcprog_t prog;
+ rpcvers_t vers;
+ rpcb_entry *a;
+ struct netconfig *nconf;
+ struct netconfig *reg_nconf;
+ char *saddr, *maddr = NULL;
+
+ free_rpcb_entry_list(&rlist);
+ prog = regp->r_prog;
+ vers = regp->r_vers;
+ reg_nconf = rpcbind_get_conf(transp->xp_netid);
+ if (reg_nconf == NULL)
+ return (NULL);
+ if (*(regp->r_addr) != '\0') {
+ saddr = regp->r_addr;
+ } else {
+ saddr = NULL;
+ }
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ fprintf(stderr, "r_addr: %s r_netid: %s nc_protofmly: %s\n",
+ regp->r_addr, regp->r_netid, reg_nconf->nc_protofmly);
+ }
+#endif
+ for (rbl = list_rbl; rbl != NULL; rbl = rbl->rpcb_next) {
+ if ((rbl->rpcb_map.r_prog == prog) &&
+ (rbl->rpcb_map.r_vers == vers)) {
+ nconf = rpcbind_get_conf(rbl->rpcb_map.r_netid);
+ if (nconf == NULL)
+ goto fail;
+ if (strcmp(nconf->nc_protofmly, reg_nconf->nc_protofmly)
+ != 0) {
+ continue; /* not same proto family */
+ }
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "\tmerge with: %s\n", rbl->rpcb_map.r_addr);
+#endif
+ if ((maddr = mergeaddr(transp, rbl->rpcb_map.r_netid,
+ rbl->rpcb_map.r_addr, saddr)) == NULL) {
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, " FAILED\n");
+#endif
+ continue;
+ } else if (!maddr[0]) {
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, " SUCCEEDED, but port died - maddr: nullstring\n");
+#endif
+ /* The server died. Unset this combination */
+ delete_prog(regp->r_prog);
+ free(maddr);
+ continue;
+ }
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, " SUCCEEDED maddr: %s\n", maddr);
+#endif
+ /*
+ * Add it to rlist.
+ */
+ rp = (rpcb_entry_list_ptr)
+ malloc((u_int)sizeof (rpcb_entry_list));
+ if (rp == NULL) {
+ free(maddr);
+ goto fail;
+ }
+ a = &rp->rpcb_entry_map;
+ a->r_maddr = maddr;
+ a->r_nc_netid = nconf->nc_netid;
+ a->r_nc_semantics = nconf->nc_semantics;
+ a->r_nc_protofmly = nconf->nc_protofmly;
+ a->r_nc_proto = nconf->nc_proto;
+ rp->rpcb_entry_next = NULL;
+ if (rlist == NULL) {
+ rlist = rp;
+ tail = rp;
+ } else if (tail) {
+ tail->rpcb_entry_next = rp;
+ tail = rp;
+ }
+ rp = NULL;
+ }
+ }
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ for (rp = rlist; rp; rp = rp->rpcb_entry_next) {
+ fprintf(stderr, "\t%s %s\n", rp->rpcb_entry_map.r_maddr,
+ rp->rpcb_entry_map.r_nc_proto);
+ }
+ }
+#endif
+ /*
+ * XXX: getaddrlist info is also being stuffed into getaddr.
+ * Perhaps wrong, but better than it not getting counted at all.
+ */
+ rpcbs_getaddr(RPCBVERS4 - 2, prog, vers, transp->xp_netid, maddr);
+ return (void *)&rlist;
+
+fail: free_rpcb_entry_list(&rlist);
+ return (NULL);
+}
+
+/*
+ * Free only the allocated structure, rest is all a pointer to some
+ * other data somewhere else.
+ */
+static void
+free_rpcb_entry_list(rpcb_entry_list_ptr *rlistp)
+{
+ register rpcb_entry_list_ptr rbl, tmp;
+
+ for (rbl = *rlistp; rbl != NULL; ) {
+ tmp = rbl;
+ rbl = rbl->rpcb_entry_next;
+ free((char *)tmp->rpcb_entry_map.r_maddr);
+ free((char *)tmp);
+ }
+ *rlistp = NULL;
+}
+
+/* ARGSUSED */
+static void *
+rpcbproc_dump_4_local(void *arg, struct svc_req *req, SVCXPRT *xprt,
+ rpcvers_t versnum)
+{
+ return ((void *)&list_rbl);
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_com.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_com.c
new file mode 100644
index 0000000..d7ac0db
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_com.c
@@ -0,0 +1,1460 @@
+/* $NetBSD: rpcb_svc_com.c,v 1.2 2011/09/16 16:13:18 plunky Exp $ */
+
+/*
+ * 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
+ */
+/*
+ * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
+ */
+
+/* #ident "@(#)rpcb_svc_com.c 1.18 94/05/02 SMI" */
+
+/*
+ * rpcb_svc_com.c
+ * The commom server procedure for the rpcbind.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <rpc/rpc.h>
+#include <rpc/rpcb_prot.h>
+#include <netconfig.h>
+#include <errno.h>
+#include <syslog.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <poll.h>
+#ifdef PORTMAP
+#include <netinet/in.h>
+#include <rpc/pmap_prot.h>
+#endif /* PORTMAP */
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "rpcbind.h"
+#include "svc_dg.h"
+#include "svc_fdset.h"
+
+#define RPC_BUF_MAX 65536 /* can be raised if required */
+
+static char emptystring[] = "";
+static int rpcb_rmtcalls;
+
+struct rmtcallfd_list {
+ int fd;
+ SVCXPRT *xprt;
+ char *netid;
+ struct rmtcallfd_list *next;
+};
+
+#define NFORWARD 64
+#define MAXTIME_OFF 300 /* 5 minutes */
+
+struct finfo {
+ int flag;
+#define FINFO_ACTIVE 0x1
+ u_int32_t caller_xid;
+ struct netbuf *caller_addr;
+ u_int32_t forward_xid;
+ int forward_fd;
+ char *uaddr;
+ rpcproc_t reply_type;
+ rpcvers_t versnum;
+ time_t time;
+};
+static struct finfo FINFO[NFORWARD];
+
+
+static bool_t xdr_encap_parms(XDR *, struct encap_parms *);
+static bool_t xdr_rmtcall_args(XDR *, struct r_rmtcall_args *);
+static bool_t xdr_rmtcall_result(XDR *, struct r_rmtcall_args *);
+static bool_t xdr_opaque_parms(XDR *, struct r_rmtcall_args *);
+static int find_rmtcallfd_by_netid(char *);
+static SVCXPRT *find_rmtcallxprt_by_fd(int);
+static u_int32_t forward_register(u_int32_t, struct netbuf *, int, char *,
+ rpcproc_t, rpcvers_t);
+static struct finfo *forward_find(u_int32_t);
+static int free_slot_by_xid(u_int32_t);
+static int free_slot_by_index(int);
+static int netbufcmp(struct netbuf *, struct netbuf *);
+static struct netbuf *netbufdup(struct netbuf *);
+static void netbuffree(struct netbuf *);
+static int check_rmtcalls(struct pollfd *, int);
+static void xprt_set_caller(SVCXPRT *, struct finfo *);
+static void send_svcsyserr(SVCXPRT *, struct finfo *);
+static void handle_reply(int, SVCXPRT *);
+static void find_versions(rpcprog_t, char *, rpcvers_t *, rpcvers_t *);
+static rpcblist_ptr find_service(rpcprog_t, rpcvers_t, char *);
+static char *getowner(SVCXPRT *, char *, size_t);
+static int add_pmaplist(RPCB *);
+static int del_pmaplist(RPCB *);
+
+/*
+ * Set a mapping of program, version, netid
+ */
+/* ARGSUSED */
+void *
+rpcbproc_set_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t rpcbversnum)
+{
+ RPCB *regp = (RPCB *)arg;
+ static bool_t ans;
+ char owner[64];
+
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCB_SET request for (%lu, %lu, %s, %s) : ",
+ (unsigned long)regp->r_prog, (unsigned long)regp->r_vers,
+ regp->r_netid, regp->r_addr);
+#endif
+ ans = map_set(regp, getowner(transp, owner, sizeof owner));
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "%s\n", ans == TRUE ? "succeeded" : "failed");
+#endif
+ /* XXX: should have used some defined constant here */
+ rpcbs_set(rpcbversnum - 2, ans);
+ return (void *)&ans;
+}
+
+bool_t
+map_set(RPCB *regp, char *owner)
+{
+ RPCB reg, *a;
+ rpcblist_ptr rbl, fnd;
+
+ reg = *regp;
+ /*
+ * check to see if already used
+ * find_service returns a hit even if
+ * the versions don't match, so check for it
+ */
+ fnd = find_service(reg.r_prog, reg.r_vers, reg.r_netid);
+ if (fnd && (fnd->rpcb_map.r_vers == reg.r_vers)) {
+ if (!strcmp(fnd->rpcb_map.r_addr, reg.r_addr))
+ /*
+ * if these match then it is already
+ * registered so just say "OK".
+ */
+ return (TRUE);
+ else
+ return (FALSE);
+ }
+ /*
+ * add to the end of the list
+ */
+ rbl = (rpcblist_ptr) malloc((u_int)sizeof (RPCBLIST));
+ if (rbl == NULL) {
+ return (FALSE);
+ }
+ a = &(rbl->rpcb_map);
+ a->r_prog = reg.r_prog;
+ a->r_vers = reg.r_vers;
+ a->r_netid = strdup(reg.r_netid);
+ a->r_addr = strdup(reg.r_addr);
+ a->r_owner = strdup(owner);
+ if (!a->r_addr || !a->r_netid || !a->r_owner) {
+ if (a->r_netid)
+ free((void *) a->r_netid);
+ if (a->r_addr)
+ free((void *) a->r_addr);
+ if (a->r_owner)
+ free((void *) a->r_owner);
+ free((void *)rbl);
+ return (FALSE);
+ }
+ rbl->rpcb_next = NULL;
+ if (list_rbl == NULL) {
+ list_rbl = rbl;
+ } else {
+ for (fnd = list_rbl; fnd->rpcb_next;
+ fnd = fnd->rpcb_next)
+ ;
+ fnd->rpcb_next = rbl;
+ }
+#ifdef PORTMAP
+ (void) add_pmaplist(regp);
+#endif
+ return (TRUE);
+}
+
+/*
+ * Unset a mapping of program, version, netid
+ */
+/* ARGSUSED */
+void *
+rpcbproc_unset_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t rpcbversnum)
+{
+ RPCB *regp = (RPCB *)arg;
+ static bool_t ans;
+ char owner[64];
+
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "RPCB_UNSET request for (%lu, %lu, %s) : ",
+ (unsigned long)regp->r_prog, (unsigned long)regp->r_vers,
+ regp->r_netid);
+#endif
+ ans = map_unset(regp, getowner(transp, owner, sizeof owner));
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "%s\n", ans == TRUE ? "succeeded" : "failed");
+#endif
+ /* XXX: should have used some defined constant here */
+ rpcbs_unset(rpcbversnum - 2, ans);
+ return (void *)&ans;
+}
+
+bool_t
+map_unset(RPCB *regp, const char *owner)
+{
+ int ans = 0;
+ rpcblist_ptr rbl, prev, tmp;
+
+ if (owner == NULL)
+ return (0);
+
+ for (prev = NULL, rbl = list_rbl; rbl; /* cstyle */) {
+ if ((rbl->rpcb_map.r_prog != regp->r_prog) ||
+ (rbl->rpcb_map.r_vers != regp->r_vers) ||
+ (regp->r_netid[0] && strcasecmp(regp->r_netid,
+ rbl->rpcb_map.r_netid))) {
+ /* both rbl & prev move forwards */
+ prev = rbl;
+ rbl = rbl->rpcb_next;
+ continue;
+ }
+ /*
+ * Check whether appropriate uid. Unset only
+ * if superuser or the owner itself.
+ */
+ if (strcmp(owner, rpcbind_superuser) &&
+ strcmp(rbl->rpcb_map.r_owner, owner))
+ return (0);
+ /* found it; rbl moves forward, prev stays */
+ ans = 1;
+ tmp = rbl;
+ rbl = rbl->rpcb_next;
+ if (prev == NULL)
+ list_rbl = rbl;
+ else
+ prev->rpcb_next = rbl;
+ free((void *) tmp->rpcb_map.r_addr);
+ free((void *) tmp->rpcb_map.r_netid);
+ free((void *) tmp->rpcb_map.r_owner);
+ free((void *) tmp);
+ }
+#ifdef PORTMAP
+ if (ans)
+ (void) del_pmaplist(regp);
+#endif
+ /*
+ * We return 1 either when the entry was not there or it
+ * was able to unset it. It can come to this point only if
+ * atleast one of the conditions is true.
+ */
+ return (1);
+}
+
+void
+delete_prog(int prog)
+{
+ RPCB reg;
+ register rpcblist_ptr rbl;
+
+ for (rbl = list_rbl; rbl != NULL; rbl = rbl->rpcb_next) {
+ if ((rbl->rpcb_map.r_prog != prog))
+ continue;
+ if (is_bound(rbl->rpcb_map.r_netid, rbl->rpcb_map.r_addr))
+ continue;
+ reg.r_prog = rbl->rpcb_map.r_prog;
+ reg.r_vers = rbl->rpcb_map.r_vers;
+ reg.r_netid = strdup(rbl->rpcb_map.r_netid);
+ (void)map_unset(&reg, rpcbind_superuser);
+ free(reg.r_netid);
+ }
+}
+
+void *
+rpcbproc_getaddr_com(RPCB *regp, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t rpcbversnum, rpcvers_t verstype)
+{
+ static char *uaddr;
+ char *saddr = NULL;
+ rpcblist_ptr fnd;
+
+ if (uaddr && uaddr[0])
+ free((void *) uaddr);
+ fnd = find_service(regp->r_prog, regp->r_vers, transp->xp_netid);
+ if (fnd && ((verstype == RPCB_ALLVERS) ||
+ (regp->r_vers == fnd->rpcb_map.r_vers))) {
+ if (*(regp->r_addr) != '\0') { /* may contain a hint about */
+ saddr = regp->r_addr; /* the interface that we */
+ } /* should use */
+ if (!(uaddr = mergeaddr(transp, transp->xp_netid,
+ fnd->rpcb_map.r_addr, saddr))) {
+ /* Try whatever we have */
+ uaddr = strdup(fnd->rpcb_map.r_addr);
+ } else if (!uaddr[0]) {
+ /*
+ * The server died. Unset all versions of this prog.
+ */
+ delete_prog(regp->r_prog);
+ uaddr = emptystring;
+ }
+ } else {
+ uaddr = emptystring;
+ }
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "getaddr: %s\n", uaddr);
+#endif
+ /* XXX: should have used some defined constant here */
+ rpcbs_getaddr(rpcbversnum - 2, regp->r_prog, regp->r_vers,
+ transp->xp_netid, uaddr);
+ return (void *)&uaddr;
+}
+
+/* ARGSUSED */
+void *
+rpcbproc_gettime_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t rpcbversnum)
+{
+ static time_t curtime;
+
+ (void) time(&curtime);
+ return (void *)&curtime;
+}
+
+/*
+ * Convert uaddr to taddr. Should be used only by
+ * local servers/clients. (kernel level stuff only)
+ */
+/* ARGSUSED */
+void *
+rpcbproc_uaddr2taddr_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t rpcbversnum)
+{
+ char **uaddrp = (char **)arg;
+ struct netconfig *nconf;
+ static struct netbuf nbuf;
+ static struct netbuf *taddr;
+
+ if (taddr) {
+ free((void *) taddr->buf);
+ free((void *) taddr);
+ }
+ if (((nconf = rpcbind_get_conf(transp->xp_netid)) == NULL) ||
+ ((taddr = uaddr2taddr(nconf, *uaddrp)) == NULL)) {
+ (void) memset((char *)&nbuf, 0, sizeof (struct netbuf));
+ return (void *)&nbuf;
+ }
+ return (void *)taddr;
+}
+
+/*
+ * Convert taddr to uaddr. Should be used only by
+ * local servers/clients. (kernel level stuff only)
+ */
+/* ARGSUSED */
+void *
+rpcbproc_taddr2uaddr_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
+ rpcvers_t rpcbversnum)
+{
+ struct netbuf *taddr = (struct netbuf *)arg;
+ static char *uaddr;
+ struct netconfig *nconf;
+
+ if (uaddr && !uaddr[0])
+ free((void *) uaddr);
+ if (((nconf = rpcbind_get_conf(transp->xp_netid)) == NULL) ||
+ ((uaddr = taddr2uaddr(nconf, taddr)) == NULL)) {
+ uaddr = emptystring;
+ }
+ return (void *)&uaddr;
+}
+
+
+static bool_t
+xdr_encap_parms(XDR *xdrs, struct encap_parms *epp)
+{
+ return (xdr_bytes(xdrs, &(epp->args), (u_int *) &(epp->arglen), ~0));
+}
+
+/*
+ * XDR remote call arguments. It ignores the address part.
+ * written for XDR_DECODE direction only
+ */
+static bool_t
+xdr_rmtcall_args(XDR *xdrs, struct r_rmtcall_args *cap)
+{
+ /* does not get the address or the arguments */
+ if (xdr_u_int32_t(xdrs, &(cap->rmt_prog)) &&
+ xdr_u_int32_t(xdrs, &(cap->rmt_vers)) &&
+ xdr_u_int32_t(xdrs, &(cap->rmt_proc))) {
+ return (xdr_encap_parms(xdrs, &(cap->rmt_args)));
+ }
+ return (FALSE);
+}
+
+/*
+ * XDR remote call results along with the address. Ignore
+ * program number, version number and proc number.
+ * Written for XDR_ENCODE direction only.
+ */
+static bool_t
+xdr_rmtcall_result(XDR *xdrs, struct r_rmtcall_args *cap)
+{
+ bool_t result;
+
+#ifdef PORTMAP
+ if (cap->rmt_localvers == PMAPVERS) {
+ int h1, h2, h3, h4, p1, p2;
+ u_long port;
+
+ /* interpret the universal address for TCP/IP */
+ if (sscanf(cap->rmt_uaddr, "%d.%d.%d.%d.%d.%d",
+ &h1, &h2, &h3, &h4, &p1, &p2) != 6)
+ return (FALSE);
+ port = ((p1 & 0xff) << 8) + (p2 & 0xff);
+ result = xdr_u_long(xdrs, &port);
+ } else
+#endif
+ if ((cap->rmt_localvers == RPCBVERS) ||
+ (cap->rmt_localvers == RPCBVERS4)) {
+ result = xdr_wrapstring(xdrs, &(cap->rmt_uaddr));
+ } else {
+ return (FALSE);
+ }
+ if (result == TRUE)
+ return (xdr_encap_parms(xdrs, &(cap->rmt_args)));
+ return (FALSE);
+}
+
+/*
+ * only worries about the struct encap_parms part of struct r_rmtcall_args.
+ * The arglen must already be set!!
+ */
+static bool_t
+xdr_opaque_parms(XDR *xdrs, struct r_rmtcall_args *cap)
+{
+ return (xdr_opaque(xdrs, cap->rmt_args.args, cap->rmt_args.arglen));
+}
+
+static struct rmtcallfd_list *rmthead;
+static struct rmtcallfd_list *rmttail;
+
+int
+create_rmtcall_fd(struct netconfig *nconf)
+{
+ int fd;
+ struct rmtcallfd_list *rmt;
+ SVCXPRT *xprt;
+
+ if ((fd = __rpc_nconf2fd(nconf)) == -1) {
+ if (debugging)
+ fprintf(stderr,
+ "create_rmtcall_fd: couldn't open \"%s\" (errno %d)\n",
+ nconf->nc_device, errno);
+ return (-1);
+ }
+ xprt = svc_tli_create(fd, 0, (struct t_bind *) 0, 0, 0);
+ if (xprt == NULL) {
+ if (debugging)
+ fprintf(stderr,
+ "create_rmtcall_fd: svc_tli_create failed\n");
+ return (-1);
+ }
+ rmt = (struct rmtcallfd_list *)malloc((u_int)
+ sizeof (struct rmtcallfd_list));
+ if (rmt == NULL) {
+ syslog(LOG_ERR, "create_rmtcall_fd: no memory!");
+ return (-1);
+ }
+ rmt->xprt = xprt;
+ rmt->netid = strdup(nconf->nc_netid);
+ xprt->xp_netid = rmt->netid;
+ rmt->fd = fd;
+ rmt->next = NULL;
+ if (rmthead == NULL) {
+ rmthead = rmt;
+ rmttail = rmt;
+ } else {
+ rmttail->next = rmt;
+ rmttail = rmt;
+ }
+ /* XXX not threadsafe */
+ if (fd > *get_fdsetmax())
+ *get_fdsetmax() = fd;
+ FD_SET(fd, get_fdset());
+ return (fd);
+}
+
+static int
+find_rmtcallfd_by_netid(char *netid)
+{
+ struct rmtcallfd_list *rmt;
+
+ for (rmt = rmthead; rmt != NULL; rmt = rmt->next) {
+ if (strcmp(netid, rmt->netid) == 0) {
+ return (rmt->fd);
+ }
+ }
+ return (-1);
+}
+
+static SVCXPRT *
+find_rmtcallxprt_by_fd(int fd)
+{
+ struct rmtcallfd_list *rmt;
+
+ for (rmt = rmthead; rmt != NULL; rmt = rmt->next) {
+ if (fd == rmt->fd) {
+ return (rmt->xprt);
+ }
+ }
+ return (NULL);
+}
+
+
+/*
+ * Call a remote procedure service. This procedure is very quiet when things
+ * go wrong. The proc is written to support broadcast rpc. In the broadcast
+ * case, a machine should shut-up instead of complain, lest the requestor be
+ * overrun with complaints at the expense of not hearing a valid reply.
+ * When receiving a request and verifying that the service exists, we
+ *
+ * receive the request
+ *
+ * open a new TLI endpoint on the same transport on which we received
+ * the original request
+ *
+ * remember the original request's XID (which requires knowing the format
+ * of the svc_dg_data structure)
+ *
+ * forward the request, with a new XID, to the requested service,
+ * remembering the XID used to send this request (for later use in
+ * reassociating the answer with the original request), the requestor's
+ * address, the file descriptor on which the forwarded request is
+ * made and the service's address.
+ *
+ * mark the file descriptor on which we anticipate receiving a reply from
+ * the service and one to select for in our private svc_run procedure
+ *
+ * At some time in the future, a reply will be received from the service to
+ * which we forwarded the request. At that time, we detect that the socket
+ * used was for forwarding (by looking through the finfo structures to see
+ * whether the fd corresponds to one of those) and call handle_reply() to
+ *
+ * receive the reply
+ *
+ * bundle the reply, along with the service's universal address
+ *
+ * create a SVCXPRT structure and use a version of svc_sendreply
+ * that allows us to specify the reply XID and destination, send the reply
+ * to the original requestor.
+ */
+
+void
+rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
+ rpcproc_t reply_type, rpcvers_t versnum)
+{
+ register rpcblist_ptr rbl;
+ struct netconfig *nconf;
+ struct netbuf *caller;
+ struct r_rmtcall_args a;
+ char *buf_alloc = NULL, *outbufp;
+ char *outbuf_alloc = NULL;
+ char buf[RPC_BUF_MAX], outbuf[RPC_BUF_MAX];
+ struct netbuf *na = NULL;
+ struct rpc_msg call_msg;
+ int outlen;
+ u_int sendsz;
+ XDR outxdr;
+ AUTH *auth;
+ int fd = -1;
+ char *uaddr, *m_uaddr, *local_uaddr = NULL;
+ u_int32_t *xidp;
+ struct __rpc_sockinfo si;
+ struct sockaddr *localsa;
+ struct netbuf tbuf;
+
+ if (!__rpc_fd2sockinfo(transp->xp_fd, &si)) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ return;
+ }
+ if (si.si_socktype != SOCK_DGRAM)
+ return; /* Only datagram type accepted */
+ sendsz = __rpc_get_t_size(si.si_af, si.si_proto, UDPMSGSIZE);
+ if (sendsz == 0) { /* data transfer not supported */
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ return;
+ }
+ /*
+ * Should be multiple of 4 for XDR.
+ */
+ sendsz = ((sendsz + 3) / 4) * 4;
+ if (sendsz > RPC_BUF_MAX) {
+#ifdef notyet
+ buf_alloc = alloca(sendsz); /* not in IDR2? */
+#else
+ buf_alloc = malloc(sendsz);
+#endif /* notyet */
+ if (buf_alloc == NULL) {
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: No Memory!\n");
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ return;
+ }
+ a.rmt_args.args = buf_alloc;
+ } else {
+ a.rmt_args.args = buf;
+ }
+
+ call_msg.rm_xid = 0; /* For error checking purposes */
+ if (!svc_getargs(transp, (xdrproc_t) xdr_rmtcall_args, (char *) &a)) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_decode(transp);
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: svc_getargs failed\n");
+ goto error;
+ }
+
+ if (!check_callit(transp, &a, versnum)) {
+ svcerr_weakauth(transp);
+ goto error;
+ }
+
+ caller = svc_getrpccaller(transp);
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ uaddr = taddr2uaddr(rpcbind_get_conf(transp->xp_netid), caller);
+ fprintf(stderr, "%s %s req for (%lu, %lu, %lu, %s) from %s : ",
+ versnum == PMAPVERS ? "pmap_rmtcall" :
+ versnum == RPCBVERS ? "rpcb_rmtcall" :
+ versnum == RPCBVERS4 ? "rpcb_indirect" :
+ rpcbind_unknown,
+ reply_type == RPCBPROC_INDIRECT ? "indirect" : "callit",
+ (unsigned long)a.rmt_prog, (unsigned long)a.rmt_vers,
+ (unsigned long)a.rmt_proc, transp->xp_netid,
+ uaddr ? uaddr : rpcbind_unknown);
+ if (uaddr)
+ free((void *) uaddr);
+ }
+#endif
+
+ rbl = find_service(a.rmt_prog, a.rmt_vers, transp->xp_netid);
+
+ rpcbs_rmtcall(versnum - 2, reply_type, a.rmt_prog, a.rmt_vers,
+ a.rmt_proc, transp->xp_netid, rbl);
+
+ if (rbl == NULL) {
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "not found\n");
+#endif
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_noprog(transp);
+ goto error;
+ }
+ if (rbl->rpcb_map.r_vers != a.rmt_vers) {
+ if (reply_type == RPCBPROC_INDIRECT) {
+ rpcvers_t vers_low, vers_high;
+
+ find_versions(a.rmt_prog, transp->xp_netid,
+ &vers_low, &vers_high);
+ svcerr_progvers(transp, vers_low, vers_high);
+ }
+ goto error;
+ }
+
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "found at uaddr %s\n", rbl->rpcb_map.r_addr);
+#endif
+ /*
+ * Check whether this entry is valid and a server is present
+ * Mergeaddr() returns NULL if no such entry is present, and
+ * returns "" if the entry was present but the server is not
+ * present (i.e., it crashed).
+ */
+ if (reply_type == RPCBPROC_INDIRECT) {
+ uaddr = mergeaddr(transp, transp->xp_netid,
+ rbl->rpcb_map.r_addr, NULL);
+ if (uaddr == NULL || uaddr[0] == '\0') {
+ svcerr_noprog(transp);
+ if (uaddr != NULL) {
+ free((void *) uaddr);
+ }
+ goto error;
+ }
+ if (uaddr != NULL) {
+ free((void *) uaddr);
+ }
+ }
+ nconf = rpcbind_get_conf(transp->xp_netid);
+ if (nconf == NULL) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: rpcbind_get_conf failed\n");
+ goto error;
+ }
+ localsa = local_sa(((struct sockaddr *)caller->buf)->sa_family);
+ if (localsa == NULL) {
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: no local address\n");
+ goto error;
+ }
+ tbuf.len = tbuf.maxlen = localsa->sa_len;
+ tbuf.buf = localsa;
+ local_uaddr =
+ addrmerge(&tbuf, rbl->rpcb_map.r_addr, NULL, nconf->nc_netid);
+ m_uaddr = addrmerge(caller, rbl->rpcb_map.r_addr, NULL,
+ nconf->nc_netid);
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "merged uaddr %s\n", m_uaddr);
+#endif
+ if ((fd = find_rmtcallfd_by_netid(nconf->nc_netid)) == -1) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ free((void *) m_uaddr);
+ goto error;
+ }
+ xidp = __rpcb_get_dg_xidp(transp);
+ call_msg.rm_xid = forward_register(*xidp,
+ caller, fd, m_uaddr, reply_type, versnum);
+ if (call_msg.rm_xid == 0) {
+ /*
+ * A duplicate request for the slow server. Let's not
+ * beat on it any more.
+ */
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: duplicate request\n");
+ free((void *) m_uaddr);
+ goto error;
+ } else if (call_msg.rm_xid == -1) {
+ /* forward_register failed. Perhaps no memory. */
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: forward_register failed\n");
+ free((void *) m_uaddr);
+ goto error;
+ }
+
+#ifdef DEBUG_RMTCALL
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: original XID %x, new XID %x\n",
+ *xidp, call_msg.rm_xid);
+#endif
+ call_msg.rm_direction = CALL;
+ call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
+ call_msg.rm_call.cb_prog = a.rmt_prog;
+ call_msg.rm_call.cb_vers = a.rmt_vers;
+ if (sendsz > RPC_BUF_MAX) {
+#ifdef notyet
+ outbuf_alloc = alloca(sendsz); /* not in IDR2? */
+#else
+ outbuf_alloc = malloc(sendsz);
+#endif /* notyet */
+ if (outbuf_alloc == NULL) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: No memory!\n");
+ goto error;
+ }
+ xdrmem_create(&outxdr, outbuf_alloc, sendsz, XDR_ENCODE);
+ } else {
+ xdrmem_create(&outxdr, outbuf, sendsz, XDR_ENCODE);
+ }
+ if (!xdr_callhdr(&outxdr, &call_msg)) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: xdr_callhdr failed\n");
+ goto error;
+ }
+ if (!xdr_u_int32_t(&outxdr, &(a.rmt_proc))) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: xdr_u_long failed\n");
+ goto error;
+ }
+
+ if (rqstp->rq_cred.oa_flavor == AUTH_NULL) {
+ auth = authnone_create();
+ } else if (rqstp->rq_cred.oa_flavor == AUTH_SYS) {
+ struct authunix_parms *au;
+
+ au = (struct authunix_parms *)rqstp->rq_clntcred;
+ auth = authunix_create(au->aup_machname,
+ au->aup_uid, au->aup_gid,
+ au->aup_len, au->aup_gids);
+ if (auth == NULL) /* fall back */
+ auth = authnone_create();
+ } else {
+ /* we do not support any other authentication scheme */
+ if (debugging)
+ fprintf(stderr,
+"rpcbproc_callit_com: oa_flavor != AUTH_NONE and oa_flavor != AUTH_SYS\n");
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_weakauth(transp); /* XXX too strong.. */
+ goto error;
+ }
+ if (auth == NULL) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: authwhatever_create returned NULL\n");
+ goto error;
+ }
+ if (!AUTH_MARSHALL(auth, &outxdr)) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ AUTH_DESTROY(auth);
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: AUTH_MARSHALL failed\n");
+ goto error;
+ }
+ AUTH_DESTROY(auth);
+ if (!xdr_opaque_parms(&outxdr, &a)) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: xdr_opaque_parms failed\n");
+ goto error;
+ }
+ outlen = (int) XDR_GETPOS(&outxdr);
+ if (outbuf_alloc)
+ outbufp = outbuf_alloc;
+ else
+ outbufp = outbuf;
+
+ na = uaddr2taddr(nconf, local_uaddr);
+ if (!na) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ goto error;
+ }
+
+ if (sendto(fd, outbufp, outlen, 0, (struct sockaddr *)na->buf, na->len)
+ != outlen) {
+ if (debugging)
+ fprintf(stderr,
+ "rpcbproc_callit_com: sendto failed: errno %d\n", errno);
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_systemerr(transp);
+ goto error;
+ }
+ goto out;
+
+error:
+ if (call_msg.rm_xid != 0)
+ (void) free_slot_by_xid(call_msg.rm_xid);
+out:
+ if (local_uaddr)
+ free(local_uaddr);
+ if (buf_alloc)
+ free((void *) buf_alloc);
+ if (outbuf_alloc)
+ free((void *) outbuf_alloc);
+ if (na) {
+ free(na->buf);
+ free(na);
+ }
+}
+
+/*
+ * Makes an entry into the FIFO for the given request.
+ * If duplicate request, returns a 0, else returns the xid of its call.
+ */
+static u_int32_t
+forward_register(u_int32_t caller_xid, struct netbuf *caller_addr,
+ int forward_fd, char *uaddr, rpcproc_t reply_type,
+ rpcvers_t versnum)
+{
+ int i;
+ int j = 0;
+ time_t min_time, time_now;
+ static u_int32_t lastxid;
+ int entry = -1;
+
+ min_time = FINFO[0].time;
+ time_now = time((time_t *)0);
+ /* initialization */
+ if (lastxid == 0)
+ lastxid = time_now * NFORWARD;
+
+ /*
+ * Check if it is an duplicate entry. Then,
+ * try to find an empty slot. If not available, then
+ * use the slot with the earliest time.
+ */
+ for (i = 0; i < NFORWARD; i++) {
+ if (FINFO[i].flag & FINFO_ACTIVE) {
+ if ((FINFO[i].caller_xid == caller_xid) &&
+ (FINFO[i].reply_type == reply_type) &&
+ (FINFO[i].versnum == versnum) &&
+ (!netbufcmp(FINFO[i].caller_addr,
+ caller_addr))) {
+ FINFO[i].time = time((time_t *)0);
+ return (0); /* Duplicate entry */
+ } else {
+ /* Should we wait any longer */
+ if ((time_now - FINFO[i].time) > MAXTIME_OFF)
+ (void) free_slot_by_index(i);
+ }
+ }
+ if (entry == -1) {
+ if ((FINFO[i].flag & FINFO_ACTIVE) == 0) {
+ entry = i;
+ } else if (FINFO[i].time < min_time) {
+ j = i;
+ min_time = FINFO[i].time;
+ }
+ }
+ }
+ if (entry != -1) {
+ /* use this empty slot */
+ j = entry;
+ } else {
+ (void) free_slot_by_index(j);
+ }
+ if ((FINFO[j].caller_addr = netbufdup(caller_addr)) == NULL) {
+ return (-1);
+ }
+ rpcb_rmtcalls++; /* no of pending calls */
+ FINFO[j].flag = FINFO_ACTIVE;
+ FINFO[j].reply_type = reply_type;
+ FINFO[j].versnum = versnum;
+ FINFO[j].time = time_now;
+ FINFO[j].caller_xid = caller_xid;
+ FINFO[j].forward_fd = forward_fd;
+ /*
+ * Though uaddr is not allocated here, it will still be freed
+ * from free_slot_*().
+ */
+ FINFO[j].uaddr = uaddr;
+ lastxid = lastxid + NFORWARD;
+ FINFO[j].forward_xid = lastxid + j; /* encode slot */
+ return (FINFO[j].forward_xid); /* forward on this xid */
+}
+
+static struct finfo *
+forward_find(u_int32_t reply_xid)
+{
+ int i;
+
+ i = reply_xid % NFORWARD;
+ if (i < 0)
+ i += NFORWARD;
+ if ((FINFO[i].flag & FINFO_ACTIVE) &&
+ (FINFO[i].forward_xid == reply_xid)) {
+ return (&FINFO[i]);
+ }
+ return (NULL);
+}
+
+static int
+free_slot_by_xid(u_int32_t xid)
+{
+ int entry;
+
+ entry = xid % NFORWARD;
+ if (entry < 0)
+ entry += NFORWARD;
+ return (free_slot_by_index(entry));
+}
+
+static int
+free_slot_by_index(int idx)
+{
+ struct finfo *fi;
+
+ fi = &FINFO[idx];
+ if (fi->flag & FINFO_ACTIVE) {
+ netbuffree(fi->caller_addr);
+ /* XXX may be too big, but can't access xprt array here */
+ if (fi->forward_fd >= *get_fdsetmax())
+ (*get_fdsetmax())--;
+ free((void *) fi->uaddr);
+ fi->flag &= ~FINFO_ACTIVE;
+ rpcb_rmtcalls--;
+ return (1);
+ }
+ return (0);
+}
+
+static int
+netbufcmp(struct netbuf *n1, struct netbuf *n2)
+{
+ return ((n1->len != n2->len) || memcmp(n1->buf, n2->buf, n1->len));
+}
+
+static struct netbuf *
+netbufdup(struct netbuf *ap)
+{
+ struct netbuf *np;
+
+ np = (struct netbuf *) malloc(sizeof (struct netbuf) + ap->len);
+ if (np) {
+ np->maxlen = np->len = ap->len;
+ np->buf = ((char *) np) + sizeof (struct netbuf);
+ (void) memcpy(np->buf, ap->buf, ap->len);
+ }
+ return (np);
+}
+
+static void
+netbuffree(struct netbuf *ap)
+{
+ free((void *) ap);
+}
+
+
+#define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)
+extern bool_t __svc_clean_idle(fd_set *, int, bool_t);
+
+void
+my_svc_run()
+{
+ size_t nfds;
+ struct pollfd pollfds[FD_SETSIZE];
+ int poll_ret, check_ret;
+ int n;
+#ifdef SVC_RUN_DEBUG
+ int i;
+#endif
+ register struct pollfd *p;
+ fd_set cleanfds;
+
+ for (;;) {
+ p = pollfds;
+ for (n = 0; n <= *get_fdsetmax(); n++) {
+ if (FD_ISSET(n, get_fdset())) {
+ p->fd = n;
+ p->events = MASKVAL;
+ p++;
+ }
+ }
+ nfds = p - pollfds;
+ poll_ret = 0;
+#ifdef SVC_RUN_DEBUG
+ if (debugging) {
+ fprintf(stderr, "polling for read on fd < ");
+ for (i = 0, p = pollfds; i < nfds; i++, p++)
+ if (p->events)
+ fprintf(stderr, "%d ", p->fd);
+ fprintf(stderr, ">\n");
+ }
+#endif
+ poll_ret = rump_sys_poll(pollfds, nfds, 30 * 1000);
+ //printf("rpcbind poll got %d\n", poll_ret);
+ switch (poll_ret) {
+ case -1:
+ /*
+ * We ignore all errors, continuing with the assumption
+ * that it was set by the signal handlers (or any
+ * other outside event) and not caused by poll().
+ */
+ case 0:
+ cleanfds = *get_fdset();
+ __svc_clean_idle(&cleanfds, 30, FALSE);
+ continue;
+ default:
+#ifdef SVC_RUN_DEBUG
+ if (debugging) {
+ fprintf(stderr, "poll returned read fds < ");
+ for (i = 0, p = pollfds; i < nfds; i++, p++)
+ if (p->revents)
+ fprintf(stderr, "%d (0x%x) ", p->fd, p->revents);
+ fprintf(stderr, ">\n");
+ }
+#endif
+ /*
+ * If we found as many replies on callback fds
+ * as the number of descriptors selectable which
+ * poll() returned, there can be no more so we
+ * don't call svc_getreq_poll. Otherwise, there
+ * must be another so we must call svc_getreq_poll.
+ */
+ if ((check_ret = check_rmtcalls(pollfds, nfds)) ==
+ poll_ret)
+ continue;
+ svc_getreq_poll(pollfds, poll_ret-check_ret);
+ }
+#ifdef SVC_RUN_DEBUG
+ if (debugging) {
+ fprintf(stderr, "svc_maxfd now %u\n", *get_fdsetmax());
+ }
+#endif
+ }
+}
+
+static int
+check_rmtcalls(struct pollfd *pfds, int nfds)
+{
+ int j, ncallbacks_found = 0, rmtcalls_pending;
+ SVCXPRT *xprt;
+
+ if (rpcb_rmtcalls == 0)
+ return (0);
+
+ rmtcalls_pending = rpcb_rmtcalls;
+ for (j = 0; j < nfds; j++) {
+ if ((xprt = find_rmtcallxprt_by_fd(pfds[j].fd)) != NULL) {
+ if (pfds[j].revents) {
+ ncallbacks_found++;
+#ifdef DEBUG_RMTCALL
+ if (debugging)
+ fprintf(stderr,
+"my_svc_run: polled on forwarding fd %d, netid %s - calling handle_reply\n",
+ pfds[j].fd, xprt->xp_netid);
+#endif
+ handle_reply(pfds[j].fd, xprt);
+ pfds[j].revents = 0;
+ if (ncallbacks_found >= rmtcalls_pending) {
+ break;
+ }
+ }
+ }
+ }
+ return (ncallbacks_found);
+}
+
+static void
+xprt_set_caller(SVCXPRT *xprt, struct finfo *fi)
+{
+ u_int32_t *xidp;
+
+ *(svc_getrpccaller(xprt)) = *(fi->caller_addr);
+ xidp = __rpcb_get_dg_xidp(xprt);
+ *xidp = fi->caller_xid;
+}
+
+/*
+ * Call svcerr_systemerr() only if RPCBVERS4
+ */
+static void
+send_svcsyserr(SVCXPRT *xprt, struct finfo *fi)
+{
+ if (fi->reply_type == RPCBPROC_INDIRECT) {
+ xprt_set_caller(xprt, fi);
+ svcerr_systemerr(xprt);
+ }
+ return;
+}
+
+static void
+handle_reply(int fd, SVCXPRT *xprt)
+{
+ XDR reply_xdrs;
+ struct rpc_msg reply_msg;
+ struct rpc_err reply_error;
+ char *buffer;
+ struct finfo *fi;
+ int inlen, pos, len;
+ struct r_rmtcall_args a;
+ struct sockaddr_storage ss;
+ socklen_t fromlen;
+#ifdef SVC_RUN_DEBUG
+ char *uaddr;
+#endif
+
+ buffer = malloc(RPC_BUF_MAX);
+ if (buffer == NULL)
+ goto done;
+
+ do {
+ fromlen = sizeof ss;
+ inlen = recvfrom(fd, buffer, RPC_BUF_MAX, 0,
+ (struct sockaddr *)&ss, &fromlen);
+ } while (inlen < 0 && errno == EINTR);
+ if (inlen < 0) {
+ if (debugging)
+ fprintf(stderr,
+ "handle_reply: recvfrom returned %d, errno %d\n", inlen, errno);
+ goto done;
+ }
+
+ reply_msg.acpted_rply.ar_verf = _null_auth;
+ reply_msg.acpted_rply.ar_results.where = 0;
+ reply_msg.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void;
+
+ xdrmem_create(&reply_xdrs, buffer, (u_int)inlen, XDR_DECODE);
+ if (!xdr_replymsg(&reply_xdrs, &reply_msg)) {
+ if (debugging)
+ (void) fprintf(stderr,
+ "handle_reply: xdr_replymsg failed\n");
+ goto done;
+ }
+ fi = forward_find(reply_msg.rm_xid);
+#ifdef SVC_RUN_DEBUG
+ if (debugging) {
+ fprintf(stderr, "handle_reply: reply xid: %d fi addr: %p\n",
+ reply_msg.rm_xid, fi);
+ }
+#endif
+ if (fi == NULL) {
+ goto done;
+ }
+ _seterr_reply(&reply_msg, &reply_error);
+ if (reply_error.re_status != RPC_SUCCESS) {
+ if (debugging)
+ (void) fprintf(stderr, "handle_reply: %s\n",
+ clnt_sperrno(reply_error.re_status));
+ send_svcsyserr(xprt, fi);
+ goto done;
+ }
+ pos = XDR_GETPOS(&reply_xdrs);
+ len = inlen - pos;
+ a.rmt_args.args = &buffer[pos];
+ a.rmt_args.arglen = len;
+ a.rmt_uaddr = fi->uaddr;
+ a.rmt_localvers = fi->versnum;
+
+ xprt_set_caller(xprt, fi);
+#ifdef SVC_RUN_DEBUG
+ uaddr = taddr2uaddr(rpcbind_get_conf("udp"),
+ svc_getrpccaller(xprt));
+ if (debugging) {
+ fprintf(stderr, "handle_reply: forwarding address %s to %s\n",
+ a.rmt_uaddr, uaddr ? uaddr : rpcbind_unknown);
+ }
+ if (uaddr)
+ free((void *) uaddr);
+#endif
+ svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a);
+done:
+ if (buffer)
+ free(buffer);
+
+ if (reply_msg.rm_xid == 0) {
+#ifdef SVC_RUN_DEBUG
+ if (debugging) {
+ fprintf(stderr, "handle_reply: NULL xid on exit!\n");
+ }
+#endif
+ } else
+ (void) free_slot_by_xid(reply_msg.rm_xid);
+ return;
+}
+
+static void
+find_versions(rpcprog_t prog, char *netid, rpcvers_t *lowvp, rpcvers_t *highvp)
+{
+ register rpcblist_ptr rbl;
+ int lowv = 0;
+ int highv = 0;
+
+ for (rbl = list_rbl; rbl != NULL; rbl = rbl->rpcb_next) {
+ if ((rbl->rpcb_map.r_prog != prog) ||
+ ((rbl->rpcb_map.r_netid != NULL) &&
+ (strcasecmp(rbl->rpcb_map.r_netid, netid) != 0)))
+ continue;
+ if (lowv == 0) {
+ highv = rbl->rpcb_map.r_vers;
+ lowv = highv;
+ } else if (rbl->rpcb_map.r_vers < lowv) {
+ lowv = rbl->rpcb_map.r_vers;
+ } else if (rbl->rpcb_map.r_vers > highv) {
+ highv = rbl->rpcb_map.r_vers;
+ }
+ }
+ *lowvp = lowv;
+ *highvp = highv;
+ return;
+}
+
+/*
+ * returns the item with the given program, version number and netid.
+ * If that version number is not found, it returns the item with that
+ * program number, so that address is now returned to the caller. The
+ * caller when makes a call to this program, version number, the call
+ * will fail and it will return with PROGVERS_MISMATCH. The user can
+ * then determine the highest and the lowest version number for this
+ * program using clnt_geterr() and use those program version numbers.
+ *
+ * Returns the RPCBLIST for the given prog, vers and netid
+ */
+static rpcblist_ptr
+find_service(rpcprog_t prog, rpcvers_t vers, char *netid)
+{
+ register rpcblist_ptr hit = NULL;
+ register rpcblist_ptr rbl;
+
+ for (rbl = list_rbl; rbl != NULL; rbl = rbl->rpcb_next) {
+ if ((rbl->rpcb_map.r_prog != prog) ||
+ ((rbl->rpcb_map.r_netid != NULL) &&
+ (strcasecmp(rbl->rpcb_map.r_netid, netid) != 0)))
+ continue;
+ hit = rbl;
+ if (rbl->rpcb_map.r_vers == vers)
+ break;
+ }
+ return (hit);
+}
+
+/*
+ * Copies the name associated with the uid of the caller and returns
+ * a pointer to it. Similar to getwd().
+ */
+static char *
+getowner(SVCXPRT *transp, char *owner, size_t ownersize)
+{
+ struct sockcred *sc;
+
+ sc = __svc_getcallercreds(transp);
+ if (sc == NULL)
+ strlcpy(owner, rpcbind_unknown, ownersize);
+ else if (sc->sc_uid == 0)
+ strlcpy(owner, rpcbind_superuser, ownersize);
+ else
+ snprintf(owner, ownersize, "%d", sc->sc_uid);
+
+ return owner;
+}
+
+#ifdef PORTMAP
+/*
+ * Add this to the pmap list only if it is UDP or TCP.
+ */
+static int
+add_pmaplist(RPCB *arg)
+{
+ struct pmap pmap;
+ struct pmaplist *pml;
+ int h1, h2, h3, h4, p1, p2;
+
+ if (strcmp(arg->r_netid, udptrans) == 0) {
+ /* It is UDP! */
+ pmap.pm_prot = IPPROTO_UDP;
+ } else if (strcmp(arg->r_netid, tcptrans) == 0) {
+ /* It is TCP */
+ pmap.pm_prot = IPPROTO_TCP;
+ } else
+ /* Not a IP protocol */
+ return (0);
+
+ /* interpret the universal address for TCP/IP */
+ if (sscanf(arg->r_addr, "%d.%d.%d.%d.%d.%d",
+ &h1, &h2, &h3, &h4, &p1, &p2) != 6)
+ return (0);
+ pmap.pm_port = ((p1 & 0xff) << 8) + (p2 & 0xff);
+ pmap.pm_prog = arg->r_prog;
+ pmap.pm_vers = arg->r_vers;
+ /*
+ * add to END of list
+ */
+ pml = (struct pmaplist *) malloc((u_int)sizeof (struct pmaplist));
+ if (pml == NULL) {
+ (void) syslog(LOG_ERR, "rpcbind: no memory!\n");
+ return (1);
+ }
+ pml->pml_map = pmap;
+ pml->pml_next = NULL;
+ if (list_pml == NULL) {
+ list_pml = pml;
+ } else {
+ struct pmaplist *fnd;
+
+ /* Attach to the end of the list */
+ for (fnd = list_pml; fnd->pml_next; fnd = fnd->pml_next)
+ ;
+ fnd->pml_next = pml;
+ }
+ return (0);
+}
+
+/*
+ * Delete this from the pmap list only if it is UDP or TCP.
+ */
+static int
+del_pmaplist(RPCB *arg)
+{
+ struct pmaplist *pml;
+ struct pmaplist *prevpml, *fnd;
+ long prot;
+
+ if (strcmp(arg->r_netid, udptrans) == 0) {
+ /* It is UDP! */
+ prot = IPPROTO_UDP;
+ } else if (strcmp(arg->r_netid, tcptrans) == 0) {
+ /* It is TCP */
+ prot = IPPROTO_TCP;
+ } else if (arg->r_netid[0] == 0) {
+ prot = 0; /* Remove all occurrences */
+ } else {
+ /* Not a IP protocol */
+ return (0);
+ }
+ for (prevpml = NULL, pml = list_pml; pml; /* cstyle */) {
+ if ((pml->pml_map.pm_prog != arg->r_prog) ||
+ (pml->pml_map.pm_vers != arg->r_vers) ||
+ (prot && (pml->pml_map.pm_prot != prot))) {
+ /* both pml & prevpml move forwards */
+ prevpml = pml;
+ pml = pml->pml_next;
+ continue;
+ }
+ /* found it; pml moves forward, prevpml stays */
+ fnd = pml;
+ pml = pml->pml_next;
+ if (prevpml == NULL)
+ list_pml = pml;
+ else
+ prevpml->pml_next = pml;
+ free((void *) fnd);
+ }
+ return (0);
+}
+#endif /* PORTMAP */
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.8 b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.8
new file mode 100644
index 0000000..c77f1d5
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.8
@@ -0,0 +1,127 @@
+.\" $NetBSD: rpcbind.8,v 1.1 2010/07/26 15:53:00 pooka Exp $
+.\" @(#)rpcbind.1m 1.19 92/09/14 SMI; from SVr4
+.\" Copyright 1989 AT&T
+.\" Copyright 1991 Sun Microsystems, Inc.
+.Dd October 19, 2008
+.Dt RPCBIND 8
+.Sh NAME
+.Nm rpcbind
+.Nd universal addresses to RPC program number mapper
+.Sh SYNOPSIS
+.Nm
+.Op Fl dilLs
+.Sh DESCRIPTION
+.Nm
+is a server that converts
+.Tn RPC
+program numbers into
+universal addresses.
+It must be running on the host to be able to make
+.Tn RPC
+calls
+on a server on that machine.
+.Pp
+When an
+.Tn RPC
+service is started,
+it tells
+.Nm
+the address at which it is listening,
+and the
+.Tn RPC
+program numbers it is prepared to serve.
+When a client wishes to make an
+.Tn RPC
+call to a given program number,
+it first contacts
+.Nm
+on the server machine to determine
+the address where
+.Tn RPC
+requests should be sent.
+.Pp
+.Nm
+should be started before any other RPC service.
+Normally, standard
+.Tn RPC
+servers are started by port monitors, so
+.Nm
+must be started before port monitors are invoked.
+.Pp
+When
+.Nm
+is started, it checks that certain name-to-address
+translation-calls function correctly.
+If they fail, the network configuration databases may be corrupt.
+Since
+.Tn RPC
+services cannot function correctly in this situation,
+.Nm
+reports the condition and terminates.
+.Pp
+.Nm
+can only be started by the super-user.
+.Pp
+Access control is provided by
+.Pa /etc/hosts.allow
+and
+.Pa /etc/hosts.deny ,
+as described in
+.Xr hosts_access 5
+with daemon name
+.Nm .
+.Sh OPTIONS
+.Bl -tag -width Ds
+.It Fl d
+Run in debug mode.
+In this mode,
+.Nm
+will not fork when it starts, will print additional information
+during operation, and will abort on certain errors.
+With this option, the name-to-address translation consistency
+checks are shown in detail.
+.It Fl i
+.Dq insecure
+mode.
+Allows calls to SET and UNSET from any host.
+Normally
+.Nm
+accepts these requests only from the loopback interface for security reasons.
+This change is necessary for programs that were compiled with earlier
+versions of the rpc library and do not make those requests using the
+loopback interface.
+.It Fl l
+Turns on libwrap connection logging.
+.It Fl s
+Causes
+.Nm
+to change to the user daemon as soon as possible.
+This causes
+.Nm
+to use non-privileged ports for outgoing connections, preventing non-privileged
+clients from using
+.Nm
+to connect to services from a privileged port.
+.It Fl L
+Allow old-style local connections over the loopback interface.
+Without this flag, local connections are only allowed over a local socket,
+.Pa /var/run/rpcbind.sock
+.El
+.Sh NOTES
+All RPC servers must be restarted if
+.Nm
+is restarted.
+.Sh FILES
+.Bl -tag -width "/var/run/rpcbind.sock" -compact
+.It Pa /var/run/rpcbind.sock
+.It Pa /etc/hosts.allow
+explicit remote host access list.
+.It Pa /etc/hosts.deny
+explicit remote host denial of service list.
+.El
+.Sh SEE ALSO
+.Xr rpcbind 3 ,
+.Xr hosts_access 5 ,
+.Xr hosts_options 5 ,
+.Xr netconfig 5 ,
+.Xr rpcinfo 8
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.c
new file mode 100644
index 0000000..492b0b6
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.c
@@ -0,0 +1,613 @@
+/* $NetBSD: rpcbind.c,v 1.4 2013/10/19 17:45:00 christos Exp $ */
+
+/*
+ * 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
+ */
+/*
+ * Copyright (c) 1984 - 1991 by Sun Microsystems, Inc.
+ */
+
+/* #ident "@(#)rpcbind.c 1.19 94/04/25 SMI" */
+
+#if 0
+#ifndef lint
+static char sccsid[] = "@(#)rpcbind.c 1.35 89/04/21 Copyr 1984 Sun Micro";
+#endif
+#endif
+
+/*
+ * rpcbind.c
+ * Implements the program, version to address mapping for rpc.
+ *
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/errno.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
+#include <sys/signal.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <rpc/rpc.h>
+#ifdef PORTMAP
+#include <netinet/in.h>
+#endif
+#include <netdb.h>
+#include <stdio.h>
+#include <netconfig.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <err.h>
+#include <util.h>
+#include <pwd.h>
+#include <semaphore.h>
+#include <string.h>
+#include <errno.h>
+#include "rpcbind.h"
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+/* Global variables */
+int debugging = 1; /* Tell me what's going on */
+int doabort = 0; /* When debugging, do an abort on errors */
+rpcblist_ptr list_rbl; /* A list of version 3/4 rpcbind services */
+
+#include "svc_fdset.h"
+
+/* who to suid to if -s is given */
+#define RUN_AS "daemon"
+
+int runasdaemon = 0;
+int insecure = 0;
+int oldstyle_local = 0;
+int verboselog = 0;
+
+#ifdef WARMSTART
+/* Local Variable */
+static int warmstart = 0; /* Grab a old copy of registrations */
+#endif
+
+#ifdef PORTMAP
+struct pmaplist *list_pml; /* A list of version 2 rpcbind services */
+const char *udptrans; /* Name of UDP transport */
+const char *tcptrans; /* Name of TCP transport */
+const char *udp_uaddr; /* Universal UDP address */
+const char *tcp_uaddr; /* Universal TCP address */
+#endif
+static const char servname[] = "sunrpc";
+
+const char rpcbind_superuser[] = "superuser";
+const char rpcbind_unknown[] = "unknown";
+
+static int init_transport(struct netconfig *);
+static void rbllist_add(rpcprog_t, rpcvers_t, struct netconfig *,
+ struct netbuf *);
+static void terminate(int);
+#if 0
+static void parseargs(int, char *[]);
+#endif
+
+int rpcbind_main(void *);
+int
+rpcbind_main(void *arg)
+{
+ struct netconfig *nconf;
+ void *nc_handle; /* Net config handle */
+ struct rlimit rl;
+ int maxrec = RPC_MAXDATASIZE;
+ extern sem_t gensem;
+
+#if 0
+ parseargs(argc, argv);
+#endif
+
+ alloc_fdset();
+
+ getrlimit(RLIMIT_NOFILE, &rl);
+ if (rl.rlim_cur < 128) {
+ if (rl.rlim_max <= 128)
+ rl.rlim_cur = rl.rlim_max;
+ else
+ rl.rlim_cur = 128;
+ setrlimit(RLIMIT_NOFILE, &rl);
+ }
+#if 0
+ if (geteuid()) /* This command allowed only to root */
+ errx(1, "Sorry. You are not superuser");
+#endif
+ nc_handle = setnetconfig(); /* open netconfig file */
+ if (nc_handle == NULL)
+ errx(1, "could not read /etc/netconfig");
+#ifdef PORTMAP
+ udptrans = "";
+ tcptrans = "";
+#endif
+
+ nconf = getnetconfigent("local");
+ if (nconf == NULL)
+ errx(1, "can't find local transport");
+
+ rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec);
+
+ init_transport(nconf);
+
+ while ((nconf = getnetconfig(nc_handle))) {
+ if (nconf->nc_flag & NC_VISIBLE)
+ init_transport(nconf);
+ }
+ endnetconfig(nc_handle);
+
+ /* catch the usual termination signals for graceful exit */
+ (void) signal(SIGCHLD, reap);
+ (void) signal(SIGINT, terminate);
+ (void) signal(SIGTERM, terminate);
+ (void) signal(SIGQUIT, terminate);
+ /* ignore others that could get sent */
+ (void) signal(SIGPIPE, SIG_IGN);
+ //(void) signal(SIGHUP, SIG_IGN); used by mountd
+ (void) signal(SIGUSR1, SIG_IGN);
+ (void) signal(SIGUSR2, SIG_IGN);
+#ifdef WARMSTART
+ if (warmstart) {
+ read_warmstart();
+ }
+#endif
+ if (debugging) {
+ printf("rpcbind debugging enabled.");
+ if (doabort) {
+ printf(" Will abort on errors!\n");
+ } else {
+ printf("\n");
+ }
+ } else {
+ if (daemon(0, 0))
+ err(1, "fork failed");
+ }
+
+ openlog("rpcbind", 0, LOG_DAEMON);
+ pidfile(NULL);
+
+ if (runasdaemon) {
+ struct passwd *p;
+
+ if((p = getpwnam(RUN_AS)) == NULL) {
+ syslog(LOG_ERR, "cannot get uid of daemon: %m");
+ exit(1);
+ }
+ if (setuid(p->pw_uid) == -1) {
+ syslog(LOG_ERR, "setuid to daemon failed: %m");
+ exit(1);
+ }
+ }
+
+ network_init();
+
+ sem_post(&gensem);
+ my_svc_run();
+ syslog(LOG_ERR, "svc_run returned unexpectedly");
+ rpcbind_abort();
+ /* NOTREACHED */
+
+ return 0;
+}
+
+/*
+ * Adds the entry into the rpcbind database.
+ * If PORTMAP, then for UDP and TCP, it adds the entries for version 2 also
+ * Returns 0 if succeeds, else fails
+ */
+static int
+init_transport(struct netconfig *nconf)
+{
+ int fd;
+ struct t_bind taddr;
+ struct addrinfo hints, *res = NULL;
+ struct __rpc_sockinfo si;
+ SVCXPRT *my_xprt;
+ int aicode, status, addrlen;
+ struct sockaddr *sa;
+ struct sockaddr_un sun;
+ const int one = 1;
+
+ if ((nconf->nc_semantics != NC_TPI_CLTS) &&
+ (nconf->nc_semantics != NC_TPI_COTS) &&
+ (nconf->nc_semantics != NC_TPI_COTS_ORD))
+ return 1; /* not my type */
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ int i;
+ char **s;
+
+ (void)fprintf(stderr, "%s: %ld lookup routines :\n",
+ nconf->nc_netid, nconf->nc_nlookups);
+ for (i = 0, s = nconf->nc_lookups; i < nconf->nc_nlookups;
+ i++, s++)
+ (void)fprintf(stderr, "[%d] - %s\n", i, *s);
+ }
+#endif
+
+ /*
+ * XXX - using RPC library internal functions.
+ */
+ if ((fd = __rpc_nconf2fd(nconf)) < 0) {
+ if (errno == EAFNOSUPPORT)
+ return 1;
+ warn("Cannot create socket for `%s'", nconf->nc_netid);
+ return 1;
+ }
+
+ if (!__rpc_nconf2sockinfo(nconf, &si)) {
+ warnx("Cannot get information for `%s'", nconf->nc_netid);
+ return 1;
+ }
+
+ if (si.si_af == AF_INET6) {
+ /*
+ * We're doing host-based access checks here, so don't allow
+ * v4-in-v6 to confuse things.
+ */
+ if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &one,
+ sizeof one) < 0) {
+ warn("Can't make socket ipv6 only");
+ return 1;
+ }
+ }
+
+
+ if (!strcmp(nconf->nc_netid, "local")) {
+ (void)memset(&sun, 0, sizeof sun);
+ sun.sun_family = AF_LOCAL;
+ (void)rump_sys_unlink(_PATH_RPCBINDSOCK);
+ (void)strlcpy(sun.sun_path, _PATH_RPCBINDSOCK,
+ sizeof(sun.sun_path));
+ sun.sun_len = SUN_LEN(&sun);
+ addrlen = sizeof(struct sockaddr_un);
+ sa = (struct sockaddr *)&sun;
+ } else {
+ /* Get rpcbind's address on this transport */
+
+ (void)memset(&hints, 0, sizeof hints);
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_family = si.si_af;
+ hints.ai_socktype = si.si_socktype;
+ hints.ai_protocol = si.si_proto;
+ if ((aicode = getaddrinfo(NULL, servname, &hints, &res)) != 0) {
+ warnx("Cannot get local address for `%s' (%s)",
+ nconf->nc_netid, gai_strerror(aicode));
+ return 1;
+ }
+ addrlen = res->ai_addrlen;
+ sa = (struct sockaddr *)res->ai_addr;
+ }
+
+ if (bind(fd, sa, addrlen) < 0) {
+ warn("Cannot bind `%s'", nconf->nc_netid);
+ if (res != NULL)
+ freeaddrinfo(res);
+ return 1;
+ }
+#if 0
+ if (sa->sa_family == AF_LOCAL)
+ if (rump_sys_chmod(sun.sun_path, S_IRWXU|S_IRWXG|S_IRWXO) == -1)
+ warn("Cannot chmod `%s'", sun.sun_path);
+#endif
+
+ /* Copy the address */
+ taddr.addr.len = taddr.addr.maxlen = addrlen;
+ taddr.addr.buf = malloc(addrlen);
+ if (taddr.addr.buf == NULL) {
+ warn("Cannot allocate memory for `%s' address",
+ nconf->nc_netid);
+ if (res != NULL)
+ freeaddrinfo(res);
+ return 1;
+ }
+ (void)memcpy(taddr.addr.buf, sa, addrlen);
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ /* for debugging print out our universal address */
+ char *uaddr;
+ struct netbuf nb;
+
+ nb.buf = sa;
+ nb.len = nb.maxlen = sa->sa_len;
+ uaddr = taddr2uaddr(nconf, &nb);
+ (void)fprintf(stderr, "rpcbind: my address is %s\n", uaddr);
+ (void)free(uaddr);
+ }
+#endif
+
+ if (res != NULL)
+ freeaddrinfo(res);
+
+ if (nconf->nc_semantics != NC_TPI_CLTS)
+ listen(fd, SOMAXCONN);
+
+ my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE,
+ RPC_MAXDATASIZE);
+ if (my_xprt == NULL) {
+ warnx("Could not create service for `%s'", nconf->nc_netid);
+ goto error;
+ }
+
+#ifdef PORTMAP
+ /*
+ * Register both the versions for tcp/ip, udp/ip and local.
+ */
+ if ((strcmp(nconf->nc_protofmly, NC_INET) == 0 &&
+ (strcmp(nconf->nc_proto, NC_TCP) == 0 ||
+ strcmp(nconf->nc_proto, NC_UDP) == 0)) ||
+ strcmp(nconf->nc_netid, "local") == 0) {
+ struct pmaplist *pml;
+
+ if (!svc_register(my_xprt, PMAPPROG, PMAPVERS,
+ pmap_service, 0)) {
+ warn("Could not register on `%s'", nconf->nc_netid);
+ goto error;
+ }
+ pml = malloc(sizeof (struct pmaplist));
+ if (pml == NULL) {
+ warn("Cannot allocate memory");
+ goto error;
+ }
+ pml->pml_map.pm_prog = PMAPPROG;
+ pml->pml_map.pm_vers = PMAPVERS;
+ pml->pml_map.pm_port = PMAPPORT;
+ if (strcmp(nconf->nc_proto, NC_TCP) == 0) {
+ if (tcptrans[0]) {
+ warnx(
+ "Cannot have more than one TCP transport");
+ free(pml);
+ goto error;
+ }
+ tcptrans = strdup(nconf->nc_netid);
+ if (tcptrans == NULL) {
+ free(pml);
+ warn("Cannot allocate memory");
+ goto error;
+ }
+ pml->pml_map.pm_prot = IPPROTO_TCP;
+
+ /* Let's snarf the universal address */
+ /* "h1.h2.h3.h4.p1.p2" */
+ tcp_uaddr = taddr2uaddr(nconf, &taddr.addr);
+ } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) {
+ if (udptrans[0]) {
+ free(pml);
+ warnx(
+ "Cannot have more than one UDP transport");
+ goto error;
+ }
+ udptrans = strdup(nconf->nc_netid);
+ if (udptrans == NULL) {
+ free(pml);
+ warn("Cannot allocate memory");
+ goto error;
+ }
+ pml->pml_map.pm_prot = IPPROTO_UDP;
+
+ /* Let's snarf the universal address */
+ /* "h1.h2.h3.h4.p1.p2" */
+ udp_uaddr = taddr2uaddr(nconf, &taddr.addr);
+ }
+ pml->pml_next = list_pml;
+ list_pml = pml;
+
+ /* Add version 3 information */
+ pml = malloc(sizeof (struct pmaplist));
+ if (pml == NULL) {
+ warn("Cannot allocate memory");
+ goto error;
+ }
+ pml->pml_map = list_pml->pml_map;
+ pml->pml_map.pm_vers = RPCBVERS;
+ pml->pml_next = list_pml;
+ list_pml = pml;
+
+ /* Add version 4 information */
+ pml = malloc(sizeof (struct pmaplist));
+ if (pml == NULL) {
+ warn("Cannot allocate memory");
+ goto error;
+ }
+ pml->pml_map = list_pml->pml_map;
+ pml->pml_map.pm_vers = RPCBVERS4;
+ pml->pml_next = list_pml;
+ list_pml = pml;
+
+ /* Also add version 2 stuff to rpcbind list */
+ rbllist_add(PMAPPROG, PMAPVERS, nconf, &taddr.addr);
+ }
+#endif
+
+ /* version 3 registration */
+ if (!svc_reg(my_xprt, RPCBPROG, RPCBVERS, rpcb_service_3, NULL)) {
+ warn("Could not register %s version 3", nconf->nc_netid);
+ goto error;
+ }
+ rbllist_add(RPCBPROG, RPCBVERS, nconf, &taddr.addr);
+
+ /* version 4 registration */
+ if (!svc_reg(my_xprt, RPCBPROG, RPCBVERS4, rpcb_service_4, NULL)) {
+ warn("Could not register %s version 4", nconf->nc_netid);
+ goto error;
+ }
+ rbllist_add(RPCBPROG, RPCBVERS4, nconf, &taddr.addr);
+
+ /* decide if bound checking works for this transport */
+ status = add_bndlist(nconf, &taddr.addr);
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ if (status < 0) {
+ fprintf(stderr, "Error in finding bind status for %s\n",
+ nconf->nc_netid);
+ } else if (status == 0) {
+ fprintf(stderr, "check binding for %s\n",
+ nconf->nc_netid);
+ } else if (status > 0) {
+ fprintf(stderr, "No check binding for %s\n",
+ nconf->nc_netid);
+ }
+ }
+#else
+ __USE(status);
+#endif
+ /*
+ * rmtcall only supported on CLTS transports for now.
+ */
+ if (nconf->nc_semantics == NC_TPI_CLTS) {
+ status = create_rmtcall_fd(nconf);
+
+#ifdef RPCBIND_DEBUG
+ if (debugging) {
+ if (status < 0) {
+ fprintf(stderr,
+ "Could not create rmtcall fd for %s\n",
+ nconf->nc_netid);
+ } else {
+ fprintf(stderr, "rmtcall fd for %s is %d\n",
+ nconf->nc_netid, status);
+ }
+ }
+#endif
+ }
+ return (0);
+error:
+ (void)rump_sys_close(fd);
+ return (1);
+}
+
+static void
+rbllist_add(rpcprog_t prog, rpcvers_t vers, struct netconfig *nconf,
+ struct netbuf *addr)
+{
+ rpcblist_ptr rbl;
+
+ rbl = malloc(sizeof(rpcblist));
+ if (rbl == NULL) {
+ warn("Out of memory");
+ return;
+ }
+
+ rbl->rpcb_map.r_prog = prog;
+ rbl->rpcb_map.r_vers = vers;
+ rbl->rpcb_map.r_netid = strdup(nconf->nc_netid);
+ rbl->rpcb_map.r_addr = taddr2uaddr(nconf, addr);
+ rbl->rpcb_map.r_owner = strdup(rpcbind_superuser);
+ rbl->rpcb_next = list_rbl; /* Attach to global list */
+ list_rbl = rbl;
+}
+
+/*
+ * Catch the signal and die
+ */
+static void
+terminate(int dummy)
+{
+#ifdef WARMSTART
+ syslog(LOG_ERR,
+ "rpcbind terminating on signal. Restart with \"rpcbind -w\"");
+ write_warmstart(); /* Dump yourself */
+#endif
+ exit(2);
+}
+
+void
+rpcbind_abort()
+{
+#ifdef WARMSTART
+ write_warmstart(); /* Dump yourself */
+#endif
+ abort();
+}
+
+#if 0
+/* get command line options */
+static void
+parseargs(int argc, char *argv[])
+{
+ int c;
+
+ while ((c = getopt(argc, argv, "dwailLs")) != -1) {
+ switch (c) {
+ case 'a':
+ doabort = 1; /* when debugging, do an abort on */
+ break; /* errors; for rpcbind developers */
+ /* only! */
+ case 'd':
+ debugging = 1;
+ break;
+ case 'i':
+ insecure = 1;
+ break;
+ case 'L':
+ oldstyle_local = 1;
+ break;
+ case 'l':
+ verboselog = 1;
+ break;
+ case 's':
+ runasdaemon = 1;
+ break;
+#ifdef WARMSTART
+ case 'w':
+ warmstart = 1;
+ break;
+#endif
+ default: /* error */
+ fprintf(stderr, "usage: rpcbind [-Idwils]\n");
+ exit (1);
+ }
+ }
+ if (doabort && !debugging) {
+ fprintf(stderr,
+ "-a (abort) specified without -d (debugging) -- ignored.\n");
+ doabort = 0;
+ }
+}
+#endif
+
+void
+reap(int dummy)
+{
+ int save_errno = errno;
+
+ while (wait3(NULL, WNOHANG, NULL) > 0)
+ ;
+ errno = save_errno;
+}
+
+void
+toggle_verboselog(int dummy)
+{
+ verboselog = !verboselog;
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.h b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.h
new file mode 100644
index 0000000..1717e31
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/rpcbind.h
@@ -0,0 +1,146 @@
+/* $NetBSD: rpcbind.h,v 1.1 2010/07/26 15:53:00 pooka Exp $ */
+
+/*
+ * 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
+ */
+/*
+ * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
+ */
+
+/* #ident "@(#)rpcbind.h 1.4 90/04/12 SMI" */
+
+/*
+ * rpcbind.h
+ * The common header declarations
+ */
+
+#ifndef rpcbind_h
+#define rpcbind_h
+
+#ifdef PORTMAP
+#include <rpc/pmap_prot.h>
+#endif
+#include <rpc/rpcb_prot.h>
+
+/*
+ * Stuff for the rmtcall service
+ */
+struct encap_parms {
+ u_int32_t arglen;
+ char *args;
+};
+
+struct r_rmtcall_args {
+ u_int32_t rmt_prog;
+ u_int32_t rmt_vers;
+ u_int32_t rmt_proc;
+ int rmt_localvers; /* whether to send port # or uaddr */
+ char *rmt_uaddr;
+ struct encap_parms rmt_args;
+};
+
+extern int debugging;
+extern int doabort;
+extern int verboselog;
+extern int insecure;
+extern int oldstyle_local;
+extern rpcblist_ptr list_rbl; /* A list of version 3 & 4 rpcbind services */
+
+#ifdef PORTMAP
+extern struct pmaplist *list_pml; /* A list of version 2 rpcbind services */
+extern const char *udptrans; /* Name of UDP transport */
+extern const char *tcptrans; /* Name of TCP transport */
+extern const char *udp_uaddr; /* Universal UDP address */
+extern const char *tcp_uaddr; /* Universal TCP address */
+#endif
+
+extern const char rpcbind_superuser[];
+extern const char rpcbind_unknown[];
+
+int add_bndlist(struct netconfig *, struct netbuf *);
+bool_t is_bound(const char *, const char *);
+char *mergeaddr(SVCXPRT *, char *, char *, char *);
+struct netconfig *rpcbind_get_conf(const char *);
+
+void rpcbs_init(void);
+void rpcbs_procinfo(rpcvers_t, rpcproc_t);
+void rpcbs_set(rpcvers_t, bool_t);
+void rpcbs_unset(rpcvers_t, bool_t);
+void rpcbs_getaddr(rpcvers_t, rpcprog_t, rpcvers_t, const char *, const char *);
+void rpcbs_rmtcall(rpcvers_t, rpcproc_t, rpcprog_t, rpcvers_t, rpcproc_t,
+ char *, rpcblist_ptr);
+void *rpcbproc_getstat(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+
+void rpcb_service_3(struct svc_req *, SVCXPRT *);
+void rpcb_service_4(struct svc_req *, SVCXPRT *);
+
+/* Common functions shared between versions */
+void *rpcbproc_set_com(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+void *rpcbproc_unset_com(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+bool_t map_set(RPCB *, char *);
+bool_t map_unset(RPCB *, const char *);
+void delete_prog(int);
+void *rpcbproc_getaddr_com(RPCB *, struct svc_req *, SVCXPRT *, rpcvers_t,
+ rpcvers_t);
+void *rpcbproc_gettime_com(void *, struct svc_req *, SVCXPRT *,
+ rpcvers_t);
+void *rpcbproc_uaddr2taddr_com(void *, struct svc_req *,
+ SVCXPRT *, rpcvers_t);
+void *rpcbproc_taddr2uaddr_com(void *, struct svc_req *, SVCXPRT *,
+ rpcvers_t);
+int create_rmtcall_fd(struct netconfig *);
+void rpcbproc_callit_com(struct svc_req *, SVCXPRT *, rpcvers_t,
+ rpcvers_t);
+void my_svc_run(void);
+
+void rpcbind_abort(void);
+void reap(int);
+void toggle_verboselog(int);
+
+int check_access(SVCXPRT *, rpcproc_t, void *, int);
+int check_callit(SVCXPRT *, struct r_rmtcall_args *, int);
+void logit(int, struct sockaddr *, rpcproc_t, rpcprog_t, const char *);
+int is_loopback(struct netbuf *);
+
+#ifdef PORTMAP
+extern void pmap_service(struct svc_req *, SVCXPRT *);
+#endif
+
+void write_warmstart(void);
+void read_warmstart(void);
+
+char *addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr,
+ char *netid);
+void network_init(void);
+struct sockaddr *local_sa(int);
+
+/* For different getaddr semantics */
+#define RPCB_ALLVERS 0
+#define RPCB_ONEVERS 1
+
+#endif /* rpcbind_h */
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/security.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/security.c
new file mode 100644
index 0000000..755c0d3
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/security.c
@@ -0,0 +1,282 @@
+/* $NetBSD: security.c,v 1.1 2010/07/26 15:53:01 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <rpc/rpc.h>
+#include <rpc/rpcb_prot.h>
+#include <rpc/pmap_prot.h>
+#include <err.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <util.h>
+#include <syslog.h>
+#include <netdb.h>
+
+/*
+ * XXX for special case checks in check_callit.
+ */
+#include <rpcsvc/mount.h>
+#include <rpcsvc/rquota.h>
+#include <rpcsvc/nfs_prot.h>
+#include <rpcsvc/yp.h>
+#include <rpcsvc/ypclnt.h>
+#include <rpcsvc/yppasswd.h>
+
+#include "rpcbind.h"
+
+#ifdef LIBWRAP
+# include <tcpd.h>
+#ifndef LIBWRAP_ALLOW_FACILITY
+# define LIBWRAP_ALLOW_FACILITY LOG_AUTH
+#endif
+#ifndef LIBWRAP_ALLOW_SEVERITY
+# define LIBWRAP_ALLOW_SEVERITY LOG_INFO
+#endif
+#ifndef LIBWRAP_DENY_FACILITY
+# define LIBWRAP_DENY_FACILITY LOG_AUTH
+#endif
+#ifndef LIBWRAP_DENY_SEVERITY
+# define LIBWRAP_DENY_SEVERITY LOG_WARNING
+#endif
+int allow_severity = LIBWRAP_ALLOW_FACILITY|LIBWRAP_ALLOW_SEVERITY;
+int deny_severity = LIBWRAP_DENY_FACILITY|LIBWRAP_DENY_SEVERITY;
+#endif
+
+#ifndef PORTMAP_LOG_FACILITY
+# define PORTMAP_LOG_FACILITY LOG_AUTH
+#endif
+#ifndef PORTMAP_LOG_SEVERITY
+# define PORTMAP_LOG_SEVERITY LOG_INFO
+#endif
+int log_severity = PORTMAP_LOG_FACILITY|PORTMAP_LOG_SEVERITY;
+
+extern int verboselog;
+
+int
+check_access(SVCXPRT *xprt, rpcproc_t proc, void *args, int rpcbvers)
+{
+ struct netbuf *caller = svc_getrpccaller(xprt);
+ struct sockaddr *addr = (struct sockaddr *)caller->buf;
+#ifdef LIBWRAP
+ struct request_info req;
+#endif
+ rpcprog_t prog = 0;
+ rpcb *rpcbp;
+ struct pmap *pmap;
+
+ /*
+ * The older PMAP_* equivalents have the same numbers, so
+ * they are accounted for here as well.
+ */
+ switch (proc) {
+ case RPCBPROC_GETADDR:
+ case RPCBPROC_SET:
+ case RPCBPROC_UNSET:
+ if (rpcbvers > PMAPVERS) {
+ rpcbp = (rpcb *)args;
+ prog = rpcbp->r_prog;
+ } else {
+ pmap = (struct pmap *)args;
+ prog = pmap->pm_prog;
+ }
+ if (proc == RPCBPROC_GETADDR)
+ break;
+ if (!insecure && !is_loopback(caller)) {
+ if (verboselog)
+ logit(log_severity, addr, proc, prog,
+ " declined (non-loopback sender)");
+ return 0;
+ }
+ break;
+ case RPCBPROC_CALLIT:
+ case RPCBPROC_INDIRECT:
+ case RPCBPROC_DUMP:
+ case RPCBPROC_GETTIME:
+ case RPCBPROC_UADDR2TADDR:
+ case RPCBPROC_TADDR2UADDR:
+ case RPCBPROC_GETVERSADDR:
+ case RPCBPROC_GETADDRLIST:
+ case RPCBPROC_GETSTAT:
+ default:
+ break;
+ }
+
+#ifdef LIBWRAP
+ if (addr->sa_family == AF_LOCAL)
+ return 1;
+ request_init(&req, RQ_DAEMON, "rpcbind", RQ_CLIENT_SIN, addr, 0);
+ sock_methods(&req);
+ if(!hosts_access(&req)) {
+ logit(deny_severity, addr, proc, prog, ": request from unauthorized host");
+ return 0;
+ }
+#endif
+ if (verboselog)
+ logit(log_severity, addr, proc, prog, "");
+ return 1;
+}
+
+int
+is_loopback(struct netbuf *nbuf)
+{
+ struct sockaddr *addr = (struct sockaddr *)nbuf->buf;
+ struct sockaddr_in *sin;
+#ifdef INET6
+ struct sockaddr_in6 *sin6;
+#endif
+
+ switch (addr->sa_family) {
+ case AF_INET:
+ if (!oldstyle_local)
+ return 0;
+ sin = (struct sockaddr_in *)addr;
+ return ((sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) &&
+ (ntohs(sin->sin_port) < IPPORT_RESERVED));
+#ifdef INET6
+ case AF_INET6:
+ if (!oldstyle_local)
+ return 0;
+ sin6 = (struct sockaddr_in6 *)addr;
+ return (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) &&
+ (ntohs(sin6->sin6_port) < IPV6PORT_RESERVED));
+#endif
+ case AF_LOCAL:
+ return 1;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+
+/* logit - report events of interest via the syslog daemon */
+void
+logit(int severity, struct sockaddr *addr, rpcproc_t procnum, rpcprog_t prognum,
+ const char *text)
+{
+ const char *procname;
+ char procbuf[32];
+ char *progname;
+ char progbuf[32];
+ char fromname[NI_MAXHOST];
+ struct rpcent *rpc;
+ static const char *procmap[] = {
+ /* RPCBPROC_NULL */ "null",
+ /* RPCBPROC_SET */ "set",
+ /* RPCBPROC_UNSET */ "unset",
+ /* RPCBPROC_GETADDR */ "getport/addr",
+ /* RPCBPROC_DUMP */ "dump",
+ /* RPCBPROC_CALLIT */ "callit",
+ /* RPCBPROC_GETTIME */ "gettime",
+ /* RPCBPROC_UADDR2TADDR */ "uaddr2taddr",
+ /* RPCBPROC_TADDR2UADDR */ "taddr2uaddr",
+ /* RPCBPROC_GETVERSADDR */ "getversaddr",
+ /* RPCBPROC_INDIRECT */ "indirect",
+ /* RPCBPROC_GETADDRLIST */ "getaddrlist",
+ /* RPCBPROC_GETSTAT */ "getstat"
+ };
+
+ /*
+ * Fork off a process or the portmap daemon might hang while
+ * getrpcbynumber() or syslog() does its thing.
+ */
+
+ if (fork() == 0) {
+ setproctitle("logit");
+
+ /* Try to map program number to name. */
+
+ if (prognum == 0) {
+ progname = __UNCONST("");
+ } else if ((rpc = getrpcbynumber((int) prognum))) {
+ progname = rpc->r_name;
+ } else {
+ snprintf(progname = progbuf, sizeof(progbuf), "%u",
+ (unsigned)prognum);
+ }
+
+ /* Try to map procedure number to name. */
+
+ if (procnum >= (sizeof procmap / sizeof (char *))) {
+ snprintf(procbuf, sizeof procbuf, "%u",
+ (unsigned)procnum);
+ procname = procbuf;
+ } else
+ procname = procmap[procnum];
+
+ /* Write syslog record. */
+
+ if (addr->sa_family == AF_LOCAL)
+ strlcpy(fromname, "local", sizeof(fromname));
+ else
+ getnameinfo(addr, addr->sa_len, fromname,
+ sizeof fromname, NULL, 0, NI_NUMERICHOST);
+
+ syslog(severity, "connect from %s to %s(%s)%s",
+ fromname, procname, progname, text);
+ _exit(0);
+ }
+}
+
+int
+check_callit(SVCXPRT *xprt, struct r_rmtcall_args *args, int versnum)
+{
+ struct sockaddr *sa = (struct sockaddr *)svc_getrpccaller(xprt)->buf;
+
+ /*
+ * Always allow calling NULLPROC
+ */
+ if (args->rmt_proc == 0)
+ return 1;
+
+ /*
+ * XXX - this special casing sucks.
+ */
+ switch (args->rmt_prog) {
+ case RPCBPROG:
+ /*
+ * Allow indirect calls to ourselves in insecure mode.
+ * The is_loopback checks aren't useful then anyway.
+ */
+ if (!insecure)
+ goto deny;
+ break;
+ case MOUNTPROG:
+ if (args->rmt_proc != MOUNTPROC_MNT &&
+ args->rmt_proc != MOUNTPROC_UMNT)
+ break;
+ goto deny;
+ case YPBINDPROG:
+ if (args->rmt_proc != YPBINDPROC_SETDOM)
+ break;
+ /* FALLTHROUGH */
+ case YPPASSWDPROG:
+ case NFS_PROGRAM:
+ case RQUOTAPROG:
+ goto deny;
+ case YPPROG:
+ switch (args->rmt_proc) {
+ case YPPROC_ALL:
+ case YPPROC_MATCH:
+ case YPPROC_FIRST:
+ case YPPROC_NEXT:
+ goto deny;
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+
+ return 1;
+deny:
+ logit(deny_severity, sa, args->rmt_proc, args->rmt_prog,
+ ": indirect call not allowed");
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/util.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/util.c
new file mode 100644
index 0000000..f67e98d
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/util.c
@@ -0,0 +1,401 @@
+/* $NetBSD: util.c,v 1.2 2011/06/11 18:03:17 christos Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank van der Linden.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/queue.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <assert.h>
+#include <ifaddrs.h>
+#include <poll.h>
+#include <rpc/rpc.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <netdb.h>
+#include <netconfig.h>
+#include <stdio.h>
+#include <arpa/inet.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "rpcbind.h"
+
+static struct sockaddr_in *local_in4;
+#ifdef INET6
+static struct sockaddr_in6 *local_in6;
+#endif
+
+static int bitmaskcmp(void *, void *, void *, int);
+#ifdef INET6
+static void in6_fillscopeid(struct sockaddr_in6 *);
+#endif
+
+/*
+ * For all bits set in "mask", compare the corresponding bits in
+ * "dst" and "src", and see if they match.
+ */
+static int
+bitmaskcmp(void *dst, void *src, void *mask, int bytelen)
+{
+ int i, j;
+ u_int8_t *p1 = dst, *p2 = src, *netmask = mask;
+ u_int8_t bitmask;
+
+ for (i = 0; i < bytelen; i++) {
+ for (j = 0; j < 8; j++) {
+ bitmask = 1 << j;
+ if (!(netmask[i] & bitmask))
+ continue;
+ if ((p1[i] & bitmask) != (p2[i] & bitmask))
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * Taken from ifconfig.c
+ */
+#ifdef INET6
+static void
+in6_fillscopeid(struct sockaddr_in6 *sin6)
+{
+ if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
+ sin6->sin6_scope_id =
+ ntohs(*(u_int16_t *)&sin6->sin6_addr.s6_addr[2]);
+ sin6->sin6_addr.s6_addr[2] = sin6->sin6_addr.s6_addr[3] = 0;
+ }
+}
+#endif
+
+char *
+addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr,
+ char *netid)
+{
+ struct ifaddrs *ifap, *ifp, *bestif;
+#ifdef INET6
+ struct sockaddr_in6 *servsin6, *sin6mask, *clntsin6, *ifsin6, *realsin6;
+ struct sockaddr_in6 *newsin6;
+#endif
+ struct sockaddr_in *servsin, *sinmask, *clntsin, *newsin, *ifsin;
+ struct netbuf *serv_nbp, *clnt_nbp = NULL, tbuf;
+ struct sockaddr *serv_sa;
+ struct sockaddr *clnt_sa;
+ struct sockaddr_storage ss;
+ struct netconfig *nconf;
+ struct sockaddr *clnt = caller->buf;
+ char *ret = NULL;
+
+#ifdef INET6
+ servsin6 = ifsin6 = newsin6 = NULL; /* XXXGCC -Wuninitialized */
+#endif
+ servsin = newsin = NULL; /* XXXGCC -Wuninitialized */
+
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "addrmerge(caller, %s, %s, %s\n", serv_uaddr,
+ clnt_uaddr, netid);
+#endif
+ nconf = getnetconfigent(netid);
+ if (nconf == NULL)
+ return NULL;
+
+ /*
+ * Local merge, just return a duplicate.
+ */
+ if (clnt_uaddr != NULL && strncmp(clnt_uaddr, "0.0.0.0.", 8) == 0)
+ return strdup(clnt_uaddr);
+
+ serv_nbp = uaddr2taddr(nconf, serv_uaddr);
+ if (serv_nbp == NULL)
+ return NULL;
+
+ serv_sa = (struct sockaddr *)serv_nbp->buf;
+ if (clnt_uaddr != NULL) {
+ clnt_nbp = uaddr2taddr(nconf, clnt_uaddr);
+ if (clnt_nbp == NULL) {
+ free(serv_nbp);
+ return NULL;
+ }
+ clnt_sa = (struct sockaddr *)clnt_nbp->buf;
+ if (clnt_sa->sa_family == AF_LOCAL) {
+ free(serv_nbp);
+ free(clnt_nbp);
+ free(clnt_sa);
+ return strdup(serv_uaddr);
+ }
+ } else {
+ clnt_sa = (struct sockaddr *)
+ malloc(sizeof (struct sockaddr_storage));
+ memcpy(clnt_sa, clnt, clnt->sa_len);
+ }
+
+ if (getifaddrs(&ifp) < 0) {
+ free(serv_nbp);
+ free(clnt_sa);
+ if (clnt_nbp != NULL)
+ free(clnt_nbp);
+ return 0;
+ }
+
+ /*
+ * Loop through all interfaces. For each interface, see if the
+ * network portion of its address is equal to that of the client.
+ * If so, we have found the interface that we want to use.
+ */
+ for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) {
+ if (ifap->ifa_addr->sa_family != clnt->sa_family ||
+ !(ifap->ifa_flags & IFF_UP))
+ continue;
+
+ switch (clnt->sa_family) {
+ case AF_INET:
+ /*
+ * realsin: address that recvfrom gave us.
+ * ifsin: address of interface being examined.
+ * clntsin: address that client want us to contact
+ * it on
+ * servsin: local address of RPC service.
+ * sinmask: netmask of this interface
+ * newsin: initially a copy of clntsin, eventually
+ * the merged address
+ */
+ servsin = (struct sockaddr_in *)serv_sa;
+ clntsin = (struct sockaddr_in *)clnt_sa;
+ sinmask = (struct sockaddr_in *)ifap->ifa_netmask;
+ newsin = (struct sockaddr_in *)&ss;
+ ifsin = (struct sockaddr_in *)ifap->ifa_addr;
+ if (!bitmaskcmp(&ifsin->sin_addr, &clntsin->sin_addr,
+ &sinmask->sin_addr, sizeof (struct in_addr))) {
+ goto found;
+ }
+ break;
+#ifdef INET6
+ case AF_INET6:
+ /*
+ * realsin6: address that recvfrom gave us.
+ * ifsin6: address of interface being examined.
+ * clntsin6: address that client want us to contact
+ * it on
+ * servsin6: local address of RPC service.
+ * sin6mask: netmask of this interface
+ * newsin6: initially a copy of clntsin, eventually
+ * the merged address
+ *
+ * For v6 link local addresses, if the client contacted
+ * us via a link-local address, and wants us to reply
+ * to one, use the scope id to see which one.
+ */
+ realsin6 = (struct sockaddr_in6 *)clnt;
+ ifsin6 = (struct sockaddr_in6 *)ifap->ifa_addr;
+ in6_fillscopeid(ifsin6);
+ clntsin6 = (struct sockaddr_in6 *)clnt_sa;
+ servsin6 = (struct sockaddr_in6 *)serv_sa;
+ sin6mask = (struct sockaddr_in6 *)ifap->ifa_netmask;
+ newsin6 = (struct sockaddr_in6 *)&ss;
+ if (IN6_IS_ADDR_LINKLOCAL(&ifsin6->sin6_addr) &&
+ IN6_IS_ADDR_LINKLOCAL(&realsin6->sin6_addr) &&
+ IN6_IS_ADDR_LINKLOCAL(&clntsin6->sin6_addr)) {
+ if (ifsin6->sin6_scope_id !=
+ realsin6->sin6_scope_id)
+ continue;
+ goto found;
+ }
+ if (!bitmaskcmp(&ifsin6->sin6_addr,
+ &clntsin6->sin6_addr, &sin6mask->sin6_addr,
+ sizeof (struct in6_addr)))
+ goto found;
+ break;
+#endif
+ default:
+ goto freeit;
+ }
+ }
+ /*
+ * Didn't find anything. Get the first possibly useful interface,
+ * preferring "normal" interfaces to point-to-point and loopback
+ * ones.
+ */
+ bestif = NULL;
+ for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) {
+ if (ifap->ifa_addr->sa_family != clnt->sa_family ||
+ !(ifap->ifa_flags & IFF_UP))
+ continue;
+ if (!(ifap->ifa_flags & IFF_LOOPBACK) &&
+ !(ifap->ifa_flags & IFF_POINTOPOINT)) {
+ bestif = ifap;
+ break;
+ }
+ if (bestif == NULL)
+ bestif = ifap;
+ else if ((bestif->ifa_flags & IFF_LOOPBACK) &&
+ !(ifap->ifa_flags & IFF_LOOPBACK))
+ bestif = ifap;
+ }
+ ifap = bestif;
+found:
+ switch (clnt->sa_family) {
+ case AF_INET:
+ memcpy(newsin, ifap->ifa_addr, clnt_sa->sa_len);
+ newsin->sin_port = servsin->sin_port;
+ tbuf.len = clnt_sa->sa_len;
+ tbuf.maxlen = sizeof (struct sockaddr_storage);
+ tbuf.buf = newsin;
+ break;
+#ifdef INET6
+ case AF_INET6:
+ assert(newsin6);
+ memcpy(newsin6, ifsin6, clnt_sa->sa_len);
+ newsin6->sin6_port = servsin6->sin6_port;
+ tbuf.maxlen = sizeof (struct sockaddr_storage);
+ tbuf.len = clnt_sa->sa_len;
+ tbuf.buf = newsin6;
+ break;
+#endif
+ default:
+ goto freeit;
+ }
+ if (ifap != NULL)
+ ret = taddr2uaddr(nconf, &tbuf);
+freeit:
+ freenetconfigent(nconf);
+ free(serv_sa);
+ free(serv_nbp);
+ if (clnt_sa != NULL)
+ free(clnt_sa);
+ if (clnt_nbp != NULL)
+ free(clnt_nbp);
+ freeifaddrs(ifp);
+
+#ifdef RPCBIND_DEBUG
+ if (debugging)
+ fprintf(stderr, "addrmerge: returning %s\n", ret);
+#endif
+ return ret;
+}
+
+void
+network_init()
+{
+#ifdef INET6
+ struct ifaddrs *ifap, *ifp;
+ struct ipv6_mreq mreq6;
+ int ifindex, s;
+#endif
+ int ecode;
+ struct addrinfo hints, *res;
+
+ memset(&hints, 0, sizeof hints);
+ hints.ai_family = AF_INET;
+ if ((ecode = getaddrinfo(NULL, "sunrpc", &hints, &res))) {
+ if (debugging)
+ fprintf(stderr, "can't get local ip4 address: %s\n",
+ gai_strerror(ecode));
+ } else {
+ local_in4 = (struct sockaddr_in *)malloc(sizeof *local_in4);
+ if (local_in4 == NULL) {
+ if (debugging)
+ fprintf(stderr, "can't alloc local ip4 addr\n");
+ }
+ memcpy(local_in4, res->ai_addr, sizeof *local_in4);
+ }
+
+#ifdef INET6
+ hints.ai_family = AF_INET6;
+ if ((ecode = getaddrinfo(NULL, "sunrpc", &hints, &res))) {
+ if (debugging)
+ fprintf(stderr, "can't get local ip6 address: %s\n",
+ gai_strerror(ecode));
+ } else {
+ local_in6 = (struct sockaddr_in6 *)malloc(sizeof *local_in6);
+ if (local_in6 == NULL) {
+ if (debugging)
+ fprintf(stderr, "can't alloc local ip6 addr\n");
+ }
+ memcpy(local_in6, res->ai_addr, sizeof *local_in6);
+ }
+
+ /*
+ * Now join the RPC ipv6 multicast group on all interfaces.
+ */
+ if (getifaddrs(&ifp) < 0)
+ return;
+
+ mreq6.ipv6mr_interface = 0;
+ inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr);
+
+ s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
+
+ /*
+ * Loop through all interfaces. For each interface, see if the
+ * network portion of its address is equal to that of the client.
+ * If so, we have found the interface that we want to use.
+ */
+ for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) {
+ if (ifap->ifa_addr->sa_family != AF_INET6 ||
+ !(ifap->ifa_flags & IFF_MULTICAST))
+ continue;
+ ifindex = if_nametoindex(ifap->ifa_name);
+ if (ifindex == mreq6.ipv6mr_interface)
+ /*
+ * Already did this one.
+ */
+ continue;
+ mreq6.ipv6mr_interface = ifindex;
+ if (setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq6,
+ sizeof mreq6) < 0)
+ if (debugging)
+ warn("setsockopt v6 multicast");
+ }
+#endif
+
+ /* close(s); */
+}
+
+struct sockaddr *
+local_sa(int af)
+{
+ switch (af) {
+ case AF_INET:
+ return (struct sockaddr *)local_in4;
+#ifdef INET6
+ case AF_INET6:
+ return (struct sockaddr *)local_in6;
+#endif
+ default:
+ return NULL;
+ }
+}
diff --git a/contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c b/contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c
new file mode 100644
index 0000000..337a06e
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c
@@ -0,0 +1,165 @@
+/* $NetBSD: rumpnfsd.c,v 1.8 2014/05/12 15:31:07 christos Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+
+#include <dlfcn.h>
+#include <err.h>
+#include <errno.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
+void *mountd_main(void *);
+void *rpcbind_main(void *);
+int nfsd_main(int, char **);
+
+sem_t gensem;
+
+#include "../../../net/config/netconfig.c"
+#include "../../common/h_fsmacros.h"
+#include "svc_fdset.h"
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+int
+main(int argc, char *argv[])
+{
+ const char *ethername, *ethername_ro;
+ const char *serveraddr, *serveraddr_ro;
+ const char *netmask;
+ const char *exportpath;
+ const char *imagename;
+ char ifname[IFNAMSIZ], ifname_ro[IFNAMSIZ];
+ void *fsarg;
+ pthread_t t;
+ int rv;
+
+ /* for netcfg */
+ noatf = 1;
+
+ /* use defaults? */
+ if (argc == 1) {
+ ethername = "etherbus";
+ ethername_ro = "etherbus_ro";
+ serveraddr = "10.3.2.1";
+ serveraddr_ro = "10.4.2.1";
+ netmask = "255.255.255.0";
+ exportpath = "/myexport";
+ imagename = "ffs.img";
+ } else {
+ ethername = argv[1];
+ ethername_ro = argv[2];
+ serveraddr = argv[3];
+ serveraddr_ro = argv[4];
+ netmask = argv[5];
+ exportpath = argv[6];
+ imagename = argv[7];
+ }
+
+ rump_init();
+ init_fdsets();
+
+ rv = rump_pub_etfs_register("/etc/exports", "./exports", RUMP_ETFS_REG);
+ if (rv) {
+ errx(1, "register /etc/exports: %s", strerror(rv));
+ }
+
+ /* mini-mtree for mountd */
+ static const char *const dirs[] = { "/var", "/var/run", "/var/db" };
+ for (size_t i = 0; i < __arraycount(dirs); i++)
+ if (rump_sys_mkdir(dirs[i], 0777) == -1)
+ err(1, "can't mkdir `%s'", dirs[i]);
+
+ if (ffs_fstest_newfs(NULL, &fsarg,
+ imagename, FSTEST_IMGSIZE, NULL) != 0)
+ err(1, "newfs failed");
+ if (ffs_fstest_mount(NULL, fsarg, exportpath, 0) != 0)
+ err(1, "mount failed");
+
+#if 0
+ /*
+ * Serve from host instead of dedicated mount?
+ * THIS IS MORE EVIL THAN MURRAY THE DEMONIC TALKING SKULL!
+ */
+
+ if (ukfs_modload("/usr/lib/librumpfs_syspuffs.so") < 1)
+ errx(1, "modload");
+
+ mount_syspuffs_parseargs(__arraycount(pnullarg), pnullarg,
+ &args, &mntflags, canon_dev, canon_dir);
+ if ((ukfs = ukfs_mount(MOUNT_PUFFS, "/", UKFS_DEFAULTMP, MNT_RDONLY,
+ &args, sizeof(args))) == NULL)
+ err(1, "mount");
+
+ if (ukfs_modload("/usr/lib/librumpfs_nfsserver.so") < 1)
+ errx(1, "modload");
+#endif
+
+ if (sem_init(&gensem, 1, 0) == -1)
+ err(1, "gensem init");
+
+ /* create interface */
+ netcfg_rump_makeshmif(ethername, ifname);
+ netcfg_rump_if(ifname, serveraddr, netmask);
+
+ netcfg_rump_makeshmif(ethername_ro, ifname_ro);
+ netcfg_rump_if(ifname_ro, serveraddr_ro, netmask);
+
+ /*
+ * No syslogging, thanks.
+ * XXX: "0" does not modify the mask, so pick something
+ * which is unlikely to cause any logging
+ */
+ setlogmask(0x10000000);
+
+ if (pthread_create(&t, NULL, rpcbind_main, NULL) == -1)
+ err(1, "rpcbind");
+ sem_wait(&gensem);
+
+ if (pthread_create(&t, NULL, mountd_main, NULL) == -1)
+ err(1, "mountd");
+ sem_wait(&gensem);
+
+ rv = 0;
+ /* signal the other process we're almost done */
+ if (write(3, &rv, 4) != 4)
+ errx(1, "magic write failed");
+
+ {
+ char *nfsargv[] = { __UNCONST("nfsd"), NULL };
+ nfsd_main(1, nfsargv);
+ }
+ /*NOTREACHED*/
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/nfs/t_mountd.c b/contrib/netbsd-tests/fs/nfs/t_mountd.c
new file mode 100644
index 0000000..b6c1528
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/t_mountd.c
@@ -0,0 +1,121 @@
+/* $NetBSD: t_mountd.c,v 1.5 2012/02/24 13:53:46 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <signal.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+#include "../common/h_fsmacros.h"
+
+ATF_TC(mountdhup);
+ATF_TC_HEAD(mountdhup, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test for service interrupt while "
+ "mountd handles SIGHUP");
+}
+
+static volatile int quit;
+
+static void *
+wrkwrkwrk(void *unused)
+{
+ int fd, fail;
+
+ fail = 0;
+
+ rump_sys_chdir(FSTEST_MNTNAME);
+ while (!quit) {
+ fd = rump_sys_open("file", O_RDWR | O_CREAT);
+ if (fd == -1) {
+ if (errno == EACCES) {
+ fail++;
+ break;
+ }
+ }
+ rump_sys_close(fd);
+ if (rump_sys_unlink("file") == -1) {
+ if (errno == EACCES) {
+ fail++;
+ break;
+ }
+ }
+ }
+ rump_sys_chdir("/");
+ quit = 1;
+
+ return fail ? wrkwrkwrk : NULL;
+}
+
+ATF_TC_BODY(mountdhup, tc)
+{
+ pthread_t pt;
+ struct nfstestargs *nfsargs;
+ void *voidargs;
+ int attempts;
+ void *fail;
+
+ FSTEST_CONSTRUCTOR(tc, nfs, voidargs);
+ nfsargs = voidargs;
+
+ pthread_create(&pt, NULL, wrkwrkwrk, NULL);
+ for (attempts = 100; attempts && !quit; attempts--) {
+ usleep(100000);
+ kill(nfsargs->ta_childpid, SIGHUP);
+ }
+ quit = 1;
+ pthread_join(pt, &fail);
+
+ FSTEST_DESTRUCTOR(tc, nfs, voidargs);
+
+ atf_tc_expect_fail("PR kern/5844");
+ if (fail)
+ atf_tc_fail("op failed with EACCES");
+ else
+ atf_tc_fail("race did not trigger this time");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mountdhup);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/nfs/t_rquotad.sh b/contrib/netbsd-tests/fs/nfs/t_rquotad.sh
new file mode 100755
index 0000000..05d34fb
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nfs/t_rquotad.sh
@@ -0,0 +1,142 @@
+# $NetBSD: t_rquotad.sh,v 1.4 2014/03/13 12:45:14 gson Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+for e in le be; do
+ for v in 1; do
+ for q in "user" "group" "both"; do
+ test_case_root get_nfs_${e}_${v}_${q} get_nfs_quota \
+ "get NFS quota with ${q} enabled" ${e} ${v} ${q}
+ done
+ done
+done
+
+get_nfs_quota()
+{
+ create_ffs $*
+ local q=$3
+ local expect
+
+ case ${q} in
+ user)
+ expect=u
+ ;;
+ group)
+ expect=g
+ ;;
+ both)
+ expect="u g"
+ ;;
+ *)
+ atf_fail "wrong quota type"
+ ;;
+ esac
+
+#start a a nfs server
+
+ atf_check -s exit:0 rump_server -lrumpvfs -lrumpdev -lrumpnet \
+ -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 \
+ -lrumpnet_local -lrumpnet_shmif -lrumpdev_disk -lrumpfs_ffs \
+ -lrumpfs_nfs -lrumpfs_nfsserver \
+ -d key=/dk,hostpath=${IMG},size=host ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+ atf_check -s exit:0 rump.ifconfig shmif0 inet 10.1.1.1
+
+ export RUMPHIJACK_RETRYCONNECT=die
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+
+ atf_check -s exit:0 mkdir /rump/etc
+ atf_check -s exit:0 mkdir /rump/export
+ atf_check -s exit:0 mkdir -p /rump/var/run
+ atf_check -s exit:0 mkdir -p /rump/var/db
+ atf_check -s exit:0 touch /rump/var/db/mountdtab
+
+ /bin/echo "/export -noresvport -noresvmnt 10.1.1.100" | \
+ dd of=/rump/etc/exports 2> /dev/null
+
+ atf_check -s exit:0 -e ignore mount_ffs /dk /rump/export
+
+#set a quota limit (and check that we can read it back)
+ for q in ${expect} ; do
+ local id=$(id -${q})
+ atf_check -s exit:0 \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/export edquota -$q -s10k/20 -h40M/50k \
+ -t 2W/3D ${id}
+ atf_check -s exit:0 \
+-o "match:0 10 40960 2weeks 1 20 51200 3days" \
+-o "match:Disk quotas for .*: $" \
+ env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/export quota -${q} -v
+ done
+
+ # start rpcbind. we want /var/run/rpcbind.sock
+ export RUMPHIJACK='blanket=/var/run,socket=all'
+ atf_check -s exit:0 rpcbind
+
+ # ok, then we want mountd in the similar fashion
+ export RUMPHIJACK='blanket=/var/run:/var/db:/export,socket=all,path=/rump,vfs=all'
+ atf_check -s exit:0 mountd /rump/etc/exports
+
+ # and nfs
+ export RUMPHIJACK='blanket=/var/run,socket=all,vfs=all'
+ atf_check -s exit:0 nfsd
+
+ #finally, rpc.rquotad
+ export RUMPHIJACK='blanket=/var/run:/export,vfs=getvfsstat,socket=all'
+ atf_check -s exit:0 /usr/libexec/rpc.rquotad
+
+ # now start a client server
+ export RUMP_SERVER=unix://clientsock
+ RUMP_SOCKETS_LIST="${RUMP_SOCKETS_LIST} clientsock"
+ unset RUMPHIJACK
+ unset LD_PRELOAD
+
+ atf_check -s exit:0 rump_server -lrumpvfs -lrumpnet \
+ -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpfs_nfs\
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+ atf_check -s exit:0 rump.ifconfig shmif0 inet 10.1.1.100
+
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+
+ atf_check -s exit:0 mkdir /rump/mnt
+ atf_check -s exit:0 mount_nfs 10.1.1.1:/export /rump/mnt
+
+ #now try a quota(8) call
+ export RUMPHIJACK='blanket=/mnt,socket=all,path=/rump,vfs=getvfsstat'
+ for q in ${expect} ; do
+ local id=$(id -${q})
+ atf_check -s exit:0 \
+-o "match:/mnt 0 10 40960 1 20 51200 " \
+-o "match:Disk quotas for .*: $" \
+ quota -${q} -v
+ done
+
+ unset LD_PRELOAD
+ rump_quota_shutdown
+}
diff --git a/contrib/netbsd-tests/fs/nullfs/t_basic.c b/contrib/netbsd-tests/fs/nullfs/t_basic.c
new file mode 100644
index 0000000..21dfccd
--- /dev/null
+++ b/contrib/netbsd-tests/fs/nullfs/t_basic.c
@@ -0,0 +1,174 @@
+/* $NetBSD: t_basic.c,v 1.3 2010/06/09 08:37:16 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <miscfs/nullfs/null.h>
+#include <fs/tmpfs/tmpfs_args.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(basic);
+ATF_TC_HEAD(basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "basic nullfs functionality");
+}
+
+#define MSTR "magic bus"
+
+static void
+xput_tfile(const char *path, const char *mstr)
+{
+ int fd;
+
+ fd = rump_sys_open(path, O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create %s", path);
+ if (rump_sys_write(fd, MSTR, sizeof(MSTR)) != sizeof(MSTR))
+ atf_tc_fail_errno("write to testfile");
+ rump_sys_close(fd);
+}
+
+static int
+xread_tfile(const char *path, const char *mstr)
+{
+ char buf[128];
+ int fd;
+
+ fd = rump_sys_open(path, O_RDONLY);
+ if (fd == -1)
+ return errno;
+ if (rump_sys_read(fd, buf, sizeof(buf)) == -1)
+ atf_tc_fail_errno("read tfile");
+ rump_sys_close(fd);
+ if (strcmp(buf, MSTR) == 0)
+ return 0;
+ return EPROGMISMATCH;
+}
+
+static void
+mountnull(const char *what, const char *mp, int flags)
+{
+ struct null_args nargs;
+
+ memset(&nargs, 0, sizeof(nargs));
+ nargs.nulla_target = __UNCONST(what);
+ if (rump_sys_mount(MOUNT_NULL, mp, flags, &nargs, sizeof(nargs)) == -1)
+ atf_tc_fail_errno("could not mount nullfs");
+
+}
+
+ATF_TC_BODY(basic, tc)
+{
+ struct tmpfs_args targs;
+ struct stat sb;
+ int error;
+
+ rump_init();
+ if (rump_sys_mkdir("/td1", 0777) == -1)
+ atf_tc_fail_errno("mp1");
+ if (rump_sys_mkdir("/td2", 0777) == -1)
+ atf_tc_fail_errno("mp1");
+
+ /* use tmpfs because rumpfs doesn't support regular files */
+ memset(&targs, 0, sizeof(targs));
+ targs.ta_version = TMPFS_ARGS_VERSION;
+ targs.ta_root_mode = 0777;
+ if (rump_sys_mount(MOUNT_TMPFS, "/td1", 0, &targs, sizeof(targs)) == -1)
+ atf_tc_fail_errno("could not mount tmpfs td1");
+
+ mountnull("/td1", "/td2", 0);
+
+ /* test unnull -> null */
+ xput_tfile("/td1/tensti", "jeppe");
+ error = xread_tfile("/td2/tensti", "jeppe");
+ if (error != 0)
+ atf_tc_fail("null compare failed: %d (%s)",
+ error, strerror(error));
+
+ /* test null -> unnull */
+ xput_tfile("/td2/kiekko", "keppi");
+ error = xread_tfile("/td1/kiekko", "keppi");
+ if (error != 0)
+ atf_tc_fail("unnull compare failed: %d (%s)",
+ error, strerror(error));
+
+ /* test unnull -> null overwrite */
+ xput_tfile("/td1/tensti", "se oolannin sota");
+ error = xread_tfile("/td2/tensti", "se oolannin sota");
+ if (error != 0)
+ atf_tc_fail("unnull compare failed: %d (%s)",
+ error, strerror(error));
+
+ /* test that /td2 is unaffected in "real life" */
+ if (rump_sys_unmount("/td2", 0) == -1)
+ atf_tc_fail_errno("cannot unmount nullfs");
+ if ((error = rump_sys_stat("/td2/tensti", &sb)) != -1
+ || errno != ENOENT) {
+ atf_tc_fail("stat tensti should return ENOENT, got %d", error);
+ }
+ if ((error = rump_sys_stat("/td2/kiekko", &sb)) != -1
+ || errno != ENOENT) {
+ atf_tc_fail("stat kiekko should return ENOENT, got %d", error);
+ }
+
+ /* done */
+}
+
+ATF_TC(twistymount);
+ATF_TC_HEAD(twistymount, tc)
+{
+
+ /* this is expected to fail until the PR is fixed */
+ atf_tc_set_md_var(tc, "descr", "\"recursive\" mounts deadlock"
+ " (kern/43439)");
+}
+
+/*
+ * Mapping to identifiers in kern/43439:
+ * /td = /home/current/pkgsrc
+ * /td/dist = /home/current/pkgsrc/distiles
+ * /mp = /usr/pkgsrc
+ * /mp/dist = /usr/pkgsrc/distfiles -- "created" by first null mount
+ */
+
+ATF_TC_BODY(twistymount, tc)
+{
+ int mkd = 0;
+
+ rump_init();
+
+ if (rump_sys_mkdir("/td", 0777) == -1)
+ atf_tc_fail_errno("mkdir %d", mkd++);
+ if (rump_sys_mkdir("/td/dist", 0777) == -1)
+ atf_tc_fail_errno("mkdir %d", mkd++);
+ if (rump_sys_mkdir("/mp", 0777) == -1)
+ atf_tc_fail_errno("mkdir %d", mkd++);
+
+ /* MNT_RDONLY doesn't matter, but just for compat with the PR */
+ mountnull("/td", "/mp", MNT_RDONLY);
+ mountnull("/td/dist", "/mp/dist", 0);
+
+ /* if we didn't get a locking-against-meself panic, we passed */
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, basic);
+ ATF_TP_ADD_TC(tp, twistymount);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/psshfs/h_have_puffs.c b/contrib/netbsd-tests/fs/psshfs/h_have_puffs.c
new file mode 100644
index 0000000..9d34950
--- /dev/null
+++ b/contrib/netbsd-tests/fs/psshfs/h_have_puffs.c
@@ -0,0 +1,58 @@
+/* $NetBSD: h_have_puffs.c,v 1.1 2010/07/06 14:06:22 pooka Exp $ */
+/*
+ * Copyright (c) 2007 The NetBSD Foundation, 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 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 <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+ int exitcode, fd;
+
+ fd = open("/dev/puffs", O_RDWR);
+ if (fd != -1) {
+ printf("yes\n");
+ close(fd);
+ exitcode = EXIT_SUCCESS;
+ } else {
+ if (errno == ENXIO) {
+ printf("enxio\n");
+ exitcode = EXIT_SUCCESS;
+ } else if (errno == EACCES) {
+ printf("eacces\n");
+ exitcode = EXIT_SUCCESS;
+ } else {
+ printf("failed\n");
+ exitcode = EXIT_FAILURE;
+ }
+ }
+
+ return exitcode;
+}
diff --git a/contrib/netbsd-tests/fs/psshfs/ssh_config.in b/contrib/netbsd-tests/fs/psshfs/ssh_config.in
new file mode 100644
index 0000000..3ebd68b
--- /dev/null
+++ b/contrib/netbsd-tests/fs/psshfs/ssh_config.in
@@ -0,0 +1,14 @@
+# $NetBSD: ssh_config.in,v 1.1 2010/07/06 14:06:22 pooka Exp $
+
+# Basic settings.
+Port 10000
+Protocol 2
+
+# The temporary key used for login.
+IdentityFile @WORKDIR@/ssh_user_key
+
+# Prevent the client from complaining about unknown host keys.
+GlobalKnownHostsFile @WORKDIR@/known_hosts
+
+# Do not attempt password authentication in case keys fail.
+IdentitiesOnly yes
diff --git a/contrib/netbsd-tests/fs/psshfs/ssh_host_key b/contrib/netbsd-tests/fs/psshfs/ssh_host_key
new file mode 100644
index 0000000..ebdbc8b
--- /dev/null
+++ b/contrib/netbsd-tests/fs/psshfs/ssh_host_key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQDJnMpSG1lGmApk8F7ZH7TGtjjP/WUs+vqHyFsyS2lilJzereen
+a/ME6S0d0HTOeCdKldjbtDpfNXbh+XnJMlJMEgEs4Mg1jluuEV0GOJoMt7cGzku2
+gAYGx++2+wqYw6Y+M8Tb1M4AO+PcxD/3BkdUyIKO63v6STl2VQn1BzsTQwIBIwKB
+gAuFTWPHDGpvFols0jhK9GMgWwSSIwnidLdNRwowMehgQ3pwVmFWoCwqlN0h2sn4
+PMJu9nL0WxtiJAzprzARgQuPI25t9LiKTF7scC/cNUiHPplUjvoDXA9ccY1eIf4R
+e6wwZz1jfCWen0eRsvMyoYvFmEH8hILAk1bY9heymOGLAkEA/WhC49n+gtloVMow
+iKQOO6+u3ouxTOTQ3sV2wCaLaO2pEbHP2//5SlUJLp6QrjC7bg9Kr+f56+zT2he9
+f6GCwwJBAMus3XizmZdJyJLnkCJRiT0/3Kf57fhWKRdnFkuRLyjET9MEWavRdJmr
+bx/lxmILi1iKwXiFEDM6MqYfmNImJYECQQCtw9YYlXtSaTGZOi/oqwJyEhGCqO6b
+II85q/moVPHhjQY4BOZNttbT4on0FPV+wlSjPa+OkHDcSp/mAaaDZ2+bAkEAujel
+6rLVkaKLfv+ZuPoXE22WivMityo0Mqdk12ArHfVQS+a4YpOdzlOYzLTSosi56o19
+sAShGOTAl+Jf1hQ/iwJAKpPviX5w292H/m5T0m4l0NRdQ3pRujOLMSVmY+/HFZTW
+GJMYLr1eBKNfLsKzJgB88GzuF2O/O8hNi3XSiOP+9w==
+-----END RSA PRIVATE KEY-----
diff --git a/contrib/netbsd-tests/fs/psshfs/ssh_host_key.pub b/contrib/netbsd-tests/fs/psshfs/ssh_host_key.pub
new file mode 100644
index 0000000..8d08795
--- /dev/null
+++ b/contrib/netbsd-tests/fs/psshfs/ssh_host_key.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAyZzKUhtZRpgKZPBe2R+0xrY4z/1lLPr6h8hbMktpYpSc3q3np2vzBOktHdB0zngnSpXY27Q6XzV24fl5yTJSTBIBLODINY5brhFdBjiaDLe3Bs5LtoAGBsfvtvsKmMOmPjPE29TOADvj3MQ/9wZHVMiCjut7+kk5dlUJ9Qc7E0M= test@test.example.net
diff --git a/contrib/netbsd-tests/fs/psshfs/sshd_config.in b/contrib/netbsd-tests/fs/psshfs/sshd_config.in
new file mode 100644
index 0000000..a7f86b1
--- /dev/null
+++ b/contrib/netbsd-tests/fs/psshfs/sshd_config.in
@@ -0,0 +1,40 @@
+# $NetBSD: sshd_config.in,v 1.2 2011/02/11 13:19:46 pooka Exp $
+
+# Basic settings.
+Port 10000
+Protocol 2
+
+# Provide information to the user in case something goes wrong.
+LogLevel DEBUG1
+
+# The host key. It lives in the work directory because we need to set
+# very strict permissions on it and cannot modify the copy on the source
+# directory.
+HostKey @WORKDIR@/ssh_host_key
+
+# The authorized keys file we set up during the test to allow the client
+# to safely log in. We need to disable strict modes because ATF_WORKDIR
+# usually lives in /tmp, which has 1777 permissions and are not liked by
+# sshd.
+AuthorizedKeysFile @WORKDIR@/authorized_keys
+StrictModes no
+
+# Some settings to allow user runs of sshd.
+PidFile @WORKDIR@/sshd.pid
+Subsystem sftp @WORKDIR@/sftp-server
+UsePam no
+UsePrivilegeSeparation no
+
+# The root user should also be able to run the tests.
+PermitRootLogin yes
+
+# Be restrictive about access to the temporary server. Only allow key-based
+# authentication.
+ChallengeResponseAuthentication no
+GSSAPIAuthentication no
+HostbasedAuthentication no
+KerberosAuthentication no
+MaxAuthTries 1
+MaxStartups 1
+PasswordAuthentication no
+PubkeyAuthentication yes
diff --git a/contrib/netbsd-tests/fs/psshfs/t_psshfs.sh b/contrib/netbsd-tests/fs/psshfs/t_psshfs.sh
new file mode 100755
index 0000000..241d46d
--- /dev/null
+++ b/contrib/netbsd-tests/fs/psshfs/t_psshfs.sh
@@ -0,0 +1,274 @@
+# $NetBSD: t_psshfs.sh,v 1.7 2013/03/16 07:54:04 jmmv Exp $
+#
+# Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+# -------------------------------------------------------------------------
+# Auxiliary functions.
+# -------------------------------------------------------------------------
+
+#
+# Skips the calling test case if puffs is not supported in the kernel
+# or if the calling user does not have the necessary permissions to mount
+# file systems.
+#
+require_puffs() {
+ case "$($(atf_get_srcdir)/h_have_puffs)" in
+ eacces)
+ atf_skip "Cannot open /dev/puffs for read/write access"
+ ;;
+ enxio)
+ atf_skip "puffs support not built into the kernel"
+ ;;
+ failed)
+ atf_skip "Unknown error trying to access /dev/puffs"
+ ;;
+ yes)
+ ;;
+ *)
+ atf_fail "Unknown value returned by h_have_puffs"
+ ;;
+ esac
+
+ if [ $(id -u) -ne 0 -a $(sysctl -n vfs.generic.usermount) -eq 0 ]
+ then
+ atf_skip "Regular users cannot mount file systems" \
+ "(vfs.generic.usermount is set to 0)"
+ fi
+}
+
+#
+# Starts a SSH server and sets up the client to access it.
+# Authentication is allowed and done using an RSA key exclusively, which
+# is generated on the fly as part of the test case.
+# XXX: Ideally, all the tests in this test program should be able to share
+# the generated key, because creating it can be a very slow process on some
+# machines.
+#
+start_ssh() {
+ echo "Setting up SSH server configuration"
+ sed -e "s,@SRCDIR@,$(atf_get_srcdir),g" -e "s,@WORKDIR@,$(pwd),g" \
+ $(atf_get_srcdir)/sshd_config.in >sshd_config || \
+ atf_fail "Failed to create sshd_config"
+ atf_check -s eq:0 -o empty -e empty cp /usr/libexec/sftp-server .
+ atf_check -s eq:0 -o empty -e empty \
+ cp $(atf_get_srcdir)/ssh_host_key .
+ atf_check -s eq:0 -o empty -e empty \
+ cp $(atf_get_srcdir)/ssh_host_key.pub .
+ atf_check -s eq:0 -o empty -e empty chmod 400 ssh_host_key
+ atf_check -s eq:0 -o empty -e empty chmod 444 ssh_host_key.pub
+
+ /usr/sbin/sshd -e -f ./sshd_config >sshd.log 2>&1 &
+ while [ ! -f sshd.pid ]; do
+ sleep 0.01
+ done
+ echo "SSH server started (pid $(cat sshd.pid))"
+
+ echo "Setting up SSH client configuration"
+ atf_check -s eq:0 -o empty -e empty \
+ ssh-keygen -f ssh_user_key -t rsa -b 1024 -N "" -q
+ atf_check -s eq:0 -o empty -e empty \
+ cp ssh_user_key.pub authorized_keys
+ echo "[localhost]:10000,[127.0.0.1]:10000,[::1]:10000" \
+ "$(cat $(atf_get_srcdir)/ssh_host_key.pub)" >known_hosts || \
+ atf_fail "Failed to create known_hosts"
+ atf_check -s eq:0 -o empty -e empty chmod 600 authorized_keys
+ sed -e "s,@SRCDIR@,$(atf_get_srcdir),g" -e "s,@WORKDIR@,$(pwd),g" \
+ $(atf_get_srcdir)/ssh_config.in >ssh_config || \
+ atf_fail "Failed to create ssh_config"
+}
+
+#
+# Stops the SSH server spawned by start_ssh and prints diagnosis data.
+#
+stop_ssh() {
+ if [ -f sshd.pid ]; then
+ echo "Stopping SSH server (pid $(cat sshd.pid))"
+ kill $(cat sshd.pid)
+ fi
+ if [ -f sshd.log ]; then
+ echo "Server output was:"
+ sed -e 's,^, ,' sshd.log
+ fi
+}
+
+#
+# Mounts the given source directory on the target directory using psshfs.
+# Both directories are supposed to live on the current directory.
+#
+mount_psshfs() {
+ atf_check -s eq:0 -o empty -e empty \
+ mount -t psshfs -o -F=$(pwd)/ssh_config localhost:$(pwd)/${1} ${2}
+}
+
+# -------------------------------------------------------------------------
+# The test cases.
+# -------------------------------------------------------------------------
+
+atf_test_case inode_nos cleanup
+inode_nos_head() {
+ atf_set "descr" "Checks that different files get different inode" \
+ "numbers"
+}
+inode_nos_body() {
+ require_puffs
+
+ start_ssh
+
+ mkdir root
+ mkdir root/dir
+ touch root/dir/file1
+ touch root/dir/file2
+ touch root/file3
+ touch root/file4
+
+ cat >ne_inodes.sh <<EOF
+#! /bin/sh
+#
+# Compares the inodes of the two given files and returns true if they are
+# different; false otherwise.
+#
+set -e
+ino1=\$(stat -f %i \${1})
+ino2=\$(stat -f %i \${2})
+test \${ino1} -ne \${ino2}
+EOF
+ chmod +x ne_inodes.sh
+
+ mkdir mnt
+ mount_psshfs root mnt
+ atf_check -s eq:0 -o empty -e empty \
+ ./ne_inodes.sh root/dir root/dir/file1
+ atf_check -s eq:0 -o empty -e empty \
+ ./ne_inodes.sh root/dir root/dir/file2
+ atf_check -s eq:0 -o empty -e empty \
+ ./ne_inodes.sh root/dir/file1 root/dir/file2
+ atf_check -s eq:0 -o empty -e empty \
+ ./ne_inodes.sh root/file3 root/file4
+}
+inode_nos_cleanup() {
+ umount mnt
+ stop_ssh
+}
+
+atf_test_case pwd cleanup
+pwd_head() {
+ atf_set "descr" "Checks that pwd works correctly"
+}
+pwd_body() {
+ require_puffs
+
+ start_ssh
+
+ mkdir root
+ mkdir root/dir
+
+ mkdir mnt
+ atf_check -s eq:0 -o save:stdout -e empty \
+ -x 'echo $(cd mnt && /bin/pwd)/dir'
+ mv stdout expout
+ mount_psshfs root mnt
+ atf_check -s eq:0 -o file:expout -e empty \
+ -x 'cd mnt/dir && ls .. >/dev/null && /bin/pwd'
+}
+pwd_cleanup() {
+ umount mnt
+ stop_ssh
+}
+
+atf_test_case ls cleanup
+ls_head() {
+ atf_set "descr" "Uses ls, attempts to exercise puffs_cc"
+}
+ls_body() {
+ require_puffs
+
+ start_ssh
+
+ mkdir mnt
+ mkdir root
+ mkdir root/dir
+ touch root/dir/file1
+ touch root/dir/file2
+ touch root/file3
+ touch root/file4
+
+ mount_psshfs root mnt
+
+ ls -l mnt &
+
+ IFS=' '
+lsout='dir
+file3
+file4
+
+mnt/dir:
+file1
+file2
+'
+ atf_check -s exit:0 -o inline:"$lsout" ls -R mnt
+}
+ls_cleanup() {
+ umount mnt
+ stop_ssh
+}
+
+atf_test_case setattr_cache cleanup
+setattr_cache_head() {
+ atf_set "descr" "Checks that setattr caches"
+ # Don't wait for the eternity that atf usually waits. Twenty
+ # seconds should be good enough, except maybe on a VAX...
+ atf_set "timeout" 20
+}
+setattr_cache_body() {
+ require_puffs
+ start_ssh
+ atf_check -s exit:0 mkdir root
+ atf_check -s exit:0 mkdir mnt
+ mount_psshfs root mnt
+ atf_check -s exit:0 -x ': > mnt/loser'
+ atf_check -s exit:0 -o save:stat stat mnt/loser
+ # Oops -- this doesn't work. We need to stop the child of the
+ # sshd that is handling the sftp session.
+ atf_check -s exit:0 kill -STOP $(cat sshd.pid)
+ atf_check -s exit:0 -x ': > mnt/loser'
+ atf_check -s exit:0 -o file:stat stat mnt/loser
+}
+setattr_cache_cleanup() {
+ umount mnt
+ kill -CONT $(cat sshd.pid)
+ stop_ssh
+}
+
+# -------------------------------------------------------------------------
+# Initialization.
+# -------------------------------------------------------------------------
+
+atf_init_test_cases() {
+ atf_add_test_case inode_nos
+ atf_add_test_case pwd
+ atf_add_test_case ls
+ #atf_add_test_case setattr_cache
+}
diff --git a/contrib/netbsd-tests/fs/ptyfs/t_nullpts.c b/contrib/netbsd-tests/fs/ptyfs/t_nullpts.c
new file mode 100644
index 0000000..9265f32
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ptyfs/t_nullpts.c
@@ -0,0 +1,128 @@
+/* $NetBSD: t_nullpts.c,v 1.5 2011/01/10 11:11:04 hannken Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/ioctl.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <fs/ptyfs/ptyfs.h>
+#include <miscfs/nullfs/null.h>
+
+#include "../../h_macros.h"
+
+static void
+mountptyfs(const char *mp, int flags)
+{
+ struct ptyfs_args args;
+
+ if (rump_sys_mkdir(mp, 0777) == -1) {
+ if (errno != EEXIST)
+ atf_tc_fail_errno("null create %s", mp);
+ }
+ memset(&args, 0, sizeof(args));
+ args.version = PTYFS_ARGSVERSION;
+ args.mode = 0777;
+ if (rump_sys_mount(MOUNT_PTYFS, mp, flags, &args, sizeof(args)) == -1)
+ atf_tc_fail_errno("could not mount ptyfs");
+}
+
+static void
+mountnull(const char *what, const char *mp, int flags)
+{
+ struct null_args nargs;
+
+ if (rump_sys_mkdir(what, 0777) == -1) {
+ if (errno != EEXIST)
+ atf_tc_fail_errno("null create %s", what);
+ }
+ if (rump_sys_mkdir(mp, 0777) == -1) {
+ if (errno != EEXIST)
+ atf_tc_fail_errno("null create %s", mp);
+ }
+ memset(&nargs, 0, sizeof(nargs));
+ nargs.nulla_target = __UNCONST(what);
+ if (rump_sys_mount(MOUNT_NULL, mp, flags, &nargs, sizeof(nargs)) == -1)
+ atf_tc_fail_errno("could not mount nullfs");
+}
+
+ATF_TC(nullrevoke);
+ATF_TC_HEAD(nullrevoke, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "null mount ptyfs and revoke");
+}
+
+ATF_TC_BODY(nullrevoke, tc)
+{
+ char path[MAXPATHLEN];
+ struct ptmget ptg;
+ int ptm;
+
+ rump_init();
+
+ /*
+ * mount /dev/pts
+ */
+ mountptyfs("/dev/pts", 0);
+
+ /*
+ * null mount /dev/pts to /null/dev/pts
+ */
+ if (rump_sys_mkdir("/null", 0777) == -1) {
+ if (errno != EEXIST)
+ atf_tc_fail_errno("null create /null");
+ }
+ if (rump_sys_mkdir("/null/dev", 0777) == -1) {
+ if (errno != EEXIST)
+ atf_tc_fail_errno("null create /null/dev");
+ }
+
+ mountnull("/dev/pts", "/null/dev/pts", 0);
+
+ /*
+ * get slave/master pair.
+ */
+ ptm = rump_sys_open("/dev/ptm", O_RDWR);
+ if (rump_sys_ioctl(ptm, TIOCPTMGET, &ptg) == -1)
+ atf_tc_fail_errno("get pty");
+
+ /*
+ * Build nullfs path to slave.
+ */
+ strcpy(path, "/null");
+ strcat(path, ptg.sn);
+
+ /*
+ * Open slave tty via nullfs.
+ */
+ if (rump_sys_open(path, O_RDWR) == -1)
+ atf_tc_fail_errno("slave null open");
+
+ /*
+ * Close slave opened with /dev/ptm. Need purely non-null refs to it.
+ */
+ rump_sys_close(ptg.sfd);
+
+ /* revoke slave tty. */
+ rump_sys_revoke(path);
+
+ /* done */
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, nullrevoke);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/ptyfs/t_ptyfs.c b/contrib/netbsd-tests/fs/ptyfs/t_ptyfs.c
new file mode 100644
index 0000000..90001b9
--- /dev/null
+++ b/contrib/netbsd-tests/fs/ptyfs/t_ptyfs.c
@@ -0,0 +1,62 @@
+/* $NetBSD: t_ptyfs.c,v 1.1 2010/06/11 23:52:38 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <fs/ptyfs/ptyfs.h>
+
+#include "../../h_macros.h"
+
+static void
+mountptyfs(const char *mp, int flags)
+{
+ struct ptyfs_args args;
+
+ if (rump_sys_mkdir("/mp", 0777) == -1) {
+ if (errno != EEXIST)
+ atf_tc_fail_errno("mp1");
+ }
+ memset(&args, 0, sizeof(args));
+ args.version = PTYFS_ARGSVERSION;
+ args.mode = 0777;
+ if (rump_sys_mount(MOUNT_PTYFS, mp, flags, &args, sizeof(args)) == -1)
+ atf_tc_fail_errno("could not mount ptyfs");
+}
+
+ATF_TC(basic);
+ATF_TC_HEAD(basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "mount ptyfs");
+}
+
+ATF_TC_BODY(basic, tc)
+{
+
+ rump_init();
+
+ mountptyfs("/mp", 0);
+ if (rump_sys_unmount("/mp", 0) == -1)
+ atf_tc_fail_errno("unmount failed");
+
+ /* done */
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs.c b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs.c
new file mode 100644
index 0000000..c625f90
--- /dev/null
+++ b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs.c
@@ -0,0 +1,255 @@
+/* $NetBSD: dtfs.c,v 1.2 2010/07/21 06:58:25 pooka Exp $ */
+
+/*
+ * Copyright (c) 2006 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Delectable Test File System: a simple in-memory file system which
+ * demonstrates the use of puffs.
+ * (a.k.a. Detrempe FS ...)
+ */
+
+#include <sys/types.h>
+
+#include <err.h>
+#include <mntopts.h>
+#include <paths.h>
+#include <puffs.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "dtfs.h"
+
+#ifdef DEEP_ROOTED_CLUE
+#define FSNAME "detrempe"
+#else
+#define FSNAME "dt"
+#endif
+#define MAXREQMAGIC -37
+
+static struct puffs_usermount *gpu;
+static struct dtfs_mount gdtm;
+int dynamicfh;
+int straightflush;
+
+static void usage(void);
+
+static void
+usage()
+{
+
+ fprintf(stderr, "usage: %s [-bsdftl] [-c hashbuckets] [-m maxreqsize] "
+ "[-n typename]\n [-o mntopt] [-o puffsopt] [-p prot] "
+ "[-r rootnodetype]\n detrempe /mountpoint\n", getprogname());
+ exit(1);
+}
+
+static void
+wipe_the_sleep_out_of_my_eyes(int v)
+{
+
+ gdtm.dtm_needwakeup++;
+}
+
+static void
+loopfun(struct puffs_usermount *pu)
+{
+ struct dtfs_mount *dtm = puffs_getspecific(pu);
+ struct dtfs_poll *dp;
+
+ while (dtm->dtm_needwakeup) {
+ dtm->dtm_needwakeup--;
+ dp = LIST_FIRST(&dtm->dtm_pollent);
+ if (dp == NULL)
+ return;
+
+ LIST_REMOVE(dp, dp_entries);
+ puffs_cc_continue(dp->dp_pcc);
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ extern char *optarg;
+ extern int optind;
+ struct puffs_usermount *pu;
+ struct puffs_pathobj *po_root;
+ struct puffs_ops *pops;
+ struct timespec ts;
+ const char *typename;
+ char *rtstr;
+ mntoptparse_t mp;
+ int pflags, detach, mntflags;
+ int ch;
+ int khashbuckets;
+ int maxreqsize;
+
+ setprogname(argv[0]);
+
+ rtstr = NULL;
+ detach = 1;
+ mntflags = 0;
+ khashbuckets = 256;
+ pflags = PUFFS_KFLAG_IAONDEMAND;
+ typename = FSNAME;
+ maxreqsize = MAXREQMAGIC;
+ gdtm.dtm_allowprot = VM_PROT_ALL;
+ while ((ch = getopt(argc, argv, "bc:dfilm:n:o:p:r:st")) != -1) {
+ switch (ch) {
+ case 'b': /* build paths, for debugging the feature */
+ pflags |= PUFFS_FLAG_BUILDPATH;
+ break;
+ case 'c':
+ khashbuckets = atoi(optarg);
+ break;
+ case 'd':
+ dynamicfh = 1;
+ break;
+ case 'f':
+ pflags |= PUFFS_KFLAG_LOOKUP_FULLPNBUF;
+ break;
+ case 'i':
+ pflags &= ~PUFFS_KFLAG_IAONDEMAND;
+ break;
+ case 'l':
+ straightflush = 1;
+ break;
+ case 'm':
+ maxreqsize = atoi(optarg);
+ break;
+ case 'n':
+ typename = optarg;
+ break;
+ case 'o':
+ mp = getmntopts(optarg, puffsmopts, &mntflags, &pflags);
+ if (mp == NULL)
+ err(1, "getmntopts");
+ freemntopts(mp);
+ break;
+ case 'p':
+ gdtm.dtm_allowprot = atoi(optarg);
+ if ((gdtm.dtm_allowprot | VM_PROT_ALL) != VM_PROT_ALL)
+ usage();
+ break;
+ case 'r':
+ rtstr = optarg;
+ break;
+ case 's': /* stay on top */
+ detach = 0;
+ break;
+ case 't':
+ pflags |= PUFFS_KFLAG_WTCACHE;
+ break;
+ default:
+ usage();
+ /*NOTREACHED*/
+ }
+ }
+ if (pflags & PUFFS_FLAG_OPDUMP)
+ detach = 0;
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 2)
+ usage();
+
+ PUFFSOP_INIT(pops);
+
+ PUFFSOP_SET(pops, dtfs, fs, statvfs);
+ PUFFSOP_SET(pops, dtfs, fs, unmount);
+ PUFFSOP_SETFSNOP(pops, sync);
+ PUFFSOP_SET(pops, dtfs, fs, fhtonode);
+ PUFFSOP_SET(pops, dtfs, fs, nodetofh);
+
+ PUFFSOP_SET(pops, dtfs, node, lookup);
+ PUFFSOP_SET(pops, dtfs, node, access);
+ PUFFSOP_SET(pops, puffs_genfs, node, getattr);
+ PUFFSOP_SET(pops, dtfs, node, setattr);
+ PUFFSOP_SET(pops, dtfs, node, create);
+ PUFFSOP_SET(pops, dtfs, node, remove);
+ PUFFSOP_SET(pops, dtfs, node, readdir);
+ PUFFSOP_SET(pops, dtfs, node, poll);
+ PUFFSOP_SET(pops, dtfs, node, mmap);
+ PUFFSOP_SET(pops, dtfs, node, mkdir);
+ PUFFSOP_SET(pops, dtfs, node, rmdir);
+ PUFFSOP_SET(pops, dtfs, node, rename);
+ PUFFSOP_SET(pops, dtfs, node, read);
+ PUFFSOP_SET(pops, dtfs, node, write);
+ PUFFSOP_SET(pops, dtfs, node, link);
+ PUFFSOP_SET(pops, dtfs, node, symlink);
+ PUFFSOP_SET(pops, dtfs, node, readlink);
+ PUFFSOP_SET(pops, dtfs, node, mknod);
+ PUFFSOP_SET(pops, dtfs, node, inactive);
+ PUFFSOP_SET(pops, dtfs, node, pathconf);
+ PUFFSOP_SET(pops, dtfs, node, reclaim);
+
+ srandom(time(NULL)); /* for random generation numbers */
+
+ pu = puffs_init(pops, _PATH_PUFFS, typename, &gdtm, pflags);
+ if (pu == NULL)
+ err(1, "init");
+ gpu = pu;
+
+ puffs_setfhsize(pu, sizeof(struct dtfs_fid),
+ PUFFS_FHFLAG_NFSV2 | PUFFS_FHFLAG_NFSV3
+ | (dynamicfh ? PUFFS_FHFLAG_DYNAMIC : 0));
+ puffs_setncookiehash(pu, khashbuckets);
+
+ if (signal(SIGALRM, wipe_the_sleep_out_of_my_eyes) == SIG_ERR)
+ warn("cannot set alarm sighandler");
+
+ /* init */
+ if (dtfs_domount(pu, rtstr) != 0)
+ errx(1, "dtfs_domount failed");
+
+ po_root = puffs_getrootpathobj(pu);
+ po_root->po_path = argv[0];
+ po_root->po_len = strlen(argv[0]);
+
+ /* often enough for testing poll */
+ ts.tv_sec = 1;
+ ts.tv_nsec = 0;
+ puffs_ml_setloopfn(pu, loopfun);
+ puffs_ml_settimeout(pu, &ts);
+
+ if (maxreqsize != MAXREQMAGIC)
+ puffs_setmaxreqlen(pu, maxreqsize);
+
+ puffs_set_errnotify(pu, puffs_kernerr_abort);
+ if (detach)
+ if (puffs_daemon(pu, 1, 1) == -1)
+ err(1, "puffs_daemon");
+
+ if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1)
+ err(1, "mount");
+ if (puffs_mainloop(pu) == -1)
+ err(1, "mainloop");
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs.h b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs.h
new file mode 100644
index 0000000..de4d958
--- /dev/null
+++ b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs.h
@@ -0,0 +1,127 @@
+/* $NetBSD: dtfs.h,v 1.2 2010/07/14 13:09:52 pooka Exp $ */
+
+/*
+ * Copyright (c) 2006 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 DTFS_H_
+#define DTFS_H_
+
+#include <sys/types.h>
+
+#include <puffs.h>
+
+PUFFSOP_PROTOS(dtfs);
+int dtfs_domount(struct puffs_usermount *, const char *);
+
+#define DTFS_BLOCKSHIFT (12)
+#define DTFS_BLOCKSIZE (1<<DTFS_BLOCKSHIFT)
+
+#define ROUNDUP(a,b) ((a) & ((b)-1))
+#define BLOCKNUM(a,b) (((a) & ~((1<<(b))-1)) >> (b))
+
+struct dtfs_fid;
+struct dtfs_mount {
+ ino_t dtm_nextfileid; /* running number for file id */
+
+ size_t dtm_fsizes; /* sum of file sizes in bytes */
+ fsfilcnt_t dtm_nfiles; /* number of files */
+
+ LIST_HEAD(, dtfs_poll) dtm_pollent;
+ int dtm_needwakeup;
+ vm_prot_t dtm_allowprot;
+};
+
+struct dtfs_file {
+ union {
+ struct {
+ uint8_t **blocks;
+ size_t numblocks;
+ size_t datalen;
+ } reg;
+ struct {
+ struct puffs_node *dotdot;
+ LIST_HEAD(, dtfs_dirent) dirents;
+ } dir;
+ struct {
+ char *target;
+ } link;
+ } u;
+#define df_blocks u.reg.blocks
+#define df_numblocks u.reg.numblocks
+#define df_datalen u.reg.datalen
+#define df_dotdot u.dir.dotdot
+#define df_dirents u.dir.dirents
+#define df_linktarget u.link.target
+};
+
+struct dtfs_dirent {
+ struct puffs_node *dfd_node;
+ struct puffs_node *dfd_parent;
+ char *dfd_name;
+ size_t dfd_namelen;
+
+ LIST_ENTRY(dtfs_dirent) dfd_entries;
+};
+
+struct dtfs_fid {
+ struct puffs_node *dfid_addr;
+
+ /* best^Wsome-effort extra sanity check */
+ ino_t dfid_fileid;
+ u_long dfid_gen;
+};
+#define DTFS_FIDSIZE (sizeof(struct dtfs_fid))
+
+struct dtfs_poll {
+ struct puffs_cc *dp_pcc;
+ LIST_ENTRY(dtfs_poll) dp_entries;
+};
+
+struct puffs_node * dtfs_genfile(struct puffs_node *,
+ const struct puffs_cn *, enum vtype);
+struct dtfs_file * dtfs_newdir(void);
+struct dtfs_file * dtfs_newfile(void);
+struct dtfs_dirent * dtfs_dirgetnth(struct dtfs_file *, int);
+struct dtfs_dirent * dtfs_dirgetbyname(struct dtfs_file *,
+ const char *, size_t);
+
+void dtfs_nukenode(struct puffs_node *, struct puffs_node *,
+ const char *, size_t);
+void dtfs_freenode(struct puffs_node *);
+void dtfs_setsize(struct puffs_node *, off_t);
+
+void dtfs_adddent(struct puffs_node *, struct dtfs_dirent *);
+void dtfs_removedent(struct puffs_node *, struct dtfs_dirent *);
+
+void dtfs_baseattrs(struct vattr *, enum vtype, ino_t);
+void dtfs_updatetimes(struct puffs_node *, int, int, int);
+
+bool dtfs_isunder(struct puffs_node *, struct puffs_node *);
+
+
+#define DTFS_CTOF(a) ((struct dtfs_file *)(((struct puffs_node *)a)->pn_data))
+#define DTFS_PTOF(a) ((struct dtfs_file *)(a->pn_data))
+
+#endif /* DTFS_H_ */
diff --git a/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_subr.c b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_subr.c
new file mode 100644
index 0000000..fcb8176
--- /dev/null
+++ b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_subr.c
@@ -0,0 +1,358 @@
+/* $NetBSD: dtfs_subr.c,v 1.4 2013/10/19 17:45:00 christos Exp $ */
+
+/*
+ * Copyright (c) 2006 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+#include <sys/time.h>
+
+#include <assert.h>
+#include <err.h>
+#include <errno.h>
+#include <puffs.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <util.h>
+
+#include "dtfs.h"
+
+void
+dtfs_baseattrs(struct vattr *vap, enum vtype type, ino_t id)
+{
+ struct timeval tv;
+ struct timespec ts;
+
+ gettimeofday(&tv, NULL);
+ TIMEVAL_TO_TIMESPEC(&tv, &ts);
+
+ vap->va_type = type;
+ if (type == VDIR) {
+ vap->va_mode = 0777;
+ vap->va_nlink = 1; /* n + 1 after adding dent */
+ } else {
+ vap->va_mode = 0666;
+ vap->va_nlink = 0; /* n + 1 */
+ }
+ vap->va_uid = 0;
+ vap->va_gid = 0;
+ vap->va_fileid = id;
+ vap->va_size = 0;
+ vap->va_blocksize = getpagesize();
+ vap->va_gen = random();
+ vap->va_flags = 0;
+ vap->va_rdev = PUFFS_VNOVAL;
+ vap->va_bytes = 0;
+ vap->va_filerev = 1;
+ vap->va_vaflags = 0;
+
+ vap->va_atime = vap->va_mtime = vap->va_ctime = vap->va_birthtime = ts;
+}
+
+/*
+ * Well, as you can probably see, this interface has the slight problem
+ * of assuming file creation will always be succesful, or at least not
+ * giving a reason for the failure. Be sure to do better when you
+ * implement your own fs.
+ */
+struct puffs_node *
+dtfs_genfile(struct puffs_node *dir, const struct puffs_cn *pcn,
+ enum vtype type)
+{
+ struct dtfs_file *dff;
+ struct dtfs_dirent *dfd;
+ struct dtfs_mount *dtm;
+ struct puffs_node *newpn;
+ uid_t uid;
+ int rv;
+
+ assert(dir->pn_va.va_type == VDIR);
+ assert(dir->pn_mnt != NULL);
+
+ uid = 0;
+ rv = puffs_cred_getuid(pcn->pcn_cred, &uid);
+ assert(rv == 0);
+
+ if (type == VDIR) {
+ dff = dtfs_newdir();
+ dff->df_dotdot = dir;
+ } else
+ dff = dtfs_newfile();
+
+ dtm = puffs_pn_getmntspecific(dir);
+ newpn = puffs_pn_new(dir->pn_mnt, dff);
+ if (newpn == NULL)
+ errx(1, "getnewpnode");
+ dtfs_baseattrs(&newpn->pn_va, type, dtm->dtm_nextfileid++);
+
+ dfd = emalloc(sizeof(struct dtfs_dirent));
+ dfd->dfd_node = newpn;
+ dfd->dfd_name = estrndup(pcn->pcn_name, pcn->pcn_namelen);
+ dfd->dfd_namelen = strlen(dfd->dfd_name);
+ dfd->dfd_parent = dir;
+ dtfs_adddent(dir, dfd);
+
+ newpn->pn_va.va_uid = uid;
+ newpn->pn_va.va_gid = dir->pn_va.va_gid;
+
+ return newpn;
+}
+
+struct dtfs_file *
+dtfs_newdir()
+{
+ struct dtfs_file *dff;
+
+ dff = emalloc(sizeof(struct dtfs_file));
+ memset(dff, 0, sizeof(struct dtfs_file));
+ LIST_INIT(&dff->df_dirents);
+
+ return dff;
+}
+
+struct dtfs_file *
+dtfs_newfile()
+{
+ struct dtfs_file *dff;
+
+ dff = emalloc(sizeof(struct dtfs_file));
+ memset(dff, 0, sizeof(struct dtfs_file));
+
+ return dff;
+}
+
+struct dtfs_dirent *
+dtfs_dirgetnth(struct dtfs_file *searchdir, int n)
+{
+ struct dtfs_dirent *dirent;
+ int i;
+
+ i = 0;
+ LIST_FOREACH(dirent, &searchdir->df_dirents, dfd_entries) {
+ if (i == n)
+ return dirent;
+ i++;
+ }
+
+ return NULL;
+}
+
+struct dtfs_dirent *
+dtfs_dirgetbyname(struct dtfs_file *searchdir, const char *fname, size_t fnlen)
+{
+ struct dtfs_dirent *dirent;
+
+ LIST_FOREACH(dirent, &searchdir->df_dirents, dfd_entries)
+ if (dirent->dfd_namelen == fnlen
+ && strncmp(dirent->dfd_name, fname, fnlen) == 0)
+ return dirent;
+
+ return NULL;
+}
+
+/*
+ * common nuke, kill dirent from parent node
+ */
+void
+dtfs_nukenode(struct puffs_node *nukeme, struct puffs_node *pn_parent,
+ const char *fname, size_t fnlen)
+{
+ struct dtfs_dirent *dfd;
+ struct dtfs_mount *dtm;
+
+ assert(pn_parent->pn_va.va_type == VDIR);
+
+ dfd = dtfs_dirgetbyname(DTFS_PTOF(pn_parent), fname, fnlen);
+ assert(dfd);
+
+ dtm = puffs_pn_getmntspecific(nukeme);
+ dtm->dtm_nfiles--;
+ assert(dtm->dtm_nfiles >= 1);
+
+ dtfs_removedent(pn_parent, dfd);
+ free(dfd);
+}
+
+/* free lingering information */
+void
+dtfs_freenode(struct puffs_node *pn)
+{
+ struct dtfs_file *df = DTFS_PTOF(pn);
+ struct dtfs_mount *dtm;
+ int i;
+
+ assert(pn->pn_va.va_nlink == 0);
+ dtm = puffs_pn_getmntspecific(pn);
+
+ switch (pn->pn_va.va_type) {
+ case VREG:
+ assert(dtm->dtm_fsizes >= pn->pn_va.va_size);
+ dtm->dtm_fsizes -= pn->pn_va.va_size;
+ for (i = 0; i < BLOCKNUM(df->df_datalen, DTFS_BLOCKSHIFT); i++)
+ free(df->df_blocks[i]);
+ if (df->df_datalen > i << DTFS_BLOCKSHIFT)
+ free(df->df_blocks[i]);
+ break;
+ case VLNK:
+ free(df->df_linktarget);
+ break;
+ case VCHR:
+ case VBLK:
+ case VDIR:
+ case VSOCK:
+ case VFIFO:
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ free(df);
+ puffs_pn_put(pn);
+}
+
+void
+dtfs_setsize(struct puffs_node *pn, off_t newsize)
+{
+ struct dtfs_file *df = DTFS_PTOF(pn);
+ struct dtfs_mount *dtm;
+ size_t newblocks;
+ int needalloc, shrinks;
+ int i;
+
+ needalloc = newsize > ROUNDUP(df->df_datalen, DTFS_BLOCKSIZE);
+ shrinks = newsize < pn->pn_va.va_size;
+
+ if (needalloc || shrinks) {
+ newblocks = BLOCKNUM(newsize, DTFS_BLOCKSHIFT) + 1;
+
+ if (shrinks)
+ for (i = newblocks; i < df->df_numblocks; i++)
+ free(df->df_blocks[i]);
+
+ df->df_blocks = erealloc(df->df_blocks,
+ newblocks * sizeof(uint8_t *));
+ /*
+ * if extended, set storage to zero
+ * to match correct behaviour
+ */
+ if (!shrinks) {
+ for (i = df->df_numblocks; i < newblocks; i++) {
+ df->df_blocks[i] = emalloc(DTFS_BLOCKSIZE);
+ memset(df->df_blocks[i], 0, DTFS_BLOCKSIZE);
+ }
+ }
+
+ df->df_datalen = newsize;
+ df->df_numblocks = newblocks;
+ }
+
+ dtm = puffs_pn_getmntspecific(pn);
+ if (!shrinks) {
+ dtm->dtm_fsizes += newsize - pn->pn_va.va_size;
+ } else {
+ dtm->dtm_fsizes -= pn->pn_va.va_size - newsize;
+ }
+
+ pn->pn_va.va_size = newsize;
+ pn->pn_va.va_bytes = BLOCKNUM(newsize,DTFS_BLOCKSHIFT)>>DTFS_BLOCKSHIFT;
+}
+
+/* add & bump link count */
+void
+dtfs_adddent(struct puffs_node *pn_dir, struct dtfs_dirent *dent)
+{
+ struct dtfs_file *dir = DTFS_PTOF(pn_dir);
+ struct puffs_node *pn_file = dent->dfd_node;
+ struct dtfs_file *file = DTFS_PTOF(pn_file);
+ struct dtfs_mount *dtm;
+
+ assert(pn_dir->pn_va.va_type == VDIR);
+ LIST_INSERT_HEAD(&dir->df_dirents, dent, dfd_entries);
+ pn_file->pn_va.va_nlink++;
+
+ dtm = puffs_pn_getmntspecific(pn_file);
+ dtm->dtm_nfiles++;
+
+ dent->dfd_parent = pn_dir;
+ if (dent->dfd_node->pn_va.va_type == VDIR) {
+ file->df_dotdot = pn_dir;
+ pn_dir->pn_va.va_nlink++;
+ }
+
+ dtfs_updatetimes(pn_dir, 0, 1, 1);
+}
+
+/* remove & lower link count */
+void
+dtfs_removedent(struct puffs_node *pn_dir, struct dtfs_dirent *dent)
+{
+ struct puffs_node *pn_file = dent->dfd_node;
+
+ assert(pn_dir->pn_va.va_type == VDIR);
+ LIST_REMOVE(dent, dfd_entries);
+ if (pn_file->pn_va.va_type == VDIR) {
+ struct dtfs_file *df = DTFS_PTOF(pn_file);
+
+ pn_dir->pn_va.va_nlink--;
+ df->df_dotdot = NULL;
+ }
+ pn_file->pn_va.va_nlink--;
+ assert(pn_dir->pn_va.va_nlink >= 2);
+
+ dtfs_updatetimes(pn_dir, 0, 1, 1);
+}
+
+void
+dtfs_updatetimes(struct puffs_node *pn, int doatime, int doctime, int domtime)
+{
+ struct timeval tv;
+ struct timespec ts;
+
+ gettimeofday(&tv, NULL);
+ TIMEVAL_TO_TIMESPEC(&tv, &ts);
+
+ if (doatime)
+ pn->pn_va.va_atime = ts;
+ if (doctime)
+ pn->pn_va.va_ctime = ts;
+ if (domtime)
+ pn->pn_va.va_mtime = ts;
+}
+
+bool
+dtfs_isunder(struct puffs_node *pn, struct puffs_node *pn_parent)
+{
+ struct dtfs_file *df;
+
+ while (pn) {
+ if (pn == pn_parent)
+ return true;
+ df = DTFS_CTOF(pn);
+ pn = df->df_dotdot;
+ }
+
+ return false;
+}
diff --git a/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_vfsops.c b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_vfsops.c
new file mode 100644
index 0000000..6f0c72e
--- /dev/null
+++ b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_vfsops.c
@@ -0,0 +1,298 @@
+/* $NetBSD: dtfs_vfsops.c,v 1.3 2012/11/04 23:37:02 christos Exp $ */
+
+/*
+ * Copyright (c) 2006 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+#include <sys/resource.h>
+
+#include <stdio.h>
+#include <assert.h>
+#include <err.h>
+#include <errno.h>
+#include <puffs.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <util.h>
+
+#include "dtfs.h"
+
+static int
+rtstr(struct puffs_usermount *pu, const char *str, enum vtype vt)
+{
+ struct puffs_node *pn = puffs_getroot(pu);
+ struct vattr *va = &pn->pn_va;
+ struct dtfs_file *df = DTFS_PTOF(pn);
+ char ltarg[256+1];
+
+ if (sscanf(str, "%*s %256s", ltarg) != 1)
+ return 1;
+
+ dtfs_baseattrs(va, vt, 2);
+ df->df_linktarget = estrdup(ltarg);
+
+ va->va_nlink = 1;
+ va->va_size = strlen(df->df_linktarget);
+
+ puffs_setrootinfo(pu, vt, 0, 0);
+
+ return 0;
+}
+
+static int
+rtdev(struct puffs_usermount *pu, const char *str, enum vtype vt)
+{
+ struct puffs_node *pn = puffs_getroot(pu);
+ struct vattr *va = &pn->pn_va;
+ int major, minor;
+
+ if (sscanf(str, "%*s %d %d", &major, &minor) != 2)
+ return 1;
+
+ dtfs_baseattrs(va, vt, 2);
+ va->va_nlink = 1;
+ va->va_rdev = makedev(major, minor);
+
+ if (vt == VBLK)
+ va->va_mode |= S_IFBLK;
+ else
+ va->va_mode |= S_IFCHR;
+
+ puffs_setrootinfo(pu, vt, 0, va->va_rdev);
+
+ return 0;
+}
+
+static int
+rtnorm(struct puffs_usermount *pu, const char *str, enum vtype vt)
+{
+ struct puffs_node *pn = puffs_getroot(pu);
+ struct vattr *va = &pn->pn_va;
+
+ dtfs_baseattrs(va, vt, 2);
+ if (vt == VDIR)
+ va->va_nlink = 2;
+ else
+ va->va_nlink = 1;
+
+ puffs_setrootinfo(pu, vt, 0, 0);
+
+ return 0;
+}
+
+struct rtype {
+ char *tstr;
+ enum vtype vt;
+ int (*pfunc)(struct puffs_usermount *, const char *, enum vtype);
+} rtypes[] = {
+ { "reg", VREG, rtnorm },
+ { "dir", VDIR, rtnorm },
+ { "blk", VBLK, rtdev },
+ { "chr", VCHR, rtdev },
+ { "lnk", VLNK, rtstr },
+ { "sock", VSOCK, rtnorm },
+ { "fifo", VFIFO, rtnorm }
+};
+#define NTYPES (sizeof(rtypes) / sizeof(rtypes[0]))
+
+int
+dtfs_domount(struct puffs_usermount *pu, const char *typestr)
+{
+ struct dtfs_mount *dtm;
+ struct dtfs_file *dff;
+ struct puffs_node *pn;
+ int i;
+
+ /* create mount-local thingie */
+ dtm = puffs_getspecific(pu);
+ dtm->dtm_nextfileid = 3;
+ dtm->dtm_nfiles = 1;
+ dtm->dtm_fsizes = 0;
+ LIST_INIT(&dtm->dtm_pollent);
+
+ /*
+ * create root directory, do it "by hand" to avoid special-casing
+ * dtfs_genfile()
+ */
+ dff = dtfs_newdir();
+ dff->df_dotdot = NULL;
+ pn = puffs_pn_new(pu, dff);
+ if (!pn)
+ errx(1, "puffs_newpnode");
+ puffs_setroot(pu, pn);
+
+ if (!typestr) {
+ rtnorm(pu, NULL, VDIR);
+ } else {
+ for (i = 0; i < NTYPES; i++) {
+ if (strncmp(rtypes[i].tstr, typestr,
+ strlen(rtypes[i].tstr)) == 0) {
+ if (rtypes[i].pfunc(pu, typestr,
+ rtypes[i].vt) != 0) {
+ fprintf(stderr, "failed to parse "
+ "\"%s\"\n", typestr);
+ return 1;
+ }
+ break;
+ }
+ }
+ if (i == NTYPES) {
+ fprintf(stderr, "no maching type for %s\n", typestr);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * statvfs() should fill in the following members of struct statvfs:
+ *
+ * unsigned long f_bsize; file system block size
+ * unsigned long f_frsize; fundamental file system block size
+ * unsigned long f_iosize; optimal file system block size
+ * fsblkcnt_t f_blocks; number of blocks in file system,
+ * (in units of f_frsize)
+ *
+ * fsblkcnt_t f_bfree; free blocks avail in file system
+ * fsblkcnt_t f_bavail; free blocks avail to non-root
+ * fsblkcnt_t f_bresvd; blocks reserved for root
+ *
+ * fsfilcnt_t f_files; total file nodes in file system
+ * fsfilcnt_t f_ffree; free file nodes in file system
+ * fsfilcnt_t f_favail; free file nodes avail to non-root
+ * fsfilcnt_t f_fresvd; file nodes reserved for root
+ *
+ *
+ * The rest are filled in by the kernel.
+ */
+#define ROUND(a,b) (((a) + ((b)-1)) & ~((b)-1))
+#define NFILES 1024*1024
+int
+dtfs_fs_statvfs(struct puffs_usermount *pu, struct statvfs *sbp)
+{
+ struct rlimit rlim;
+ struct dtfs_mount *dtm;
+ off_t btot, bfree;
+ int pgsize;
+
+ dtm = puffs_getspecific(pu);
+ pgsize = getpagesize();
+ memset(sbp, 0, sizeof(struct statvfs));
+
+ /*
+ * Use datasize rlimit as an _approximation_ for free size.
+ * This, of course, is not accurate due to overhead and not
+ * accounting for metadata.
+ */
+ if (getrlimit(RLIMIT_DATA, &rlim) == 0)
+ btot = rlim.rlim_cur;
+ else
+ btot = 16*1024*1024;
+ bfree = btot - dtm->dtm_fsizes;
+
+ sbp->f_blocks = ROUND(btot, pgsize) / pgsize;
+ sbp->f_files = NFILES;
+
+ sbp->f_bsize = sbp->f_frsize = sbp->f_iosize = pgsize;
+ sbp->f_bfree = sbp->f_bavail = ROUND(bfree, pgsize) / pgsize;
+ sbp->f_ffree = sbp->f_favail = NFILES - dtm->dtm_nfiles;
+
+ sbp->f_bresvd = sbp->f_fresvd = 0;
+
+ return 0;
+}
+#undef ROUND
+
+static void *
+addrcmp(struct puffs_usermount *pu, struct puffs_node *pn, void *arg)
+{
+
+ if (pn == arg)
+ return pn;
+
+ return NULL;
+}
+
+int
+dtfs_fs_fhtonode(struct puffs_usermount *pu, void *fid, size_t fidsize,
+ struct puffs_newinfo *pni)
+{
+ struct dtfs_fid *dfid;
+ struct puffs_node *pn;
+
+ assert(fidsize == sizeof(struct dtfs_fid));
+ dfid = fid;
+
+ pn = puffs_pn_nodewalk(pu, addrcmp, dfid->dfid_addr);
+ if (pn == NULL)
+ return ESTALE;
+
+ if (pn->pn_va.va_fileid != dfid->dfid_fileid
+ || pn->pn_va.va_gen != dfid->dfid_gen)
+ return ESTALE;
+
+ puffs_newinfo_setcookie(pni, pn);
+ puffs_newinfo_setvtype(pni, pn->pn_va.va_type);
+ puffs_newinfo_setsize(pni, pn->pn_va.va_size);
+ puffs_newinfo_setrdev(pni, pn->pn_va.va_rdev);
+
+ return 0;
+}
+
+int
+dtfs_fs_nodetofh(struct puffs_usermount *pu, void *cookie,
+ void *fid, size_t *fidsize)
+{
+ struct puffs_node *pn = cookie;
+ struct dtfs_fid *dfid;
+ extern int dynamicfh;
+
+ if (dynamicfh == 0) {
+ assert(*fidsize >= sizeof(struct dtfs_fid));
+ } else {
+ if (*fidsize < sizeof(struct dtfs_fid)) {
+ *fidsize = sizeof(struct dtfs_fid);
+ return E2BIG;
+ }
+ *fidsize = sizeof(struct dtfs_fid);
+ }
+
+ dfid = fid;
+
+ dfid->dfid_addr = pn;
+ dfid->dfid_fileid = pn->pn_va.va_fileid;
+ dfid->dfid_gen = pn->pn_va.va_gen;
+
+ return 0;
+}
+
+int
+dtfs_fs_unmount(struct puffs_usermount *pu, int flags)
+{
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_vnops.c b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_vnops.c
new file mode 100644
index 0000000..875109c
--- /dev/null
+++ b/contrib/netbsd-tests/fs/puffs/h_dtfs/dtfs_vnops.c
@@ -0,0 +1,586 @@
+/* $NetBSD: dtfs_vnops.c,v 1.10 2013/10/19 17:45:00 christos Exp $ */
+
+/*
+ * Copyright (c) 2006 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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/types.h>
+#include <sys/poll.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <puffs.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <util.h>
+
+#include "dtfs.h"
+
+int
+dtfs_node_lookup(struct puffs_usermount *pu, void *opc,
+ struct puffs_newinfo *pni, const struct puffs_cn *pcn)
+{
+ struct puffs_node *pn_dir = opc;
+ struct dtfs_file *df = DTFS_CTOF(opc);
+ struct dtfs_dirent *dfd;
+ extern int straightflush;
+ int rv;
+
+ /* parent dir? */
+ if (PCNISDOTDOT(pcn)) {
+ if (df->df_dotdot == NULL)
+ return ENOENT;
+
+ assert(df->df_dotdot->pn_va.va_type == VDIR);
+ puffs_newinfo_setcookie(pni, df->df_dotdot);
+ puffs_newinfo_setvtype(pni, df->df_dotdot->pn_va.va_type);
+
+ return 0;
+ }
+
+ dfd = dtfs_dirgetbyname(df, pcn->pcn_name, pcn->pcn_namelen);
+ if (dfd) {
+ if ((pcn->pcn_flags & NAMEI_ISLASTCN) &&
+ (pcn->pcn_nameiop == NAMEI_DELETE)) {
+ rv = puffs_access(VDIR, pn_dir->pn_va.va_mode,
+ pn_dir->pn_va.va_uid, pn_dir->pn_va.va_gid,
+ PUFFS_VWRITE, pcn->pcn_cred);
+ if (rv)
+ return rv;
+ }
+ puffs_newinfo_setcookie(pni, dfd->dfd_node);
+ puffs_newinfo_setvtype(pni, dfd->dfd_node->pn_va.va_type);
+ puffs_newinfo_setsize(pni, dfd->dfd_node->pn_va.va_size);
+ puffs_newinfo_setrdev(pni, dfd->dfd_node->pn_va.va_rdev);
+
+ if (straightflush)
+ puffs_flush_pagecache_node(pu, dfd->dfd_node);
+
+ return 0;
+ }
+
+ if ((pcn->pcn_flags & NAMEI_ISLASTCN)
+ && (pcn->pcn_nameiop == NAMEI_CREATE ||
+ pcn->pcn_nameiop == NAMEI_RENAME)) {
+ rv = puffs_access(VDIR, pn_dir->pn_va.va_mode,
+ pn_dir->pn_va.va_uid, pn_dir->pn_va.va_gid,
+ PUFFS_VWRITE, pcn->pcn_cred);
+ if (rv)
+ return rv;
+ }
+
+ return ENOENT;
+}
+
+int
+dtfs_node_access(struct puffs_usermount *pu, void *opc, int acc_mode,
+ const struct puffs_cred *pcr)
+{
+ struct puffs_node *pn = opc;
+
+ return puffs_access(pn->pn_va.va_type, pn->pn_va.va_mode,
+ pn->pn_va.va_uid, pn->pn_va.va_gid, acc_mode, pcr);
+}
+
+int
+dtfs_node_setattr(struct puffs_usermount *pu, void *opc,
+ const struct vattr *va, const struct puffs_cred *pcr)
+{
+ struct puffs_node *pn = opc;
+ int rv;
+
+ /* check permissions */
+ if (va->va_flags != PUFFS_VNOVAL)
+ return EOPNOTSUPP;
+
+ if (va->va_uid != PUFFS_VNOVAL || va->va_gid != PUFFS_VNOVAL) {
+ rv = puffs_access_chown(pn->pn_va.va_uid, pn->pn_va.va_gid,
+ va->va_uid, va->va_gid, pcr);
+ if (rv)
+ return rv;
+ }
+
+ if (va->va_mode != PUFFS_VNOVAL) {
+ rv = puffs_access_chmod(pn->pn_va.va_uid, pn->pn_va.va_gid,
+ pn->pn_va.va_type, va->va_mode, pcr);
+ if (rv)
+ return rv;
+ }
+
+ if ((va->va_atime.tv_sec != PUFFS_VNOVAL
+ && va->va_atime.tv_nsec != PUFFS_VNOVAL)
+ || (va->va_mtime.tv_sec != PUFFS_VNOVAL
+ && va->va_mtime.tv_nsec != PUFFS_VNOVAL)) {
+ rv = puffs_access_times(pn->pn_va.va_uid, pn->pn_va.va_gid,
+ pn->pn_va.va_mode, va->va_vaflags & VA_UTIMES_NULL, pcr);
+ if (rv)
+ return rv;
+ }
+
+ if (va->va_size != PUFFS_VNOVAL) {
+ switch (pn->pn_va.va_type) {
+ case VREG:
+ dtfs_setsize(pn, va->va_size);
+ pn->pn_va.va_bytes = va->va_size;
+ break;
+ case VBLK:
+ case VCHR:
+ case VFIFO:
+ break;
+ case VDIR:
+ return EISDIR;
+ default:
+ return EOPNOTSUPP;
+ }
+ }
+
+ puffs_setvattr(&pn->pn_va, va);
+
+ return 0;
+}
+
+/* create a new node in the parent directory specified by opc */
+int
+dtfs_node_create(struct puffs_usermount *pu, void *opc,
+ struct puffs_newinfo *pni, const struct puffs_cn *pcn,
+ const struct vattr *va)
+{
+ struct puffs_node *pn_parent = opc;
+ struct puffs_node *pn_new;
+
+ if (!(va->va_type == VREG || va->va_type == VSOCK))
+ return ENODEV;
+
+ pn_new = dtfs_genfile(pn_parent, pcn, va->va_type);
+ puffs_setvattr(&pn_new->pn_va, va);
+
+ puffs_newinfo_setcookie(pni, pn_new);
+
+ return 0;
+}
+
+int
+dtfs_node_remove(struct puffs_usermount *pu, void *opc, void *targ,
+ const struct puffs_cn *pcn)
+{
+ struct puffs_node *pn_parent = opc;
+ struct puffs_node *pn = targ;
+
+ if (pn->pn_va.va_type == VDIR)
+ return EPERM;
+
+ dtfs_nukenode(targ, pn_parent, pcn->pcn_name, pcn->pcn_namelen);
+
+ if (pn->pn_va.va_nlink == 0)
+ puffs_setback(puffs_cc_getcc(pu), PUFFS_SETBACK_NOREF_N2);
+
+ return 0;
+}
+
+int
+dtfs_node_mkdir(struct puffs_usermount *pu, void *opc,
+ struct puffs_newinfo *pni, const struct puffs_cn *pcn,
+ const struct vattr *va)
+{
+ struct puffs_node *pn_parent = opc;
+ struct puffs_node *pn_new;
+
+ pn_new = dtfs_genfile(pn_parent, pcn, VDIR);
+ puffs_setvattr(&pn_new->pn_va, va);
+
+ puffs_newinfo_setcookie(pni, pn_new);
+
+ return 0;
+}
+
+int
+dtfs_node_rmdir(struct puffs_usermount *pu, void *opc, void *targ,
+ const struct puffs_cn *pcn)
+{
+ struct puffs_node *pn_parent = opc;
+ struct dtfs_file *df = DTFS_CTOF(targ);
+
+ if (!LIST_EMPTY(&df->df_dirents))
+ return ENOTEMPTY;
+
+ dtfs_nukenode(targ, pn_parent, pcn->pcn_name, pcn->pcn_namelen);
+ puffs_setback(puffs_cc_getcc(pu), PUFFS_SETBACK_NOREF_N2);
+
+ return 0;
+}
+
+int
+dtfs_node_readdir(struct puffs_usermount *pu, void *opc,
+ struct dirent *dent, off_t *readoff, size_t *reslen,
+ const struct puffs_cred *pcr,
+ int *eofflag, off_t *cookies, size_t *ncookies)
+{
+ struct puffs_node *pn = opc;
+ struct puffs_node *pn_nth;
+ struct dtfs_dirent *dfd_nth;
+
+ if (pn->pn_va.va_type != VDIR)
+ return ENOTDIR;
+
+ dtfs_updatetimes(pn, 1, 0, 0);
+
+ *ncookies = 0;
+ again:
+ if (*readoff == DENT_DOT || *readoff == DENT_DOTDOT) {
+ puffs_gendotdent(&dent, pn->pn_va.va_fileid, *readoff, reslen);
+ (*readoff)++;
+ PUFFS_STORE_DCOOKIE(cookies, ncookies, *readoff);
+ goto again;
+ }
+
+ for (;;) {
+ dfd_nth = dtfs_dirgetnth(pn->pn_data, DENT_ADJ(*readoff));
+ if (!dfd_nth) {
+ *eofflag = 1;
+ break;
+ }
+ pn_nth = dfd_nth->dfd_node;
+
+ if (!puffs_nextdent(&dent, dfd_nth->dfd_name,
+ pn_nth->pn_va.va_fileid,
+ puffs_vtype2dt(pn_nth->pn_va.va_type),
+ reslen))
+ break;
+
+ (*readoff)++;
+ PUFFS_STORE_DCOOKIE(cookies, ncookies, *readoff);
+ }
+
+ return 0;
+}
+
+int
+dtfs_node_poll(struct puffs_usermount *pu, void *opc, int *events)
+{
+ struct dtfs_mount *dtm = puffs_getspecific(pu);
+ struct dtfs_poll dp;
+ struct itimerval it;
+
+ memset(&it, 0, sizeof(struct itimerval));
+ it.it_value.tv_sec = 4;
+ if (setitimer(ITIMER_REAL, &it, NULL) == -1)
+ return errno;
+
+ dp.dp_pcc = puffs_cc_getcc(pu);
+ LIST_INSERT_HEAD(&dtm->dtm_pollent, &dp, dp_entries);
+ puffs_cc_yield(dp.dp_pcc);
+
+ *events = *events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM);
+ return 0;
+}
+
+int
+dtfs_node_mmap(struct puffs_usermount *pu, void *opc, vm_prot_t prot,
+ const struct puffs_cred *pcr)
+{
+ struct dtfs_mount *dtm = puffs_getspecific(pu);
+
+ if ((dtm->dtm_allowprot & prot) != prot)
+ return EACCES;
+
+ return 0;
+}
+
+int
+dtfs_node_rename(struct puffs_usermount *pu, void *opc, void *src,
+ const struct puffs_cn *pcn_src, void *targ_dir, void *targ,
+ const struct puffs_cn *pcn_targ)
+{
+ struct dtfs_dirent *dfd_src;
+ struct dtfs_file *df_targ;
+ struct puffs_node *pn_sdir = opc;
+ struct puffs_node *pn_sfile = src;
+ struct puffs_node *pn_tdir = targ_dir;
+ struct puffs_node *pn_tfile = targ;
+
+ /* check that we don't do the old amigados trick */
+ if (pn_sfile->pn_va.va_type == VDIR) {
+ if (dtfs_isunder(pn_tdir, pn_sfile))
+ return EINVAL;
+
+ if ((pcn_src->pcn_namelen == 1 && pcn_src->pcn_name[0]=='.') ||
+ opc == src ||
+ PCNISDOTDOT(pcn_src) ||
+ PCNISDOTDOT(pcn_targ)) {
+ return EINVAL;
+ }
+ }
+
+ dfd_src = dtfs_dirgetbyname(DTFS_PTOF(pn_sdir),
+ pcn_src->pcn_name, pcn_src->pcn_namelen);
+
+ /* does it still exist, or did someone race us here? */
+ if (dfd_src == NULL) {
+ return ENOENT;
+ }
+
+ /* if there's a target file, nuke it for atomic replacement */
+ if (pn_tfile) {
+ if (pn_tfile->pn_va.va_type == VDIR) {
+ df_targ = DTFS_CTOF(pn_tfile);
+ if (!LIST_EMPTY(&df_targ->df_dirents))
+ return ENOTEMPTY;
+ }
+ dtfs_nukenode(pn_tfile, pn_tdir,
+ pcn_targ->pcn_name, pcn_targ->pcn_namelen);
+ }
+
+ /* out with the old */
+ dtfs_removedent(pn_sdir, dfd_src);
+ /* and in with the new */
+ dtfs_adddent(pn_tdir, dfd_src);
+
+ /* update name */
+ free(dfd_src->dfd_name);
+ dfd_src->dfd_name = estrndup(pcn_targ->pcn_name,pcn_targ->pcn_namelen);
+ dfd_src->dfd_namelen = strlen(dfd_src->dfd_name);
+
+ dtfs_updatetimes(src, 0, 1, 0);
+
+ return 0;
+}
+
+int
+dtfs_node_link(struct puffs_usermount *pu, void *opc, void *targ,
+ const struct puffs_cn *pcn)
+{
+ struct puffs_node *pn_dir = opc;
+ struct dtfs_dirent *dfd;
+
+ dfd = emalloc(sizeof(struct dtfs_dirent));
+ dfd->dfd_node = targ;
+ dfd->dfd_name = estrndup(pcn->pcn_name, pcn->pcn_namelen);
+ dfd->dfd_namelen = strlen(dfd->dfd_name);
+ dtfs_adddent(pn_dir, dfd);
+
+ dtfs_updatetimes(targ, 0, 1, 0);
+
+ return 0;
+}
+
+int
+dtfs_node_symlink(struct puffs_usermount *pu, void *opc,
+ struct puffs_newinfo *pni, const struct puffs_cn *pcn_src,
+ const struct vattr *va, const char *link_target)
+{
+ struct puffs_node *pn_parent = opc;
+ struct puffs_node *pn_new;
+ struct dtfs_file *df_new;
+
+ if (va->va_type != VLNK)
+ return ENODEV;
+
+ pn_new = dtfs_genfile(pn_parent, pcn_src, VLNK);
+ puffs_setvattr(&pn_new->pn_va, va);
+ df_new = DTFS_PTOF(pn_new);
+ df_new->df_linktarget = estrdup(link_target);
+ pn_new->pn_va.va_size = strlen(df_new->df_linktarget);
+
+ puffs_newinfo_setcookie(pni, pn_new);
+
+ return 0;
+}
+
+int
+dtfs_node_readlink(struct puffs_usermount *pu, void *opc,
+ const struct puffs_cred *cred, char *linkname, size_t *linklen)
+{
+ struct dtfs_file *df = DTFS_CTOF(opc);
+ struct puffs_node *pn = opc;
+
+ assert(pn->pn_va.va_type == VLNK);
+ strlcpy(linkname, df->df_linktarget, *linklen);
+ *linklen = strlen(linkname);
+
+ return 0;
+}
+
+int
+dtfs_node_mknod(struct puffs_usermount *pu, void *opc,
+ struct puffs_newinfo *pni, const struct puffs_cn *pcn,
+ const struct vattr *va)
+{
+ struct puffs_node *pn_parent = opc;
+ struct puffs_node *pn_new;
+
+ if (!(va->va_type == VBLK || va->va_type == VCHR
+ || va->va_type == VFIFO))
+ return EINVAL;
+
+ pn_new = dtfs_genfile(pn_parent, pcn, va->va_type);
+ puffs_setvattr(&pn_new->pn_va, va);
+
+ puffs_newinfo_setcookie(pni, pn_new);
+
+ return 0;
+}
+
+#define BLOCKOFF(a,b) ((a) & ((b)-1))
+#define BLOCKLEFT(a,b) ((b) - BLOCKOFF(a,b))
+
+/*
+ * Read operation, used both for VOP_READ and VOP_GETPAGES
+ */
+int
+dtfs_node_read(struct puffs_usermount *pu, void *opc, uint8_t *buf,
+ off_t offset, size_t *resid, const struct puffs_cred *pcr, int ioflag)
+{
+ struct puffs_node *pn = opc;
+ struct dtfs_file *df = DTFS_CTOF(opc);
+ quad_t xfer, origxfer;
+ uint8_t *src, *dest;
+ size_t copylen;
+
+ if (pn->pn_va.va_type != VREG)
+ return EISDIR;
+
+ xfer = MIN(*resid, df->df_datalen - offset);
+ if (xfer < 0)
+ return EINVAL;
+
+ dest = buf;
+ origxfer = xfer;
+ while (xfer > 0) {
+ copylen = MIN(xfer, BLOCKLEFT(offset, DTFS_BLOCKSIZE));
+ src = df->df_blocks[BLOCKNUM(offset, DTFS_BLOCKSHIFT)]
+ + BLOCKOFF(offset, DTFS_BLOCKSIZE);
+ memcpy(dest, src, copylen);
+ offset += copylen;
+ dest += copylen;
+ xfer -= copylen;
+ }
+ *resid -= origxfer;
+
+ dtfs_updatetimes(pn, 1, 0, 0);
+
+ return 0;
+}
+
+/*
+ * write operation on the wing
+ */
+int
+dtfs_node_write(struct puffs_usermount *pu, void *opc, uint8_t *buf,
+ off_t offset, size_t *resid, const struct puffs_cred *pcr, int ioflag)
+{
+ struct puffs_node *pn = opc;
+ struct dtfs_file *df = DTFS_CTOF(opc);
+ uint8_t *src, *dest;
+ size_t copylen;
+
+ if (pn->pn_va.va_type != VREG)
+ return EISDIR;
+
+ if (ioflag & PUFFS_IO_APPEND)
+ offset = pn->pn_va.va_size;
+
+ if (*resid + offset > pn->pn_va.va_size)
+ dtfs_setsize(pn, *resid + offset);
+
+ src = buf;
+ while (*resid > 0) {
+ int i;
+ copylen = MIN(*resid, BLOCKLEFT(offset, DTFS_BLOCKSIZE));
+ i = BLOCKNUM(offset, DTFS_BLOCKSHIFT);
+ dest = df->df_blocks[i]
+ + BLOCKOFF(offset, DTFS_BLOCKSIZE);
+ memcpy(dest, src, copylen);
+ offset += copylen;
+ dest += copylen;
+ *resid -= copylen;
+ }
+
+ dtfs_updatetimes(pn, 0, 1, 1);
+
+ return 0;
+}
+
+int
+dtfs_node_pathconf(struct puffs_usermount *pu, puffs_cookie_t opc,
+ int name, register_t *retval)
+{
+
+ switch (name) {
+ case _PC_LINK_MAX:
+ *retval = LINK_MAX;
+ return 0;
+ case _PC_NAME_MAX:
+ *retval = NAME_MAX;
+ return 0;
+ case _PC_PATH_MAX:
+ *retval = PATH_MAX;
+ return 0;
+ case _PC_PIPE_BUF:
+ *retval = PIPE_BUF;
+ return 0;
+ case _PC_CHOWN_RESTRICTED:
+ *retval = 1;
+ return 0;
+ case _PC_NO_TRUNC:
+ *retval = 1;
+ return 0;
+ case _PC_SYNC_IO:
+ *retval = 1;
+ return 0;
+ case _PC_FILESIZEBITS:
+ *retval = 43; /* this one goes to 11 */
+ return 0;
+ case _PC_SYMLINK_MAX:
+ *retval = MAXPATHLEN;
+ return 0;
+ case _PC_2_SYMLINKS:
+ *retval = 1;
+ return 0;
+ default:
+ return EINVAL;
+ }
+}
+
+int
+dtfs_node_inactive(struct puffs_usermount *pu, puffs_cookie_t opc)
+{
+ struct puffs_node *pn = opc;
+
+ if (pn->pn_va.va_nlink == 0)
+ puffs_setback(puffs_cc_getcc(pu), PUFFS_SETBACK_NOREF_N1);
+ return 0;
+}
+
+int
+dtfs_node_reclaim(struct puffs_usermount *pu, void *opc)
+{
+ struct puffs_node *pn = opc;
+
+ if (pn->pn_va.va_nlink == 0)
+ dtfs_freenode(pn);
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/fs/puffs/t_basic.c b/contrib/netbsd-tests/fs/puffs/t_basic.c
new file mode 100644
index 0000000..ce5e4ea
--- /dev/null
+++ b/contrib/netbsd-tests/fs/puffs/t_basic.c
@@ -0,0 +1,455 @@
+/* $NetBSD: t_basic.c,v 1.12 2013/10/19 17:45:00 christos Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <puffs.h>
+#include <puffsdump.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+#include "../common/h_fsmacros.h"
+
+/*
+ * Do a synchronous operation. When this returns, all FAF operations
+ * have at least been delivered to the file system.
+ *
+ * XXX: is this really good enough considering puffs(9)-issued
+ * callback operations?
+ */
+static void
+syncbar(const char *fs)
+{
+ struct statvfs svb;
+
+ if (rump_sys_statvfs1(fs, &svb, ST_WAIT) == -1)
+ atf_tc_fail_errno("statvfs");
+}
+
+#ifdef PUFFSDUMP
+static void __unused
+dumpopcount(struct puffstestargs *args)
+{
+ size_t i;
+
+ printf("VFS OPS:\n");
+ for (i = 0; i < MIN(puffsdump_vfsop_count, PUFFS_VFS_MAX); i++) {
+ printf("\t%s: %d\n",
+ puffsdump_vfsop_revmap[i], args->pta_vfs_toserv_ops[i]);
+ }
+
+ printf("VN OPS:\n");
+ for (i = 0; i < MIN(puffsdump_vnop_count, PUFFS_VN_MAX); i++) {
+ printf("\t%s: %d\n",
+ puffsdump_vnop_revmap[i], args->pta_vn_toserv_ops[i]);
+ }
+}
+#endif
+
+ATF_TC(mount);
+ATF_TC_HEAD(mount, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "puffs+dtfs un/mount test");
+}
+
+ATF_TC_BODY(mount, tc)
+{
+ void *args;
+
+ FSTEST_CONSTRUCTOR(tc, puffs, args);
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+ATF_TC(root_reg);
+ATF_TC_HEAD(root_reg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "root is a regular file");
+}
+
+#define MAKEOPTS(...) \
+ char *theopts[] = {NULL, "-s", __VA_ARGS__, "dtfs", "n/a", NULL}
+
+ATF_TC_BODY(root_reg, tc)
+{
+ MAKEOPTS("-r", "reg");
+ void *args;
+ int fd, rv;
+
+ FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
+
+ fd = rump_sys_open(FSTEST_MNTNAME, O_RDWR);
+ if (fd == -1)
+ atf_tc_fail_errno("open root");
+ if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
+ atf_tc_fail_errno("write to root");
+ rv = rump_sys_mkdir(FSTEST_MNTNAME "/test", 0777);
+ ATF_REQUIRE(errno == ENOTDIR);
+ ATF_REQUIRE(rv == -1);
+ rump_sys_close(fd);
+
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+ATF_TC(root_lnk);
+ATF_TC_HEAD(root_lnk, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "root is a symbolic link");
+}
+
+#define LINKSTR "/path/to/nowhere"
+ATF_TC_BODY(root_lnk, tc)
+{
+ MAKEOPTS("-r", "lnk " LINKSTR);
+ void *args;
+ char buf[PATH_MAX];
+ ssize_t len;
+
+ FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
+
+ if ((len = rump_sys_readlink(FSTEST_MNTNAME, buf, sizeof(buf)-1)) == -1)
+ atf_tc_fail_errno("readlink");
+ buf[len] = '\0';
+
+ ATF_REQUIRE_STREQ(buf, LINKSTR);
+
+#if 0 /* XXX: unmount uses FOLLOW */
+ if (rump_sys_unmount("/mp", 0) == -1)
+ atf_tc_fail_errno("unmount");
+#endif
+}
+
+ATF_TC(root_fifo);
+ATF_TC_HEAD(root_fifo, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "root is a symbolic link");
+}
+
+#define MAGICSTR "nakit ja muusiperunat maustevoilla"
+static void *
+dofifow(void *arg)
+{
+ int fd = (int)(uintptr_t)arg;
+ char buf[512];
+
+ printf("writing\n");
+ strcpy(buf, MAGICSTR);
+ if (rump_sys_write(fd, buf, strlen(buf)+1) != strlen(buf)+1)
+ atf_tc_fail_errno("write to fifo");
+
+ return NULL;
+}
+
+ATF_TC_BODY(root_fifo, tc)
+{
+ MAKEOPTS("-r", "fifo");
+ void *args;
+ pthread_t pt;
+ char buf[512];
+ int fd;
+
+ FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
+
+ fd = rump_sys_open(FSTEST_MNTNAME, O_RDWR);
+ if (fd == -1)
+ atf_tc_fail_errno("open fifo");
+
+ pthread_create(&pt, NULL, dofifow, (void *)(uintptr_t)fd);
+
+ memset(buf, 0, sizeof(buf));
+ if (rump_sys_read(fd, buf, sizeof(buf)) == -1)
+ atf_tc_fail_errno("read fifo");
+
+ ATF_REQUIRE_STREQ(buf, MAGICSTR);
+ rump_sys_close(fd);
+
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+ATF_TC(root_chrdev);
+ATF_TC_HEAD(root_chrdev, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "root is /dev/null");
+}
+
+ATF_TC_BODY(root_chrdev, tc)
+{
+ MAKEOPTS("-r", "chr 2 2");
+ void *args;
+ ssize_t rv;
+ char buf[512];
+ int fd;
+
+ FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
+
+ fd = rump_sys_open(FSTEST_MNTNAME, O_RDWR);
+ if (fd == -1)
+ atf_tc_fail_errno("open null");
+
+ rv = rump_sys_write(fd, buf, sizeof(buf));
+ ATF_REQUIRE(rv == sizeof(buf));
+
+ rv = rump_sys_read(fd, buf, sizeof(buf));
+ ATF_REQUIRE(rv == 0);
+
+ rump_sys_close(fd);
+
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+/*
+ * Inactive/reclaim tests
+ */
+
+ATF_TC(inactive_basic);
+ATF_TC_HEAD(inactive_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "inactive gets called");
+}
+
+ATF_TC_BODY(inactive_basic, tc)
+{
+ struct puffstestargs *pargs;
+ void *args;
+ int fd;
+
+ FSTEST_CONSTRUCTOR(tc, puffs, args);
+ FSTEST_ENTER();
+ pargs = args;
+
+ fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create");
+
+ /* none yet */
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], 0);
+
+ rump_sys_close(fd);
+
+ /* one for file */
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], 1);
+
+ FSTEST_EXIT();
+
+ /* another for the mountpoint */
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], 2);
+
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+ATF_TC(inactive_reclaim);
+ATF_TC_HEAD(inactive_reclaim, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "inactive/reclaim gets called");
+}
+
+ATF_TC_BODY(inactive_reclaim, tc)
+{
+ struct puffstestargs *pargs;
+ void *args;
+ int fd;
+
+ FSTEST_CONSTRUCTOR(tc, puffs, args);
+ FSTEST_ENTER();
+ pargs = args;
+
+ fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create");
+
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], 0);
+
+ if (rump_sys_unlink("file") == -1)
+ atf_tc_fail_errno("remove");
+
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], 0);
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 0);
+
+ rump_sys_close(fd);
+ syncbar(FSTEST_MNTNAME);
+
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], 1);
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 1);
+
+ FSTEST_EXIT();
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+ATF_TC(reclaim_hardlink);
+ATF_TC_HEAD(reclaim_hardlink, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "reclaim gets called only after "
+ "final link is gone");
+}
+
+ATF_TC_BODY(reclaim_hardlink, tc)
+{
+ struct puffstestargs *pargs;
+ void *args;
+ int fd;
+ int ianow;
+
+ FSTEST_CONSTRUCTOR(tc, puffs, args);
+ FSTEST_ENTER();
+ pargs = args;
+
+ fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create");
+
+ if (rump_sys_link("file", "anotherfile") == -1)
+ atf_tc_fail_errno("create link");
+ rump_sys_close(fd);
+
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 0);
+
+ /* unlink first hardlink */
+ if (rump_sys_unlink("file") == -1)
+ atf_tc_fail_errno("unlink 1");
+
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 0);
+ ianow = pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE];
+
+ /* unlink second hardlink */
+ if (rump_sys_unlink("anotherfile") == -1)
+ atf_tc_fail_errno("unlink 2");
+
+ syncbar(FSTEST_MNTNAME);
+
+ ATF_REQUIRE(ianow < pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE]);
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 1);
+
+ FSTEST_EXIT();
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+ATF_TC(unlink_accessible);
+ATF_TC_HEAD(unlink_accessible, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "open file is accessible after "
+ "having been unlinked");
+}
+
+ATF_TC_BODY(unlink_accessible, tc)
+{
+ MAKEOPTS("-i", "-o", "nopagecache");
+ struct puffstestargs *pargs;
+ void *args;
+ char buf[512];
+ int fd, ianow;
+
+ assert(sizeof(buf) > sizeof(MAGICSTR));
+
+ FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
+ FSTEST_ENTER();
+ pargs = args;
+
+ fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create");
+
+ if (rump_sys_write(fd, MAGICSTR, sizeof(MAGICSTR)) != sizeof(MAGICSTR))
+ atf_tc_fail_errno("write");
+ if (rump_sys_unlink("file") == -1)
+ atf_tc_fail_errno("unlink");
+
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 0);
+ ianow = pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE];
+
+ if (rump_sys_pread(fd, buf, sizeof(buf), 0) == -1)
+ atf_tc_fail_errno("read");
+ rump_sys_close(fd);
+
+ syncbar(FSTEST_MNTNAME);
+
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_RECLAIM], 1);
+ ATF_REQUIRE_EQ(pargs->pta_vn_toserv_ops[PUFFS_VN_INACTIVE], ianow+1);
+
+ ATF_REQUIRE_STREQ(buf, MAGICSTR);
+
+ FSTEST_EXIT();
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+ATF_TC(signals);
+ATF_TC_HEAD(signals, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that sending a signal can "
+ "cause an interrupt to puffs wait");
+}
+
+extern struct proc *rumpns_initproc;
+extern void rumpns_psignal(struct proc *, int);
+extern void rumpns_sigclearall(struct proc *, void *, void *);
+ATF_TC_BODY(signals, tc)
+{
+ struct stat sb;
+ void *args;
+
+ rump_boot_setsigmodel(RUMP_SIGMODEL_RECORD);
+
+ FSTEST_CONSTRUCTOR(tc, puffs, args);
+ FSTEST_ENTER();
+ RL(rump_sys_stat(".", &sb));
+
+ /* send SIGUSR1, should not affect puffs ops */
+ rump_schedule();
+ rumpns_psignal(rumpns_initproc, SIGUSR1);
+ rump_unschedule();
+ RL(rump_sys_stat(".", &sb));
+
+ /* send SIGTERM, should get EINTR */
+ rump_schedule();
+ rumpns_psignal(rumpns_initproc, SIGTERM);
+ rump_unschedule();
+ ATF_REQUIRE_ERRNO(EINTR, rump_sys_stat(".", &sb) == -1);
+
+ /* clear sigmask so that we can unmount */
+ rump_schedule();
+ rumpns_sigclearall(rumpns_initproc, NULL, NULL);
+ rump_unschedule();
+
+ FSTEST_EXIT();
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mount);
+
+ ATF_TP_ADD_TC(tp, root_fifo);
+ ATF_TP_ADD_TC(tp, root_lnk);
+ ATF_TP_ADD_TC(tp, root_reg);
+ ATF_TP_ADD_TC(tp, root_chrdev);
+
+ ATF_TP_ADD_TC(tp, inactive_basic);
+ ATF_TP_ADD_TC(tp, inactive_reclaim);
+ ATF_TP_ADD_TC(tp, reclaim_hardlink);
+ ATF_TP_ADD_TC(tp, unlink_accessible);
+
+ ATF_TP_ADD_TC(tp, signals);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/puffs/t_fuzz.c b/contrib/netbsd-tests/fs/puffs/t_fuzz.c
new file mode 100644
index 0000000..1d249c0
--- /dev/null
+++ b/contrib/netbsd-tests/fs/puffs/t_fuzz.c
@@ -0,0 +1,283 @@
+/* $NetBSD: t_fuzz.c,v 1.5 2012/04/21 01:03:46 manu Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Fuzztest puffs mount. There are n different levels of testing:
+ * each one pours more and more sane garbage into the args to that
+ * the mount progresses further and further. Level 8 (at least when
+ * writing this comment) should be the one where mounting actually
+ * succeeds.
+ *
+ * Our metric of success is crash / no crash.
+ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/poll.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <fs/puffs/puffs_msgif.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+
+#define ITERATIONS 100
+
+static void
+fixversion(struct puffs_kargs *kargs)
+{
+
+ kargs->pa_vers = PUFFSVERSION;
+}
+
+static void
+fixkflag(struct puffs_kargs *kargs)
+{
+
+ kargs->pa_flags &= PUFFS_KFLAG_MASK;
+
+ /*
+ * PUFFS_KFLAG_CACHE_FS_TTL require extended behavior
+ * from the filesystem for which we have no test right now.
+ */
+ kargs->pa_flags &= ~PUFFS_KFLAG_CACHE_FS_TTL;
+}
+
+static void
+fixfhflag(struct puffs_kargs *kargs)
+{
+
+ kargs->pa_fhflags &= PUFFS_FHFLAG_MASK;
+}
+
+static void
+fixspare(struct puffs_kargs *kargs)
+{
+
+ memset(&kargs->pa_spare, 0, sizeof(kargs->pa_spare));
+}
+
+static void
+fixhandsize(struct puffs_kargs *kargs)
+{
+
+ kargs->pa_fhsize %= PUFFS_FHSIZE_MAX+4;
+}
+
+static void
+fixhandsize2(struct puffs_kargs *kargs)
+{
+
+ /* XXX: values */
+ if (kargs->pa_fhflags & PUFFS_FHFLAG_NFSV3)
+ kargs->pa_fhsize %= 60;
+ if (kargs->pa_fhflags & PUFFS_FHFLAG_NFSV2)
+ kargs->pa_fhsize %= 28;
+}
+
+static void
+fixputter(struct puffs_kargs *kargs)
+{
+
+ kargs->pa_fd = rump_sys_open("/dev/putter", O_RDWR);
+ if (kargs->pa_fd == -1)
+ atf_tc_fail_errno("open putter");
+}
+
+static void
+fixroot(struct puffs_kargs *kargs)
+{
+
+ kargs->pa_root_vtype %= VBAD;
+}
+
+static void
+unfixputter(struct puffs_kargs *kargs)
+{
+
+ rump_sys_close(kargs->pa_fd);
+}
+
+typedef void (*fixfn)(struct puffs_kargs *);
+static fixfn fixstack[] = {
+ fixversion,
+ fixkflag,
+ fixfhflag,
+ fixspare,
+ fixhandsize,
+ fixhandsize2,
+ fixputter,
+ fixroot,
+};
+
+static void
+fixup(int nfix, struct puffs_kargs *kargs)
+{
+ int i;
+
+ assert(nfix <= __arraycount(fixstack));
+ for (i = 0; i < nfix; i++)
+ fixstack[i](kargs);
+}
+
+static void
+unfixup(int nfix, struct puffs_kargs *kargs)
+{
+
+ if (nfix >= 7)
+ unfixputter(kargs);
+}
+
+static pthread_mutex_t damtx;
+static pthread_cond_t dacv;
+static int dafd = -1;
+
+static void *
+respondthread(void *arg)
+{
+ char buf[PUFFS_MSG_MAXSIZE];
+ struct puffs_req *preq = (void *)buf;
+ struct pollfd pfd;
+ ssize_t n;
+
+ pthread_mutex_lock(&damtx);
+ for (;;) {
+ while (dafd == -1)
+ pthread_cond_wait(&dacv, &damtx);
+
+ while (dafd != -1) {
+ pthread_mutex_unlock(&damtx);
+ pfd.fd = dafd;
+ pfd.events = POLLIN;
+ pfd.revents = 0;
+ if (rump_sys_poll(&pfd, 1, 10) == 0) {
+ pthread_mutex_lock(&damtx);
+ continue;
+ }
+ n = rump_sys_read(dafd, buf, sizeof(buf));
+ if (n <= 0) {
+ pthread_mutex_lock(&damtx);
+ break;
+ }
+
+ /* just say it was succesful */
+ preq->preq_rv = 0;
+ rump_sys_write(dafd, buf, n);
+ pthread_mutex_lock(&damtx);
+ }
+ }
+
+ return NULL;
+}
+
+static void
+testbody(int nfix)
+{
+ pthread_t pt;
+ struct puffs_kargs kargs;
+ unsigned long seed;
+ int i;
+
+ seed = time(NULL);
+ srandom(seed);
+ printf("test seeded RNG with %lu\n", seed);
+
+ rump_init();
+
+ pthread_mutex_init(&damtx, NULL);
+ pthread_cond_init(&dacv, NULL);
+ pthread_create(&pt, NULL, respondthread, NULL);
+
+ ATF_REQUIRE(rump_sys_mkdir("/mnt", 0777) == 0);
+
+ for (i = 0; i < ITERATIONS; i++) {
+ tests_makegarbage(&kargs, sizeof(kargs));
+ fixup(nfix, &kargs);
+ if (rump_sys_mount(MOUNT_PUFFS, "/mnt", 0,
+ &kargs, sizeof(kargs)) == 0) {
+ struct stat sb;
+
+ pthread_mutex_lock(&damtx);
+ dafd = kargs.pa_fd;
+ pthread_cond_signal(&dacv);
+ pthread_mutex_unlock(&damtx);
+
+ rump_sys_stat("/mnt", &sb);
+ rump_sys_unmount("/mnt", MNT_FORCE);
+ }
+ unfixup(nfix, &kargs);
+
+ pthread_mutex_lock(&damtx);
+ dafd = -1;
+ pthread_mutex_unlock(&damtx);
+ }
+}
+
+#define MAKETEST(_n_) \
+ATF_TC(mountfuzz##_n_); \
+ATF_TC_HEAD(mountfuzz##_n_, tc) \
+{atf_tc_set_md_var(tc, "descr", "garbage kargs, " # _n_ " fix(es)");} \
+ATF_TC_BODY(mountfuzz##_n_, tc) {testbody(_n_);}
+
+MAKETEST(0);
+MAKETEST(1);
+MAKETEST(2);
+MAKETEST(3);
+MAKETEST(4);
+MAKETEST(5);
+MAKETEST(6);
+MAKETEST(7);
+MAKETEST(8);
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mountfuzz0);
+ ATF_TP_ADD_TC(tp, mountfuzz1);
+ ATF_TP_ADD_TC(tp, mountfuzz2);
+ ATF_TP_ADD_TC(tp, mountfuzz3);
+ ATF_TP_ADD_TC(tp, mountfuzz4);
+ ATF_TP_ADD_TC(tp, mountfuzz5);
+ ATF_TP_ADD_TC(tp, mountfuzz6);
+ ATF_TP_ADD_TC(tp, mountfuzz7);
+ ATF_TP_ADD_TC(tp, mountfuzz8);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/puffs/t_io.c b/contrib/netbsd-tests/fs/puffs/t_io.c
new file mode 100644
index 0000000..37c386c
--- /dev/null
+++ b/contrib/netbsd-tests/fs/puffs/t_io.c
@@ -0,0 +1,61 @@
+/* $NetBSD: t_io.c,v 1.1 2010/11/12 17:33:28 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <puffs.h>
+#include <puffsdump.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+#include "../common/h_fsmacros.h"
+
+#define MAKEOPTS(...) \
+ char *theopts[] = {NULL, "-s", __VA_ARGS__, "dtfs", "n/a", NULL}
+
+ATF_TC(nocache);
+ATF_TC_HEAD(nocache, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests large i/o without page cache");
+}
+
+ATF_TC_BODY(nocache, tc)
+{
+ MAKEOPTS("-o", "nopagecache");
+ char data[1024*1024];
+ void *args;
+ int fd;
+
+ FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
+ FSTEST_ENTER();
+
+ RL(fd = rump_sys_open("afile", O_CREAT | O_RDWR, 0755));
+ RL(rump_sys_write(fd, data, sizeof(data)));
+ rump_sys_close(fd);
+
+ FSTEST_EXIT();
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, nocache);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/README b/contrib/netbsd-tests/fs/tmpfs/README
new file mode 100644
index 0000000..cdc3f2d
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/README
@@ -0,0 +1,17 @@
+The tests in this directory where written at the same time tmpfs was
+developed. This is why, if you follow the order of tests in the Atffile,
+you will notice that they start checking the most basic things and end
+checking the less common ones. Furthermore, tests try not to use features
+tested by further tests in the lists.
+
+However, the above is not the most appropriate testing procedure when you
+have a working file system because some separation in test programs does
+not make sense afterwards.
+
+Many of the tests here are applicable to any file system. They should be
+refactored to be reusable on any mounted file system, which could also
+remove the need to do the mount/unmount steps in each and every test case.
+
+Possibly take a look at the file system tests in FreeBSD. They seem to be
+much more complete, even though they are written in Perl and therefore not
+directly usable.
diff --git a/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr b/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr
new file mode 100644
index 0000000..07c1644
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# $NetBSD: h_funcs.subr,v 1.5 2013/03/17 01:16:45 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, 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 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.
+#
+
+Mount_Point=
+
+#
+# test_mount [args]
+#
+# Mounts tmpfs over ${Mount_Point} and changes the current directory
+# to the mount point. Optional arguments may be passed to the
+# mount command.
+#
+test_mount() {
+ require_fs tmpfs
+
+ Mount_Point=$(pwd)/mntpt
+ atf_check -s eq:0 -o empty -e empty mkdir "${Mount_Point}"
+ echo "mount -t tmpfs ${*} tmpfs ${Mount_Point}"
+ mount -t tmpfs "${@}" tmpfs "${Mount_Point}" 2>mounterr
+ if [ "${?}" -ne 0 ]; then
+ cat mounterr 1>&2
+ if grep 'Operation not supported' mounterr > /dev/null; then
+ atf_skip "tmpfs not supported"
+ fi
+ atf_fail "Failed to mount a tmpfs file system"
+ fi
+ cd "${Mount_Point}"
+}
+
+#
+# test_unmount
+#
+# Unmounts the file system mounted by test_mount.
+#
+test_unmount() {
+ cd - >/dev/null
+ atf_check -s eq:0 -o empty -e empty umount ${Mount_Point}
+ atf_check -s eq:0 -o empty -e empty rmdir ${Mount_Point}
+ Mount_Point=
+}
+
+#
+# kqueue_monitor expected_nevents file1 [.. fileN]
+#
+# Monitors the commands given through stdin (one per line) using
+# kqueue and stores the events raised in a log that can be later
+# verified with kqueue_check.
+#
+kqueue_monitor() {
+ nev=${1}; shift
+ echo "Running kqueue-monitored commands and expecting" \
+ "${nev} events"
+ $(atf_get_srcdir)/h_tools kqueue ${*} >kqueue.log || \
+ atf_fail "Could not launch kqueue monitor"
+ got=$(wc -l kqueue.log | awk '{ print $1 }')
+ test ${got} -eq ${nev} || \
+ atf_fail "Got ${got} events but expected ${nev}"
+}
+
+#
+# kqueue_check file event
+#
+# Checks if kqueue raised the given event when monitoring the
+# given file.
+#
+kqueue_check() {
+ echo "Checking if ${1} received ${2}"
+ grep "^${1} - ${2}$" kqueue.log >/dev/null || \
+ atf_fail "${1} did not receive ${2}"
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/h_tools.c b/contrib/netbsd-tests/fs/tmpfs/h_tools.c
new file mode 100644
index 0000000..6a7b8fd
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/h_tools.c
@@ -0,0 +1,299 @@
+/* $NetBSD: h_tools.c,v 1.4 2011/06/11 18:03:17 christos Exp $ */
+
+/*
+ * Copyright (c) 2005, 2006 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Helper tools for several tests. These are kept in a single file due
+ * to the limitations of bsd.prog.mk to build a single program in a
+ * given directory.
+ */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/event.h>
+#include <sys/mount.h>
+#include <sys/statvfs.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/un.h>
+
+#include <assert.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/* --------------------------------------------------------------------- */
+
+static int getfh_main(int, char **);
+static int kqueue_main(int, char **);
+static int rename_main(int, char **);
+static int sockets_main(int, char **);
+static int statvfs_main(int, char **);
+
+/* --------------------------------------------------------------------- */
+
+int
+getfh_main(int argc, char **argv)
+{
+ int error;
+ void *fh;
+ size_t fh_size;
+
+ if (argc < 2)
+ return EXIT_FAILURE;
+
+ fh_size = 0;
+ fh = NULL;
+ for (;;) {
+ if (fh_size) {
+ fh = malloc(fh_size);
+ if (fh == NULL) {
+ fprintf(stderr, "out of memory");
+ return EXIT_FAILURE;
+ }
+ }
+ /*
+ * The kernel provides the necessary size in fh_size -
+ * but it may change if someone moves things around,
+ * so retry untill we have enough memory.
+ */
+ error = getfh(argv[1], fh, &fh_size);
+ if (error == 0) {
+ break;
+ } else {
+ if (fh != NULL)
+ free(fh);
+ if (errno != E2BIG) {
+ warn("getfh");
+ return EXIT_FAILURE;
+ }
+ }
+ }
+
+ error = write(STDOUT_FILENO, fh, fh_size);
+ if (error == -1) {
+ warn("write");
+ return EXIT_FAILURE;
+ }
+ free(fh);
+
+ return 0;
+}
+
+/* --------------------------------------------------------------------- */
+
+int
+kqueue_main(int argc, char **argv)
+{
+ char *line;
+ int i, kq;
+ size_t len;
+ struct kevent *changes, event;
+
+ if (argc < 2)
+ return EXIT_FAILURE;
+
+ argc--;
+ argv++;
+
+ changes = malloc(sizeof(struct kevent) * argc);
+ if (changes == NULL)
+ errx(EXIT_FAILURE, "not enough memory");
+
+ for (i = 0; i < argc; i++) {
+ int fd;
+
+ fd = open(argv[i], O_RDONLY);
+ if (fd == -1)
+ err(EXIT_FAILURE, "cannot open %s", argv[i]);
+
+ EV_SET(&changes[i], fd, EVFILT_VNODE,
+ EV_ADD | EV_ENABLE | EV_ONESHOT,
+ NOTE_ATTRIB | NOTE_DELETE | NOTE_EXTEND | NOTE_LINK |
+ NOTE_RENAME | NOTE_REVOKE | NOTE_WRITE,
+ 0, 0);
+ }
+
+ kq = kqueue();
+ if (kq == -1)
+ err(EXIT_FAILURE, "kqueue");
+
+ while ((line = fgetln(stdin, &len)) != NULL) {
+ int ec, nev;
+ struct timespec to;
+
+ to.tv_sec = 0;
+ to.tv_nsec = 100000;
+
+ (void)kevent(kq, changes, argc, &event, 1, &to);
+
+ assert(len > 0);
+ assert(line[len - 1] == '\n');
+ line[len - 1] = '\0';
+ ec = system(line);
+ if (ec != EXIT_SUCCESS)
+ errx(ec, "%s returned %d", line, ec);
+
+ do {
+ nev = kevent(kq, changes, argc, &event, 1, &to);
+ if (nev == -1)
+ err(EXIT_FAILURE, "kevent");
+ else if (nev > 0) {
+ for (i = 0; i < argc; i++)
+ if (event.ident == changes[i].ident)
+ break;
+
+ if (event.fflags & NOTE_ATTRIB)
+ printf("%s - NOTE_ATTRIB\n", argv[i]);
+ if (event.fflags & NOTE_DELETE)
+ printf("%s - NOTE_DELETE\n", argv[i]);
+ if (event.fflags & NOTE_EXTEND)
+ printf("%s - NOTE_EXTEND\n", argv[i]);
+ if (event.fflags & NOTE_LINK)
+ printf("%s - NOTE_LINK\n", argv[i]);
+ if (event.fflags & NOTE_RENAME)
+ printf("%s - NOTE_RENAME\n", argv[i]);
+ if (event.fflags & NOTE_REVOKE)
+ printf("%s - NOTE_REVOKE\n", argv[i]);
+ if (event.fflags & NOTE_WRITE)
+ printf("%s - NOTE_WRITE\n", argv[i]);
+ }
+ } while (nev > 0);
+ }
+
+ for (i = 0; i < argc; i++)
+ close(changes[i].ident);
+ free(changes);
+
+ return EXIT_SUCCESS;
+}
+
+/* --------------------------------------------------------------------- */
+
+int
+rename_main(int argc, char **argv)
+{
+
+ if (argc < 3)
+ return EXIT_FAILURE;
+
+ if (rename(argv[1], argv[2]) == -1) {
+ warn("rename");
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
+
+/* --------------------------------------------------------------------- */
+
+int
+sockets_main(int argc, char **argv)
+{
+ int error, fd;
+ struct sockaddr_un addr;
+
+ if (argc < 2)
+ return EXIT_FAILURE;
+
+ fd = socket(PF_LOCAL, SOCK_STREAM, 0);
+ if (fd == -1) {
+ warn("socket");
+ return EXIT_FAILURE;
+ }
+
+ (void)strlcpy(addr.sun_path, argv[1], sizeof(addr.sun_path));
+ addr.sun_family = PF_UNIX;
+
+ error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
+ if (error == -1) {
+ warn("connect");
+ return EXIT_FAILURE;
+ }
+
+ close(fd);
+
+ return EXIT_SUCCESS;
+}
+
+/* --------------------------------------------------------------------- */
+
+int
+statvfs_main(int argc, char **argv)
+{
+ int error;
+ struct statvfs buf;
+
+ if (argc < 2)
+ return EXIT_FAILURE;
+
+ error = statvfs(argv[1], &buf);
+ if (error != 0) {
+ warn("statvfs");
+ return EXIT_FAILURE;
+ }
+
+ (void)printf("f_bsize=%lu\n", buf.f_bsize);
+ (void)printf("f_blocks=%" PRId64 "\n", buf.f_blocks);
+ (void)printf("f_bfree=%" PRId64 "\n", buf.f_bfree);
+ (void)printf("f_files=%" PRId64 "\n", buf.f_files);
+
+ return EXIT_SUCCESS;
+}
+
+/* --------------------------------------------------------------------- */
+
+int
+main(int argc, char **argv)
+{
+ int error;
+
+ if (argc < 2)
+ return EXIT_FAILURE;
+
+ argc -= 1;
+ argv += 1;
+
+ if (strcmp(argv[0], "getfh") == 0)
+ error = getfh_main(argc, argv);
+ else if (strcmp(argv[0], "kqueue") == 0)
+ error = kqueue_main(argc, argv);
+ else if (strcmp(argv[0], "rename") == 0)
+ error = rename_main(argc, argv);
+ else if (strcmp(argv[0], "sockets") == 0)
+ error = sockets_main(argc, argv);
+ else if (strcmp(argv[0], "statvfs") == 0)
+ error = statvfs_main(argc, argv);
+ else
+ error = EXIT_FAILURE;
+
+ return error;
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_create.sh b/contrib/netbsd-tests/fs/tmpfs/t_create.sh
new file mode 100755
index 0000000..f1f894d
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_create.sh
@@ -0,0 +1,122 @@
+# $NetBSD: t_create.sh,v 1.8 2011/03/05 07:41:11 pooka Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the create operation works.
+#
+
+atf_test_case create
+create_head() {
+ atf_set "descr" "Verifies that files can be created"
+ atf_set "require.user" "root"
+}
+create_body() {
+ test_mount
+
+ atf_check -s eq:1 -o empty -e empty test -f a
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty test -f a
+
+ test_unmount
+}
+
+atf_test_case attrs
+attrs_head() {
+ atf_set "descr" "Verifies that a new file gets the correct" \
+ "attributes"
+ atf_set "require.config" "unprivileged-user"
+ atf_set "require.user" "root"
+}
+attrs_body() {
+ user=$(atf_config_get unprivileged-user)
+ # Allow the unprivileged user to access the work directory.
+ chown ${user} .
+
+ test_mount
+
+ umask 022
+ atf_check -s eq:1 -o empty -e empty test -f a
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty test -f a
+
+ eval $(stat -s . | sed -e 's|st_|dst_|g')
+ eval $(stat -s a)
+ test ${st_flags} -eq 0 || atf_fail "Incorrect flags"
+ test ${st_size} -eq 0 || atf_fail "Incorrect size"
+ test ${st_uid} -eq $(id -u) || atf_fail "Incorrect uid"
+ test ${st_gid} -eq ${dst_gid} || atf_fail "Incorrect gid"
+ test ${st_mode} = 0100644 || atf_fail "Incorrect mode"
+
+ atf_check -s eq:0 -o empty -e empty mkdir b c
+
+ atf_check -s eq:0 -o empty -e empty chown ${user}:0 b
+ eval $(stat -s b)
+ [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
+ [ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
+
+ atf_check -s eq:0 -o empty -e empty chown ${user}:100 c
+ eval $(stat -s c)
+ [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
+ [ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
+
+ atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'touch b/a'
+ eval $(stat -s b/a)
+ [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
+ [ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
+
+ atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'touch c/a'
+ eval $(stat -s c/a)
+ [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
+ [ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
+
+ test_unmount
+}
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Verifies that creating a file raises the correct" \
+ "kqueue events"
+ atf_set "require.user" "root"
+}
+kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ echo 'touch dir/a' | kqueue_monitor 1 dir
+ kqueue_check dir NOTE_WRITE
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case create
+ atf_add_test_case attrs
+ atf_add_test_case kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_devices.sh b/contrib/netbsd-tests/fs/tmpfs/t_devices.sh
new file mode 100755
index 0000000..472d378
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_devices.sh
@@ -0,0 +1,60 @@
+# $NetBSD: t_devices.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Tests that special devices work"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ umask 022
+
+ atf_check -s eq:0 -o ignore -e ignore /dev/MAKEDEV std
+ atf_check -s eq:0 -o empty -e empty test -e zero
+ atf_check -s eq:0 -o empty -e empty test -e null
+
+ echo "Reading from the 'zero' character device"
+ atf_check -s eq:0 -o ignore -e ignore dd if=zero of=a bs=10k count=1
+ [ $(md5 a | cut -d ' ' -f 4) = 1276481102f218c981e0324180bafd9f ] || \
+ atf_fail "Data read is invalid"
+
+ echo "Writing to the 'null' device"
+ echo foo >null
+ eval $(stat -s null)
+ [ ${st_size} -eq 0 ] || atf_fail "Invalid size for device"
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_dots.sh b/contrib/netbsd-tests/fs/tmpfs/t_dots.sh
new file mode 100755
index 0000000..e480de7
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_dots.sh
@@ -0,0 +1,67 @@
+# $NetBSD: t_dots.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case topdir
+topdir_head() {
+ atf_set "descr" "Verifies that looking up '.' and '..' in" \
+ "top-level directories works"
+ atf_set "require.user" "root"
+}
+topdir_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty test -d ./a
+ atf_check -s eq:0 -o empty -e empty test -d a/../a
+
+ test_unmount
+}
+
+atf_test_case nesteddir
+nesteddir_head() {
+ atf_set "descr" "Verifies that looking up '.' and '..' in" \
+ "top-level directories works"
+ atf_set "require.user" "root"
+}
+nesteddir_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty mkdir a/b
+ atf_check -s eq:0 -o empty -e empty test -d a/b/../b
+ atf_check -s eq:0 -o empty -e empty test -d a/b/../../a
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case topdir
+ atf_add_test_case nesteddir
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_exec.sh b/contrib/netbsd-tests/fs/tmpfs/t_exec.sh
new file mode 100755
index 0000000..9ffc600
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_exec.sh
@@ -0,0 +1,52 @@
+# $NetBSD: t_exec.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Verifies that binary files can be executed from" \
+ "within the file system (i.e., whether getpages" \
+ "works)"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty cp /bin/cp .
+ echo "Verifying copied file"
+ [ $(md5 cp | cut -d ' ' -f 4) = $(md5 /bin/cp | cut -d ' ' -f 4) ] || \
+ atf_file "New binary file does not match original"
+ atf_check -s eq:0 -o empty -e empty ./cp cp foo
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_link.sh b/contrib/netbsd-tests/fs/tmpfs/t_link.sh
new file mode 100755
index 0000000..660f3f2
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_link.sh
@@ -0,0 +1,129 @@
+# $NetBSD: t_link.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the link operation works.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Verifies that the link operation works on files" \
+ "at the top directory"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty touch z
+ eval $(stat -s a | sed -e 's|st_|sta_|g')
+ eval $(stat -s z | sed -e 's|st_|stz_|g')
+ test ${sta_ino} != ${stz_ino} || \
+ atf_fail "Node numbers are not different"
+ test ${sta_nlink} -eq 1 || atf_fail "Number of links is incorrect"
+ atf_check -s eq:0 -o empty -e empty ln a b
+
+ echo "Checking if link count is correct after links are created"
+ eval $(stat -s a | sed -e 's|st_|sta_|g')
+ eval $(stat -s b | sed -e 's|st_|stb_|g')
+ test ${sta_ino} = ${stb_ino} || atf_fail "Node number changed"
+ test ${sta_nlink} -eq 2 || atf_fail "Link count is incorrect"
+ test ${stb_nlink} -eq 2 || atf_fail "Link count is incorrect"
+
+ echo "Checking if link count is correct after links are deleted"
+ atf_check -s eq:0 -o empty -e empty rm a
+ eval $(stat -s b | sed -e 's|st_|stb_|g')
+ test ${stb_nlink} -eq 1 || atf_fail "Link count is incorrect"
+ atf_check -s eq:0 -o empty -e empty rm b
+
+ test_unmount
+}
+
+atf_test_case subdirs
+subdirs_head() {
+ atf_set "descr" "Verifies that the link operation works if used" \
+ "in subdirectories"
+ atf_set "require.user" "root"
+}
+subdirs_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty mkdir c
+ atf_check -s eq:0 -o empty -e empty ln a c/b
+
+ echo "Checking if link count is correct after links are created"
+ eval $(stat -s a | sed -e 's|st_|sta_|g')
+ eval $(stat -s c/b | sed -e 's|st_|stb_|g')
+ test ${sta_ino} = ${stb_ino} || atf_fail "Node number changed"
+ test ${sta_nlink} -eq 2 || atf_fail "Link count is incorrect"
+ test ${stb_nlink} -eq 2 || atf_fail "Link count is incorrect"
+
+ echo "Checking if link count is correct after links are deleted"
+ atf_check -s eq:0 -o empty -e empty rm a
+ eval $(stat -s c/b | sed -e 's|st_|stb_|g')
+ test ${stb_nlink} -eq 1 || atf_fail "Link count is incorrect"
+ atf_check -s eq:0 -o empty -e empty rm c/b
+ atf_check -s eq:0 -o empty -e empty rmdir c
+
+ test_unmount
+}
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Verifies that creating a link raises the correct" \
+ "kqueue events"
+ atf_set "require.user" "root"
+}
+kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ atf_check -s eq:0 -o empty -e empty touch dir/a
+ echo 'ln dir/a dir/b' | kqueue_monitor 2 dir dir/a
+ kqueue_check dir/a NOTE_LINK
+ kqueue_check dir NOTE_WRITE
+
+ echo 'rm dir/a' | kqueue_monitor 2 dir dir/b
+ # XXX According to the (short) kqueue(2) documentation, the following
+ # should raise a NOTE_LINK but FFS raises a NOTE_DELETE...
+ kqueue_check dir/b NOTE_LINK
+ kqueue_check dir NOTE_WRITE
+ atf_check -s eq:0 -o empty -e empty rm dir/b
+ atf_check -s eq:0 -o empty -e empty rmdir dir
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case basic
+ atf_add_test_case subdirs
+ atf_add_test_case kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_mkdir.sh b/contrib/netbsd-tests/fs/tmpfs/t_mkdir.sh
new file mode 100755
index 0000000..db0d1e3
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_mkdir.sh
@@ -0,0 +1,159 @@
+# $NetBSD: t_mkdir.sh,v 1.8 2011/03/05 07:41:11 pooka Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that mkdir works by creating some nested directories. It also
+# checks, in part, the lookup operation.
+#
+
+atf_test_case single
+single_head() {
+ atf_set "descr" "Creates a single directory and checks the" \
+ "mount point's hard link count"
+ atf_set "require.user" "root"
+}
+single_body() {
+ test_mount
+
+ atf_check -s eq:1 -o empty -e empty test -d a
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty test -d a
+ test -d a
+ eval $(stat -s ${Mount_Point})
+ [ ${st_nlink} = 3 ] || atf_fail "Link count is not 3"
+
+ test_unmount
+}
+
+atf_test_case many
+many_head() {
+ atf_set "descr" "Creates multiple directories and checks the" \
+ "mount point's hard link count"
+ atf_set "require.user" "root"
+}
+many_body() {
+ test_mount
+
+ for d in $(jot 100); do
+ atf_check -s eq:1 -o empty -e empty test -d ${d}
+ atf_check -s eq:0 -o empty -e empty mkdir ${d}
+ atf_check -s eq:0 -o empty -e empty test -d ${d}
+ done
+ eval $(stat -s ${Mount_Point})
+ [ ${st_nlink} = 102 ] || atf_fail "Link count is not 102"
+
+ test_unmount
+}
+
+atf_test_case nested
+nested_head() {
+ atf_set "descr" "Checks if nested directories can be created"
+ atf_set "require.user" "root"
+}
+nested_body() {
+ test_mount
+
+ atf_check -s eq:1 -o empty -e empty test -d a/b/c/d/e
+ atf_check -s eq:0 -o empty -e empty mkdir -p a/b/c/d/e
+ atf_check -s eq:0 -o empty -e empty test -d a/b/c/d/e
+
+ test_unmount
+}
+
+atf_test_case attrs
+attrs_head() {
+ atf_set "descr" "Checks that new directories get the proper" \
+ "attributes (owner and group)"
+ atf_set "require.config" "unprivileged-user"
+ atf_set "require.user" "root"
+}
+attrs_body() {
+ user=$(atf_config_get unprivileged-user)
+ # Allow the unprivileged user to access the work directory.
+ chown ${user} .
+
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir b c
+
+ atf_check -s eq:0 -o empty -e empty chown ${user}:0 b
+ eval $(stat -s b)
+ [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
+ [ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
+
+ atf_check -s eq:0 -o empty -e empty chown ${user}:100 c
+ eval $(stat -s c)
+ [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
+ [ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
+
+ atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'mkdir b/a'
+ eval $(stat -s b/a)
+ [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
+ [ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
+
+ atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'mkdir c/a'
+ eval $(stat -s c/a)
+ [ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
+ [ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
+
+ test_unmount
+}
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Creates a directory and checks the kqueue events" \
+ "raised"
+ atf_set "require.user" "root"
+}
+kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ echo 'mkdir dir/a' | kqueue_monitor 2 dir
+
+ # Creating a directory raises NOTE_LINK on the parent directory
+ kqueue_check dir NOTE_LINK
+
+ # Creating a directory raises NOTE_WRITE on the parent directory
+ kqueue_check dir NOTE_WRITE
+
+ atf_check -s eq:0 -o empty -e empty rmdir dir/a
+ atf_check -s eq:0 -o empty -e empty rmdir dir
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case single
+ atf_add_test_case many
+ atf_add_test_case nested
+ atf_add_test_case attrs
+ atf_add_test_case kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh b/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh
new file mode 100755
index 0000000..62c7cce
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh
@@ -0,0 +1,143 @@
+# $NetBSD: t_mknod.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the mknod operation works.
+#
+
+atf_test_case block
+block_head() {
+ atf_set "descr" "Tests that block devices can be created"
+ atf_set "require.user" "root"
+}
+block_body() {
+ test_mount
+ umask 022
+
+ atf_check -s eq:0 -o empty -e empty mknod fd0a b 2 0
+ eval $(stat -s fd0a)
+ [ ${st_mode} = 060644 ] || atf_fail "Invalid mode"
+ [ ${st_rdev} -eq 512 ] || atf_fail "Invalid device"
+
+ test_unmount
+}
+
+atf_test_case block_kqueue
+block_kqueue_head() {
+ atf_set "descr" "Tests that creating a block device raises the" \
+ "appropriate kqueue events"
+ atf_set "require.user" "root"
+}
+block_kqueue_body() {
+ test_mount
+ umask 022
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ echo 'mknod dir/fd0a b 2 0' | kqueue_monitor 1 dir
+ kqueue_check dir NOTE_WRITE
+
+ test_unmount
+}
+
+atf_test_case char
+char_head() {
+ atf_set "descr" "Tests that character devices can be created"
+ atf_set "require.user" "root"
+}
+char_body() {
+ test_mount
+ umask 022
+
+ atf_check -s eq:0 -o empty -e empty mknod null c 2 2
+ eval $(stat -s null)
+ [ ${st_mode} = 020644 ] || atf_fail "Invalid mode"
+ [ ${st_rdev} -eq 514 ] || atf_fail "Invalid device"
+
+ test_unmount
+}
+
+atf_test_case char_kqueue
+char_kqueue_head() {
+ atf_set "descr" "Tests that creating a character device raises the" \
+ "appropriate kqueue events"
+ atf_set "require.user" "root"
+}
+char_kqueue_body() {
+ test_mount
+ umask 022
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ echo 'mknod dir/null c 2 2' | kqueue_monitor 1 dir
+ kqueue_check dir NOTE_WRITE
+
+ test_unmount
+}
+
+atf_test_case pipe
+pipe_head() {
+ atf_set "descr" "Tests that named pipes can be created"
+ atf_set "require.user" "root"
+}
+pipe_body() {
+ test_mount
+ umask 022
+
+ atf_check -s eq:0 -o empty -e empty mknod pipe p
+ eval $(stat -s pipe)
+ [ ${st_mode} = 010644 ] || atf_fail "Invalid mode"
+
+ test_unmount
+}
+
+atf_test_case pipe_kqueue
+pipe_kqueue_head() {
+ atf_set "descr" "Tests that creating a named pipe raises the" \
+ "appropriate kqueue events"
+ atf_set "require.user" "root"
+}
+pipe_kqueue_body() {
+ test_mount
+ umask 022
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ echo 'mknod dir/pipe p' | kqueue_monitor 1 dir
+ kqueue_check dir NOTE_WRITE
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case block
+ atf_add_test_case block_kqueue
+ atf_add_test_case char
+ atf_add_test_case char_kqueue
+ atf_add_test_case pipe
+ atf_add_test_case pipe_kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_mount.sh b/contrib/netbsd-tests/fs/tmpfs/t_mount.sh
new file mode 100755
index 0000000..11a77d4
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_mount.sh
@@ -0,0 +1,140 @@
+# $NetBSD: t_mount.sh,v 1.6 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that an execution of mount and umount works correctly without
+# causing errors and that the root node gets correct attributes.
+# Also verifies command line parsing from mount_tmpfs.
+#
+
+atf_test_case plain
+plain_head() {
+ atf_set "descr" "Tests a mount and unmount without any options"
+ atf_set "require.user" "root"
+}
+plain_body() {
+ test_mount
+ test_unmount
+}
+
+atf_test_case links
+links_head() {
+ atf_set "descr" "Tests that the mount point has two hard links"
+ atf_set "require.user" "root"
+}
+links_body() {
+ test_mount
+ eval $(stat -s ${Mount_Point})
+ [ ${st_nlink} = 2 ] || \
+ atf_fail "Root directory does not have two hard links"
+ test_unmount
+}
+
+atf_test_case options
+options_head() {
+ atf_set "descr" "Tests the read-only mount option"
+ atf_set "require.user" "root"
+}
+options_body() {
+ test_mount -o ro
+ mount | grep ${Mount_Point} | grep -q read-only || \
+ atf_fail "read-only option (ro) does not work"
+ test_unmount
+}
+
+atf_test_case attrs
+attrs_head() {
+ atf_set "descr" "Tests that root directory attributes are set" \
+ "correctly"
+ atf_set "require.user" "root"
+}
+attrs_body() {
+ test_mount -o -u1000 -o -g100 -o -m755
+ eval $(stat -s ${Mount_Point})
+ [ ${st_uid} = 1000 ] || atf_fail "uid is incorrect"
+ [ ${st_gid} = 100 ] || atf_fail "gid is incorrect"
+ [ ${st_mode} = 040755 ] || atf_fail "mode is incorrect"
+ test_unmount
+}
+
+atf_test_case negative
+negative_head() {
+ atf_set "descr" "Tests that negative values passed to to -s are" \
+ "handled correctly"
+ atf_set "require.user" "root"
+}
+negative_body() {
+ mkdir tmp
+ test_mount -o -s-10
+ test_unmount
+}
+
+atf_test_case large
+large_head() {
+ atf_set "descr" "Tests that extremely long values passed to -s" \
+ "are handled correctly"
+ atf_set "require.user" "root"
+}
+large_body() {
+ test_mount -o -s9223372036854775807
+ test_unmount
+
+ mkdir tmp
+ atf_check -s eq:1 -o empty -e ignore \
+ mount -t tmpfs -o -s9223372036854775808 tmpfs tmp
+ atf_check -s eq:1 -o empty -e ignore \
+ mount -t tmpfs -o -s9223372036854775808g tmpfs tmp
+ rmdir tmp
+}
+
+atf_test_case mntpt
+mntpt_head() {
+ atf_set "descr" "Tests that the error messages printed when the" \
+ "mount point is invalid do not show the source" \
+ "unused parameter"
+}
+mntpt_body() {
+ mount_tmpfs unused $(pwd)/mnt >out 2>&1
+ atf_check -s eq:1 -o empty -e empty grep unused out
+ atf_check -s eq:0 -o ignore -e empty grep "$(pwd)/mnt" out
+
+ mount_tmpfs unused mnt >out 2>&1
+ atf_check -s eq:1 -o empty -e empty grep unused out
+ atf_check -s eq:0 -o ignore -e empty grep mnt out
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case plain
+ atf_add_test_case options
+ atf_add_test_case attrs
+ atf_add_test_case negative
+ atf_add_test_case large
+ atf_add_test_case mntpt
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_pipes.sh b/contrib/netbsd-tests/fs/tmpfs/t_pipes.sh
new file mode 100755
index 0000000..7c0065a
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_pipes.sh
@@ -0,0 +1,52 @@
+# $NetBSD: t_pipes.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Verifies that pipes work"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ umask 022
+
+ atf_check -s eq:0 -o empty -e empty mknod pipe p
+
+ echo "Writing to pipe and waiting for response"
+ echo -n foo >pipe &
+ [ "$(cat pipe)" = foo ] || atf_fail "Received data is incorrect"
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_read_write.sh b/contrib/netbsd-tests/fs/tmpfs/t_read_write.sh
new file mode 100755
index 0000000..13cc256
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_read_write.sh
@@ -0,0 +1,87 @@
+# $NetBSD: t_read_write.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the read and write operations work.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Checks that file removal works"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ echo "Testing write to a small file"
+ echo foo >a || atf_fail "Failed to write to file"
+ [ $(md5 a | cut -d ' ' -f 4) = d3b07384d113edec49eaa6238ad5ff00 ] || \
+ atf_fail "Invalid file contents"
+
+ echo "Testing appending to a small file"
+ echo bar >>a || atf_fail "Failed to append data to file"
+ [ $(md5 a | cut -d ' ' -f 4) = f47c75614087a8dd938ba4acff252494 ] || \
+ atf_fail "Invalid file contents"
+
+ echo "Testing write to a big file (bigger than a page)"
+ jot 10000 >b || atf_fail "Failed to create a big file"
+ [ $(md5 b | cut -d ' ' -f 4) = 72d4ff27a28afbc066d5804999d5a504 ] || \
+ atf_fail "Invalid file contents"
+
+ test_unmount
+}
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Checks that writing to a file raises the" \
+ "appropriate kqueue events"
+ atf_set "require.user" "root"
+}
+kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o ignore -e ignore \
+ dd if=/dev/zero of=c bs=1k count=10
+ echo 'dd if=/dev/zero of=c seek=2 bs=1k count=1 conv=notrunc' \
+ '>/dev/null 2>&1' | kqueue_monitor 1 c
+ kqueue_check c NOTE_WRITE
+
+ echo foo >d
+ echo 'echo bar >>d' | kqueue_monitor 2 d
+ kqueue_check d NOTE_EXTEND
+ kqueue_check d NOTE_WRITE
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case basic
+ atf_add_test_case kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh b/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh
new file mode 100755
index 0000000..6f5dc3e
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh
@@ -0,0 +1,116 @@
+# $NetBSD: t_readdir.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the readdir operation works.
+#
+
+atf_test_case dots
+dots_head() {
+ atf_set "descr" "Verifies that readdir returns the '.' and '..'" \
+ "entries"
+ atf_set "require.user" "root"
+}
+dots_body() {
+ test_mount
+
+ atf_check -s eq:0 -o save:stdout -e empty /bin/ls -a
+ atf_check -s eq:0 -o ignore -e empty grep '^\.$' stdout
+ atf_check -s eq:0 -o ignore -e empty grep '^\..$' stdout
+
+ test_unmount
+}
+
+atf_test_case types
+types_head() {
+ atf_set "descr" "Verifies that readdir works for all different" \
+ "file types"
+ atf_set "require.user" "root"
+}
+types_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ atf_check -s eq:0 -o empty -e empty touch reg
+ atf_check -s eq:0 -o empty -e empty ln -s reg lnk
+ atf_check -s eq:0 -o empty -e empty mknod blk b 0 0
+ atf_check -s eq:0 -o empty -e empty mknod chr c 0 0
+ atf_check -s eq:0 -o empty -e empty mknod fifo p
+ atf_check -s eq:0 -o empty -e empty \
+ $(atf_get_srcdir)/h_tools sockets sock
+
+ atf_check -s eq:0 -o ignore -e empty ls
+ atf_check -s eq:0 -o empty -e empty rm -rf *
+
+ test_unmount
+}
+
+atf_test_case caching
+caching_head() {
+ atf_set "descr" "Catch a bug caused by incorrect invalidation of" \
+ "readdir caching variables"
+ atf_set "require.user" "root"
+}
+caching_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty touch $(jot 10)
+ atf_check -s eq:0 -o empty -e empty rm *
+ atf_check -s eq:0 -o empty -e empty touch $(jot 20)
+ atf_check -s eq:0 -o empty -e empty -x "ls >/dev/null"
+
+ test_unmount
+}
+
+atf_test_case many
+many_head() {
+ atf_set "descr" "Verifies that readdir works with many files"
+ atf_set "require.user" "root"
+}
+many_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ echo "Creating 500 files"
+ for f in $(jot 500); do
+ touch a/$f
+ done
+ atf_check -s eq:0 -o empty -e empty rm a/*
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case dots
+ atf_add_test_case types
+ atf_add_test_case caching
+ atf_add_test_case many
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_remove.sh b/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
new file mode 100755
index 0000000..df868f9
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
@@ -0,0 +1,110 @@
+# $NetBSD: t_remove.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the remove operation works.
+#
+
+atf_test_case single
+single_head() {
+ atf_set "descr" "Checks that file removal works"
+ atf_set "require.user" "root"
+}
+single_body() {
+ test_mount
+
+ atf_check -s eq:1 -o empty -e empty test -f a
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty test -f a
+ atf_check -s eq:0 -o empty -e empty rm a
+ atf_check -s eq:1 -o empty -e empty test -f a
+
+ test_unmount
+}
+
+atf_test_case uchg
+uchg_head() {
+ atf_set "descr" "Checks that files with the uchg flag set cannot" \
+ "be removed"
+ atf_set "require.user" "root"
+}
+uchg_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty chflags uchg a
+ atf_check -s eq:1 -o empty -e ignore rm -f a
+ atf_check -s eq:0 -o empty -e empty chflags nouchg a
+ atf_check -s eq:0 -o empty -e empty rm a
+ atf_check -s eq:1 -o empty -e empty test -f a
+
+ test_unmount
+}
+
+atf_test_case dot
+dot_head() {
+ atf_set "descr" "Checks that '.' cannot be removed"
+ atf_set "require.user" "root"
+}
+dot_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:1 -o empty -e ignore unlink a/.
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ test_unmount
+}
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Removes a file and checks the kqueue events" \
+ "raised"
+ atf_set "require.user" "root"
+}
+kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ atf_check -s eq:0 -o empty -e empty touch dir/a
+ echo 'rm dir/a' | kqueue_monitor 2 dir dir/a
+ kqueue_check dir/a NOTE_DELETE
+ kqueue_check dir NOTE_WRITE
+ atf_check -s eq:0 -o empty -e empty rmdir dir
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case single
+ atf_add_test_case uchg
+ atf_add_test_case dot
+ atf_add_test_case kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_rename.sh b/contrib/netbsd-tests/fs/tmpfs/t_rename.sh
new file mode 100755
index 0000000..7613f1f
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_rename.sh
@@ -0,0 +1,278 @@
+# $NetBSD: t_rename.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the rename operation works (either by renaming entries or
+# by moving them).
+#
+
+atf_test_case dots
+dots_head() {
+ atf_set "descr" "Tests that '.' and '..' cannot be renamed"
+ atf_set "require.user" "root"
+}
+dots_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:1 -o empty -e ignore mv a/. c
+ atf_check -s eq:1 -o empty -e ignore mv a/.. c
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ test_unmount
+}
+
+atf_test_case crossdev
+crossdev_head() {
+ atf_set "descr" "Tests that cross-device renames do not work"
+ atf_set "require.user" "root"
+}
+crossdev_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:1 -o empty -e save:stderr \
+ $(atf_get_srcdir)/h_tools rename a /var/tmp/a
+ atf_check -s eq:0 -o ignore -e empty grep "Cross-device link" stderr
+ atf_check -s eq:0 -o empty -e empty test -d a
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ test_unmount
+}
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Tests that basic renames work"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty mv a c
+ atf_check -s eq:1 -o empty -e empty test -d a
+ atf_check -s eq:0 -o empty -e empty test -d c
+ atf_check -s eq:0 -o empty -e empty rmdir c
+
+ test_unmount
+}
+
+atf_test_case dotdot
+dotdot_head() {
+ atf_set "descr" "Tests that the '..' entry is properly updated" \
+ "during moves"
+ atf_set "require.user" "root"
+}
+dotdot_body() {
+ test_mount
+
+ echo "Checking if the '..' entry is updated after moves"
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty mkdir b
+ atf_check -s eq:0 -o empty -e empty mv b a
+ atf_check -s eq:0 -o empty -e empty test -d a/b/../b
+ atf_check -s eq:0 -o empty -e empty test -d a/b/../../a
+ eval $(stat -s a/b)
+ [ ${st_nlink} = 2 ] || atf_fail "Incorrect number of links"
+ eval $(stat -s a)
+ [ ${st_nlink} = 3 ] || atf_fail "Incorrect number of links"
+ atf_check -s eq:0 -o empty -e empty rmdir a/b
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ echo "Checking if the '..' entry is correct after renames"
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty mkdir b
+ atf_check -s eq:0 -o empty -e empty mv b a
+ atf_check -s eq:0 -o empty -e empty mv a c
+ atf_check -s eq:0 -o empty -e empty test -d c/b/../b
+ atf_check -s eq:0 -o empty -e empty test -d c/b/../../c
+ atf_check -s eq:0 -o empty -e empty rmdir c/b
+ atf_check -s eq:0 -o empty -e empty rmdir c
+
+ echo "Checking if the '..' entry is correct after multiple moves"
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty mkdir b
+ atf_check -s eq:0 -o empty -e empty mv b a
+ atf_check -s eq:0 -o empty -e empty mv a c
+ atf_check -s eq:0 -o empty -e empty mv c/b d
+ atf_check -s eq:0 -o empty -e empty test -d d/../c
+ atf_check -s eq:0 -o empty -e empty rmdir d
+ atf_check -s eq:0 -o empty -e empty rmdir c
+
+ test_unmount
+}
+
+atf_test_case dir_to_emptydir
+dir_to_emptydir_head() {
+ atf_set "descr" "Tests that renaming a directory to override an" \
+ "empty directory works"
+ atf_set "require.user" "root"
+}
+dir_to_emptydir_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty touch a/c
+ atf_check -s eq:0 -o empty -e empty mkdir b
+ atf_check -s eq:0 -o empty -e empty \
+ $(atf_get_srcdir)/h_tools rename a b
+ atf_check -s eq:1 -o empty -e empty test -e a
+ atf_check -s eq:0 -o empty -e empty test -d b
+ atf_check -s eq:0 -o empty -e empty test -f b/c
+ rm b/c
+ rmdir b
+
+ test_unmount
+}
+
+atf_test_case dir_to_fulldir
+dir_to_fulldir_head() {
+ atf_set "descr" "Tests that renaming a directory to override a" \
+ "non-empty directory fails"
+ atf_set "require.user" "root"
+}
+dir_to_fulldir_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty touch a/c
+ atf_check -s eq:0 -o empty -e empty mkdir b
+ atf_check -s eq:0 -o empty -e empty touch b/d
+ atf_check -s eq:1 -o empty -e save:stderr \
+ $(atf_get_srcdir)/h_tools rename a b
+ atf_check -s eq:0 -o ignore -e empty grep "Directory not empty" stderr
+ atf_check -s eq:0 -o empty -e empty test -d a
+ atf_check -s eq:0 -o empty -e empty test -f a/c
+ atf_check -s eq:0 -o empty -e empty test -d b
+ atf_check -s eq:0 -o empty -e empty test -f b/d
+ rm a/c
+ rm b/d
+ rmdir a
+ rmdir b
+
+ test_unmount
+}
+
+atf_test_case dir_to_file
+dir_to_file_head() {
+ atf_set "descr" "Tests that renaming a directory to override a" \
+ "file fails"
+ atf_set "require.user" "root"
+}
+dir_to_file_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty touch b
+ atf_check -s eq:1 -o empty -e save:stderr \
+ $(atf_get_srcdir)/h_tools rename a b
+ atf_check -s eq:0 -o ignore -e empty grep "Not a directory" stderr
+ atf_check -s eq:0 -o empty -e empty test -d a
+ atf_check -s eq:0 -o empty -e empty test -f b
+ rmdir a
+ rm b
+
+ test_unmount
+}
+
+atf_test_case file_to_dir
+file_to_dir_head() {
+ atf_set "descr" "Tests that renaming a file to override a" \
+ "directory fails"
+ atf_set "require.user" "root"
+}
+file_to_dir_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty mkdir b
+ atf_check -s eq:1 -o empty -e save:stderr \
+ $(atf_get_srcdir)/h_tools rename a b
+ atf_check -s eq:0 -o ignore -e empty grep "Is a directory" stderr
+ atf_check -s eq:0 -o empty -e empty test -f a
+ atf_check -s eq:0 -o empty -e empty test -d b
+ rm a
+ rmdir b
+
+ test_unmount
+}
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Tests that moving and renaming files raise the" \
+ "correct kqueue events"
+ atf_set "require.user" "root"
+}
+kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ atf_check -s eq:0 -o empty -e empty touch dir/a
+ echo 'mv dir/a dir/b' | kqueue_monitor 2 dir dir/a
+ kqueue_check dir/a NOTE_RENAME
+ kqueue_check dir NOTE_WRITE
+ atf_check -s eq:0 -o empty -e empty rm dir/b
+ atf_check -s eq:0 -o empty -e empty rmdir dir
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ atf_check -s eq:0 -o empty -e empty touch dir/a
+ atf_check -s eq:0 -o empty -e empty touch dir/b
+ echo 'mv dir/a dir/b' | kqueue_monitor 3 dir dir/a dir/b
+ kqueue_check dir/a NOTE_RENAME
+ kqueue_check dir NOTE_WRITE
+ kqueue_check dir/b NOTE_DELETE
+ atf_check -s eq:0 -o empty -e empty rm dir/b
+ atf_check -s eq:0 -o empty -e empty rmdir dir
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir1
+ atf_check -s eq:0 -o empty -e empty mkdir dir2
+ atf_check -s eq:0 -o empty -e empty touch dir1/a
+ echo 'mv dir1/a dir2/a' | kqueue_monitor 3 dir1 dir1/a dir2
+ kqueue_check dir1/a NOTE_RENAME
+ kqueue_check dir1 NOTE_WRITE
+ kqueue_check dir2 NOTE_WRITE
+ atf_check -s eq:0 -o empty -e empty rm dir2/a
+ atf_check -s eq:0 -o empty -e empty rmdir dir1
+ atf_check -s eq:0 -o empty -e empty rmdir dir2
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case dots
+ atf_add_test_case crossdev
+ atf_add_test_case basic
+ atf_add_test_case dotdot
+ atf_add_test_case dir_to_emptydir
+ atf_add_test_case dir_to_fulldir
+ atf_add_test_case dir_to_file
+ atf_add_test_case file_to_dir
+ atf_add_test_case kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_renamerace.c b/contrib/netbsd-tests/fs/tmpfs/t_renamerace.c
new file mode 100644
index 0000000..044937a
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_renamerace.c
@@ -0,0 +1,115 @@
+/* $NetBSD: t_renamerace.c,v 1.13 2011/08/18 21:44:55 riastradh Exp $ */
+
+/*
+ * Modified for rump and atf from a program supplied
+ * by Nicolas Joly in kern/40948
+ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/utsname.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <fs/tmpfs/tmpfs_args.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(renamerace2);
+ATF_TC_HEAD(renamerace2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "rename(2) lock order inversion");
+ atf_tc_set_md_var(tc, "timeout", "6");
+}
+
+static volatile int quittingtime = 0;
+static pid_t wrkpid;
+
+static void *
+r2w1(void *arg)
+{
+ int fd;
+
+ rump_pub_lwproc_newlwp(wrkpid);
+
+ fd = rump_sys_open("/file", O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("creat");
+ rump_sys_close(fd);
+
+ while (!quittingtime) {
+ if (rump_sys_rename("/file", "/dir/file") == -1)
+ atf_tc_fail_errno("rename 1");
+ if (rump_sys_rename("/dir/file", "/file") == -1)
+ atf_tc_fail_errno("rename 2");
+ }
+
+ return NULL;
+}
+
+static void *
+r2w2(void *arg)
+{
+ int fd;
+
+ rump_pub_lwproc_newlwp(wrkpid);
+
+ while (!quittingtime) {
+ fd = rump_sys_open("/dir/file1", O_RDWR);
+ if (fd != -1)
+ rump_sys_close(fd);
+ }
+
+ return NULL;
+}
+
+ATF_TC_BODY(renamerace2, tc)
+{
+ struct tmpfs_args args;
+ pthread_t pt[2];
+
+ /*
+ * Force SMP regardless of how many host CPUs there are.
+ * Deadlock is highly unlikely to trigger otherwise.
+ */
+ setenv("RUMP_NCPU", "2", 1);
+
+ rump_init();
+ memset(&args, 0, sizeof(args));
+ args.ta_version = TMPFS_ARGS_VERSION;
+ args.ta_root_mode = 0777;
+ if (rump_sys_mount(MOUNT_TMPFS, "/", 0, &args, sizeof(args)) == -1)
+ atf_tc_fail_errno("could not mount tmpfs");
+
+ if (rump_sys_mkdir("/dir", 0777) == -1)
+ atf_tc_fail_errno("cannot create directory");
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ RL(wrkpid = rump_sys_getpid());
+ pthread_create(&pt[0], NULL, r2w1, NULL);
+ pthread_create(&pt[1], NULL, r2w2, NULL);
+
+ /* usually triggers in <<1s for me */
+ sleep(4);
+ quittingtime = 1;
+
+ pthread_join(pt[0], NULL);
+ pthread_join(pt[1], NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, renamerace2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_rmdir.sh b/contrib/netbsd-tests/fs/tmpfs/t_rmdir.sh
new file mode 100755
index 0000000..9e5d761
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_rmdir.sh
@@ -0,0 +1,204 @@
+# $NetBSD: t_rmdir.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that rmdir works by creating and removing directories. Also
+# checks multiple error conditions.
+#
+
+atf_test_case mntpt
+mntpt_head() {
+ atf_set "descr" "Checks that the mount point cannot be removed"
+ atf_set "require.user" "root"
+}
+mntpt_body() {
+ test_mount
+
+ atf_check -s eq:1 -o empty -e ignore rmdir ${Mount_Point}
+
+ test_unmount
+}
+
+atf_test_case non_existent
+non_existent_head() {
+ atf_set "descr" "Checks that non-existent directories cannot" \
+ "be removed"
+ atf_set "require.user" "root"
+}
+non_existent_body() {
+ test_mount
+
+ atf_check -s eq:1 -o empty -e ignore rmdir non-existent
+
+ test_unmount
+}
+
+atf_test_case single
+single_head() {
+ atf_set "descr" "Checks that removing a single directory works"
+ atf_set "require.user" "root"
+}
+single_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ eval $(stat -s ${Mount_Point})
+ [ ${st_nlink} = 3 ] || \
+ atf_fail "Incorrect number of links after creation"
+ atf_check -s eq:0 -o empty -e empty rmdir a
+ eval $(stat -s ${Mount_Point})
+ [ ${st_nlink} = 2 ] || \
+ atf_fail "Incorrect number of links after removal"
+
+ test_unmount
+}
+
+atf_test_case nested
+nested_head() {
+ atf_set "descr" "Checks that removing nested directories works"
+ atf_set "require.user" "root"
+}
+nested_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir -p a/b/c
+ atf_check -s eq:0 -o empty -e empty rmdir a/b/c
+ atf_check -s eq:0 -o empty -e empty rmdir a/b
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ test_unmount
+}
+
+atf_test_case dots
+dots_head() {
+ atf_set "descr" "Checks that '.' and '..' cannot be removed"
+ atf_set "require.user" "root"
+}
+dots_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:1 -o empty -e ignore rmdir a/.
+ atf_check -s eq:1 -o empty -e ignore rmdir a/..
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ test_unmount
+}
+
+atf_test_case non_empty
+non_empty_head() {
+ atf_set "descr" "Checks that non-empty directories cannot be removed"
+ atf_set "require.user" "root"
+}
+non_empty_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty mkdir a/b
+ atf_check -s eq:0 -o empty -e empty mkdir a/c
+ atf_check -s eq:1 -o empty -e ignore rmdir a
+ atf_check -s eq:0 -o empty -e empty rmdir a/b
+ atf_check -s eq:0 -o empty -e empty rmdir a/c
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ test_unmount
+}
+
+atf_test_case links
+links_head() {
+ atf_set "descr" "Checks the root directory's links after removals"
+ atf_set "require.user" "root"
+}
+links_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ atf_check -s eq:0 -o empty -e empty mkdir a/b
+ atf_check -s eq:0 -o empty -e empty mkdir c
+
+ atf_check -s eq:0 -o empty -e empty rmdir c
+ atf_check -s eq:0 -o empty -e empty rmdir a/b
+ atf_check -s eq:0 -o empty -e empty rmdir a
+
+ eval $(stat -s ${Mount_Point})
+ [ ${st_nlink} = 2 ] || atf_fail "Incorrect number of links"
+
+ test_unmount
+}
+
+atf_test_case curdir
+curdir_head() {
+ atf_set "descr" "Checks that the current directory cannot be removed"
+ atf_set "require.user" "root"
+}
+curdir_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a
+ # Catch a bug that would panic the system when accessing the
+ # current directory after being deleted: vop_open cannot assume
+ # that open files are still linked to a directory.
+ atf_check -s eq:1 -o empty -e ignore -x '( cd a && rmdir ../a && ls )'
+ atf_check -s eq:1 -o empty -e empty test -e a
+
+ test_unmount
+}
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Checks that removing a directory raises the" \
+ "correct kqueue events"
+ atf_set "require.user" "root"
+}
+kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ atf_check -s eq:0 -o empty -e empty mkdir dir/a
+ echo 'rmdir dir/a' | kqueue_monitor 3 dir dir/a
+ kqueue_check dir/a NOTE_DELETE
+ kqueue_check dir NOTE_LINK
+ kqueue_check dir NOTE_WRITE
+ atf_check -s eq:0 -o empty -e empty rmdir dir
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case mntpt
+ atf_add_test_case non_existent
+ atf_add_test_case single
+ atf_add_test_case nested
+ atf_add_test_case dots
+ atf_add_test_case non_empty
+ atf_add_test_case links
+ atf_add_test_case curdir
+ atf_add_test_case kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_setattr.sh b/contrib/netbsd-tests/fs/tmpfs/t_setattr.sh
new file mode 100755
index 0000000..f643446
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_setattr.sh
@@ -0,0 +1,216 @@
+# $NetBSD: t_setattr.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the setattr vnode operation works, using several commands
+# that require this function.
+#
+
+atf_test_case chown
+chown_head() {
+ atf_set "descr" "Tests that the file owner can be changed"
+ atf_set "require.user" "root"
+}
+chown_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir own
+ eval $(stat -s own | sed -e 's|st_|ost_|g')
+ atf_check -s eq:0 -o empty -e empty chown 1234 own
+ eval $(stat -s own)
+ [ ${st_uid} -eq 1234 ] || atf_fail "uid was not set"
+ [ ${st_gid} -eq ${ost_gid} ] || atf_fail "gid was modified"
+
+ test_unmount
+}
+
+atf_test_case chown_kqueue
+chown_kqueue_head() {
+ atf_set "descr" "Tests that changing the file owner raises" \
+ "NOTE_ATTRIB on it"
+ atf_set "require.user" "root"
+}
+chown_kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir ownq
+ echo 'chown 1234 ownq' | kqueue_monitor 1 ownq
+ kqueue_check ownq NOTE_ATTRIB
+
+ test_unmount
+}
+
+atf_test_case chgrp
+chgrp_head() {
+ atf_set "descr" "Tests that the file group can be changed"
+ atf_set "require.user" "root"
+}
+chgrp_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir grp
+ eval $(stat -s grp | sed -e 's|st_|ost_|g')
+ atf_check -s eq:0 -o empty -e empty chgrp 5678 grp
+ eval $(stat -s grp)
+ [ ${st_uid} -eq ${ost_uid} ] || atf_fail "uid was modified"
+ [ ${st_gid} -eq 5678 ] || atf_fail "gid was not set"
+
+ test_unmount
+}
+
+atf_test_case chgrp_kqueue
+chgrp_kqueue_head() {
+ atf_set "descr" "Tests that changing the file group raises" \
+ "NOTE_ATTRIB on it"
+ atf_set "require.user" "root"
+}
+chgrp_kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir grpq
+ echo 'chgrp 1234 grpq' | kqueue_monitor 1 grpq
+ kqueue_check grpq NOTE_ATTRIB
+
+ test_unmount
+}
+
+atf_test_case chowngrp
+chowngrp_head() {
+ atf_set "descr" "Tests that the file owner and group can be" \
+ "changed at once"
+ atf_set "require.user" "root"
+}
+chowngrp_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir owngrp
+ atf_check -s eq:0 -o empty -e empty chown 1234:5678 owngrp
+ eval $(stat -s owngrp)
+ [ ${st_uid} -eq 1234 ] || atf_fail "uid was not modified"
+ [ ${st_gid} -eq 5678 ] || atf_fail "gid was not modified"
+
+ test_unmount
+}
+
+atf_test_case chowngrp_kqueue
+chowngrp_kqueue_head() {
+ atf_set "descr" "Tests that changing the file owner and group" \
+ "raises NOTE_ATTRIB on it"
+ atf_set "require.user" "root"
+}
+chowngrp_kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir owngrpp
+ echo 'chown 1234:5678 owngrpp' | kqueue_monitor 1 owngrpp
+ kqueue_check owngrpp NOTE_ATTRIB
+
+ test_unmount
+}
+
+atf_test_case chmod
+chmod_head() {
+ atf_set "descr" "Tests that the file mode can be changed"
+ atf_set "require.user" "root"
+}
+chmod_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir mode
+ atf_check -s eq:0 -o empty -e empty chmod 0000 mode
+ eval $(stat -s mode)
+ [ ${st_mode} -eq 40000 ] || af_fail "mode was not set"
+
+ test_unmount
+}
+
+atf_test_case chmod_kqueue
+chmod_kqueue_head() {
+ atf_set "descr" "Tests that changing the file mode raises" \
+ "NOTE_ATTRIB on it"
+ atf_set "require.user" "root"
+}
+chmod_kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir modeq
+ echo 'chmod 0000 modeq' | kqueue_monitor 1 modeq
+ kqueue_check modeq NOTE_ATTRIB
+
+ test_unmount
+}
+
+atf_test_case chtimes
+chtimes_head() {
+ atf_set "descr" "Tests that file times can be changed"
+ atf_set "require.user" "root"
+}
+chtimes_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir times
+ atf_check -s eq:0 -o empty -e empty \
+ -x 'TZ=GMT touch -t 200501010101 times'
+ eval $(stat -s times)
+ [ ${st_atime} = ${st_mtime} ] || \
+ atf_fail "atime does not match mtime"
+ [ ${st_atime} = 1104541260 ] || atf_fail "atime does not match"
+
+ test_unmount
+}
+
+atf_test_case chtimes_kqueue
+chtimes_kqueue_head() {
+ atf_set "descr" "Tests that changing the file times raises" \
+ "NOTE_ATTRIB on it"
+ atf_set "require.user" "root"
+}
+chtimes_kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir timesq
+ echo 'touch timesq' | kqueue_monitor 1 timesq
+ kqueue_check timesq NOTE_ATTRIB
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case chown
+ atf_add_test_case chown_kqueue
+ atf_add_test_case chgrp
+ atf_add_test_case chgrp_kqueue
+ atf_add_test_case chowngrp
+ atf_add_test_case chowngrp_kqueue
+ atf_add_test_case chmod
+ atf_add_test_case chmod_kqueue
+ atf_add_test_case chtimes
+ atf_add_test_case chtimes_kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_sizes.sh b/contrib/netbsd-tests/fs/tmpfs/t_sizes.sh
new file mode 100755
index 0000000..9673b91
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_sizes.sh
@@ -0,0 +1,131 @@
+# $NetBSD: t_sizes.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the file system controls memory usage correctly.
+#
+
+atf_test_case small
+small_head() {
+ atf_set "descr" "Checks the status after creating a small file"
+ atf_set "require.user" "root"
+}
+small_body() {
+ test_mount -o -s10M
+
+ echo a >a || atf_fail "Could not create file"
+ eval $($(atf_get_srcdir)/h_tools statvfs .)
+ f_bused=$((${f_blocks} - ${f_bfree}))
+ [ ${f_bused} -gt 1 ] || atf_fail "Incorrect bused count"
+ atf_check -s eq:0 -o empty -e empty rm a
+
+ test_unmount
+}
+
+atf_test_case big
+big_head() {
+ atf_set "descr" "Checks the status after creating a big file"
+ atf_set "require.user" "root"
+}
+big_body() {
+ test_mount -o -s10M
+
+ pagesize=$(sysctl hw.pagesize | cut -d ' ' -f 3)
+ eval $($(atf_get_srcdir)/h_tools statvfs . | sed -e 's|^f_|cf_|')
+ cf_bused=$((${cf_blocks} - ${cf_bfree}))
+
+ atf_check -s eq:0 -o ignore -e ignore \
+ dd if=/dev/zero of=a bs=1m count=5
+ eval $($(atf_get_srcdir)/h_tools statvfs .)
+ f_bused=$((${f_blocks} - ${f_bfree}))
+ [ ${f_bused} -ne ${cf_bused} ] || atf_fail "bused did not change"
+ [ ${f_bused} -gt $((5 * 1024 * 1024 / ${pagesize})) ] || \
+ atf_fail "bused too big"
+ of_bused=${f_bused}
+ atf_check -s eq:0 -o empty -e empty rm a
+ eval $($(atf_get_srcdir)/h_tools statvfs .)
+ f_bused=$((${f_blocks} - ${f_bfree}))
+ [ ${f_bused} -lt ${of_bused} ] || \
+ atf_fail "bused was not correctly restored"
+
+ test_unmount
+}
+
+atf_test_case overflow
+overflow_head() {
+ atf_set "descr" "Checks the status after creating a big file that" \
+ "overflows the file system limits"
+ atf_set "require.user" "root"
+}
+overflow_body() {
+ test_mount -o -s10M
+
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty rm a
+ eval $($(atf_get_srcdir)/h_tools statvfs .)
+ of_bused=$((${f_blocks} - ${f_bfree}))
+ atf_check -s eq:1 -o ignore -e ignore \
+ dd if=/dev/zero of=a bs=1m count=15
+ atf_check -s eq:0 -o empty -e empty rm a
+ eval $($(atf_get_srcdir)/h_tools statvfs .)
+ f_bused=$((${f_blocks} - ${f_bfree}))
+ [ ${f_bused} -ge ${of_bused} -a ${f_bused} -le $((${of_bused} + 1)) ] \
+ || atf_fail "Incorrect bused"
+
+ test_unmount
+}
+
+atf_test_case overwrite
+overwrite_head() {
+ atf_set "descr" "Checks that writing to the middle of a file" \
+ "does not change its size"
+ atf_set "require.user" "root"
+}
+overwrite_body() {
+ test_mount -o -s10M
+
+ atf_check -s eq:0 -o ignore -e ignore \
+ dd if=/dev/zero of=a bs=1024 count=10
+ sync
+ atf_check -s eq:0 -o ignore -e ignore \
+ dd if=/dev/zero of=a bs=1024 conv=notrunc seek=1 count=1
+ sync
+ eval $(stat -s a)
+ [ ${st_size} -eq 10240 ] || atf_fail "Incorrect file size"
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case small
+ atf_add_test_case big
+ atf_add_test_case overflow
+ atf_add_test_case overwrite
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_sockets.sh b/contrib/netbsd-tests/fs/tmpfs/t_sockets.sh
new file mode 100755
index 0000000..6b97248
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_sockets.sh
@@ -0,0 +1,52 @@
+# $NetBSD: t_sockets.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Verifies that sockets can be created using" \
+ "socket/bind"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty $(atf_get_srcdir)/h_tools sockets a
+ atf_check -s eq:0 -o empty -e empty rm a
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ echo "$(atf_get_srcdir)/h_tools sockets dir/a" | kqueue_monitor 1 dir
+ kqueue_check dir NOTE_WRITE
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_statvfs.sh b/contrib/netbsd-tests/fs/tmpfs/t_statvfs.sh
new file mode 100755
index 0000000..21290b6
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_statvfs.sh
@@ -0,0 +1,59 @@
+# $NetBSD: t_statvfs.sh,v 1.4 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the statvfs system call works properly (returning the
+# correct values) over a tmpfs mount point.
+#
+
+atf_test_case values
+values_head() {
+ atf_set "descr" "Tests that statvfs(2) returns correct values"
+ atf_set "require.user" "root"
+}
+values_body() {
+ test_mount -o -s10M
+
+ pagesize=$(sysctl hw.pagesize | cut -d ' ' -f 3)
+ eval $($(atf_get_srcdir)/h_tools statvfs .)
+ [ ${pagesize} -eq ${f_bsize} ] || \
+ atf_fail "Invalid bsize"
+ [ $((${f_bsize} * ${f_blocks})) -ge $((10 * 1024 * 1024)) ] || \
+ atf_file "bsize * blocks too small"
+ [ $((${f_bsize} * ${f_blocks})) -le \
+ $((10 * 1024 * 1024 + ${pagesize})) ] || \
+ atf_fail "bsize * blocks too big"
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case values
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_symlink.sh b/contrib/netbsd-tests/fs/tmpfs/t_symlink.sh
new file mode 100755
index 0000000..2cc66c0
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_symlink.sh
@@ -0,0 +1,114 @@
+# $NetBSD: t_symlink.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that the symlink and readlink operations work.
+#
+
+atf_test_case file
+file_head() {
+ atf_set "descr" "Tests that symlinks to files work"
+ atf_set "require.user" "root"
+}
+file_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty touch a
+ atf_check -s eq:0 -o empty -e empty ln -s a b
+ [ $(md5 b | cut -d ' ' -f 4) = d41d8cd98f00b204e9800998ecf8427e ] || \
+ atf_fail "Symlink points to an incorrect file"
+
+ atf_check -s eq:0 -o empty -e empty -x 'echo foo >a'
+ [ $(md5 b | cut -d ' ' -f 4) = d3b07384d113edec49eaa6238ad5ff00 ] || \
+ atf_fail "Symlink points to an incorrect file"
+
+ test_unmount
+}
+
+atf_test_case exec
+exec_head() {
+ atf_set "descr" "Tests symlinking to a known system binary and" \
+ "executing it through the symlink"
+ atf_set "require.user" "root"
+}
+exec_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty touch b
+ atf_check -s eq:0 -o empty -e empty ln -s /bin/cp cp
+ atf_check -s eq:0 -o empty -e empty ./cp b c
+ atf_check -s eq:0 -o empty -e empty test -f c
+
+ test_unmount
+}
+
+atf_test_case dir
+dir_head() {
+ atf_set "descr" "Tests that symlinks to directories work"
+ atf_set "require.user" "root"
+}
+dir_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir d
+ atf_check -s eq:1 -o empty -e empty test -f d/foo
+ atf_check -s eq:1 -o empty -e empty test -f e/foo
+ atf_check -s eq:0 -o empty -e empty ln -s d e
+ atf_check -s eq:0 -o empty -e empty touch d/foo
+ atf_check -s eq:0 -o empty -e empty test -f d/foo
+ atf_check -s eq:0 -o empty -e empty test -f e/foo
+
+ test_unmount
+}
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Tests that creating a symlink raises the" \
+ "appropriate kqueue events"
+ atf_set "require.user" "root"
+}
+kqueue_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir dir
+ echo 'ln -s non-existent dir/a' | kqueue_monitor 1 dir
+ kqueue_check dir NOTE_WRITE
+ atf_check -s eq:0 -o empty -e empty rm dir/a
+ atf_check -s eq:0 -o empty -e empty rmdir dir
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case file
+ atf_add_test_case exec
+ atf_add_test_case dir
+ atf_add_test_case kqueue
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_times.sh b/contrib/netbsd-tests/fs/tmpfs/t_times.sh
new file mode 100755
index 0000000..f83dfe8
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_times.sh
@@ -0,0 +1,141 @@
+# $NetBSD: t_times.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that node times are properly handled.
+#
+
+atf_test_case empty
+empty_head() {
+ atf_set "descr" "Tests that creating an empty file and later" \
+ "manipulating it updates times correctly"
+ atf_set "require.user" "root"
+}
+empty_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty touch a
+ eval $(stat -s a | sed -e 's|st_|ost_|g') || atf_fail "stat failed"
+ [ ${ost_birthtime} -eq ${ost_atime} ] || atf_fail "Incorrect atime"
+ [ ${ost_birthtime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime"
+ [ ${ost_birthtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime"
+
+ sleep 1
+ atf_check -s eq:0 -o ignore -e empty cat a
+ eval $(stat -s a) || atf_fail "stat failed"
+ [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime"
+ [ ${st_ctime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime"
+ [ ${st_mtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime"
+
+ sleep 1
+ echo foo >a || atf_fail "Write failed"
+ eval $(stat -s a) || atf_fail "stat failed"
+ [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime"
+ [ ${st_ctime} -gt ${ost_ctime} ] || atf_fail "Incorrect ctime"
+ [ ${st_mtime} -gt ${ost_mtime} ] || atf_fail "Incorrect mtime"
+
+ test_unmount
+}
+
+atf_test_case non_empty
+non_empty_head() {
+ atf_set "descr" "Tests that creating a non-empty file and later" \
+ "manipulating it updates times correctly"
+ atf_set "require.user" "root"
+}
+non_empty_body() {
+ test_mount
+
+ echo foo >b || atf_fail "Non-empty creation failed"
+ eval $(stat -s b | sed -e 's|st_|ost_|g') || atf_fail "stat failed"
+
+ sleep 1
+ atf_check -s eq:0 -o ignore -e empty cat b
+ eval $(stat -s b) || atf_fail "stat failed"
+ [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime"
+ [ ${st_ctime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime"
+ [ ${st_mtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime"
+
+ test_unmount
+}
+
+atf_test_case link
+link_head() {
+ atf_set "descr" "Tests that linking to an existing file updates" \
+ "times correctly"
+ atf_set "require.user" "root"
+}
+link_body() {
+ test_mount
+
+ echo foo >c || atf_fail "Non-empty creation failed"
+ eval $(stat -s c | sed -e 's|st_|ost_|g') || atf_fail "stat failed"
+
+ sleep 1
+ atf_check -s eq:0 -o empty -e empty ln c d
+ eval $(stat -s c) || atf_fail "stat failed"
+ [ ${st_atime} -eq ${ost_atime} ] || atf_fail "Incorrect atime"
+ [ ${st_ctime} -gt ${ost_ctime} ] || atf_fail "Incorrect ctime"
+ [ ${st_mtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime"
+
+ test_unmount
+}
+
+atf_test_case rename
+rename_head() {
+ atf_set "descr" "Tests that renaming an existing file updates" \
+ "times correctly"
+ atf_set "require.user" "root"
+}
+rename_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir e
+ echo foo >e/a || atf_fail "Creation failed"
+ eval $(stat -s e | sed -e 's|st_|dost_|g') || atf_fail "stat failed"
+ eval $(stat -s e/a | sed -e 's|st_|ost_|g') || atf_fail "stat failed"
+ sleep 1
+ atf_check -s eq:0 -o empty -e empty mv e/a e/b
+ eval $(stat -s e | sed -e 's|st_|dst_|g') || atf_fail "stat failed"
+ eval $(stat -s e/b) || atf_fail "stat failed"
+ [ ${st_atime} -eq ${ost_atime} ] || atf_fail "Incorrect atime"
+ [ ${st_ctime} -gt ${ost_ctime} ] || atf_fail "Incorrect ctime"
+ [ ${st_mtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime"
+ [ ${dst_mtime} -gt ${dost_mtime} ] || atf_fail "Incorrect mtime"
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case empty
+ atf_add_test_case non_empty
+ atf_add_test_case link
+ atf_add_test_case rename
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_trail_slash.sh b/contrib/netbsd-tests/fs/tmpfs/t_trail_slash.sh
new file mode 100755
index 0000000..df5b023
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_trail_slash.sh
@@ -0,0 +1,52 @@
+# $NetBSD: t_trail_slash.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case main
+main_head() {
+ atf_set "descr" "Verifies that trailing slashes are not stored" \
+ "in directory names and that they do not cause" \
+ "crashes"
+ atf_set "require.user" "root"
+}
+main_body() {
+ test_mount
+
+ atf_check -s eq:0 -o empty -e empty mkdir a/
+ atf_check -s eq:0 -o empty -e empty touch a/b
+ atf_check -s eq:0 -o empty -e empty test -f a/b
+ atf_check -s eq:0 -o empty -e empty rm a/b
+ atf_check -s eq:0 -o empty -e empty rmdir a/
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case main
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_truncate.sh b/contrib/netbsd-tests/fs/tmpfs/t_truncate.sh
new file mode 100755
index 0000000..2bc1902
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_truncate.sh
@@ -0,0 +1,56 @@
+# $NetBSD: t_truncate.sh,v 1.4 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Verifies that the truncate operation works"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ echo "Creating big file"
+ jot 10000 >a || atf_fail "Failed to create big file"
+ echo "Trunctaing the file to a smaller size"
+ echo foo >a || atf_fail "Failed to truncate file to a smaller size"
+ [ $(md5 a | cut -d ' ' -f 4) = d3b07384d113edec49eaa6238ad5ff00 ] || \
+ echo "Truncated file is incorrect"
+
+ echo "Truncating to zero bytes"
+ >a || atf_fail "Failed to truncate to 0"
+ echo "Truncating to zero bytes, second try"
+ >a || atf_fail "Failed to re-truncate to 0"
+
+ test_unmount
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh b/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
new file mode 100755
index 0000000..2c97fa9
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
@@ -0,0 +1,78 @@
+# $NetBSD: t_vnd.sh,v 1.8 2011/04/21 22:26:46 haad Exp $
+#
+# Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+#
+# Verifies that vnd works with files stored in tmpfs.
+#
+
+atf_test_case basic cleanup
+basic_head() {
+ atf_set "descr" "Verifies that vnd works with files stored in tmpfs"
+ atf_set "require.user" "root"
+}
+basic_body() {
+ test_mount
+
+ atf_check -s eq:0 -o ignore -e ignore \
+ dd if=/dev/zero of=disk.img bs=1m count=10
+ atf_check -s eq:0 -o empty -e empty vnconfig /dev/vnd3 disk.img
+
+ atf_check -s eq:0 -o ignore -e ignore newfs /dev/rvnd3a
+
+ atf_check -s eq:0 -o empty -e empty mkdir mnt
+ atf_check -s eq:0 -o empty -e empty mount /dev/vnd3a mnt
+
+ echo "Creating test files"
+ for f in $(jot -w %u 100 | uniq); do
+ jot 1000 >mnt/${f} || atf_fail "Failed to create file ${f}"
+ done
+
+ echo "Verifying created files"
+ for f in $(jot -w %u 100 | uniq); do
+ [ $(md5 mnt/${f} | cut -d ' ' -f 4) = \
+ 53d025127ae99ab79e8502aae2d9bea6 ] || \
+ atf_fail "Invalid checksum for file ${f}"
+ done
+
+ atf_check -s eq:0 -o empty -e empty umount mnt
+ atf_check -s eq:0 -o empty -e empty vnconfig -u /dev/vnd3
+
+ test_unmount
+ touch done
+}
+basic_cleanup() {
+ if [ ! -f done ]; then
+ umount mnt 2>/dev/null 1>&2
+ vnconfig -u /dev/vnd3 2>/dev/null 1>&2
+ fi
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/fs/tmpfs/t_vnode_leak.sh b/contrib/netbsd-tests/fs/tmpfs/t_vnode_leak.sh
new file mode 100755
index 0000000..c505ffd
--- /dev/null
+++ b/contrib/netbsd-tests/fs/tmpfs/t_vnode_leak.sh
@@ -0,0 +1,60 @@
+# $NetBSD: t_vnode_leak.sh,v 1.6 2010/11/07 17:51:18 jmmv Exp $
+#
+# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case main cleanup
+main_head() {
+ atf_set "descr" "Verifies that vnodes are not leaked and that" \
+ "their reclaim operation works as expected: i.e.," \
+ "when all free vnodes are exhausted, unused ones" \
+ "have to be recycled, which is what the reclaim" \
+ "operation does."
+ atf_set "require.user" "root"
+}
+main_body() {
+ echo "Lowering kern.maxvnodes to 2000"
+ sysctl kern.maxvnodes | awk '{ print $3; }' >oldvnodes
+ atf_check -s eq:0 -o ignore -e empty sysctl -w kern.maxvnodes=2000
+
+ test_mount -o -s$(((4000 + 2) * 4096))
+ echo "Creating 4000 directories"
+ for f in $(jot 4000); do
+ mkdir ${f}
+ done
+ test_unmount
+}
+main_cleanup() {
+ oldvnodes=$(cat oldvnodes)
+ echo "Restoring kern.maxvnodes to ${oldvnodes}"
+ sysctl -w kern.maxvnodes=${oldvnodes}
+}
+
+atf_init_test_cases() {
+ . $(atf_get_srcdir)/../h_funcs.subr
+ . $(atf_get_srcdir)/h_funcs.subr
+
+ atf_add_test_case main
+}
diff --git a/contrib/netbsd-tests/fs/umapfs/t_basic.c b/contrib/netbsd-tests/fs/umapfs/t_basic.c
new file mode 100644
index 0000000..259f6fe
--- /dev/null
+++ b/contrib/netbsd-tests/fs/umapfs/t_basic.c
@@ -0,0 +1,145 @@
+/* $NetBSD: t_basic.c,v 1.4 2010/07/19 15:35:39 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+#include <rump/rumpvfs_if_pub.h>
+
+#include <fs/tmpfs/tmpfs_args.h>
+#include <miscfs/umapfs/umap.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(basic);
+ATF_TC_HEAD(basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "basic umapfs mapping");
+}
+
+static void
+xtouch(const char *path)
+{
+ int fd;
+
+ fd = rump_sys_open(path, O_CREAT | O_RDWR, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create %s", path);
+ rump_sys_close(fd);
+}
+
+static void
+xchown(const char *path, uid_t uid, gid_t gid)
+{
+
+ if (rump_sys_chown(path, uid, gid) == -1)
+ atf_tc_fail_errno("chown %s failed", path);
+}
+
+static void
+testuidgid(const char *path, uid_t uid, gid_t gid)
+{
+ struct stat sb;
+
+ if (rump_sys_stat(path, &sb) == -1)
+ atf_tc_fail_errno("stat %s", path);
+ if (uid != (uid_t)-1) {
+ if (sb.st_uid != uid)
+ atf_tc_fail("%s: expected uid %d, got %d",
+ path, uid, sb.st_uid);
+ }
+ if (gid != (gid_t)-1) {
+ if (sb.st_gid != gid)
+ atf_tc_fail("%s: expected gid %d, got %d",
+ path, gid, sb.st_gid);
+ }
+}
+
+ATF_TC_BODY(basic, tc)
+{
+ struct umap_args umargs;
+ struct tmpfs_args targs;
+ u_long umaps[2][2];
+ u_long gmaps[2][2];
+
+ rump_init();
+ if (rump_sys_mkdir("/td1", 0777) == -1)
+ atf_tc_fail_errno("mp1");
+ if (rump_sys_mkdir("/td2", 0777) == -1)
+ atf_tc_fail_errno("mp1");
+
+ /* use tmpfs because rumpfs doesn't support ownership */
+ memset(&targs, 0, sizeof(targs));
+ targs.ta_version = TMPFS_ARGS_VERSION;
+ targs.ta_root_mode = 0777;
+ if (rump_sys_mount(MOUNT_TMPFS, "/td1", 0, &targs, sizeof(targs)) == -1)
+ atf_tc_fail_errno("could not mount tmpfs td1");
+
+ memset(&umargs, 0, sizeof(umargs));
+
+ /*
+ * Map td1 uid 555 to td2 uid 777 (yes, IMHO the umapfs
+ * mapping format is counter-intuitive).
+ */
+ umaps[0][0] = 777;
+ umaps[0][1] = 555;
+ umaps[1][0] = 0;
+ umaps[1][1] = 0;
+ gmaps[0][0] = 4321;
+ gmaps[0][1] = 1234;
+ gmaps[1][0] = 0;
+ gmaps[1][1] = 0;
+
+ umargs.umap_target = __UNCONST("/td1");
+ umargs.nentries = 2;
+ umargs.gnentries = 2;
+ umargs.mapdata = umaps;
+ umargs.gmapdata = gmaps;
+
+ if (rump_sys_mount(MOUNT_UMAP, "/td2", 0, &umargs,sizeof(umargs)) == -1)
+ atf_tc_fail_errno("could not mount umapfs");
+
+ xtouch("/td1/noch");
+ testuidgid("/td1/noch", 0, 0);
+ testuidgid("/td2/noch", 0, 0);
+
+ xtouch("/td1/nomap");
+ xchown("/td1/nomap", 1, 2);
+ testuidgid("/td1/nomap", 1, 2);
+ testuidgid("/td2/nomap", -1, -1);
+
+ xtouch("/td1/forwmap");
+ xchown("/td1/forwmap", 555, 1234);
+ testuidgid("/td1/forwmap", 555, 1234);
+ testuidgid("/td2/forwmap", 777, 4321);
+
+ /*
+ * this *CANNOT* be correct???
+ */
+ xtouch("/td1/revmap");
+ /*
+ * should be 777 / 4321 (?), but makes first test fail since
+ * it gets 777 / 4321, i.e. unmapped results.
+ */
+ xchown("/td2/revmap", 555, 1234);
+ testuidgid("/td1/revmap", 555, 1234);
+ testuidgid("/td2/revmap", 777, 4321);
+
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, basic);
+ return 0; /*XXX?*/
+}
diff --git a/contrib/netbsd-tests/fs/union/t_pr.c b/contrib/netbsd-tests/fs/union/t_pr.c
new file mode 100644
index 0000000..2d0c0c8
--- /dev/null
+++ b/contrib/netbsd-tests/fs/union/t_pr.c
@@ -0,0 +1,130 @@
+/* $NetBSD: t_pr.c,v 1.8 2011/08/10 06:27:02 hannken Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <miscfs/union/union.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(multilayer);
+ATF_TC_HEAD(multilayer, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "mount_union -b twice");
+}
+
+ATF_TC_BODY(multilayer, tc)
+{
+ struct union_args unionargs;
+
+ rump_init();
+
+ if (rump_sys_mkdir("/Tunion", 0777) == -1)
+ atf_tc_fail_errno("mkdir mp1");
+ if (rump_sys_mkdir("/Tunion2", 0777) == -1)
+ atf_tc_fail_errno("mkdir mp2");
+ if (rump_sys_mkdir("/Tunion2/A", 0777) == -1)
+ atf_tc_fail_errno("mkdir A");
+ if (rump_sys_mkdir("/Tunion2/B", 0777) == -1)
+ atf_tc_fail_errno("mkdir B");
+
+ unionargs.target = __UNCONST("/Tunion2/A");
+ unionargs.mntflags = UNMNT_BELOW;
+
+ if (rump_sys_mount(MOUNT_UNION, "/Tunion", 0,
+ &unionargs, sizeof(unionargs)) == -1)
+ atf_tc_fail_errno("union mount");
+
+ unionargs.target = __UNCONST("/Tunion2/B");
+ unionargs.mntflags = UNMNT_BELOW;
+
+ rump_sys_mount(MOUNT_UNION, "/Tunion", 0,&unionargs,sizeof(unionargs));
+}
+
+ATF_TC(devnull1);
+ATF_TC_HEAD(devnull1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "mount_union -b and "
+ "'echo x > /un/null'");
+}
+
+ATF_TC_BODY(devnull1, tc)
+{
+ struct union_args unionargs;
+ int fd, res;
+
+ rump_init();
+
+ if (rump_sys_mkdir("/mp", 0777) == -1)
+ atf_tc_fail_errno("mkdir mp");
+
+ unionargs.target = __UNCONST("/dev");
+ unionargs.mntflags = UNMNT_BELOW;
+
+ if (rump_sys_mount(MOUNT_UNION, "/mp", 0,
+ &unionargs, sizeof(unionargs)) == -1)
+ atf_tc_fail_errno("union mount");
+
+ fd = rump_sys_open("/mp/null", O_WRONLY | O_CREAT | O_TRUNC);
+
+ if (fd == -1)
+ atf_tc_fail_errno("open");
+
+ res = rump_sys_write(fd, &fd, sizeof(fd));
+ if (res != sizeof(fd))
+ atf_tc_fail("write");
+}
+
+ATF_TC(devnull2);
+ATF_TC_HEAD(devnull2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "mount_union -b and "
+ "'echo x >> /un/null'");
+}
+
+ATF_TC_BODY(devnull2, tc)
+{
+ struct union_args unionargs;
+ int fd, res;
+
+ rump_init();
+
+ if (rump_sys_mkdir("/mp", 0777) == -1)
+ atf_tc_fail_errno("mkdir mp");
+
+ unionargs.target = __UNCONST("/dev");
+ unionargs.mntflags = UNMNT_BELOW;
+
+ if (rump_sys_mount(MOUNT_UNION, "/mp", 0,
+ &unionargs, sizeof(unionargs)) == -1)
+ atf_tc_fail_errno("union mount");
+
+ fd = rump_sys_open("/mp/null", O_WRONLY | O_CREAT | O_APPEND);
+ if (fd == -1)
+ atf_tc_fail_errno("open");
+
+ res = rump_sys_write(fd, &fd, sizeof(fd));
+ if (res != sizeof(fd))
+ atf_tc_fail("write");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, multilayer);
+ ATF_TP_ADD_TC(tp, devnull1);
+ ATF_TP_ADD_TC(tp, devnull2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/vfs/t_full.c b/contrib/netbsd-tests/fs/vfs/t_full.c
new file mode 100644
index 0000000..f338a02
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_full.c
@@ -0,0 +1,101 @@
+/* $NetBSD: t_full.c,v 1.8 2013/03/16 05:45:37 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/stat.h>
+#include <sys/statvfs.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rump.h>
+
+#include "../common/h_fsmacros.h"
+#include "../../h_macros.h"
+
+/*
+ * Write this much over the image size. This is to force an NFS commit,
+ * since we might just stuff data into the cache and miss the problem.
+ */
+#define NFSBONUS (1<<16)
+
+static void
+fillfs(const atf_tc_t *tc, const char *mp)
+{
+ char buf[8192];
+ size_t written;
+ ssize_t n = 0; /* xxxgcc */
+ size_t bonus;
+ int fd, i = 0;
+
+ if (FSTYPE_P2K_FFS(tc) || FSTYPE_PUFFS(tc) || FSTYPE_RUMPFS(tc)) {
+ atf_tc_skip("fs does not support explicit block allocation "
+ "(GOP_ALLOC)");
+ }
+
+ bonus = 0;
+ if (FSTYPE_NFS(tc))
+ bonus = NFSBONUS;
+
+ if (rump_sys_chdir(mp) == -1)
+ atf_tc_fail_errno("chdir mountpoint");
+ fd = rump_sys_open("afile", O_CREAT | O_RDWR);
+ if (fd == -1)
+ atf_tc_fail_errno("create file");
+
+ for (written = 0; written < FSTEST_IMGSIZE + bonus; written +=n) {
+ memset(buf, i++, sizeof(buf)); /* known garbage */
+ n = rump_sys_write(fd, buf, sizeof(buf));
+ if (n == -1)
+ break;
+ }
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ if (n == -1) {
+ if (errno != ENOSPC)
+ atf_tc_fail_errno("write");
+ } else {
+ atf_tc_fail("filled file system over size limit");
+ }
+
+ rump_sys_close(fd);
+ rump_sys_chdir("/");
+}
+
+ATF_TC_FSAPPLY(fillfs, "fills file system, expects ENOSPC");
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_FSAPPLY(fillfs);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/vfs/t_io.c b/contrib/netbsd-tests/fs/vfs/t_io.c
new file mode 100644
index 0000000..67d8657
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_io.c
@@ -0,0 +1,250 @@
+/* $NetBSD: t_io.c,v 1.12 2013/08/04 11:02:02 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/stat.h>
+#include <sys/statvfs.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rump.h>
+
+#include "../common/h_fsmacros.h"
+#include "../../h_macros.h"
+
+#define TESTSTR "this is a string. collect enough and you'll have Em"
+#define TESTSZ sizeof(TESTSTR)
+
+static void
+holywrite(const atf_tc_t *tc, const char *mp)
+{
+ char buf[1024];
+ char *b2, *b3;
+ size_t therange = getpagesize()+1;
+ int fd;
+
+ FSTEST_ENTER();
+
+ RL(fd = rump_sys_open("file", O_RDWR|O_CREAT|O_TRUNC, 0666));
+
+ memset(buf, 'A', sizeof(buf));
+ RL(rump_sys_pwrite(fd, buf, 1, getpagesize()));
+
+ memset(buf, 'B', sizeof(buf));
+ RL(rump_sys_pwrite(fd, buf, 2, getpagesize()-1));
+
+ REQUIRE_LIBC(b2 = malloc(2 * getpagesize()), NULL);
+ REQUIRE_LIBC(b3 = malloc(2 * getpagesize()), NULL);
+
+ RL(rump_sys_pread(fd, b2, therange, 0));
+
+ memset(b3, 0, therange);
+ memset(b3 + getpagesize() - 1, 'B', 2);
+
+ ATF_REQUIRE_EQ(memcmp(b2, b3, therange), 0);
+
+ rump_sys_close(fd);
+ FSTEST_EXIT();
+}
+
+static void
+extendbody(const atf_tc_t *tc, off_t seekcnt)
+{
+ char buf[TESTSZ+1];
+ struct stat sb;
+ int fd;
+
+ FSTEST_ENTER();
+ RL(fd = rump_sys_open("testfile",
+ O_CREAT | O_RDWR | (seekcnt ? O_APPEND : 0)));
+ RL(rump_sys_ftruncate(fd, seekcnt));
+ RL(rump_sys_fstat(fd, &sb));
+ ATF_REQUIRE_EQ(sb.st_size, seekcnt);
+
+ ATF_REQUIRE_EQ(rump_sys_write(fd, TESTSTR, TESTSZ), TESTSZ);
+ ATF_REQUIRE_EQ(rump_sys_pread(fd, buf, TESTSZ, seekcnt), TESTSZ);
+ ATF_REQUIRE_STREQ(buf, TESTSTR);
+
+ RL(rump_sys_fstat(fd, &sb));
+ ATF_REQUIRE_EQ(sb.st_size, (off_t)TESTSZ + seekcnt);
+ RL(rump_sys_close(fd));
+ FSTEST_EXIT();
+}
+
+static void
+extendfile(const atf_tc_t *tc, const char *mp)
+{
+
+ extendbody(tc, 0);
+}
+
+static void
+extendfile_append(const atf_tc_t *tc, const char *mp)
+{
+
+ extendbody(tc, 37);
+}
+
+static void
+overwritebody(const atf_tc_t *tc, off_t count, bool dotrunc)
+{
+ char *buf;
+ int fd;
+
+ REQUIRE_LIBC(buf = malloc(count), NULL);
+ FSTEST_ENTER();
+ RL(fd = rump_sys_open("testi", O_CREAT | O_RDWR, 0666));
+ ATF_REQUIRE_EQ(rump_sys_write(fd, buf, count), count);
+ RL(rump_sys_close(fd));
+
+ RL(fd = rump_sys_open("testi", O_RDWR));
+ if (dotrunc)
+ RL(rump_sys_ftruncate(fd, 0));
+ ATF_REQUIRE_EQ(rump_sys_write(fd, buf, count), count);
+ RL(rump_sys_close(fd));
+ FSTEST_EXIT();
+}
+
+static void
+overwrite512(const atf_tc_t *tc, const char *mp)
+{
+
+ overwritebody(tc, 512, false);
+}
+
+static void
+overwrite64k(const atf_tc_t *tc, const char *mp)
+{
+
+ overwritebody(tc, 1<<16, false);
+}
+
+static void
+overwrite_trunc(const atf_tc_t *tc, const char *mp)
+{
+
+ overwritebody(tc, 1<<16, true);
+}
+
+static void
+shrinkfile(const atf_tc_t *tc, const char *mp)
+{
+ int fd;
+
+ FSTEST_ENTER();
+ RL(fd = rump_sys_open("file", O_RDWR|O_CREAT|O_TRUNC, 0666));
+ RL(rump_sys_ftruncate(fd, 2));
+ RL(rump_sys_ftruncate(fd, 1));
+ rump_sys_close(fd);
+ FSTEST_EXIT();
+}
+
+#define TBSIZE 9000
+static void
+read_after_unlink(const atf_tc_t *tc, const char *mp)
+{
+ char buf[TBSIZE], buf2[TBSIZE];
+ int fd;
+
+ FSTEST_ENTER();
+
+ /* create file and put some content into it */
+ RL(fd = rump_sys_open("file", O_RDWR|O_CREAT, 0666));
+ memset(buf, 'D', TBSIZE);
+ ATF_REQUIRE_EQ(rump_sys_write(fd, buf, TBSIZE), TBSIZE);
+ rump_sys_close(fd);
+
+ /* flush buffers from UBC to file system */
+ ATF_REQUIRE_ERRNO(EBUSY, rump_sys_unmount(mp, 0) == -1);
+
+ RL(fd = rump_sys_open("file", O_RDWR));
+ RL(rump_sys_unlink("file"));
+
+ ATF_REQUIRE_EQ(rump_sys_read(fd, buf2, TBSIZE), TBSIZE);
+ ATF_REQUIRE_EQ(memcmp(buf, buf2, TBSIZE), 0);
+ rump_sys_close(fd);
+
+ FSTEST_EXIT();
+}
+
+static void
+wrrd_after_unlink(const atf_tc_t *tc, const char *mp)
+{
+ int value = 0x11;
+ int v2;
+ int fd;
+
+ FSTEST_ENTER();
+
+ RL(fd = rump_sys_open("file", O_RDWR|O_CREAT, 0666));
+ RL(rump_sys_unlink("file"));
+
+ RL(rump_sys_pwrite(fd, &value, sizeof(value), 654321));
+
+ /*
+ * We can't easily invalidate the buffer since we hold a
+ * reference, but try to get them to flush anyway.
+ */
+ RL(rump_sys_fsync(fd));
+ RL(rump_sys_pread(fd, &v2, sizeof(v2), 654321));
+ rump_sys_close(fd);
+
+ ATF_REQUIRE_EQ(value, v2);
+ FSTEST_EXIT();
+}
+
+ATF_TC_FSAPPLY(holywrite, "create a sparse file and fill hole");
+ATF_TC_FSAPPLY(extendfile, "check that extending a file works");
+ATF_TC_FSAPPLY(extendfile_append, "check that extending a file works "
+ "with a append-only fd (PR kern/44307)");
+ATF_TC_FSAPPLY(overwrite512, "write a 512 byte file twice");
+ATF_TC_FSAPPLY(overwrite64k, "write a 64k byte file twice");
+ATF_TC_FSAPPLY(overwrite_trunc, "write 64k + truncate + rewrite");
+ATF_TC_FSAPPLY(shrinkfile, "shrink file");
+ATF_TC_FSAPPLY(read_after_unlink, "contents can be read off disk after unlink");
+ATF_TC_FSAPPLY(wrrd_after_unlink, "file can be written and read after unlink");
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_FSAPPLY(holywrite);
+ ATF_TP_FSAPPLY(extendfile);
+ ATF_TP_FSAPPLY(extendfile_append);
+ ATF_TP_FSAPPLY(overwrite512);
+ ATF_TP_FSAPPLY(overwrite64k);
+ ATF_TP_FSAPPLY(overwrite_trunc);
+ ATF_TP_FSAPPLY(shrinkfile);
+ ATF_TP_FSAPPLY(read_after_unlink);
+ ATF_TP_FSAPPLY(wrrd_after_unlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/vfs/t_renamerace.c b/contrib/netbsd-tests/fs/vfs/t_renamerace.c
new file mode 100644
index 0000000..70e02f3
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_renamerace.c
@@ -0,0 +1,190 @@
+/* $NetBSD: t_renamerace.c,v 1.32 2014/07/29 09:15:48 gson Exp $ */
+
+/*
+ * Modified for rump and atf from a program supplied
+ * by Nicolas Joly in kern/40948
+ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/utsname.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+/* Bump the size of the test file system image to a larger value.
+ *
+ * These tests cause a lot of churn in the file system by creating and
+ * deleting files/directories in quick succession. A faster CPU will cause
+ * more churn because the tests are capped by a run time period in seconds,
+ * not number of operations.
+ *
+ * This is all fine except for LFS, because the lfs_cleanerd cannot keep up
+ * with the churn and thus causes the test to fail on fast machines. Hence
+ * the reason for this hack. */
+#define FSTEST_IMGSIZE (50000 * 512)
+
+#include "../common/h_fsmacros.h"
+#include "../../h_macros.h"
+
+static volatile int quittingtime;
+pid_t wrkpid;
+
+static void *
+w1(void *arg)
+{
+ int fd;
+
+ rump_pub_lwproc_newlwp(wrkpid);
+
+ while (!quittingtime) {
+ fd = rump_sys_open("rename.test1",
+ O_WRONLY|O_CREAT|O_TRUNC, 0666);
+ if (fd == -1 && errno != EEXIST)
+ atf_tc_fail_errno("create");
+ rump_sys_unlink("rename.test1");
+ rump_sys_close(fd);
+ }
+
+ return NULL;
+}
+
+static void *
+w1_dirs(void *arg)
+{
+
+ rump_pub_lwproc_newlwp(wrkpid);
+
+ while (!quittingtime) {
+ if (rump_sys_mkdir("rename.test1", 0777) == -1)
+ atf_tc_fail_errno("mkdir");
+ rump_sys_rmdir("rename.test1");
+ }
+
+ return NULL;
+}
+
+static void *
+w2(void *arg)
+{
+
+ rump_pub_lwproc_newlwp(wrkpid);
+
+ while (!quittingtime) {
+ rump_sys_rename("rename.test1", "rename.test2");
+ }
+
+ return NULL;
+}
+
+#define NWRK 8
+static void
+renamerace(const atf_tc_t *tc, const char *mp)
+{
+ pthread_t pt1[NWRK], pt2[NWRK];
+ int i;
+
+ /*
+ * Sysvbfs supports only 8 inodes so this test would exhaust
+ * the inode table and creating files would fail with ENOSPC.
+ */
+ if (FSTYPE_SYSVBFS(tc))
+ atf_tc_skip("filesystem has not enough inodes");
+ if (FSTYPE_RUMPFS(tc))
+ atf_tc_skip("rename not supported by file system");
+ if (FSTYPE_UDF(tc))
+ atf_tc_expect_fail("PR kern/49046");
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ RL(wrkpid = rump_sys_getpid());
+
+ RL(rump_sys_chdir(mp));
+ for (i = 0; i < NWRK; i++)
+ pthread_create(&pt1[i], NULL, w1, NULL);
+
+ for (i = 0; i < NWRK; i++)
+ pthread_create(&pt2[i], NULL, w2, NULL);
+
+ sleep(5);
+ quittingtime = 1;
+
+ for (i = 0; i < NWRK; i++)
+ pthread_join(pt1[i], NULL);
+ for (i = 0; i < NWRK; i++)
+ pthread_join(pt2[i], NULL);
+ RL(rump_sys_chdir("/"));
+
+ if (FSTYPE_UDF(tc))
+ atf_tc_fail("race did not trigger this time");
+
+ if (FSTYPE_MSDOS(tc)) {
+ atf_tc_expect_fail("PR kern/44661");
+ /*
+ * XXX: race does not trigger every time at least
+ * on amd64/qemu.
+ */
+ if (msdosfs_fstest_unmount(tc, mp, 0) != 0) {
+ rump_pub_vfs_mount_print(mp, 1);
+ atf_tc_fail_errno("unmount failed");
+ }
+ atf_tc_fail("race did not trigger this time");
+ }
+}
+
+static void
+renamerace_dirs(const atf_tc_t *tc, const char *mp)
+{
+ pthread_t pt1, pt2;
+
+ if (FSTYPE_SYSVBFS(tc))
+ atf_tc_skip("directories not supported by file system");
+
+ if (FSTYPE_RUMPFS(tc))
+ atf_tc_skip("rename not supported by file system");
+
+ /* XXX: msdosfs also sometimes hangs */
+ if (FSTYPE_MSDOS(tc))
+ atf_tc_expect_signal(-1, "PR kern/43626");
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ RL(wrkpid = rump_sys_getpid());
+
+ RL(rump_sys_chdir(mp));
+ pthread_create(&pt1, NULL, w1_dirs, NULL);
+ pthread_create(&pt2, NULL, w2, NULL);
+
+ sleep(5);
+ quittingtime = 1;
+
+ pthread_join(pt1, NULL);
+ pthread_join(pt2, NULL);
+ RL(rump_sys_chdir("/"));
+
+ /*
+ * Doesn't always trigger when run on a slow backend
+ * (i.e. not on tmpfs/mfs). So do the usual kludge.
+ */
+ if (FSTYPE_MSDOS(tc))
+ abort();
+}
+
+ATF_TC_FSAPPLY(renamerace, "rename(2) race with file unlinked mid-operation");
+ATF_TC_FSAPPLY(renamerace_dirs, "rename(2) race with directories");
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_FSAPPLY(renamerace); /* PR kern/41128 */
+ ATF_TP_FSAPPLY(renamerace_dirs);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/vfs/t_rmdirrace.c b/contrib/netbsd-tests/fs/vfs/t_rmdirrace.c
new file mode 100644
index 0000000..839dbad
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_rmdirrace.c
@@ -0,0 +1,106 @@
+/* $NetBSD: t_rmdirrace.c,v 1.9 2012/02/16 02:47:56 perseant Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rump.h>
+
+#include "../common/h_fsmacros.h"
+
+#define DIRNAME "rmdir.test"
+
+static void *func1(void *arg)
+{
+
+ while (*(int *)arg != 1)
+ rump_sys_mkdir(DIRNAME, 0755);
+
+ return NULL;
+}
+
+static void *func2(void *arg)
+{
+
+ while (*(int *)arg != 1)
+ rump_sys_rmdir(DIRNAME);
+
+ return NULL;
+}
+
+static void
+race(const atf_tc_t *tc, const char *path)
+{
+ int res, fd, quit;
+ pthread_t th1, th2;
+
+ if (FSTYPE_SYSVBFS(tc))
+ atf_tc_skip("directories not supported by file system");
+
+ fd = rump_sys_open(".", O_RDONLY, 0666);
+ if (fd == -1)
+ atf_tc_fail("open failed");
+ res = rump_sys_chdir(path);
+ if (res == -1)
+ atf_tc_fail("chdir failed");
+
+ quit = 0;
+
+ res = pthread_create(&th1, NULL, func1, &quit);
+ if (res != 0)
+ atf_tc_fail("pthread_create1 failed");
+ res = pthread_create(&th2, NULL, func2, &quit);
+ if (res != 0)
+ atf_tc_fail("pthread_create2 failed");
+
+ sleep(10);
+
+ quit = 1;
+
+ res = pthread_join(th2, NULL);
+ if (res != 0)
+ atf_tc_fail("pthread_join2 failed");
+ res = pthread_join(th1, NULL);
+ if (res != 0)
+ atf_tc_fail("pthread_join1 failed");
+
+ res = rump_sys_fchdir(fd);
+ if (res == -1)
+ atf_tc_fail("fchdir failed");
+}
+
+ATF_FSAPPLY(race, "rmdir(2) race");
diff --git a/contrib/netbsd-tests/fs/vfs/t_ro.c b/contrib/netbsd-tests/fs/vfs/t_ro.c
new file mode 100644
index 0000000..b1e1179
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_ro.c
@@ -0,0 +1,203 @@
+/* $NetBSD: t_ro.c,v 1.5 2011/02/22 21:23:19 yamt Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/stat.h>
+#include <sys/statvfs.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rump.h>
+
+#include "../common/h_fsmacros.h"
+#include "../../h_macros.h"
+
+#define AFILE "testfile"
+#define ADIR "testdir"
+#define AFIFO "testfifo"
+#define ASYMLINK "testsymlink"
+#define ALINK "testlink"
+#define FUNTEXT "this is some non-humppa text"
+#define FUNSIZE (sizeof(FUNTEXT)-1)
+
+static void
+nullgen(const atf_tc_t *tc, const char *mp)
+{
+
+ return;
+}
+
+static void
+filegen(const atf_tc_t *tc, const char *mp)
+{
+ int fd;
+
+ FSTEST_ENTER();
+ RL(fd = rump_sys_open(AFILE, O_CREAT | O_RDWR, 0777));
+ ATF_REQUIRE_EQ(rump_sys_write(fd, FUNTEXT, FUNSIZE), FUNSIZE);
+ RL(rump_sys_close(fd));
+ FSTEST_EXIT();
+}
+
+/*
+ *
+ * BEGIN tests
+ *
+ */
+
+static void
+create(const atf_tc_t *tc, const char *mp)
+{
+
+ FSTEST_ENTER();
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_open(AFILE, O_CREAT|O_RDONLY) == -1);
+ FSTEST_EXIT();
+}
+
+static void
+rmfile(const atf_tc_t *tc, const char *mp)
+{
+
+ FSTEST_ENTER();
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_unlink(AFILE) == -1);
+ FSTEST_EXIT();
+}
+
+static void
+fileio(const atf_tc_t *tc, const char *mp)
+{
+ int fd;
+ char buf[FUNSIZE+1];
+ int expected;
+
+ if (FSTYPE_NFSRO(tc))
+ expected = EACCES;
+ else
+ expected = EROFS;
+
+ FSTEST_ENTER();
+ RL(fd = rump_sys_open(AFILE, O_RDONLY));
+ ATF_REQUIRE_EQ(rump_sys_read(fd, buf, FUNSIZE), FUNSIZE);
+ buf[FUNSIZE] = '\0';
+ ATF_REQUIRE_STREQ(buf, FUNTEXT);
+ RL(rump_sys_close(fd));
+
+ ATF_REQUIRE_ERRNO(expected, rump_sys_open(AFILE, O_WRONLY) == -1);
+ ATF_REQUIRE_ERRNO(expected, rump_sys_open(AFILE, O_RDWR) == -1);
+ FSTEST_EXIT();
+}
+
+static void
+attrs(const atf_tc_t *tc, const char *mp)
+{
+ struct timeval sometvs[2];
+ struct stat sb;
+ int fd;
+
+ FSTEST_ENTER();
+
+ RL(rump_sys_stat(AFILE, &sb));
+
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_chmod(AFILE, 0775) == -1);
+ if (!FSTYPE_MSDOS(tc))
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_chown(AFILE, 1, 1) == -1);
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_utimes(AFILE, sometvs) == -1);
+
+ RL(fd = rump_sys_open(AFILE, O_RDONLY));
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_fchmod(fd, 0775) == -1);
+ if (!FSTYPE_MSDOS(tc))
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_fchown(fd, 1, 1) == -1);
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_futimes(fd, sometvs) == -1);
+ RL(rump_sys_close(fd));
+
+ FSTEST_EXIT();
+}
+
+static void
+createdir(const atf_tc_t *tc, const char *mp)
+{
+
+ FSTEST_ENTER();
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_mkdir(ADIR, 0775) == -1);
+ FSTEST_EXIT();
+}
+
+static void
+createfifo(const atf_tc_t *tc, const char *mp)
+{
+
+ FSTEST_ENTER();
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_mkfifo(AFIFO, 0775) == -1);
+ FSTEST_EXIT();
+}
+
+static void
+createsymlink(const atf_tc_t *tc, const char *mp)
+{
+
+ FSTEST_ENTER();
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_symlink("hoge", ASYMLINK) == -1);
+ FSTEST_EXIT();
+}
+
+static void
+createlink(const atf_tc_t *tc, const char *mp)
+{
+
+ FSTEST_ENTER();
+ ATF_REQUIRE_ERRNO(EROFS, rump_sys_link(AFILE, ALINK) == -1);
+ FSTEST_EXIT();
+}
+
+ATF_TC_FSAPPLY_RO(create, "create file on r/o mount", nullgen);
+ATF_TC_FSAPPLY_RO(rmfile, "remove file from r/o mount", filegen);
+ATF_TC_FSAPPLY_RO(fileio, "can read a file but not write it", filegen);
+ATF_TC_FSAPPLY_RO(attrs, "can query but not change attributes", filegen);
+ATF_TC_FSAPPLY_RO(createdir, "create directory on r/o mount", nullgen);
+ATF_TC_FSAPPLY_RO(createfifo, "create fifo on r/o mount", nullgen);
+ATF_TC_FSAPPLY_RO(createsymlink, "create symlink on r/o mount", nullgen);
+ATF_TC_FSAPPLY_RO(createlink, "create hardlink on r/o mount", filegen);
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_FSAPPLY_RO(create);
+ ATF_TP_FSAPPLY_RO(rmfile);
+ ATF_TP_FSAPPLY_RO(fileio);
+ ATF_TP_FSAPPLY_RO(attrs);
+ ATF_TP_FSAPPLY_RO(createdir);
+ ATF_TP_FSAPPLY_RO(createfifo);
+ ATF_TP_FSAPPLY_RO(createsymlink);
+ ATF_TP_FSAPPLY_RO(createlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/vfs/t_union.c b/contrib/netbsd-tests/fs/vfs/t_union.c
new file mode 100644
index 0000000..bdcef93
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_union.c
@@ -0,0 +1,204 @@
+/* $NetBSD: t_union.c,v 1.8 2011/08/07 06:01:51 hannken Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <miscfs/union/union.h>
+
+#include "../../h_macros.h"
+#include "../common/h_fsmacros.h"
+
+#define MSTR "magic bus"
+
+static void
+xput_tfile(const char *mp, const char *path)
+{
+ char pathb[MAXPATHLEN];
+ int fd;
+
+ strcpy(pathb, mp);
+ strcat(pathb, "/");
+ strcat(pathb, path);
+
+ RL(fd = rump_sys_open(pathb, O_CREAT | O_RDWR, 0777));
+ if (rump_sys_write(fd, MSTR, sizeof(MSTR)) != sizeof(MSTR))
+ atf_tc_fail_errno("write to testfile");
+ RL(rump_sys_close(fd));
+}
+
+static int
+xread_tfile(const char *mp, const char *path)
+{
+ char pathb[MAXPATHLEN];
+ char buf[128];
+ int fd;
+
+ strcpy(pathb, mp);
+ strcat(pathb, "/");
+ strcat(pathb, path);
+
+ fd = rump_sys_open(pathb, O_RDONLY);
+ if (fd == -1)
+ return errno;
+ if (rump_sys_read(fd, buf, sizeof(buf)) == -1)
+ atf_tc_fail_errno("read tfile");
+ RL(rump_sys_close(fd));
+ if (strcmp(buf, MSTR) == 0)
+ return 0;
+ return EPROGMISMATCH;
+}
+
+/*
+ * Mount a unionfs for testing. Before calling, "mp" contains
+ * the upper layer. Lowerpath is constructed so that the directory
+ * contains rumpfs.
+ */
+static void
+mountunion(const char *mp, char *lowerpath)
+{
+ struct union_args unionargs;
+
+ sprintf(lowerpath, "/lower");
+ rump_sys_mkdir(lowerpath, 0777);
+
+ /* mount the union with our testfs as the upper layer */
+ memset(&unionargs, 0, sizeof(unionargs));
+ unionargs.target = lowerpath;
+ unionargs.mntflags = UNMNT_BELOW;
+
+ if (rump_sys_mount(MOUNT_UNION, mp, 0,
+ &unionargs, sizeof(unionargs)) == -1) {
+ if (errno == EOPNOTSUPP) {
+ atf_tc_skip("fs does not support VOP_WHITEOUT");
+ } else {
+ atf_tc_fail_errno("union mount");
+ }
+ }
+}
+
+#if 0
+static void
+toggleroot(void)
+{
+ static int status;
+
+ status ^= MNT_RDONLY;
+
+ printf("0x%x\n", status);
+ RL(rump_sys_mount(MOUNT_RUMPFS, "/", status | MNT_UPDATE, NULL, 0));
+}
+#endif
+
+#define TFILE "tensti"
+#define TDIR "testdir"
+#define TDFILE TDIR "/indir"
+
+static void
+basic(const atf_tc_t *tc, const char *mp)
+{
+ char lowerpath[MAXPATHLEN];
+ char dbuf[8192];
+ struct stat sb;
+ struct dirent *dp;
+ int error, fd, dsize;
+
+ mountunion(mp, lowerpath);
+
+ /* create a file in the lower layer */
+ xput_tfile(lowerpath, TFILE);
+
+ /* first, test we can read the old file from the new namespace */
+ error = xread_tfile(mp, TFILE);
+ if (error != 0)
+ atf_tc_fail("union compare failed: %d (%s)",
+ error, strerror(error));
+
+ /* then, test upper layer writes don't affect the lower layer */
+ xput_tfile(mp, "kiekko");
+ if ((error = xread_tfile(lowerpath, "kiekko")) != ENOENT)
+ atf_tc_fail("invisibility failed: %d (%s)",
+ error, strerror(error));
+
+ /* check that we can whiteout stuff in the upper layer */
+ FSTEST_ENTER();
+ RL(rump_sys_unlink(TFILE));
+ ATF_REQUIRE_ERRNO(ENOENT, rump_sys_stat(TFILE, &sb) == -1);
+ FSTEST_EXIT();
+
+ /* check that the removed node is not in the directory listing */
+ RL(fd = rump_sys_open(mp, O_RDONLY));
+ RL(dsize = rump_sys_getdents(fd, dbuf, sizeof(dbuf)));
+ for (dp = (struct dirent *)dbuf;
+ (char *)dp < dbuf + dsize;
+ dp = _DIRENT_NEXT(dp)) {
+ if (strcmp(dp->d_name, TFILE) == 0 && dp->d_type != DT_WHT)
+ atf_tc_fail("removed file non-white-outed");
+ }
+ RL(rump_sys_close(fd));
+
+ RL(rump_sys_unmount(mp, 0));
+}
+
+static void
+whiteout(const atf_tc_t *tc, const char *mp)
+{
+ char lower[MAXPATHLEN];
+ struct stat sb;
+ void *fsarg;
+
+ /*
+ * XXX: use ffs here to make sure any screwups in rumpfs don't
+ * affect the test
+ */
+ RL(ffs_fstest_newfs(tc, &fsarg, "daimage", 1024*1024*5, NULL));
+ RL(ffs_fstest_mount(tc, fsarg, "/lower", 0));
+
+ /* create a file in the lower layer */
+ RL(rump_sys_chdir("/lower"));
+ RL(rump_sys_mkdir(TDIR, 0777));
+ RL(rump_sys_mkdir(TDFILE, 0777));
+ RL(rump_sys_chdir("/"));
+
+ RL(ffs_fstest_unmount(tc, "/lower", 0));
+ RL(ffs_fstest_mount(tc, fsarg, "/lower", MNT_RDONLY));
+
+ mountunion(mp, lower);
+
+ FSTEST_ENTER();
+ ATF_REQUIRE_ERRNO(ENOTEMPTY, rump_sys_rmdir(TDIR) == -1);
+ RL(rump_sys_rmdir(TDFILE));
+ RL(rump_sys_rmdir(TDIR));
+ ATF_REQUIRE_ERRNO(ENOENT, rump_sys_stat(TDFILE, &sb) == -1);
+ ATF_REQUIRE_ERRNO(ENOENT, rump_sys_stat(TDIR, &sb) == -1);
+
+ RL(rump_sys_mkdir(TDIR, 0777));
+ RL(rump_sys_stat(TDIR, &sb));
+ ATF_REQUIRE_ERRNO(ENOENT, rump_sys_stat(TDFILE, &sb) == -1);
+ FSTEST_EXIT();
+
+ RL(rump_sys_unmount(mp, 0));
+}
+
+ATF_TC_FSAPPLY(basic, "check basic union functionality");
+ATF_TC_FSAPPLY(whiteout, "create whiteout in upper layer");
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_FSAPPLY(basic);
+ ATF_TP_FSAPPLY(whiteout);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/vfs/t_unpriv.c b/contrib/netbsd-tests/fs/vfs/t_unpriv.c
new file mode 100644
index 0000000..fffffe4
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_unpriv.c
@@ -0,0 +1,241 @@
+/* $NetBSD: t_unpriv.c,v 1.11 2014/08/29 17:39:18 gson Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/stat.h>
+#include <sys/time.h>
+
+#include <atf-c.h>
+#include <libgen.h>
+#include <limits.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rump.h>
+
+#include "../common/h_fsmacros.h"
+#include "../../h_macros.h"
+
+#define USES_OWNER \
+ if (FSTYPE_MSDOS(tc)) \
+ atf_tc_skip("owner not supported by file system")
+
+static void
+owner(const atf_tc_t *tc, const char *mp)
+{
+
+ USES_OWNER;
+
+ FSTEST_ENTER();
+
+ rump_pub_lwproc_rfork(RUMP_RFCFDG);
+ if (rump_sys_setuid(1) == -1)
+ atf_tc_fail_errno("setuid");
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ if (rump_sys_chown(".", 1, -1) != -1 || errno != EPERM)
+ atf_tc_fail_errno("chown");
+ if (rump_sys_chmod(".", 0000) != -1 || errno != EPERM)
+ atf_tc_fail_errno("chmod");
+ rump_pub_lwproc_releaselwp();
+
+ if (rump_sys_chown(".", 1, -1) == -1)
+ atf_tc_fail_errno("chown");
+
+ rump_pub_lwproc_rfork(RUMP_RFCFDG);
+ if (rump_sys_setuid(1) == -1)
+ atf_tc_fail_errno("setuid");
+ if (rump_sys_chown(".", 1, -1) == -1)
+ atf_tc_fail_errno("chown");
+ if (rump_sys_chmod(".", 0000) == -1)
+ atf_tc_fail_errno("chmod");
+ rump_pub_lwproc_releaselwp();
+
+ FSTEST_EXIT();
+}
+
+static void
+dirperms(const atf_tc_t *tc, const char *mp)
+{
+ char name[] = "dir.test/file.test";
+ char *dir = dirname(name);
+ int fd;
+
+ if (FSTYPE_SYSVBFS(tc))
+ atf_tc_skip("directories not supported by file system");
+
+ FSTEST_ENTER();
+
+ if (rump_sys_mkdir(dir, 0777) == -1)
+ atf_tc_fail_errno("mkdir");
+
+ rump_pub_lwproc_rfork(RUMP_RFCFDG);
+ if (rump_sys_setuid(1) == -1)
+ atf_tc_fail_errno("setuid");
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ if (rump_sys_open(name, O_RDWR|O_CREAT, 0666) != -1 || errno != EACCES)
+ atf_tc_fail_errno("open");
+ rump_pub_lwproc_releaselwp();
+
+ if ((fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666)) == -1)
+ atf_tc_fail_errno("open");
+ if (rump_sys_close(fd) == -1)
+ atf_tc_fail_errno("close");
+
+ rump_pub_lwproc_rfork(RUMP_RFCFDG);
+ if (rump_sys_setuid(1) == -1)
+ atf_tc_fail_errno("setuid");
+ if (rump_sys_unlink(name) != -1 || errno != EACCES)
+ atf_tc_fail_errno("unlink");
+ rump_pub_lwproc_releaselwp();
+
+ if (rump_sys_unlink(name) == -1)
+ atf_tc_fail_errno("unlink");
+
+ if (rump_sys_rmdir(dir) == -1)
+ atf_tc_fail_errno("rmdir");
+
+ FSTEST_EXIT();
+}
+
+static void
+times(const atf_tc_t *tc, const char *mp)
+{
+ const char *name = "file.test";
+ int fd;
+ unsigned int i, j;
+ struct timeval tmv[2];
+ static struct timeval tmvs[] = {
+ { QUAD_MIN, 0 },
+ { 0, 0 },
+ { QUAD_MAX, 999999 }
+ };
+
+ FSTEST_ENTER();
+
+ if ((fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666)) == -1)
+ atf_tc_fail_errno("open");
+ if (rump_sys_close(fd) == -1)
+ atf_tc_fail_errno("close");
+
+ rump_pub_lwproc_rfork(RUMP_RFCFDG);
+ if (rump_sys_setuid(1) == -1)
+ atf_tc_fail_errno("setuid");
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ if (rump_sys_utimes(name, NULL) != -1 || errno != EACCES)
+ atf_tc_fail_errno("utimes");
+ rump_pub_lwproc_releaselwp();
+
+ if (rump_sys_utimes(name, NULL) == -1)
+ atf_tc_fail_errno("utimes");
+
+ for (i = 0; i < sizeof(tmvs) / sizeof(tmvs[0]); i++) {
+ for (j = 0; j < sizeof(tmvs) / sizeof(tmvs[0]); j++) {
+ tmv[0] = tmvs[i];
+ tmv[1] = tmvs[j];
+ rump_pub_lwproc_rfork(RUMP_RFCFDG);
+ if (rump_sys_setuid(1) == -1)
+ atf_tc_fail_errno("setuid");
+ if (rump_sys_utimes(name, tmv) != -1 || errno != EPERM)
+ atf_tc_fail_errno("utimes");
+ rump_pub_lwproc_releaselwp();
+
+ if (rump_sys_utimes(name, tmv) == -1)
+ atf_tc_fail_errno("utimes");
+ }
+ }
+
+ if (rump_sys_unlink(name) == -1)
+ atf_tc_fail_errno("unlink");
+
+ FSTEST_EXIT();
+}
+
+static void
+flags(const atf_tc_t *tc, const char *mp)
+{
+ const char *name = "file.test";
+ int fd, fflags;
+ struct stat st;
+
+ FSTEST_ENTER();
+
+ if ((fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666)) == -1)
+ atf_tc_fail_errno("open");
+ if (rump_sys_close(fd) == -1)
+ atf_tc_fail_errno("close");
+
+ if (rump_sys_stat(name, &st) == -1)
+ atf_tc_fail_errno("stat");
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ if (rump_sys_chflags(name, st.st_flags) == -1) {
+ if (errno == EOPNOTSUPP)
+ atf_tc_skip("file flags not supported by file system");
+ atf_tc_fail_errno("chflags");
+ }
+
+ fflags = st.st_flags | UF_IMMUTABLE;
+
+ rump_pub_lwproc_rfork(RUMP_RFCFDG);
+ if (rump_sys_setuid(1) == -1)
+ atf_tc_fail_errno("setuid");
+ fflags |= UF_IMMUTABLE;
+ if (rump_sys_chflags(name, fflags) != -1 || errno != EPERM)
+ atf_tc_fail_errno("chflags");
+ rump_pub_lwproc_releaselwp();
+
+ if (rump_sys_chflags(name, fflags) == -1)
+ atf_tc_fail_errno("chflags");
+
+ fflags &= ~UF_IMMUTABLE;
+ if (rump_sys_chflags(name, fflags) == -1)
+ atf_tc_fail_errno("chflags");
+
+ if (rump_sys_unlink(name) == -1)
+ atf_tc_fail_errno("unlink");
+
+ FSTEST_EXIT();
+}
+
+ATF_TC_FSAPPLY(owner, "owner unprivileged checks");
+ATF_TC_FSAPPLY(dirperms, "directory permission checks");
+ATF_TC_FSAPPLY(times, "time set checks");
+ATF_TC_FSAPPLY(flags, "file flags checks");
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_FSAPPLY(owner);
+ ATF_TP_FSAPPLY(dirperms);
+ ATF_TP_FSAPPLY(times);
+ ATF_TP_FSAPPLY(flags);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/vfs/t_vfsops.c b/contrib/netbsd-tests/fs/vfs/t_vfsops.c
new file mode 100644
index 0000000..1bcee89
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_vfsops.c
@@ -0,0 +1,211 @@
+/* $NetBSD: t_vfsops.c,v 1.11 2011/04/04 19:16:58 hannken Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/stat.h>
+#include <sys/statvfs.h>
+
+#include <atf-c.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rump.h>
+
+#include "../common/h_fsmacros.h"
+#include "../../h_macros.h"
+
+static void
+tmount(const atf_tc_t *tc, const char *path)
+{
+
+ return;
+}
+
+static void
+tstatvfs(const atf_tc_t *tc, const char *path)
+{
+ const char *fstype = atf_tc_get_md_var(tc, "X-fs.mntname");
+ struct statvfs svb;
+
+ if (rump_sys_statvfs1(path, &svb, ST_WAIT) == -1)
+ atf_tc_fail_errno("statvfs");
+
+ ATF_REQUIRE(svb.f_namemax > 0 && svb.f_namemax <= MAXNAMLEN);
+ if (!(FSTYPE_PUFFS(tc) || FSTYPE_P2K_FFS(tc)))
+ ATF_REQUIRE_STREQ(svb.f_fstypename, fstype);
+ ATF_REQUIRE_STREQ(svb.f_mntonname, path);
+}
+
+static void
+tsync(const atf_tc_t *tc, const char *path)
+{
+
+ rump_sys_sync();
+}
+
+#define MAGICSTR "just a string, I like A"
+static void
+tfilehandle(const atf_tc_t *tc, const char *path)
+{
+ char fpath[MAXPATHLEN];
+ char buf[sizeof(MAGICSTR)];
+ size_t fhsize;
+ void *fhp;
+ int fd;
+
+ sprintf(fpath, "%s/file", path);
+ fd = rump_sys_open(fpath, O_RDWR | O_CREAT, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("open");
+
+ if (rump_sys_write(fd, MAGICSTR, sizeof(MAGICSTR)) != sizeof(MAGICSTR))
+ atf_tc_fail("write to file");
+ rump_sys_close(fd);
+
+ /*
+ * Get file handle size.
+ * This also weeds out unsupported file systems.
+ */
+ fhsize = 0;
+ if (rump_sys_getfh(fpath, NULL, &fhsize) == -1) {
+ if (errno == EOPNOTSUPP) {
+ atf_tc_skip("file handles not supported");
+ } else if (errno != E2BIG) {
+ atf_tc_fail_errno("getfh size");
+ }
+ }
+
+ fhp = malloc(fhsize);
+ if (rump_sys_getfh(fpath, fhp, &fhsize) == -1)
+ atf_tc_fail_errno("getfh");
+
+ /* open file based on file handle */
+ fd = rump_sys_fhopen(fhp, fhsize, O_RDONLY);
+ if (fd == -1) {
+ atf_tc_fail_errno("fhopen");
+ }
+
+ /* check that we got the same file */
+ if (rump_sys_read(fd, buf, sizeof(buf)) != sizeof(MAGICSTR))
+ atf_tc_fail("read fhopened file");
+
+ ATF_REQUIRE_STREQ(buf, MAGICSTR);
+
+ rump_sys_close(fd);
+}
+
+#define FNAME "a_file"
+static void
+tfhremove(const atf_tc_t *tc, const char *path)
+{
+ size_t fhsize;
+ void *fhp;
+ int fd;
+
+ RL(rump_sys_chdir(path));
+ RL(fd = rump_sys_open(FNAME, O_RDWR | O_CREAT, 0777));
+ RL(rump_sys_close(fd));
+
+ fhsize = 0;
+ if (rump_sys_getfh(FNAME, NULL, &fhsize) == -1) {
+ if (errno == EOPNOTSUPP) {
+ atf_tc_skip("file handles not supported");
+ } else if (errno != E2BIG) {
+ atf_tc_fail_errno("getfh size");
+ }
+ }
+
+ fhp = malloc(fhsize);
+ RL(rump_sys_getfh(FNAME, fhp, &fhsize));
+ RL(rump_sys_unlink(FNAME));
+
+ if (FSTYPE_LFS(tc))
+ atf_tc_expect_fail("fhopen() for removed file succeeds "
+ "(PR kern/43745)");
+ ATF_REQUIRE_ERRNO(ESTALE, rump_sys_fhopen(fhp, fhsize, O_RDONLY) == -1);
+ atf_tc_expect_pass();
+
+ RL(rump_sys_chdir("/"));
+}
+#undef FNAME
+
+/*
+ * This test only checks the file system doesn't crash. We *might*
+ * try a valid file handle.
+ */
+static void
+tfhinval(const atf_tc_t *tc, const char *path)
+{
+ size_t fhsize;
+ void *fhp;
+ unsigned long seed;
+ int fd;
+
+ srandom(seed = time(NULL));
+ printf("RNG seed %lu\n", seed);
+
+ RL(rump_sys_chdir(path));
+ fhsize = 0;
+ if (rump_sys_getfh(".", NULL, &fhsize) == -1) {
+ if (errno == EOPNOTSUPP) {
+ atf_tc_skip("file handles not supported");
+ } else if (errno != E2BIG) {
+ atf_tc_fail_errno("getfh size");
+ }
+ }
+
+ fhp = malloc(fhsize);
+ tests_makegarbage(fhp, fhsize);
+ fd = rump_sys_fhopen(fhp, fhsize, O_RDWR);
+ if (fd != -1)
+ rump_sys_close(fd);
+
+ RL(rump_sys_chdir("/"));
+}
+
+ATF_TC_FSAPPLY(tmount, "mount/unmount");
+ATF_TC_FSAPPLY(tstatvfs, "statvfs");
+ATF_TC_FSAPPLY(tsync, "sync");
+ATF_TC_FSAPPLY(tfilehandle, "file handles");
+ATF_TC_FSAPPLY(tfhremove, "fhtovp for removed file");
+ATF_TC_FSAPPLY(tfhinval, "fhopen invalid filehandle");
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_FSAPPLY(tmount);
+ ATF_TP_FSAPPLY(tstatvfs);
+ ATF_TP_FSAPPLY(tsync);
+ ATF_TP_FSAPPLY(tfilehandle);
+ ATF_TP_FSAPPLY(tfhremove);
+ ATF_TP_FSAPPLY(tfhinval);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/vfs/t_vnops.c b/contrib/netbsd-tests/fs/vfs/t_vnops.c
new file mode 100644
index 0000000..66b5505
--- /dev/null
+++ b/contrib/netbsd-tests/fs/vfs/t_vnops.c
@@ -0,0 +1,1001 @@
+/* $NetBSD: t_vnops.c,v 1.43 2014/09/09 06:51:00 gson Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/stat.h>
+#include <sys/statvfs.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rump.h>
+
+#include "../common/h_fsmacros.h"
+#include "../../h_macros.h"
+
+#define TESTFILE "afile"
+
+#define USES_DIRS \
+ if (FSTYPE_SYSVBFS(tc)) \
+ atf_tc_skip("directories not supported by file system")
+
+#define USES_SYMLINKS \
+ if (FSTYPE_SYSVBFS(tc) || FSTYPE_MSDOS(tc)) \
+ atf_tc_skip("symlinks not supported by file system")
+
+static char *
+md(char *buf, const char *base, const char *tail)
+{
+
+ sprintf(buf, "%s/%s", base, tail);
+ return buf;
+}
+
+static void
+lookup_simple(const atf_tc_t *tc, const char *mountpath)
+{
+ char pb[MAXPATHLEN], final[MAXPATHLEN];
+ struct stat sb1, sb2;
+
+ strcpy(final, mountpath);
+ sprintf(pb, "%s/../%s", mountpath, basename(final));
+ if (rump_sys_stat(pb, &sb1) == -1)
+ atf_tc_fail_errno("stat 1");
+
+ sprintf(pb, "%s/./../%s", mountpath, basename(final));
+ if (rump_sys_stat(pb, &sb2) == -1)
+ atf_tc_fail_errno("stat 2");
+
+ ATF_REQUIRE(memcmp(&sb1, &sb2, sizeof(sb1)) == 0);
+}
+
+static void
+lookup_complex(const atf_tc_t *tc, const char *mountpath)
+{
+ char pb[MAXPATHLEN];
+ struct stat sb1, sb2;
+
+ USES_DIRS;
+
+ if (FSTYPE_UDF(tc))
+ atf_tc_expect_fail("PR kern/49033");
+
+ sprintf(pb, "%s/dir", mountpath);
+ if (rump_sys_mkdir(pb, 0777) == -1)
+ atf_tc_fail_errno("mkdir");
+ if (rump_sys_stat(pb, &sb1) == -1)
+ atf_tc_fail_errno("stat 1");
+
+ sprintf(pb, "%s/./dir/../././dir/.", mountpath);
+ if (rump_sys_stat(pb, &sb2) == -1)
+ atf_tc_fail_errno("stat 2");
+
+ if (memcmp(&sb1, &sb2, sizeof(sb1)) != 0) {
+ printf("what\tsb1\t\tsb2\n");
+
+#define FIELD(FN) \
+ printf(#FN "\t%lld\t%lld\n", \
+ (long long)sb1.FN, (long long)sb2.FN)
+#define TIME(FN) \
+ printf(#FN "\t%lld.%ld\t%lld.%ld\n", \
+ (long long)sb1.FN.tv_sec, sb1.FN.tv_nsec, \
+ (long long)sb2.FN.tv_sec, sb2.FN.tv_nsec)
+
+ FIELD(st_dev);
+ FIELD(st_mode);
+ FIELD(st_ino);
+ FIELD(st_nlink);
+ FIELD(st_uid);
+ FIELD(st_gid);
+ FIELD(st_rdev);
+ TIME(st_atim);
+ TIME(st_mtim);
+ TIME(st_ctim);
+ TIME(st_birthtim);
+ FIELD(st_size);
+ FIELD(st_blocks);
+ FIELD(st_flags);
+ FIELD(st_gen);
+
+#undef FIELD
+#undef TIME
+
+ atf_tc_fail("stat results differ, see ouput for more details");
+ }
+ if (FSTYPE_UDF(tc))
+ atf_tc_fail("random failure of PR kern/49033 "
+ "did not happen this time");
+}
+
+static void
+dir_simple(const atf_tc_t *tc, const char *mountpath)
+{
+ char pb[MAXPATHLEN];
+ struct stat sb;
+
+ USES_DIRS;
+
+ /* check we can create directories */
+ sprintf(pb, "%s/dir", mountpath);
+ if (rump_sys_mkdir(pb, 0777) == -1)
+ atf_tc_fail_errno("mkdir");
+ if (rump_sys_stat(pb, &sb) == -1)
+ atf_tc_fail_errno("stat new directory");
+
+ /* check we can remove then and that it makes them unreachable */
+ if (rump_sys_rmdir(pb) == -1)
+ atf_tc_fail_errno("rmdir");
+ if (rump_sys_stat(pb, &sb) != -1 || errno != ENOENT)
+ atf_tc_fail("ENOENT expected from stat");
+}
+
+static void
+dir_notempty(const atf_tc_t *tc, const char *mountpath)
+{
+ char pb[MAXPATHLEN], pb2[MAXPATHLEN];
+ int fd, rv;
+
+ USES_DIRS;
+
+ /* check we can create directories */
+ sprintf(pb, "%s/dir", mountpath);
+ if (rump_sys_mkdir(pb, 0777) == -1)
+ atf_tc_fail_errno("mkdir");
+
+ sprintf(pb2, "%s/dir/file", mountpath);
+ fd = rump_sys_open(pb2, O_RDWR | O_CREAT, 0777);
+ if (fd == -1)
+ atf_tc_fail_errno("create file");
+ rump_sys_close(fd);
+
+ rv = rump_sys_rmdir(pb);
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ if (rv != -1 || errno != ENOTEMPTY)
+ atf_tc_fail("non-empty directory removed succesfully");
+
+ if (rump_sys_unlink(pb2) == -1)
+ atf_tc_fail_errno("cannot remove dir/file");
+
+ if (rump_sys_rmdir(pb) == -1)
+ atf_tc_fail_errno("remove directory");
+}
+
+static void
+dir_rmdirdotdot(const atf_tc_t *tc, const char *mp)
+{
+ char pb[MAXPATHLEN];
+ int xerrno;
+
+ USES_DIRS;
+
+ FSTEST_ENTER();
+ RL(rump_sys_mkdir("test", 0777));
+ RL(rump_sys_chdir("test"));
+
+ RL(rump_sys_mkdir("subtest", 0777));
+ RL(rump_sys_chdir("subtest"));
+
+ md(pb, mp, "test/subtest");
+ RL(rump_sys_rmdir(pb));
+ md(pb, mp, "test");
+ RL(rump_sys_rmdir(pb));
+
+ if (FSTYPE_NFS(tc))
+ xerrno = ESTALE;
+ else
+ xerrno = ENOENT;
+ ATF_REQUIRE_ERRNO(xerrno, rump_sys_chdir("..") == -1);
+ FSTEST_EXIT();
+}
+
+static void
+checkfile(const char *path, struct stat *refp)
+{
+ char buf[MAXPATHLEN];
+ struct stat sb;
+ static int n = 1;
+
+ md(buf, path, "file");
+ if (rump_sys_stat(buf, &sb) == -1)
+ atf_tc_fail_errno("cannot stat file %d (%s)", n, buf);
+ if (memcmp(&sb, refp, sizeof(sb)) != 0)
+ atf_tc_fail("stat mismatch %d", n);
+ n++;
+}
+
+static void
+rename_dir(const atf_tc_t *tc, const char *mp)
+{
+ char pb1[MAXPATHLEN], pb2[MAXPATHLEN], pb3[MAXPATHLEN];
+ struct stat ref, sb;
+
+ if (FSTYPE_RUMPFS(tc))
+ atf_tc_skip("rename not supported by file system");
+
+ USES_DIRS;
+
+ md(pb1, mp, "dir1");
+ if (rump_sys_mkdir(pb1, 0777) == -1)
+ atf_tc_fail_errno("mkdir 1");
+
+ md(pb2, mp, "dir2");
+ if (rump_sys_mkdir(pb2, 0777) == -1)
+ atf_tc_fail_errno("mkdir 2");
+ md(pb2, mp, "dir2/subdir");
+ if (rump_sys_mkdir(pb2, 0777) == -1)
+ atf_tc_fail_errno("mkdir 3");
+
+ md(pb3, mp, "dir1/file");
+ if (rump_sys_mknod(pb3, S_IFREG | 0777, -1) == -1)
+ atf_tc_fail_errno("create file");
+ if (rump_sys_stat(pb3, &ref) == -1)
+ atf_tc_fail_errno("stat of file");
+
+ /*
+ * First try ops which should succeed.
+ */
+
+ /* rename within directory */
+ md(pb3, mp, "dir3");
+ if (rump_sys_rename(pb1, pb3) == -1)
+ atf_tc_fail_errno("rename 1");
+ checkfile(pb3, &ref);
+
+ /* rename directory onto itself (two ways, should fail) */
+ md(pb1, mp, "dir3/.");
+ if (rump_sys_rename(pb1, pb3) != -1 || errno != EINVAL)
+ atf_tc_fail_errno("rename 2");
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ if (rump_sys_rename(pb3, pb1) != -1 || errno != EISDIR)
+ atf_tc_fail_errno("rename 3");
+
+ checkfile(pb3, &ref);
+
+ /* rename father of directory into directory */
+ md(pb1, mp, "dir2/dir");
+ md(pb2, mp, "dir2");
+ if (rump_sys_rename(pb2, pb1) != -1 || errno != EINVAL)
+ atf_tc_fail_errno("rename 4");
+
+ /* same for grandfather */
+ md(pb1, mp, "dir2/subdir/dir2");
+ if (rump_sys_rename(pb2, pb1) != -1 || errno != EINVAL)
+ atf_tc_fail("rename 5");
+
+ checkfile(pb3, &ref);
+
+ /* rename directory over a non-empty directory */
+ if (rump_sys_rename(pb2, pb3) != -1 || errno != ENOTEMPTY)
+ atf_tc_fail("rename 6");
+
+ /* cross-directory rename */
+ md(pb1, mp, "dir3");
+ md(pb2, mp, "dir2/somedir");
+ if (rump_sys_rename(pb1, pb2) == -1)
+ atf_tc_fail_errno("rename 7");
+ checkfile(pb2, &ref);
+
+ /* move to parent directory */
+ md(pb1, mp, "dir2/somedir/../../dir3");
+ if (rump_sys_rename(pb2, pb1) == -1)
+ atf_tc_fail_errno("rename 8");
+ md(pb1, mp, "dir2/../dir3");
+ checkfile(pb1, &ref);
+
+ /* atomic cross-directory rename */
+ md(pb3, mp, "dir2/subdir");
+ if (rump_sys_rename(pb1, pb3) == -1)
+ atf_tc_fail_errno("rename 9");
+ checkfile(pb3, &ref);
+
+ /* rename directory over an empty directory */
+ md(pb1, mp, "parent");
+ md(pb2, mp, "parent/dir1");
+ md(pb3, mp, "parent/dir2");
+ RL(rump_sys_mkdir(pb1, 0777));
+ RL(rump_sys_mkdir(pb2, 0777));
+ RL(rump_sys_mkdir(pb3, 0777));
+ RL(rump_sys_rename(pb2, pb3));
+
+ RL(rump_sys_stat(pb1, &sb));
+ if (! FSTYPE_MSDOS(tc))
+ ATF_CHECK_EQ(sb.st_nlink, 3);
+ RL(rump_sys_rmdir(pb3));
+ RL(rump_sys_rmdir(pb1));
+}
+
+static void
+rename_dotdot(const atf_tc_t *tc, const char *mp)
+{
+
+ if (FSTYPE_RUMPFS(tc))
+ atf_tc_skip("rename not supported by file system");
+
+ USES_DIRS;
+
+ if (rump_sys_chdir(mp) == -1)
+ atf_tc_fail_errno("chdir mountpoint");
+
+ if (rump_sys_mkdir("dir1", 0777) == -1)
+ atf_tc_fail_errno("mkdir 1");
+ if (rump_sys_mkdir("dir2", 0777) == -1)
+ atf_tc_fail_errno("mkdir 2");
+
+ if (rump_sys_rename("dir1", "dir1/..") != -1 || errno != EINVAL)
+ atf_tc_fail_errno("self-dotdot to");
+
+ if (rump_sys_rename("dir1/..", "sometarget") != -1 || errno != EINVAL)
+ atf_tc_fail_errno("self-dotdot from");
+
+ if (rump_sys_rename("dir1", "dir2/..") != -1 || errno != EINVAL)
+ atf_tc_fail("other-dotdot");
+
+ rump_sys_chdir("/");
+}
+
+static void
+rename_reg_nodir(const atf_tc_t *tc, const char *mp)
+{
+ bool haslinks;
+ struct stat sb;
+ ino_t f1ino;
+
+ if (FSTYPE_RUMPFS(tc))
+ atf_tc_skip("rename not supported by file system");
+
+ if (rump_sys_chdir(mp) == -1)
+ atf_tc_fail_errno("chdir mountpoint");
+
+ if (FSTYPE_MSDOS(tc) || FSTYPE_SYSVBFS(tc))
+ haslinks = false;
+ else
+ haslinks = true;
+
+ if (rump_sys_mknod("file1", S_IFREG | 0777, -1) == -1)
+ atf_tc_fail_errno("create file");
+ if (rump_sys_mknod("file2", S_IFREG | 0777, -1) == -1)
+ atf_tc_fail_errno("create file");
+
+ if (rump_sys_stat("file1", &sb) == -1)
+ atf_tc_fail_errno("stat");
+ f1ino = sb.st_ino;
+
+ if (haslinks) {
+ if (rump_sys_link("file1", "file_link") == -1)
+ atf_tc_fail_errno("link");
+ if (rump_sys_stat("file_link", &sb) == -1)
+ atf_tc_fail_errno("stat");
+ ATF_REQUIRE_EQ(sb.st_ino, f1ino);
+ ATF_REQUIRE_EQ(sb.st_nlink, 2);
+ }
+
+ if (rump_sys_stat("file2", &sb) == -1)
+ atf_tc_fail_errno("stat");
+
+ if (rump_sys_rename("file1", "file3") == -1)
+ atf_tc_fail_errno("rename 1");
+ if (rump_sys_stat("file3", &sb) == -1)
+ atf_tc_fail_errno("stat 1");
+ if (haslinks) {
+ ATF_REQUIRE_EQ(sb.st_ino, f1ino);
+ }
+ if (rump_sys_stat("file1", &sb) != -1 || errno != ENOENT)
+ atf_tc_fail_errno("source 1");
+
+ if (rump_sys_rename("file3", "file2") == -1)
+ atf_tc_fail_errno("rename 2");
+ if (rump_sys_stat("file2", &sb) == -1)
+ atf_tc_fail_errno("stat 2");
+ if (haslinks) {
+ ATF_REQUIRE_EQ(sb.st_ino, f1ino);
+ }
+
+ if (rump_sys_stat("file3", &sb) != -1 || errno != ENOENT)
+ atf_tc_fail_errno("source 2");
+
+ if (haslinks) {
+ if (rump_sys_rename("file2", "file_link") == -1)
+ atf_tc_fail_errno("rename hardlink");
+ if (rump_sys_stat("file2", &sb) != -1 || errno != ENOENT)
+ atf_tc_fail_errno("source 3");
+ if (rump_sys_stat("file_link", &sb) == -1)
+ atf_tc_fail_errno("stat 2");
+ ATF_REQUIRE_EQ(sb.st_ino, f1ino);
+ ATF_REQUIRE_EQ(sb.st_nlink, 1);
+ }
+
+ ATF_CHECK_ERRNO(EFAULT, rump_sys_rename("file2", NULL) == -1);
+ ATF_CHECK_ERRNO(EFAULT, rump_sys_rename(NULL, "file2") == -1);
+
+ rump_sys_chdir("/");
+}
+
+static void
+create_nametoolong(const atf_tc_t *tc, const char *mp)
+{
+ char *name;
+ int fd;
+ long val;
+ size_t len;
+
+ if (rump_sys_chdir(mp) == -1)
+ atf_tc_fail_errno("chdir mountpoint");
+
+ val = rump_sys_pathconf(".", _PC_NAME_MAX);
+ if (val == -1)
+ atf_tc_fail_errno("pathconf");
+
+ len = val + 1;
+ name = malloc(len+1);
+ if (name == NULL)
+ atf_tc_fail_errno("malloc");
+
+ memset(name, 'a', len);
+ *(name+len) = '\0';
+
+ val = rump_sys_pathconf(".", _PC_NO_TRUNC);
+ if (val == -1)
+ atf_tc_fail_errno("pathconf");
+
+ fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666);
+ if (val != 0 && (fd != -1 || errno != ENAMETOOLONG))
+ atf_tc_fail_errno("open");
+
+ if (val == 0 && rump_sys_close(fd) == -1)
+ atf_tc_fail_errno("close");
+ if (val == 0 && rump_sys_unlink(name) == -1)
+ atf_tc_fail_errno("unlink");
+
+ free(name);
+
+ rump_sys_chdir("/");
+}
+
+static void
+create_exist(const atf_tc_t *tc, const char *mp)
+{
+ const char *name = "hoge";
+ int fd;
+
+ RL(rump_sys_chdir(mp));
+ RL(fd = rump_sys_open(name, O_RDWR|O_CREAT|O_EXCL, 0666));
+ RL(rump_sys_close(fd));
+ RL(rump_sys_unlink(name));
+ RL(fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666));
+ RL(rump_sys_close(fd));
+ RL(fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666));
+ RL(rump_sys_close(fd));
+ ATF_REQUIRE_ERRNO(EEXIST,
+ (fd = rump_sys_open(name, O_RDWR|O_CREAT|O_EXCL, 0666)));
+ RL(rump_sys_unlink(name));
+ RL(rump_sys_chdir("/"));
+}
+
+static void
+rename_nametoolong(const atf_tc_t *tc, const char *mp)
+{
+ char *name;
+ int res, fd;
+ long val;
+ size_t len;
+
+ if (FSTYPE_RUMPFS(tc))
+ atf_tc_skip("rename not supported by file system");
+
+ if (rump_sys_chdir(mp) == -1)
+ atf_tc_fail_errno("chdir mountpoint");
+
+ val = rump_sys_pathconf(".", _PC_NAME_MAX);
+ if (val == -1)
+ atf_tc_fail_errno("pathconf");
+
+ len = val + 1;
+ name = malloc(len+1);
+ if (name == NULL)
+ atf_tc_fail_errno("malloc");
+
+ memset(name, 'a', len);
+ *(name+len) = '\0';
+
+ fd = rump_sys_open("dummy", O_RDWR|O_CREAT, 0666);
+ if (fd == -1)
+ atf_tc_fail_errno("open");
+ if (rump_sys_close(fd) == -1)
+ atf_tc_fail_errno("close");
+
+ val = rump_sys_pathconf(".", _PC_NO_TRUNC);
+ if (val == -1)
+ atf_tc_fail_errno("pathconf");
+
+ res = rump_sys_rename("dummy", name);
+ if (val != 0 && (res != -1 || errno != ENAMETOOLONG))
+ atf_tc_fail_errno("rename");
+
+ if (val == 0 && rump_sys_unlink(name) == -1)
+ atf_tc_fail_errno("unlink");
+
+ free(name);
+
+ rump_sys_chdir("/");
+}
+
+/*
+ * Test creating a symlink whose length is "len" bytes, not including
+ * the terminating NUL.
+ */
+static void
+symlink_len(const atf_tc_t *tc, const char *mp, size_t len)
+{
+ char *buf;
+ int r;
+
+ USES_SYMLINKS;
+
+ RL(rump_sys_chdir(mp));
+
+ buf = malloc(len + 1);
+ ATF_REQUIRE(buf);
+ memset(buf, 'a', len);
+ buf[len] = '\0';
+ r = rump_sys_symlink(buf, "afile");
+ if (r == -1) {
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, r);
+ } else {
+ RL(rump_sys_unlink("afile"));
+ }
+ free(buf);
+
+ RL(rump_sys_chdir("/"));
+}
+
+static void
+symlink_zerolen(const atf_tc_t *tc, const char *mp)
+{
+ symlink_len(tc, mp, 0);
+}
+
+static void
+symlink_long(const atf_tc_t *tc, const char *mp)
+{
+ /*
+ * Test lengths close to powers of two, as those are likely
+ * to be edge cases.
+ */
+ size_t len;
+ int fuzz;
+ for (len = 2; len <= 65536; len *= 2) {
+ for (fuzz = -1; fuzz <= 1; fuzz++) {
+ symlink_len(tc, mp, len + fuzz);
+ }
+ }
+}
+
+static void
+symlink_root(const atf_tc_t *tc, const char *mp)
+{
+
+ USES_SYMLINKS;
+
+ RL(rump_sys_chdir(mp));
+ RL(rump_sys_symlink("/", "foo"));
+ RL(rump_sys_chdir("foo"));
+}
+
+static void
+attrs(const atf_tc_t *tc, const char *mp)
+{
+ struct stat sb, sb2;
+ struct timeval tv[2];
+ int fd;
+
+ FSTEST_ENTER();
+ RL(fd = rump_sys_open(TESTFILE, O_RDWR | O_CREAT, 0755));
+ RL(rump_sys_close(fd));
+ RL(rump_sys_stat(TESTFILE, &sb));
+ if (!(FSTYPE_MSDOS(tc) || FSTYPE_SYSVBFS(tc))) {
+ RL(rump_sys_chown(TESTFILE, 1, 2));
+ sb.st_uid = 1;
+ sb.st_gid = 2;
+ RL(rump_sys_chmod(TESTFILE, 0123));
+ sb.st_mode = (sb.st_mode & ~ACCESSPERMS) | 0123;
+ }
+
+ tv[0].tv_sec = 1000000000; /* need something >1980 for msdosfs */
+ tv[0].tv_usec = 1;
+ tv[1].tv_sec = 1000000002; /* need even seconds for msdosfs */
+ tv[1].tv_usec = 3;
+ RL(rump_sys_utimes(TESTFILE, tv));
+ RL(rump_sys_utimes(TESTFILE, tv)); /* XXX: utimes & birthtime */
+ sb.st_atimespec.tv_sec = 1000000000;
+ sb.st_atimespec.tv_nsec = 1000;
+ sb.st_mtimespec.tv_sec = 1000000002;
+ sb.st_mtimespec.tv_nsec = 3000;
+
+ RL(rump_sys_stat(TESTFILE, &sb2));
+#define CHECK(a) ATF_REQUIRE_EQ(sb.a, sb2.a)
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ if (!(FSTYPE_MSDOS(tc) || FSTYPE_SYSVBFS(tc))) {
+ CHECK(st_uid);
+ CHECK(st_gid);
+ CHECK(st_mode);
+ }
+ if (!FSTYPE_MSDOS(tc)) {
+ /* msdosfs has only access date, not time */
+ CHECK(st_atimespec.tv_sec);
+ }
+ CHECK(st_mtimespec.tv_sec);
+ if (!(FSTYPE_EXT2FS(tc) || FSTYPE_MSDOS(tc) ||
+ FSTYPE_SYSVBFS(tc) || FSTYPE_V7FS(tc))) {
+ CHECK(st_atimespec.tv_nsec);
+ CHECK(st_mtimespec.tv_nsec);
+ }
+#undef CHECK
+
+ FSTEST_EXIT();
+}
+
+static void
+fcntl_lock(const atf_tc_t *tc, const char *mp)
+{
+ int fd, fd2;
+ struct flock l;
+ struct lwp *lwp1, *lwp2;
+
+ FSTEST_ENTER();
+ l.l_pid = 0;
+ l.l_start = l.l_len = 1024;
+ l.l_type = F_RDLCK | F_WRLCK;
+ l.l_whence = SEEK_END;
+
+ lwp1 = rump_pub_lwproc_curlwp();
+ RL(fd = rump_sys_open(TESTFILE, O_RDWR | O_CREAT, 0755));
+ RL(rump_sys_ftruncate(fd, 8192));
+
+ /* PR kern/43321 */
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be broken");
+ RL(rump_sys_fcntl(fd, F_SETLK, &l));
+
+ /* Next, we fork and try to lock the same area */
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ lwp2 = rump_pub_lwproc_curlwp();
+ RL(fd2 = rump_sys_open(TESTFILE, O_RDWR, 0));
+ ATF_REQUIRE_ERRNO(EAGAIN, rump_sys_fcntl(fd2, F_SETLK, &l));
+
+ /* Switch back and unlock... */
+ rump_pub_lwproc_switch(lwp1);
+ l.l_type = F_UNLCK;
+ RL(rump_sys_fcntl(fd, F_SETLK, &l));
+
+ /* ... and try to lock again */
+ rump_pub_lwproc_switch(lwp2);
+ l.l_type = F_RDLCK | F_WRLCK;
+ RL(rump_sys_fcntl(fd2, F_SETLK, &l));
+
+ RL(rump_sys_close(fd2));
+ rump_pub_lwproc_releaselwp();
+
+ RL(rump_sys_close(fd));
+
+ FSTEST_EXIT();
+}
+
+static int
+flock_compare(const void *p, const void *q)
+{
+ int a = ((const struct flock *)p)->l_start;
+ int b = ((const struct flock *)q)->l_start;
+ return a < b ? -1 : (a > b ? 1 : 0);
+}
+
+/*
+ * Find all locks set by fcntl_getlock_pids test
+ * using GETLK for a range [start, start+end], and,
+ * if there is a blocking lock, recursively find
+ * all locks to the left (toward the beginning of
+ * a file) and to the right of the lock.
+ * The function also understands "until end of file"
+ * convention when len==0.
+ */
+static unsigned int
+fcntl_getlocks(int fildes, off_t start, off_t len,
+ struct flock *lock, struct flock *end)
+{
+ unsigned int rv = 0;
+ const struct flock l = { start, len, 0, F_RDLCK, SEEK_SET };
+
+ if (lock == end)
+ return rv;
+
+ RL(rump_sys_fcntl(fildes, F_GETLK, &l));
+
+ if (l.l_type == F_UNLCK)
+ return rv;
+
+ *lock++ = l;
+ rv += 1;
+
+ ATF_REQUIRE(l.l_whence == SEEK_SET);
+
+ if (l.l_start > start) {
+ unsigned int n =
+ fcntl_getlocks(fildes, start, l.l_start - start, lock, end);
+ rv += n;
+ lock += n;
+ if (lock == end)
+ return rv;
+ }
+
+ if (l.l_len == 0) /* does l spans until the end? */
+ return rv;
+
+ if (len == 0) /* are we looking for locks until the end? */ {
+ rv += fcntl_getlocks(fildes, l.l_start + l.l_len, len, lock, end);
+ } else if (l.l_start + l.l_len < start + len) {
+ len -= l.l_start + l.l_len - start;
+ rv += fcntl_getlocks(fildes, l.l_start + l.l_len, len, lock, end);
+ }
+
+ return rv;
+}
+
+static void
+fcntl_getlock_pids(const atf_tc_t *tc, const char *mp)
+{
+ /* test non-overlaping ranges */
+ struct flock expect[4];
+ const struct flock lock[4] = {
+ { 0, 2, 0, F_WRLCK, SEEK_SET },
+ { 2, 1, 0, F_WRLCK, SEEK_SET },
+ { 7, 5, 0, F_WRLCK, SEEK_SET },
+ { 4, 3, 0, F_WRLCK, SEEK_SET },
+ };
+
+ /* Add extra element to make sure recursion does't stop at array end */
+ struct flock result[5];
+
+ /* Add 5th process */
+ int fd[5];
+ pid_t pid[5];
+ struct lwp *lwp[5];
+
+ unsigned int i, j;
+ const off_t sz = 8192;
+ int omode = 0755;
+ int oflags = O_RDWR | O_CREAT;
+
+ memcpy(expect, lock, sizeof(lock));
+
+ FSTEST_ENTER();
+
+ /*
+ * First, we create 4 processes and let each lock a range of the
+ * file. Note that the third and fourth processes lock in
+ * "reverse" order, i.e. the greater pid locks a range before
+ * the lesser pid.
+ * Then, we create 5th process which doesn't lock anything.
+ */
+ for (i = 0; i < __arraycount(lwp); i++) {
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+
+ lwp[i] = rump_pub_lwproc_curlwp();
+ pid[i] = rump_sys_getpid();
+
+ RL(fd[i] = rump_sys_open(TESTFILE, oflags, omode));
+ oflags = O_RDWR;
+ omode = 0;
+
+ RL(rump_sys_ftruncate(fd[i], sz));
+
+ if (FSTYPE_ZFS(tc))
+ atf_tc_expect_fail("PR kern/47656: Test known to be "
+ "broken");
+ if (i < __arraycount(lock)) {
+ RL(rump_sys_fcntl(fd[i], F_SETLK, &lock[i]));
+ expect[i].l_pid = pid[i];
+ }
+ }
+
+ qsort(expect, __arraycount(expect), sizeof(expect[0]), &flock_compare);
+
+ /*
+ * In the context of each process, recursively find all locks
+ * that would block the current process. Processes 1-4 don't
+ * see their own lock, we insert it to simplify checks.
+ * Process 5 sees all 4 locks.
+ */
+ for (i = 0; i < __arraycount(lwp); i++) {
+ unsigned int nlocks;
+
+ rump_pub_lwproc_switch(lwp[i]);
+
+ memset(result, 0, sizeof(result));
+ nlocks = fcntl_getlocks(fd[i], 0, sz,
+ result, result + __arraycount(result));
+
+ if (i < __arraycount(lock)) {
+ ATF_REQUIRE(nlocks < __arraycount(result));
+ result[nlocks] = lock[i];
+ result[nlocks].l_pid = pid[i];
+ nlocks++;
+ }
+
+ ATF_CHECK_EQ(nlocks, __arraycount(expect));
+
+ qsort(result, nlocks, sizeof(result[0]), &flock_compare);
+
+ for (j = 0; j < nlocks; j++) {
+ ATF_CHECK_EQ(result[j].l_start, expect[j].l_start );
+ ATF_CHECK_EQ(result[j].l_len, expect[j].l_len );
+ ATF_CHECK_EQ(result[j].l_pid, expect[j].l_pid );
+ ATF_CHECK_EQ(result[j].l_type, expect[j].l_type );
+ ATF_CHECK_EQ(result[j].l_whence, expect[j].l_whence);
+ }
+ }
+
+ /*
+ * Release processes. This also releases the fds and locks
+ * making fs unmount possible
+ */
+ for (i = 0; i < __arraycount(lwp); i++) {
+ rump_pub_lwproc_switch(lwp[i]);
+ rump_pub_lwproc_releaselwp();
+ }
+
+ FSTEST_EXIT();
+}
+
+static void
+access_simple(const atf_tc_t *tc, const char *mp)
+{
+ int fd;
+ int tmode;
+
+ FSTEST_ENTER();
+ RL(fd = rump_sys_open("tfile", O_CREAT | O_RDWR, 0777));
+ RL(rump_sys_close(fd));
+
+#define ALLACC (F_OK | X_OK | W_OK | R_OK)
+ if (FSTYPE_SYSVBFS(tc) || FSTYPE_MSDOS(tc))
+ tmode = F_OK;
+ else
+ tmode = ALLACC;
+
+ RL(rump_sys_access("tfile", tmode));
+
+ /* PR kern/44648 */
+ ATF_REQUIRE_ERRNO(EINVAL, rump_sys_access("tfile", ALLACC+1) == -1);
+#undef ALLACC
+ FSTEST_EXIT();
+}
+
+static void
+read_directory(const atf_tc_t *tc, const char *mp)
+{
+ char buf[1024];
+ int fd, res;
+ ssize_t size;
+
+ FSTEST_ENTER();
+ fd = rump_sys_open(".", O_DIRECTORY | O_RDONLY, 0777);
+ ATF_REQUIRE(fd != -1);
+
+ size = rump_sys_pread(fd, buf, sizeof(buf), 0);
+ ATF_CHECK(size != -1 || errno == EISDIR);
+ size = rump_sys_read(fd, buf, sizeof(buf));
+ ATF_CHECK(size != -1 || errno == EISDIR);
+
+ res = rump_sys_close(fd);
+ ATF_REQUIRE(res != -1);
+ FSTEST_EXIT();
+}
+
+static void
+lstat_symlink(const atf_tc_t *tc, const char *mp)
+{
+ const char *src, *dst;
+ int res;
+ struct stat st;
+
+ USES_SYMLINKS;
+
+ if (FSTYPE_V7FS(tc))
+ atf_tc_expect_fail("PR kern/48864");
+
+ FSTEST_ENTER();
+
+ src = "source";
+ dst = "destination";
+
+ res = rump_sys_symlink(src, dst);
+ ATF_REQUIRE(res != -1);
+ res = rump_sys_lstat(dst, &st);
+ ATF_REQUIRE(res != -1);
+
+ ATF_CHECK(S_ISLNK(st.st_mode) != 0);
+ ATF_CHECK(st.st_size == (off_t)strlen(src));
+
+ FSTEST_EXIT();
+}
+
+ATF_TC_FSAPPLY(lookup_simple, "simple lookup (./.. on root)");
+ATF_TC_FSAPPLY(lookup_complex, "lookup of non-dot entries");
+ATF_TC_FSAPPLY(dir_simple, "mkdir/rmdir");
+ATF_TC_FSAPPLY(dir_notempty, "non-empty directories cannot be removed");
+ATF_TC_FSAPPLY(dir_rmdirdotdot, "remove .. and try to cd out (PR kern/44657)");
+ATF_TC_FSAPPLY(rename_dir, "exercise various directory renaming ops "
+"(PR kern/44288)");
+ATF_TC_FSAPPLY(rename_dotdot, "rename dir .. (PR kern/43617)");
+ATF_TC_FSAPPLY(rename_reg_nodir, "rename regular files, no subdirectories");
+ATF_TC_FSAPPLY(create_nametoolong, "create file with name too long");
+ATF_TC_FSAPPLY(create_exist, "create with O_EXCL");
+ATF_TC_FSAPPLY(rename_nametoolong, "rename to file with name too long");
+ATF_TC_FSAPPLY(symlink_zerolen, "symlink with target of length 0");
+ATF_TC_FSAPPLY(symlink_long, "symlink with target of length > 0");
+ATF_TC_FSAPPLY(symlink_root, "symlink to root directory");
+ATF_TC_FSAPPLY(attrs, "check setting attributes works");
+ATF_TC_FSAPPLY(fcntl_lock, "check fcntl F_SETLK");
+ATF_TC_FSAPPLY(fcntl_getlock_pids,"fcntl F_GETLK w/ many procs, PR kern/44494");
+ATF_TC_FSAPPLY(access_simple, "access(2)");
+ATF_TC_FSAPPLY(read_directory, "read(2) on directories");
+ATF_TC_FSAPPLY(lstat_symlink, "lstat(2) values for symbolic links");
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_FSAPPLY(lookup_simple);
+ ATF_TP_FSAPPLY(lookup_complex);
+ ATF_TP_FSAPPLY(dir_simple);
+ ATF_TP_FSAPPLY(dir_notempty);
+ ATF_TP_FSAPPLY(dir_rmdirdotdot);
+ ATF_TP_FSAPPLY(rename_dir);
+ ATF_TP_FSAPPLY(rename_dotdot);
+ ATF_TP_FSAPPLY(rename_reg_nodir);
+ ATF_TP_FSAPPLY(create_nametoolong);
+ ATF_TP_FSAPPLY(create_exist);
+ ATF_TP_FSAPPLY(rename_nametoolong);
+ ATF_TP_FSAPPLY(symlink_zerolen);
+ ATF_TP_FSAPPLY(symlink_long);
+ ATF_TP_FSAPPLY(symlink_root);
+ ATF_TP_FSAPPLY(attrs);
+ ATF_TP_FSAPPLY(fcntl_lock);
+ ATF_TP_FSAPPLY(fcntl_getlock_pids);
+ ATF_TP_FSAPPLY(access_simple);
+ ATF_TP_FSAPPLY(read_directory);
+ ATF_TP_FSAPPLY(lstat_symlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/fs/zfs/t_zpool.sh b/contrib/netbsd-tests/fs/zfs/t_zpool.sh
new file mode 100755
index 0000000..e3c2380
--- /dev/null
+++ b/contrib/netbsd-tests/fs/zfs/t_zpool.sh
@@ -0,0 +1,66 @@
+# $NetBSD: t_zpool.sh,v 1.3 2011/12/06 18:18:59 njoly Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+server='rump_server -lrumpvfs -lrumpkern_solaris -lrumpfs_zfs -lrumpdev -lrumpdev_rnd -d key=/dk,hostpath=zfs.img,size=100m'
+
+export RUMP_SERVER=unix://zsuck
+
+atf_test_case create cleanup
+create_head()
+{
+ atf_set "descr" "basic zpool create"
+}
+
+IFS=' '
+exmount='rumpfs on / type rumpfs (local)
+jippo on /jippo type zfs (local)
+'
+
+create_body()
+{
+
+ atf_check -s exit:0 -o ignore -e ignore ${server} ${RUMP_SERVER}
+
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ export RUMPHIJACK=blanket=/dev/zfs:/dk:/jippo
+ atf_check -s exit:0 zpool create jippo /dk
+
+ export RUMPHIJACK=vfs=all
+ atf_check -s exit:0 -o inline:"${exmount}" mount
+}
+
+create_cleanup()
+{
+
+ rump.halt
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case create
+}
diff --git a/contrib/netbsd-tests/games/t_factor.sh b/contrib/netbsd-tests/games/t_factor.sh
new file mode 100755
index 0000000..e2320a2
--- /dev/null
+++ b/contrib/netbsd-tests/games/t_factor.sh
@@ -0,0 +1,58 @@
+# $NetBSD: t_factor.sh,v 1.7 2010/11/19 12:31:36 pgoyette Exp $
+#
+# Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, 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 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.
+#
+
+expect() {
+ echo "${2}" >expout
+ atf_check -s eq:0 -o file:expout -e empty /usr/games/factor ${1}
+}
+
+atf_test_case overflow
+overflow_head() {
+ atf_set "descr" "Tests for overflow conditions"
+ atf_set "require.progs" "/usr/games/factor"
+}
+overflow_body() {
+ expect '8675309' '8675309: 8675309'
+ expect '6172538568' '6172538568: 2 2 2 3 7 17 2161253'
+}
+
+atf_test_case loop
+loop_head() {
+ atf_set "descr" "Tests some cases that once locked the program" \
+ "in an infinite loop"
+ atf_set "require.progs" "/usr/games/factor"
+}
+loop_body() {
+ expect '99999999999991' '99999999999991: 7 13 769231 1428571'
+ expect '2147483647111311' '2147483647111311: 3 3 3 131 607148331103'
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case overflow
+ atf_add_test_case loop
+}
diff --git a/contrib/netbsd-tests/h_macros.h b/contrib/netbsd-tests/h_macros.h
new file mode 100644
index 0000000..5dd56de
--- /dev/null
+++ b/contrib/netbsd-tests/h_macros.h
@@ -0,0 +1,85 @@
+/* $NetBSD: h_macros.h,v 1.9 2013/05/17 15:42:09 christos Exp $ */
+
+/*-
+ * Copyright (c) 2008, 2009 The NetBSD Foundation, 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 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 SRC_TESTS_H_MACROS_H_
+#define SRC_TESTS_H_MACROS_H_
+
+#include <sys/types.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <atf-c.h>
+
+#define REQUIRE_LIBC(x, v) \
+ ATF_REQUIRE_MSG((x) != (v), "%s: %s", #x, strerror(errno))
+
+#define CHECK_LIBC(x, v) \
+ ATF_CHECK_MSG((x) != (v), "%s: %s", #x, strerror(errno))
+
+#define RL(x) REQUIRE_LIBC(x, -1)
+#define RZ(x) \
+do { \
+ int RZ_rv = x; \
+ ATF_REQUIRE_MSG(RZ_rv == 0, "%s: %s", #x, strerror(RZ_rv)); \
+} while (/*CONSTCOND*/0)
+
+static __inline __printflike(1, 2) void
+atf_tc_fail_errno(const char *fmt, ...)
+{
+ va_list ap;
+ char buf[1024];
+ int sverrno = errno;
+
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+
+ strlcat(buf, ": ", sizeof(buf));
+ strlcat(buf, strerror(sverrno), sizeof(buf));
+
+ atf_tc_fail("%s", buf);
+}
+
+static __inline void
+tests_makegarbage(void *space, size_t len)
+{
+ uint16_t *sb = space;
+ uint16_t randval;
+
+ while (len >= sizeof(randval)) {
+ *sb++ = (random() & 0xffff);
+ len -= sizeof(*sb);
+ }
+ randval = (uint16_t)random();
+ memcpy(sb, &randval, len);
+}
+
+#endif
diff --git a/contrib/netbsd-tests/include/d_bitstring_27.out b/contrib/netbsd-tests/include/d_bitstring_27.out
new file mode 100644
index 0000000..55ba39e
--- /dev/null
+++ b/contrib/netbsd-tests/include/d_bitstring_27.out
@@ -0,0 +1,263 @@
+Testing with TEST_LENGTH = 27
+
+test _bit_byte, _bit_mask, and bitstr_size
+ i _bit_byte(i) _bit_mask(i) bitstr_size(i)
+ 0 0 1 0
+ 1 0 2 1
+ 2 0 4 1
+ 3 0 8 1
+ 4 0 16 1
+ 5 0 32 1
+ 6 0 64 1
+ 7 0 128 1
+ 8 1 1 1
+ 9 1 2 2
+ 10 1 4 2
+ 11 1 8 2
+ 12 1 16 2
+ 13 1 32 2
+ 14 1 64 2
+ 15 1 128 2
+ 16 2 1 2
+ 17 2 2 3
+ 18 2 4 3
+ 19 2 8 3
+ 20 2 16 3
+ 21 2 32 3
+ 22 2 64 3
+ 23 2 128 3
+ 24 3 1 3
+ 25 3 2 4
+ 26 3 4 4
+
+test bit_alloc, clearbits, bit_ffc, bit_ffs
+be: 0 -1 000000000000000000000000000
+is: 0 -1 000000000000000000000000000
+
+test bit_set
+be: 1 0 100100100100100100100100100
+is: 1 0 100100100100100100100100100
+
+test bit_clear
+be: 0 3 000100000100000100000100000
+is: 0 3 000100000100000100000100000
+
+test bit_test using previous bitstring
+ i bit_test(i)
+ 0 0
+ 1 0
+ 2 0
+ 3 8
+ 4 0
+ 5 0
+ 6 0
+ 7 0
+ 8 0
+ 9 2
+ 10 0
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 128
+ 16 0
+ 17 0
+ 18 0
+ 19 0
+ 20 0
+ 21 32
+ 22 0
+ 23 0
+ 24 0
+ 25 0
+ 26 0
+
+test clearbits
+be: 0 -1 000000000000000000000000000
+is: 0 -1 000000000000000000000000000
+
+test bit_nset and bit_nclear
+be: 0 1 011111111111111111111111110
+is: 0 1 011111111111111111111111110
+be: 0 1 010000000000000000000000010
+is: 0 1 010000000000000000000000010
+be: 0 -1 000000000000000000000000000
+is: 0 -1 000000000000000000000000000
+be: 26 0 111111111111111111111111110
+is: 26 0 111111111111111111111111110
+be: 0 -1 000000000000000000000000000
+is: 0 -1 000000000000000000000000000
+
+first 1 bit should move right 1 position each line
+ 0 -1 0 111111111111111111111111111
+ 1 0 1 011111111111111111111111111
+ 2 0 2 001111111111111111111111111
+ 3 0 3 000111111111111111111111111
+ 4 0 4 000011111111111111111111111
+ 5 0 5 000001111111111111111111111
+ 6 0 6 000000111111111111111111111
+ 7 0 7 000000011111111111111111111
+ 8 0 8 000000001111111111111111111
+ 9 0 9 000000000111111111111111111
+ 10 0 10 000000000011111111111111111
+ 11 0 11 000000000001111111111111111
+ 12 0 12 000000000000111111111111111
+ 13 0 13 000000000000011111111111111
+ 14 0 14 000000000000001111111111111
+ 15 0 15 000000000000000111111111111
+ 16 0 16 000000000000000011111111111
+ 17 0 17 000000000000000001111111111
+ 18 0 18 000000000000000000111111111
+ 19 0 19 000000000000000000011111111
+ 20 0 20 000000000000000000001111111
+ 21 0 21 000000000000000000000111111
+ 22 0 22 000000000000000000000011111
+ 23 0 23 000000000000000000000001111
+ 24 0 24 000000000000000000000000111
+ 25 0 25 000000000000000000000000011
+ 26 0 26 000000000000000000000000001
+
+first 0 bit should move right 1 position each line
+ 0 0 -1 000000000000000000000000000
+ 1 1 0 100000000000000000000000000
+ 2 2 0 110000000000000000000000000
+ 3 3 0 111000000000000000000000000
+ 4 4 0 111100000000000000000000000
+ 5 5 0 111110000000000000000000000
+ 6 6 0 111111000000000000000000000
+ 7 7 0 111111100000000000000000000
+ 8 8 0 111111110000000000000000000
+ 9 9 0 111111111000000000000000000
+ 10 10 0 111111111100000000000000000
+ 11 11 0 111111111110000000000000000
+ 12 12 0 111111111111000000000000000
+ 13 13 0 111111111111100000000000000
+ 14 14 0 111111111111110000000000000
+ 15 15 0 111111111111111000000000000
+ 16 16 0 111111111111111100000000000
+ 17 17 0 111111111111111110000000000
+ 18 18 0 111111111111111111000000000
+ 19 19 0 111111111111111111100000000
+ 20 20 0 111111111111111111110000000
+ 21 21 0 111111111111111111111000000
+ 22 22 0 111111111111111111111100000
+ 23 23 0 111111111111111111111110000
+ 24 24 0 111111111111111111111111000
+ 25 25 0 111111111111111111111111100
+ 26 26 0 111111111111111111111111110
+
+first 0 bit should move left 1 position each line
+ 0 -1 0 111111111111111111111111111
+ 1 26 0 111111111111111111111111110
+ 2 25 0 111111111111111111111111100
+ 3 24 0 111111111111111111111111000
+ 4 23 0 111111111111111111111110000
+ 5 22 0 111111111111111111111100000
+ 6 21 0 111111111111111111111000000
+ 7 20 0 111111111111111111110000000
+ 8 19 0 111111111111111111100000000
+ 9 18 0 111111111111111111000000000
+ 10 17 0 111111111111111110000000000
+ 11 16 0 111111111111111100000000000
+ 12 15 0 111111111111111000000000000
+ 13 14 0 111111111111110000000000000
+ 14 13 0 111111111111100000000000000
+ 15 12 0 111111111111000000000000000
+ 16 11 0 111111111110000000000000000
+ 17 10 0 111111111100000000000000000
+ 18 9 0 111111111000000000000000000
+ 19 8 0 111111110000000000000000000
+ 20 7 0 111111100000000000000000000
+ 21 6 0 111111000000000000000000000
+ 22 5 0 111110000000000000000000000
+ 23 4 0 111100000000000000000000000
+ 24 3 0 111000000000000000000000000
+ 25 2 0 110000000000000000000000000
+ 26 1 0 100000000000000000000000000
+
+first 1 bit should move left 1 position each line
+ 0 0 -1 000000000000000000000000000
+ 1 0 26 000000000000000000000000001
+ 2 0 25 000000000000000000000000011
+ 3 0 24 000000000000000000000000111
+ 4 0 23 000000000000000000000001111
+ 5 0 22 000000000000000000000011111
+ 6 0 21 000000000000000000000111111
+ 7 0 20 000000000000000000001111111
+ 8 0 19 000000000000000000011111111
+ 9 0 18 000000000000000000111111111
+ 10 0 17 000000000000000001111111111
+ 11 0 16 000000000000000011111111111
+ 12 0 15 000000000000000111111111111
+ 13 0 14 000000000000001111111111111
+ 14 0 13 000000000000011111111111111
+ 15 0 12 000000000000111111111111111
+ 16 0 11 000000000001111111111111111
+ 17 0 10 000000000011111111111111111
+ 18 0 9 000000000111111111111111111
+ 19 0 8 000000001111111111111111111
+ 20 0 7 000000011111111111111111111
+ 21 0 6 000000111111111111111111111
+ 22 0 5 000001111111111111111111111
+ 23 0 4 000011111111111111111111111
+ 24 0 3 000111111111111111111111111
+ 25 0 2 001111111111111111111111111
+ 26 0 1 011111111111111111111111111
+
+0 bit should move right 1 position each line
+ 0 0 1 011111111111111111111111111
+ 1 1 0 101111111111111111111111111
+ 2 2 0 110111111111111111111111111
+ 3 3 0 111011111111111111111111111
+ 4 4 0 111101111111111111111111111
+ 5 5 0 111110111111111111111111111
+ 6 6 0 111111011111111111111111111
+ 7 7 0 111111101111111111111111111
+ 8 8 0 111111110111111111111111111
+ 9 9 0 111111111011111111111111111
+ 10 10 0 111111111101111111111111111
+ 11 11 0 111111111110111111111111111
+ 12 12 0 111111111111011111111111111
+ 13 13 0 111111111111101111111111111
+ 14 14 0 111111111111110111111111111
+ 15 15 0 111111111111111011111111111
+ 16 16 0 111111111111111101111111111
+ 17 17 0 111111111111111110111111111
+ 18 18 0 111111111111111111011111111
+ 19 19 0 111111111111111111101111111
+ 20 20 0 111111111111111111110111111
+ 21 21 0 111111111111111111111011111
+ 22 22 0 111111111111111111111101111
+ 23 23 0 111111111111111111111110111
+ 24 24 0 111111111111111111111111011
+ 25 25 0 111111111111111111111111101
+ 26 26 0 111111111111111111111111110
+
+1 bit should move right 1 position each line
+ 0 1 0 100000000000000000000000000
+ 1 0 1 010000000000000000000000000
+ 2 0 2 001000000000000000000000000
+ 3 0 3 000100000000000000000000000
+ 4 0 4 000010000000000000000000000
+ 5 0 5 000001000000000000000000000
+ 6 0 6 000000100000000000000000000
+ 7 0 7 000000010000000000000000000
+ 8 0 8 000000001000000000000000000
+ 9 0 9 000000000100000000000000000
+ 10 0 10 000000000010000000000000000
+ 11 0 11 000000000001000000000000000
+ 12 0 12 000000000000100000000000000
+ 13 0 13 000000000000010000000000000
+ 14 0 14 000000000000001000000000000
+ 15 0 15 000000000000000100000000000
+ 16 0 16 000000000000000010000000000
+ 17 0 17 000000000000000001000000000
+ 18 0 18 000000000000000000100000000
+ 19 0 19 000000000000000000010000000
+ 20 0 20 000000000000000000001000000
+ 21 0 21 000000000000000000000100000
+ 22 0 22 000000000000000000000010000
+ 23 0 23 000000000000000000000001000
+ 24 0 24 000000000000000000000000100
+ 25 0 25 000000000000000000000000010
+ 26 0 26 000000000000000000000000001
diff --git a/contrib/netbsd-tests/include/d_bitstring_32.out b/contrib/netbsd-tests/include/d_bitstring_32.out
new file mode 100644
index 0000000..2e1ca55
--- /dev/null
+++ b/contrib/netbsd-tests/include/d_bitstring_32.out
@@ -0,0 +1,303 @@
+Testing with TEST_LENGTH = 32
+
+test _bit_byte, _bit_mask, and bitstr_size
+ i _bit_byte(i) _bit_mask(i) bitstr_size(i)
+ 0 0 1 0
+ 1 0 2 1
+ 2 0 4 1
+ 3 0 8 1
+ 4 0 16 1
+ 5 0 32 1
+ 6 0 64 1
+ 7 0 128 1
+ 8 1 1 1
+ 9 1 2 2
+ 10 1 4 2
+ 11 1 8 2
+ 12 1 16 2
+ 13 1 32 2
+ 14 1 64 2
+ 15 1 128 2
+ 16 2 1 2
+ 17 2 2 3
+ 18 2 4 3
+ 19 2 8 3
+ 20 2 16 3
+ 21 2 32 3
+ 22 2 64 3
+ 23 2 128 3
+ 24 3 1 3
+ 25 3 2 4
+ 26 3 4 4
+ 27 3 8 4
+ 28 3 16 4
+ 29 3 32 4
+ 30 3 64 4
+ 31 3 128 4
+
+test bit_alloc, clearbits, bit_ffc, bit_ffs
+be: 0 -1 00000000000000000000000000000000
+is: 0 -1 00000000000000000000000000000000
+
+test bit_set
+be: 1 0 10010010010010010010010010010010
+is: 1 0 10010010010010010010010010010010
+
+test bit_clear
+be: 0 3 00010000010000010000010000010000
+is: 0 3 00010000010000010000010000010000
+
+test bit_test using previous bitstring
+ i bit_test(i)
+ 0 0
+ 1 0
+ 2 0
+ 3 8
+ 4 0
+ 5 0
+ 6 0
+ 7 0
+ 8 0
+ 9 2
+ 10 0
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 128
+ 16 0
+ 17 0
+ 18 0
+ 19 0
+ 20 0
+ 21 32
+ 22 0
+ 23 0
+ 24 0
+ 25 0
+ 26 0
+ 27 8
+ 28 0
+ 29 0
+ 30 0
+ 31 0
+
+test clearbits
+be: 0 -1 00000000000000000000000000000000
+is: 0 -1 00000000000000000000000000000000
+
+test bit_nset and bit_nclear
+be: 0 1 01111111111111111111111111111110
+is: 0 1 01111111111111111111111111111110
+be: 0 1 01000000000000000000000000000010
+is: 0 1 01000000000000000000000000000010
+be: 0 -1 00000000000000000000000000000000
+is: 0 -1 00000000000000000000000000000000
+be: 31 0 11111111111111111111111111111110
+is: 31 0 11111111111111111111111111111110
+be: 0 -1 00000000000000000000000000000000
+is: 0 -1 00000000000000000000000000000000
+
+first 1 bit should move right 1 position each line
+ 0 -1 0 11111111111111111111111111111111
+ 1 0 1 01111111111111111111111111111111
+ 2 0 2 00111111111111111111111111111111
+ 3 0 3 00011111111111111111111111111111
+ 4 0 4 00001111111111111111111111111111
+ 5 0 5 00000111111111111111111111111111
+ 6 0 6 00000011111111111111111111111111
+ 7 0 7 00000001111111111111111111111111
+ 8 0 8 00000000111111111111111111111111
+ 9 0 9 00000000011111111111111111111111
+ 10 0 10 00000000001111111111111111111111
+ 11 0 11 00000000000111111111111111111111
+ 12 0 12 00000000000011111111111111111111
+ 13 0 13 00000000000001111111111111111111
+ 14 0 14 00000000000000111111111111111111
+ 15 0 15 00000000000000011111111111111111
+ 16 0 16 00000000000000001111111111111111
+ 17 0 17 00000000000000000111111111111111
+ 18 0 18 00000000000000000011111111111111
+ 19 0 19 00000000000000000001111111111111
+ 20 0 20 00000000000000000000111111111111
+ 21 0 21 00000000000000000000011111111111
+ 22 0 22 00000000000000000000001111111111
+ 23 0 23 00000000000000000000000111111111
+ 24 0 24 00000000000000000000000011111111
+ 25 0 25 00000000000000000000000001111111
+ 26 0 26 00000000000000000000000000111111
+ 27 0 27 00000000000000000000000000011111
+ 28 0 28 00000000000000000000000000001111
+ 29 0 29 00000000000000000000000000000111
+ 30 0 30 00000000000000000000000000000011
+ 31 0 31 00000000000000000000000000000001
+
+first 0 bit should move right 1 position each line
+ 0 0 -1 00000000000000000000000000000000
+ 1 1 0 10000000000000000000000000000000
+ 2 2 0 11000000000000000000000000000000
+ 3 3 0 11100000000000000000000000000000
+ 4 4 0 11110000000000000000000000000000
+ 5 5 0 11111000000000000000000000000000
+ 6 6 0 11111100000000000000000000000000
+ 7 7 0 11111110000000000000000000000000
+ 8 8 0 11111111000000000000000000000000
+ 9 9 0 11111111100000000000000000000000
+ 10 10 0 11111111110000000000000000000000
+ 11 11 0 11111111111000000000000000000000
+ 12 12 0 11111111111100000000000000000000
+ 13 13 0 11111111111110000000000000000000
+ 14 14 0 11111111111111000000000000000000
+ 15 15 0 11111111111111100000000000000000
+ 16 16 0 11111111111111110000000000000000
+ 17 17 0 11111111111111111000000000000000
+ 18 18 0 11111111111111111100000000000000
+ 19 19 0 11111111111111111110000000000000
+ 20 20 0 11111111111111111111000000000000
+ 21 21 0 11111111111111111111100000000000
+ 22 22 0 11111111111111111111110000000000
+ 23 23 0 11111111111111111111111000000000
+ 24 24 0 11111111111111111111111100000000
+ 25 25 0 11111111111111111111111110000000
+ 26 26 0 11111111111111111111111111000000
+ 27 27 0 11111111111111111111111111100000
+ 28 28 0 11111111111111111111111111110000
+ 29 29 0 11111111111111111111111111111000
+ 30 30 0 11111111111111111111111111111100
+ 31 31 0 11111111111111111111111111111110
+
+first 0 bit should move left 1 position each line
+ 0 -1 0 11111111111111111111111111111111
+ 1 31 0 11111111111111111111111111111110
+ 2 30 0 11111111111111111111111111111100
+ 3 29 0 11111111111111111111111111111000
+ 4 28 0 11111111111111111111111111110000
+ 5 27 0 11111111111111111111111111100000
+ 6 26 0 11111111111111111111111111000000
+ 7 25 0 11111111111111111111111110000000
+ 8 24 0 11111111111111111111111100000000
+ 9 23 0 11111111111111111111111000000000
+ 10 22 0 11111111111111111111110000000000
+ 11 21 0 11111111111111111111100000000000
+ 12 20 0 11111111111111111111000000000000
+ 13 19 0 11111111111111111110000000000000
+ 14 18 0 11111111111111111100000000000000
+ 15 17 0 11111111111111111000000000000000
+ 16 16 0 11111111111111110000000000000000
+ 17 15 0 11111111111111100000000000000000
+ 18 14 0 11111111111111000000000000000000
+ 19 13 0 11111111111110000000000000000000
+ 20 12 0 11111111111100000000000000000000
+ 21 11 0 11111111111000000000000000000000
+ 22 10 0 11111111110000000000000000000000
+ 23 9 0 11111111100000000000000000000000
+ 24 8 0 11111111000000000000000000000000
+ 25 7 0 11111110000000000000000000000000
+ 26 6 0 11111100000000000000000000000000
+ 27 5 0 11111000000000000000000000000000
+ 28 4 0 11110000000000000000000000000000
+ 29 3 0 11100000000000000000000000000000
+ 30 2 0 11000000000000000000000000000000
+ 31 1 0 10000000000000000000000000000000
+
+first 1 bit should move left 1 position each line
+ 0 0 -1 00000000000000000000000000000000
+ 1 0 31 00000000000000000000000000000001
+ 2 0 30 00000000000000000000000000000011
+ 3 0 29 00000000000000000000000000000111
+ 4 0 28 00000000000000000000000000001111
+ 5 0 27 00000000000000000000000000011111
+ 6 0 26 00000000000000000000000000111111
+ 7 0 25 00000000000000000000000001111111
+ 8 0 24 00000000000000000000000011111111
+ 9 0 23 00000000000000000000000111111111
+ 10 0 22 00000000000000000000001111111111
+ 11 0 21 00000000000000000000011111111111
+ 12 0 20 00000000000000000000111111111111
+ 13 0 19 00000000000000000001111111111111
+ 14 0 18 00000000000000000011111111111111
+ 15 0 17 00000000000000000111111111111111
+ 16 0 16 00000000000000001111111111111111
+ 17 0 15 00000000000000011111111111111111
+ 18 0 14 00000000000000111111111111111111
+ 19 0 13 00000000000001111111111111111111
+ 20 0 12 00000000000011111111111111111111
+ 21 0 11 00000000000111111111111111111111
+ 22 0 10 00000000001111111111111111111111
+ 23 0 9 00000000011111111111111111111111
+ 24 0 8 00000000111111111111111111111111
+ 25 0 7 00000001111111111111111111111111
+ 26 0 6 00000011111111111111111111111111
+ 27 0 5 00000111111111111111111111111111
+ 28 0 4 00001111111111111111111111111111
+ 29 0 3 00011111111111111111111111111111
+ 30 0 2 00111111111111111111111111111111
+ 31 0 1 01111111111111111111111111111111
+
+0 bit should move right 1 position each line
+ 0 0 1 01111111111111111111111111111111
+ 1 1 0 10111111111111111111111111111111
+ 2 2 0 11011111111111111111111111111111
+ 3 3 0 11101111111111111111111111111111
+ 4 4 0 11110111111111111111111111111111
+ 5 5 0 11111011111111111111111111111111
+ 6 6 0 11111101111111111111111111111111
+ 7 7 0 11111110111111111111111111111111
+ 8 8 0 11111111011111111111111111111111
+ 9 9 0 11111111101111111111111111111111
+ 10 10 0 11111111110111111111111111111111
+ 11 11 0 11111111111011111111111111111111
+ 12 12 0 11111111111101111111111111111111
+ 13 13 0 11111111111110111111111111111111
+ 14 14 0 11111111111111011111111111111111
+ 15 15 0 11111111111111101111111111111111
+ 16 16 0 11111111111111110111111111111111
+ 17 17 0 11111111111111111011111111111111
+ 18 18 0 11111111111111111101111111111111
+ 19 19 0 11111111111111111110111111111111
+ 20 20 0 11111111111111111111011111111111
+ 21 21 0 11111111111111111111101111111111
+ 22 22 0 11111111111111111111110111111111
+ 23 23 0 11111111111111111111111011111111
+ 24 24 0 11111111111111111111111101111111
+ 25 25 0 11111111111111111111111110111111
+ 26 26 0 11111111111111111111111111011111
+ 27 27 0 11111111111111111111111111101111
+ 28 28 0 11111111111111111111111111110111
+ 29 29 0 11111111111111111111111111111011
+ 30 30 0 11111111111111111111111111111101
+ 31 31 0 11111111111111111111111111111110
+
+1 bit should move right 1 position each line
+ 0 1 0 10000000000000000000000000000000
+ 1 0 1 01000000000000000000000000000000
+ 2 0 2 00100000000000000000000000000000
+ 3 0 3 00010000000000000000000000000000
+ 4 0 4 00001000000000000000000000000000
+ 5 0 5 00000100000000000000000000000000
+ 6 0 6 00000010000000000000000000000000
+ 7 0 7 00000001000000000000000000000000
+ 8 0 8 00000000100000000000000000000000
+ 9 0 9 00000000010000000000000000000000
+ 10 0 10 00000000001000000000000000000000
+ 11 0 11 00000000000100000000000000000000
+ 12 0 12 00000000000010000000000000000000
+ 13 0 13 00000000000001000000000000000000
+ 14 0 14 00000000000000100000000000000000
+ 15 0 15 00000000000000010000000000000000
+ 16 0 16 00000000000000001000000000000000
+ 17 0 17 00000000000000000100000000000000
+ 18 0 18 00000000000000000010000000000000
+ 19 0 19 00000000000000000001000000000000
+ 20 0 20 00000000000000000000100000000000
+ 21 0 21 00000000000000000000010000000000
+ 22 0 22 00000000000000000000001000000000
+ 23 0 23 00000000000000000000000100000000
+ 24 0 24 00000000000000000000000010000000
+ 25 0 25 00000000000000000000000001000000
+ 26 0 26 00000000000000000000000000100000
+ 27 0 27 00000000000000000000000000010000
+ 28 0 28 00000000000000000000000000001000
+ 29 0 29 00000000000000000000000000000100
+ 30 0 30 00000000000000000000000000000010
+ 31 0 31 00000000000000000000000000000001
diff --git a/contrib/netbsd-tests/include/d_bitstring_49.out b/contrib/netbsd-tests/include/d_bitstring_49.out
new file mode 100644
index 0000000..d63c069
--- /dev/null
+++ b/contrib/netbsd-tests/include/d_bitstring_49.out
@@ -0,0 +1,439 @@
+Testing with TEST_LENGTH = 49
+
+test _bit_byte, _bit_mask, and bitstr_size
+ i _bit_byte(i) _bit_mask(i) bitstr_size(i)
+ 0 0 1 0
+ 1 0 2 1
+ 2 0 4 1
+ 3 0 8 1
+ 4 0 16 1
+ 5 0 32 1
+ 6 0 64 1
+ 7 0 128 1
+ 8 1 1 1
+ 9 1 2 2
+ 10 1 4 2
+ 11 1 8 2
+ 12 1 16 2
+ 13 1 32 2
+ 14 1 64 2
+ 15 1 128 2
+ 16 2 1 2
+ 17 2 2 3
+ 18 2 4 3
+ 19 2 8 3
+ 20 2 16 3
+ 21 2 32 3
+ 22 2 64 3
+ 23 2 128 3
+ 24 3 1 3
+ 25 3 2 4
+ 26 3 4 4
+ 27 3 8 4
+ 28 3 16 4
+ 29 3 32 4
+ 30 3 64 4
+ 31 3 128 4
+ 32 4 1 4
+ 33 4 2 5
+ 34 4 4 5
+ 35 4 8 5
+ 36 4 16 5
+ 37 4 32 5
+ 38 4 64 5
+ 39 4 128 5
+ 40 5 1 5
+ 41 5 2 6
+ 42 5 4 6
+ 43 5 8 6
+ 44 5 16 6
+ 45 5 32 6
+ 46 5 64 6
+ 47 5 128 6
+ 48 6 1 6
+
+test bit_alloc, clearbits, bit_ffc, bit_ffs
+be: 0 -1 0000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000
+
+test bit_set
+be: 1 0 1001001001001001001001001001001001001001001001001
+is: 1 0 1001001001001001001001001001001001001001001001001
+
+test bit_clear
+be: 0 3 0001000001000001000001000001000001000001000001000
+is: 0 3 0001000001000001000001000001000001000001000001000
+
+test bit_test using previous bitstring
+ i bit_test(i)
+ 0 0
+ 1 0
+ 2 0
+ 3 8
+ 4 0
+ 5 0
+ 6 0
+ 7 0
+ 8 0
+ 9 2
+ 10 0
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 128
+ 16 0
+ 17 0
+ 18 0
+ 19 0
+ 20 0
+ 21 32
+ 22 0
+ 23 0
+ 24 0
+ 25 0
+ 26 0
+ 27 8
+ 28 0
+ 29 0
+ 30 0
+ 31 0
+ 32 0
+ 33 2
+ 34 0
+ 35 0
+ 36 0
+ 37 0
+ 38 0
+ 39 128
+ 40 0
+ 41 0
+ 42 0
+ 43 0
+ 44 0
+ 45 32
+ 46 0
+ 47 0
+ 48 0
+
+test clearbits
+be: 0 -1 0000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000
+
+test bit_nset and bit_nclear
+be: 0 1 0111111111111111111111111111111111111111111111110
+is: 0 1 0111111111111111111111111111111111111111111111110
+be: 0 1 0100000000000000000000000000000000000000000000010
+is: 0 1 0100000000000000000000000000000000000000000000010
+be: 0 -1 0000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000
+be: 48 0 1111111111111111111111111111111111111111111111110
+is: 48 0 1111111111111111111111111111111111111111111111110
+be: 0 -1 0000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000
+
+first 1 bit should move right 1 position each line
+ 0 -1 0 1111111111111111111111111111111111111111111111111
+ 1 0 1 0111111111111111111111111111111111111111111111111
+ 2 0 2 0011111111111111111111111111111111111111111111111
+ 3 0 3 0001111111111111111111111111111111111111111111111
+ 4 0 4 0000111111111111111111111111111111111111111111111
+ 5 0 5 0000011111111111111111111111111111111111111111111
+ 6 0 6 0000001111111111111111111111111111111111111111111
+ 7 0 7 0000000111111111111111111111111111111111111111111
+ 8 0 8 0000000011111111111111111111111111111111111111111
+ 9 0 9 0000000001111111111111111111111111111111111111111
+ 10 0 10 0000000000111111111111111111111111111111111111111
+ 11 0 11 0000000000011111111111111111111111111111111111111
+ 12 0 12 0000000000001111111111111111111111111111111111111
+ 13 0 13 0000000000000111111111111111111111111111111111111
+ 14 0 14 0000000000000011111111111111111111111111111111111
+ 15 0 15 0000000000000001111111111111111111111111111111111
+ 16 0 16 0000000000000000111111111111111111111111111111111
+ 17 0 17 0000000000000000011111111111111111111111111111111
+ 18 0 18 0000000000000000001111111111111111111111111111111
+ 19 0 19 0000000000000000000111111111111111111111111111111
+ 20 0 20 0000000000000000000011111111111111111111111111111
+ 21 0 21 0000000000000000000001111111111111111111111111111
+ 22 0 22 0000000000000000000000111111111111111111111111111
+ 23 0 23 0000000000000000000000011111111111111111111111111
+ 24 0 24 0000000000000000000000001111111111111111111111111
+ 25 0 25 0000000000000000000000000111111111111111111111111
+ 26 0 26 0000000000000000000000000011111111111111111111111
+ 27 0 27 0000000000000000000000000001111111111111111111111
+ 28 0 28 0000000000000000000000000000111111111111111111111
+ 29 0 29 0000000000000000000000000000011111111111111111111
+ 30 0 30 0000000000000000000000000000001111111111111111111
+ 31 0 31 0000000000000000000000000000000111111111111111111
+ 32 0 32 0000000000000000000000000000000011111111111111111
+ 33 0 33 0000000000000000000000000000000001111111111111111
+ 34 0 34 0000000000000000000000000000000000111111111111111
+ 35 0 35 0000000000000000000000000000000000011111111111111
+ 36 0 36 0000000000000000000000000000000000001111111111111
+ 37 0 37 0000000000000000000000000000000000000111111111111
+ 38 0 38 0000000000000000000000000000000000000011111111111
+ 39 0 39 0000000000000000000000000000000000000001111111111
+ 40 0 40 0000000000000000000000000000000000000000111111111
+ 41 0 41 0000000000000000000000000000000000000000011111111
+ 42 0 42 0000000000000000000000000000000000000000001111111
+ 43 0 43 0000000000000000000000000000000000000000000111111
+ 44 0 44 0000000000000000000000000000000000000000000011111
+ 45 0 45 0000000000000000000000000000000000000000000001111
+ 46 0 46 0000000000000000000000000000000000000000000000111
+ 47 0 47 0000000000000000000000000000000000000000000000011
+ 48 0 48 0000000000000000000000000000000000000000000000001
+
+first 0 bit should move right 1 position each line
+ 0 0 -1 0000000000000000000000000000000000000000000000000
+ 1 1 0 1000000000000000000000000000000000000000000000000
+ 2 2 0 1100000000000000000000000000000000000000000000000
+ 3 3 0 1110000000000000000000000000000000000000000000000
+ 4 4 0 1111000000000000000000000000000000000000000000000
+ 5 5 0 1111100000000000000000000000000000000000000000000
+ 6 6 0 1111110000000000000000000000000000000000000000000
+ 7 7 0 1111111000000000000000000000000000000000000000000
+ 8 8 0 1111111100000000000000000000000000000000000000000
+ 9 9 0 1111111110000000000000000000000000000000000000000
+ 10 10 0 1111111111000000000000000000000000000000000000000
+ 11 11 0 1111111111100000000000000000000000000000000000000
+ 12 12 0 1111111111110000000000000000000000000000000000000
+ 13 13 0 1111111111111000000000000000000000000000000000000
+ 14 14 0 1111111111111100000000000000000000000000000000000
+ 15 15 0 1111111111111110000000000000000000000000000000000
+ 16 16 0 1111111111111111000000000000000000000000000000000
+ 17 17 0 1111111111111111100000000000000000000000000000000
+ 18 18 0 1111111111111111110000000000000000000000000000000
+ 19 19 0 1111111111111111111000000000000000000000000000000
+ 20 20 0 1111111111111111111100000000000000000000000000000
+ 21 21 0 1111111111111111111110000000000000000000000000000
+ 22 22 0 1111111111111111111111000000000000000000000000000
+ 23 23 0 1111111111111111111111100000000000000000000000000
+ 24 24 0 1111111111111111111111110000000000000000000000000
+ 25 25 0 1111111111111111111111111000000000000000000000000
+ 26 26 0 1111111111111111111111111100000000000000000000000
+ 27 27 0 1111111111111111111111111110000000000000000000000
+ 28 28 0 1111111111111111111111111111000000000000000000000
+ 29 29 0 1111111111111111111111111111100000000000000000000
+ 30 30 0 1111111111111111111111111111110000000000000000000
+ 31 31 0 1111111111111111111111111111111000000000000000000
+ 32 32 0 1111111111111111111111111111111100000000000000000
+ 33 33 0 1111111111111111111111111111111110000000000000000
+ 34 34 0 1111111111111111111111111111111111000000000000000
+ 35 35 0 1111111111111111111111111111111111100000000000000
+ 36 36 0 1111111111111111111111111111111111110000000000000
+ 37 37 0 1111111111111111111111111111111111111000000000000
+ 38 38 0 1111111111111111111111111111111111111100000000000
+ 39 39 0 1111111111111111111111111111111111111110000000000
+ 40 40 0 1111111111111111111111111111111111111111000000000
+ 41 41 0 1111111111111111111111111111111111111111100000000
+ 42 42 0 1111111111111111111111111111111111111111110000000
+ 43 43 0 1111111111111111111111111111111111111111111000000
+ 44 44 0 1111111111111111111111111111111111111111111100000
+ 45 45 0 1111111111111111111111111111111111111111111110000
+ 46 46 0 1111111111111111111111111111111111111111111111000
+ 47 47 0 1111111111111111111111111111111111111111111111100
+ 48 48 0 1111111111111111111111111111111111111111111111110
+
+first 0 bit should move left 1 position each line
+ 0 -1 0 1111111111111111111111111111111111111111111111111
+ 1 48 0 1111111111111111111111111111111111111111111111110
+ 2 47 0 1111111111111111111111111111111111111111111111100
+ 3 46 0 1111111111111111111111111111111111111111111111000
+ 4 45 0 1111111111111111111111111111111111111111111110000
+ 5 44 0 1111111111111111111111111111111111111111111100000
+ 6 43 0 1111111111111111111111111111111111111111111000000
+ 7 42 0 1111111111111111111111111111111111111111110000000
+ 8 41 0 1111111111111111111111111111111111111111100000000
+ 9 40 0 1111111111111111111111111111111111111111000000000
+ 10 39 0 1111111111111111111111111111111111111110000000000
+ 11 38 0 1111111111111111111111111111111111111100000000000
+ 12 37 0 1111111111111111111111111111111111111000000000000
+ 13 36 0 1111111111111111111111111111111111110000000000000
+ 14 35 0 1111111111111111111111111111111111100000000000000
+ 15 34 0 1111111111111111111111111111111111000000000000000
+ 16 33 0 1111111111111111111111111111111110000000000000000
+ 17 32 0 1111111111111111111111111111111100000000000000000
+ 18 31 0 1111111111111111111111111111111000000000000000000
+ 19 30 0 1111111111111111111111111111110000000000000000000
+ 20 29 0 1111111111111111111111111111100000000000000000000
+ 21 28 0 1111111111111111111111111111000000000000000000000
+ 22 27 0 1111111111111111111111111110000000000000000000000
+ 23 26 0 1111111111111111111111111100000000000000000000000
+ 24 25 0 1111111111111111111111111000000000000000000000000
+ 25 24 0 1111111111111111111111110000000000000000000000000
+ 26 23 0 1111111111111111111111100000000000000000000000000
+ 27 22 0 1111111111111111111111000000000000000000000000000
+ 28 21 0 1111111111111111111110000000000000000000000000000
+ 29 20 0 1111111111111111111100000000000000000000000000000
+ 30 19 0 1111111111111111111000000000000000000000000000000
+ 31 18 0 1111111111111111110000000000000000000000000000000
+ 32 17 0 1111111111111111100000000000000000000000000000000
+ 33 16 0 1111111111111111000000000000000000000000000000000
+ 34 15 0 1111111111111110000000000000000000000000000000000
+ 35 14 0 1111111111111100000000000000000000000000000000000
+ 36 13 0 1111111111111000000000000000000000000000000000000
+ 37 12 0 1111111111110000000000000000000000000000000000000
+ 38 11 0 1111111111100000000000000000000000000000000000000
+ 39 10 0 1111111111000000000000000000000000000000000000000
+ 40 9 0 1111111110000000000000000000000000000000000000000
+ 41 8 0 1111111100000000000000000000000000000000000000000
+ 42 7 0 1111111000000000000000000000000000000000000000000
+ 43 6 0 1111110000000000000000000000000000000000000000000
+ 44 5 0 1111100000000000000000000000000000000000000000000
+ 45 4 0 1111000000000000000000000000000000000000000000000
+ 46 3 0 1110000000000000000000000000000000000000000000000
+ 47 2 0 1100000000000000000000000000000000000000000000000
+ 48 1 0 1000000000000000000000000000000000000000000000000
+
+first 1 bit should move left 1 position each line
+ 0 0 -1 0000000000000000000000000000000000000000000000000
+ 1 0 48 0000000000000000000000000000000000000000000000001
+ 2 0 47 0000000000000000000000000000000000000000000000011
+ 3 0 46 0000000000000000000000000000000000000000000000111
+ 4 0 45 0000000000000000000000000000000000000000000001111
+ 5 0 44 0000000000000000000000000000000000000000000011111
+ 6 0 43 0000000000000000000000000000000000000000000111111
+ 7 0 42 0000000000000000000000000000000000000000001111111
+ 8 0 41 0000000000000000000000000000000000000000011111111
+ 9 0 40 0000000000000000000000000000000000000000111111111
+ 10 0 39 0000000000000000000000000000000000000001111111111
+ 11 0 38 0000000000000000000000000000000000000011111111111
+ 12 0 37 0000000000000000000000000000000000000111111111111
+ 13 0 36 0000000000000000000000000000000000001111111111111
+ 14 0 35 0000000000000000000000000000000000011111111111111
+ 15 0 34 0000000000000000000000000000000000111111111111111
+ 16 0 33 0000000000000000000000000000000001111111111111111
+ 17 0 32 0000000000000000000000000000000011111111111111111
+ 18 0 31 0000000000000000000000000000000111111111111111111
+ 19 0 30 0000000000000000000000000000001111111111111111111
+ 20 0 29 0000000000000000000000000000011111111111111111111
+ 21 0 28 0000000000000000000000000000111111111111111111111
+ 22 0 27 0000000000000000000000000001111111111111111111111
+ 23 0 26 0000000000000000000000000011111111111111111111111
+ 24 0 25 0000000000000000000000000111111111111111111111111
+ 25 0 24 0000000000000000000000001111111111111111111111111
+ 26 0 23 0000000000000000000000011111111111111111111111111
+ 27 0 22 0000000000000000000000111111111111111111111111111
+ 28 0 21 0000000000000000000001111111111111111111111111111
+ 29 0 20 0000000000000000000011111111111111111111111111111
+ 30 0 19 0000000000000000000111111111111111111111111111111
+ 31 0 18 0000000000000000001111111111111111111111111111111
+ 32 0 17 0000000000000000011111111111111111111111111111111
+ 33 0 16 0000000000000000111111111111111111111111111111111
+ 34 0 15 0000000000000001111111111111111111111111111111111
+ 35 0 14 0000000000000011111111111111111111111111111111111
+ 36 0 13 0000000000000111111111111111111111111111111111111
+ 37 0 12 0000000000001111111111111111111111111111111111111
+ 38 0 11 0000000000011111111111111111111111111111111111111
+ 39 0 10 0000000000111111111111111111111111111111111111111
+ 40 0 9 0000000001111111111111111111111111111111111111111
+ 41 0 8 0000000011111111111111111111111111111111111111111
+ 42 0 7 0000000111111111111111111111111111111111111111111
+ 43 0 6 0000001111111111111111111111111111111111111111111
+ 44 0 5 0000011111111111111111111111111111111111111111111
+ 45 0 4 0000111111111111111111111111111111111111111111111
+ 46 0 3 0001111111111111111111111111111111111111111111111
+ 47 0 2 0011111111111111111111111111111111111111111111111
+ 48 0 1 0111111111111111111111111111111111111111111111111
+
+0 bit should move right 1 position each line
+ 0 0 1 0111111111111111111111111111111111111111111111111
+ 1 1 0 1011111111111111111111111111111111111111111111111
+ 2 2 0 1101111111111111111111111111111111111111111111111
+ 3 3 0 1110111111111111111111111111111111111111111111111
+ 4 4 0 1111011111111111111111111111111111111111111111111
+ 5 5 0 1111101111111111111111111111111111111111111111111
+ 6 6 0 1111110111111111111111111111111111111111111111111
+ 7 7 0 1111111011111111111111111111111111111111111111111
+ 8 8 0 1111111101111111111111111111111111111111111111111
+ 9 9 0 1111111110111111111111111111111111111111111111111
+ 10 10 0 1111111111011111111111111111111111111111111111111
+ 11 11 0 1111111111101111111111111111111111111111111111111
+ 12 12 0 1111111111110111111111111111111111111111111111111
+ 13 13 0 1111111111111011111111111111111111111111111111111
+ 14 14 0 1111111111111101111111111111111111111111111111111
+ 15 15 0 1111111111111110111111111111111111111111111111111
+ 16 16 0 1111111111111111011111111111111111111111111111111
+ 17 17 0 1111111111111111101111111111111111111111111111111
+ 18 18 0 1111111111111111110111111111111111111111111111111
+ 19 19 0 1111111111111111111011111111111111111111111111111
+ 20 20 0 1111111111111111111101111111111111111111111111111
+ 21 21 0 1111111111111111111110111111111111111111111111111
+ 22 22 0 1111111111111111111111011111111111111111111111111
+ 23 23 0 1111111111111111111111101111111111111111111111111
+ 24 24 0 1111111111111111111111110111111111111111111111111
+ 25 25 0 1111111111111111111111111011111111111111111111111
+ 26 26 0 1111111111111111111111111101111111111111111111111
+ 27 27 0 1111111111111111111111111110111111111111111111111
+ 28 28 0 1111111111111111111111111111011111111111111111111
+ 29 29 0 1111111111111111111111111111101111111111111111111
+ 30 30 0 1111111111111111111111111111110111111111111111111
+ 31 31 0 1111111111111111111111111111111011111111111111111
+ 32 32 0 1111111111111111111111111111111101111111111111111
+ 33 33 0 1111111111111111111111111111111110111111111111111
+ 34 34 0 1111111111111111111111111111111111011111111111111
+ 35 35 0 1111111111111111111111111111111111101111111111111
+ 36 36 0 1111111111111111111111111111111111110111111111111
+ 37 37 0 1111111111111111111111111111111111111011111111111
+ 38 38 0 1111111111111111111111111111111111111101111111111
+ 39 39 0 1111111111111111111111111111111111111110111111111
+ 40 40 0 1111111111111111111111111111111111111111011111111
+ 41 41 0 1111111111111111111111111111111111111111101111111
+ 42 42 0 1111111111111111111111111111111111111111110111111
+ 43 43 0 1111111111111111111111111111111111111111111011111
+ 44 44 0 1111111111111111111111111111111111111111111101111
+ 45 45 0 1111111111111111111111111111111111111111111110111
+ 46 46 0 1111111111111111111111111111111111111111111111011
+ 47 47 0 1111111111111111111111111111111111111111111111101
+ 48 48 0 1111111111111111111111111111111111111111111111110
+
+1 bit should move right 1 position each line
+ 0 1 0 1000000000000000000000000000000000000000000000000
+ 1 0 1 0100000000000000000000000000000000000000000000000
+ 2 0 2 0010000000000000000000000000000000000000000000000
+ 3 0 3 0001000000000000000000000000000000000000000000000
+ 4 0 4 0000100000000000000000000000000000000000000000000
+ 5 0 5 0000010000000000000000000000000000000000000000000
+ 6 0 6 0000001000000000000000000000000000000000000000000
+ 7 0 7 0000000100000000000000000000000000000000000000000
+ 8 0 8 0000000010000000000000000000000000000000000000000
+ 9 0 9 0000000001000000000000000000000000000000000000000
+ 10 0 10 0000000000100000000000000000000000000000000000000
+ 11 0 11 0000000000010000000000000000000000000000000000000
+ 12 0 12 0000000000001000000000000000000000000000000000000
+ 13 0 13 0000000000000100000000000000000000000000000000000
+ 14 0 14 0000000000000010000000000000000000000000000000000
+ 15 0 15 0000000000000001000000000000000000000000000000000
+ 16 0 16 0000000000000000100000000000000000000000000000000
+ 17 0 17 0000000000000000010000000000000000000000000000000
+ 18 0 18 0000000000000000001000000000000000000000000000000
+ 19 0 19 0000000000000000000100000000000000000000000000000
+ 20 0 20 0000000000000000000010000000000000000000000000000
+ 21 0 21 0000000000000000000001000000000000000000000000000
+ 22 0 22 0000000000000000000000100000000000000000000000000
+ 23 0 23 0000000000000000000000010000000000000000000000000
+ 24 0 24 0000000000000000000000001000000000000000000000000
+ 25 0 25 0000000000000000000000000100000000000000000000000
+ 26 0 26 0000000000000000000000000010000000000000000000000
+ 27 0 27 0000000000000000000000000001000000000000000000000
+ 28 0 28 0000000000000000000000000000100000000000000000000
+ 29 0 29 0000000000000000000000000000010000000000000000000
+ 30 0 30 0000000000000000000000000000001000000000000000000
+ 31 0 31 0000000000000000000000000000000100000000000000000
+ 32 0 32 0000000000000000000000000000000010000000000000000
+ 33 0 33 0000000000000000000000000000000001000000000000000
+ 34 0 34 0000000000000000000000000000000000100000000000000
+ 35 0 35 0000000000000000000000000000000000010000000000000
+ 36 0 36 0000000000000000000000000000000000001000000000000
+ 37 0 37 0000000000000000000000000000000000000100000000000
+ 38 0 38 0000000000000000000000000000000000000010000000000
+ 39 0 39 0000000000000000000000000000000000000001000000000
+ 40 0 40 0000000000000000000000000000000000000000100000000
+ 41 0 41 0000000000000000000000000000000000000000010000000
+ 42 0 42 0000000000000000000000000000000000000000001000000
+ 43 0 43 0000000000000000000000000000000000000000000100000
+ 44 0 44 0000000000000000000000000000000000000000000010000
+ 45 0 45 0000000000000000000000000000000000000000000001000
+ 46 0 46 0000000000000000000000000000000000000000000000100
+ 47 0 47 0000000000000000000000000000000000000000000000010
+ 48 0 48 0000000000000000000000000000000000000000000000001
diff --git a/contrib/netbsd-tests/include/d_bitstring_64.out b/contrib/netbsd-tests/include/d_bitstring_64.out
new file mode 100644
index 0000000..7e9308e
--- /dev/null
+++ b/contrib/netbsd-tests/include/d_bitstring_64.out
@@ -0,0 +1,559 @@
+Testing with TEST_LENGTH = 64
+
+test _bit_byte, _bit_mask, and bitstr_size
+ i _bit_byte(i) _bit_mask(i) bitstr_size(i)
+ 0 0 1 0
+ 1 0 2 1
+ 2 0 4 1
+ 3 0 8 1
+ 4 0 16 1
+ 5 0 32 1
+ 6 0 64 1
+ 7 0 128 1
+ 8 1 1 1
+ 9 1 2 2
+ 10 1 4 2
+ 11 1 8 2
+ 12 1 16 2
+ 13 1 32 2
+ 14 1 64 2
+ 15 1 128 2
+ 16 2 1 2
+ 17 2 2 3
+ 18 2 4 3
+ 19 2 8 3
+ 20 2 16 3
+ 21 2 32 3
+ 22 2 64 3
+ 23 2 128 3
+ 24 3 1 3
+ 25 3 2 4
+ 26 3 4 4
+ 27 3 8 4
+ 28 3 16 4
+ 29 3 32 4
+ 30 3 64 4
+ 31 3 128 4
+ 32 4 1 4
+ 33 4 2 5
+ 34 4 4 5
+ 35 4 8 5
+ 36 4 16 5
+ 37 4 32 5
+ 38 4 64 5
+ 39 4 128 5
+ 40 5 1 5
+ 41 5 2 6
+ 42 5 4 6
+ 43 5 8 6
+ 44 5 16 6
+ 45 5 32 6
+ 46 5 64 6
+ 47 5 128 6
+ 48 6 1 6
+ 49 6 2 7
+ 50 6 4 7
+ 51 6 8 7
+ 52 6 16 7
+ 53 6 32 7
+ 54 6 64 7
+ 55 6 128 7
+ 56 7 1 7
+ 57 7 2 8
+ 58 7 4 8
+ 59 7 8 8
+ 60 7 16 8
+ 61 7 32 8
+ 62 7 64 8
+ 63 7 128 8
+
+test bit_alloc, clearbits, bit_ffc, bit_ffs
+be: 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+
+test bit_set
+be: 1 0 1001001001001001001001001001001001001001001001001001001001001001
+is: 1 0 1001001001001001001001001001001001001001001001001001001001001001
+
+test bit_clear
+be: 0 3 0001000001000001000001000001000001000001000001000001000001000001
+is: 0 3 0001000001000001000001000001000001000001000001000001000001000001
+
+test bit_test using previous bitstring
+ i bit_test(i)
+ 0 0
+ 1 0
+ 2 0
+ 3 8
+ 4 0
+ 5 0
+ 6 0
+ 7 0
+ 8 0
+ 9 2
+ 10 0
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 128
+ 16 0
+ 17 0
+ 18 0
+ 19 0
+ 20 0
+ 21 32
+ 22 0
+ 23 0
+ 24 0
+ 25 0
+ 26 0
+ 27 8
+ 28 0
+ 29 0
+ 30 0
+ 31 0
+ 32 0
+ 33 2
+ 34 0
+ 35 0
+ 36 0
+ 37 0
+ 38 0
+ 39 128
+ 40 0
+ 41 0
+ 42 0
+ 43 0
+ 44 0
+ 45 32
+ 46 0
+ 47 0
+ 48 0
+ 49 0
+ 50 0
+ 51 8
+ 52 0
+ 53 0
+ 54 0
+ 55 0
+ 56 0
+ 57 2
+ 58 0
+ 59 0
+ 60 0
+ 61 0
+ 62 0
+ 63 128
+
+test clearbits
+be: 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+
+test bit_nset and bit_nclear
+be: 0 1 0111111111111111111111111111111111111111111111111111111111111110
+is: 0 1 0111111111111111111111111111111111111111111111111111111111111110
+be: 0 1 0100000000000000000000000000000000000000000000000000000000000010
+is: 0 1 0100000000000000000000000000000000000000000000000000000000000010
+be: 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+be: 63 0 1111111111111111111111111111111111111111111111111111111111111110
+is: 63 0 1111111111111111111111111111111111111111111111111111111111111110
+be: 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+
+first 1 bit should move right 1 position each line
+ 0 -1 0 1111111111111111111111111111111111111111111111111111111111111111
+ 1 0 1 0111111111111111111111111111111111111111111111111111111111111111
+ 2 0 2 0011111111111111111111111111111111111111111111111111111111111111
+ 3 0 3 0001111111111111111111111111111111111111111111111111111111111111
+ 4 0 4 0000111111111111111111111111111111111111111111111111111111111111
+ 5 0 5 0000011111111111111111111111111111111111111111111111111111111111
+ 6 0 6 0000001111111111111111111111111111111111111111111111111111111111
+ 7 0 7 0000000111111111111111111111111111111111111111111111111111111111
+ 8 0 8 0000000011111111111111111111111111111111111111111111111111111111
+ 9 0 9 0000000001111111111111111111111111111111111111111111111111111111
+ 10 0 10 0000000000111111111111111111111111111111111111111111111111111111
+ 11 0 11 0000000000011111111111111111111111111111111111111111111111111111
+ 12 0 12 0000000000001111111111111111111111111111111111111111111111111111
+ 13 0 13 0000000000000111111111111111111111111111111111111111111111111111
+ 14 0 14 0000000000000011111111111111111111111111111111111111111111111111
+ 15 0 15 0000000000000001111111111111111111111111111111111111111111111111
+ 16 0 16 0000000000000000111111111111111111111111111111111111111111111111
+ 17 0 17 0000000000000000011111111111111111111111111111111111111111111111
+ 18 0 18 0000000000000000001111111111111111111111111111111111111111111111
+ 19 0 19 0000000000000000000111111111111111111111111111111111111111111111
+ 20 0 20 0000000000000000000011111111111111111111111111111111111111111111
+ 21 0 21 0000000000000000000001111111111111111111111111111111111111111111
+ 22 0 22 0000000000000000000000111111111111111111111111111111111111111111
+ 23 0 23 0000000000000000000000011111111111111111111111111111111111111111
+ 24 0 24 0000000000000000000000001111111111111111111111111111111111111111
+ 25 0 25 0000000000000000000000000111111111111111111111111111111111111111
+ 26 0 26 0000000000000000000000000011111111111111111111111111111111111111
+ 27 0 27 0000000000000000000000000001111111111111111111111111111111111111
+ 28 0 28 0000000000000000000000000000111111111111111111111111111111111111
+ 29 0 29 0000000000000000000000000000011111111111111111111111111111111111
+ 30 0 30 0000000000000000000000000000001111111111111111111111111111111111
+ 31 0 31 0000000000000000000000000000000111111111111111111111111111111111
+ 32 0 32 0000000000000000000000000000000011111111111111111111111111111111
+ 33 0 33 0000000000000000000000000000000001111111111111111111111111111111
+ 34 0 34 0000000000000000000000000000000000111111111111111111111111111111
+ 35 0 35 0000000000000000000000000000000000011111111111111111111111111111
+ 36 0 36 0000000000000000000000000000000000001111111111111111111111111111
+ 37 0 37 0000000000000000000000000000000000000111111111111111111111111111
+ 38 0 38 0000000000000000000000000000000000000011111111111111111111111111
+ 39 0 39 0000000000000000000000000000000000000001111111111111111111111111
+ 40 0 40 0000000000000000000000000000000000000000111111111111111111111111
+ 41 0 41 0000000000000000000000000000000000000000011111111111111111111111
+ 42 0 42 0000000000000000000000000000000000000000001111111111111111111111
+ 43 0 43 0000000000000000000000000000000000000000000111111111111111111111
+ 44 0 44 0000000000000000000000000000000000000000000011111111111111111111
+ 45 0 45 0000000000000000000000000000000000000000000001111111111111111111
+ 46 0 46 0000000000000000000000000000000000000000000000111111111111111111
+ 47 0 47 0000000000000000000000000000000000000000000000011111111111111111
+ 48 0 48 0000000000000000000000000000000000000000000000001111111111111111
+ 49 0 49 0000000000000000000000000000000000000000000000000111111111111111
+ 50 0 50 0000000000000000000000000000000000000000000000000011111111111111
+ 51 0 51 0000000000000000000000000000000000000000000000000001111111111111
+ 52 0 52 0000000000000000000000000000000000000000000000000000111111111111
+ 53 0 53 0000000000000000000000000000000000000000000000000000011111111111
+ 54 0 54 0000000000000000000000000000000000000000000000000000001111111111
+ 55 0 55 0000000000000000000000000000000000000000000000000000000111111111
+ 56 0 56 0000000000000000000000000000000000000000000000000000000011111111
+ 57 0 57 0000000000000000000000000000000000000000000000000000000001111111
+ 58 0 58 0000000000000000000000000000000000000000000000000000000000111111
+ 59 0 59 0000000000000000000000000000000000000000000000000000000000011111
+ 60 0 60 0000000000000000000000000000000000000000000000000000000000001111
+ 61 0 61 0000000000000000000000000000000000000000000000000000000000000111
+ 62 0 62 0000000000000000000000000000000000000000000000000000000000000011
+ 63 0 63 0000000000000000000000000000000000000000000000000000000000000001
+
+first 0 bit should move right 1 position each line
+ 0 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+ 1 1 0 1000000000000000000000000000000000000000000000000000000000000000
+ 2 2 0 1100000000000000000000000000000000000000000000000000000000000000
+ 3 3 0 1110000000000000000000000000000000000000000000000000000000000000
+ 4 4 0 1111000000000000000000000000000000000000000000000000000000000000
+ 5 5 0 1111100000000000000000000000000000000000000000000000000000000000
+ 6 6 0 1111110000000000000000000000000000000000000000000000000000000000
+ 7 7 0 1111111000000000000000000000000000000000000000000000000000000000
+ 8 8 0 1111111100000000000000000000000000000000000000000000000000000000
+ 9 9 0 1111111110000000000000000000000000000000000000000000000000000000
+ 10 10 0 1111111111000000000000000000000000000000000000000000000000000000
+ 11 11 0 1111111111100000000000000000000000000000000000000000000000000000
+ 12 12 0 1111111111110000000000000000000000000000000000000000000000000000
+ 13 13 0 1111111111111000000000000000000000000000000000000000000000000000
+ 14 14 0 1111111111111100000000000000000000000000000000000000000000000000
+ 15 15 0 1111111111111110000000000000000000000000000000000000000000000000
+ 16 16 0 1111111111111111000000000000000000000000000000000000000000000000
+ 17 17 0 1111111111111111100000000000000000000000000000000000000000000000
+ 18 18 0 1111111111111111110000000000000000000000000000000000000000000000
+ 19 19 0 1111111111111111111000000000000000000000000000000000000000000000
+ 20 20 0 1111111111111111111100000000000000000000000000000000000000000000
+ 21 21 0 1111111111111111111110000000000000000000000000000000000000000000
+ 22 22 0 1111111111111111111111000000000000000000000000000000000000000000
+ 23 23 0 1111111111111111111111100000000000000000000000000000000000000000
+ 24 24 0 1111111111111111111111110000000000000000000000000000000000000000
+ 25 25 0 1111111111111111111111111000000000000000000000000000000000000000
+ 26 26 0 1111111111111111111111111100000000000000000000000000000000000000
+ 27 27 0 1111111111111111111111111110000000000000000000000000000000000000
+ 28 28 0 1111111111111111111111111111000000000000000000000000000000000000
+ 29 29 0 1111111111111111111111111111100000000000000000000000000000000000
+ 30 30 0 1111111111111111111111111111110000000000000000000000000000000000
+ 31 31 0 1111111111111111111111111111111000000000000000000000000000000000
+ 32 32 0 1111111111111111111111111111111100000000000000000000000000000000
+ 33 33 0 1111111111111111111111111111111110000000000000000000000000000000
+ 34 34 0 1111111111111111111111111111111111000000000000000000000000000000
+ 35 35 0 1111111111111111111111111111111111100000000000000000000000000000
+ 36 36 0 1111111111111111111111111111111111110000000000000000000000000000
+ 37 37 0 1111111111111111111111111111111111111000000000000000000000000000
+ 38 38 0 1111111111111111111111111111111111111100000000000000000000000000
+ 39 39 0 1111111111111111111111111111111111111110000000000000000000000000
+ 40 40 0 1111111111111111111111111111111111111111000000000000000000000000
+ 41 41 0 1111111111111111111111111111111111111111100000000000000000000000
+ 42 42 0 1111111111111111111111111111111111111111110000000000000000000000
+ 43 43 0 1111111111111111111111111111111111111111111000000000000000000000
+ 44 44 0 1111111111111111111111111111111111111111111100000000000000000000
+ 45 45 0 1111111111111111111111111111111111111111111110000000000000000000
+ 46 46 0 1111111111111111111111111111111111111111111111000000000000000000
+ 47 47 0 1111111111111111111111111111111111111111111111100000000000000000
+ 48 48 0 1111111111111111111111111111111111111111111111110000000000000000
+ 49 49 0 1111111111111111111111111111111111111111111111111000000000000000
+ 50 50 0 1111111111111111111111111111111111111111111111111100000000000000
+ 51 51 0 1111111111111111111111111111111111111111111111111110000000000000
+ 52 52 0 1111111111111111111111111111111111111111111111111111000000000000
+ 53 53 0 1111111111111111111111111111111111111111111111111111100000000000
+ 54 54 0 1111111111111111111111111111111111111111111111111111110000000000
+ 55 55 0 1111111111111111111111111111111111111111111111111111111000000000
+ 56 56 0 1111111111111111111111111111111111111111111111111111111100000000
+ 57 57 0 1111111111111111111111111111111111111111111111111111111110000000
+ 58 58 0 1111111111111111111111111111111111111111111111111111111111000000
+ 59 59 0 1111111111111111111111111111111111111111111111111111111111100000
+ 60 60 0 1111111111111111111111111111111111111111111111111111111111110000
+ 61 61 0 1111111111111111111111111111111111111111111111111111111111111000
+ 62 62 0 1111111111111111111111111111111111111111111111111111111111111100
+ 63 63 0 1111111111111111111111111111111111111111111111111111111111111110
+
+first 0 bit should move left 1 position each line
+ 0 -1 0 1111111111111111111111111111111111111111111111111111111111111111
+ 1 63 0 1111111111111111111111111111111111111111111111111111111111111110
+ 2 62 0 1111111111111111111111111111111111111111111111111111111111111100
+ 3 61 0 1111111111111111111111111111111111111111111111111111111111111000
+ 4 60 0 1111111111111111111111111111111111111111111111111111111111110000
+ 5 59 0 1111111111111111111111111111111111111111111111111111111111100000
+ 6 58 0 1111111111111111111111111111111111111111111111111111111111000000
+ 7 57 0 1111111111111111111111111111111111111111111111111111111110000000
+ 8 56 0 1111111111111111111111111111111111111111111111111111111100000000
+ 9 55 0 1111111111111111111111111111111111111111111111111111111000000000
+ 10 54 0 1111111111111111111111111111111111111111111111111111110000000000
+ 11 53 0 1111111111111111111111111111111111111111111111111111100000000000
+ 12 52 0 1111111111111111111111111111111111111111111111111111000000000000
+ 13 51 0 1111111111111111111111111111111111111111111111111110000000000000
+ 14 50 0 1111111111111111111111111111111111111111111111111100000000000000
+ 15 49 0 1111111111111111111111111111111111111111111111111000000000000000
+ 16 48 0 1111111111111111111111111111111111111111111111110000000000000000
+ 17 47 0 1111111111111111111111111111111111111111111111100000000000000000
+ 18 46 0 1111111111111111111111111111111111111111111111000000000000000000
+ 19 45 0 1111111111111111111111111111111111111111111110000000000000000000
+ 20 44 0 1111111111111111111111111111111111111111111100000000000000000000
+ 21 43 0 1111111111111111111111111111111111111111111000000000000000000000
+ 22 42 0 1111111111111111111111111111111111111111110000000000000000000000
+ 23 41 0 1111111111111111111111111111111111111111100000000000000000000000
+ 24 40 0 1111111111111111111111111111111111111111000000000000000000000000
+ 25 39 0 1111111111111111111111111111111111111110000000000000000000000000
+ 26 38 0 1111111111111111111111111111111111111100000000000000000000000000
+ 27 37 0 1111111111111111111111111111111111111000000000000000000000000000
+ 28 36 0 1111111111111111111111111111111111110000000000000000000000000000
+ 29 35 0 1111111111111111111111111111111111100000000000000000000000000000
+ 30 34 0 1111111111111111111111111111111111000000000000000000000000000000
+ 31 33 0 1111111111111111111111111111111110000000000000000000000000000000
+ 32 32 0 1111111111111111111111111111111100000000000000000000000000000000
+ 33 31 0 1111111111111111111111111111111000000000000000000000000000000000
+ 34 30 0 1111111111111111111111111111110000000000000000000000000000000000
+ 35 29 0 1111111111111111111111111111100000000000000000000000000000000000
+ 36 28 0 1111111111111111111111111111000000000000000000000000000000000000
+ 37 27 0 1111111111111111111111111110000000000000000000000000000000000000
+ 38 26 0 1111111111111111111111111100000000000000000000000000000000000000
+ 39 25 0 1111111111111111111111111000000000000000000000000000000000000000
+ 40 24 0 1111111111111111111111110000000000000000000000000000000000000000
+ 41 23 0 1111111111111111111111100000000000000000000000000000000000000000
+ 42 22 0 1111111111111111111111000000000000000000000000000000000000000000
+ 43 21 0 1111111111111111111110000000000000000000000000000000000000000000
+ 44 20 0 1111111111111111111100000000000000000000000000000000000000000000
+ 45 19 0 1111111111111111111000000000000000000000000000000000000000000000
+ 46 18 0 1111111111111111110000000000000000000000000000000000000000000000
+ 47 17 0 1111111111111111100000000000000000000000000000000000000000000000
+ 48 16 0 1111111111111111000000000000000000000000000000000000000000000000
+ 49 15 0 1111111111111110000000000000000000000000000000000000000000000000
+ 50 14 0 1111111111111100000000000000000000000000000000000000000000000000
+ 51 13 0 1111111111111000000000000000000000000000000000000000000000000000
+ 52 12 0 1111111111110000000000000000000000000000000000000000000000000000
+ 53 11 0 1111111111100000000000000000000000000000000000000000000000000000
+ 54 10 0 1111111111000000000000000000000000000000000000000000000000000000
+ 55 9 0 1111111110000000000000000000000000000000000000000000000000000000
+ 56 8 0 1111111100000000000000000000000000000000000000000000000000000000
+ 57 7 0 1111111000000000000000000000000000000000000000000000000000000000
+ 58 6 0 1111110000000000000000000000000000000000000000000000000000000000
+ 59 5 0 1111100000000000000000000000000000000000000000000000000000000000
+ 60 4 0 1111000000000000000000000000000000000000000000000000000000000000
+ 61 3 0 1110000000000000000000000000000000000000000000000000000000000000
+ 62 2 0 1100000000000000000000000000000000000000000000000000000000000000
+ 63 1 0 1000000000000000000000000000000000000000000000000000000000000000
+
+first 1 bit should move left 1 position each line
+ 0 0 -1 0000000000000000000000000000000000000000000000000000000000000000
+ 1 0 63 0000000000000000000000000000000000000000000000000000000000000001
+ 2 0 62 0000000000000000000000000000000000000000000000000000000000000011
+ 3 0 61 0000000000000000000000000000000000000000000000000000000000000111
+ 4 0 60 0000000000000000000000000000000000000000000000000000000000001111
+ 5 0 59 0000000000000000000000000000000000000000000000000000000000011111
+ 6 0 58 0000000000000000000000000000000000000000000000000000000000111111
+ 7 0 57 0000000000000000000000000000000000000000000000000000000001111111
+ 8 0 56 0000000000000000000000000000000000000000000000000000000011111111
+ 9 0 55 0000000000000000000000000000000000000000000000000000000111111111
+ 10 0 54 0000000000000000000000000000000000000000000000000000001111111111
+ 11 0 53 0000000000000000000000000000000000000000000000000000011111111111
+ 12 0 52 0000000000000000000000000000000000000000000000000000111111111111
+ 13 0 51 0000000000000000000000000000000000000000000000000001111111111111
+ 14 0 50 0000000000000000000000000000000000000000000000000011111111111111
+ 15 0 49 0000000000000000000000000000000000000000000000000111111111111111
+ 16 0 48 0000000000000000000000000000000000000000000000001111111111111111
+ 17 0 47 0000000000000000000000000000000000000000000000011111111111111111
+ 18 0 46 0000000000000000000000000000000000000000000000111111111111111111
+ 19 0 45 0000000000000000000000000000000000000000000001111111111111111111
+ 20 0 44 0000000000000000000000000000000000000000000011111111111111111111
+ 21 0 43 0000000000000000000000000000000000000000000111111111111111111111
+ 22 0 42 0000000000000000000000000000000000000000001111111111111111111111
+ 23 0 41 0000000000000000000000000000000000000000011111111111111111111111
+ 24 0 40 0000000000000000000000000000000000000000111111111111111111111111
+ 25 0 39 0000000000000000000000000000000000000001111111111111111111111111
+ 26 0 38 0000000000000000000000000000000000000011111111111111111111111111
+ 27 0 37 0000000000000000000000000000000000000111111111111111111111111111
+ 28 0 36 0000000000000000000000000000000000001111111111111111111111111111
+ 29 0 35 0000000000000000000000000000000000011111111111111111111111111111
+ 30 0 34 0000000000000000000000000000000000111111111111111111111111111111
+ 31 0 33 0000000000000000000000000000000001111111111111111111111111111111
+ 32 0 32 0000000000000000000000000000000011111111111111111111111111111111
+ 33 0 31 0000000000000000000000000000000111111111111111111111111111111111
+ 34 0 30 0000000000000000000000000000001111111111111111111111111111111111
+ 35 0 29 0000000000000000000000000000011111111111111111111111111111111111
+ 36 0 28 0000000000000000000000000000111111111111111111111111111111111111
+ 37 0 27 0000000000000000000000000001111111111111111111111111111111111111
+ 38 0 26 0000000000000000000000000011111111111111111111111111111111111111
+ 39 0 25 0000000000000000000000000111111111111111111111111111111111111111
+ 40 0 24 0000000000000000000000001111111111111111111111111111111111111111
+ 41 0 23 0000000000000000000000011111111111111111111111111111111111111111
+ 42 0 22 0000000000000000000000111111111111111111111111111111111111111111
+ 43 0 21 0000000000000000000001111111111111111111111111111111111111111111
+ 44 0 20 0000000000000000000011111111111111111111111111111111111111111111
+ 45 0 19 0000000000000000000111111111111111111111111111111111111111111111
+ 46 0 18 0000000000000000001111111111111111111111111111111111111111111111
+ 47 0 17 0000000000000000011111111111111111111111111111111111111111111111
+ 48 0 16 0000000000000000111111111111111111111111111111111111111111111111
+ 49 0 15 0000000000000001111111111111111111111111111111111111111111111111
+ 50 0 14 0000000000000011111111111111111111111111111111111111111111111111
+ 51 0 13 0000000000000111111111111111111111111111111111111111111111111111
+ 52 0 12 0000000000001111111111111111111111111111111111111111111111111111
+ 53 0 11 0000000000011111111111111111111111111111111111111111111111111111
+ 54 0 10 0000000000111111111111111111111111111111111111111111111111111111
+ 55 0 9 0000000001111111111111111111111111111111111111111111111111111111
+ 56 0 8 0000000011111111111111111111111111111111111111111111111111111111
+ 57 0 7 0000000111111111111111111111111111111111111111111111111111111111
+ 58 0 6 0000001111111111111111111111111111111111111111111111111111111111
+ 59 0 5 0000011111111111111111111111111111111111111111111111111111111111
+ 60 0 4 0000111111111111111111111111111111111111111111111111111111111111
+ 61 0 3 0001111111111111111111111111111111111111111111111111111111111111
+ 62 0 2 0011111111111111111111111111111111111111111111111111111111111111
+ 63 0 1 0111111111111111111111111111111111111111111111111111111111111111
+
+0 bit should move right 1 position each line
+ 0 0 1 0111111111111111111111111111111111111111111111111111111111111111
+ 1 1 0 1011111111111111111111111111111111111111111111111111111111111111
+ 2 2 0 1101111111111111111111111111111111111111111111111111111111111111
+ 3 3 0 1110111111111111111111111111111111111111111111111111111111111111
+ 4 4 0 1111011111111111111111111111111111111111111111111111111111111111
+ 5 5 0 1111101111111111111111111111111111111111111111111111111111111111
+ 6 6 0 1111110111111111111111111111111111111111111111111111111111111111
+ 7 7 0 1111111011111111111111111111111111111111111111111111111111111111
+ 8 8 0 1111111101111111111111111111111111111111111111111111111111111111
+ 9 9 0 1111111110111111111111111111111111111111111111111111111111111111
+ 10 10 0 1111111111011111111111111111111111111111111111111111111111111111
+ 11 11 0 1111111111101111111111111111111111111111111111111111111111111111
+ 12 12 0 1111111111110111111111111111111111111111111111111111111111111111
+ 13 13 0 1111111111111011111111111111111111111111111111111111111111111111
+ 14 14 0 1111111111111101111111111111111111111111111111111111111111111111
+ 15 15 0 1111111111111110111111111111111111111111111111111111111111111111
+ 16 16 0 1111111111111111011111111111111111111111111111111111111111111111
+ 17 17 0 1111111111111111101111111111111111111111111111111111111111111111
+ 18 18 0 1111111111111111110111111111111111111111111111111111111111111111
+ 19 19 0 1111111111111111111011111111111111111111111111111111111111111111
+ 20 20 0 1111111111111111111101111111111111111111111111111111111111111111
+ 21 21 0 1111111111111111111110111111111111111111111111111111111111111111
+ 22 22 0 1111111111111111111111011111111111111111111111111111111111111111
+ 23 23 0 1111111111111111111111101111111111111111111111111111111111111111
+ 24 24 0 1111111111111111111111110111111111111111111111111111111111111111
+ 25 25 0 1111111111111111111111111011111111111111111111111111111111111111
+ 26 26 0 1111111111111111111111111101111111111111111111111111111111111111
+ 27 27 0 1111111111111111111111111110111111111111111111111111111111111111
+ 28 28 0 1111111111111111111111111111011111111111111111111111111111111111
+ 29 29 0 1111111111111111111111111111101111111111111111111111111111111111
+ 30 30 0 1111111111111111111111111111110111111111111111111111111111111111
+ 31 31 0 1111111111111111111111111111111011111111111111111111111111111111
+ 32 32 0 1111111111111111111111111111111101111111111111111111111111111111
+ 33 33 0 1111111111111111111111111111111110111111111111111111111111111111
+ 34 34 0 1111111111111111111111111111111111011111111111111111111111111111
+ 35 35 0 1111111111111111111111111111111111101111111111111111111111111111
+ 36 36 0 1111111111111111111111111111111111110111111111111111111111111111
+ 37 37 0 1111111111111111111111111111111111111011111111111111111111111111
+ 38 38 0 1111111111111111111111111111111111111101111111111111111111111111
+ 39 39 0 1111111111111111111111111111111111111110111111111111111111111111
+ 40 40 0 1111111111111111111111111111111111111111011111111111111111111111
+ 41 41 0 1111111111111111111111111111111111111111101111111111111111111111
+ 42 42 0 1111111111111111111111111111111111111111110111111111111111111111
+ 43 43 0 1111111111111111111111111111111111111111111011111111111111111111
+ 44 44 0 1111111111111111111111111111111111111111111101111111111111111111
+ 45 45 0 1111111111111111111111111111111111111111111110111111111111111111
+ 46 46 0 1111111111111111111111111111111111111111111111011111111111111111
+ 47 47 0 1111111111111111111111111111111111111111111111101111111111111111
+ 48 48 0 1111111111111111111111111111111111111111111111110111111111111111
+ 49 49 0 1111111111111111111111111111111111111111111111111011111111111111
+ 50 50 0 1111111111111111111111111111111111111111111111111101111111111111
+ 51 51 0 1111111111111111111111111111111111111111111111111110111111111111
+ 52 52 0 1111111111111111111111111111111111111111111111111111011111111111
+ 53 53 0 1111111111111111111111111111111111111111111111111111101111111111
+ 54 54 0 1111111111111111111111111111111111111111111111111111110111111111
+ 55 55 0 1111111111111111111111111111111111111111111111111111111011111111
+ 56 56 0 1111111111111111111111111111111111111111111111111111111101111111
+ 57 57 0 1111111111111111111111111111111111111111111111111111111110111111
+ 58 58 0 1111111111111111111111111111111111111111111111111111111111011111
+ 59 59 0 1111111111111111111111111111111111111111111111111111111111101111
+ 60 60 0 1111111111111111111111111111111111111111111111111111111111110111
+ 61 61 0 1111111111111111111111111111111111111111111111111111111111111011
+ 62 62 0 1111111111111111111111111111111111111111111111111111111111111101
+ 63 63 0 1111111111111111111111111111111111111111111111111111111111111110
+
+1 bit should move right 1 position each line
+ 0 1 0 1000000000000000000000000000000000000000000000000000000000000000
+ 1 0 1 0100000000000000000000000000000000000000000000000000000000000000
+ 2 0 2 0010000000000000000000000000000000000000000000000000000000000000
+ 3 0 3 0001000000000000000000000000000000000000000000000000000000000000
+ 4 0 4 0000100000000000000000000000000000000000000000000000000000000000
+ 5 0 5 0000010000000000000000000000000000000000000000000000000000000000
+ 6 0 6 0000001000000000000000000000000000000000000000000000000000000000
+ 7 0 7 0000000100000000000000000000000000000000000000000000000000000000
+ 8 0 8 0000000010000000000000000000000000000000000000000000000000000000
+ 9 0 9 0000000001000000000000000000000000000000000000000000000000000000
+ 10 0 10 0000000000100000000000000000000000000000000000000000000000000000
+ 11 0 11 0000000000010000000000000000000000000000000000000000000000000000
+ 12 0 12 0000000000001000000000000000000000000000000000000000000000000000
+ 13 0 13 0000000000000100000000000000000000000000000000000000000000000000
+ 14 0 14 0000000000000010000000000000000000000000000000000000000000000000
+ 15 0 15 0000000000000001000000000000000000000000000000000000000000000000
+ 16 0 16 0000000000000000100000000000000000000000000000000000000000000000
+ 17 0 17 0000000000000000010000000000000000000000000000000000000000000000
+ 18 0 18 0000000000000000001000000000000000000000000000000000000000000000
+ 19 0 19 0000000000000000000100000000000000000000000000000000000000000000
+ 20 0 20 0000000000000000000010000000000000000000000000000000000000000000
+ 21 0 21 0000000000000000000001000000000000000000000000000000000000000000
+ 22 0 22 0000000000000000000000100000000000000000000000000000000000000000
+ 23 0 23 0000000000000000000000010000000000000000000000000000000000000000
+ 24 0 24 0000000000000000000000001000000000000000000000000000000000000000
+ 25 0 25 0000000000000000000000000100000000000000000000000000000000000000
+ 26 0 26 0000000000000000000000000010000000000000000000000000000000000000
+ 27 0 27 0000000000000000000000000001000000000000000000000000000000000000
+ 28 0 28 0000000000000000000000000000100000000000000000000000000000000000
+ 29 0 29 0000000000000000000000000000010000000000000000000000000000000000
+ 30 0 30 0000000000000000000000000000001000000000000000000000000000000000
+ 31 0 31 0000000000000000000000000000000100000000000000000000000000000000
+ 32 0 32 0000000000000000000000000000000010000000000000000000000000000000
+ 33 0 33 0000000000000000000000000000000001000000000000000000000000000000
+ 34 0 34 0000000000000000000000000000000000100000000000000000000000000000
+ 35 0 35 0000000000000000000000000000000000010000000000000000000000000000
+ 36 0 36 0000000000000000000000000000000000001000000000000000000000000000
+ 37 0 37 0000000000000000000000000000000000000100000000000000000000000000
+ 38 0 38 0000000000000000000000000000000000000010000000000000000000000000
+ 39 0 39 0000000000000000000000000000000000000001000000000000000000000000
+ 40 0 40 0000000000000000000000000000000000000000100000000000000000000000
+ 41 0 41 0000000000000000000000000000000000000000010000000000000000000000
+ 42 0 42 0000000000000000000000000000000000000000001000000000000000000000
+ 43 0 43 0000000000000000000000000000000000000000000100000000000000000000
+ 44 0 44 0000000000000000000000000000000000000000000010000000000000000000
+ 45 0 45 0000000000000000000000000000000000000000000001000000000000000000
+ 46 0 46 0000000000000000000000000000000000000000000000100000000000000000
+ 47 0 47 0000000000000000000000000000000000000000000000010000000000000000
+ 48 0 48 0000000000000000000000000000000000000000000000001000000000000000
+ 49 0 49 0000000000000000000000000000000000000000000000000100000000000000
+ 50 0 50 0000000000000000000000000000000000000000000000000010000000000000
+ 51 0 51 0000000000000000000000000000000000000000000000000001000000000000
+ 52 0 52 0000000000000000000000000000000000000000000000000000100000000000
+ 53 0 53 0000000000000000000000000000000000000000000000000000010000000000
+ 54 0 54 0000000000000000000000000000000000000000000000000000001000000000
+ 55 0 55 0000000000000000000000000000000000000000000000000000000100000000
+ 56 0 56 0000000000000000000000000000000000000000000000000000000010000000
+ 57 0 57 0000000000000000000000000000000000000000000000000000000001000000
+ 58 0 58 0000000000000000000000000000000000000000000000000000000000100000
+ 59 0 59 0000000000000000000000000000000000000000000000000000000000010000
+ 60 0 60 0000000000000000000000000000000000000000000000000000000000001000
+ 61 0 61 0000000000000000000000000000000000000000000000000000000000000100
+ 62 0 62 0000000000000000000000000000000000000000000000000000000000000010
+ 63 0 63 0000000000000000000000000000000000000000000000000000000000000001
diff --git a/contrib/netbsd-tests/include/d_bitstring_67.out b/contrib/netbsd-tests/include/d_bitstring_67.out
new file mode 100644
index 0000000..e5decc3
--- /dev/null
+++ b/contrib/netbsd-tests/include/d_bitstring_67.out
@@ -0,0 +1,583 @@
+Testing with TEST_LENGTH = 67
+
+test _bit_byte, _bit_mask, and bitstr_size
+ i _bit_byte(i) _bit_mask(i) bitstr_size(i)
+ 0 0 1 0
+ 1 0 2 1
+ 2 0 4 1
+ 3 0 8 1
+ 4 0 16 1
+ 5 0 32 1
+ 6 0 64 1
+ 7 0 128 1
+ 8 1 1 1
+ 9 1 2 2
+ 10 1 4 2
+ 11 1 8 2
+ 12 1 16 2
+ 13 1 32 2
+ 14 1 64 2
+ 15 1 128 2
+ 16 2 1 2
+ 17 2 2 3
+ 18 2 4 3
+ 19 2 8 3
+ 20 2 16 3
+ 21 2 32 3
+ 22 2 64 3
+ 23 2 128 3
+ 24 3 1 3
+ 25 3 2 4
+ 26 3 4 4
+ 27 3 8 4
+ 28 3 16 4
+ 29 3 32 4
+ 30 3 64 4
+ 31 3 128 4
+ 32 4 1 4
+ 33 4 2 5
+ 34 4 4 5
+ 35 4 8 5
+ 36 4 16 5
+ 37 4 32 5
+ 38 4 64 5
+ 39 4 128 5
+ 40 5 1 5
+ 41 5 2 6
+ 42 5 4 6
+ 43 5 8 6
+ 44 5 16 6
+ 45 5 32 6
+ 46 5 64 6
+ 47 5 128 6
+ 48 6 1 6
+ 49 6 2 7
+ 50 6 4 7
+ 51 6 8 7
+ 52 6 16 7
+ 53 6 32 7
+ 54 6 64 7
+ 55 6 128 7
+ 56 7 1 7
+ 57 7 2 8
+ 58 7 4 8
+ 59 7 8 8
+ 60 7 16 8
+ 61 7 32 8
+ 62 7 64 8
+ 63 7 128 8
+ 64 8 1 8
+ 65 8 2 9
+ 66 8 4 9
+
+test bit_alloc, clearbits, bit_ffc, bit_ffs
+be: 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+
+test bit_set
+be: 1 0 1001001001001001001001001001001001001001001001001001001001001001001
+is: 1 0 1001001001001001001001001001001001001001001001001001001001001001001
+
+test bit_clear
+be: 0 3 0001000001000001000001000001000001000001000001000001000001000001000
+is: 0 3 0001000001000001000001000001000001000001000001000001000001000001000
+
+test bit_test using previous bitstring
+ i bit_test(i)
+ 0 0
+ 1 0
+ 2 0
+ 3 8
+ 4 0
+ 5 0
+ 6 0
+ 7 0
+ 8 0
+ 9 2
+ 10 0
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 128
+ 16 0
+ 17 0
+ 18 0
+ 19 0
+ 20 0
+ 21 32
+ 22 0
+ 23 0
+ 24 0
+ 25 0
+ 26 0
+ 27 8
+ 28 0
+ 29 0
+ 30 0
+ 31 0
+ 32 0
+ 33 2
+ 34 0
+ 35 0
+ 36 0
+ 37 0
+ 38 0
+ 39 128
+ 40 0
+ 41 0
+ 42 0
+ 43 0
+ 44 0
+ 45 32
+ 46 0
+ 47 0
+ 48 0
+ 49 0
+ 50 0
+ 51 8
+ 52 0
+ 53 0
+ 54 0
+ 55 0
+ 56 0
+ 57 2
+ 58 0
+ 59 0
+ 60 0
+ 61 0
+ 62 0
+ 63 128
+ 64 0
+ 65 0
+ 66 0
+
+test clearbits
+be: 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+
+test bit_nset and bit_nclear
+be: 0 1 0111111111111111111111111111111111111111111111111111111111111111110
+is: 0 1 0111111111111111111111111111111111111111111111111111111111111111110
+be: 0 1 0100000000000000000000000000000000000000000000000000000000000000010
+is: 0 1 0100000000000000000000000000000000000000000000000000000000000000010
+be: 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+be: 66 0 1111111111111111111111111111111111111111111111111111111111111111110
+is: 66 0 1111111111111111111111111111111111111111111111111111111111111111110
+be: 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+is: 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+
+first 1 bit should move right 1 position each line
+ 0 -1 0 1111111111111111111111111111111111111111111111111111111111111111111
+ 1 0 1 0111111111111111111111111111111111111111111111111111111111111111111
+ 2 0 2 0011111111111111111111111111111111111111111111111111111111111111111
+ 3 0 3 0001111111111111111111111111111111111111111111111111111111111111111
+ 4 0 4 0000111111111111111111111111111111111111111111111111111111111111111
+ 5 0 5 0000011111111111111111111111111111111111111111111111111111111111111
+ 6 0 6 0000001111111111111111111111111111111111111111111111111111111111111
+ 7 0 7 0000000111111111111111111111111111111111111111111111111111111111111
+ 8 0 8 0000000011111111111111111111111111111111111111111111111111111111111
+ 9 0 9 0000000001111111111111111111111111111111111111111111111111111111111
+ 10 0 10 0000000000111111111111111111111111111111111111111111111111111111111
+ 11 0 11 0000000000011111111111111111111111111111111111111111111111111111111
+ 12 0 12 0000000000001111111111111111111111111111111111111111111111111111111
+ 13 0 13 0000000000000111111111111111111111111111111111111111111111111111111
+ 14 0 14 0000000000000011111111111111111111111111111111111111111111111111111
+ 15 0 15 0000000000000001111111111111111111111111111111111111111111111111111
+ 16 0 16 0000000000000000111111111111111111111111111111111111111111111111111
+ 17 0 17 0000000000000000011111111111111111111111111111111111111111111111111
+ 18 0 18 0000000000000000001111111111111111111111111111111111111111111111111
+ 19 0 19 0000000000000000000111111111111111111111111111111111111111111111111
+ 20 0 20 0000000000000000000011111111111111111111111111111111111111111111111
+ 21 0 21 0000000000000000000001111111111111111111111111111111111111111111111
+ 22 0 22 0000000000000000000000111111111111111111111111111111111111111111111
+ 23 0 23 0000000000000000000000011111111111111111111111111111111111111111111
+ 24 0 24 0000000000000000000000001111111111111111111111111111111111111111111
+ 25 0 25 0000000000000000000000000111111111111111111111111111111111111111111
+ 26 0 26 0000000000000000000000000011111111111111111111111111111111111111111
+ 27 0 27 0000000000000000000000000001111111111111111111111111111111111111111
+ 28 0 28 0000000000000000000000000000111111111111111111111111111111111111111
+ 29 0 29 0000000000000000000000000000011111111111111111111111111111111111111
+ 30 0 30 0000000000000000000000000000001111111111111111111111111111111111111
+ 31 0 31 0000000000000000000000000000000111111111111111111111111111111111111
+ 32 0 32 0000000000000000000000000000000011111111111111111111111111111111111
+ 33 0 33 0000000000000000000000000000000001111111111111111111111111111111111
+ 34 0 34 0000000000000000000000000000000000111111111111111111111111111111111
+ 35 0 35 0000000000000000000000000000000000011111111111111111111111111111111
+ 36 0 36 0000000000000000000000000000000000001111111111111111111111111111111
+ 37 0 37 0000000000000000000000000000000000000111111111111111111111111111111
+ 38 0 38 0000000000000000000000000000000000000011111111111111111111111111111
+ 39 0 39 0000000000000000000000000000000000000001111111111111111111111111111
+ 40 0 40 0000000000000000000000000000000000000000111111111111111111111111111
+ 41 0 41 0000000000000000000000000000000000000000011111111111111111111111111
+ 42 0 42 0000000000000000000000000000000000000000001111111111111111111111111
+ 43 0 43 0000000000000000000000000000000000000000000111111111111111111111111
+ 44 0 44 0000000000000000000000000000000000000000000011111111111111111111111
+ 45 0 45 0000000000000000000000000000000000000000000001111111111111111111111
+ 46 0 46 0000000000000000000000000000000000000000000000111111111111111111111
+ 47 0 47 0000000000000000000000000000000000000000000000011111111111111111111
+ 48 0 48 0000000000000000000000000000000000000000000000001111111111111111111
+ 49 0 49 0000000000000000000000000000000000000000000000000111111111111111111
+ 50 0 50 0000000000000000000000000000000000000000000000000011111111111111111
+ 51 0 51 0000000000000000000000000000000000000000000000000001111111111111111
+ 52 0 52 0000000000000000000000000000000000000000000000000000111111111111111
+ 53 0 53 0000000000000000000000000000000000000000000000000000011111111111111
+ 54 0 54 0000000000000000000000000000000000000000000000000000001111111111111
+ 55 0 55 0000000000000000000000000000000000000000000000000000000111111111111
+ 56 0 56 0000000000000000000000000000000000000000000000000000000011111111111
+ 57 0 57 0000000000000000000000000000000000000000000000000000000001111111111
+ 58 0 58 0000000000000000000000000000000000000000000000000000000000111111111
+ 59 0 59 0000000000000000000000000000000000000000000000000000000000011111111
+ 60 0 60 0000000000000000000000000000000000000000000000000000000000001111111
+ 61 0 61 0000000000000000000000000000000000000000000000000000000000000111111
+ 62 0 62 0000000000000000000000000000000000000000000000000000000000000011111
+ 63 0 63 0000000000000000000000000000000000000000000000000000000000000001111
+ 64 0 64 0000000000000000000000000000000000000000000000000000000000000000111
+ 65 0 65 0000000000000000000000000000000000000000000000000000000000000000011
+ 66 0 66 0000000000000000000000000000000000000000000000000000000000000000001
+
+first 0 bit should move right 1 position each line
+ 0 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+ 1 1 0 1000000000000000000000000000000000000000000000000000000000000000000
+ 2 2 0 1100000000000000000000000000000000000000000000000000000000000000000
+ 3 3 0 1110000000000000000000000000000000000000000000000000000000000000000
+ 4 4 0 1111000000000000000000000000000000000000000000000000000000000000000
+ 5 5 0 1111100000000000000000000000000000000000000000000000000000000000000
+ 6 6 0 1111110000000000000000000000000000000000000000000000000000000000000
+ 7 7 0 1111111000000000000000000000000000000000000000000000000000000000000
+ 8 8 0 1111111100000000000000000000000000000000000000000000000000000000000
+ 9 9 0 1111111110000000000000000000000000000000000000000000000000000000000
+ 10 10 0 1111111111000000000000000000000000000000000000000000000000000000000
+ 11 11 0 1111111111100000000000000000000000000000000000000000000000000000000
+ 12 12 0 1111111111110000000000000000000000000000000000000000000000000000000
+ 13 13 0 1111111111111000000000000000000000000000000000000000000000000000000
+ 14 14 0 1111111111111100000000000000000000000000000000000000000000000000000
+ 15 15 0 1111111111111110000000000000000000000000000000000000000000000000000
+ 16 16 0 1111111111111111000000000000000000000000000000000000000000000000000
+ 17 17 0 1111111111111111100000000000000000000000000000000000000000000000000
+ 18 18 0 1111111111111111110000000000000000000000000000000000000000000000000
+ 19 19 0 1111111111111111111000000000000000000000000000000000000000000000000
+ 20 20 0 1111111111111111111100000000000000000000000000000000000000000000000
+ 21 21 0 1111111111111111111110000000000000000000000000000000000000000000000
+ 22 22 0 1111111111111111111111000000000000000000000000000000000000000000000
+ 23 23 0 1111111111111111111111100000000000000000000000000000000000000000000
+ 24 24 0 1111111111111111111111110000000000000000000000000000000000000000000
+ 25 25 0 1111111111111111111111111000000000000000000000000000000000000000000
+ 26 26 0 1111111111111111111111111100000000000000000000000000000000000000000
+ 27 27 0 1111111111111111111111111110000000000000000000000000000000000000000
+ 28 28 0 1111111111111111111111111111000000000000000000000000000000000000000
+ 29 29 0 1111111111111111111111111111100000000000000000000000000000000000000
+ 30 30 0 1111111111111111111111111111110000000000000000000000000000000000000
+ 31 31 0 1111111111111111111111111111111000000000000000000000000000000000000
+ 32 32 0 1111111111111111111111111111111100000000000000000000000000000000000
+ 33 33 0 1111111111111111111111111111111110000000000000000000000000000000000
+ 34 34 0 1111111111111111111111111111111111000000000000000000000000000000000
+ 35 35 0 1111111111111111111111111111111111100000000000000000000000000000000
+ 36 36 0 1111111111111111111111111111111111110000000000000000000000000000000
+ 37 37 0 1111111111111111111111111111111111111000000000000000000000000000000
+ 38 38 0 1111111111111111111111111111111111111100000000000000000000000000000
+ 39 39 0 1111111111111111111111111111111111111110000000000000000000000000000
+ 40 40 0 1111111111111111111111111111111111111111000000000000000000000000000
+ 41 41 0 1111111111111111111111111111111111111111100000000000000000000000000
+ 42 42 0 1111111111111111111111111111111111111111110000000000000000000000000
+ 43 43 0 1111111111111111111111111111111111111111111000000000000000000000000
+ 44 44 0 1111111111111111111111111111111111111111111100000000000000000000000
+ 45 45 0 1111111111111111111111111111111111111111111110000000000000000000000
+ 46 46 0 1111111111111111111111111111111111111111111111000000000000000000000
+ 47 47 0 1111111111111111111111111111111111111111111111100000000000000000000
+ 48 48 0 1111111111111111111111111111111111111111111111110000000000000000000
+ 49 49 0 1111111111111111111111111111111111111111111111111000000000000000000
+ 50 50 0 1111111111111111111111111111111111111111111111111100000000000000000
+ 51 51 0 1111111111111111111111111111111111111111111111111110000000000000000
+ 52 52 0 1111111111111111111111111111111111111111111111111111000000000000000
+ 53 53 0 1111111111111111111111111111111111111111111111111111100000000000000
+ 54 54 0 1111111111111111111111111111111111111111111111111111110000000000000
+ 55 55 0 1111111111111111111111111111111111111111111111111111111000000000000
+ 56 56 0 1111111111111111111111111111111111111111111111111111111100000000000
+ 57 57 0 1111111111111111111111111111111111111111111111111111111110000000000
+ 58 58 0 1111111111111111111111111111111111111111111111111111111111000000000
+ 59 59 0 1111111111111111111111111111111111111111111111111111111111100000000
+ 60 60 0 1111111111111111111111111111111111111111111111111111111111110000000
+ 61 61 0 1111111111111111111111111111111111111111111111111111111111111000000
+ 62 62 0 1111111111111111111111111111111111111111111111111111111111111100000
+ 63 63 0 1111111111111111111111111111111111111111111111111111111111111110000
+ 64 64 0 1111111111111111111111111111111111111111111111111111111111111111000
+ 65 65 0 1111111111111111111111111111111111111111111111111111111111111111100
+ 66 66 0 1111111111111111111111111111111111111111111111111111111111111111110
+
+first 0 bit should move left 1 position each line
+ 0 -1 0 1111111111111111111111111111111111111111111111111111111111111111111
+ 1 66 0 1111111111111111111111111111111111111111111111111111111111111111110
+ 2 65 0 1111111111111111111111111111111111111111111111111111111111111111100
+ 3 64 0 1111111111111111111111111111111111111111111111111111111111111111000
+ 4 63 0 1111111111111111111111111111111111111111111111111111111111111110000
+ 5 62 0 1111111111111111111111111111111111111111111111111111111111111100000
+ 6 61 0 1111111111111111111111111111111111111111111111111111111111111000000
+ 7 60 0 1111111111111111111111111111111111111111111111111111111111110000000
+ 8 59 0 1111111111111111111111111111111111111111111111111111111111100000000
+ 9 58 0 1111111111111111111111111111111111111111111111111111111111000000000
+ 10 57 0 1111111111111111111111111111111111111111111111111111111110000000000
+ 11 56 0 1111111111111111111111111111111111111111111111111111111100000000000
+ 12 55 0 1111111111111111111111111111111111111111111111111111111000000000000
+ 13 54 0 1111111111111111111111111111111111111111111111111111110000000000000
+ 14 53 0 1111111111111111111111111111111111111111111111111111100000000000000
+ 15 52 0 1111111111111111111111111111111111111111111111111111000000000000000
+ 16 51 0 1111111111111111111111111111111111111111111111111110000000000000000
+ 17 50 0 1111111111111111111111111111111111111111111111111100000000000000000
+ 18 49 0 1111111111111111111111111111111111111111111111111000000000000000000
+ 19 48 0 1111111111111111111111111111111111111111111111110000000000000000000
+ 20 47 0 1111111111111111111111111111111111111111111111100000000000000000000
+ 21 46 0 1111111111111111111111111111111111111111111111000000000000000000000
+ 22 45 0 1111111111111111111111111111111111111111111110000000000000000000000
+ 23 44 0 1111111111111111111111111111111111111111111100000000000000000000000
+ 24 43 0 1111111111111111111111111111111111111111111000000000000000000000000
+ 25 42 0 1111111111111111111111111111111111111111110000000000000000000000000
+ 26 41 0 1111111111111111111111111111111111111111100000000000000000000000000
+ 27 40 0 1111111111111111111111111111111111111111000000000000000000000000000
+ 28 39 0 1111111111111111111111111111111111111110000000000000000000000000000
+ 29 38 0 1111111111111111111111111111111111111100000000000000000000000000000
+ 30 37 0 1111111111111111111111111111111111111000000000000000000000000000000
+ 31 36 0 1111111111111111111111111111111111110000000000000000000000000000000
+ 32 35 0 1111111111111111111111111111111111100000000000000000000000000000000
+ 33 34 0 1111111111111111111111111111111111000000000000000000000000000000000
+ 34 33 0 1111111111111111111111111111111110000000000000000000000000000000000
+ 35 32 0 1111111111111111111111111111111100000000000000000000000000000000000
+ 36 31 0 1111111111111111111111111111111000000000000000000000000000000000000
+ 37 30 0 1111111111111111111111111111110000000000000000000000000000000000000
+ 38 29 0 1111111111111111111111111111100000000000000000000000000000000000000
+ 39 28 0 1111111111111111111111111111000000000000000000000000000000000000000
+ 40 27 0 1111111111111111111111111110000000000000000000000000000000000000000
+ 41 26 0 1111111111111111111111111100000000000000000000000000000000000000000
+ 42 25 0 1111111111111111111111111000000000000000000000000000000000000000000
+ 43 24 0 1111111111111111111111110000000000000000000000000000000000000000000
+ 44 23 0 1111111111111111111111100000000000000000000000000000000000000000000
+ 45 22 0 1111111111111111111111000000000000000000000000000000000000000000000
+ 46 21 0 1111111111111111111110000000000000000000000000000000000000000000000
+ 47 20 0 1111111111111111111100000000000000000000000000000000000000000000000
+ 48 19 0 1111111111111111111000000000000000000000000000000000000000000000000
+ 49 18 0 1111111111111111110000000000000000000000000000000000000000000000000
+ 50 17 0 1111111111111111100000000000000000000000000000000000000000000000000
+ 51 16 0 1111111111111111000000000000000000000000000000000000000000000000000
+ 52 15 0 1111111111111110000000000000000000000000000000000000000000000000000
+ 53 14 0 1111111111111100000000000000000000000000000000000000000000000000000
+ 54 13 0 1111111111111000000000000000000000000000000000000000000000000000000
+ 55 12 0 1111111111110000000000000000000000000000000000000000000000000000000
+ 56 11 0 1111111111100000000000000000000000000000000000000000000000000000000
+ 57 10 0 1111111111000000000000000000000000000000000000000000000000000000000
+ 58 9 0 1111111110000000000000000000000000000000000000000000000000000000000
+ 59 8 0 1111111100000000000000000000000000000000000000000000000000000000000
+ 60 7 0 1111111000000000000000000000000000000000000000000000000000000000000
+ 61 6 0 1111110000000000000000000000000000000000000000000000000000000000000
+ 62 5 0 1111100000000000000000000000000000000000000000000000000000000000000
+ 63 4 0 1111000000000000000000000000000000000000000000000000000000000000000
+ 64 3 0 1110000000000000000000000000000000000000000000000000000000000000000
+ 65 2 0 1100000000000000000000000000000000000000000000000000000000000000000
+ 66 1 0 1000000000000000000000000000000000000000000000000000000000000000000
+
+first 1 bit should move left 1 position each line
+ 0 0 -1 0000000000000000000000000000000000000000000000000000000000000000000
+ 1 0 66 0000000000000000000000000000000000000000000000000000000000000000001
+ 2 0 65 0000000000000000000000000000000000000000000000000000000000000000011
+ 3 0 64 0000000000000000000000000000000000000000000000000000000000000000111
+ 4 0 63 0000000000000000000000000000000000000000000000000000000000000001111
+ 5 0 62 0000000000000000000000000000000000000000000000000000000000000011111
+ 6 0 61 0000000000000000000000000000000000000000000000000000000000000111111
+ 7 0 60 0000000000000000000000000000000000000000000000000000000000001111111
+ 8 0 59 0000000000000000000000000000000000000000000000000000000000011111111
+ 9 0 58 0000000000000000000000000000000000000000000000000000000000111111111
+ 10 0 57 0000000000000000000000000000000000000000000000000000000001111111111
+ 11 0 56 0000000000000000000000000000000000000000000000000000000011111111111
+ 12 0 55 0000000000000000000000000000000000000000000000000000000111111111111
+ 13 0 54 0000000000000000000000000000000000000000000000000000001111111111111
+ 14 0 53 0000000000000000000000000000000000000000000000000000011111111111111
+ 15 0 52 0000000000000000000000000000000000000000000000000000111111111111111
+ 16 0 51 0000000000000000000000000000000000000000000000000001111111111111111
+ 17 0 50 0000000000000000000000000000000000000000000000000011111111111111111
+ 18 0 49 0000000000000000000000000000000000000000000000000111111111111111111
+ 19 0 48 0000000000000000000000000000000000000000000000001111111111111111111
+ 20 0 47 0000000000000000000000000000000000000000000000011111111111111111111
+ 21 0 46 0000000000000000000000000000000000000000000000111111111111111111111
+ 22 0 45 0000000000000000000000000000000000000000000001111111111111111111111
+ 23 0 44 0000000000000000000000000000000000000000000011111111111111111111111
+ 24 0 43 0000000000000000000000000000000000000000000111111111111111111111111
+ 25 0 42 0000000000000000000000000000000000000000001111111111111111111111111
+ 26 0 41 0000000000000000000000000000000000000000011111111111111111111111111
+ 27 0 40 0000000000000000000000000000000000000000111111111111111111111111111
+ 28 0 39 0000000000000000000000000000000000000001111111111111111111111111111
+ 29 0 38 0000000000000000000000000000000000000011111111111111111111111111111
+ 30 0 37 0000000000000000000000000000000000000111111111111111111111111111111
+ 31 0 36 0000000000000000000000000000000000001111111111111111111111111111111
+ 32 0 35 0000000000000000000000000000000000011111111111111111111111111111111
+ 33 0 34 0000000000000000000000000000000000111111111111111111111111111111111
+ 34 0 33 0000000000000000000000000000000001111111111111111111111111111111111
+ 35 0 32 0000000000000000000000000000000011111111111111111111111111111111111
+ 36 0 31 0000000000000000000000000000000111111111111111111111111111111111111
+ 37 0 30 0000000000000000000000000000001111111111111111111111111111111111111
+ 38 0 29 0000000000000000000000000000011111111111111111111111111111111111111
+ 39 0 28 0000000000000000000000000000111111111111111111111111111111111111111
+ 40 0 27 0000000000000000000000000001111111111111111111111111111111111111111
+ 41 0 26 0000000000000000000000000011111111111111111111111111111111111111111
+ 42 0 25 0000000000000000000000000111111111111111111111111111111111111111111
+ 43 0 24 0000000000000000000000001111111111111111111111111111111111111111111
+ 44 0 23 0000000000000000000000011111111111111111111111111111111111111111111
+ 45 0 22 0000000000000000000000111111111111111111111111111111111111111111111
+ 46 0 21 0000000000000000000001111111111111111111111111111111111111111111111
+ 47 0 20 0000000000000000000011111111111111111111111111111111111111111111111
+ 48 0 19 0000000000000000000111111111111111111111111111111111111111111111111
+ 49 0 18 0000000000000000001111111111111111111111111111111111111111111111111
+ 50 0 17 0000000000000000011111111111111111111111111111111111111111111111111
+ 51 0 16 0000000000000000111111111111111111111111111111111111111111111111111
+ 52 0 15 0000000000000001111111111111111111111111111111111111111111111111111
+ 53 0 14 0000000000000011111111111111111111111111111111111111111111111111111
+ 54 0 13 0000000000000111111111111111111111111111111111111111111111111111111
+ 55 0 12 0000000000001111111111111111111111111111111111111111111111111111111
+ 56 0 11 0000000000011111111111111111111111111111111111111111111111111111111
+ 57 0 10 0000000000111111111111111111111111111111111111111111111111111111111
+ 58 0 9 0000000001111111111111111111111111111111111111111111111111111111111
+ 59 0 8 0000000011111111111111111111111111111111111111111111111111111111111
+ 60 0 7 0000000111111111111111111111111111111111111111111111111111111111111
+ 61 0 6 0000001111111111111111111111111111111111111111111111111111111111111
+ 62 0 5 0000011111111111111111111111111111111111111111111111111111111111111
+ 63 0 4 0000111111111111111111111111111111111111111111111111111111111111111
+ 64 0 3 0001111111111111111111111111111111111111111111111111111111111111111
+ 65 0 2 0011111111111111111111111111111111111111111111111111111111111111111
+ 66 0 1 0111111111111111111111111111111111111111111111111111111111111111111
+
+0 bit should move right 1 position each line
+ 0 0 1 0111111111111111111111111111111111111111111111111111111111111111111
+ 1 1 0 1011111111111111111111111111111111111111111111111111111111111111111
+ 2 2 0 1101111111111111111111111111111111111111111111111111111111111111111
+ 3 3 0 1110111111111111111111111111111111111111111111111111111111111111111
+ 4 4 0 1111011111111111111111111111111111111111111111111111111111111111111
+ 5 5 0 1111101111111111111111111111111111111111111111111111111111111111111
+ 6 6 0 1111110111111111111111111111111111111111111111111111111111111111111
+ 7 7 0 1111111011111111111111111111111111111111111111111111111111111111111
+ 8 8 0 1111111101111111111111111111111111111111111111111111111111111111111
+ 9 9 0 1111111110111111111111111111111111111111111111111111111111111111111
+ 10 10 0 1111111111011111111111111111111111111111111111111111111111111111111
+ 11 11 0 1111111111101111111111111111111111111111111111111111111111111111111
+ 12 12 0 1111111111110111111111111111111111111111111111111111111111111111111
+ 13 13 0 1111111111111011111111111111111111111111111111111111111111111111111
+ 14 14 0 1111111111111101111111111111111111111111111111111111111111111111111
+ 15 15 0 1111111111111110111111111111111111111111111111111111111111111111111
+ 16 16 0 1111111111111111011111111111111111111111111111111111111111111111111
+ 17 17 0 1111111111111111101111111111111111111111111111111111111111111111111
+ 18 18 0 1111111111111111110111111111111111111111111111111111111111111111111
+ 19 19 0 1111111111111111111011111111111111111111111111111111111111111111111
+ 20 20 0 1111111111111111111101111111111111111111111111111111111111111111111
+ 21 21 0 1111111111111111111110111111111111111111111111111111111111111111111
+ 22 22 0 1111111111111111111111011111111111111111111111111111111111111111111
+ 23 23 0 1111111111111111111111101111111111111111111111111111111111111111111
+ 24 24 0 1111111111111111111111110111111111111111111111111111111111111111111
+ 25 25 0 1111111111111111111111111011111111111111111111111111111111111111111
+ 26 26 0 1111111111111111111111111101111111111111111111111111111111111111111
+ 27 27 0 1111111111111111111111111110111111111111111111111111111111111111111
+ 28 28 0 1111111111111111111111111111011111111111111111111111111111111111111
+ 29 29 0 1111111111111111111111111111101111111111111111111111111111111111111
+ 30 30 0 1111111111111111111111111111110111111111111111111111111111111111111
+ 31 31 0 1111111111111111111111111111111011111111111111111111111111111111111
+ 32 32 0 1111111111111111111111111111111101111111111111111111111111111111111
+ 33 33 0 1111111111111111111111111111111110111111111111111111111111111111111
+ 34 34 0 1111111111111111111111111111111111011111111111111111111111111111111
+ 35 35 0 1111111111111111111111111111111111101111111111111111111111111111111
+ 36 36 0 1111111111111111111111111111111111110111111111111111111111111111111
+ 37 37 0 1111111111111111111111111111111111111011111111111111111111111111111
+ 38 38 0 1111111111111111111111111111111111111101111111111111111111111111111
+ 39 39 0 1111111111111111111111111111111111111110111111111111111111111111111
+ 40 40 0 1111111111111111111111111111111111111111011111111111111111111111111
+ 41 41 0 1111111111111111111111111111111111111111101111111111111111111111111
+ 42 42 0 1111111111111111111111111111111111111111110111111111111111111111111
+ 43 43 0 1111111111111111111111111111111111111111111011111111111111111111111
+ 44 44 0 1111111111111111111111111111111111111111111101111111111111111111111
+ 45 45 0 1111111111111111111111111111111111111111111110111111111111111111111
+ 46 46 0 1111111111111111111111111111111111111111111111011111111111111111111
+ 47 47 0 1111111111111111111111111111111111111111111111101111111111111111111
+ 48 48 0 1111111111111111111111111111111111111111111111110111111111111111111
+ 49 49 0 1111111111111111111111111111111111111111111111111011111111111111111
+ 50 50 0 1111111111111111111111111111111111111111111111111101111111111111111
+ 51 51 0 1111111111111111111111111111111111111111111111111110111111111111111
+ 52 52 0 1111111111111111111111111111111111111111111111111111011111111111111
+ 53 53 0 1111111111111111111111111111111111111111111111111111101111111111111
+ 54 54 0 1111111111111111111111111111111111111111111111111111110111111111111
+ 55 55 0 1111111111111111111111111111111111111111111111111111111011111111111
+ 56 56 0 1111111111111111111111111111111111111111111111111111111101111111111
+ 57 57 0 1111111111111111111111111111111111111111111111111111111110111111111
+ 58 58 0 1111111111111111111111111111111111111111111111111111111111011111111
+ 59 59 0 1111111111111111111111111111111111111111111111111111111111101111111
+ 60 60 0 1111111111111111111111111111111111111111111111111111111111110111111
+ 61 61 0 1111111111111111111111111111111111111111111111111111111111111011111
+ 62 62 0 1111111111111111111111111111111111111111111111111111111111111101111
+ 63 63 0 1111111111111111111111111111111111111111111111111111111111111110111
+ 64 64 0 1111111111111111111111111111111111111111111111111111111111111111011
+ 65 65 0 1111111111111111111111111111111111111111111111111111111111111111101
+ 66 66 0 1111111111111111111111111111111111111111111111111111111111111111110
+
+1 bit should move right 1 position each line
+ 0 1 0 1000000000000000000000000000000000000000000000000000000000000000000
+ 1 0 1 0100000000000000000000000000000000000000000000000000000000000000000
+ 2 0 2 0010000000000000000000000000000000000000000000000000000000000000000
+ 3 0 3 0001000000000000000000000000000000000000000000000000000000000000000
+ 4 0 4 0000100000000000000000000000000000000000000000000000000000000000000
+ 5 0 5 0000010000000000000000000000000000000000000000000000000000000000000
+ 6 0 6 0000001000000000000000000000000000000000000000000000000000000000000
+ 7 0 7 0000000100000000000000000000000000000000000000000000000000000000000
+ 8 0 8 0000000010000000000000000000000000000000000000000000000000000000000
+ 9 0 9 0000000001000000000000000000000000000000000000000000000000000000000
+ 10 0 10 0000000000100000000000000000000000000000000000000000000000000000000
+ 11 0 11 0000000000010000000000000000000000000000000000000000000000000000000
+ 12 0 12 0000000000001000000000000000000000000000000000000000000000000000000
+ 13 0 13 0000000000000100000000000000000000000000000000000000000000000000000
+ 14 0 14 0000000000000010000000000000000000000000000000000000000000000000000
+ 15 0 15 0000000000000001000000000000000000000000000000000000000000000000000
+ 16 0 16 0000000000000000100000000000000000000000000000000000000000000000000
+ 17 0 17 0000000000000000010000000000000000000000000000000000000000000000000
+ 18 0 18 0000000000000000001000000000000000000000000000000000000000000000000
+ 19 0 19 0000000000000000000100000000000000000000000000000000000000000000000
+ 20 0 20 0000000000000000000010000000000000000000000000000000000000000000000
+ 21 0 21 0000000000000000000001000000000000000000000000000000000000000000000
+ 22 0 22 0000000000000000000000100000000000000000000000000000000000000000000
+ 23 0 23 0000000000000000000000010000000000000000000000000000000000000000000
+ 24 0 24 0000000000000000000000001000000000000000000000000000000000000000000
+ 25 0 25 0000000000000000000000000100000000000000000000000000000000000000000
+ 26 0 26 0000000000000000000000000010000000000000000000000000000000000000000
+ 27 0 27 0000000000000000000000000001000000000000000000000000000000000000000
+ 28 0 28 0000000000000000000000000000100000000000000000000000000000000000000
+ 29 0 29 0000000000000000000000000000010000000000000000000000000000000000000
+ 30 0 30 0000000000000000000000000000001000000000000000000000000000000000000
+ 31 0 31 0000000000000000000000000000000100000000000000000000000000000000000
+ 32 0 32 0000000000000000000000000000000010000000000000000000000000000000000
+ 33 0 33 0000000000000000000000000000000001000000000000000000000000000000000
+ 34 0 34 0000000000000000000000000000000000100000000000000000000000000000000
+ 35 0 35 0000000000000000000000000000000000010000000000000000000000000000000
+ 36 0 36 0000000000000000000000000000000000001000000000000000000000000000000
+ 37 0 37 0000000000000000000000000000000000000100000000000000000000000000000
+ 38 0 38 0000000000000000000000000000000000000010000000000000000000000000000
+ 39 0 39 0000000000000000000000000000000000000001000000000000000000000000000
+ 40 0 40 0000000000000000000000000000000000000000100000000000000000000000000
+ 41 0 41 0000000000000000000000000000000000000000010000000000000000000000000
+ 42 0 42 0000000000000000000000000000000000000000001000000000000000000000000
+ 43 0 43 0000000000000000000000000000000000000000000100000000000000000000000
+ 44 0 44 0000000000000000000000000000000000000000000010000000000000000000000
+ 45 0 45 0000000000000000000000000000000000000000000001000000000000000000000
+ 46 0 46 0000000000000000000000000000000000000000000000100000000000000000000
+ 47 0 47 0000000000000000000000000000000000000000000000010000000000000000000
+ 48 0 48 0000000000000000000000000000000000000000000000001000000000000000000
+ 49 0 49 0000000000000000000000000000000000000000000000000100000000000000000
+ 50 0 50 0000000000000000000000000000000000000000000000000010000000000000000
+ 51 0 51 0000000000000000000000000000000000000000000000000001000000000000000
+ 52 0 52 0000000000000000000000000000000000000000000000000000100000000000000
+ 53 0 53 0000000000000000000000000000000000000000000000000000010000000000000
+ 54 0 54 0000000000000000000000000000000000000000000000000000001000000000000
+ 55 0 55 0000000000000000000000000000000000000000000000000000000100000000000
+ 56 0 56 0000000000000000000000000000000000000000000000000000000010000000000
+ 57 0 57 0000000000000000000000000000000000000000000000000000000001000000000
+ 58 0 58 0000000000000000000000000000000000000000000000000000000000100000000
+ 59 0 59 0000000000000000000000000000000000000000000000000000000000010000000
+ 60 0 60 0000000000000000000000000000000000000000000000000000000000001000000
+ 61 0 61 0000000000000000000000000000000000000000000000000000000000000100000
+ 62 0 62 0000000000000000000000000000000000000000000000000000000000000010000
+ 63 0 63 0000000000000000000000000000000000000000000000000000000000000001000
+ 64 0 64 0000000000000000000000000000000000000000000000000000000000000000100
+ 65 0 65 0000000000000000000000000000000000000000000000000000000000000000010
+ 66 0 66 0000000000000000000000000000000000000000000000000000000000000000001
diff --git a/contrib/netbsd-tests/include/d_bitstring_8.out b/contrib/netbsd-tests/include/d_bitstring_8.out
new file mode 100644
index 0000000..aba6440
--- /dev/null
+++ b/contrib/netbsd-tests/include/d_bitstring_8.out
@@ -0,0 +1,111 @@
+Testing with TEST_LENGTH = 8
+
+test _bit_byte, _bit_mask, and bitstr_size
+ i _bit_byte(i) _bit_mask(i) bitstr_size(i)
+ 0 0 1 0
+ 1 0 2 1
+ 2 0 4 1
+ 3 0 8 1
+ 4 0 16 1
+ 5 0 32 1
+ 6 0 64 1
+ 7 0 128 1
+
+test bit_alloc, clearbits, bit_ffc, bit_ffs
+be: 0 -1 00000000
+is: 0 -1 00000000
+
+test bit_set
+be: 1 0 10010010
+is: 1 0 10010010
+
+test bit_clear
+be: 0 3 00010000
+is: 0 3 00010000
+
+test bit_test using previous bitstring
+ i bit_test(i)
+ 0 0
+ 1 0
+ 2 0
+ 3 8
+ 4 0
+ 5 0
+ 6 0
+ 7 0
+
+test clearbits
+be: 0 -1 00000000
+is: 0 -1 00000000
+
+test bit_nset and bit_nclear
+be: 0 1 01111110
+is: 0 1 01111110
+be: 0 1 01000010
+is: 0 1 01000010
+be: 0 -1 00000000
+is: 0 -1 00000000
+be: 7 0 11111110
+is: 7 0 11111110
+be: 0 -1 00000000
+is: 0 -1 00000000
+
+first 1 bit should move right 1 position each line
+ 0 -1 0 11111111
+ 1 0 1 01111111
+ 2 0 2 00111111
+ 3 0 3 00011111
+ 4 0 4 00001111
+ 5 0 5 00000111
+ 6 0 6 00000011
+ 7 0 7 00000001
+
+first 0 bit should move right 1 position each line
+ 0 0 -1 00000000
+ 1 1 0 10000000
+ 2 2 0 11000000
+ 3 3 0 11100000
+ 4 4 0 11110000
+ 5 5 0 11111000
+ 6 6 0 11111100
+ 7 7 0 11111110
+
+first 0 bit should move left 1 position each line
+ 0 -1 0 11111111
+ 1 7 0 11111110
+ 2 6 0 11111100
+ 3 5 0 11111000
+ 4 4 0 11110000
+ 5 3 0 11100000
+ 6 2 0 11000000
+ 7 1 0 10000000
+
+first 1 bit should move left 1 position each line
+ 0 0 -1 00000000
+ 1 0 7 00000001
+ 2 0 6 00000011
+ 3 0 5 00000111
+ 4 0 4 00001111
+ 5 0 3 00011111
+ 6 0 2 00111111
+ 7 0 1 01111111
+
+0 bit should move right 1 position each line
+ 0 0 1 01111111
+ 1 1 0 10111111
+ 2 2 0 11011111
+ 3 3 0 11101111
+ 4 4 0 11110111
+ 5 5 0 11111011
+ 6 6 0 11111101
+ 7 7 0 11111110
+
+1 bit should move right 1 position each line
+ 0 1 0 10000000
+ 1 0 1 01000000
+ 2 0 2 00100000
+ 3 0 3 00010000
+ 4 0 4 00001000
+ 5 0 5 00000100
+ 6 0 6 00000010
+ 7 0 7 00000001
diff --git a/contrib/netbsd-tests/include/machine/t_bswap.c b/contrib/netbsd-tests/include/machine/t_bswap.c
new file mode 100644
index 0000000..a7bb42a
--- /dev/null
+++ b/contrib/netbsd-tests/include/machine/t_bswap.c
@@ -0,0 +1,178 @@
+/* $NetBSD: t_bswap.c,v 1.1 2011/05/05 05:39:11 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_bswap.c,v 1.1 2011/05/05 05:39:11 jruoho Exp $");
+
+#include <sys/types.h>
+#include <machine/bswap.h>
+
+#include <atf-c.h>
+
+static uint16_t x16;
+static uint32_t x32;
+static uint64_t x64;
+
+static uint16_t unconst16(uint16_t);
+static uint32_t unconst32(uint32_t);
+static uint64_t unconst64(uint64_t);
+
+/*
+ * Given the use of __builtin_constant_p(3),
+ * these functions try to avoid gcc(1) from
+ * treating the arguments as constants.
+ */
+static uint16_t
+unconst16(uint16_t val)
+{
+ return val + x16;
+}
+
+static uint32_t
+unconst32(uint32_t val)
+{
+ return val + x32;
+}
+
+static uint64_t
+unconst64(uint64_t val)
+{
+ return val + x64;
+}
+
+ATF_TC(bswap16_basic);
+ATF_TC_HEAD(bswap16_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of bswap16(3), #1");
+}
+
+ATF_TC_BODY(bswap16_basic, tc)
+{
+ ATF_REQUIRE_EQ(bswap16(0x0000), 0x0000);
+ ATF_REQUIRE_EQ(bswap16(0xff00), 0x00ff);
+ ATF_REQUIRE_EQ(bswap16(0xffff), 0xffff);
+ ATF_REQUIRE_EQ(bswap16(0x1234), 0x3412);
+}
+
+ATF_TC(bswap16_unconst);
+ATF_TC_HEAD(bswap16_unconst, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of bswap16(3), #2");
+}
+
+ATF_TC_BODY(bswap16_unconst, tc)
+{
+ x16 = 0;
+
+ ATF_REQUIRE_EQ(bswap16(unconst16(0x0000)), 0x0000);
+ ATF_REQUIRE_EQ(bswap16(unconst16(0xff00)), 0x00ff);
+ ATF_REQUIRE_EQ(bswap16(unconst16(0xffff)), 0xffff);
+ ATF_REQUIRE_EQ(bswap16(unconst16(0x1234)), 0x3412);
+}
+
+ATF_TC(bswap32_basic);
+ATF_TC_HEAD(bswap32_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of bswap32(3), #1");
+}
+
+ATF_TC_BODY(bswap32_basic, tc)
+{
+ ATF_REQUIRE_EQ(bswap32(0x00000000), 0x00000000);
+ ATF_REQUIRE_EQ(bswap32(0xffff0000), 0x0000ffff);
+ ATF_REQUIRE_EQ(bswap32(0xffffffff), 0xffffffff);
+ ATF_REQUIRE_EQ(bswap32(0x12345678), 0x78563412);
+}
+
+ATF_TC(bswap32_unconst);
+ATF_TC_HEAD(bswap32_unconst, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of bswap32(3), #2");
+}
+
+ATF_TC_BODY(bswap32_unconst, tc)
+{
+ x32 = 0;
+
+ ATF_REQUIRE_EQ(bswap32(unconst32(0x00000000)), 0x00000000);
+ ATF_REQUIRE_EQ(bswap32(unconst32(0xffff0000)), 0x0000ffff);
+ ATF_REQUIRE_EQ(bswap32(unconst32(0xffffffff)), 0xffffffff);
+ ATF_REQUIRE_EQ(bswap32(unconst32(0x12345678)), 0x78563412);
+}
+
+ATF_TC(bswap64_basic);
+ATF_TC_HEAD(bswap64_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of bswap64(3), #1");
+}
+
+ATF_TC_BODY(bswap64_basic, tc)
+{
+ ATF_REQUIRE_EQ(bswap64(0x0000000000000000), 0x0000000000000000);
+ ATF_REQUIRE_EQ(bswap64(0xffffffff00000000), 0x00000000ffffffff);
+ ATF_REQUIRE_EQ(bswap64(0xffffffffffffffff), 0xffffffffffffffff);
+ ATF_REQUIRE_EQ(bswap64(0x123456789abcdeff), 0xffdebc9a78563412);
+}
+
+ATF_TC(bswap64_unconst);
+ATF_TC_HEAD(bswap64_unconst, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of bswap64(3), #2");
+}
+
+ATF_TC_BODY(bswap64_unconst, tc)
+{
+ x64 = 0;
+
+ ATF_REQUIRE_EQ(bswap64(unconst64(0x0000000000000000)),
+ 0x0000000000000000);
+
+ ATF_REQUIRE_EQ(bswap64(unconst64(0xffffffff00000000)),
+ 0x00000000ffffffff);
+
+ ATF_REQUIRE_EQ(bswap64(unconst64(0xffffffffffffffff)),
+ 0xffffffffffffffff);
+
+ ATF_REQUIRE_EQ(bswap64(unconst64(0x123456789abcdeff)),
+ 0xffdebc9a78563412);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, bswap16_basic);
+ ATF_TP_ADD_TC(tp, bswap16_unconst);
+ ATF_TP_ADD_TC(tp, bswap32_basic);
+ ATF_TP_ADD_TC(tp, bswap32_unconst);
+ ATF_TP_ADD_TC(tp, bswap64_basic);
+ ATF_TP_ADD_TC(tp, bswap64_unconst);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/sys/t_bitops.c b/contrib/netbsd-tests/include/sys/t_bitops.c
new file mode 100644
index 0000000..7c90da0
--- /dev/null
+++ b/contrib/netbsd-tests/include/sys/t_bitops.c
@@ -0,0 +1,238 @@
+/* $NetBSD: t_bitops.c,v 1.16 2012/12/07 02:28:19 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011, 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas and Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_bitops.c,v 1.16 2012/12/07 02:28:19 christos Exp $");
+
+#include <atf-c.h>
+
+#include <sys/cdefs.h>
+#include <sys/bitops.h>
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+
+static const struct {
+ uint32_t val;
+ int ffs;
+ int fls;
+} bits[] = {
+
+ { 0x00, 0, 0 }, { 0x01, 1, 1 }, { 0x02, 2, 2 }, { 0x03, 1, 2 },
+ { 0x04, 3, 3 }, { 0x05, 1, 3 }, { 0x06, 2, 3 }, { 0x07, 1, 3 },
+ { 0x08, 4, 4 }, { 0x09, 1, 4 }, { 0x0A, 2, 4 }, { 0x0B, 1, 4 },
+ { 0x0C, 3, 4 }, { 0x0D, 1, 4 }, { 0x0E, 2, 4 }, { 0x0F, 1, 4 },
+
+ { 0x10, 5, 5 }, { 0x11, 1, 5 }, { 0x12, 2, 5 }, { 0x13, 1, 5 },
+ { 0x14, 3, 5 }, { 0x15, 1, 5 }, { 0x16, 2, 5 }, { 0x17, 1, 5 },
+ { 0x18, 4, 5 }, { 0x19, 1, 5 }, { 0x1A, 2, 5 }, { 0x1B, 1, 5 },
+ { 0x1C, 3, 5 }, { 0x1D, 1, 5 }, { 0x1E, 2, 5 }, { 0x1F, 1, 5 },
+
+ { 0xF0, 5, 8 }, { 0xF1, 1, 8 }, { 0xF2, 2, 8 }, { 0xF3, 1, 8 },
+ { 0xF4, 3, 8 }, { 0xF5, 1, 8 }, { 0xF6, 2, 8 }, { 0xF7, 1, 8 },
+ { 0xF8, 4, 8 }, { 0xF9, 1, 8 }, { 0xFA, 2, 8 }, { 0xFB, 1, 8 },
+ { 0xFC, 3, 8 }, { 0xFD, 1, 8 }, { 0xFE, 2, 8 }, { 0xFF, 1, 8 },
+
+};
+
+ATF_TC(bitmap_basic);
+ATF_TC_HEAD(bitmap_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of __BITMAP_*");
+}
+
+ATF_TC_BODY(bitmap_basic, tc)
+{
+ __BITMAP_TYPE(, uint32_t, 65536) bm;
+ __BITMAP_ZERO(&bm);
+
+ ATF_REQUIRE(__BITMAP_SIZE(uint32_t, 65536) == 2048);
+
+ ATF_REQUIRE(__BITMAP_SHIFT(uint32_t) == 5);
+
+ ATF_REQUIRE(__BITMAP_MASK(uint32_t) == 31);
+
+ for (size_t i = 0; i < 65536; i += 2)
+ __BITMAP_SET(i, &bm);
+
+ for (size_t i = 0; i < 2048; i++)
+ ATF_REQUIRE(bm._b[i] == 0x55555555);
+
+ for (size_t i = 0; i < 65536; i++)
+ if (i & 1)
+ ATF_REQUIRE(!__BITMAP_ISSET(i, &bm));
+ else {
+ ATF_REQUIRE(__BITMAP_ISSET(i, &bm));
+ __BITMAP_CLR(i, &bm);
+ }
+
+ for (size_t i = 0; i < 65536; i += 2)
+ ATF_REQUIRE(!__BITMAP_ISSET(i, &bm));
+}
+
+ATF_TC(fast_divide32);
+ATF_TC_HEAD(fast_divide32, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of fast_divide32(3)");
+}
+
+ATF_TC_BODY(fast_divide32, tc)
+{
+ uint32_t a, b, q, r, m;
+ uint8_t i, s1, s2;
+
+ a = 0xFFFF;
+ b = 0x000F;
+
+ fast_divide32_prepare(b, &m, &s1, &s2);
+
+ q = fast_divide32(a, b, m, s1, s2);
+ r = fast_remainder32(a, b, m, s1, s2);
+
+ ATF_REQUIRE(q == 0x1111 && r == 0);
+
+ for (i = 1; i < __arraycount(bits); i++) {
+
+ a = bits[i].val;
+ b = bits[i].ffs;
+
+ fast_divide32_prepare(b, &m, &s1, &s2);
+
+ q = fast_divide32(a, b, m, s1, s2);
+ r = fast_remainder32(a, b, m, s1, s2);
+
+ ATF_REQUIRE(q == a / b);
+ ATF_REQUIRE(r == a % b);
+ }
+}
+
+ATF_TC(ffsfls);
+ATF_TC_HEAD(ffsfls, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ffs32(3)-family for correctness");
+}
+
+ATF_TC_BODY(ffsfls, tc)
+{
+ uint8_t i;
+
+ ATF_REQUIRE(ffs32(0) == 0x00);
+ ATF_REQUIRE(fls32(0) == 0x00);
+ ATF_REQUIRE(ffs64(0) == 0x00);
+ ATF_REQUIRE(fls64(0) == 0x00);
+
+ ATF_REQUIRE(ffs32(UINT32_MAX) == 0x01);
+ ATF_REQUIRE(fls32(UINT32_MAX) == 0x20);
+ ATF_REQUIRE(ffs64(UINT64_MAX) == 0x01);
+ ATF_REQUIRE(fls64(UINT64_MAX) == 0x40);
+
+ for (i = 1; i < __arraycount(bits); i++) {
+
+ ATF_REQUIRE(ffs32(bits[i].val) == bits[i].ffs);
+ ATF_REQUIRE(fls32(bits[i].val) == bits[i].fls);
+ ATF_REQUIRE(ffs64(bits[i].val) == bits[i].ffs);
+ ATF_REQUIRE(fls64(bits[i].val) == bits[i].fls);
+
+ ATF_REQUIRE(ffs32(bits[i].val << 1) == bits[i].ffs + 1);
+ ATF_REQUIRE(fls32(bits[i].val << 1) == bits[i].fls + 1);
+ ATF_REQUIRE(ffs64(bits[i].val << 1) == bits[i].ffs + 1);
+ ATF_REQUIRE(fls64(bits[i].val << 1) == bits[i].fls + 1);
+
+ ATF_REQUIRE(ffs32(bits[i].val << 9) == bits[i].ffs + 9);
+ ATF_REQUIRE(fls32(bits[i].val << 9) == bits[i].fls + 9);
+ ATF_REQUIRE(ffs64(bits[i].val << 9) == bits[i].ffs + 9);
+ ATF_REQUIRE(fls64(bits[i].val << 9) == bits[i].fls + 9);
+ }
+}
+
+ATF_TC(ilog2_basic);
+ATF_TC_HEAD(ilog2_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ilog2(3) for correctness");
+}
+
+ATF_TC_BODY(ilog2_basic, tc)
+{
+ uint64_t i, x;
+
+ for (i = x = 0; i < 64; i++) {
+
+ x = (uint64_t)1 << i;
+
+ ATF_REQUIRE(i == (uint64_t)ilog2(x));
+ }
+}
+
+ATF_TC(ilog2_log2);
+ATF_TC_HEAD(ilog2_log2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2(3) vs. ilog2(3)");
+}
+
+ATF_TC_BODY(ilog2_log2, tc)
+{
+#ifdef __vax__
+ atf_tc_skip("Test is unavailable on vax because of lack of log2()");
+#else
+ double x, y;
+ uint64_t i;
+
+ /*
+ * This may fail under QEMU; see PR misc/44767.
+ */
+ for (i = 1; i < UINT32_MAX; i += UINT16_MAX) {
+
+ x = log2(i);
+ y = (double)(ilog2(i));
+
+ ATF_REQUIRE(ceil(x) >= y);
+
+ if (fabs(floor(x) - y) > 1.0e-40) {
+ atf_tc_expect_fail("PR misc/44767");
+ atf_tc_fail("log2(%"PRIu64") != "
+ "ilog2(%"PRIu64")", i, i);
+ }
+ }
+#endif
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, bitmap_basic);
+ ATF_TP_ADD_TC(tp, fast_divide32);
+ ATF_TP_ADD_TC(tp, ffsfls);
+ ATF_TP_ADD_TC(tp, ilog2_basic);
+ ATF_TP_ADD_TC(tp, ilog2_log2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/sys/t_bootblock.c b/contrib/netbsd-tests/include/sys/t_bootblock.c
new file mode 100644
index 0000000..13af2dd
--- /dev/null
+++ b/contrib/netbsd-tests/include/sys/t_bootblock.c
@@ -0,0 +1,73 @@
+/* $NetBSD: t_bootblock.c,v 1.1 2010/07/17 19:26:27 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2004, 2008, 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_bootblock.c,v 1.1 2010/07/17 19:26:27 jmmv Exp $");
+
+#include <sys/types.h>
+#include <sys/bootblock.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+ATF_TC_WITHOUT_HEAD(mbr_sector);
+ATF_TC_BODY(mbr_sector, tc)
+{
+ ATF_CHECK_EQ(512, sizeof(struct mbr_sector));
+
+ ATF_CHECK_EQ(MBR_BPB_OFFSET, offsetof(struct mbr_sector, mbr_bpb));
+ ATF_CHECK_EQ(MBR_BS_OFFSET, offsetof(struct mbr_sector, mbr_bootsel));
+
+ ATF_CHECK_EQ(440, offsetof(struct mbr_sector, mbr_dsn));
+
+ ATF_CHECK_EQ(446, MBR_PART_OFFSET);
+ ATF_CHECK_EQ(MBR_PART_OFFSET, offsetof(struct mbr_sector, mbr_parts));
+
+ ATF_CHECK_EQ(510, MBR_MAGIC_OFFSET);
+ ATF_CHECK_EQ(MBR_MAGIC_OFFSET, offsetof(struct mbr_sector, mbr_magic));
+}
+
+ATF_TC_WITHOUT_HEAD(mbr_partition);
+ATF_TC_BODY(mbr_partition, tc)
+{
+ ATF_CHECK_EQ(16, sizeof(struct mbr_partition));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mbr_sector);
+ ATF_TP_ADD_TC(tp, mbr_partition);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/sys/t_cdefs.c b/contrib/netbsd-tests/include/sys/t_cdefs.c
new file mode 100644
index 0000000..a473009
--- /dev/null
+++ b/contrib/netbsd-tests/include/sys/t_cdefs.c
@@ -0,0 +1,267 @@
+/* $NetBSD: t_cdefs.c,v 1.3 2013/09/05 09:01:27 gsutre Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_cdefs.c,v 1.3 2013/09/05 09:01:27 gsutre Exp $");
+
+#include <atf-c.h>
+#include <sys/types.h>
+#include <limits.h>
+#include <stdint.h>
+
+static const struct {
+ const char *name;
+ intmax_t min;
+ intmax_t max;
+} s[] = {
+ { "signed char", SCHAR_MIN, SCHAR_MAX },
+ { "signed short", SHRT_MIN, SHRT_MAX },
+ { "signed int", INT_MIN, INT_MAX },
+ { "signed long", LONG_MIN, LONG_MAX },
+ { "signed long long", LLONG_MIN, LLONG_MAX },
+};
+
+static const struct {
+ const char *name;
+ uintmax_t min;
+ uintmax_t max;
+} u[] = {
+ { "unsigned char", 0, UCHAR_MAX },
+ { "unsigned short", 0, USHRT_MAX },
+ { "unsigned int", 0, UINT_MAX },
+ { "unsigned long", 0, ULONG_MAX },
+ { "unsigned long long", 0, ULLONG_MAX },
+};
+
+ATF_TC(stypeminmax);
+ATF_TC_HEAD(stypeminmax, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks signed type min/max macros");
+}
+
+
+ATF_TC_BODY(stypeminmax, tc)
+{
+#define CHECK(a, b) ATF_REQUIRE(__type_min(a) == s[b].min); \
+ ATF_REQUIRE(__type_max(a) == s[b].max)
+
+ CHECK(signed char, 0);
+ CHECK(signed short, 1);
+ CHECK(signed int, 2);
+ CHECK(signed long, 3);
+ CHECK(signed long long, 4);
+#undef CHECK
+}
+
+ATF_TC(utypeminmax);
+ATF_TC_HEAD(utypeminmax, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks unsigned type min/max macros");
+}
+
+ATF_TC_BODY(utypeminmax, tc)
+{
+#define CHECK(a, b) ATF_REQUIRE(__type_min(a) == u[b].min); \
+ ATF_REQUIRE(__type_max(a) == u[b].max)
+
+ CHECK(unsigned char, 0);
+ CHECK(unsigned short, 1);
+ CHECK(unsigned int, 2);
+ CHECK(unsigned long, 3);
+ CHECK(unsigned long long, 4);
+#undef CHECK
+}
+
+ATF_TC(sissigned);
+ATF_TC_HEAD(sissigned, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks issigned macro for signed");
+}
+
+ATF_TC_BODY(sissigned, tc)
+{
+#define CHECK(a) ATF_REQUIRE(__type_is_signed(a) == 1)
+
+ CHECK(signed char);
+ CHECK(signed short);
+ CHECK(signed int);
+ CHECK(signed long);
+ CHECK(signed long long);
+#undef CHECK
+}
+
+ATF_TC(uissigned);
+ATF_TC_HEAD(uissigned, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks issigned macro for unsigned");
+}
+
+ATF_TC_BODY(uissigned, tc)
+{
+#define CHECK(a) ATF_REQUIRE(__type_is_signed(a) == 0)
+
+ CHECK(unsigned char);
+ CHECK(unsigned short);
+ CHECK(unsigned int);
+ CHECK(unsigned long);
+ CHECK(unsigned long long);
+#undef CHECK
+}
+
+ATF_TC(utypemask);
+ATF_TC_HEAD(utypemask, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks type mask macro for unsigned");
+}
+
+ATF_TC_BODY(utypemask, tc)
+{
+#define CHECK(a, b) ATF_REQUIRE(__type_mask(a) == b)
+
+ CHECK(unsigned char, 0xffffffffffffff00ULL);
+ CHECK(unsigned short, 0xffffffffffff0000ULL);
+ CHECK(unsigned int, 0xffffffff00000000ULL);
+ CHECK(unsigned long long, 0x0000000000000000ULL);
+#undef CHECK
+}
+
+ATF_TC(stypemask);
+ATF_TC_HEAD(stypemask, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks type mask macro for signed");
+}
+
+ATF_TC_BODY(stypemask, tc)
+{
+#define CHECK(a, b) ATF_REQUIRE(__type_mask(a) == b)
+
+ CHECK(signed char, 0xffffffffffffff00LL);
+ CHECK(signed short, 0xffffffffffff0000LL);
+ CHECK(signed int, 0xffffffff00000000LL);
+ CHECK(signed long long, 0x0000000000000000LL);
+#undef CHECK
+}
+
+ATF_TC(stypefit);
+ATF_TC_HEAD(stypefit, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks typefit macro for signed");
+}
+
+ATF_TC_BODY(stypefit, tc)
+{
+#define CHECK(a, b, c) ATF_REQUIRE(!__type_fit(a, b) == c)
+
+ CHECK(signed char, -1, 0);
+ CHECK(signed char, 1, 0);
+ CHECK(signed char, 0x7f, 0);
+ CHECK(signed char, 0x80, 1);
+ CHECK(signed char, 0xff, 1);
+ CHECK(signed char, 0x1ff, 1);
+
+ CHECK(signed short, -1, 0);
+ CHECK(signed short, 1, 0);
+ CHECK(signed short, 0x7fff, 0);
+ CHECK(signed short, 0x8000, 1);
+ CHECK(signed short, 0xffff, 1);
+ CHECK(signed short, 0x1ffff, 1);
+
+ CHECK(signed int, -1, 0);
+ CHECK(signed int, 1, 0);
+ CHECK(signed int, 0x7fffffff, 0);
+ CHECK(signed int, 0x80000000, 1);
+ CHECK(signed int, 0xffffffff, 1);
+ CHECK(signed int, 0x1ffffffffLL, 1);
+
+ CHECK(signed long long, -1, 0);
+ CHECK(signed long long, 1, 0);
+ CHECK(signed long long, 0x7fffffffffffffffLL, 0);
+ CHECK(signed long long, 0x8000000000000000LL, 1);
+ CHECK(signed long long, 0xffffffffffffffffLL, 1);
+
+#undef CHECK
+}
+
+ATF_TC(utypefit);
+ATF_TC_HEAD(utypefit, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks typefit macro for unsigned");
+}
+
+ATF_TC_BODY(utypefit, tc)
+{
+#define CHECK(a, b, c) ATF_REQUIRE(!__type_fit(a, b) == c)
+
+ CHECK(unsigned char, -1, 1);
+ CHECK(unsigned char, 1, 0);
+ CHECK(unsigned char, 0x7f, 0);
+ CHECK(unsigned char, 0x80, 0);
+ CHECK(unsigned char, 0xff, 0);
+ CHECK(unsigned char, 0x1ff, 1);
+
+ CHECK(unsigned short, -1, 1);
+ CHECK(unsigned short, 1, 0);
+ CHECK(unsigned short, 0x7fff, 0);
+ CHECK(unsigned short, 0x8000, 0);
+ CHECK(unsigned short, 0xffff, 0);
+ CHECK(unsigned short, 0x1ffff, 1);
+
+ CHECK(unsigned int, -1, 1);
+ CHECK(unsigned int, 1, 0);
+ CHECK(unsigned int, 0x7fffffff, 0);
+ CHECK(unsigned int, 0x80000000, 0);
+ CHECK(unsigned int, 0xffffffff, 0);
+ CHECK(unsigned int, 0x1ffffffffLL, 1);
+
+ CHECK(unsigned long long, -1, 1);
+ CHECK(unsigned long long, 1, 0);
+ CHECK(unsigned long long, 0x7fffffffffffffffULL, 0);
+ CHECK(unsigned long long, 0x8000000000000000ULL, 0);
+ CHECK(unsigned long long, 0xffffffffffffffffULL, 0);
+
+#undef CHECK
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, stypeminmax);
+ ATF_TP_ADD_TC(tp, utypeminmax);
+ ATF_TP_ADD_TC(tp, sissigned);
+ ATF_TP_ADD_TC(tp, uissigned);
+ ATF_TP_ADD_TC(tp, stypemask);
+ ATF_TP_ADD_TC(tp, utypemask);
+ ATF_TP_ADD_TC(tp, stypefit);
+ ATF_TP_ADD_TC(tp, utypefit);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/sys/t_socket.c b/contrib/netbsd-tests/include/sys/t_socket.c
new file mode 100644
index 0000000..ad4d2e6
--- /dev/null
+++ b/contrib/netbsd-tests/include/sys/t_socket.c
@@ -0,0 +1,205 @@
+/* $NetBSD: t_socket.c,v 1.3 2013/10/19 17:45:00 christos Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <err.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <util.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(cmsg_sendfd_bounds);
+ATF_TC_HEAD(cmsg_sendfd_bounds, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that attempting to pass an "
+ "invalid fd returns an error");
+}
+
+ATF_TC_BODY(cmsg_sendfd_bounds, tc)
+{
+ struct cmsghdr *cmp;
+ struct msghdr msg;
+ struct iovec iov;
+ int s[2];
+ int fd;
+
+ rump_init();
+
+ if (rump_sys_socketpair(AF_LOCAL, SOCK_STREAM, 0, s) == -1)
+ atf_tc_fail("rump_sys_socket");
+
+ cmp = malloc(CMSG_SPACE(sizeof(int)));
+
+ iov.iov_base = &fd;
+ iov.iov_len = sizeof(int);
+
+ cmp->cmsg_level = SOL_SOCKET;
+ cmp->cmsg_type = SCM_RIGHTS;
+ cmp->cmsg_len = CMSG_LEN(sizeof(int));
+
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+ msg.msg_control = cmp;
+ msg.msg_controllen = CMSG_SPACE(sizeof(int));
+
+ /*
+ * ERROR HERE: trying to pass invalid fd
+ * (This value was previously directly used to index the fd
+ * array and therefore we are passing a hyperspace index)
+ */
+ *(int *)CMSG_DATA(cmp) = 0x12345678;
+
+ rump_sys_sendmsg(s[0], &msg, 0);
+ if (errno != EBADF)
+ atf_tc_fail("descriptor passing failed: expected EBADF (9), "
+ "got %d\n(%s)", errno, strerror(errno));
+}
+
+
+ATF_TC(cmsg_sendfd);
+ATF_TC_HEAD(cmsg_sendfd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that fd passing works");
+ atf_tc_set_md_var(tc, "timeout", "2");
+}
+
+ATF_TC_BODY(cmsg_sendfd, tc)
+{
+ char buf[128];
+ struct cmsghdr *cmp;
+ struct msghdr msg;
+ struct sockaddr_un sun;
+ struct lwp *l1;
+ struct iovec iov;
+ socklen_t sl;
+ int s1, s2, sgot;
+ int rfd, fd[2], storage;
+
+ rump_init();
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ l1 = rump_pub_lwproc_curlwp();
+
+ /* create unix socket and bind it to a path */
+ memset(&sun, 0, sizeof(sun));
+ sun.sun_family = AF_LOCAL;
+#define SOCKPATH "/com"
+ strncpy(sun.sun_path, SOCKPATH, sizeof(SOCKPATH));
+ s1 = rump_sys_socket(AF_LOCAL, SOCK_STREAM, 0);
+ if (s1 == -1)
+ atf_tc_fail_errno("socket 1");
+ if (rump_sys_bind(s1, (struct sockaddr *)&sun, SUN_LEN(&sun)) == -1)
+ atf_tc_fail_errno("socket 1 bind");
+ if (rump_sys_listen(s1, 1) == -1)
+ atf_tc_fail_errno("socket 1 listen");
+
+ /* create second process for test */
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ (void)rump_pub_lwproc_curlwp();
+
+ /* connect to unix domain socket */
+ memset(&sun, 0, sizeof(sun));
+ sun.sun_family = AF_LOCAL;
+ strncpy(sun.sun_path, SOCKPATH, sizeof(SOCKPATH));
+ s2 = rump_sys_socket(AF_LOCAL, SOCK_STREAM, 0);
+ if (s2 == -1)
+ atf_tc_fail_errno("socket 2");
+ if (rump_sys_connect(s2, (struct sockaddr *)&sun, SUN_LEN(&sun)) == -1)
+ atf_tc_fail_errno("socket 2 connect");
+
+ /* open a pipe and write stuff to it */
+ if (rump_sys_pipe(fd) == -1)
+ atf_tc_fail_errno("can't open pipe");
+#define MAGICSTRING "duam xnaht"
+ if (rump_sys_write(fd[1], MAGICSTRING, sizeof(MAGICSTRING)) !=
+ sizeof(MAGICSTRING))
+ atf_tc_fail_errno("pipe write"); /* XXX: errno */
+
+ cmp = malloc(CMSG_SPACE(sizeof(int)));
+
+ iov.iov_base = &storage;
+ iov.iov_len = sizeof(int);
+
+ cmp->cmsg_level = SOL_SOCKET;
+ cmp->cmsg_type = SCM_RIGHTS;
+ cmp->cmsg_len = CMSG_LEN(sizeof(int));
+
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+ msg.msg_control = cmp;
+ msg.msg_controllen = CMSG_SPACE(sizeof(int));
+ *(int *)CMSG_DATA(cmp) = fd[0];
+
+ /* pass the fd */
+ if (rump_sys_sendmsg(s2, &msg, 0) == -1)
+ atf_tc_fail_errno("sendmsg failed");
+
+ /*
+ * We will read to the same cmsg space. Overwrite the space
+ * with an invalid fd to make sure we get an explicit error
+ * if we don't manage to read the fd.
+ */
+ *(int *)CMSG_DATA(cmp) = -1;
+
+ /* switch back to original proc */
+ rump_pub_lwproc_switch(l1);
+
+ /* accept connection and read fd */
+ sl = sizeof(sun);
+ sgot = rump_sys_accept(s1, (struct sockaddr *)&sun, &sl);
+ if (sgot == -1)
+ atf_tc_fail_errno("accept");
+ if (rump_sys_recvmsg(sgot, &msg, 0) == -1)
+ atf_tc_fail_errno("recvmsg failed");
+ rfd = *(int *)CMSG_DATA(cmp);
+
+ /* read from the fd */
+ memset(buf, 0, sizeof(buf));
+ if (rump_sys_read(rfd, buf, sizeof(buf)) == -1)
+ atf_tc_fail_errno("read rfd");
+
+ /* check that we got the right stuff */
+ if (strcmp(buf, MAGICSTRING) != 0)
+ atf_tc_fail("expected \"%s\", got \"%s\"", MAGICSTRING, buf);
+}
+
+ATF_TC(sock_cloexec);
+ATF_TC_HEAD(sock_cloexec, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "SOCK_CLOEXEC kernel invariant failure");
+}
+
+ATF_TC_BODY(sock_cloexec, tc)
+{
+
+ rump_init();
+ rump_pub_lwproc_rfork(RUMP_RFFDG);
+ if (rump_sys_socket(-1, SOCK_CLOEXEC, 0) != -1)
+ atf_tc_fail("invalid socket parameters unexpectedly worked");
+ rump_pub_lwproc_releaselwp();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, cmsg_sendfd);
+ ATF_TP_ADD_TC(tp, cmsg_sendfd_bounds);
+ ATF_TP_ADD_TC(tp, sock_cloexec);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/sys/t_tree.c b/contrib/netbsd-tests/include/sys/t_tree.c
new file mode 100644
index 0000000..498f7ee
--- /dev/null
+++ b/contrib/netbsd-tests/include/sys/t_tree.c
@@ -0,0 +1,124 @@
+/* $NetBSD: t_tree.c,v 1.1 2011/05/05 13:36:05 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010, 2011 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#include <sys/tree.h>
+
+#include <atf-c.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+struct mist {
+ RB_ENTRY(mist) rbentry;
+ int key;
+};
+RB_HEAD(head, mist) tt;
+
+static int
+mistcmp(struct mist *a, struct mist *b)
+{
+#if 0
+ return (b->key - a->key); /* wrong, can overflow */
+#else
+ if (b->key > a->key)
+ return 1;
+ else if (b->key < a->key)
+ return (-1);
+ else
+ return 0;
+#endif
+}
+
+RB_PROTOTYPE(head, mist, rbentry, mistcmp)
+RB_GENERATE(head, mist, rbentry, mistcmp)
+
+static struct mist *
+addmist(int key)
+{
+ struct mist *m;
+
+ m = malloc(sizeof(struct mist));
+ m->key = key;
+ RB_INSERT(head, &tt, m);
+ return m;
+}
+
+static int
+findmist(struct mist *m)
+{
+
+ return (!!RB_FIND(head, &tt, m));
+}
+
+#define N 1000
+static int
+test(void)
+{
+ struct mist *m[N];
+ int fail, i, j;
+
+ RB_INIT(&tt);
+ fail = 0;
+ for (i = 0; i < N; i++) {
+ m[i] = addmist(random() << 1); /* use all 32 bits */
+ for (j = 0; j <= i; j++)
+ if (!findmist(m[j]))
+ fail++;
+ }
+ return fail;
+}
+
+ATF_TC(tree_rbstress);
+ATF_TC_HEAD(tree_rbstress, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "rb-tree stress test");
+}
+
+ATF_TC_BODY(tree_rbstress, tc)
+{
+ int i, fail, f;
+
+ srandom(4711);
+ fail = 0;
+ for (i = 0; i < 10; i++) {
+ f = test();
+ if (f) {
+ atf_tc_fail_nonfatal("loop %d: %d errors\n", i, f);
+ fail += f;
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, tree_rbstress);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/sys/t_types.c b/contrib/netbsd-tests/include/sys/t_types.c
new file mode 100644
index 0000000..45b715f
--- /dev/null
+++ b/contrib/netbsd-tests/include/sys/t_types.c
@@ -0,0 +1,144 @@
+/* $NetBSD: t_types.c,v 1.4 2012/03/18 07:14:08 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_types.c,v 1.4 2012/03/18 07:14:08 jruoho Exp $");
+
+#include <sys/types.h>
+
+#include <atf-c.h>
+#include <limits.h>
+#include <stdint.h>
+
+#include <stdio.h>
+
+ATF_TC(types_limits);
+ATF_TC_HEAD(types_limits, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Known limits for types(3)");
+}
+
+ATF_TC_BODY(types_limits, tc)
+{
+ useconds_t usec;
+ ssize_t size;
+
+ /*
+ * IEEE Std 1003.1-2008:
+ *
+ * "The type ssize_t shall be capable of storing
+ * values at least in the range [-1, {SSIZE_MAX}]."
+ *
+ */
+ size = SSIZE_MAX;
+ ATF_REQUIRE(size > 0);
+
+ size = size + 1;
+ ATF_REQUIRE(size < 0);
+
+ /*
+ * IEEE Std 1003.1-2008:
+ *
+ * "The type suseconds_t shall be a signed integer type capable
+ * of storing values at least in the range [-1, 1000000]."
+ */
+ usec = 1000000;
+ ATF_REQUIRE(usec > 0);
+}
+
+ATF_TC(types_signed);
+ATF_TC_HEAD(types_signed, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Signed types(3)"
+ " (PR standards/44847)");
+}
+
+ATF_TC_BODY(types_signed, tc)
+{
+ blkcnt_t bc;
+ blksize_t bs;
+ ssize_t size;
+ off_t off;
+ pid_t pid;
+
+ /*
+ * As noted in types(3), the following
+ * types should be signed integers.
+ */
+ bc = 0;
+ bs = 0;
+ off = 0;
+ pid = 0;
+ size = 0;
+
+ ATF_CHECK((bc - 1) <= 0);
+ ATF_CHECK((bs - 1) <= 0);
+ ATF_CHECK((off - 1) <= 0);
+ ATF_CHECK((pid - 1) <= 0);
+ ATF_CHECK((size - 1) <= 0);
+}
+
+ATF_TC(types_unsigned);
+ATF_TC_HEAD(types_unsigned, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Unsigned types(3)"
+ " (PR standards/18067)");
+}
+
+ATF_TC_BODY(types_unsigned, tc)
+{
+ fsblkcnt_t fb;
+ fsfilcnt_t ff;
+ size_t size;
+ rlim_t lim;
+ ino_t ino;
+
+ fb = 0;
+ ff = 0;
+ ino = 0;
+ lim = 0;
+ size = 0;
+
+ ATF_CHECK((fb - 1) > 0);
+ ATF_CHECK((ff - 1) > 0);
+ ATF_CHECK((ino - 1) > 0);
+ ATF_CHECK((lim - 1) > 0);
+ ATF_CHECK((size - 1) > 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, types_limits);
+ ATF_TP_ADD_TC(tp, types_signed);
+ ATF_TP_ADD_TC(tp, types_unsigned);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/t_bitstring.c b/contrib/netbsd-tests/include/t_bitstring.c
new file mode 100644
index 0000000..1dda3c2
--- /dev/null
+++ b/contrib/netbsd-tests/include/t_bitstring.c
@@ -0,0 +1,298 @@
+/* $NetBSD: t_bitstring.c,v 1.4 2012/03/25 06:54:04 joerg Exp $ */
+
+/*-
+ * Copyright (c) 1993, 2008, 2010 The NetBSD Foundation, 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 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 <assert.h>
+#include <bitstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <atf-c.h>
+
+static void
+clearbits(bitstr_t *b, int n)
+{
+ int i = bitstr_size(n);
+
+ while(i--)
+ *(b + i) = 0;
+}
+
+static void
+printbits(FILE *file, bitstr_t *b, int n)
+{
+ int i;
+ int jc, js;
+
+ bit_ffc(b, n, &jc);
+ bit_ffs(b, n, &js);
+
+ (void) fprintf(file, "%3d %3d ", jc, js);
+
+ for (i=0; i < n; i++) {
+ (void) fprintf(file, "%c", (bit_test(b, i) ? '1' : '0'));
+ }
+
+ (void) fprintf(file, "%c", '\n');
+}
+
+static void
+calculate_data(FILE *file, const int test_length)
+{
+ int i;
+ bitstr_t *bs;
+
+ assert(test_length >= 4);
+
+ (void) fprintf(file, "Testing with TEST_LENGTH = %d\n\n", test_length);
+
+ (void) fprintf(file, "test _bit_byte, _bit_mask, and bitstr_size\n");
+ (void) fprintf(file, " i _bit_byte(i) _bit_mask(i) bitstr_size(i)\n");
+
+ for (i=0; i < test_length; i++) {
+ (void) fprintf(file, "%3d%15u%15u%15zu\n",
+ i, _bit_byte(i), _bit_mask(i), bitstr_size(i));
+ }
+
+ bs = bit_alloc(test_length);
+ clearbits(bs, test_length);
+ (void) fprintf(file, "\ntest bit_alloc, clearbits, bit_ffc, bit_ffs\n");
+ (void) fprintf(file, "be: 0 -1 ");
+ for (i=0; i < test_length; i++)
+ (void) fprintf(file, "%c", '0');
+ (void) fprintf(file, "\nis: ");
+ printbits(file, bs, test_length);
+
+ (void) fprintf(file, "\ntest bit_set\n");
+ for (i=0; i < test_length; i+=3)
+ bit_set(bs, i);
+ (void) fprintf(file, "be: 1 0 ");
+ for (i=0; i < test_length; i++)
+ (void) fprintf(file, "%c", "100"[i % 3]);
+ (void) fprintf(file, "\nis: ");
+ printbits(file, bs, test_length);
+
+ (void) fprintf(file, "\ntest bit_clear\n");
+ for (i=0; i < test_length; i+=6)
+ bit_clear(bs, i);
+ (void) fprintf(file, "be: 0 3 ");
+ for (i=0; i < test_length; i++)
+ (void) fprintf(file, "%c", "000100"[i % 6]);
+ (void) fprintf(file, "\nis: ");
+ printbits(file, bs, test_length);
+
+ (void) fprintf(file, "\ntest bit_test using previous bitstring\n");
+ (void) fprintf(file, " i bit_test(i)\n");
+ for (i=0; i < test_length; i++)
+ (void) fprintf(file, "%3d%15d\n", i, bit_test(bs, i));
+
+ clearbits(bs, test_length);
+ (void) fprintf(file, "\ntest clearbits\n");
+ (void) fprintf(file, "be: 0 -1 ");
+ for (i=0; i < test_length; i++)
+ (void) fprintf(file, "%c", '0');
+ (void) fprintf(file, "\nis: ");
+ printbits(file, bs, test_length);
+
+ (void) fprintf(file, "\ntest bit_nset and bit_nclear\n");
+ bit_nset(bs, 1, test_length - 2);
+ (void) fprintf(file, "be: 0 1 0");
+ for (i=0; i < test_length - 2; i++)
+ (void) fprintf(file, "%c", '1');
+ (void) fprintf(file, "0\nis: ");
+ printbits(file, bs, test_length);
+
+ bit_nclear(bs, 2, test_length - 3);
+ (void) fprintf(file, "be: 0 1 01");
+ for (i=0; i < test_length - 4; i++)
+ (void) fprintf(file, "%c", '0');
+ (void) fprintf(file, "10\nis: ");
+ printbits(file, bs, test_length);
+
+ bit_nclear(bs, 0, test_length - 1);
+ (void) fprintf(file, "be: 0 -1 ");
+ for (i=0; i < test_length; i++)
+ (void) fprintf(file, "%c", '0');
+ (void) fprintf(file, "\nis: ");
+ printbits(file, bs, test_length);
+ bit_nset(bs, 0, test_length - 2);
+ (void) fprintf(file, "be: %3d 0 ",test_length - 1);
+ for (i=0; i < test_length - 1; i++)
+ (void) fprintf(file, "%c", '1');
+ fprintf(file, "%c", '0');
+ (void) fprintf(file, "\nis: ");
+ printbits(file, bs, test_length);
+ bit_nclear(bs, 0, test_length - 1);
+ (void) fprintf(file, "be: 0 -1 ");
+ for (i=0; i < test_length; i++)
+ (void) fprintf(file, "%c", '0');
+ (void) fprintf(file, "\nis: ");
+ printbits(file, bs, test_length);
+
+ (void) fprintf(file, "\n");
+ (void) fprintf(file, "first 1 bit should move right 1 position each line\n");
+ for (i=0; i < test_length; i++) {
+ bit_nclear(bs, 0, test_length - 1);
+ bit_nset(bs, i, test_length - 1);
+ (void) fprintf(file, "%3d ", i); printbits(file, bs, test_length);
+ }
+
+ (void) fprintf(file, "\n");
+ (void) fprintf(file, "first 0 bit should move right 1 position each line\n");
+ for (i=0; i < test_length; i++) {
+ bit_nset(bs, 0, test_length - 1);
+ bit_nclear(bs, i, test_length - 1);
+ (void) fprintf(file, "%3d ", i); printbits(file, bs, test_length);
+ }
+
+ (void) fprintf(file, "\n");
+ (void) fprintf(file, "first 0 bit should move left 1 position each line\n");
+ for (i=0; i < test_length; i++) {
+ bit_nclear(bs, 0, test_length - 1);
+ bit_nset(bs, 0, test_length - 1 - i);
+ (void) fprintf(file, "%3d ", i); printbits(file, bs, test_length);
+ }
+
+ (void) fprintf(file, "\n");
+ (void) fprintf(file, "first 1 bit should move left 1 position each line\n");
+ for (i=0; i < test_length; i++) {
+ bit_nset(bs, 0, test_length - 1);
+ bit_nclear(bs, 0, test_length - 1 - i);
+ (void) fprintf(file, "%3d ", i); printbits(file, bs, test_length);
+ }
+
+ (void) fprintf(file, "\n");
+ (void) fprintf(file, "0 bit should move right 1 position each line\n");
+ for (i=0; i < test_length; i++) {
+ bit_nset(bs, 0, test_length - 1);
+ bit_nclear(bs, i, i);
+ (void) fprintf(file, "%3d ", i); printbits(file, bs, test_length);
+ }
+
+ (void) fprintf(file, "\n");
+ (void) fprintf(file, "1 bit should move right 1 position each line\n");
+ for (i=0; i < test_length; i++) {
+ bit_nclear(bs, 0, test_length - 1);
+ bit_nset(bs, i, i);
+ (void) fprintf(file, "%3d ", i); printbits(file, bs, test_length);
+ }
+
+ (void) free(bs);
+}
+
+static void
+one_check(const atf_tc_t *tc, const int test_length)
+{
+ FILE *out;
+ char command[1024];
+
+ ATF_REQUIRE((out = fopen("out", "w")) != NULL);
+ calculate_data(out, test_length);
+ fclose(out);
+
+ /* XXX The following is a huge hack that was added to simplify the
+ * conversion of these tests from src/regress/ to src/tests/. The
+ * tests in this file should be checking their own results, without
+ * having to resort to external data files. */
+ snprintf(command, sizeof(command), "diff -u %s/d_bitstring_%d.out out",
+ atf_tc_get_config_var(tc, "srcdir"), test_length);
+ if (system(command) != EXIT_SUCCESS)
+ atf_tc_fail("Test failed; see output for details");
+}
+
+ATF_TC(bits_8);
+ATF_TC_HEAD(bits_8, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks 8-bit long bitstrings");
+}
+ATF_TC_BODY(bits_8, tc)
+{
+ one_check(tc, 8);
+}
+
+ATF_TC(bits_27);
+ATF_TC_HEAD(bits_27, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks 27-bit long bitstrings");
+}
+ATF_TC_BODY(bits_27, tc)
+{
+ one_check(tc, 27);
+}
+
+ATF_TC(bits_32);
+ATF_TC_HEAD(bits_32, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks 32-bit long bitstrings");
+}
+ATF_TC_BODY(bits_32, tc)
+{
+ one_check(tc, 32);
+}
+
+ATF_TC(bits_49);
+ATF_TC_HEAD(bits_49, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks 49-bit long bitstrings");
+}
+ATF_TC_BODY(bits_49, tc)
+{
+ one_check(tc, 49);
+}
+
+ATF_TC(bits_64);
+ATF_TC_HEAD(bits_64, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks 64-bit long bitstrings");
+}
+ATF_TC_BODY(bits_64, tc)
+{
+ one_check(tc, 64);
+}
+
+ATF_TC(bits_67);
+ATF_TC_HEAD(bits_67, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks 67-bit long bitstrings");
+}
+ATF_TC_BODY(bits_67, tc)
+{
+ one_check(tc, 67);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, bits_8);
+ ATF_TP_ADD_TC(tp, bits_27);
+ ATF_TP_ADD_TC(tp, bits_32);
+ ATF_TP_ADD_TC(tp, bits_49);
+ ATF_TP_ADD_TC(tp, bits_64);
+ ATF_TP_ADD_TC(tp, bits_67);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/t_errno.c b/contrib/netbsd-tests/include/t_errno.c
new file mode 100644
index 0000000..763e569
--- /dev/null
+++ b/contrib/netbsd-tests/include/t_errno.c
@@ -0,0 +1,765 @@
+/* $NetBSD: t_errno.c,v 1.1 2011/05/01 17:07:05 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_errno.c,v 1.1 2011/05/01 17:07:05 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+
+ATF_TC(errno_constants);
+ATF_TC_HEAD(errno_constants, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test POSIX constants in <errno.h>");
+}
+
+ATF_TC_BODY(errno_constants, tc)
+{
+ bool fail;
+
+ /*
+ * The following definitions should be available
+ * according to IEEE Std 1003.1-2008, issue 7.
+ */
+ atf_tc_expect_fail("PR standards/44921");
+
+ fail = true;
+
+#ifdef E2BIG
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("E2BIG not defined");
+
+ fail = true;
+
+#ifdef EACCES
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EACCES not defined");
+
+ fail = true;
+
+#ifdef EADDRINUSE
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EADDRINUSE not defined");
+
+ fail = true;
+
+#ifdef EADDRNOTAVAIL
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EADDRNOTAVAIL not defined");
+
+ fail = true;
+
+#ifdef EAFNOSUPPORT
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAFNOSUPPORT not defined");
+
+ fail = true;
+
+#ifdef EAGAIN
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAGAIN not defined");
+
+ fail = true;
+
+#ifdef EALREADY
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EALREADY not defined");
+
+ fail = true;
+
+#ifdef EBADF
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EBADF not defined");
+
+ fail = true;
+
+#ifdef EBADMSG
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EBADMSG not defined");
+
+ fail = true;
+
+#ifdef EBUSY
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EBUSY not defined");
+
+ fail = true;
+
+#ifdef ECANCELED
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("ECANCELED not defined");
+
+ fail = true;
+
+#ifdef ECHILD
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("ECHILD not defined");
+
+ fail = true;
+
+#ifdef ECONNABORTED
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("ECONNABORTED not defined");
+
+ fail = true;
+
+#ifdef ECONNREFUSED
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("ECONNREFUSED not defined");
+
+ fail = true;
+
+#ifdef ECONNRESET
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("ECONNRESET not defined");
+
+ fail = true;
+
+#ifdef EDEADLK
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EDEADLK not defined");
+
+ fail = true;
+
+#ifdef EDESTADDRREQ
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EDESTADDRREQ not defined");
+
+ fail = true;
+
+#ifdef EDOM
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EDOM not defined");
+
+ fail = true;
+
+#ifdef EDQUOT
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EDQUOT not defined");
+
+ fail = true;
+
+#ifdef EEXIST
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EEXIST not defined");
+
+ fail = true;
+
+#ifdef EFAULT
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EFAULT not defined");
+
+ fail = true;
+
+#ifdef EFBIG
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EFBIG not defined");
+
+ fail = true;
+
+#ifdef EHOSTUNREACH
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EHOSTUNREACH not defined");
+
+ fail = true;
+
+#ifdef EIDRM
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EIDRM not defined");
+
+ fail = true;
+
+#ifdef EILSEQ
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EILSEQ not defined");
+
+ fail = true;
+
+#ifdef EINPROGRESS
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EINPROGRESS not defined");
+
+ fail = true;
+
+#ifdef EINTR
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EINTR not defined");
+
+ fail = true;
+
+#ifdef EINVAL
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EINVAL not defined");
+
+ fail = true;
+
+#ifdef EIO
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EIO not defined");
+
+ fail = true;
+
+#ifdef EISCONN
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EISCONN not defined");
+
+ fail = true;
+
+#ifdef EISDIR
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EISDIR not defined");
+
+ fail = true;
+
+#ifdef ELOOP
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ELOOP not defined");
+
+ fail = true;
+
+#ifdef EMFILE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EMFILE not defined");
+
+ fail = true;
+
+#ifdef EMLINK
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EMLINK not defined");
+
+ fail = true;
+
+#ifdef EMSGSIZE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EMSGSIZE not defined");
+
+ fail = true;
+
+#ifdef EMULTIHOP
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EMULTIHOP not defined");
+
+ fail = true;
+
+#ifdef ENAMETOOLONG
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENAMETOOLONG not defined");
+
+ fail = true;
+
+#ifdef ENETDOWN
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENETDOWN not defined");
+
+ fail = true;
+
+#ifdef ENETRESET
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENETRESET not defined");
+
+ fail = true;
+
+#ifdef ENETUNREACH
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENETUNREACH not defined");
+
+ fail = true;
+
+#ifdef ENFILE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENFILE not defined");
+
+ fail = true;
+
+#ifdef ENOBUFS
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOBUFS not defined");
+
+ fail = true;
+
+#ifdef ENODATA
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENODATA not defined");
+
+ fail = true;
+
+#ifdef ENODEV
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENODEV not defined");
+
+ fail = true;
+
+#ifdef ENOENT
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOENT not defined");
+
+ fail = true;
+
+#ifdef ENOEXEC
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOEXEC not defined");
+
+ fail = true;
+
+#ifdef ENOLCK
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOLCK not defined");
+
+ fail = true;
+
+#ifdef ENOLINK
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOLINK not defined");
+
+ fail = true;
+
+#ifdef ENOMEM
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOMEM not defined");
+
+ fail = true;
+
+#ifdef ENOMSG
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOMSG not defined");
+
+ fail = true;
+
+#ifdef ENOPROTOOPT
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOPROTOOPT not defined");
+
+ fail = true;
+
+#ifdef ENOSPC
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOSPC not defined");
+
+ fail = true;
+
+#ifdef ENOSR
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOSR not defined");
+
+ fail = true;
+
+#ifdef ENOSTR
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOSTR not defined");
+
+ fail = true;
+
+#ifdef ENOSYS
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOSYS not defined");
+
+ fail = true;
+
+#ifdef ENOTCONN
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOTCONN not defined");
+
+ fail = true;
+
+#ifdef ENOTDIR
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOTDIR not defined");
+
+ fail = true;
+
+#ifdef ENOTEMPTY
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOTEMPTY not defined");
+
+ fail = true;
+
+#ifdef ENOTRECOVERABLE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOTRECOVERABLE not defined");
+
+ fail = true;
+
+#ifdef ENOTSOCK
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOTSOCK not defined");
+
+ fail = true;
+
+#ifdef ENOTSUP
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOTSUP not defined");
+
+ fail = true;
+
+#ifdef ENOTTY
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENOTTY not defined");
+
+ fail = true;
+
+#ifdef ENXIO
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ENXIO not defined");
+
+ fail = true;
+
+#ifdef EOPNOTSUPP
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EOPNOTSUPP not defined");
+
+ fail = true;
+
+#ifdef EOVERFLOW
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EOVERFLOW not defined");
+
+ fail = true;
+
+#ifdef EOWNERDEAD
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EOWNERDEAD not defined");
+
+ fail = true;
+
+#ifdef EPERM
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EPERM not defined");
+
+ fail = true;
+
+#ifdef EPIPE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EPIPE not defined");
+
+ fail = true;
+
+#ifdef EPROTO
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EPROTO not defined");
+
+ fail = true;
+
+#ifdef EPROTONOSUPPORT
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EPROTONOSUPPORT not defined");
+
+ fail = true;
+
+#ifdef EPROTOTYPE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EPROTOTYPE not defined");
+
+ fail = true;
+
+#ifdef ERANGE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ERANGE not defined");
+
+ fail = true;
+
+#ifdef EROFS
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EROFS not defined");
+
+ fail = true;
+
+#ifdef ESPIPE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ESPIPE not defined");
+
+ fail = true;
+
+#ifdef ESRCH
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ESRCH not defined");
+
+ fail = true;
+
+#ifdef ESTALE
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ESTALE not defined");
+
+ fail = true;
+
+#ifdef ETIME
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ETIME not defined");
+
+ fail = true;
+
+#ifdef ETIMEDOUT
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ETIMEDOUT not defined");
+
+ fail = true;
+
+#ifdef ETXTBSY
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("ETXTBSY not defined");
+
+ fail = true;
+
+#ifdef EWOULDBLOCK
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EWOULDBLOCK not defined");
+
+ fail = true;
+
+#ifdef EXDEV
+ fail = false;
+#endif
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("EXDEV not defined");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, errno_constants);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/t_glob.c b/contrib/netbsd-tests/include/t_glob.c
new file mode 100644
index 0000000..da6a4ad
--- /dev/null
+++ b/contrib/netbsd-tests/include/t_glob.c
@@ -0,0 +1,75 @@
+/* $NetBSD: t_glob.c,v 1.1 2011/04/10 08:35:48 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_glob.c,v 1.1 2011/04/10 08:35:48 jruoho Exp $");
+
+#include <atf-c.h>
+#include <glob.h>
+#include <string.h>
+
+ATF_TC(glob_types);
+ATF_TC_HEAD(glob_types, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test glob(3) types");
+}
+
+ATF_TC_BODY(glob_types, tc)
+{
+ glob_t g;
+
+ /*
+ * IEEE Std 1003.1-2008:
+ *
+ * "The <glob.h> header shall define the glob_t structure type,
+ * which shall include at least the following members:
+ *
+ * size_t gl_pathc Count of paths matched by pattern.
+ * char **gl_pathv Pointer to a list of matched pathnames.
+ * size_t gl_offs Slots to reserve at the beginning of gl_pathv."
+ *
+ * Verify that gl_pathc and gl_offs are unsigned; PR standards/21401.
+ */
+ (void)memset(&g, 0, sizeof(glob_t));
+
+ g.gl_offs = g.gl_offs - 1;
+ g.gl_pathc = g.gl_pathc - 1;
+
+ ATF_REQUIRE(g.gl_pathc > 0);
+ ATF_REQUIRE(g.gl_offs > 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, glob_types);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/t_inttypes.c b/contrib/netbsd-tests/include/t_inttypes.c
new file mode 100644
index 0000000..d713615
--- /dev/null
+++ b/contrib/netbsd-tests/include/t_inttypes.c
@@ -0,0 +1,250 @@
+/* $NetBSD: t_inttypes.c,v 1.3 2013/10/19 17:44:37 christos Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, 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 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 <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <atf-c.h>
+
+ATF_TC_WITHOUT_HEAD(int_fmtio);
+ATF_TC_BODY(int_fmtio, tc)
+{
+ char buf[64];
+
+ int8_t i8 = 0;
+ int16_t i16 = 0;
+ int32_t i32 = 0;
+ int64_t i64 = 0;
+ int_least8_t il8 = 0;
+ int_least16_t il16 = 0;
+ int_least32_t il32 = 0;
+ int_least64_t il64 = 0;
+ int_fast8_t if8 = 0;
+ int_fast16_t if16 = 0;
+ int_fast32_t if32 = 0;
+ int_fast64_t if64 = 0;
+ intmax_t im = 0;
+ intptr_t ip = 0;
+ uint8_t ui8 = 0;
+ uint16_t ui16 = 0;
+ uint32_t ui32 = 0;
+ uint64_t ui64 = 0;
+ uint_least8_t uil8 = 0;
+ uint_least16_t uil16 = 0;
+ uint_least32_t uil32 = 0;
+ uint_least64_t uil64 = 0;
+ uint_fast8_t uif8 = 0;
+ uint_fast16_t uif16 = 0;
+ uint_fast32_t uif32 = 0;
+ uint_fast64_t uif64 = 0;
+ uintmax_t uim = 0;
+ uintptr_t uip = 0;
+
+#define PRINT(fmt, var) \
+ snprintf(buf, sizeof(buf), "%" fmt, var)
+#define SCAN(fmt, var) \
+ sscanf(buf, "%" fmt, &var)
+
+ PRINT(PRId8, i8);
+ PRINT(PRId16, i16);
+ PRINT(PRId32, i32);
+ PRINT(PRId64, i64);
+ PRINT(PRIdLEAST8, il8);
+ PRINT(PRIdLEAST16, il16);
+ PRINT(PRIdLEAST32, il32);
+ PRINT(PRIdLEAST64, il64);
+ PRINT(PRIdFAST8, if8);
+ PRINT(PRIdFAST16, if16);
+ PRINT(PRIdFAST32, if32);
+ PRINT(PRIdFAST64, if64);
+ PRINT(PRIdMAX, im);
+ PRINT(PRIdPTR, ip);
+
+ PRINT(PRIi8, i8);
+ PRINT(PRIi16, i16);
+ PRINT(PRIi32, i32);
+ PRINT(PRIi64, i64);
+ PRINT(PRIiLEAST8, il8);
+ PRINT(PRIiLEAST16, il16);
+ PRINT(PRIiLEAST32, il32);
+ PRINT(PRIiLEAST64, il64);
+ PRINT(PRIiFAST8, if8);
+ PRINT(PRIiFAST16, if16);
+ PRINT(PRIiFAST32, if32);
+ PRINT(PRIiFAST64, if64);
+ PRINT(PRIiMAX, im);
+ PRINT(PRIiPTR, ip);
+
+ PRINT(PRIo8, ui8);
+ PRINT(PRIo16, ui16);
+ PRINT(PRIo32, ui32);
+ PRINT(PRIo64, ui64);
+ PRINT(PRIoLEAST8, uil8);
+ PRINT(PRIoLEAST16, uil16);
+ PRINT(PRIoLEAST32, uil32);
+ PRINT(PRIoLEAST64, uil64);
+ PRINT(PRIoFAST8, uif8);
+ PRINT(PRIoFAST16, uif16);
+ PRINT(PRIoFAST32, uif32);
+ PRINT(PRIoFAST64, uif64);
+ PRINT(PRIoMAX, uim);
+ PRINT(PRIoPTR, uip);
+
+ PRINT(PRIu8, ui8);
+ PRINT(PRIu16, ui16);
+ PRINT(PRIu32, ui32);
+ PRINT(PRIu64, ui64);
+ PRINT(PRIuLEAST8, uil8);
+ PRINT(PRIuLEAST16, uil16);
+ PRINT(PRIuLEAST32, uil32);
+ PRINT(PRIuLEAST64, uil64);
+ PRINT(PRIuFAST8, uif8);
+ PRINT(PRIuFAST16, uif16);
+ PRINT(PRIuFAST32, uif32);
+ PRINT(PRIuFAST64, uif64);
+ PRINT(PRIuMAX, uim);
+ PRINT(PRIuPTR, uip);
+
+ PRINT(PRIx8, ui8);
+ PRINT(PRIx16, ui16);
+ PRINT(PRIx32, ui32);
+ PRINT(PRIx64, ui64);
+ PRINT(PRIxLEAST8, uil8);
+ PRINT(PRIxLEAST16, uil16);
+ PRINT(PRIxLEAST32, uil32);
+ PRINT(PRIxLEAST64, uil64);
+ PRINT(PRIxFAST8, uif8);
+ PRINT(PRIxFAST16, uif16);
+ PRINT(PRIxFAST32, uif32);
+ PRINT(PRIxFAST64, uif64);
+ PRINT(PRIxMAX, uim);
+ PRINT(PRIxPTR, uip);
+
+ PRINT(PRIX8, ui8);
+ PRINT(PRIX16, ui16);
+ PRINT(PRIX32, ui32);
+ PRINT(PRIX64, ui64);
+ PRINT(PRIXLEAST8, uil8);
+ PRINT(PRIXLEAST16, uil16);
+ PRINT(PRIXLEAST32, uil32);
+ PRINT(PRIXLEAST64, uil64);
+ PRINT(PRIXFAST8, uif8);
+ PRINT(PRIXFAST16, uif16);
+ PRINT(PRIXFAST32, uif32);
+ PRINT(PRIXFAST64, uif64);
+ PRINT(PRIXMAX, uim);
+ PRINT(PRIXPTR, uip);
+
+
+ SCAN(SCNd8, i8);
+ SCAN(SCNd16, i16);
+ SCAN(SCNd32, i32);
+ SCAN(SCNd64, i64);
+ SCAN(SCNdLEAST8, il8);
+ SCAN(SCNdLEAST16, il16);
+ SCAN(SCNdLEAST32, il32);
+ SCAN(SCNdLEAST64, il64);
+ SCAN(SCNdFAST8, if8);
+ SCAN(SCNdFAST16, if16);
+ SCAN(SCNdFAST32, if32);
+ SCAN(SCNdFAST64, if64);
+ SCAN(SCNdMAX, im);
+ SCAN(SCNdPTR, ip);
+
+ SCAN(SCNi8, i8);
+ SCAN(SCNi16, i16);
+ SCAN(SCNi32, i32);
+ SCAN(SCNi64, i64);
+ SCAN(SCNiLEAST8, il8);
+ SCAN(SCNiLEAST16, il16);
+ SCAN(SCNiLEAST32, il32);
+ SCAN(SCNiLEAST64, il64);
+ SCAN(SCNiFAST8, if8);
+ SCAN(SCNiFAST16, if16);
+ SCAN(SCNiFAST32, if32);
+ SCAN(SCNiFAST64, if64);
+ SCAN(SCNiMAX, im);
+ SCAN(SCNiPTR, ip);
+
+ SCAN(SCNo8, ui8);
+ SCAN(SCNo16, ui16);
+ SCAN(SCNo32, ui32);
+ SCAN(SCNo64, ui64);
+ SCAN(SCNoLEAST8, uil8);
+ SCAN(SCNoLEAST16, uil16);
+ SCAN(SCNoLEAST32, uil32);
+ SCAN(SCNoLEAST64, uil64);
+ SCAN(SCNoFAST8, uif8);
+ SCAN(SCNoFAST16, uif16);
+ SCAN(SCNoFAST32, uif32);
+ SCAN(SCNoFAST64, uif64);
+ SCAN(SCNoMAX, uim);
+ SCAN(SCNoPTR, uip);
+
+ SCAN(SCNu8, ui8);
+ SCAN(SCNu16, ui16);
+ SCAN(SCNu32, ui32);
+ SCAN(SCNu64, ui64);
+ SCAN(SCNuLEAST8, uil8);
+ SCAN(SCNuLEAST16, uil16);
+ SCAN(SCNuLEAST32, uil32);
+ SCAN(SCNuLEAST64, uil64);
+ SCAN(SCNuFAST8, uif8);
+ SCAN(SCNuFAST16, uif16);
+ SCAN(SCNuFAST32, uif32);
+ SCAN(SCNuFAST64, uif64);
+ SCAN(SCNuMAX, uim);
+ SCAN(SCNuPTR, uip);
+
+ SCAN(SCNx8, ui8);
+ SCAN(SCNx16, ui16);
+ SCAN(SCNx32, ui32);
+ SCAN(SCNx64, ui64);
+ SCAN(SCNxLEAST8, uil8);
+ SCAN(SCNxLEAST16, uil16);
+ SCAN(SCNxLEAST32, uil32);
+ SCAN(SCNxLEAST64, uil64);
+ SCAN(SCNxFAST8, uif8);
+ SCAN(SCNxFAST16, uif16);
+ SCAN(SCNxFAST32, uif32);
+ SCAN(SCNxFAST64, uif64);
+ SCAN(SCNxMAX, uim);
+ SCAN(SCNxPTR, uip);
+
+#undef SCAN
+#undef PRINT
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, int_fmtio);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/t_limits.c b/contrib/netbsd-tests/include/t_limits.c
new file mode 100644
index 0000000..625750a
--- /dev/null
+++ b/contrib/netbsd-tests/include/t_limits.c
@@ -0,0 +1,287 @@
+/* $NetBSD: t_limits.c,v 1.2 2011/04/04 18:02:01 jruoho Exp $ */
+
+/*
+ * Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Copyright (c) 2009, Stathis Kamperis
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_limits.c,v 1.2 2011/04/04 18:02:01 jruoho Exp $");
+
+#include <limits.h>
+
+#include <atf-c.h>
+
+struct psxentry {
+ const char *psx_desc;
+ int psx_constant;
+ int psx_minval;
+} psxtable[] = {
+
+ /*
+ * POSIX symbolic constants.
+ */
+#ifdef _POSIX_AIO_LISTIO_MAX
+ { "_POSIX_AIO_LISTIO_MAX", _POSIX_AIO_LISTIO_MAX, 2 },
+#endif
+#ifdef _POSIX_AIO_MAX
+ { "_POSIX_AIO_MAX", _POSIX_AIO_MAX, 1 },
+#endif
+#ifdef _POSIX_ARG_MAX
+ { "_POSIX_ARG_MAX", _POSIX_ARG_MAX, 4096 },
+#endif
+#ifdef _POSIX_CHILD_MAX
+ { "_POSIX_CHILD_MAX" , _POSIX_CHILD_MAX, 25 },
+#endif
+#ifdef _POSIX_DELAYTIMER_MAX
+ { "_POSIX_DELAYTIMER_MAX", _POSIX_DELAYTIMER_MAX, 32 },
+#endif
+#ifdef _POSIX_HOST_NAME_MAX
+ { "_POSIX_HOST_NAME_MAX", _POSIX_HOST_NAME_MAX, 255 },
+#endif
+#ifdef _POSIX_LINK_MAX
+ { "_POSIX_LINK_MAX", _POSIX_LINK_MAX, 8 },
+#endif
+#ifdef _POSIX_LOGIN_NAME_MAX
+ { "_POSIX_LOGIN_NAME_MAX", _POSIX_LOGIN_NAME_MAX, 9 },
+#endif
+#ifdef _POSIX_MAX_CANON
+ { "_POSIX_MAX_CANON", _POSIX_MAX_CANON, 255 },
+#endif
+#ifdef _POSIX_MAX_INPUT
+ { "_POSIX_MAX_INPUT", _POSIX_MAX_INPUT, 255 },
+#endif
+#ifdef _POSIX_MQ_OPEN_MAX
+ { "_POSIX_MQ_OPEN_MAX", _POSIX_MQ_OPEN_MAX, 8 },
+#endif
+#ifdef _POSIX_MQ_PRIO_MAX
+ { "_POSIX_MQ_PRIO_MAX", _POSIX_MQ_PRIO_MAX, 32 },
+#endif
+#ifdef _POSIX_NAME_MAX
+ { "_POSIX_NAME_MAX", _POSIX_NAME_MAX, 9 },
+#endif
+#ifdef _POSIX_NGROUPS_MAX
+ { "_POSIX_NGROUPS_MAX", _POSIX_NGROUPS_MAX, 8 },
+#endif
+#ifdef _POSIX_OPEN_MAX
+ { "_POSIX_OPEN_MAX", _POSIX_OPEN_MAX, 20 },
+#endif
+#ifdef _POSIX_PATH_MAX
+ { "_POSIX_PATH_MAX", _POSIX_PATH_MAX, 256 },
+#endif
+#ifdef _POSIX_PIPE_BUF
+ { "_POSIX_PIPE_BUF", _POSIX_PIPE_BUF, 512 },
+#endif
+#ifdef _POSIX_RE_DUP_MAX
+ { "_POSIX_RE_DUP_MAX", _POSIX_RE_DUP_MAX, 255 },
+#endif
+#ifdef _POSIX_RTSIG_MAX
+ { "_POSIX_RTSIG_MAX", _POSIX_RTSIG_MAX, 8 },
+#endif
+#ifdef _POSIX_SEM_NSEMS_MAX
+ { "_POSIX_SEM_NSEMS_MAX", _POSIX_SEM_NSEMS_MAX, 256 },
+#endif
+#ifdef _POSIX_SEM_VALUE_MAX
+ { "_POSIX_SEM_VALUE_MAX", _POSIX_SEM_VALUE_MAX, 32767},
+#endif
+#ifdef _POSIX_SIGQUEUE_MAX
+ { "_POSIX_SIGQUEUE_MAX", _POSIX_SIGQUEUE_MAX, 32 },
+#endif
+#ifdef _POSIX_SSIZE_MAX
+ { "_POSIX_SSIZE_MAX", _POSIX_SSIZE_MAX, 32767},
+#endif
+#ifdef _POSIX_STREAM_MAX
+ { "_POSIX_STREAM_MAX", _POSIX_STREAM_MAX, 8 },
+#endif
+#ifdef _POSIX_SS_REPL_MAX
+ { "_POSIX_SS_REPL_MAX", _POSIX_SS_REPL_MAX, 4 },
+#endif
+#ifdef _POSIX_SYMLINK_MAX
+ { "_POSIX_SYMLINK_MAX", _POSIX_SYMLINK_MAX, 255 },
+#endif
+#ifdef _POSIX_SYMLOOP_MAX
+ { "_POSIX_SYMLOOP_MAX", _POSIX_SYMLOOP_MAX, 8 },
+#endif
+#ifdef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+ { "_POSIX_THREAD_DESTRUCTOR_ITERATIONS",
+ _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 4 },
+#endif
+#ifdef _POSIX_THREAD_KEYS_MAX
+ { "_POSIX_THREAD_KEYS_MAX", _POSIX_THREAD_KEYS_MAX, 128 },
+#endif
+#ifdef _POSIX_THREAD_THREADS_MAX
+ { "_POSIX_THREAD_THREADS_MAX", _POSIX_THREAD_THREADS_MAX, 64 },
+#endif
+#ifdef _POSIX_TIMER_MAX
+ { "_POSIX_TIMER_MAX", _POSIX_TIMER_MAX, 32 },
+#endif
+#ifdef _POSIX_TRACE_EVENT_NAME_MAX
+ { "_POSIX_TRACE_EVENT_NAME_MAX",_POSIX_TRACE_EVENT_NAME_MAX, 30 },
+#endif
+#ifdef _POSIX_TRACE_NAME_MAX
+ { "_POSIX_TRACE_NAME_MAX", _POSIX_TRACE_NAME_MAX, 8 },
+#endif
+#ifdef _POSIX_TRACE_SYS_MAX
+ { "_POSIX_TRACE_SYS_MAX", _POSIX_TRACE_SYS_MAX, 8 },
+#endif
+#ifdef _POSIX_TRACE_USER_EVENT_MAX
+ { "_POSIX_TRACE_USER_EVENT_MAX",_POSIX_TRACE_USER_EVENT_MAX, 32 },
+#endif
+#ifdef _POSIX_TTY_NAME_MAX
+ { "_POSIX_TTY_NAME_MAX", _POSIX_TTY_NAME_MAX, 9 },
+#endif
+#ifdef _POSIX_TZNAME_MAX
+ { "_POSIX_TZNAME_MAX", _POSIX_TZNAME_MAX, 6 },
+#endif
+#ifdef _POSIX2_BC_BASE_MAX
+ { "_POSIX2_BC_BASE_MAX", _POSIX2_BC_BASE_MAX, 99 },
+#endif
+#ifdef _POSIX2_BC_DIM_MAX
+ { "_POSIX2_BC_DIM_MAX", _POSIX2_BC_DIM_MAX, 2048 },
+#endif
+#ifdef _POSIX2_BC_SCALE_MAX
+ { "_POSIX2_BC_SCALE_MAX", _POSIX2_BC_SCALE_MAX, 99 },
+#endif
+#ifdef _POSIX2_BC_STRING_MAX
+ { "_POSIX2_BC_STRING_MAX", _POSIX2_BC_STRING_MAX, 1000 },
+#endif
+#ifdef _POSIX2_CHARCLASS_NAME_MAX
+ { "_POSIX2_CHARCLASS_NAME_MAX", _POSIX2_CHARCLASS_NAME_MAX, 14 },
+#endif
+#ifdef _POSIX2_COLL_WEIGHTS_MAX
+ { "_POSIX2_COLL_WEIGHTS_MAX", _POSIX2_COLL_WEIGHTS_MAX, 2 },
+#endif
+#ifdef _POSIX2_EXPR_NEST_MAX
+ { "_POSIX2_EXPR_NEST_MAX", _POSIX2_EXPR_NEST_MAX, 32 },
+#endif
+#ifdef _POSIX2_LINE_MAX
+ { "_POSIX2_LINE_MAX", _POSIX2_LINE_MAX, 2048 },
+#endif
+#ifdef _POSIX2_RE_DUP_MAX
+ { "_POSIX2_RE_DUP_MAX", _POSIX2_RE_DUP_MAX, 255 },
+#endif
+#ifdef _XOPEN_IOV_MAX
+ { "_XOPEN_IOV_MAX", _XOPEN_IOV_MAX, 16 },
+#endif
+#ifdef _XOPEN_NAME_MAX
+ { "_XOPEN_NAME_MAX", _XOPEN_NAME_MAX, 255 },
+#endif
+#ifdef _XOPEN_PATH_MAX
+ { "_XOPEN_PATH_MAX", _XOPEN_PATH_MAX, 1024 },
+#endif
+
+ /*
+ * Other invariant values.
+ */
+#ifdef NL_ARGMAX
+ { "NL_ARGMAX", NL_ARGMAX, 9 },
+#endif
+#ifdef NL_LANGMAX
+ { "NL_LANGMAX", NL_LANGMAX, 14 },
+#endif
+#ifdef NL_MSGMAX
+ { "NL_MSGMAX", NL_MSGMAX, 32767},
+#endif
+#ifdef NL_SETMAX
+ { "NL_SETMAX", NL_SETMAX, 255 },
+#endif
+#ifdef NL_TEXTMAX
+#ifdef _POSIX2_LINE_MAX
+ { "NL_TEXTMAX", NL_TEXTMAX, _POSIX2_LINE_MAX},
+#endif
+#endif
+#ifdef NZERO
+ { "NZERO", NZERO, 20 },
+#endif
+};
+
+ATF_TC_WITHOUT_HEAD(char);
+ATF_TC_BODY(char, tc)
+{
+ ATF_CHECK(CHAR_MIN < UCHAR_MAX);
+}
+
+ATF_TC(posix);
+ATF_TC_HEAD(posix, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test POSIX limits");
+}
+
+ATF_TC_BODY(posix, tc)
+{
+ size_t i;
+
+ for (i = 0; i < __arraycount(psxtable); i++) {
+
+ if (psxtable[i].psx_constant < psxtable[i].psx_minval) {
+
+ atf_tc_fail("%s is less than the minimum",
+ psxtable[i].psx_desc);
+ }
+ }
+}
+
+ATF_TC_WITHOUT_HEAD(short);
+ATF_TC_BODY(short, tc)
+{
+ ATF_CHECK(SHRT_MIN < USHRT_MAX);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, char);
+ ATF_TP_ADD_TC(tp, posix);
+ ATF_TP_ADD_TC(tp, short);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/t_netdb.c b/contrib/netbsd-tests/include/t_netdb.c
new file mode 100644
index 0000000..c7f946f
--- /dev/null
+++ b/contrib/netbsd-tests/include/t_netdb.c
@@ -0,0 +1,244 @@
+/* $NetBSD: t_netdb.c,v 1.2 2011/04/25 20:51:14 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_netdb.c,v 1.2 2011/04/25 20:51:14 njoly Exp $");
+
+#include <atf-c.h>
+#include <netdb.h>
+
+ATF_TC(netdb_constants);
+ATF_TC_HEAD(netdb_constants, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test constants in <netdb.h>");
+}
+
+ATF_TC_BODY(netdb_constants, tc)
+{
+ bool fail;
+
+ /*
+ * The following definitions should be available
+ * according to IEEE Std 1003.1-2008, issue 7.
+ */
+ atf_tc_expect_fail("PR standards/44777");
+
+ fail = true;
+
+#ifdef AI_PASSIVE
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("AI_PASSIVE not defined");
+
+ fail = true;
+
+#ifdef AI_CANONNAME
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("AI_CANONNAME not defined");
+
+ fail = true;
+
+#ifdef AI_NUMERICHOST
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("AI_NUMERICHOST not defined");
+
+ fail = true;
+
+#ifdef AI_NUMERICSERV
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("AI_NUMERICSERV not defined");
+
+ fail = true;
+
+#ifdef AI_V4MAPPED
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("AI_V4MAPPED not defined");
+
+ fail = true;
+
+#ifdef AI_ALL
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("AI_ALL not defined");
+
+ fail = true;
+
+#ifdef AI_ADDRCONFIG
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("AI_ADDRCONFIG not defined");
+
+ fail = true;
+
+#ifdef NI_NOFQDN
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("NI_NOFQDN not defined");
+
+ fail = true;
+
+#ifdef NI_NUMERICHOST
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("NI_NUMERICHOST not defined");
+
+ fail = true;
+
+#ifdef NI_NAMEREQD
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("NI_NAMEREQD not defined");
+
+ fail = true;
+
+#ifdef NI_NUMERICSERV
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("NI_NUMERICSERV not defined");
+
+ fail = true;
+
+#ifdef NI_NUMERICSCOPE
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("NI_NUMERICSCOPE not defined");
+
+ fail = true;
+
+#ifdef NI_DGRAM
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("NI_DGRAM not defined");
+
+ fail = true;
+
+#ifdef EAI_AGAIN
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_AGAIN not defined");
+
+ fail = true;
+
+#ifdef EAI_BADFLAGS
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_BADFLAGS not defined");
+
+ fail = true;
+
+#ifdef EAI_FAIL
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_FAIL not defined");
+
+ fail = true;
+
+#ifdef EAI_FAMILY
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_FAMILY not defined");
+
+ fail = true;
+
+#ifdef EAI_MEMORY
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_MEMORY not defined");
+
+ fail = true;
+
+#ifdef EAI_NONAME
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_NONAME not defined");
+
+ fail = true;
+
+#ifdef EAI_SERVICE
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_SERVICE not defined");
+
+ fail = true;
+
+#ifdef EAI_SOCKTYPE
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_SOCKTYPE not defined");
+
+ fail = true;
+
+#ifdef EAI_SYSTEM
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_SYSTEM not defined");
+
+ fail = true;
+
+#ifdef EAI_OVERFLOW
+ fail = false;
+#endif
+ if (fail != false)
+ atf_tc_fail_nonfatal("EAI_OVERFLOW not defined");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, netdb_constants);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/t_paths.c b/contrib/netbsd-tests/include/t_paths.c
new file mode 100644
index 0000000..925bb3a
--- /dev/null
+++ b/contrib/netbsd-tests/include/t_paths.c
@@ -0,0 +1,205 @@
+/* $NetBSD: t_paths.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_paths.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $");
+
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#define PATH_DEV __BIT(0) /* A device node */
+#define PATH_DIR __BIT(1) /* A directory */
+#define PATH_FILE __BIT(2) /* A file */
+#define PATH_ROOT __BIT(3) /* Access for root only */
+
+static const struct {
+ const char *path;
+ int flags;
+} paths[] = {
+ { _PATH_AUDIO, PATH_DEV },
+ { _PATH_AUDIO0, PATH_DEV },
+ { _PATH_AUDIOCTL, PATH_DEV },
+ { _PATH_AUDIOCTL0, PATH_DEV },
+ { _PATH_BPF, PATH_DEV | PATH_ROOT },
+ { _PATH_CLOCKCTL, PATH_DEV | PATH_ROOT },
+ { _PATH_CONSOLE, PATH_DEV | PATH_ROOT },
+ { _PATH_CONSTTY, PATH_DEV | PATH_ROOT },
+ { _PATH_CPUCTL, PATH_DEV },
+ { _PATH_CSMAPPER, PATH_DIR },
+ { _PATH_DEFTAPE, PATH_DEV | PATH_ROOT },
+ { _PATH_DEVCDB, PATH_FILE },
+ { _PATH_DEVDB, PATH_FILE },
+ { _PATH_DEVNULL, PATH_DEV },
+ { _PATH_DRUM, PATH_DEV | PATH_ROOT },
+ { _PATH_ESDB, PATH_DIR },
+ { _PATH_FTPUSERS, PATH_FILE },
+ { _PATH_GETTYTAB, PATH_FILE },
+ { _PATH_I18NMODULE, PATH_DIR },
+ { _PATH_ICONV, PATH_DIR },
+ { _PATH_KMEM, PATH_DEV | PATH_ROOT },
+ { _PATH_KSYMS, PATH_DEV },
+ { _PATH_KVMDB, PATH_FILE },
+ { _PATH_LOCALE, PATH_DIR },
+ { _PATH_MAILDIR, PATH_DIR },
+ { _PATH_MAN, PATH_DIR },
+ { _PATH_MEM, PATH_DEV | PATH_ROOT },
+ { _PATH_MIXER, PATH_DEV },
+ { _PATH_MIXER0, PATH_DEV },
+ { _PATH_NOLOGIN, PATH_FILE },
+ { _PATH_POWER, PATH_DEV | PATH_ROOT },
+ { _PATH_PRINTCAP, PATH_FILE },
+ { _PATH_PUD, PATH_DEV | PATH_ROOT },
+ { _PATH_PUFFS, PATH_DEV | PATH_ROOT },
+ { _PATH_RANDOM, PATH_DEV },
+ { _PATH_SENDMAIL, PATH_FILE },
+ { _PATH_SHELLS, PATH_FILE },
+ { _PATH_SKEYKEYS, PATH_FILE | PATH_ROOT },
+ { _PATH_SOUND, PATH_DEV },
+ { _PATH_SOUND0, PATH_DEV },
+ { _PATH_SYSMON, PATH_DEV },
+ { _PATH_TTY, PATH_DEV },
+ { _PATH_UNIX, PATH_FILE | PATH_ROOT },
+ { _PATH_URANDOM, PATH_DEV },
+ { _PATH_VIDEO, PATH_DEV },
+ { _PATH_VIDEO0, PATH_DEV },
+
+ { _PATH_DEV, PATH_DIR },
+ { _PATH_DEV_PTS, PATH_DIR },
+ { _PATH_EMUL_AOUT, PATH_DIR },
+ { _PATH_TMP, PATH_DIR },
+ { _PATH_VARDB, PATH_DIR },
+ { _PATH_VARRUN, PATH_DIR },
+ { _PATH_VARTMP, PATH_DIR },
+
+ { _PATH_BSHELL, PATH_FILE },
+ { _PATH_CSHELL, PATH_FILE },
+ { _PATH_VI, PATH_FILE },
+};
+
+ATF_TC(paths);
+ATF_TC_HEAD(paths, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test for <paths.h>");
+}
+
+ATF_TC_BODY(paths, tc)
+{
+ struct stat st;
+ uid_t uid;
+ mode_t m;
+ size_t i;
+ int fd;
+
+#if defined(__sparc__)
+ atf_tc_skip("PR port-sparc/45580");
+#endif
+
+ uid = getuid();
+
+ for (i = 0; i < __arraycount(paths); i++) {
+
+ (void)fprintf(stderr, "testing '%s'\n", paths[i].path);
+
+ errno = 0;
+ fd = open(paths[i].path, O_RDONLY);
+
+ if (fd < 0) {
+
+ switch (errno) {
+
+ case EPERM: /* FALLTHROUGH */
+ case EACCES: /* FALLTHROUGH */
+
+ if ((paths[i].flags & PATH_ROOT) == 0) {
+
+ atf_tc_fail("UID %u failed to open %s",
+ (uint32_t)uid, paths[i].path);
+ }
+
+ case EBUSY: /* FALLTHROUGH */
+ case ENXIO: /* FALLTHROUGH */
+ case ENOENT: /* FALLTHROUGH */
+
+ default:
+ continue;
+ }
+ }
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(fstat(fd, &st) == 0);
+
+ m = st.st_mode;
+
+ if ((paths[i].flags & PATH_DEV) != 0) {
+
+ ATF_CHECK(S_ISBLK(m) != 0 || S_ISCHR(m) != 0);
+
+ ATF_CHECK((paths[i].flags & PATH_DIR) == 0);
+ ATF_CHECK((paths[i].flags & PATH_FILE) == 0);
+ }
+
+ if ((paths[i].flags & PATH_DIR) != 0) {
+
+ ATF_CHECK(S_ISDIR(m) != 0);
+
+ ATF_CHECK((paths[i].flags & PATH_DEV) == 0);
+ ATF_CHECK((paths[i].flags & PATH_FILE) == 0);
+ }
+
+ if ((paths[i].flags & PATH_FILE) != 0) {
+
+ ATF_CHECK(S_ISREG(m) != 0);
+
+ ATF_CHECK((paths[i].flags & PATH_DEV) == 0);
+ ATF_CHECK((paths[i].flags & PATH_DIR) == 0);
+ }
+
+ ATF_REQUIRE(close(fd) == 0);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, paths);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/include/t_stdint.c b/contrib/netbsd-tests/include/t_stdint.c
new file mode 100644
index 0000000..6a57d9a
--- /dev/null
+++ b/contrib/netbsd-tests/include/t_stdint.c
@@ -0,0 +1,57 @@
+/* $NetBSD: t_stdint.c,v 1.1 2010/07/17 19:26:27 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008, 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_stdint.c,v 1.1 2010/07/17 19:26:27 jmmv Exp $");
+
+#include <stdint.h>
+
+#include <atf-c.h>
+
+ATF_TC_WITHOUT_HEAD(int8);
+ATF_TC_BODY(int8, tc)
+{
+ ATF_CHECK(INT8_MIN < UINT8_MAX);
+}
+
+ATF_TC_WITHOUT_HEAD(int16);
+ATF_TC_BODY(int16, tc)
+{
+ ATF_CHECK(INT16_MIN < UINT16_MAX);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, int8);
+ ATF_TP_ADD_TC(tp, int16);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/ipf/expected/.cvsignore b/contrib/netbsd-tests/ipf/expected/.cvsignore
new file mode 100644
index 0000000..47a4237
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/.cvsignore
@@ -0,0 +1 @@
+i19
diff --git a/contrib/netbsd-tests/ipf/expected/bpf-f1 b/contrib/netbsd-tests/ipf/expected/bpf-f1
new file mode 100644
index 0000000..85ce84c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/bpf-f1
@@ -0,0 +1,20 @@
+nomatch
+pass
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/bpf1 b/contrib/netbsd-tests/ipf/expected/bpf1
new file mode 100644
index 0000000..76381a7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/bpf1
@@ -0,0 +1,4 @@
+pass in bpf-v4 { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" }
+pass out bpf-v4 { "0 0 0 0 0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x1 0x6 0 0 0" }
+pass in bpf-v4 { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" }
+pass out bpf-v4 { "0 0 0 0 0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x1 0x6 0 0 0" }
diff --git a/contrib/netbsd-tests/ipf/expected/f1 b/contrib/netbsd-tests/ipf/expected/f1
new file mode 100644
index 0000000..86d9592
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f1
@@ -0,0 +1,20 @@
+block
+block
+nomatch
+nomatch
+--------
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+block
+--------
+nomatch
+nomatch
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f10 b/contrib/netbsd-tests/ipf/expected/f10
new file mode 100644
index 0000000..da6c312
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f10
@@ -0,0 +1,126 @@
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+block
+block
+nomatch
+nomatch
+nomatch
+block
+--------
+pass
+pass
+nomatch
+nomatch
+nomatch
+pass
+--------
+block
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+block
+block
+block
+nomatch
+block
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+pass
+--------
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+block
+block
+--------
+nomatch
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+nomatch
+block
+nomatch
+block
+--------
+pass
+pass
+nomatch
+pass
+nomatch
+pass
+--------
+block
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+nomatch
+nomatch
+block
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f11 b/contrib/netbsd-tests/ipf/expected/f11
new file mode 100644
index 0000000..d7ab889
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f11
@@ -0,0 +1,283 @@
+pass
+nomatch
+nomatch
+pass
+pass
+nomatch
+pass
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+1 pass in proto tcp from any to any port = 23 flags S/SA keep state
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+--------
+block
+nomatch
+nomatch
+block
+block
+nomatch
+block
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+1 block in proto tcp from any to any port = 23 flags S/SA keep state
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+2 pass in proto udp from any to any port = 53 keep frags
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+nomatch
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+2 block in proto udp from any to any port = 53 keep frags
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+4:udp src:2.2.2.2,2 dst:4.4.4.4,53 240
+ FWD: IN pkts 1 bytes 28 OUT pkts 0 bytes 0
+ REV: IN pkts 0 bytes 0 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[e1],X[] out X[],X[]
+ Sync status: not synchronized
+4:udp src:1.1.1.1,1 dst:4.4.4.4,53 24
+ FWD: IN pkts 1 bytes 28 OUT pkts 0 bytes 0
+ REV: IN pkts 1 bytes 28 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[e1],X[e0] out X[],X[]
+ Sync status: not synchronized
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+2 pass in proto udp from any to any port = 53 keep state
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+4:udp src:2.2.2.2,2 dst:4.4.4.4,53 240
+ FWD: IN pkts 1 bytes 28 OUT pkts 0 bytes 0
+ REV: IN pkts 0 bytes 0 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008401 = block in keep state
+ interfaces: in X[e1],X[] out X[],X[]
+ Sync status: not synchronized
+4:udp src:1.1.1.1,1 dst:4.4.4.4,53 24
+ FWD: IN pkts 1 bytes 28 OUT pkts 0 bytes 0
+ REV: IN pkts 1 bytes 28 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008401 = block in keep state
+ interfaces: in X[e1],X[e0] out X[],X[]
+ Sync status: not synchronized
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+2 block in proto udp from any to any port = 53 keep state
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+4:tcp src:1.1.1.1,1 dst:2.1.2.2,25 state:3/4 864000
+ 2:66 4096<<0:16384<<0
+ FWD: IN pkts 1 bytes 40 OUT pkts 0 bytes 0
+ REV: IN pkts 1 bytes 40 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[e0],X[e1] out X[],X[]
+ Sync status: not synchronized
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+1 pass in on e0 proto tcp from any to any port = 25 keep state
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f12 b/contrib/netbsd-tests/ipf/expected/f12
new file mode 100644
index 0000000..094d8c0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f12
@@ -0,0 +1,60 @@
+pass
+pass
+pass
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+bad-packet
+block
+nomatch
+bad-packet
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+bad-packet
+block
+nomatch
+bad-packet
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+pass
+--------
+nomatch
+nomatch
+nomatch
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+block
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f13 b/contrib/netbsd-tests/ipf/expected/f13
new file mode 100644
index 0000000..ac7947b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f13
@@ -0,0 +1,180 @@
+pass
+bad-packet
+nomatch
+pass
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+bad-packet
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+bad-packet
+nomatch
+block
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+bad-packet
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+nomatch
+bad-packet
+pass
+bad-packet
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+nomatch
+bad-packet
+block
+bad-packet
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+bad-packet
+nomatch
+pass
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+bad-packet
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+pass
+pass
+--------
+block
+bad-packet
+nomatch
+block
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+bad-packet
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+block
+block
+--------
+nomatch
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+nomatch
+bad-packet
+pass
+bad-packet
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+bad-packet
+nomatch
+pass
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+bad-packet
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+block
+block
+pass
+--------
+block
+bad-packet
+nomatch
+pass
+bad-packet
+nomatch
+nomatch
+bad-packet
+nomatch
+bad-packet
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f14 b/contrib/netbsd-tests/ipf/expected/f14
new file mode 100644
index 0000000..1c6ed5c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f14
@@ -0,0 +1,48 @@
+block
+nomatch
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+pass
+pass
+--------
+block
+nomatch
+nomatch
+nomatch
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f15 b/contrib/netbsd-tests/ipf/expected/f15
new file mode 100644
index 0000000..9b31258
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f15
@@ -0,0 +1,9 @@
+block return-rst
+pass
+block return-icmp
+pass
+block
+nomatch
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f16 b/contrib/netbsd-tests/ipf/expected/f16
new file mode 100644
index 0000000..b6cb3fa
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f16
@@ -0,0 +1,9 @@
+block
+block
+pass
+block
+pass
+pass
+block
+block
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f17 b/contrib/netbsd-tests/ipf/expected/f17
new file mode 100644
index 0000000..c586e5b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f17
@@ -0,0 +1,7 @@
+pass
+block return-rst
+pass
+pass
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f18 b/contrib/netbsd-tests/ipf/expected/f18
new file mode 100644
index 0000000..1af5de5
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f18
@@ -0,0 +1,27 @@
+pass
+pass
+pass
+pass
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+2 pass in inet from 1.1.1.1/32 to any
+Rules configured (set 0, out)
+2 pass out inet from 2.2.2.2/32 to any
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+1 count in inet from 1.1.1.1/32 to 3.3.3.3/32
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+1 count out inet from 2.2.2.2/32 to 4.4.4.4/32
+Accounting rules configured (set 1, out)
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f19 b/contrib/netbsd-tests/ipf/expected/f19
new file mode 100644
index 0000000..5ee2e9d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f19
@@ -0,0 +1,10 @@
+pass
+pass
+pass
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f2 b/contrib/netbsd-tests/ipf/expected/f2
new file mode 100644
index 0000000..7093a41
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f2
@@ -0,0 +1,42 @@
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+block
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f20 b/contrib/netbsd-tests/ipf/expected/f20
new file mode 100644
index 0000000..86308a0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f20
@@ -0,0 +1,3 @@
+pass
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f21 b/contrib/netbsd-tests/ipf/expected/f21
new file mode 100644
index 0000000..525daca
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f21
@@ -0,0 +1,5 @@
+pass
+pass
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f22 b/contrib/netbsd-tests/ipf/expected/f22
new file mode 100644
index 0000000..525daca
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f22
@@ -0,0 +1,5 @@
+pass
+pass
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f24 b/contrib/netbsd-tests/ipf/expected/f24
new file mode 100644
index 0000000..801abd3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f24
@@ -0,0 +1,5 @@
+pass
+pass
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f25 b/contrib/netbsd-tests/ipf/expected/f25
new file mode 100644
index 0000000..a87b084
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f25
@@ -0,0 +1,35 @@
+pass
+pass
+pass
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+4:udp src:192.168.1.235,8008 dst:239.255.255.250,1900 240
+ FWD: IN pkts 1 bytes 129 OUT pkts 0 bytes 0
+ REV: IN pkts 0 bytes 0 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[hme0],X[] out X[],X[]
+ Sync status: not synchronized
+4:udp src:192.168.1.235,8008 dst:192.168.1.254,1900 24
+ FWD: IN pkts 1 bytes 129 OUT pkts 0 bytes 0
+ REV: IN pkts 0 bytes 0 OUT pkts 1 bytes 264
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[hme0],X[] out X[],X[hme0]
+ Sync status: not synchronized
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+2 pass in on hme0 proto udp from any to any with mcast keep state
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f26 b/contrib/netbsd-tests/ipf/expected/f26
new file mode 100644
index 0000000..9e4d62b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f26
@@ -0,0 +1,84 @@
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+pass
+pass
+nomatch
+pass
+pass
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+pass
+pass
+nomatch
+pass
+pass
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f27 b/contrib/netbsd-tests/ipf/expected/f27
new file mode 100644
index 0000000..c62f588
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f27
@@ -0,0 +1,90 @@
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+pass
+pass
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+pass
+pass
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f28 b/contrib/netbsd-tests/ipf/expected/f28
new file mode 100644
index 0000000..e5867e6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f28
@@ -0,0 +1,32 @@
+block
+block
+block
+> nic0 ip #0 20(20) 0 4.4.3.1 > 4.2.3.2
+pass
+> nic1 ip #0 20(20) 0 4.4.1.1 > 4.2.1.2
+pass
+> nic2 ip #0 20(20) 0 4.4.2.1 > 4.2.2.2
+pass
+> nic3 ip #0 20(20) 0 4.4.3.1 > 4.2.3.2
+pass
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+7 block in all
+4 pass in on nic0 to dstlist/spread inet from 4.4.0.0/16 to any
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/f29 b/contrib/netbsd-tests/ipf/expected/f29
new file mode 100644
index 0000000..a650c1b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f29
@@ -0,0 +1,64 @@
+block
+block
+block
+> nic0 ip #0 28(20) 17 4.4.3.1,1000 > 4.2.3.2,2000
+pass
+> nic0 ip #0 28(20) 17 4.4.3.1,1000 > 4.2.3.2,2000
+pass
+> nic1 ip #0 28(20) 17 4.4.1.1,1001 > 4.2.1.2,2001
+pass
+> nic1 ip #0 28(20) 17 4.4.1.1,1001 > 4.2.1.2,2001
+pass
+> nic2 ip #0 28(20) 17 4.4.2.1,1002 > 4.2.2.2,2002
+pass
+> nic2 ip #0 28(20) 17 4.4.2.1,1002 > 4.2.2.2,2002
+pass
+> nic3 ip #0 28(20) 17 4.4.3.1,1003 > 4.2.3.2,2003
+pass
+> nic3 ip #0 28(20) 17 4.4.3.1,1003 > 4.2.3.2,2003
+pass
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+4:udp src:4.4.3.1,1003 dst:4.2.3.2,2003 240
+ FWD: IN pkts 2 bytes 56 OUT pkts 2 bytes 56
+ REV: IN pkts 0 bytes 0 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[nic0],X[] out X[nic3],X[]
+ Sync status: not synchronized
+4:udp src:4.4.2.1,1002 dst:4.2.2.2,2002 240
+ FWD: IN pkts 2 bytes 56 OUT pkts 2 bytes 56
+ REV: IN pkts 0 bytes 0 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[nic0],X[] out X[nic2],X[]
+ Sync status: not synchronized
+4:udp src:4.4.1.1,1001 dst:4.2.1.2,2001 240
+ FWD: IN pkts 2 bytes 56 OUT pkts 2 bytes 56
+ REV: IN pkts 0 bytes 0 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[nic0],X[] out X[nic1],X[]
+ Sync status: not synchronized
+4:udp src:4.4.3.1,1000 dst:4.2.3.2,2000 240
+ FWD: IN pkts 2 bytes 56 OUT pkts 2 bytes 56
+ REV: IN pkts 0 bytes 0 OUT pkts 0 bytes 0
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[nic0],X[] out X[nic0],X[]
+ Sync status: not synchronized
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+7 block in all
+4 pass in on nic0 to dstlist/spread inet from 4.4.0.0/16 to any keep state
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/f3 b/contrib/netbsd-tests/ipf/expected/f3
new file mode 100644
index 0000000..5df3ac4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f3
@@ -0,0 +1,48 @@
+nomatch
+block
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+--------
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f30 b/contrib/netbsd-tests/ipf/expected/f30
new file mode 100644
index 0000000..30b9d40
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f30
@@ -0,0 +1,68 @@
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f4 b/contrib/netbsd-tests/ipf/expected/f4
new file mode 100644
index 0000000..5df3ac4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f4
@@ -0,0 +1,48 @@
+nomatch
+block
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+--------
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f5 b/contrib/netbsd-tests/ipf/expected/f5
new file mode 100644
index 0000000..36c7d40
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f5
@@ -0,0 +1,1392 @@
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f6 b/contrib/netbsd-tests/ipf/expected/f6
new file mode 100644
index 0000000..36c7d40
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f6
@@ -0,0 +1,1392 @@
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f7 b/contrib/netbsd-tests/ipf/expected/f7
new file mode 100644
index 0000000..7a4daed
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f7
@@ -0,0 +1,144 @@
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f8 b/contrib/netbsd-tests/ipf/expected/f8
new file mode 100644
index 0000000..ad42ff2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f8
@@ -0,0 +1,42 @@
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+nomatch
+block
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/f9 b/contrib/netbsd-tests/ipf/expected/f9
new file mode 100644
index 0000000..cc5be68
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/f9
@@ -0,0 +1,180 @@
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/i1 b/contrib/netbsd-tests/ipf/expected/i1
new file mode 100644
index 0000000..19ae393
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i1
@@ -0,0 +1,17 @@
+pass in all
+block out all
+log in all
+log body in all
+count in from any to any
+pass in from !any to any pps 10
+block in from any to !any
+pass in on ed0(!) inet from 127.0.0.1/32 to 127.0.0.1/32
+pass in on ed0(!),vx0(!) inet from 127.0.0.1/32 to 127.0.0.1/32
+block in log first on lo0(!) from any to any
+pass in log body or-block quick from any to any
+block return-rst in quick on le0(!) proto tcp from any to any
+block return-icmp in on qe0(!) from any to any
+block return-icmp(host-unr) in on qe0(!) from any to any
+block return-icmp-as-dest in on le0(!) from any to any
+block return-icmp-as-dest(port-unr) in on qe0(!) from any to any
+pass out on longNICname0(!) inet from 254.220.186.152/32 to 254.220.186.152/32
diff --git a/contrib/netbsd-tests/ipf/expected/i10 b/contrib/netbsd-tests/ipf/expected/i10
new file mode 100644
index 0000000..24137c1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i10
@@ -0,0 +1,5 @@
+pass in inet from 127.0.0.1/32 to 127.0.0.1/32 with opt sec
+pass in inet from 127.0.0.1/32 to 127.0.0.1/32 with opt lsrr not opt sec
+block in inet from any to any with not opt sec-class topsecret
+block in inet from any to any with not opt sec-class topsecret,secret
+pass in inet from any to any with opt sec-class topsecret,confid not opt sec-class unclass
diff --git a/contrib/netbsd-tests/ipf/expected/i11 b/contrib/netbsd-tests/ipf/expected/i11
new file mode 100644
index 0000000..d1d2cf6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i11
@@ -0,0 +1,12 @@
+pass in on ed0(!) inet proto tcp from 127.0.0.1/32 to 127.0.0.1/32 port = 23 keep state # count 0
+block in log first on lo0(!) proto tcp/udp from any to any port = 7 keep state # count 0
+pass in inet proto udp from 127.0.0.1/32 to 127.0.0.1/32 port = 20499 keep frags
+pass in inet proto udp from 127.0.0.1/32 to 127.0.0.1/32 port = 2049 keep frags (strict)
+pass in inet proto udp from 127.0.0.1/32 to 127.0.0.1/32 port = 53 keep state keep frags # count 0
+pass in on ed0(!) out-via vx0(!) proto udp from any to any keep state # count 0
+pass out on ppp0(!) in-via le0(!) proto tcp from any to any keep state # count 0
+pass in on ed0(!),vx0(!) out-via vx0(!),ed0(!) proto udp from any to any keep state # count 0
+pass in inet proto tcp from any port > 1024 to 127.0.0.1/32 port = 1024 keep state # count 0
+pass in proto tcp from any to any flags S/FSRPAU keep state (limit 101,strict,newisn,no-icmp-err,age 600/600) # count 0
+pass in proto tcp from any to any flags S/FSRPAU keep state (limit 101,loose,newisn,no-icmp-err,age 600/600) # count 0
+pass in proto udp from any to any keep state (sync,age 10/20) # count 0
diff --git a/contrib/netbsd-tests/ipf/expected/i12 b/contrib/netbsd-tests/ipf/expected/i12
new file mode 100644
index 0000000..6747d93
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i12
@@ -0,0 +1,39 @@
+pass in inet from 1.1.1.1/32 to 2.2.2.2/32
+pass in inet from 2.2.2.0/24 to 4.4.4.4/32
+pass in inet from 3.3.3.3/32 to 4.4.4.4/32
+pass in inet from 2.2.2.0/24 to 5.5.5.5/32
+pass in inet from 3.3.3.3/32 to 5.5.5.5/32
+pass in inet from 2.2.2.0/24 to 6.6.6.6/32
+pass in inet from 3.3.3.3/32 to 6.6.6.6/32
+pass in inet from 2.2.2.0/24 to 5.5.5.5/32 port = 22
+pass in inet from 3.3.3.3/32 to 5.5.5.5/32 port = 22
+pass in inet from 2.2.2.0/24 to 6.6.6.6/32 port = 22
+pass in inet from 3.3.3.3/32 to 6.6.6.6/32 port = 22
+pass in inet from 2.2.2.0/24 to 5.5.5.5/32 port = 25
+pass in inet from 3.3.3.3/32 to 5.5.5.5/32 port = 25
+pass in inet from 2.2.2.0/24 to 6.6.6.6/32 port = 25
+pass in inet from 3.3.3.3/32 to 6.6.6.6/32 port = 25
+pass in inet proto tcp from 2.2.2.0/24 port = 53 to 5.5.5.5/32
+pass in inet proto tcp from 3.3.3.3/32 port = 53 to 5.5.5.5/32
+pass in inet proto tcp from 2.2.2.0/24 port = 9 to 5.5.5.5/32
+pass in inet proto tcp from 3.3.3.3/32 port = 9 to 5.5.5.5/32
+pass in inet proto tcp from 2.2.2.0/24 port = 53 to 6.6.6.6/32
+pass in inet proto tcp from 3.3.3.3/32 port = 53 to 6.6.6.6/32
+pass in inet proto tcp from 2.2.2.0/24 port = 9 to 6.6.6.6/32
+pass in inet proto tcp from 3.3.3.3/32 port = 9 to 6.6.6.6/32
+pass in inet proto udp from 2.2.2.0/24 to 5.5.5.5/32 port = 53
+pass in inet proto udp from 3.3.3.3/32 to 5.5.5.5/32 port = 53
+pass in inet proto udp from 2.2.2.0/24 to 6.6.6.6/32 port = 53
+pass in inet proto udp from 3.3.3.3/32 to 6.6.6.6/32 port = 53
+pass in inet proto udp from 2.2.2.0/24 to 5.5.5.5/32 port = 9
+pass in inet proto udp from 3.3.3.3/32 to 5.5.5.5/32 port = 9
+pass in inet proto udp from 2.2.2.0/24 to 6.6.6.6/32 port = 9
+pass in inet proto udp from 3.3.3.3/32 to 6.6.6.6/32 port = 9
+pass in inet from 10.10.10.10/32 to 11.11.11.11/32
+pass in from pool/101 to hash/202
+pass in from hash/303 to pool/404
+table role=ipf type=tree number=
+ { ! 2.2.0.0/16; 2.2.2.2/32; ! 1.1.1.1/32; };
+table role=ipf type=tree number=
+ { 1.1.0.0/16; };
+pass in from pool/0 to pool/0
diff --git a/contrib/netbsd-tests/ipf/expected/i13 b/contrib/netbsd-tests/ipf/expected/i13
new file mode 100644
index 0000000..5c8d945
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i13
@@ -0,0 +1,2 @@
+block in from any to any
+pass in from any to any
diff --git a/contrib/netbsd-tests/ipf/expected/i14 b/contrib/netbsd-tests/ipf/expected/i14
new file mode 100644
index 0000000..0f2430f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i14
@@ -0,0 +1,15 @@
+block in on eri0(!) all head 1
+pass in on eri0(!) proto icmp from any to any group 1
+pass out on ed0(!) all head 1000000
+block out on ed0(!) proto udp from any to any group 1000000
+block in on vm0(!) proto tcp/udp from any to any head 101
+pass in inet proto tcp/udp from 1.1.1.1/32 to 2.2.2.2/32 group 101
+pass in inet proto tcp from 1.0.0.1/32 to 2.0.0.2/32 group 101
+pass in inet proto udp from 2.0.0.2/32 to 3.0.0.3/32 group 101
+block in on vm0(!) proto tcp/udp from any to any head vm0-group
+pass in inet proto tcp/udp from 1.1.1.1/32 to 2.2.2.2/32 group vm0-group
+block in on vm0(!) proto tcp/udp from any to any head vm0-group
+pass in inet proto tcp/udp from 1.1.1.1/32 to 2.2.2.2/32 group vm0-group
+pass in inet6 from 8f::/128 to f8::/128
+block in inet6 proto udp from any to any
+block in inet6 all
diff --git a/contrib/netbsd-tests/ipf/expected/i15 b/contrib/netbsd-tests/ipf/expected/i15
new file mode 100644
index 0000000..4974659
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i15
@@ -0,0 +1,4 @@
+pass out on fxp0(!) all set-tag(log=100)
+pass out on fxp0(!) all set-tag(nat=foo)
+pass out on fxp0(!) all set-tag(log=100, nat=200)
+pass out on fxp0(!) all set-tag(log=2147483648, nat=overtherainbowis)
diff --git a/contrib/netbsd-tests/ipf/expected/i16 b/contrib/netbsd-tests/ipf/expected/i16
new file mode 100644
index 0000000..c5b3cf3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i16
@@ -0,0 +1,3 @@
+block out all
+100 pass in all
+10101 pass out proto tcp from any to any
diff --git a/contrib/netbsd-tests/ipf/expected/i17 b/contrib/netbsd-tests/ipf/expected/i17
new file mode 100644
index 0000000..9e71cb1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i17
@@ -0,0 +1,29 @@
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+0 pass in inet from 1.1.1.1/32 to any
+0 pass in all
+0 pass in inet from 3.3.3.3/32 to any
+0 pass in inet from any to 127.0.0.1/32
+0 pass in inet from 127.0.0.1/32 to any
+0 100 pass in inet from 127.0.0.1/32 to any
+0 100 pass in all
+0 110 pass in proto udp from any to any
+0 110 pass in inet from 2.2.2.2/32 to any
+0 110 pass in inet from 127.0.0.1/32 to any
+0 200 pass in proto tcp from any to any
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
diff --git a/contrib/netbsd-tests/ipf/expected/i18 b/contrib/netbsd-tests/ipf/expected/i18
new file mode 100644
index 0000000..2c7e493
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i18
@@ -0,0 +1,11 @@
+pass in tos 0x50 from any to any
+pass in tos 0x80 from any to any
+pass out tos 0x80 from any to any
+pass out tos 0x50 from any to any
+block in ttl 0 from any to any
+block in ttl 1 from any to any
+block in ttl 2 from any to any
+block in ttl 3 from any to any
+block in ttl 4 from any to any
+block in ttl 5 from any to any
+block in ttl 6 from any to any
diff --git a/contrib/netbsd-tests/ipf/expected/i19.dist b/contrib/netbsd-tests/ipf/expected/i19.dist
new file mode 100644
index 0000000..5d9c26c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i19.dist
@@ -0,0 +1,22 @@
+block in log level user.debug quick proto icmp from any to any
+block in log level mail.info quick proto icmp from any to any
+block in log level daemon.notice quick proto icmp from any to any
+block in log level auth.warn quick proto icmp from any to any
+block in log level syslog.err quick proto icmp from any to any
+block in log level lpr.crit quick proto icmp from any to any
+block in log level news.alert quick proto icmp from any to any
+block in log level uucp.emerg quick proto icmp from any to any
+block in log level cron.debug quick proto icmp from any to any
+block in log level ftp.info quick proto icmp from any to any
+block in log level authpriv.notice quick proto icmp from any to any
+block in log level logalert.warn quick proto icmp from any to any
+block in log level local0.err quick proto icmp from any to any
+block in log level local1.crit quick proto icmp from any to any
+block in log level local2.alert quick proto icmp from any to any
+block in log level local3.emerg quick proto icmp from any to any
+block in log level local4.debug quick proto icmp from any to any
+block in log level local5.info quick proto icmp from any to any
+block in log level local6.notice quick proto icmp from any to any
+block in log level local7.warn quick proto icmp from any to any
+block in log level kern.err quick proto icmp from any to any
+block in log level security.emerg quick proto icmp from any to any
diff --git a/contrib/netbsd-tests/ipf/expected/i2 b/contrib/netbsd-tests/ipf/expected/i2
new file mode 100644
index 0000000..17b9d07
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i2
@@ -0,0 +1,9 @@
+log in proto tcp from any to any
+pass in proto tcp from any to any
+pass in inet proto udp from 127.0.0.1/32 to 127.0.0.1/32
+block in proto ipv6 from any to any
+block in proto udp from any to any
+block in proto 250 from any to any
+pass in proto tcp/udp from any to any
+block in proto tcp/udp from any to any
+block in proto tcp/udp from any to any
diff --git a/contrib/netbsd-tests/ipf/expected/i20 b/contrib/netbsd-tests/ipf/expected/i20
new file mode 100644
index 0000000..25e35cd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i20
@@ -0,0 +1,4 @@
+pass in on ppp0(!) inet from ppp0/peer to ppp0/32
+block in on hme0(!) inet from any to hme0/bcast
+pass in on bge0(!) inet from bge0/net to bge0/32
+block in on eri0(!) inet from any to eri0/netmasked
diff --git a/contrib/netbsd-tests/ipf/expected/i21 b/contrib/netbsd-tests/ipf/expected/i21
new file mode 100644
index 0000000..d4d28da
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i21
@@ -0,0 +1,16 @@
+pass in from any port = 10101 to any
+pass out from any to any port != 22
+block in from any port 20:21 to any
+block out from any to any port 10 <> 100
+pass out from any to any port = 3
+pass out from any to any port = 5
+pass out from any to any port = 7
+pass out from any to any port = 9
+block in from any port = 20 to any
+block in from any port = 25 to any
+pass in from any port 11:12 to any port 1:2
+pass in from any port 21:22 to any port 1:2
+pass in from any port 11:12 to any port 4:5
+pass in from any port 21:22 to any port 4:5
+pass in from any port 11:12 to any port 8:9
+pass in from any port 21:22 to any port 8:9
diff --git a/contrib/netbsd-tests/ipf/expected/i22 b/contrib/netbsd-tests/ipf/expected/i22
new file mode 100644
index 0000000..6e5a07d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i22
@@ -0,0 +1,5 @@
+pass in exp { "ip.src != 1.1.1.0/24; tcp.dport = 80;" }
+pass in exp { "ip.addr = 1.2.3.4/32,5.6.7.8/32;" }
+block out exp { "ip.dst = 127.0.0.0/8;" }
+block in exp { "udp.sport = 53; udp.dport = 53;" }
+pass out exp { "tcp.sport = 22; tcp.port = 25;" }
diff --git a/contrib/netbsd-tests/ipf/expected/i23 b/contrib/netbsd-tests/ipf/expected/i23
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i23
diff --git a/contrib/netbsd-tests/ipf/expected/i3 b/contrib/netbsd-tests/ipf/expected/i3
new file mode 100644
index 0000000..691ad25
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i3
@@ -0,0 +1,11 @@
+log in all
+pass in inet from 128.16.0.0/16 to 129.10.10.0/24
+pass in inet from 128.0.0.0/24 to 128.0.0.0/16
+pass in inet from 128.0.0.0/24 to 128.0.0.0/16
+pass in inet from 128.0.0.0/24 to 128.0.0.0/16
+pass in inet from 128.0.0.0/24 to 128.0.0.0/16
+pass in inet from 128.0.0.0/24 to 128.0.0.0/16
+pass in inet from 127.0.0.1/32 to 127.0.0.1/32
+block in log inet from any to any
+block in log level auth.info on hme0(!) all
+log level local5.warn out all
diff --git a/contrib/netbsd-tests/ipf/expected/i4 b/contrib/netbsd-tests/ipf/expected/i4
new file mode 100644
index 0000000..1198714
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i4
@@ -0,0 +1,9 @@
+log in proto tcp from any port > 0 to any
+log in proto tcp from any to any port > 0
+pass in proto tcp from any port != 0 to any port 0 >< 65535
+pass in inet proto udp from 127.0.0.1/32 port > 32000 to 127.0.0.1/32 port < 29000
+block in proto udp from any port != 123 to any port < 7
+block in proto tcp from any port = 25 to any port > 25
+pass in proto tcp/udp from any port 1 >< 3 to any port 1 <> 3
+pass in proto tcp/udp from any port 2:2 to any port 10:20
+pass in log first quick proto tcp from any port > 1023 to any port = 1723 flags S/FSRPAU keep state # count 0
diff --git a/contrib/netbsd-tests/ipf/expected/i5 b/contrib/netbsd-tests/ipf/expected/i5
new file mode 100644
index 0000000..0dbc859
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i5
@@ -0,0 +1,9 @@
+log in all
+count in tos 0x80 from any to any
+pass in on ed0(!) inet tos 0x40 from 127.0.0.1/32 to 127.0.0.1/32
+block in log on lo0(!) ttl 0 from any to any
+pass in quick ttl 1 from any to any
+skip 3 out inet from 127.0.0.1/32 to any
+auth out on foo0(!) proto tcp from any to any port = 80
+preauth out on foo0(!) proto tcp from any to any port = 22
+nomatch out on foo0(!) proto tcp from any port < 1024 to any
diff --git a/contrib/netbsd-tests/ipf/expected/i6 b/contrib/netbsd-tests/ipf/expected/i6
new file mode 100644
index 0000000..29c33a2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i6
@@ -0,0 +1,12 @@
+pass in on lo0(!) fastroute from any to any
+pass in on lo0(!) to qe0(!) inet from 127.0.0.1/32 to 127.0.0.1/32
+pass in on le0(!) to qe0:127.0.0.1 inet from 127.0.0.1/32 to 127.0.0.1/32
+pass in on lo0(!) dup-to qe0(!) inet from 127.0.0.1/32 to 127.0.0.1/32
+pass in on le0(!) dup-to qe0:127.0.0.1 inet from 127.0.0.1/32 to 127.0.0.1/32
+pass in on le0(!) to hme0:10.1.1.1 dup-to qe0:127.0.0.1 inet from 127.0.0.1/32 to 127.0.0.1/32
+block in quick on qe0(!) to qe1(!) from any to any
+block in quick to qe1(!) from any to any
+pass out quick dup-to hme0(!) from any to any
+pass out quick on hme0(!) reply-to hme1(!) from any to any
+pass in on le0(!) dup-to qe0:127.0.0.1 reply-to hme1:10.10.10.10 inet all
+pass in quick fastroute all
diff --git a/contrib/netbsd-tests/ipf/expected/i7 b/contrib/netbsd-tests/ipf/expected/i7
new file mode 100644
index 0000000..552f7f8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i7
@@ -0,0 +1,14 @@
+pass in on ed0(!) inet proto tcp from 127.0.0.1/32 to 127.0.0.1/32 port = 23 flags S/SA
+block in on lo0(!) proto tcp from any to any flags A/FSRPAU
+pass in on lo0(!) proto tcp from any to any flags /SPA
+block in on lo0(!) proto tcp from any to any flags C/A
+pass in on lo0(!) proto tcp from any to any flags S/SA
+block in on lo0(!) proto tcp from any to any flags S/SA
+pass in on lo0(!) proto tcp from any to any flags S/FSRPAU
+block in on lo0(!) proto tcp from any to any flags /A
+pass in on lo0(!) proto tcp from any to any flags S/SA
+pass in on lo0(!) proto tcp from any to any flags S/SA
+block in on lo0(!) proto tcp from any to any flags S/SA
+pass in on lo0(!) proto tcp from any to any flags S/FSRPAU
+block in on lo0(!) proto tcp from any to any flags /A
+pass in on lo0(!) proto tcp from any to any flags S/SA
diff --git a/contrib/netbsd-tests/ipf/expected/i8 b/contrib/netbsd-tests/ipf/expected/i8
new file mode 100644
index 0000000..a85f1de
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i8
@@ -0,0 +1,66 @@
+pass in inet proto icmp from 127.0.0.1/32 to 127.0.0.1/32 icmp-type timest
+block in inet proto icmp from any to any icmp-type unreach code 1
+pass in inet proto icmp from any to any icmp-type unreach code 15
+pass in inet proto icmp from any to any icmp-type unreach code 13
+pass in inet proto icmp from any to any icmp-type unreach code 8
+pass in inet proto icmp from any to any icmp-type unreach code 4
+pass in inet proto icmp from any to any icmp-type unreach code 9
+pass in inet proto icmp from any to any icmp-type unreach code 11
+pass in inet proto icmp from any to any icmp-type unreach code 14
+pass in inet proto icmp from any to any icmp-type unreach code 10
+pass in inet proto icmp from any to any icmp-type unreach code 12
+pass in inet proto icmp from any to any icmp-type unreach code 7
+pass in inet proto icmp from any to any icmp-type unreach code 1
+pass in inet proto icmp from any to any icmp-type unreach code 6
+pass in inet proto icmp from any to any icmp-type unreach code 0
+pass in inet proto icmp from any to any icmp-type unreach code 3
+pass in inet proto icmp from any to any icmp-type unreach code 2
+pass in inet proto icmp from any to any icmp-type unreach code 5
+pass in inet proto icmp from any to any icmp-type echo
+pass in inet proto icmp from any to any icmp-type echorep
+pass in inet proto icmp from any to any icmp-type inforeq
+pass in inet proto icmp from any to any icmp-type inforep
+pass in inet proto icmp from any to any icmp-type maskrep
+pass in inet proto icmp from any to any icmp-type maskreq
+pass in inet proto icmp from any to any icmp-type paramprob
+pass in inet proto icmp from any to any icmp-type redir
+pass in inet proto icmp from any to any icmp-type unreach
+pass in inet proto icmp from any to any icmp-type routerad
+pass in inet proto icmp from any to any icmp-type routersol
+pass in inet proto icmp from any to any icmp-type squench
+pass in inet proto icmp from any to any icmp-type timest
+pass in inet proto icmp from any to any icmp-type timestrep
+pass in inet proto icmp from any to any icmp-type timex
+pass in inet proto icmp from any to any icmp-type 254
+pass in inet proto icmp from any to any icmp-type 253 code 254
+pass in inet proto icmp from any to any icmp-type unreach code 15
+pass in inet proto icmp from any to any icmp-type unreach code 13
+pass in inet proto icmp from any to any icmp-type unreach code 8
+pass in inet proto icmp from any to any icmp-type unreach code 4
+pass in inet proto icmp from any to any icmp-type unreach code 9
+pass in inet proto icmp from any to any icmp-type unreach code 11
+pass in inet proto icmp from any to any icmp-type unreach code 14
+pass in inet proto icmp from any to any icmp-type unreach code 10
+pass in inet proto icmp from any to any icmp-type unreach code 12
+pass in inet proto icmp from any to any icmp-type unreach code 7
+pass in inet proto icmp from any to any icmp-type unreach code 1
+pass in inet proto icmp from any to any icmp-type unreach code 6
+pass in inet proto icmp from any to any icmp-type unreach code 0
+pass in inet proto icmp from any to any icmp-type unreach code 3
+pass in inet proto icmp from any to any icmp-type unreach code 2
+pass in inet proto icmp from any to any icmp-type unreach code 5
+pass in inet proto icmp from any to any icmp-type echo
+pass in inet proto icmp from any to any icmp-type echorep
+pass in inet proto icmp from any to any icmp-type inforeq
+pass in inet proto icmp from any to any icmp-type inforep
+pass in inet proto icmp from any to any icmp-type maskrep
+pass in inet proto icmp from any to any icmp-type maskreq
+pass in inet proto icmp from any to any icmp-type paramprob
+pass in inet proto icmp from any to any icmp-type redir
+pass in inet proto icmp from any to any icmp-type unreach
+pass in inet proto icmp from any to any icmp-type routerad
+pass in inet proto icmp from any to any icmp-type routersol
+pass in inet proto icmp from any to any icmp-type squench
+pass in inet proto icmp from any to any icmp-type timest
+pass in inet proto icmp from any to any icmp-type timestrep
+pass in inet proto icmp from any to any icmp-type timex
diff --git a/contrib/netbsd-tests/ipf/expected/i9 b/contrib/netbsd-tests/ipf/expected/i9
new file mode 100644
index 0000000..deecd17
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/i9
@@ -0,0 +1,17 @@
+pass in inet from 127.0.0.1/32 to 127.0.0.1/32 with short,frag
+block in from any to any with ipopts
+pass in inet from any to any with opt nop,rr,zsu
+pass in inet from any to any with opt nop,rr,zsu not opt lsrr,ssrr
+pass in inet from 127.0.0.1/32 to 127.0.0.1/32 with not frag
+pass in inet from 127.0.0.1/32 to 127.0.0.1/32 with frag,frag-body
+pass in proto tcp from any to any flags S/FSRPAU with not oow keep state # count 0
+block in proto tcp from any to any with oow
+pass in proto tcp from any to any flags S/FSRPAU with not bad,bad-src,bad-nat
+block in proto tcp from any to any flags S/FSRPAU with bad,not bad-src,not bad-nat
+pass in quick from any to any with not short
+block in quick from any to any with not nat
+pass in quick from any to any with not frag-body
+block in quick from any to any with not lowttl
+pass in from any to any with not ipopts,mbcast,not bcast,mcast,not state
+block in from any to any with not mbcast,bcast,not mcast,state
+pass in inet from any to any with opt mtup,mtur,encode,ts,tr,sec,e-sec,cipso,satid,ssrr,addext,visa,imitd,eip,finn,dps,sdb,nsapa,rtralrt,ump
diff --git a/contrib/netbsd-tests/ipf/expected/in1 b/contrib/netbsd-tests/ipf/expected/in1
new file mode 100644
index 0000000..2f1cf31
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in1
@@ -0,0 +1,31 @@
+map le0 0/0 -> 0/32
+map le0 0.0.0.1/32 -> 0.0.0.1/32
+map le0 128.0.0.0/1 -> 0/0
+map le0 10.0.0.0/8 -> 1.2.3.0/24
+map le0 10.0.0.0/8 -> 1.2.3.0/24
+map le0 10.0.0.0/8 -> 1.2.3.0/24
+map le0 0.0.0.5/0.0.0.255 -> 1.2.3.0/24
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999
+map ppp0 192.168.0.0/16 -> 0/32 portmap udp 20000:29999
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp/udp 30000:39999
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp auto
+map ppp0 192.168.0.0/16 -> 0/32 portmap udp auto
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp/udp auto
+map ppp0 192.168.0.0/16 -> 0/32 proxy port 21 ftp/tcp
+map ppp0 192.168.0.0/16 -> 0/32 proxy port 1010 ftp/tcp
+map le0 0/0 -> 0/32 frag
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 frag
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 frag
+map ppp0 192.168.0.0/16 -> 0/32 proxy port 21 ftp/tcp frag
+map le0 0/0 -> 0/32 age 10/10
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 age 10/20
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 age 30/30
+map le0 0/0 -> 0/32 frag age 10/10
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 frag age 10/20
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 frag age 30/30
+map fxp0 from 192.168.0.0/18 to 0/0 port = 21 -> 1.2.3.4/32 proxy port 21 ftp/tcp
+map thisisalonginte 0/0 -> 0/32 mssclamp 1452 tag freddyliveshere
+map bar0 0/0 -> 0/32 icmpidmap icmp 1000:2000
+map ppp0,adsl0 0/0 -> 0/32
+map ppp0 from 192.168.0.0/16 to 0/0 port = 123 -> 0/32 age 30/1 udp
diff --git a/contrib/netbsd-tests/ipf/expected/in100 b/contrib/netbsd-tests/ipf/expected/in100
new file mode 100644
index 0000000..dcf3097
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in100
@@ -0,0 +1,3 @@
+rewrite in on bge0 from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.3/32 dst 4.4.4.4/32;
+rewrite out on bge0 from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.0/24 dst 4.4.4.4/32;
+rewrite in on bge0 from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.0/24 dst 4.4.4.0/24;
diff --git a/contrib/netbsd-tests/ipf/expected/in100_6 b/contrib/netbsd-tests/ipf/expected/in100_6
new file mode 100644
index 0000000..b81fa60
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in100_6
@@ -0,0 +1,3 @@
+rewrite in on bge0 inet6 from 1:1:1::1/128 to 2:2::2:2/128 -> src 3:3:3::3/128 dst 4::4:4:4/128;
+rewrite out on bge0 inet6 from 1:1:1::1/128 to 2:2::2:2/128 -> src 3:3:3::/96 dst 4::4:4:4/128;
+rewrite in on bge0 inet6 from 1:1:1::1/128 to 2:2::2:2/128 -> src 3:3:3::/96 dst 4::4:0:0/96;
diff --git a/contrib/netbsd-tests/ipf/expected/in101 b/contrib/netbsd-tests/ipf/expected/in101
new file mode 100644
index 0000000..04e234c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in101
@@ -0,0 +1,4 @@
+rewrite in on bge0 proto icmp from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.3/32 dst 4.4.4.4/32;
+rewrite in on bge0 proto udp from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.3/32 dst 4.4.4.4/32;
+rewrite out on bge0 proto tcp from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.0/24 dst 4.4.4.4/32;
+rewrite in on bge0 proto tcp/udp from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.0/24,20202 dst 4.4.4.0/24,10101;
diff --git a/contrib/netbsd-tests/ipf/expected/in101_6 b/contrib/netbsd-tests/ipf/expected/in101_6
new file mode 100644
index 0000000..baed807
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in101_6
@@ -0,0 +1,4 @@
+rewrite in on bge0 inet6 proto icmp from 1:1:1::1/128 to 2:2::2:2/128 -> src 3:3:3::3/128 dst 4::4:4:4/128;
+rewrite in on bge0 inet6 proto udp from 1:1:1::1/128 to 2:2::2:2/128 -> src 3:3:3::3/128 dst 4::4:4:4/128;
+rewrite out on bge0 inet6 proto tcp from 1:1:1::1/128 to 2:2::2:2/128 -> src 3::/24 dst 4::4:4:4/128;
+rewrite in on bge0 inet6 proto tcp/udp from 1:1:1::1/128 to 2:2::/32 -> src 3::/24,20202 dst 4::/24,10101;
diff --git a/contrib/netbsd-tests/ipf/expected/in102 b/contrib/netbsd-tests/ipf/expected/in102
new file mode 100644
index 0000000..0a1b612
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in102
@@ -0,0 +1,5 @@
+rewrite in on bge0 proto tcp from 0/0 to 0/0 -> src 0/0 dst dstlist/a;
+rewrite in on bge0 proto tcp from 1.1.1.1/32 to 0/0 -> src 0/0 dst dstlist/bee;
+rewrite in on bge0 proto tcp from 1.1.1.1/32 to 2.2.2.2/32 -> src 0/0 dst dstlist/cat;
+rewrite in on bge0 proto tcp from pool/a to 2.2.2.2/32 -> src 0/0 dst dstlist/bat;
+rewrite in on bge0 proto tcp from pool/a to pool/1 -> src 0/0 dst dstlist/ant;
diff --git a/contrib/netbsd-tests/ipf/expected/in102_6 b/contrib/netbsd-tests/ipf/expected/in102_6
new file mode 100644
index 0000000..0e3fa8e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in102_6
@@ -0,0 +1,5 @@
+rewrite in on bge0 inet6 proto tcp from any to any -> src any dst dstlist/a;
+rewrite in on bge0 inet6 proto tcp from 1:1:1::1/128 to any -> src any dst dstlist/bee;
+rewrite in on bge0 inet6 proto tcp from 1:1:1::1/128 to 2:2::2:2/128 -> src any dst dstlist/cat;
+rewrite in on bge0 inet6 proto tcp from pool/a to 2:2::2:2/128 -> src any dst dstlist/bat;
+rewrite in on bge0 inet6 proto tcp from pool/a to pool/1 -> src any dst dstlist/ant;
diff --git a/contrib/netbsd-tests/ipf/expected/in1_6 b/contrib/netbsd-tests/ipf/expected/in1_6
new file mode 100644
index 0000000..7651337
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in1_6
@@ -0,0 +1,29 @@
+map le0 inet6 any -> ::/128
+map le0 inet6 any -> any
+map le0 inet6 ::/1 -> any
+map le0 inet6 10::/16 -> 1:2:3::/96
+map le0 inet6 10::/16 -> 1:2:3::/96
+map le0 inet6 192:168::/32 -> range 203:1:1::23-203:1:3::45
+map ppp0 inet6 192:168::/32 -> ::/128 portmap tcp 10000:19999
+map ppp0 inet6 192:168::/32 -> ::/128 portmap udp 20000:29999
+map ppp0 inet6 192:168::/32 -> ::/128 portmap tcp/udp 30000:39999
+map ppp0 inet6 192:168::/32 -> ::/128 portmap tcp auto
+map ppp0 inet6 192:168::/32 -> ::/128 portmap udp auto
+map ppp0 inet6 192:168::/32 -> ::/128 portmap tcp/udp auto
+map ppp0 inet6 192:168::/32 -> ::/128 proxy port 21 ftp/tcp
+map ppp0 inet6 192:168::/32 -> ::/128 proxy port 1010 ftp/tcp
+map le0 inet6 any -> ::/128 frag
+map le0 inet6 192:168::/32 -> range 203:1:1::23-203:1:3::45 frag
+map ppp0 inet6 192:168::/32 -> ::/128 portmap tcp 10000:19999 frag
+map ppp0 inet6 192:168::/32 -> ::/128 proxy port 21 ftp/tcp frag
+map le0 inet6 any -> ::/128 age 10/10
+map le0 inet6 192:168::/32 -> range 203:1:1::23-203:1:3::45 age 10/20
+map ppp0 inet6 192:168::/32 -> ::/128 portmap tcp 10000:19999 age 30/30
+map le0 inet6 any -> ::/128 frag age 10/10
+map le0 inet6 192:168::/32 -> range 203:1:1::23-203:1:3::45 frag age 10/20
+map ppp0 inet6 192:168::/32 -> ::/128 portmap tcp 10000:19999 frag age 30/30
+map fxp0 inet6 from 192::/18 to any port = 21 -> 1:2:3::4/128 proxy port 21 ftp/tcp
+map thisisalonginte inet6 any -> ::/128 mssclamp 1452 tag freddyliveshere
+map bar0 inet6 any -> ::/128 icmpidmap icmp 1000:2000
+map ppp0,adsl0 inet6 any -> ::/128
+map ppp0 inet6 from 192:168::/32 to any port = 123 -> ::/128 age 30/1 udp
diff --git a/contrib/netbsd-tests/ipf/expected/in2 b/contrib/netbsd-tests/ipf/expected/in2
new file mode 100644
index 0000000..068db50
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in2
@@ -0,0 +1,71 @@
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1/32 port 0 tcp
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 reserved
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip
+rdr le0 9.0.0.0/8 -> 1.1.1.1/32 ip
+rdr le0 9.8.0.0/16 -> 1.1.1.1/32 ip
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp
+rdr le0 9.8.7.6/32 port 80 -> 0/0 port 80 tcp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 udp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp/udp
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp frag
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp/udp frag
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin frag
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/10
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/20
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp frag age 10/10
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20/20
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin frag age 30/30
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40/40
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp frag
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin frag sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/10
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/20
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp frag age 10/10
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20/20 sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin frag age 30/30 sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40/40 sticky
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip mssclamp 1000
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip mssclamp 1000
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag mssclamp 1000
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp frag mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin frag sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky mssclamp 1000
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/10 mssclamp 1000
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/20 mssclamp 1000
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp frag age 10/10 mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20/20 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin frag age 30/30 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40/40 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip tag nattagcacheline
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp frag mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/10 mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/20 mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 -> 1.1.1.1/32 icmp frag age 10/10 mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20/20 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1/32 port 80 tcp round-robin frag age 30/30 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40/40 sticky mssclamp 1000 tag nattagcacheline
+rdr ge0 9.8.7.6/32 port 21 -> 1.1.1.1/32 port 21 tcp proxy ftp
+rdr ge0 9.8.7.6/32 port 21 -> 1.1.1.1/32 port 21 tcp proxy ftp
+rdr le0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1/32 port 5555 tcp
+rdr le0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1/32 port = 5555 tcp
+rdr le0 0/0 -> 254.220.186.152/32 ip
+rdr le0 0/0 -> 254.220.186.152,254.220.186.152 ip
+rdr adsl0,ppp0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1/32 port 5555-7777 tcp
diff --git a/contrib/netbsd-tests/ipf/expected/in2_6 b/contrib/netbsd-tests/ipf/expected/in2_6
new file mode 100644
index 0000000..7e9ef01
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in2_6
@@ -0,0 +1,71 @@
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1/128 port 0 tcp
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 reserved
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip
+rdr le0 inet6 9:8::/32 -> 1:1:1::1/128 ip
+rdr le0 inet6 9:8:7::/64 -> 1:1:1::1/128 ip
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp
+rdr le0 inet6 9:8:7::6/128 port 80 -> any port 80 tcp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 udp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp/udp
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp frag
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp/udp frag
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin frag
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/10
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/20
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp frag age 10/10
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag age 20/20
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin frag age 30/30
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag age 40/40
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp frag
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin frag sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag sticky
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/10
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/20
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp frag age 10/10
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag age 20/20 sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin frag age 30/30 sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag age 40/40 sticky
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp frag mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin frag sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/10 mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/20 mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp frag age 10/10 mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag age 20/20 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin frag age 30/30 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag age 40/40 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp frag mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/10 mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/20 mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1/128 icmp frag age 10/10 mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag age 20/20 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1/128 port 80 tcp round-robin frag age 30/30 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag age 40/40 sticky mssclamp 1000 tag nattagcacheline
+rdr ge0 inet6 9:8:7::6/128 port 21 -> 1:1:1::1/128 port 21 tcp proxy ftp
+rdr ge0 inet6 9:8:7::6/128 port 21 -> 1:1:1::1/128 port 21 tcp proxy ftp
+rdr le0 inet6 9:8:7::6/128 port 1000-2000 -> 1:1:1::1/128 port 5555 tcp
+rdr le0 inet6 9:8:7::6/128 port 1000-2000 -> 1:1:1::1/128 port = 5555 tcp
+rdr le0 inet6 any -> fe80:aa55:1234:5678:5a5a:a5a5:fedc:ba98/128 ip
+rdr le0 inet6 any -> fe80:aa55:1234:5678:5a5a:a5a5:fedc:ba98,fe80:aa55:1234:5678:5a5a:a5a5:fedc:ba98 ip
+rdr adsl0,ppp0 inet6 9:8:7::6/128 port 1000-2000 -> 1:1:1::1/128 port 5555-7777 tcp
diff --git a/contrib/netbsd-tests/ipf/expected/in3 b/contrib/netbsd-tests/ipf/expected/in3
new file mode 100644
index 0000000..dac97c7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in3
@@ -0,0 +1,5 @@
+bimap le0 0/0 -> 0/32
+bimap le0 0.0.0.1/32 -> 0.0.0.1/32
+bimap le0 128.0.0.0/1 -> 0/0
+bimap le0 10.0.0.0/8 -> 1.2.3.0/24
+bimap le0 10.0.5.0/24 -> 1.2.3.0/24
diff --git a/contrib/netbsd-tests/ipf/expected/in3_6 b/contrib/netbsd-tests/ipf/expected/in3_6
new file mode 100644
index 0000000..60f3091
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in3_6
@@ -0,0 +1,5 @@
+bimap le0 inet6 any -> ::/128
+bimap le0 inet6 any -> any
+bimap le0 inet6 ::/1 -> any
+bimap le0 inet6 10::/16 -> 1:2:3::/96
+bimap le0 inet6 10:0:5::/96 -> 1:2:3::/96
diff --git a/contrib/netbsd-tests/ipf/expected/in4 b/contrib/netbsd-tests/ipf/expected/in4
new file mode 100644
index 0000000..ac8dce1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in4
@@ -0,0 +1,5 @@
+map-block le0 10.0.0.0/24 -> 203.1.1.0/24 ports 0
+map-block le0 10.0.0.0/24 -> 203.1.1.0/24 ports 0
+map-block le0 10.0.0.0/24 -> 203.1.1.0/24 ports 256
+map-block le0 10.0.0.0/24 -> 203.1.1.0/24 ports auto
+map-block le0 10.0.0.0/16 -> 203.1.1.0/24 ports auto
diff --git a/contrib/netbsd-tests/ipf/expected/in4_6 b/contrib/netbsd-tests/ipf/expected/in4_6
new file mode 100644
index 0000000..0e9bfd2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in4_6
@@ -0,0 +1,5 @@
+map-block le0 inet6 10::/96 -> 203:1:1::/96 ports 0
+map-block le0 inet6 10::/96 -> 203:1:1::/96 ports 0
+map-block le0 inet6 10::/96 -> 203:1:1::/96 ports 256
+map-block le0 inet6 10::/96 -> 203:1:1::/96 ports auto
+map-block le0 inet6 10::/16 -> 203:1:1::/96 ports auto
diff --git a/contrib/netbsd-tests/ipf/expected/in5 b/contrib/netbsd-tests/ipf/expected/in5
new file mode 100644
index 0000000..b7c6ef5
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in5
@@ -0,0 +1,24 @@
+map le0 from 9.8.7.6/32 port > 1024 to 0/0 -> 1.1.1.1/32 portmap tcp 10000:20000
+map le0 from 9.8.7.6/32 port > 1024 ! to 1.2.3.4/32 -> 1.1.1.1/32 portmap tcp 10000:20000
+rdr le0 from 0/0 to 9.8.7.6/32 port = 0 -> 1.1.1.1/32 port 0 tcp
+rdr le0 from 0/0 to 9.8.7.6/32 -> 1.1.1.1/32 ip
+rdr le0 ! from 1.2.3.4/32 to 9.8.7.6/32 port = 8888 -> 1.1.1.1/32 port 888 tcp
+rdr le0 from 0/0 to 9.8.7.6/32 -> 1.1.1.1/32 ip
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1/32 port 888 tcp
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1/32 port 888 udp
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1/32 port 888 tcp/udp
+rdr le0 from 0/0 to 9.8.7.6/32 -> 1.1.1.1/32 icmp
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1/32 port 888 tcp round-robin
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin
+rdr le0 from 0/0 to 9.8.7.6/32 -> 1.1.1.1/32 ip frag
+rdr le0 from 0/0 to 9.8.7.6/32 -> 1.1.1.1/32 icmp frag
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp frag
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1/32 port 888 tcp round-robin frag
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin frag
+rdr le0 from 0/0 to 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/10
+rdr le0 from 0/0 to 9.8.7.6/32 -> 1.1.1.1/32 ip frag age 10/20
+rdr le0 from 0/0 to 9.8.7.6/32 -> 1.1.1.1/32 icmp frag age 10/10
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp frag age 20/20
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1/32 port 888 tcp round-robin frag age 30/30
+rdr le0 from 0/0 to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin frag age 40/40
diff --git a/contrib/netbsd-tests/ipf/expected/in5_6 b/contrib/netbsd-tests/ipf/expected/in5_6
new file mode 100644
index 0000000..a1925a2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in5_6
@@ -0,0 +1,24 @@
+map le0 inet6 from 9:8:7::6/128 port > 1024 to any -> 1:1:1::1/128 portmap tcp 10000:20000
+map le0 inet6 from 9:8:7::6/128 port > 1024 ! to 1:2:3::4/128 -> 1:1:1::1/128 portmap tcp 10000:20000
+rdr le0 inet6 from any to 9:8:7::6/128 port = 0 -> 1:1:1::1/128 port 0 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1/128 ip
+rdr le0 inet6 ! from 1:2:3::4/128 to 9:8:7::6/128 port = 8888 -> 1:1:1::1/128 port 888 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1/128 ip
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1/128 port 888 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1/128 port 888 udp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1/128 port 888 tcp/udp
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1/128 icmp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1/128 port 888 tcp round-robin
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp round-robin
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1/128 ip frag
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1/128 icmp frag
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp frag
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1/128 port 888 tcp round-robin frag
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp round-robin frag
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/10
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1/128 ip frag age 10/20
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1/128 icmp frag age 10/10
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp frag age 20/20
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1/128 port 888 tcp round-robin frag age 30/30
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp round-robin frag age 40/40
diff --git a/contrib/netbsd-tests/ipf/expected/in6 b/contrib/netbsd-tests/ipf/expected/in6
new file mode 100644
index 0000000..fefc052
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in6
@@ -0,0 +1,8 @@
+map foo0 from 0/0 port = 1 to 0/0 port != 0 -> 0/32 udp
+map foo0 from 0/0 port = 1 to 0/0 port != 0 -> 0/32 udp
+map foo0 from 0/0 port < 1 to 0/0 port > 0 -> 0/32 tcp
+map foo0 from 0/0 port < 1 to 0/0 port > 0 -> 0/32 tcp
+map foo0 from 0/0 port <= 1 to 0/0 port >= 0 -> 0/32 tcp/udp
+map foo0 from 0/0 port <= 1 to 0/0 port >= 0 -> 0/32 tcp/udp
+map foo0 from 0/0 port 1 >< 20 to 0/0 port 20 <> 40 -> 0/32 tcp/udp
+map foo0 from 0/0 port 10:20 to 0/0 port 30:40 -> 0/32 tcp/udp
diff --git a/contrib/netbsd-tests/ipf/expected/in6_6 b/contrib/netbsd-tests/ipf/expected/in6_6
new file mode 100644
index 0000000..ee8a35c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in6_6
@@ -0,0 +1,8 @@
+map foo0 inet6 from any port = 1 to any port != 0 -> ::/32 udp
+map foo0 inet6 from any port = 1 to any port != 0 -> ::/32 udp
+map foo0 inet6 from any port < 1 to any port > 0 -> ::/32 tcp
+map foo0 inet6 from any port < 1 to any port > 0 -> ::/32 tcp
+map foo0 inet6 from any port <= 1 to any port >= 0 -> ::/32 tcp/udp
+map foo0 inet6 from any port <= 1 to any port >= 0 -> ::/32 tcp/udp
+map foo0 inet6 from any port 1 >< 20 to any port 20 <> 40 -> ::/32 tcp/udp
+map foo0 inet6 from any port 10:20 to any port 30:40 -> ::/32 tcp/udp
diff --git a/contrib/netbsd-tests/ipf/expected/in7 b/contrib/netbsd-tests/ipf/expected/in7
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in7
diff --git a/contrib/netbsd-tests/ipf/expected/in8_6 b/contrib/netbsd-tests/ipf/expected/in8_6
new file mode 100644
index 0000000..ab23b84
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/in8_6
@@ -0,0 +1,6 @@
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 tcp purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 mssclamp 1000 purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 portmap tcp/udp 10000:11000 purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 portmap tcp/udp 10000:11000 sequential purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 portmap tcp/udp 10000:11000 sequential purge
diff --git a/contrib/netbsd-tests/ipf/expected/ip1 b/contrib/netbsd-tests/ipf/expected/ip1
new file mode 100644
index 0000000..cee7831
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ip1
@@ -0,0 +1,68 @@
+table role=ipf type=tree number=1
+ {; };
+table role=ipf type=tree number=100
+ { 1.2.3.4/32; ! 2.2.0.0/16; 2.2.2.0/24; };
+table role=nat type=tree number=110
+ { 1.2.3.4/32; ! 2.2.0.0/16; 2.2.2.0/24; };
+table role=auth type=tree number=120
+ { 1.2.3.4/32; ! 2.2.0.0/16; 2.2.2.0/24; };
+table role=count type=tree number=130
+ { 1.2.3.4/32; ! 2.2.0.0/16; 2.2.2.0/24; };
+table role=ipf type=hash number=2 size=1
+ {; };
+table role=ipf type=hash number=200 size=5
+ { 0/0; 1/32; 1.2.3.4/32; };
+table role=nat type=hash number=210 size=5
+ { 0/0; 2/32; 1.2.3.4/32; };
+table role=auth type=hash number=220 size=5
+ { 0/0; 3/32; 1.2.3.4/32; };
+table role=count type=hash number=230 size=5
+ { 0/0; 4/32; 1.2.3.4/32; };
+table role=ipf type=hash number=240 size=5 seed=101
+ { 0/0; 1/32; 1.2.3.4/32; };
+table role=nat type=hash number=250 size=5 seed=101
+ { 0/0; 2/32; 1.2.3.4/32; };
+table role=auth type=hash number=260 size=5 seed=101
+ { 0/0; 3/32; 1.2.3.4/32; };
+table role=count type=hash number=270 size=5 seed=101
+ { 0/0; 4/32; 1.2.3.4/32; };
+table role=ipf type=hash number=2000 size=1001
+ { 0/0; 1/32; 1.2.3.4/32; };
+table role=nat type=hash number=2000 size=1001
+ { 0/0; 2/32; 1.2.3.4/32; };
+table role=auth type=hash number=2000 size=1001
+ { 0/0; 3/32; 1.2.3.4/32; };
+table role=count type=hash number=2000 size=1001
+ { 0/0; 4/32; 1.2.3.4/32; };
+table role=ipf type=hash number=100 size=1001 seed=101
+ { 0/0; 1/32; 1.2.3.4/32; };
+table role=nat type=hash number=100 size=1001 seed=101
+ { 0/0; 2/32; 1.2.3.4/32; };
+table role=auth type=hash number=100 size=1001 seed=101
+ { 0/0; 3/32; 1.2.3.4/32; };
+table role=count type=hash number=100 size=1001 seed=101
+ { 0/0; 4/32; 1.2.3.4/32; };
+group-map in role=ipf number=300 size=5
+ { 0/0, group=303; 5/32, group=303; 1.2.3.4/32, group=303; };
+group-map in role=nat number=300 size=5
+ { 0/0, group=303; 6/32, group=303; 1.2.3.4/32, group=303; };
+group-map in role=auth number=300 size=5
+ { 0/0, group=303; 7/32, group=303; 1.2.3.4/32, group=303; };
+group-map in role=count number=300 size=5
+ { 0/0, group=303; 8/32, group=303; 1.2.3.4/32, group=303; };
+group-map out role=ipf number=400 size=5
+ { 0/0, group=303; 5/32, group=303; 1.2.3.4/32, group=606; };
+group-map out role=nat number=400 size=5
+ { 0/0, group=303; 6/32, group=303; 1.2.3.4/32, group=606; };
+group-map out role=auth number=400 size=5
+ { 0/0, group=303; 7/32, group=303; 1.2.3.4/32, group=606; };
+group-map out role=count number=400 size=5
+ { 0/0, group=303; 8/32, group=303; 1.2.3.4/32, group=606; };
+group-map in role=ipf number=500 size=5
+ { 0/0, group=10; 5/32, group=800; 1.2.3.4/32, group=606; };
+group-map in role=nat number=500 size=5
+ { 0/0, group=10; 6/32, group=800; 1.2.3.4/32, group=606; };
+group-map in role=auth number=500 size=5
+ { 0/0, group=10; 7/32, group=800; 1.2.3.4/32, group=606; };
+group-map in role=count number=500 size=5
+ { 0/0, group=10; 8/32, group=800; 1.2.3.4/32, group=606; };
diff --git a/contrib/netbsd-tests/ipf/expected/ip2 b/contrib/netbsd-tests/ipf/expected/ip2
new file mode 100644
index 0000000..3de3c47
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ip2
@@ -0,0 +1,2 @@
+table role=ipf type=tree name=letters
+ { 1.1.1.1/32; ! 2.2.0.0/16; 2.2.2.0/24; };
diff --git a/contrib/netbsd-tests/ipf/expected/ip3 b/contrib/netbsd-tests/ipf/expected/ip3
new file mode 100644
index 0000000..48dd074
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ip3
@@ -0,0 +1,14 @@
+pool ipf/dstlist (name fred; policy round-robin;)
+ { 3.3.3.3; };
+pool ipf/dstlist (name jack; policy weighting connection;)
+ { 4.4.4.4; bge0:5.5.5.5; };
+pool ipf/dstlist (name jill; policy random;)
+ { 1.1.1.1; bge0:2.2.2.2; };
+table role=nat type=hash name=noproxy size=3
+ { 1.1.1.1/32; 2.2.2.2/32; };
+table role=nat type=tree name=raw
+ { 1.1.1.1/32; 2.2.2.2/32; };
+pool all/dstlist (name jill; policy random;)
+ { 1.1.1.1; bge0:2.2.2.2; };
+table role=all type=hash name=noproxy size=3
+ { 1.1.1.1/32; 2.2.2.2/32; };
diff --git a/contrib/netbsd-tests/ipf/expected/ipv6.1 b/contrib/netbsd-tests/ipf/expected/ipv6.1
new file mode 100644
index 0000000..9fd5437
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ipv6.1
@@ -0,0 +1,4 @@
+pass
+pass
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/ipv6.2 b/contrib/netbsd-tests/ipf/expected/ipv6.2
new file mode 100644
index 0000000..ba1581b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ipv6.2
@@ -0,0 +1,15 @@
+nomatch
+block
+nomatch
+block
+--------
+block
+nomatch
+block
+nomatch
+--------
+pass
+pass
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/ipv6.3 b/contrib/netbsd-tests/ipf/expected/ipv6.3
new file mode 100644
index 0000000..58cddec
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ipv6.3
@@ -0,0 +1,6 @@
+pass
+nomatch
+nomatch
+nomatch
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/ipv6.4 b/contrib/netbsd-tests/ipf/expected/ipv6.4
new file mode 100644
index 0000000..e3ae842
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ipv6.4
@@ -0,0 +1,51 @@
+pass
+pass
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+block
+nomatch
+nomatch
+nomatch
+pass
+pass
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/ipv6.5 b/contrib/netbsd-tests/ipf/expected/ipv6.5
new file mode 100644
index 0000000..3133a7f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ipv6.5
@@ -0,0 +1,6 @@
+pass
+nomatch
+--------
+block
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/ipv6.6 b/contrib/netbsd-tests/ipf/expected/ipv6.6
new file mode 100644
index 0000000..efd0421
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ipv6.6
@@ -0,0 +1,10 @@
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+block
+nomatch
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/l1 b/contrib/netbsd-tests/ipf/expected/l1
new file mode 100644
index 0000000..e4a081d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/l1
@@ -0,0 +1,56 @@
+log in all
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -AF IN
+01/01/1970 00:00:00.000000 2x anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,2049 -> 3.3.3.3,1023 PR udp len 20 28 IN
+--------
+pass in on anon0 all head 100
+--------
+pass in log quick from 3.3.3.3 to any group 100
+--------
+pass in log body quick from 2.2.2.2 to any
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS IN
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+--------
+pass in log quick proto tcp from 1.1.1.1 to any flags S keep state
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+01/01/1970 00:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A K-S IN
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS K-S IN
+01/01/1970 00:00:00.000000 e1 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -A K-S OUT
+01/01/1970 00:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -AF K-S IN
+--------
+pass in log first quick proto tcp from 1.1.1.1 to any flags S keep state
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+--------
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S IN
+01/01/1970 00:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+01/01/1970 00:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A K-S IN
+01/01/1970 00:00:00.000000 anon0 @0:4 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS K-S IN
+01/01/1970 00:00:00.000000 e1 @0:4 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -A K-S OUT
+01/01/1970 00:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -AF K-S IN
+01/01/1970 00:00:00.000000 2x anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @0:3 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 00:00:00.000000 anon0 @0:3 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 00:00:00.000000 anon0 @0:3 p 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 00:00:00.000000 anon0 @100:1 p 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,2049 -> 3.3.3.3,1023 PR udp len 20 28 IN
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/l1.b b/contrib/netbsd-tests/ipf/expected/l1.b
new file mode 100644
index 0000000..e06e486
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/l1.b
@@ -0,0 +1,56 @@
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -AF IN
+01/01/1970 00:00:00.000000 2x anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,2049 -> 3.3.3.3,1023 PR udp len 20 28 IN
+--------
+--------
+--------
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS IN
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01 02 03 04 05 06 07 08 09 0a 0b 0d ............
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01 02 03 04 05 06 07 08 09 0a 0b 0d 0e 0f 40 61 ..............@a
+42 63 44 65 46 67 48 69 4a 6b 4c 6d BcDeFgHiJkLm
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+--------
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+01/01/1970 00:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A K-S IN
+01/01/1970 00:00:00.000000 anon0 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS K-S IN
+01/01/1970 00:00:00.000000 e1 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -A K-S OUT
+01/01/1970 00:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -AF K-S IN
+--------
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+--------
+missed 1 ipf log entries: 0 1
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S IN
+01/01/1970 00:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+01/01/1970 00:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A K-S IN
+01/01/1970 00:00:00.000000 anon0 @0:4 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS K-S IN
+01/01/1970 00:00:00.000000 e1 @0:4 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -A K-S OUT
+01/01/1970 00:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -AF K-S IN
+01/01/1970 00:00:00.000000 2x anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 00:00:00.000000 anon0 @0:3 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01 02 03 04 05 06 07 08 09 0a 0b 0d ............
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 00:00:00.000000 anon0 @0:3 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01 02 03 04 05 06 07 08 09 0a 0b 0d 0e 0f 40 61 ..............@a
+42 63 44 65 46 67 48 69 4a 6b 4c 6d BcDeFgHiJkLm
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 00:00:00.000000 anon0 @0:3 p 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 00:00:00.000000 anon0 @100:1 p 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 00:00:00.000000 anon0 @-1:-1 L 1.1.1.1,2049 -> 3.3.3.3,1023 PR udp len 20 28 IN
+--------
diff --git a/contrib/netbsd-tests/ipf/expected/n1 b/contrib/netbsd-tests/ipf/expected/n1
new file mode 100644
index 0000000..20eaedc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n1
@@ -0,0 +1,197 @@
+> zx0 ip #0 20(20) 255 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+> zx0 ip #0 48(20) 1 10.2.2.2 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.1.1.1
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.1
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.3
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.4
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+List of active MAP/Redirect filters:
+map zx0 10.1.1.1/32 -> 10.2.2.2/32
+
+List of active sessions:
+MAP 10.1.1.1 <- -> 10.2.2.2 [10.4.3.2]
+MAP 10.1.1.1 <- -> 10.2.2.2 [10.1.1.2]
+
+Hostmap table:
+10.1.1.1,10.4.3.2 -> 10.2.2.2,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.2 -> 10.2.2.2,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.3.4.5 > 10.1.1.2
+15
+> zx0 ip #0 20(20) 255 10.3.4.5 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.0
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+> zx0 ip #0 48(20) 1 10.3.4.5 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.2.2.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.1
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.3
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.4
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.1.1.1
+> zx0 ip #0 20(20) 34 10.3.4.5 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.3.4.5 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.1.1.2
+15
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.3.4.5 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+List of active MAP/Redirect filters:
+map zx0 10.1.1.0/24 -> 10.3.4.5/32
+
+List of active sessions:
+MAP 10.1.1.3 <- -> 10.3.4.5 [10.4.3.4]
+MAP 10.1.1.2 <- -> 10.3.4.5 [10.4.3.4]
+MAP 10.1.1.2 <- -> 10.3.4.5 [10.4.3.2]
+MAP 10.1.1.1 <- -> 10.3.4.5 [10.4.3.2]
+MAP 10.1.1.2 1026 <- -> 10.3.4.5 1026 [10.1.1.1 1025]
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 1025 [10.1.1.1 1025]
+MAP 10.1.1.2 <- -> 10.3.4.5 [10.1.1.1]
+MAP 10.1.1.0 <- -> 10.3.4.5 [10.1.1.2]
+
+Hostmap table:
+10.1.1.3,10.4.3.4 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.2,10.4.3.4 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.2,10.4.3.2 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.1,10.4.3.2 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.2,10.1.1.1 -> 10.3.4.5,0.0.0.0 (use = 3)
+10.1.1.0,10.1.1.2 -> 10.3.4.5,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.3.4.1 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.3.4.2 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.3.4.3 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.3.4.3,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.3,1026 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+> zx0 ip #0 48(20) 1 10.3.4.3 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.2.2.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.1
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.1.1.1
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.4
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.3.4.3 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.3.4.3 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.3.4.4 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.3.4.4 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+List of active MAP/Redirect filters:
+map zx0 10.1.1.0/24 -> 10.3.4.0/24
+
+List of active sessions:
+MAP 10.1.1.3 <- -> 10.3.4.4 [10.4.3.4]
+MAP 10.1.1.3 <- -> 10.3.4.4 [10.4.3.4]
+MAP 10.1.1.2 <- -> 10.3.4.3 [10.4.3.4]
+MAP 10.1.1.2 <- -> 10.3.4.3 [10.4.3.2]
+MAP 10.1.1.1 <- -> 10.3.4.3 [10.4.3.2]
+MAP 10.1.1.2 1026 <- -> 10.3.4.3 1026 [10.1.1.1 1025]
+MAP 10.1.1.2 1025 <- -> 10.3.4.3 1025 [10.1.1.1 1025]
+MAP 10.1.1.2 <- -> 10.3.4.3 [10.1.1.1]
+MAP 10.1.1.1 <- -> 10.3.4.2 [10.1.1.2]
+MAP 10.1.1.0 <- -> 10.3.4.1 [10.1.1.2]
+
+Hostmap table:
+10.1.1.3,10.4.3.4 -> 10.3.4.4,0.0.0.0 (use = 2)
+10.1.1.2,10.4.3.4 -> 10.3.4.3,0.0.0.0 (use = 1)
+10.1.1.2,10.4.3.2 -> 10.3.4.3,0.0.0.0 (use = 1)
+10.1.1.1,10.4.3.2 -> 10.3.4.3,0.0.0.0 (use = 1)
+10.1.1.2,10.1.1.1 -> 10.3.4.3,0.0.0.0 (use = 3)
+10.1.1.1,10.1.1.2 -> 10.3.4.2,0.0.0.0 (use = 1)
+10.1.1.0,10.1.1.2 -> 10.3.4.1,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n10 b/contrib/netbsd-tests/ipf/expected/n10
new file mode 100644
index 0000000..0c03ff0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n10
@@ -0,0 +1,72 @@
+4500 002c 10c9 4000 ff06 5c9d cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 655d 0000 0204 0064
+
+List of active MAP/Redirect filters:
+map ppp0 0/0 -> 203.203.203.203/32 mssclamp 100
+
+List of active sessions:
+MAP 192.168.1.3 32818 <- -> 203.203.203.203 32818 [150.203.224.2 21]
+
+Hostmap table:
+192.168.1.3,150.203.224.2 -> 203.203.203.203,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+4500 002c 10c9 4000 ff06 5c9d cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 61d9 0000 0204 03e8
+
+List of active MAP/Redirect filters:
+map ppp0 0/0 -> 203.203.203.203/32 mssclamp 1000
+
+List of active sessions:
+MAP 192.168.1.3 32818 <- -> 203.203.203.203 32818 [150.203.224.2 21]
+
+Hostmap table:
+192.168.1.3,150.203.224.2 -> 203.203.203.203,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+4500 002c 10c9 4000 ff06 5c9d cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 600d 0000 0204 05b4
+
+List of active MAP/Redirect filters:
+map ppp0 0/0 -> 203.203.203.203/32 mssclamp 10000
+
+List of active sessions:
+MAP 192.168.1.3 32818 <- -> 203.203.203.203 32818 [150.203.224.2 21]
+
+Hostmap table:
+192.168.1.3,150.203.224.2 -> 203.203.203.203,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n100 b/contrib/netbsd-tests/ipf/expected/n100
new file mode 100644
index 0000000..80f00a1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n100
@@ -0,0 +1,33 @@
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.3.2.3
+> zx0 ip #0 20(20) 255 4.4.4.4 > 6.6.0.1
+> zx0 ip #0 20(20) 255 4.4.4.4 > 6.6.0.2
+> zx0 ip #0 20(20) 255 4.4.4.4 > 6.6.0.3
+> zx0 ip #0 20(20) 255 4.4.4.4 > 6.6.0.4
+> zx0 ip #0 20(20) 255 4.4.4.4 > 6.6.0.1
+> zx0 ip #0 40(20) 6 1.1.1.1,101 > 2.3.2.3,203
+> zx0 ip #0 40(20) 6 4.4.4.4,101 > 6.6.0.5,203
+List of active MAP/Redirect filters:
+rewrite out on zx0 from 0/0 to 2.2.0.0/16 -> src 4.4.4.4/32 dst 6.6.0.0/16;
+
+List of active sessions:
+RWR-MAP 1.1.1.1 101 2.2.2.3 203 <- -> 4.4.4.4 101 6.6.0.5 203
+RWR-MAP 1.1.1.1 2.2.2.4 <- -> 4.4.4.4 6.6.0.4
+RWR-MAP 1.2.1.2 2.2.2.3 <- -> 4.4.4.4 6.6.0.3
+RWR-MAP 1.1.1.2 2.2.2.3 <- -> 4.4.4.4 6.6.0.2
+RWR-MAP 1.1.1.1 2.2.2.3 <- -> 4.4.4.4 6.6.0.1
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n101 b/contrib/netbsd-tests/ipf/expected/n101
new file mode 100644
index 0000000..ad0ad97
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n101
@@ -0,0 +1,29 @@
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.3.2.3
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.2.2.3
+> zx0 ip #0 20(20) 255 1.1.1.2 > 2.2.2.3
+> zx0 ip #0 20(20) 255 1.2.1.2 > 2.2.2.3
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.2.2.4
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.2.2.3
+> zx0 ip #0 40(20) 6 1.1.1.1,101 > 2.3.2.3,203
+> zx0 ip #0 40(20) 6 4.4.4.4,101 > 6.6.0.1,203
+List of active MAP/Redirect filters:
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 -> src 4.4.4.4/32 dst 6.6.0.0/16;
+
+List of active sessions:
+RWR-MAP 1.1.1.1 101 2.2.2.3 203 <- -> 4.4.4.4 101 6.6.0.1 203
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n102 b/contrib/netbsd-tests/ipf/expected/n102
new file mode 100644
index 0000000..a2f130e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n102
@@ -0,0 +1,29 @@
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.3.2.3
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.2.2.3
+> zx0 ip #0 20(20) 255 1.1.1.2 > 2.2.2.3
+> zx0 ip #0 20(20) 255 1.2.1.2 > 2.2.2.3
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.2.2.4
+> zx0 ip #0 20(20) 255 1.1.1.1 > 2.2.2.3
+> zx0 ip #0 40(20) 6 1.1.1.1,101 > 2.3.2.3,203
+> zx0 ip #0 40(20) 6 4.4.4.4,1000 > 6.6.0.1,203
+List of active MAP/Redirect filters:
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 -> src 4.4.4.4/32,1000-2000 dst 6.6.0.0/16;
+
+List of active sessions:
+RWR-MAP 1.1.1.1 101 2.2.2.3 203 <- -> 4.4.4.4 1000 6.6.0.1 203
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n103 b/contrib/netbsd-tests/ipf/expected/n103
new file mode 100644
index 0000000..31ed740
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n103
@@ -0,0 +1,33 @@
+> zx0 ip #0 40(20) 6 1.1.1.1,101 > 2.3.2.3,203
+> zx0 ip #0 40(20) 6 4.4.4.4,1000 > 6.6.0.1,4000
+> zx0 ip #0 40(20) 6 4.4.4.4,1000 > 6.6.0.1,4000
+> zx0 ip #0 40(20) 6 4.4.4.4,1001 > 6.6.0.1,4000
+> zx0 ip #0 40(20) 6 4.4.4.4,1001 > 6.6.0.2,4000
+> zx0 ip #0 40(20) 6 4.4.4.4,1001 > 6.6.0.2,4001
+< zx0 ip #0 40(20) 6 2.2.2.3,4000 > 4.4.4.4,1000
+> zx0 ip #0 40(20) 6 4.4.4.4,1000 > 6.6.0.2,4001
+List of active MAP/Redirect filters:
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 -> src 4.4.4.4/32,1000-1001 dst 6.6.0.0/16,4000-4001;
+
+List of active sessions:
+RWR-MAP 7.7.7.7 101 2.2.2.3 203 <- -> 4.4.4.4 1000 6.6.0.2 4001
+RWR-MAP 5.5.5.5 101 2.2.2.3 203 <- -> 4.4.4.4 1001 6.6.0.2 4001
+RWR-MAP 10.10.10.10 101 2.2.2.3 203 <- -> 4.4.4.4 1001 6.6.0.2 4000
+RWR-MAP 1.1.1.2 101 2.2.2.3 203 <- -> 4.4.4.4 1001 6.6.0.1 4000
+RWR-MAP 1.1.1.1 101 2.2.2.3 203 <- -> 4.4.4.4 1000 6.6.0.1 4000
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n104 b/contrib/netbsd-tests/ipf/expected/n104
new file mode 100644
index 0000000..3b8a9de
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n104
@@ -0,0 +1,50 @@
+4500 0028 0001 0000 ff06 b1c3 0404 0001 0606 0001 03e8 0fa0 0000 0001 1000 0001 5010 2000 623f 0000
+
+4500 0028 0002 0000 ff06 b5c8 0202 0202 0101 0101 00cb 0065 0000 0001 1000 0001 5010 2000 789d 0000
+
+4500 0028 0003 0000 ff06 b1c0 0404 0002 0606 0001 03e8 0fa0 0000 0001 1000 0001 5010 2000 623e 0000
+
+4500 0028 0004 0000 ff06 b5c6 0202 0202 0101 0101 00cb 0066 0000 0001 1000 0001 5010 2000 789c 0000
+
+4500 0028 0005 0000 ff06 b1be 0404 0002 0606 0001 03e9 0fa0 0000 0001 1000 0001 5010 2000 623d 0000
+
+4500 0028 0006 0000 ff06 b5c4 0202 0202 0101 0101 00cb 0067 0000 0001 1000 0001 5010 2000 789b 0000
+
+4500 0028 0007 0000 ff06 b1bb 0404 0002 0606 0002 03e9 0fa0 0000 0001 1000 0001 5010 2000 623c 0000
+
+4500 0028 0008 0000 ff06 b5c2 0202 0202 0101 0101 00cb 0068 0000 0001 1000 0001 5010 2000 789a 0000
+
+4500 0028 0009 0000 ff06 b1b9 0404 0002 0606 0002 03e9 0fa1 0000 0001 1000 0001 5010 2000 623b 0000
+
+4500 0028 000a 0000 ff06 b5c0 0202 0202 0101 0101 00cb 0069 0000 0001 1000 0001 5010 2000 7899 0000
+
+4500 0028 000b 0000 ff06 b1b6 0404 0003 0606 0002 03e9 0fa1 0000 0001 1000 0001 5010 2000 623a 0000
+
+4500 0028 000c 0000 ff06 b5be 0202 0202 0101 0101 00cb 006a 0000 0001 1000 0001 5010 2000 7898 0000
+
+List of active MAP/Redirect filters:
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 -> src 4.4.0.0/24,1000-1001 dst 6.6.0.0/16,4000-4001;
+
+List of active sessions:
+RWR-MAP 1.1.1.1 106 2.2.2.2 203 <- -> 4.4.0.3 1001 6.6.0.2 4001
+RWR-MAP 1.1.1.1 105 2.2.2.2 203 <- -> 4.4.0.2 1001 6.6.0.2 4001
+RWR-MAP 1.1.1.1 104 2.2.2.2 203 <- -> 4.4.0.2 1001 6.6.0.2 4000
+RWR-MAP 1.1.1.1 103 2.2.2.2 203 <- -> 4.4.0.2 1001 6.6.0.1 4000
+RWR-MAP 1.1.1.1 102 2.2.2.2 203 <- -> 4.4.0.2 1000 6.6.0.1 4000
+RWR-MAP 1.1.1.1 101 2.2.2.2 203 <- -> 4.4.0.1 1000 6.6.0.1 4000
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n105 b/contrib/netbsd-tests/ipf/expected/n105
new file mode 100644
index 0000000..d45a4af
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n105
@@ -0,0 +1,25 @@
+4500 0028 0001 0000 ff06 adc0 0404 0404 0606 0001 03e8 0c38 0000 0001 1000 0001 5010 2000 61a4 0000
+
+4500 0028 0001 0000 ff06 b5c9 0202 0202 0101 0101 0050 0065 0000 0001 1000 0001 5010 2000 7918 0000
+
+List of active MAP/Redirect filters:
+rewrite in on zx0 proto tcp from 0/0 to 2.2.0.0/16 port = 80 -> src 4.4.4.4/32,1000-1001 dst 6.6.0.0/16,port = 3128;
+
+List of active sessions:
+RWR-RDR 1.1.1.1 101 2.2.2.2 80 <- -> 4.4.4.4 1000 6.6.0.1 3128
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n106 b/contrib/netbsd-tests/ipf/expected/n106
new file mode 100644
index 0000000..d466e65
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n106
@@ -0,0 +1,25 @@
+4500 0028 0001 0000 ff06 adc0 0404 0404 0606 0001 03e8 0c38 0000 0001 1000 0001 5010 2000 61a4 0000
+
+4500 0028 0001 0000 ff06 b5c9 0202 0202 0101 0101 0050 0065 0000 0001 1000 0001 5010 2000 7918 0000
+
+List of active MAP/Redirect filters:
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 port = 80 -> src 4.4.4.4/32,1000-1001 dst 6.6.0.0/16,port = 3128;
+
+List of active sessions:
+RWR-MAP 1.1.1.1 101 2.2.2.2 80 <- -> 4.4.4.4 1000 6.6.0.1 3128
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n11 b/contrib/netbsd-tests/ipf/expected/n11
new file mode 100644
index 0000000..ea11b93
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n11
@@ -0,0 +1,124 @@
+> zx0 ip #0 20(20) 255 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 255 1.6.7.8 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+List of active MAP/Redirect filters:
+bimap zx0 10.1.1.1/32 -> 1.6.7.8/32
+
+List of active sessions:
+BIMAP 10.1.1.1 <- -> 1.6.7.8 [10.1.1.2]
+
+Hostmap table:
+10.1.1.1,10.1.1.2 -> 1.6.7.8,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.1.2
+15
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.1.1
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.1.1.0
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.0
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+List of active MAP/Redirect filters:
+bimap zx0 10.1.1.0/24 -> 10.2.2.2/32
+
+List of active sessions:
+BIMAP 10.1.1.0 <- -> 10.2.2.2 [10.2.3.4]
+BIMAP 10.1.1.2 <- -> 10.2.2.2 [10.1.1.1]
+BIMAP 10.1.1.0 <- -> 10.2.2.2 [10.1.1.2]
+
+Hostmap table:
+10.1.1.2,10.1.1.1 -> 10.2.2.2,0.0.0.0 (use = 1)
+10.1.1.0,10.1.1.2 -> 10.2.2.2,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.3.4.0 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.3.4.1 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.3.4.2 > 10.1.1.1
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.1.1.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.5
+List of active MAP/Redirect filters:
+bimap zx0 10.1.1.0/24 -> 10.3.4.0/24
+
+List of active sessions:
+BIMAP 10.1.1.5 <- -> 10.3.4.5 [10.1.1.2]
+BIMAP 10.1.1.5 <- -> 10.3.4.5 [10.1.1.1]
+BIMAP 10.1.1.5 <- -> 10.3.4.5 [10.1.1.0]
+BIMAP 10.1.1.2 <- -> 10.3.4.2 [10.1.1.1]
+BIMAP 10.1.1.1 <- -> 10.3.4.1 [10.1.1.2]
+BIMAP 10.1.1.0 <- -> 10.3.4.0 [10.1.1.2]
+
+Hostmap table:
+10.1.1.2,10.1.1.1 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.2 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.0,10.1.1.2 -> 10.3.4.1,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n11_6 b/contrib/netbsd-tests/ipf/expected/n11_6
new file mode 100644
index 0000000..f1c80de
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n11_6
@@ -0,0 +1,124 @@
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 1:0:0:0:0:6:7:8 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:3:4:5
+List of active MAP/Redirect filters:
+bimap zx0 inet6 10:1:1::1/128 -> 1::6:7:8/128
+
+List of active sessions:
+BIMAP 10:1:1::1 <- -> 1::6:7:8 [10:1:1::2]
+
+Hostmap table:
+10:1:1::1,10:1:1::2 -> 1::6:7:8,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:1:0:0:0:0:2
+16
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:1:1:0:0:0:0:0
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:0
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:3:4:5
+List of active MAP/Redirect filters:
+bimap zx0 inet6 10:1:1::/112 -> 10::2:2:2/128
+
+List of active sessions:
+BIMAP 10:1:1:: <- -> 10::2:2:2 [10::2:3:4]
+BIMAP 10:1:1::2 <- -> 10::2:2:2 [10:1:1::1]
+BIMAP 10:1:1:: <- -> 10::2:2:2 [10:1:1::2]
+
+Hostmap table:
+10:1:1::2,10:1:1::1 -> 10::2:2:2,any (use = 1)
+10:1:1::,10:1:1::2 -> 10::2:2:2,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:1 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:5
+List of active MAP/Redirect filters:
+bimap zx0 inet6 10:1:1::/112 -> 10::3:4:0/112
+
+List of active sessions:
+BIMAP 10:1:1::5 <- -> 10::3:4:5 [10:1:1::2]
+BIMAP 10:1:1::5 <- -> 10::3:4:5 [10:1:1::1]
+BIMAP 10:1:1::5 <- -> 10::3:4:5 [10:1:1::]
+BIMAP 10:1:1::2 <- -> 10::3:4:2 [10:1:1::1]
+BIMAP 10:1:1::1 <- -> 10::3:4:1 [10:1:1::2]
+BIMAP 10:1:1:: <- -> 10::3:4:0 [10:1:1::2]
+
+Hostmap table:
+10:1:1::2,10:1:1::1 -> 10::3:4:1,any (use = 1)
+10:1:1::1,10:1:1::2 -> 10::3:4:1,any (use = 1)
+10:1:1::,10:1:1::2 -> 10::3:4:1,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n12 b/contrib/netbsd-tests/ipf/expected/n12
new file mode 100644
index 0000000..56b3a78
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n12
@@ -0,0 +1,28 @@
+4510 0040 2020 4000 4006 9478 c0a8 01bc c0a8 0303 2710 0017 4e33 298e 0000 0000 b002 4000 6ff8 0000 0204 05b4 0101 0402 0103 0300 0101 080a 0c72 549e 0000 0000
+
+4500 003c 00b0 4000 fe06 7964 c0a8 0303 c0a8 7e53 0017 12c2 f674 e02c 4e33 298f a012 2798 7ace 0000 0101 080a 2c05 b797 0c72 549e 0103 0300 0204 05b4
+
+4510 0034 493b 4000 4006 6b69 c0a8 01bc c0a8 0303 2710 0017 4e33 298f f674 e02d 8010 4000 f673 0000 0101 080a 0c72 549e 2c05 b797
+
+List of active MAP/Redirect filters:
+map le0 192.168.126.0/24 -> 0/32 portmap tcp/udp 10000:20000 sequential
+
+List of active sessions:
+MAP 192.168.126.83 4802 <- -> 192.168.1.188 10000 [192.168.3.3 23]
+
+Hostmap table:
+192.168.126.83,192.168.3.3 -> 0.0.0.0,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n12_6 b/contrib/netbsd-tests/ipf/expected/n12_6
new file mode 100644
index 0000000..9ef040a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n12_6
@@ -0,0 +1,28 @@
+6000 0000 002c 0640 c0a8 0100 0000 0000 0000 0000 0000 00bc c0a8 0300 0000 0000 0000 0000 0000 0003 2710 0017 4e33 298e 0000 0000 b002 4000 6ff8 0000 0204 05b4 0101 0402 0103 0300 0101 080a 0c72 549e 0000 0000
+
+6000 0000 0028 06fe c0a8 0300 0000 0000 0000 0000 0000 0003 c0a8 7e00 0000 0000 0000 0000 0000 0053 0017 12c2 f674 e02c 4e33 298f a012 2798 7ace 0000 0101 080a 2c05 b797 0c72 549e 0103 0300 0204 05b4
+
+6000 0000 0020 0640 c0a8 0100 0000 0000 0000 0000 0000 00bc c0a8 0300 0000 0000 0000 0000 0000 0003 2710 0017 4e33 298f f674 e02d 8010 4000 f673 0000 0101 080a 0c72 549e 2c05 b797
+
+List of active MAP/Redirect filters:
+map le0 inet6 c0a8:7e00::/112 -> ::/128 portmap tcp/udp 10000:20000
+
+List of active sessions:
+MAP c0a8:7e00::53 4802 <- -> c0a8:100::bc 10000 [c0a8:300::3 23]
+
+Hostmap table:
+c0a8:7e00::53,c0a8:300::3 -> any,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n13 b/contrib/netbsd-tests/ipf/expected/n13
new file mode 100644
index 0000000..e6d26b2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n13
@@ -0,0 +1,32 @@
+> le0 ip #0 20(20) 0 203.1.1.23 > 150.1.1.1
+> le0 ip #0 20(20) 0 203.1.1.23 > 150.1.1.2
+> le0 ip #0 20(20) 0 203.1.1.24 > 150.1.1.2
+> le0 ip #0 20(20) 0 203.1.1.25 > 150.1.1.1
+List of active MAP/Redirect filters:
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45
+
+List of active sessions:
+MAP 192.168.1.3 <- -> 203.1.1.25 [150.1.1.1]
+MAP 192.168.1.2 <- -> 203.1.1.24 [150.1.1.2]
+MAP 192.168.1.1 <- -> 203.1.1.23 [150.1.1.2]
+MAP 192.168.1.1 <- -> 203.1.1.23 [150.1.1.1]
+
+Hostmap table:
+192.168.1.3,150.1.1.1 -> 203.1.1.25,0.0.0.0 (use = 1)
+192.168.1.2,150.1.1.2 -> 203.1.1.24,0.0.0.0 (use = 1)
+192.168.1.1,150.1.1.2 -> 203.1.1.23,0.0.0.0 (use = 1)
+192.168.1.1,150.1.1.1 -> 203.1.1.23,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n13_6 b/contrib/netbsd-tests/ipf/expected/n13_6
new file mode 100644
index 0000000..d3b5fe7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n13_6
@@ -0,0 +1,32 @@
+> le0 ip6/0 1 0 41 203:0:1:0:0:0:1:23 > 150.1.1.1
+> le0 ip6/0 1 0 41 203:0:1:0:0:0:1:23 > 150.1.1.2
+> le0 ip6/0 1 0 41 203:0:1:0:0:0:1:24 > 150.1.1.2
+> le0 ip6/0 1 0 41 203:0:1:0:0:0:1:25 > 150.1.1.1
+List of active MAP/Redirect filters:
+map le0 inet6 192:168:0::0/48 -> range 203:0:1::1:23-203:0:1::3:45
+
+List of active sessions:
+MAP 192.168.1.3 <- -> 203:0:1::1:25 [150.1.1.1]
+MAP 192.168.1.2 <- -> 203:0:1::1:24 [150.1.1.2]
+MAP 192.168.1.1 <- -> 203:0:1::1:23 [150.1.1.2]
+MAP 192.168.1.1 <- -> 203:0:1::1:23 [150.1.1.1]
+
+Hostmap table:
+192.168.1.3,150.1.1.1 -> 203:0:1:0:0:0:1:25,any (use = 1)
+192.168.1.2,150.1.1.2 -> 203:0:1:0:0:0:1:24,any (use = 1)
+192.168.1.1,150.1.1.2 -> 203:0:1:0:0:0:1:23,any (use = 1)
+192.168.1.1,150.1.1.1 -> 203:0:1:0:0:0:1:23,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n14 b/contrib/netbsd-tests/ipf/expected/n14
new file mode 100644
index 0000000..7b1a19e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n14
@@ -0,0 +1,30 @@
+< gre0 ip #0 40(20) 6 10.2.2.5,2000 > 10.1.1.254,80
+< gre0 ip #0 40(20) 6 10.2.2.6,2000 > 10.1.1.253,80
+< gre0 ip #0 40(20) 6 10.2.2.7,2000 > 10.1.1.254,80
+15
+List of active MAP/Redirect filters:
+rdr gre0 0/0 port 80 -> 10.1.1.254,10.1.1.253 port 80 tcp sticky
+
+List of active sessions:
+RDR 10.1.1.254 80 <- -> 203.1.1.1 80 [10.2.2.7 2000]
+RDR 10.1.1.253 80 <- -> 203.1.1.1 80 [10.2.2.6 2000]
+RDR 10.1.1.254 80 <- -> 203.1.1.1 80 [10.2.2.5 2000]
+
+Hostmap table:
+10.2.2.7,203.1.1.1 -> 254.1.1.10,0.0.0.0 (use = 1)
+10.2.2.6,203.1.1.1 -> 253.1.1.10,0.0.0.0 (use = 1)
+10.2.2.5,203.1.1.1 -> 254.1.1.10,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n14_6 b/contrib/netbsd-tests/ipf/expected/n14_6
new file mode 100644
index 0000000..b999ee97
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n14_6
@@ -0,0 +1,30 @@
+< gre0 ip6/0 20 0 6 10:0:0:0:0:2:2:5,2000 > 10:1:1:0:0:0:0:254,80
+< gre0 ip6/0 20 0 6 10:0:0:0:0:2:2:6,2000 > 10:1:1:0:0:0:0:253,80
+< gre0 ip6/0 20 0 6 10:0:0:0:0:2:2:7,2000 > 10:1:1:0:0:0:0:254,80
+< gre0 ip6/0 20 0 6 10:0:0:0:0:2:2:5,2001 > 203:0:1:0:0:0:1:1,80
+List of active MAP/Redirect filters:
+rdr gre0 inet6 any port 80 -> 10:1:1::254,10:1:1::253 port 80 tcp sticky
+
+List of active sessions:
+RDR 10:1:1::254 80 <- -> 203:0:1::1:1 80 [10::2:2:7 2000]
+RDR 10:1:1::253 80 <- -> 203:0:1::1:1 80 [10::2:2:6 2000]
+RDR 10:1:1::254 80 <- -> 203:0:1::1:1 80 [10::2:2:5 2000]
+
+Hostmap table:
+10::2:2:7,203:0:1:0:0:0:1:1 -> 254:1:1::10,any (use = 1)
+10::2:2:6,203:0:1:0:0:0:1:1 -> 253:0:1:0:0:0:1:10,any (use = 1)
+10::2:2:5,203:0:1:0:0:0:1:1 -> 254:1:1::10,any (use = 3)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n15 b/contrib/netbsd-tests/ipf/expected/n15
new file mode 100644
index 0000000..3889f82
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n15
@@ -0,0 +1,47 @@
+< le0 ip #0 40(20) 6 9.9.9.9,10011 > 3.3.3.3,80
+15
+List of active MAP/Redirect filters:
+rdr le0 0/0 port 80 -> 3.3.3.3/32 port 80 tcp
+
+List of active sessions:
+RDR 3.3.3.3 80 <- -> 5.5.5.5 80 [9.9.9.9 10011]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< le0 ip #0 40(20) 6 9.9.9.9,10011 > 3.3.3.3,80
+< le0 ip #0 40(20) 6 9.9.9.9,10011 > 3.3.3.3,81
+List of active MAP/Redirect filters:
+rdr le0 0/0 port 80 -> 3.3.3.3/32 port 80-88 tcp
+
+List of active sessions:
+RDR 3.3.3.3 81 <- -> 2.2.2.2 80 [9.9.9.9 10011]
+RDR 3.3.3.3 80 <- -> 5.5.5.5 80 [9.9.9.9 10011]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n15_6 b/contrib/netbsd-tests/ipf/expected/n15_6
new file mode 100644
index 0000000..f01b72b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n15_6
@@ -0,0 +1,47 @@
+< le0 ip6/0 20 0 6 9:9:9:0:0:0:0:9,10011 > 3:0:3:0:0:0:3:3,80
+16
+List of active MAP/Redirect filters:
+rdr le0 inet6 any port 80 -> 3:0:3::3:3/128 port 80 tcp
+
+List of active sessions:
+RDR 3:0:3::3:3 80 <- -> 5:5::5:5 80 [9:9:9::9 10011]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< le0 ip6/0 20 0 6 9:9:9:0:0:0:0:9,10011 > 3:0:3:0:0:0:3:3,80
+< le0 ip6/0 20 0 6 9:9:9:0:0:0:0:9,10011 > 3:0:3:0:0:0:3:3,81
+List of active MAP/Redirect filters:
+rdr le0 inet6 any port 80 -> 3:0:3::3:3/128 port 80-88 tcp
+
+List of active sessions:
+RDR 3:0:3::3:3 81 <- -> 2::2:2:2 80 [9:9:9::9 10011]
+RDR 3:0:3::3:3 80 <- -> 5:5::5:5 80 [9:9:9::9 10011]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n16 b/contrib/netbsd-tests/ipf/expected/n16
new file mode 100644
index 0000000..0eb3954
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n16
@@ -0,0 +1,29 @@
+4520 0068 17e4 0000 6b11 cbba c05b ac33 ac1f 5318 1194 07dd 0054 0000 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+
+4520 0068 17e4 0000 6a11 ccba c05b ac33 ac1f 5318 1194 07dd 0054 0000 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+
+4500 0084 ee0f 0000 8001 e0a2 ac1f 5318 c05b ac33 0303 4ca1 0000 0000 4520 0068 17e4 0000 6a11 ccba c05b ac33 ac1f 5318 1194 07dd 0054 0000 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+
+4500 0084 ee0f 0000 8001 4a21 45f8 4fc1 c05b ac33 0303 bf85 0000 0000 4520 0068 17e4 0000 6a11 3639 c05b ac33 45f8 4fc1 1194 94f8 0054 0000 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+
+List of active MAP/Redirect filters:
+rdr vlan0 from 0/0 to 69.248.79.193/32 port = 38136 -> 172.31.83.24/32 port 2013 udp
+
+List of active sessions:
+RDR 172.31.83.24 2013 <- -> 69.248.79.193 38136 [192.91.172.51 4500]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n17 b/contrib/netbsd-tests/ipf/expected/n17
new file mode 100644
index 0000000..f336bb0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n17
@@ -0,0 +1,24 @@
+4500 00a0 0000 0100 3f06 7555 0101 0101 0201 0101 0401 0019 0000 0000 0000 0000 5010 2000 86b7 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00a0 0000 0100 3f06 7553 0201 0101 0101 0103 0401 0019 0000 0000 0000 0000 5010 2000 86b7 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+List of active MAP/Redirect filters:
+bimap zx0 0/0 -> 1.1.1.3/32
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n18 b/contrib/netbsd-tests/ipf/expected/n18
new file mode 100644
index 0000000..c51c11c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n18
@@ -0,0 +1,111 @@
+> z0 ip #0 40(20) 6 1.1.1.1,1 > 3.3.3.3,30
+> z0 ip #0 40(20) 6 1.1.1.1,2 > 3.3.3.3,31
+> z0 ip #0 40(20) 6 1.1.1.1,3 > 3.3.3.3,32
+> z0 ip #0 40(20) 6 1.1.1.1,4 > 3.3.3.3,33
+> z0 ip #0 40(20) 6 1.1.1.1,1 > 3.3.3.3,34
+> z0 ip #0 40(20) 6 1.1.1.1,2 > 3.3.3.3,35
+> z0 ip #0 40(20) 6 1.1.1.1,3 > 3.3.3.3,36
+> z0 ip #0 40(20) 6 1.1.1.1,4 > 3.3.3.3,37
+List of active MAP/Redirect filters:
+map z0 0/0 -> 1.1.1.1/32 portmap tcp/udp 1:4 sequential
+
+List of active sessions:
+MAP 2.2.2.2 29 <- -> 1.1.1.1 4 [3.3.3.3 37]
+MAP 2.2.2.2 28 <- -> 1.1.1.1 3 [3.3.3.3 36]
+MAP 2.2.2.2 27 <- -> 1.1.1.1 2 [3.3.3.3 35]
+MAP 2.2.2.2 26 <- -> 1.1.1.1 1 [3.3.3.3 34]
+MAP 2.2.2.2 25 <- -> 1.1.1.1 4 [3.3.3.3 33]
+MAP 2.2.2.2 24 <- -> 1.1.1.1 3 [3.3.3.3 32]
+MAP 2.2.2.2 23 <- -> 1.1.1.1 2 [3.3.3.3 31]
+MAP 2.2.2.2 22 <- -> 1.1.1.1 1 [3.3.3.3 30]
+
+Hostmap table:
+2.2.2.2,3.3.3.3 -> 1.1.1.1,0.0.0.0 (use = 8)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> z0 ip #0 40(20) 6 1.1.1.1,1000 > 3.3.3.3,30
+> z0 ip #0 40(20) 6 1.1.1.1,1001 > 3.3.3.3,31
+> z0 ip #0 40(20) 6 1.1.1.1,1002 > 3.3.3.3,32
+> z0 ip #0 40(20) 6 1.1.1.1,1003 > 3.3.3.3,33
+> z0 ip #0 40(20) 6 1.1.1.1,1004 > 3.3.3.3,34
+> z0 ip #0 40(20) 6 1.1.1.1,1005 > 3.3.3.3,35
+> z0 ip #0 40(20) 6 1.1.1.1,1006 > 3.3.3.3,36
+> z0 ip #0 40(20) 6 1.1.1.1,1007 > 3.3.3.3,37
+List of active MAP/Redirect filters:
+map z0 0/0 -> 1.1.1.1/32 portmap tcp/udp 1000:5000 sequential
+
+List of active sessions:
+MAP 2.2.2.2 29 <- -> 1.1.1.1 1007 [3.3.3.3 37]
+MAP 2.2.2.2 28 <- -> 1.1.1.1 1006 [3.3.3.3 36]
+MAP 2.2.2.2 27 <- -> 1.1.1.1 1005 [3.3.3.3 35]
+MAP 2.2.2.2 26 <- -> 1.1.1.1 1004 [3.3.3.3 34]
+MAP 2.2.2.2 25 <- -> 1.1.1.1 1003 [3.3.3.3 33]
+MAP 2.2.2.2 24 <- -> 1.1.1.1 1002 [3.3.3.3 32]
+MAP 2.2.2.2 23 <- -> 1.1.1.1 1001 [3.3.3.3 31]
+MAP 2.2.2.2 22 <- -> 1.1.1.1 1000 [3.3.3.3 30]
+
+Hostmap table:
+2.2.2.2,3.3.3.3 -> 1.1.1.1,0.0.0.0 (use = 8)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> z0 ip #0 40(20) 6 1.1.1.1,1000 > 3.3.3.3,30
+> z0 ip #0 40(20) 6 1.1.1.1,1001 > 3.3.3.3,31
+> z0 ip #0 40(20) 6 1.1.1.1,1002 > 3.3.3.3,32
+> z0 ip #0 40(20) 6 1.1.1.1,1003 > 3.3.3.3,33
+> z0 ip #0 40(20) 6 1.1.1.1,1004 > 3.3.3.3,34
+> z0 ip #0 40(20) 6 1.1.1.1,1005 > 3.3.3.3,35
+> z0 ip #0 40(20) 6 1.1.1.1,1006 > 3.3.3.3,36
+> z0 ip #0 40(20) 6 1.1.1.1,1007 > 3.3.3.3,37
+List of active MAP/Redirect filters:
+map z0 0/0 -> 1.1.1.1/32 portmap tcp/udp 1000:50000 sequential
+
+List of active sessions:
+MAP 2.2.2.2 29 <- -> 1.1.1.1 1007 [3.3.3.3 37]
+MAP 2.2.2.2 28 <- -> 1.1.1.1 1006 [3.3.3.3 36]
+MAP 2.2.2.2 27 <- -> 1.1.1.1 1005 [3.3.3.3 35]
+MAP 2.2.2.2 26 <- -> 1.1.1.1 1004 [3.3.3.3 34]
+MAP 2.2.2.2 25 <- -> 1.1.1.1 1003 [3.3.3.3 33]
+MAP 2.2.2.2 24 <- -> 1.1.1.1 1002 [3.3.3.3 32]
+MAP 2.2.2.2 23 <- -> 1.1.1.1 1001 [3.3.3.3 31]
+MAP 2.2.2.2 22 <- -> 1.1.1.1 1000 [3.3.3.3 30]
+
+Hostmap table:
+2.2.2.2,3.3.3.3 -> 1.1.1.1,0.0.0.0 (use = 8)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n1_6 b/contrib/netbsd-tests/ipf/expected/n1_6
new file mode 100644
index 0000000..347bf4a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n1_6
@@ -0,0 +1,197 @@
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx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> 10:0:0:0:0:3:4:5
+> zx0 ip6/0 1 0 34 10:1:1:0:0:0:0:2 > 10:4:3:0:0:0:0:2
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:4
+> zx0 ip6/0 1 0 34 10:1:1:0:0:0:0:2 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:5
+> zx0 ip6/0 1 0 34 10:1:1:0:0:0:0:3 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:6
+> zx0 ip6/0 1 0 35 10:1:1:0:0:0:0:3 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 35 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:7
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::1/128 -> 10::2:2:2/128
+
+List of active sessions:
+MAP 10:1:1::1 <- -> 10::2:2:2 [10:4:3::2]
+MAP 10:1:1::1 <- -> 10::2:2:2 [10:1:1::2]
+
+Hostmap table:
+10:1:1::1,10:4:3::2 -> 10::2:2:2,any (use = 1)
+10:1:1::1,10:1:1::2 -> 10::2:2:2,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:5 > 10:1:1:0:0:0:0:2
+16
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:5 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:0
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+> zx0 ip6/0 88 0 58 10:0:0:0:0:3:4:5 > 10:4:3:0:0:0:0:2
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:1
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:2
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:3
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:4
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 1 0 34 10:0:0:0:0:3:4:5 > 10:4:3:0:0:0:0:2
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:4
+> zx0 ip6/0 1 0 34 10:0:0:0:0:3:4:5 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:4 > 10:1:1:0:0:0:0:2
+16
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:6
+> zx0 ip6/0 1 0 35 10:0:0:0:0:3:4:5 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 35 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:7
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::/112 -> 10::3:4:5/128
+
+List of active sessions:
+MAP 10:1:1::3 <- -> 10::3:4:5 [10:4:3::4]
+MAP 10:1:1::2 <- -> 10::3:4:5 [10:4:3::4]
+MAP 10:1:1::2 <- -> 10::3:4:5 [10:4:3::2]
+MAP 10:1:1::1 <- -> 10::3:4:5 [10:4:3::2]
+MAP 10:1:1::2 1026 <- -> 10::3:4:5 1026 [10:1:1::1 1025]
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 1025 [10:1:1::1 1025]
+MAP 10:1:1::2 <- -> 10::3:4:5 [10:1:1::1]
+MAP 10:1:1:: <- -> 10::3:4:5 [10:1:1::2]
+
+Hostmap table:
+10:1:1::3,10:4:3::4 -> 10::3:4:5,any (use = 1)
+10:1:1::2,10:4:3::4 -> 10::3:4:5,any (use = 1)
+10:1:1::2,10:4:3::2 -> 10::3:4:5,any (use = 1)
+10:1:1::1,10:4:3::2 -> 10::3:4:5,any (use = 1)
+10:1:1::2,10:1:1::1 -> 10::3:4:5,any (use = 3)
+10:1:1::,10:1:1::2 -> 10::3:4:5,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:1 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:2 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:3 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:3,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:3,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,1025
+> zx0 ip6/0 88 0 58 10:0:0:0:0:3:4:3 > 10:4:3:0:0:0:0:2
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:1
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:2
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:4
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:5
+> zx0 ip6/0 1 0 34 10:0:0:0:0:3:4:3 > 10:4:3:0:0:0:0:2
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:4
+> zx0 ip6/0 1 0 34 10:0:0:0:0:3:4:3 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:5
+> zx0 ip6/0 1 0 34 10:0:0:0:0:3:4:4 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:6
+> zx0 ip6/0 1 0 35 10:0:0:0:0:3:4:4 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 35 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:7
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::/112 -> 10::3:4:0/112
+
+List of active sessions:
+MAP 10:1:1::3 <- -> 10::3:4:4 [10:4:3::4]
+MAP 10:1:1::3 <- -> 10::3:4:4 [10:4:3::4]
+MAP 10:1:1::2 <- -> 10::3:4:3 [10:4:3::4]
+MAP 10:1:1::2 <- -> 10::3:4:3 [10:4:3::2]
+MAP 10:1:1::1 <- -> 10::3:4:3 [10:4:3::2]
+MAP 10:1:1::2 1026 <- -> 10::3:4:3 1026 [10:1:1::1 1025]
+MAP 10:1:1::2 1025 <- -> 10::3:4:3 1025 [10:1:1::1 1025]
+MAP 10:1:1::2 <- -> 10::3:4:3 [10:1:1::1]
+MAP 10:1:1::1 <- -> 10::3:4:2 [10:1:1::2]
+MAP 10:1:1:: <- -> 10::3:4:1 [10:1:1::2]
+
+Hostmap table:
+10:1:1::3,10:4:3::4 -> 10::3:4:4,any (use = 2)
+10:1:1::2,10:4:3::4 -> 10::3:4:3,any (use = 1)
+10:1:1::2,10:4:3::2 -> 10::3:4:3,any (use = 1)
+10:1:1::1,10:4:3::2 -> 10::3:4:3,any (use = 1)
+10:1:1::2,10:1:1::1 -> 10::3:4:3,any (use = 3)
+10:1:1::1,10:1:1::2 -> 10::3:4:2,any (use = 1)
+10:1:1::,10:1:1::2 -> 10::3:4:1,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n2 b/contrib/netbsd-tests/ipf/expected/n2
new file mode 100644
index 0000000..836608a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n2
@@ -0,0 +1,191 @@
+> zx0 ip #0 40(20) 6 10.2.2.2,10000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.2.2.2,10001 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 10.1.1.1/32 -> 10.2.2.2/32 portmap tcp 10000:20000 sequential
+
+List of active sessions:
+MAP 10.1.1.1 1025 <- -> 10.2.2.2 10001 [10.1.1.2 1025]
+MAP 10.1.1.1 1025 <- -> 10.2.2.2 10000 [10.1.1.1 1025]
+
+Hostmap table:
+10.1.1.1,10.1.1.2 -> 10.2.2.2,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.1 -> 10.2.2.2,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.3.4.5,10000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap udp 10000:20000 sequential
+
+List of active sessions:
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 10000 [10.1.1.1 1025]
+
+Hostmap table:
+10.1.1.2,10.1.1.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10001 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10003 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.3.4.1,10004 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10005 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.3.4.1,10006 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.3.4.1,10007 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.3.4.1,10008 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 10.1.0.0/16 -> 10.3.4.0/24 portmap tcp/udp 10000:20000 sequential
+
+List of active sessions:
+MAP 10.1.1.3 2003 <- -> 10.3.4.1 10008 [10.1.4.1 80]
+MAP 10.1.1.3 2002 <- -> 10.3.4.1 10007 [10.1.4.1 80]
+MAP 10.1.1.3 2001 <- -> 10.3.4.1 10006 [10.1.3.1 80]
+MAP 10.1.1.3 2000 <- -> 10.3.4.1 10005 [10.1.2.1 80]
+MAP 10.1.1.2 1025 <- -> 10.3.4.1 10004 [10.1.1.1 1025]
+MAP 10.1.1.2 1026 <- -> 10.3.4.1 10003 [10.1.1.1 1025]
+MAP 10.1.1.2 1025 <- -> 10.3.4.1 10002 [10.1.1.1 1025]
+MAP 10.1.1.1 1025 <- -> 10.3.4.1 10001 [10.1.1.2 1025]
+MAP 10.1.1.1 1025 <- -> 10.3.4.1 10000 [10.1.1.1 1025]
+
+Hostmap table:
+10.1.1.3,10.1.4.1 -> 10.3.4.1,0.0.0.0 (use = 2)
+10.1.1.3,10.1.3.1 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.3,10.1.2.1 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.2,10.1.1.1 -> 10.3.4.1,0.0.0.0 (use = 3)
+10.1.1.1,10.1.1.2 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.1 -> 10.3.4.1,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025
+15
+> zx0 ip #0 28(20) 17 10.3.4.5,40000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.1.1.3,2000
+List of active MAP/Redirect filters:
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap tcp/udp 40000:40001 sequential
+
+List of active sessions:
+MAP 10.1.1.3 2003 <- -> 10.3.4.5 40000 [10.1.4.1 80]
+MAP 10.1.1.3 2002 <- -> 10.3.4.5 40001 [10.1.4.1 80]
+MAP 10.1.1.3 2001 <- -> 10.3.4.5 40000 [10.1.3.1 80]
+MAP 10.1.1.3 2000 <- -> 10.3.4.5 40001 [10.1.2.1 80]
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 40000 [10.1.1.1 1025]
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 40001 [10.1.1.1 1025]
+MAP 10.1.1.1 1025 <- -> 10.3.4.5 40001 [10.1.1.2 1025]
+MAP 10.1.1.1 1025 <- -> 10.3.4.5 40000 [10.1.1.1 1025]
+
+Hostmap table:
+10.1.1.3,10.1.4.1 -> 10.3.4.5,0.0.0.0 (use = 2)
+10.1.1.3,10.1.3.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.3,10.1.2.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.2,10.1.1.1 -> 10.3.4.5,0.0.0.0 (use = 2)
+10.1.1.1,10.1.1.2 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n200 b/contrib/netbsd-tests/ipf/expected/n200
new file mode 100644
index 0000000..0f3c6a5
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n200
@@ -0,0 +1,25 @@
+4500 0044 0000 0000 ff11 bda6 7f00 0001 7f00 0001 2775 2775 0030 0000 4500 0028 0000 0000 0006 435a 6363 6363 5858 5858 038d 0050 0000 0000 0000 0000 5000 1000 2491 0000
+
+4500 0028 0000 0000 0006 435a 6363 6363 5858 5858 038d 0050 0000 0000 0000 0000 5000 1000 2491 0000
+
+List of active MAP/Redirect filters:
+divert in on bar0 proto tcp from 0/0 to 0/0 -> src 127.0.0.1/32,10101 dst 127.0.0.1/32,10101 udp;
+
+List of active sessions:
+DIV-RDR 127.0.0.1 10101 <- -> 88.88.88.88 80 [99.99.99.99 909]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n2_6 b/contrib/netbsd-tests/ipf/expected/n2_6
new file mode 100644
index 0000000..08abc8f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n2_6
@@ -0,0 +1,191 @@
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,10000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,10001 > 10:1:1:0:0:0:0:2,1025
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2000 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2001 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2002 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2003 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::1/128 -> 10::2:2:2/128 portmap tcp 10000:20000 sequential
+
+List of active sessions:
+MAP 10:1:1::1 1025 <- -> 10::2:2:2 10001 [10:1:1::2 1025]
+MAP 10:1:1::1 1025 <- -> 10::2:2:2 10000 [10:1:1::1 1025]
+
+Hostmap table:
+10:1:1::1,10:1:1::2 -> 10::2:2:2,any (use = 1)
+10:1:1::1,10:1:1::1 -> 10::2:2:2,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:5,10000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2000 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2001 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2002 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2003 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::/112 -> 10::3:4:5/128 portmap udp 10000:20000 sequential
+
+List of active sessions:
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 10000 [10:1:1::1 1025]
+
+Hostmap table:
+10:1:1::2,10:1:1::1 -> 10::3:4:5,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10001 > 10:1:1:0:0:0:0:2,1025
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10002 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10002 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10003 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:1,10004 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10005 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10006 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10007 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10008 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1::/32 -> 10::3:4:0/112 portmap tcp/udp 10000:20000 sequential
+
+List of active sessions:
+MAP 10:1:1::3 2003 <- -> 10::3:4:1 10008 [10:1:4::1 80]
+MAP 10:1:1::3 2002 <- -> 10::3:4:1 10007 [10:1:4::1 80]
+MAP 10:1:1::3 2001 <- -> 10::3:4:1 10006 [10:1:3::1 80]
+MAP 10:1:1::3 2000 <- -> 10::3:4:1 10005 [10:1:2::1 80]
+MAP 10:1:1::2 1025 <- -> 10::3:4:1 10004 [10:1:1::1 1025]
+MAP 10:1:1::2 1026 <- -> 10::3:4:1 10003 [10:1:1::1 1025]
+MAP 10:1:1::2 1025 <- -> 10::3:4:1 10002 [10:1:1::1 1025]
+MAP 10:1:1::1 1025 <- -> 10::3:4:1 10001 [10:1:1::2 1025]
+MAP 10:1:1::1 1025 <- -> 10::3:4:1 10000 [10:1:1::1 1025]
+
+Hostmap table:
+10:1:1::3,10:1:4::1 -> 10::3:4:1,any (use = 2)
+10:1:1::3,10:1:3::1 -> 10::3:4:1,any (use = 1)
+10:1:1::3,10:1:2::1 -> 10::3:4:1,any (use = 1)
+10:1:1::2,10:1:1::1 -> 10::3:4:1,any (use = 3)
+10:1:1::1,10:1:1::2 -> 10::3:4:1,any (use = 1)
+10:1:1::1,10:1:1::1 -> 10::3:4:1,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:1:0:0:0:0:2,1025
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:1:0:0:0:0:1,1025
+16
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:5,40000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40000 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40000 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:1,1025
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:1:1:0:0:0:0:3,2000
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::/112 -> 10::3:4:5/128 portmap tcp/udp 40000:40001 sequential
+
+List of active sessions:
+MAP 10:1:1::3 2003 <- -> 10::3:4:5 40000 [10:1:4::1 80]
+MAP 10:1:1::3 2002 <- -> 10::3:4:5 40001 [10:1:4::1 80]
+MAP 10:1:1::3 2001 <- -> 10::3:4:5 40000 [10:1:3::1 80]
+MAP 10:1:1::3 2000 <- -> 10::3:4:5 40001 [10:1:2::1 80]
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 40000 [10:1:1::1 1025]
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 40001 [10:1:1::1 1025]
+MAP 10:1:1::1 1025 <- -> 10::3:4:5 40001 [10:1:1::2 1025]
+MAP 10:1:1::1 1025 <- -> 10::3:4:5 40000 [10:1:1::1 1025]
+
+Hostmap table:
+10:1:1::3,10:1:4::1 -> 10::3:4:5,any (use = 2)
+10:1:1::3,10:1:3::1 -> 10::3:4:5,any (use = 1)
+10:1:1::3,10:1:2::1 -> 10::3:4:5,any (use = 1)
+10:1:1::2,10:1:1::1 -> 10::3:4:5,any (use = 2)
+10:1:1::1,10:1:1::2 -> 10::3:4:5,any (use = 1)
+10:1:1::1,10:1:1::1 -> 10::3:4:5,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n3 b/contrib/netbsd-tests/ipf/expected/n3
new file mode 100644
index 0000000..66ada76
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n3
@@ -0,0 +1,66 @@
+> zz0 ip #0 40(20) 6 192.168.2.1,1488 > 203.1.1.1,80
+> zz0 ip #0 40(20) 6 192.168.2.1,1276 > 203.1.1.1,80
+> zz0 ip #0 40(20) 6 192.168.2.1,1032 > 203.1.1.1,80
+> zz0 ip #0 28(20) 17 192.168.2.1,1032 > 203.1.1.1,80
+> zz0 ip #0 40(20) 6 192.168.2.1,65299 > 203.1.1.1,80
+List of active MAP/Redirect filters:
+map zz0 10.1.0.0/16 -> 192.168.2.0/24 portmap tcp/udp auto
+
+List of active sessions:
+MAP 10.1.255.255 65535 <- -> 192.168.2.1 65299 [203.1.1.1 80]
+MAP 10.1.0.0 32768 <- -> 192.168.2.1 1032 [203.1.1.1 80]
+MAP 10.1.0.0 32768 <- -> 192.168.2.1 1032 [203.1.1.1 80]
+MAP 10.1.1.1 252 <- -> 192.168.2.1 1276 [203.1.1.1 80]
+MAP 10.1.1.1 5000 <- -> 192.168.2.1 1488 [203.1.1.1 80]
+
+Hostmap table:
+10.1.255.255,203.1.1.1 -> 192.168.2.1,0.0.0.0 (use = 1)
+10.1.0.0,203.1.1.1 -> 192.168.2.1,0.0.0.0 (use = 2)
+10.1.1.1,203.1.1.1 -> 192.168.2.1,0.0.0.0 (use = 2)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zz0 ip #0 40(20) 6 192.168.1.1,1488 > 203.1.1.1,80
+> zz0 ip #0 40(20) 6 192.168.1.1,1276 > 203.1.1.1,80
+> zz0 ip #0 40(20) 6 192.168.1.0,1032 > 203.1.1.1,80
+> zz0 ip #0 28(20) 17 192.168.1.0,1032 > 203.1.1.1,80
+> zz0 ip #0 40(20) 6 192.168.1.255,65299 > 203.1.1.1,80
+List of active MAP/Redirect filters:
+map-block zz0 10.1.0.0/16 -> 192.168.1.0/24 ports 252
+
+List of active sessions:
+MAP-BLOCK 10.1.255.255 65535 <- -> 192.168.1.255 65299 [203.1.1.1 80]
+MAP-BLOCK 10.1.0.0 32768 <- -> 192.168.1.0 1032 [203.1.1.1 80]
+MAP-BLOCK 10.1.0.0 32768 <- -> 192.168.1.0 1032 [203.1.1.1 80]
+MAP-BLOCK 10.1.1.1 252 <- -> 192.168.1.1 1276 [203.1.1.1 80]
+MAP-BLOCK 10.1.1.1 5000 <- -> 192.168.1.1 1488 [203.1.1.1 80]
+
+Hostmap table:
+10.1.255.255,203.1.1.1 -> 192.168.1.1,0.0.0.0 (use = 1)
+10.1.0.0,203.1.1.1 -> 192.168.1.1,0.0.0.0 (use = 2)
+10.1.1.1,203.1.1.1 -> 192.168.1.1,0.0.0.0 (use = 2)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n4 b/contrib/netbsd-tests/ipf/expected/n4
new file mode 100644
index 0000000..746ef7e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n4
@@ -0,0 +1,190 @@
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+> zx0 ip #0 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+> zx0 ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23
+> zx0 ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+> zx0 ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+> zx0 ip #0 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.1/32 port 23 -> 10.2.2.1/32 port 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.3.3.3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+> zx0 ip #0 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+> zx0 ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23
+> zx0 ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+> zx0 ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+> zx0 ip #0 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.0/24 port 23 -> 10.2.2.1/32 port 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.3.3.3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+> zx0 ip #0 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+> zx0 ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12346 > 10.2.2.1,10023
+> zx0 ip #0 40(20) 6 10.1.0.0,23 > 10.3.3.3,12346
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+> zx0 ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+> zx0 ip #0 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345
+List of active MAP/Redirect filters:
+rdr zx0 0/0 port 23 -> 10.2.2.1/32 port 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10023 <- -> 10.1.0.0 23 [10.3.3.3 12346]
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.3.3.3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23
+> zx0 ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+> zx0 ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23
+> zx0 ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.2.2.1,10053
+> zx0 ip #0 28(20) 17 10.1.1.0,53 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+> zx0 ip #0 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.0/24 port 53 -> 10.2.2.1/32 port 10053 udp
+
+List of active sessions:
+RDR 10.2.2.1 10053 <- -> 10.1.1.0 53 [10.3.3.3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,23
+> zx0 ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53
+> zx0 ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23
+> zx0 ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+> zx0 ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345
+15
+> zx0 ip #0 40(20) 6 10.1.1.1,53 > 10.3.3.3,12345
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.0/24 port 0 -> 10.2.2.1/32 port 0 tcp
+
+List of active sessions:
+RDR 10.2.2.1 53 <- -> 10.1.1.1 53 [10.3.3.3 12345]
+RDR 10.2.2.1 23 <- -> 10.1.1.1 23 [10.3.3.3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,23
+> zx0 ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53
+> zx0 ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345
+< zx0 ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23
+> zx0 ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.2.2.1,53
+> zx0 ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345
+15
+> zx0 ip #0 40(20) 6 10.1.1.1,53 > 10.3.3.3,12345
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.0/24 -> 10.2.2.1/32 ip
+
+List of active sessions:
+RDR 10.2.2.1 53 <- -> 10.1.1.0 53 [10.3.3.3 12345]
+RDR 10.2.2.1 53 <- -> 10.1.1.1 53 [10.3.3.3 12345]
+RDR 10.2.2.1 23 <- -> 10.1.1.1 23 [10.3.3.3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n4_6 b/contrib/netbsd-tests/ipf/expected/n4_6
new file mode 100644
index 0000000..e9a5ce3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n4_6
@@ -0,0 +1,190 @@
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,10023
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,23 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12346 > 10:1:0:0:0:0:0:0,23
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10023 > 10:3:3:0:0:0:0:3,12346
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+> zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,53 > 10:3:3:0:0:0:0:3,12345
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::1/128 port 23 -> 10::2:2:1/128 port 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10:3:3::3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,10023
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,23 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12346 > 10:1:0:0:0:0:0:0,23
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10023 > 10:3:3:0:0:0:0:3,12346
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+> zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,53 > 10:3:3:0:0:0:0:3,12345
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::/112 port 23 -> 10::2:2:1/128 port 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10:3:3::3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,10023
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,23 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12346 > 10:0:0:0:0:2:2:1,10023
+> zx0 ip6/0 20 0 6 10:1:0:0:0:0:0:0,23 > 10:3:3:0:0:0:0:3,12346
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+> zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,53 > 10:3:3:0:0:0:0:3,12345
+List of active MAP/Redirect filters:
+rdr zx0 inet6 any port 23 -> 10::2:2:1/128 port 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10023 <- -> 10:1:: 23 [10:3:3::3 12346]
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10:3:3::3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,23
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10023 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12346 > 10:1:0:0:0:0:0:0,23
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10023 > 10:3:3:0:0:0:0:3,12346
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,10053
+> zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:0,53 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,53 > 10:3:3:0:0:0:0:3,12345
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::/112 port 53 -> 10::2:2:1/128 port 10053 udp
+
+List of active sessions:
+RDR 10::2:2:1 10053 <- -> 10:1:1:: 53 [10:3:3::3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,23
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10023 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12346 > 10:1:0:0:0:0:0:0,23
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10023 > 10:3:3:0:0:0:0:3,12346
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+> zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+16
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,53 > 10:3:3:0:0:0:0:3,12345
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::/112 port 0 -> 10::2:2:1/128 port 0 tcp
+
+List of active sessions:
+RDR 10::2:2:1 53 <- -> 10:1:1::1 53 [10:3:3::3 12345]
+RDR 10::2:2:1 23 <- -> 10:1:1::1 23 [10:3:3::3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,23
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10023 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,53
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12346 > 10:1:0:0:0:0:0:0,23
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:1,10023 > 10:3:3:0:0:0:0:3,12346
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,53
+> zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:1,10053 > 10:3:3:0:0:0:0:3,12345
+16
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,53 > 10:3:3:0:0:0:0:3,12345
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::/112 -> 10::2:2:1/128 ip
+
+List of active sessions:
+RDR 10::2:2:1 53 <- -> 10:1:1:: 53 [10:3:3::3 12345]
+RDR 10::2:2:1 53 <- -> 10:1:1::1 53 [10:3:3::3 12345]
+RDR 10::2:2:1 23 <- -> 10:1:1::1 23 [10:3:3::3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n5 b/contrib/netbsd-tests/ipf/expected/n5
new file mode 100644
index 0000000..423bf48
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n5
@@ -0,0 +1,533 @@
+> zx0 ip #0 20(20) 255 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+> zx0 ip #0 48(20) 1 10.2.2.2 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.1.1.1
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.3
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+> zx0 ip #0 40(20) 6 10.2.2.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.2.2.2,1025 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.2.2.2 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.2.2.2,1026 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+> zx0 ip #0 40(20) 6 10.2.2.2,1025 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+> zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+> zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 10.1.1.1/32 -> 10.2.2.2/32
+
+List of active sessions:
+MAP 10.1.1.1 1025 <- -> 10.2.2.2 1025 [10.3.4.5 40000]
+MAP 10.1.1.1 1026 <- -> 10.2.2.2 1026 [10.3.4.5 40000]
+MAP 10.1.1.1 <- -> 10.2.2.2 [10.1.2.1]
+MAP 10.1.1.1 1025 <- -> 10.2.2.2 1025 [10.1.1.2 1025]
+MAP 10.1.1.1 1025 <- -> 10.2.2.2 1025 [10.1.1.1 1025]
+MAP 10.1.1.1 <- -> 10.2.2.2 [10.4.3.2]
+MAP 10.1.1.1 <- -> 10.2.2.2 [10.1.1.2]
+
+Hostmap table:
+10.1.1.1,10.3.4.5 -> 10.2.2.2,0.0.0.0 (use = 2)
+10.1.1.1,10.1.2.1 -> 10.2.2.2,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.1 -> 10.2.2.2,0.0.0.0 (use = 1)
+10.1.1.1,10.4.3.2 -> 10.2.2.2,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.2 -> 10.2.2.2,0.0.0.0 (use = 2)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.3.4.5 > 10.1.1.2
+15
+> zx0 ip #0 20(20) 255 10.3.4.5 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.0
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+> zx0 ip #0 48(20) 1 10.1.1.1 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.2.2.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.3
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+15
+> zx0 ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.3.4.5 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.3.4.5 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.3.4.5,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,2000 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,2001 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,2002 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,2003 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+> zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+> zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+> zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 from 10.1.1.0/24 to 10.1.0.0/16 -> 10.3.4.5/32
+
+List of active sessions:
+MAP 10.1.1.3 2003 <- -> 10.3.4.5 2003 [10.1.4.1 80]
+MAP 10.1.1.3 2002 <- -> 10.3.4.5 2002 [10.1.4.1 80]
+MAP 10.1.1.3 2001 <- -> 10.3.4.5 2001 [10.1.3.1 80]
+MAP 10.1.1.3 2000 <- -> 10.3.4.5 2000 [10.1.2.1 80]
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 1025 [10.1.1.1 1025]
+MAP 10.1.1.1 <- -> 10.3.4.5 [10.1.2.1]
+MAP 10.1.1.0 <- -> 10.3.4.5 [10.1.1.2]
+MAP 10.1.1.1 1025 <- -> 10.3.4.5 1025 [10.1.1.2 1025]
+MAP 10.1.1.2 1026 <- -> 10.3.4.5 1026 [10.1.1.1 1025]
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 1025 [10.1.1.1 1025]
+MAP 10.1.1.2 <- -> 10.3.4.5 [10.1.1.1]
+MAP 10.1.1.0 <- -> 10.3.4.5 [10.1.1.2]
+
+Hostmap table:
+10.1.1.3,10.1.4.1 -> 10.3.4.5,0.0.0.0 (use = 2)
+10.1.1.3,10.1.3.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.3,10.1.2.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.1,10.1.2.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.2 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.2,10.1.1.1 -> 10.3.4.5,0.0.0.0 (use = 4)
+10.1.1.0,10.1.1.2 -> 10.3.4.5,0.0.0.0 (use = 2)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+> zx0 ip #0 48(20) 1 10.3.4.1 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.2.2.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.3
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.3.4.1 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.3.4.1 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.3.4.2 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.3.4.2 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+> zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.3.4.3,1026 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+> zx0 ip #0 40(20) 6 10.3.4.3,1025 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+> zx0 ip #0 28(20) 17 10.3.4.3,1025 > 10.3.4.5,40001
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+> zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 from 10.1.1.0/24 ! to 10.1.0.0/16 -> 10.3.4.0/24
+
+List of active sessions:
+MAP 10.1.1.2 1025 <- -> 10.3.4.3 1025 [10.3.4.5 40001]
+MAP 10.1.1.1 1025 <- -> 10.3.4.3 1025 [10.3.4.5 40000]
+MAP 10.1.1.1 1026 <- -> 10.3.4.3 1026 [10.3.4.5 40000]
+MAP 10.1.1.3 <- -> 10.3.4.2 [10.4.3.4]
+MAP 10.1.1.3 <- -> 10.3.4.2 [10.4.3.4]
+MAP 10.1.1.2 <- -> 10.3.4.1 [10.4.3.4]
+MAP 10.1.1.2 <- -> 10.3.4.1 [10.4.3.2]
+MAP 10.1.1.1 <- -> 10.3.4.1 [10.4.3.2]
+
+Hostmap table:
+10.1.1.2,10.3.4.5 -> 10.3.4.3,0.0.0.0 (use = 1)
+10.1.1.1,10.3.4.5 -> 10.3.4.3,0.0.0.0 (use = 2)
+10.1.1.3,10.4.3.4 -> 10.3.4.2,0.0.0.0 (use = 2)
+10.1.1.2,10.4.3.4 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.2,10.4.3.2 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.1,10.4.3.2 -> 10.3.4.1,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+> zx0 ip #0 48(20) 1 10.1.1.1 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.2.2.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.3
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+> zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.3.4.5,10000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+> zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+> zx0 ip #0 28(20) 17 10.3.4.5,10001 > 10.3.4.5,40001
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+> zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap udp 10000:20000 sequential
+
+List of active sessions:
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 10001 [10.3.4.5 40001]
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 10000 [10.1.1.1 1025]
+
+Hostmap table:
+10.1.1.2,10.3.4.5 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.2,10.1.1.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10001 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+> zx0 ip #0 48(20) 1 10.1.1.1 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.2.2.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.3
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+> zx0 ip #0 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10003 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10001 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.3.4.1,10004 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.1,10005 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.3.4.1,10006 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.3.4.1,10007 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.3.4.1,10008 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.3.4.1,10009 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+> zx0 ip #0 40(20) 6 10.3.4.1,10010 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+> zx0 ip #0 28(20) 17 10.3.4.1,10011 > 10.3.4.5,40001
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+> zx0 ip #0 40(20) 6 10.3.4.1,10012 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 10.1.0.0/16 -> 10.3.4.0/24 portmap tcp/udp 10000:20000 sequential
+
+List of active sessions:
+MAP 10.1.2.1 80 <- -> 10.3.4.1 10012 [10.3.4.5 40001]
+MAP 10.1.1.2 1025 <- -> 10.3.4.1 10011 [10.3.4.5 40001]
+MAP 10.1.1.1 1025 <- -> 10.3.4.1 10010 [10.3.4.5 40000]
+MAP 10.1.1.1 1026 <- -> 10.3.4.1 10009 [10.3.4.5 40000]
+MAP 10.1.1.3 2003 <- -> 10.3.4.1 10008 [10.1.4.1 80]
+MAP 10.1.1.3 2002 <- -> 10.3.4.1 10007 [10.1.4.1 80]
+MAP 10.1.1.3 2001 <- -> 10.3.4.1 10006 [10.1.3.1 80]
+MAP 10.1.1.3 2000 <- -> 10.3.4.1 10005 [10.1.2.1 80]
+MAP 10.1.1.2 1025 <- -> 10.3.4.1 10004 [10.1.1.1 1025]
+MAP 10.1.1.1 1025 <- -> 10.3.4.1 10003 [10.1.1.2 1025]
+MAP 10.1.1.1 1025 <- -> 10.3.4.1 10002 [10.1.1.1 1025]
+MAP 10.1.1.2 1026 <- -> 10.3.4.1 10001 [10.1.1.1 1025]
+MAP 10.1.1.2 1025 <- -> 10.3.4.1 10000 [10.1.1.1 1025]
+
+Hostmap table:
+10.1.2.1,10.3.4.5 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.2,10.3.4.5 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.1,10.3.4.5 -> 10.3.4.1,0.0.0.0 (use = 2)
+10.1.1.3,10.1.4.1 -> 10.3.4.1,0.0.0.0 (use = 2)
+10.1.1.3,10.1.3.1 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.3,10.1.2.1 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.2 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.1 -> 10.3.4.1,0.0.0.0 (use = 1)
+10.1.1.2,10.1.1.1 -> 10.3.4.1,0.0.0.0 (use = 3)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip #0 20(20) 255 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+> zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025
+> zx0 ip #0 20(20) 255 10.2.2.1 > 10.1.2.1
+> zx0 ip #0 20(20) 255 10.2.2.2 > 10.1.2.1
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.2.1 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.2 > 10.2.1.1
+< zx0 ip #0 20(20) 255 10.2.2.3 > 10.1.1.1
+< zx0 ip #0 20(20) 255 10.2.3.4 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.2.2.2
+< zx0 ip #0 20(20) 255 10.1.1.0 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.1 > 10.3.4.5
+< zx0 ip #0 20(20) 255 10.1.1.2 > 10.3.4.5
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+> zx0 ip #0 48(20) 1 10.1.1.1 > 10.4.3.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.2.2.2
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.3
+< zx0 ip #0 48(20) 1 10.4.3.2 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.2
+< zx0 ip #0 20(20) 34 10.4.3.2 > 10.3.4.4
+> zx0 ip #0 20(20) 34 10.1.1.2 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.5
+> zx0 ip #0 20(20) 34 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 34 10.4.3.4 > 10.3.4.6
+> zx0 ip #0 20(20) 35 10.1.1.3 > 10.4.3.4
+< zx0 ip #0 20(20) 35 10.4.3.4 > 10.3.4.7
+15
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.2,1025
+> zx0 ip #0 20(20) 0 10.1.1.0 > 10.1.1.2
+> zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.2.1
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025
+> zx0 ip #0 28(20) 17 10.3.4.5,40001 > 10.1.1.1,1025
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.2.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.3.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.1.4.1,80
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.1.4.1,80
+< zx0 ip #0 20(20) 0 10.1.1.1 > 10.1.1.2
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+< zx0 ip #0 20(20) 0 10.1.1.2 > 10.1.1.1
+> zx0 ip #0 40(20) 6 10.3.4.5,40000 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+> zx0 ip #0 40(20) 6 10.3.4.5,40001 > 10.3.4.5,40000
+< zx0 ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+> zx0 ip #0 28(20) 17 10.3.4.5,40000 > 10.3.4.5,40001
+< zx0 ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+> zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+< zx0 ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+List of active MAP/Redirect filters:
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap tcp/udp 40000:40001 sequential
+
+List of active sessions:
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 40000 [10.3.4.5 40001]
+MAP 10.1.1.1 1025 <- -> 10.3.4.5 40001 [10.3.4.5 40000]
+MAP 10.1.1.1 1026 <- -> 10.3.4.5 40000 [10.3.4.5 40000]
+MAP 10.1.1.3 2003 <- -> 10.3.4.5 40001 [10.1.4.1 80]
+MAP 10.1.1.3 2002 <- -> 10.3.4.5 40000 [10.1.4.1 80]
+MAP 10.1.1.3 2001 <- -> 10.3.4.5 40001 [10.1.3.1 80]
+MAP 10.1.1.3 2000 <- -> 10.3.4.5 40000 [10.1.2.1 80]
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 40001 [10.1.1.1 1025]
+MAP 10.1.1.1 1025 <- -> 10.3.4.5 40000 [10.1.1.2 1025]
+MAP 10.1.1.2 1026 <- -> 10.3.4.5 40001 [10.1.1.1 1025]
+MAP 10.1.1.2 1025 <- -> 10.3.4.5 40000 [10.1.1.1 1025]
+
+Hostmap table:
+10.1.1.2,10.3.4.5 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.1,10.3.4.5 -> 10.3.4.5,0.0.0.0 (use = 2)
+10.1.1.3,10.1.4.1 -> 10.3.4.5,0.0.0.0 (use = 2)
+10.1.1.3,10.1.3.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.3,10.1.2.1 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.1,10.1.1.2 -> 10.3.4.5,0.0.0.0 (use = 1)
+10.1.1.2,10.1.1.1 -> 10.3.4.5,0.0.0.0 (use = 3)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n5_6 b/contrib/netbsd-tests/ipf/expected/n5_6
new file mode 100644
index 0000000..1e7bc8e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n5_6
@@ -0,0 +1,533 @@
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,1025
+> zx0 ip6/0 88 0 58 10:0:0:0:0:2:2:2 > 10:4:3:0:0:0:0:2
+< zx0 ip6/0 88 0 58 10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:1:1:0:0:0:0:3,2000 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2001 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2002 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2003 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,1026 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,1025 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+> zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::1/128 -> 10::2:2:2/128
+
+List of active sessions:
+MAP 10:1:1::1 1025 <- -> 10::2:2:2 1025 [10::3:4:5 40000]
+MAP 10:1:1::1 1026 <- -> 10::2:2:2 1026 [10::3:4:5 40000]
+MAP 10:1:1::1 <- -> 10::2:2:2 [10:1:2::1]
+MAP 10:1:1::1 1025 <- -> 10::2:2:2 1025 [10:1:1::2 1025]
+MAP 10:1:1::1 1025 <- -> 10::2:2:2 1025 [10:1:1::1 1025]
+MAP 10:1:1::1 <- -> 10::2:2:2 [10:4:3::2]
+MAP 10:1:1::1 <- -> 10::2:2:2 [10:1:1::2]
+
+Hostmap table:
+10:1:1::1,10::3:4:5 -> 10::2:2:2,any (use = 2)
+10:1:1::1,10:1:2::1 -> 10::2:2:2,any (use = 1)
+10:1:1::1,10:1:1::1 -> 10::2:2:2,any (use = 1)
+10:1:1::1,10:4:3::2 -> 10::2:2:2,any (use = 1)
+10:1:1::1,10:1:1::2 -> 10::2:2:2,any (use = 2)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:5 > 10:1:1:0:0:0:0:2
+16
+> zx0 ip6/0 1 0 255 10:0:0:0:0:3:4:5 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 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:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 35 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:7
+16
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,1025 > 10:1:1:0:0:0:0:2,1025
+> zx0 ip6/0 1 0 41 10:0:0:0:0:3:4:5 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 41 10:0:0:0:0:3:4:5 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:5,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,2000 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,2001 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,2002 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,2003 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+> zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 from 10:1:1::/112 to 10:1::/32 -> 10::3:4:5/128
+
+List of active sessions:
+MAP 10:1:1::3 2003 <- -> 10::3:4:5 2003 [10:1:4::1 80]
+MAP 10:1:1::3 2002 <- -> 10::3:4:5 2002 [10:1:4::1 80]
+MAP 10:1:1::3 2001 <- -> 10::3:4:5 2001 [10:1:3::1 80]
+MAP 10:1:1::3 2000 <- -> 10::3:4:5 2000 [10:1:2::1 80]
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 1025 [10:1:1::1 1025]
+MAP 10:1:1::1 <- -> 10::3:4:5 [10:1:2::1]
+MAP 10:1:1:: <- -> 10::3:4:5 [10:1:1::2]
+MAP 10:1:1::1 1025 <- -> 10::3:4:5 1025 [10:1:1::2 1025]
+MAP 10:1:1::2 1026 <- -> 10::3:4:5 1026 [10:1:1::1 1025]
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 1025 [10:1:1::1 1025]
+MAP 10:1:1::2 <- -> 10::3:4:5 [10:1:1::1]
+MAP 10:1:1:: <- -> 10::3:4:5 [10:1:1::2]
+
+Hostmap table:
+10:1:1::3,10:1:4::1 -> 10::3:4:5,any (use = 2)
+10:1:1::3,10:1:3::1 -> 10::3:4:5,any (use = 1)
+10:1:1::3,10:1:2::1 -> 10::3:4:5,any (use = 1)
+10:1:1::1,10:1:2::1 -> 10::3:4:5,any (use = 1)
+10:1:1::1,10:1:1::2 -> 10::3:4:5,any (use = 1)
+10:1:1::2,10:1:1::1 -> 10::3:4:5,any (use = 4)
+10:1:1::,10:1:1::2 -> 10::3:4:5,any (use = 2)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
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10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2000 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2001 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2002 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2003 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:3,1026 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:3,1025 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:3,1025 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+> zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 from 10:1:1::/112 ! to 10:1::/32 -> 10::3:4:0/112
+
+List of active sessions:
+MAP 10:1:1::2 1025 <- -> 10::3:4:3 1025 [10::3:4:5 40001]
+MAP 10:1:1::1 1025 <- -> 10::3:4:3 1025 [10::3:4:5 40000]
+MAP 10:1:1::1 1026 <- -> 10::3:4:3 1026 [10::3:4:5 40000]
+MAP 10:1:1::3 <- -> 10::3:4:2 [10:4:3::4]
+MAP 10:1:1::3 <- -> 10::3:4:2 [10:4:3::4]
+MAP 10:1:1::2 <- -> 10::3:4:1 [10:4:3::4]
+MAP 10:1:1::2 <- -> 10::3:4:1 [10:4:3::2]
+MAP 10:1:1::1 <- -> 10::3:4:1 [10:4:3::2]
+
+Hostmap table:
+10:1:1::2,10::3:4:5 -> 10::3:4:3,any (use = 1)
+10:1:1::1,10::3:4:5 -> 10::3:4:3,any (use = 2)
+10:1:1::3,10:4:3::4 -> 10::3:4:2,any (use = 2)
+10:1:1::2,10:4:3::4 -> 10::3:4:1,any (use = 1)
+10:1:1::2,10:4:3::2 -> 10::3:4:1,any (use = 1)
+10:1:1::1,10:4:3::2 -> 10::3:4:1,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:3:4:5
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,1025
+> zx0 ip6/0 88 0 58 10:1:1:0:0:0:0:1 > 10:4:3:0:0:0:0:2
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:3
+< zx0 ip6/0 88 0 58 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:5
+> zx0 ip6/0 1 0 34 10:1:1:0:0:0:0:2 > 10:4:3:0:0:0:0:2
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:2 > 10:0:0:0:0:3:4:4
+> zx0 ip6/0 1 0 34 10:1:1:0:0:0:0:2 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:5
+> zx0 ip6/0 1 0 34 10:1:1:0:0:0:0:3 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 34 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:6
+> zx0 ip6/0 1 0 35 10:1:1:0:0:0:0:3 > 10:4:3:0:0:0:0:4
+< zx0 ip6/0 1 0 35 10:4:3:0:0:0:0:4 > 10:0:0:0:0:3:4:7
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1025 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:2,1026 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:5,10000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2000 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2001 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2002 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:3,2003 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:5,10001 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+> zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::/112 -> 10::3:4:5/128 portmap udp 10000:20000 sequential
+
+List of active sessions:
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 10001 [10::3:4:5 40001]
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 10000 [10:1:1::1 1025]
+
+Hostmap table:
+10:1:1::2,10::3:4:5 -> 10::3:4:5,any (use = 1)
+10:1:1::2,10:1:1::1 -> 10::3:4:5,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10001 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 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1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10001 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:1,10004 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10005 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10006 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10007 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10008 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10009 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10010 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:1,10011 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:1,10012 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1::/32 -> 10::3:4:0/112 portmap tcp/udp 10000:20000 sequential
+
+List of active sessions:
+MAP 10:1:2::1 80 <- -> 10::3:4:1 10012 [10::3:4:5 40001]
+MAP 10:1:1::2 1025 <- -> 10::3:4:1 10011 [10::3:4:5 40001]
+MAP 10:1:1::1 1025 <- -> 10::3:4:1 10010 [10::3:4:5 40000]
+MAP 10:1:1::1 1026 <- -> 10::3:4:1 10009 [10::3:4:5 40000]
+MAP 10:1:1::3 2003 <- -> 10::3:4:1 10008 [10:1:4::1 80]
+MAP 10:1:1::3 2002 <- -> 10::3:4:1 10007 [10:1:4::1 80]
+MAP 10:1:1::3 2001 <- -> 10::3:4:1 10006 [10:1:3::1 80]
+MAP 10:1:1::3 2000 <- -> 10::3:4:1 10005 [10:1:2::1 80]
+MAP 10:1:1::2 1025 <- -> 10::3:4:1 10004 [10:1:1::1 1025]
+MAP 10:1:1::1 1025 <- -> 10::3:4:1 10003 [10:1:1::2 1025]
+MAP 10:1:1::1 1025 <- -> 10::3:4:1 10002 [10:1:1::1 1025]
+MAP 10:1:1::2 1026 <- -> 10::3:4:1 10001 [10:1:1::1 1025]
+MAP 10:1:1::2 1025 <- -> 10::3:4:1 10000 [10:1:1::1 1025]
+
+Hostmap table:
+10:1:2::1,10::3:4:5 -> 10::3:4:1,any (use = 1)
+10:1:1::2,10::3:4:5 -> 10::3:4:1,any (use = 1)
+10:1:1::1,10::3:4:5 -> 10::3:4:1,any (use = 2)
+10:1:1::3,10:1:4::1 -> 10::3:4:1,any (use = 2)
+10:1:1::3,10:1:3::1 -> 10::3:4:1,any (use = 1)
+10:1:1::3,10:1:2::1 -> 10::3:4:1,any (use = 1)
+10:1:1::1,10:1:1::2 -> 10::3:4:1,any (use = 1)
+10:1:1::1,10:1:1::1 -> 10::3:4:1,any (use = 1)
+10:1:1::2,10:1:1::1 -> 10::3:4:1,any (use = 3)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:0 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+> zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:1:2:0:0:0:0:1
+> zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:1:2:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:1 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:2 > 10:0:0:0:0:2:1:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:2:3 > 10:1:1:0:0:0:0:1
+< zx0 ip6/0 1 0 255 10:0:0:0:0:2:3:4 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:1 > 10:0:0:0:0:2:2:2
+< zx0 ip6/0 1 0 255 10:1:1:0:0:0:0:2 > 10:0:0:0:0:2:2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10:0:0:0:0:3:4:5,40000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40000 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:5,40001 > 10:1:1:0:0:0:0:1,1025
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40000 > 10:1:2:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:3:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40000 > 10:1:4:0:0:0:0:1,80
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:1:4:0:0:0:0:1,80
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:1 > 10:1:1:0:0:0:0:2
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+< zx0 ip6/0 1 0 41 10:1:1:0:0:0:0:2 > 10:1:1:0:0:0:0:1
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40000 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1026 > 10:0:0:0:0:3:4:5,40000
+> zx0 ip6/0 20 0 6 10:0:0:0:0:3:4:5,40001 > 10:0:0:0:0:3:4:5,40000
+< zx0 ip6/0 20 0 6 10:1:1:0:0:0:0:1,1025 > 10:1:1:0:0:0:0:2,1025
+> zx0 ip6/0 8 0 17 10:0:0:0:0:3:4:5,40000 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 8 0 17 10:1:1:0:0:0:0:2,1025 > 10:0:0:0:0:3:4:5,40001
+> zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+< zx0 ip6/0 20 0 6 10:1:2:0:0:0:0:1,80 > 10:0:0:0:0:3:4:5,40001
+List of active MAP/Redirect filters:
+map zx0 inet6 10:1:1::/112 -> 10::3:4:5/128 portmap tcp/udp 40000:40001 sequential
+
+List of active sessions:
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 40000 [10::3:4:5 40001]
+MAP 10:1:1::1 1025 <- -> 10::3:4:5 40001 [10::3:4:5 40000]
+MAP 10:1:1::1 1026 <- -> 10::3:4:5 40000 [10::3:4:5 40000]
+MAP 10:1:1::3 2003 <- -> 10::3:4:5 40001 [10:1:4::1 80]
+MAP 10:1:1::3 2002 <- -> 10::3:4:5 40000 [10:1:4::1 80]
+MAP 10:1:1::3 2001 <- -> 10::3:4:5 40001 [10:1:3::1 80]
+MAP 10:1:1::3 2000 <- -> 10::3:4:5 40000 [10:1:2::1 80]
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 40001 [10:1:1::1 1025]
+MAP 10:1:1::1 1025 <- -> 10::3:4:5 40000 [10:1:1::2 1025]
+MAP 10:1:1::2 1026 <- -> 10::3:4:5 40001 [10:1:1::1 1025]
+MAP 10:1:1::2 1025 <- -> 10::3:4:5 40000 [10:1:1::1 1025]
+
+Hostmap table:
+10:1:1::2,10::3:4:5 -> 10::3:4:5,any (use = 1)
+10:1:1::1,10::3:4:5 -> 10::3:4:5,any (use = 2)
+10:1:1::3,10:1:4::1 -> 10::3:4:5,any (use = 2)
+10:1:1::3,10:1:3::1 -> 10::3:4:5,any (use = 1)
+10:1:1::3,10:1:2::1 -> 10::3:4:5,any (use = 1)
+10:1:1::1,10:1:1::2 -> 10::3:4:5,any (use = 1)
+10:1:1::2,10:1:1::1 -> 10::3:4:5,any (use = 3)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n6 b/contrib/netbsd-tests/ipf/expected/n6
new file mode 100644
index 0000000..1afd94e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n6
@@ -0,0 +1,173 @@
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23
+< zx0 ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.1/32 port 23 -> 10.2.2.1/32 port 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.3.3.3 12345]
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.2.2.2 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023
+15
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23
+< zx0 ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+List of active MAP/Redirect filters:
+rdr zx0 from 0/0 to 10.1.1.0/24 port = 23 -> 10.2.2.1/32 port 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.3.3.3 12345]
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.2.2.2 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023
+15
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23
+< zx0 ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+List of active MAP/Redirect filters:
+rdr zx0 from 10.2.0.0/16 to 10.1.1.0/24 port = 23 -> 10.2.2.1/32 port 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.2.2.2 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,23
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23
+15
+< zx0 ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+List of active MAP/Redirect filters:
+rdr zx0 from 10.3.0.0/16 to 10.1.0.0/16 port = 23 -> 10.2.2.1/32 port 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.3.3.3 12345]
+RDR 10.2.2.1 10023 <- -> 10.1.2.2 23 [10.3.0.1 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,23
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23
+< zx0 ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23
+< zx0 ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 28(20) 17 10.3.3.3,12345 > 10.2.2.1,10053
+< zx0 ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53
+< zx0 ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+List of active MAP/Redirect filters:
+rdr zx0 ! from 10.2.0.0/16 to 10.1.1.0/24 port = 53 -> 10.2.2.1/32 port 10053 udp
+
+List of active sessions:
+RDR 10.2.2.1 10053 <- -> 10.1.1.0 53 [10.3.3.3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n6_6 b/contrib/netbsd-tests/ipf/expected/n6_6
new file mode 100644
index 0000000..e10f9bd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n6_6
@@ -0,0 +1,173 @@
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:2,23
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:1:2:0:0:0:0:2,23
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:0:0:0:0:2:2:2,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:0:0:0:0:0:0,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:0:0:0:0:0:0,23
+< zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::1/128 port 23 -> 10::2:2:1/128 port 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10:3:3::3 12345]
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10::2:2:2 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:0:0:0:0:2:2:1,10023
+16
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:1:2:0:0:0:0:2,23
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:0:0:0:0:2:2:2,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:0:0:0:0:0:0,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:0:0:0:0:0:0,23
+< zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+List of active MAP/Redirect filters:
+rdr zx0 inet6 from any to 10:1:1::/112 port = 23 -> 10::2:2:1/128 port 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10:3:3::3 12345]
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10::2:2:2 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:0:0:0:0:2:2:1,10023
+16
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:1:2:0:0:0:0:2,23
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:0:0:0:0:2:2:2,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,23
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:0:0:0:0:0:0,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:0:0:0:0:0:0,23
+< zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+List of active MAP/Redirect filters:
+rdr zx0 inet6 from 10::/32 to 10:1:1::/112 port = 23 -> 10::2:2:1/128 port 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10::2:2:2 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:1,23
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:2,23
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:0:0:0:0:2:2:2,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:0:0:0:0:0:0,23
+16
+< zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+List of active MAP/Redirect filters:
+rdr zx0 inet6 from 10:3::/32 to 10:1::/32 port = 23 -> 10::2:2:1/128 port 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10:3:3::3 12345]
+RDR 10::2:2:1 10023 <- -> 10:1:2::2 23 [10:3::1 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:1,23
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:2,23
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:1:2:0:0:0:0:2,23
+< zx0 ip6/0 20 0 6 10:3:0:0:0:0:0:1,12345 > 10:0:0:0:0:2:2:2,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,23
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:1,53
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:0:0:0:0:0:0,23
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:0:0:0:0:0:0,23
+< zx0 ip6/0 8 0 17 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 8 0 17 10:3:3:0:0:0:0:3,12345 > 10:0:0:0:0:2:2:1,10053
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:2:2,12345 > 10:1:1:0:0:0:0:0,53
+< zx0 ip6/0 20 0 6 10:3:3:0:0:0:0:3,12345 > 10:1:1:0:0:0:0:0,53
+List of active MAP/Redirect filters:
+rdr zx0 inet6 ! from 10::/32 to 10:1:1::/112 port = 53 -> 10::2:2:1/128 port 10053 udp
+
+List of active sessions:
+RDR 10::2:2:1 10053 <- -> 10:1:1:: 53 [10:3:3::3 12345]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n7 b/contrib/netbsd-tests/ipf/expected/n7
new file mode 100644
index 0000000..11b8115
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n7
@@ -0,0 +1,98 @@
+< zx0 ip #0 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22
+< zx0 ip #0 40(20) 6 10.2.3.1,1231 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.2.3.1,1232 > 10.2.2.1,10050
+< zx0 ip #0 40(20) 6 10.2.3.1,1233 > 10.2.2.1,10079
+< zx0 ip #0 40(20) 6 10.2.3.1,1234 > 10.1.1.1,80
+< zx0 ip #0 40(20) 6 10.2.3.1,1235 > 10.1.1.2,80
+< zx0 ip #0 40(20) 6 10.2.3.1,1236 > 10.1.1.3,80
+< zx0 ip #0 40(20) 6 10.2.3.1,1237 > 10.1.1.4,80
+< zx0 ip #0 40(20) 6 10.2.3.1,1238 > 10.1.1.4,80
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.1/32 port 23-79 -> 10.2.2.1/32 port 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10079 <- -> 10.1.1.1 79 [10.2.3.1 1233]
+RDR 10.2.2.1 10050 <- -> 10.1.1.1 50 [10.2.3.1 1232]
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.2.3.1 1231]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22
+< zx0 ip #0 40(20) 6 10.2.3.1,1231 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.2.3.1,1232 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.2.3.1,1233 > 10.2.2.1,10023
+< zx0 ip #0 40(20) 6 10.2.3.1,1234 > 10.1.1.1,80
+< zx0 ip #0 40(20) 6 10.2.3.1,1235 > 10.1.1.2,80
+< zx0 ip #0 40(20) 6 10.2.3.1,1236 > 10.1.1.3,80
+< zx0 ip #0 40(20) 6 10.2.3.1,1237 > 10.1.1.4,80
+< zx0 ip #0 40(20) 6 10.2.3.1,1238 > 10.1.1.4,80
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.1/32 port 23-79 -> 10.2.2.1/32 port = 10023 tcp
+
+List of active sessions:
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 79 [10.2.3.1 1233]
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 50 [10.2.3.1 1232]
+RDR 10.2.2.1 10023 <- -> 10.1.1.1 23 [10.2.3.1 1231]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip #0 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22
+< zx0 ip #0 40(20) 6 10.2.3.1,1231 > 10.1.1.1,23
+< zx0 ip #0 40(20) 6 10.2.3.1,1232 > 10.1.1.1,50
+< zx0 ip #0 40(20) 6 10.2.3.1,1233 > 10.1.1.1,79
+< zx0 ip #0 40(20) 6 10.2.3.1,1234 > 10.2.2.1,3128
+< zx0 ip #0 40(20) 6 10.2.3.1,1235 > 1.2.2.129,3128
+< zx0 ip #0 40(20) 6 10.2.3.1,1236 > 10.2.2.1,3128
+< zx0 ip #0 40(20) 6 10.2.3.1,1237 > 1.2.2.129,3128
+< zx0 ip #0 40(20) 6 10.2.3.1,1238 > 10.2.2.1,3128
+List of active MAP/Redirect filters:
+rdr zx0 10.1.1.0/24 port 80 -> 10.2.2.1,1.2.2.129 port 3128 tcp
+
+List of active sessions:
+RDR 10.2.2.1 3128 <- -> 10.1.1.4 80 [10.2.3.1 1238]
+RDR 1.2.2.129 3128 <- -> 10.1.1.4 80 [10.2.3.1 1237]
+RDR 10.2.2.1 3128 <- -> 10.1.1.3 80 [10.2.3.1 1236]
+RDR 1.2.2.129 3128 <- -> 10.1.1.2 80 [10.2.3.1 1235]
+RDR 10.2.2.1 3128 <- -> 10.1.1.1 80 [10.2.3.1 1234]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n7_6 b/contrib/netbsd-tests/ipf/expected/n7_6
new file mode 100644
index 0000000..2563033
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n7_6
@@ -0,0 +1,98 @@
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1230 > 10:1:1:0:0:0:0:1,22
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1231 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1232 > 10:0:0:0:0:2:2:1,10050
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1233 > 10:0:0:0:0:2:2:1,10079
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1234 > 10:1:1:0:0:0:0:1,80
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1235 > 10:1:1:0:0:0:0:2,80
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1236 > 10:1:1:0:0:0:0:3,80
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1237 > 10:1:1:0:0:0:0:4,80
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1238 > 10:1:1:0:0:0:0:4,80
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::1/128 port 23-79 -> 10::2:2:1/128 port 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10079 <- -> 10:1:1::1 79 [10::2:3:1 1233]
+RDR 10::2:2:1 10050 <- -> 10:1:1::1 50 [10::2:3:1 1232]
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10::2:3:1 1231]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1230 > 10:1:1:0:0:0:0:1,22
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1231 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1232 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1233 > 10:0:0:0:0:2:2:1,10023
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1234 > 10:1:1:0:0:0:0:1,80
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1235 > 10:1:1:0:0:0:0:2,80
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1236 > 10:1:1:0:0:0:0:3,80
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1237 > 10:1:1:0:0:0:0:4,80
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1238 > 10:1:1:0:0:0:0:4,80
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::1/128 port 23-79 -> 10::2:2:1/128 port = 10023 tcp
+
+List of active sessions:
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 79 [10::2:3:1 1233]
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 50 [10::2:3:1 1232]
+RDR 10::2:2:1 10023 <- -> 10:1:1::1 23 [10::2:3:1 1231]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1230 > 10:1:1:0:0:0:0:1,22
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1231 > 10:1:1:0:0:0:0:1,23
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1232 > 10:1:1:0:0:0:0:1,50
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1233 > 10:1:1:0:0:0:0:1,79
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1234 > 10:0:0:0:0:2:2:1,3128
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1235 > 1:0:0:0:0:2:2:129,3128
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1236 > 10:0:0:0:0:2:2:1,3128
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1237 > 1:0:0:0:0:2:2:129,3128
+< zx0 ip6/0 20 0 6 10:0:0:0:0:2:3:1,1238 > 10:0:0:0:0:2:2:1,3128
+List of active MAP/Redirect filters:
+rdr zx0 inet6 10:1:1::/112 port 80 -> 10::2:2:1,1::2:2:129 port 3128 tcp
+
+List of active sessions:
+RDR 10::2:2:1 3128 <- -> 10:1:1::4 80 [10::2:3:1 1238]
+RDR 1::2:2:129 3128 <- -> 10:1:1::4 80 [10::2:3:1 1237]
+RDR 10::2:2:1 3128 <- -> 10:1:1::3 80 [10::2:3:1 1236]
+RDR 1::2:2:129 3128 <- -> 10:1:1::2 80 [10::2:3:1 1235]
+RDR 10::2:2:1 3128 <- -> 10:1:1::1 80 [10::2:3:1 1234]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n8 b/contrib/netbsd-tests/ipf/expected/n8
new file mode 100644
index 0000000..a5e938f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n8
@@ -0,0 +1,30 @@
+4500 0054 8bc1 0000 ff01 13d5 0a0a 0a01 0404 0404 0800 efdf 6220 0000 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+4500 0054 3fd5 4000 ff01 2fc8 0404 0404 0202 0202 0000 f7df 6220 0000 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+4500 0054 8bc1 0000 ff01 13d5 0a0a 0a01 0404 0404 0800 efde 6220 0001 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+4500 0054 3fd5 4000 ff01 2fc8 0404 0404 0202 0202 0000 f7de 6220 0001 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+List of active MAP/Redirect filters:
+map icmp0 2.2.2.0/24 -> 10.10.10.0/24
+
+List of active sessions:
+MAP 2.2.2.2 <- -> 10.10.10.1 [4.4.4.4]
+
+Hostmap table:
+2.2.2.2,4.4.4.4 -> 10.10.10.1,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n8_6 b/contrib/netbsd-tests/ipf/expected/n8_6
new file mode 100644
index 0000000..4d08efe
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n8_6
@@ -0,0 +1,30 @@
+6000 0000 0040 3aff 0010 0010 0010 0000 0000 0000 0000 0001 0004 0004 0004 0000 0000 0000 0000 0004 8000 7724 6220 0000 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+6000 0000 0040 3aff 0004 0004 0004 0000 0000 0000 0000 0004 0002 0000 0000 0000 0000 0002 0002 0002 8100 764d 6220 0000 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+6000 0000 0040 3aff 0010 0010 0010 0000 0000 0000 0000 0001 0004 0004 0004 0000 0000 0000 0000 0004 8000 7723 6220 0001 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+6000 0000 0040 3aff 0004 0004 0004 0000 0000 0000 0000 0004 0002 0000 0000 0000 0000 0002 0002 0002 8100 764c 6220 0001 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+List of active MAP/Redirect filters:
+map icmp0 inet6 2::2:2:0/112 -> 10:10:10::/112
+
+List of active sessions:
+MAP 2::2:2:2 <- -> 10:10:10::1 [4:4:4::4]
+
+Hostmap table:
+2::2:2:2,4:4:4::4 -> 10:10:10::1,any (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n9 b/contrib/netbsd-tests/ipf/expected/n9
new file mode 100644
index 0000000..2c762be
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n9
@@ -0,0 +1,29 @@
+4500 0054 8bc1 0000 ff01 17d9 0202 0202 0a0a 0a01 0800 efdf 6220 0000 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+4500 0054 3fd5 4000 ff01 2fc8 0404 0404 0202 0202 0000 f7df 6220 0000 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+4500 0054 8bc1 0000 ff01 17d9 0202 0202 0a0a 0a01 0800 efde 6220 0001 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+4500 0054 3fd5 4000 ff01 2fc8 0404 0404 0202 0202 0000 f7de 6220 0001 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+List of active MAP/Redirect filters:
+rdr icmp0 4.4.4.0/24 -> 10.10.10.1/32 ip
+
+List of active sessions:
+RDR 10.10.10.1 <- -> 4.4.4.4 [2.2.2.2]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/n9_6 b/contrib/netbsd-tests/ipf/expected/n9_6
new file mode 100644
index 0000000..134d74c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/n9_6
@@ -0,0 +1,29 @@
+6000 0000 0040 3aff 0002 0000 0000 0000 0000 0002 0002 0002 0010 0010 0010 0000 0000 0000 0000 0001 8000 772c 6220 0000 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+6000 0000 0040 3aff 0004 0004 0004 0000 0000 0000 0000 0004 0002 0000 0000 0000 0000 0002 0002 0002 8100 764d 6220 0000 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+6000 0000 0040 3aff 0002 0000 0000 0000 0000 0002 0002 0002 0010 0010 0010 0000 0000 0000 0000 0001 8000 772b 6220 0001 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+6000 0000 0040 3aff 0004 0004 0004 0000 0000 0000 0000 0004 0002 0000 0000 0000 0000 0002 0002 0002 8100 764c 6220 0001 3f6f 6e80 000b 0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+
+List of active MAP/Redirect filters:
+rdr icmp0 inet6 4:4:4::/112 -> 10:10:10::1/128 ip
+
+List of active sessions:
+RDR 10:10:10::1 <- -> 4:4:4::4 [2::2:2:2]
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni1 b/contrib/netbsd-tests/ipf/expected/ni1
new file mode 100644
index 0000000..d4e2de2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni1
@@ -0,0 +1,19 @@
+4500 0028 0000 4000 0111 65b2 0606 0606 0404 0404 afc9 829e 0014 6308 0402 0000 3be5 468d 000a cfc3
+
+4500 0038 809a 0000 ff01 3121 0303 0303 0202 0202 0b00 5773 0000 0000 4500 0028 0000 4000 0111 6dba 0202 0202 0404 0404 afc9 829e 0014 6b10
+
+4500 0044 809a 0000 ff01 3115 0303 0303 0202 0202 0b00 0131 0000 0000 4500 0028 0000 4000 0111 6dba 0202 0202 0404 0404 afc9 829e 0014 6b10 0402 0000 3be5 468d 000a cfc3
+
+4500 0028 0001 4000 0111 65b0 0606 0607 0404 0404 4e20 829e 0014 c4b0 0402 0000 3be5 468d 000a cfc3
+
+4500 0038 809a 0000 ff01 3121 0303 0303 0202 0202 0b00 5773 0000 0000 4500 0028 0000 4000 0111 6dba 0202 0202 0404 0404 0800 829e 0014 12da
+
+4500 0044 809a 0000 ff01 3115 0303 0303 0202 0202 0b00 0131 0000 0000 4500 0028 0000 4000 0111 6dba 0202 0202 0404 0404 0800 829e 0014 12da 0402 0000 3be5 468d 000a cfc3
+
+4500 0028 0002 4000 0111 65ae 0606 0608 0404 0404 07d0 829e 0014 0b00 0402 0000 3be5 468d 000a cfc3
+
+4500 0038 809a 0000 ff01 3121 0303 0303 0202 0202 0b00 ff6a 0000 0000 4500 0028 0000 4000 0111 6dba 0202 0202 0404 0404 5000 829e 0014 22e2
+
+4500 0044 809a 0000 ff01 3115 0303 0303 0202 0202 0b00 0131 0000 0000 4500 0028 0000 4000 0111 6dba 0202 0202 0404 0404 5000 829e 0014 cad9 0402 0000 3be5 468d 000a cfc3
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni10 b/contrib/netbsd-tests/ipf/expected/ni10
new file mode 100644
index 0000000..050fb40
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni10
@@ -0,0 +1,8 @@
+4500 003c 4706 4000 ff06 20a2 0404 0404 0606 0606 5000 0050 0000 0001 0000 0000 a002 16d0 d0da 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 0000 0000 ff01 afb9 0202 0202 0404 0404 0303 acab 0000 0000 4500 003c 4706 4000 ff06 28aa 0404 0404 0202 0202 5000 0050 0000 0001
+
+4500 0058 0001 0000 ff01 af98 0202 0202 0404 0404 0303 0937 0000 0000 4500 003c 4706 4000 ff06 28aa 0404 0404 0202 0202 5000 0050 0000 0001 0000 0000 a002 16d0 d8e2 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+0
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni11 b/contrib/netbsd-tests/ipf/expected/ni11
new file mode 100644
index 0000000..6ed8ecc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni11
@@ -0,0 +1,8 @@
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101 5000 9d58 0000 0001 0000 0000 a002 16d0 3ddc 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 0000 0000 ff01 a7b9 0a02 0202 0404 0404 0303 a7fc 0000 0000 4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202 5000 0500 0000 0001
+
+4500 0058 0001 0000 ff01 a798 0a02 0202 0404 0404 0303 1137 0000 0000 4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202 5000 0500 0000 0001 0000 0000 a002 16d0 cc32 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+0
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni12 b/contrib/netbsd-tests/ipf/expected/ni12
new file mode 100644
index 0000000..590ec23
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni12
@@ -0,0 +1,8 @@
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101 5000 9c40 0000 0001 0000 0000 a002 16d0 3ef4 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 0000 0000 ff01 a7b9 0a02 0202 0404 0404 0303 a7fc 0000 0000 4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202 5000 0500 0000 0001
+
+4500 0058 0001 0000 ff01 a798 0a02 0202 0404 0404 0303 1137 0000 0000 4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202 5000 0500 0000 0001 0000 0000 a002 16d0 cc32 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+0
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni13 b/contrib/netbsd-tests/ipf/expected/ni13
new file mode 100644
index 0000000..897bef3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni13
@@ -0,0 +1,63 @@
+4500 0030 5e11 4000 8006 3961 c0a8 7101 c0a8 7103 05e7 06bb abf0 4aa5 0000 0000 7002 faf0 21a1 0000 0204 05b4 0101 0402
+
+4500 002c 0000 4000 4006 d776 c0a8 7103 c0a8 7101 06bb 05e7 a564 68da abf0 4aa6 6012 8000 a348 0000 0204 05b4
+
+4500 00c4 5e12 4000 8006 38cc c0a8 7101 c0a8 7103 05e7 06bb abf0 4aa6 a564 68db 5018 faf0 e2a0 0000 009c 0001 1a2b 3c4d 0001 0000 0100 0000 0000 0001 0000 0001 0000 0a28 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 4d69 6372 6f73 6f66 7420 5769 6e64 6f77 7320 4e54 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00c4 0001 4000 4006 d6dd c0a8 7103 c0a8 7101 06bb 05e7 a564 68db abf0 4b42 5018 832c cecf 0000 009c 0001 1a2b 3c4d 0002 0000 0100 0100 0000 0000 0000 0000 0001 0001 6c6f 6361 6c00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 6c69 6e75 7800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00d0 5e13 4000 8006 38bf c0a8 7101 c0a8 7103 05e7 06bb abf0 4b42 a564 6977 5018 fa54 ac07 0000 00a8 0001 1a2b 3c4d 0007 0000 4000 1331 0000 012c 05f5 e100 0000 0003 0000 0003 0040 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 0048 0002 4000 4006 d758 c0a8 7103 c0a8 7101 06bb 05e7 a564 6977 abf0 4bea 5018 832c 36fa 0000 0020 0001 1a2b 3c4d 0008 0000 0000 4000 0100 0000 05f5 e100 0040 0000 0000 0000
+
+4500 0040 5e14 4000 8006 394e c0a8 7101 c0a8 7103 05e7 06bb abf0 4bea a564 6997 5018 fa34 e810 0000 0018 0001 1a2b 3c4d 000f 0000 0000 0000 ffff ffff ffff ffff
+
+4500 0039 5e15 0000 802f 792b c0a8 7101 c0a8 7103 3001 880b 0019 0000 0000 0000 ff03 c021 0100 0015 0104 0578 0506 577f 7c5b 0702 0802 0d03 06
+
+4500 0020 0003 0000 ff2f 5856 c0a8 7103 c0a8 7101 2081 880b 0000 4000 ffff ffff
+
+4500 0028 0004 4000 4006 d776 c0a8 7103 c0a8 7101 06bb 05e7 a564 6997 abf0 4c02 5010 832c b5c1 0000
+
+4500 0038 0005 0000 ff2f 583c c0a8 7103 c0a8 7101 3001 880b 0018 4000 0000 0000 ff03 c021 0101 0014 0206 0000 0000 0506 22d9 0cfa 0702 0802
+
+4500 002f 0006 0000 ff2f 5844 c0a8 7103 c0a8 7101 3081 880b 000b 4000 0000 0001 0000 0000 ff03 c021 0400 0007 0d03 06
+
+4500 003c 5e16 0000 802f 7927 c0a8 7101 c0a8 7103 3081 880b 0018 0000 0000 0001 0000 0001 ff03 c021 0201 0014 0206 0000 0000 0506 22d9 0cfa 0702 0802
+
+4500 0036 5e17 0000 802f 792c c0a8 7101 c0a8 7103 3001 880b 0016 0000 0000 0002 ff03 c021 0101 0012 0104 0578 0506 577f 7c5b 0702 0802
+
+4500 003a 0007 0000 ff2f 5838 c0a8 7103 c0a8 7101 3081 880b 0016 4000 0000 0002 0000 0002 ff03 c021 0201 0012 0104 0578 0506 577f 7c5b 0702 0802
+
+4500 0032 0008 0000 ff2f 583f c0a8 7103 c0a8 7101 3001 880b 0012 4000 0000 0003 8021 0101 0010 0306 c0a8 0001 0206 002d 0f01
+
+4500 0040 5e18 4000 8006 394a c0a8 7101 c0a8 7103 05e7 06bb abf0 4c02 a564 6997 5018 fa34 e7f8 0000 0018 0001 1a2b 3c4d 000f 0000 0000 0000 0000 0000 ffff ffff
+
+4500 0038 5e19 0000 802f 7928 c0a8 7101 c0a8 7103 3081 880b 0014 0000 0000 0003 0000 0003 c021 0c02 0012 577f 7c5b 4d53 5241 5356 352e 3130
+
+4500 003e 0009 0000 ff2f 5832 c0a8 7103 c0a8 7101 3081 880b 001a 4000 0000 0004 0000 0003 ff03 c021 0702 0016 0c02 0012 577f 7c5b 4d53 5241 5356 352e 3130
+
+4500 003e 5e1a 0000 802f 7921 c0a8 7101 c0a8 7103 3081 880b 001a 0000 0000 0004 0000 0004 c021 0c03 0018 577f 7c5b 4d53 5241 532d 302d 434c 4159 4d4f 4f52
+
+4500 0044 000a 0000 ff2f 582b c0a8 7103 c0a8 7101 3081 880b 0020 4000 0000 0005 0000 0004 ff03 c021 0703 001c 0c03 0018 577f 7c5b 4d53 5241 532d 302d 434c 4159 4d4f 4f52
+
+4500 0030 5e1b 0000 802f 792e c0a8 7101 c0a8 7103 3081 880b 000c 0000 0000 0005 0000 0005 80fd 0104 000a 1206 0100 0001
+
+4500 002a 000b 0000 ff2f 5844 c0a8 7103 c0a8 7101 3081 880b 0006 4000 0000 0006 0000 0005 80fd 0101 0004
+
+4500 002c 000c 0000 ff2f 5841 c0a8 7103 c0a8 7101 3001 880b 000c 4000 0000 0007 80fd 0404 000a 1206 0100 0001
+
+4500 0048 5e1c 0000 802f 7915 c0a8 7101 c0a8 7103 3081 880b 0024 0000 0000 0006 0000 0007 8021 0105 0022 0306 0000 0000 8106 0000 0000 8206 0000 0000 8306 0000 0000 8406 0000 0000
+
+4500 0042 000d 0000 ff2f 582a c0a8 7103 c0a8 7101 3081 880b 001e 4000 0000 0008 0000 0006 8021 0405 001c 8106 0000 0000 8206 0000 0000 8306 0000 0000 8406 0000 0000
+
+4500 0030 5e1d 0000 802f 792c c0a8 7101 c0a8 7103 3081 880b 000c 0000 0000 0007 0000 0008 8021 0401 000a 0206 002d 0f01
+
+4500 0030 000e 0000 ff2f 583b c0a8 7103 c0a8 7101 3081 880b 000c 4000 0000 0009 0000 0007 8021 0102 000a 0306 c0a8 0001
+
+4500 002a 5e1e 0000 802f 7931 c0a8 7101 c0a8 7103 3081 880b 0006 0000 0000 0008 0000 0009 80fd 0201 0004
+
+4500 0032 5e1f 0000 802f 7928 c0a8 7101 c0a8 7103 3001 880b 0012 0000 0000 0009 80fd 0506 0010 577f 7c5b 003c cd74 0000 02dc
+
+4500 002a 000f 0000 ff2f 5840 c0a8 7103 c0a8 7101 3081 880b 0006 4000 0000 000a 0000 0009 80fd 0606 0004
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni14 b/contrib/netbsd-tests/ipf/expected/ni14
new file mode 100644
index 0000000..5ad5a1b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni14
@@ -0,0 +1,63 @@
+4500 0030 5e11 4000 8006 ec0b c0a8 7101 7f00 0001 05e7 06bb abf0 4aa5 0000 0000 7002 faf0 d44b 0000 0204 05b4 0101 0402
+
+4500 002c 0000 4000 4006 d776 c0a8 7103 c0a8 7101 06bb 05e7 a564 68da abf0 4aa6 6012 8000 a348 0000 0204 05b4
+
+4500 00c4 5e12 4000 8006 eb76 c0a8 7101 7f00 0001 05e7 06bb abf0 4aa6 a564 68db 5018 faf0 954b 0000 009c 0001 1a2b 3c4d 0001 0000 0100 0000 0000 0001 0000 0001 0000 0a28 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 4d69 6372 6f73 6f66 7420 5769 6e64 6f77 7320 4e54 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00c4 0001 4000 4006 d6dd c0a8 7103 c0a8 7101 06bb 05e7 a564 68db abf0 4b42 5018 832c cecf 0000 009c 0001 1a2b 3c4d 0002 0000 0100 0100 0000 0000 0000 0000 0001 0001 6c6f 6361 6c00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 6c69 6e75 7800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00d0 5e13 4000 8006 eb69 c0a8 7101 7f00 0001 05e7 06bb abf0 4b42 a564 6977 5018 fa54 5eb2 0000 00a8 0001 1a2b 3c4d 0007 0000 4000 1331 0000 012c 05f5 e100 0000 0003 0000 0003 0040 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 0048 0002 4000 4006 d758 c0a8 7103 c0a8 7101 06bb 05e7 a564 6977 abf0 4bea 5018 832c 36fa 0000 0020 0001 1a2b 3c4d 0008 0000 0000 4000 0100 0000 05f5 e100 0040 0000 0000 0000
+
+4500 0040 5e14 4000 8006 ebf8 c0a8 7101 7f00 0001 05e7 06bb abf0 4bea a564 6997 5018 fa34 9abb 0000 0018 0001 1a2b 3c4d 000f 0000 0000 0000 ffff ffff ffff ffff
+
+4500 0039 5e15 0000 802f 2bd6 c0a8 7101 7f00 0001 3001 880b 0019 0000 0000 0000 ff03 c021 0100 0015 0104 0578 0506 577f 7c5b 0702 0802 0d03 06
+
+4500 0020 0003 0000 ff2f 5856 c0a8 7103 c0a8 7101 2081 880b 0000 4000 ffff ffff
+
+4500 0028 0004 4000 4006 d776 c0a8 7103 c0a8 7101 06bb 05e7 a564 6997 abf0 4c02 5010 832c b5c1 0000
+
+4500 0038 0005 0000 ff2f 583c c0a8 7103 c0a8 7101 3001 880b 0018 4000 0000 0000 ff03 c021 0101 0014 0206 0000 0000 0506 22d9 0cfa 0702 0802
+
+4500 002f 0006 0000 ff2f 5844 c0a8 7103 c0a8 7101 3081 880b 000b 4000 0000 0001 0000 0000 ff03 c021 0400 0007 0d03 06
+
+4500 003c 5e16 0000 802f 2bd2 c0a8 7101 7f00 0001 3081 880b 0018 0000 0000 0001 0000 0001 ff03 c021 0201 0014 0206 0000 0000 0506 22d9 0cfa 0702 0802
+
+4500 0036 5e17 0000 802f 2bd7 c0a8 7101 7f00 0001 3001 880b 0016 0000 0000 0002 ff03 c021 0101 0012 0104 0578 0506 577f 7c5b 0702 0802
+
+4500 003a 0007 0000 ff2f 5838 c0a8 7103 c0a8 7101 3081 880b 0016 4000 0000 0002 0000 0002 ff03 c021 0201 0012 0104 0578 0506 577f 7c5b 0702 0802
+
+4500 0032 0008 0000 ff2f 583f c0a8 7103 c0a8 7101 3001 880b 0012 4000 0000 0003 8021 0101 0010 0306 c0a8 0001 0206 002d 0f01
+
+4500 0040 5e18 4000 8006 ebf4 c0a8 7101 7f00 0001 05e7 06bb abf0 4c02 a564 6997 5018 fa34 9aa3 0000 0018 0001 1a2b 3c4d 000f 0000 0000 0000 0000 0000 ffff ffff
+
+4500 0038 5e19 0000 802f 2bd3 c0a8 7101 7f00 0001 3081 880b 0014 0000 0000 0003 0000 0003 c021 0c02 0012 577f 7c5b 4d53 5241 5356 352e 3130
+
+4500 003e 0009 0000 ff2f 5832 c0a8 7103 c0a8 7101 3081 880b 001a 4000 0000 0004 0000 0003 ff03 c021 0702 0016 0c02 0012 577f 7c5b 4d53 5241 5356 352e 3130
+
+4500 003e 5e1a 0000 802f 2bcc c0a8 7101 7f00 0001 3081 880b 001a 0000 0000 0004 0000 0004 c021 0c03 0018 577f 7c5b 4d53 5241 532d 302d 434c 4159 4d4f 4f52
+
+4500 0044 000a 0000 ff2f 582b c0a8 7103 c0a8 7101 3081 880b 0020 4000 0000 0005 0000 0004 ff03 c021 0703 001c 0c03 0018 577f 7c5b 4d53 5241 532d 302d 434c 4159 4d4f 4f52
+
+4500 0030 5e1b 0000 802f 2bd9 c0a8 7101 7f00 0001 3081 880b 000c 0000 0000 0005 0000 0005 80fd 0104 000a 1206 0100 0001
+
+4500 002a 000b 0000 ff2f 5844 c0a8 7103 c0a8 7101 3081 880b 0006 4000 0000 0006 0000 0005 80fd 0101 0004
+
+4500 002c 000c 0000 ff2f 5841 c0a8 7103 c0a8 7101 3001 880b 000c 4000 0000 0007 80fd 0404 000a 1206 0100 0001
+
+4500 0048 5e1c 0000 802f 2bc0 c0a8 7101 7f00 0001 3081 880b 0024 0000 0000 0006 0000 0007 8021 0105 0022 0306 0000 0000 8106 0000 0000 8206 0000 0000 8306 0000 0000 8406 0000 0000
+
+4500 0042 000d 0000 ff2f 582a c0a8 7103 c0a8 7101 3081 880b 001e 4000 0000 0008 0000 0006 8021 0405 001c 8106 0000 0000 8206 0000 0000 8306 0000 0000 8406 0000 0000
+
+4500 0030 5e1d 0000 802f 2bd7 c0a8 7101 7f00 0001 3081 880b 000c 0000 0000 0007 0000 0008 8021 0401 000a 0206 002d 0f01
+
+4500 0030 000e 0000 ff2f 583b c0a8 7103 c0a8 7101 3081 880b 000c 4000 0000 0009 0000 0007 8021 0102 000a 0306 c0a8 0001
+
+4500 002a 5e1e 0000 802f 2bdc c0a8 7101 7f00 0001 3081 880b 0006 0000 0000 0008 0000 0009 80fd 0201 0004
+
+4500 0032 5e1f 0000 802f 2bd3 c0a8 7101 7f00 0001 3001 880b 0012 0000 0000 0009 80fd 0506 0010 577f 7c5b 003c cd74 0000 02dc
+
+4500 002a 000f 0000 ff2f 5840 c0a8 7103 c0a8 7101 3081 880b 0006 4000 0000 000a 0000 0009 80fd 0606 0004
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni15 b/contrib/netbsd-tests/ipf/expected/ni15
new file mode 100644
index 0000000..3820d56
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni15
@@ -0,0 +1,63 @@
+4500 0030 0000 4000 8006 9772 c0a8 7101 c0a8 7103 05e7 06bb abf0 4aa5 0000 0000 7002 faf0 21a1 0000 0204 05b4 0101 0402
+
+4500 002c 69a6 4000 4006 6dd0 c0a8 7103 c0a8 7101 06bb 05e7 a564 68da abf0 4aa6 6012 8000 a348 0000 0204 05b4
+
+4500 00c4 0001 4000 8006 96dd c0a8 7101 c0a8 7103 05e7 06bb abf0 4aa6 a564 68db 5018 faf0 e2a0 0000 009c 0001 1a2b 3c4d 0001 0000 0100 0000 0000 0001 0000 0001 0000 0a28 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 4d69 6372 6f73 6f66 7420 5769 6e64 6f77 7320 4e54 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00c4 69a7 4000 4006 6d37 c0a8 7103 c0a8 7101 06bb 05e7 a564 68db abf0 4b42 5018 832c cecf 0000 009c 0001 1a2b 3c4d 0002 0000 0100 0100 0000 0000 0000 0000 0001 0001 6c6f 6361 6c00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 6c69 6e75 7800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00d0 0002 4000 8006 96d0 c0a8 7101 c0a8 7103 05e7 06bb abf0 4b42 a564 6977 5018 fa54 ac07 0000 00a8 0001 1a2b 3c4d 0007 0000 4000 1331 0000 012c 05f5 e100 0000 0003 0000 0003 0040 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 0048 69a8 4000 4006 6db2 c0a8 7103 c0a8 7101 06bb 05e7 a564 6977 abf0 4bea 5018 832c 36fa 0000 0020 0001 1a2b 3c4d 0008 0000 0000 4000 0100 0000 05f5 e100 0040 0000 0000 0000
+
+4500 0040 0003 4000 8006 975f c0a8 7101 c0a8 7103 05e7 06bb abf0 4bea a564 6997 5018 fa34 e810 0000 0018 0001 1a2b 3c4d 000f 0000 0000 0000 ffff ffff ffff ffff
+
+4500 0039 0004 0000 802f d73c c0a8 7101 c0a8 7103 3001 880b 0019 0000 0000 0000 ff03 c021 0100 0015 0104 0578 0506 577f 7c5b 0702 0802 0d03 06
+
+4500 0020 69a9 0000 ff2f eeaf c0a8 7103 c0a8 7101 2081 880b 0000 4000 ffff ffff
+
+4500 0028 69aa 4000 4006 6dd0 c0a8 7103 c0a8 7101 06bb 05e7 a564 6997 abf0 4c02 5010 832c b5c1 0000
+
+4500 0038 69ab 0000 ff2f ee95 c0a8 7103 c0a8 7101 3001 880b 0018 4000 0000 0000 ff03 c021 0101 0014 0206 0000 0000 0506 22d9 0cfa 0702 0802
+
+4500 002f 69ac 0000 ff2f ee9d c0a8 7103 c0a8 7101 3081 880b 000b 4000 0000 0001 0000 0000 ff03 c021 0400 0007 0d03 06
+
+4500 003c 0005 0000 802f d738 c0a8 7101 c0a8 7103 3081 880b 0018 0000 0000 0001 0000 0001 ff03 c021 0201 0014 0206 0000 0000 0506 22d9 0cfa 0702 0802
+
+4500 0036 0006 0000 802f d73d c0a8 7101 c0a8 7103 3001 880b 0016 0000 0000 0002 ff03 c021 0101 0012 0104 0578 0506 577f 7c5b 0702 0802
+
+4500 003a 69ad 0000 ff2f ee91 c0a8 7103 c0a8 7101 3081 880b 0016 4000 0000 0002 0000 0002 ff03 c021 0201 0012 0104 0578 0506 577f 7c5b 0702 0802
+
+4500 0032 69ae 0000 ff2f ee98 c0a8 7103 c0a8 7101 3001 880b 0012 4000 0000 0003 8021 0101 0010 0306 c0a8 0001 0206 002d 0f01
+
+4500 0040 0007 4000 8006 975b c0a8 7101 c0a8 7103 05e7 06bb abf0 4c02 a564 6997 5018 fa34 e7f8 0000 0018 0001 1a2b 3c4d 000f 0000 0000 0000 0000 0000 ffff ffff
+
+4500 0038 0008 0000 802f d739 c0a8 7101 c0a8 7103 3081 880b 0014 0000 0000 0003 0000 0003 c021 0c02 0012 577f 7c5b 4d53 5241 5356 352e 3130
+
+4500 003e 69af 0000 ff2f ee8b c0a8 7103 c0a8 7101 3081 880b 001a 4000 0000 0004 0000 0003 ff03 c021 0702 0016 0c02 0012 577f 7c5b 4d53 5241 5356 352e 3130
+
+4500 003e 0009 0000 802f d732 c0a8 7101 c0a8 7103 3081 880b 001a 0000 0000 0004 0000 0004 c021 0c03 0018 577f 7c5b 4d53 5241 532d 302d 434c 4159 4d4f 4f52
+
+4500 0044 69b0 0000 ff2f ee84 c0a8 7103 c0a8 7101 3081 880b 0020 4000 0000 0005 0000 0004 ff03 c021 0703 001c 0c03 0018 577f 7c5b 4d53 5241 532d 302d 434c 4159 4d4f 4f52
+
+4500 0030 000a 0000 802f d73f c0a8 7101 c0a8 7103 3081 880b 000c 0000 0000 0005 0000 0005 80fd 0104 000a 1206 0100 0001
+
+4500 002a 69b1 0000 ff2f ee9d c0a8 7103 c0a8 7101 3081 880b 0006 4000 0000 0006 0000 0005 80fd 0101 0004
+
+4500 002c 69b2 0000 ff2f ee9a c0a8 7103 c0a8 7101 3001 880b 000c 4000 0000 0007 80fd 0404 000a 1206 0100 0001
+
+4500 0048 000b 0000 802f d726 c0a8 7101 c0a8 7103 3081 880b 0024 0000 0000 0006 0000 0007 8021 0105 0022 0306 0000 0000 8106 0000 0000 8206 0000 0000 8306 0000 0000 8406 0000 0000
+
+4500 0042 69b3 0000 ff2f ee83 c0a8 7103 c0a8 7101 3081 880b 001e 4000 0000 0008 0000 0006 8021 0405 001c 8106 0000 0000 8206 0000 0000 8306 0000 0000 8406 0000 0000
+
+4500 0030 000c 0000 802f d73d c0a8 7101 c0a8 7103 3081 880b 000c 0000 0000 0007 0000 0008 8021 0401 000a 0206 002d 0f01
+
+4500 0030 69b4 0000 ff2f ee94 c0a8 7103 c0a8 7101 3081 880b 000c 4000 0000 0009 0000 0007 8021 0102 000a 0306 c0a8 0001
+
+4500 002a 000d 0000 802f d742 c0a8 7101 c0a8 7103 3081 880b 0006 0000 0000 0008 0000 0009 80fd 0201 0004
+
+4500 0032 000e 0000 802f d739 c0a8 7101 c0a8 7103 3001 880b 0012 0000 0000 0009 80fd 0506 0010 577f 7c5b 003c cd74 0000 02dc
+
+4500 002a 69b5 0000 ff2f ee99 c0a8 7103 c0a8 7101 3081 880b 0006 4000 0000 000a 0000 0009 80fd 0606 0004
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni16 b/contrib/netbsd-tests/ipf/expected/ni16
new file mode 100644
index 0000000..2c34f5c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni16
@@ -0,0 +1,63 @@
+4500 0030 0000 4000 8006 9772 c0a8 7101 c0a8 7103 05e7 06bb abf0 4aa5 0000 0000 7002 faf0 21a1 0000 0204 05b4 0101 0402
+
+4500 002c 69a6 4000 4006 9376 c0a8 7103 0a02 0202 06bb 05e7 a564 68da abf0 4aa6 6012 8000 c8ee 0000 0204 05b4
+
+4500 00c4 0001 4000 8006 96dd c0a8 7101 c0a8 7103 05e7 06bb abf0 4aa6 a564 68db 5018 faf0 e2a0 0000 009c 0001 1a2b 3c4d 0001 0000 0100 0000 0000 0001 0000 0001 0000 0a28 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 4d69 6372 6f73 6f66 7420 5769 6e64 6f77 7320 4e54 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00c4 69a7 4000 4006 92dd c0a8 7103 0a02 0202 06bb 05e7 a564 68db abf0 4b42 5018 832c f475 0000 009c 0001 1a2b 3c4d 0002 0000 0100 0100 0000 0000 0000 0000 0001 0001 6c6f 6361 6c00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 6c69 6e75 7800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 00d0 0002 4000 8006 96d0 c0a8 7101 c0a8 7103 05e7 06bb abf0 4b42 a564 6977 5018 fa54 ac07 0000 00a8 0001 1a2b 3c4d 0007 0000 4000 1331 0000 012c 05f5 e100 0000 0003 0000 0003 0040 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 0048 69a8 4000 4006 9358 c0a8 7103 0a02 0202 06bb 05e7 a564 6977 abf0 4bea 5018 832c 5ca0 0000 0020 0001 1a2b 3c4d 0008 0000 0000 4000 0100 0000 05f5 e100 0040 0000 0000 0000
+
+4500 0040 0003 4000 8006 975f c0a8 7101 c0a8 7103 05e7 06bb abf0 4bea a564 6997 5018 fa34 e810 0000 0018 0001 1a2b 3c4d 000f 0000 0000 0000 ffff ffff ffff ffff
+
+4500 0039 0004 0000 802f d73c c0a8 7101 c0a8 7103 3001 880b 0019 0000 0000 0000 ff03 c021 0100 0015 0104 0578 0506 577f 7c5b 0702 0802 0d03 06
+
+4500 0020 69a9 0000 ff2f 1456 c0a8 7103 0a02 0202 2081 880b 0000 4000 ffff ffff
+
+4500 0028 69aa 4000 4006 9376 c0a8 7103 0a02 0202 06bb 05e7 a564 6997 abf0 4c02 5010 832c db67 0000
+
+4500 0038 69ab 0000 ff2f 143c c0a8 7103 0a02 0202 3001 880b 0018 4000 0000 0000 ff03 c021 0101 0014 0206 0000 0000 0506 22d9 0cfa 0702 0802
+
+4500 002f 69ac 0000 ff2f 1444 c0a8 7103 0a02 0202 3081 880b 000b 4000 0000 0001 0000 0000 ff03 c021 0400 0007 0d03 06
+
+4500 003c 0005 0000 802f d738 c0a8 7101 c0a8 7103 3081 880b 0018 0000 0000 0001 0000 0001 ff03 c021 0201 0014 0206 0000 0000 0506 22d9 0cfa 0702 0802
+
+4500 0036 0006 0000 802f d73d c0a8 7101 c0a8 7103 3001 880b 0016 0000 0000 0002 ff03 c021 0101 0012 0104 0578 0506 577f 7c5b 0702 0802
+
+4500 003a 69ad 0000 ff2f 1438 c0a8 7103 0a02 0202 3081 880b 0016 4000 0000 0002 0000 0002 ff03 c021 0201 0012 0104 0578 0506 577f 7c5b 0702 0802
+
+4500 0032 69ae 0000 ff2f 143f c0a8 7103 0a02 0202 3001 880b 0012 4000 0000 0003 8021 0101 0010 0306 c0a8 0001 0206 002d 0f01
+
+4500 0040 0007 4000 8006 975b c0a8 7101 c0a8 7103 05e7 06bb abf0 4c02 a564 6997 5018 fa34 e7f8 0000 0018 0001 1a2b 3c4d 000f 0000 0000 0000 0000 0000 ffff ffff
+
+4500 0038 0008 0000 802f d739 c0a8 7101 c0a8 7103 3081 880b 0014 0000 0000 0003 0000 0003 c021 0c02 0012 577f 7c5b 4d53 5241 5356 352e 3130
+
+4500 003e 69af 0000 ff2f 1432 c0a8 7103 0a02 0202 3081 880b 001a 4000 0000 0004 0000 0003 ff03 c021 0702 0016 0c02 0012 577f 7c5b 4d53 5241 5356 352e 3130
+
+4500 003e 0009 0000 802f d732 c0a8 7101 c0a8 7103 3081 880b 001a 0000 0000 0004 0000 0004 c021 0c03 0018 577f 7c5b 4d53 5241 532d 302d 434c 4159 4d4f 4f52
+
+4500 0044 69b0 0000 ff2f 142b c0a8 7103 0a02 0202 3081 880b 0020 4000 0000 0005 0000 0004 ff03 c021 0703 001c 0c03 0018 577f 7c5b 4d53 5241 532d 302d 434c 4159 4d4f 4f52
+
+4500 0030 000a 0000 802f d73f c0a8 7101 c0a8 7103 3081 880b 000c 0000 0000 0005 0000 0005 80fd 0104 000a 1206 0100 0001
+
+4500 002a 69b1 0000 ff2f 1444 c0a8 7103 0a02 0202 3081 880b 0006 4000 0000 0006 0000 0005 80fd 0101 0004
+
+4500 002c 69b2 0000 ff2f 1441 c0a8 7103 0a02 0202 3001 880b 000c 4000 0000 0007 80fd 0404 000a 1206 0100 0001
+
+4500 0048 000b 0000 802f d726 c0a8 7101 c0a8 7103 3081 880b 0024 0000 0000 0006 0000 0007 8021 0105 0022 0306 0000 0000 8106 0000 0000 8206 0000 0000 8306 0000 0000 8406 0000 0000
+
+4500 0042 69b3 0000 ff2f 142a c0a8 7103 0a02 0202 3081 880b 001e 4000 0000 0008 0000 0006 8021 0405 001c 8106 0000 0000 8206 0000 0000 8306 0000 0000 8406 0000 0000
+
+4500 0030 000c 0000 802f d73d c0a8 7101 c0a8 7103 3081 880b 000c 0000 0000 0007 0000 0008 8021 0401 000a 0206 002d 0f01
+
+4500 0030 69b4 0000 ff2f 143b c0a8 7103 0a02 0202 3081 880b 000c 4000 0000 0009 0000 0007 8021 0102 000a 0306 c0a8 0001
+
+4500 002a 000d 0000 802f d742 c0a8 7101 c0a8 7103 3081 880b 0006 0000 0000 0008 0000 0009 80fd 0201 0004
+
+4500 0032 000e 0000 802f d739 c0a8 7101 c0a8 7103 3001 880b 0012 0000 0000 0009 80fd 0506 0010 577f 7c5b 003c cd74 0000 02dc
+
+4500 002a 69b5 0000 ff2f 1440 c0a8 7103 0a02 0202 3081 880b 0006 4000 0000 000a 0000 0009 80fd 0606 0004
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni17 b/contrib/netbsd-tests/ipf/expected/ni17
new file mode 100644
index 0000000..74eb4dd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni17
@@ -0,0 +1,7 @@
+< le0 ip #0 40(20) 6 10.2.2.5,2000 > 10.1.1.252,3128
+< le0 ip #0 40(20) 6 10.2.2.6,2000 > 10.1.2.252,3128
+< le0 ip #0 40(20) 6 10.2.2.7,2000 > 10.1.3.252,3128
+< le0 ip #0 40(20) 6 10.2.2.7,2001 > 10.1.3.252,3128
+< le0 ip #0 40(20) 6 10.2.2.8,2000 > 10.1.1.253,3128
+< le0 ip #0 40(20) 6 10.2.2.9,2000 > 10.1.2.253,3128
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni18 b/contrib/netbsd-tests/ipf/expected/ni18
new file mode 100644
index 0000000..defc59c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni18
@@ -0,0 +1,5 @@
+< hme0 ip #0 40(20) 6 2.2.2.2,3000 > 1.1.1.1,80
+< hme0 ip #0 40(20) 6 2.2.2.2,3000 > 192.168.1.1,80
+> hme1 ip #0 40(20) 6 203.1.1.1,10000 > 4.5.6.7,80
+> hme1 ip #0 40(20) 6 10.1.1.2,5050 > 4.5.6.7,80
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni19 b/contrib/netbsd-tests/ipf/expected/ni19
new file mode 100644
index 0000000..e55c75d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni19
@@ -0,0 +1,43 @@
+4500 0040 e3fc 4000 4006 40b5 0a01 0101 0a01 0104 03f1 0202 6523 90b2 0000 0000 b002 8000 a431 0000 0204 05b4 0103 0300 0402 0101 0101 080a 0000 0000 0000 0000
+
+4500 0034 0000 4000 4006 fe13 0a01 0104 c0a8 7103 0202 03f1 915a a5c4 6523 90b3 8012 16d0 e89c 0000 0204 05b4 0101 0402 0103 0302
+
+4500 0028 e3fd 4000 4006 40cc 0a01 0101 0a01 0104 03f1 0202 6523 90b3 915a a5c5 5010 832c e3b7 0000
+
+4500 002d e3fe 4000 4006 40c6 0a01 0101 0a01 0104 03f1 0202 6523 90b3 915a a5c5 5018 832c 8242 0000 3130 3038 00
+
+4500 0028 7ce5 4000 4006 813a 0a01 0104 c0a8 7103 0202 03f1 915a a5c5 6523 90b8 5010 05b4 3a81 0000
+
+4500 003c 1186 4000 4006 ec85 0a01 0104 c0a8 7103 03ff 03f0 91d4 c8a2 0000 0000 a002 16d0 b8c0 0000 0204 05b4 0402 080a 0039 d924 0000 0000 0103 0302
+
+4500 0040 e3ff 4000 4006 40b2 0a01 0101 0a01 0104 03f0 03ff 66e5 b810 91d4 c8a3 b012 8000 452f 0000 0204 05b4 0103 0300 0101 080a 0000 0000 0039 d924 0402 0101
+
+4500 0034 1188 4000 4006 ec8b 0a01 0104 c0a8 7103 03ff 03f0 91d4 c8a3 66e5 b811 8010 05b4 d99b 0000 0101 080a 0039 d925 0000 0000
+
+4500 0030 e400 4000 4006 40c1 0a01 0101 0a01 0104 03f1 0202 6523 90b8 915a a5c5 5018 832c 3560 0000 6461 7272 656e 7200
+
+4500 0028 7ce7 4000 4006 8138 0a01 0104 c0a8 7103 0202 03f1 915a a5c5 6523 90c0 5010 05b4 3a79 0000
+
+4500 0053 e401 4000 4006 409d 0a01 0101 0a01 0104 03f1 0202 6523 90c0 915a a5c5 5018 832c cce7 0000 6461 7272 656e 7200 7368 202d 6320 2265 6368 6f20 666f 6f20 3e26 313b 2065 6368 6f20 6261 7220 3e26 3222 00
+
+4500 0028 7ce9 4000 4006 8136 0a01 0104 c0a8 7103 0202 03f1 915a a5c5 6523 90eb 5010 05b4 3a4e 0000
+
+4500 0029 7ceb 4000 4006 8133 0a01 0104 c0a8 7103 0202 03f1 915a a5c5 6523 90eb 5018 05b4 3a45 0000 00
+
+4500 0028 e403 4000 4006 40c6 0a01 0101 0a01 0104 03f1 0202 6523 90eb 915a a5c6 5010 832c e37e 0000
+
+4500 002c 7ced 4000 4006 812e 0a01 0104 c0a8 7103 0202 03f1 915a a5c6 6523 90eb 5018 05b4 64c7 0000 666f 6f0a
+
+4500 0038 118a 4000 4006 ec85 0a01 0104 c0a8 7103 03ff 03f0 91d4 c8a3 66e5 b811 8018 05b4 00dd 0000 0101 080a 0039 dd6c 0000 0000 6261 720a
+
+4500 0028 7cef 4000 4006 8130 0a01 0104 c0a8 7103 0202 03f1 915a a5ca 6523 90eb 5011 05b4 3a48 0000
+
+4500 0034 118c 4000 4006 ec87 0a01 0104 c0a8 7103 03ff 03f0 91d4 c8a7 66e5 b811 8011 05b4 d54e 0000 0101 080a 0039 dd6d 0000 0000
+
+0
+0
+0
+0
+0
+0
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni2 b/contrib/netbsd-tests/ipf/expected/ni2
new file mode 100644
index 0000000..69a5272
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni2
@@ -0,0 +1,19 @@
+4510 002c 0000 4000 3e06 78df 0101 0101 c0a8 0133 9c40 0077 a664 2485 0000 0000 6002 4000 2ca8 0000 0204 05b4
+
+4500 002c ce83 4000 7e06 606b c0a8 0133 0a01 0201 0077 05f6 fbdf 1a21 a664 2486 6012 2238 c0a8 0000 0204 05b4
+
+4510 0028 0001 4000 3e06 78e2 0101 0101 c0a8 0133 9c40 0077 a664 2486 fbdf 1a22 5010 4470 29e3 0000
+
+4500 005b cf83 4000 7e06 5f3c c0a8 0133 0a01 0201 0077 05f6 fbdf 1a22 a664 2486 5018 2238 ce2a 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0a
+
+4510 0028 0002 4000 3e06 78e1 0101 0101 c0a8 0133 9c40 0077 a664 2486 fbdf 1a55 5010 4470 29b0 0000
+
+4510 002e 0003 4000 3e06 78da 0101 0101 c0a8 0133 9c40 0077 a664 2486 fbdf 1a55 5018 4470 1c98 0000 0000 0000 0d0a
+
+4500 0048 e383 4000 7e06 4b4f c0a8 0133 0a01 0201 0077 05f6 fbdf 1a55 a664 248c 5018 2232 d80a 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 05dc e483 4000 7e06 44bb c0a8 0133 0a01 0201 0077 05f6 fbdf 1a75 a664 248c 5010 2232 9f2d 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3331 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+4500 0038 0004 4000 4001 76e4 0101 0101 c0a8 0133 0304 444f 0000 05a0 4500 05dc e483 4000 7e06 4ebb c0a8 0133 0101 0101 0077 9c40 fbdf 1a75
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni20 b/contrib/netbsd-tests/ipf/expected/ni20
new file mode 100644
index 0000000..913ef0b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni20
@@ -0,0 +1,69 @@
+4500 0040 e3fc 4000 4006 f362 c0a8 7103 c0a8 7104 03f1 0202 6523 90b2 0000 0000 b002 8000 56df 0000 0204 05b4 0103 0300 0402 0101 0101 080a 0000 0000 0000 0000
+
+4500 0034 0000 4000 4006 fe13 0a01 0104 c0a8 7103 0202 03f1 915a a5c4 6523 90b3 8012 16d0 e89c 0000 0204 05b4 0101 0402 0103 0302
+
+4500 0028 e3fd 4000 4006 f379 c0a8 7103 c0a8 7104 03f1 0202 6523 90b3 915a a5c5 5010 832c 9665 0000
+
+4500 002d e3fe 4000 4006 f373 c0a8 7103 c0a8 7104 03f1 0202 6523 90b3 915a a5c5 5018 832c 34f0 0000 3130 3038 00
+
+4500 0028 7ce5 4000 4006 813a 0a01 0104 c0a8 7103 0202 03f1 915a a5c5 6523 90b8 5010 05b4 3a81 0000
+
+4500 003c 1186 4000 4006 ec85 0a01 0104 c0a8 7103 03ff 03f0 91d4 c8a2 0000 0000 a002 16d0 b8c0 0000 0204 05b4 0402 080a 0039 d924 0000 0000 0103 0302
+
+4500 0040 e3ff 4000 4006 f35f c0a8 7103 c0a8 7104 03f0 03ff 66e5 b810 91d4 c8a3 b012 8000 f7dc 0000 0204 05b4 0103 0300 0101 080a 0000 0000 0039 d924 0402 0101
+
+4500 0034 1188 4000 4006 ec8b 0a01 0104 c0a8 7103 03ff 03f0 91d4 c8a3 66e5 b811 8010 05b4 d99b 0000 0101 080a 0039 d925 0000 0000
+
+4500 0030 e400 4000 4006 f36e c0a8 7103 c0a8 7104 03f1 0202 6523 90b8 915a a5c5 5018 832c e80d 0000 6461 7272 656e 7200
+
+4500 0028 7ce7 4000 4006 8138 0a01 0104 c0a8 7103 0202 03f1 915a a5c5 6523 90c0 5010 05b4 3a79 0000
+
+4500 0053 e401 4000 4006 f34a c0a8 7103 c0a8 7104 03f1 0202 6523 90c0 915a a5c5 5018 832c 7f95 0000 6461 7272 656e 7200 7368 202d 6320 2265 6368 6f20 666f 6f20 3e26 313b 2065 6368 6f20 6261 7220 3e26 3222 00
+
+4500 0028 7ce9 4000 4006 8136 0a01 0104 c0a8 7103 0202 03f1 915a a5c5 6523 90eb 5010 05b4 3a4e 0000
+
+4500 0029 7ceb 4000 4006 8133 0a01 0104 c0a8 7103 0202 03f1 915a a5c5 6523 90eb 5018 05b4 3a45 0000 00
+
+4500 0028 e403 4000 4006 f373 c0a8 7103 c0a8 7104 03f1 0202 6523 90eb 915a a5c6 5010 832c 962c 0000
+
+4500 002c 7ced 4000 4006 812e 0a01 0104 c0a8 7103 0202 03f1 915a a5c6 6523 90eb 5018 05b4 64c7 0000 666f 6f0a
+
+4500 0038 118a 4000 4006 ec85 0a01 0104 c0a8 7103 03ff 03f0 91d4 c8a3 66e5 b811 8018 05b4 00dd 0000 0101 080a 0039 dd6c 0000 0000 6261 720a
+
+4500 0028 7cef 4000 4006 8130 0a01 0104 c0a8 7103 0202 03f1 915a a5ca 6523 90eb 5011 05b4 3a48 0000
+
+4500 0034 118c 4000 4006 ec87 0a01 0104 c0a8 7103 03ff 03f0 91d4 c8a7 66e5 b811 8011 05b4 d54e 0000 0101 080a 0039 dd6d 0000 0000
+
+0
+0
+0
+0
+0
+0
+List of active MAP/Redirect filters:
+rdr bge0 10.1.1.4/32 port 514 -> 192.168.113.4/32 port 514 tcp proxy rcmd
+
+List of active sessions:
+MAP 192.168.113.4 1023 <- -> 10.1.1.4 1023 [192.168.113.3 1008]
+RDR 192.168.113.4 514 <- -> 10.1.1.4 514 [192.168.113.3 1009]
+ proxy active
+
+Hostmap table:
+192.168.113.4,192.168.113.3 -> 10.1.1.4,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+5 block in all
+1 pass in quick on bge0 proto tcp from any to any port = 514 flags S/FSRPAU keep state
+Rules configured (set 0, out)
+2 block out all
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni21 b/contrib/netbsd-tests/ipf/expected/ni21
new file mode 100644
index 0000000..53e64a5
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni21
@@ -0,0 +1,6 @@
+> eri0 ip #0 20(20) 0 4.4.4.4 > 3.3.3.3
+0
+< lan0 ip #0 20(20) 0 3.3.3.3 > 2.2.2.2
+> eri0 ip #0 20(20) 0 4.4.4.4 > 3.3.3.3
+0
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni23 b/contrib/netbsd-tests/ipf/expected/ni23
new file mode 100644
index 0000000..586373c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni23
@@ -0,0 +1,37 @@
+> ppp0 ip #0 28(20) 17 4.4.4.4,6700 > 2.2.2.2,4500
+0
+< hme0 ip #0 28(20) 17 2.2.2.2,4500 > 3.3.3.1,6700
+> bge0 ip #0 28(20) 17 1.1.2.3,4500 > 3.3.3.1,6700
+List of active MAP/Redirect filters:
+rdr le0,bge0 1.1.0.0/16 -> 2.2.2.2/32 ip
+map hme0,ppp0 3.3.3.0/24 -> 4.4.4.4/32
+
+List of active sessions:
+MAP 3.3.3.1 6700 <- -> 4.4.4.4 6700 [2.2.2.2 4500]
+RDR 2.2.2.2 4500 <- -> 1.1.2.3 4500 [3.3.3.1 6700]
+
+Hostmap table:
+3.3.3.1,2.2.2.2 -> 4.4.4.4,0.0.0.0 (use = 1)
+List of active state sessions:
+4:udp src:3.3.3.1,6700 dst:2.2.2.2,4500 24
+ FWD: IN pkts 1 bytes 28 OUT pkts 1 bytes 28
+ REV: IN pkts 1 bytes 28 OUT pkts 1 bytes 28
+ tag 0 pass 0x2008402 = pass in keep state
+ interfaces: in X[le0],X[hme0] out X[ppp0],X[bge0]
+ Sync status: not synchronized
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+1 block in all
+1 pass in on le0,hme0 to ppp0:3.3.3.254 out-via ppp0,bge0 inet proto udp from any to any keep state
+Rules configured (set 0, out)
+0 block out all
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni3 b/contrib/netbsd-tests/ipf/expected/ni3
new file mode 100644
index 0000000..107d5d9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni3
@@ -0,0 +1,7 @@
+4500 003c 0000 4000 ff06 67a8 0606 0606 0404 0404 5000 0050 0000 0001 0000 0000 a002 16d0 d0da 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 809a 0000 ff01 3121 0303 0303 0202 0202 0303 acab 0000 0000 4500 003c 4706 4000 ff06 28aa 0202 0202 0404 0404 5000 0050 0000 0001
+
+4500 0058 809a 0000 ff01 3101 0303 0303 0202 0202 0303 0937 0000 0000 4500 003c 4706 4000 ff06 28aa 0202 0202 0404 0404 5000 0050 0000 0001 0000 0000 a002 16d0 d8e2 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni4 b/contrib/netbsd-tests/ipf/expected/ni4
new file mode 100644
index 0000000..627aa19
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni4
@@ -0,0 +1,7 @@
+4500 003c 0000 4000 ff06 67a8 0606 0606 0404 0404 9c40 0050 0000 0001 0000 0000 a002 16d0 849a 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 809a 0000 ff01 3121 0303 0303 0202 0202 0303 acac 0000 0000 4500 003c 4706 4000 ff06 28aa 0202 0202 0404 0404 5000 0050 0000 0001
+
+4500 0058 809a 0000 ff01 3101 0303 0303 0202 0202 0303 0937 0000 0000 4500 003c 4706 4000 ff06 28aa 0202 0202 0404 0404 5000 0050 0000 0001 0000 0000 a002 16d0 d8e2 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni5 b/contrib/netbsd-tests/ipf/expected/ni5
new file mode 100644
index 0000000..14d9837
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni5
@@ -0,0 +1,96 @@
+4500 002c 0000 4000 ff06 02fc 0101 0101 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 f5a2 0000 0204 05b4
+
+4500 002c ffdd 4000 ef06 5374 96cb e002 c0a8 0103 0015 8032 3786 76c4 bd6b c9c9 6012 269c 8369 0000 0204 0584
+
+4500 0028 0001 4000 ff06 02ff 0101 0101 96cb e002 8032 0015 bd6b c9c9 3786 76c5 5010 269c 5aa0 0000
+
+ipf_p_ftp_servert_valid:i(0) < 5
+4500 006f ffde 4000 ef06 5330 96cb e002 c0a8 0103 0015 8032 3786 76c5 bd6b c9c9 5018 269c 967e 0000 3232 302d 636f 6f6d 6273 2e61 6e75 2e65 6475 2e61 7520 4e63 4654 5064 2053 6572 7665 7220 2866 7265 6520 6564 7563 6174 696f 6e61 6c20 6c69 6365 6e73 6529 2072 6561 6479 2e0d 0a
+
+4500 0028 0002 4000 ff06 02fe 0101 0101 96cb e002 8032 0015 bd6b c9c9 3786 770c 5010 269c 5a59 0000
+
+4500 00c7 ffdf 4000 ef06 52d7 96cb e002 c0a8 0103 0015 8032 3786 770c bd6b c9c9 5018 269c 1087 0000 3232 302d 0d0a 3232 302d 4d61 696e 7461 696e 6564 2062 7920 5253 5353 2061 6e64 2052 5350 4153 2049 5420 5374 6166 6620 2870 7265 7669 6f75 736c 7920 6b6e 6f77 6e20 6173 2043 6f6f 6d62 7320 436f 6d70 7574 696e 6720 556e 6974 290d 0a32 3230 2d41 6e79 2070 726f 626c 656d 7320 636f 6e74 6163 7420 6674 706d 6173 7465 7240 636f 6f6d 6273 2e61 6e75 2e65 6475 2e61 750d 0a32 3230 2d0d 0a32 3230 200d 0a
+
+4500 0028 0003 4000 ff06 02fd 0101 0101 96cb e002 8032 0015 bd6b c9c9 3786 77ab 5010 269c 59ba 0000
+
+4500 0038 0004 4000 ff06 02ec 0101 0101 96cb e002 8032 0015 bd6b c9c9 3786 77ab 5018 269c d1c5 0000 5553 4552 2061 6e6f 6e79 6d6f 7573 0d0a
+
+4500 0028 ffe0 4000 ef06 5375 96cb e002 c0a8 0103 0015 8032 3786 77ab bd6b c9d9 5010 269c 9a00 0000
+
+4500 006c ffe1 4000 ef06 5330 96cb e002 c0a8 0103 0015 8032 3786 77ab bd6b c9d9 5018 269c b00f 0000 3333 3120 4775 6573 7420 6c6f 6769 6e20 6f6b 2c20 7365 6e64 2079 6f75 7220 636f 6d70 6c65 7465 2065 2d6d 6169 6c20 6164 6472 6573 7320 6173 2070 6173 7377 6f72 642e 0d0a
+
+4500 0028 0005 4000 ff06 02fb 0101 0101 96cb e002 8032 0015 bd6b c9d9 3786 77ef 5010 269c 5966 0000
+
+4500 0036 0006 4000 ff06 02ec 0101 0101 96cb e002 8032 0015 bd6b c9d9 3786 77ef 5018 269c 373f 0000 5041 5353 2061 7661 6c6f 6e40 0d0a
+
+ipf_p_ftp_servert_valid:i(0) < 5
+4500 005f ffe2 4000 ef06 533c 96cb e002 c0a8 0103 0015 8032 3786 77ef bd6b c9e7 5018 269c 895e 0000 3233 302d 596f 7520 6172 6520 7573 6572 2023 3420 6f66 2035 3020 7369 6d75 6c74 616e 656f 7573 2075 7365 7273 2061 6c6c 6f77 6564 2e0d 0a
+
+4500 0028 0007 4000 ff06 02f9 0101 0101 96cb e002 8032 0015 bd6b c9e7 3786 7826 5010 269c 5921 0000
+
+4500 0099 ffe3 4000 ef06 5301 96cb e002 c0a8 0103 0015 8032 3786 7826 bd6b c9e7 5018 269c d399 0000 3233 302d 0d0a 3233 302d 0d0a 3233 302d 4869 2e20 2057 6527 7265 2063 6c65 616e 696e 6720 7570 2e20 2041 6e79 2066 6565 6462 6163 6b20 6d6f 7374 2077 656c 636f 6d65 2e20 3130 2041 7567 2030 300d 0a32 3330 2d0d 0a32 3330 204c 6f67 6765 6420 696e 2061 6e6f 6e79 6d6f 7573 6c79 2e0d 0a
+
+4500 0028 0008 4000 ff06 02f8 0101 0101 96cb e002 8032 0015 bd6b c9e7 3786 7897 5010 269c 58b0 0000
+
+4500 0030 0009 4000 ff06 02ef 0101 0101 96cb e002 8032 0015 bd6b c9e7 3786 7897 5018 269c 86ae 0000 5459 5045 2049 0d0a
+
+4500 0038 ffe4 4000 ef06 5361 96cb e002 c0a8 0103 0015 8032 3786 7897 bd6b c9ef 5018 269c 5fae 0000 3230 3020 5479 7065 206f 6b61 792e 0d0a
+
+4500 0028 000a 4000 ff06 02f6 0101 0101 96cb e002 8032 0015 bd6b c9ef 3786 78a7 5010 269c 5898 0000
+
+4500 003d 000b 4000 ff06 02e0 0101 0101 96cb e002 8032 0015 bd6b c9ef 3786 78a7 5018 269c 4b67 0000 504f 5254 2031 2c31 2c31 2c31 2c31 3238 2c35 310d 0a
+
+4500 0046 ffe5 4000 ef06 5352 96cb e002 c0a8 0103 0015 8032 3786 78a7 bd6b ca0c 5018 269c dbc3 0000 3230 3020 504f 5254 2063 6f6d 6d61 6e64 2073 7563 6365 7373 6675 6c2e 0d0a
+
+4500 0030 000c 4000 ff06 02ec 0101 0101 96cb e002 8032 0015 bd6b ca04 3786 78c5 5018 269c 866b 0000 5459 5045 2041 0d0a
+
+4500 0038 ffe6 4000 ef06 535f 96cb e002 c0a8 0103 0015 8032 3786 78c5 bd6b ca14 5018 269c 5f5b 0000 3230 3020 5479 7065 206f 6b61 792e 0d0a
+
+4500 002e 000d 4000 ff06 02ed 0101 0101 96cb e002 8032 0015 bd6b ca0c 3786 78d5 5018 269c a994 0000 4e4c 5354 0d0a
+
+4500 002c ffe7 4000 ef06 536a 96cb e002 c0a8 0103 0014 8033 d9f8 11d4 0000 0000 6002 2238 d190 0000 0204 0584
+
+4500 002c 000e 4000 ff06 02ee 0101 0101 96cb e002 8033 0014 bd78 5c12 d9f8 11d5 6012 02f8 96de 0000 0204 0584
+
+4500 0028 ffe8 4000 ef06 536d 96cb e002 c0a8 0103 0014 8033 d9f8 11d5 bd78 5c13 5010 269c cb1d 0000
+
+4500 005d ffe9 4000 ef06 5337 96cb e002 c0a8 0103 0015 8032 3786 78d5 bd6b ca1a 5018 269c eed0 0000 3135 3020 4f70 656e 696e 6720 4153 4349 4920 6d6f 6465 2064 6174 6120 636f 6e6e 6563 7469 6f6e 2066 6f72 202f 6269 6e2f 6c73 2e0d 0a
+
+4500 0028 000f 4000 ff06 02f1 0101 0101 96cb e002 8033 0014 bd78 5c13 d9f8 11d5 5010 6348 4e1b 0000
+
+4500 003d 0010 4000 ff06 02db 0101 0101 96cb e002 8032 0015 bd6b ca12 3786 78d5 5018 269c 4a16 0000 504f 5254 2031 2c31 2c31 2c31 2c31 3238 2c35 320d 0a
+
+4500 0046 ffea 4000 ef06 534d 96cb e002 c0a8 0103 0015 8032 3786 78d5 bd6b ca37 5018 269c db6a 0000 3230 3020 504f 5254 2063 6f6d 6d61 6e64 2073 7563 6365 7373 6675 6c2e 0d0a
+
+4500 0030 0011 4000 ff06 02e7 0101 0101 96cb e002 8032 0015 bd6b ca27 3786 78f3 5018 269c 861a 0000 5459 5045 2041 0d0a
+
+4500 0038 ffeb 4000 ef06 535a 96cb e002 c0a8 0103 0015 8032 3786 78f3 bd6b ca3f 5018 269c 5ef2 0000 3230 3020 5479 7065 206f 6b61 793e 0d0a
+
+4500 002e 0012 4000 ff06 02e8 0101 0101 96cb e002 8032 0015 bd6b ca2f 3786 7903 5018 269c a943 0000 4e4c 5354 0d0a
+
+4500 002c ffec 4000 ef06 5365 96cb e002 c0a8 0103 0014 8034 d9f8 11d4 0000 0000 6002 2238 d18f 0000 0204 0584
+
+4500 002c 0013 4000 ff06 02e9 0101 0101 96cb e002 8034 0014 bd78 5c12 d9f8 11d5 6012 02f8 96dd 0000 0204 0584
+
+4500 0028 ffec 4000 ef06 5369 96cb e002 c0a8 0103 0014 8034 d9f8 11d4 0000 0000 5010 2238 e90d 0000
+
+0
+0
+0
+0
+0
+0
+4500 0040 fff0 4000 ef06 534d 96cb e002 c0a8 0103 0015 8032 3786 7903 bd6b ca3f 5018 269c 7c80 0000 3232 3620 4c69 7374 696e 6720 636f 6d70 6c65 7465 642e 0d0a
+
+4500 0028 0014 4000 ff06 02ec 0101 0101 96cb e002 8032 0015 bd6b ca2f 3786 791b 5010 269c 57e4 0000
+
+4500 002e 0015 4000 ff06 02e5 0101 0101 96cb e002 8032 0015 bd6b ca2f 3786 791b 5018 269c b022 0000 5155 4954 0d0a
+
+4500 0036 fff2 4000 ef06 5355 96cb e002 c0a8 0103 0015 8032 3786 791b bd6b ca45 5018 269c a936 0000 3232 3120 476f 6f64 6279 652e 0d0a
+
+4500 0028 0016 4000 ff06 02ea 0101 0101 96cb e002 8032 0015 bd6b ca35 3786 7929 5011 269c 57cf 0000
+
+0
+0
+0
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni6 b/contrib/netbsd-tests/ipf/expected/ni6
new file mode 100644
index 0000000..e70412b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni6
@@ -0,0 +1,63 @@
+< nf0 ip #52618 84(20) 17 192.168.6.1,32885 > 192.168.7.1,111
+> qfe0 ip #0 84(20) 17 192.168.7.2,32885 > 192.168.7.1,111
+< qfe0 ip #52611 56(20) 17 192.168.7.1,111 > 192.168.6.1,32885
+> nf0 ip #1 56(20) 17 192.168.6.2,111 > 192.168.6.1,32885
+< nf0 ip #54694 68(20) 17 192.168.6.1,32991 > 192.168.7.1,2049
+> qfe0 ip #2 68(20) 17 192.168.7.2,32991 > 192.168.7.1,2049
+< qfe0 ip #0 52(20) 17 192.168.7.1,2049 > 192.168.6.1,32991
+> nf0 ip #3 52(20) 17 192.168.6.2,2049 > 192.168.6.1,32991
+List of active MAP/Redirect filters:
+rdr nf0 192.168.6.2/32 port 111 -> 192.168.7.1/32 port 111 udp proxy rpcbu
+rdr nf0 192.168.6.2/32 port 111 -> 192.168.7.1/32 port 111 tcp proxy rpcbt
+map qfe0 192.168.6.0/24 -> 192.168.7.2/32
+
+List of active sessions:
+MAP 192.168.6.1 32991 <- -> 192.168.7.2 32991 [192.168.7.1 2049]
+RDR 192.168.7.1 2049 <- -> 192.168.6.2 2049 [192.168.6.1 32991]
+RDR CLONE 192.168.7.1 2049 <- -> 192.168.6.2 2049 [192.168.6.1 0]
+MAP 192.168.6.1 32885 <- -> 192.168.7.2 32885 [192.168.7.1 111]
+RDR 192.168.7.1 111 <- -> 192.168.6.2 111 [192.168.6.1 32885]
+ proxy active
+
+Hostmap table:
+192.168.6.1,192.168.7.1 -> 192.168.7.2,0.0.0.0 (use = 2)
+List of active state sessions:
+4:udp src:192.168.6.1,32991 dst:192.168.7.1,2049 24
+ FWD: IN pkts 2 bytes 96 OUT pkts 1 bytes 68
+ REV: IN pkts 1 bytes 52 OUT pkts 1 bytes 52
+ tag 0 pass 0x502 = pass in quick keep state
+ interfaces: in X[nf0],X[qfe0] out X[qfe0],X[nf0]
+ Sync status: not synchronized
+4:udp src:192.168.6.1,* dst:192.168.7.1,2049 240 CLONE
+ FWD: IN pkts 1 bytes 28 OUT pkts 0 bytes 0
+ REV: IN pkts 0 bytes 0 OUT pkts 0 bytes 0
+ tag 0 pass 0x502 = pass in quick keep state
+ interfaces: in X[nf0],X[] out X[],X[]
+ Sync status: not synchronized
+4:udp src:192.168.6.1,32885 dst:192.168.7.1,111 24
+ FWD: IN pkts 1 bytes 84 OUT pkts 1 bytes 84
+ REV: IN pkts 1 bytes 56 OUT pkts 1 bytes 56
+ tag 0 pass 0x2008502 = pass in quick keep state
+ interfaces: in X[nf0],X[qfe0] out X[qfe0],X[nf0]
+ Sync status: not synchronized
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+0 pass in quick on nf0 proto tcp from any to any port = 111 flags S/FSRPAU keep state
+1 pass in quick on nf0 proto udp from any to any port = 111 keep state
+0 block return-rst in log quick on nf0 proto tcp from any to any
+0 block in log quick on nf0 inet from 192.168.7.0/24 to any
+0 block return-rst in log quick on qfe0 proto tcp from any to any
+0 block in log quick on qfe0 inet from 192.168.6.0/24 to any
+Rules configured (set 0, out)
+0 block out log quick on qfe0 inet from 192.168.7.0/24 to any
+0 block out log quick on nf0 inet from 192.168.6.0/24 to any
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni7 b/contrib/netbsd-tests/ipf/expected/ni7
new file mode 100644
index 0000000..38c39ab
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni7
@@ -0,0 +1,5 @@
+4500 0028 4706 4000 0111 1eac 0404 0404 0606 0606 afc9 829e 0014 6308 0402 0000 3be5 468d 000a cfc3
+
+4500 0038 0000 0000 ff01 afb9 0202 0202 0404 0404 0b00 f91c 0000 0000 4500 0028 4706 4000 0111 26b4 0404 0404 0202 0202 afc9 829e 0014 c966
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni8 b/contrib/netbsd-tests/ipf/expected/ni8
new file mode 100644
index 0000000..e0d5182
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni8
@@ -0,0 +1,9 @@
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101 5000 9d58 0000 0001 0000 0000 a002 16d0 3ddc 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 0000 0000 ff01 a7b9 0a02 0202 0404 0404 0303 a7fc 0000 0000 4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202 5000 0500 0000 0001
+
+4500 0058 0001 0000 ff01 a798 0a02 0202 0404 0404 0303 1137 0000 0000 4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202 5000 0500 0000 0001 0000 0000 a002 16d0 cc32 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 0002 0000 ff01 abb3 0303 0303 0505 0505 0303 0fa3 0000 0000 4500 003c 4706 4000 ff06 2aab 0404 0404 0101 0102 5000 9d58 0000 0001
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/ni9 b/contrib/netbsd-tests/ipf/expected/ni9
new file mode 100644
index 0000000..1eb6fbc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/ni9
@@ -0,0 +1,9 @@
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101 5000 9c40 0000 0001 0000 0000 a002 16d0 3ef4 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 0000 0000 ff01 adb7 0303 0303 0404 0404 0303 0fa3 0000 0000 4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101 5000 9d58 0000 0001
+
+4500 0058 0001 0000 ff01 ad96 0303 0303 0404 0404 0303 0735 0000 0000 4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101 5000 9d58 0000 0001 0000 0000 a002 16d0 3ddc 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+4500 0038 0002 0000 ff01 abb3 0303 0303 0505 0505 0303 0fa3 0000 0000 4500 003c 4706 4000 ff06 2aab 0404 0404 0101 0102 5000 9d58 0000 0001
+
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p1 b/contrib/netbsd-tests/ipf/expected/p1
new file mode 100644
index 0000000..58dc681
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p1
@@ -0,0 +1,30 @@
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+table role=ipf type=tree number=100
+ { 1.1.1.1/32; ! 2.2.0.0/16; 2.2.2.0/24; ef00::5/128; };
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+2 pass in from pool/100 to any
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p10 b/contrib/netbsd-tests/ipf/expected/p10
new file mode 100644
index 0000000..9f09502
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p10
@@ -0,0 +1,40 @@
+< bge0 ip #0 40(20) 6 5.5.5.5,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.5.6,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.5.7,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.5.8,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.5.9,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.6.5,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.6.6,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.6.7,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.8,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.9,10000 > 1.1.1.9,80
+List of active MAP/Redirect filters:
+rewrite in on bge0 proto tcp from 0/0 to 0/0 port = 80 -> src 0/0 dst dstlist/servers;
+
+List of active sessions:
+RWR-RDR 5.5.6.9 10000 9.9.9.9 80 <- -> 5.5.6.9 10000 1.1.1.9 80
+RWR-RDR 5.5.6.8 10000 9.9.9.9 80 <- -> 5.5.6.8 10000 1.1.1.5 80
+RWR-RDR 5.5.6.7 10000 9.9.9.9 80 <- -> 5.5.6.7 10000 1.1.1.5 80
+RWR-RDR 5.5.6.6 10000 9.9.9.9 80 <- -> 5.5.6.6 10000 1.1.1.9 80
+RWR-RDR 5.5.6.5 10000 9.9.9.9 80 <- -> 5.5.6.5 10000 1.1.1.4 80
+RWR-RDR 5.5.5.9 10000 9.9.9.9 80 <- -> 5.5.5.9 10000 1.1.1.4 80
+RWR-RDR 5.5.5.8 10000 9.9.9.9 80 <- -> 5.5.5.8 10000 1.1.1.9 80
+RWR-RDR 5.5.5.7 10000 9.9.9.9 80 <- -> 5.5.5.7 10000 1.1.1.2 80
+RWR-RDR 5.5.5.6 10000 9.9.9.9 80 <- -> 5.5.5.6 10000 1.1.1.9 80
+RWR-RDR 5.5.5.5 10000 9.9.9.9 80 <- -> 5.5.5.5 10000 1.1.1.2 80
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p11 b/contrib/netbsd-tests/ipf/expected/p11
new file mode 100644
index 0000000..e907fbb
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p11
@@ -0,0 +1,40 @@
+< bge0 ip #0 40(20) 6 5.5.5.5,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.5.6,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.5.7,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.5.8,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.5.9,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.5,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.6,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.7,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.8,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.9,10000 > 1.1.1.5,80
+List of active MAP/Redirect filters:
+rewrite in on bge0 proto tcp from 0/0 to 0/0 port = 80 -> src 0/0 dst dstlist/servers;
+
+List of active sessions:
+RWR-RDR 5.5.6.9 10000 9.9.9.9 80 <- -> 5.5.6.9 10000 1.1.1.5 80
+RWR-RDR 5.5.6.8 10000 9.9.9.9 80 <- -> 5.5.6.8 10000 1.1.1.5 80
+RWR-RDR 5.5.6.7 10000 9.9.9.9 80 <- -> 5.5.6.7 10000 1.1.1.5 80
+RWR-RDR 5.5.6.6 10000 9.9.9.9 80 <- -> 5.5.6.6 10000 1.1.1.5 80
+RWR-RDR 5.5.6.5 10000 9.9.9.9 80 <- -> 5.5.6.5 10000 1.1.1.5 80
+RWR-RDR 5.5.5.9 10000 9.9.9.9 80 <- -> 5.5.5.9 10000 1.1.1.5 80
+RWR-RDR 5.5.5.8 10000 9.9.9.9 80 <- -> 5.5.5.8 10000 1.1.1.5 80
+RWR-RDR 5.5.5.7 10000 9.9.9.9 80 <- -> 5.5.5.7 10000 1.1.1.5 80
+RWR-RDR 5.5.5.6 10000 9.9.9.9 80 <- -> 5.5.5.6 10000 1.1.1.5 80
+RWR-RDR 5.5.5.5 10000 9.9.9.9 80 <- -> 5.5.5.5 10000 1.1.1.5 80
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p12 b/contrib/netbsd-tests/ipf/expected/p12
new file mode 100644
index 0000000..d097d51
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p12
@@ -0,0 +1,40 @@
+< bge0 ip #0 40(20) 6 5.5.5.5,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.5.6,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.5.7,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.5.8,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.5.9,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.6.5,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.6.6,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.6.7,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.6.8,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.6.9,10000 > 1.1.1.5,80
+List of active MAP/Redirect filters:
+rewrite in on bge0 proto tcp from 0/0 to 0/0 port = 80 -> src 0/0 dst dstlist/servers;
+
+List of active sessions:
+RWR-RDR 5.5.6.9 10000 9.9.9.9 80 <- -> 5.5.6.9 10000 1.1.1.5 80
+RWR-RDR 5.5.6.8 10000 9.9.9.9 80 <- -> 5.5.6.8 10000 1.1.1.9 80
+RWR-RDR 5.5.6.7 10000 9.9.9.9 80 <- -> 5.5.6.7 10000 1.1.1.9 80
+RWR-RDR 5.5.6.6 10000 9.9.9.9 80 <- -> 5.5.6.6 10000 1.1.1.4 80
+RWR-RDR 5.5.6.5 10000 9.9.9.9 80 <- -> 5.5.6.5 10000 1.1.1.4 80
+RWR-RDR 5.5.5.9 10000 9.9.9.9 80 <- -> 5.5.5.9 10000 1.1.1.9 80
+RWR-RDR 5.5.5.8 10000 9.9.9.9 80 <- -> 5.5.5.8 10000 1.1.1.4 80
+RWR-RDR 5.5.5.7 10000 9.9.9.9 80 <- -> 5.5.5.7 10000 1.1.1.4 80
+RWR-RDR 5.5.5.6 10000 9.9.9.9 80 <- -> 5.5.5.6 10000 1.1.1.5 80
+RWR-RDR 5.5.5.5 10000 9.9.9.9 80 <- -> 5.5.5.5 10000 1.1.1.2 80
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p13 b/contrib/netbsd-tests/ipf/expected/p13
new file mode 100644
index 0000000..aa529ea
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p13
@@ -0,0 +1,30 @@
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+table role=all type=tree number=100
+ { 1.1.1.1/32; ! 2.2.0.0/16; 2.2.2.0/24; ef00::5/128; };
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+2 pass in from pool/100 to any
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p2 b/contrib/netbsd-tests/ipf/expected/p2
new file mode 100644
index 0000000..5388742
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p2
@@ -0,0 +1,35 @@
+block
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+# 'anonymous' table refs 2
+table role=ipf type=hash number=2147483650 size=3
+ { 127.0.0.1/32; 4.4.0.0/16; };
+# 'anonymous' table refs 2
+table role=ipf type=hash number=2147483649 size=3
+ { 127.0.0.1/32; 4.4.0.0/16; };
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+1 block in from hash/2147483650 to any
+Rules configured (set 0, out)
+2 pass out from hash/2147483649 to any
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p3 b/contrib/netbsd-tests/ipf/expected/p3
new file mode 100644
index 0000000..c1e0343
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p3
@@ -0,0 +1,45 @@
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+block
+nomatch
+nomatch
+pass
+nomatch
+block
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+group-map out role=ipf number=2010 size=5
+ { 2.2.2.2/32, group=2020; 4.4.0.0/16, group=2020; 5.0.0.0/8, group=2040; };
+group-map in role=ipf number=1010 size=3
+ { 1.1.1.1/32, group=1020; 3.3.0.0/16, group=1030; };
+List of groups configured (set 0)
+Dev.0. Group 1020 Ref 2 Flags 0x8000
+2 pass in all group 1020
+Dev.0. Group 1030 Ref 2 Flags 0x8000
+2 block in all group 1030
+Dev.0. Group 2020 Ref 3 Flags 0x4000
+4 pass out all group 2020
+Dev.0. Group 2040 Ref 2 Flags 0x4000
+2 block out all group 2040
+List of groups configured (set 1)
+Rules configured (set 0, in)
+6 call now srcgrpmap/1010 in all
+Rules configured (set 0, out)
+6 call now dstgrpmap/2010 out all
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p4 b/contrib/netbsd-tests/ipf/expected/p4
new file mode 100644
index 0000000..e7aa73f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p4
@@ -0,0 +1,38 @@
+< anon0 ip #0 20(20) 0 127.0.0.1 > 127.0.0.1
+< anon0 ip #0 20(20) 0 1.1.1.1 > 1.2.1.1
+> anon0 ip #0 20(20) 0 127.0.0.1 > 127.0.0.1
+> anon0 ip #0 20(20) 0 1.2.3.4 > 1.2.1.1
+< anon0 ip #0 20(20) 0 2.3.0.1 > 1.2.1.1
+< anon0 ip #0 20(20) 0 2.2.2.1 > 1.2.1.1
+< anon0 ip #0 20(20) 0 2.2.0.1 > 1.2.1.1
+15
+> anon0 ip #0 20(20) 0 1.2.3.4 > 1.2.1.2
+> anon0 ip #0 20(20) 0 2.2.0.1 > 1.2.1.1
+> anon0 ip #0 20(20) 0 2.2.0.1 > 1.2.1.3
+> anon0 ip #0 20(20) 0 4.4.1.1 > 1.2.1.1
+List of active MAP/Redirect filters:
+map * from pool/100 to 0/0 -> 1.2.3.4/32
+
+List of active sessions:
+MAP 2.2.2.1 <- -> 1.2.3.4 [1.2.1.2]
+MAP 1.1.1.1 <- -> 1.2.3.4 [1.2.1.1]
+
+Hostmap table:
+2.2.2.1,1.2.1.2 -> 1.2.3.4,0.0.0.0 (use = 1)
+1.1.1.1,1.2.1.1 -> 1.2.3.4,0.0.0.0 (use = 1)
+List of active state sessions:
+List of configured pools
+table role=nat type=tree number=100
+ { 1.1.1.1/32; ! 2.2.0.0/16; 2.2.2.0/24; };
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p5 b/contrib/netbsd-tests/ipf/expected/p5
new file mode 100644
index 0000000..b56c3bc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p5
@@ -0,0 +1,21 @@
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+table role=ipf type=tree name=letters
+ { 1.1.1.1/32; ! 2.2.0.0/16; 2.2.2.0/24; };
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p6 b/contrib/netbsd-tests/ipf/expected/p6
new file mode 100644
index 0000000..413f94b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p6
@@ -0,0 +1,24 @@
+block
+nomatch
+List of active MAP/Redirect filters:
+
+List of active sessions:
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+table role=ipf type=tree name=microsoft
+ { 131.107.0.0/16; 192.92.90.0/24; 198.105.232.0/22; 204.231.58.0/24; 204.140.77.0/24; 204.140.80.0/22; 199.60.28.0/24; 199.103.90.0/23; 199.103.122.0/24; 204.79.101.0/24; 192.237.67.0/24; 198.137.97.0/24; 204.79.135.0/24; 204.79.179.0/24; 204.79.180.0/23; 204.79.188.0/24; 204.79.7.0/24; 204.79.27.0/24; 198.180.74.0/23; 204.231.236.0/24; 205.163.63.0/24; 205.163.62.0/24; 205.163.144.0/20; 205.248.50.0/23; 205.248.72.0/24; 205.248.212.0/22; 205.248.228.0/24; 205.248.235.0/24; 204.231.76.0/24; 204.231.192.0/24; 207.78.80.0/24; 207.78.81.0/24; 207.78.82.0/24; 207.117.3.0/24; 207.18.117.0/24; 208.139.27.0/24; 209.28.213.0/24; 207.209.68.0/24; 204.95.96.0/20; 207.158.93.192/27; 207.240.123.192/27; 208.26.205.0/24; 192.197.157.0/24; 204.133.231.0/24; 216.72.96.0/22; 207.229.166.152/29; 204.95.149.0/24; 209.192.213.72/29; 206.73.203.0/24; 206.73.118.0/24; 208.45.54.16/29; 208.45.54.8/29; 206.73.31.0/24; 63.161.50.128/25; 63.161.50.0/25; 207.240.8.224/28; 208.45.89.248/29; 206.182.69.0/24; 206.182.240.0/24; 206.182.241.0/24; 206.73.67.0/24; 206.182.251.0/24; 206.182.247.0/24; 206.182.236.0/24; 63.236.198.64/29; 63.236.198.152/29; 165.121.253.232/29; 63.236.170.64/29; 63.236.186.64/29; 63.236.187.104/29; 63.236.187.128/29; 63.236.187.160/29; 199.2.137.0/24; 216.222.104.224/28; 63.151.87.64/29; 64.77.82.96/29; 64.77.93.80/28; 65.52.0.0/14; 207.46.0.0/16; 204.182.144.0/20; 206.107.34.0/24; 205.240.158.0/23; 204.79.252.0/24; 64.200.211.16/28; 12.178.163.0/27; 69.44.126.80/28; 63.173.42.128/25; 12.28.108.0/25; 65.170.29.0/29; 67.132.133.96/29; 8.6.176.0/24; 63.148.123.240/29; 64.41.193.0/24; 64.85.70.32/28; 64.85.81.96/29; 64.85.81.104/29; 216.32.168.224/27; 206.79.74.32/28; 216.32.175.224/27; 216.32.180.0/22; 216.33.229.224/27; 216.33.236.0/22; 216.33.240.0/22; 216.32.240.0/22; 216.34.51.0/24; 209.1.112.0/24; 209.1.113.0/24; 209.1.15.0/24; 216.34.53.176/28; 216.35.8.224/28; 209.185.128.0/22; 65.114.175.128/27; 64.15.229.96/27; 64.15.177.0/24; 64.15.170.192/29; 209.143.238.0/24; 64.15.178.0/24; 66.35.209.120/29; 66.35.211.128/26; 66.35.208.48/28; 216.33.148.0/22; 216.35.66.88/29; 12.230.32.160/29; 12.53.124.0/27; 12.232.18.96/27; 12.190.158.0/24; 12.71.196.32/28; 209.240.192.0/19; 70.37.128.0/23; 70.37.135.0/24; 12.49.87.192/26; 74.93.205.144/29; 74.93.205.152/29; 74.93.206.64/29; 70.89.139.120/29; 206.71.119.0/24; 206.71.117.0/24; 206.71.118.0/24; 209.154.155.112/29; 65.68.62.152/29; 67.39.208.168/29; 65.242.67.0/24; 204.71.191.0/24; 63.194.155.144/29; 66.136.85.192/29; 64.124.184.72/29; 216.200.206.0/24; 63.80.93.0/25; 67.192.225.208/28; 69.74.162.0/24; 65.221.5.0/24; 65.248.85.0/24; 199.243.157.192/27; 199.243.157.112/29; 65.194.210.224/27; 208.194.139.0/24; 208.204.49.128/25; 208.205.26.0/24; 208.217.184.0/22; 208.222.172.0/24; 208.224.200.64/27; 208.229.100.0/23; 208.241.19.0/28; 208.241.19.16/28; 208.241.9.224/28; 208.244.108.0/28; 208.245.16.0/27; 208.249.17.160/28; 63.104.216.0/25; 63.69.245.0/24; 68.90.141.72/29; 63.198.123.160/29; 68.248.48.64/29; 68.248.48.72/29; 99.49.8.248/29; 65.38.172.72/29; 65.38.172.96/28; 75.149.174.16/29; 75.151.100.240/28; 64.81.8.96/27; 67.112.255.144/29; 63.240.201.176/28; 206.16.209.208/28; 63.240.195.208/28; 206.16.204.64/28; 206.16.223.0/24; 63.240.216.0/22; 63.240.220.0/22; 206.16.246.24/29; 63.240.195.192/28; 206.16.224.160/27; 67.192.39.48/28; 72.32.240.160/28; 72.32.201.152/29; 67.39.81.152/29; 69.20.127.32/29; 216.52.28.0/24; 70.42.230.0/23; 63.251.97.0/24; 67.120.132.128/29; 67.120.132.152/29; 67.120.132.192/28; };
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+1 block in from pool/microsoft to any
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p7 b/contrib/netbsd-tests/ipf/expected/p7
new file mode 100644
index 0000000..89bfc11
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p7
@@ -0,0 +1,40 @@
+< bge0 ip #0 40(20) 6 5.5.5.5,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.5.6,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.5.7,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.5.8,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.5.9,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.6.5,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.6.6,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.7,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.6.8,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.6.9,10000 > 1.1.1.4,80
+List of active MAP/Redirect filters:
+rewrite in on bge0 proto tcp from 0/0 to 0/0 port = 80 -> src 0/0 dst dstlist/servers;
+
+List of active sessions:
+RWR-RDR 5.5.6.9 10000 9.9.9.9 80 <- -> 5.5.6.9 10000 1.1.1.4 80
+RWR-RDR 5.5.6.8 10000 9.9.9.9 80 <- -> 5.5.6.8 10000 1.1.1.2 80
+RWR-RDR 5.5.6.7 10000 9.9.9.9 80 <- -> 5.5.6.7 10000 1.1.1.9 80
+RWR-RDR 5.5.6.6 10000 9.9.9.9 80 <- -> 5.5.6.6 10000 1.1.1.5 80
+RWR-RDR 5.5.6.5 10000 9.9.9.9 80 <- -> 5.5.6.5 10000 1.1.1.4 80
+RWR-RDR 5.5.5.9 10000 9.9.9.9 80 <- -> 5.5.5.9 10000 1.1.1.2 80
+RWR-RDR 5.5.5.8 10000 9.9.9.9 80 <- -> 5.5.5.8 10000 1.1.1.9 80
+RWR-RDR 5.5.5.7 10000 9.9.9.9 80 <- -> 5.5.5.7 10000 1.1.1.5 80
+RWR-RDR 5.5.5.6 10000 9.9.9.9 80 <- -> 5.5.5.6 10000 1.1.1.4 80
+RWR-RDR 5.5.5.5 10000 9.9.9.9 80 <- -> 5.5.5.5 10000 1.1.1.2 80
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/expected/p9 b/contrib/netbsd-tests/ipf/expected/p9
new file mode 100644
index 0000000..89bfc11
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/expected/p9
@@ -0,0 +1,40 @@
+< bge0 ip #0 40(20) 6 5.5.5.5,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.5.6,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.5.7,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.5.8,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.5.9,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.6.5,10000 > 1.1.1.4,80
+< bge0 ip #0 40(20) 6 5.5.6.6,10000 > 1.1.1.5,80
+< bge0 ip #0 40(20) 6 5.5.6.7,10000 > 1.1.1.9,80
+< bge0 ip #0 40(20) 6 5.5.6.8,10000 > 1.1.1.2,80
+< bge0 ip #0 40(20) 6 5.5.6.9,10000 > 1.1.1.4,80
+List of active MAP/Redirect filters:
+rewrite in on bge0 proto tcp from 0/0 to 0/0 port = 80 -> src 0/0 dst dstlist/servers;
+
+List of active sessions:
+RWR-RDR 5.5.6.9 10000 9.9.9.9 80 <- -> 5.5.6.9 10000 1.1.1.4 80
+RWR-RDR 5.5.6.8 10000 9.9.9.9 80 <- -> 5.5.6.8 10000 1.1.1.2 80
+RWR-RDR 5.5.6.7 10000 9.9.9.9 80 <- -> 5.5.6.7 10000 1.1.1.9 80
+RWR-RDR 5.5.6.6 10000 9.9.9.9 80 <- -> 5.5.6.6 10000 1.1.1.5 80
+RWR-RDR 5.5.6.5 10000 9.9.9.9 80 <- -> 5.5.6.5 10000 1.1.1.4 80
+RWR-RDR 5.5.5.9 10000 9.9.9.9 80 <- -> 5.5.5.9 10000 1.1.1.2 80
+RWR-RDR 5.5.5.8 10000 9.9.9.9 80 <- -> 5.5.5.8 10000 1.1.1.9 80
+RWR-RDR 5.5.5.7 10000 9.9.9.9 80 <- -> 5.5.5.7 10000 1.1.1.5 80
+RWR-RDR 5.5.5.6 10000 9.9.9.9 80 <- -> 5.5.5.6 10000 1.1.1.4 80
+RWR-RDR 5.5.5.5 10000 9.9.9.9 80 <- -> 5.5.5.5 10000 1.1.1.2 80
+
+Hostmap table:
+List of active state sessions:
+List of configured pools
+List of configured hash tables
+List of groups configured (set 0)
+List of groups configured (set 1)
+Rules configured (set 0, in)
+Rules configured (set 0, out)
+Rules configured (set 1, in)
+Rules configured (set 1, out)
+Accounting rules configured (set 0, in)
+Accounting rules configured (set 0, out)
+Accounting rules configured (set 1, in)
+Accounting rules configured (set 1, out)
+-------------------------------
diff --git a/contrib/netbsd-tests/ipf/h_common.sh b/contrib/netbsd-tests/ipf/h_common.sh
new file mode 100755
index 0000000..8f11c2f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/h_common.sh
@@ -0,0 +1,100 @@
+# $NetBSD: h_common.sh,v 1.8 2013/05/16 07:20:29 martin Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+h_copydata()
+{
+ test -f $(atf_get_srcdir)/input/$1 && \
+ cp $(atf_get_srcdir)/input/$1 in
+ test -f $(atf_get_srcdir)/regress/$1 && \
+ cp $(atf_get_srcdir)/regress/$1 reg
+ test -f $(atf_get_srcdir)/expected/$1 && \
+ cp $(atf_get_srcdir)/expected/$1 exp
+}
+
+test_case()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+
+ atf_test_case "${name}"
+ eval "${name}_body() { \
+ ${check_function} '${name}' " "${@}" "; \
+ }"
+}
+
+broken_test_case()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+
+ atf_test_case "${name}"
+ eval "${name}_body() { \
+ atf_skip 'This test case is probably broken'; \
+ ${check_function} '${name}' " "${@}" "; \
+ }"
+}
+
+failing_test_case()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+ local reason="${1}"; shift
+
+ atf_test_case "${name}"
+ eval "${name}_body() { \
+ atf_expect_fail '${reason}'; \
+ ${check_function} '${name}' " "${@}" "; \
+ }"
+}
+
+failing_test_case_be()
+{
+ # this test fails on some architectures - not fully analyzed, assume
+ # an endianess bug
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+ local reason="${1}"; shift
+
+ atf_test_case "${name}"
+
+ if [ `sysctl -n hw.byteorder` = 4321 ]; then
+ eval "${name}_body() { \
+ atf_expect_fail '${reason}'; \
+ ${check_function} '${name}' " "${@}" "; \
+ }"
+ else
+ eval "${name}_body() { \
+ ${check_function} '${name}' " "${@}" "; \
+ }"
+ fi
+}
+
diff --git a/contrib/netbsd-tests/ipf/input/f1 b/contrib/netbsd-tests/ipf/input/f1
new file mode 100644
index 0000000..7c3ae8a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f1
@@ -0,0 +1,4 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+out 127.0.0.1 127.0.0.1
+out 1.1.1.1 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/f10 b/contrib/netbsd-tests/ipf/input/f10
new file mode 100644
index 0000000..254cee7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f10
@@ -0,0 +1,6 @@
+in 1.1.1.1 2.1.1.1 opt lsrr
+in 1.1.1.1 2.1.1.1
+in 1.1.1.1 2.1.1.1 opt ts
+in 1.1.1.1 2.1.1.1 opt sec-class=topsecret
+in 1.1.1.1 2.1.1.1 opt ssrr,sec-class=topsecret
+in 1.1.1.1 2.1.1.1 opt sec
diff --git a/contrib/netbsd-tests/ipf/input/f11 b/contrib/netbsd-tests/ipf/input/f11
new file mode 100644
index 0000000..d558150
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f11
@@ -0,0 +1,16 @@
+in on e0 tcp 1.1.1.1,1 2.1.2.2,23 S seq=1 ack=0
+in on e0 tcp 1.1.1.1,1 2.1.2.2,24 SA seq=1 ack=1
+in on e1 tcp 2.1.2.2,23 1.1.1.1,2 SA seq=101 ack=2
+in on e1 tcp 2.1.2.2,23 1.1.1.1,1 SA seq=101 ack=2
+in on e0 tcp 1.1.1.1,1 2.1.2.2,23 A seq=2 ack=102
+in on e0 tcp 1.1.1.1,1 2.1.2.2,25 A seq=2 ack=102
+in on e1 tcp 2.1.2.2,23 1.1.1.1,1 A seq=102 ack=2
+in on e1 tcp 2.1.2.2,25 1.1.1.1,1 A seq=102 ack=2
+in on e0 tcp 1.1.1.1,1 2.1.2.2,23 FA seq=2 ack=102
+in on e0 tcp 1.1.1.1,1 2.1.2.2,23 A seq=2 ack=102
+in on e0 tcp 1.1.1.1,2 2.1.2.2,23 A seq=2 ack=102
+in on e1 udp 1.1.1.1,1 4.4.4.4,53
+in on e1 udp 2.2.2.2,2 4.4.4.4,53
+in on e0 udp 4.4.4.4,53 1.1.1.1,1
+in on e0 udp 4.4.4.4,1023 1.1.1.1,2049
+in on e0 udp 4.4.4.4,2049 1.1.1.1,1023
diff --git a/contrib/netbsd-tests/ipf/input/f12 b/contrib/netbsd-tests/ipf/input/f12
new file mode 100644
index 0000000..52edde1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f12
@@ -0,0 +1,44 @@
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF SYN
+[]
+4500 0028 0000 4000 3f06 36cd 0101 0101 0201 0101
+0401 0019 0000 0000 0000 0000 5002 2000 86c5 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF ACK
+[]
+4500 0028 0000 4000 3f06 36cd 0101 0101 0201 0101
+0401 0019 0000 0000 0000 0000 5010 2000 86b7 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF MF FO=0 ACK
+[]
+4500 0028 0000 6000 3f06 16cd 0101 0101 0201 0101
+0401 0019 0000 0000 0000 0000 5010 2000 86b7 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF FO=0
+[]
+4500 001c 0000 6000 3f06 16d9 0101 0101 0201 0101
+0401 0019 0000 0000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 TCP DF FO=1 ACK
+[]
+4500 001c 0000 6001 3f06 16d8 0101 0101 0201 0101
+0000 0000 5010 2000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 UDP DF MF FO=0
+[]
+4500 0014 0000 6000 3f11 16d6 0101 0101 0201 0101
+
+# 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0
+[]
+4500 0018 0000 2000 3f11 56d2 0101 0101 0201 0101
+0035 0035
+
+# 1.1.1.1,1 -> 2.1.1.1,1 TTL=63 UDP MF FO=0
+[]
+4500 001c 0000 2000 3f11 56ce 0101 0101 0201 0101
+0001 0001 0004 fadc
+
+# 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0
+[]
+4500 001c 0000 2000 3f11 56ce 0101 0101 0201 0101
+0035 0035 0004 fa74
+
diff --git a/contrib/netbsd-tests/ipf/input/f13 b/contrib/netbsd-tests/ipf/input/f13
new file mode 100644
index 0000000..ccd370a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f13
@@ -0,0 +1,95 @@
+# This checksum is deliberately incorrect.
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF,FO=0 SYN
+[in]
+4500 0028 0001 4000 3f06 36cc 0101 0101 0201 0101
+0401 0019 0000 0000 0000 0000 50 02 2000 86bb 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP MF ACK
+[in]
+4500 0024 0002 2000 3f06 56cf 0101 0101 0201 0101
+0401 0019 0000 0000 0000 0000 5010 2000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP FO=2 ACK
+[in]
+4500 002c 0002 0002 3f06 76c5 0101 0101 0201 0101
+0000 0000 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f 1011 1213
+
+# 1.1.1.1,1024 -> 2.1.1.1,25 TTL=63 TCP DF MF FO=0 SYN
+[in]
+4500 0028 0003 6000 3f06 16ca 0101 0101 0201 0101
+0400 0019 7000 0000 0000 0000 5002 2000 16c6 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF FO=0
+[in]
+4500 001c 0004 6000 3f06 16d5 0101 0101 0201 0101
+0401 0019 0000 0000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 TCP DF FO=1 SYN
+[in]
+4500 001c 0005 6001 3f06 16d3 0101 0101 0201 0101
+0000 0000 5010 2000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 UDP DF MF FO=0
+[in]
+4500 0014 0006 6000 3f11 16d0 0101 0101 0201 0101
+
+# 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0
+[in]
+4500 0018 0007 2000 3f11 56cb 0101 0101 0201 0101
+0035 0035
+
+# 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0
+[in]
+4500 001c 0008 2000 3f11 56c6 0101 0101 0201 0101
+0035 0035 0004 0000
+
+# 1.1.1.1,53 -> 2.1.1.1,54 TTL=63 UDP MF FO=0 (short)
+[in]
+4500 0018 0008 2000 3f11 56ca 0101 0101 0201 0101
+0035 0036
+
+# 1.1.1.1,21 -> 2.1.1.1,54 TTL=63 UDP MF FO=0
+[in]
+4500 001c 0008 2000 3f11 56c6 0101 0101 0201 0101
+0015 0036 0004 0000
+
+# 1.1.1.1,21 -> 2.1.1.1,54 TTL=63 TCP MF FO=0
+[in]
+4500 001c 0008 2000 3f06 56d1 0101 0101 0201 0101
+0015 0036 0000 0000 0000 0000 50 02 2000 0000 0000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 UDP FO=3
+[in]
+4500 001c 0008 0003 3f11 76c3 0101 0101 0201 0101
+0000 0000 0000 0000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 UDP FO=1
+[in]
+4500 001c 0008 0001 3f11 76c5 0101 0101 0201 0101
+0000 0000 0000 0000
+
+# 2.1.1.1,53 -> 1.1.1.1,53 TTL=63 UDP
+[out]
+4500 001c 0008 0000 3f11 76c6 0201 0101 0101 0101
+0035 0035 0004 0000
+
+# 2.1.1.1,25 -> 1.1.1.1,1014 TTL=63 TCP DF SYN-ACK
+[out]
+4500 0028 0003 4000 3f06 36ca 0201 0101 0101 0101
+0019 0400 0000 0001 7000 0001 5012 2000 16b4 0000
+
+# 1.1.1.1,1024 -> 2.1.1.1,25 TTL=63 TCP DF ACK (OOW)
+[in]
+4500 0028 0003 4000 3f06 36ca 0101 0101 0201 0101
+0400 0019 0040 0000 0000 0000 5010 2000 8678 0000
+
+# 1.1.1.1,1024 -> 2.1.1.1,25 TTL=63 TCP DF ACK (out-of-order)
+[in]
+4500 0028 0003 4000 3f06 36ca 0101 0101 0201 0101
+0400 0019 7000 0004 0000 0002 5010 2000 16b2 0000
+
+# 1.1.1.1,1024 -> 2.1.1.1,25 TTL=63 TCP DF ACK
+[in]
+4500 0028 0003 4000 3f06 36ca 0101 0101 0201 0101
+0400 0019 7000 0001 0000 0002 5010 2000 16b5 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/f14 b/contrib/netbsd-tests/ipf/input/f14
new file mode 100644
index 0000000..16a806f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f14
@@ -0,0 +1,5 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+in 1.1.1.2 1.2.1.1
+in 1.1.2.2 1.2.1.1
+in 1.2.2.2 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/f15 b/contrib/netbsd-tests/ipf/input/f15
new file mode 100644
index 0000000..db547cb
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f15
@@ -0,0 +1,8 @@
+in on hme0 tcp 10.1.2.3,1200 195.134.65.10,100 S
+in on hme0 tcp 10.1.2.3,1200 195.134.65.10,22 S
+in on hme0 udp 10.1.2.3,1200 195.134.65.10,100
+in on hme0 udp 10.1.2.3,53 195.134.65.10,53
+in on hme0 10.1.2.3 195.134.65.10
+in on hme1 195.134.65.10 10.1.2.3
+in on hme1 udp 195.134.65.10,53 10.1.2.3,53
+in on hme1 tcp 195.134.65.10,22 10.1.2.3,1200 SA
diff --git a/contrib/netbsd-tests/ipf/input/f16 b/contrib/netbsd-tests/ipf/input/f16
new file mode 100644
index 0000000..a17f41f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f16
@@ -0,0 +1,8 @@
+in 2.2.2.2 5.5.5.5
+in 2.2.2.2 1.1.1.1
+in udp 4.4.4.4,110 1.1.1.1,53
+in udp 4.4.4.9,101 1.1.1.3,35
+in udp 4.4.4.8,111 1.1.1.2,53
+in tcp 4.4.4.7,220 1.1.1.1,23
+in tcp 4.4.4.6,202 1.1.1.3,22
+in tcp 4.4.4.5,222 1.1.1.2,52
diff --git a/contrib/netbsd-tests/ipf/input/f17 b/contrib/netbsd-tests/ipf/input/f17
new file mode 100644
index 0000000..a0d44d7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f17
@@ -0,0 +1,39 @@
+# TCP 1.1.1.1,54076 -> 2.2.2.2,27 SYN
+[out,ppp0]
+4500 003c 8262 0000 4006 f254 0101 0101
+0202 0202 d33c 0019 bfd0 8989 0000 0000
+a002 4000 cfcd 0000 0204 05b4 0103 0300
+0101 080a 008e 17f7 0000 0000
+
+# TCP 2.2.2.2,27 -> 1.1.1.1,54076 ACK
+[in,ppp0]
+4500 003c 8262 0000 1106 2155 0202 0202
+0101 0101 0019 d33c 4020 3436 bfdf cbc9
+5010 4000 694a 0000 0204 0584 0103 0300
+0101 080a 008e 17f7 0000 0000
+
+# TCP 1.1.1.1,54076 -> 2.2.2.2,27 SYN
+[out,ppp0]
+4500 003c 8265 0000 4006 f251 0101 0101
+0202 0202 d33c 0019 bfd0 8989 0000 0000
+a002 4000 cfc2 0000 0204 05b4 0103 0300
+0101 080a 008e 1802 0000 0000
+
+# TCP 2.2.2.2,27 -> 1.1.1.1,54076 SYN-ACK
+[in,ppp0]
+4500 002c 7442 4000 2906 d784 0202 0202
+0101 0101 0019 d33c ed67 4d4e bfd0 898a
+6012 2118 19c2 0000 0204 0584
+
+# TCP 1.1.1.1,54076 -> 2.2.2.2,27 ACK
+[out,ppp0]
+4500 0028 8262 0000 4006 f268 0101 0101
+0202 0202 d33c 0019 bfd0 898a ed67 4d4e
+5010 4000 1268 0000
+
+# TCP 2.2.2.2,27 -> 1.1.1.1,54076 ACK+data
+[in,ppp0]
+4500 002a 7442 4000 2906 d786 0202 0202
+0101 0101 0019 d33c ed67 4d4e bfd0 8990
+5012 2118 2f43 0000 0203
+
diff --git a/contrib/netbsd-tests/ipf/input/f18 b/contrib/netbsd-tests/ipf/input/f18
new file mode 100644
index 0000000..9ecbb7f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f18
@@ -0,0 +1,4 @@
+in on le1 1.1.1.1 3.3.3.3
+in on le1 1.1.1.1 5.5.5.5
+out on le1 2.2.2.2 4.4.4.4
+out on le1 2.2.2.2 6.6.6.6
diff --git a/contrib/netbsd-tests/ipf/input/f19 b/contrib/netbsd-tests/ipf/input/f19
new file mode 100644
index 0000000..6cab988
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f19
@@ -0,0 +1,4 @@
+in tcp 127.0.0.1,1 127.0.0.1,21 S
+in tcp 127.0.0.1,2 127.0.0.1,21 S
+in tcp 127.0.0.1,3 127.0.0.1,21 S
+in tcp 127.0.0.1,4 127.0.0.1,21 S
diff --git a/contrib/netbsd-tests/ipf/input/f2 b/contrib/netbsd-tests/ipf/input/f2
new file mode 100644
index 0000000..f4e9d23
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f2
@@ -0,0 +1,6 @@
+in tcp 127.0.0.1,1 127.0.0.1,ftp
+in tcp 1.1.1.1,1 1.2.1.1,ftp
+in udp 127.0.0.1,1 127.0.0.1,21
+in udp 1.1.1.1,1 1.2.1.1,21
+in icmp 127.0.0.1 127.0.0.1
+in icmp 1.1.1.1 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/f20 b/contrib/netbsd-tests/ipf/input/f20
new file mode 100644
index 0000000..605ba7c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f20
@@ -0,0 +1,2 @@
+out on de0 1.1.1.1 2.2.2.2
+out on ab0 1.1.1.1 2.2.2.2
diff --git a/contrib/netbsd-tests/ipf/input/f21 b/contrib/netbsd-tests/ipf/input/f21
new file mode 100644
index 0000000..1135cbd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f21
@@ -0,0 +1,31 @@
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going out)
+# IP 4.4.4.4 2.2.2.2 TCP(20480,80)
+[out,df0]
+4500 003c 4706 4000 ff06 28aa 0404 0404
+0202 0202 5000 0050 0000 0001 0000 0000
+a002 16d0 d8e2 0000 0204 05b4 0402 080a
+0047 fbb0 0000 0000 0103 0300
+
+# IP 3.3.3.3 -> 4.4.4.4 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80)) UNREACH
+[in,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303
+0404 0404 0303 acab 0000 0000 4500 003c
+4706 4000 ff06 28aa 0404 0404 0202 0202
+5000 0050 0000 0001
+
+# IP 3.3.3.3 -> 4.4.4.4 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80)) REDIRECT
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[in,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303
+0404 0404 0501 9a9d 0808 0808 4500 003c
+4706 4000 ff06 28aa 0404 0404 0202 0202
+5000 0050 0000 0001
+
+# IP 3.3.3.3 -> 5.5.5.5 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80)) UNREACH
+[in,df0]
+4500 0038 809a 0000 ff01 2b1b 0303 0303
+0505 0505 0303 acab 0000 0000 4500 003c
+4706 4000 ff06 28aa 0404 0404 0202 0202
+5000 0050 0000 0001
+
diff --git a/contrib/netbsd-tests/ipf/input/f22 b/contrib/netbsd-tests/ipf/input/f22
new file mode 100644
index 0000000..a5221c1a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f22
@@ -0,0 +1,31 @@
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going out)
+# IP 4.4.4.4 2.2.2.2 TCP(20480,80)
+[in,df0]
+4500 003c 4706 4000 ff06 28aa 0404 0404
+0202 0202 5000 0050 0000 0001 0000 0000
+a002 16d0 d8e2 0000 0204 05b4 0402 080a
+0047 fbb0 0000 0000 0103 0300
+
+# IP 3.3.3.3 -> 4.4.4.4 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80)) UNREACH
+[out,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303
+0404 0404 0303 acab 0000 0000 4500 003c
+4706 4000 ff06 28aa 0404 0404 0202 0202
+5000 0050 0000 0001
+
+# IP 3.3.3.3 -> 4.4.4.4 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80)) REDIRECT
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[out,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303
+0404 0404 0501 9a9d 0808 0808 4500 003c
+4706 4000 ff06 28aa 0404 0404 0202 0202
+5000 0050 0000 0001
+
+# IP 3.3.3.3 -> 5.5.5.5 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80)) UNREACH
+[out,df0]
+4500 0038 809a 0000 ff01 2b1b 0303 0303
+0505 0505 0303 acab 0000 0000 4500 003c
+4706 4000 ff06 28aa 0404 0404 0202 0202
+5000 0050 0000 0001
+
diff --git a/contrib/netbsd-tests/ipf/input/f24 b/contrib/netbsd-tests/ipf/input/f24
new file mode 100644
index 0000000..030772b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f24
@@ -0,0 +1,27 @@
+[out,hme0]
+4500 003f 6e48 0000 4011 8816 c0a8 0101
+c0a8 01fe eb22 0035 002b d9e6 4a82 0100
+0001 0000 0000 0000 0663 6f6f 6d62 7303
+616e 7503 6564 7502 6175 0000 0100 01
+
+[in,hme0]
+4500 004c fc96 2000 4011 d9ba c0a8 01fe
+c0a8 0101 0035 eb22 00a9 d7b9 4a82 8180
+0001 0001 0003 0003 0663 6f6f 6d62 7303
+616e 7503 6564 7502 6175 0000 0100 01c0
+0c00 0100 0100 0000 3c00 0496
+
+[in,hme0]
+4500 004c fc96 2007 4011 d9b3 c0a8 01fe
+c0a8 0101 cbe7 50c0 1300 0200 0100 0078
+8c00 0603 6e73 31c0 13c0 1300 0200 0100
+0078 8c00 0e02 6e73 0861 6465 6c61 6964
+65c0 17c0 1300 0200 0100 0078
+
+[in,hme0]
+4500 004d fc96 000c 4011 f9ad c0a8 01fe
+c0a8 0101 8c00 0603 756e 61c0 13c0 6b00
+0100 0100 0027 5800 0496 cb16 1cc0 5100
+0100 0100 0018 4700 0481 7f28 03c0 3f00
+0100 0100 0027 5800 0496 cb01 0a
+
diff --git a/contrib/netbsd-tests/ipf/input/f25 b/contrib/netbsd-tests/ipf/input/f25
new file mode 100644
index 0000000..a4e3139
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f25
@@ -0,0 +1,41 @@
+[in,hme0]+mcast
+4500 0081 b02d 0000 0411 53b1 c0a8 01eb
+efff fffa 1f48 076c 006d 1bd2 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0a
+
+[out,hme0]
+4500 0108 7aca 0000 4011 79e1 c0a8 01fe
+c0a8 01eb 076c 1f48 00f4 5218 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000
+
+[in,hme0]+mcast
+4500 0081 b02d 0000 0411 53b1 c0a8 01eb
+efff fffa 1f48 076c 006d 1bd2 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0a
+
diff --git a/contrib/netbsd-tests/ipf/input/f26 b/contrib/netbsd-tests/ipf/input/f26
new file mode 100644
index 0000000..2151f72
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f26
@@ -0,0 +1,13 @@
+in tcp 1.1.1.1,1001 2.2.2.2,22 S
+in tcp 1.1.1.1,1002 2.2.2.2,22 S
+in tcp 1.1.1.1,1003 2.2.2.2,22 S
+in tcp 1.1.1.1,1004 2.2.2.2,22 S
+in tcp 1.1.1.2,1002 2.2.2.2,22 S
+in tcp 1.1.1.3,1003 2.2.2.2,22 S
+in tcp 1.1.1.4,1004 2.2.2.2,22 S
+in tcp 1.1.1.2,1005 2.2.2.2,22 S
+in tcp 1.1.1.3,1006 2.2.2.2,22 S
+in tcp 1.1.1.4,1007 2.2.2.2,22 S
+in tcp 1.1.1.2,1008 2.2.2.2,22 S
+in tcp 1.1.1.3,1009 2.2.2.2,22 S
+in tcp 1.1.1.4,1010 2.2.2.2,22 S
diff --git a/contrib/netbsd-tests/ipf/input/f27 b/contrib/netbsd-tests/ipf/input/f27
new file mode 100644
index 0000000..f01bf7e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f27
@@ -0,0 +1,84 @@
+[in,hme0]
+45000028 0000 0000 FF06 b5ca
+01010101 02020202
+03e9 0016 00000000 00000000 5002 0000
+a5de 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5ca
+01010101 02020202
+03ea 0016 00000000 00000000 5002 0000
+a5dd 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5ca
+01010101 02020202
+03eb 0016 00000000 00000000 5002 0000
+a5dc 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5ca
+01010101 02020202
+03ec 0016 00000000 00000000 5002 0000
+a5db 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c9
+01010102 02020202
+03ed 0016 00000000 00000000 5002 0000
+a5d9 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c8
+01010103 02020202
+03ee 0016 00000000 00000000 5002 0000
+a5d7 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c7
+01010104 02020202
+03ef 0016 00000000 00000000 5002 0000
+a5d5 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c9
+01010102 02020202
+03f0 0016 00000000 00000000 5002 0000
+a5d6 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c8
+01010103 02020202
+03f1 0016 00000000 00000000 5002 0000
+a5d4 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c7
+01010104 02020202
+03f2 0016 00000000 00000000 5002 0000
+a5d2 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c9
+01010102 02020202
+03f3 0016 00000000 00000000 5002 0000
+a5d3 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c8
+01010103 02020202
+03f4 0016 00000000 00000000 5002 0000
+a5d1 0000
+
+[in,hme0]
+45000028 0000 0000 FF06 b5c7
+01010104 02020202
+03f5 0016 00000000 00000000 5002 0000
+a5cf 0000
+
+[in,hme0]
+6000 0000 0014 06FF
+ef00 1001 2002 0001 0000 0000 0000 0070
+2001 1002 3333 0001 0000 0000 0000 0001
+03f6 0016 0000 0000 0000 0000 5002 0000 292a 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/f28 b/contrib/netbsd-tests/ipf/input/f28
new file mode 100644
index 0000000..8849c14
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f28
@@ -0,0 +1,7 @@
+in on nic1 4.4.0.1 4.2.0.2
+in on nic2 4.4.1.1 4.2.1.2
+in on nic3 4.4.2.1 4.2.2.2
+in on nic0 4.4.3.1 4.2.3.2
+in on nic0 4.4.1.1 4.2.1.2
+in on nic0 4.4.2.1 4.2.2.2
+in on nic0 4.4.3.1 4.2.3.2
diff --git a/contrib/netbsd-tests/ipf/input/f29 b/contrib/netbsd-tests/ipf/input/f29
new file mode 100644
index 0000000..2e717af
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f29
@@ -0,0 +1,11 @@
+in on nic1 4.4.0.1 4.2.0.2
+in on nic2 4.4.1.1 4.2.1.2
+in on nic3 4.4.2.1 4.2.2.2
+in on nic0 udp 4.4.3.1,1000 4.2.3.2,2000
+in on nic0 udp 4.4.3.1,1000 4.2.3.2,2000
+in on nic0 udp 4.4.1.1,1001 4.2.1.2,2001
+in on nic0 udp 4.4.1.1,1001 4.2.1.2,2001
+in on nic0 udp 4.4.2.1,1002 4.2.2.2,2002
+in on nic0 udp 4.4.2.1,1002 4.2.2.2,2002
+in on nic0 udp 4.4.3.1,1003 4.2.3.2,2003
+in on nic0 udp 4.4.3.1,1003 4.2.3.2,2003
diff --git a/contrib/netbsd-tests/ipf/input/f3 b/contrib/netbsd-tests/ipf/input/f3
new file mode 100644
index 0000000..16a806f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f3
@@ -0,0 +1,5 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+in 1.1.1.2 1.2.1.1
+in 1.1.2.2 1.2.1.1
+in 1.2.2.2 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/f30 b/contrib/netbsd-tests/ipf/input/f30
new file mode 100644
index 0000000..ebf7dc0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f30
@@ -0,0 +1,16 @@
+in on hme0 udp 1.1.1.1,53 2.1.1.1,53 opt lsrr
+in on hme1 udp 2.1.1.1,53 1.1.1.1,53 opt ts,lsrr
+in on hme1 udp 2.1.1.1,53 1.1.1.1,53 opt lsrr
+in on hme0 udp 1.1.1.1,53 2.1.1.1,53
+in on hme1 udp 2.1.1.1,53 1.1.1.1,53
+in on hme0 tcp 1.1.1.1,12345 2.1.1.1,22 S opt rr
+in on hme0 tcp 1.1.1.1,12345 2.1.1.1,22 S
+in on hme1 tcp 2.1.1.1,22 1.1.1.1,12345 SA opt rr,ts
+in on hme1 tcp 2.1.1.1,22 1.1.1.1,12345 SA opt rr
+in on hme1 tcp 2.1.1.1,22 1.1.1.1,12345 SA
+in on hme0 tcp 1.1.1.1,12346 2.1.1.1,22 S opt sec-class=secret
+in on hme0 tcp 1.1.1.1,12346 2.1.1.1,22 S
+in on hme1 tcp 2.1.1.1,22 1.1.1.1,12346 SA opt sec-class=topsecret
+in on hme1 tcp 2.1.1.1,22 1.1.1.1,12346 SA opt ts,sec-class=secret
+in on hme1 tcp 2.1.1.1,22 1.1.1.1,12346 SA opt sec-class=secret
+in on hme1 tcp 2.1.1.1,22 1.1.1.1,12346 SA
diff --git a/contrib/netbsd-tests/ipf/input/f4 b/contrib/netbsd-tests/ipf/input/f4
new file mode 100644
index 0000000..2956d1b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f4
@@ -0,0 +1,5 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.1.1.1
+in 1.1.1.1 1.1.1.2
+in 1.1.1.1 1.1.2.2
+in 1.1.1.1 1.2.2.2
diff --git a/contrib/netbsd-tests/ipf/input/f5 b/contrib/netbsd-tests/ipf/input/f5
new file mode 100644
index 0000000..41600c1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f5
@@ -0,0 +1,28 @@
+in tcp 1.1.1.1,0 2.2.2.2,2222
+in tcp 1.1.1.1,1 2.2.2.2,2222
+in tcp 1.1.1.1,23 2.2.2.2,2222
+in tcp 1.1.1.1,21 2.2.2.2,2222
+in tcp 1.1.1.1,1023 2.2.2.2,2222
+in tcp 1.1.1.1,1024 2.2.2.2,2222
+in tcp 1.1.1.1,1025 2.2.2.2,2222
+in tcp 1.1.1.1,32767 2.2.2.2,2222
+in tcp 1.1.1.1,32768 2.2.2.2,2222
+in tcp 1.1.1.1,65535 2.2.2.2,2222
+in tcp 1.1.1.1,5999 2.2.2.2,2222
+in tcp 1.1.1.1,6000 2.2.2.2,2222
+in tcp 1.1.1.1,6009 2.2.2.2,2222
+in tcp 1.1.1.1,6010 2.2.2.2,2222
+in udp 1.1.1.1,0 2.2.2.2,2222
+in udp 1.1.1.1,1 2.2.2.2,2222
+in udp 1.1.1.1,23 2.2.2.2,2222
+in udp 1.1.1.1,21 2.2.2.2,2222
+in udp 1.1.1.1,1023 2.2.2.2,2222
+in udp 1.1.1.1,1024 2.2.2.2,2222
+in udp 1.1.1.1,1025 2.2.2.2,2222
+in udp 1.1.1.1,32767 2.2.2.2,2222
+in udp 1.1.1.1,32768 2.2.2.2,2222
+in udp 1.1.1.1,65535 2.2.2.2,2222
+in udp 1.1.1.1,5999 2.2.2.2,2222
+in udp 1.1.1.1,6000 2.2.2.2,2222
+in udp 1.1.1.1,6009 2.2.2.2,2222
+in udp 1.1.1.1,6010 2.2.2.2,2222
diff --git a/contrib/netbsd-tests/ipf/input/f6 b/contrib/netbsd-tests/ipf/input/f6
new file mode 100644
index 0000000..21f0be3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f6
@@ -0,0 +1,28 @@
+in tcp 2.2.2.2,2222 1.1.1.1,0
+in tcp 2.2.2.2,2222 1.1.1.1,1
+in tcp 2.2.2.2,2222 1.1.1.1,23
+in tcp 2.2.2.2,2222 1.1.1.1,21
+in tcp 2.2.2.2,2222 1.1.1.1,1023
+in tcp 2.2.2.2,2222 1.1.1.1,1024
+in tcp 2.2.2.2,2222 1.1.1.1,1025
+in tcp 2.2.2.2,2222 1.1.1.1,32767
+in tcp 2.2.2.2,2222 1.1.1.1,32768
+in tcp 2.2.2.2,2222 1.1.1.1,65535
+in tcp 2.2.2.2,2222 1.1.1.1,5999
+in tcp 2.2.2.2,2222 1.1.1.1,6000
+in tcp 2.2.2.2,2222 1.1.1.1,6009
+in tcp 2.2.2.2,2222 1.1.1.1,6010
+in udp 2.2.2.2,2222 1.1.1.1,0
+in udp 2.2.2.2,2222 1.1.1.1,1
+in udp 2.2.2.2,2222 1.1.1.1,23
+in udp 2.2.2.2,2222 1.1.1.1,21
+in udp 2.2.2.2,2222 1.1.1.1,1023
+in udp 2.2.2.2,2222 1.1.1.1,1024
+in udp 2.2.2.2,2222 1.1.1.1,1025
+in udp 2.2.2.2,2222 1.1.1.1,32767
+in udp 2.2.2.2,2222 1.1.1.1,32768
+in udp 2.2.2.2,2222 1.1.1.1,65535
+in udp 2.2.2.2,2222 1.1.1.1,5999
+in udp 2.2.2.2,2222 1.1.1.1,6000
+in udp 2.2.2.2,2222 1.1.1.1,6009
+in udp 2.2.2.2,2222 1.1.1.1,6010
diff --git a/contrib/netbsd-tests/ipf/input/f7 b/contrib/netbsd-tests/ipf/input/f7
new file mode 100644
index 0000000..dbc9e33
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f7
@@ -0,0 +1,15 @@
+in icmp 1.1.1.1 2.1.1.1 echo
+in icmp 1.1.1.1 2.1.1.1 echo,1
+in icmp 1.1.1.1 2.1.1.1 echo,3
+in icmp 1.1.1.1 2.1.1.1 unreach
+in icmp 1.1.1.1 2.1.1.1 unreach,1
+in icmp 1.1.1.1 2.1.1.1 unreach,3
+in icmp 1.1.1.1 2.1.1.1 echorep
+in icmp 1.1.1.1 2.1.1.1 echorep,1
+in icmp 1.1.1.1 2.1.1.1 echorep,3
+in icmp 2.2.2.2 3.3.3.3 maskreq
+out icmp 3.3.3.3 2.2.2.2 maskrep
+in icmp 4.4.4.4 5.5.5.5 timest
+out icmp 5.5.5.5 4.4.4.4 timestrep
+in icmp 6.6.6.6 7.7.7.7 inforeq
+out icmp 7.7.7.7 6.6.6.6 inforep
diff --git a/contrib/netbsd-tests/ipf/input/f8 b/contrib/netbsd-tests/ipf/input/f8
new file mode 100644
index 0000000..cace511
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f8
@@ -0,0 +1,6 @@
+in tcp 1.1.1.1,1 2.1.2.2,1 S
+in tcp 1.1.1.1,1 2.1.2.2,1 SA
+in tcp 1.1.1.1,1 2.1.2.2,1 SF
+in tcp 1.1.1.1,1 2.1.2.2,1 SFPAUR
+in tcp 1.1.1.1,1 2.1.2.2,1 PAU
+in tcp 1.1.1.1,1 2.1.2.2,1 A
diff --git a/contrib/netbsd-tests/ipf/input/f9 b/contrib/netbsd-tests/ipf/input/f9
new file mode 100644
index 0000000..e64e299
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/f9
@@ -0,0 +1,9 @@
+in 1.1.1.1 2.1.1.1 opt lsrr
+in 1.1.1.1 2.1.1.1 opt lsrr=1.1.1.1
+in 1.1.1.1 2.1.1.1 opt lsrr,ssrr
+in 1.1.1.1 2.1.1.1 opt ts
+in 1.1.1.1 2.1.1.1 opt satid
+in 1.1.1.1 2.1.1.1 opt satid=234
+in 1.1.1.1 2.1.1.1 opt sec-class=topsecret
+in 1.1.1.1 2.1.1.1 opt ssrr,sec-class=topsecret
+in 1.1.1.1 2.1.1.1 opt sec
diff --git a/contrib/netbsd-tests/ipf/input/ip2.data b/contrib/netbsd-tests/ipf/input/ip2.data
new file mode 100644
index 0000000..ef34eb5
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ip2.data
@@ -0,0 +1,3 @@
+1.1.1.1/32
+!2.2.0.0/16
+2.2.2.0/24
diff --git a/contrib/netbsd-tests/ipf/input/ipv6.1 b/contrib/netbsd-tests/ipf/input/ipv6.1
new file mode 100644
index 0000000..6da8da0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ipv6.1
@@ -0,0 +1,45 @@
+#
+# traceroute simulation
+#
+# UDP
+#
+[out,gif0] 6000 0000 0018 1101
+ef00 1001 2002 0001 0000 0000 0000 0070
+2001 1002 3333 0001 0000 0000 0000 0001
+8083 829a
+0018
+f4c1
+0000 0344 0000 0004 f8f1 9d3c ddba 0e00
+
+#
+# ICMPV6
+# - Time exceeded
+#
+[in,gif0] 6000 0000 0048 3a40
+ef00 1001 0880 6cbf 0000 0000 0000 0001
+ef00 1001 2002 0001 0000 0000 0000 0070
+0300 f86f 0000 0000
+6000 0000 0018 1101
+ef00 1001 2002 0001 0000 0000 0000 0070
+2001 1002 3333 0001 0000 0000 0000 0001
+8083 829a
+0018
+f427
+0000 0344 0000 0004 f8f1 9d3c ddba 0e00
+
+#
+# ICMPV6
+# - Time exceeded
+#
+[in,gif0] 6000 0000 0048 3a40
+ef00 1001 0880 6cbf 0000 0000 0000 0001
+ef00 1001 2002 0001 0000 0000 0000 0070
+0300 7266 0000 0000
+6000 0000 0018 1101
+ef00 1001 2002 1001 0000 0000 0000 0070
+2001 1002 3333 0001 0000 0000 0000 0001
+8083 f8a3
+0018
+f427
+0000 0344 0000 0004 f8f1 9d3c ddba 0e00
+
diff --git a/contrib/netbsd-tests/ipf/input/ipv6.2 b/contrib/netbsd-tests/ipf/input/ipv6.2
new file mode 100644
index 0000000..8cc2d17
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ipv6.2
@@ -0,0 +1,26 @@
+[out,de0]
+6000 0000 0020 3aff ef00 0000 0000 0000
+0000 0000 0001 0013 ff02 0000 0000 0000
+0000 0001 ff01 000b 8700 ea32 0000 0000
+ef00 0000 0000 0000 0000 0000 0001 000b
+0101 0048 5487 5c6f
+
+[in,de0]
+6000 0000 0020 3aff ef00 0000 0000 0000
+0000 0000 0001 000b ef00 0000 0000 0000
+0000 0000 0001 0013 8800 5322 6000 0000
+ef00 0000 0000 0000 0000 0000 0001 000b
+0201 0800 2071 cce1
+
+[out,de0]
+6000 0000 0010 3a40 ef00 0000 0000 0000
+0000 0000 0001 0013 ef00 0000 0000 0000
+0000 0000 0001 000b 8000 3210 06ff 0002
+9ec3 3c3c 8a82 0300
+
+[in,de0]
+6000 0000 0010 3aff ef00 0000 0000 0000
+0000 0000 0001 000b ef00 0000 0000 0000
+0000 0000 0001 0013 8100 3110 06ff 0002
+9ec3 3c3c 8a82 0300
+
diff --git a/contrib/netbsd-tests/ipf/input/ipv6.3 b/contrib/netbsd-tests/ipf/input/ipv6.3
new file mode 100644
index 0000000..3b2ef4d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ipv6.3
@@ -0,0 +1,30 @@
+[out,gif0]
+6000 0000 0010 3a40 3ffe 8280 0000 2001
+0000 0000 0000 4395 3ffe 8280 0000 2001
+0000 0000 0000 4394 8000 3f77 085c 0038
+0c06 b73d 1b3d 0d00
+
+[in,gif0]
+6000 0000 0010 3a40 3ffe 8280 0000 2001
+0000 0000 0000 4393 3ffe 8280 0000 2001
+0000 0000 0000 4395 8100 3e78 085c 0038
+0c06 b73d 1b3d 0d00
+
+[in,gif0]
+6000 0000 0010 3a40 3ffe 8280 0000 2001
+0000 0000 0000 4394 3ffe 8280 0000 2001
+0000 0000 0000 4395 8300 3c77 085c 0038
+0c06 b73d 1b3d 0d00
+
+[in,gif0]
+6000 0000 0010 3a40 3ffe 8280 0000 2001
+0000 0000 0000 4394 3ffe 8280 0000 2001
+0000 0000 0000 4395 8000 3f77 085c 0038
+0c06 b73d 1b3d 0d00
+
+[in,gif0]
+6000 0000 0010 3a40 3ffe 8280 0000 2001
+0000 0000 0000 4394 3ffe 8280 0000 2001
+0000 0000 0000 4395 8100 3e77 085c 0038
+0c06 b73d 1b3d 0d00
+
diff --git a/contrib/netbsd-tests/ipf/input/ipv6.4 b/contrib/netbsd-tests/ipf/input/ipv6.4
new file mode 100644
index 0000000..eb986ae
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ipv6.4
@@ -0,0 +1,522 @@
+# fe80::20c:29ff:fe13:6899 > fe80::20c:29ff:fe21:5742: frag (0|1448) icmp6: echo request
+[in,eth0]
+6000 0000 05b0 2c40 fe80 0000 0000 0000
+020c 29ff fe13 6899 fe80 0000 0000 0000
+020c 29ff fe21 5742 3a00 0001 0000 0008
+8000 f400 2c0a 0001 fd38 4a42 9e59 0900
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f
+
+# fe80::20c:29ff:fe13:6899 > fe80::20c:29ff:fe21:5742: frag (1448|160)
+[in,eth0]
+6000 0000 00a8 2c40 fe80 0000 0000 0000
+020c 29ff fe13 6899 fe80 0000 0000 0000
+020c 29ff fe21 5742 3a00 05a8 0000 0008
+a0a1 a2a3 a4a5 a6a7 a8a9 aaab acad aeaf
+b0b1 b2b3 b4b5 b6b7 b8b9 babb bcbd bebf
+c0c1 c2c3 c4c5 c6c7 c8c9 cacb cccd cecf
+d0d1 d2d3 d4d5 d6d7 d8d9 dadb dcdd dedf
+e0e1 e2e3 e4e5 e6e7 e8e9 eaeb eced eeef
+f0f1 f2f3 f4f5 f6f7 f8f9 fafb fcfd feff
+0001 0203 0405 0607 0809 0a0b 0c0d 0e0f
+1011 1213 1415 1617 1819 1a1b 1c1d 1e1f
+2021 2223 2425 2627 2829 2a2b 2c2d 2e2f
+3031 3233 3435 3637 3839 3a3b 3c3d 3e3f
+
+# fe80::20c:29ff:fe21:5742 > fe80::20c:29ff:fe13:6899: frag (0|1232) icmp6: echo reply
+[out,eth0]
+6000 0000 04d8 2c40 fe80 0000 0000 0000
+020c 29ff fe21 5742 fe80 0000 0000 0000
+020c 29ff fe13 6899 3a00 0001 9c56 86dd
+8100 f300 2c0a 0001 fd38 4a42 9e59 0900
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+
+# fe80::20c:29ff:fe21:5742 > fe80::20c:29ff:fe13:6899: frag (1232|376)
+[out,eth0]
+6000 0000 0180 2c40 fe80 0000 0000 0000
+020c 29ff fe21 5742 fe80 0000 0000 0000
+020c 29ff fe13 6899 3a00 04d0 9c56 86dd
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f
+
+# fe80::20c:29ff:fe13:6899 > fe80::20c:29ff:fe21:5742: frag (0|1448) icmp6: echo request
+[in,eth0]
+6000 0000 05b0 2c40 fe80 0000 0000 0000
+020c 29ff fe13 6899 fe80 0000 0000 0000
+020c 29ff fe21 5742 3a00 0001 0000 0009
+8000 80fb 2c0a 0002 fe38 4a42 105e 0900
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f
+
+# fe80::20c:29ff:fe13:6899 > fe80::20c:29ff:fe21:5742: frag (1448|160)
+[in,eth0]
+6000 0000 00a8 2c40 fe80 0000 0000 0000
+020c 29ff fe13 6899 fe80 0000 0000 0000
+020c 29ff fe21 5742 3a00 05a8 0000 0009
+a0a1 a2a3 a4a5 a6a7 a8a9 aaab acad aeaf
+b0b1 b2b3 b4b5 b6b7 b8b9 babb bcbd bebf
+c0c1 c2c3 c4c5 c6c7 c8c9 cacb cccd cecf
+d0d1 d2d3 d4d5 d6d7 d8d9 dadb dcdd dedf
+e0e1 e2e3 e4e5 e6e7 e8e9 eaeb eced eeef
+f0f1 f2f3 f4f5 f6f7 f8f9 fafb fcfd feff
+0001 0203 0405 0607 0809 0a0b 0c0d 0e0f
+1011 1213 1415 1617 1819 1a1b 1c1d 1e1f
+2021 2223 2425 2627 2829 2a2b 2c2d 2e2f
+3031 3233 3435 3637 3839 3a3b 3c3d 3e3f
+
+# fe80::20c:29ff:fe21:5742 > fe80::20c:29ff:fe13:6899: frag (0|1232) icmp6: echo reply
+[out,eth0]
+6000 0000 04d8 2c40 fe80 0000 0000 0000
+020c 29ff fe21 5742 fe80 0000 0000 0000
+020c 29ff fe13 6899 3a00 0001 9889 f4c1
+8100 7ffb 2c0a 0002 fe38 4a42 105e 0900
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+
+# fe80::20c:29ff:fe21:5742 > fe80::20c:29ff:fe13:6899: frag (1232|376)
+[out,eth0]
+6000 0000 0180 2c40 fe80 0000 0000 0000
+020c 29ff fe21 5742 fe80 0000 0000 0000
+020c 29ff fe13 6899 3a00 04d0 9889 f4c1
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f 4041 4243 4445 4647
+4849 4a4b 4c4d 4e4f 5051 5253 5455 5657
+5859 5a5b 5c5d 5e5f 6061 6263 6465 6667
+6869 6a6b 6c6d 6e6f 7071 7273 7475 7677
+7879 7a7b 7c7d 7e7f 8081 8283 8485 8687
+8889 8a8b 8c8d 8e8f 9091 9293 9495 9697
+9899 9a9b 9c9d 9e9f a0a1 a2a3 a4a5 a6a7
+a8a9 aaab acad aeaf b0b1 b2b3 b4b5 b6b7
+b8b9 babb bcbd bebf c0c1 c2c3 c4c5 c6c7
+c8c9 cacb cccd cecf d0d1 d2d3 d4d5 d6d7
+d8d9 dadb dcdd dedf e0e1 e2e3 e4e5 e6e7
+e8e9 eaeb eced eeef f0f1 f2f3 f4f5 f6f7
+f8f9 fafb fcfd feff 0001 0203 0405 0607
+0809 0a0b 0c0d 0e0f 1011 1213 1415 1617
+1819 1a1b 1c1d 1e1f 2021 2223 2425 2627
+2829 2a2b 2c2d 2e2f 3031 3233 3435 3637
+3839 3a3b 3c3d 3e3f
+
+# frag: [0-7:nh][8-15:res][16-31:off][32-64:id]
+# Case 4: ipv6,fragment[id=10,off=0,m=1],tcp
+[in,eth0]
+600a af74 0038 2c40
+fe80 0000 0000 0000 020c 29ff fe21 5742
+fe80 0000 0000 0000 020c 29ff fe6e eb5a
+0600 0001 0000 0010
+fff3 0017 52ac fbab 0000 0000 c002 8000 d36b 0000
+0204 05a0 0103 0300 0402 0101 0101 080a 0000 0000 0000 0000 0000 0000
+
+# Case 5: ipv6,fragment[id=10,off=5,m=1],data
+[in,eth0]
+600a af74 0010 2c40
+fe80 0000 0000 0000 020c 29ff fe21 5742
+fe80 0000 0000 0000 020c 29ff fe6e eb5a
+0600 0030 0000 0010
+0000 0000 0000 0000
+
+# Case 3: ipv6,fragment[id=10,off=1,m=0],tcp
+[in,eth0]
+600a af74 0034 2c40
+fe80 0000 0000 0000 020c 29ff fe21 5742
+fe80 0000 0000 0000 020c 29ff fe6e eb5a
+0600 0008 0000 0010
+0000 0000 b002 8000 d36b 0000
+0204 05a0 0103 0300 0402 0101 0101 080a 0000 0000 0000 0000
+
+# Case 1: ipv6,fragment[id=11,off=0,m=1],hopopts,ah[next=dstopts]
+[in,eth0]
+600a af74 0020 2c40
+fe80 0000 0000 0000 020c 29ff fe21 5742
+fe80 0000 0000 0000 020c 29ff fe6e eb5a
+0000 0001 0000 0011
+3300 0000 0000 0000
+3c01 0000 0000 0000 0000 0000 0000 0000
+
+# Case 2: ipv6,fragment[id=11,off=3,m=0],dstopts,hop,tcp
+[in,eth0]
+600a af74 002c 2c40
+fe80 0000 0000 0000 020c 29ff fe21 5742
+fe80 0000 0000 0000 020c 29ff fe6e eb5a
+3c00 0008 0000 0011
+0000 0000 0000 0000
+0600 0000 0000 0000
+fff3 0017 52ac fbab 0000 0000 5002 8000 d36b 0000
+
+# Case 4: ipv6,fragment[id=10,off=0,m=1],tcp
+[out,eth0]
+6000 0000 001c 2c40
+fe80 0000 0000 0000 020c 29ff fe6e eb5a
+fe80 0000 0000 0000 020c 29ff fe21 5742
+0600 0001 0000 0010
+0017 fff3 0000 0000 52ac fbac 5014 0000 cd26 0000
+
+# Normal TCP Reset
+[out,eth0]
+6000 0000 0014 0640
+fe80 0000 0000 0000 020c 29ff fe6e eb5a
+fe80 0000 0000 0000 020c 29ff fe21 5742
+0017 fff3 0000 0000 52ac fbac 5014 0000 cd26 0000
+
+# Case 4: ipv6,fragment[id=12,off=0,m=1],tcp
+[in,eth0]
+600a af74 0038 2c40
+fe80 0000 0000 0000 020c 29ff fe21 5742
+fe80 0000 0000 0000 020c 29ff fe6e eb5a
+0600 0001 0000 0012
+fff3 0017 52ac fbab 0000 0000 c002 8000 d36b 0000
+0204 05a0 0103 0300 0402 0101 0101 080a 0000 0000 0000 0000 0000 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/ipv6.5 b/contrib/netbsd-tests/ipf/input/ipv6.5
new file mode 100644
index 0000000..e46407c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ipv6.5
@@ -0,0 +1,14 @@
+[out,de0]
+6000 0000 002c 2bff
+ef00 0000 0000 0000 0000 0000 0001 0013
+ff02 0000 0000 0000 0000 0001 ff01 000b
+0602 0000 0000 0000
+ff02 0000 0000 0000 0000 0001 ff01 000b
+0401 0019 0000 0000 0000 0000 5002 2000 9ea3 0000
+
+[out,de0]
+6000 0000 0014 06ff
+ef00 0000 0000 0000 0000 0000 0001 0013
+ff02 0000 0000 0000 0000 0001 ff01 000b
+0401 0019 0000 0000 0000 0000 5002 2000 9ea3 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/ipv6.6 b/contrib/netbsd-tests/ipf/input/ipv6.6
new file mode 100644
index 0000000..fffbad2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ipv6.6
@@ -0,0 +1,31 @@
+[out,gif0]
+6000 0000 0020 2c01
+ef00 1001 2002 0001 0000 0000 0000 0070
+2001 1002 3333 0001 0000 0000 0000 0001
+1100 0001 0000 0001
+8083 829a
+0020
+f4c1
+0000 0000 0000 0000 0000 0000 0000 0000
+
+[out,gif0]
+6000 0000 0020 2c01
+ef00 1001 2002 0001 0000 0000 0000 0070
+2001 1002 3333 0001 0000 0000 0000 0001
+1100 0008 0000 0001
+0000 0000 0000 0000 0000 0000 0000 0000
+
+[out,gif0]
+6000 0000 001e 2c01
+ef00 1001 2002 0001 0000 0000 0000 0070
+2001 1002 3333 0001 0000 0000 0000 0001
+1100 0001 0000 0001
+0000 0000 0000 0000 0000 0000 0000
+
+[out,gif0]
+6000 0000 0020 2c01
+ef00 1001 2002 0001 0000 0000 0000 0070
+2001 1002 3333 0001 0000 0000 0000 0001
+1100 001c 0000 0001
+0000 0000 0000 0000 0000 0000 0000 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/l1 b/contrib/netbsd-tests/ipf/input/l1
new file mode 100644
index 0000000..a59dbe3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/l1
@@ -0,0 +1,64 @@
+# 1.1.1.1,1025 -> 2.2.2.2,25 TTL=63 TCP DF SYN
+[]
+4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202
+0401 0019 0000 0001 0000 0000 5002 2000 85c2 0000
+
+#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A
+[]
+4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202
+0401 0019 0000 0001 0000 0000 5010 2000 85b4 0000
+
+#in on e1 tcp 2.1.2.2,25 1.1.1.1,1025 AS
+[]
+4500 0028 0000 4000 3f06 35cb 0202 0202 0101 0101
+0019 0401 0000 0011 0000 0002 5012 2000 85a0 0000
+
+#in on e1 tcp 2.1.2.2,25 1.1.1.1,1025 A
+[out,e1] 4500 0028 0000 4000 3f06 35cb 0202 0202 0101 0101
+0019 0401 0000 0012 0000 0002 5010 2000 85a1 0000
+
+#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 AF
+[]
+4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202
+0401 0019 0000 0002 0000 0012 5011 2000 85a0 0000
+
+#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A
+[]
+4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202
+0401 0019 0000 0012 0000 0003 5010 2000 85a0 0000
+
+#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A
+[]
+4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202
+0401 0019 0000 0012 0000 0003 5010 2000 85a0 0000
+
+#in on e1 udp 1.1.1.1,1 4.4.4.4,53
+[]
+4500 0028 0000 4000 3f11 31bc 0101 0101 0404 0404
+0001 0035 0000 d16f 0102 0304 0506 0708 090a 0b0d
+
+#in on e1 udp 2.2.2.2,2 4.4.4.4,53
+[]
+4500 0028 0000 4000 3f11 2fba 0202 0202 0404 0404
+0001 0035 0000 0000 0102 0304 0506 0708 090a 0b0d
+
+#in on e1 udp 2.2.2.2,2 4.4.4.4,53
+[]
+4500 0038 0000 4000 3f11 2faa 0202 0202 0404 0404
+0001 0035 0000 d47b 0102 0304 0506 0708 090a 0b0d
+0e0f 4061 4263 4465 4667 4869 4a6b 4c6d
+
+#in on e0 ip 4.4.4.4,53 1.1.1.1,1
+[]
+4500 0014 0000 4000 3f00 2fdf 0202 0202 0404 0404
+
+#in on e0 udp 3.3.3.3,1023 1.1.1.1,2049
+[]
+4500 001c 0000 4000 3f11 33ca 0303 0303 0101 0101
+03ff 0801 0000 ebde
+
+#in on e0 udp 1.1.1.1,2049 3.3.3.3,1023
+[]
+4500 001c 0000 4000 3f11 33ca 0101 0101 0303 0303
+0801 03ff 0000 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/n1 b/contrib/netbsd-tests/ipf/input/n1
new file mode 100644
index 0000000..04b24ef
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n1
@@ -0,0 +1,34 @@
+out on zx0 255 10.1.1.0 10.1.1.2
+out on zx0 255 10.1.1.1 10.1.1.2
+out on zx0 255 10.1.1.2 10.1.1.1
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1026 10.1.1.1,1025
+out on zx0 255 10.2.2.1 10.1.2.1
+out on zx0 255 10.2.2.2 10.1.2.1
+in on zx0 255 10.1.1.1 10.1.1.2
+in on zx0 255 10.1.1.2 10.1.1.1
+in on zx0 255 10.2.2.1 10.2.1.1
+in on zx0 255 10.2.2.2 10.2.1.1
+in on zx0 255 10.2.2.3 10.1.1.1
+in on zx0 255 10.2.3.4 10.2.2.2
+in on zx0 255 10.1.1.1 10.2.2.2
+in on zx0 255 10.1.1.2 10.2.2.2
+in on zx0 255 10.1.1.0 10.3.4.5
+in on zx0 255 10.1.1.1 10.3.4.5
+in on zx0 255 10.1.1.2 10.3.4.5
+in on zx0 tcp 10.1.1.1,1025 10.3.4.5,1025
+out on zx0 icmp 10.1.1.1 10.4.3.2
+in on zx0 icmp 10.4.3.2 10.2.2.2
+in on zx0 icmp 10.4.3.2 10.3.4.1
+in on zx0 icmp 10.4.3.2 10.3.4.2
+in on zx0 icmp 10.4.3.2 10.3.4.3
+in on zx0 icmp 10.4.3.2 10.3.4.4
+in on zx0 icmp 10.4.3.2 10.3.4.5
+out on zx0 34 10.1.1.2 10.4.3.2
+in on zx0 34 10.4.3.2 10.3.4.4
+out on zx0 34 10.1.1.2 10.4.3.4
+in on zx0 34 10.4.3.4 10.3.4.5
+out on zx0 34 10.1.1.3 10.4.3.4
+in on zx0 34 10.4.3.4 10.3.4.6
+out on zx0 35 10.1.1.3 10.4.3.4
+in on zx0 35 10.4.3.4 10.3.4.7
diff --git a/contrib/netbsd-tests/ipf/input/n10 b/contrib/netbsd-tests/ipf/input/n10
new file mode 100644
index 0000000..1e919cc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n10
@@ -0,0 +1,6 @@
+# TCP SYN packet with an MSS option
+[out,ppp0]
+4500 002c 10c9 4000 ff06 3289 c0a8 0103 96cb e002
+8032 0015 bd6b c9c8 0000 0000
+6002 2238 35f9 0000 0204 05b4
+
diff --git a/contrib/netbsd-tests/ipf/input/n100 b/contrib/netbsd-tests/ipf/input/n100
new file mode 100644
index 0000000..94ff8c4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n100
@@ -0,0 +1,8 @@
+out on zx0 255 1.1.1.1 2.3.2.3
+out on zx0 255 1.1.1.1 2.2.2.3
+out on zx0 255 1.1.1.2 2.2.2.3
+out on zx0 255 1.2.1.2 2.2.2.3
+out on zx0 255 1.1.1.1 2.2.2.4
+out on zx0 255 1.1.1.1 2.2.2.3
+out on zx0 tcp 1.1.1.1,101 2.3.2.3,203
+out on zx0 tcp 1.1.1.1,101 2.2.2.3,203
diff --git a/contrib/netbsd-tests/ipf/input/n101 b/contrib/netbsd-tests/ipf/input/n101
new file mode 100644
index 0000000..94ff8c4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n101
@@ -0,0 +1,8 @@
+out on zx0 255 1.1.1.1 2.3.2.3
+out on zx0 255 1.1.1.1 2.2.2.3
+out on zx0 255 1.1.1.2 2.2.2.3
+out on zx0 255 1.2.1.2 2.2.2.3
+out on zx0 255 1.1.1.1 2.2.2.4
+out on zx0 255 1.1.1.1 2.2.2.3
+out on zx0 tcp 1.1.1.1,101 2.3.2.3,203
+out on zx0 tcp 1.1.1.1,101 2.2.2.3,203
diff --git a/contrib/netbsd-tests/ipf/input/n102 b/contrib/netbsd-tests/ipf/input/n102
new file mode 100644
index 0000000..94ff8c4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n102
@@ -0,0 +1,8 @@
+out on zx0 255 1.1.1.1 2.3.2.3
+out on zx0 255 1.1.1.1 2.2.2.3
+out on zx0 255 1.1.1.2 2.2.2.3
+out on zx0 255 1.2.1.2 2.2.2.3
+out on zx0 255 1.1.1.1 2.2.2.4
+out on zx0 255 1.1.1.1 2.2.2.3
+out on zx0 tcp 1.1.1.1,101 2.3.2.3,203
+out on zx0 tcp 1.1.1.1,101 2.2.2.3,203
diff --git a/contrib/netbsd-tests/ipf/input/n103 b/contrib/netbsd-tests/ipf/input/n103
new file mode 100644
index 0000000..7957799
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n103
@@ -0,0 +1,8 @@
+out on zx0 tcp 1.1.1.1,101 2.3.2.3,203
+out on zx0 tcp 1.1.1.1,101 2.2.2.3,203
+out on zx0 tcp 1.1.1.1,101 2.2.2.3,203
+out on zx0 tcp 1.1.1.2,101 2.2.2.3,203
+out on zx0 tcp 10.10.10.10,101 2.2.2.3,203
+out on zx0 tcp 5.5.5.5,101 2.2.2.3,203
+in on zx0 tcp 2.2.2.3,4000 4.4.4.4,1000
+out on zx0 tcp 7.7.7.7,101 2.2.2.3,203
diff --git a/contrib/netbsd-tests/ipf/input/n104 b/contrib/netbsd-tests/ipf/input/n104
new file mode 100644
index 0000000..bb46b28
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n104
@@ -0,0 +1,48 @@
+[out,zx0]
+4500 0028 0001 0000 ff06 b5c9 0101 0101 0202 0202
+0065 00cb 0000 0001 1000 0001 5010 2000 789d 0000
+
+[in,zx0]
+4500 0028 0002 0000 ff06 b1c2 0606 0001 0404 0001
+0fa0 03e8 0000 0001 1000 0001 5010 2000 623f 0000
+
+[out,zx0]
+4500 0028 0003 0000 ff06 b5c7 0101 0101 0202 0202
+0066 00cb 0000 0001 1000 0001 5010 2000 789c 0000
+
+[in,zx0]
+4500 0028 0004 0000 ff06 b1bf 0606 0001 0404 0002
+0fa0 03e8 0000 0001 1000 0001 5010 2000 623e 0000
+
+[out,zx0]
+4500 0028 0005 0000 ff06 b5c5 0101 0101 0202 0202
+0067 00cb 0000 0001 1000 0001 5010 2000 789b 0000
+
+[in,zx0]
+4500 0028 0006 0000 ff06 b1bd 0606 0001 0404 0002
+0fa0 03e9 0000 0001 1000 0001 5010 2000 623d 0000
+
+[out,zx0]
+4500 0028 0007 0000 ff06 b5c3 0101 0101 0202 0202
+0068 00cb 0000 0001 1000 0001 5010 2000 789a 0000
+
+[in,zx0]
+4500 0028 0008 0000 ff06 b1ba 0606 0002 0404 0002
+0fa0 03e9 0000 0001 1000 0001 5010 2000 623c 0000
+
+[out,zx0]
+4500 0028 0009 0000 ff06 b5c1 0101 0101 0202 0202
+0069 00cb 0000 0001 1000 0001 5010 2000 7899 0000
+
+[in,zx0]
+4500 0028 000a 0000 ff06 b1b8 0606 0002 0404 0002
+0fa1 03e9 0000 0001 1000 0001 5010 2000 623b 0000
+
+[out,zx0]
+4500 0028 000b 0000 ff06 b5bf 0101 0101 0202 0202
+006a 00cb 0000 0001 1000 0001 5010 2000 7898 0000
+
+[in,zx0]
+4500 0028 000c 0000 ff06 b1b5 0606 0002 0404 0003
+0fa1 03e9 0000 0001 1000 0001 5010 2000 623a 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/n105 b/contrib/netbsd-tests/ipf/input/n105
new file mode 100644
index 0000000..63b68f0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n105
@@ -0,0 +1,8 @@
+[in,zx0]
+4500 0028 0001 0000 ff06 b5c9 0101 0101 0202 0202
+0065 0050 0000 0001 1000 0001 5010 2000 7918 0000
+
+[out,zx0]
+4500 0028 0001 0000 ff06 adc0 0606 0001 0404 0404
+0c38 03e8 0000 0001 1000 0001 5010 2000 61a4 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/n106 b/contrib/netbsd-tests/ipf/input/n106
new file mode 100644
index 0000000..4e93378
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n106
@@ -0,0 +1,8 @@
+[out,zx0]
+4500 0028 0001 0000 ff06 b5c9 0101 0101 0202 0202
+0065 0050 0000 0001 1000 0001 5010 2000 7918 0000
+
+[in,zx0]
+4500 0028 0001 0000 ff06 adc0 0606 0001 0404 0404
+0c38 03e8 0000 0001 1000 0001 5010 2000 61a4 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/n10_6 b/contrib/netbsd-tests/ipf/input/n10_6
new file mode 100644
index 0000000..5c1f5af
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n10_6
@@ -0,0 +1,6 @@
+# TCP SYN packet with an MSS option
+[out,ppp0]
+6000 0000 0018 06ff c0a8 0100 0000 0000 0000 0000 0000 0003 96cb e000 0000 0000 0000 0000 0000 0002
+8032 0015 bd6b c9c8 0000 0000
+6002 2238 35f9 0000 0204 05b4
+
diff --git a/contrib/netbsd-tests/ipf/input/n11 b/contrib/netbsd-tests/ipf/input/n11
new file mode 100644
index 0000000..8712674
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n11
@@ -0,0 +1,16 @@
+out on zx0 255 10.1.1.0 10.1.1.2
+out on zx0 255 10.1.1.1 10.1.1.2
+out on zx0 255 10.1.1.2 10.1.1.1
+out on zx0 255 10.2.2.1 10.1.2.1
+out on zx0 255 10.2.2.2 10.1.2.1
+in on zx0 255 10.1.1.1 10.1.1.2
+in on zx0 255 10.1.1.2 10.1.1.1
+in on zx0 255 10.2.2.1 10.2.1.1
+in on zx0 255 10.2.2.2 10.2.1.1
+in on zx0 255 10.2.2.3 10.1.1.1
+in on zx0 255 10.2.3.4 10.2.2.2
+in on zx0 255 10.1.1.1 10.2.2.2
+in on zx0 255 10.1.1.2 10.2.2.2
+in on zx0 255 10.1.1.0 10.3.4.5
+in on zx0 255 10.1.1.1 10.3.4.5
+in on zx0 255 10.1.1.2 10.3.4.5
diff --git a/contrib/netbsd-tests/ipf/input/n11_6 b/contrib/netbsd-tests/ipf/input/n11_6
new file mode 100644
index 0000000..128e45a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n11_6
@@ -0,0 +1,16 @@
+out6 on zx0 255 10:1:1::0 10:1:1::2
+out6 on zx0 255 10:1:1::1 10:1:1::2
+out6 on zx0 255 10:1:1::2 10:1:1::1
+out6 on zx0 255 10::2:2:1 10:1:2::1
+out6 on zx0 255 10::2:2:2 10:1:2::1
+in6 on zx0 255 10:1:1::1 10:1:1::2
+in6 on zx0 255 10:1:1::2 10:1:1::1
+in6 on zx0 255 10::2:2:1 10::2:1:1
+in6 on zx0 255 10::2:2:2 10::2:1:1
+in6 on zx0 255 10::2:2:3 10:1:1::1
+in6 on zx0 255 10::2:3:4 10::2:2:2
+in6 on zx0 255 10:1:1::1 10::2:2:2
+in6 on zx0 255 10:1:1::2 10::2:2:2
+in6 on zx0 255 10:1:1::0 10::3:4:5
+in6 on zx0 255 10:1:1::1 10::3:4:5
+in6 on zx0 255 10:1:1::2 10::3:4:5
diff --git a/contrib/netbsd-tests/ipf/input/n12 b/contrib/netbsd-tests/ipf/input/n12
new file mode 100644
index 0000000..16e479e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n12
@@ -0,0 +1,18 @@
+[out,le0=192.168.1.188]
+4510 0040 2020 4000 4006 17e1 c0a8 7e53 c0a8 0303
+12c2 0017 4e33 298e 0000 0000
+b002 4000 07af 0000 0204 05b4 0101 0402
+0103 0300 0101 080a 0c72 549e 0000 0000
+
+[in,le0]
+4500 003c 00b0 4000 fe06 f5fb c0a8 0303 c0a8 01bc
+0017 2710 f674 e02c 4e33 298f
+a012 2798 e317 0000 0101 080a 2c05 b797
+0c72 549e 0103 0300 0204 05b4
+
+[out,le0]
+4510 0034 493b 4000 4006 eed1 c0a8 7e53 c0a8 0303
+12c2 0017 4e33 298f f674 e02d
+8010 4000 8e2a 0000 0101 080a 0c72 549e
+2c05 b797
+
diff --git a/contrib/netbsd-tests/ipf/input/n12_6 b/contrib/netbsd-tests/ipf/input/n12_6
new file mode 100644
index 0000000..8583acb
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n12_6
@@ -0,0 +1,18 @@
+[out,le0=c0a8:0100::bc]
+6000 0000 002c 0640 c0a8 7e00 0000 0000 0000 0000 0000 0053 c0a8 0300 0000 0000 0000 0000 0000 0003
+12c2 0017 4e33 298e 0000 0000
+b002 4000 07af 0000 0204 05b4 0101 0402
+0103 0300 0101 080a 0c72 549e 0000 0000
+
+[in,le0]
+6000 0000 0028 06fe c0a8 0300 0000 0000 0000 0000 0000 0003 c0a8 0100 0000 0000 0000 0000 0000 00bc
+0017 2710 f674 e02c 4e33 298f
+a012 2798 e317 0000 0101 080a 2c05 b797
+0c72 549e 0103 0300 0204 05b4
+
+[out,le0]
+6000 0000 0020 0640 c0a8 7e00 0000 0000 0000 0000 0000 0053 c0a8 0300 0000 0000 0000 0000 0000 0003
+12c2 0017 4e33 298f f674 e02d
+8010 4000 8e2a 0000 0101 080a 0c72 549e
+2c05 b797
+
diff --git a/contrib/netbsd-tests/ipf/input/n13 b/contrib/netbsd-tests/ipf/input/n13
new file mode 100644
index 0000000..ac7bbbd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n13
@@ -0,0 +1,4 @@
+out on le0 192.168.1.1 150.1.1.1
+out on le0 192.168.1.1 150.1.1.2
+out on le0 192.168.1.2 150.1.1.2
+out on le0 192.168.1.3 150.1.1.1
diff --git a/contrib/netbsd-tests/ipf/input/n13_6 b/contrib/netbsd-tests/ipf/input/n13_6
new file mode 100644
index 0000000..54b262d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n13_6
@@ -0,0 +1,4 @@
+out6 on le0 192:168:1::1 150:1:1::1
+out6 on le0 192:168:1::1 150:1:1::2
+out6 on le0 192:168:1::2 150:1:1::2
+out6 on le0 192:168:1::3 150:1:1::1
diff --git a/contrib/netbsd-tests/ipf/input/n14 b/contrib/netbsd-tests/ipf/input/n14
new file mode 100644
index 0000000..969eb1c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n14
@@ -0,0 +1,4 @@
+in on gre0 tcp 10.2.2.5,2000 203.1.1.1,80
+in on gre0 tcp 10.2.2.6,2000 203.1.1.1,80
+in on gre0 tcp 10.2.2.7,2000 203.1.1.1,80
+in on gre0 tcp 10.2.2.5,2001 203.1.1.1,80
diff --git a/contrib/netbsd-tests/ipf/input/n14_6 b/contrib/netbsd-tests/ipf/input/n14_6
new file mode 100644
index 0000000..f5dd5d3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n14_6
@@ -0,0 +1,4 @@
+in6 on gre0 tcp 10::2:2:5,2000 203:1:1::1,80
+in6 on gre0 tcp 10::2:2:6,2000 203:1:1::1,80
+in6 on gre0 tcp 10::2:2:7,2000 203:1:1::1,80
+in6 on gre0 tcp 10::2:2:5,2001 203:1:1::1,80
diff --git a/contrib/netbsd-tests/ipf/input/n15 b/contrib/netbsd-tests/ipf/input/n15
new file mode 100644
index 0000000..715848e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n15
@@ -0,0 +1,2 @@
+in on le0 tcp 9.9.9.9,10011 5.5.5.5,80
+in on le0 tcp 9.9.9.9,10011 2.2.2.2,80
diff --git a/contrib/netbsd-tests/ipf/input/n15_6 b/contrib/netbsd-tests/ipf/input/n15_6
new file mode 100644
index 0000000..4a56138
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n15_6
@@ -0,0 +1,2 @@
+in6 on le0 tcp 9:9:9::9,10011 5:5::5:5,80
+in6 on le0 tcp 9:9:9::9,10011 2::2:2:2,80
diff --git a/contrib/netbsd-tests/ipf/input/n16 b/contrib/netbsd-tests/ipf/input/n16
new file mode 100644
index 0000000..ad09a45
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n16
@@ -0,0 +1,40 @@
+[in,vlan0]
+4520 0068 17e4 0000 6b11 3539 c05b ac33 45f8 4fc1
+1194 94f8 0054 0000
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+
+[out,vlan2]
+4520 0068 17e4 0000 6a11 ccba c05b ac33 ac1f 5318
+1194 07dd 0054 0000
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+
+[in,vlan2]
+4500 0084 ee0f 0000 8001 e0a2 ac1f 5318 c05b ac33
+0303 4ca1 0000 0000
+4520 0068 17e4 0000 6a11 ccba c05b ac33 ac1f 5318
+1194 07dd 0054 0000
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+
+[out,vlan0]
+4500 0084 ee0f 0000 8001 e0a2 ac1f 5318 c05b ac33
+0303 4ca1 0000 0000
+4520 0068 17e4 0000 6a11 ccba c05b ac33 ac1f 5318
+1194 07dd 0054 0000
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
+
diff --git a/contrib/netbsd-tests/ipf/input/n17 b/contrib/netbsd-tests/ipf/input/n17
new file mode 100644
index 0000000..29709de
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n17
@@ -0,0 +1,24 @@
+[out,zx0]
+4500 00a0 0000 0100 3f06 7555 0101 0101 0201 0101
+0401 0019 0000 0000 0000 0000 5010 2000 86b7 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000
+
+[in,zx0]
+4500 00a0 0000 0100 3f06 7553 0201 0101 0101 0103
+0401 0019 0000 0000 0000 0000 5010 2000 86b7 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/n18 b/contrib/netbsd-tests/ipf/input/n18
new file mode 100644
index 0000000..a7a610c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n18
@@ -0,0 +1,8 @@
+out on z0 tcp 2.2.2.2,22 3.3.3.3,30
+out on z0 tcp 2.2.2.2,23 3.3.3.3,31
+out on z0 tcp 2.2.2.2,24 3.3.3.3,32
+out on z0 tcp 2.2.2.2,25 3.3.3.3,33
+out on z0 tcp 2.2.2.2,26 3.3.3.3,34
+out on z0 tcp 2.2.2.2,27 3.3.3.3,35
+out on z0 tcp 2.2.2.2,28 3.3.3.3,36
+out on z0 tcp 2.2.2.2,29 3.3.3.3,37
diff --git a/contrib/netbsd-tests/ipf/input/n1_6 b/contrib/netbsd-tests/ipf/input/n1_6
new file mode 100644
index 0000000..c1badab
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n1_6
@@ -0,0 +1,34 @@
+out6 on zx0 255 10:1:1::0 10:1:1::2
+out6 on zx0 255 10:1:1::1 10:1:1::2
+out6 on zx0 255 10:1:1::2 10:1:1::1
+out6 on zx0 tcp 10:1:1::2,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::2,1026 10:1:1::1,1025
+out6 on zx0 255 10::2:2:1 10:1:2::1
+out6 on zx0 255 10::2:2:2 10:1:2::1
+in6 on zx0 255 10:1:1::1 10:1:1::2
+in6 on zx0 255 10:1:1::2 10:1:1::1
+in6 on zx0 255 10::2:2:1 10::2:1:1
+in6 on zx0 255 10::2:2:2 10::2:1:1
+in6 on zx0 255 10::2:2:3 10:1:1::1
+in6 on zx0 255 10::2:3:4 10::2:2:2
+in6 on zx0 255 10:1:1::1 10::2:2:2
+in6 on zx0 255 10:1:1::2 10::2:2:2
+in6 on zx0 255 10:1:1::0 10::3:4:5
+in6 on zx0 255 10:1:1::1 10::3:4:5
+in6 on zx0 255 10:1:1::2 10::3:4:5
+in6 on zx0 tcp 10:1:1::1,1025 10::3:4:5,1025
+out6 on zx0 58 10:1:1::1 10:4:3::2
+in6 on zx0 58 10:4:3::2 10::2:2:2
+in6 on zx0 58 10:4:3::2 10::3:4:1
+in6 on zx0 58 10:4:3::2 10::3:4:2
+in6 on zx0 58 10:4:3::2 10::3:4:3
+in6 on zx0 58 10:4:3::2 10::3:4:4
+in6 on zx0 58 10:4:3::2 10::3:4:5
+out6 on zx0 34 10:1:1::2 10:4:3::2
+in6 on zx0 34 10:4:3::2 10::3:4:4
+out6 on zx0 34 10:1:1::2 10:4:3::4
+in6 on zx0 34 10:4:3::4 10::3:4:5
+out6 on zx0 34 10:1:1::3 10:4:3::4
+in6 on zx0 34 10:4:3::4 10::3:4:6
+out6 on zx0 35 10:1:1::3 10:4:3::4
+in6 on zx0 35 10:4:3::4 10::3:4:7
diff --git a/contrib/netbsd-tests/ipf/input/n2 b/contrib/netbsd-tests/ipf/input/n2
new file mode 100644
index 0000000..476f16e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n2
@@ -0,0 +1,19 @@
+out on zx0 tcp 10.1.1.1,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.1,1025 10.1.1.2,1025
+out on zx0 10.1.1.0 10.1.1.2
+out on zx0 10.1.1.1 10.1.2.1
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1026 10.1.1.1,1025
+out on zx0 udp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.3,2000 10.1.2.1,80
+out on zx0 tcp 10.1.1.3,2001 10.1.3.1,80
+out on zx0 tcp 10.1.1.3,2002 10.1.4.1,80
+out on zx0 tcp 10.1.1.3,2003 10.1.4.1,80
+in on zx0 10.1.1.1 10.1.1.2
+in on zx0 tcp 10.1.1.1,1025 10.1.1.2,1025
+in on zx0 10.1.1.2 10.1.1.1
+in on zx0 tcp 10.1.1.1,1026 10.3.4.5,40000
+in on zx0 tcp 10.1.1.1,1025 10.3.4.5,40000
+in on zx0 udp 10.1.1.2,1025 10.3.4.5,40001
+in on zx0 tcp 10.1.2.1,80 10.3.4.5,40001
diff --git a/contrib/netbsd-tests/ipf/input/n200 b/contrib/netbsd-tests/ipf/input/n200
new file mode 100644
index 0000000..9b02158
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n200
@@ -0,0 +1,6 @@
+[in,bar0]
+4500 0028 0000 0000 0006 435a 6363 6363 5858 5858 038d 0050 0000 0000 0000 0000 5000 1000 2491 0000
+
+[out,bar0]
+4500 0044 0000 0000 ff11 bda6 7f00 0001 7f00 0001 2775 2775 0030 0000 4500 0028 0000 0000 0006 435a 6363 6363 5858 5858 038d 0050 0000 0000 0000 0000 5000 1000 2491 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/n2_6 b/contrib/netbsd-tests/ipf/input/n2_6
new file mode 100644
index 0000000..3ea74ff
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n2_6
@@ -0,0 +1,19 @@
+out6 on zx0 tcp 10:1:1::1,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::1,1025 10:1:1::2,1025
+out6 on zx0 10:1:1::0 10:1:1::2
+out6 on zx0 10:1:1::1 10:1:2::1
+out6 on zx0 tcp 10:1:1::2,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::2,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::2,1026 10:1:1::1,1025
+out6 on zx0 udp 10:1:1::2,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::3,2000 10:1:2::1,80
+out6 on zx0 tcp 10:1:1::3,2001 10:1:3::1,80
+out6 on zx0 tcp 10:1:1::3,2002 10:1:4::1,80
+out6 on zx0 tcp 10:1:1::3,2003 10:1:4::1,80
+in6 on zx0 10:1:1::1 10:1:1::2
+in6 on zx0 tcp 10:1:1::1,1025 10:1:1::2,1025
+in6 on zx0 10:1:1::2 10:1:1::1
+in6 on zx0 tcp 10:1:1::1,1026 10::3:4:5,40000
+in6 on zx0 tcp 10:1:1::1,1025 10::3:4:5,40000
+in6 on zx0 udp 10:1:1::2,1025 10::3:4:5,40001
+in6 on zx0 tcp 10:1:2::1,80 10::3:4:5,40001
diff --git a/contrib/netbsd-tests/ipf/input/n3 b/contrib/netbsd-tests/ipf/input/n3
new file mode 100644
index 0000000..deca317
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n3
@@ -0,0 +1,5 @@
+out on zz0 tcp 10.1.1.1,5000 203.1.1.1,80
+out on zz0 tcp 10.1.1.1,252 203.1.1.1,80
+out on zz0 tcp 10.1.0.0,32768 203.1.1.1,80
+out on zz0 udp 10.1.0.0,32768 203.1.1.1,80
+out on zz0 tcp 10.1.255.255,65535 203.1.1.1,80
diff --git a/contrib/netbsd-tests/ipf/input/n4 b/contrib/netbsd-tests/ipf/input/n4
new file mode 100644
index 0000000..1218ef9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n4
@@ -0,0 +1,10 @@
+in on zx0 tcp 10.3.3.3,12345 10.1.1.1,23
+out on zx0 tcp 10.2.2.1,10023 10.3.3.3,12345
+in on zx0 tcp 10.3.3.3,12345 10.1.1.1,53
+out on zx0 tcp 10.2.2.1,10053 10.3.3.3,12345
+in on zx0 tcp 10.3.3.3,12346 10.1.0.0,23
+out on zx0 tcp 10.2.2.1,10023 10.3.3.3,12346
+in on zx0 udp 10.3.3.3,12345 10.1.1.0,53
+out on zx0 udp 10.2.2.1,10053 10.3.3.3,12345
+in on zx0 tcp 10.3.3.3,12345 10.1.1.0,53
+out on zx0 tcp 10.2.2.1,53 10.3.3.3,12345
diff --git a/contrib/netbsd-tests/ipf/input/n4_6 b/contrib/netbsd-tests/ipf/input/n4_6
new file mode 100644
index 0000000..8f0f423
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n4_6
@@ -0,0 +1,10 @@
+in6 on zx0 tcp 10:3:3::3,12345 10:1:1::1,23
+out6 on zx0 tcp 10::2:2:1,10023 10:3:3::3,12345
+in6 on zx0 tcp 10:3:3::3,12345 10:1:1::1,53
+out6 on zx0 tcp 10::2:2:1,10053 10:3:3::3,12345
+in6 on zx0 tcp 10:3:3::3,12346 10:1:0::0,23
+out6 on zx0 tcp 10::2:2:1,10023 10:3:3::3,12346
+in6 on zx0 udp 10:3:3::3,12345 10:1:1::0,53
+out6 on zx0 udp 10::2:2:1,10053 10:3:3::3,12345
+in6 on zx0 tcp 10:3:3::3,12345 10:1:1::0,53
+out6 on zx0 tcp 10::2:2:1,53 10:3:3::3,12345
diff --git a/contrib/netbsd-tests/ipf/input/n5 b/contrib/netbsd-tests/ipf/input/n5
new file mode 100644
index 0000000..579210b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n5
@@ -0,0 +1,54 @@
+out on zx0 255 10.1.1.0 10.1.1.2
+out on zx0 255 10.1.1.1 10.1.1.2
+out on zx0 255 10.1.1.2 10.1.1.1
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1026 10.1.1.1,1025
+out on zx0 255 10.2.2.1 10.1.2.1
+out on zx0 255 10.2.2.2 10.1.2.1
+in on zx0 255 10.1.1.1 10.1.1.2
+in on zx0 255 10.1.1.2 10.1.1.1
+in on zx0 255 10.2.2.1 10.2.1.1
+in on zx0 255 10.2.2.2 10.2.1.1
+in on zx0 255 10.2.2.3 10.1.1.1
+in on zx0 255 10.2.3.4 10.2.2.2
+in on zx0 255 10.1.1.1 10.2.2.2
+in on zx0 255 10.1.1.2 10.2.2.2
+in on zx0 255 10.1.1.0 10.3.4.5
+in on zx0 255 10.1.1.1 10.3.4.5
+in on zx0 255 10.1.1.2 10.3.4.5
+in on zx0 tcp 10.1.1.1,1025 10.3.4.5,1025
+out on zx0 icmp 10.1.1.1 10.4.3.2
+in on zx0 icmp 10.4.3.2 10.2.2.2
+in on zx0 icmp 10.4.3.2 10.3.4.3
+in on zx0 icmp 10.4.3.2 10.3.4.5
+out on zx0 34 10.1.1.2 10.4.3.2
+in on zx0 34 10.4.3.2 10.3.4.4
+out on zx0 34 10.1.1.2 10.4.3.4
+in on zx0 34 10.4.3.4 10.3.4.5
+out on zx0 34 10.1.1.3 10.4.3.4
+in on zx0 34 10.4.3.4 10.3.4.6
+out on zx0 35 10.1.1.3 10.4.3.4
+in on zx0 35 10.4.3.4 10.3.4.7
+out on zx0 tcp 10.1.1.1,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.1,1025 10.1.1.2,1025
+out on zx0 10.1.1.0 10.1.1.2
+out on zx0 10.1.1.1 10.1.2.1
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1026 10.1.1.1,1025
+out on zx0 udp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.3,2000 10.1.2.1,80
+out on zx0 tcp 10.1.1.3,2001 10.1.3.1,80
+out on zx0 tcp 10.1.1.3,2002 10.1.4.1,80
+out on zx0 tcp 10.1.1.3,2003 10.1.4.1,80
+in on zx0 10.1.1.1 10.1.1.2
+in on zx0 tcp 10.1.1.1,1025 10.1.1.2,1025
+in on zx0 10.1.1.2 10.1.1.1
+out on zx0 tcp 10.1.1.1,1026 10.3.4.5,40000
+in on zx0 tcp 10.1.1.1,1026 10.3.4.5,40000
+out on zx0 tcp 10.1.1.1,1025 10.3.4.5,40000
+in on zx0 tcp 10.1.1.1,1025 10.3.4.5,40000
+out on zx0 udp 10.1.1.2,1025 10.3.4.5,40001
+in on zx0 udp 10.1.1.2,1025 10.3.4.5,40001
+out on zx0 tcp 10.1.2.1,80 10.3.4.5,40001
+in on zx0 tcp 10.1.2.1,80 10.3.4.5,40001
diff --git a/contrib/netbsd-tests/ipf/input/n5_6 b/contrib/netbsd-tests/ipf/input/n5_6
new file mode 100644
index 0000000..9ac0c29
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n5_6
@@ -0,0 +1,54 @@
+out6 on zx0 255 10:1:1::0 10:1:1::2
+out6 on zx0 255 10:1:1::1 10:1:1::2
+out6 on zx0 255 10:1:1::2 10:1:1::1
+out6 on zx0 tcp 10:1:1::2,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::2,1026 10:1:1::1,1025
+out6 on zx0 255 10::2:2:1 10:1:2::1
+out6 on zx0 255 10::2:2:2 10:1:2::1
+in6 on zx0 255 10:1:1::1 10:1:1::2
+in6 on zx0 255 10:1:1::2 10:1:1::1
+in6 on zx0 255 10::2:2:1 10::2:1:1
+in6 on zx0 255 10::2:2:2 10::2:1:1
+in6 on zx0 255 10::2:2:3 10:1:1::1
+in6 on zx0 255 10::2:3:4 10::2:2:2
+in6 on zx0 255 10:1:1::1 10::2:2:2
+in6 on zx0 255 10:1:1::2 10::2:2:2
+in6 on zx0 255 10:1:1::0 10::3:4:5
+in6 on zx0 255 10:1:1::1 10::3:4:5
+in6 on zx0 255 10:1:1::2 10::3:4:5
+in6 on zx0 tcp 10:1:1::1,1025 10::3:4:5,1025
+out6 on zx0 58 10:1:1::1 10:4:3::2
+in6 on zx0 58 10:4:3::2 10::2:2:2
+in6 on zx0 58 10:4:3::2 10::3:4:3
+in6 on zx0 58 10:4:3::2 10::3:4:5
+out6 on zx0 34 10:1:1::2 10:4:3::2
+in6 on zx0 34 10:4:3::2 10::3:4:4
+out6 on zx0 34 10:1:1::2 10:4:3::4
+in6 on zx0 34 10:4:3::4 10::3:4:5
+out6 on zx0 34 10:1:1::3 10:4:3::4
+in6 on zx0 34 10:4:3::4 10::3:4:6
+out6 on zx0 35 10:1:1::3 10:4:3::4
+in6 on zx0 35 10:4:3::4 10::3:4:7
+out6 on zx0 tcp 10:1:1::1,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::1,1025 10:1:1::2,1025
+out6 on zx0 10:1:1::0 10:1:1::2
+out6 on zx0 10:1:1::1 10:1:2::1
+out6 on zx0 tcp 10:1:1::2,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::2,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::2,1026 10:1:1::1,1025
+out6 on zx0 udp 10:1:1::2,1025 10:1:1::1,1025
+out6 on zx0 tcp 10:1:1::3,2000 10:1:2::1,80
+out6 on zx0 tcp 10:1:1::3,2001 10:1:3::1,80
+out6 on zx0 tcp 10:1:1::3,2002 10:1:4::1,80
+out6 on zx0 tcp 10:1:1::3,2003 10:1:4::1,80
+in6 on zx0 10:1:1::1 10:1:1::2
+in6 on zx0 tcp 10:1:1::1,1025 10:1:1::2,1025
+in6 on zx0 10:1:1::2 10:1:1::1
+out6 on zx0 tcp 10:1:1::1,1026 10::3:4:5,40000
+in6 on zx0 tcp 10:1:1::1,1026 10::3:4:5,40000
+out6 on zx0 tcp 10:1:1::1,1025 10::3:4:5,40000
+in6 on zx0 tcp 10:1:1::1,1025 10::3:4:5,40000
+out6 on zx0 udp 10:1:1::2,1025 10::3:4:5,40001
+in6 on zx0 udp 10:1:1::2,1025 10::3:4:5,40001
+out6 on zx0 tcp 10:1:2::1,80 10::3:4:5,40001
+in6 on zx0 tcp 10:1:2::1,80 10::3:4:5,40001
diff --git a/contrib/netbsd-tests/ipf/input/n6 b/contrib/netbsd-tests/ipf/input/n6
new file mode 100644
index 0000000..8a0c924
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n6
@@ -0,0 +1,13 @@
+in on zx0 tcp 10.2.2.2,12345 10.1.1.1,23
+in on zx0 tcp 10.2.2.2,12345 10.1.1.2,23
+in on zx0 tcp 10.3.0.1,12345 10.1.2.2,23
+in on zx0 tcp 10.3.0.1,12345 10.2.2.2,23
+in on zx0 tcp 10.3.3.3,12345 10.1.1.1,23
+in on zx0 tcp 10.2.2.2,12345 10.1.1.1,53
+in on zx0 tcp 10.3.3.3,12345 10.1.1.1,53
+in on zx0 tcp 10.2.2.2,12345 10.1.0.0,23
+in on zx0 tcp 10.3.3.3,12345 10.1.0.0,23
+in on zx0 udp 10.2.2.2,12345 10.1.1.0,53
+in on zx0 udp 10.3.3.3,12345 10.1.1.0,53
+in on zx0 tcp 10.2.2.2,12345 10.1.1.0,53
+in on zx0 tcp 10.3.3.3,12345 10.1.1.0,53
diff --git a/contrib/netbsd-tests/ipf/input/n6_6 b/contrib/netbsd-tests/ipf/input/n6_6
new file mode 100644
index 0000000..18300cd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n6_6
@@ -0,0 +1,13 @@
+in6 on zx0 tcp 10::2:2:2,12345 10:1:1::1,23
+in6 on zx0 tcp 10::2:2:2,12345 10:1:1::2,23
+in6 on zx0 tcp 10:3:0::1,12345 10:1:2::2,23
+in6 on zx0 tcp 10:3:0::1,12345 10::2:2:2,23
+in6 on zx0 tcp 10:3:3::3,12345 10:1:1::1,23
+in6 on zx0 tcp 10::2:2:2,12345 10:1:1::1,53
+in6 on zx0 tcp 10:3:3::3,12345 10:1:1::1,53
+in6 on zx0 tcp 10::2:2:2,12345 10:1:0::0,23
+in6 on zx0 tcp 10:3:3::3,12345 10:1:0::0,23
+in6 on zx0 udp 10::2:2:2,12345 10:1:1::0,53
+in6 on zx0 udp 10:3:3::3,12345 10:1:1::0,53
+in6 on zx0 tcp 10::2:2:2,12345 10:1:1::0,53
+in6 on zx0 tcp 10:3:3::3,12345 10:1:1::0,53
diff --git a/contrib/netbsd-tests/ipf/input/n7 b/contrib/netbsd-tests/ipf/input/n7
new file mode 100644
index 0000000..79af901
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n7
@@ -0,0 +1,9 @@
+in on zx0 tcp 10.2.3.1,1230 10.1.1.1,22
+in on zx0 tcp 10.2.3.1,1231 10.1.1.1,23
+in on zx0 tcp 10.2.3.1,1232 10.1.1.1,50
+in on zx0 tcp 10.2.3.1,1233 10.1.1.1,79
+in on zx0 tcp 10.2.3.1,1234 10.1.1.1,80
+in on zx0 tcp 10.2.3.1,1235 10.1.1.2,80
+in on zx0 tcp 10.2.3.1,1236 10.1.1.3,80
+in on zx0 tcp 10.2.3.1,1237 10.1.1.4,80
+in on zx0 tcp 10.2.3.1,1238 10.1.1.4,80
diff --git a/contrib/netbsd-tests/ipf/input/n7_6 b/contrib/netbsd-tests/ipf/input/n7_6
new file mode 100644
index 0000000..b31a1de
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n7_6
@@ -0,0 +1,9 @@
+in6 on zx0 tcp 10::2:3:1,1230 10:1:1::1,22
+in6 on zx0 tcp 10::2:3:1,1231 10:1:1::1,23
+in6 on zx0 tcp 10::2:3:1,1232 10:1:1::1,50
+in6 on zx0 tcp 10::2:3:1,1233 10:1:1::1,79
+in6 on zx0 tcp 10::2:3:1,1234 10:1:1::1,80
+in6 on zx0 tcp 10::2:3:1,1235 10:1:1::2,80
+in6 on zx0 tcp 10::2:3:1,1236 10:1:1::3,80
+in6 on zx0 tcp 10::2:3:1,1237 10:1:1::4,80
+in6 on zx0 tcp 10::2:3:1,1238 10:1:1::4,80
diff --git a/contrib/netbsd-tests/ipf/input/n8 b/contrib/netbsd-tests/ipf/input/n8
new file mode 100644
index 0000000..c0a5b3f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n8
@@ -0,0 +1,34 @@
+#v tos len id off ttl p sum src dst
+# ICMP ECHO (ping) exchange
+[out,icmp0]
+4500 0054 8bc1 0000 ff01 23dc 0202 0202 0404 0404
+0800 efdf 6220 0000 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[in,icmp0]
+4500 0054 3fd5 4000 ff01 1fc1 0404 0404 0a0a 0a01
+0000 f7df 6220 0000 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[out,icmp0]
+4500 0054 8bc1 0000 ff01 23dc 0202 0202 0404 0404
+0800 efde 6220 0001 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[in,icmp0]
+4500 0054 3fd5 4000 ff01 1fc1 0404 0404 0a0a 0a01
+0000 f7de 6220 0001 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
diff --git a/contrib/netbsd-tests/ipf/input/n8_6 b/contrib/netbsd-tests/ipf/input/n8_6
new file mode 100644
index 0000000..8039f78
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n8_6
@@ -0,0 +1,37 @@
+#v tos len id off ttl p sum src dst
+# ICMP ECHO (ping) exchange
+[out,icmp0]
+6000 0000 0040 3aff 0002 0000 0000 0000 0000 0002 0002 0002 0004 0004 0004 0000 0000 0000 0000 0004
+8000 774d 6220 0000 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+# ECHO reply
+[in,icmp0]
+6000 0000 0040 3aff 0004 0004 0004 0000 0000 0000 0000 0004 0010 0010 0010 0000 0000 0000 0000 0001
+8100 7624 6220 0000 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+# ECHO request
+[out,icmp0]
+6000 0000 0040 3aff 0002 0000 0000 0000 0000 0002 0002 0002 0004 0004 0004 0000 0000 0000 0000 0004
+8000 774c 6220 0001 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+# ECHO reply
+[in,icmp0]
+6000 0000 0040 3aff 0004 0004 0004 0000 0000 0000 0000 0004 0010 0010 0010 0000 0000 0000 0000 0001
+8100 7623 6220 0001 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
diff --git a/contrib/netbsd-tests/ipf/input/n9 b/contrib/netbsd-tests/ipf/input/n9
new file mode 100644
index 0000000..5c2d3c7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n9
@@ -0,0 +1,34 @@
+#v tos len id off ttl p sum src dst
+# ICMP ECHO (ping) exchange
+[in,icmp0]
+4500 0054 8bc1 0000 ff01 23dc 0202 0202 0404 0404
+0800 efdf 6220 0000 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[out,icmp0]
+4500 0054 3fd5 4000 ff01 23c5 0a0a 0a01 0202 0202
+0000 f7df 6220 0000 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[in,icmp0]
+4500 0054 8bc1 0000 ff01 23dc 0202 0202 0404 0404
+0800 efde 6220 0001 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[out,icmp0]
+4500 0054 3fd5 4000 ff01 23c5 0a0a 0a01 0202 0202
+0000 f7de 6220 0001 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
diff --git a/contrib/netbsd-tests/ipf/input/n9_6 b/contrib/netbsd-tests/ipf/input/n9_6
new file mode 100644
index 0000000..42db09d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/n9_6
@@ -0,0 +1,34 @@
+#v tos len id off ttl p sum src dst
+# ICMP ECHO (ping) exchange
+[in,icmp0]
+6000 0000 0040 3aff 0002 0000 0000 0000 0000 0002 0002 0002 0004 0004 0004 0000 0000 0000 0000 0004
+8000 774d 6220 0000 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[out,icmp0]
+6000 0000 0040 3aff 0010 0010 0010 0000 0000 0000 0000 0001 0002 0000 0000 0000 0000 0002 0002 0002
+8100 762c 6220 0000 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[in,icmp0]
+6000 0000 0040 3aff 0002 0000 0000 0000 0000 0002 0002 0002 0004 0004 0004 0000 0000 0000 0000 0004
+8000 774c 6220 0001 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
+[out,icmp0]
+6000 0000 0040 3aff 0010 0010 0010 0000 0000 0000 0000 0001 0002 0000 0000 0000 0000 0002 0002 0002
+8100 762b 6220 0001 3f6f 6e80 000b
+0d02 0809 0a0b 0c0d 0e0f 1011 1213 1415
+1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
+2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
+3637
+
diff --git a/contrib/netbsd-tests/ipf/input/ni1 b/contrib/netbsd-tests/ipf/input/ni1
new file mode 100644
index 0000000..519325f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni1
@@ -0,0 +1,59 @@
+#v tos len id off ttl p sum src dst
+# ICMP timeout exceeded in reply to a ICMP packet going out.
+# 2.2.2.2,44489 -> 4.4.4.4,33438
+[out,df0]
+4500 0028 4706 4000 0111 26b4 0202 0202 0404 0404
+afc9 829e 0014 6b10
+0402 0000 3be5 468d 000a cfc3
+
+[in,df0]
+4500 0038 809a 0000 ff01 2919 0303 0303 0606 0606
+0b00 5f7b 0000 0000
+4500 0028 0000 4000 0111 65b2 0606 0606 0404 0404
+afc9 829e 0014 6308
+
+[in,df0]
+4500 0044 809a 0000 ff01 290d 0303 0303 0606 0606
+0b00 0939 0000 0000
+4500 0028 0000 4000 0111 65b2 0606 0606 0404 0404
+afc9 829e 0014 6308
+0402 0000 3be5 468d 000a cfc3
+
+# 2.2.2.2,2048 -> 4.4.4.4,33438
+[out,df0]
+4500 0028 4706 4000 0111 26b4 0202 0202 0404 0404
+0800 829e 0014 12da
+0402 0000 3be5 468d 000a cfc3
+
+[in,df0]
+4500 0038 809a 0000 ff01 2918 0303 0303 0606 0607
+0b00 5f7c 0000 0000
+4500 0028 0000 4000 0111 65b1 0606 0607 0404 0404
+4e20 829e 0014 c4b0
+
+[in,df0]
+4500 0044 809a 0000 ff01 290c 0303 0303 0606 0607
+0b00 093a 0000 0000
+4500 0028 0000 4000 0111 65b1 0606 0607 0404 0404
+4e20 829e 0014 c4b0
+0402 0000 3be5 468d 000a cfc3
+
+# 2.2.2.2,20480 -> 4.4.4.4,33438
+[out,df0]
+4500 0028 4706 4000 0111 26b4 0202 0202 0404 0404
+5000 829e 0014 cad9
+0402 0000 3be5 468d 000a cfc3
+
+[in,df0]
+4500 0038 809a 0000 ff01 2917 0303 0303 0606 0608
+0b00 0775 0000 0000
+4500 0028 0000 4000 0111 65b0 0606 0608 0404 0404
+07d0 829e 0014 6308
+
+[in,df0]
+4500 0044 809a 0000 ff01 290b 0303 0303 0606 0608
+0b00 093b 0000 0000
+4500 0028 0000 4000 0111 65b0 0606 0608 0404 0404
+07d0 829e 0014 0b00
+0402 0000 3be5 468d 000a cfc3
+
diff --git a/contrib/netbsd-tests/ipf/input/ni10 b/contrib/netbsd-tests/ipf/input/ni10
new file mode 100644
index 0000000..636c4f1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni10
@@ -0,0 +1,29 @@
+#v tos len id off ttl p sum src dst
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going out)
+# IP 4.4.4.4 2.2.2.2 TCP(20480,80)
+[in,df0]
+4500 003c 4706 4000 ff06 28aa 0404 0404 0202 0202
+5000 0050 0000 0001 0000 0000 a002 16d0 d8e2 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+# IP 3.3.3.3 -> 4.4.4.4 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80))
+[out,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303 0404 0404
+0303 acab 0000 0000
+4500 003c 4706 4000 ff06 20a2 0404 0404 0606 0606
+5000 0050 0000 0001
+
+# IP 3.3.3.3 -> 4.4.4.4 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80))
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[out,df0]
+4500 0058 809a 0000 ff01 2cfd 0303 0303 0404 0404
+0303 113f 0000 0000
+4500 003c 4706 4000 ff06 20a2 0404 0404 0606 0606
+5000 0050 0000 0001 0000 0000 a002 16d0 d0da 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+# IP 3.3.3.3 -> 4.4.4.4 ICMP (IP(4.4.4.4,6.6.6.6) TCP(20480,80))
+[out,df0]
+4500 0038 809a 0000 ff01 2b1b 0303 0303 0505 0505
+0303 acab 0000 0000
+4500 003c 4706 4000 ff06 28ab 0404 0404 0202 0201 5000 0050 0000 0001
+
diff --git a/contrib/netbsd-tests/ipf/input/ni11 b/contrib/netbsd-tests/ipf/input/ni11
new file mode 100644
index 0000000..0650abb
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni11
@@ -0,0 +1,26 @@
+#v tos len id off ttl p sum src dst
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going out)
+[in,df0]
+4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202
+5000 0500 0000 0001 0000 0000 a002 16d0 cc32 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[out,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303 0404 0404
+0303 0fa3 0000 0000
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101
+5000 9d58 0000 0001
+
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[out,df0]
+4500 0058 809a 0000 ff01 2cfd 0303 0303 0404 0404
+0303 0735 0000 0000
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101
+5000 9d58 0000 0001 0000 0000 a002 16d0 3ddc 0000
+0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[out,df0]
+4500 0038 809a 0000 ff01 2b1b 0303 0303 0505 0505
+0303 0fa3 0000 0000
+4500 003c 4706 4000 ff06 2aab 0404 0404 0101 0102 5000 9d58 0000 0001
+
diff --git a/contrib/netbsd-tests/ipf/input/ni12 b/contrib/netbsd-tests/ipf/input/ni12
new file mode 100644
index 0000000..c44aacc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni12
@@ -0,0 +1,26 @@
+#v tos len id off ttl p sum src dst
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going out)
+[in,df0]
+4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202
+5000 0500 0000 0001 0000 0000 a002 16d0 cc32 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[out,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303 0404 0404
+0303 10bb 0000 0000
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101
+5000 9c40 0000 0001
+
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[out,df0]
+4500 0058 809a 0000 ff01 2cfd 0303 0303 0404 0404
+0303 0735 0000 0000
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101
+5000 9c40 0000 0001 0000 0000 a002 16d0 3ef4 0000
+0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[out,df0]
+4500 0038 809a 0000 ff01 2b1b 0303 0303 0505 0505
+0303 10bb 0000 0000
+4500 003c 4706 4000 ff06 2aab 0404 0404 0101 0102 5000 9c40 0000 0001
+
diff --git a/contrib/netbsd-tests/ipf/input/ni13 b/contrib/netbsd-tests/ipf/input/ni13
new file mode 100644
index 0000000..70c1952
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni13
@@ -0,0 +1,231 @@
+# 23:18:36.130424 192.168.113.1.1511 > 192.168.113.3.1723: S 2884651685:2884651685(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
+[in,pcn1=192.168.113.3]
+4500 0030 5e11 4000 8006 3961 c0a8 7101 c0a8 7103
+05e7 06bb abf0 4aa5 0000 0000 7002 faf0 21a1 0000 0204 05b4 0101 0402
+
+# 23:18:36.130778 192.168.113.3.1723 > 192.168.113.1.1511: S 2774821082:2774821082(0) ack 2884651686 win 32768 <mss 1460> (DF)
+[out,pcn1]
+4500 002c 69a6 4000 4006 6dd0 c0a8 7103 c0a8 7101
+06bb 05e7 a564 68da abf0 4aa6 6012 8000 a348 0000 0204 05b4
+
+# 23:18:36.130784 192.168.113.1.1511 > 192.168.113.3.1723: P 1:157(156) ack 1 win 64240: pptp CTRL_MSGTYPE=SCCRQ PROTO_VER(1.0) FRAME_CAP(A) BEARER_CAP(A) MAX_CHAN(0) FIRM_REV(2600) HOSTNAME() VENDOR(Microsoft Windows NT) (DF)
+[in,pcn1]
+4500 00c4 5e12 4000 8006 38cc c0a8 7101 c0a8 7103
+05e7 06bb abf0 4aa6 a564 68db
+5018 faf0 e2a0 0000 009c 0001 1a2b 3c4d
+0001 0000 0100 0000 0000 0001 0000 0001
+0000 0a28 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 4d69 6372 6f73 6f66 7420 5769
+6e64 6f77 7320 4e54 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+# 23:18:36.260235 192.168.113.3.1723 > 192.168.113.1.1511: P 1:157(156) ack 157 win 33580: pptp CTRL_MSGTYPE=SCCRP PROTO_VER(1.0) RESULT_CODE(1) ERR_CODE(0) FRAME_CAP() BEARER_CAP() MAX_CHAN(1) FIRM_REV(1) HOSTNAME(local) VENDOR(linux) (DF)
+[out,pcn1]
+4500 00c4 69a7 4000 4006 6d37 c0a8 7103 c0a8 7101
+06bb 05e7 a564 68db abf0 4b42
+5018 832c cecf 0000 009c 0001 1a2b 3c4d
+0002 0000 0100 0100 0000 0000 0000 0000
+0001 0001 6c6f 6361 6c00 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 6c69 6e75 7800 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+# 23:18:36.260252 192.168.113.1.1511 > 192.168.113.3.1723: P 157:325(168) ack 157 win 64084: pptp CTRL_MSGTYPE=OCRQ CALL_ID(16384) CALL_SER_NUM(4913) MIN_BPS(300) MAX_BPS(100000000) BEARER_TYPE(Any) FRAME_TYPE(E) RECV_WIN(64) PROC_DELAY(0) PHONE_NO_LEN(0) PHONE_NO() SUB_ADDR() (DF)
+[in,pcn1]
+4500 00d0 5e13 4000 8006 38bf c0a8 7101 c0a8 7103
+05e7 06bb abf0 4b42 a564 6977
+5018 fa54 ac07 0000 00a8 0001 1a2b 3c4d
+0007 0000 4000 1331 0000 012c 05f5 e100
+0000 0003 0000 0003 0040 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+
+# 23:18:36.272856 192.168.113.3.1723 > 192.168.113.1.1511: P 157:189(32) ack 325 win 33580: pptp CTRL_MSGTYPE=OCRP CALL_ID(0) PEER_CALL_ID(16384) RESULT_CODE(1) ERR_CODE(0) CAUSE_CODE(0) CONN_SPEED(100000000) RECV_WIN(64) PROC_DELAY(0) PHY_CHAN_ID(0) (DF)
+[out,pcn1]
+4500 0048 69a8 4000 4006 6db2 c0a8 7103 c0a8 7101
+06bb 05e7 a564 6977 abf0 4bea
+5018 832c 36fa 0000 0020 0001 1a2b 3c4d
+0008 0000 0000 4000 0100 0000 05f5 e100
+0040 0000 0000 0000
+
+# 23:18:36.321819 192.168.113.1.1511 > 192.168.113.3.1723: P 325:349(24) ack 189 win 64052: pptp CTRL_MSGTYPE=SLI PEER_CALL_ID(0) SEND_ACCM(0xffffffff) RECV_ACCM(0xffffffff) (DF)
+[in,pcn1]
+4500 0040 5e14 4000 8006 394e c0a8 7101 c0a8 7103
+05e7 06bb abf0 4bea a564 6997
+5018 fa34 e810 0000 0018 0001 1a2b 3c4d
+000f 0000 0000 0000 ffff ffff ffff ffff
+
+# 23:18:36.349759 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:0 ppp: LCP 25: Conf-Req(0), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC, Call-Back CBCP
+[in,pcn1]
+4500 0039 5e15 0000 802f 792b c0a8 7101 c0a8 7103
+3001 880b 0019 0000 0000 0000
+ff03 c021 0100 0015 0104 0578 0506 577f
+7c5b 0702 0802 0d03 06
+
+# 23:18:36.389970 192.168.113.3 > 192.168.113.1: gre [KAv1] ID:4000 A:4294967295 [|gre]
+[out,pcn1]
+4500 0020 69a9 0000 ff2f eeaf c0a8 7103 c0a8 7101
+2081 880b 0000 4000 ffff ffff
+
+# 23:18:36.518426 192.168.113.3.1723 > 192.168.113.1.1511: . ack 349 win 33580 (DF)
+[out,pcn1]
+4500 0028 69aa 4000 4006 6dd0 c0a8 7103 c0a8 7101
+06bb 05e7 a564 6997 abf0 4c02 5010 832c b5c1 0000
+
+# 23:18:36.555363 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:0 ppp: LCP 24: Conf-Req(1), ACCM=00000000, Magic-Num=22d90cfa, PFC, ACFC
+[out,pcn1]
+4500 0038 69ab 0000 ff2f ee95 c0a8 7103 c0a8 7101
+3001 880b 0018 4000 0000 0000
+ff03 c021 0101 0014 0206 0000 0000 0506
+22d9 0cfa 0702 0802
+
+# 23:18:36.556030 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:1 A:0 ppp: LCP 11: Conf-Rej(0), Call-Back CBCP
+[out,pcn1]
+4500 002f 69ac 0000 ff2f ee9d c0a8 7103 c0a8 7101
+3081 880b 000b 4000 0000 0001 0000 0000 ff03 c021 0400 0007 0d03 06
+
+# 23:18:36.557166 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:1 A:1 ppp: LCP 24: Conf-Ack(1), ACCM=00000000, Magic-Num=22d90cfa, PFC, ACFC
+[in,pcn1]
+4500 003c 5e16 0000 802f 7927 c0a8 7101 c0a8 7103
+3081 880b 0018 0000 0000 0001
+0000 0001 ff03 c021 0201 0014 0206 0000
+0000 0506 22d9 0cfa 0702 0802
+
+# 23:18:36.557764 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:2 ppp: LCP 22: Conf-Req(1), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC
+[in,pcn1]
+4500 0036 5e17 0000 802f 792c c0a8 7101 c0a8 7103
+3001 880b 0016 0000 0000 0002
+ff03 c021 0101 0012 0104 0578 0506 577f
+7c5b 0702 0802
+
+# 23:18:36.564658 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:2 A:2 ppp: LCP 22: Conf-Ack(1), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC
+[out,pcn1]
+4500 003a 69ad 0000 ff2f ee91 c0a8 7103 c0a8 7101
+3081 880b 0016 4000 0000 0002
+0000 0002 ff03 c021 0201 0012 0104 0578
+0506 577f 7c5b 0702 0802
+
+# 23:18:36.564803 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:3 ppp: IPCP 18: Conf-Req(1), IP-Addr=192.168.0.1, IP-Comp VJ-Comp
+[out,pcn1]
+4500 0032 69ae 0000 ff2f ee98 c0a8 7103 c0a8 7101
+3001 880b 0012 4000 0000 0003
+8021 0101 0010 0306 c0a8 0001 0206 002d
+0f01
+
+# 23:18:36.570395 192.168.113.1.1511 > 192.168.113.3.1723: P 349:373(24) ack 189 win 64052: pptp CTRL_MSGTYPE=SLI PEER_CALL_ID(0) SEND_ACCM(0x00000000) RECV_ACCM(0xffffffff) (DF)
+[in,pcn1]
+4500 0040 5e18 4000 8006 394a c0a8 7101 c0a8 7103
+05e7 06bb abf0 4c02 a564 6997
+5018 fa34 e7f8 0000 0018 0001 1a2b 3c4d
+000f 0000 0000 0000 0000 0000 ffff ffff
+
+# 23:18:36.573307 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:3 A:3 ppp: LCP 20: Ident(2), Magic-Num=577f7c5b
+[in,pcn1]
+4500 0038 5e19 0000 802f 7928 c0a8 7101 c0a8 7103
+3081 880b 0014 0000 0000 0003
+0000 0003 c021 0c02 0012 577f 7c5b 4d53
+5241 5356 352e 3130
+
+# 23:18:36.573856 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:4 A:3 ppp: LCP 26: Code-Rej(2)
+[out,pcn1]
+4500 003e 69af 0000 ff2f ee8b c0a8 7103 c0a8 7101
+3081 880b 001a 4000 0000 0004
+0000 0003 ff03 c021 0702 0016 0c02 0012
+577f 7c5b 4d53 5241 5356 352e 3130
+
+# 23:18:36.584936 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:4 A:4 ppp: LCP 26: Ident(3), Magic-Num=577f7c5b
+[in,pcn1]
+4500 003e 5e1a 0000 802f 7921 c0a8 7101 c0a8 7103
+3081 880b 001a 0000 0000 0004
+0000 0004 c021 0c03 0018 577f 7c5b 4d53
+5241 532d 302d 434c 4159 4d4f 4f52
+
+# 23:18:36.585562 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:5 A:4 ppp: LCP 32: Code-Rej(3)
+[out,pcn1]
+4500 0044 69b0 0000 ff2f ee84 c0a8 7103 c0a8 7101
+3081 880b 0020 4000 0000 0005
+0000 0004 ff03 c021 0703 001c 0c03 0018
+577f 7c5b 4d53 5241 532d 302d 434c 4159
+4d4f 4f52
+
+# 23:18:36.588721 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:5 A:5 ppp: CCP 12: Conf-Req(4), MPPC
+[in,pcn1]
+4500 0030 5e1b 0000 802f 792e c0a8 7101 c0a8 7103
+3081 880b 000c 0000 0000 0005
+0000 0005 80fd 0104 000a 1206 0100 0001
+
+# 23:18:36.589445 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:6 A:5 ppp: CCP 6: Conf-Req(1)
+[out,pcn1]
+4500 002a 69b1 0000 ff2f ee9d c0a8 7103 c0a8 7101
+3081 880b 0006 4000 0000 0006
+0000 0005 80fd 0101 0004
+
+# 23:18:36.589540 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:7 ppp: CCP 12: Conf-Rej(4), MPPC
+[out,pcn1]
+4500 002c 69b2 0000 ff2f ee9a c0a8 7103 c0a8 7101
+3001 880b 000c 4000 0000 0007
+80fd 0404 000a 1206 0100 0001
+
+# 23:18:36.590023 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:6 A:7 ppp: IPCP 36: Conf-Req(5), IP-Addr=0.0.0.0, Pri-DNS=0.0.0.0, Pri-NBNS=0.0.0.0, Sec-DNS=0.0.0.0, Sec-NBNS=0.0.0.0
+[in,pcn1]
+4500 0048 5e1c 0000 802f 7915 c0a8 7101 c0a8 7103
+3081 880b 0024 0000 0000 0006
+0000 0007 8021 0105 0022 0306 0000 0000
+8106 0000 0000 8206 0000 0000 8306 0000
+0000 8406 0000 0000
+
+# 23:18:36.590489 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:8 A:6 ppp: IPCP 30: Conf-Rej(5), Pri-DNS=0.0.0.0, Pri-NBNS=0.0.0.0, Sec-DNS=0.0.0.0, Sec-NBNS=0.0.0.0
+[out,pcn1]
+4500 0042 69b3 0000 ff2f ee83 c0a8 7103 c0a8 7101
+3081 880b 001e 4000 0000 0008
+0000 0006 8021 0405 001c 8106 0000 0000
+8206 0000 0000 8306 0000 0000 8406 0000
+0000
+
+# 23:18:36.591003 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:7 A:8 ppp: IPCP 12: Conf-Rej(1), IP-Comp VJ-Comp
+[in,pcn1]
+4500 0030 5e1d 0000 802f 792c c0a8 7101 c0a8 7103
+3081 880b 000c 0000 0000 0007
+0000 0008 8021 0401 000a 0206 002d 0f01
+
+# 23:18:36.593819 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:9 A:7 ppp: IPCP 12: Conf-Req(2), IP-Addr=192.168.0.1
+[out,pcn1]
+4500 0030 69b4 0000 ff2f ee94 c0a8 7103 c0a8 7101
+3081 880b 000c 4000 0000 0009
+0000 0007 8021 0102 000a 0306 c0a8 0001
+
+# 23:18:36.594840 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:8 A:9 ppp: CCP 6: Conf-Ack(1)
+[in,pcn1]
+4500 002a 5e1e 0000 802f 7931 c0a8 7101 c0a8 7103
+3081 880b 0006 0000 0000 0008
+0000 0009 80fd 0201 0004
+
+# 23:18:36.595525 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:9 ppp: CCP 18: Term-Req(6)
+[in,pcn1]
+4500 0032 5e1f 0000 802f 7928 c0a8 7101 c0a8 7103
+3001 880b 0012 0000 0000 0009
+80fd 0506 0010 577f 7c5b 003c cd74 0000
+02dc
+
+# 23:18:36.595937 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:10 A:9 ppp: CCP 6: Term-Ack(6)
+[out,pcn1]
+4500 002a 69b5 0000 ff2f ee99 c0a8 7103 c0a8 7101
+3081 880b 0006 4000 0000 000a
+0000 0009 80fd 0606 0004
+
diff --git a/contrib/netbsd-tests/ipf/input/ni14 b/contrib/netbsd-tests/ipf/input/ni14
new file mode 100644
index 0000000..6bc1276
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni14
@@ -0,0 +1,235 @@
+# 23:18:36.130424 192.168.113.1.1511 > 192.168.113.3.1723: S 2884651685:2884651685(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
+[in,pcn1=192.168.113.3]
+4500 0030 5e11 4000 8006 3961 c0a8 7101 c0a8 7103
+05e7 06bb abf0 4aa5 0000 0000
+7002 faf0 21a1 0000 0204 05b4 0101 0402
+
+# 23:18:36.130778 192.168.113.3.1723 > 192.168.113.1.1511: S 2774821082:2774821082(0) ack 2884651686 win 32768 <mss 1460> (DF)
+[out,pcn1]
+4500 002c 69a6 4000 4006 207b 7f00 0001 c0a8 7101
+06bb 05e7 a564 68da abf0 4aa6
+6012 8000 55f3 0000 0204 05b4
+
+# 23:18:36.130784 192.168.113.1.1511 > 192.168.113.3.1723: P 1:157(156) ack 1 win 64240: pptp CTRL_MSGTYPE=SCCRQ PROTO_VER(1.0) FRAME_CAP(A) BEARER_CAP(A) MAX_CHAN(0) FIRM_REV(2600) HOSTNAME() VENDOR(Microsoft Windows NT) (DF)
+[in,pcn1]
+4500 00c4 5e12 4000 8006 38cc c0a8 7101 c0a8 7103
+05e7 06bb abf0 4aa6 a564 68db
+5018 faf0 e2a0 0000 009c 0001 1a2b 3c4d
+0001 0000 0100 0000 0000 0001 0000 0001
+0000 0a28 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 4d69 6372 6f73 6f66 7420 5769
+6e64 6f77 7320 4e54 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+# 23:18:36.260235 192.168.113.3.1723 > 192.168.113.1.1511: P 1:157(156) ack 157 win 33580: pptp CTRL_MSGTYPE=SCCRP PROTO_VER(1.0) RESULT_CODE(1) ERR_CODE(0) FRAME_CAP() BEARER_CAP() MAX_CHAN(1) FIRM_REV(1) HOSTNAME(local) VENDOR(linux) (DF)
+[out,pcn1]
+4500 00c4 69a7 4000 4006 1fe2 7f00 0001 c0a8 7101
+06bb 05e7 a564 68db abf0 4b42
+5018 832c 817a 0000 009c 0001 1a2b 3c4d
+0002 0000 0100 0100 0000 0000 0000 0000
+0001 0001 6c6f 6361 6c00 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 6c69 6e75 7800 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+# 23:18:36.260252 192.168.113.1.1511 > 192.168.113.3.1723: P 157:325(168) ack 157 win 64084: pptp CTRL_MSGTYPE=OCRQ CALL_ID(16384) CALL_SER_NUM(4913) MIN_BPS(300) MAX_BPS(100000000) BEARER_TYPE(Any) FRAME_TYPE(E) RECV_WIN(64) PROC_DELAY(0) PHONE_NO_LEN(0) PHONE_NO() SUB_ADDR() (DF)
+[in,pcn1]
+4500 00d0 5e13 4000 8006 38bf c0a8 7101 c0a8 7103
+05e7 06bb abf0 4b42 a564 6977
+5018 fa54 ac07 0000 00a8 0001 1a2b 3c4d
+0007 0000 4000 1331 0000 012c 05f5 e100
+0000 0003 0000 0003 0040 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+
+# 23:18:36.272856 192.168.113.3.1723 > 192.168.113.1.1511: P 157:189(32) ack 325 win 33580: pptp CTRL_MSGTYPE=OCRP CALL_ID(0) PEER_CALL_ID(16384) RESULT_CODE(1) ERR_CODE(0) CAUSE_CODE(0) CONN_SPEED(100000000) RECV_WIN(64) PROC_DELAY(0) PHY_CHAN_ID(0) (DF)
+[out,pcn1]
+4500 0048 69a8 4000 4006 205d 7f00 0001 c0a8 7101
+06bb 05e7 a564 6977 abf0 4bea
+5018 832c e9a4 0000 0020 0001 1a2b 3c4d
+0008 0000 0000 4000 0100 0000 05f5 e100
+0040 0000 0000 0000
+
+# 23:18:36.321819 192.168.113.1.1511 > 192.168.113.3.1723: P 325:349(24) ack 189 win 64052: pptp CTRL_MSGTYPE=SLI PEER_CALL_ID(0) SEND_ACCM(0xffffffff) RECV_ACCM(0xffffffff) (DF)
+[in,pcn1]
+4500 0040 5e14 4000 8006 394e c0a8 7101 c0a8 7103
+05e7 06bb abf0 4bea a564 6997
+5018 fa34 e810 0000 0018 0001 1a2b 3c4d
+000f 0000 0000 0000 ffff ffff ffff ffff
+
+# 23:18:36.349759 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:0 ppp: LCP 25: Conf-Req(0), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC, Call-Back CBCP
+[in,pcn1]
+4500 0039 5e15 0000 802f 792b c0a8 7101 c0a8 7103
+3001 880b 0019 0000 0000 0000
+ff03 c021 0100 0015 0104 0578 0506 577f
+7c5b 0702 0802 0d03 06
+
+# 23:18:36.389970 192.168.113.3 > 192.168.113.1: gre [KAv1] ID:4000 A:4294967295 [|gre]
+[out,pcn1]
+4500 0020 69a9 0000 ff2f a15a 7f00 0001 c0a8 7101
+2081 880b 0000 4000 ffff ffff
+
+# 23:18:36.518426 192.168.113.3.1723 > 192.168.113.1.1511: . ack 349 win 33580 (DF)
+[out,pcn1]
+4500 0028 69aa 4000 4006 207b 7f00 0001 c0a8 7101
+06bb 05e7 a564 6997 abf0 4c02
+5010 832c 686c 0000
+
+# 23:18:36.555363 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:0 ppp: LCP 24: Conf-Req(1), ACCM=00000000, Magic-Num=22d90cfa, PFC, ACFC
+[out,pcn1]
+4500 0038 69ab 0000 ff2f a140 7f00 0001 c0a8 7101
+3001 880b 0018 4000 0000 0000
+ff03 c021 0101 0014 0206 0000 0000 0506
+22d9 0cfa 0702 0802
+
+# 23:18:36.556030 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:1 A:0 ppp: LCP 11: Conf-Rej(0), Call-Back CBCP
+[out,pcn1]
+4500 002f 69ac 0000 ff2f a148 7f00 0001 c0a8 7101
+3081 880b 000b 4000 0000 0001
+0000 0000 ff03 c021 0400 0007 0d03 06
+
+# 23:18:36.557166 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:1 A:1 ppp: LCP 24: Conf-Ack(1), ACCM=00000000, Magic-Num=22d90cfa, PFC, ACFC
+[in,pcn1]
+4500 003c 5e16 0000 802f 7927 c0a8 7101 c0a8 7103
+3081 880b 0018 0000 0000 0001
+0000 0001 ff03 c021 0201 0014 0206 0000
+0000 0506 22d9 0cfa 0702 0802
+
+# 23:18:36.557764 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:2 ppp: LCP 22: Conf-Req(1), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC
+[in,pcn1]
+4500 0036 5e17 0000 802f 792c c0a8 7101 c0a8 7103
+3001 880b 0016 0000 0000 0002
+ff03 c021 0101 0012 0104 0578 0506 577f
+7c5b 0702 0802
+
+# 23:18:36.564658 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:2 A:2 ppp: LCP 22: Conf-Ack(1), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC
+[out,pcn1]
+4500 003a 69ad 0000 ff2f a13c 7f00 0001 c0a8 7101
+3081 880b 0016 4000 0000 0002
+0000 0002 ff03 c021 0201 0012 0104 0578
+0506 577f 7c5b 0702 0802
+
+# 23:18:36.564803 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:3 ppp: IPCP 18: Conf-Req(1), IP-Addr=192.168.0.1, IP-Comp VJ-Comp
+[out,pcn1]
+4500 0032 69ae 0000 ff2f a143 7f00 0001 c0a8 7101
+3001 880b 0012 4000 0000 0003
+8021 0101 0010 0306 c0a8 0001 0206 002d
+0f01
+
+# 23:18:36.570395 192.168.113.1.1511 > 192.168.113.3.1723: P 349:373(24) ack 189 win 64052: pptp CTRL_MSGTYPE=SLI PEER_CALL_ID(0) SEND_ACCM(0x00000000) RECV_ACCM(0xffffffff) (DF)
+[in,pcn1]
+4500 0040 5e18 4000 8006 394a c0a8 7101 c0a8 7103
+05e7 06bb abf0 4c02 a564 6997
+5018 fa34 e7f8 0000 0018 0001 1a2b 3c4d
+000f 0000 0000 0000 0000 0000 ffff ffff
+
+# 23:18:36.573307 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:3 A:3 ppp: LCP 20: Ident(2), Magic-Num=577f7c5b
+[in,pcn1]
+4500 0038 5e19 0000 802f 7928 c0a8 7101 c0a8 7103
+3081 880b 0014 0000 0000 0003
+0000 0003 c021 0c02 0012 577f 7c5b 4d53
+5241 5356 352e 3130
+
+# 23:18:36.573856 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:4 A:3 ppp: LCP 26: Code-Rej(2)
+[out,pcn1]
+4500 003e 69af 0000 ff2f a136 7f00 0001 c0a8 7101
+3081 880b 001a 4000 0000 0004
+0000 0003 ff03 c021 0702 0016 0c02 0012
+577f 7c5b 4d53 5241 5356 352e 3130
+
+# 23:18:36.584936 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:4 A:4 ppp: LCP 26: Ident(3), Magic-Num=577f7c5b
+[in,pcn1]
+4500 003e 5e1a 0000 802f 7921 c0a8 7101 c0a8 7103
+3081 880b 001a 0000 0000 0004
+0000 0004 c021 0c03 0018 577f 7c5b 4d53
+5241 532d 302d 434c 4159 4d4f 4f52
+
+# 23:18:36.585562 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:5 A:4 ppp: LCP 32: Code-Rej(3)
+[out,pcn1]
+4500 0044 69b0 0000 ff2f a12f 7f00 0001 c0a8 7101
+3081 880b 0020 4000 0000 0005
+0000 0004 ff03 c021 0703 001c 0c03 0018
+577f 7c5b 4d53 5241 532d 302d 434c 4159
+4d4f 4f52
+
+# 23:18:36.588721 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:5 A:5 ppp: CCP 12: Conf-Req(4), MPPC
+[in,pcn1]
+4500 0030 5e1b 0000 802f 792e c0a8 7101 c0a8 7103
+3081 880b 000c 0000 0000 0005
+0000 0005 80fd 0104 000a 1206 0100 0001
+
+# 23:18:36.589445 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:6 A:5 ppp: CCP 6: Conf-Req(1)
+[out,pcn1]
+4500 002a 69b1 0000 ff2f a148 7f00 0001 c0a8 7101
+3081 880b 0006 4000 0000 0006
+0000 0005 80fd 0101 0004
+
+# 23:18:36.589540 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:7 ppp: CCP 12: Conf-Rej(4), MPPC
+[out,pcn1]
+4500 002c 69b2 0000 ff2f a145 7f00 0001 c0a8 7101
+3001 880b 000c 4000 0000 0007
+80fd 0404 000a 1206 0100 0001
+
+# 23:18:36.590023 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:6 A:7 ppp: IPCP 36: Conf-Req(5), IP-Addr=0.0.0.0, Pri-DNS=0.0.0.0, Pri-NBNS=0.0.0.0, Sec-DNS=0.0.0.0, Sec-NBNS=0.0.0.0
+[in,pcn1]
+4500 0048 5e1c 0000 802f 7915 c0a8 7101 c0a8 7103
+3081 880b 0024 0000 0000 0006
+0000 0007 8021 0105 0022 0306 0000 0000
+8106 0000 0000 8206 0000 0000 8306 0000
+0000 8406 0000 0000
+
+# 23:18:36.590489 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:8 A:6 ppp: IPCP 30: Conf-Rej(5), Pri-DNS=0.0.0.0, Pri-NBNS=0.0.0.0, Sec-DNS=0.0.0.0, Sec-NBNS=0.0.0.0
+[out,pcn1]
+4500 0042 69b3 0000 ff2f a12e 7f00 0001 c0a8 7101
+3081 880b 001e 4000 0000 0008
+0000 0006 8021 0405 001c 8106 0000 0000
+8206 0000 0000 8306 0000 0000 8406 0000
+0000
+
+# 23:18:36.591003 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:7 A:8 ppp: IPCP 12: Conf-Rej(1), IP-Comp VJ-Comp
+[in,pcn1]
+4500 0030 5e1d 0000 802f 792c c0a8 7101 c0a8 7103
+3081 880b 000c 0000 0000 0007
+0000 0008 8021 0401 000a 0206 002d 0f01
+
+# 23:18:36.593819 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:9 A:7 ppp: IPCP 12: Conf-Req(2), IP-Addr=192.168.0.1
+[out,pcn1]
+4500 0030 69b4 0000 ff2f a13f 7f00 0001 c0a8 7101
+3081 880b 000c 4000 0000 0009
+0000 0007 8021 0102 000a 0306 c0a8 0001
+
+# 23:18:36.594840 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:8 A:9 ppp: CCP 6: Conf-Ack(1)
+[in,pcn1]
+4500 002a 5e1e 0000 802f 7931 c0a8 7101 c0a8 7103
+3081 880b 0006 0000 0000 0008
+0000 0009 80fd 0201 0004
+
+# 23:18:36.595525 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:9 ppp: CCP 18: Term-Req(6)
+[in,pcn1]
+4500 0032 5e1f 0000 802f 7928 c0a8 7101 c0a8 7103
+3001 880b 0012 0000 0000 0009
+80fd 0506 0010 577f 7c5b 003c cd74 0000
+02dc
+
+# 23:18:36.595937 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:10 A:9 ppp: CCP 6: Term-Ack(6)
+[out,pcn1]
+4500 002a 69b5 0000 ff2f a144 7f00 0001 c0a8 7101
+3081 880b 0006 4000 0000 000a
+0000 0009 80fd 0606 0004
+
diff --git a/contrib/netbsd-tests/ipf/input/ni15 b/contrib/netbsd-tests/ipf/input/ni15
new file mode 100644
index 0000000..7e7aabd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni15
@@ -0,0 +1,235 @@
+# 23:18:36.130424 192.168.113.1.1511 > 192.168.113.3.1723: S 2884651685:2884651685(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
+[out,pcn1=192.168.113.3]
+4500 0030 5e11 4000 8006 3961 c0a8 7101
+c0a8 7103 05e7 06bb abf0 4aa5 0000 0000
+7002 faf0 21a1 0000 0204 05b4 0101 0402
+
+# 23:18:36.130778 192.168.113.3.1723 > 192.168.113.1.1511: S 2774821082:2774821082(0) ack 2884651686 win 32768 <mss 1460> (DF)
+[in,pcn1]
+4500 002c 69a6 4000 4006 6dd0 c0a8 7103
+c0a8 7101 06bb 05e7 a564 68da abf0 4aa6
+6012 8000 a348 0000 0204 05b4
+
+# 23:18:36.130784 192.168.113.1.1511 > 192.168.113.3.1723: P 1:157(156) ack 1 win 64240: pptp CTRL_MSGTYPE=SCCRQ PROTO_VER(1.0) FRAME_CAP(A) BEARER_CAP(A) MAX_CHAN(0) FIRM_REV(2600) HOSTNAME() VENDOR(Microsoft Windows NT) (DF)
+[out,pcn1]
+4500 00c4 5e12 4000 8006 38cc c0a8 7101
+c0a8 7103 05e7 06bb abf0 4aa6 a564 68db
+5018 faf0 e2a0 0000 009c 0001 1a2b 3c4d
+0001 0000 0100 0000 0000 0001 0000 0001
+0000 0a28 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 4d69 6372 6f73 6f66 7420 5769
+6e64 6f77 7320 4e54 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+# 23:18:36.260235 192.168.113.3.1723 > 192.168.113.1.1511: P 1:157(156) ack 157 win 33580: pptp CTRL_MSGTYPE=SCCRP PROTO_VER(1.0) RESULT_CODE(1) ERR_CODE(0) FRAME_CAP() BEARER_CAP() MAX_CHAN(1) FIRM_REV(1) HOSTNAME(local) VENDOR(linux) (DF)
+[in,pcn1]
+4500 00c4 69a7 4000 4006 6d37 c0a8 7103
+c0a8 7101 06bb 05e7 a564 68db abf0 4b42
+5018 832c cecf 0000 009c 0001 1a2b 3c4d
+0002 0000 0100 0100 0000 0000 0000 0000
+0001 0001 6c6f 6361 6c00 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 6c69 6e75 7800 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+# 23:18:36.260252 192.168.113.1.1511 > 192.168.113.3.1723: P 157:325(168) ack 157 win 64084: pptp CTRL_MSGTYPE=OCRQ CALL_ID(16384) CALL_SER_NUM(4913) MIN_BPS(300) MAX_BPS(100000000) BEARER_TYPE(Any) FRAME_TYPE(E) RECV_WIN(64) PROC_DELAY(0) PHONE_NO_LEN(0) PHONE_NO() SUB_ADDR() (DF)
+[out,pcn1]
+4500 00d0 5e13 4000 8006 38bf c0a8 7101
+c0a8 7103 05e7 06bb abf0 4b42 a564 6977
+5018 fa54 ac07 0000 00a8 0001 1a2b 3c4d
+0007 0000 4000 1331 0000 012c 05f5 e100
+0000 0003 0000 0003 0040 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+
+# 23:18:36.272856 192.168.113.3.1723 > 192.168.113.1.1511: P 157:189(32) ack 325 win 33580: pptp CTRL_MSGTYPE=OCRP CALL_ID(0) PEER_CALL_ID(16384) RESULT_CODE(1) ERR_CODE(0) CAUSE_CODE(0) CONN_SPEED(100000000) RECV_WIN(64) PROC_DELAY(0) PHY_CHAN_ID(0) (DF)
+[in,pcn1]
+4500 0048 69a8 4000 4006 6db2 c0a8 7103
+c0a8 7101 06bb 05e7 a564 6977 abf0 4bea
+5018 832c 36fa 0000 0020 0001 1a2b 3c4d
+0008 0000 0000 4000 0100 0000 05f5 e100
+0040 0000 0000 0000
+
+# 23:18:36.321819 192.168.113.1.1511 > 192.168.113.3.1723: P 325:349(24) ack 189 win 64052: pptp CTRL_MSGTYPE=SLI PEER_CALL_ID(0) SEND_ACCM(0xffffffff) RECV_ACCM(0xffffffff) (DF)
+[out,pcn1]
+4500 0040 5e14 4000 8006 394e c0a8 7101
+c0a8 7103 05e7 06bb abf0 4bea a564 6997
+5018 fa34 e810 0000 0018 0001 1a2b 3c4d
+000f 0000 0000 0000 ffff ffff ffff ffff
+
+# 23:18:36.349759 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:0 ppp: LCP 25: Conf-Req(0), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC, Call-Back CBCP
+[out,pcn1]
+4500 0039 5e15 0000 802f 792b c0a8 7101
+c0a8 7103 3001 880b 0019 0000 0000 0000
+ff03 c021 0100 0015 0104 0578 0506 577f
+7c5b 0702 0802 0d03 06
+
+# 23:18:36.389970 192.168.113.3 > 192.168.113.1: gre [KAv1] ID:4000 A:4294967295 [|gre]
+[in,pcn1]
+4500 0020 69a9 0000 ff2f eeaf c0a8 7103
+c0a8 7101 2081 880b 0000 4000 ffff ffff
+
+# 23:18:36.518426 192.168.113.3.1723 > 192.168.113.1.1511: . ack 349 win 33580 (DF)
+[in,pcn1]
+4500 0028 69aa 4000 4006 6dd0 c0a8 7103
+c0a8 7101 06bb 05e7 a564 6997 abf0 4c02
+5010 832c b5c1 0000
+
+# 23:18:36.555363 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:0 ppp: LCP 24: Conf-Req(1), ACCM=00000000, Magic-Num=22d90cfa, PFC, ACFC
+[in,pcn1]
+4500 0038 69ab 0000 ff2f ee95 c0a8 7103
+c0a8 7101 3001 880b 0018 4000 0000 0000
+ff03 c021 0101 0014 0206 0000 0000 0506
+22d9 0cfa 0702 0802
+
+# 23:18:36.556030 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:1 A:0 ppp: LCP 11: Conf-Rej(0), Call-Back CBCP
+[in,pcn1]
+4500 002f 69ac 0000 ff2f ee9d c0a8 7103
+c0a8 7101 3081 880b 000b 4000 0000 0001
+0000 0000 ff03 c021 0400 0007 0d03 06
+
+# 23:18:36.557166 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:1 A:1 ppp: LCP 24: Conf-Ack(1), ACCM=00000000, Magic-Num=22d90cfa, PFC, ACFC
+[out,pcn1]
+4500 003c 5e16 0000 802f 7927 c0a8 7101
+c0a8 7103 3081 880b 0018 0000 0000 0001
+0000 0001 ff03 c021 0201 0014 0206 0000
+0000 0506 22d9 0cfa 0702 0802
+
+# 23:18:36.557764 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:2 ppp: LCP 22: Conf-Req(1), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC
+[out,pcn1]
+4500 0036 5e17 0000 802f 792c c0a8 7101
+c0a8 7103 3001 880b 0016 0000 0000 0002
+ff03 c021 0101 0012 0104 0578 0506 577f
+7c5b 0702 0802
+
+# 23:18:36.564658 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:2 A:2 ppp: LCP 22: Conf-Ack(1), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC
+[in,pcn1]
+4500 003a 69ad 0000 ff2f ee91 c0a8 7103
+c0a8 7101 3081 880b 0016 4000 0000 0002
+0000 0002 ff03 c021 0201 0012 0104 0578
+0506 577f 7c5b 0702 0802
+
+# 23:18:36.564803 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:3 ppp: IPCP 18: Conf-Req(1), IP-Addr=192.168.0.1, IP-Comp VJ-Comp
+[in,pcn1]
+4500 0032 69ae 0000 ff2f ee98 c0a8 7103
+c0a8 7101 3001 880b 0012 4000 0000 0003
+8021 0101 0010 0306 c0a8 0001 0206 002d
+0f01
+
+# 23:18:36.570395 192.168.113.1.1511 > 192.168.113.3.1723: P 349:373(24) ack 189 win 64052: pptp CTRL_MSGTYPE=SLI PEER_CALL_ID(0) SEND_ACCM(0x00000000) RECV_ACCM(0xffffffff) (DF)
+[out,pcn1]
+4500 0040 5e18 4000 8006 394a c0a8 7101
+c0a8 7103 05e7 06bb abf0 4c02 a564 6997
+5018 fa34 e7f8 0000 0018 0001 1a2b 3c4d
+000f 0000 0000 0000 0000 0000 ffff ffff
+
+# 23:18:36.573307 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:3 A:3 ppp: LCP 20: Ident(2), Magic-Num=577f7c5b
+[out,pcn1]
+4500 0038 5e19 0000 802f 7928 c0a8 7101
+c0a8 7103 3081 880b 0014 0000 0000 0003
+0000 0003 c021 0c02 0012 577f 7c5b 4d53
+5241 5356 352e 3130
+
+# 23:18:36.573856 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:4 A:3 ppp: LCP 26: Code-Rej(2)
+[in,pcn1]
+4500 003e 69af 0000 ff2f ee8b c0a8 7103
+c0a8 7101 3081 880b 001a 4000 0000 0004
+0000 0003 ff03 c021 0702 0016 0c02 0012
+577f 7c5b 4d53 5241 5356 352e 3130
+
+# 23:18:36.584936 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:4 A:4 ppp: LCP 26: Ident(3), Magic-Num=577f7c5b
+[out,pcn1]
+4500 003e 5e1a 0000 802f 7921 c0a8 7101
+c0a8 7103 3081 880b 001a 0000 0000 0004
+0000 0004 c021 0c03 0018 577f 7c5b 4d53
+5241 532d 302d 434c 4159 4d4f 4f52
+
+# 23:18:36.585562 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:5 A:4 ppp: LCP 32: Code-Rej(3)
+[in,pcn1]
+4500 0044 69b0 0000 ff2f ee84 c0a8 7103
+c0a8 7101 3081 880b 0020 4000 0000 0005
+0000 0004 ff03 c021 0703 001c 0c03 0018
+577f 7c5b 4d53 5241 532d 302d 434c 4159
+4d4f 4f52
+
+# 23:18:36.588721 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:5 A:5 ppp: CCP 12: Conf-Req(4), MPPC
+[out,pcn1]
+4500 0030 5e1b 0000 802f 792e c0a8 7101
+c0a8 7103 3081 880b 000c 0000 0000 0005
+0000 0005 80fd 0104 000a 1206 0100 0001
+
+# 23:18:36.589445 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:6 A:5 ppp: CCP 6: Conf-Req(1)
+[in,pcn1]
+4500 002a 69b1 0000 ff2f ee9d c0a8 7103
+c0a8 7101 3081 880b 0006 4000 0000 0006
+0000 0005 80fd 0101 0004
+
+# 23:18:36.589540 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:7 ppp: CCP 12: Conf-Rej(4), MPPC
+[in,pcn1]
+4500 002c 69b2 0000 ff2f ee9a c0a8 7103
+c0a8 7101 3001 880b 000c 4000 0000 0007
+80fd 0404 000a 1206 0100 0001
+
+# 23:18:36.590023 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:6 A:7 ppp: IPCP 36: Conf-Req(5), IP-Addr=0.0.0.0, Pri-DNS=0.0.0.0, Pri-NBNS=0.0.0.0, Sec-DNS=0.0.0.0, Sec-NBNS=0.0.0.0
+[out,pcn1]
+4500 0048 5e1c 0000 802f 7915 c0a8 7101
+c0a8 7103 3081 880b 0024 0000 0000 0006
+0000 0007 8021 0105 0022 0306 0000 0000
+8106 0000 0000 8206 0000 0000 8306 0000
+0000 8406 0000 0000
+
+# 23:18:36.590489 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:8 A:6 ppp: IPCP 30: Conf-Rej(5), Pri-DNS=0.0.0.0, Pri-NBNS=0.0.0.0, Sec-DNS=0.0.0.0, Sec-NBNS=0.0.0.0
+[in,pcn1]
+4500 0042 69b3 0000 ff2f ee83 c0a8 7103
+c0a8 7101 3081 880b 001e 4000 0000 0008
+0000 0006 8021 0405 001c 8106 0000 0000
+8206 0000 0000 8306 0000 0000 8406 0000
+0000
+
+# 23:18:36.591003 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:7 A:8 ppp: IPCP 12: Conf-Rej(1), IP-Comp VJ-Comp
+[out,pcn1]
+4500 0030 5e1d 0000 802f 792c c0a8 7101
+c0a8 7103 3081 880b 000c 0000 0000 0007
+0000 0008 8021 0401 000a 0206 002d 0f01
+
+# 23:18:36.593819 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:9 A:7 ppp: IPCP 12: Conf-Req(2), IP-Addr=192.168.0.1
+[in,pcn1]
+4500 0030 69b4 0000 ff2f ee94 c0a8 7103
+c0a8 7101 3081 880b 000c 4000 0000 0009
+0000 0007 8021 0102 000a 0306 c0a8 0001
+
+# 23:18:36.594840 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:8 A:9 ppp: CCP 6: Conf-Ack(1)
+[out,pcn1]
+4500 002a 5e1e 0000 802f 7931 c0a8 7101
+c0a8 7103 3081 880b 0006 0000 0000 0008
+0000 0009 80fd 0201 0004
+
+# 23:18:36.595525 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:9 ppp: CCP 18: Term-Req(6)
+[out,pcn1]
+4500 0032 5e1f 0000 802f 7928 c0a8 7101
+c0a8 7103 3001 880b 0012 0000 0000 0009
+80fd 0506 0010 577f 7c5b 003c cd74 0000
+02dc
+
+# 23:18:36.595937 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:10 A:9 ppp: CCP 6: Term-Ack(6)
+[in,pcn1]
+4500 002a 69b5 0000 ff2f ee99 c0a8 7103
+c0a8 7101 3081 880b 0006 4000 0000 000a
+0000 0009 80fd 0606 0004
+
diff --git a/contrib/netbsd-tests/ipf/input/ni16 b/contrib/netbsd-tests/ipf/input/ni16
new file mode 100644
index 0000000..362b98d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni16
@@ -0,0 +1,235 @@
+# 23:18:36.130424 192.168.113.1.1511 > 192.168.113.3.1723: S 2884651685:2884651685(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
+[out,pcn1=192.168.113.1]
+4500 0030 5e11 4000 8006 5f07 0a02 0202
+c0a8 7103 05e7 06bb abf0 4aa5 0000 0000
+7002 faf0 4747 0000 0204 05b4 0101 0402
+
+# 23:18:36.130778 192.168.113.3.1723 > 192.168.113.1.1511: S 2774821082:2774821082(0) ack 2884651686 win 32768 <mss 1460> (DF)
+[in,pcn1]
+4500 002c 69a6 4000 4006 6dd0 c0a8 7103
+c0a8 7101 06bb 05e7 a564 68da abf0 4aa6
+6012 8000 a348 0000 0204 05b4
+
+# 23:18:36.130784 192.168.113.1.1511 > 192.168.113.3.1723: P 1:157(156) ack 1 win 64240: pptp CTRL_MSGTYPE=SCCRQ PROTO_VER(1.0) FRAME_CAP(A) BEARER_CAP(A) MAX_CHAN(0) FIRM_REV(2600) HOSTNAME() VENDOR(Microsoft Windows NT) (DF)
+[out,pcn1]
+4500 00c4 5e12 4000 8006 5e72 0a02 0202
+c0a8 7103 05e7 06bb abf0 4aa6 a564 68db
+5018 faf0 0847 0000 009c 0001 1a2b 3c4d
+0001 0000 0100 0000 0000 0001 0000 0001
+0000 0a28 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 4d69 6372 6f73 6f66 7420 5769
+6e64 6f77 7320 4e54 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+# 23:18:36.260235 192.168.113.3.1723 > 192.168.113.1.1511: P 1:157(156) ack 157 win 33580: pptp CTRL_MSGTYPE=SCCRP PROTO_VER(1.0) RESULT_CODE(1) ERR_CODE(0) FRAME_CAP() BEARER_CAP() MAX_CHAN(1) FIRM_REV(1) HOSTNAME(local) VENDOR(linux) (DF)
+[in,pcn1]
+4500 00c4 69a7 4000 4006 6d37 c0a8 7103
+c0a8 7101 06bb 05e7 a564 68db abf0 4b42
+5018 832c cecf 0000 009c 0001 1a2b 3c4d
+0002 0000 0100 0100 0000 0000 0000 0000
+0001 0001 6c6f 6361 6c00 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 6c69 6e75 7800 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+# 23:18:36.260252 192.168.113.1.1511 > 192.168.113.3.1723: P 157:325(168) ack 157 win 64084: pptp CTRL_MSGTYPE=OCRQ CALL_ID(16384) CALL_SER_NUM(4913) MIN_BPS(300) MAX_BPS(100000000) BEARER_TYPE(Any) FRAME_TYPE(E) RECV_WIN(64) PROC_DELAY(0) PHONE_NO_LEN(0) PHONE_NO() SUB_ADDR() (DF)
+[out,pcn1]
+4500 00d0 5e13 4000 8006 5e65 0a02 0202
+c0a8 7103 05e7 06bb abf0 4b42 a564 6977
+5018 fa54 d1ad 0000 00a8 0001 1a2b 3c4d
+0007 0000 4000 1331 0000 012c 05f5 e100
+0000 0003 0000 0003 0040 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+
+# 23:18:36.272856 192.168.113.3.1723 > 192.168.113.1.1511: P 157:189(32) ack 325 win 33580: pptp CTRL_MSGTYPE=OCRP CALL_ID(0) PEER_CALL_ID(16384) RESULT_CODE(1) ERR_CODE(0) CAUSE_CODE(0) CONN_SPEED(100000000) RECV_WIN(64) PROC_DELAY(0) PHY_CHAN_ID(0) (DF)
+[in,pcn1]
+4500 0048 69a8 4000 4006 6db2 c0a8 7103
+c0a8 7101 06bb 05e7 a564 6977 abf0 4bea
+5018 832c 36fa 0000 0020 0001 1a2b 3c4d
+0008 0000 0000 4000 0100 0000 05f5 e100
+0040 0000 0000 0000
+
+# 23:18:36.321819 192.168.113.1.1511 > 192.168.113.3.1723: P 325:349(24) ack 189 win 64052: pptp CTRL_MSGTYPE=SLI PEER_CALL_ID(0) SEND_ACCM(0xffffffff) RECV_ACCM(0xffffffff) (DF)
+[out,pcn1]
+4500 0040 5e14 4000 8006 5ef4 0a02 0202
+c0a8 7103 05e7 06bb abf0 4bea a564 6997
+5018 fa34 0db7 0000 0018 0001 1a2b 3c4d
+000f 0000 0000 0000 ffff ffff ffff ffff
+
+# 23:18:36.349759 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:0 ppp: LCP 25: Conf-Req(0), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC, Call-Back CBCP
+[out,pcn1]
+4500 0039 5e15 0000 802f 9ed1 0a02 0202
+c0a8 7103 3001 880b 0019 0000 0000 0000
+ff03 c021 0100 0015 0104 0578 0506 577f
+7c5b 0702 0802 0d03 06
+
+# 23:18:36.389970 192.168.113.3 > 192.168.113.1: gre [KAv1] ID:4000 A:4294967295 [|gre]
+[in,pcn1]
+4500 0020 69a9 0000 ff2f eeaf c0a8 7103
+c0a8 7101 2081 880b 0000 4000 ffff ffff
+
+# 23:18:36.518426 192.168.113.3.1723 > 192.168.113.1.1511: . ack 349 win 33580 (DF)
+[in,pcn1]
+4500 0028 69aa 4000 4006 6dd0 c0a8 7103
+c0a8 7101 06bb 05e7 a564 6997 abf0 4c02
+5010 832c b5c1 0000
+
+# 23:18:36.555363 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:0 ppp: LCP 24: Conf-Req(1), ACCM=00000000, Magic-Num=22d90cfa, PFC, ACFC
+[in,pcn1]
+4500 0038 69ab 0000 ff2f ee95 c0a8 7103
+c0a8 7101 3001 880b 0018 4000 0000 0000
+ff03 c021 0101 0014 0206 0000 0000 0506
+22d9 0cfa 0702 0802
+
+# 23:18:36.556030 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:1 A:0 ppp: LCP 11: Conf-Rej(0), Call-Back CBCP
+[in,pcn1]
+4500 002f 69ac 0000 ff2f ee9d c0a8 7103
+c0a8 7101 3081 880b 000b 4000 0000 0001
+0000 0000 ff03 c021 0400 0007 0d03 06
+
+# 23:18:36.557166 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:1 A:1 ppp: LCP 24: Conf-Ack(1), ACCM=00000000, Magic-Num=22d90cfa, PFC, ACFC
+[out,pcn1]
+4500 003c 5e16 0000 802f 9ecd 0a02 0202
+c0a8 7103 3081 880b 0018 0000 0000 0001
+0000 0001 ff03 c021 0201 0014 0206 0000
+0000 0506 22d9 0cfa 0702 0802
+
+# 23:18:36.557764 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:2 ppp: LCP 22: Conf-Req(1), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC
+[out,pcn1]
+4500 0036 5e17 0000 802f 9ed2 0a02 0202
+c0a8 7103 3001 880b 0016 0000 0000 0002
+ff03 c021 0101 0012 0104 0578 0506 577f
+7c5b 0702 0802
+
+# 23:18:36.564658 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:2 A:2 ppp: LCP 22: Conf-Ack(1), MRU=1400, Magic-Num=577f7c5b, PFC, ACFC
+[in,pcn1]
+4500 003a 69ad 0000 ff2f ee91 c0a8 7103
+c0a8 7101 3081 880b 0016 4000 0000 0002
+0000 0002 ff03 c021 0201 0012 0104 0578
+0506 577f 7c5b 0702 0802
+
+# 23:18:36.564803 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:3 ppp: IPCP 18: Conf-Req(1), IP-Addr=192.168.0.1, IP-Comp VJ-Comp
+[in,pcn1]
+4500 0032 69ae 0000 ff2f ee98 c0a8 7103
+c0a8 7101 3001 880b 0012 4000 0000 0003
+8021 0101 0010 0306 c0a8 0001 0206 002d
+0f01
+
+# 23:18:36.570395 192.168.113.1.1511 > 192.168.113.3.1723: P 349:373(24) ack 189 win 64052: pptp CTRL_MSGTYPE=SLI PEER_CALL_ID(0) SEND_ACCM(0x00000000) RECV_ACCM(0xffffffff) (DF)
+[out,pcn1]
+4500 0040 5e18 4000 8006 5ef0 0a02 0202
+c0a8 7103 05e7 06bb abf0 4c02 a564 6997
+5018 fa34 0d9f 0000 0018 0001 1a2b 3c4d
+000f 0000 0000 0000 0000 0000 ffff ffff
+
+# 23:18:36.573307 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:3 A:3 ppp: LCP 20: Ident(2), Magic-Num=577f7c5b
+[out,pcn1]
+4500 0038 5e19 0000 802f 9ece 0a02 0202
+c0a8 7103 3081 880b 0014 0000 0000 0003
+0000 0003 c021 0c02 0012 577f 7c5b 4d53
+5241 5356 352e 3130
+
+# 23:18:36.573856 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:4 A:3 ppp: LCP 26: Code-Rej(2)
+[in,pcn1]
+4500 003e 69af 0000 ff2f ee8b c0a8 7103
+c0a8 7101 3081 880b 001a 4000 0000 0004
+0000 0003 ff03 c021 0702 0016 0c02 0012
+577f 7c5b 4d53 5241 5356 352e 3130
+
+# 23:18:36.584936 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:4 A:4 ppp: LCP 26: Ident(3), Magic-Num=577f7c5b
+[out,pcn1]
+4500 003e 5e1a 0000 802f 9ec7 0a02 0202
+c0a8 7103 3081 880b 001a 0000 0000 0004
+0000 0004 c021 0c03 0018 577f 7c5b 4d53
+5241 532d 302d 434c 4159 4d4f 4f52
+
+# 23:18:36.585562 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:5 A:4 ppp: LCP 32: Code-Rej(3)
+[in,pcn1]
+4500 0044 69b0 0000 ff2f ee84 c0a8 7103
+c0a8 7101 3081 880b 0020 4000 0000 0005
+0000 0004 ff03 c021 0703 001c 0c03 0018
+577f 7c5b 4d53 5241 532d 302d 434c 4159
+4d4f 4f52
+
+# 23:18:36.588721 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:5 A:5 ppp: CCP 12: Conf-Req(4), MPPC
+[out,pcn1]
+4500 0030 5e1b 0000 802f 9ed4 0a02 0202
+c0a8 7103 3081 880b 000c 0000 0000 0005
+0000 0005 80fd 0104 000a 1206 0100 0001
+
+# 23:18:36.589445 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:6 A:5 ppp: CCP 6: Conf-Req(1)
+[in,pcn1]
+4500 002a 69b1 0000 ff2f ee9d c0a8 7103
+c0a8 7101 3081 880b 0006 4000 0000 0006
+0000 0005 80fd 0101 0004
+
+# 23:18:36.589540 192.168.113.3 > 192.168.113.1: gre [KSv1] ID:4000 S:7 ppp: CCP 12: Conf-Rej(4), MPPC
+[in,pcn1]
+4500 002c 69b2 0000 ff2f ee9a c0a8 7103
+c0a8 7101 3001 880b 000c 4000 0000 0007
+80fd 0404 000a 1206 0100 0001
+
+# 23:18:36.590023 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:6 A:7 ppp: IPCP 36: Conf-Req(5), IP-Addr=0.0.0.0, Pri-DNS=0.0.0.0, Pri-NBNS=0.0.0.0, Sec-DNS=0.0.0.0, Sec-NBNS=0.0.0.0
+[out,pcn1]
+4500 0048 5e1c 0000 802f 9ebb 0a02 0202
+c0a8 7103 3081 880b 0024 0000 0000 0006
+0000 0007 8021 0105 0022 0306 0000 0000
+8106 0000 0000 8206 0000 0000 8306 0000
+0000 8406 0000 0000
+
+# 23:18:36.590489 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:8 A:6 ppp: IPCP 30: Conf-Rej(5), Pri-DNS=0.0.0.0, Pri-NBNS=0.0.0.0, Sec-DNS=0.0.0.0, Sec-NBNS=0.0.0.0
+[in,pcn1]
+4500 0042 69b3 0000 ff2f ee83 c0a8 7103
+c0a8 7101 3081 880b 001e 4000 0000 0008
+0000 0006 8021 0405 001c 8106 0000 0000
+8206 0000 0000 8306 0000 0000 8406 0000
+0000
+
+# 23:18:36.591003 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:7 A:8 ppp: IPCP 12: Conf-Rej(1), IP-Comp VJ-Comp
+[out,pcn1]
+4500 0030 5e1d 0000 802f 9ed2 0a02 0202
+c0a8 7103 3081 880b 000c 0000 0000 0007
+0000 0008 8021 0401 000a 0206 002d 0f01
+
+# 23:18:36.593819 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:9 A:7 ppp: IPCP 12: Conf-Req(2), IP-Addr=192.168.0.1
+[in,pcn1]
+4500 0030 69b4 0000 ff2f ee94 c0a8 7103
+c0a8 7101 3081 880b 000c 4000 0000 0009
+0000 0007 8021 0102 000a 0306 c0a8 0001
+
+# 23:18:36.594840 192.168.113.1 > 192.168.113.3: gre [KSAv1] ID:0000 S:8 A:9 ppp: CCP 6: Conf-Ack(1)
+[out,pcn1]
+4500 002a 5e1e 0000 802f 9ed7 0a02 0202
+c0a8 7103 3081 880b 0006 0000 0000 0008
+0000 0009 80fd 0201 0004
+
+# 23:18:36.595525 192.168.113.1 > 192.168.113.3: gre [KSv1] ID:0000 S:9 ppp: CCP 18: Term-Req(6)
+[out,pcn1]
+4500 0032 5e1f 0000 802f 9ece 0a02 0202
+c0a8 7103 3001 880b 0012 0000 0000 0009
+80fd 0506 0010 577f 7c5b 003c cd74 0000
+02dc
+
+# 23:18:36.595937 192.168.113.3 > 192.168.113.1: gre [KSAv1] ID:4000 S:10 A:9 ppp: CCP 6: Term-Ack(6)
+[in,pcn1]
+4500 002a 69b5 0000 ff2f ee99 c0a8 7103
+c0a8 7101 3081 880b 0006 4000 0000 000a
+0000 0009 80fd 0606 0004
+
diff --git a/contrib/netbsd-tests/ipf/input/ni17 b/contrib/netbsd-tests/ipf/input/ni17
new file mode 100644
index 0000000..f9dec94
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni17
@@ -0,0 +1,6 @@
+in on le0 tcp 10.2.2.5,2000 203.1.1.1,80
+in on le0 tcp 10.2.2.6,2000 203.1.1.1,80
+in on le0 tcp 10.2.2.7,2000 203.1.1.1,80
+in on le0 tcp 10.2.2.7,2001 203.1.1.1,80
+in on le0 tcp 10.2.2.8,2000 203.1.1.1,80
+in on le0 tcp 10.2.2.9,2000 203.1.1.1,80
diff --git a/contrib/netbsd-tests/ipf/input/ni18 b/contrib/netbsd-tests/ipf/input/ni18
new file mode 100644
index 0000000..4e06f79
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni18
@@ -0,0 +1,4 @@
+in on hme0 tcp 2.2.2.2,3000 192.168.1.2,80
+in on hme0 tcp 2.2.2.2,3000 192.168.1.1,80
+out on hme1 tcp 10.1.2.2,5050 4.5.6.7,80;
+out on hme1 tcp 10.1.1.2,5050 4.5.6.7,80;
diff --git a/contrib/netbsd-tests/ipf/input/ni19 b/contrib/netbsd-tests/ipf/input/ni19
new file mode 100644
index 0000000..3ea706f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni19
@@ -0,0 +1,157 @@
+# 192.168.113.3.1009 > 10.1.1.4.shell: SYN win 32768 <mss 1460,nop,wscale 0,sackOK,nop,nop,nop,nop,timestamp 0 0>
+[out,bge0]
+4500 0040 e3fc 4000 4006 1a0b c0a8 7103
+0a01 0104 03f1 0202 6523 90b2 0000 0000
+b002 8000 7d87 0000 0204 05b4 0103 0300
+0402 0101 0101 080a 0000 0000 0000 0000
+
+# 10.1.1.4.shell > 10.1.1.1.1009: SYN win 5840 <mss 1460,nop,nop,sackOK,nop,wscale 2>
+[in,bge0]
+4500 0034 0000 4000 4006 24be 0a01 0104
+0a01 0101 0202 03f1 915a a5c4 6523 90b3
+8012 16d0 0f47 0000 0204 05b4 0101 0402
+0103 0302
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[out,bge0]
+4500 0028 e3fd 4000 4006 1a22 c0a8 7103
+0a01 0104 03f1 0202 6523 90b3 915a a5c5
+5010 832c bd0d 0000
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[out,bge0]
+4500 002d e3fe 4000 4006 1a1c c0a8 7103
+0a01 0104 03f1 0202 6523 90b3 915a a5c5
+5018 832c 5b98 0000 3130 3038 00
+
+# 10.1.1.4.shell > 10.1.1.1.1009
+[in,bge0]
+4500 0028 7ce5 4000 4006 a7e4 0a01 0104
+0a01 0101 0202 03f1 915a a5c5 6523 90b8
+5010 05b4 612b 0000
+
+# 10.1.1.4.1023 > 10.1.1.1.1008: SYN win 5840 <mss 1460,sackOK,timestamp 3791140 0,nop,wscale 2>
+[in,bge0]
+4500 003c 1186 4000 4006 1330 0a01 0104
+0a01 0101 03ff 03f0 91d4 c8a2 0000 0000
+a002 16d0 df6a 0000 0204 05b4 0402 080a
+0039 d924 0000 0000 0103 0302
+
+# 192.168.113.3.1008 > 10.1.1.4.1023: SYN win 32768 <mss 1460,nop,wscale 0,nop,nop,timestamp 0 3791140,sackOK,nop,nop>
+[out,bge0]
+4500 0040 e3ff 4000 4006 1a08 c0a8 7103
+0a01 0104 03f0 03ff 66e5 b810 91d4 c8a3
+b012 8000 1e85 0000 0204 05b4 0103 0300
+0101 080a 0000 0000 0039 d924 0402 0101
+
+# 10.1.1.4.1023 > 10.1.1.1.1008
+[in,bge0]
+4500 0034 1188 4000 4006 1336 0a01 0104
+0a01 0101 03ff 03f0 91d4 c8a3 66e5 b811
+8010 05b4 0046 0000 0101 080a 0039 d925
+0000 0000
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[out,bge0]
+4500 0030 e400 4000 4006 1a17 c0a8 7103
+0a01 0104 03f1 0202 6523 90b8 915a a5c5
+5018 832c 0eb6 0000 6461 7272 656e 7200
+
+# 10.1.1.4.shell > 10.1.1.1.1009
+[in,bge0]
+4500 0028 7ce7 4000 4006 a7e2 0a01 0104
+0a01 0101 0202 03f1 915a a5c5 6523 90c0
+5010 05b4 6123 0000
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[out,bge0]
+4500 0053 e401 4000 4006 19f3 c0a8 7103
+0a01 0104 03f1 0202 6523 90c0 915a a5c5
+5018 832c a63d 0000 6461 7272 656e 7200
+7368 202d 6320 2265 6368 6f20 666f 6f20
+3e26 313b 2065 6368 6f20 6261 7220 3e26
+3222 00
+
+# 10.1.1.4.shell > 10.1.1.1.1009
+[in,bge0]
+4500 0028 7ce9 4000 4006 a7e0 0a01 0104
+0a01 0101 0202 03f1 915a a5c5 6523 90eb
+5010 05b4 60f8 0000
+
+# 10.1.1.4.shell > 10.1.1.1.1009
+[in,bge0]
+4500 0029 7ceb 4000 4006 a7dd 0a01 0104
+0a01 0101 0202 03f1 915a a5c5 6523 90eb
+5018 05b4 60ef 0000 00
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[out,bge0]
+4500 0028 e403 4000 4006 1a1c c0a8 7103
+0a01 0104 03f1 0202 6523 90eb 915a a5c6
+5010 832c bcd4 0000
+
+# 10.1.1.4.shell > 10.1.1.1.1009
+[in,bge0]
+4500 002c 7ced 4000 4006 a7d8 0a01 0104
+0a01 0101 0202 03f1 915a a5c6 6523 90eb
+5018 05b4 8b71 0000 666f 6f0a
+
+# 10.1.1.4.1023 > 10.1.1.1.1008
+[in,bge0]
+4500 0038 118a 4000 4006 1330 0a01 0104
+0a01 0101 03ff 03f0 91d4 c8a3 66e5 b811
+8018 05b4 2787 0000 0101 080a 0039 dd6c
+0000 0000 6261 720a
+
+# 10.1.1.4.shell > 10.1.1.1.1009
+[in,bge0]
+4500 0028 7cef 4000 4006 a7da 0a01 0104
+0a01 0101 0202 03f1 915a a5ca 6523 90eb
+5011 05b4 60f2 0000
+
+# 10.1.1.4.1023 > 10.1.1.1.1008
+[in,bge0]
+4500 0034 118c 4000 4006 1332 0a01 0104
+0a01 0101 03ff 03f0 91d4 c8a7 66e5 b811
+8011 05b4 fbf8 0000 0101 080a 0039 dd6d
+0000 0000
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[out,bge0]
+4500 0028 e404 4000 4006 1a1b c0a8 7103
+0a01 0104 03f1 0202 6523 90eb 915a a5cb
+5010 8328 bcd3 0000
+
+# 192.168.113.3.1008 > 10.1.1.4.1023
+[out,bge0]
+4500 0034 e405 4000 4006 1a0e c0a8 7103
+0a01 0104 03f0 03ff 66e5 b811 91d4 c8a8
+8010 8328 57d7 0000 0101 080a 0000 0004
+0039 dd6c
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[out,bge0]
+4500 0028 e40a 4000 4006 1a15 c0a8 7103
+0a01 0104 03f1 0202 6523 90eb 915a a5cb
+5011 832c bcce 0000
+
+# 192.168.113.3.1008 > 10.1.1.4.1023
+[out,bge0]
+4500 0034 e40b 4000 4006 1a08 c0a8 7103
+0a01 0104 03f0 03ff 66e5 b811 91d4 c8a8
+8011 832c 57d2 0000 0101 080a 0000 0004
+0039 dd6c
+
+# 10.1.1.4.shell > 10.1.1.1.1009
+[in,bge0]
+4500 0028 0004 4000 4006 24c6 0a01 0104
+0a01 0101 0202 03f1 915a a5cb 6523 90ec
+5010 05b4 60f1 0000
+
+# 10.1.1.4.1023 > 10.1.1.1.1008
+[in,bge0]
+4500 0034 118e 4000 4006 1330 0a01 0104
+0a01 0101 03ff 03f0 91d4 c8a8 66e5 b812
+8010 05b4 fbf2 0000 0101 080a 0039 dd6e
+0000 0004
+
diff --git a/contrib/netbsd-tests/ipf/input/ni2 b/contrib/netbsd-tests/ipf/input/ni2
new file mode 100644
index 0000000..6dcedb7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni2
@@ -0,0 +1,143 @@
+# Test of fragmentation required coming from the inside.
+[out,xl0]
+4510 002c bd0d 4000 3e06 b1d1 0a01 0201 c0a8 0133
+05f6 0077 a664 2485 0000 0000
+6002 4000 b8f2 0000 0204 05b4
+
+[in,xl0]
+4500 002c ce83 4000 7e06 606b c0a8 0133 0a01 0201
+0077 05f6 fbdf 1a21 a664 2486
+6012 2238 c0a8 0000 0204 05b4
+
+[out,xl0]
+4510 0028 bd0e 4000 3e06 b1d4 0a01 0201 c0a8 0133
+05f6 0077 a664 2486 fbdf 1a22
+5010 4470 b62d 0000
+
+[in,xl0]
+4500 005b cf83 4000 7e06 5f3c c0a8 0133 0a01 0201
+0077 05f6 fbdf 1a22 a664 2486
+5018 2238 ce2a 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0a
+
+[out,xl0]
+4510 0028 bd18 4000 3e06 b1ca 0a01 0201 c0a8 0133
+05f6 0077 a664 2486 fbdf 1a55
+5010 4470 b5fa 0000
+
+[out,xl0]
+4510 002e bd1e 4000 3e06 b1be 0a01 0201 c0a8 0133
+05f6 0077 a664 2486 fbdf 1a55
+5018 4470 a8e2 0000 0000 0000 0d0a
+
+[in,xl0]
+4500 0048 e383 4000 7e06 4b4f c0a8 0133 0a01 0201
+0077 05f6 fbdf 1a55 a664 248c
+5018 2232 d80a 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000
+
+[in,xl0]
+4500 05dc e483 4000 7e06 44bb c0a8 0133 0a01 0201
+0077 05f6 fbdf 1a75 a664 248c
+5010 2232 9f2d 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3331 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000
+
+[out,xl0]
+4500 0038 d71d 4000 4001 7d22 c0a8 6401 c0a8 0133
+0304 da99 0000 05a0
+4500 05dc e483 4000 7e06 44bb c0a8 0133 0a01 0201
+0077 05f6 fbdf 1a75
+
diff --git a/contrib/netbsd-tests/ipf/input/ni20 b/contrib/netbsd-tests/ipf/input/ni20
new file mode 100644
index 0000000..065ed27
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni20
@@ -0,0 +1,157 @@
+# 192.168.113.3.1009 > 10.1.1.4.shell: SYN win 32768 <mss 1460,nop,wscale 0,sackOK,nop,nop,nop,nop,timestamp 0 0>
+[in,bge0]
+4500 0040 e3fc 4000 4006 1a0b c0a8 7103
+0a01 0104 03f1 0202 6523 90b2 0000 0000
+b002 8000 7d87 0000 0204 05b4 0103 0300
+0402 0101 0101 080a 0000 0000 0000 0000
+
+# 192.168.113.4.shell > 192.168.113.3.1009: SYN win 5840 <mss 1460,nop,nop,sackOK,nop,wscale 2>
+[out,bge0]
+4500 0034 0000 4000 4006 d76b c0a8 7104
+c0a8 7103 0202 03f1 915a a5c4 6523 90b3
+8012 16d0 c1f4 0000 0204 05b4 0101 0402
+0103 0302
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[in,bge0]
+4500 0028 e3fd 4000 4006 1a22 c0a8 7103
+0a01 0104 03f1 0202 6523 90b3 915a a5c5
+5010 832c bd0d 0000
+
+# 192.168.113.3.1009 > 10.1.1.4.shell
+[in,bge0]
+4500 002d e3fe 4000 4006 1a1c c0a8 7103
+0a01 0104 03f1 0202 6523 90b3 915a a5c5
+5018 832c 5b98 0000 3130 3038 00
+
+# 192.168.113.4.shell > 192.168.113.3.1009
+[out,bge0]
+4500 0028 7ce5 4000 4006 5a92 c0a8 7104
+c0a8 7103 0202 03f1 915a a5c5 6523 90b8
+5010 05b4 13d9 0000
+
+# 192.168.113.4.1023 > 192.168.113.3.1008: SYN win 5840 <mss 1460,sackOK,timestamp 3791140 0,nop,wscale 2>
+[out,bge0]
+4500 003c 1186 4000 4006 c5dd c0a8 7104
+c0a8 7103 03ff 03f0 91d4 c8a2 0000 0000
+a002 16d0 9218 0000 0204 05b4 0402 080a
+0039 d924 0000 0000 0103 0302
+
+# 192.168.113.3.1008 > 10.1.1.4.1023: SYN win 32768 <mss 1460,nop,wscale 0,nop,nop,timestamp 0 3791140,sackOK,nop,nop>
+[in,bge0]
+4500 0040 e3ff 4000 4006 1a08 c0a8 7103
+0a01 0104 03f0 03ff 66e5 b810 91d4 c8a3
+b012 8000 1e85 0000 0204 05b4 0103 0300
+0101 080a 0000 0000 0039 d924 0402 0101
+
+# 192.168.113.4.1023 > 192.168.113.3.1008 ACK
+[out,bge0]
+4500 0034 1188 4000 4006 c5e3 c0a8 7104
+c0a8 7103 03ff 03f0 91d4 c8a3 66e5 b811
+8010 05b4 b2f3 0000 0101 080a 0039 d925
+0000 0000
+
+# 192.168.113.3.1009 > 10.1.1.4.shell PUSH+ACK
+[in,bge0]
+4500 0030 e400 4000 4006 1a17 c0a8 7103
+0a01 0104 03f1 0202 6523 90b8 915a a5c5
+5018 832c 0eb6 0000 6461 7272 656e 7200
+
+# 192.168.113.4.shell > 192.168.113.3.1009 ACK
+[out,bge0]
+4500 0028 7ce7 4000 4006 5a90 c0a8 7104
+c0a8 7103 0202 03f1 915a a5c5 6523 90c0
+5010 05b4 13d1 0000
+
+# 192.168.113.3.1009 > 10.1.1.4.shell PUSH+ACK
+[in,bge0]
+4500 0053 e401 4000 4006 19f3 c0a8 7103
+0a01 0104 03f1 0202 6523 90c0 915a a5c5
+5018 832c a63d 0000 6461 7272 656e 7200
+7368 202d 6320 2265 6368 6f20 666f 6f20
+3e26 313b 2065 6368 6f20 6261 7220 3e26
+3222 00
+
+# 192.168.113.4.shell > 192.168.113.3.1009 ACK
+[out,bge0]
+4500 0028 7ce9 4000 4006 5a8e c0a8 7104
+c0a8 7103 0202 03f1 915a a5c5 6523 90eb
+5010 05b4 13a6 0000
+
+# 192.168.113.4.shell > 192.168.113.3.1009 PUSH+ACK
+[out,bge0]
+4500 0029 7ceb 4000 4006 5a8b c0a8 7104
+c0a8 7103 0202 03f1 915a a5c5 6523 90eb
+5018 05b4 139d 0000 00
+
+# 192.168.113.3.1009 > 10.1.1.4.shell ACK
+[in,bge0]
+4500 0028 e403 4000 4006 1a1c c0a8 7103
+0a01 0104 03f1 0202 6523 90eb 915a a5c6
+5010 832c bcd4 0000
+
+# 192.168.113.4.shell > 192.168.113.3.1009 PUSH+ACK
+[out,bge0]
+4500 002c 7ced 4000 4006 5a86 c0a8 7104
+c0a8 7103 0202 03f1 915a a5c6 6523 90eb
+5018 05b4 3e1f 0000 666f 6f0a
+
+# 192.168.113.4.1023 > 192.168.113.3.1008 PUSH+ACK
+[out,bge0]
+4500 0038 118a 4000 4006 c5dd c0a8 7104
+c0a8 7103 03ff 03f0 91d4 c8a3 66e5 b811
+8018 05b4 da34 0000 0101 080a 0039 dd6c
+0000 0000 6261 720a
+
+# 192.168.113.4.shell > 192.168.113.3.1009 FIN+ACK
+[out,bge0]
+4500 0028 7cef 4000 4006 5a88 c0a8 7104
+c0a8 7103 0202 03f1 915a a5ca 6523 90eb
+5011 05b4 13a0 0000
+
+# 192.168.113.4.1023 > 192.168.113.3.1008 FIN+ACK
+[out,bge0]
+4500 0034 118c 4000 4006 c5df c0a8 7104
+c0a8 7103 03ff 03f0 91d4 c8a7 66e5 b811
+8011 05b4 aea6 0000 0101 080a 0039 dd6d
+0000 0000
+
+# 192.168.113.3.1009 > 10.1.1.4.shell ACK
+[in,bge0]
+4500 0028 e404 4000 4006 1a1b c0a8 7103
+0a01 0104 03f1 0202 6523 90eb 915a a5cb
+5010 8328 bcd3 0000
+
+# 192.168.113.3.1008 > 10.1.1.4.1023 ACK
+[in,bge0]
+4500 0034 e405 4000 4006 1a0e c0a8 7103
+0a01 0104 03f0 03ff 66e5 b811 91d4 c8a8
+8010 8328 57d7 0000 0101 080a 0000 0004
+0039 dd6c
+
+# 192.168.113.3.1009 > 10.1.1.4.shell FIN+ACK
+[in,bge0]
+4500 0028 e40a 4000 4006 1a15 c0a8 7103
+0a01 0104 03f1 0202 6523 90eb 915a a5cb
+5011 832c bcce 0000
+
+# 192.168.113.3.1008 > 10.1.1.4.1023 FIN+ACK
+[in,bge0]
+4500 0034 e40b 4000 4006 1a08 c0a8 7103
+0a01 0104 03f0 03ff 66e5 b811 91d4 c8a8
+8011 832c 57d2 0000 0101 080a 0000 0004
+0039 dd6c
+
+# 192.168.113.4.shell > 192.168.113.3.1009 ACK
+[out,bge0]
+4500 0028 0004 4000 4006 d773 c0a8 7104
+c0a8 7103 0202 03f1 915a a5cb 6523 90ec
+5010 05b4 139f 0000
+
+# 192.168.113.4.1023 > 192.168.113.3.1008 ACK
+[out,bge0]
+4500 0034 118e 4000 4006 c5dd c0a8 7104
+c0a8 7103 03ff 03f0 91d4 c8a8 66e5 b812
+8010 05b4 aea0 0000 0101 080a 0039 dd6e
+0000 0004
+
diff --git a/contrib/netbsd-tests/ipf/input/ni21 b/contrib/netbsd-tests/ipf/input/ni21
new file mode 100644
index 0000000..daf741e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni21
@@ -0,0 +1,3 @@
+out on lan0 2.2.2.2 3.3.3.3
+in on lan0 3.3.3.3 4.4.4.4
+out on lan0 2.2.2.2 3.3.3.3
diff --git a/contrib/netbsd-tests/ipf/input/ni23 b/contrib/netbsd-tests/ipf/input/ni23
new file mode 100644
index 0000000..938b7b8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni23
@@ -0,0 +1,3 @@
+in on le0 udp 3.3.3.1,6700 1.1.2.3,4500
+in on hme0 udp 2.2.2.2,4500 4.4.4.4,6700
+out on bge0 udp 2.2.2.2,4500 3.3.3.1,6700
diff --git a/contrib/netbsd-tests/ipf/input/ni3 b/contrib/netbsd-tests/ipf/input/ni3
new file mode 100644
index 0000000..e4d12fe
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni3
@@ -0,0 +1,20 @@
+#v tos len id off ttl p sum src dst
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going out)
+[out,df0]
+4500 003c 4706 4000 ff06 28aa 0202 0202 0404 0404
+5000 0050 0000 0001 0000 0000 a002 16d0 d8e2 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[in,df0]
+4500 0038 809a 0000 ff01 2919 0303 0303 0606 0606
+0303 acab 0000 0000
+4500 003c 4706 4000 ff06 20a2 0606 0606 0404 0404
+5000 0050 0000 0001
+
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[in,df0]
+4500 0058 809a 0000 ff01 28f9 0303 0303 0606 0606
+0303 113f 0000 0000
+4500 003c 4706 4000 ff06 20a2 0606 0606 0404 0404
+5000 0050 0000 0001 0000 0000 a002 16d0 d0da 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
diff --git a/contrib/netbsd-tests/ipf/input/ni4 b/contrib/netbsd-tests/ipf/input/ni4
new file mode 100644
index 0000000..dac9f53
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni4
@@ -0,0 +1,18 @@
+#v tos len id off ttl p sum src dst
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going out)
+[out,df0]
+4500 003c 4706 4000 ff06 28aa 0202 0202 0404 0404
+5000 0050 0000 0001 0000 0000 a002 16d0 d8e2 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[in,df0]
+4500 0038 809a 0000 ff01 2919 0303 0303 0606 0606
+0303 606b 0000 0000 4500 003c 4706 4000 ff06 20a2 0606 0606 0404 0404 9c40 0050 0000 0001
+
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[in,df0]
+4500 0058 809a 0000 ff01 28f9 0303 0303 0606 0606
+0303 113f 0000 0000
+4500 003c 4706 4000 ff06 20a2 0606 0606 0404 0404
+9c40 0050 0000 0001 0000 0000 a002 16d0 849a 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
diff --git a/contrib/netbsd-tests/ipf/input/ni5 b/contrib/netbsd-tests/ipf/input/ni5
new file mode 100644
index 0000000..4b32e49
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni5
@@ -0,0 +1,363 @@
+# 32818,21 SYN
+[out,ppp0]
+4500 002c 10c9 4000 ff06 3289 c0a8 0103
+96cb e002 8032 0015 bd6b c9c8 0000 0000
+6002 2238 35f9 0000 0204 05b4
+
+# 21,32818 SYN+ACK
+[in,ppp0]
+4500 002c ffdd 4000 ef06 131e 96cb e002
+0101 0101 0015 8032 3786 76c4 bd6b c9c9
+6012 269c 4313 0000 0204 0584
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10ca 4000 ff06 328c c0a8 0103
+96cb e002 8032 0015 bd6b c9c9 3786 76c5
+5010 269c 9af6 0000
+
+# ACK+PUSH "[220-coombs.anu.edu.au NcFTPd Server (free educational license) ready.\r\n"
+[in,ppp0]
+4500 006f ffde 4000 ef06 12da 96cb e002
+0101 0101 0015 8032 3786 76c5 bd6b c9c9
+5018 269c 5628 0000 3232 302d 636f 6f6d
+6273 2e61 6e75 2e65 6475 2e61 7520 4e63
+4654 5064 2053 6572 7665 7220 2866 7265
+6520 6564 7563 6174 696f 6e61 6c20 6c69
+6365 6e73 6529 2072 6561 6479 2e0d 0a
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10cb 4000 ff06 328b c0a8 0103
+96cb e002 8032 0015 bd6b c9c9 3786 770c
+5010 269c 9aaf 0000
+
+# 21,32818 ACK+PUSH
+# "220-Maintained by RSSS and RSPAS IT Staff (previously known as Coombs Computing Unit)\r\n
+# "220-Any problems contact ftpmaster@coombs.anu.edu.au\r\n"
+# "220-\r\n220 \r\n"
+[in,ppp0]
+4500 00c7 ffdf 4000 ef06 1281 96cb e002
+0101 0101 0015 8032 3786 770c bd6b c9c9
+5018 269c d030 0000 3232 302d 0d0a 3232
+302d 4d61 696e 7461 696e 6564 2062 7920
+5253 5353 2061 6e64 2052 5350 4153 2049
+5420 5374 6166 6620 2870 7265 7669 6f75
+736c 7920 6b6e 6f77 6e20 6173 2043 6f6f
+6d62 7320 436f 6d70 7574 696e 6720 556e
+6974 290d 0a32 3230 2d41 6e79 2070 726f
+626c 656d 7320 636f 6e74 6163 7420 6674
+706d 6173 7465 7240 636f 6f6d 6273 2e61
+6e75 2e65 6475 2e61 750d 0a32 3230 2d0d
+0a32 3230 200d 0a
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10cc 4000 ff06 328a c0a8 0103
+96cb e002 8032 0015 bd6b c9c9 3786 77ab
+5010 269c 9a10 0000
+
+# 32818,21 ACK+PUSH "USER anonymous\r\n"
+[out,ppp0]
+4500 0038 10cd 4000 ff06 3279 c0a8 0103
+96cb e002 8032 0015 bd6b c9c9 3786 77ab
+5018 269c 121c 0000 5553 4552 2061 6e6f
+6e79 6d6f 7573 0d0a
+
+# 21,32818 ACK
+[in,ppp0]
+4500 0028 ffe0 4000 ef06 131f 96cb e002
+0101 0101 0015 8032 3786 77ab bd6b c9d9
+5010 269c 59aa 0000
+
+# 21,32818 ACK+PUSH "331 Guest login ok, send your complete e-mail address as password.\r\n"
+[in,ppp0]
+4500 006c ffe1 4000 ef06 12da 96cb e002
+0101 0101 0015 8032 3786 77ab bd6b c9d9
+5018 269c 6fb9 0000 3333 3120 4775 6573
+7420 6c6f 6769 6e20 6f6b 2c20 7365 6e64
+2079 6f75 7220 636f 6d70 6c65 7465 2065
+2d6d 6169 6c20 6164 6472 6573 7320 6173
+2070 6173 7377 6f72 642e 0d0a
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10ce 4000 ff06 3288 c0a8 0103
+96cb e002 8032 0015 bd6b c9d9 3786 77ef
+5010 269c 99bc 0000
+
+# 32818,21 ACK+PUSH "PASS avalon@\r\n"
+[out,ppp0]
+4500 0036 10cf 4000 ff06 3279 c0a8 0103
+96cb e002 8032 0015 bd6b c9d9 3786 77ef
+5018 269c 7795 0000 5041 5353 2061 7661
+6c6f 6e40 0d0a
+
+# 21,32818 ACK+PUSH
+# "230-You are user #4 of 50 simultaneous users allowed.\r\n"
+[in,ppp0]
+4500 005f ffe2 4000 ef06 12e6 96cb e002
+0101 0101 0015 8032 3786 77ef bd6b c9e7
+5018 269c 4908 0000 3233 302d 596f 7520
+6172 6520 7573 6572 2023 3420 6f66 2035
+3020 7369 6d75 6c74 616e 656f 7573 2075
+7365 7273 2061 6c6c 6f77 6564 2e0d 0a
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10d0 4000 ff06 3286 c0a8 0103
+96cb e002 8032 0015 bd6b c9e7 3786 7826
+5010 269c 9977 0000
+
+# 21,32818 ACK+PUSH
+# "230-\r\n230-\r\n"
+# "230-Hi. We're cleaning up. Any feedback most welcome. 10 Aug 00\r\n"
+# "230-\r\n230 Logged in anonymously.\r\n"
+[in,ppp0]
+4500 0099 ffe3 4000 ef06 12ab 96cb e002
+0101 0101 0015 8032 3786 7826 bd6b c9e7
+5018 269c 9343 0000 3233 302d 0d0a 3233
+302d 0d0a 3233 302d 4869 2e20 2057 6527
+7265 2063 6c65 616e 696e 6720 7570 2e20
+2041 6e79 2066 6565 6462 6163 6b20 6d6f
+7374 2077 656c 636f 6d65 2e20 3130 2041
+7567 2030 300d 0a32 3330 2d0d 0a32 3330
+204c 6f67 6765 6420 696e 2061 6e6f 6e79
+6d6f 7573 6c79 2e0d 0a
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10d1 4000 ff06 3285 c0a8 0103
+96cb e002 8032 0015 bd6b c9e7 3786 7897
+5010 269c 9906 0000
+
+# 32818,21 ACK "TYPE I\r\n"
+[out,ppp0]
+4500 0030 10d2 4000 ff06 327c c0a8 0103
+96cb e002 8032 0015 bd6b c9e7 3786 7897
+5018 269c c704 0000 5459 5045 2049 0d0a
+
+# 21,32818 "200 Type okay.\r\n"
+[in,ppp0]
+4500 0038 ffe4 4000 ef06 130b 96cb e002
+0101 0101 0015 8032 3786 7897 bd6b c9ef
+5018 269c 1f58 0000 3230 3020 5479 7065
+206f 6b61 792e 0d0a
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10d3 4000 ff06 3283 c0a8 0103
+96cb e002 8032 0015 bd6b c9ef 3786 78a7
+5010 269c 98ee 0000
+
+# 32818,21 ACK "PORT 192,158,1,3,128,51\r\n"
+[out,ppp0]
+4500 0041 10d4 4000 ff06 3269 c0a8 0103
+96cb e002 8032 0015 bd6b c9ef 3786 78a7
+5018 269c 1c4d 0000 504f 5254 2031 3932
+2c31 3638 2c31 2c33 2c31 3238 2c35 310d
+0a
+
+# 32818,21 ACK "200 PORT command successful.\r\n"
+[in,ppp0]
+4500 0046 ffe5 4000 ef06 12fc 96cb e002
+0101 0101 0015 8032 3786 78a7 bd6b ca08
+5018 269c 9b71 0000 3230 3020 504f 5254
+2063 6f6d 6d61 6e64 2073 7563 6365 7373
+6675 6c2e 0d0a
+
+# 32818,21 "TYPE A\r\n"
+[out,ppp0]
+4500 0030 10d5 4000 ff06 3279 c0a8 0103
+96cb e002 8032 0015 bd6b ca08 3786 78c5
+5018 269c c6bd 0000 5459 5045 2041 0d0a
+
+# 21,32818 "200 Type okay.\r\n"
+[in,ppp0]
+4500 0038 ffe6 4000 ef06 1309 96cb e002
+0101 0101 0015 8032 3786 78c5 bd6b ca10
+5018 269c 1f09 0000 3230 3020 5479 7065
+206f 6b61 792e 0d0a
+
+# 32818,21 "NLST\r\n"
+[out,ppp0]
+4500 002e 10d6 4000 ff06 327a c0a8 0103
+96cb e002 8032 0015 bd6b ca10 3786 78d5
+5018 269c e9e6 0000 4e4c 5354 0d0a
+
+# 20,32819 SYN
+[in,ppp0]
+4500 002c ffe7 4000 ef06 1314 96cb e002
+0101 0101 0014 8033 d9f8 11d4 0000 0000
+6002 2238 913a 0000 0204 0584
+
+# 32819,20 SYN+ACK
+[out,ppp0]
+4500 002c 10d7 4000 ff06 327b c0a8 0103
+96cb e002 8033 0014 bd78 5c12 d9f8 11d5
+6012 02f8 d734 0000 0204 0584
+
+# 20,32819 ACK
+[in,ppp0]
+4500 0028 ffe8 4000 ef06 1317 96cb e002
+0101 0101 0014 8033 d9f8 11d5 bd78 5c13
+5010 269c 8ac7 0000
+
+# 21,32818 ACK "150 Opening ASCII mode data connection for /bin/ls.\r\n"
+[in,ppp0]
+4500 005d ffe9 4000 ef06 12e1 96cb e002
+0101 0101 0015 8032 3786 78d5 bd6b ca16
+5018 269c ae7e 0000 3135 3020 4f70 656e
+696e 6720 4153 4349 4920 6d6f 6465 2064
+6174 6120 636f 6e6e 6563 7469 6f6e 2066
+6f72 202f 6269 6e2f 6c73 2e0d 0a
+
+# 32819,20 ACK
+[out,ppp0]
+4500 0028 10d8 4000 ff06 327e c0a8 0103
+96cb e002 8033 0014 bd78 5c13 d9f8 11d5
+5010 6348 8e71 0000
+
+# 32818,21 ACK+PUSH "PORT 192,158,1,3,128,52\r\n"
+[out,ppp0]
+4500 0041 10d9 4000 ff06 3264 c0a8 0103
+96cb e002 8032 0015 bd6b ca16 3786 78d5
+5018 269c 1af8 0000 504f 5254 2031 3932
+2c31 3638 2c31 2c33 2c31 3238 2c35 320d
+0a
+
+# 21,32818 ACK+PUSH "200 PORT command successful\r\n"
+[in,ppp0]
+4500 0046 ffea 4000 ef06 12f7 96cb e002
+0101 0101 0015 8032 3786 78d5 bd6b ca2f
+5018 269c 9b1c 0000 3230 3020 504f 5254
+2063 6f6d 6d61 6e64 2073 7563 6365 7373
+6675 6c2e 0d0a
+
+# 32818,21 ACK+PUSH "TYPE A\r\n"
+[out,ppp0]
+4500 0030 10da 4000 ff06 3274 c0a8 0103
+96cb e002 8032 0015 bd6b ca2f 3786 78f3
+5018 269c c668 0000 5459 5045 2041 0d0a
+
+# 21,32818 "200 Type okay.\r\n"
+[in,ppp0]
+4500 0038 ffeb 4000 ef06 1304 96cb e002
+0101 0101 0015 8032 3786 78f3 bd6b ca37
+5018 269c 1ea4 0000 3230 3020 5479 7065
+206f 6b61 793e 0d0a
+
+# 32818,21 ACK+PUSH "NLST\r\n"
+[out,ppp0]
+4500 002e 10db 4000 ff06 3275 c0a8 0103
+96cb e002 8032 0015 bd6b ca37 3786 7903
+5018 269c e991 0000 4e4c 5354 0d0a
+
+# 20,32820 2nd connection SYN
+[in,ppp0]
+4500 002c ffec 4000 ef06 130f 96cb e002
+0101 0101 0014 8034 d9f8 11d4 0000 0000
+6002 2238 9139 0000 0204 0584
+
+# 32820,20 SYN+ACK
+[out,ppp0]
+4500 002c 10d7 4000 ff06 327b c0a8 0103
+96cb e002 8034 0014 bd78 5c12 d9f8 11d5
+6012 02f8 d733 0000 0204 0584
+
+# 20,32820 ACK
+[in,ppp0]
+4500 0028 ffec 4000 ef06 1313 96cb e002
+0101 0101 0014 8034 d9f8 11d4 0000 0000
+5010 2238 a8b7 0000
+
+# 20,32819 ACK+PUSH
+[in,ppp0]
+4500 0063 ffed 4000 ef06 12d7 96cb e002
+0101 0101 0014 8033 d9f8 11d5 bd78 5c13
+5018 269c 62bf 0000 636f 6f6d 6273 7061
+7065 7273 0d0a 6465 7074 730d 0a66 6f75
+6e64 2d66 696c 6573 0d0a 696e 636f 6d69
+6e67 0d0a 6e6c 632d 7465 7374 0d0a 7075
+620d 0a
+
+# 32819,20 ACK
+[out,ppp0]
+4500 0028 10dc 4000 ff06 327a c0a8 0103
+96cb e002 8033 0014 bd78 5c13 d9f8 1210
+5010 6348 8e36 0000
+
+# 20,32819 FIN+ACK
+[in,ppp0]
+4500 0028 ffee 4000 ef06 1311 96cb e002
+0101 0101 0014 8033 d9f8 1210 bd78 5c13
+5011 269c 8a8b 0000
+
+# 32819,20 ACK
+[out,ppp0]
+4500 0028 10dd 4000 ff06 3279 c0a8 0103
+96cb e002 8033 0014 bd78 5c13 d9f8 1211
+5010 6348 8e35 0000
+
+# 32819,20 FIN+ACK
+[out,ppp0]
+4500 0028 10dd 4000 ff06 3279 c0a8 0103
+96cb e002 8033 0014 bd78 5c13 d9f8 1211
+5011 6348 8e34 0000
+
+# 20,32819 ACK
+[in,ppp0]
+4500 0028 ffef 4000 ef06 1310 96cb e002
+0101 0101 0014 8033 d9f8 1211 bd78 5c14
+5010 269c 8a8a 0000
+
+# 21,32818 220 "226 Listing completed.\r\n"
+[in,ppp0]
+4500 0040 fff0 4000 ef06 12f7 96cb e002
+0101 0101 0015 8032 3786 7903 bd6b ca37
+5018 269c 3c32 0000 3232 3620 4c69 7374
+696e 6720 636f 6d70 6c65 7465 642e 0d0a
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10e0 4000 ff06 3276 c0a8 0103
+96cb e002 8032 0015 bd6b ca37 3786 791b
+5010 269c 9832 0000
+
+# 32818,21 "QUIT\r\n"
+[out,ppp0]
+4500 002e 10e1 4000 ff06 326f c0a8 0103
+96cb e002 8032 0015 bd6b ca37 3786 791b
+5018 269c f070 0000 5155 4954 0d0a
+
+# 21,32818 "221 Goodbye."
+[in,ppp0]
+4500 0036 fff2 4000 ef06 12ff 96cb e002
+0101 0101 0015 8032 3786 791b bd6b ca3d
+5018 269c 68e8 0000 3232 3120 476f 6f64
+6279 652e 0d0a
+
+# 32818,21 ACK+FIN
+[out,ppp0]
+4500 0028 10e2 4000 ff06 3274 c0a8 0103
+96cb e002 8032 0015 bd6b ca3d 3786 7929
+5011 269c 981d 0000
+
+# 21,32818 ACK+FIN
+[in,ppp0]
+4500 0028 fff3 4000 ef06 130c 96cb e002
+0101 0101 0015 8032 3786 7929 bd6b ca3d
+5011 269c 57c7 0000
+
+# 32818,21 ACK
+[out,ppp0]
+4500 0028 10e3 4000 ff06 3273 c0a8 0103
+96cb e002 8032 0015 bd6b ca3d 3786 792a
+5010 269c 981d 0000
+
+# 21,32818 ACK
+[in,ppp0]
+4500 0028 fff4 4000 ef06 130b 96cb e002
+0101 0101 0015 8032 3786 792a bd6b ca3e
+5010 269c 57c6 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/ni6 b/contrib/netbsd-tests/ipf/input/ni6
new file mode 100644
index 0000000..70e80c0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni6
@@ -0,0 +1,54 @@
+[in,nf0]
+4500 0054 cd8a 4000 ff11 20ba c0a8 0601
+c0a8 0602 8075 006f 0040 d36d 3e1d d249
+0000 0000 0000 0002 0001 86a0 0000 0002
+0000 0003 0000 0000 0000 0000 0000 0000
+0000 0000 0001 86a3 0000 0003 0000 0011
+0000 0000
+
+[out,qfe0]
+4500 0054 cd8a 4000 ff11 1fbb c0a8 0601
+c0a8 0701 8075 006f 0040 d26e 3e1d d249
+0000 0000 0000 0002 0001 86a0 0000 0002
+0000 0003 0000 0000 0000 0000 0000 0000
+0000 0000 0001 86a3 0000 0003 0000 0011
+0000 0000
+
+[in,qfe0]
+4500 0038 cd83 4000 ff11 1edd c0a8 0701
+c0a8 0702 006f 8075 0024 d704 3e1d d249
+0000 0001 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0801
+
+[out,nf0]
+4500 0038 cd83 4000 ff11 1fde c0a8 0701
+c0a8 0601 006f 8075 0024 d805 3e1d d249
+0000 0001 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0801
+
+[in,nf0]
+4500 0044 d5a6 4000 ff11 18ae c0a8 0601
+c0a8 0602 80df 0801 0030 04f0 3e10 1fb1
+0000 0000 0000 0002 0001 86a3 0000 0002
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+[out,qfe0]
+4500 0044 d5a6 4000 ff11 17af c0a8 0601
+c0a8 0701 80df 0801 0030 03f1 3e10 1fb1
+0000 0000 0000 0002 0001 86a3 0000 0002
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000
+
+[in,qfe0]
+4500 0034 0000 4000 fe11 ed64 c0a8 0701
+c0a8 0702 0801 80df 0020 89b7 3e10 1fb1
+0000 0001 0000 0000 0000 0000 0000 0000
+0000 0000
+
+[out,nf0]
+4500 0034 0000 4000 fe11 ee65 c0a8 0701
+c0a8 0601 0801 80df 0020 0000 3e10 1fb1
+0000 0001 0000 0000 0000 0000 0000 0000
+0000 0000
+
diff --git a/contrib/netbsd-tests/ipf/input/ni7 b/contrib/netbsd-tests/ipf/input/ni7
new file mode 100644
index 0000000..8d07937
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni7
@@ -0,0 +1,13 @@
+#v tos len id off ttl p sum src dst
+# ICMP timeout exceeded in reply to a ICMP packet coming in.
+[in,df0]
+4500 0028 4706 4000 0111 26b4 0404 0404 0202 0202
+afc9 829e 0014 6b10 0402 0000
+3be5 468d 000a cfc3
+
+[out,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303 0404 0404
+0b00 0125 0000 0000
+4500 0028 4706 4000 0111 1eac 0404 0404 0606 0606
+afc9 829e 0014 c15e
+
diff --git a/contrib/netbsd-tests/ipf/input/ni8 b/contrib/netbsd-tests/ipf/input/ni8
new file mode 100644
index 0000000..72205ee
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni8
@@ -0,0 +1,27 @@
+#v tos len id off ttl p sum src dst
+[in,df0]
+4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202
+5000 0500 0000 0001 0000 0000 a002 16d0 cc32 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[out,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303 0404 0404
+0303 0fa3 0000 0000
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101
+5000 9d58 0000 0001
+
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[out,df0]
+4500 0058 809a 0000 ff01 2cfd 0303 0303 0404 0404
+0303 0735 0000 0000
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101
+5000 9d58 0000 0001 0000 0000 a002 16d0 3ddc 0000
+0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going in)
+[out,df0]
+4500 0038 809a 0000 ff01 2b1b 0303 0303 0505 0505
+0303 0fa3 0000 0000
+4500 003c 4706 4000 ff06 2aab 0404 0404 0101 0102
+5000 9d58 0000 0001
+
diff --git a/contrib/netbsd-tests/ipf/input/ni9 b/contrib/netbsd-tests/ipf/input/ni9
new file mode 100644
index 0000000..b8f4599
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/ni9
@@ -0,0 +1,27 @@
+#v tos len id off ttl p sum src dst
+# ICMP dest unreachable with 64 bits in payload (in reply to a TCP packet
+# going out)
+[in,df0]
+4500 003c 4706 4000 ff06 20aa 0404 0404 0a02 0202
+5000 0500 0000 0001 0000 0000 a002 16d0 cc32 0000 0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[out,df0]
+4500 0038 809a 0000 ff01 2d1d 0303 0303 0404 0404
+0303 0fa3 0000 0000
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101
+5000 9d58 0000 0001
+
+# ICMP dest unreachable with whole packet in payload (40 bytes = 320 bits)
+[out,df0]
+4500 0058 809a 0000 ff01 2cfd 0303 0303 0404 0404
+0303 0735 0000 0000
+4500 003c 4706 4000 ff06 2aac 0404 0404 0101 0101
+5000 9d58 0000 0001 0000 0000 a002 16d0 3ddc 0000
+0204 05b4 0402 080a 0047 fbb0 0000 0000 0103 0300
+
+[out,df0]
+4500 0038 809a 0000 ff01 2b1b 0303 0303 0505 0505
+0303 0fa3 0000 0000
+4500 003c 4706 4000 ff06 2aab 0404 0404 0101 0102
+5000 9d58 0000 0001
+
diff --git a/contrib/netbsd-tests/ipf/input/p1 b/contrib/netbsd-tests/ipf/input/p1
new file mode 100644
index 0000000..f6753fa
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p1
@@ -0,0 +1,8 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+out 127.0.0.1 127.0.0.1
+out 1.1.1.1 1.2.1.1
+in 2.3.0.1 1.2.1.1
+in 2.2.2.1 1.2.1.1
+in 2.2.0.1 1.2.1.1
+out 4.4.1.1 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/p10 b/contrib/netbsd-tests/ipf/input/p10
new file mode 100644
index 0000000..f8162e8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p10
@@ -0,0 +1,10 @@
+in on bge0 tcp 5.5.5.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.9,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.9,10000 9.9.9.9,80
diff --git a/contrib/netbsd-tests/ipf/input/p11 b/contrib/netbsd-tests/ipf/input/p11
new file mode 100644
index 0000000..f8162e8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p11
@@ -0,0 +1,10 @@
+in on bge0 tcp 5.5.5.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.9,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.9,10000 9.9.9.9,80
diff --git a/contrib/netbsd-tests/ipf/input/p12 b/contrib/netbsd-tests/ipf/input/p12
new file mode 100644
index 0000000..f8162e8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p12
@@ -0,0 +1,10 @@
+in on bge0 tcp 5.5.5.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.9,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.9,10000 9.9.9.9,80
diff --git a/contrib/netbsd-tests/ipf/input/p13 b/contrib/netbsd-tests/ipf/input/p13
new file mode 100644
index 0000000..f6753fa
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p13
@@ -0,0 +1,8 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+out 127.0.0.1 127.0.0.1
+out 1.1.1.1 1.2.1.1
+in 2.3.0.1 1.2.1.1
+in 2.2.2.1 1.2.1.1
+in 2.2.0.1 1.2.1.1
+out 4.4.1.1 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/p2 b/contrib/netbsd-tests/ipf/input/p2
new file mode 100644
index 0000000..f6753fa
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p2
@@ -0,0 +1,8 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+out 127.0.0.1 127.0.0.1
+out 1.1.1.1 1.2.1.1
+in 2.3.0.1 1.2.1.1
+in 2.2.2.1 1.2.1.1
+in 2.2.0.1 1.2.1.1
+out 4.4.1.1 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/p3 b/contrib/netbsd-tests/ipf/input/p3
new file mode 100644
index 0000000..4a6666b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p3
@@ -0,0 +1,12 @@
+in 1.1.1.1 1.2.1.1
+in 1.2.1.1 1.1.1.1
+out 1.1.1.1 1.2.1.1
+out 1.2.1.1 1.1.1.1
+in 2.2.2.2 2.1.2.1
+out 2.1.2.1 2.2.2.2
+in 3.3.1.1 3.1.3.1
+out 3.1.3.1 3.3.1.1
+in 4.4.1.1 4.1.4.1
+out 4.1.4.1 4.4.1.1
+in 5.5.1.1 5.1.5.1
+out 5.1.5.1 5.5.1.1
diff --git a/contrib/netbsd-tests/ipf/input/p4 b/contrib/netbsd-tests/ipf/input/p4
new file mode 100644
index 0000000..46c0998
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p4
@@ -0,0 +1,12 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+out 127.0.0.1 127.0.0.1
+out 1.1.1.1 1.2.1.1
+in 2.3.0.1 1.2.1.1
+in 2.2.2.1 1.2.1.1
+in 2.2.0.1 1.2.1.1
+out 2.2.2.1 1.2.1.1
+out 2.2.2.1 1.2.1.2
+out 2.2.0.1 1.2.1.1
+out 2.2.0.1 1.2.1.3
+out 4.4.1.1 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/p5 b/contrib/netbsd-tests/ipf/input/p5
new file mode 100644
index 0000000..f6753fa
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p5
@@ -0,0 +1,8 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+out 127.0.0.1 127.0.0.1
+out 1.1.1.1 1.2.1.1
+in 2.3.0.1 1.2.1.1
+in 2.2.2.1 1.2.1.1
+in 2.2.0.1 1.2.1.1
+out 4.4.1.1 1.2.1.1
diff --git a/contrib/netbsd-tests/ipf/input/p6 b/contrib/netbsd-tests/ipf/input/p6
new file mode 100644
index 0000000..37c26ce
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p6
@@ -0,0 +1,2 @@
+in 131.107.1.1 10.1.1.1
+out 10.1.1.1 131.107.1.1
diff --git a/contrib/netbsd-tests/ipf/input/p7 b/contrib/netbsd-tests/ipf/input/p7
new file mode 100644
index 0000000..f8162e8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p7
@@ -0,0 +1,10 @@
+in on bge0 tcp 5.5.5.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.9,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.9,10000 9.9.9.9,80
diff --git a/contrib/netbsd-tests/ipf/input/p9 b/contrib/netbsd-tests/ipf/input/p9
new file mode 100644
index 0000000..f8162e8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/input/p9
@@ -0,0 +1,10 @@
+in on bge0 tcp 5.5.5.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.5.9,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.5,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.6,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.7,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.8,10000 9.9.9.9,80
+in on bge0 tcp 5.5.6.9,10000 9.9.9.9,80
diff --git a/contrib/netbsd-tests/ipf/regress/bpf-f1 b/contrib/netbsd-tests/ipf/regress/bpf-f1
new file mode 100644
index 0000000..2c80283
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/bpf-f1
@@ -0,0 +1,4 @@
+pass in bpf-v4 { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" }
+pass out bpf-v4 { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" }
+pass in bpf-v4 { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" }
+pass out bpf-v4 { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" }
diff --git a/contrib/netbsd-tests/ipf/regress/bpf1 b/contrib/netbsd-tests/ipf/regress/bpf1
new file mode 100644
index 0000000..5d83b77
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/bpf1
@@ -0,0 +1,4 @@
+pass in bpf-v4 { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" }
+pass out bpf-v4 { "src host 1.1.1.1" }
+pass in bpf-v4 { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" }
+pass out bpf-v4 { "dst host 1.1.1.1" }
diff --git a/contrib/netbsd-tests/ipf/regress/f1 b/contrib/netbsd-tests/ipf/regress/f1
new file mode 100644
index 0000000..6a2ede9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f1
@@ -0,0 +1,4 @@
+block in all
+pass in all
+block out all
+pass out all
diff --git a/contrib/netbsd-tests/ipf/regress/f10 b/contrib/netbsd-tests/ipf/regress/f10
new file mode 100644
index 0000000..3552983
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f10
@@ -0,0 +1,18 @@
+block in from any to any with not ipopts
+pass in from any to any with not opt sec-class topsecret
+block in from any to any with not opt ssrr,sec-class topsecret
+pass in from any to any with not opt ssrr,sec-class topsecret
+block in from any to any with not opt ts,sec-class topsecret
+pass in from any to any with not opt ts,sec-class topsecret
+block in from any to any with not opt sec-class secret
+pass in from any to any with not opt sec-class secret
+block in from any to any with not opt lsrr,ssrr
+pass in from any to any with not opt lsrr,ssrr
+pass in from any to any with not ipopts
+block in from any to any with not opt lsrr
+pass in from any to any with not opt lsrr
+block in from any to any with not opt ssrr,ts
+pass in from any to any with not opt ssrr,ts
+block in from any to any with not opt rr
+pass in from any to any with not opt rr
+block in from any to any with not opt sec-class topsecret
diff --git a/contrib/netbsd-tests/ipf/regress/f11 b/contrib/netbsd-tests/ipf/regress/f11
new file mode 100644
index 0000000..a71e528
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f11
@@ -0,0 +1,7 @@
+pass in proto tcp from any to any port = 23 flags S/SA keep state
+block in proto tcp from any to any port = 23 flags S/SA keep state
+pass in proto udp from any to any port = 53 keep frags
+block in proto udp from any to any port = 53 keep frags
+pass in proto udp from any to any port = 53 keep state
+block in proto udp from any to any port = 53 keep state
+pass in on e0 proto tcp from any to any port = 25 keep state
diff --git a/contrib/netbsd-tests/ipf/regress/f12 b/contrib/netbsd-tests/ipf/regress/f12
new file mode 100644
index 0000000..c29f839
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f12
@@ -0,0 +1,6 @@
+pass in proto tcp from any port > 1024 to any port = 25 with not short
+pass in proto tcp from any port > 1024 to any port = 25
+block in proto tcp from any to any with short
+block in proto tcp from any to any with frag
+pass in proto udp from any port = 53 to any port = 53
+block in proto udp from any port = 53 to any port = 53 with not short
diff --git a/contrib/netbsd-tests/ipf/regress/f13 b/contrib/netbsd-tests/ipf/regress/f13
new file mode 100644
index 0000000..393a65e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f13
@@ -0,0 +1,9 @@
+pass in proto tcp from any to any port = 25 flags S/SA keep frags
+block in proto tcp from any to any port = 25 flags S/SA keep frags
+pass in proto udp from any to any port = 53 keep frags
+block in proto udp from any to any port = 53 keep frags
+pass in proto tcp from any to any port = 25 flags S/SA keep state keep frags
+block in proto tcp from any to any port = 25 flags S/SA keep state keep frags
+pass in proto udp from any to any port = 53 keep frags(strict)
+pass in proto tcp from any to any port = 25 keep state(strict)
+pass in proto tcp from any to any port = 25 keep state(loose)
diff --git a/contrib/netbsd-tests/ipf/regress/f14 b/contrib/netbsd-tests/ipf/regress/f14
new file mode 100644
index 0000000..06ab519
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f14
@@ -0,0 +1,8 @@
+block in from !1.1.1.1 to any
+pass in from 1.1.1.1 to !any
+block in from 1.1.1.0/24 to !any
+pass in from !1.1.1.0/24 to any
+block in from !1.1.0.0/16 to any
+pass in from 1.1.0.0/16 to !1.2.0.0/16
+block in from any to !127.0.0.0/8
+pass in from !any to any
diff --git a/contrib/netbsd-tests/ipf/regress/f15 b/contrib/netbsd-tests/ipf/regress/f15
new file mode 100644
index 0000000..16185e1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f15
@@ -0,0 +1,8 @@
+block in log quick on hme0 from any to 195.134.65.0/25 head 10
+block return-rst in log quick proto tcp all flags S head 100 group 10
+pass in quick proto tcp from any to any port = 22 keep state group 100
+pass in quick proto tcp from any to any port = 23 keep state group 100
+pass in quick proto tcp from any to any port = 21 keep state group 100
+block return-icmp in quick proto udp all keep state head 110 group 10
+pass in quick proto udp from any to any port = 53 keep state group 110
+block in log quick on hme0 from any to any
diff --git a/contrib/netbsd-tests/ipf/regress/f16 b/contrib/netbsd-tests/ipf/regress/f16
new file mode 100644
index 0000000..920ad8c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f16
@@ -0,0 +1,10 @@
+pass in all
+skip 2 in proto tcp all
+block in quick proto tcp all
+skip 4 in proto udp all
+block in quick proto udp all
+pass in quick proto tcp from any to 1.1.1.1
+pass in quick proto tcp from any to 1.1.1.2 port = 22
+block in quick proto udp from any to any port = 53
+pass in quick proto udp from any to any port = 53
+block in all
diff --git a/contrib/netbsd-tests/ipf/regress/f17 b/contrib/netbsd-tests/ipf/regress/f17
new file mode 100644
index 0000000..9a75ae3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f17
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass out quick on ppp0 proto tcp all flags S keep state
+block return-rst in quick proto tcp all
diff --git a/contrib/netbsd-tests/ipf/regress/f18 b/contrib/netbsd-tests/ipf/regress/f18
new file mode 100644
index 0000000..acba2b3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f18
@@ -0,0 +1,4 @@
+pass in from 1.1.1.1 to any
+pass out from 2.2.2.2 to any
+count in from 1.1.1.1 to 3.3.3.3
+count out from 2.2.2.2 to 4.4.4.4
diff --git a/contrib/netbsd-tests/ipf/regress/f19 b/contrib/netbsd-tests/ipf/regress/f19
new file mode 100644
index 0000000..d7770b8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f19
@@ -0,0 +1,2 @@
+pass in quick proto tcp all flags S keep state
+pass in quick proto tcp all flags S keep state(limit 1)
diff --git a/contrib/netbsd-tests/ipf/regress/f2 b/contrib/netbsd-tests/ipf/regress/f2
new file mode 100644
index 0000000..e2f02a4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f2
@@ -0,0 +1,6 @@
+block in proto tcp from any to any
+pass in proto tcp from any to any
+block in proto udp from any to any
+pass in proto udp from any to any
+block in proto icmp from any to any
+pass in proto icmp from any to any
diff --git a/contrib/netbsd-tests/ipf/regress/f20 b/contrib/netbsd-tests/ipf/regress/f20
new file mode 100644
index 0000000..279523e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f20
@@ -0,0 +1,4 @@
+block out quick on de0 head 100
+skip 1 out group 100
+block out quick group 100
+pass out quick group 100
diff --git a/contrib/netbsd-tests/ipf/regress/f21 b/contrib/netbsd-tests/ipf/regress/f21
new file mode 100644
index 0000000..26ffa87
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f21
@@ -0,0 +1,2 @@
+pass out proto tcp all flags S keep state(icmp-head icmpredir)
+block in proto icmp all icmp-type redir group icmpredir
diff --git a/contrib/netbsd-tests/ipf/regress/f22 b/contrib/netbsd-tests/ipf/regress/f22
new file mode 100644
index 0000000..10765db
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f22
@@ -0,0 +1,2 @@
+pass in proto tcp all flags S keep state(icmp-head icmpredir)
+block out proto icmp all icmp-type redir group icmpredir
diff --git a/contrib/netbsd-tests/ipf/regress/f24 b/contrib/netbsd-tests/ipf/regress/f24
new file mode 100644
index 0000000..5cb3bab
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f24
@@ -0,0 +1 @@
+pass out quick proto udp all keep state keep frags
diff --git a/contrib/netbsd-tests/ipf/regress/f25 b/contrib/netbsd-tests/ipf/regress/f25
new file mode 100644
index 0000000..c018b49
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f25
@@ -0,0 +1 @@
+pass in on hme0 proto udp all with mcast keep state
diff --git a/contrib/netbsd-tests/ipf/regress/f26 b/contrib/netbsd-tests/ipf/regress/f26
new file mode 100644
index 0000000..22357a4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f26
@@ -0,0 +1,6 @@
+pass in quick proto tcp from 1.1.1.0/24 to any port = 22 flags S keep state(max-srcs 3)
+pass in quick proto tcp from 1.1.1.0/24 to any port = 22 flags S keep state(max-srcs 3, max-per-src 1/32)
+pass in quick proto tcp from 1.1.1.0/24 to any port = 22 flags S keep state(max-srcs 3, max-per-src 1/16)
+pass in quick proto tcp all flags S keep state(max-srcs 3)
+pass in quick proto tcp all flags S keep state(max-srcs 3, max-per-src 1/32)
+pass in quick proto tcp all flags S keep state(max-srcs 3, max-per-src 1/16)
diff --git a/contrib/netbsd-tests/ipf/regress/f27 b/contrib/netbsd-tests/ipf/regress/f27
new file mode 100644
index 0000000..22357a4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f27
@@ -0,0 +1,6 @@
+pass in quick proto tcp from 1.1.1.0/24 to any port = 22 flags S keep state(max-srcs 3)
+pass in quick proto tcp from 1.1.1.0/24 to any port = 22 flags S keep state(max-srcs 3, max-per-src 1/32)
+pass in quick proto tcp from 1.1.1.0/24 to any port = 22 flags S keep state(max-srcs 3, max-per-src 1/16)
+pass in quick proto tcp all flags S keep state(max-srcs 3)
+pass in quick proto tcp all flags S keep state(max-srcs 3, max-per-src 1/32)
+pass in quick proto tcp all flags S keep state(max-srcs 3, max-per-src 1/16)
diff --git a/contrib/netbsd-tests/ipf/regress/f28.ipf b/contrib/netbsd-tests/ipf/regress/f28.ipf
new file mode 100644
index 0000000..ca42771
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f28.ipf
@@ -0,0 +1,2 @@
+block in all
+pass in on nic0 to dstlist/spread from 4.4.0.0/16 to any
diff --git a/contrib/netbsd-tests/ipf/regress/f28.pool b/contrib/netbsd-tests/ipf/regress/f28.pool
new file mode 100644
index 0000000..499b603
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f28.pool
@@ -0,0 +1,2 @@
+pool ipf/dstlist (name spread; policy round-robin;)
+ { nic0:1.1.0.2; nic1:1.1.1.2; nic2:1.1.2.2; nic3:1.1.3.2; };
diff --git a/contrib/netbsd-tests/ipf/regress/f29.ipf b/contrib/netbsd-tests/ipf/regress/f29.ipf
new file mode 100644
index 0000000..e4634cc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f29.ipf
@@ -0,0 +1,2 @@
+block in all
+pass in on nic0 to dstlist/spread from 4.4.0.0/16 to any keep state
diff --git a/contrib/netbsd-tests/ipf/regress/f29.pool b/contrib/netbsd-tests/ipf/regress/f29.pool
new file mode 100644
index 0000000..499b603
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f29.pool
@@ -0,0 +1,2 @@
+pool ipf/dstlist (name spread; policy round-robin;)
+ { nic0:1.1.0.2; nic1:1.1.1.2; nic2:1.1.2.2; nic3:1.1.3.2; };
diff --git a/contrib/netbsd-tests/ipf/regress/f3 b/contrib/netbsd-tests/ipf/regress/f3
new file mode 100644
index 0000000..ee80729
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f3
@@ -0,0 +1,8 @@
+block in from 1.1.1.1 to any
+pass in from 1.1.1.1 to any
+block in from 1.1.1.1/24 to any
+pass in from 1.1.1.1/24 to any
+block in from 1.1.1.1/16 to any
+pass in from 1.1.1.1/16 to any
+block in from 1.1.1.1/0 to any
+pass in from 1.1.1.1/0 to any
diff --git a/contrib/netbsd-tests/ipf/regress/f30 b/contrib/netbsd-tests/ipf/regress/f30
new file mode 100644
index 0000000..84a8970
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f30
@@ -0,0 +1,4 @@
+pass in on hme0 proto udp all with not ipopts keep state
+pass in on hme0 proto udp all with ipopts keep state
+pass in on hme0 proto tcp all flags S with opt rr keep state
+pass in on hme0 proto tcp all flags S with opt sec-class secret keep state
diff --git a/contrib/netbsd-tests/ipf/regress/f4 b/contrib/netbsd-tests/ipf/regress/f4
new file mode 100644
index 0000000..bc8af2f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f4
@@ -0,0 +1,8 @@
+block in from any to 1.1.1.1
+pass in from any to 1.1.1.1
+block in from any to 1.1.1.1/24
+pass in from any to 1.1.1.1/24
+block in from any to 1.1.1.1/16
+pass in from any to 1.1.1.1/16
+block in from any to 1.1.1.1/0
+pass in from any to 1.1.1.1/0
diff --git a/contrib/netbsd-tests/ipf/regress/f5 b/contrib/netbsd-tests/ipf/regress/f5
new file mode 100644
index 0000000..998eabd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f5
@@ -0,0 +1,48 @@
+block in proto tcp from any port = 23 to any
+block in proto udp from any port = 23 to any
+block in proto tcp/udp from any port = 23 to any
+pass in proto tcp from any port <= 1023 to any
+pass in proto udp from any port <= 1023 to any
+pass in proto tcp/udp from any port <= 1023 to any
+block in proto tcp from any port >= 1024 to any
+block in proto udp from any port >= 1024 to any
+block in proto tcp/udp from any port >= 1024 to any
+pass in proto tcp from any port >= 1024 to any
+pass in proto udp from any port >= 1024 to any
+pass in proto tcp/udp from any port >= 1024 to any
+block in proto tcp from any port 0 >< 512 to any
+block in proto udp from any port 0 >< 512 to any
+block in proto tcp/udp from any port 0 >< 512 to any
+pass in proto tcp from any port 0 >< 512 to any
+pass in proto udp from any port 0 >< 512 to any
+pass in proto tcp/udp from any port 0 >< 512 to any
+block in proto tcp from any port 6000 <> 6009 to any
+block in proto udp from any port 6000 <> 6009 to any
+block in proto tcp/udp from any port 6000 <> 6009 to any
+pass in proto tcp from any port 6000 <> 6009 to any
+pass in proto udp from any port 6000 <> 6009 to any
+pass in proto tcp/udp from any port 6000 <> 6009 to any
+pass in proto tcp from any port = 23 to any
+pass in proto udp from any port = 23 to any
+pass in proto tcp/udp from any port = 23 to any
+block in proto tcp from any port != 21 to any
+block in proto udp from any port != 21 to any
+block in proto tcp/udp from any port != 21 to any
+pass in proto tcp from any port != 21 to any
+pass in proto udp from any port != 21 to any
+pass in proto tcp/udp from any port != 21 to any
+block in proto tcp from any port < 1024 to any
+block in proto udp from any port < 1024 to any
+block in proto tcp/udp from any port < 1024 to any
+pass in proto tcp from any port < 1024 to any
+pass in proto udp from any port < 1024 to any
+pass in proto tcp/udp from any port < 1024 to any
+block in proto tcp from any port > 1023 to any
+block in proto udp from any port > 1023 to any
+block in proto tcp/udp from any port > 1023 to any
+pass in proto tcp from any port > 1023 to any
+pass in proto udp from any port > 1023 to any
+pass in proto tcp/udp from any port > 1023 to any
+block in proto tcp from any port <= 1023 to any
+block in proto udp from any port <= 1023 to any
+block in proto tcp/udp from any port <= 1023 to any
diff --git a/contrib/netbsd-tests/ipf/regress/f6 b/contrib/netbsd-tests/ipf/regress/f6
new file mode 100644
index 0000000..291f09ad
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f6
@@ -0,0 +1,48 @@
+block in proto tcp from any to any port = 23
+block in proto udp from any to any port = 23
+block in proto tcp/udp from any to any port = 23
+pass in proto tcp from any to any port <= 1023
+pass in proto udp from any to any port <= 1023
+pass in proto tcp/udp from any to any port <= 1023
+block in proto tcp from any to any port >= 1024
+block in proto udp from any to any port >= 1024
+block in proto tcp/udp from any to any port >= 1024
+pass in proto tcp from any to any port >= 1024
+pass in proto udp from any to any port >= 1024
+pass in proto tcp/udp from any to any port >= 1024
+block in proto tcp from any to any port 0 >< 512
+block in proto udp from any to any port 0 >< 512
+block in proto tcp/udp from any to any port 0 >< 512
+pass in proto tcp from any to any port 0 >< 512
+pass in proto udp from any to any port 0 >< 512
+pass in proto tcp/udp from any to any port 0 >< 512
+block in proto tcp from any to any port 6000 <> 6009
+block in proto udp from any to any port 6000 <> 6009
+block in proto tcp/udp from any to any port 6000 <> 6009
+pass in proto tcp from any to any port 6000 <> 6009
+pass in proto udp from any to any port 6000 <> 6009
+pass in proto tcp/udp from any to any port 6000 <> 6009
+pass in proto tcp from any to any port = 23
+pass in proto udp from any to any port = 23
+pass in proto tcp/udp from any to any port = 23
+block in proto tcp from any to any port != 21
+block in proto udp from any to any port != 21
+block in proto tcp/udp from any to any port != 21
+pass in proto tcp from any to any port != 21
+pass in proto udp from any to any port != 21
+pass in proto tcp/udp from any to any port != 21
+block in proto tcp from any to any port < 1024
+block in proto udp from any to any port < 1024
+block in proto tcp/udp from any to any port < 1024
+pass in proto tcp from any to any port < 1024
+pass in proto udp from any to any port < 1024
+pass in proto tcp/udp from any to any port < 1024
+block in proto tcp from any to any port > 1023
+block in proto udp from any to any port > 1023
+block in proto tcp/udp from any to any port > 1023
+pass in proto tcp from any to any port > 1023
+pass in proto udp from any to any port > 1023
+pass in proto tcp/udp from any to any port > 1023
+block in proto tcp from any to any port <= 1023
+block in proto udp from any to any port <= 1023
+block in proto tcp/udp from any to any port <= 1023
diff --git a/contrib/netbsd-tests/ipf/regress/f7 b/contrib/netbsd-tests/ipf/regress/f7
new file mode 100644
index 0000000..be1b969
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f7
@@ -0,0 +1,9 @@
+block in proto icmp from any to any icmp-type echo
+pass in proto icmp from any to any icmp-type echo
+block in proto icmp from any to any icmp-type unreach code 3
+pass in proto icmp from any to any icmp-type unreach code 3
+block in proto icmp from any to any icmp-type echorep
+pass in proto icmp from any to any icmp-type echorep
+pass in proto icmp all icmp-type maskreq keep state
+pass in proto icmp all icmp-type timest keep state
+pass in proto icmp all icmp-type inforeq keep state
diff --git a/contrib/netbsd-tests/ipf/regress/f8 b/contrib/netbsd-tests/ipf/regress/f8
new file mode 100644
index 0000000..0f28fd2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f8
@@ -0,0 +1,6 @@
+block in proto tcp from any to any flags S
+pass in proto tcp from any to any flags S
+block in proto tcp from any to any flags S/SA
+pass in proto tcp from any to any flags S/SA
+block in proto tcp from any to any flags S/APU
+pass in proto tcp from any to any flags S/APU
diff --git a/contrib/netbsd-tests/ipf/regress/f9 b/contrib/netbsd-tests/ipf/regress/f9
new file mode 100644
index 0000000..17bc967
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/f9
@@ -0,0 +1,18 @@
+block in from any to any with ipopts
+pass in from any to any with opt sec-class topsecret
+block in from any to any with opt ssrr,sec-class topsecret
+pass in from any to any with opt ssrr,sec-class topsecret
+block in from any to any with opt ts,sec-class topsecret
+pass in from any to any with opt ts,sec-class topsecret
+block in from any to any with opt sec-class secret
+pass in from any to any with opt sec-class secret
+block in from any to any with opt lsrr,ssrr
+pass in from any to any with opt lsrr,ssrr
+pass in from any to any with ipopts
+block in from any to any with opt lsrr
+pass in from any to any with opt lsrr
+block in from any to any with opt ssrr,ts
+pass in from any to any with opt ssrr,ts
+block in from any to any with opt rr
+pass in from any to any with opt rr
+block in from any to any with opt sec-class topsecret
diff --git a/contrib/netbsd-tests/ipf/regress/i1 b/contrib/netbsd-tests/ipf/regress/i1
new file mode 100644
index 0000000..0fd2c6e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i1
@@ -0,0 +1,18 @@
+pass in all
+block out \
+all
+log in all
+log body in all
+count in from any to any
+pass in from !any to any pps 10
+block in from any to !any
+pass in on ed0 from localhost to localhost
+pass in on ed0,vx0 from localhost to localhost
+block in log first on lo0 from any to any
+pass in log body or-block quick from any to any
+block return-rst in quick on le0 proto tcp from any to any
+block return-icmp in on qe0 from any to any
+block return-icmp(1) in on qe0 from any to any
+block return-icmp-as-dest in on le0 from any to any
+block return-icmp-as-dest(port-unr) in on qe0 from any to any
+pass out on longNICname0 from test.host.dots to test\.host.dots
diff --git a/contrib/netbsd-tests/ipf/regress/i10 b/contrib/netbsd-tests/ipf/regress/i10
new file mode 100644
index 0000000..640ac84
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i10
@@ -0,0 +1,5 @@
+pass in from localhost to localhost with opt sec
+pass in from localhost to localhost with opt lsrr not opt sec
+block in from any to any with not opt sec-class topsecret
+block in from any to any with not opt sec-class topsecret,secret
+pass in from any to any with opt sec-class topsecret,confid not opt sec-class unclass
diff --git a/contrib/netbsd-tests/ipf/regress/i11 b/contrib/netbsd-tests/ipf/regress/i11
new file mode 100644
index 0000000..ca65da3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i11
@@ -0,0 +1,12 @@
+pass in on ed0 proto tcp from localhost to localhost port = telnet keep state
+block in log first on lo0 proto tcp/udp from any to any port = echo keep state
+pass in proto udp from localhost to localhost port = 20499 keep frag
+pass in proto udp from localhost to localhost port = 2049 keep frag(strict)
+pass in proto udp from localhost to localhost port = 53 keep state keep frags
+pass in on ed0 out-via vx0 proto udp from any to any keep state
+pass out on ppp0 in-via le0 proto tcp from any to any keep state
+pass in on ed0,vx0 out-via vx0,ed0 proto udp from any to any keep state
+pass in proto tcp from any port gt 1024 to localhost port eq 1024 keep state
+pass in proto tcp all flags S keep state(strict,newisn,no-icmp-err,limit 101,age 600)
+pass in proto tcp all flags S keep state(loose,newisn,no-icmp-err,limit 101,age 600)
+pass in proto udp all keep state(age 10/20,sync)
diff --git a/contrib/netbsd-tests/ipf/regress/i12 b/contrib/netbsd-tests/ipf/regress/i12
new file mode 100644
index 0000000..f42c2d5
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i12
@@ -0,0 +1,10 @@
+pass in from 1.1.1.1/32 to 2.2.2.2/32
+pass in from {2.2.2.2/24,3.3.3.3/32} to 4.4.4.4/32
+pass in from {2.2.2.2/24,3.3.3.3/32} to {5.5.5.5/32,6.6.6.6/32}
+pass in from {2.2.2.2/24,3.3.3.3/32} to {5.5.5.5/32,6.6.6.6/32} port = {22,25}
+pass in proto tcp from {2.2.2.2/24,3.3.3.3/32} port = {53,9} to {5.5.5.5/32,6.6.6.6/32}
+pass in proto udp from {2.2.2.2/24,3.3.3.3/32} to {5.5.5.5/32,6.6.6.6/32} port = {53,9}
+pass in from 10.10.10.10 to 11.11.11.11
+pass in from pool/101 to hash/202
+pass in from hash/303 to pool/404
+pass in from pool=(!1.1.1.1,2.2.2.2,!2.2.0.0/16) to pool = ( 1.1.0.0/16 )
diff --git a/contrib/netbsd-tests/ipf/regress/i13 b/contrib/netbsd-tests/ipf/regress/i13
new file mode 100644
index 0000000..3ba343d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i13
@@ -0,0 +1,8 @@
+a=any;
+b="from $a";
+c='to $a';
+d=block;
+e="pass in";
+$d in $b $c
+f=" $b $c";
+$e${f}
diff --git a/contrib/netbsd-tests/ipf/regress/i14 b/contrib/netbsd-tests/ipf/regress/i14
new file mode 100644
index 0000000..6788af6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i14
@@ -0,0 +1,15 @@
+block in on eri0 all head 1
+pass in on eri0 proto icmp all group 1
+pass out on ed0 all head 1000000
+block out on ed0 proto udp all group 1000000
+block in on vm0 proto tcp/udp all head 101
+pass in from 1.1.1.1 to 2.2.2.2 group 101
+pass in proto tcp from 1.0.0.1 to 2.0.0.2 group 101
+pass in proto udp from 2.0.0.2 to 3.0.0.3 group 101
+block in on vm0 proto tcp/udp all head vm0-group
+pass in from 1.1.1.1 to 2.2.2.2 group vm0-group
+block in on vm0 proto tcp/udp all head vm0-group
+pass in from 1.1.1.1 to 2.2.2.2 group vm0-group
+pass in from 8f:: to f8::
+block in inet6 proto udp
+block in inet6
diff --git a/contrib/netbsd-tests/ipf/regress/i15 b/contrib/netbsd-tests/ipf/regress/i15
new file mode 100644
index 0000000..0e6b0d1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i15
@@ -0,0 +1,4 @@
+pass out on fxp0 all set-tag(log=100)
+pass out on fxp0 all set-tag(nat=foo)
+pass out on fxp0 all set-tag(log=100, nat=200)
+pass out on fxp0 all set-tag(log=2147483648, nat=overtherainbowisapotof)
diff --git a/contrib/netbsd-tests/ipf/regress/i16 b/contrib/netbsd-tests/ipf/regress/i16
new file mode 100644
index 0000000..5c9144a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i16
@@ -0,0 +1,3 @@
+0 block out all
+100 pass in all
+10101 pass out proto tcp all
diff --git a/contrib/netbsd-tests/ipf/regress/i17 b/contrib/netbsd-tests/ipf/regress/i17
new file mode 100644
index 0000000..139b86a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i17
@@ -0,0 +1,13 @@
+100 pass in all
+200 pass in proto tcp all
+110 pass in proto udp all
+110 pass in from localhost to any
+pass in all
+pass in from localhost to any
+@0 100 pass in from localhost to any
+@1 pass in from any to localhost
+@0 pass in from 1.1.1.1 to any
+@1 110 pass in from 2.2.2.2 to any
+@2 pass in from 3.3.3.3 to any
+call srcgrpmap/100 out from 10.1.0.0/16 to any
+call now dstgrpmap/200 in from 10.2.0.0/16 to any
diff --git a/contrib/netbsd-tests/ipf/regress/i18 b/contrib/netbsd-tests/ipf/regress/i18
new file mode 100644
index 0000000..b55b11a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i18
@@ -0,0 +1,3 @@
+pass in tos {80,0x80} all
+pass out tos {0x80,80} all
+block in ttl {0,1,2,3,4,5,6} all
diff --git a/contrib/netbsd-tests/ipf/regress/i19 b/contrib/netbsd-tests/ipf/regress/i19
new file mode 100644
index 0000000..a09fd56
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i19
@@ -0,0 +1,22 @@
+block in quick log level user.debug proto icmp all
+block in quick log level mail.info proto icmp all
+block in quick log level daemon.notice proto icmp all
+block in quick log level auth.warn proto icmp all
+block in quick log level syslog.err proto icmp all
+block in quick log level lpr.crit proto icmp all
+block in quick log level news.alert proto icmp all
+block in quick log level uucp.emerg proto icmp all
+block in quick log level cron.debug proto icmp all
+block in quick log level ftp.info proto icmp all
+block in quick log level authpriv.notice proto icmp all
+block in quick log level logalert.warn proto icmp all
+block in quick log level local0.err proto icmp all
+block in quick log level local1.crit proto icmp all
+block in quick log level local2.alert proto icmp all
+block in quick log level local3.emerg proto icmp all
+block in quick log level local4.debug proto icmp all
+block in quick log level local5.info proto icmp all
+block in quick log level local6.notice proto icmp all
+block in quick log level local7.warn proto icmp all
+block in quick log level kern.err proto icmp all
+block in quick log level security.emerg proto icmp all
diff --git a/contrib/netbsd-tests/ipf/regress/i2 b/contrib/netbsd-tests/ipf/regress/i2
new file mode 100644
index 0000000..f69e28e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i2
@@ -0,0 +1,9 @@
+log in proto tcp all
+pass in proto 6 from any to any
+pass in proto udp from localhost to localhost
+block in proto ipv6 from any to any
+block in proto 17 from any to any
+block in proto 250 from any to any
+pass in proto tcp/udp from any to any
+block in proto tcp-udp from any to any
+block in proto tcp-udp from any to any
diff --git a/contrib/netbsd-tests/ipf/regress/i20 b/contrib/netbsd-tests/ipf/regress/i20
new file mode 100644
index 0000000..99039ee
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i20
@@ -0,0 +1,4 @@
+pass in on ppp0 from ppp0/peer to ppp0/32
+block in on hme0 from any to hme0/broadcast
+pass in on bge0 from bge0/network to bge0/32
+block in on eri0 from any to eri0/netmasked
diff --git a/contrib/netbsd-tests/ipf/regress/i21 b/contrib/netbsd-tests/ipf/regress/i21
new file mode 100644
index 0000000..237f8fa
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i21
@@ -0,0 +1,7 @@
+pass in from port = 10101
+pass out from any to port != 22
+block in from port 20:21
+block out from any to port 10 <> 100
+pass out from any to port = {3,5,7,9}
+block in from port = {20,25}
+pass in from any port = {11:12, 21:22} to any port = {1:2, 4:5, 8:9}
diff --git a/contrib/netbsd-tests/ipf/regress/i22 b/contrib/netbsd-tests/ipf/regress/i22
new file mode 100644
index 0000000..1ac8d12
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i22
@@ -0,0 +1,5 @@
+pass in exp { "ip.src != 1.1.1.0/24; tcp.dport = 80;" }
+pass in exp { "ip.addr = 1.2.3.4,5.6.7.8;" }
+block out exp { "ip.dst= 127.0.0.0/8;" }
+block in exp { "udp.sport=53;udp.dport=53;" }
+pass out exp { "tcp.sport=22; tcp.port=25;" }
diff --git a/contrib/netbsd-tests/ipf/regress/i23 b/contrib/netbsd-tests/ipf/regress/i23
new file mode 100644
index 0000000..792d600
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i23
@@ -0,0 +1 @@
+#
diff --git a/contrib/netbsd-tests/ipf/regress/i3 b/contrib/netbsd-tests/ipf/regress/i3
new file mode 100644
index 0000000..390fc3c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i3
@@ -0,0 +1,14 @@
+log in all
+pass in from 128.16/16 to 129.10.10/24
+pass in from 128.0.0.1/24 to 1\
+28\
+.\
+0.0.1/16
+pass in from 128.0.0.1/0xffffff00 to 128.0.0.1/0xffff0000
+pass in from 128.0.0.1/255.255.255.0 to 128.0.0.1/255.255.0.0
+pass in from 128.0.0.1 mask 0xffffff00 to 128.0.0.1 mask 0xffff0000
+pass in from 128.0.0.1 mask 255.255.255.0 to 128.0.0.1 mask 255.255.0.0
+pass in from localhost to localhost
+block in log from 0/0 to 0/0
+block in log level auth.info on hme0 all
+log level local5.warn out all
diff --git a/contrib/netbsd-tests/ipf/regress/i4 b/contrib/netbsd-tests/ipf/regress/i4
new file mode 100644
index 0000000..8551f76
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i4
@@ -0,0 +1,9 @@
+log in proto tcp from any port > 0 to any
+log in proto tcp from any to any port > 0
+pass in proto 6 from any port != 0 to any port 0 >< 65535
+pass in proto 17 from localhost port > 32000 to localhost port < 29000
+block in proto udp from any port != \ntp to any port < echo
+block in proto tcp from any port = smtp to any port > 25
+pass in proto tcp/udp from any port 1 >< 3 to any port 1 <> 3
+pass in proto tcp/udp from any port 2:2 to any port 10:20
+pass in log first quick proto tcp from any port > 1023 to any port = 1723 flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/i5 b/contrib/netbsd-tests/ipf/regress/i5
new file mode 100644
index 0000000..788f971
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i5
@@ -0,0 +1,9 @@
+log in all
+count in tos 0x80 from any to any
+pass in on ed0 tos 64 from localhost to localhost
+block in log on lo0 ttl 0 from any to any
+pass in quick ttl 1 from any to any
+skip 3 out from 127.0.0.1 to any
+auth out on foo0 proto tcp from any to any port = 80
+preauth out on foo0 proto tcp from any to any port = 22
+nomatch out on foo0 proto tcp from any port < 1024 to any
diff --git a/contrib/netbsd-tests/ipf/regress/i6 b/contrib/netbsd-tests/ipf/regress/i6
new file mode 100644
index 0000000..0b371bd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i6
@@ -0,0 +1,12 @@
+pass in on lo0 fastroute from any to any
+pass in on lo0 to qe0 from localhost to localhost
+pass in on le0 to qe0:127.0.0.1 from localhost to localhost
+pass in on lo0 dup-to qe0 from localhost to localhost
+pass in on le0 dup-to qe0:127.0.0.1 from localhost to localhost
+pass in on le0 to hme0:10.1.1.1 dup-to qe0:127.0.0.1 from localhost to localhost
+block in quick on qe0 to qe1 from any to any
+block in quick to qe1 from any to any
+pass out quick dup-to hme0 from any to any
+pass out quick on hme0 reply-to hme1 from any to any
+pass in on le0 dup-to qe0:127.0.0.1 reply-to hme1:10.10.10.10 all
+pass in quick fastroute all
diff --git a/contrib/netbsd-tests/ipf/regress/i7 b/contrib/netbsd-tests/ipf/regress/i7
new file mode 100644
index 0000000..15b88a5
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i7
@@ -0,0 +1,14 @@
+pass in on ed0 proto tcp from localhost to localhost port = 23 flags S/SA
+block in on lo0 proto tcp from any to any flags A
+pass in on lo0 proto tcp from any to any flags /SAP
+block in on lo0 proto tcp from any to any flags 0x80/A
+pass in on lo0 proto tcp from any to any flags S/18
+block in on lo0 proto tcp from any to any flags 2/18
+pass in on lo0 proto tcp from any to any flags 2
+block in on lo0 proto tcp from any to any flags /16
+pass in on lo0 proto tcp from any to any flags 2/SA
+pass in on lo0 proto tcp from any to any flags S/18
+block in on lo0 proto tcp from any to any flags 2/18
+pass in on lo0 proto tcp from any to any flags 2
+block in on lo0 proto tcp from any to any flags /16
+pass in on lo0 proto tcp from any to any flags 2/SA
diff --git a/contrib/netbsd-tests/ipf/regress/i8 b/contrib/netbsd-tests/ipf/regress/i8
new file mode 100644
index 0000000..abf69d9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i8
@@ -0,0 +1,62 @@
+pass in proto icmp from localhost to localhost icmp-type timest
+block in proto icmp from any to any icmp-type unreach code 1
+pass in proto icmp all icmp-type unreach code cutoff-preced
+pass in proto icmp all icmp-type unreach code filter-prohib
+pass in proto icmp all icmp-type unreach code isolate
+pass in proto icmp all icmp-type unreach code needfrag
+pass in proto icmp all icmp-type unreach code net-prohib
+pass in proto icmp all icmp-type unreach code net-tos
+pass in proto icmp all icmp-type unreach code host-preced
+pass in proto icmp all icmp-type unreach code host-prohib
+pass in proto icmp all icmp-type unreach code host-tos
+pass in proto icmp all icmp-type unreach code host-unk
+pass in proto icmp all icmp-type unreach code host-unr
+pass in proto icmp all icmp-type unreach code {net-unk,net-unr}
+pass in proto icmp all icmp-type unreach code port-unr
+pass in proto icmp all icmp-type unreach code proto-unr
+pass in proto icmp all icmp-type unreach code srcfail
+pass in proto icmp all icmp-type {echo,echorep}
+pass in proto icmp all icmp-type inforeq
+pass in proto icmp all icmp-type inforep
+pass in proto icmp all icmp-type maskrep
+pass in proto icmp all icmp-type maskreq
+pass in proto icmp all icmp-type paramprob
+pass in proto icmp all icmp-type redir
+pass in proto icmp all icmp-type unreach
+pass in proto icmp all icmp-type routerad
+pass in proto icmp all icmp-type routersol
+pass in proto icmp all icmp-type squench
+pass in proto icmp all icmp-type timest
+pass in proto icmp all icmp-type timestrep
+pass in proto icmp all icmp-type timex
+pass in proto icmp all icmp-type 254
+pass in proto icmp all icmp-type 253 code 254
+pass in proto icmp all icmp-type unreach code cutoff-preced
+pass in proto icmp all icmp-type unreach code filter-prohib
+pass in proto icmp all icmp-type unreach code isolate
+pass in proto icmp all icmp-type unreach code needfrag
+pass in proto icmp all icmp-type unreach code net-prohib
+pass in proto icmp all icmp-type unreach code net-tos
+pass in proto icmp all icmp-type unreach code host-preced
+pass in proto icmp all icmp-type unreach code host-prohib
+pass in proto icmp all icmp-type unreach code host-tos
+pass in proto icmp all icmp-type unreach code host-unk
+pass in proto icmp all icmp-type unreach code host-unr
+pass in proto icmp all icmp-type unreach code {net-unk,net-unr}
+pass in proto icmp all icmp-type unreach code port-unr
+pass in proto icmp all icmp-type unreach code proto-unr
+pass in proto icmp all icmp-type unreach code srcfail
+pass in proto icmp all icmp-type {echo,echorep}
+pass in proto icmp all icmp-type inforeq
+pass in proto icmp all icmp-type inforep
+pass in proto icmp all icmp-type maskrep
+pass in proto icmp all icmp-type maskreq
+pass in proto icmp all icmp-type paramprob
+pass in proto icmp all icmp-type redir
+pass in proto icmp all icmp-type unreach
+pass in proto icmp all icmp-type routerad
+pass in proto icmp all icmp-type routersol
+pass in proto icmp all icmp-type squench
+pass in proto icmp all icmp-type timest
+pass in proto icmp all icmp-type timestrep
+pass in proto icmp all icmp-type timex
diff --git a/contrib/netbsd-tests/ipf/regress/i9 b/contrib/netbsd-tests/ipf/regress/i9
new file mode 100644
index 0000000..441cfa9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/i9
@@ -0,0 +1,17 @@
+pass in from localhost to localhost with short,frags
+block in from any to any with ipopts
+pass in from any to any with opt nop,rr,zsu
+pass in from any to any with opt nop,rr,zsu not opt ssrr,lsrr
+pass in from localhost to localhost and not frag
+pass in from localhost to localhost with frags,frag-body
+pass in proto tcp all flags S with not oow keep state
+block in proto tcp all with oow
+pass in proto tcp all flags S with not bad,bad-src,bad-nat
+block in proto tcp all flags S with bad,not bad-src,not bad-nat
+pass in quick all with not short
+block in quick all with not nat
+pass in quick all with not frag-body
+block in quick all with not lowttl
+pass in all with mbcast,not bcast,multicast,not state,not ipopts
+block in all with not mbcast,bcast,not multicast,state
+pass in from any to any with opt mtur,mtup,encode,ts,tr,sec,cipso,satid,ssrr,visa,imitd,eip,finn,dps,sdb,nsapa,rtralrt,ump,addext,e-sec
diff --git a/contrib/netbsd-tests/ipf/regress/in1 b/contrib/netbsd-tests/ipf/regress/in1
new file mode 100644
index 0000000..d5d0cf4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in1
@@ -0,0 +1,31 @@
+map le0 0/0 -> 0/32
+map le0 1/32 -> 1/32
+map le0 128.0.0.0/1 -> 0/0
+map le0 10.0.0.0/8 -> 1.2.3.0/24
+map le0 10.0.0.5/8 -> 1.2.3.4/24
+map le0 10.0.0.5/0xff000000 -> 1.2.3.4/24
+map le0 10.0.0.5/0xff -> 1.2.3.4/24
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999
+map ppp0 192.168.0.0/16 -> 0/32 portmap udp 20000:29999
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp/udp 30000:39999
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp auto
+map ppp0 192.168.0.0/16 -> 0/32 portmap udp auto
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcpudp auto
+map ppp0 192.168.0.0/16 -> 0/32 proxy port ftp ftp/6
+map ppp0 192.168.0.0/16 -> 0/32 proxy port 1010 ftp/tcp
+map le0 0/0 -> 0/32 frag
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 frag
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 frag
+map ppp0 192.168.0.0/16 -> 0/32 proxy port ftp ftp/tcp frag
+map le0 0/0 -> 0/32 age 10
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 age 10/20
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 age 30
+map le0 0/0 -> 0/32 frag age 10
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 frag age 10/20
+map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 frag age 30
+map fxp0 from 192.168.0.0/18 to 0/0 port = 21 -> 1.2.3.4/32 proxy port 21 ftp/tcp
+map thisisalonginte 0/0 -> 0/32 mssclamp 1452 tag freddyliveshere
+map bar0 0/0 -> 0/32 icmpidmap icmp 1000:2000
+map ppp0,adsl0 0/0 -> 0/32
+map ppp0 from 192.168.0.0/16 to any port = 123 -> 0/32 age 30/1 udp
diff --git a/contrib/netbsd-tests/ipf/regress/in100 b/contrib/netbsd-tests/ipf/regress/in100
new file mode 100644
index 0000000..5e2ab6c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in100
@@ -0,0 +1,3 @@
+rewrite in on bge0 from 1.1.1.1 to 2.2.2.2 -> src 3.3.3.3 dst 4.4.4.4;
+rewrite out on bge0 from 1.1.1.1/32 to 2.2.2.2 -> src 3.3.3.0/24 dst 4.4.4.4;
+rewrite in on bge0 from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.0/24 dst 4.4.4.0/24;
diff --git a/contrib/netbsd-tests/ipf/regress/in100_6 b/contrib/netbsd-tests/ipf/regress/in100_6
new file mode 100644
index 0000000..533e2dd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in100_6
@@ -0,0 +1,3 @@
+rewrite in on bge0 inet6 from 1:1:1::1 to 2:2::2:2 -> src 3:3:3::3 dst 4::4:4:4;
+rewrite out on bge0 inet6 from 1:1:1::1/128 to 2:2::2:2 -> src 3:3:3::0/96 dst 4::4:4:4;
+rewrite in on bge0 inet6 from 1:1:1::1/128 to 2:2::2:2/128 -> src 3:3:3::0/96 dst 4::4:4:4/96;
diff --git a/contrib/netbsd-tests/ipf/regress/in101 b/contrib/netbsd-tests/ipf/regress/in101
new file mode 100644
index 0000000..afef53b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in101
@@ -0,0 +1,4 @@
+rewrite in on bge0 proto icmp from 1.1.1.1 to 2.2.2.2 -> src 3.3.3.3 dst 4.4.4.4;
+rewrite in on bge0 proto udp from 1.1.1.1 to 2.2.2.2 -> src 3.3.3.3 dst 4.4.4.4;
+rewrite out on bge0 proto tcp from 1.1.1.1/32 to 2.2.2.2 -> src 3.3.3.0/24 dst 4.4.4.4;
+rewrite in on bge0 proto tcp/udp from 1.1.1.1/32 to 2.2.2.2/32 -> src 3.3.3.0/24,20202 dst 4.4.4.0/24,10101;
diff --git a/contrib/netbsd-tests/ipf/regress/in101_6 b/contrib/netbsd-tests/ipf/regress/in101_6
new file mode 100644
index 0000000..bb4af3d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in101_6
@@ -0,0 +1,4 @@
+rewrite in on bge0 proto icmp from 1:1:1::1 to 2:2::2:2 -> src 3:3:3::3 dst 4::4:4:4;
+rewrite in on bge0 proto udp from 1:1:1::1 to 2:2::2:2 -> src 3:3:3::3 dst 4::4:4:4;
+rewrite out on bge0 proto tcp from 1:1:1::1/128 to 2:2::2:2 -> src 3:3:3::0/24 dst 4::4:4:4;
+rewrite in on bge0 proto tcp/udp from 1:1:1::1/128 to 2:2::2:2/32 -> src 3:3:3::0/24,20202 dst 4::4:4:4/24,10101;
diff --git a/contrib/netbsd-tests/ipf/regress/in102 b/contrib/netbsd-tests/ipf/regress/in102
new file mode 100644
index 0000000..57f3645
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in102
@@ -0,0 +1,5 @@
+rewrite in on bge0 proto tcp from any to any -> src 0/0 dst dstlist/a;
+rewrite in on bge0 proto tcp from 1.1.1.1 to any -> src 0/0 dst dstlist/bee;
+rewrite in on bge0 proto tcp from 1.1.1.1 to 2.2.2.2 -> src 0/0 dst dstlist/cat;
+rewrite in on bge0 proto tcp from pool/a to 2.2.2.2 -> src 0/0 dst dstlist/bat;
+rewrite in on bge0 proto tcp from pool/a to pool/1 -> src 0/0 dst dstlist/ant;
diff --git a/contrib/netbsd-tests/ipf/regress/in102_6 b/contrib/netbsd-tests/ipf/regress/in102_6
new file mode 100644
index 0000000..e11906d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in102_6
@@ -0,0 +1,5 @@
+rewrite in on bge0 inet6 proto tcp from any to any -> src 0/0 dst dstlist/a;
+rewrite in on bge0 inet6 proto tcp from 1:1:1::1 to any -> src 0/0 dst dstlist/bee;
+rewrite in on bge0 inet6 proto tcp from 1:1:1::1 to 2:2::2:2 -> src 0/0 dst dstlist/cat;
+rewrite in on bge0 inet6 proto tcp from pool/a to 2:2::2:2 -> src 0/0 dst dstlist/bat;
+rewrite in on bge0 inet6 proto tcp from pool/a to pool/1 -> src 0/0 dst dstlist/ant;
diff --git a/contrib/netbsd-tests/ipf/regress/in1_6 b/contrib/netbsd-tests/ipf/regress/in1_6
new file mode 100644
index 0000000..e5050f8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in1_6
@@ -0,0 +1,29 @@
+map le0 inet6 0/0 -> 0/128
+map le0 inet6 1/128 -> 1/128
+map le0 inet6 128::/1 -> 0/0
+map le0 inet6 10::0/16 -> 1:2:3::0/96
+map le0 inet6 10::5/16 -> 1:2:3::4/96
+map le0 inet6 192:168::/32 -> range 203:1:1::23-203:1:3::45
+map ppp0 inet6 192:168::/32 -> 0/128 portmap tcp 10000:19999
+map ppp0 inet6 192:168::/32 -> 0/128 portmap udp 20000:29999
+map ppp0 inet6 192:168::/32 -> 0/128 portmap tcp/udp 30000:39999
+map ppp0 inet6 192:168::/32 -> 0/128 portmap tcp auto
+map ppp0 inet6 192:168::/32 -> 0/128 portmap udp auto
+map ppp0 inet6 192:168::/32 -> 0/128 portmap tcpudp auto
+map ppp0 inet6 192:168::/32 -> 0/128 proxy port ftp ftp/6
+map ppp0 inet6 192:168::/32 -> 0/128 proxy port 1010 ftp/tcp
+map le0 inet6 0/0 -> 0/128 frag
+map le0 inet6 192:168::/32 -> range 203:1:1::23-203:1:3::45 frag
+map ppp0 inet6 192:168::/32 -> 0/128 portmap tcp 10000:19999 frag
+map ppp0 inet6 192:168::/32 -> 0/128 proxy port ftp ftp/tcp frag
+map le0 inet6 0/0 -> 0/128 age 10
+map le0 inet6 192:168::/32 -> range 203:1:1::23-203:1:3::45 age 10/20
+map ppp0 inet6 192:168::/32 -> 0/128 portmap tcp 10000:19999 age 30
+map le0 inet6 0/0 -> 0/128 frag age 10
+map le0 inet6 192:168::/32 -> range 203:1:1::23-203:1:3::45 frag age 10/20
+map ppp0 inet6 192:168::/32 -> 0/128 portmap tcp 10000:19999 frag age 30
+map fxp0 inet6 from 192:168::/18 to 0/0 port = 21 -> 1:2:3::4/128 proxy port 21 ftp/tcp
+map thisisalonginte inet6 0/0 -> 0/128 mssclamp 1452 tag freddyliveshere
+map bar0 inet6 0/0 -> 0/128 icmpidmap ipv6-icmp 1000:2000
+map ppp0,adsl0 inet6 0/0 -> 0/128
+map ppp0 inet6 from 192:168::/32 to any port = 123 -> 0/128 age 30/1 udp
diff --git a/contrib/netbsd-tests/ipf/regress/in2 b/contrib/netbsd-tests/ipf/regress/in2
new file mode 100644
index 0000000..58556c0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in2
@@ -0,0 +1,71 @@
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 tcp
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 255
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp
+rdr le0 9.8.7.6/32 -> 1.1.1.1 ip
+rdr le0 9.8.7.6/0xff000000 -> 1.1.1.1 ip
+rdr le0 9.8.7.6/0xffff0000 -> 1.1.1.1 ip
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp
+rdr le0 9.8.7.6/32 port 80 -> 0/0 port 80 tcp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 udp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp/udp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcpudp frag
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag
+rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10/20
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag age 10
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip sticky
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10 sticky
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10/20 sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag age 10 sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20 sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30 sticky
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40 sticky
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip mssclamp 1000
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10/20 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag age 10 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40 sticky mssclamp 1000
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip tag nattagcacheline
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10/20 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag age 10 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40 sticky mssclamp 1000 tag nattagcacheline
+rdr ge0 9.8.7.6/32 -> 1.1.1.1 proxy port 21 ftp/tcp
+rdr ge0 9.8.7.6/32 port 21 -> 1.1.1.1 port 21 tcp proxy ftp
+rdr le0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1 port 5555 tcp
+rdr le0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1 port = 5555 tcp
+rdr le0 0/0 -> test.host.dots
+rdr le0 any -> test.host.dots,test.host.dots
+rdr adsl0,ppp0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1 port 5555-7777 tcp
diff --git a/contrib/netbsd-tests/ipf/regress/in2_6 b/contrib/netbsd-tests/ipf/regress/in2_6
new file mode 100644
index 0000000..1ee1f06
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in2_6
@@ -0,0 +1,71 @@
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 tcp
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 255
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1 ip
+rdr le0 inet6 9:8:7::6/32 -> 1:1:1::1 ip
+rdr le0 inet6 9:8:7::6/64 -> 1:1:1::1 ip
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 0/0 port 80 tcp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 udp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp/udp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp frag
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcpudp frag
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin frag
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag
+rdr le0 inet6 9:8:7::6/128 -> 1:1:1::1 ip frag age 10
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag age 10/20
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp frag age 10
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag age 20
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin frag age 30
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag age 40
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip sticky
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp frag sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin frag sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag sticky
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag age 10 sticky
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag age 10/20 sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp frag age 10 sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag age 20 sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin frag age 30 sticky
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag age 40 sticky
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp frag sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin frag sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag age 10 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag age 10/20 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp frag age 10 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag age 20 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin frag age 30 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag age 40 sticky mssclamp 1000
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag age 10 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 0 -> 1:1:1::1 port 0 ip frag age 10/20 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 icmp frag age 10 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp frag age 20 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1 port 80 tcp round-robin frag age 30 sticky mssclamp 1000 tag nattagcacheline
+rdr le0 inet6 9:8:7::6/128 port 80 -> 1:1:1::1,1:1:1::2 port 80 tcp round-robin frag age 40 sticky mssclamp 1000 tag nattagcacheline
+rdr ge0 9:8:7::6/128 -> 1:1:1::1 proxy port 21 ftp/tcp
+rdr ge0 9:8:7::6/128 port 21 -> 1:1:1::1 port 21 tcp proxy ftp
+rdr le0 inet6 9:8:7::6/128 port 1000-2000 -> 1:1:1::1 port 5555 tcp
+rdr le0 inet6 9:8:7::6/128 port 1000-2000 -> 1:1:1::1 port = 5555 tcp
+rdr le0 inet6 0/0 -> test.host.dots
+rdr le0 inet6 any -> test.host.dots,test.host.dots
+rdr adsl0,ppp0 9:8:7::6/128 port 1000-2000 -> 1:1:1::1 port 5555-7777 tcp
diff --git a/contrib/netbsd-tests/ipf/regress/in3 b/contrib/netbsd-tests/ipf/regress/in3
new file mode 100644
index 0000000..d8016b6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in3
@@ -0,0 +1,5 @@
+bimap le0 0/0 -> 0/32
+bimap le0 1/32 -> 1/32
+bimap le0 128.0.0.0/1 -> 0/0
+bimap le0 10.0.0.0/8 -> 1.2.3.0/24
+bimap le0 10.0.5.6/24 -> 1.2.3.4/24
diff --git a/contrib/netbsd-tests/ipf/regress/in3_6 b/contrib/netbsd-tests/ipf/regress/in3_6
new file mode 100644
index 0000000..a82ff09
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in3_6
@@ -0,0 +1,5 @@
+bimap le0 inet6 0/0 -> 0/128
+bimap le0 inet6 1/128 -> 1/128
+bimap le0 inet6 128::/1 -> 0/0
+bimap le0 inet6 10::/16 -> 1:2:3::0/96
+bimap le0 inet6 10:0:5::6/96 -> 1:2:3::4/96
diff --git a/contrib/netbsd-tests/ipf/regress/in4 b/contrib/netbsd-tests/ipf/regress/in4
new file mode 100644
index 0000000..46bbd81
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in4
@@ -0,0 +1,5 @@
+map-block le0 10.0.0.0/24 -> 203.1.1.0/24
+map-block le0 10.0.0.0/24 -> 203.1.1.0/24 ports 0
+map-block le0 10.0.0.0/24 -> 203.1.1.0/24 ports 256
+map-block le0 10.0.0.0/24 -> 203.1.1.0/24 ports auto
+map-block le0 10.0.0.0/16 -> 203.1.1.0/24 ports auto
diff --git a/contrib/netbsd-tests/ipf/regress/in4_6 b/contrib/netbsd-tests/ipf/regress/in4_6
new file mode 100644
index 0000000..b6b78c0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in4_6
@@ -0,0 +1,5 @@
+map-block le0 inet6 10::/96 -> 203:1:1::/96
+map-block le0 inet6 10::/96 -> 203:1:1::/96 ports 0
+map-block le0 inet6 10::/96 -> 203:1:1::/96 ports 256
+map-block le0 inet6 10::/96 -> 203:1:1::/96 ports auto
+map-block le0 inet6 10::/16 -> 203:1:1::/96 ports auto
diff --git a/contrib/netbsd-tests/ipf/regress/in5 b/contrib/netbsd-tests/ipf/regress/in5
new file mode 100644
index 0000000..766c3e3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in5
@@ -0,0 +1,24 @@
+map le0 from 9.8.7.6/32 port > 1024 to any -> 1.1.1.1 portmap 10000:20000 tcp
+map le0 from 9.8.7.6/32 port > 1024 to ! 1.2.3.4 -> 1.1.1.1 portmap 10000:20000 tcp
+rdr le0 from any to 9.8.7.6/32 port = 0 -> 1.1.1.1 port 0 tcp
+rdr le0 from any to 9.8.7.6/0xffffffff port = 0 -> 1.1.1.1 port 0 ip
+rdr le0 ! from 1.2.3.4 to 9.8.7.6 port = 8888 -> 1.1.1.1 port 888 tcp
+rdr le0 from any to 9.8.7.6/255.255.255.255 port = 8888 -> 1.1.1.1 port 888 ip
+rdr le0 from any to 9.8.7.6 mask 0xffffffff port = 8888 -> 1.1.1.1 port 888 tcp
+rdr le0 from any to 9.8.7.6 mask 255.255.255.255 port = 8888 -> 1.1.1.1 port 888 udp
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp/udp
+rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 port 888 icmp
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin
+rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 port 0 ip frag
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 icmp frag
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp frag
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin frag
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin frag
+rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 port 0 ip frag age 10
+rdr le0 from any to 9.8.7.6/32 port = 0 -> 1.1.1.1 port 0 ip frag age 10/20
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 icmp frag age 10
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp frag age 20
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin frag age 30
+rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin frag age 40
diff --git a/contrib/netbsd-tests/ipf/regress/in5_6 b/contrib/netbsd-tests/ipf/regress/in5_6
new file mode 100644
index 0000000..f39d819
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in5_6
@@ -0,0 +1,24 @@
+map le0 inet6 from 9:8:7::6/128 port > 1024 to any -> 1:1:1::1 portmap 10000:20000 tcp
+map le0 inet6 from 9:8:7::6/128 port > 1024 to ! 1:2:3::4 -> 1:1:1::1 portmap 10000:20000 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 0 -> 1:1:1::1 port 0 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 0 -> 1:1:1::1 port 0 ip
+rdr le0 inet6 ! from 1:2:3::4 to 9:8:7::6 port = 8888 -> 1:1:1::1 port 888 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 ip
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 udp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 tcp/udp
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1 port 888 icmp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 tcp round-robin
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp round-robin
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1 port 0 ip frag
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 icmp frag
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp frag
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 tcp round-robin frag
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp round-robin frag
+rdr le0 inet6 from any to 9:8:7::6/128 -> 1:1:1::1 port 0 ip frag age 10
+rdr le0 inet6 from any to 9:8:7::6/128 port = 0 -> 1:1:1::1 port 0 ip frag age 10/20
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 icmp frag age 10
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp frag age 20
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1 port 888 tcp round-robin frag age 30
+rdr le0 inet6 from any to 9:8:7::6/128 port = 8888 -> 1:1:1::1,1:1:1::2 port 888 tcp round-robin frag age 40
diff --git a/contrib/netbsd-tests/ipf/regress/in6 b/contrib/netbsd-tests/ipf/regress/in6
new file mode 100644
index 0000000..70e71dd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in6
@@ -0,0 +1,8 @@
+map foo0 from any port = 1 to any port != 0 -> 0/32 udp
+map foo0 from any port eq 1 to any port ne 0 -> 0/32 udp
+map foo0 from any port < 1 to any port > 0 -> 0/32 tcp
+map foo0 from any port lt 1 to any port gt 0 -> 0/32 tcp
+map foo0 from any port <= 1 to any port >= 0 -> 0/32 tcp/udp
+map foo0 from any port le 1 to any port ge 0 -> 0/32 tcp/udp
+map foo0 from any port 1 >< 20 to any port 20 <> 40 -> 0/32 tcp/udp
+map foo0 from any port 10:20 to any port 30:40 -> 0/32 tcp/udp
diff --git a/contrib/netbsd-tests/ipf/regress/in6_6 b/contrib/netbsd-tests/ipf/regress/in6_6
new file mode 100644
index 0000000..556015d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in6_6
@@ -0,0 +1,8 @@
+map foo0 inet6 from any port = 1 to any port != 0 -> 0/32 udp
+map foo0 inet6 from any port eq 1 to any port ne 0 -> 0/32 udp
+map foo0 inet6 from any port < 1 to any port > 0 -> 0/32 tcp
+map foo0 inet6 from any port lt 1 to any port gt 0 -> 0/32 tcp
+map foo0 inet6 from any port <= 1 to any port >= 0 -> 0/32 tcp/udp
+map foo0 inet6 from any port le 1 to any port ge 0 -> 0/32 tcp/udp
+map foo0 inet6 from any port 1 >< 20 to any port 20 <> 40 -> 0/32 tcp/udp
+map foo0 inet6 from any port 10:20 to any port 30:40 -> 0/32 tcp/udp
diff --git a/contrib/netbsd-tests/ipf/regress/in7 b/contrib/netbsd-tests/ipf/regress/in7
new file mode 100644
index 0000000..792d600
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in7
@@ -0,0 +1 @@
+#
diff --git a/contrib/netbsd-tests/ipf/regress/in8_6 b/contrib/netbsd-tests/ipf/regress/in8_6
new file mode 100644
index 0000000..ab23b84
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/in8_6
@@ -0,0 +1,6 @@
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 tcp purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 mssclamp 1000 purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 portmap tcp/udp 10000:11000 purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 portmap tcp/udp 10000:11000 sequential purge
+map zx0 inet6 10:1::1:1/128 -> 10:2:2::2/128 portmap tcp/udp 10000:11000 sequential purge
diff --git a/contrib/netbsd-tests/ipf/regress/ip1 b/contrib/netbsd-tests/ipf/regress/ip1
new file mode 100644
index 0000000..c31ba25
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ip1
@@ -0,0 +1,78 @@
+#:%s/ \(number = [0-9]*\) \(type = [a-z]*\)/ \2 \1/g
+
+table role = ipf type = tree number = 1
+ {; };
+table role = ipf type = tree number = 100
+ { 1.2.3.4/32; !2.2.0.0/16; 2.2.2.0/24; };
+table role = nat type = tree number = 110
+ { 1.2.3.4/32; !2.2.0.0/16; 2.2.2.0/24; };
+table role = auth type = tree number = 120
+ { 1.2.3.4/32; !2.2.0.0/16; 2.2.2.0/24; };
+table role = count type = tree number = 130
+ { 1.2.3.4; !2.2.0.0/16; 2.2.2.0/24; };
+
+table role = ipf type = hash number = 2
+ {; };
+table role = ipf type = hash number = 200
+ { 0/0; 1/32; 1.2.3.4/32; };
+table role = nat type = hash number = 210
+ { 0/0; 2/32; 1.2.3.4/32; };
+table role = auth type = hash number = 220
+ { 0/0; 3/32; 1.2.3.4/32; };
+table role = count type = hash number = 230
+ { 0/0; 4/32; 1.2.3.4/32; };
+
+table role = ipf type = hash number = 240 seed = 101
+ { 0/0; 1/32; 1.2.3.4/32; };
+table role = nat type = hash number = 250 seed = 101
+ { 0/0; 2/32; 1.2.3.4/32; };
+table role = auth type = hash number = 260 seed = 101
+ { 0/0; 3/32; 1.2.3.4/32; };
+table role = count type = hash number = 270 seed = 101
+ { 0/0; 4/32; 1.2.3.4/32; };
+
+table role = ipf type = hash number = 2000 size = 1001
+ { 0/0; 1/32; 1.2.3.4/32; };
+table role = nat type = hash number = 2000 size = 1001
+ { 0/0; 2/32; 1.2.3.4/32; };
+table role = auth type = hash number = 2000 size = 1001
+ { 0/0; 3/32; 1.2.3.4/32; };
+table role = count type = hash number = 2000 size = 1001
+ { 0/0; 4/32; 1.2.3.4/32; };
+
+table role = ipf type = hash number = 100 size = 1001 seed = 101
+ { 0/0; 1/32; 1.2.3.4/32; };
+table role = nat type = hash number = 100 size = 1001 seed = 101
+ { 0/0; 2/32; 1.2.3.4/32; };
+table role = auth type = hash number = 100 size = 1001 seed = 101
+ { 0/0; 3/32; 1.2.3.4/32; };
+table role = count type = hash number = 100 size = 1001 seed = 101
+ { 0/0; 4/32; 1.2.3.4/32; };
+
+group-map in role = ipf number = 300 group = 303
+ { 0/0; 5/32; 1.2.3.4/32; };
+group-map in role = nat number = 300 group = 303
+ { 0/0; 6/32; 1.2.3.4/32; };
+group-map in role = auth number = 300 group = 303
+ { 0/0; 7/32; 1.2.3.4/32; };
+group-map in role = count number = 300 group = 303
+ { 0/0; 8/32; 1.2.3.4/32; };
+
+group-map out role = ipf number = 400 group = 303
+ { 0/0; 5/32; 1.2.3.4/32, group = 606; };
+group-map out role = nat number = 400 group = 303
+ { 0/0; 6/32; 1.2.3.4/32, group = 606; };
+group-map out role = auth number = 400 group = 303
+ { 0/0; 7/32; 1.2.3.4/32, group = 606; };
+group-map out role = count number = 400 group = 303
+ { 0/0; 8/32; 1.2.3.4/32, group = 606; };
+
+group-map in role = ipf number = 500
+ { 0/0, group = 10; 5/32, group = 800; 1.2.3.4/32, group = 606; };
+group-map in role = nat number = 500
+ { 0/0, group = 10; 6/32, group = 800; 1.2.3.4/32, group = 606; };
+group-map in role = auth number = 500
+ { 0/0, group = 10; 7/32, group = 800; 1.2.3.4/32, group = 606; };
+group-map in role = count number = 500
+ { 0/0, group = 10; 8/32, group = 800; 1.2.3.4/32, group = 606; };
+
diff --git a/contrib/netbsd-tests/ipf/regress/ip2 b/contrib/netbsd-tests/ipf/regress/ip2
new file mode 100644
index 0000000..76f31b6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ip2
@@ -0,0 +1,2 @@
+table role = ipf type = tree name = letters
+ { "file://input/ip2.data"; };
diff --git a/contrib/netbsd-tests/ipf/regress/ip3 b/contrib/netbsd-tests/ipf/regress/ip3
new file mode 100644
index 0000000..98d2b0b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ip3
@@ -0,0 +1,14 @@
+pool ipf/dstlist (name fred; policy round-robin;)
+ { 3.3.3.3; };
+pool ipf/dstlist (name jack; policy weighted connection;)
+ { 4.4.4.4; bge0:5.5.5.5;};
+pool ipf/dstlist (name jill; policy random;)
+ { 1.1.1.1; bge0:2.2.2.2;};
+pool nat/hash (name noproxy; size 17;)
+ { 1.1.1.1; 2.2.2.2;};
+pool nat/tree (name raw;)
+ { 1.1.1.1; 2.2.2.2;};
+pool all/dstlist (name jill; policy random;)
+ { 1.1.1.1; bge0:2.2.2.2;};
+pool all/hash (name noproxy; size 17;)
+ { 1.1.1.1; 2.2.2.2;};
diff --git a/contrib/netbsd-tests/ipf/regress/ipv6.1 b/contrib/netbsd-tests/ipf/regress/ipv6.1
new file mode 100644
index 0000000..fc532b6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ipv6.1
@@ -0,0 +1 @@
+pass out log quick on gif0 proto udp from ef00:1001:2002::/48 to any port 33433 >< 34000 keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ipv6.2 b/contrib/netbsd-tests/ipf/regress/ipv6.2
new file mode 100644
index 0000000..814dfd6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ipv6.2
@@ -0,0 +1,3 @@
+block in all
+block out all
+pass out proto 58 all keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ipv6.3 b/contrib/netbsd-tests/ipf/regress/ipv6.3
new file mode 100644
index 0000000..6dc9e93
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ipv6.3
@@ -0,0 +1 @@
+pass out log quick on gif0 proto ipv6-icmp from any to any icmp-type 128 keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ipv6.4 b/contrib/netbsd-tests/ipf/regress/ipv6.4
new file mode 100644
index 0000000..b221744
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ipv6.4
@@ -0,0 +1,3 @@
+pass in proto ipv6-icmp all icmp-type echo keep frags
+pass in proto ipv6-icmp all icmp-type echo keep frags keep state
+pass in proto tcp all keep frags keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ipv6.5 b/contrib/netbsd-tests/ipf/regress/ipv6.5
new file mode 100644
index 0000000..d9ae23b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ipv6.5
@@ -0,0 +1,2 @@
+pass out family inet6 all with v6hdr routing
+block out family inet6 proto tcp all with v6hdr routing
diff --git a/contrib/netbsd-tests/ipf/regress/ipv6.6 b/contrib/netbsd-tests/ipf/regress/ipv6.6
new file mode 100644
index 0000000..19a4df9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ipv6.6
@@ -0,0 +1,2 @@
+pass out on gif0 proto udp all keep frag
+block out all with bad
diff --git a/contrib/netbsd-tests/ipf/regress/l1 b/contrib/netbsd-tests/ipf/regress/l1
new file mode 100644
index 0000000..88cca58
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/l1
@@ -0,0 +1,6 @@
+log in all
+pass in on anon0 all head 100
+pass in log quick from 3.3.3.3 to any group 100
+pass in log body quick from 2.2.2.2 to any
+pass in log quick proto tcp from 1.1.1.1 to any flags S keep state
+pass in log first quick proto tcp from 1.1.1.1 to any flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/n1 b/contrib/netbsd-tests/ipf/regress/n1
new file mode 100644
index 0000000..9bcf29b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n1
@@ -0,0 +1,3 @@
+map zx0 10.1.1.1/32 -> 10.2.2.2/32
+map zx0 10.1.1.0/24 -> 10.3.4.5/32
+map zx0 10.1.1.0/24 -> 10.3.4.0/24
diff --git a/contrib/netbsd-tests/ipf/regress/n10 b/contrib/netbsd-tests/ipf/regress/n10
new file mode 100644
index 0000000..0f48192
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n10
@@ -0,0 +1,3 @@
+map ppp0 0/0 -> 203.203.203.203/32 mssclamp 100
+map ppp0 0/0 -> 203.203.203.203/32 mssclamp 1000
+map ppp0 0/0 -> 203.203.203.203/32 mssclamp 10000
diff --git a/contrib/netbsd-tests/ipf/regress/n100 b/contrib/netbsd-tests/ipf/regress/n100
new file mode 100644
index 0000000..a8b6dee
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n100
@@ -0,0 +1 @@
+rewrite out on zx0 from 0/0 to 2.2.0.0/16 -> src 4.4.4.4/32 dst 6.6.0.0/16;
diff --git a/contrib/netbsd-tests/ipf/regress/n101 b/contrib/netbsd-tests/ipf/regress/n101
new file mode 100644
index 0000000..2f5fcd9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n101
@@ -0,0 +1 @@
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 -> src 4.4.4.4/32 dst 6.6.0.0/16;
diff --git a/contrib/netbsd-tests/ipf/regress/n102 b/contrib/netbsd-tests/ipf/regress/n102
new file mode 100644
index 0000000..f056633
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n102
@@ -0,0 +1 @@
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 -> src 4.4.4.4/32,1000:2000 dst 6.6.0.0/16;
diff --git a/contrib/netbsd-tests/ipf/regress/n103 b/contrib/netbsd-tests/ipf/regress/n103
new file mode 100644
index 0000000..c3c27d6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n103
@@ -0,0 +1 @@
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 -> src 4.4.4.4/32,1000-1001 dst 6.6.0.0/16,4000:4001;
diff --git a/contrib/netbsd-tests/ipf/regress/n104 b/contrib/netbsd-tests/ipf/regress/n104
new file mode 100644
index 0000000..785f0ad
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n104
@@ -0,0 +1 @@
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 -> src 4.4.0.0/24,1000-1001 dst 6.6.0.0/16,4000:4001;
diff --git a/contrib/netbsd-tests/ipf/regress/n105 b/contrib/netbsd-tests/ipf/regress/n105
new file mode 100644
index 0000000..afe8966
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n105
@@ -0,0 +1 @@
+rewrite in on zx0 proto tcp from 0/0 to 2.2.0.0/16 port = 80 -> src 4.4.4.4/32,1000-1001 dst 6.6.0.0/16 port = 3128;
diff --git a/contrib/netbsd-tests/ipf/regress/n106 b/contrib/netbsd-tests/ipf/regress/n106
new file mode 100644
index 0000000..6074ab0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n106
@@ -0,0 +1 @@
+rewrite out on zx0 proto tcp from 0/0 to 2.2.0.0/16 port = 80 -> src 4.4.4.4/32,1000-1001 dst 6.6.0.0/16 port = 3128;
diff --git a/contrib/netbsd-tests/ipf/regress/n10_6 b/contrib/netbsd-tests/ipf/regress/n10_6
new file mode 100644
index 0000000..738152d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n10_6
@@ -0,0 +1,3 @@
+map ppp0 any -> 203.203.203.203/128 mssclamp 100
+map ppp0 any -> 203.203.203.203/128 mssclamp 1000
+map ppp0 any -> 203.203.203.203/128 mssclamp 10000
diff --git a/contrib/netbsd-tests/ipf/regress/n11 b/contrib/netbsd-tests/ipf/regress/n11
new file mode 100644
index 0000000..8cdf7fc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n11
@@ -0,0 +1,3 @@
+bimap zx0 10.1.1.1/32 -> 1.6.7.8/32
+bimap zx0 10.1.1.0/24 -> 10.2.2.2/32
+bimap zx0 10.1.1.0/24 -> 10.3.4.5/24
diff --git a/contrib/netbsd-tests/ipf/regress/n11_6 b/contrib/netbsd-tests/ipf/regress/n11_6
new file mode 100644
index 0000000..7b428cc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n11_6
@@ -0,0 +1,3 @@
+bimap zx0 10:1:1::1/128 -> 1::6:7:8/128
+bimap zx0 10:1:1::/112 -> 10::2:2:2/128
+bimap zx0 10:1:1::/112 -> 10::3:4:5/112
diff --git a/contrib/netbsd-tests/ipf/regress/n12 b/contrib/netbsd-tests/ipf/regress/n12
new file mode 100644
index 0000000..933856b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n12
@@ -0,0 +1 @@
+map le0 192.168.126.0/24 -> 0/32 portmap tcp/udp 10000:20000 sequential
diff --git a/contrib/netbsd-tests/ipf/regress/n12_6 b/contrib/netbsd-tests/ipf/regress/n12_6
new file mode 100644
index 0000000..bf21848
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n12_6
@@ -0,0 +1 @@
+map le0 c0a8:7e00::/112 -> 0/128 portmap tcp/udp 10000:20000
diff --git a/contrib/netbsd-tests/ipf/regress/n13 b/contrib/netbsd-tests/ipf/regress/n13
new file mode 100644
index 0000000..8047930
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n13
@@ -0,0 +1 @@
+map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45
diff --git a/contrib/netbsd-tests/ipf/regress/n13_6 b/contrib/netbsd-tests/ipf/regress/n13_6
new file mode 100644
index 0000000..c1d1646
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n13_6
@@ -0,0 +1 @@
+map le0 192:168:1::0/48 -> range 203:0:1::1:23-203:0:1::3:45
diff --git a/contrib/netbsd-tests/ipf/regress/n14 b/contrib/netbsd-tests/ipf/regress/n14
new file mode 100644
index 0000000..6f5d571
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n14
@@ -0,0 +1 @@
+rdr gre0 0/0 port 80 -> 10.1.1.254,10.1.1.253 port 80 tcp sticky
diff --git a/contrib/netbsd-tests/ipf/regress/n14_6 b/contrib/netbsd-tests/ipf/regress/n14_6
new file mode 100644
index 0000000..64e88ee
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n14_6
@@ -0,0 +1 @@
+rdr gre0 any port 80 -> 10:1:1::254,10:1:1::253 port 80 tcp sticky
diff --git a/contrib/netbsd-tests/ipf/regress/n15 b/contrib/netbsd-tests/ipf/regress/n15
new file mode 100644
index 0000000..062b766
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n15
@@ -0,0 +1,2 @@
+rdr le0 0/0 port 80 -> 3.3.3.3 port 80 tcp
+rdr le0 0/0 port 80 -> 3.3.3.3 port 80-88 tcp
diff --git a/contrib/netbsd-tests/ipf/regress/n15_6 b/contrib/netbsd-tests/ipf/regress/n15_6
new file mode 100644
index 0000000..e82dd82
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n15_6
@@ -0,0 +1,2 @@
+rdr le0 any port 80 -> 3:0:3::3:3 port 80 tcp
+rdr le0 any port 80 -> 3:0:3::3:3 port 80-88 tcp
diff --git a/contrib/netbsd-tests/ipf/regress/n16 b/contrib/netbsd-tests/ipf/regress/n16
new file mode 100644
index 0000000..ff8958c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n16
@@ -0,0 +1 @@
+rdr vlan0 from any to 69.248.79.193 port = 38136 -> 172.31.83.24 port 2013 udp
diff --git a/contrib/netbsd-tests/ipf/regress/n16_6 b/contrib/netbsd-tests/ipf/regress/n16_6
new file mode 100644
index 0000000..ff8958c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n16_6
@@ -0,0 +1 @@
+rdr vlan0 from any to 69.248.79.193 port = 38136 -> 172.31.83.24 port 2013 udp
diff --git a/contrib/netbsd-tests/ipf/regress/n17 b/contrib/netbsd-tests/ipf/regress/n17
new file mode 100644
index 0000000..213f51f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n17
@@ -0,0 +1 @@
+bimap zx0 0/0 -> 1.1.1.3
diff --git a/contrib/netbsd-tests/ipf/regress/n18 b/contrib/netbsd-tests/ipf/regress/n18
new file mode 100644
index 0000000..792f136
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n18
@@ -0,0 +1,3 @@
+map z0 0/0 -> 1.1.1.1/32 portmap tcp/udp 1:4 sequential
+map z0 0/0 -> 1.1.1.1/32 portmap tcp/udp 1000:5000 sequential
+map z0 0/0 -> 1.1.1.1/32 portmap tcp/udp 1000:50000 sequential
diff --git a/contrib/netbsd-tests/ipf/regress/n1_6 b/contrib/netbsd-tests/ipf/regress/n1_6
new file mode 100644
index 0000000..341f136
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n1_6
@@ -0,0 +1,3 @@
+map zx0 10:1:1::1/128 -> 10::2:2:2/128
+map zx0 10:1:1::/112 -> 10::3:4:5/128
+map zx0 10:1:1::/112 -> 10::3:4:0/112
diff --git a/contrib/netbsd-tests/ipf/regress/n2 b/contrib/netbsd-tests/ipf/regress/n2
new file mode 100644
index 0000000..39a4d72
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n2
@@ -0,0 +1,4 @@
+map zx0 10.1.1.1/32 -> 10.2.2.2/32 portmap tcp 10000:20000 sequential
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap udp 10000:20000 sequential
+map zx0 10.1.0.0/16 -> 10.3.4.0/24 portmap tcp/udp 10000:20000 sequential
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap tcp/udp 40000:40001 sequential
diff --git a/contrib/netbsd-tests/ipf/regress/n200 b/contrib/netbsd-tests/ipf/regress/n200
new file mode 100644
index 0000000..c792e54
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n200
@@ -0,0 +1 @@
+divert in on bar0 from any to any -> src 127.0.0.1,10101 dst 127.0.0.1,10101 udp;
diff --git a/contrib/netbsd-tests/ipf/regress/n2_6 b/contrib/netbsd-tests/ipf/regress/n2_6
new file mode 100644
index 0000000..3a04f33
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n2_6
@@ -0,0 +1,4 @@
+map zx0 10:1:1::1/128 -> 10::2:2:2/128 portmap tcp 10000:20000 sequential
+map zx0 10:1:1::/112 -> 10::3:4:5/128 portmap udp 10000:20000 sequential
+map zx0 10:1::/32 -> 10::3:4:0/112 portmap tcp/udp 10000:20000 sequential
+map zx0 10:1:1::/112 -> 10::3:4:5/128 portmap tcp/udp 40000:40001 sequential
diff --git a/contrib/netbsd-tests/ipf/regress/n3 b/contrib/netbsd-tests/ipf/regress/n3
new file mode 100644
index 0000000..82c83dd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n3
@@ -0,0 +1,2 @@
+map zz0 10.1.0.0/16 -> 192.168.2.0/24 portmap tcp/udp auto
+map-block zz0 10.1.0.0/16 -> 192.168.1.0/24 ports 252
diff --git a/contrib/netbsd-tests/ipf/regress/n4 b/contrib/netbsd-tests/ipf/regress/n4
new file mode 100644
index 0000000..e7c0314
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n4
@@ -0,0 +1,6 @@
+rdr zx0 10.1.1.1/32 port 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 10.1.1.0/24 port 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 0/0 port 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 10.1.1.0/24 port 53 -> 10.2.2.1 port 10053 udp
+rdr zx0 10.1.1.0/24 port 0 -> 10.2.2.1 port 0 tcp
+rdr zx0 10.1.1.0/24 port 0 -> 10.2.2.1 port 0 ip
diff --git a/contrib/netbsd-tests/ipf/regress/n4_6 b/contrib/netbsd-tests/ipf/regress/n4_6
new file mode 100644
index 0000000..72dad4c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n4_6
@@ -0,0 +1,6 @@
+rdr zx0 10:1:1::1/128 port 23 -> 10::2:2:1 port 10023 tcp
+rdr zx0 10:1:1::/112 port 23 -> 10::2:2:1 port 10023 tcp
+rdr zx0 any port 23 -> 10::2:2:1 port 10023 tcp
+rdr zx0 10:1:1::/112 port 53 -> 10::2:2:1 port 10053 udp
+rdr zx0 10:1:1::/112 port 0 -> 10::2:2:1 port 0 tcp
+rdr zx0 10:1:1::/112 port 0 -> 10::2:2:1 port 0 ip
diff --git a/contrib/netbsd-tests/ipf/regress/n5 b/contrib/netbsd-tests/ipf/regress/n5
new file mode 100644
index 0000000..d9f1a88
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n5
@@ -0,0 +1,6 @@
+map zx0 10.1.1.1/32 -> 10.2.2.2/32
+map zx0 from 10.1.1.0/24 to 10.1.0.0/16 -> 10.3.4.5/32
+map zx0 from 10.1.1.0/24 ! to 10.1.0.0/16 -> 10.3.4.0/24
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap udp 10000:20000 sequential
+map zx0 10.1.0.0/16 -> 10.3.4.0/24 portmap tcp/udp 10000:20000 sequential
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap tcp/udp 40000:40001 sequential
diff --git a/contrib/netbsd-tests/ipf/regress/n5_6 b/contrib/netbsd-tests/ipf/regress/n5_6
new file mode 100644
index 0000000..acefd7b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n5_6
@@ -0,0 +1,6 @@
+map zx0 10:1:1::1/128 -> 10::2:2:2/128
+map zx0 from 10:1:1::/112 to 10:1::/32 -> 10::3:4:5/128
+map zx0 from 10:1:1::/112 ! to 10:1::/32 -> 10::3:4:0/112
+map zx0 10:1:1::/112 -> 10::3:4:5/128 portmap udp 10000:20000 sequential
+map zx0 10:1::/32 -> 10::3:4:0/112 portmap tcp/udp 10000:20000 sequential
+map zx0 10:1:1::/112 -> 10::3:4:5/128 portmap tcp/udp 40000:40001 sequential
diff --git a/contrib/netbsd-tests/ipf/regress/n6 b/contrib/netbsd-tests/ipf/regress/n6
new file mode 100644
index 0000000..79f11a4
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n6
@@ -0,0 +1,5 @@
+rdr zx0 10.1.1.1/32 port 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 from any to 10.1.1.0/24 port = 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 from 10.2.0.0/16 to 10.1.1.0/24 port = 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 from 10.3.0.0/16 to 10.1.0.0/16 port = 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 ! from 10.2.0.0/16 to 10.1.1.0/24 port = 53 -> 10.2.2.1 port 10053 udp
diff --git a/contrib/netbsd-tests/ipf/regress/n6_6 b/contrib/netbsd-tests/ipf/regress/n6_6
new file mode 100644
index 0000000..3491c6b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n6_6
@@ -0,0 +1,5 @@
+rdr zx0 10:1:1::1/128 port 23 -> 10::2:2:1 port 10023 tcp
+rdr zx0 from any to 10:1:1::/112 port = 23 -> 10::2:2:1 port 10023 tcp
+rdr zx0 from 10::/32 to 10:1:1::/112 port = 23 -> 10::2:2:1 port 10023 tcp
+rdr zx0 from 10:3::/32 to 10:1::/32 port = 23 -> 10::2:2:1 port 10023 tcp
+rdr zx0 ! from 10::/32 to 10:1:1::/112 port = 53 -> 10::2:2:1 port 10053 udp
diff --git a/contrib/netbsd-tests/ipf/regress/n7 b/contrib/netbsd-tests/ipf/regress/n7
new file mode 100644
index 0000000..be995c2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n7
@@ -0,0 +1,3 @@
+rdr zx0 10.1.1.1/32 port 23-79 -> 10.2.2.1 port 10023 tcp
+rdr zx0 10.1.1.1/32 port 23-79 -> 10.2.2.1 port = 10023 tcp
+rdr zx0 10.1.1.0/24 port 80 -> 10.2.2.1,1.2.2.129 port 3128 tcp
diff --git a/contrib/netbsd-tests/ipf/regress/n7_6 b/contrib/netbsd-tests/ipf/regress/n7_6
new file mode 100644
index 0000000..88055f6
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n7_6
@@ -0,0 +1,3 @@
+rdr zx0 10:1:1::1/128 port 23-79 -> 10::2:2:1 port 10023 tcp
+rdr zx0 10:1:1::1/128 port 23-79 -> 10::2:2:1 port = 10023 tcp
+rdr zx0 10:1:1::/112 port 80 -> 10::2:2:1,1::2:2:129 port 3128 tcp
diff --git a/contrib/netbsd-tests/ipf/regress/n8 b/contrib/netbsd-tests/ipf/regress/n8
new file mode 100644
index 0000000..bf0e94f
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n8
@@ -0,0 +1 @@
+map icmp0 2.2.2.0/24 -> 10.10.10.0/24
diff --git a/contrib/netbsd-tests/ipf/regress/n8_6 b/contrib/netbsd-tests/ipf/regress/n8_6
new file mode 100644
index 0000000..2f96be0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n8_6
@@ -0,0 +1 @@
+map icmp0 2::2:2:0/112 -> 10:10:10::/112
diff --git a/contrib/netbsd-tests/ipf/regress/n9 b/contrib/netbsd-tests/ipf/regress/n9
new file mode 100644
index 0000000..81a7ccd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n9
@@ -0,0 +1 @@
+rdr icmp0 4.4.4.0/24 port 0 -> 10.10.10.1 port 0 ip
diff --git a/contrib/netbsd-tests/ipf/regress/n9_6 b/contrib/netbsd-tests/ipf/regress/n9_6
new file mode 100644
index 0000000..31e4615
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/n9_6
@@ -0,0 +1 @@
+rdr icmp0 4:4:4::/112 port 0 -> 10:10:10::1 port 0 ip
diff --git a/contrib/netbsd-tests/ipf/regress/ni1.ipf b/contrib/netbsd-tests/ipf/regress/ni1.ipf
new file mode 100644
index 0000000..c7e5797
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni1.ipf
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass out proto udp from any to any keep state
+pass out proto tcp from any to any flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni1.nat b/contrib/netbsd-tests/ipf/regress/ni1.nat
new file mode 100644
index 0000000..077aab1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni1.nat
@@ -0,0 +1,3 @@
+map df0 from 2.2.2.2/32 port 20000 >< 25000 to any -> 6.6.6.8/32 portmap udp 2000:2500 sequential
+map df0 from 2.2.2.2/32 port 2000 >< 2500 to any -> 6.6.6.7/32 portmap udp 20000:25000 sequential
+map df0 from 2.2.2.2/32 to any -> 6.6.6.6/32
diff --git a/contrib/netbsd-tests/ipf/regress/ni10.ipf b/contrib/netbsd-tests/ipf/regress/ni10.ipf
new file mode 100644
index 0000000..4151b6e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni10.ipf
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass in proto udp from any to any keep state
+pass in proto tcp from any to any flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni10.nat b/contrib/netbsd-tests/ipf/regress/ni10.nat
new file mode 100644
index 0000000..2a04ef7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni10.nat
@@ -0,0 +1 @@
+rdr df0 2.2.2.2/32 -> 6.6.6.6
diff --git a/contrib/netbsd-tests/ipf/regress/ni11.ipf b/contrib/netbsd-tests/ipf/regress/ni11.ipf
new file mode 100644
index 0000000..4151b6e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni11.ipf
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass in proto udp from any to any keep state
+pass in proto tcp from any to any flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni11.nat b/contrib/netbsd-tests/ipf/regress/ni11.nat
new file mode 100644
index 0000000..1d0018c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni11.nat
@@ -0,0 +1 @@
+rdr df0 10.0.0.0/8 port 1000:2000 -> 1.1.1.1 port 40000 tcp/udp
diff --git a/contrib/netbsd-tests/ipf/regress/ni12.ipf b/contrib/netbsd-tests/ipf/regress/ni12.ipf
new file mode 100644
index 0000000..4151b6e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni12.ipf
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass in proto udp from any to any keep state
+pass in proto tcp from any to any flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni12.nat b/contrib/netbsd-tests/ipf/regress/ni12.nat
new file mode 100644
index 0000000..8c36bc8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni12.nat
@@ -0,0 +1 @@
+rdr df0 10.0.0.0/8 port 1000:2000 -> 1.1.1.1 port = 40000 tcp/udp
diff --git a/contrib/netbsd-tests/ipf/regress/ni13.ipf b/contrib/netbsd-tests/ipf/regress/ni13.ipf
new file mode 100644
index 0000000..04b6d13
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni13.ipf
@@ -0,0 +1,3 @@
+pass in quick on pcn1 proto tcp from any to any port = 1723 keep state
+block in all
+block out all
diff --git a/contrib/netbsd-tests/ipf/regress/ni13.nat b/contrib/netbsd-tests/ipf/regress/ni13.nat
new file mode 100644
index 0000000..ac2be49
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni13.nat
@@ -0,0 +1 @@
+rdr pcn1 192.168.113.3/32 port 1723 -> 0.0.0.0 port 1723 tcp proxy pptp
diff --git a/contrib/netbsd-tests/ipf/regress/ni14.ipf b/contrib/netbsd-tests/ipf/regress/ni14.ipf
new file mode 100644
index 0000000..04b6d13
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni14.ipf
@@ -0,0 +1,3 @@
+pass in quick on pcn1 proto tcp from any to any port = 1723 keep state
+block in all
+block out all
diff --git a/contrib/netbsd-tests/ipf/regress/ni14.nat b/contrib/netbsd-tests/ipf/regress/ni14.nat
new file mode 100644
index 0000000..72a8a4a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni14.nat
@@ -0,0 +1 @@
+rdr pcn1 192.168.113.3/32 port 1723 -> 127.0.0.1 port 1723 tcp proxy pptp
diff --git a/contrib/netbsd-tests/ipf/regress/ni15.ipf b/contrib/netbsd-tests/ipf/regress/ni15.ipf
new file mode 100644
index 0000000..1b9a013
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni15.ipf
@@ -0,0 +1,3 @@
+pass out quick on pcn1 proto tcp from any to any port = 1723 keep state
+block in all
+block out all
diff --git a/contrib/netbsd-tests/ipf/regress/ni15.nat b/contrib/netbsd-tests/ipf/regress/ni15.nat
new file mode 100644
index 0000000..420c7b7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni15.nat
@@ -0,0 +1 @@
+map pcn1 0/0 -> 0/0 proxy port 1723 pptp/tcp
diff --git a/contrib/netbsd-tests/ipf/regress/ni16.ipf b/contrib/netbsd-tests/ipf/regress/ni16.ipf
new file mode 100644
index 0000000..1b9a013
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni16.ipf
@@ -0,0 +1,3 @@
+pass out quick on pcn1 proto tcp from any to any port = 1723 keep state
+block in all
+block out all
diff --git a/contrib/netbsd-tests/ipf/regress/ni16.nat b/contrib/netbsd-tests/ipf/regress/ni16.nat
new file mode 100644
index 0000000..5fad3cd
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni16.nat
@@ -0,0 +1 @@
+map pcn1 10.2.2.2/32 -> 0/32 proxy port 1723 pptp/tcp
diff --git a/contrib/netbsd-tests/ipf/regress/ni17.ipf b/contrib/netbsd-tests/ipf/regress/ni17.ipf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni17.ipf
diff --git a/contrib/netbsd-tests/ipf/regress/ni17.nat b/contrib/netbsd-tests/ipf/regress/ni17.nat
new file mode 100644
index 0000000..3da6338
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni17.nat
@@ -0,0 +1,4 @@
+rdr le0 0/0 port 80 -> 10.1.1.252 port 3128 tcp round-robin
+rdr le0 0/0 port 80 -> 10.1.2.252 port 3128 tcp round-robin
+rdr le0 0/0 port 80 -> 10.1.3.252 port 3128 tcp round-robin sticky
+rdr le0 0/0 port 80 -> 10.1.1.253,10.1.2.253 port 3128 tcp round-robin sticky
diff --git a/contrib/netbsd-tests/ipf/regress/ni18.ipf b/contrib/netbsd-tests/ipf/regress/ni18.ipf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni18.ipf
diff --git a/contrib/netbsd-tests/ipf/regress/ni18.nat b/contrib/netbsd-tests/ipf/regress/ni18.nat
new file mode 100644
index 0000000..40113c1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni18.nat
@@ -0,0 +1,4 @@
+rdr hme0 192.168.1.0/24 port 80 -> 1.1.1.1 port 80 tcp;
+no rdr hme0 192.168.1.1 port 80 tcp;
+map hme1 10.1.0.0/16 -> 203.1.1.1/32 portmap tcp/udp 10000:20000
+no map hme1 10.1.1.0/24 tcp;
diff --git a/contrib/netbsd-tests/ipf/regress/ni19.ipf b/contrib/netbsd-tests/ipf/regress/ni19.ipf
new file mode 100644
index 0000000..c6fcec1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni19.ipf
@@ -0,0 +1,3 @@
+block in all
+pass out quick on bge0 proto tcp from any to any port = shell flags S keep state
+block out all
diff --git a/contrib/netbsd-tests/ipf/regress/ni19.nat b/contrib/netbsd-tests/ipf/regress/ni19.nat
new file mode 100644
index 0000000..56b81a9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni19.nat
@@ -0,0 +1 @@
+map bge0 192.168.113.0/24 -> 10.1.1.1/32 proxy port shell rcmd/tcp
diff --git a/contrib/netbsd-tests/ipf/regress/ni2.ipf b/contrib/netbsd-tests/ipf/regress/ni2.ipf
new file mode 100644
index 0000000..5956cf9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni2.ipf
@@ -0,0 +1 @@
+pass out quick proto tcp from any to any flags S/SAFR keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni2.nat b/contrib/netbsd-tests/ipf/regress/ni2.nat
new file mode 100644
index 0000000..43d2c83
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni2.nat
@@ -0,0 +1 @@
+map xl0 10.0.0.0/8 -> 1.1.1.1/32 portmap tcp/udp 40000:60000 sequential
diff --git a/contrib/netbsd-tests/ipf/regress/ni20.ipf b/contrib/netbsd-tests/ipf/regress/ni20.ipf
new file mode 100644
index 0000000..c6f6d84
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni20.ipf
@@ -0,0 +1,3 @@
+block in all
+pass in quick on bge0 proto tcp from any to any port = shell flags S keep state
+block out all
diff --git a/contrib/netbsd-tests/ipf/regress/ni20.nat b/contrib/netbsd-tests/ipf/regress/ni20.nat
new file mode 100644
index 0000000..f2dd0a7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni20.nat
@@ -0,0 +1 @@
+rdr bge0 10.1.1.4/32 port shell -> 192.168.113.4 port shell tcp proxy rcmd
diff --git a/contrib/netbsd-tests/ipf/regress/ni21.ipf b/contrib/netbsd-tests/ipf/regress/ni21.ipf
new file mode 100644
index 0000000..6d6ed08
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni21.ipf
@@ -0,0 +1 @@
+pass out on lan0 to eri0:1.1.1.1 from 2.2.2.2 to any
diff --git a/contrib/netbsd-tests/ipf/regress/ni21.nat b/contrib/netbsd-tests/ipf/regress/ni21.nat
new file mode 100644
index 0000000..6b2d46a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni21.nat
@@ -0,0 +1 @@
+map lan0,eri0 2.2.2.2 -> 4.4.4.4
diff --git a/contrib/netbsd-tests/ipf/regress/ni23.ipf b/contrib/netbsd-tests/ipf/regress/ni23.ipf
new file mode 100644
index 0000000..49ebcf7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni23.ipf
@@ -0,0 +1,3 @@
+block out all
+block in all
+pass in on le0,hme0 out-via ppp0,bge0 to ppp0:3.3.3.254 proto udp all keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni23.nat b/contrib/netbsd-tests/ipf/regress/ni23.nat
new file mode 100644
index 0000000..094d377
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni23.nat
@@ -0,0 +1,2 @@
+rdr le0,bge0 1.1.0.0/16 -> 2.2.2.2
+map hme0,ppp0 3.3.3.0/24 -> 4.4.4.4/32
diff --git a/contrib/netbsd-tests/ipf/regress/ni3.ipf b/contrib/netbsd-tests/ipf/regress/ni3.ipf
new file mode 100644
index 0000000..c7e5797
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni3.ipf
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass out proto udp from any to any keep state
+pass out proto tcp from any to any flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni3.nat b/contrib/netbsd-tests/ipf/regress/ni3.nat
new file mode 100644
index 0000000..4306f4b
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni3.nat
@@ -0,0 +1 @@
+map df0 2.2.2.2/32 -> 6.6.6.6/32
diff --git a/contrib/netbsd-tests/ipf/regress/ni4.ipf b/contrib/netbsd-tests/ipf/regress/ni4.ipf
new file mode 100644
index 0000000..c7e5797
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni4.ipf
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass out proto udp from any to any keep state
+pass out proto tcp from any to any flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni4.nat b/contrib/netbsd-tests/ipf/regress/ni4.nat
new file mode 100644
index 0000000..e9d5cc1
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni4.nat
@@ -0,0 +1 @@
+map df0 2.2.2.2/32 -> 6.6.6.6/32 portmap tcp/udp 40000:60000 sequential
diff --git a/contrib/netbsd-tests/ipf/regress/ni5.ipf b/contrib/netbsd-tests/ipf/regress/ni5.ipf
new file mode 100644
index 0000000..8f11424
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni5.ipf
@@ -0,0 +1,3 @@
+block in all
+pass out quick on ppp0 proto tcp from any to any port = ftp flags S keep state
+block out all
diff --git a/contrib/netbsd-tests/ipf/regress/ni5.nat b/contrib/netbsd-tests/ipf/regress/ni5.nat
new file mode 100644
index 0000000..8e80d22
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni5.nat
@@ -0,0 +1 @@
+map ppp0 192.168.1.0/24 -> 1.1.1.1/32 proxy port ftp ftp/tcp
diff --git a/contrib/netbsd-tests/ipf/regress/ni6.ipf b/contrib/netbsd-tests/ipf/regress/ni6.ipf
new file mode 100644
index 0000000..f5b83b2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni6.ipf
@@ -0,0 +1,9 @@
+block out log quick on qfe0 from 192.168.7.0/24 to any
+block out log quick on nf0 from 192.168.6.0/24 to any
+pass in quick on nf0 proto tcp from any to any port = 111 flags S keep state
+pass in quick on nf0 proto udp from any to any port = 111 keep state
+block return-rst in log quick on nf0 proto tcp from any to any
+block in log quick on nf0 from 192.168.7.0/24 to any
+block return-rst in log quick on qfe0 proto tcp from any to any
+block in log quick on qfe0 from 192.168.6.0/24 to any
+
diff --git a/contrib/netbsd-tests/ipf/regress/ni6.nat b/contrib/netbsd-tests/ipf/regress/ni6.nat
new file mode 100644
index 0000000..00d57d0
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni6.nat
@@ -0,0 +1,3 @@
+rdr nf0 192.168.6.2 port 111 -> 192.168.7.1 port 111 udp proxy rpcbu
+rdr nf0 192.168.6.2 port 111 -> 192.168.7.1 port 111 tcp proxy rpcbt
+map qfe0 192.168.6.0/24 -> 192.168.7.2/32
diff --git a/contrib/netbsd-tests/ipf/regress/ni7.ipf b/contrib/netbsd-tests/ipf/regress/ni7.ipf
new file mode 100644
index 0000000..4151b6e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni7.ipf
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass in proto udp from any to any keep state
+pass in proto tcp from any to any flags S keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni7.nat b/contrib/netbsd-tests/ipf/regress/ni7.nat
new file mode 100644
index 0000000..2a04ef7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni7.nat
@@ -0,0 +1 @@
+rdr df0 2.2.2.2/32 -> 6.6.6.6
diff --git a/contrib/netbsd-tests/ipf/regress/ni8.ipf b/contrib/netbsd-tests/ipf/regress/ni8.ipf
new file mode 100644
index 0000000..6666241
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni8.ipf
@@ -0,0 +1 @@
+pass in quick proto tcp from any to any flags S/SAFR keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni8.nat b/contrib/netbsd-tests/ipf/regress/ni8.nat
new file mode 100644
index 0000000..1d0018c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni8.nat
@@ -0,0 +1 @@
+rdr df0 10.0.0.0/8 port 1000:2000 -> 1.1.1.1 port 40000 tcp/udp
diff --git a/contrib/netbsd-tests/ipf/regress/ni9.ipf b/contrib/netbsd-tests/ipf/regress/ni9.ipf
new file mode 100644
index 0000000..6666241
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni9.ipf
@@ -0,0 +1 @@
+pass in quick proto tcp from any to any flags S/SAFR keep state
diff --git a/contrib/netbsd-tests/ipf/regress/ni9.nat b/contrib/netbsd-tests/ipf/regress/ni9.nat
new file mode 100644
index 0000000..8c36bc8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/ni9.nat
@@ -0,0 +1 @@
+rdr df0 10.0.0.0/8 port 1000:2000 -> 1.1.1.1 port = 40000 tcp/udp
diff --git a/contrib/netbsd-tests/ipf/regress/p1.ipf b/contrib/netbsd-tests/ipf/regress/p1.ipf
new file mode 100644
index 0000000..acaf639
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p1.ipf
@@ -0,0 +1 @@
+pass in from pool/100 to any
diff --git a/contrib/netbsd-tests/ipf/regress/p1.pool b/contrib/netbsd-tests/ipf/regress/p1.pool
new file mode 100644
index 0000000..aa262a7
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p1.pool
@@ -0,0 +1,2 @@
+table role = ipf type = tree number = 100
+ { 1.1.1.1/32; !2.2.0.0/16; 2.2.2.0/24; ef00::5/128; };
diff --git a/contrib/netbsd-tests/ipf/regress/p10.nat b/contrib/netbsd-tests/ipf/regress/p10.nat
new file mode 100644
index 0000000..3c3fa7c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p10.nat
@@ -0,0 +1 @@
+rewrite in on bge0 proto tcp from any to any port = 80 -> src 0/0 dst dstlist/servers;
diff --git a/contrib/netbsd-tests/ipf/regress/p10.pool b/contrib/netbsd-tests/ipf/regress/p10.pool
new file mode 100644
index 0000000..2be554a
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p10.pool
@@ -0,0 +1,2 @@
+pool nat/dstlist (name servers; policy hash;)
+ { 1.1.1.2; 1.1.1.4; 1.1.1.5; 1.1.1.9; };
diff --git a/contrib/netbsd-tests/ipf/regress/p11.nat b/contrib/netbsd-tests/ipf/regress/p11.nat
new file mode 100644
index 0000000..3c3fa7c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p11.nat
@@ -0,0 +1 @@
+rewrite in on bge0 proto tcp from any to any port = 80 -> src 0/0 dst dstlist/servers;
diff --git a/contrib/netbsd-tests/ipf/regress/p11.pool b/contrib/netbsd-tests/ipf/regress/p11.pool
new file mode 100644
index 0000000..a79d9ea
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p11.pool
@@ -0,0 +1,2 @@
+pool nat/dstlist (name servers; policy dst-hash;)
+ { 1.1.1.2; 1.1.1.4; 1.1.1.5; 1.1.1.9; };
diff --git a/contrib/netbsd-tests/ipf/regress/p12.nat b/contrib/netbsd-tests/ipf/regress/p12.nat
new file mode 100644
index 0000000..3c3fa7c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p12.nat
@@ -0,0 +1 @@
+rewrite in on bge0 proto tcp from any to any port = 80 -> src 0/0 dst dstlist/servers;
diff --git a/contrib/netbsd-tests/ipf/regress/p12.pool b/contrib/netbsd-tests/ipf/regress/p12.pool
new file mode 100644
index 0000000..c9afcda
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p12.pool
@@ -0,0 +1,2 @@
+pool nat/dstlist (name servers; policy src-hash;)
+ { 1.1.1.2; 1.1.1.4; 1.1.1.5; 1.1.1.9; };
diff --git a/contrib/netbsd-tests/ipf/regress/p13.ipf b/contrib/netbsd-tests/ipf/regress/p13.ipf
new file mode 100644
index 0000000..acaf639
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p13.ipf
@@ -0,0 +1 @@
+pass in from pool/100 to any
diff --git a/contrib/netbsd-tests/ipf/regress/p13.pool b/contrib/netbsd-tests/ipf/regress/p13.pool
new file mode 100644
index 0000000..de80f72
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p13.pool
@@ -0,0 +1,2 @@
+table role = all type = tree number = 100
+ { 1.1.1.1/32; !2.2.0.0/16; 2.2.2.0/24; ef00::5/128; };
diff --git a/contrib/netbsd-tests/ipf/regress/p2.ipf b/contrib/netbsd-tests/ipf/regress/p2.ipf
new file mode 100644
index 0000000..4cfb388
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p2.ipf
@@ -0,0 +1,2 @@
+pass out from hash=(127.0.0.1,4.4.0.0/16) to any
+block in from hash=(127.0.0.1,4.4.0.0/16) to any
diff --git a/contrib/netbsd-tests/ipf/regress/p3.ipf b/contrib/netbsd-tests/ipf/regress/p3.ipf
new file mode 100644
index 0000000..a598d88
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p3.ipf
@@ -0,0 +1,6 @@
+call now srcgrpmap/1010 in all
+call now dstgrpmap/2010 out all
+pass in all group 1020
+block in all group 1030
+pass out all group 2020
+block out all group 2040
diff --git a/contrib/netbsd-tests/ipf/regress/p3.pool b/contrib/netbsd-tests/ipf/regress/p3.pool
new file mode 100644
index 0000000..3fadd59
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p3.pool
@@ -0,0 +1,4 @@
+group-map in role = ipf number = 1010
+ { 1.1.1.1/32, group = 1020; 3.3.0.0/16, group = 1030; };
+group-map out role = ipf number = 2010 group = 2020
+ { 2.2.2.2/32; 4.4.0.0/16; 5.0.0.0/8, group = 2040; };
diff --git a/contrib/netbsd-tests/ipf/regress/p4.nat b/contrib/netbsd-tests/ipf/regress/p4.nat
new file mode 100644
index 0000000..d504ac9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p4.nat
@@ -0,0 +1 @@
+map * from pool/100 to any -> 1.2.3.4/32
diff --git a/contrib/netbsd-tests/ipf/regress/p4.pool b/contrib/netbsd-tests/ipf/regress/p4.pool
new file mode 100644
index 0000000..6ed0e49
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p4.pool
@@ -0,0 +1,2 @@
+table role = nat type = tree number = 100
+ { 1.1.1.1/32; !2.2.0.0/16; 2.2.2.0/24; };
diff --git a/contrib/netbsd-tests/ipf/regress/p5.ipf b/contrib/netbsd-tests/ipf/regress/p5.ipf
new file mode 100644
index 0000000..ada9f56
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p5.ipf
@@ -0,0 +1 @@
+pass in from pool/letters to any
diff --git a/contrib/netbsd-tests/ipf/regress/p5.pool b/contrib/netbsd-tests/ipf/regress/p5.pool
new file mode 100644
index 0000000..9a8eaa3
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p5.pool
@@ -0,0 +1,2 @@
+table role = ipf type = tree name = letters
+ { 1.1.1.1/32; !2.2.0.0/16; 2.2.2.0/24; };
diff --git a/contrib/netbsd-tests/ipf/regress/p6.ipf b/contrib/netbsd-tests/ipf/regress/p6.ipf
new file mode 100644
index 0000000..b9b8937
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p6.ipf
@@ -0,0 +1 @@
+block in from pool/microsoft to any
diff --git a/contrib/netbsd-tests/ipf/regress/p6.pool b/contrib/netbsd-tests/ipf/regress/p6.pool
new file mode 100644
index 0000000..83e818c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p6.pool
@@ -0,0 +1 @@
+pool ipf/tree (name microsoft;) { whois file "regress/p6.whois"; };
diff --git a/contrib/netbsd-tests/ipf/regress/p6.whois b/contrib/netbsd-tests/ipf/regress/p6.whois
new file mode 100644
index 0000000..284244e
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p6.whois
@@ -0,0 +1,241 @@
+# This query resulted in more than 256 records. Remaining results
+# have been truncated. For more specific results, go to
+# http://ws.arin.net/whois for help in refining your query.
+Microsoft Corp (MSFT)
+Microsoft Corp., MSN Operations (MCMO)
+MICROSOFT CORPORATION (MICRO-101)
+MICROSOFT CORPORATION (MICRO-97)
+MICROSOFT CORPORATION (MICRO-100)
+Microsoft Corporation (MICRO-111)
+MICROSOFT CORPORATION (MICRO-117)
+Microsoft Corporation (ZM23-ARIN) noc@microsoft.com +1-425-882-8080
+Microsoft (ZM39-ARIN) noc@microsoft.com +1-425-882-8080
+Microsoft Corp (AS8068) MICROSOFT-CORP---MSN-AS-BLOCK 8068 - 8075
+Microsoft Corp (AS13811) MSLI 13811
+Microsoft Corp (AS14719) MICROSOFT-CORP-BCENTRAL 14719
+Microsoft Corp (AS3598) MICROSOFT-CORP-AS 3598
+Microsoft Corp (AS5761) MICROSOFT-CORP---MSN-AS---SATURN 5761
+Microsoft Corp (AS6182) MICROSOFT-CORP--MSN-AS-4 6182
+Microsoft Corp (AS6194) MICROSOFT-CORP--MSN-AS-3 6194
+Microsoft Corp (AS6291) MICROSOFT-CORP---MSN-AS 6291
+Microsoft Corp (AS13399) MICROSOFT-CORP---MSN-AS-2 13399
+Microsoft Corp (AS23468) MICROSOFT-CORP-XBOX-ONLINE 23468
+Microsoft Corp MICROSOFT (NET-131-107-0-0-1) 131.107.0.0 - 131.107.255.255
+Microsoft Corp MICROSOFT-VEXCEL (NET-192-92-90-0-1) 192.92.90.0 - 192.92.90.255
+Microsoft Corp NETBLK-MSOFT-NET (NET-198-105-232-0-1) 198.105.232.0 - 198.105.235.255
+Microsoft Corp MICROSOFT19-NET58 (NET-204-231-58-0-1) 204.231.58.0 - 204.231.58.255
+Microsoft Corp MICROSOFT15 (NET-204-140-77-0-1) 204.140.77.0 - 204.140.77.255
+Microsoft Corp MICROSOFT16 (NET-204-140-80-0-1) 204.140.80.0 - 204.140.83.255
+Microsoft Corp MICROSOFT-CORP-MSN-1 (NET-199-60-28-0-1) 199.60.28.0 - 199.60.28.255
+Microsoft Corp MICROSOFT-1 (NET-199-103-90-0-1) 199.103.90.0 - 199.103.91.255
+Microsoft Corp MICROSOFT-CORP-MSN-3 (NET-199-103-122-0-1) 199.103.122.0 - 199.103.122.255
+Microsoft Corp MICROSOFT8 (NET-204-79-101-0-1) 204.79.101.0 - 204.79.101.255
+Microsoft Corp MICROSOFT18 (NET-192-237-67-0-1) 192.237.67.0 - 192.237.67.255
+Microsoft Corp MICROSOFT19 (NET-198-137-97-0-1) 198.137.97.0 - 198.137.97.255
+Microsoft Corp MICROSOFT-HK (NET-204-79-135-0-1) 204.79.135.0 - 204.79.135.255
+Microsoft Corp MICROSOFT-PLACEWARE-1 (NET-204-79-179-0-1) 204.79.179.0 - 204.79.179.255
+Microsoft Corp MICROSOFT11 (NET-204-79-180-0-1) 204.79.180.0 - 204.79.181.255
+Microsoft Corp MICROSOFT-PLACEWARE-2 (NET-204-79-188-0-1) 204.79.188.0 - 204.79.188.255
+Microsoft Corp MICROSOFT13 (NET-204-79-195-0-1) 204.79.195.0 - 204.79.197.255
+Microsoft Corp MICROSOFT17 (NET-199-6-92-0-1) 199.6.92.0 - 199.6.94.255
+Microsoft Corp MICROSOFT-2 (NET-204-79-7-0-1) 204.79.7.0 - 204.79.7.255
+Microsoft Corp MICROSOFT-NET1 (NET-204-79-27-0-1) 204.79.27.0 - 204.79.27.255
+Microsoft Corp MICROSOFT2 (NET-198-180-74-0-1) 198.180.74.0 - 198.180.75.255
+Microsoft Corp MICROSOFT3 (NET-198-180-95-0-1) 198.180.95.0 - 198.180.97.255
+Microsoft Corp MICROSOFT28 (NET-204-231-236-0-1) 204.231.236.0 - 204.231.236.255
+Microsoft Corp MICROSOFT29 (NET-205-248-10-0-1) 205.248.10.0 - 205.248.15.255
+Microsoft Corp SPRINT-CDA33F (NET-205-163-63-0-1) 205.163.63.0 - 205.163.63.255
+Microsoft Corp SPRINT-CDA33E (NET-205-163-62-0-1) 205.163.62.0 - 205.163.62.255
+Microsoft Corp SPRINT-CDA39F (NET-205-163-144-0-1) 205.163.144.0 - 205.163.159.255
+Microsoft Corp MICROSOFT30 (NET-205-248-41-0-1) 205.248.41.0 - 205.248.43.255
+Microsoft Corp MICROSOFT31 (NET-205-248-50-0-1) 205.248.50.0 - 205.248.51.255
+Microsoft Corp MICROSOFT32 (NET-205-248-61-0-1) 205.248.61.0 - 205.248.63.255
+Microsoft Corp MICROSOFT34 (NET-205-248-72-0-1) 205.248.72.0 - 205.248.72.255
+Microsoft Corp MICROSOFT35 (NET-205-248-212-0-1) 205.248.212.0 - 205.248.215.255
+Microsoft Corp MICROSOFT36 (NET-205-248-228-0-1) 205.248.228.0 - 205.248.228.255
+Microsoft Corp MICROSOFT37 (NET-205-248-235-0-1) 205.248.235.0 - 205.248.235.255
+Microsoft Corp MICROSOFT20 (NET-204-231-76-0-1) 204.231.76.0 - 204.231.76.255
+Microsoft Corp MICROSOFT26 (NET-204-231-192-0-1) 204.231.192.0 - 204.231.192.255
+Microsoft Corp MICROSOFT27 (NET-204-231-194-0-1) 204.231.194.0 - 204.231.223.255
+Microsoft Corp SOCRATIC (NET-207-78-80-0-1) 207.78.80.0 - 207.78.80.255
+Microsoft Corp DAVELADD (NET-207-78-81-0-1) 207.78.81.0 - 207.78.81.255
+Microsoft Corp RSEGAL (NET-207-78-82-0-1) 207.78.82.0 - 207.78.82.255
+Microsoft Corp MICROSOFT44 (NET-205-248-243-0-1) 205.248.243.0 - 205.248.244.255
+Microsoft Corp MICROSOFT48 (NET-207-117-3-0-1) 207.117.3.0 - 207.117.3.255
+Microsoft Corp UU-207-18-117 (NET-207-18-117-0-1) 207.18.117.0 - 207.18.117.255
+Microsoft Corp CW-208-139-27-B (NET-208-139-27-0-1) 208.139.27.0 - 208.139.27.255
+Microsoft Corp MICROSOFT55 (NET-209-28-213-0-1) 209.28.213.0 - 209.28.213.255
+Microsoft Corp MICROSOFT50 (NET-207-209-68-0-1) 207.209.68.0 - 207.209.68.255
+Microsoft Corp SPRINT-CC5F6F (NET-204-95-96-0-1) 204.95.96.0 - 204.95.111.255
+Microsoft Corp CYBR-LCCLAB (NET-207-158-93-192-1) 207.158.93.192 - 207.158.93.223
+Microsoft Corp MSBPN-2 (NET-207-240-123-192-1) 207.240.123.192 - 207.240.123.223
+Microsoft Corp SPRINT-D01ACD (NET-208-26-205-0-1) 208.26.205.0 - 208.26.205.255
+Microsoft Corp MICROSOFT-CORP-MSN-2 (NET-192-197-157-0-1) 192.197.157.0 - 192.197.157.255
+Microsoft Corp MICROSOFTDENVER (NET-204-133-231-0-1) 204.133.231.0 - 204.133.231.255
+Microsoft Corp MICROSOFTG1-COM (NET-216-72-96-0-1) 216.72.96.0 - 216.72.99.255
+Microsoft Corp EACT-CUST-JLEZNEK (NET-207-229-166-152-1) 207.229.166.152 - 207.229.166.159
+Microsoft Corp SPRINT-CC5F95-8 (NET-204-95-149-0-1) 204.95.149.0 - 204.95.149.255
+Microsoft Corp NET-CSAMSI (NET-209-192-213-72-1) 209.192.213.72 - 209.192.213.79
+Microsoft Corp MICROSOFT57 (NET-206-73-203-0-1) 206.73.203.0 - 206.73.203.255
+Microsoft Corp MICROSOFT56 (NET-206-73-118-0-1) 206.73.118.0 - 206.73.118.255
+Microsoft Corp QWEST-208-45-54-16 (NET-208-45-54-16-1) 208.45.54.16 - 208.45.54.23
+Microsoft Corp QWEST-208-45-54-8 (NET-208-45-54-8-1) 208.45.54.8 - 208.45.54.15
+Microsoft Corp MICROSOFT58 (NET-206-73-31-0-1) 206.73.31.0 - 206.73.31.255
+Microsoft Corp SPRINT-3FA132 (NET-63-161-50-128-1) 63.161.50.128 - 63.161.50.255
+Microsoft Corp SPRINT-3FA132-6 (NET-63-161-50-0-1) 63.161.50.0 - 63.161.50.127
+Microsoft Corp MICROSOFT-8-18 (NET-207-240-8-224-1) 207.240.8.224 - 207.240.8.239
+Microsoft Corp MICROSOFT-BBLK (NET-157-54-0-0-1) 157.54.0.0 - 157.60.255.255
+Microsoft Corp QWEST-208-45-89-248A (NET-208-45-89-248-1) 208.45.89.248 - 208.45.89.255
+Microsoft Corp MICROSOFT61 (NET-206-182-69-0-1) 206.182.69.0 - 206.182.69.255
+Microsoft Corp MICROSOFT63 (NET-206-182-240-0-1) 206.182.240.0 - 206.182.240.255
+Microsoft Corp MICROSOFT64 (NET-206-182-241-0-1) 206.182.241.0 - 206.182.241.255
+Microsoft Corp MICROSOFT59 (NET-206-73-67-0-1) 206.73.67.0 - 206.73.67.255
+Microsoft Corp MICROSOFT66 (NET-206-182-251-0-1) 206.182.251.0 - 206.182.251.255
+Microsoft Corp MICROSOFT65 (NET-206-182-247-0-1) 206.182.247.0 - 206.182.247.255
+Microsoft Corp MICROSOFT62 (NET-206-182-236-0-1) 206.182.236.0 - 206.182.236.255
+Microsoft Corp QWEST-63-236-198-64 (NET-63-236-198-64-1) 63.236.198.64 - 63.236.198.71
+Microsoft Corp QWEST-63-236-198-152 (NET-63-236-198-152-1) 63.236.198.152 - 63.236.198.159
+Microsoft Corp ERMS-6799349 (NET-165-121-253-232-1) 165.121.253.232 - 165.121.253.239
+Microsoft Corp QWEST-63-236-170-64 (NET-63-236-170-64-1) 63.236.170.64 - 63.236.170.71
+Microsoft Corp QWEST-63-236-186-64 (NET-63-236-186-64-1) 63.236.186.64 - 63.236.186.71
+Microsoft Corp QWEST-63-236-187-104 (NET-63-236-187-104-1) 63.236.187.104 - 63.236.187.111
+Microsoft Corp QWEST-63-236-187-128 (NET-63-236-187-128-1) 63.236.187.128 - 63.236.187.135
+Microsoft Corp QWEST-63-236-187-160 (NET-63-236-187-160-1) 63.236.187.160 - 63.236.187.167
+Microsoft Corp FON-3338832128690 (NET-199-2-137-0-1) 199.2.137.0 - 199.2.137.255
+Microsoft Corp CUST-86-24614 (NET-216-222-104-224-1) 216.222.104.224 - 216.222.104.239
+Microsoft Corp QWEST-63-151-87-64 (NET-63-151-87-64-1) 63.151.87.64 - 63.151.87.71
+Microsoft Corp HP-64-77-82-96 (NET-64-77-82-96-1) 64.77.82.96 - 64.77.82.103
+Microsoft Corp HP-64-77-93-80 (NET-64-77-93-80-1) 64.77.93.80 - 64.77.93.95
+Microsoft Corp MICROSOFT-1BLK (NET-65-52-0-0-1) 65.52.0.0 - 65.55.255.255
+Microsoft Corp MICROSOFT-GLOBAL-NET (NET-207-46-0-0-1) 207.46.0.0 - 207.46.255.255
+Microsoft Corp MICROSOFT-CORP-MSN-BLK (NET-207-68-128-0-1) 207.68.128.0 - 207.68.207.255
+Microsoft Corp FON-343451648081865 (NET-204-182-144-0-1) 204.182.144.0 - 204.182.159.255
+Microsoft Corp FON-346312755281299 (NET-206-107-34-0-1) 206.107.34.0 - 206.107.34.255
+Microsoft Corp FON-34550983681918 (NET-205-240-158-0-1) 205.240.158.0 - 205.240.159.255
+Microsoft Corp MICROSOFT-PLACEWARE-2 (NET-204-79-252-0-1) 204.79.252.0 - 204.79.252.255
+Microsoft Corp WLCO-TWC1057147-MICROSOFT (NET-64-200-211-16-1) 64.200.211.16 - 64.200.211.31
+Microsoft Corp MICROSOF81-163-0 (NET-12-178-163-0-1) 12.178.163.0 - 12.178.163.31
+Microsoft Corp WLCO-TWC1057147-MICROSOFT-1 (NET-69-44-126-80-1) 69.44.126.80 - 69.44.126.95
+Microsoft Corp SPRINTLINK (NET-63-173-42-128-1) 63.173.42.128 - 63.173.42.255
+Microsoft Corp MICROSOF33-108-0 (NET-12-28-108-0-1) 12.28.108.0 - 12.28.108.127
+Microsoft Corp SPRINTLINK (NET-65-170-29-0-1) 65.170.29.0 - 65.170.29.7
+Microsoft Corp Q0903-67-132-133-96 (NET-67-132-133-96-1) 67.132.133.96 - 67.132.133.103
+Microsoft Corp MICROSOFT-IPV6-BLK (NET6-2001-4898-1) 2001:4898:0000:0000:0000:0000:0000:0000 - 2001:4898:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
+Microsoft Corp LVLT-MSFT-8-6-176 (NET-8-6-176-0-1) 8.6.176.0 - 8.6.176.255
+Microsoft Corp MICROSOFT33 (NET-205-248-80-0-1) 205.248.80.0 - 205.248.129.255
+Microsoft Corp Q0523-63-148-123-240 (NET-63-148-123-240-1) 63.148.123.240 - 63.148.123.247
+Microsoft Corp SAVV-S233608-1 (NET-64-41-193-0-1) 64.41.193.0 - 64.41.193.255
+Microsoft Corp SAVV-S233053-1 (NET-64-85-70-32-1) 64.85.70.32 - 64.85.70.47
+Microsoft Corp SAVV-S233053-2 (NET-64-85-81-96-1) 64.85.81.96 - 64.85.81.103
+Microsoft Corp SAVV-S233053-3 (NET-64-85-81-104-1) 64.85.81.104 - 64.85.81.111
+Microsoft Corp SAVV-S233053-7 (NET-216-32-168-224-1) 216.32.168.224 - 216.32.168.255
+Microsoft Corp SAVV-S233053-6 (NET-206-79-74-32-1) 206.79.74.32 - 206.79.74.47
+Microsoft Corp SAVV-S233053-8 (NET-216-32-175-224-1) 216.32.175.224 - 216.32.175.255
+Microsoft Corp SAVV-S233053-9 (NET-216-32-180-0-1) 216.32.180.0 - 216.32.183.255
+Microsoft Corp SAVV-S233053-11 (NET-216-33-229-224-1) 216.33.229.224 - 216.33.229.255
+Microsoft Corp SAVV-S233053-12 (NET-216-33-236-0-1) 216.33.236.0 - 216.33.239.255
+Microsoft Corp SAVV-S233053-13 (NET-216-33-240-0-1) 216.33.240.0 - 216.33.243.255
+Microsoft Corp SAVV-S233053-10 (NET-216-32-240-0-1) 216.32.240.0 - 216.32.243.255
+Microsoft Corp SAVV-S233608-3 (NET-216-34-51-0-1) 216.34.51.0 - 216.34.51.255
+Microsoft Corp SAVV-S233053-4 (NET-209-1-112-0-1) 209.1.112.0 - 209.1.112.255
+Microsoft Corp SAVV-S233053-5 (NET-209-1-113-0-1) 209.1.113.0 - 209.1.113.255
+Microsoft Corp SAVV-S233608-2 (NET-209-1-15-0-1) 209.1.15.0 - 209.1.15.255
+Microsoft Corp SAVV-S233608-4 (NET-216-34-53-176-1) 216.34.53.176 - 216.34.53.191
+Microsoft Corp SAVV-S233608-5 (NET-216-35-8-224-1) 216.35.8.224 - 216.35.8.239
+Microsoft Corp SAVV-S233053-14 (NET-209-185-128-0-1) 209.185.128.0 - 209.185.131.255
+Microsoft Corp Q0112-65-114-175-128 (NET-65-114-175-128-1) 65.114.175.128 - 65.114.175.159
+Microsoft Corp SAVV-S233053-15 (NET-64-15-229-96-1) 64.15.229.96 - 64.15.229.127
+Microsoft Corp SAVV-S233050-5 (NET-64-15-177-0-1) 64.15.177.0 - 64.15.177.255
+Microsoft Corp SAVV-S233050-4 (NET-64-15-170-192-1) 64.15.170.192 - 64.15.170.199
+Microsoft Corp SAVV-S233050-2 (NET-209-143-238-0-1) 209.143.238.0 - 209.143.238.255
+Microsoft Corp SAVV-S233050-6 (NET-64-15-178-0-1) 64.15.178.0 - 64.15.178.255
+Microsoft Corp SAVV-S232995-2 (NET-66-35-209-120-1) 66.35.209.120 - 66.35.209.127
+Microsoft Corp SAVV-S232995-3 (NET-66-35-211-128-1) 66.35.211.128 - 66.35.211.191
+Microsoft Corp SAVV-S232995-1 (NET-66-35-208-48-1) 66.35.208.48 - 66.35.208.63
+Microsoft Corp SAVV-S233053-16 (NET-216-33-148-0-1) 216.33.148.0 - 216.33.151.255
+Microsoft Corp., MSN Operations SAVV-S233052-4 (NET-216-35-66-88-1) 216.35.66.88 - 216.35.66.95
+MICROSOFT CORPORATION MICROSOF32-32-160 (NET-12-230-32-160-1) 12.230.32.160 - 12.230.32.167
+MICROSOFT CORPORATION MICROSOF43-124-0 (NET-12-53-124-0-1) 12.53.124.0 - 12.53.124.31
+MICROSOFT CORPORATION MICROSOF82-18-96 (NET-12-232-18-96-1) 12.232.18.96 - 12.232.18.127
+MICROSOFT CORPORATION MICROSOF25-158 (NET-12-190-158-0-1) 12.190.158.0 - 12.190.158.255
+MICROSOFT CORPORATION MICROSOF61-196-32 (NET-12-71-196-32-1) 12.71.196.32 - 12.71.196.47
+Microsoft Corporation MICROSOFT-ONLINE-SERVICES (NET-209-240-192-0-1) 209.240.192.0 - 209.240.223.255
+Microsoft Corporation MICROSOFT-DYNAMIC-HOSTING (NET-70-37-0-0-1) 70.37.0.0 - 70.37.191.255
+Microsoft Corporation MS-ONLINE-SERVICES-NJ (NET-70-37-128-0-1) 70.37.128.0 - 70.37.129.255
+Microsoft Corporation MS-GLOBAL-ONLINE-SERVICES (NET-70-37-135-0-1) 70.37.135.0 - 70.37.135.255
+MICROSOFT CORPORATION MICROSOF82-87-192 (NET-12-49-87-192-1) 12.49.87.192 - 12.49.87.255
+Microsoft MICROSOFT (NET-74-93-205-144-1) 74.93.205.144 - 74.93.205.151
+Microsoft MICROSOFT (NET-74-93-205-152-1) 74.93.205.152 - 74.93.205.159
+Microsoft MICROSOFT (NET-74-93-206-64-1) 74.93.206.64 - 74.93.206.71
+Microsoft MICROSOFT (NET-70-89-139-120-1) 70.89.139.120 - 70.89.139.127
+Microsoft DIRECP-NET1-206-71-11 (NET-206-71-119-0-1) 206.71.119.0 - 206.71.119.255
+Microsoft DIRECP-NET1-117 (NET-206-71-117-0-1) 206.71.117.0 - 206.71.117.255
+Microsoft DIRECP-NET1-118 (NET-206-71-118-0-1) 206.71.118.0 - 206.71.118.255
+Microsoft UUHIL-BLK1-C155-112 (NET-209-154-155-112-1) 209.154.155.112 - 209.154.155.119
+Microsoft SBCIS-101411-164355 (NET-65-68-62-152-1) 65.68.62.152 - 65.68.62.159
+MICROSOFT SBC067039208168020503 (NET-67-39-208-168-1) 67.39.208.168 - 67.39.208.175
+Microsoft UU-65-242-67 (NET-65-242-67-0-1) 65.242.67.0 - 65.242.67.255
+Microsoft CW-204-71-191-0 (NET-204-71-191-0-1) 204.71.191.0 - 204.71.191.255
+Microsoft SBC063194155144021023 (NET-63-194-155-144-1) 63.194.155.144 - 63.194.155.151
+Microsoft SBC066136085192030113 (NET-66-136-85-192-1) 66.136.85.192 - 66.136.85.199
+MICROSOFT MFN-T280-64-124-184-72-29 (NET-64-124-184-72-1) 64.124.184.72 - 64.124.184.79
+MICROSOFT MFN-T133-216-200-206-0-24 (NET-216-200-206-0-1) 216.200.206.0 - 216.200.206.255
+Microsoft UU-63-80-93-D4 (NET-63-80-93-0-1) 63.80.93.0 - 63.80.93.127
+Microsoft RSPC-1218167167199384 (NET-67-192-225-208-1) 67.192.225.208 - 67.192.225.223
+Microsoft CVNET-454AA20 (NET-69-74-162-0-1) 69.74.162.0 - 69.74.162.255
+Microsoft UU-65-221-5 (NET-65-221-5-0-1) 65.221.5.0 - 65.221.5.255
+Microsoft - Partner Campaign Builder (PCB) MICROSOFT-PARTNER-CAMPAIGN-BUILDER-PCB (NET-216-182-89-192-1) 216.182.89.192 - 216.182.89.207
+Microsoft - Partner Campaign Builder (PCB) MICROSOFT-PARTNER-CAMPAIGN-BUILDER-PCB (NET-216-182-89-48-1) 216.182.89.48 - 216.182.89.63
+MICROSOFT AUSTIN-STO UU-65-248-85-D4 (NET-65-248-85-0-1) 65.248.85.0 - 65.248.85.255
+Microsoft Canada MIC0923-CA (NET-199-243-157-192-1) 199.243.157.192 - 199.243.157.223
+Microsoft Canada MIC0702-CA (NET-199-243-157-112-1) 199.243.157.112 - 199.243.157.119
+Microsoft Corp UU-65-194-210-224 (NET-65-194-210-224-1) 65.194.210.224 - 65.194.210.255
+Microsoft Corp UU-208-194-139 (NET-208-194-139-0-1) 208.194.139.0 - 208.194.139.255
+Microsoft Corp UU-208-204-49-128-B (NET-208-204-49-128-1) 208.204.49.128 - 208.204.49.255
+Microsoft Corp UU-208-205-26 (NET-208-205-26-0-1) 208.205.26.0 - 208.205.26.255
+Microsoft Corp UU-208-217-184-D1 (NET-208-217-184-0-1) 208.217.184.0 - 208.217.187.255
+Microsoft Corp UU-208-222-172 (NET-208-222-172-0-1) 208.222.172.0 - 208.222.172.255
+Microsoft Corp UU-208-224-200-64 (NET-208-224-200-64-1) 208.224.200.64 - 208.224.200.95
+Microsoft Corp UU-208-229-100-D1 (NET-208-229-100-0-1) 208.229.100.0 - 208.229.101.255
+Microsoft Corp UU-208-241-19 (NET-208-241-19-0-1) 208.241.19.0 - 208.241.19.15
+Microsoft Corp UU-208-241-19-16 (NET-208-241-19-16-1) 208.241.19.16 - 208.241.19.31
+Microsoft Corp UU-208-241-9-224 (NET-208-241-9-224-1) 208.241.9.224 - 208.241.9.239
+Microsoft Corp UU-208-244-108-D2 (NET-208-244-108-0-1) 208.244.108.0 - 208.244.108.15
+Microsoft Corp UU-208-245-16 (NET-208-245-16-0-1) 208.245.16.0 - 208.245.16.31
+Microsoft Corp UU-208-249-17-160 (NET-208-249-17-160-1) 208.249.17.160 - 208.249.17.175
+Microsoft Corp UU-63-104-216-D2 (NET-63-104-216-0-1) 63.104.216.0 - 63.104.216.127
+Microsoft Corp UU-63-69-245 (NET-63-69-245-0-1) 63.69.245.0 - 63.69.245.255
+Microsoft Corp SBC068090141072031030 (NET-68-90-141-72-1) 68.90.141.72 - 68.90.141.79
+Microsoft Corp 10825385 SBC06319812316029040317151513 (NET-63-198-123-160-1) 63.198.123.160 - 63.198.123.167
+MICROSOFT CORP-040821020257 SBC06824804806429040821020303 (NET-68-248-48-64-1) 68.248.48.64 - 68.248.48.71
+MICROSOFT CORP-040821020338 SBC06824804807229040821020347 (NET-68-248-48-72-1) 68.248.48.72 - 68.248.48.79
+MICROSOFT CORP-081024181821 SBC-99-49-8-248-29-0810241850 (NET-99-49-8-248-1) 99.49.8.248 - 99.49.8.255
+Microsoft Corp. HUGE-65-38-172-72-29 (NET-65-38-172-72-1) 65.38.172.72 - 65.38.172.79
+Microsoft Corp. HUGE-65-38-172-96-28 (NET-65-38-172-96-1) 65.38.172.96 - 65.38.172.111
+Microsoft Corporation MICROSOFT-CORPORATION (NET-75-149-174-16-1) 75.149.174.16 - 75.149.174.23
+Microsoft Corporation MICROSOFT-CORPORATION (NET-75-151-100-240-1) 75.151.100.240 - 75.151.100.255
+Microsoft Corporation SPEK-647057-0 (NET-64-81-8-96-1) 64.81.8.96 - 64.81.8.127
+Microsoft Corporation SBC067112255144030130 (NET-67-112-255-144-1) 67.112.255.144 - 67.112.255.151
+Microsoft Corporation ATTENS-010075-004522 (NET-63-240-201-176-1) 63.240.201.176 - 63.240.201.191
+Microsoft Corporation ATTENS-010075-004523 (NET-206-16-209-208-1) 206.16.209.208 - 206.16.209.223
+Microsoft Corporation ATTENS-010075-004525 (NET-63-240-195-208-1) 63.240.195.208 - 63.240.195.223
+Microsoft Corporation ATTENS-010075-004526 (NET-206-16-204-64-1) 206.16.204.64 - 206.16.204.79
+Microsoft Corporation ATTENS-010075-004450 (NET-206-16-223-0-1) 206.16.223.0 - 206.16.223.255
+Microsoft Corporation ATTENS-010075-005028 (NET-63-240-216-0-1) 63.240.216.0 - 63.240.219.255
+Microsoft Corporation ATTENS-010075-005057 (NET-63-240-220-0-1) 63.240.220.0 - 63.240.223.255
+Microsoft Corporation ATTENS-010075-005135 (NET-206-16-246-24-1) 206.16.246.24 - 206.16.246.31
+Microsoft Corporation ATTENS-010075-004524 (NET-63-240-195-192-1) 63.240.195.192 - 63.240.195.207
+Microsoft Corporation ATTENS-010075-005880 (NET-206-16-224-160-1) 206.16.224.160 - 206.16.224.191
+Microsoft Corporation (managed segment) RSPC-1229444888833780 (NET-98-129-187-144-1) 98.129.187.144 - 98.129.187.151
+Microsoft Corporation - Secure Dimensions ( RSPC-33955-12072007 (NET-67-192-39-48-1) 67.192.39.48 - 67.192.39.63
+Microsoft Corporation - Whale RSPC-108457-1170047010 (NET-72-32-240-160-1) 72.32.240.160 - 72.32.240.175
+Microsoft Corporation - Whale RSPC-108456-1173386392 (NET-72-32-201-152-1) 72.32.201.152 - 72.32.201.159
+MICROSOFT CROP SBC067039081152020503 (NET-67-39-81-152-1) 67.39.81.152 - 67.39.81.159
+Microsoft Education Programs RSPC-48725-1096578571 (NET-69-20-127-32-1) 69.20.127.32 - 69.20.127.39
+Microsoft License PNAP-SFJ-MSLI-RM-01 (NET-216-52-28-0-1) 216.52.28.0 - 216.52.28.255
+Microsoft License INAP-PHX003-MSLICENSE-25271 (NET-70-42-230-0-1) 70.42.230.0 - 70.42.231.255
+Microsoft License INAP-SFJ-MSLICENSE-13982 (NET-63-251-97-0-1) 63.251.97.0 - 63.251.97.255
+Microsoft Licensing SBC067120132128020815 (NET-67-120-132-128-1) 67.120.132.128 - 67.120.132.135
+Microsoft Licensing SBC067120132152020815 (NET-67-120-132-152-1) 67.120.132.152 - 67.120.132.159
+Microsoft Licensing SBC067120132192020816 (NET-67-120-132-192-1) 67.120.132.192 - 67.120.132.207
+Microsoft Licensing SBC0671201322080208
diff --git a/contrib/netbsd-tests/ipf/regress/p7.nat b/contrib/netbsd-tests/ipf/regress/p7.nat
new file mode 100644
index 0000000..3c3fa7c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p7.nat
@@ -0,0 +1 @@
+rewrite in on bge0 proto tcp from any to any port = 80 -> src 0/0 dst dstlist/servers;
diff --git a/contrib/netbsd-tests/ipf/regress/p7.pool b/contrib/netbsd-tests/ipf/regress/p7.pool
new file mode 100644
index 0000000..451b374d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p7.pool
@@ -0,0 +1,2 @@
+pool nat/dstlist (name servers; policy weighted connection;)
+ { 1.1.1.2; 1.1.1.4; 1.1.1.5; 1.1.1.9; };
diff --git a/contrib/netbsd-tests/ipf/regress/p9.nat b/contrib/netbsd-tests/ipf/regress/p9.nat
new file mode 100644
index 0000000..3c3fa7c
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p9.nat
@@ -0,0 +1 @@
+rewrite in on bge0 proto tcp from any to any port = 80 -> src 0/0 dst dstlist/servers;
diff --git a/contrib/netbsd-tests/ipf/regress/p9.pool b/contrib/netbsd-tests/ipf/regress/p9.pool
new file mode 100644
index 0000000..c452ffc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/regress/p9.pool
@@ -0,0 +1,2 @@
+pool nat/dstlist (name servers; policy round-robin;)
+ { 1.1.1.2; 1.1.1.4; 1.1.1.5; 1.1.1.9; };
diff --git a/contrib/netbsd-tests/ipf/t_bpf.sh b/contrib/netbsd-tests/ipf/t_bpf.sh
new file mode 100755
index 0000000..6d7d2e8
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/t_bpf.sh
@@ -0,0 +1,68 @@
+# $NetBSD: t_bpf.sh,v 1.3 2012/11/29 16:05:34 pgoyette Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+itest()
+{
+ h_copydata $1
+
+ case $3 in
+ ipf)
+ atf_check -o file:exp -e ignore ipf -Rnvf reg
+ ;;
+ ipftest)
+ atf_check -o file:exp ipftest -D -r reg -i /dev/null
+ ;;
+ esac
+}
+
+bpftest()
+{
+ h_copydata $(echo ${1} | tr _ -)
+ cp "$(atf_get_srcdir)/input/$(echo ${1} | sed s,bpf_,,)" in
+
+ { while read rule; do
+ atf_check -o save:save -x "echo '$rule' | ipftest -Rbr - -i in"
+ cat save >>out
+ echo "--------" >>out
+ done; } <reg
+
+ diff -u exp out || atf_fail "results differ"
+}
+
+broken_test_case bpf1 itest text ipf
+broken_test_case bpf_f1 bpftest text text
+
+atf_init_test_cases()
+{
+ atf_add_test_case bpf1
+ atf_add_test_case bpf_f1
+}
diff --git a/contrib/netbsd-tests/ipf/t_filter_exec.sh b/contrib/netbsd-tests/ipf/t_filter_exec.sh
new file mode 100755
index 0000000..e79dc90
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/t_filter_exec.sh
@@ -0,0 +1,175 @@
+# $NetBSD: t_filter_exec.sh,v 1.8 2013/03/17 03:00:05 jmmv Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+dotest()
+{
+ h_copydata $1
+ infmt=$2
+ outfmt=$3
+ shift
+ shift
+ shift
+ args=$@
+
+ if [ $outfmt = hex ] ; then
+ output=-x
+ else
+ output=
+ fi
+
+ { while read rule; do
+ atf_check -x "echo \"$rule\" | ipftest -F \
+$infmt $output -Rbr - -i in $args >>out"
+ echo "--------" >>out
+ done; } <reg
+
+ diff -u exp out || atf_fail "results differ"
+}
+
+mtest()
+{
+ h_copydata $1
+ infmt=$2
+ outfmt=$3
+ shift
+ shift
+ shift
+ args=$@
+
+ if [ $outfmt = hex ] ; then
+ output=-x
+ else
+ output=
+ fi
+
+
+ atf_check -o save:out ipftest -F $infmt $output -Rbr reg -i in $args
+ echo "--------" >>out
+
+ diff -u exp out || atf_fail "results differ"
+}
+
+dotest6()
+{
+ h_copydata $(echo ${1} | tr _ .)
+ infmt=$2
+ outfmt=$3
+ shift
+ shift
+ shift
+ args=$@
+
+ if [ $outfmt = hex ] ; then
+ output=-x
+ else
+ output=
+ fi
+
+
+ ipftest -6 -r /dev/null -i /dev/null >/dev/null 2>&1 \
+ || atf_skip "skipping IPv6 tests"
+
+ { while read rule; do
+ atf_check -o save:save -x "echo \"$rule\" | \
+ipftest -F $infmt $output -6br - -i in $args"
+ cat save >>out
+ echo "--------" >>out
+ done; } <reg
+
+ diff -u exp out || atf_fail "results differ"
+}
+
+test_case f1 dotest text text
+test_case f2 dotest text text
+test_case f3 dotest text text
+test_case f4 dotest text text
+test_case f5 dotest text text
+test_case f6 dotest text text
+test_case f7 dotest text text
+test_case f8 dotest text text
+test_case f9 dotest text text
+test_case f10 dotest text text
+test_case f11 dotest text text -D
+test_case f12 dotest hex hex
+test_case f13 dotest hex hex
+test_case f14 dotest text text
+test_case f15 mtest text text
+test_case f16 mtest text text
+test_case f17 mtest hex hex
+test_case f18 mtest text text -D
+test_case f19 dotest text text -T state_max=3
+test_case f20 mtest text text
+test_case f24 mtest hex text
+test_case f25 mtest hex text -D
+failing_test_case f26 dotest "Known to be broken" text text
+failing_test_case f27 dotest "Known to be broken" hex text
+test_case f30 dotest text text
+test_case ipv6_1 dotest6 hex hex
+test_case ipv6_2 dotest6 hex hex
+test_case ipv6_3 dotest6 hex hex
+test_case ipv6_5 dotest6 hex hex
+test_case ipv6_6 dotest6 hex text
+
+atf_init_test_cases()
+{
+ atf_add_test_case f1
+ atf_add_test_case f2
+ atf_add_test_case f3
+ atf_add_test_case f4
+ atf_add_test_case f5
+ atf_add_test_case f6
+ atf_add_test_case f7
+ atf_add_test_case f8
+ atf_add_test_case f9
+ atf_add_test_case f10
+ atf_add_test_case f11
+ atf_add_test_case f12
+ atf_add_test_case f13
+ atf_add_test_case f14
+ atf_add_test_case f15
+ atf_add_test_case f16
+ atf_add_test_case f17
+ atf_add_test_case f18
+ atf_add_test_case f19
+ atf_add_test_case f20
+ atf_add_test_case f24
+ atf_add_test_case f25
+ atf_add_test_case f26
+ atf_add_test_case f27
+ atf_add_test_case f30
+ atf_add_test_case ipv6_1
+ atf_add_test_case ipv6_2
+ atf_add_test_case ipv6_3
+ atf_add_test_case ipv6_5
+ atf_add_test_case ipv6_6
+
+}
diff --git a/contrib/netbsd-tests/ipf/t_filter_parse.sh b/contrib/netbsd-tests/ipf/t_filter_parse.sh
new file mode 100755
index 0000000..f44db7d
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/t_filter_parse.sh
@@ -0,0 +1,135 @@
+# $NetBSD: t_filter_parse.sh,v 1.11 2014/06/29 09:27:58 darrenr Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+itest()
+{
+ h_copydata $1
+
+ case $3 in
+ ipf)
+ atf_check -o file:exp -e ignore ipf -Rnvf reg
+ ;;
+ ipftest)
+ atf_check -o file:exp ipftest -D -r reg -i /dev/null
+ ;;
+ esac
+}
+
+itest_i19()
+{
+ cp "$(atf_get_srcdir)/expected/i19.dist" .
+
+ if [ "`grep LOG_SECURITY /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
+ if [ "`grep LOG_AUDIT /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
+ sed -e 's/security/!!!/g' i19.dist > i19.p1;
+ else
+ sed -e 's/security/audit/g' i19.dist > i19.p1;
+ fi
+ else
+ cp i19.dist i19.p1;
+ fi
+ if [ "`grep LOG_AUTHPRIV /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
+ sed -e 's/authpriv/!!!/g' i19.p1 > i19.p2;
+ else
+ cp i19.p1 i19.p2;
+ fi
+ if [ "`grep LOG_LOGALERT /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
+ sed -e 's/logalert/!!!/g' i19.p2 > i19.p1;
+ else
+ cp i19.p2 i19.p1;
+ fi
+ if [ "`grep LOG_FTP /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
+ sed -e 's/ftp/!!!/g' i19.p1 > i19.p2;
+ else
+ cp i19.p1 i19.p2;
+ fi
+ if [ "`egrep 'LOG_CRON.*15' /usr/include/sys/syslog.h 2>&1`" != "" ] ; then
+ sed -e 's/cron/cron2/g' i19.p2 > i19;
+ else
+ cp i19.p2 i19;
+ fi
+ /bin/rm i19.p?
+
+ mv i19 exp
+ itest "$@"
+}
+
+test_case i1 itest text ipf
+test_case i2 itest text ipf
+test_case i3 itest text ipf
+test_case i4 itest text ipf
+test_case i5 itest text ipf
+test_case i6 itest text ipf
+test_case i7 itest text ipf
+test_case i8 itest text ipf
+test_case i9 itest text ipf
+test_case i10 itest text ipf
+test_case i11 itest text ipf
+test_case i12 itest text ipf
+test_case i13 itest text ipf
+test_case i14 itest text ipf
+test_case i15 itest text ipf
+test_case i16 itest text ipf
+failing_test_case i17 itest "Known to be broken" text ipftest
+test_case i18 itest text ipf
+test_case i19 itest_i19 text ipf
+test_case i20 itest text ipf
+test_case i21 itest text ipf
+test_case i22 itest text ipf
+test_case i23 itest text ipf
+
+atf_init_test_cases()
+{
+ atf_add_test_case i1
+ atf_add_test_case i2
+ atf_add_test_case i3
+ atf_add_test_case i4
+ atf_add_test_case i5
+ atf_add_test_case i6
+ atf_add_test_case i7
+ atf_add_test_case i8
+ atf_add_test_case i9
+ atf_add_test_case i10
+ atf_add_test_case i11
+ atf_add_test_case i12
+ atf_add_test_case i13
+ atf_add_test_case i14
+ atf_add_test_case i15
+ atf_add_test_case i16
+ atf_add_test_case i17
+ atf_add_test_case i18
+ atf_add_test_case i19
+ atf_add_test_case i20
+ atf_add_test_case i21
+ atf_add_test_case i22
+ atf_add_test_case i23
+}
diff --git a/contrib/netbsd-tests/ipf/t_logging.sh b/contrib/netbsd-tests/ipf/t_logging.sh
new file mode 100755
index 0000000..00317d9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/t_logging.sh
@@ -0,0 +1,80 @@
+# $NetBSD: t_logging.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+logtest()
+{
+ h_copydata $1
+ cp $(atf_get_srcdir)/expected/$1.b exp.b
+
+ case `uname -s` in
+ OSF1)
+ GMT=:
+ ;;
+ *)
+ GMT=GMT
+ ;;
+ esac
+
+ { while read rule; do
+ echo $rule >>out
+ atf_check -o ignore -x \
+ "echo $rule | ipftest -br - -F $2 -i in -l logout"
+
+ atf_check -o save:save -x "TZ=$GMT ipmon -P /dev/null -f logout"
+ cat save >>out
+ echo "--------" >>out
+
+ atf_check -o save:save -x "TZ=$GMT ipmon -P /dev/null -bf logout"
+ cat save >>out.b
+ echo "--------" >>out.b
+ done; } <reg
+
+ atf_check -o ignore ipftest -br reg -F $2 -i in -l logout
+
+ atf_check -o save:save -x "TZ=$GMT ipmon -P /dev/null -f logout"
+ cat save >>out
+ echo "--------" >>out
+
+ atf_check -o save:save -x "TZ=$GMT ipmon -P /dev/null -bf logout"
+ cat save >>out.b
+ echo "--------" >>out.b
+
+ diff -u exp out || atf_fail "results differ"
+ diff -u exp.b out.b || atf_fail "results differ"
+}
+
+test_case l1 logtest hex hex
+
+atf_init_test_cases()
+{
+ atf_add_test_case l1
+}
diff --git a/contrib/netbsd-tests/ipf/t_nat_exec.sh b/contrib/netbsd-tests/ipf/t_nat_exec.sh
new file mode 100755
index 0000000..78110dc
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/t_nat_exec.sh
@@ -0,0 +1,140 @@
+# $NetBSD: t_nat_exec.sh,v 1.20 2014/07/15 20:00:23 martin Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+nattest()
+{
+ h_copydata $1
+ infmt=$2
+ outfmt=$3
+ shift
+ shift
+ shift
+ args=$@
+
+ if [ $outfmt = hex ] ; then
+ format="-xF $infmt"
+ else
+ format="-F $infmt"
+ fi
+
+ format="$format"
+
+ test -f in && test -f reg || atf_fail "Test input file missing"
+
+ { while read rule; do
+ atf_check -o save:save -x \
+ "echo \"$rule\" | ipftest $format -RDbN - -i in $args"
+ cat save >>out
+ echo "-------------------------------" >>out
+ done; } <reg
+
+ diff -u exp out || atf_fail "results differ"
+}
+
+test_case n1 nattest text text
+test_case n2 nattest text text
+test_case n3 nattest text text
+test_case n4 nattest text text
+test_case n5 nattest text text
+test_case n6 nattest text text
+test_case n7 nattest text text
+test_case n8 nattest hex hex -T update_ipid=0
+test_case n9 nattest hex hex -T update_ipid=0
+test_case n10 nattest hex hex -T update_ipid=0
+test_case n11 nattest text text
+failing_test_case n12 nattest "Known to be broken" hex hex -T update_ipid=0 -v
+test_case n13 nattest text text
+failing_test_case_be n14 nattest "See PR kern/47665" text text
+test_case n15 nattest text text -T update_ipid=0
+test_case n16 nattest hex hex -D
+test_case n17 nattest hex hex -D
+test_case n100 nattest text text
+test_case n101 nattest text text
+test_case n102 nattest text text
+test_case n103 nattest text text
+test_case n104 nattest hex hex -T update_ipid=0
+test_case n105 nattest hex hex -T update_ipid=0
+test_case n106 nattest hex hex -T update_ipid=0
+test_case n200 nattest hex hex -T update_ipid=0
+test_case n1_6 nattest text text -6
+test_case n2_6 nattest text text -6
+#test_case n3_6 nattest text text -6
+test_case n4_6 nattest text text -6
+test_case n5_6 nattest text text -6
+test_case n6_6 nattest text text -6
+test_case n7_6 nattest text text -6
+failing_test_case_be n8_6 nattest "See PR kern/47665" hex hex -6
+failing_test_case_be n9_6 nattest "See PR kern/47665" hex hex -6
+test_case n11_6 nattest text text -6
+test_case n12_6 nattest hex hex -6
+test_case n15_6 nattest text text -6
+
+atf_init_test_cases()
+{
+ atf_add_test_case n1
+ atf_add_test_case n2
+ atf_add_test_case n3
+ atf_add_test_case n4
+ atf_add_test_case n5
+ atf_add_test_case n6
+ atf_add_test_case n7
+ atf_add_test_case n8
+ atf_add_test_case n9
+ atf_add_test_case n10
+ atf_add_test_case n11
+ atf_add_test_case n12
+ atf_add_test_case n13
+ atf_add_test_case n14
+ atf_add_test_case n16
+ atf_add_test_case n17
+ atf_add_test_case n100
+ atf_add_test_case n101
+ atf_add_test_case n102
+ atf_add_test_case n103
+ atf_add_test_case n104
+ atf_add_test_case n105
+ atf_add_test_case n106
+ atf_add_test_case n200
+
+ atf_add_test_case n1_6
+ atf_add_test_case n2_6
+# atf_add_test_case n3_6
+ atf_add_test_case n4_6
+ atf_add_test_case n5_6
+ atf_add_test_case n6_6
+ atf_add_test_case n7_6
+ atf_add_test_case n8_6
+ atf_add_test_case n9_6
+ atf_add_test_case n11_6
+ atf_add_test_case n12_6
+ atf_add_test_case n15_6
+}
diff --git a/contrib/netbsd-tests/ipf/t_nat_ipf_exec.sh b/contrib/netbsd-tests/ipf/t_nat_ipf_exec.sh
new file mode 100755
index 0000000..663edb9
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/t_nat_ipf_exec.sh
@@ -0,0 +1,120 @@
+# $NetBSD: t_nat_ipf_exec.sh,v 1.7 2012/07/07 23:29:44 pgoyette Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+natipftest()
+{
+ h_copydata $1
+ cp $(atf_get_srcdir)/regress/$1.nat nat
+ cp $(atf_get_srcdir)/regress/$1.ipf ipf
+ many=$2
+ infmt=$3
+ outfmt=$4
+ shift
+ shift
+ shift
+ shift
+ args=$@
+
+ if [ $outfmt = hex ] ; then
+ format="-xF $infmt"
+ else
+ format="-F $infmt"
+ fi
+
+ case $many in
+ single)
+ { while read rule; do
+ atf_check -o save:save -x "echo \"$rule\" | \
+ipftest -R $format -b -r ipf -N - -i in $args"
+ cat save >>out
+ echo "-------------------------------" >>out
+ done; } <nat
+ ;;
+ multi)
+ atf_check -o save:out ipftest -R $args \
+ $format -b -r ipf -N nat -i in
+ echo "-------------------------------" >>out
+ ;;
+ esac
+
+ diff -u exp out || atf_fail "results differ"
+}
+
+test_case ni1 natipftest multi hex hex -T update_ipid=1
+test_case ni2 natipftest single hex hex -T update_ipid=1
+test_case ni3 natipftest single hex hex -T update_ipid=1
+test_case ni4 natipftest single hex hex -T update_ipid=1
+test_case ni5 natipftest single hex hex -T update_ipid=1
+test_case ni6 natipftest multi hex text -T update_ipid=1 -D
+test_case ni7 natipftest single hex hex -T update_ipid=1
+test_case ni8 natipftest single hex hex -T update_ipid=1
+test_case ni9 natipftest single hex hex -T update_ipid=1
+test_case ni10 natipftest single hex hex -T update_ipid=1
+test_case ni11 natipftest single hex hex -T update_ipid=1
+test_case ni12 natipftest single hex hex -T update_ipid=1
+test_case ni13 natipftest single hex hex -T update_ipid=1
+test_case ni14 natipftest single hex hex -T update_ipid=1
+test_case ni15 natipftest single hex hex -T update_ipid=1
+test_case ni16 natipftest single hex hex -T update_ipid=1
+test_case ni17 natipftest multi text text
+test_case ni18 natipftest multi text text
+test_case ni19 natipftest single hex hex -T update_ipid=0
+test_case ni20 natipftest single hex hex -T update_ipid=0 -D
+test_case ni21 natipftest multi text text
+test_case ni23 natipftest multi text text -D
+
+atf_init_test_cases()
+{
+ atf_add_test_case ni1
+ atf_add_test_case ni2
+ atf_add_test_case ni3
+ atf_add_test_case ni4
+ atf_add_test_case ni5
+ atf_add_test_case ni6
+ atf_add_test_case ni7
+ atf_add_test_case ni8
+ atf_add_test_case ni9
+ atf_add_test_case ni10
+ atf_add_test_case ni11
+ atf_add_test_case ni12
+ atf_add_test_case ni13
+ atf_add_test_case ni14
+ atf_add_test_case ni15
+ atf_add_test_case ni16
+ atf_add_test_case ni17
+ atf_add_test_case ni18
+ atf_add_test_case ni19
+ atf_add_test_case ni20
+ atf_add_test_case ni21
+ atf_add_test_case ni23
+
+}
diff --git a/contrib/netbsd-tests/ipf/t_nat_parse.sh b/contrib/netbsd-tests/ipf/t_nat_parse.sh
new file mode 100755
index 0000000..ddc7a32
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/t_nat_parse.sh
@@ -0,0 +1,83 @@
+# $NetBSD: t_nat_parse.sh,v 1.8 2014/06/29 09:26:32 darrenr Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+intest()
+{
+ h_copydata $1
+
+ atf_check -o file:exp -e ignore ipnat -Rnvf reg
+}
+
+test_case in1 intest text text
+test_case in2 intest text text
+test_case in3 intest text text
+test_case in4 intest text text
+test_case in5 intest text text
+test_case in6 intest text text
+test_case in7 intest text text
+test_case in100 intest text text
+test_case in101 intest text text
+test_case in102 intest text text
+test_case in1_6 intest text text
+test_case in2_6 intest text text
+test_case in3_6 intest text text
+test_case in4_6 intest text text
+test_case in5_6 intest text text
+test_case in6_6 intest text text
+test_case in8_6 intest text text
+test_case in100_6 intest text text
+test_case in101_6 intest text text
+test_case in102_6 intest text text
+
+atf_init_test_cases()
+{
+ atf_add_test_case in1
+ atf_add_test_case in2
+ atf_add_test_case in3
+ atf_add_test_case in4
+ atf_add_test_case in5
+ atf_add_test_case in6
+ atf_add_test_case in7
+ atf_add_test_case in100
+ atf_add_test_case in101
+ atf_add_test_case in102
+ atf_add_test_case in1_6
+ atf_add_test_case in2_6
+ atf_add_test_case in3_6
+ atf_add_test_case in4_6
+ atf_add_test_case in5_6
+ atf_add_test_case in6_6
+ atf_add_test_case in8_6
+ atf_add_test_case in100_6
+ atf_add_test_case in101_6
+ atf_add_test_case in102_6
+}
diff --git a/contrib/netbsd-tests/ipf/t_pools.sh b/contrib/netbsd-tests/ipf/t_pools.sh
new file mode 100755
index 0000000..33b5cb2
--- /dev/null
+++ b/contrib/netbsd-tests/ipf/t_pools.sh
@@ -0,0 +1,103 @@
+# $NetBSD: t_pools.sh,v 1.8 2012/12/03 23:39:30 pgoyette Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# See the IPFILTER.LICENCE file for details on licencing.
+#
+
+iptest()
+{
+ h_copydata $1
+ mkdir input
+ cp $(atf_get_srcdir)/input/ip2.data input/
+
+ atf_check -o file:exp -e ignore ippool -f reg -nRv
+}
+
+ptest()
+{
+ h_copydata $1
+ cp $(atf_get_srcdir)/regress/$1.pool pool 2>/dev/null
+ if [ -f $(atf_get_srcdir)/regress/$1.nat ] ; then
+ cp $(atf_get_srcdir)/regress/$1.nat nat
+ else
+ cp $(atf_get_srcdir)/regress/$1.ipf ipf
+ fi
+
+ if [ -f pool ] ; then
+ if [ -f nat ] ; then
+ atf_check -o save:out ipftest -RD -b -P pool -N nat -i in
+ else
+ atf_check -o save:out ipftest -RD -b -P pool -r ipf -i in
+ fi
+ else
+ atf_check -o save:out ipftest -RD -b -r ipf -i in
+ fi
+
+ echo "-------------------------------" >>out
+
+}
+
+test_case f28 ptest text text
+test_case f29 ptest text text
+test_case p1 ptest text text
+test_case p2 ptest text text
+test_case p3 ptest text text
+test_case p4 ptest text text
+test_case p5 ptest text text
+test_case p6 ptest text text
+test_case p7 ptest text text
+test_case p9 ptest text text
+test_case p10 ptest text text
+test_case p11 ptest text text
+test_case p12 ptest text text
+test_case p13 ptest text text
+test_case ip1 iptest text text
+test_case ip2 iptest text text
+test_case ip3 iptest text text
+
+atf_init_test_cases()
+{
+ atf_add_test_case f28
+ atf_add_test_case f29
+ atf_add_test_case p1
+ atf_add_test_case p2
+ atf_add_test_case p3
+ atf_add_test_case p4
+ atf_add_test_case p5
+ atf_add_test_case p6
+ atf_add_test_case p7
+ atf_add_test_case p9
+ atf_add_test_case p10
+ atf_add_test_case p11
+ atf_add_test_case p12
+ atf_add_test_case p13
+ atf_add_test_case ip1
+ atf_add_test_case ip2
+ atf_add_test_case ip3
+}
diff --git a/contrib/netbsd-tests/kernel/gen_t_subr_prf b/contrib/netbsd-tests/kernel/gen_t_subr_prf
new file mode 100755
index 0000000..b58a6ba
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/gen_t_subr_prf
@@ -0,0 +1,134 @@
+#!/bin/sh
+
+cat << _EOF > $2
+#include <sys/types.h>
+#include <sys/time.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <string.h>
+#include <sha2.h>
+
+#include <atf-c.h>
+
+/* Avoid SSP re-definitions */
+#undef snprintf
+#undef vsnprintf
+#undef sprintf
+#undef vsprintf
+
+#define KPRINTF_BUFSIZE 1024
+#undef putchar
+#define putchar xputchar
+
+static int putchar(char c, int foo, void *b)
+{
+ return fputc(c, stderr);
+}
+
+#define TOBUFONLY 1
+static const char HEXDIGITS[] = "0123456789ABCDEF";
+static const char hexdigits[] = "0123456789abcdef";
+
+typedef int device_t;
+
+#if 0
+static SHA512_CTX kprnd_sha;
+#endif
+
+#define timespec timeval
+#define nanotime(ts) gettimeofday(ts, NULL)
+
+#define device_xname(a) ""
+int kprintf(const char *, int, void *, char *, va_list) __printflike(1, 0);
+void device_printf(device_t, const char *, ...) __printflike(2, 3);
+
+static void
+empty(void)
+{
+}
+
+static void (*v_flush)(void) = empty;
+
+ATF_TC(snprintf_print);
+ATF_TC_HEAD(snprintf_print, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "checks snprintf print");
+}
+
+ATF_TC_BODY(snprintf_print, tc)
+{
+ char buf[10];
+ int i;
+
+ memset(buf, 'x', sizeof(buf));
+ i = snprintf(buf, sizeof(buf), "number %d", 10);
+ ATF_CHECK_EQ(i, 9);
+ ATF_CHECK_STREQ(buf, "number 10");
+}
+
+ATF_TC(snprintf_print_overflow);
+ATF_TC_HEAD(snprintf_print_overflow, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "checks snprintf print with overflow");
+}
+
+ATF_TC_BODY(snprintf_print_overflow, tc)
+{
+ char buf[10];
+ int i;
+
+ memset(buf, 'x', sizeof(buf));
+ i = snprintf(buf, sizeof(buf), "fjsdfsdjfsdf %d\n", 10);
+ ATF_CHECK_EQ(i, 16);
+ ATF_CHECK_STREQ(buf, "fjsdfsdjf");
+}
+
+ATF_TC(snprintf_count);
+ATF_TC_HEAD(snprintf_count, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "checks snprintf count");
+}
+
+ATF_TC_BODY(snprintf_count, tc)
+{
+ int i;
+
+ i = snprintf(NULL, 20, "number %d", 10);
+ ATF_CHECK_EQ(i, 9);
+}
+
+ATF_TC(snprintf_count_overflow);
+ATF_TC_HEAD(snprintf_count_overflow, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "checks snprintf count with overflow");
+}
+
+ATF_TC_BODY(snprintf_count_overflow, tc)
+{
+ int i;
+
+ i = snprintf(NULL, 10, "fjsdfsdjfsdf %d\n", 10);
+ ATF_CHECK_EQ(i, 16);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, snprintf_print);
+ ATF_TP_ADD_TC(tp, snprintf_print_overflow);
+ ATF_TP_ADD_TC(tp, snprintf_count);
+ ATF_TP_ADD_TC(tp, snprintf_count_overflow);
+
+ return atf_no_error();
+}
+_EOF
+
+awk '
+/^snprintf\(/ {
+ print prevline
+ out = 1
+}
+{
+ if (out) print
+ else prevline = $0
+}' $1 >>$2
diff --git a/contrib/netbsd-tests/kernel/h_ps_strings1.c b/contrib/netbsd-tests/kernel/h_ps_strings1.c
new file mode 100644
index 0000000..64d8c71
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/h_ps_strings1.c
@@ -0,0 +1,74 @@
+/* $NetBSD: h_ps_strings1.c,v 1.1 2011/03/05 18:14:33 pgoyette Exp $ */
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (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/types.h>
+#include <sys/exec.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+extern struct ps_strings *__ps_strings;
+
+int
+main(int argc, char **argv, char **environ)
+{
+ int ret = 0;
+ int nenv;
+
+ if (__ps_strings->ps_nargvstr != argc) {
+ static const char nargv_err[] = "Wrong argc in ps_strings";
+ write(STDOUT_FILENO, nargv_err, sizeof(nargv_err));
+ ret = 1;
+ }
+
+ if (__ps_strings->ps_argvstr != argv) {
+ static const char argv_err[] = "Wrong argv in ps_strings";
+ write(STDOUT_FILENO, argv_err, sizeof(argv_err));
+ ret = 1;
+ }
+
+ if (__ps_strings->ps_envstr != environ) {
+ static const char env_err[] = "Wrong env in ps_strings";
+ write(STDOUT_FILENO, env_err, sizeof(env_err));
+ ret = 1;
+ }
+ nenv = 0;
+ while (environ[nenv])
+ ++nenv;
+ if (__ps_strings->ps_nenvstr != nenv) {
+ static const char nenv_err[] = "Wrong nenv in ps_strings";
+ write(STDOUT_FILENO, nenv_err, sizeof(nenv_err));
+ ret = 1;
+ }
+
+ return ret;
+}
diff --git a/contrib/netbsd-tests/kernel/h_ps_strings2.c b/contrib/netbsd-tests/kernel/h_ps_strings2.c
new file mode 100644
index 0000000..d9c1c24
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/h_ps_strings2.c
@@ -0,0 +1,69 @@
+/* $NetBSD: h_ps_strings2.c,v 1.1 2011/03/05 18:14:33 pgoyette Exp $ */
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (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/types.h>
+#include <sys/exec.h>
+#include <err.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define LEN 16384
+
+extern struct ps_strings *__ps_strings;
+
+int
+main(void)
+{
+ size_t i;
+ char buf[16];
+ char **argv;
+
+ if ((argv = calloc(LEN, sizeof(*argv))) == NULL)
+ errx(1, "calloc failed");
+ for (i = 0; i < LEN; ++i) {
+ snprintf(buf, sizeof(buf), "arg%04zx", i);
+ if ((argv[i] = strdup(buf)) == NULL)
+ errx(1, "strdup failed");
+ }
+ __ps_strings->ps_argvstr = argv;
+ __ps_strings->ps_nargvstr = LEN;
+
+ printf("Sleeping forever...\n");
+ do {
+ sleep(UINT_MAX);
+ } while /* CONSTCOND */ (1);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c b/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c
new file mode 100644
index 0000000..5908547
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c
@@ -0,0 +1,98 @@
+/* $NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn and Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
+
+#include <sys/event.h>
+#include <sys/stat.h>
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <inttypes.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+#define FIFONAME "fifo"
+
+ATF_TC(fifo);
+ATF_TC_HEAD(fifo, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_READ on fifo");
+}
+ATF_TC_BODY(fifo, tc)
+{
+ int kq, n, fd;
+ struct kevent event[1];
+ char buffer[128];
+
+ RL(mkfifo(FIFONAME, 0644));
+ RL(fd = open(FIFONAME, O_RDWR, 0644));
+
+ RL(kq = kqueue());
+
+ EV_SET(&event[0], fd, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ /* make sure there is something in the fifo */
+ RL(write(fd, "foo", 3));
+ (void)printf("fifo: wrote 'foo'\n");
+
+ (void)memset(event, 0, sizeof(event));
+
+ RL(n = kevent(kq, NULL, 0, event, 1, NULL));
+
+ (void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, "
+ "data: %" PRId64 "\n", n, event[0].filter, event[0].flags,
+ event[0].fflags, event[0].data);
+
+ ATF_REQUIRE_EQ(event[0].filter, EVFILT_READ);
+
+ RL(n = read(fd, buffer, event[0].data));
+ buffer[n] = '\0';
+ (void)printf("fifo: read '%s'\n", buffer);
+
+ RL(close(fd));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, fifo);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/read/t_file.c b/contrib/netbsd-tests/kernel/kqueue/read/t_file.c
new file mode 100644
index 0000000..2335172
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/read/t_file.c
@@ -0,0 +1,139 @@
+/* $NetBSD: t_file.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_file.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
+
+#include <sys/param.h>
+#include <sys/event.h>
+#include <sys/mount.h>
+#include <sys/wait.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <inttypes.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+#define FILENAME "file"
+#define NLINES 5
+
+static void
+child(void)
+{
+ int i, n, fd;
+
+ (void)sleep(1);
+
+ for (i = 0; i < NLINES; ++i) {
+ fd = open(FILENAME, O_WRONLY|O_APPEND, 0644);
+ if (fd < 0)
+ err(EXIT_FAILURE, "open()");
+
+ n = write(fd, "foo\n", 4);
+ if (n < 0)
+ err(EXIT_FAILURE, "write()");
+
+ (void)close(fd);
+ (void)sleep(1);
+ }
+ _exit(0);
+}
+
+ATF_TC(file);
+ATF_TC_HEAD(file, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_READ on regular file");
+}
+ATF_TC_BODY(file, tc)
+{
+ char buffer[128];
+ struct kevent event[1];
+ pid_t pid;
+ int fd, kq, n, num, status;
+
+ RL(pid = fork());
+ if (pid == 0) {
+ child();
+ /* NOTREACHED */
+ }
+
+ RL(fd = open(FILENAME, O_RDONLY|O_CREAT, 0644));
+
+#if 1 /* XXX: why was this disabled? */
+ RL(lseek(fd, 0, SEEK_END));
+#endif
+
+ RL(kq = kqueue());
+
+ EV_SET(&event[0], fd, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ for (num = 0; num < NLINES;) {
+ RL(n = kevent(kq, NULL, 0, event, 1, NULL));
+ num += n;
+
+ (void)printf("kevent num %d flags: %#x, fflags: %#x, data: "
+ "%" PRId64 "\n", n, event[0].flags, event[0].fflags,
+ event[0].data);
+
+ if (event[0].data < 0)
+#if 1 /* XXXLUKEM */
+ RL(lseek(fd, 0, SEEK_END));
+#else
+ RL(lseek(fd, event[0].data, SEEK_END));
+#endif
+
+ RL(n = read(fd, buffer, 128));
+ buffer[n] = '\0';
+ (void)printf("file(%d): %s", num, buffer);
+ }
+
+ (void)waitpid(pid, &status, 0);
+
+ (void)printf("read: successful end\n");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, file);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/read/t_file2.c b/contrib/netbsd-tests/kernel/kqueue/read/t_file2.c
new file mode 100644
index 0000000..c77d283
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/read/t_file2.c
@@ -0,0 +1,79 @@
+/* $NetBSD: t_file2.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_file2.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
+
+#include <sys/event.h>
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+ATF_TC(file2);
+ATF_TC_HEAD(file2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks EVFILT_READ for regular files. This test used to "
+ "trigger deadlock caused by problem fixed in revision 1.79.2.10 "
+ "of sys/kern/kern_descrip.c");
+}
+ATF_TC_BODY(file2, tc)
+{
+ int fd1, fd2, kq;
+ struct kevent event[1];
+
+ RL(fd1 = open("afile", O_RDONLY|O_CREAT, 0644));
+ RL(fd2 = open("bfile", O_RDONLY|O_CREAT, 0644));
+
+#if 1 /* XXX: why was this disabled? */
+ RL(lseek(fd1, 0, SEEK_END));
+#endif
+
+ RL(kq = kqueue());
+
+ EV_SET(&event[0], fd1, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ RL(dup2(fd2, fd1));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, file2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c b/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c
new file mode 100644
index 0000000..d8e05f2
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c
@@ -0,0 +1,84 @@
+/* $NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn and Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+
+#include <sys/event.h>
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+ATF_TC(pipe);
+ATF_TC_HEAD(pipe, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_READ for pipes");
+}
+ATF_TC_BODY(pipe, tc)
+{
+ struct kevent event[1];
+ char buffer[128];
+ int fds[2];
+ int kq, n;
+
+ RL(pipe(fds));
+ RL(kq = kqueue());
+
+ EV_SET(&event[0], fds[0], EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ /* make sure there is something in the pipe */
+ RL(write(fds[1], "foo", 3));
+ (void)printf("pipe: wrote 'foo' to pipe\n");
+
+ RL(n = kevent(kq, NULL, 0, event, 1, NULL));
+ (void)printf("kevent num %d flags: %#x, fflags: %#x, data: "
+ "%" PRId64 "\n", n, event[0].flags, event[0].fflags, event[0].data);
+
+ RL(n = read(fds[0], buffer, event[0].data));
+ buffer[n] = '\0';
+
+ (void)printf("pipe: read '%s'\n", buffer);
+ (void)printf("pipe: successful end\n");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, pipe);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c b/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c
new file mode 100644
index 0000000..3a42fd3
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c
@@ -0,0 +1,144 @@
+/* $NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn and Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+
+#include <sys/event.h>
+#include <sys/wait.h>
+
+#include <poll.h>
+#include <stdio.h>
+#include <termios.h>
+#include <unistd.h>
+#include <util.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+static void
+h_check(bool check_master)
+{
+ char slavetty[1024];
+ char buffer[128];
+ struct kevent event[1];
+ pid_t child;
+ int amaster, aslave, acurrent;
+ int kq, n, status;
+#if 0
+ int fl;
+#endif
+ struct pollfd pfd;
+ struct termios tio;
+
+ RL(openpty(&amaster, &aslave, slavetty, NULL, NULL));
+
+ (void)printf("tty: openpty master %d slave %d tty '%s'\n",
+ amaster, aslave, slavetty);
+ acurrent = check_master ? amaster : aslave;
+
+ RL(child = fork());
+ if (child == 0) {
+ sleep(1);
+
+ (void)printf("tty: child writing 'f00\\n'\n");
+ (void)write(check_master ? aslave : amaster, "f00\n", 4);
+
+ _exit(0);
+ }
+
+ /* switch ONLCR off, to not get confused by newline translation */
+ RL(tcgetattr(acurrent, &tio));
+ tio.c_oflag &= ~ONLCR;
+ RL(tcsetattr(acurrent, TCSADRAIN, &tio));
+
+ pfd.fd = acurrent;
+ pfd.events = POLLIN;
+ (void)printf("tty: polling ...\n");
+ RL(poll(&pfd, 1, INFTIM));
+ (void)printf("tty: returned from poll - %d\n", pfd.revents);
+
+#if 0
+ fl = 1;
+ if (ioctl(acurrent, TIOCPKT, &fl) < 0)
+ err(1, "ioctl");
+#endif
+
+ RL(kq = kqueue());
+
+ EV_SET(&event[0], acurrent, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ RL(n = kevent(kq, NULL, 0, event, 1, NULL));
+
+ (void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, "
+ "data: %" PRId64 "\n", n, event[0].filter, event[0].flags,
+ event[0].fflags, event[0].data);
+
+ ATF_REQUIRE_EQ(event[0].filter, EVFILT_READ);
+
+ RL(n = read(acurrent, buffer, 128));
+ (void)printf("tty: read '%.*s' (n=%d)\n", n, buffer, n);
+
+ (void)waitpid(child, &status, 0);
+ (void)printf("tty: successful end\n");
+}
+
+ATF_TC(master);
+ATF_TC_HEAD(master, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_READ for master tty");
+}
+ATF_TC_BODY(master, tc)
+{
+ h_check(true);
+}
+
+ATF_TC(slave);
+ATF_TC_HEAD(slave, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_READ for slave tty");
+}
+ATF_TC_BODY(slave, tc)
+{
+ h_check(false);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, master);
+ ATF_TP_ADD_TC(tp, slave);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/t_ioctl.c b/contrib/netbsd-tests/kernel/kqueue/t_ioctl.c
new file mode 100644
index 0000000..8ed5a79
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/t_ioctl.c
@@ -0,0 +1,115 @@
+/* $NetBSD: t_ioctl.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_ioctl.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+
+#include <sys/event.h>
+#include <sys/ioctl.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(kfilter_byfilter);
+ATF_TC_HEAD(kfilter_byfilter, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks KFILTER_BYFILTER ioctl");
+}
+ATF_TC_BODY(kfilter_byfilter, tc)
+{
+ char buf[32];
+ struct kfilter_mapping km;
+ int i, kq;
+
+ RL(kq = kqueue());
+
+ km.name = buf;
+ km.len = sizeof(buf) - 1;
+
+ for (i = 0; i < 7; ++i) {
+ km.filter = i;
+ RL(ioctl(kq, KFILTER_BYFILTER, &km));
+ (void)printf(" map %d -> %s\n", km.filter, km.name);
+ }
+
+ km.filter = 7;
+ ATF_REQUIRE_EQ(ioctl(kq, KFILTER_BYFILTER, &km), -1);
+}
+
+ATF_TC(kfilter_byname);
+ATF_TC_HEAD(kfilter_byname, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks KFILTER_BYNAME ioctl");
+}
+ATF_TC_BODY(kfilter_byname, tc)
+{
+ const char *tests[] = {
+ "EVFILT_READ",
+ "EVFILT_WRITE",
+ "EVFILT_AIO",
+ "EVFILT_VNODE",
+ "EVFILT_PROC",
+ "EVFILT_SIGNAL",
+ "EVFILT_TIMER",
+ NULL
+ };
+ char buf[32];
+ struct kfilter_mapping km;
+ const char **test;
+ int kq;
+
+ RL(kq = kqueue());
+
+ km.name = buf;
+
+ for (test = &tests[0]; *test != NULL; ++test) {
+ (void)strlcpy(buf, *test, sizeof(buf));
+ RL(ioctl(kq, KFILTER_BYNAME, &km));
+ (void)printf(" map %s -> %d\n", km.name, km.filter);
+ }
+
+ (void)strlcpy(buf, "NOTREG_FILTER", sizeof(buf));
+ ATF_REQUIRE_EQ(ioctl(kq, KFILTER_BYNAME, &km), -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, kfilter_byfilter);
+ ATF_TP_ADD_TC(tp, kfilter_byname);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/t_proc1.c b/contrib/netbsd-tests/kernel/kqueue/t_proc1.c
new file mode 100644
index 0000000..e755309
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/t_proc1.c
@@ -0,0 +1,154 @@
+/* $NetBSD: t_proc1.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn and Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_proc1.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+
+/*
+ * this also used to trigger problem fixed in
+ * rev. 1.1.1.1.2.13 of sys/kern/kern_event.c
+ */
+
+#include <sys/param.h>
+#include <sys/event.h>
+#include <sys/wait.h>
+
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <inttypes.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+static int
+child(void)
+{
+ pid_t ch;
+ int status;
+ char *argv[] = { NULL, NULL };
+ char *envp[] = { NULL, NULL };
+
+ if ((argv[0] = strdup("true")) == NULL)
+ err(EXIT_FAILURE, "strdup(\"true\")");
+
+ if ((envp[0] = strdup("FOO=BAZ")) == NULL)
+ err(EXIT_FAILURE, "strdup(\"FOO=BAZ\")");
+
+ /* Ensure parent is ready */
+ (void)sleep(2);
+
+ /* Do fork */
+ switch (ch = fork()) {
+ case -1:
+ return EXIT_FAILURE;
+ /* NOTREACHED */
+ case 0:
+ return EXIT_SUCCESS;
+ /* NOTREACHED */
+ default:
+ wait(&status);
+ break;
+ }
+
+ /* Exec */
+ execve("/usr/bin/true", argv, envp);
+
+ /* NOTREACHED */
+ return EXIT_FAILURE;
+}
+
+ATF_TC(proc1);
+ATF_TC_HEAD(proc1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_PROC");
+}
+ATF_TC_BODY(proc1, tc)
+{
+ struct kevent event[1];
+ pid_t pid;
+ int kq, want, status;
+
+ RL(kq = kqueue());
+
+ /* fork a child for doing the events */
+ RL(pid = fork());
+ if (pid == 0) {
+ _exit(child());
+ /* NOTREACHED */
+ }
+
+ (void)sleep(1); /* give child some time to come up */
+
+ event[0].ident = pid;
+ event[0].filter = EVFILT_PROC;
+ event[0].flags = EV_ADD | EV_ENABLE;
+ event[0].fflags = NOTE_EXIT | NOTE_FORK | NOTE_EXEC; /* | NOTE_TRACK;*/
+ want = NOTE_EXIT | NOTE_FORK | NOTE_EXEC;
+
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ /* wait until we get all events we want */
+ while (want) {
+ RL(kevent(kq, NULL, 0, event, 1, NULL));
+ printf("%ld:", (long)event[0].ident);
+
+ if (event[0].fflags & NOTE_EXIT) {
+ want &= ~NOTE_EXIT;
+ printf(" NOTE_EXIT");
+ }
+ if (event[0].fflags & NOTE_EXEC) {
+ want &= ~NOTE_EXEC;
+ printf(" NOTE_EXEC");
+ }
+ if (event[0].fflags & NOTE_FORK) {
+ want &= ~NOTE_FORK;
+ printf(" NOTE_FORK");
+ }
+ if (event[0].fflags & NOTE_CHILD)
+ printf(" NOTE_CHILD, parent = %" PRId64, event[0].data);
+
+ printf("\n");
+ }
+
+ (void)waitpid(pid, &status, 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, proc1);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/t_proc2.c b/contrib/netbsd-tests/kernel/kqueue/t_proc2.c
new file mode 100644
index 0000000..54769d6
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/t_proc2.c
@@ -0,0 +1,138 @@
+/* $NetBSD: t_proc2.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Peter Werner <Peter.Werner@wgsn.com>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_proc2.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+
+#include <sys/event.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <err.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+static void
+child_two(void)
+{
+ _exit(EXIT_SUCCESS);
+}
+
+static void
+child_one(void)
+{
+ pid_t pid;
+ struct passwd *pwd;
+ const char *nam = "nobody";
+
+ pwd = getpwnam(nam);
+ if (pwd == NULL)
+ err(EXIT_FAILURE, "getpwnam(\"%s\")", nam);
+
+ if ((setuid(pwd->pw_uid)) == -1)
+ err(EXIT_FAILURE, "setuid(%d)", pwd->pw_uid);
+
+ pid = fork();
+ if (pid == -1)
+ err(EXIT_FAILURE, "fork()");
+
+ if (pid == 0)
+ child_two();
+
+ _exit(EXIT_SUCCESS);
+}
+
+ATF_TC(proc2);
+ATF_TC_HEAD(proc2, tc)
+{
+ atf_tc_set_md_var(tc, "require.user", "root");
+ atf_tc_set_md_var(tc, "descr",
+ "Checks EVFILT_PROC for NOTE_FORK|NOTE_TRACK error path problem "
+ "fixed in rev. 1.1.1.1.2.17 of sys/kern/kern_event.c");
+}
+ATF_TC_BODY(proc2, tc)
+{
+ pid_t pid = 0;
+ int kq, status;
+ struct kevent ke;
+ struct timespec timeout;
+
+ RL(kq = kqueue());
+
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+
+ RL(pid = fork());
+ if (pid == 0) {
+ (void)sleep(1); /* let parent set kevent */
+ child_one();
+ /* NOTREACHED */
+ }
+
+ EV_SET(&ke, pid, EVFILT_PROC, EV_ADD, NOTE_FORK|NOTE_TRACK, 0, 0);
+
+ RL(kevent(kq, &ke, 1, NULL, 0, &timeout));
+
+ (void)sleep(2);
+
+ ke.ident = 0;
+ ke.fflags = 0;
+ ke.flags = EV_ENABLE;
+
+ RL(kevent(kq, NULL, 0, &ke, 1, &timeout));
+ RL(close(kq));
+
+ RL(waitpid(pid, &status, 0));
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE_EQ(WEXITSTATUS(status), EXIT_SUCCESS);
+
+ /*
+ * we are expecting an error here as we should not have
+ * been able to add a knote to child 2.
+ */
+ ATF_REQUIRE(ke.fflags & NOTE_TRACKERR);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, proc2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/t_proc3.c b/contrib/netbsd-tests/kernel/kqueue/t_proc3.c
new file mode 100644
index 0000000..3cb9ae5
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/t_proc3.c
@@ -0,0 +1,99 @@
+/* $NetBSD: t_proc3.c,v 1.1 2012/11/17 21:55:24 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_proc3.c,v 1.1 2012/11/17 21:55:24 joerg Exp $");
+
+#include <sys/event.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <err.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(proc3);
+ATF_TC_HEAD(proc3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks EVFILT_PROC for NOTE_TRACK on self bug ");
+}
+
+ATF_TC_BODY(proc3, tc)
+{
+ pid_t pid = 0;
+ int kq, status;
+ struct kevent ke;
+ struct timespec timeout;
+
+ RL(kq = kqueue());
+
+ EV_SET(&ke, getpid(), EVFILT_PROC, EV_ADD, NOTE_TRACK, 0, 0);
+
+ RL(kevent(kq, &ke, 1, NULL, 0, NULL));
+
+ RL(pid = fork());
+ if (pid == 0) {
+ _exit(EXIT_SUCCESS);
+ /* NOTREACHED */
+ }
+
+ RL(waitpid(pid, &status, 0));
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE_EQ(WEXITSTATUS(status), EXIT_SUCCESS);
+
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+ ke.ident = 0;
+ ke.fflags = 0;
+ ke.flags = EV_ENABLE;
+
+ RL(kevent(kq, NULL, 0, &ke, 1, &timeout));
+ RL(close(kq));
+
+ ATF_REQUIRE(ke.fflags & NOTE_CHILD);
+ ATF_REQUIRE((ke.fflags & NOTE_TRACKERR) == 0);
+ ATF_REQUIRE_EQ((pid_t)ke.ident, pid);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, proc3);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/t_sig.c b/contrib/netbsd-tests/kernel/kqueue/t_sig.c
new file mode 100644
index 0000000..4fc0758
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/t_sig.c
@@ -0,0 +1,133 @@
+/* $NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn and Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $");
+
+#include <sys/event.h>
+#include <sys/ioctl.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+
+#include <inttypes.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+#define NSIGNALS 5
+
+ATF_TC(sig);
+ATF_TC_HEAD(sig, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_SIGNAL");
+}
+ATF_TC_BODY(sig, tc)
+{
+ struct timespec timeout;
+ struct kfilter_mapping km;
+ struct kevent event[1];
+ char namebuf[32];
+ pid_t pid, child;
+ int kq, n, num, status;
+
+ pid = getpid();
+ (void)printf("my pid: %d\n", pid);
+
+ /* fork a child to send signals */
+ RL(child = fork());
+ if (child == 0) {
+ int i;
+ (void)sleep(2);
+ for(i = 0; i < NSIGNALS; ++i) {
+ (void)kill(pid, SIGUSR1);
+ (void)sleep(2);
+ }
+ _exit(0);
+ /* NOTREACHED */
+ }
+
+ RL(kq = kqueue());
+
+ (void)strlcpy(namebuf, "EVFILT_SIGNAL", sizeof(namebuf));
+ km.name = namebuf;
+ RL(ioctl(kq, KFILTER_BYNAME, &km));
+ (void)printf("got %d as filter number for `%s'.\n", km.filter, km.name);
+
+ /* ignore the signal to avoid taking it for real */
+ REQUIRE_LIBC(signal(SIGUSR1, SIG_IGN), SIG_ERR);
+
+ event[0].ident = SIGUSR1;
+ event[0].filter = km.filter;
+ event[0].flags = EV_ADD | EV_ENABLE;
+
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ (void)sleep(1);
+
+ timeout.tv_sec = 1;
+ timeout.tv_nsec = 0;
+
+ for (num = 0; num < NSIGNALS; num += n) {
+ struct timeval then, now, diff;
+
+ RL(gettimeofday(&then, NULL));
+ RL(n = kevent(kq, NULL, 0, event, 1, &timeout));
+ RL(gettimeofday(&now, NULL));
+ timersub(&now, &then, &diff);
+
+ (void)printf("sig: kevent returned %d in %lld.%06ld\n",
+ n, (long long)diff.tv_sec, (long)diff.tv_usec);
+
+ if (n == 0)
+ continue;
+
+ (void)printf("sig: kevent flags: 0x%x, data: %" PRId64 " (# "
+ "times signal posted)\n", event[0].flags, event[0].data);
+ }
+
+ (void)waitpid(child, &status, 0);
+ (void)printf("sig: finished successfully\n");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, sig);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/write/t_fifo.c b/contrib/netbsd-tests/kernel/kqueue/write/t_fifo.c
new file mode 100644
index 0000000..82b256c
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/write/t_fifo.c
@@ -0,0 +1,102 @@
+/* $NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn and Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
+
+#include <sys/event.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+#define FIFONAME "fifo"
+
+ATF_TC(fifo);
+ATF_TC_HEAD(fifo, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_WRITE for fifo");
+}
+ATF_TC_BODY(fifo, tc)
+{
+ char buffer[128];
+ struct kevent event[1];
+ pid_t child;
+ int kq, n, fd, status;
+
+ RL(mkfifo(FIFONAME, 0644));
+ RL(fd = open(FIFONAME, O_RDWR, 0644));
+ RL(kq = kqueue());
+
+ /* spawn child reader */
+ RL(child = fork());
+ if (child == 0) {
+ int sz = read(fd, buffer, 128);
+ if (sz > 0)
+ (void)printf("fifo: child read '%.*s'\n", sz, buffer);
+ _exit(sz <= 0);
+ }
+
+ EV_SET(&event[0], fd, EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ (void)memset(event, 0, sizeof(event));
+ RL(n = kevent(kq, NULL, 0, event, 1, NULL));
+
+ (void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, "
+ "data: %" PRId64 "\n", n, event[0].filter, event[0].flags,
+ event[0].fflags, event[0].data);
+
+ ATF_REQUIRE_EQ(event[0].filter, EVFILT_WRITE);
+
+ RL(write(fd, "foo", 3));
+ (void)printf("fifo: wrote 'foo'\n");
+ RL(close(fd));
+
+ (void)waitpid(child, &status, 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, fifo);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/write/t_pipe.c b/contrib/netbsd-tests/kernel/kqueue/write/t_pipe.c
new file mode 100644
index 0000000..459a1f7
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/write/t_pipe.c
@@ -0,0 +1,147 @@
+/* $NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn and Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+
+#include <sys/event.h>
+#include <sys/wait.h>
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+ATF_TC(pipe1);
+ATF_TC_HEAD(pipe1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks EVFILT_WRITE for pipes. This test used to trigger "
+ "problem fixed in rev. 1.5.2.7 of sys/kern/sys_pipe.c");
+}
+ATF_TC_BODY(pipe1, tc)
+{
+ struct kevent event[1];
+ int fds[2];
+ int kq, n;
+
+ RL(pipe(fds));
+ RL(kq = kqueue());
+ RL(close(fds[0]));
+
+ EV_SET(&event[0], fds[1], EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0);
+ ATF_REQUIRE_EQ_MSG((n = kevent(kq, event, 1, NULL, 0, NULL)),
+ -1, "got: %d", n);
+ ATF_REQUIRE_EQ_MSG(errno, EBADF, "got: %s", strerror(errno));
+}
+
+ATF_TC(pipe2);
+ATF_TC_HEAD(pipe2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks EVFILT_WRITE for pipes. This test used to trigger problem "
+ "fixed in rev. 1.5.2.9 of sys/kern/sys_pipe.c");
+}
+ATF_TC_BODY(pipe2, tc)
+{
+ struct kevent event[1];
+ char buffer[128];
+ int fds[2];
+ int kq, n;
+ int status;
+ pid_t child;
+
+ RL(pipe(fds));
+ RL(kq = kqueue());
+
+ EV_SET(&event[0], fds[1], EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ /* spawn child reader */
+ RL(child = fork());
+ if (child == 0) {
+ int sz = read(fds[0], buffer, 128);
+ if (sz > 0)
+ (void)printf("pipe: child read '%.*s'\n", sz, buffer);
+ exit(sz <= 0);
+ }
+
+ RL(n = kevent(kq, NULL, 0, event, 1, NULL));
+
+ (void)printf("kevent num %d flags: %#x, fflags: %#x, data: "
+ "%" PRId64 "\n", n, event[0].flags, event[0].fflags, event[0].data);
+
+ RL(n = write(fds[1], "foo", 3));
+ RL(close(fds[1]));
+
+ (void)waitpid(child, &status, 0);
+}
+
+ATF_TC(pipe3);
+ATF_TC_HEAD(pipe3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks EVFILT_WRITE for pipes. This test used to trigger problem "
+ "fixed in rev. 1.5.2.10 of sys/kern/sys_pipe.c");
+}
+ATF_TC_BODY(pipe3, tc)
+{
+ struct kevent event[1];
+ int fds[2];
+ int kq;
+
+ RL(pipe(fds));
+ RL(kq = kqueue());
+
+ EV_SET(&event[0], fds[1], EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ /* close 'read' end first, then 'write' */
+
+ RL(close(fds[0]));
+ RL(close(fds[1]));
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, pipe1);
+ ATF_TP_ADD_TC(tp, pipe2);
+ ATF_TP_ADD_TC(tp, pipe3);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/kqueue/write/t_ttypty.c b/contrib/netbsd-tests/kernel/kqueue/write/t_ttypty.c
new file mode 100644
index 0000000..6983910
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/kqueue/write/t_ttypty.c
@@ -0,0 +1,130 @@
+/* $NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:58 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn and Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:58 jmmv Exp $");
+
+#include <sys/event.h>
+#include <sys/wait.h>
+
+#include <fcntl.h>
+#include <poll.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <unistd.h>
+#include <util.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+static void
+h_check(bool check_master)
+{
+ char slavetty[1024];
+ char buffer[128];
+ struct kevent event[1];
+ struct pollfd pfd;
+ pid_t child;
+ int status, kq, n;
+ int amaster, aslave, acurrent;
+
+ RL(openpty(&amaster, &aslave, slavetty, NULL, NULL));
+ (void)printf("tty: openpty master %d slave %d tty '%s'\n",
+ amaster, aslave, slavetty);
+ acurrent = check_master ? amaster : aslave;
+
+ RL(child = fork());
+ if (child == 0) {
+ (void)sleep(1);
+
+ n = read(check_master ? aslave : amaster, buffer, 128);
+ (void)printf("tty: child read '%.*s'\n", n, buffer);
+
+ _exit(0);
+ }
+
+ pfd.fd = acurrent;
+ pfd.events = POLLOUT;
+ (void)printf("tty: polling ...\n");
+ RL(poll(&pfd, 1, INFTIM));
+ (void)printf("tty: returned from poll - %d\n", pfd.revents);
+
+ RL(kq = kqueue());
+
+ EV_SET(&event[0], acurrent, EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0);
+ RL(kevent(kq, event, 1, NULL, 0, NULL));
+
+ RL(n = kevent(kq, NULL, 0, event, 1, NULL));
+
+ (void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, data: "
+ "%" PRId64 "\n", n, event[0].filter, event[0].flags, event[0].fflags,
+ event[0].data);
+
+ ATF_REQUIRE_EQ(event[0].filter, EVFILT_WRITE);
+
+ RL(n = write(acurrent, "f00\n", 4));
+ (void)printf("tty: wrote 'f00\\n' (wrote %d characters)\n", n);
+
+ (void)waitpid(child, &status, 0);
+ (void)printf("tty: successful end\n");
+}
+
+ATF_TC(master);
+ATF_TC_HEAD(master, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_WRITE for master tty");
+}
+ATF_TC_BODY(master, tc)
+{
+ h_check(true);
+}
+
+ATF_TC(slave);
+ATF_TC_HEAD(slave, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks EVFILT_WRITE for slave tty");
+}
+ATF_TC_BODY(slave, tc)
+{
+ h_check(false);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, master);
+ ATF_TP_ADD_TC(tp, slave);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_extattrctl.c b/contrib/netbsd-tests/kernel/t_extattrctl.c
new file mode 100644
index 0000000..2f8932e
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_extattrctl.c
@@ -0,0 +1,28 @@
+#include <sys/types.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+
+ATF_TC(extattrctl_namei);
+ATF_TC_HEAD(extattrctl_namei, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "extattrctl namei safety (kern/43328)");
+}
+
+ATF_TC_BODY(extattrctl_namei, tc)
+{
+
+ rump_init();
+
+ rump_sys_extattrctl("/anyfile", 0, "/", 0, 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, extattrctl_namei);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_extent.c b/contrib/netbsd-tests/kernel/t_extent.c
new file mode 100644
index 0000000..faefafa
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_extent.c
@@ -0,0 +1,385 @@
+/* $NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $");
+
+#include <sys/types.h>
+#include <sys/queue.h>
+#include <sys/extent.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <atf-c.h>
+
+#include "../h_macros.h"
+
+static int ret;
+static struct extent *ex;
+
+#define h_create(name, start, end, flags) \
+ ATF_REQUIRE((ex = extent_create(name, \
+ start, end, 0, 0, flags)) != NULL);
+
+#define h_alloc_region(start, size) \
+ ATF_REQUIRE_EQ_MSG(ret = extent_alloc_region(ex, \
+ start, size, 0), 0, "%s", strerror(ret));
+
+#define h_free(start, size) \
+ ATF_REQUIRE_EQ_MSG(ret = extent_free(ex, \
+ start, size, 0), 0, "%s", strerror(ret));
+
+static void
+h_alloc_subregion(u_long substart, u_long subend, u_long size,
+ u_long alignment, u_long boundary, int expret, u_long expres)
+{
+ u_long result;
+
+#define FAIL(fmt, ...) \
+ atf_tc_fail("extent_alloc_subregion1(ex, %#lx, %#lx, %#lx, %#lx, 0, " \
+ "%#lx, 0, &result): " fmt, substart, subend, size, alignment, \
+ boundary, ##__VA_ARGS__)
+
+ ret = extent_alloc_subregion1(ex, substart, subend, size,
+ alignment, 0, boundary, 0, &result);
+
+ if (ret != expret)
+ FAIL("%s", strerror(errno));
+
+ if (expret == 0 && result != expres)
+ FAIL("result should be: %#lx, got: %#lx", expres, result);
+#undef FAIL
+}
+
+static void
+h_require(const char *name, u_long start,
+ u_long end, int flags, const char *exp)
+{
+ char buf[4096];
+ struct extent_region *rp;
+ int n = 0;
+
+ ATF_REQUIRE_STREQ_MSG(ex->ex_name, name,
+ "expected: \"%s\", got: \"%s\"", name, ex->ex_name);
+ ATF_REQUIRE_EQ_MSG(ex->ex_start, start,
+ "expected: %#lx, got: %#lx", start, ex->ex_start);
+ ATF_REQUIRE_EQ_MSG(ex->ex_end, end,
+ "expected: %#lx, got: %#lx", end, ex->ex_end);
+ ATF_REQUIRE_EQ_MSG(ex->ex_flags, flags,
+ "expected: %#x, got: %#x", flags, ex->ex_flags);
+
+ (void)memset(buf, 0, sizeof(buf));
+ LIST_FOREACH(rp, &ex->ex_regions, er_link)
+ n += snprintf(buf + n, sizeof(buf) - n,
+ "0x%lx - 0x%lx\n", rp->er_start, rp->er_end);
+
+ if (strcmp(buf, exp) == 0)
+ return;
+
+ printf("Incorrect extent map\n");
+ printf("Expected:\n%s\n", exp);
+ printf("Got:\n%s\n", buf);
+ atf_tc_fail("incorrect extent map");
+}
+
+ATF_TC(coalesce);
+ATF_TC_HEAD(coalesce, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks coalescing of regions");
+}
+ATF_TC_BODY(coalesce, tc)
+{
+ h_create("test1", 0, 0x4f, 0);
+
+ h_alloc_region(0x00, 0x10);
+ h_alloc_region(0x20, 0x10);
+ h_alloc_region(0x40, 0x10);
+ h_alloc_region(0x10, 0x10);
+ h_alloc_subregion(0, 0x4f, 0x10, EX_NOALIGN, EX_NOBOUNDARY, 0, 0x30);
+
+ h_require("test1", 0x00, 0x4f, 0x00,
+ "0x0 - 0x4f\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(subregion1);
+ATF_TC_HEAD(subregion1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that subregions work (PR kern/7539)");
+}
+ATF_TC_BODY(subregion1, tc)
+{
+ h_create("test2", 0, 0x2f, EX_NOCOALESCE);
+
+ h_alloc_region(0x00, 0x10);
+ h_alloc_subregion(0x20, 0x30, 0x10, EX_NOALIGN, EX_NOBOUNDARY, 0, 0x20);
+
+ h_require("test2", 0x00, 0x2f, 0x2,
+ "0x0 - 0xf\n"
+ "0x20 - 0x2f\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(subregion2);
+ATF_TC_HEAD(subregion2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that subregion allocations don't overlap with existing "
+ "ones (fixed in 1.25)");
+}
+ATF_TC_BODY(subregion2, tc)
+{
+ h_create("test3", 0, 0x3f, EX_NOCOALESCE);
+
+ h_alloc_region(0x00, 0x20);
+ h_alloc_region(0x30, 0x10);
+ h_alloc_subregion(0x10, 0x3f, 0x10,
+ EX_NOALIGN, EX_NOBOUNDARY, 0, 0x20);
+
+ h_require("test3", 0x00, 0x3f, 0x2,
+ "0x0 - 0x1f\n"
+ "0x20 - 0x2f\n"
+ "0x30 - 0x3f\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(bound1);
+ATF_TC_HEAD(bound1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks for overflow in boundary check, before an allocated region "
+ "(fixed in 1.32)");
+}
+ATF_TC_BODY(bound1, tc)
+{
+ h_create("test4", 0xf0000000, 0xffffffff, 0);
+
+ h_alloc_region(0xf1000000, 0x1);
+ h_alloc_subregion(0xf0000000, 0xffffffff, 0x1,
+ EX_NOALIGN, 0x20000000, 0, 0xf0000000);
+
+ h_require("test4", 0xf0000000, 0xffffffff, 0x0,
+ "0xf0000000 - 0xf0000000\n"
+ "0xf1000000 - 0xf1000000\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(bound2);
+ATF_TC_HEAD(bound2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks for overflow in boundary checks, before the subregion end "
+ "(fixed in 1.32)");
+}
+ATF_TC_BODY(bound2, tc)
+{
+ h_create("test5", 0xf0000000, 0xffffffff, 0);
+
+ h_alloc_subregion(0xf0000000, 0xffffffff, 0x1,
+ EX_NOALIGN, 0x20000000, 0, 0xf0000000);
+
+ h_require("test5", 0xf0000000, 0xffffffff, 0x0,
+ "0xf0000000 - 0xf0000000\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(bound3);
+ATF_TC_HEAD(bound3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks allocation beyond last boundary line: last two "
+ "allocations should succeed without boundary \"fixups\"");
+}
+ATF_TC_BODY(bound3, tc)
+{
+ h_create("test6", 0, 11, 0);
+
+ h_alloc_subregion(0, 11, 8, EX_NOALIGN, 8, 0, 0);
+ h_alloc_subregion(0, 11, 2, EX_NOALIGN, 8, 0, 0x8);
+ h_alloc_subregion(0, 11, 2, EX_NOALIGN, 8, 0, 0xa);
+
+ h_require("test6", 0x0, 0xb, 0x0, "0x0 - 0xb\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(bound4);
+ATF_TC_HEAD(bound4, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks allocation beyond last boundary line: last allocation "
+ "should be bumped to the next boundary and exactly fit the "
+ "remaining space");
+}
+ATF_TC_BODY(bound4, tc)
+{
+ h_create("test7", 0, 11, 0);
+
+ h_alloc_subregion(0, 11, 7, EX_NOALIGN, 8, 0, 0);
+ h_alloc_subregion(0, 11, 4, EX_NOALIGN, 8, 0, 8);
+
+ h_require("test7", 0x0, 0xb, 0x0,
+ "0x0 - 0x6\n"
+ "0x8 - 0xb\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(subregion3);
+ATF_TC_HEAD(subregion3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that we don't allocate a region pasts the end of "
+ "subregion (i.e., the second alloc_subregion should fail). "
+ "subr_extent.c prior to rev. 1.43 allocated region starting "
+ "from 0x10");
+}
+ATF_TC_BODY(subregion3, tc)
+{
+ h_create("test8", 0, 0x4f, EX_NOCOALESCE);
+
+ h_alloc_region(0x30, 0x10);
+ h_alloc_subregion(0, 0xf, 0x10, EX_NOALIGN, EX_NOBOUNDARY, 0, 0);
+ h_alloc_subregion(0, 0xf, 0x10, EX_NOALIGN, EX_NOBOUNDARY, EAGAIN, 0);
+
+ h_require("test8", 0x0, 0x4f, 0x2,
+ "0x0 - 0xf\n"
+ "0x30 - 0x3f\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(bound5);
+ATF_TC_HEAD(bound5, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "When allocating a region with a boundary constraint, checks "
+ "proper detection of overflaps once the candidate region has "
+ "been aligned. subr_extent.c prior 1.45 could corrupt the extent "
+ "map in this situation");
+}
+ATF_TC_BODY(bound5, tc)
+{
+ h_create("test9", 0, 0x4f, 0);
+
+ h_alloc_subregion(0, 0x10, 4, EX_NOALIGN, 0, 0, 0);
+ h_alloc_subregion(0xd, 0x20, 2, EX_NOALIGN, 0, 0, 0xd);
+ h_alloc_subregion(0, 0x4f, 8, EX_NOALIGN, 8, 0, 0x10);
+
+ h_require("test9", 0x0, 0x4f, 0x0,
+ "0x0 - 0x3\n"
+ "0xd - 0xe\n"
+ "0x10 - 0x17\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(free);
+ATF_TC_HEAD(free, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks extent_free()");
+}
+ATF_TC_BODY(free, tc)
+{
+ h_create("test10", 0xc0002000, 0xffffe000, EX_BOUNDZERO);
+
+ h_alloc_subregion(0xc0002000, 0xffffe000, 0x2000,
+ 0x10000, 0x10000, 0, 0xc0010000);
+ h_alloc_subregion(0xc0002000, 0xffffe000, 0x2000,
+ 0x10000, 0x10000, 0, 0xc0020000);
+
+ h_require("test10", 0xc0002000, 0xffffe000, 0x0,
+ "0xc0010000 - 0xc0011fff\n"
+ "0xc0020000 - 0xc0021fff\n");
+
+ h_free(0xc0020000, 0x2000);
+ h_require("test10", 0xc0002000, 0xffffe000, 0x0,
+ "0xc0010000 - 0xc0011fff\n");
+
+ h_alloc_subregion(0xc0002000, 0xffffe000, 0x10000,
+ 0x10000, 0x10000, 0, 0xc0022000);
+
+ h_require("test10", 0xc0002000, 0xffffe000, 0x0,
+ "0xc0010000 - 0xc0011fff\n"
+ "0xc0022000 - 0xc0031fff\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TC(subregion4);
+ATF_TC_HEAD(subregion4, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks for off-by-one bug which would cause a region at the end "
+ "of the extent to be allocated multiple times (fixed in 1.51)");
+}
+ATF_TC_BODY(subregion4, tc)
+{
+ h_create("test11", 0x10, 0x20, EX_NOCOALESCE);
+
+ h_alloc_subregion(0x10, 0x13, 0x4, EX_NOALIGN, EX_NOBOUNDARY, 0, 0x10);
+ h_alloc_subregion(0x1e, 0x1f, 0x2, EX_NOALIGN, EX_NOBOUNDARY, 0, 0x1e);
+ h_alloc_subregion(0x20, 0x20, 0x1, EX_NOALIGN, EX_NOBOUNDARY, 0, 0x20);
+ h_alloc_subregion(0x20, 0x20, 0x1, EX_NOALIGN, EX_NOBOUNDARY, EAGAIN, 0);
+ h_alloc_subregion(0x10, 0x20, 0x1, EX_NOALIGN, EX_NOBOUNDARY, 0, 0x14);
+
+ h_require("test11", 0x10, 0x20, 0x2,
+ "0x10 - 0x13\n"
+ "0x14 - 0x14\n"
+ "0x1e - 0x1f\n"
+ "0x20 - 0x20\n");
+
+ extent_destroy(ex);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, coalesce);
+ ATF_TP_ADD_TC(tp, subregion1);
+ ATF_TP_ADD_TC(tp, subregion2);
+ ATF_TP_ADD_TC(tp, bound1);
+ ATF_TP_ADD_TC(tp, bound2);
+ ATF_TP_ADD_TC(tp, bound3);
+ ATF_TP_ADD_TC(tp, bound4);
+ ATF_TP_ADD_TC(tp, subregion3);
+ ATF_TP_ADD_TC(tp, bound5);
+ ATF_TP_ADD_TC(tp, free);
+ ATF_TP_ADD_TC(tp, subregion4);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_filedesc.c b/contrib/netbsd-tests/kernel/t_filedesc.c
new file mode 100644
index 0000000..6b367ee
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_filedesc.c
@@ -0,0 +1,108 @@
+/* $NetBSD: t_filedesc.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_filedesc.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $");
+
+#include <sys/types.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../h_macros.h"
+
+ATF_TC(getfilerace);
+ATF_TC_HEAD(getfilerace, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "race between multithreaded proc. "
+ "fd_getfile() and fd_close() (PR kern/43694)");
+}
+
+static int fd;
+static volatile bool quit;
+
+static void *
+wrkwrk(void *arg)
+{
+
+ /* just something to cause fd_getfile() to be called */
+ while (!quit)
+ rump_sys_write(fd, &fd, sizeof(fd));
+
+ return NULL;
+}
+
+/* for me, 1000 triggers extremely seldom, 10k sometimes, 100k almost always */
+#define DEFAULT_ITERATIONS 10000
+
+ATF_TC_BODY(getfilerace, tc)
+{
+ pthread_t pt;
+ int fd_wrk;
+ int i, iters;
+
+ /*
+ * Want a multiprocessor virtual kernel. A multiprocessor host
+ * probably helps too, but that's harder to do in software...
+ */
+ setenv("RUMP_NCPU", "2", 1);
+ rump_init();
+
+ fd = fd_wrk = rump_sys_open("/dev/null", O_RDWR, 0);
+ if (fd == -1)
+ atf_tc_fail_errno("cannot open /dev/null");
+
+ if (atf_tc_has_config_var(tc, "iters"))
+ iters = atoi(atf_tc_get_config_var(tc, "iters"));
+ else
+ iters = DEFAULT_ITERATIONS;
+
+ pthread_create(&pt, NULL, wrkwrk, NULL);
+ for (i = 0; i < iters; i++) {
+ rump_sys_close(fd_wrk);
+ fd_wrk = rump_sys_open("/dev/null", O_RDWR, 0);
+ assert(fd == fd_wrk);
+ }
+
+ quit = true;
+ pthread_join(pt, NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, getfilerace);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_kauth_pr_47598.c b/contrib/netbsd-tests/kernel/t_kauth_pr_47598.c
new file mode 100644
index 0000000..f54b289
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_kauth_pr_47598.c
@@ -0,0 +1,169 @@
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2013\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_kauth_pr_47598.c,v 1.3 2014/04/28 08:34:16 martin Exp $");
+
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/sysctl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <atf-c.h>
+
+/*
+ * helper function
+ */
+static const char curtain_name[] = "security.models.bsd44.curtain";
+static const char securelevel_name[] = "security.models.bsd44.securelevel";
+
+static bool may_lower_curtain(void);
+static int get_curtain(void);
+static void set_curtain(int newval);
+
+static bool
+may_lower_curtain(void)
+{
+ int seclevel;
+ size_t len = sizeof(seclevel);
+
+ if (sysctlbyname(securelevel_name, &seclevel, &len, NULL, 0) != 0)
+ atf_tc_fail("failed to read %s", securelevel_name);
+
+ return seclevel <= 0;
+}
+
+static int
+get_curtain(void)
+{
+ int curtain;
+ size_t len = sizeof(curtain);
+
+ if (sysctlbyname(curtain_name, &curtain, &len, NULL, 0) != 0)
+ atf_tc_fail("failed to read %s", curtain_name);
+
+ return curtain;
+}
+
+static void
+set_curtain(int newval)
+{
+
+ if (sysctlbyname(curtain_name, NULL, 0, &newval, sizeof(newval)) != 0)
+ atf_tc_fail("failed to set %s to %d", curtain_name, newval);
+}
+
+/*
+ * PR kern/47598: if security.models.extensions.curtain = 1 we crash when
+ * doing a netstat while an embryonic (not yet fully accepted) connection
+ * exists.
+ * This has been fixed with rev. 1.5 of
+ * src/sys/secmodel/extensions/secmodel_extensions.c.
+ */
+
+
+ATF_TC(kauth_curtain);
+ATF_TC_HEAD(kauth_curtain, tc)
+{
+ atf_tc_set_md_var(tc, "require.user", "root");
+ atf_tc_set_md_var(tc, "require.progs", "netstat");
+ atf_tc_set_md_var(tc, "descr",
+ "Checks for kernel crash with curtain active (PR kern/47598)");
+}
+
+ATF_TC_BODY(kauth_curtain, tc)
+{
+
+ int old_curtain, s, s2, err;
+ socklen_t slen;
+ struct sockaddr_in sa;
+
+ /*
+ * save old value of "curtain" and enable it
+ */
+ old_curtain = get_curtain();
+ if (old_curtain < 1 && !may_lower_curtain())
+ atf_tc_skip("curtain is not enabled and we would not be able"
+ " to drop it later due to securelevel settings");
+
+ set_curtain(1);
+
+ /*
+ * create a socket and bind it to some arbitray free port
+ */
+ s = socket(PF_INET, SOCK_STREAM|SOCK_NONBLOCK, 0);
+ ATF_REQUIRE(s != -1);
+ memset(&sa, 0, sizeof(sa));
+ sa.sin_family = AF_INET;
+ sa.sin_len = sizeof(sa);
+ sa.sin_addr.s_addr = inet_addr("127.0.0.1");
+ ATF_REQUIRE(bind(s, (struct sockaddr *)&sa, sizeof(sa))==0);
+ ATF_REQUIRE(listen(s, 16)==0);
+
+ /*
+ * extract address and open a connection to the port
+ */
+ slen = sizeof(sa);
+ ATF_REQUIRE(getsockname(s, (struct sockaddr *)&sa, &slen)==0);
+ s2 = socket(PF_INET, SOCK_STREAM|SOCK_NONBLOCK, 0);
+ ATF_REQUIRE(s2 != -1);
+ printf("port is %d\n", ntohs(sa.sin_port));
+ err = connect(s2, (struct sockaddr *)&sa, sizeof(sa));
+ ATF_REQUIRE_MSG(err == -1 && errno == EINPROGRESS,
+ "conect returned %d with errno %d", err, errno);
+ fflush(stdout);
+ fflush(stderr);
+
+ /*
+ * we now have a pending, not yet accepted connection - run netstat
+ */
+ system("netstat -aA");
+
+ /*
+ * cleanup
+ */
+ close(s2);
+ close(s);
+
+ /*
+ * restore old value of curtain
+ */
+ set_curtain(old_curtain);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, kauth_curtain);
+
+ return atf_no_error();
+}
+
+
diff --git a/contrib/netbsd-tests/kernel/t_lock.c b/contrib/netbsd-tests/kernel/t_lock.c
new file mode 100644
index 0000000..3704afb
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_lock.c
@@ -0,0 +1,87 @@
+/* $NetBSD: t_lock.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_lock.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+
+#include <sys/time.h>
+
+#include <machine/lock.h>
+#include <signal.h>
+
+#include <atf-c.h>
+
+#include "../h_macros.h"
+
+__cpu_simple_lock_t lk;
+volatile int handled = 0;
+
+static void
+handler(int sig)
+{
+ handled = 1;
+ __cpu_simple_unlock(&lk);
+}
+
+ATF_TC(lock);
+ATF_TC_HEAD(lock, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "3");
+ atf_tc_set_md_var(tc, "descr",
+ "Checks __cpu_simple_lock()/__cpu_simple_unlock()");
+}
+ATF_TC_BODY(lock, tc)
+{
+ struct itimerval itv;
+
+ __cpu_simple_lock_init(&lk);
+
+ REQUIRE_LIBC(signal(SIGVTALRM, handler), SIG_ERR);
+
+ itv.it_interval.tv_sec = 0;
+ itv.it_interval.tv_usec = 0;
+ itv.it_value.tv_sec = 1;
+ itv.it_value.tv_usec = 0;
+ RL(setitimer(ITIMER_VIRTUAL, &itv, NULL));
+
+ __cpu_simple_lock(&lk);
+ __cpu_simple_lock(&lk);
+
+ ATF_REQUIRE(handled);
+
+ __cpu_simple_unlock(&lk);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, lock);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_lockf.c b/contrib/netbsd-tests/kernel/t_lockf.c
new file mode 100644
index 0000000..d937301
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_lockf.c
@@ -0,0 +1,262 @@
+/* $NetBSD: t_lockf.c,v 1.9 2013/10/19 17:45:00 christos Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, 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 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 <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/ptrace.h>
+
+/*
+ * lockf1 regression test:
+ *
+ * Tests:
+ * Fork N child processes, each of which gets M random byte range locks
+ * on a common file. We ignore all lock errors (practically speaking,
+ * this means EDEADLK or ENOLOCK), but we make numerous passes over all
+ * the children to make sure that they are still awake. (We do this by
+ * verifying that we can ptrace(ATTACH/DETACH) to the children and get
+ * their status via waitpid().)
+ * When finished, reap all the children.
+ */
+
+#define nlocks 500 /* number of locks per thread */
+#define nprocs 10 /* number of processes to spawn */
+#define npasses 50 /* number of passes to make over the children */
+#define sleeptime 150000 /* sleep time between locks, usec */
+#define filesize 8192 /* size of file to lock */
+
+const char *lockfile = "lockf_test";
+
+static u_int32_t
+random_uint32(void)
+{
+ return lrand48();
+}
+
+static void
+trylocks(int id)
+{
+ int i, fd;
+
+ srand48(getpid());
+
+ fd = open (lockfile, O_RDWR, 0);
+
+ if (fd < 0)
+ err(1, "%s", lockfile);
+
+ printf("%d: start\n", id);
+
+ for (i = 0; i < nlocks; i++) {
+ struct flock fl;
+
+ fl.l_start = random_uint32() % filesize;
+ fl.l_len = random_uint32() % filesize;
+ switch (random_uint32() % 3) {
+ case 0:
+ fl.l_type = F_RDLCK;
+ break;
+ case 1:
+ fl.l_type = F_WRLCK;
+ break;
+ case 2:
+ fl.l_type = F_UNLCK;
+ break;
+ }
+ fl.l_whence = SEEK_SET;
+
+ (void)fcntl(fd, F_SETLKW, &fl);
+
+ if (usleep(sleeptime) < 0)
+ err(1, "usleep");
+ }
+ printf("%d: done\n", id);
+ close (fd);
+}
+
+ATF_TC(randlock);
+ATF_TC_HEAD(randlock, tc)
+{
+
+ atf_tc_set_md_var(tc, "timeout", "300");
+ atf_tc_set_md_var(tc, "descr", "Checks fcntl(2) locking");
+}
+
+ATF_TC_BODY(randlock, tc)
+{
+ int i, j, fd;
+ int pipe_fd[2];
+ pid_t *pid;
+ int status;
+ char pipe_in, pipe_out;
+ const char pipe_errmsg[] = "child: pipe write failed\n";
+
+ (void)unlink(lockfile);
+
+ fd = open (lockfile, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0666);
+ ATF_REQUIRE_MSG(fd >= 0, "open(%s): %s", lockfile, strerror(errno));
+
+ ATF_REQUIRE_MSG(ftruncate(fd, filesize) >= 0,
+ "ftruncate(%s): %s", lockfile, strerror(errno));
+
+ ATF_REQUIRE_MSG(pipe(pipe_fd) == 0, "pipe: %s", strerror(errno));
+
+ fsync(fd);
+ close(fd);
+
+ pid = malloc(nprocs * sizeof(pid_t));
+
+ for (i = 0; i < nprocs; i++) {
+ pipe_out = (char)('A' + i);
+ pid[i] = fork();
+ switch (pid[i]) {
+ case 0:
+ if (write(pipe_fd[1], &pipe_out, 1) != 1)
+ write(STDERR_FILENO, pipe_errmsg,
+ __arraycount(pipe_errmsg) - 1);
+ else
+ trylocks(i);
+ _exit(0);
+ break;
+ case -1:
+ atf_tc_fail("fork %d failed", i);
+ break;
+ default:
+ ATF_REQUIRE_MSG(read(pipe_fd[0], &pipe_in, 1) == 1,
+ "parent: read_pipe(%i): %s", i, strerror(errno));
+ ATF_REQUIRE_MSG(pipe_in == pipe_out,
+ "parent: pipe does not match");
+ break;
+ }
+ }
+ for (j = 0; j < npasses; j++) {
+ printf("parent: run %i\n", j+1);
+ for (i = 0; i < nprocs; i++) {
+ ATF_REQUIRE_MSG(ptrace(PT_ATTACH, pid[i], 0, 0) >= 0,
+ "ptrace attach %d", pid[i]);
+ ATF_REQUIRE_MSG(waitpid(pid[i], &status, WUNTRACED) >= 0,
+ "waitpid(ptrace)");
+ usleep(sleeptime / 3);
+ ATF_REQUIRE_MSG(ptrace(PT_DETACH, pid[i], (caddr_t)1,
+ 0) >= 0,
+ "ptrace detach %d", pid[i]);
+ usleep(sleeptime / 3);
+ }
+ }
+ for (i = 0; i < nprocs; i++) {
+ printf("reap %d: ", i);
+ fflush(stdout);
+ kill(pid[i], SIGINT);
+ waitpid(pid[i], &status, 0);
+ printf(" status %d\n", status);
+ }
+ atf_tc_pass();
+}
+
+static int
+dolock(int fd, int op, off_t lk_off, off_t lk_size)
+{
+ off_t result;
+ int ret;
+
+ result = lseek(fd, lk_off, SEEK_SET);
+ if (result == -1) {
+ return errno;
+ }
+ ATF_REQUIRE_MSG(result == lk_off, "lseek to wrong offset");
+ ret = lockf(fd, op, lk_size);
+ if (ret == -1) {
+ return errno;
+ }
+ return 0;
+}
+
+ATF_TC(deadlock);
+ATF_TC_HEAD(deadlock, tc)
+{
+
+ atf_tc_set_md_var(tc, "timeout", "30");
+ atf_tc_set_md_var(tc, "descr", "Checks fcntl(2) deadlock detection");
+}
+
+ATF_TC_BODY(deadlock, tc)
+{
+ int fd;
+ int error;
+ int ret;
+ pid_t pid;
+
+ (void)unlink(lockfile);
+
+ fd = open (lockfile, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0666);
+ ATF_REQUIRE_MSG(fd >= 0, "open(%s): %s", lockfile, strerror(errno));
+
+ ATF_REQUIRE_MSG(ftruncate(fd, filesize) >= 0,
+ "ftruncate(%s): %s", lockfile, strerror(errno));
+
+ fsync(fd);
+
+ error = dolock(fd, F_LOCK, 0, 1);
+ ATF_REQUIRE_MSG(error == 0, "initial dolock: %s", strerror(errno));
+
+ pid = fork();
+ ATF_REQUIRE_MSG(pid != -1, "fork failed: %s", strerror(errno));
+ if (pid == 0) {
+ error = dolock(fd, F_LOCK, 1, 1);
+ ATF_REQUIRE_MSG(error == 0, "child dolock: %s",
+ strerror(errno));
+ dolock(fd, F_LOCK, 0, 1); /* will block */
+ atf_tc_fail("child did not block");
+ }
+ sleep(1); /* give child time to grab its lock then block */
+
+ error = dolock(fd, F_LOCK, 1, 1);
+ ATF_REQUIRE_MSG(error == EDEADLK, "parent did not detect deadlock: %s",
+ strerror(errno));
+ ret = kill(pid, SIGKILL);
+ ATF_REQUIRE_MSG(ret != -1, "failed to kill child: %s", strerror(errno));
+
+ atf_tc_pass();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, randlock);
+ ATF_TP_ADD_TC(tp, deadlock);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_mqueue.c b/contrib/netbsd-tests/kernel/t_mqueue.c
new file mode 100644
index 0000000..2a03101
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_mqueue.c
@@ -0,0 +1,137 @@
+/* $NetBSD: t_mqueue.c,v 1.4 2014/03/02 19:56:48 jmmv Exp $ */
+
+/*
+ * Test for POSIX message queue priority handling.
+ *
+ * This file is in the Public Domain.
+ */
+
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <mqueue.h>
+
+#define MQ_PRIO_BASE 24
+
+static void
+send_msgs(mqd_t mqfd)
+{
+ char msg[2];
+
+ msg[1] = '\0';
+
+ msg[0] = 'a';
+ ATF_REQUIRE_MSG(mq_send(mqfd, msg, sizeof(msg), MQ_PRIO_BASE) != -1,
+ "mq_send 1 failed: %d", errno);
+
+ msg[0] = 'b';
+ ATF_REQUIRE_MSG(mq_send(mqfd, msg, sizeof(msg), MQ_PRIO_BASE + 1) != -1,
+ "mq_send 2 failed: %d", errno);
+
+ msg[0] = 'c';
+ ATF_REQUIRE_MSG(mq_send(mqfd, msg, sizeof(msg), MQ_PRIO_BASE) != -1,
+ "mq_send 3 failed: %d", errno);
+
+ msg[0] = 'd';
+ ATF_REQUIRE_MSG(mq_send(mqfd, msg, sizeof(msg), MQ_PRIO_BASE - 1) != -1,
+ "mq_send 4 failed: %d", errno);
+
+ msg[0] = 'e';
+ ATF_REQUIRE_MSG(mq_send(mqfd, msg, sizeof(msg), 0) != -1,
+ "mq_send 5 failed: %d", errno);
+
+ msg[0] = 'f';
+ ATF_REQUIRE_MSG(mq_send(mqfd, msg, sizeof(msg), MQ_PRIO_BASE + 1) != -1,
+ "mq_send 6 failed: %d", errno);
+}
+
+static void
+receive_msgs(mqd_t mqfd)
+{
+ struct mq_attr mqa;
+ char *m;
+ unsigned p;
+ int len;
+
+ ATF_REQUIRE_MSG(mq_getattr(mqfd, &mqa) != -1, "mq_getattr failed %d",
+ errno);
+
+ len = mqa.mq_msgsize;
+ m = calloc(1, len);
+ ATF_REQUIRE_MSG(m != NULL, "calloc failed");
+
+ ATF_REQUIRE_MSG(mq_receive(mqfd, m, len, &p) != -1,
+ "mq_receive 1 failed: %d", errno);
+ ATF_REQUIRE_MSG(p == (MQ_PRIO_BASE + 1) && m[0] == 'b',
+ "mq_receive 1 prio/data mismatch");
+
+ ATF_REQUIRE_MSG(mq_receive(mqfd, m, len, &p) != -1,
+ "mq_receive 2 failed: %d", errno);
+ ATF_REQUIRE_MSG(p == (MQ_PRIO_BASE + 1) && m[0] == 'f',
+ "mq_receive 2 prio/data mismatch");
+
+ ATF_REQUIRE_MSG(mq_receive(mqfd, m, len, &p) != -1,
+ "mq_receive 3 failed: %d", errno);
+ ATF_REQUIRE_MSG(p == MQ_PRIO_BASE && m[0] == 'a',
+ "mq_receive 3 prio/data mismatch");
+
+ ATF_REQUIRE_MSG(mq_receive(mqfd, m, len, &p) != -1,
+ "mq_receive 4 failed: %d", errno);
+ ATF_REQUIRE_MSG(p == MQ_PRIO_BASE && m[0] == 'c',
+ "mq_receive 4 prio/data mismatch");
+
+ ATF_REQUIRE_MSG(mq_receive(mqfd, m, len, &p) != -1,
+ "mq_receive 5 failed: %d", errno);
+ ATF_REQUIRE_MSG(p == (MQ_PRIO_BASE - 1) && m[0] == 'd',
+ "mq_receive 5 prio/data mismatch");
+
+ ATF_REQUIRE_MSG(mq_receive(mqfd, m, len, &p) != -1,
+ "mq_receive 6 failed: %d", errno);
+ ATF_REQUIRE_MSG(p == 0 && m[0] == 'e',
+ "mq_receive 6 prio/data mismatch");
+}
+
+ATF_TC(mqueue);
+ATF_TC_HEAD(mqueue, tc)
+{
+
+ atf_tc_set_md_var(tc, "timeout", "3");
+ atf_tc_set_md_var(tc, "descr", "Checks mqueue send/receive");
+}
+
+ATF_TC_BODY(mqueue, tc)
+{
+ int status;
+ char *tmpdir;
+ char template[32];
+ char mq_name[64];
+
+ strlcpy(template, "./t_mqueue.XXXXXX", sizeof(template));
+ tmpdir = mkdtemp(template);
+ ATF_REQUIRE_MSG(tmpdir != NULL, "mkdtemp failed: %d", errno);
+ snprintf(mq_name, sizeof(mq_name), "%s/mq", tmpdir);
+
+ mqd_t mqfd;
+
+ mqfd = mq_open(mq_name, O_RDWR | O_CREAT,
+ S_IRUSR | S_IRWXG | S_IROTH, NULL);
+ ATF_REQUIRE_MSG(mqfd != -1, "mq_open failed: %d", errno);
+
+ send_msgs(mqfd);
+ receive_msgs(mqfd);
+
+ status = mq_close(mqfd);
+ ATF_REQUIRE_MSG(status == 0, "mq_close failed: %d", errno);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, mqueue);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_ps_strings.sh b/contrib/netbsd-tests/kernel/t_ps_strings.sh
new file mode 100755
index 0000000..8adba54
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_ps_strings.sh
@@ -0,0 +1,85 @@
+# $NetBSD: t_ps_strings.sh,v 1.1 2011/03/05 18:14:33 pgoyette Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case validate
+validate_head()
+{
+ atf_set "descr" "Validates ps_strings passed to program"
+}
+validate_body()
+{
+ atf_check -s exit:0 -o ignore -e ignore \
+ $(atf_get_srcdir)/h_ps_strings1
+}
+
+# Function to parse and validate the output from ps
+
+parse_ps() {
+ local pid seq arg
+
+ pid="$1" ; shift
+
+ while [ "$1" != "$pid" ] ; do
+ echo $1
+ shift
+ done
+ if [ $# -eq 0 ] ; then
+ echo "NO_PID"
+ return
+ fi
+ shift
+
+ seq=0
+ while [ $# -gt 1 ] ; do
+ arg=$(printf "arg%04x" $seq)
+ if [ "$arg" != "$1" ] ; then
+ echo BAD_$seq
+ return
+ fi
+ shift
+ done
+ echo "OK"
+}
+
+atf_test_case update
+update_head()
+{
+ atf_set "descr" "Check updating of ps_strings"
+}
+update_body()
+{
+ $(atf_get_srcdir)/h_ps_strings2 > /dev/null 2>&1 &
+ h_pid=$!
+ parse=$(parse_ps $h_pid $(ps -wwo pid,args -p $h_pid) )
+ kill $h_pid
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case validate
+ atf_add_test_case update
+}
diff --git a/contrib/netbsd-tests/kernel/t_pty.c b/contrib/netbsd-tests/kernel/t_pty.c
new file mode 100644
index 0000000..fccfc17b
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_pty.c
@@ -0,0 +1,351 @@
+/* $Id: t_pty.c,v 1.1 2011/09/24 15:53:01 christos Exp $ */
+
+/*
+ * Allocates a pty(4) device, and sends the specified number of packets of the
+ * specified length though it, while a child reader process reads and reports
+ * results.
+ *
+ * Written by Matthew Mondor
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_pty.c,v 1.1 2011/09/24 15:53:01 christos Exp $");
+
+#include <errno.h>
+#include <err.h>
+#include <fcntl.h>
+#include <poll.h>
+#include <stdio.h>
+#ifdef __linux__
+#define _XOPEN_SOURCE
+#define __USE_XOPEN
+#endif
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#ifdef STANDALONE
+static __dead void usage(const char *);
+static void parse_args(int, char **);
+#else
+#include <atf-c.h>
+#include "../h_macros.h"
+#endif
+
+static int pty_open(void);
+static int tty_open(const char *);
+static void fd_nonblock(int);
+static pid_t child_spawn(const char *);
+static void run(void);
+
+static size_t buffer_size = 4096;
+static size_t packets = 2;
+static uint8_t *dbuf;
+static int verbose;
+static int qsize;
+
+
+static
+void run(void)
+{
+ size_t i;
+ int pty;
+ int status;
+ pid_t child;
+ if ((dbuf = calloc(1, buffer_size)) == NULL)
+ err(EXIT_FAILURE, "malloc(%zu)", buffer_size);
+
+ if (verbose)
+ (void)printf(
+ "parent: started; opening PTY and spawning child\n");
+ pty = pty_open();
+ child = child_spawn(ptsname(pty));
+ if (verbose)
+ (void)printf("parent: sleeping to make sure child is ready\n");
+ (void)sleep(1);
+
+ for (i = 0; i < buffer_size; i++)
+ dbuf[i] = i & 0xff;
+
+ if (verbose)
+ (void)printf("parent: writing\n");
+
+ for (i = 0; i < packets; i++) {
+ ssize_t size;
+
+ if (verbose)
+ (void)printf(
+ "parent: attempting to write %zu bytes to PTY\n",
+ buffer_size);
+ if ((size = write(pty, dbuf, buffer_size)) == -1) {
+ err(EXIT_FAILURE, "parent: write()");
+ break;
+ }
+ if (verbose)
+ (void)printf("parent: wrote %zd bytes to PTY\n", size);
+ }
+
+ if (verbose)
+ (void)printf("parent: waiting for child to exit\n");
+ if (waitpid(child, &status, 0) == -1)
+ err(EXIT_FAILURE, "waitpid");
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
+ errx(EXIT_FAILURE, "child failed");
+
+ if (verbose)
+ (void)printf("parent: closing PTY\n");
+ (void)close(pty);
+ if (verbose)
+ (void)printf("parent: exiting\n");
+}
+
+static void
+condition(int fd)
+{
+ struct termios tios;
+
+ if (qsize) {
+ int opt = qsize;
+ if (ioctl(fd, TIOCSQSIZE, &opt) == -1)
+ err(EXIT_FAILURE, "Couldn't set tty(4) buffer size");
+ if (ioctl(fd, TIOCGQSIZE, &opt) == -1)
+ err(EXIT_FAILURE, "Couldn't get tty(4) buffer size");
+ if (opt != qsize)
+ errx(EXIT_FAILURE, "Wrong qsize %d != %d\n",
+ qsize, opt);
+ }
+ if (tcgetattr(fd, &tios) == -1)
+ err(EXIT_FAILURE, "tcgetattr()");
+ cfmakeraw(&tios);
+ cfsetspeed(&tios, B921600);
+ if (tcsetattr(fd, TCSANOW, &tios) == -1)
+ err(EXIT_FAILURE, "tcsetattr()");
+}
+
+static int
+pty_open(void)
+{
+ int fd;
+
+ if ((fd = posix_openpt(O_RDWR)) == -1)
+ err(EXIT_FAILURE, "Couldn't pty(4) device");
+ condition(fd);
+ if (grantpt(fd) == -1)
+ err(EXIT_FAILURE,
+ "Couldn't grant permissions on tty(4) device");
+
+
+ condition(fd);
+
+ if (unlockpt(fd) == -1)
+ err(EXIT_FAILURE, "unlockpt()");
+
+ return fd;
+}
+
+static int
+tty_open(const char *ttydev)
+{
+ int fd;
+
+ if ((fd = open(ttydev, O_RDWR, 0)) == -1)
+ err(EXIT_FAILURE, "Couldn't open tty(4) device");
+
+#ifdef USE_PPP_DISCIPLINE
+ {
+ int opt = PPPDISC;
+ if (ioctl(fd, TIOCSETD, &opt) == -1)
+ err(EXIT_FAILURE,
+ "Couldn't set tty(4) discipline to PPP");
+ }
+#endif
+
+ condition(fd);
+
+ return fd;
+}
+
+static void
+fd_nonblock(int fd)
+{
+ int opt;
+
+ if ((opt = fcntl(fd, F_GETFL, NULL)) == -1)
+ err(EXIT_FAILURE, "fcntl()");
+ if (fcntl(fd, F_SETFL, opt | O_NONBLOCK) == -1)
+ err(EXIT_FAILURE, "fcntl()");
+}
+
+static pid_t
+child_spawn(const char *ttydev)
+{
+ pid_t pid;
+ int tty;
+ struct pollfd pfd;
+ size_t total = 0;
+
+ if ((pid = fork()) == -1)
+ err(EXIT_FAILURE, "fork()");
+ (void)setsid();
+ if (pid != 0)
+ return pid;
+
+ if (verbose)
+ (void)printf("child: started; open \"%s\"\n", ttydev);
+ tty = tty_open(ttydev);
+ fd_nonblock(tty);
+
+ if (verbose)
+ (void)printf("child: TTY open, starting read loop\n");
+ pfd.fd = tty;
+ pfd.events = POLLIN;
+ pfd.revents = 0;
+ for (;;) {
+ int ret;
+ ssize_t size;
+
+ if (verbose)
+ (void)printf("child: polling\n");
+ if ((ret = poll(&pfd, 1, 2000)) == -1)
+ err(EXIT_FAILURE, "child: poll()");
+ if (ret == 0)
+ break;
+ if ((pfd.revents & POLLERR) != 0)
+ break;
+ if ((pfd.revents & POLLIN) != 0) {
+ for (;;) {
+ if (verbose)
+ (void)printf(
+ "child: attempting to read %zu"
+ " bytes\n", buffer_size);
+ if ((size = read(tty, dbuf, buffer_size))
+ == -1) {
+ if (errno == EAGAIN)
+ break;
+ err(EXIT_FAILURE, "child: read()");
+ }
+ if (qsize && size < qsize &&
+ (size_t)size < buffer_size)
+ errx(EXIT_FAILURE, "read returned %zd "
+ "less than the queue size %d",
+ size, qsize);
+ if (verbose)
+ (void)printf(
+ "child: read %zd bytes from TTY\n",
+ size);
+ if (size == 0)
+ goto end;
+ total += size;
+ }
+ }
+ }
+end:
+ if (verbose)
+ (void)printf("child: closing TTY %zu\n", total);
+ (void)close(tty);
+ if (verbose)
+ (void)printf("child: exiting\n");
+ if (total != buffer_size * packets)
+ errx(EXIT_FAILURE,
+ "Lost data %zu != %zu\n", total, buffer_size * packets);
+
+ exit(EXIT_SUCCESS);
+}
+
+#ifdef STANDALONE
+static void
+usage(const char *msg)
+{
+
+ if (msg != NULL)
+ (void) fprintf(stderr, "\n%s\n\n", msg);
+
+ (void)fprintf(stderr,
+ "Usage: %s [-v] [-q <qsize>] [-s <packetsize>] [-n <packets>]\n",
+ getprogname());
+
+ exit(EXIT_FAILURE);
+}
+
+static void
+parse_args(int argc, char **argv)
+{
+ int ch;
+
+ while ((ch = getopt(argc, argv, "n:q:s:v")) != -1) {
+ switch (ch) {
+ case 'n':
+ packets = (size_t)atoi(optarg);
+ break;
+ case 'q':
+ qsize = atoi(optarg);
+ break;
+ case 's':
+ buffer_size = (size_t)atoi(optarg);
+ break;
+ case 'v':
+ verbose++;
+ break;
+ default:
+ usage(NULL);
+ break;
+ }
+ }
+ if (buffer_size < 0 || buffer_size > 65536)
+ usage("-s must be between 0 and 65536");
+ if (packets < 1 || packets > 100)
+ usage("-p must be between 1 and 100");
+}
+
+int
+main(int argc, char **argv)
+{
+
+ parse_args(argc, argv);
+ run();
+ exit(EXIT_SUCCESS);
+}
+
+#else
+ATF_TC(pty_no_queue);
+
+ATF_TC_HEAD(pty_no_queue, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that writing to pty "
+ "does not lose data with the default queue size of 1024");
+}
+
+ATF_TC_BODY(pty_no_queue, tc)
+{
+ qsize = 0;
+ run();
+}
+
+ATF_TC(pty_queue);
+
+ATF_TC_HEAD(pty_queue, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that writing to pty "
+ "does not lose data with the a queue size of 4096");
+}
+
+ATF_TC_BODY(pty_queue, tc)
+{
+ qsize = 4096;
+ run();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, pty_no_queue);
+ ATF_TP_ADD_TC(tp, pty_queue);
+
+ return atf_no_error();
+}
+#endif
diff --git a/contrib/netbsd-tests/kernel/t_rnd.c b/contrib/netbsd-tests/kernel/t_rnd.c
new file mode 100644
index 0000000..7f1f288
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_rnd.c
@@ -0,0 +1,95 @@
+/* $NetBSD: t_rnd.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $ */
+
+/*
+ * Copyright (c) 2009 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_rnd.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $");
+
+#include <sys/types.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/rnd.h>
+
+#include <atf-c.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../h_macros.h"
+
+ATF_TC(RNDADDDATA);
+ATF_TC_HEAD(RNDADDDATA, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks ioctl(RNDADDDATA) (PR kern/42020)");
+}
+
+/* Adapted from example provided by Juho Salminen in the noted PR. */
+ATF_TC_BODY(RNDADDDATA, tc)
+{
+ rnddata_t rd;
+ int fd;
+
+ rump_init();
+ fd = rump_sys_open("/dev/random", O_RDWR, 0);
+ if (fd == -1)
+ atf_tc_fail_errno("cannot open /dev/random");
+
+ rd.entropy = 1;
+ rd.len = 1;
+ if (rump_sys_ioctl(fd, RNDADDDATA, &rd) == -1)
+ atf_tc_fail_errno("RNDADDDATA");
+}
+
+ATF_TC(RNDADDDATA2);
+ATF_TC_HEAD(RNDADDDATA2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "checks ioctl(RNDADDDATA) deals with "
+ "garbage len field");
+}
+ATF_TC_BODY(RNDADDDATA2, tc)
+{
+ rnddata_t rd;
+ int fd;
+
+ rump_init();
+ fd = rump_sys_open("/dev/random", O_RDWR, 0);
+ if (fd == -1)
+ atf_tc_fail_errno("cannot open /dev/random");
+
+ rd.entropy = 1;
+ rd.len = -1;
+ ATF_REQUIRE_ERRNO(EINVAL, rump_sys_ioctl(fd, RNDADDDATA, &rd) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, RNDADDDATA);
+ ATF_TP_ADD_TC(tp, RNDADDDATA2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_sysctl.c b/contrib/netbsd-tests/kernel/t_sysctl.c
new file mode 100644
index 0000000..8b7c97e
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_sysctl.c
@@ -0,0 +1,74 @@
+/* $NetBSD: t_sysctl.c,v 1.1 2014/08/09 07:04:03 gson Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2014\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sysctl.c,v 1.1 2014/08/09 07:04:03 gson Exp $");
+
+#include <sys/sysctl.h>
+#include <errno.h>
+#include <memory.h>
+
+#include <atf-c.h>
+
+ATF_TC(bufsize);
+ATF_TC_HEAD(bufsize, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test sysctl integer reads with different buffer sizes");
+}
+ATF_TC_BODY(bufsize, tc)
+{
+ union {
+ int int_val;
+ unsigned char space[256];
+ } buf;
+ size_t len;
+ for (len = 0; len < sizeof(buf); len++) {
+ size_t oldlen = len;
+ int r;
+ memset(&buf, 0xFF, sizeof(buf));
+ r = sysctlbyname("kern.job_control", &buf, &oldlen, 0, (size_t) 0);
+ if (len < sizeof(int)) {
+ ATF_REQUIRE_EQ(r, -1);
+ ATF_REQUIRE_EQ(errno, ENOMEM);
+ } else {
+ ATF_REQUIRE_EQ(r, 0);
+ ATF_REQUIRE_EQ(buf.int_val, 1);
+ ATF_REQUIRE_EQ(oldlen, sizeof(int));
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, bufsize);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/kernel/t_sysv.c b/contrib/netbsd-tests/kernel/t_sysv.c
new file mode 100644
index 0000000..0860d4b
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_sysv.c
@@ -0,0 +1,854 @@
+/* $NetBSD: t_sysv.c,v 1.4 2014/03/02 20:13:12 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 1999, 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center, and by Andrew Doran.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Test the SVID-compatible Message Queue facility.
+ */
+
+#include <atf-c.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <sys/param.h>
+#include <sys/sem.h>
+#include <sys/shm.h>
+#include <sys/wait.h>
+
+volatile int did_sigsys, did_sigchild;
+volatile int child_status, child_count;
+
+void sigsys_handler(int);
+void sigchld_handler(int);
+
+key_t get_ftok(int);
+
+void print_msqid_ds(struct msqid_ds *, mode_t);
+void receiver(void);
+
+void print_semid_ds(struct semid_ds *, mode_t);
+void waiter(void);
+
+void print_shmid_ds(struct shmid_ds *, mode_t);
+void sharer(void);
+
+#define MESSAGE_TEXT_LEN 256
+
+struct mymsg {
+ long mtype;
+ char mtext[MESSAGE_TEXT_LEN];
+};
+
+const char *m1_str = "California is overrated.";
+const char *m2_str = "The quick brown fox jumped over the lazy dog.";
+
+size_t pgsize;
+
+#define MTYPE_1 1
+#define MTYPE_1_ACK 2
+
+#define MTYPE_2 3
+#define MTYPE_2_ACK 4
+
+pid_t child_pid;
+
+key_t msgkey, semkey, shmkey;
+
+int maxloop = 1;
+
+union semun {
+ int val; /* value for SETVAL */
+ struct semid_ds *buf; /* buffer for IPC_{STAT,SET} */
+ u_short *array; /* array for GETALL & SETALL */
+};
+
+
+/* Writes an integer to a file. To be used from the body of the test
+ * cases below to pass any global identifiers to the cleanup routine. */
+static void
+write_int(const char *path, const int value)
+{
+ int output;
+
+ output = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ ATF_REQUIRE_MSG(output != -1, "Failed to create %s", path);
+ write(output, &value, sizeof(value));
+ close(output);
+}
+
+
+/* Reads an integer from a file. To be used from the cleanup routines
+ * of the test cases below. */
+static int
+read_int(const char *path)
+{
+ int input;
+
+ input = open(path, O_RDONLY);
+ if (input == -1)
+ return -1;
+ else {
+ int value;
+ read(input, &value, sizeof(value));
+ return value;
+ }
+}
+
+
+void
+sigsys_handler(int signo)
+{
+
+ did_sigsys = 1;
+}
+
+void
+sigchld_handler(int signo)
+{
+ int c_status;
+
+ did_sigchild = 1;
+ /*
+ * Reap the child and return its status
+ */
+ if (wait(&c_status) == -1)
+ child_status = -errno;
+ else
+ child_status = c_status;
+
+ child_count--;
+}
+
+key_t get_ftok(int id)
+{
+ int fd;
+ char token_key[64], token_dir[64];
+ char *tmpdir;
+ key_t key;
+
+ strlcpy(token_key, "/tmp/t_sysv.XXXXXX", sizeof(token_key));
+ tmpdir = mkdtemp(token_key);
+ ATF_REQUIRE_MSG(tmpdir != NULL, "mkdtemp() failed: %d", errno);
+
+ strlcpy(token_dir, tmpdir, sizeof(token_dir));
+ strlcpy(token_key, tmpdir, sizeof(token_key));
+ strlcat(token_key, "/token_key", sizeof(token_key));
+
+ /* Create the file, since ftok() requires it to exist! */
+
+ fd = open(token_key, O_RDWR | O_CREAT | O_EXCL);
+ if (fd == -1) {
+ rmdir(tmpdir);
+ atf_tc_fail("open() of temp file failed: %d", errno);
+ return (key_t)-1;
+ } else
+ close(fd);
+
+ key = ftok(token_key, id);
+
+ ATF_REQUIRE_MSG(unlink(token_key) != -1, "unlink() failed: %d", errno);
+ ATF_REQUIRE_MSG(rmdir(token_dir) != -1, "rmdir() failed: %d", errno);
+
+ return key;
+}
+
+ATF_TC_WITH_CLEANUP(msg);
+ATF_TC_HEAD(msg, tc)
+{
+
+ atf_tc_set_md_var(tc, "timeout", "3");
+ atf_tc_set_md_var(tc, "descr", "Checks sysvmsg passing");
+}
+
+ATF_TC_BODY(msg, tc)
+{
+ struct sigaction sa;
+ struct msqid_ds m_ds;
+ struct mymsg m;
+ sigset_t sigmask;
+ int sender_msqid;
+ int loop;
+ int c_status;
+
+ /*
+ * Install a SIGSYS handler so that we can exit gracefully if
+ * System V Message Queue support isn't in the kernel.
+ */
+ did_sigsys = 0;
+ sa.sa_handler = sigsys_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ ATF_REQUIRE_MSG(sigaction(SIGSYS, &sa, NULL) != -1,
+ "sigaction SIGSYS: %d", errno);
+
+ /*
+ * Install a SIGCHLD handler to deal with all possible exit
+ * conditions of the receiver.
+ */
+ did_sigchild = 0;
+ child_count = 0;
+ sa.sa_handler = sigchld_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ ATF_REQUIRE_MSG(sigaction(SIGCHLD, &sa, NULL) != -1,
+ "sigaction SIGCHLD: %d", errno);
+
+ msgkey = get_ftok(4160);
+ ATF_REQUIRE_MSG(msgkey != (key_t)-1, "get_ftok failed");
+
+ sender_msqid = msgget(msgkey, IPC_CREAT | 0640);
+ ATF_REQUIRE_MSG(sender_msqid != -1, "msgget: %d", errno);
+ write_int("sender_msqid", sender_msqid);
+
+ if (did_sigsys) {
+ atf_tc_skip("SYSV Message Queue not supported");
+ return;
+ }
+
+ ATF_REQUIRE_MSG(msgctl(sender_msqid, IPC_STAT, &m_ds) != -1,
+ "msgctl IPC_STAT 1: %d", errno);
+
+ print_msqid_ds(&m_ds, 0640);
+
+ m_ds.msg_perm.mode = (m_ds.msg_perm.mode & ~0777) | 0600;
+
+ ATF_REQUIRE_MSG(msgctl(sender_msqid, IPC_SET, &m_ds) != -1,
+ "msgctl IPC_SET: %d", errno);
+
+ memset(&m_ds, 0, sizeof(m_ds));
+
+ ATF_REQUIRE_MSG(msgctl(sender_msqid, IPC_STAT, &m_ds) != -1,
+ "msgctl IPC_STAT 2: %d", errno);
+
+ ATF_REQUIRE_MSG((m_ds.msg_perm.mode & 0777) == 0600,
+ "IPC_SET of mode didn't hold");
+
+ print_msqid_ds(&m_ds, 0600);
+
+ switch ((child_pid = fork())) {
+ case -1:
+ atf_tc_fail("fork: %d", errno);
+ return;
+
+ case 0:
+ child_count++;
+ receiver();
+ break;
+
+ default:
+ break;
+ }
+
+ for (loop = 0; loop < maxloop; loop++) {
+ /*
+ * Send the first message to the receiver and wait for the ACK.
+ */
+ m.mtype = MTYPE_1;
+ strcpy(m.mtext, m1_str);
+ ATF_REQUIRE_MSG(msgsnd(sender_msqid, &m, MESSAGE_TEXT_LEN,
+ 0) != -1, "sender: msgsnd 1: %d", errno);
+
+ ATF_REQUIRE_MSG(msgrcv(sender_msqid, &m, MESSAGE_TEXT_LEN,
+ MTYPE_1_ACK, 0) == MESSAGE_TEXT_LEN,
+ "sender: msgrcv 1 ack: %d", errno);
+
+ print_msqid_ds(&m_ds, 0600);
+
+ /*
+ * Send the second message to the receiver and wait for the ACK.
+ */
+ m.mtype = MTYPE_2;
+ strcpy(m.mtext, m2_str);
+ ATF_REQUIRE_MSG(msgsnd(sender_msqid, &m, MESSAGE_TEXT_LEN, 0) != -1,
+ "sender: msgsnd 2: %d", errno);
+
+ ATF_REQUIRE_MSG(msgrcv(sender_msqid, &m, MESSAGE_TEXT_LEN,
+ MTYPE_2_ACK, 0) == MESSAGE_TEXT_LEN,
+ "sender: msgrcv 2 ack: %d", errno);
+ }
+
+ /*
+ * Wait for child to finish
+ */
+ sigemptyset(&sigmask);
+ (void) sigsuspend(&sigmask);
+
+ /*
+ * ...and any other signal is an unexpected error.
+ */
+ if (did_sigchild) {
+ c_status = child_status;
+ if (c_status < 0)
+ atf_tc_fail("waitpid: %d", -c_status);
+ else if (WIFEXITED(c_status) == 0)
+ atf_tc_fail("child abnormal exit: %d", c_status);
+ else if (WEXITSTATUS(c_status) != 0)
+ atf_tc_fail("c status: %d", WEXITSTATUS(c_status));
+ else {
+ ATF_REQUIRE_MSG(msgctl(sender_msqid, IPC_STAT, &m_ds)
+ != -1, "msgctl IPC_STAT: %d", errno);
+
+ print_msqid_ds(&m_ds, 0600);
+ atf_tc_pass();
+ }
+ } else
+ atf_tc_fail("sender: received unexpected signal");
+}
+
+ATF_TC_CLEANUP(msg, tc)
+{
+ int sender_msqid;
+
+ /*
+ * Remove the message queue if it exists.
+ */
+ sender_msqid = read_int("sender_msqid");
+ if (sender_msqid != -1)
+ if (msgctl(sender_msqid, IPC_RMID, NULL) == -1)
+ err(1, "msgctl IPC_RMID");
+}
+
+void
+print_msqid_ds(mp, mode)
+ struct msqid_ds *mp;
+ mode_t mode;
+{
+ uid_t uid = geteuid();
+ gid_t gid = getegid();
+
+ printf("PERM: uid %d, gid %d, cuid %d, cgid %d, mode 0%o\n",
+ mp->msg_perm.uid, mp->msg_perm.gid,
+ mp->msg_perm.cuid, mp->msg_perm.cgid,
+ mp->msg_perm.mode & 0777);
+
+ printf("qnum %lu, qbytes %lu, lspid %d, lrpid %d\n",
+ mp->msg_qnum, (u_long)mp->msg_qbytes, mp->msg_lspid,
+ mp->msg_lrpid);
+
+ printf("stime: %s", ctime(&mp->msg_stime));
+ printf("rtime: %s", ctime(&mp->msg_rtime));
+ printf("ctime: %s", ctime(&mp->msg_ctime));
+
+ /*
+ * Sanity check a few things.
+ */
+
+ ATF_REQUIRE_MSG(mp->msg_perm.uid == uid && mp->msg_perm.cuid == uid,
+ "uid mismatch");
+
+ ATF_REQUIRE_MSG(mp->msg_perm.gid == gid && mp->msg_perm.cgid == gid,
+ "gid mismatch");
+
+ ATF_REQUIRE_MSG((mp->msg_perm.mode & 0777) == mode, "mode mismatch");
+}
+
+void
+receiver()
+{
+ struct mymsg m;
+ int msqid, loop;
+
+ if ((msqid = msgget(msgkey, 0)) == -1)
+ err(1, "receiver: msgget");
+
+ for (loop = 0; loop < maxloop; loop++) {
+ /*
+ * Receive the first message, print it, and send an ACK.
+ */
+ if (msgrcv(msqid, &m, MESSAGE_TEXT_LEN, MTYPE_1, 0) != MESSAGE_TEXT_LEN)
+ err(1, "receiver: msgrcv 1");
+
+ printf("%s\n", m.mtext);
+ if (strcmp(m.mtext, m1_str) != 0)
+ err(1, "receiver: message 1 data isn't correct");
+
+ m.mtype = MTYPE_1_ACK;
+
+ if (msgsnd(msqid, &m, MESSAGE_TEXT_LEN, 0) == -1)
+ err(1, "receiver: msgsnd ack 1");
+
+ /*
+ * Receive the second message, print it, and send an ACK.
+ */
+
+ if (msgrcv(msqid, &m, MESSAGE_TEXT_LEN, MTYPE_2, 0) != MESSAGE_TEXT_LEN)
+ err(1, "receiver: msgrcv 2");
+
+ printf("%s\n", m.mtext);
+ if (strcmp(m.mtext, m2_str) != 0)
+ err(1, "receiver: message 2 data isn't correct");
+
+ m.mtype = MTYPE_2_ACK;
+
+ if (msgsnd(msqid, &m, MESSAGE_TEXT_LEN, 0) == -1)
+ err(1, "receiver: msgsnd ack 2");
+ }
+
+ exit(0);
+}
+
+/*
+ * Test the SVID-compatible Semaphore facility.
+ */
+
+ATF_TC_WITH_CLEANUP(sem);
+ATF_TC_HEAD(sem, tc)
+{
+
+ atf_tc_set_md_var(tc, "timeout", "3");
+ atf_tc_set_md_var(tc, "descr", "Checks sysvmsg passing");
+}
+
+ATF_TC_BODY(sem, tc)
+{
+ struct sigaction sa;
+ union semun sun;
+ struct semid_ds s_ds;
+ sigset_t sigmask;
+ int sender_semid;
+ int i;
+ int c_status;
+
+ /*
+ * Install a SIGSYS handler so that we can exit gracefully if
+ * System V Semaphore support isn't in the kernel.
+ */
+ did_sigsys = 0;
+ sa.sa_handler = sigsys_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ ATF_REQUIRE_MSG(sigaction(SIGSYS, &sa, NULL) != -1,
+ "sigaction SIGSYS: %d", errno);
+
+ /*
+ * Install a SIGCHLD handler to deal with all possible exit
+ * conditions of the receiver.
+ */
+ did_sigchild = 0;
+ child_count = 0;
+ sa.sa_handler = sigchld_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ ATF_REQUIRE_MSG(sigaction(SIGCHLD, &sa, NULL) != -1,
+ "sigaction SIGCHLD: %d", errno);
+
+ semkey = get_ftok(4160);
+ ATF_REQUIRE_MSG(semkey != (key_t)-1, "get_ftok failed");
+
+ sender_semid = semget(semkey, 1, IPC_CREAT | 0640);
+ ATF_REQUIRE_MSG(sender_semid != -1, "semget: %d", errno);
+ write_int("sender_semid", sender_semid);
+
+ if (did_sigsys) {
+ atf_tc_skip("SYSV Semaphore not supported");
+ return;
+ }
+
+ sun.buf = &s_ds;
+ ATF_REQUIRE_MSG(semctl(sender_semid, 0, IPC_STAT, sun) != -1,
+ "semctl IPC_STAT: %d", errno);
+
+ print_semid_ds(&s_ds, 0640);
+
+ s_ds.sem_perm.mode = (s_ds.sem_perm.mode & ~0777) | 0600;
+
+ sun.buf = &s_ds;
+ ATF_REQUIRE_MSG(semctl(sender_semid, 0, IPC_SET, sun) != -1,
+ "semctl IPC_SET: %d", errno);
+
+ memset(&s_ds, 0, sizeof(s_ds));
+
+ sun.buf = &s_ds;
+ ATF_REQUIRE_MSG(semctl(sender_semid, 0, IPC_STAT, sun) != -1,
+ "semctl IPC_STAT: %d", errno);
+
+ ATF_REQUIRE_MSG((s_ds.sem_perm.mode & 0777) == 0600,
+ "IPC_SET of mode didn't hold");
+
+ print_semid_ds(&s_ds, 0600);
+
+ for (child_count = 0; child_count < 5; child_count++) {
+ switch ((child_pid = fork())) {
+ case -1:
+ atf_tc_fail("fork: %d", errno);
+ return;
+
+ case 0:
+ waiter();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ /*
+ * Wait for all of the waiters to be attempting to acquire the
+ * semaphore.
+ */
+ for (;;) {
+ i = semctl(sender_semid, 0, GETNCNT);
+ if (i == -1)
+ atf_tc_fail("semctl GETNCNT: %d", i);
+ if (i == 5)
+ break;
+ }
+
+ /*
+ * Now set the thundering herd in motion by initializing the
+ * semaphore to the value 1.
+ */
+ sun.val = 1;
+ ATF_REQUIRE_MSG(semctl(sender_semid, 0, SETVAL, sun) != -1,
+ "sender: semctl SETVAL to 1: %d", errno);
+
+ /*
+ * Wait for all children to finish
+ */
+ sigemptyset(&sigmask);
+ for (;;) {
+ (void) sigsuspend(&sigmask);
+ if (did_sigchild) {
+ c_status = child_status;
+ if (c_status < 0)
+ atf_tc_fail("waitpid: %d", -c_status);
+ else if (WIFEXITED(c_status) == 0)
+ atf_tc_fail("c abnormal exit: %d", c_status);
+ else if (WEXITSTATUS(c_status) != 0)
+ atf_tc_fail("c status: %d",
+ WEXITSTATUS(c_status));
+ else {
+ sun.buf = &s_ds;
+ ATF_REQUIRE_MSG(semctl(sender_semid, 0,
+ IPC_STAT, sun) != -1,
+ "semctl IPC_STAT: %d", errno);
+
+ print_semid_ds(&s_ds, 0600);
+ atf_tc_pass();
+ }
+ if (child_count <= 0)
+ break;
+ did_sigchild = 0;
+ } else {
+ atf_tc_fail("sender: received unexpected signal");
+ break;
+ }
+ }
+}
+
+ATF_TC_CLEANUP(sem, tc)
+{
+ int sender_semid;
+
+ /*
+ * Remove the semaphore if it exists
+ */
+ sender_semid = read_int("sender_semid");
+ if (sender_semid != -1)
+ if (semctl(sender_semid, 0, IPC_RMID) == -1)
+ err(1, "semctl IPC_RMID");
+}
+
+void
+print_semid_ds(sp, mode)
+ struct semid_ds *sp;
+ mode_t mode;
+{
+ uid_t uid = geteuid();
+ gid_t gid = getegid();
+
+ printf("PERM: uid %d, gid %d, cuid %d, cgid %d, mode 0%o\n",
+ sp->sem_perm.uid, sp->sem_perm.gid,
+ sp->sem_perm.cuid, sp->sem_perm.cgid,
+ sp->sem_perm.mode & 0777);
+
+ printf("nsems %u\n", sp->sem_nsems);
+
+ printf("otime: %s", ctime(&sp->sem_otime));
+ printf("ctime: %s", ctime(&sp->sem_ctime));
+
+ /*
+ * Sanity check a few things.
+ */
+
+ ATF_REQUIRE_MSG(sp->sem_perm.uid == uid && sp->sem_perm.cuid == uid,
+ "uid mismatch");
+
+ ATF_REQUIRE_MSG(sp->sem_perm.gid == gid && sp->sem_perm.cgid == gid,
+ "gid mismatch");
+
+ ATF_REQUIRE_MSG((sp->sem_perm.mode & 0777) == mode,
+ "mode mismatch %o != %o", (sp->sem_perm.mode & 0777), mode);
+}
+
+void
+waiter()
+{
+ struct sembuf s;
+ int semid;
+
+ if ((semid = semget(semkey, 1, 0)) == -1)
+ err(1, "waiter: semget");
+
+ /*
+ * Attempt to acquire the semaphore.
+ */
+ s.sem_num = 0;
+ s.sem_op = -1;
+ s.sem_flg = SEM_UNDO;
+
+ if (semop(semid, &s, 1) == -1)
+ err(1, "waiter: semop -1");
+
+ printf("WOO! GOT THE SEMAPHORE!\n");
+ sleep(1);
+
+ /*
+ * Release the semaphore and exit.
+ */
+ s.sem_num = 0;
+ s.sem_op = 1;
+ s.sem_flg = SEM_UNDO;
+
+ if (semop(semid, &s, 1) == -1)
+ err(1, "waiter: semop +1");
+
+ exit(0);
+}
+
+/*
+ * Test the SVID-compatible Shared Memory facility.
+ */
+
+ATF_TC_WITH_CLEANUP(shm);
+ATF_TC_HEAD(shm, tc)
+{
+
+ atf_tc_set_md_var(tc, "timeout", "3");
+ atf_tc_set_md_var(tc, "descr", "Checks sysv shared memory");
+}
+
+ATF_TC_BODY(shm, tc)
+{
+ struct sigaction sa;
+ struct shmid_ds s_ds;
+ sigset_t sigmask;
+ char *shm_buf;
+ int sender_shmid;
+ int c_status;
+
+ /*
+ * Install a SIGSYS handler so that we can exit gracefully if
+ * System V Shared Memory support isn't in the kernel.
+ */
+ did_sigsys = 0;
+ sa.sa_handler = sigsys_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ ATF_REQUIRE_MSG(sigaction(SIGSYS, &sa, NULL) != -1,
+ "sigaction SIGSYS: %d", errno);
+
+ /*
+ * Install a SIGCHLD handler to deal with all possible exit
+ * conditions of the sharer.
+ */
+ did_sigchild = 0;
+ child_count = 0;
+ sa.sa_handler = sigchld_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ ATF_REQUIRE_MSG(sigaction(SIGCHLD, &sa, NULL) != -1,
+ "sigaction SIGCHLD: %d", errno);
+
+ pgsize = sysconf(_SC_PAGESIZE);
+
+ shmkey = get_ftok(4160);
+ ATF_REQUIRE_MSG(shmkey != (key_t)-1, "get_ftok failed");
+
+ ATF_REQUIRE_MSG((sender_shmid = shmget(shmkey, pgsize,
+ IPC_CREAT | 0640)) != -1,
+ "shmget: %d", errno);
+ write_int("sender_shmid", sender_shmid);
+
+ ATF_REQUIRE_MSG(shmctl(sender_shmid, IPC_STAT, &s_ds) != -1,
+ "shmctl IPC_STAT: %d", errno);
+
+ print_shmid_ds(&s_ds, 0640);
+
+ s_ds.shm_perm.mode = (s_ds.shm_perm.mode & ~0777) | 0600;
+
+ ATF_REQUIRE_MSG(shmctl(sender_shmid, IPC_SET, &s_ds) != -1,
+ "shmctl IPC_SET: %d", errno);
+
+ memset(&s_ds, 0, sizeof(s_ds));
+
+ ATF_REQUIRE_MSG(shmctl(sender_shmid, IPC_STAT, &s_ds) != -1,
+ "shmctl IPC_STAT: %d", errno);
+
+ ATF_REQUIRE_MSG((s_ds.shm_perm.mode & 0777) == 0600,
+ "IPC_SET of mode didn't hold");
+
+ print_shmid_ds(&s_ds, 0600);
+
+ shm_buf = shmat(sender_shmid, NULL, 0);
+ ATF_REQUIRE_MSG(shm_buf != (void *) -1, "sender: shmat: %d", errno);
+
+ /*
+ * Write the test pattern into the shared memory buffer.
+ */
+ strcpy(shm_buf, m2_str);
+
+ switch ((child_pid = fork())) {
+ case -1:
+ atf_tc_fail("fork: %d", errno);
+ return;
+
+ case 0:
+ sharer();
+ break;
+
+ default:
+ break;
+ }
+
+ /*
+ * Wait for child to finish
+ */
+ sigemptyset(&sigmask);
+ (void) sigsuspend(&sigmask);
+
+ if (did_sigchild) {
+ c_status = child_status;
+ if (c_status < 0)
+ atf_tc_fail("waitpid: %d", -c_status);
+ else if (WIFEXITED(c_status) == 0)
+ atf_tc_fail("c abnormal exit: %d", c_status);
+ else if (WEXITSTATUS(c_status) != 0)
+ atf_tc_fail("c status: %d", WEXITSTATUS(c_status));
+ else {
+ ATF_REQUIRE_MSG(shmctl(sender_shmid, IPC_STAT,
+ &s_ds) != -1,
+ "shmctl IPC_STAT: %d", errno);
+
+ print_shmid_ds(&s_ds, 0600);
+ atf_tc_pass();
+ }
+ } else
+ atf_tc_fail("sender: received unexpected signal");
+}
+
+ATF_TC_CLEANUP(shm, tc)
+{
+ int sender_shmid;
+
+ /*
+ * Remove the shared memory area if it exists.
+ */
+ sender_shmid = read_int("sender_shmid");
+ if (sender_shmid != -1)
+ if (shmctl(sender_shmid, IPC_RMID, NULL) == -1)
+ err(1, "shmctl IPC_RMID");
+}
+
+void
+print_shmid_ds(sp, mode)
+ struct shmid_ds *sp;
+ mode_t mode;
+{
+ uid_t uid = geteuid();
+ gid_t gid = getegid();
+
+ printf("PERM: uid %d, gid %d, cuid %d, cgid %d, mode 0%o\n",
+ sp->shm_perm.uid, sp->shm_perm.gid,
+ sp->shm_perm.cuid, sp->shm_perm.cgid,
+ sp->shm_perm.mode & 0777);
+
+ printf("segsz %lu, lpid %d, cpid %d, nattch %u\n",
+ (u_long)sp->shm_segsz, sp->shm_lpid, sp->shm_cpid,
+ sp->shm_nattch);
+
+ printf("atime: %s", ctime(&sp->shm_atime));
+ printf("dtime: %s", ctime(&sp->shm_dtime));
+ printf("ctime: %s", ctime(&sp->shm_ctime));
+
+ /*
+ * Sanity check a few things.
+ */
+
+ ATF_REQUIRE_MSG(sp->shm_perm.uid == uid && sp->shm_perm.cuid == uid,
+ "uid mismatch");
+
+ ATF_REQUIRE_MSG(sp->shm_perm.gid == gid && sp->shm_perm.cgid == gid,
+ "gid mismatch");
+
+ ATF_REQUIRE_MSG((sp->shm_perm.mode & 0777) == mode, "mode mismatch");
+}
+
+void
+sharer()
+{
+ int shmid;
+ void *shm_buf;
+
+ shmid = shmget(shmkey, pgsize, 0);
+ ATF_REQUIRE_MSG(shmid != -1, "receiver: shmget:%d", errno);
+
+ shm_buf = shmat(shmid, NULL, 0);
+ ATF_REQUIRE_MSG(shm_buf != (void *) -1, "receiver: shmat: %d", errno);
+
+ printf("%s\n", (const char *)shm_buf);
+
+ ATF_REQUIRE_MSG(strcmp((const char *)shm_buf, m2_str) == 0,
+ "receiver: data isn't correct");
+
+ exit(0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, msg);
+ ATF_TP_ADD_TC(tp, sem);
+ ATF_TP_ADD_TC(tp, shm);
+
+ return atf_no_error();
+}
+
diff --git a/contrib/netbsd-tests/kernel/t_umount.sh b/contrib/netbsd-tests/kernel/t_umount.sh
new file mode 100755
index 0000000..b62ba10
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_umount.sh
@@ -0,0 +1,95 @@
+# $NetBSD: t_umount.sh,v 1.5 2010/11/07 17:51:19 jmmv Exp $
+#
+# Copyright (c) 2008, 2009 The NetBSD Foundation, 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 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.
+#
+
+TMPMP=umount-f_mount
+TMPIM=umount-f.im
+
+VND=vnd0
+BVND=/dev/${VND}
+CVND=/dev/r${VND}
+MPART=a
+
+atf_test_case umount cleanup
+umount_head()
+{
+ atf_set "descr" "Checks forced unmounting"
+ atf_set "require.user" "root"
+}
+umount_body()
+{
+ cat >disktab <<EOF
+floppy288|2.88MB 3.5in Extra High Density Floppy:\
+ :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\
+ :pa#5760:oa#0:ba#4096:fa#512:ta=4.2BSD:\
+ :pb#5760:ob#0:\
+ :pc#5760:oc#0:
+EOF
+
+ echo "*** Creating a dummy directory tree at" \
+ "${TMPMP} mounted on ${TMPIM}"
+
+ atf_check -o ignore -e ignore mkdir ${TMPMP}
+ atf_check -o ignore -e ignore touch ${TMPMP}/under_the_mount
+ atf_check -o ignore -e ignore dd if=/dev/zero of=${TMPIM} count=5860
+ atf_check -o ignore -e ignore vnconfig -v ${VND} ${TMPIM}
+ atf_check -o ignore -e ignore disklabel -f disktab -rw ${VND} floppy288
+ atf_check -o ignore -e ignore newfs -i 500 -b 8192 -f 1024 ${CVND}${MPART}
+ atf_check -o ignore -e ignore mount -o async ${BVND}${MPART} ${TMPMP}
+ atf_check -o ignore -e ignore touch ${TMPMP}/in_mounted_directory
+
+ echo "*** Testing forced unmount"
+ test -e "${TMPMP}/in_mounted_directory" || \
+ atf_fail "Test file not present in mounted directory!"
+
+ mydir="`pwd`"
+ cd "${TMPMP}"
+ atf_check -o ignore -e ignore umount -f "${BVND}${MPART}"
+
+ atf_check -s ne:0 -e inline:"ls: .: No such file or directory\n" ls .
+ atf_check -s ne:0 -e inline:"ls: ..: No such file or directory\n" ls ..
+
+ atf_check -s ne:0 -e ignore -o inline:"cd: can't cd to .\n" \
+ -x "cd . 2>&1"
+ atf_check -s ne:0 -e ignore -o inline:"cd: can't cd to ..\n" \
+ -x "cd .. 2>&1"
+
+ cd "${mydir}"
+
+ test -e "${TMPMP}/under_the_mount" || \
+ atf_fail "Original mount point dissapeared!"
+}
+umount_cleanup()
+{
+ echo "*** Cleaning up ${TMPMP}, ${TMPIM}."
+ umount -f "${TMPMP}"
+ vnconfig -u "${VND}"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case umount
+}
diff --git a/contrib/netbsd-tests/kernel/t_umountstress.sh b/contrib/netbsd-tests/kernel/t_umountstress.sh
new file mode 100755
index 0000000..fd50a1d
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/t_umountstress.sh
@@ -0,0 +1,209 @@
+# $NetBSD: t_umountstress.sh,v 1.5 2013/05/31 14:40:48 gson Exp $
+#
+# Copyright (c) 2013 The NetBSD Foundation, 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 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.
+#
+
+TMPMP=umount-stress_mount
+TMPIM=umount-stress.im
+
+VND=vnd0
+BVND=/dev/${VND}
+CVND=/dev/r${VND}
+MPART=a
+
+atf_test_case fileop cleanup
+fileop_head()
+{
+ atf_set "descr" "Checks unmounting a filesystem doing file operations"
+ atf_set "require.user" "root"
+}
+fileop_body()
+{
+ cat >disktab <<EOF
+floppy288|2.88MB 3.5in Extra High Density Floppy:\
+ :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\
+ :pa#5760:oa#0:ba#4096:fa#512:ta=4.2BSD:\
+ :pb#5760:ob#0:\
+ :pc#5760:oc#0:
+EOF
+
+ echo "*** Creating a dummy directory tree at" \
+ "${TMPMP} mounted on ${TMPIM}"
+
+ atf_check -o ignore -e ignore mkdir ${TMPMP}
+ atf_check -o ignore -e ignore dd if=/dev/zero of=${TMPIM} count=5860
+ atf_check -o ignore -e ignore vnconfig -v ${VND} ${TMPIM}
+ atf_check -o ignore -e ignore disklabel -f disktab -rw ${VND} floppy288
+ atf_check -o ignore -e ignore newfs -i 500 -b 8192 -f 1024 ${CVND}${MPART}
+ atf_check -o ignore -e ignore mount -o async ${BVND}${MPART} ${TMPMP}
+
+ echo "*** Testing fileops"
+
+ touch ${TMPMP}/hold
+ exec 9< ${TMPMP}/hold
+
+ (
+ for j in 0 1 2; do
+ for k in 0 1 2 3 4 5 6 7 8 9; do
+ if ! dd msgfmt=quiet if=/dev/zero \
+ count=1 of=${TMPMP}/test$i$j$k; then
+ echo 1 >result
+ exit
+ fi
+ done
+ done
+ echo 0 >result
+ ) &
+ busypid=$!
+
+ while ! test -f result; do
+ if err=$(umount ${TMPMP} 2>&1); then
+ kill $busypid
+ exec 9<&-
+ wait
+ atf_fail "Unmount succeeded while busy"
+ return
+ fi
+
+ case $err in
+ *:\ Device\ busy)
+ ;;
+ *)
+ kill $busypid
+ exec 9<&-
+ wait
+ atf_fail "Unmount failed: $err"
+ return
+ ;;
+ esac
+ done
+
+ exec 9<&-
+ wait
+
+ rc=`cat result`
+ rm -f result
+
+ case $rc in
+ 0) ;;
+ *) atf_fail "File operation failed"
+ esac
+}
+fileop_cleanup()
+{
+ echo "*** Cleaning up ${TMPMP}, ${TMPIM}."
+ umount -f "${TMPMP}"
+ vnconfig -u "${VND}"
+}
+
+atf_test_case mountlist cleanup
+mountlist_head()
+{
+ atf_set "descr" "Checks unmounting a filesystem using mountlist"
+ atf_set "require.user" "root"
+}
+mountlist_body()
+{
+ cat >disktab <<EOF
+floppy288|2.88MB 3.5in Extra High Density Floppy:\
+ :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\
+ :pa#5760:oa#0:ba#4096:fa#512:ta=4.2BSD:\
+ :pb#5760:ob#0:\
+ :pc#5760:oc#0:
+EOF
+
+ echo "*** Creating a dummy directory tree at" \
+ "${TMPMP} mounted on ${TMPIM}"
+
+ atf_check -o ignore -e ignore mkdir ${TMPMP}
+ atf_check -o ignore -e ignore dd if=/dev/zero of=${TMPIM} count=5860
+ atf_check -o ignore -e ignore vnconfig -v ${VND} ${TMPIM}
+ atf_check -o ignore -e ignore disklabel -f disktab -rw ${VND} floppy288
+ atf_check -o ignore -e ignore newfs -i 500 -b 8192 -f 1024 ${CVND}${MPART}
+ atf_check -o ignore -e ignore mount -o async ${BVND}${MPART} ${TMPMP}
+
+ echo "*** Testing mountlist"
+
+ (
+ for j in 0 1 2 3 4 5 6 7 8 9; do
+ for k in 0 1 2 3 4 5 6 7 8 9; do
+ if ! out=$(mount); then
+ echo 1 >result
+ exit
+ fi
+ done
+ done
+ echo 0 >result
+ ) &
+ busypid=$!
+
+ while ! test -f result; do
+ if err=$(umount ${TMPMP} 2>&1); then
+ if ! mount -o async ${BVND}${MPART} ${TMPMP}; then
+ kill $busypid
+ exec 9<&-
+ wait
+ atf_fail "Remount failed"
+ return
+ fi
+ continue
+ fi
+
+ case $err in
+ *:\ Device\ busy)
+ ;;
+ *)
+ kill $busypid
+ exec 9<&-
+ wait
+ atf_fail "Unmount failed: $err"
+ return
+ ;;
+ esac
+ done
+
+ exec 9<&-
+ wait
+
+ rc=`cat result`
+ rm -f result
+
+ case $rc in
+ 0) ;;
+ *) atf_fail "Mountlist operation failed"
+ esac
+}
+mountlist_cleanup()
+{
+ echo "*** Cleaning up ${TMPMP}, ${TMPIM}."
+ umount -f "${TMPMP}"
+ vnconfig -u "${VND}"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case fileop
+ atf_add_test_case mountlist
+}
diff --git a/contrib/netbsd-tests/kernel/tty/t_pr.c b/contrib/netbsd-tests/kernel/tty/t_pr.c
new file mode 100644
index 0000000..c590ea5
--- /dev/null
+++ b/contrib/netbsd-tests/kernel/tty/t_pr.c
@@ -0,0 +1,186 @@
+/* $NetBSD: t_pr.c,v 1.7 2011/04/26 20:42:01 martin Exp $ */
+
+/*-
+ * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Antti Kantee <pooka@NetBSD.org> and Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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/types.h>
+#include <sys/ioctl.h>
+#include <sys/tty.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+static int
+sendsome(int from, int to)
+{
+ size_t i;
+ ssize_t cnt;
+ static const char msg[] = "hello world\n";
+ char buf[sizeof(msg)+10];
+
+ memset(buf, 0, sizeof(buf));
+ rump_sys_write(from, msg, strlen(msg));
+ cnt = rump_sys_read(to, buf, sizeof(buf));
+ if (cnt < (ssize_t)strlen(msg)) {
+ printf("short message read: %zd chars: \"%s\"\n", cnt, buf);
+ return 1;
+ }
+ for (i = 0; i < sizeof(buf); i++) {
+ if (buf[i] == '\r' || buf[i] == '\n') {
+ buf[i] = '\n';
+ buf[i+1] = '\0';
+ break;
+ }
+ }
+
+ return strcmp(buf, msg) != 0;
+}
+
+static int
+exercise_ptytty(int master, int slave)
+{
+ int error, flags;
+
+ /*
+ * send a few bytes from master to slave and read them back
+ */
+ error = sendsome(master, slave);
+ if (error)
+ return error;
+
+ flags = FREAD|FWRITE;
+ rump_sys_ioctl(master, TIOCFLUSH, &flags);
+
+ /*
+ * and the same in the other direction
+ */
+ error = sendsome(slave, master);
+ if (error)
+ return error;
+
+ flags = FREAD|FWRITE;
+ rump_sys_ioctl(master, TIOCFLUSH, &flags);
+ return 0;
+}
+
+ATF_TC(client_first);
+ATF_TC_HEAD(client_first, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "test basic tty/pty operation when opening client side first");
+}
+
+ATF_TC_BODY(client_first, tc)
+{
+ int master, slave, error, v;
+
+ rump_init();
+ slave = rump_sys_open("/dev/ttyp1", O_RDWR|O_NONBLOCK);
+ ATF_CHECK(slave != -1);
+
+ master = rump_sys_open("/dev/ptyp1", O_RDWR);
+ ATF_CHECK(master != -1);
+
+ v = 0;
+ rump_sys_ioctl(slave, FIOASYNC, &v);
+ error = exercise_ptytty(master, slave);
+ ATF_CHECK(error == 0);
+
+ rump_sys_close(master);
+ rump_sys_close(slave);
+}
+
+ATF_TC(master_first);
+ATF_TC_HEAD(master_first, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "test basic tty/pty operation when opening master side first");
+}
+
+ATF_TC_BODY(master_first, tc)
+{
+ int master, slave, error;
+
+ rump_init();
+ master = rump_sys_open("/dev/ptyp1", O_RDWR);
+ ATF_CHECK(master != -1);
+
+ slave = rump_sys_open("/dev/ttyp1", O_RDWR);
+ ATF_CHECK(slave != -1);
+
+ error = exercise_ptytty(master, slave);
+ ATF_CHECK(error == 0);
+
+ rump_sys_close(master);
+ rump_sys_close(slave);
+}
+
+ATF_TC(ptyioctl);
+ATF_TC_HEAD(ptyioctl, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "ioctl on pty with client side not open");
+}
+
+ATF_TC_BODY(ptyioctl, tc)
+{
+ struct termios tio;
+ int fd;
+
+ rump_init();
+ fd = rump_sys_open("/dev/ptyp1", O_RDWR);
+ ATF_CHECK(fd != -1);
+
+ /*
+ * This used to die with null deref under ptcwakeup()
+ * atf_tc_expect_signal(-1, "PR kern/40688");
+ */
+ rump_sys_ioctl(fd, TIOCGETA, &tio);
+
+ rump_sys_close(fd);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, ptyioctl);
+ ATF_TP_ADD_TC(tp, client_first);
+ ATF_TP_ADD_TC(tp, master_first);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/csu/arch/alpha/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/alpha/h_initfini_align.S
new file mode 100644
index 0000000..b4382c1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/alpha/h_initfini_align.S
@@ -0,0 +1,16 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:55 matt Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:55 matt Exp $")
+
+/*
+ * LINTSTUB: bool check_stack_alignment(void);
+ */
+
+LEAF_NOPROFILE(check_stack_alignment, 0)
+ ldiq v0, 0
+ and sp, 7, t0
+ cmoveq t0, 1, v0
+ ret
+END(check_stack_alignment)
diff --git a/contrib/netbsd-tests/lib/csu/arch/arm/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/arm/h_initfini_align.S
new file mode 100644
index 0000000..2abc56f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/arm/h_initfini_align.S
@@ -0,0 +1,20 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:56 matt Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:56 matt Exp $")
+
+/*
+ * LINTSTUB: bool check_stack_alignment(void);
+ */
+
+ARM_ENTRY(check_stack_alignment)
+#ifdef __ARM_EABI__
+ tst sp, #7
+#else
+ tst sp, #3
+#endif
+ movne r0, #0
+ moveq r0, #1
+ RET
+END(check_stack_alignment)
diff --git a/contrib/netbsd-tests/lib/csu/arch/hppa/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/hppa/h_initfini_align.S
new file mode 100644
index 0000000..c297e90
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/hppa/h_initfini_align.S
@@ -0,0 +1,12 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2013/11/15 11:48:30 skrll Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2013/11/15 11:48:30 skrll Exp $")
+
+LEAF_ENTRY(check_stack_alignment)
+ extru %sp,31,6,%ret0
+ comiclr,<> 0, %ret0, %ret0
+ ldi 1,%ret0
+ bv,n %r0(%r2)
+EXIT(check_stack_alignment)
diff --git a/contrib/netbsd-tests/lib/csu/arch/i386/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/i386/h_initfini_align.S
new file mode 100644
index 0000000..e212989
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/i386/h_initfini_align.S
@@ -0,0 +1,12 @@
+/* $NetBSD: h_initfini_align.S,v 1.2 2010/12/12 18:21:21 joerg Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.2 2010/12/12 18:21:21 joerg Exp $")
+
+_ENTRY(check_stack_alignment)
+ movl %esp, %eax
+ andl $3, %eax
+ setz %al
+ movzbl %al, %eax
+ ret
diff --git a/contrib/netbsd-tests/lib/csu/arch/ia64/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/ia64/h_initfini_align.S
new file mode 100644
index 0000000..f7612a8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/ia64/h_initfini_align.S
@@ -0,0 +1,37 @@
+/* $NetBSD: h_initfini_align.S,v 1.2 2014/03/16 09:27:04 cherry Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.2 2014/03/16 09:27:04 cherry Exp $")
+
+ENTRY(check_stack_alignment, 0)
+ .prologue
+ .regstk 0, 2, 0, 0
+
+ alloc loc0 = ar.pfs, 0, 2, 0, 0
+
+ .body
+ mov ret0 = 1
+ ;;
+
+ /* ar.bsp has an 8-byte alignment requirement */
+ mov loc1 = ar.bsp
+ ;;
+
+ and loc1 = 7, loc1
+ ;;
+
+ cmp.eq p1, p0 = 0, loc1
+ (p0) mov ret0 = 0
+ ;;
+
+ /* sp has a 16-byte alignment requirement */
+ (p1) mov loc1 = sp
+ ;;
+ (p1) and loc1 = 15, loc1
+ ;;
+
+ (p1) cmp.eq p1, p0 = 0, loc1
+ (p0) mov ret0 = 0
+
+ br.ret.sptk.few rp
diff --git a/contrib/netbsd-tests/lib/csu/arch/mips/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/mips/h_initfini_align.S
new file mode 100644
index 0000000..d6782ac
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/mips/h_initfini_align.S
@@ -0,0 +1,19 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:56 matt Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:56 matt Exp $")
+
+/*
+ * LINTSTUB: bool check_stack_alignment(void);
+ */
+
+LEAF_NOPROFILE(check_stack_alignment)
+#ifdef __mips_o32
+ andi v1,sp,3
+#else
+ andi v1,sp,7
+#endif
+ sltiu v0,v1,1
+ jr ra
+END(check_stack_alignment)
diff --git a/contrib/netbsd-tests/lib/csu/arch/powerpc/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/powerpc/h_initfini_align.S
new file mode 100644
index 0000000..7abd9ea
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/powerpc/h_initfini_align.S
@@ -0,0 +1,17 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:56 matt Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:56 matt Exp $")
+
+/*
+ * LINTSTUB: bool check_stack_alignment(void);
+ */
+
+_ENTRY(check_stack_alignment)
+ li %r3,0
+ andis. %r0,%r1,15
+ bnelr %cr0
+ li %r3,1
+ blr
+END(check_stack_alignment)
diff --git a/contrib/netbsd-tests/lib/csu/arch/sparc/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/sparc/h_initfini_align.S
new file mode 100644
index 0000000..a770d39
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/sparc/h_initfini_align.S
@@ -0,0 +1,10 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2013/12/12 11:22:26 martin Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2013/12/12 11:22:26 martin Exp $")
+
+_ENTRY(check_stack_alignment)
+ and %sp, 7, %o1
+ retl
+ not %o1, %o0
diff --git a/contrib/netbsd-tests/lib/csu/arch/sparc64/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/sparc64/h_initfini_align.S
new file mode 100644
index 0000000..402ceb3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/sparc64/h_initfini_align.S
@@ -0,0 +1,11 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2013/11/15 20:00:20 martin Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2013/11/15 20:00:20 martin Exp $")
+
+_ENTRY(check_stack_alignment)
+ add %sp, BIAS, %o1
+ and %o1, 15, %o2
+ retl
+ not %o2, %o0
diff --git a/contrib/netbsd-tests/lib/csu/arch/vax/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/vax/h_initfini_align.S
new file mode 100644
index 0000000..a751e1f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/vax/h_initfini_align.S
@@ -0,0 +1,17 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:56 matt Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2013/12/11 17:31:56 matt Exp $")
+
+/*
+ * LINTSTUB: bool check_stack_alignment(void);
+ */
+
+_ENTRY(check_stack_alignment, 0)
+ clrl %r0
+ bitl $3,%sp
+ bneq 1f
+ incl %r0
+1: ret
+END(check_stack_alignment)
diff --git a/contrib/netbsd-tests/lib/csu/arch/x86_64/h_initfini_align.S b/contrib/netbsd-tests/lib/csu/arch/x86_64/h_initfini_align.S
new file mode 100644
index 0000000..fbc1e56
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/arch/x86_64/h_initfini_align.S
@@ -0,0 +1,13 @@
+/* $NetBSD: h_initfini_align.S,v 1.2 2010/12/12 18:21:21 joerg Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.2 2010/12/12 18:21:21 joerg Exp $")
+
+_ENTRY(check_stack_alignment)
+ movl %esp, %eax
+ andl $15, %eax
+ subl $8, %eax
+ sete %al
+ movzbl %al, %eax
+ ret
diff --git a/contrib/netbsd-tests/lib/csu/dso/h_initfini3_dso.cxx b/contrib/netbsd-tests/lib/csu/dso/h_initfini3_dso.cxx
new file mode 100644
index 0000000..ff90ce6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/dso/h_initfini3_dso.cxx
@@ -0,0 +1,37 @@
+#include <unistd.h>
+
+#ifdef CHECK_STACK_ALIGNMENT
+#include <stdlib.h>
+
+extern "C" int check_stack_alignment(void);
+#endif
+
+class Test2 {
+public:
+ Test2()
+ {
+ static const char msg[] = "constructor2 executed\n";
+ write(STDOUT_FILENO, msg, sizeof(msg) - 1);
+#ifdef CHECK_STACK_ALIGNMENT
+ if (!check_stack_alignment()) {
+ static const char msg2[] = "stack unaligned \n";
+ write(STDOUT_FILENO, msg2, sizeof(msg2) - 1);
+ exit(1);
+ }
+#endif
+ }
+ ~Test2()
+ {
+ static const char msg[] = "destructor2 executed\n";
+ write(STDOUT_FILENO, msg, sizeof(msg) - 1);
+#ifdef CHECK_STACK_ALIGNMENT
+ if (!check_stack_alignment()) {
+ static const char msg2[] = "stack unaligned \n";
+ write(STDOUT_FILENO, msg2, sizeof(msg2) - 1);
+ exit(1);
+ }
+#endif
+ }
+};
+
+Test2 test2;
diff --git a/contrib/netbsd-tests/lib/csu/h_initfini1.cxx b/contrib/netbsd-tests/lib/csu/h_initfini1.cxx
new file mode 100644
index 0000000..d410f70
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/h_initfini1.cxx
@@ -0,0 +1,9 @@
+#include <unistd.h>
+
+int
+main(void)
+{
+ static const char msg[] = "main executed\n";
+ write(STDOUT_FILENO, msg, sizeof(msg) - 1);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/csu/h_initfini3.cxx b/contrib/netbsd-tests/lib/csu/h_initfini3.cxx
new file mode 100644
index 0000000..13f54ce
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/h_initfini3.cxx
@@ -0,0 +1,22 @@
+#include <dlfcn.h>
+#include <err.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+ static const char msg1[] = "main started\n";
+ static const char msg2[] = "main after dlopen\n";
+ static const char msg3[] = "main terminated\n";
+
+ void *handle;
+
+ write(STDOUT_FILENO, msg1, sizeof(msg1) - 1);
+ handle = dlopen("h_initfini3_dso.so", RTLD_NOW | RTLD_LOCAL);
+ if (handle == NULL)
+ err(1, "dlopen");
+ write(STDOUT_FILENO, msg2, sizeof(msg2) - 1);
+ dlclose(handle);
+ write(STDOUT_FILENO, msg3, sizeof(msg3) - 1);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/csu/h_initfini_common.cxx b/contrib/netbsd-tests/lib/csu/h_initfini_common.cxx
new file mode 100644
index 0000000..dd34983
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/h_initfini_common.cxx
@@ -0,0 +1,37 @@
+#include <unistd.h>
+
+#ifdef CHECK_STACK_ALIGNMENT
+#include <stdlib.h>
+
+extern "C" int check_stack_alignment(void);
+#endif
+
+class Test {
+public:
+ Test()
+ {
+ static const char msg[] = "constructor executed\n";
+ write(STDOUT_FILENO, msg, sizeof(msg) - 1);
+#ifdef CHECK_STACK_ALIGNMENT
+ if (!check_stack_alignment()) {
+ static const char msg2[] = "stack unaligned \n";
+ write(STDOUT_FILENO, msg2, sizeof(msg2) - 1);
+ exit(1);
+ }
+#endif
+ }
+ ~Test()
+ {
+ static const char msg[] = "destructor executed\n";
+ write(STDOUT_FILENO, msg, sizeof(msg) - 1);
+#ifdef CHECK_STACK_ALIGNMENT
+ if (!check_stack_alignment()) {
+ static const char msg2[] = "stack unaligned \n";
+ write(STDOUT_FILENO, msg2, sizeof(msg2) - 1);
+ exit(1);
+ }
+#endif
+ }
+};
+
+Test test;
diff --git a/contrib/netbsd-tests/lib/csu/t_crt0.sh b/contrib/netbsd-tests/lib/csu/t_crt0.sh
new file mode 100755
index 0000000..a36a9b7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/csu/t_crt0.sh
@@ -0,0 +1,104 @@
+# $NetBSD: t_crt0.sh,v 1.4 2011/12/11 14:57:07 joerg Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case initfini1
+initfini1_head()
+{
+ atf_set "descr" "Checks support for init/fini sections"
+}
+initfini1_body()
+{
+ cat >expout <<EOF
+constructor executed
+main executed
+destructor executed
+EOF
+
+ atf_check -o file:expout "$(atf_get_srcdir)/h_initfini1"
+}
+
+atf_test_case initfini2
+initfini2_head()
+{
+ atf_set "descr" "Checks support for init/fini sections in static binaries"
+}
+initfini2_body()
+{
+ cat >expout <<EOF
+constructor executed
+main executed
+destructor executed
+EOF
+
+ atf_check -o file:expout "$(atf_get_srcdir)/h_initfini2"
+}
+
+atf_test_case initfini3
+initfini3_head()
+{
+ atf_set "descr" "Checks support for init/fini sections in dlopen"
+}
+initfini3_body()
+{
+ cat >expout <<EOF
+constructor executed
+main started
+constructor2 executed
+main after dlopen
+destructor2 executed
+main terminated
+destructor executed
+EOF
+
+ atf_check -o file:expout "$(atf_get_srcdir)/h_initfini3"
+}
+
+atf_test_case initfini4
+initfini4_head()
+{
+ atf_set "descr" "Checks support for init/fini sections in LD_PRELOAD"
+}
+initfini4_body()
+{
+ cat >expout <<EOF
+constructor2 executed
+constructor executed
+main executed
+destructor executed
+destructor2 executed
+EOF
+
+ atf_check -o file:expout -x "env LD_PRELOAD=$(atf_get_srcdir)/h_initfini3_dso.so $(atf_get_srcdir)/h_initfini1"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case initfini1
+ atf_add_test_case initfini2
+ atf_add_test_case initfini3
+ atf_add_test_case initfini4
+}
diff --git a/contrib/netbsd-tests/lib/libbluetooth/t_bluetooth.c b/contrib/netbsd-tests/lib/libbluetooth/t_bluetooth.c
new file mode 100644
index 0000000..066f8d9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbluetooth/t_bluetooth.c
@@ -0,0 +1,87 @@
+/* $NetBSD: t_bluetooth.c,v 1.2 2011/04/07 08:29:50 plunky Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Iain Hibbert.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <bluetooth.h>
+#include <string.h>
+
+ATF_TC(check_bt_aton);
+
+ATF_TC_HEAD(check_bt_aton, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test bt_aton results");
+}
+
+ATF_TC_BODY(check_bt_aton, tc)
+{
+ bdaddr_t bdaddr;
+
+ ATF_CHECK_EQ(bt_aton("0a:0b:0c:0d:0e", &bdaddr), 0);
+ ATF_CHECK_EQ(bt_aton("0a:0b:0c:0d0:0e:0f", &bdaddr), 0);
+ ATF_CHECK_EQ(bt_aton("0a:0b:0c:0d:0e:0f:00", &bdaddr), 0);
+ ATF_CHECK_EQ(bt_aton("0a:0b:0c:0d:0e:0f\n", &bdaddr), 0);
+ ATF_CHECK_EQ(bt_aton(" 0a:0b:0c:0d:0e:0f", &bdaddr), 0);
+ ATF_CHECK_EQ(bt_aton("0a:0b:0x:0d:0e:0f", &bdaddr), 0);
+
+ ATF_REQUIRE(bt_aton("0a:0b:0c:0d:0e:0f", &bdaddr));
+ ATF_CHECK_EQ(bdaddr.b[0], 0x0f);
+ ATF_CHECK_EQ(bdaddr.b[1], 0x0e);
+ ATF_CHECK_EQ(bdaddr.b[2], 0x0d);
+ ATF_CHECK_EQ(bdaddr.b[3], 0x0c);
+ ATF_CHECK_EQ(bdaddr.b[4], 0x0b);
+ ATF_CHECK_EQ(bdaddr.b[5], 0x0a);
+}
+
+ATF_TC(check_bt_ntoa);
+
+ATF_TC_HEAD(check_bt_ntoa, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test bt_ntoa results");
+}
+
+ATF_TC_BODY(check_bt_ntoa, tc)
+{
+ bdaddr_t bdaddr = { { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 } };
+
+ ATF_CHECK_STREQ(bt_ntoa(&bdaddr, NULL), "55:44:33:22:11:00");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, check_bt_aton);
+ ATF_TP_ADD_TC(tp, check_bt_ntoa);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libbluetooth/t_sdp_data.c b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_data.c
new file mode 100644
index 0000000..cff6627
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_data.c
@@ -0,0 +1,136 @@
+/* $NetBSD: t_sdp_data.c,v 1.2 2011/04/07 08:29:50 plunky Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Iain Hibbert.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <sdp.h>
+
+ATF_TC(check_sdp_data_type);
+
+ATF_TC_HEAD(check_sdp_data_type, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_data_type results");
+}
+
+ATF_TC_BODY(check_sdp_data_type, tc)
+{
+ uint8_t data[] = {
+ 0x00, // nil
+ 0x08, 0x00, // uint8 0x00
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t value;
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_UINT8);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_data_size);
+
+ATF_TC_HEAD(check_sdp_data_size, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_data_size results");
+}
+
+ATF_TC_BODY(check_sdp_data_size, tc)
+{
+ uint8_t data[] = {
+ 0x00, // nil
+ 0x08, 0x00, // uint8
+ 0x11, 0x00, 0x00, // int16
+ 0x1a, 0x00, 0x00, 0x00, // uuid32
+ 0x00,
+ 0x28, 0x00, // bool
+ 0x25, 0x00, // str8(0)
+ 0x25, 0x02, 0x00, 0x00, // str8(2)
+ 0x36, 0x00, 0x00, // seq16(0)
+ 0x3e, 0x00, 0x05, 0x00, // alt16(5)
+ 0x00, 0x00, 0x00, 0x00,
+ 0x37, 0x00, 0x00, 0x00, // seq32(0)
+ 0x00,
+ 0x47, 0x00, 0x00, 0x00, // url32(7)
+ 0x07, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t value;
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 1);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 2);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 3);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 5);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 2);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 2);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 4);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 3);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 8);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 5);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_size(&value), 12);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, check_sdp_data_type);
+ ATF_TP_ADD_TC(tp, check_sdp_data_size);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libbluetooth/t_sdp_get.c b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_get.c
new file mode 100644
index 0000000..3ad8070
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_get.c
@@ -0,0 +1,643 @@
+/* $NetBSD: t_sdp_get.c,v 1.2 2011/04/07 08:29:50 plunky Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Iain Hibbert.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <limits.h>
+#include <sdp.h>
+#include <string.h>
+
+ATF_TC(check_sdp_get_data);
+
+ATF_TC_HEAD(check_sdp_get_data, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_data results");
+}
+
+ATF_TC_BODY(check_sdp_get_data, tc)
+{
+ uint8_t data[] = {
+ 0x09, 0x00, 0x00, // uint16 0x0000
+ 0x35, 0x05, // seq8(5)
+ 0x19, 0x00, 0x00, // uuid16 0x0000
+ 0x08, 0x00, // uint8 0x00
+ 0x36, 0x00, 0x01, // seq16(1)
+ 0x19, // uint16 /* invalid */
+ 0x25, 0x04, 0x54, 0x45, // str8(4) "TEST"
+ 0x53, 0x54,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t value, seq;
+
+ /*
+ * sdp_get_data constructs a new sdp_data_t containing
+ * the next data element, advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_UINT16);
+ ATF_CHECK_EQ(sdp_data_size(&value), 3);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_SEQ8);
+ ATF_CHECK_EQ(sdp_data_size(&value), 7);
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_SEQ16);
+ ATF_CHECK_EQ(sdp_data_size(&value), 4);
+ ATF_REQUIRE_EQ(sdp_get_seq(&value, &seq), true);
+ ATF_REQUIRE_EQ(sdp_get_data(&seq, &value), false); /* invalid */
+
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_STR8);
+ ATF_CHECK_EQ(sdp_data_size(&value), 6);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_attr);
+
+ATF_TC_HEAD(check_sdp_get_attr, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_attr results");
+}
+
+ATF_TC_BODY(check_sdp_get_attr, tc)
+{
+ uint8_t data[] = {
+ 0x09, 0x00, 0x00, // uint16 0x0000
+ 0x35, 0x05, // seq8(5)
+ 0x19, 0x00, 0x00, // uuid16 0x0000
+ 0x08, 0x00, // uint8 0x00
+ 0x08, 0x00, // uint8 0x00
+ 0x09, 0x00, 0x01, // uint16 0x0001
+ 0x19, 0x12, 0x34, // uuid16 0x1234
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t value;
+ uint16_t attr;
+
+ /*
+ * sdp_get_attr expects a UINT16 followed by any data item
+ * and advances test if successful
+ */
+ ATF_REQUIRE(sdp_get_attr(&test, &attr, &value));
+ ATF_CHECK_EQ(attr, 0x0000);
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_SEQ8);
+ ATF_CHECK_EQ(sdp_data_size(&value), 7);
+
+ ATF_REQUIRE_EQ(sdp_get_attr(&test, &attr, &value), false);
+ ATF_REQUIRE(sdp_get_data(&test, &value));
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_UINT8);
+ ATF_CHECK_EQ(sdp_data_size(&value), 2);
+
+ ATF_REQUIRE(sdp_get_attr(&test, &attr, &value));
+ ATF_CHECK_EQ(attr, 0x0001);
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_UUID16);
+ ATF_CHECK_EQ(sdp_data_size(&value), 3);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_uuid);
+
+ATF_TC_HEAD(check_sdp_get_uuid, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_uuid results");
+}
+
+ATF_TC_BODY(check_sdp_get_uuid, tc)
+{
+ uint8_t data[] = {
+ 0x19, 0x12, 0x34, // uuid16 0x1234
+ 0x1a, 0x11, 0x22, 0x33, // uuid32 0x11223344
+ 0x44,
+ 0x00, // nil
+ 0x1c, // uuid128 0x00112233-4444--5555-6666-778899aabbcc
+ 0x00, 0x11, 0x22, 0x33,
+ 0x44, 0x44, 0x55, 0x55,
+ 0x66, 0x66, 0x77, 0x88,
+ 0x99, 0xaa, 0xbb, 0xcc,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ uuid_t u16 = {
+ 0x00001234,
+ 0x0000,
+ 0x1000,
+ 0x80,
+ 0x00,
+ { 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb }
+ };
+ uuid_t u32 = {
+ 0x11223344,
+ 0x0000,
+ 0x1000,
+ 0x80,
+ 0x00,
+ { 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb }
+ };
+ uuid_t u128 = {
+ 0x00112233,
+ 0x4444,
+ 0x5555,
+ 0x66,
+ 0x66,
+ { 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc }
+ };
+ sdp_data_t nil;
+ uuid_t value;
+
+ /*
+ * sdp_get_uuid expects any UUID type returns the full uuid
+ * advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_uuid(&test, &value));
+ ATF_CHECK(uuid_equal(&value, &u16, NULL));
+
+ ATF_REQUIRE(sdp_get_uuid(&test, &value));
+ ATF_CHECK(uuid_equal(&value, &u32, NULL));
+
+ ATF_REQUIRE_EQ(sdp_get_uuid(&test, &value), false); /* not uuid */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_uuid(&test, &value));
+ ATF_CHECK(uuid_equal(&value, &u128, NULL));
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_bool);
+
+ATF_TC_HEAD(check_sdp_get_bool, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_bool results");
+}
+
+ATF_TC_BODY(check_sdp_get_bool, tc)
+{
+ uint8_t data[] = {
+ 0x28, 0x00, // bool false
+ 0x00, // nil
+ 0x28, 0x01, // bool true
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t nil;
+ bool value;
+
+ /*
+ * sdp_get_bool expects a BOOL type
+ * advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_bool(&test, &value));
+ ATF_CHECK_EQ(value, false);
+
+ ATF_REQUIRE_EQ(sdp_get_bool(&test, &value), false); /* not bool */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_bool(&test, &value));
+ ATF_CHECK_EQ(value, true);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_uint);
+
+ATF_TC_HEAD(check_sdp_get_uint, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_uint results");
+}
+
+ATF_TC_BODY(check_sdp_get_uint, tc)
+{
+ uint8_t data[] = {
+ 0x08, 0x00, // uint8 0x00
+ 0x08, 0xff, // uint8 0xff
+ 0x09, 0x01, 0x02, // uint16 0x0102
+ 0x09, 0xff, 0xff, // uint16 0xffff
+ 0x00, // nil
+ 0x0a, 0x01, 0x02, 0x03, // uint32 0x01020304
+ 0x04,
+ 0x0a, 0xff, 0xff, 0xff, // uint32 0xffffffff
+ 0xff,
+ 0x0b, 0x01, 0x02, 0x03, // uint64 0x0102030405060708
+ 0x04, 0x05, 0x06, 0x07,
+ 0x08,
+ 0x0b, 0xff, 0xff, 0xff, // uint64 0xffffffffffffffff
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ 0x0c, 0x00, 0x00, 0x00, // uint128 0x00000000000000000000000000000000
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x0c, 0x00, 0x00, 0x00, // uint128 0x00000000000000010000000000000000
+ 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x0c, 0x00, 0x00, 0x00, // uint128 0x0000000000000000ffffffffffffffff
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t nil;
+ uintmax_t value;
+
+ /*
+ * sdp_get_uint expects any UINT type, advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, 0x00);
+
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, UINT8_MAX);
+
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, 0x0102);
+
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, UINT16_MAX);
+
+ ATF_REQUIRE_EQ(sdp_get_uint(&test, &value), false); /* not uint */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, 0x01020304);
+
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, UINT32_MAX);
+
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, 0x0102030405060708);
+
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, UINT64_MAX);
+
+ /*
+ * expected failure is that we cannot decode UINT128 values larger than UINT64
+ */
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, 0x00000000000000000000000000000000);
+
+ ATF_REQUIRE_EQ(sdp_get_uint(&test, &value), false); /* overflow */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_UINT128);
+
+ ATF_REQUIRE(sdp_get_uint(&test, &value));
+ ATF_CHECK_EQ(value, UINT64_MAX);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_int);
+
+ATF_TC_HEAD(check_sdp_get_int, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_int results");
+}
+
+ATF_TC_BODY(check_sdp_get_int, tc)
+{
+ uint8_t data[] = {
+ 0x10, 0x00, // int8 0x00
+ 0x10, 0x7f, // int8 0x7f
+ 0x10, 0x80, // int8 0x80
+ 0x11, 0x01, 0x02, // int16 0x0102
+ 0x11, 0x7f, 0xff, // int16 0x7fff
+ 0x11, 0x80, 0x00, // int16 0x8000
+ 0x00, // nil
+ 0x12, 0x01, 0x02, 0x03, // int32 0x01020304
+ 0x04,
+ 0x12, 0x7f, 0xff, 0xff, // int32 0x7fffffff
+ 0xff,
+ 0x12, 0x80, 0x00, 0x00, // int32 0x80000000
+ 0x00,
+ 0x13, 0x01, 0x02, 0x03, // int64 0x0102030405060708
+ 0x04, 0x05, 0x06, 0x07,
+ 0x08,
+ 0x13, 0x7f, 0xff, 0xff, // int64 0x7fffffffffffffff
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ 0x13, 0x80, 0x00, 0x00, // int64 0x8000000000000000
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x14, 0x00, 0x00, 0x00, // int128 0x00000000000000000000000000000000
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x14, 0x00, 0x00, 0x00, // int128 0x00000000000000007fffffffffffffff
+ 0x00, 0x00, 0x00, 0x00, // (INT64_MAX)
+ 0x00, 0x7f, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ 0x14, 0x00, 0x00, 0x00, // int128 0x00000000000000008000000000000000
+ 0x00, 0x00, 0x00, 0x00, // (INT64_MAX + 1)
+ 0x00, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x14, 0xff, 0xff, 0xff, // int128 0xffffffffffffffff8000000000000000
+ 0xff, 0xff, 0xff, 0xff, // (INT64_MIN)
+ 0xff, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x14, 0xff, 0xff, 0xff, // int128 0xffffffffffffffff7fffffffffffffff
+ 0xff, 0xff, 0xff, 0xff, // (INT64_MIN - 1)
+ 0xff, 0x7f, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t nil;
+ intmax_t value;
+
+ /*
+ * sdp_get_int expects any INT type, advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, 0);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT8_MAX);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT8_MIN);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, 0x0102);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT16_MAX);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT16_MIN);
+
+ ATF_REQUIRE_EQ(sdp_get_int(&test, &value), false); /* not int */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, 0x01020304);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT32_MAX);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT32_MIN);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, 0x0102030405060708);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT64_MAX);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT64_MIN);
+
+ /*
+ * expected failure is that we cannot decode INT128 values larger than INT64
+ */
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, 0);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT64_MAX);
+
+ ATF_REQUIRE_EQ(sdp_get_int(&test, &value), false); /* overflow */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_INT128);
+
+ ATF_REQUIRE(sdp_get_int(&test, &value));
+ ATF_CHECK_EQ(value, INT64_MIN);
+
+ ATF_REQUIRE_EQ(sdp_get_int(&test, &value), false); /* underflow */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_INT128);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_seq);
+
+ATF_TC_HEAD(check_sdp_get_seq, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_seq results");
+}
+
+ATF_TC_BODY(check_sdp_get_seq, tc)
+{
+ uint8_t data[] = {
+ 0x35, 0x00, // seq8(0)
+ 0x00, // nil
+ 0x36, 0x00, 0x00, // seq16(0)
+ 0x37, 0x00, 0x00, 0x00, // seq32(0)
+ 0x00,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t value;
+
+ /*
+ * sdp_get_seq expects a SEQ type
+ * advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_seq(&test, &value));
+ ATF_CHECK_EQ(value.next, value.end);
+
+ ATF_REQUIRE_EQ(sdp_get_seq(&test, &value), false); /* not seq */
+ ATF_REQUIRE(sdp_get_data(&test, &value)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_seq(&test, &value));
+ ATF_CHECK_EQ(value.next, value.end);
+
+ ATF_REQUIRE(sdp_get_seq(&test, &value));
+ ATF_CHECK_EQ(value.next, value.end);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_alt);
+
+ATF_TC_HEAD(check_sdp_get_alt, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_alt results");
+}
+
+ATF_TC_BODY(check_sdp_get_alt, tc)
+{
+ uint8_t data[] = {
+ 0x3d, 0x00, // alt8(0)
+ 0x00, // nil
+ 0x3e, 0x00, 0x00, // alt16(0)
+ 0x3f, 0x00, 0x00, 0x00, // alt32(0)
+ 0x00,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t value;
+
+ /*
+ * sdp_get_alt expects a ALT type
+ * advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_alt(&test, &value));
+ ATF_CHECK_EQ(value.next, value.end);
+
+ ATF_REQUIRE_EQ(sdp_get_alt(&test, &value), false); /* not alt */
+ ATF_REQUIRE(sdp_get_data(&test, &value)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&value), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_alt(&test, &value));
+ ATF_CHECK_EQ(value.next, value.end);
+
+ ATF_REQUIRE(sdp_get_alt(&test, &value));
+ ATF_CHECK_EQ(value.next, value.end);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_str);
+
+ATF_TC_HEAD(check_sdp_get_str, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_str results");
+}
+
+ATF_TC_BODY(check_sdp_get_str, tc)
+{
+ uint8_t data[] = {
+ 0x25, 0x04, 0x53, 0x54, // str8(4) "STR8"
+ 0x52, 0x38,
+ 0x00, // nil
+ 0x26, 0x00, 0x05, 0x53, // str16(5) "STR16"
+ 0x54, 0x52, 0x31, 0x36,
+ 0x27, 0x00, 0x00, 0x00, // str32(5) "STR32"
+ 0x05, 0x53, 0x54, 0x52,
+ 0x33, 0x32,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t nil;
+ char *str;
+ size_t len;
+
+ /*
+ * sdp_get_str expects a STR type
+ * advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_str(&test, &str, &len));
+ ATF_CHECK(len == 4 && strncmp(str, "STR8", 4) == 0);
+
+ ATF_REQUIRE_EQ(sdp_get_str(&test, &str, &len), false); /* not str */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_str(&test, &str, &len));
+ ATF_CHECK(len == 5 && strncmp(str, "STR16", 5) == 0);
+
+ ATF_REQUIRE(sdp_get_str(&test, &str, &len));
+ ATF_CHECK(len == 5 && strncmp(str, "STR32", 5) == 0);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TC(check_sdp_get_url);
+
+ATF_TC_HEAD(check_sdp_get_url, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_get_url results");
+}
+
+ATF_TC_BODY(check_sdp_get_url, tc)
+{
+ uint8_t data[] = {
+ 0x45, 0x04, 0x55, 0x52, // url8(4) "URL8"
+ 0x4c, 0x38,
+ 0x00, // nil
+ 0x46, 0x00, 0x05, 0x55, // url16(5) "URL16"
+ 0x52, 0x4c, 0x31, 0x36,
+ 0x47, 0x00, 0x00, 0x00, // url32(5) "URL32"
+ 0x05, 0x55, 0x52, 0x4c,
+ 0x33, 0x32,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t nil;
+ char *url;
+ size_t len;
+
+ /*
+ * sdp_get_url expects a URL type
+ * advancing test if successful
+ */
+ ATF_REQUIRE(sdp_get_url(&test, &url, &len));
+ ATF_CHECK(len == 4 && strncmp(url, "URL8", 4) == 0);
+
+ ATF_REQUIRE_EQ(sdp_get_url(&test, &url, &len), false); /* not url */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_NIL);
+
+ ATF_REQUIRE(sdp_get_url(&test, &url, &len));
+ ATF_CHECK(len == 5 && strncmp(url, "URL16", 5) == 0);
+
+ ATF_REQUIRE(sdp_get_url(&test, &url, &len));
+ ATF_CHECK(len == 5 && strncmp(url, "URL32", 5) == 0);
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, check_sdp_get_data);
+ ATF_TP_ADD_TC(tp, check_sdp_get_attr);
+ ATF_TP_ADD_TC(tp, check_sdp_get_uuid);
+ ATF_TP_ADD_TC(tp, check_sdp_get_bool);
+ ATF_TP_ADD_TC(tp, check_sdp_get_uint);
+ ATF_TP_ADD_TC(tp, check_sdp_get_int);
+ ATF_TP_ADD_TC(tp, check_sdp_get_seq);
+ ATF_TP_ADD_TC(tp, check_sdp_get_alt);
+ ATF_TP_ADD_TC(tp, check_sdp_get_str);
+ ATF_TP_ADD_TC(tp, check_sdp_get_url);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libbluetooth/t_sdp_match.c b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_match.c
new file mode 100644
index 0000000..54a5bd5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_match.c
@@ -0,0 +1,87 @@
+/* $NetBSD: t_sdp_match.c,v 1.2 2011/04/07 08:29:50 plunky Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Iain Hibbert.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <sdp.h>
+
+ATF_TC(check_sdp_match_uuid16);
+
+ATF_TC_HEAD(check_sdp_match_uuid16, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_match_uuid16 results");
+}
+
+ATF_TC_BODY(check_sdp_match_uuid16, tc)
+{
+ uint8_t data[] = {
+ 0x19, 0x11, 0x11, // uuid16 0x1111
+ 0x00, // nil
+ 0x19, 0x12, 0x34, // uuid16 0x1234
+ 0x1a, 0x00, 0x00, 0x34, // uuid32 0x00003456
+ 0x56,
+ 0x1c, 0x00, 0x00, 0x43, // uuid128 00004321-0000-1000-8000-00805f9b34fb
+ 0x21, 0x00, 0x00, 0x10,
+ 0x00, 0x80, 0x00, 0x00,
+ 0x80, 0x5f, 0x9b, 0x34,
+ 0xfb,
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t nil;
+
+ /*
+ * sdp_match_uuid16 advances if the UUID matches the 16-bit short alias given
+ */
+
+ ATF_REQUIRE_EQ(sdp_match_uuid16(&test, 0x1100), false); /* mismatch */
+ ATF_REQUIRE(sdp_match_uuid16(&test, 0x1111));
+
+ ATF_REQUIRE_EQ(sdp_match_uuid16(&test, 0x1234), false); /* not uuid */
+ ATF_REQUIRE(sdp_get_data(&test, &nil)); /* (skip) */
+ ATF_CHECK_EQ(sdp_data_type(&nil), SDP_DATA_NIL);
+ ATF_REQUIRE(sdp_match_uuid16(&test, 0x1234));
+
+ ATF_REQUIRE(sdp_match_uuid16(&test, 0x3456));
+
+ ATF_REQUIRE_EQ(sdp_match_uuid16(&test, 0x1234), false); /* mismatch */
+ ATF_REQUIRE(sdp_match_uuid16(&test, 0x4321));
+
+ ATF_CHECK_EQ(test.next, test.end);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, check_sdp_match_uuid16);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libbluetooth/t_sdp_put.c b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_put.c
new file mode 100644
index 0000000..fff4119
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_put.c
@@ -0,0 +1,875 @@
+/* $NetBSD: t_sdp_put.c,v 1.3 2011/04/16 07:32:27 plunky Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Iain Hibbert.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <limits.h>
+#include <sdp.h>
+#include <string.h>
+
+ATF_TC(check_sdp_put_data);
+
+ATF_TC_HEAD(check_sdp_put_data, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_data results");
+}
+
+ATF_TC_BODY(check_sdp_put_data, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+ uint8_t data[] = {
+ 0x35, 0x05, // seq8(5)
+ 0x08, 0x00, // uint8 0x00
+ 0x09, 0x12, 0x34, // uint16 0x1234
+ };
+ sdp_data_t value = { data, data + sizeof(data) };
+
+ ATF_REQUIRE(sdp_put_data(&test, &value));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x35, 0x05, // seq8(5)
+ 0x08, 0x00, // uint8 0x00
+ 0x09, 0x12, 0x34, // uint16 0x1234
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_attr);
+
+ATF_TC_HEAD(check_sdp_put_attr, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_attr results");
+}
+
+ATF_TC_BODY(check_sdp_put_attr, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+ uint8_t data[] = {
+ 0x00, // nil
+ 0x19, 0x33, 0x44, // uuid16 0x3344
+ };
+ sdp_data_t value = { data, data + sizeof(data) };
+
+ ATF_REQUIRE_EQ(sdp_put_attr(&test, 0xabcd, &value), false);
+ value.next += 1; // skip "nil"
+ ATF_REQUIRE(sdp_put_attr(&test, 0x1337, &value));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x09, 0x13, 0x37, // uint16 0x1337
+ 0x19, 0x33, 0x44, // uuid16 0x3344
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uuid);
+
+ATF_TC_HEAD(check_sdp_put_uuid, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uuid results");
+}
+
+ATF_TC_BODY(check_sdp_put_uuid, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+ const uuid_t u16 = {
+ 0x00001234,
+ 0x0000,
+ 0x1000,
+ 0x80,
+ 0x00,
+ { 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb }
+ };
+ const uuid_t u32 = {
+ 0x12345678,
+ 0x0000,
+ 0x1000,
+ 0x80,
+ 0x00,
+ { 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb }
+ };
+ const uuid_t u128 = {
+ 0x00112233,
+ 0x4444,
+ 0x5555,
+ 0x66,
+ 0x77,
+ { 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd }
+ };
+
+ ATF_REQUIRE(sdp_put_uuid(&test, &u16));
+ ATF_REQUIRE(sdp_put_uuid(&test, &u32));
+ ATF_REQUIRE(sdp_put_uuid(&test, &u128));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x19, 0x12, 0x34, // uuid16 0x1234
+ 0x1a, 0x12, 0x34, 0x56, // uuid32 0x12345678
+ 0x78,
+ 0x1c, 0x00, 0x11, 0x22, // uuid128 00112233-4444-5555-6677-8899aabbccdd
+ 0x33, 0x44, 0x44, 0x55,
+ 0x55, 0x66, 0x77, 0x88,
+ 0x99, 0xaa, 0xbb, 0xcc,
+ 0xdd,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uuid16);
+
+ATF_TC_HEAD(check_sdp_put_uuid16, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uuid16 results");
+}
+
+ATF_TC_BODY(check_sdp_put_uuid16, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_uuid16(&test, 0x4567));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x19, 0x45, 0x67, // uuid16 0x4567
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uuid32);
+
+ATF_TC_HEAD(check_sdp_put_uuid32, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uuid32 results");
+}
+
+ATF_TC_BODY(check_sdp_put_uuid32, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_uuid32(&test, 0xabcdef00));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x1a, 0xab, 0xcd, 0xef, // uuid32 0xabcdef00
+ 0x00,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uuid128);
+
+ATF_TC_HEAD(check_sdp_put_uuid128, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uuid128 results");
+}
+
+ATF_TC_BODY(check_sdp_put_uuid128, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+ uuid_t value = {
+ 0x00000100,
+ 0x0000,
+ 0x1000,
+ 0x80,
+ 0x00,
+ { 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb }
+ };
+
+ ATF_REQUIRE(sdp_put_uuid128(&test, &value));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x1c, 0x00, 0x00, 0x01, // uuid128 0000100-0000-1000-8000-00805f9b34fb
+ 0x00, 0x00, 0x00, 0x10, // (L2CAP protocol)
+ 0x00, 0x80, 0x00, 0x00,
+ 0x80, 0x5f, 0x9b, 0x34,
+ 0xfb,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_bool);
+
+ATF_TC_HEAD(check_sdp_put_bool, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_bool results");
+}
+
+ATF_TC_BODY(check_sdp_put_bool, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_bool(&test, true));
+ ATF_REQUIRE(sdp_put_bool(&test, false));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x28, 0x01, // bool true
+ 0x28, 0x00, // bool false
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uint);
+
+ATF_TC_HEAD(check_sdp_put_uint, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uint results");
+}
+
+ATF_TC_BODY(check_sdp_put_uint, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_uint(&test, (uintmax_t)0));
+ ATF_REQUIRE(sdp_put_uint(&test, (uintmax_t)UINT8_MAX));
+ ATF_REQUIRE(sdp_put_uint(&test, (uintmax_t)UINT8_MAX + 1));
+ ATF_REQUIRE(sdp_put_uint(&test, (uintmax_t)UINT16_MAX));
+ ATF_REQUIRE(sdp_put_uint(&test, (uintmax_t)UINT16_MAX + 1));
+ ATF_REQUIRE(sdp_put_uint(&test, (uintmax_t)UINT32_MAX));
+ ATF_REQUIRE(sdp_put_uint(&test, (uintmax_t)UINT32_MAX + 1));
+ ATF_REQUIRE(sdp_put_uint(&test, (uintmax_t)UINT64_MAX));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x08, 0x00, // uint8 0x00
+ 0x08, 0xff, // uint8 0xff
+ 0x09, 0x01, 0x00, // uint16 0x0100
+ 0x09, 0xff, 0xff, // uint16 0xffff
+ 0x0a, 0x00, 0x01, 0x00, // uint32 0x00010000
+ 0x00,
+ 0x0a, 0xff, 0xff, 0xff, // uint32 0xffffffff
+ 0xff,
+ 0x0b, 0x00, 0x00, 0x00, // uint64 0x0000000100000000
+ 0x01, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x0b, 0xff, 0xff, 0xff, // uint64 0xffffffffffffffff
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uint8);
+
+ATF_TC_HEAD(check_sdp_put_uint8, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uint8 results");
+}
+
+ATF_TC_BODY(check_sdp_put_uint8, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_uint8(&test, (uint8_t)0));
+ ATF_REQUIRE(sdp_put_uint8(&test, (uint8_t)UINT8_MAX));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x08, 0x00, // uint8 0x00
+ 0x08, 0xff, // uint8 0xff
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uint16);
+
+ATF_TC_HEAD(check_sdp_put_uint16, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uint16 results");
+}
+
+ATF_TC_BODY(check_sdp_put_uint16, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_uint16(&test, (uint16_t)0));
+ ATF_REQUIRE(sdp_put_uint16(&test, (uint16_t)UINT8_MAX));
+ ATF_REQUIRE(sdp_put_uint16(&test, (uint16_t)UINT16_MAX));
+ ATF_REQUIRE(sdp_put_uint16(&test, (uint16_t)0xabcd));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x09, 0x00, 0x00, // uint16 0x0000
+ 0x09, 0x00, 0xff, // uint16 0x00ff
+ 0x09, 0xff, 0xff, // uint16 0xffff
+ 0x09, 0xab, 0xcd, // uint16 0xabcd
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uint32);
+
+ATF_TC_HEAD(check_sdp_put_uint32, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uint32 results");
+}
+
+ATF_TC_BODY(check_sdp_put_uint32, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_uint32(&test, (uint32_t)0));
+ ATF_REQUIRE(sdp_put_uint32(&test, (uint32_t)UINT8_MAX));
+ ATF_REQUIRE(sdp_put_uint32(&test, (uint32_t)UINT16_MAX));
+ ATF_REQUIRE(sdp_put_uint32(&test, (uint32_t)UINT32_MAX));
+ ATF_REQUIRE(sdp_put_uint32(&test, (uint32_t)0xdeadbeef));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x0a, 0x00, 0x00, 0x00, // uint32 0x00000000
+ 0x00,
+ 0x0a, 0x00, 0x00, 0x00, // uint32 0x000000ff
+ 0xff,
+ 0x0a, 0x00, 0x00, 0xff, // uint32 0x0000ffff
+ 0xff,
+ 0x0a, 0xff, 0xff, 0xff, // uint32 0xffffffff
+ 0xff,
+ 0x0a, 0xde, 0xad, 0xbe, // uint32 0xdeadbeef
+ 0xef,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_uint64);
+
+ATF_TC_HEAD(check_sdp_put_uint64, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_uint64 results");
+}
+
+ATF_TC_BODY(check_sdp_put_uint64, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_uint64(&test, (uint64_t)0));
+ ATF_REQUIRE(sdp_put_uint64(&test, (uint64_t)UINT8_MAX));
+ ATF_REQUIRE(sdp_put_uint64(&test, (uint64_t)UINT16_MAX));
+ ATF_REQUIRE(sdp_put_uint64(&test, (uint64_t)UINT32_MAX));
+ ATF_REQUIRE(sdp_put_uint64(&test, (uint64_t)UINT64_MAX));
+ ATF_REQUIRE(sdp_put_uint64(&test, (uint64_t)0xc0ffeecafec0ffee));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x0b, 0x00, 0x00, 0x00, // uint64 0x0000000000000000
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x0b, 0x00, 0x00, 0x00, // uint64 0x00000000000000ff
+ 0x00, 0x00, 0x00, 0x00,
+ 0xff,
+ 0x0b, 0x00, 0x00, 0x00, // uint64 0x000000000000ffff
+ 0x00, 0x00, 0x00, 0xff,
+ 0xff,
+ 0x0b, 0x00, 0x00, 0x00, // uint64 0x00000000ffffffff
+ 0x00, 0xff, 0xff, 0xff,
+ 0xff,
+ 0x0b, 0xff, 0xff, 0xff, // uint64 0xffffffffffffffff
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ 0x0b, 0xc0, 0xff, 0xee, // uint64 0xc0ffeecafec0ffee
+ 0xca, 0xfe, 0xc0, 0xff,
+ 0xee,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_int);
+
+ATF_TC_HEAD(check_sdp_put_int, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_int results");
+}
+
+ATF_TC_BODY(check_sdp_put_int, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)0));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT8_MIN));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT8_MAX));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT8_MIN - 1));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT8_MAX + 1));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT16_MIN));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT16_MAX));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT16_MIN - 1));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT16_MAX + 1));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT32_MIN));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT32_MAX));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT32_MIN - 1));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT32_MAX + 1));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT64_MIN));
+ ATF_REQUIRE(sdp_put_int(&test, (intmax_t)INT64_MAX));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x10, 0x00, // int8 0
+ 0x10, 0x80, // int8 -128
+ 0x10, 0x7f, // int8 127
+ 0x11, 0xff, 0x7f, // int16 -129
+ 0x11, 0x00, 0x80, // int16 128
+ 0x11, 0x80, 0x00, // int16 -32768
+ 0x11, 0x7f, 0xff, // int16 32767
+ 0x12, 0xff, 0xff, 0x7f, // int32 -32769
+ 0xff,
+ 0x12, 0x00, 0x00, 0x80, // int32 32768
+ 0x00,
+ 0x12, 0x80, 0x00, 0x00, // int32 -2147483648
+ 0x00,
+ 0x12, 0x7f, 0xff, 0xff, // int32 2147483647
+ 0xff,
+ 0x13, 0xff, 0xff, 0xff, // int64 -2147483649
+ 0xff, 0x7f, 0xff, 0xff,
+ 0xff,
+ 0x13, 0x00, 0x00, 0x00, // int64 2147483648
+ 0x00, 0x80, 0x00, 0x00,
+ 0x00,
+ 0x13, 0x80, 0x00, 0x00, // int64 -9223372036854775808
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x13, 0x7f, 0xff, 0xff, // int64 9223372036854775807
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_int8);
+
+ATF_TC_HEAD(check_sdp_put_int8, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_int8 results");
+}
+
+ATF_TC_BODY(check_sdp_put_int8, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_int8(&test, (int8_t)0));
+ ATF_REQUIRE(sdp_put_int8(&test, (int8_t)INT8_MIN));
+ ATF_REQUIRE(sdp_put_int8(&test, (int8_t)INT8_MAX));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x10, 0x00, // int8 0
+ 0x10, 0x80, // int8 -128
+ 0x10, 0x7f, // int8 127
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_int16);
+
+ATF_TC_HEAD(check_sdp_put_int16, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_int16 results");
+}
+
+ATF_TC_BODY(check_sdp_put_int16, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_int16(&test, (int16_t)0));
+ ATF_REQUIRE(sdp_put_int16(&test, (int16_t)INT8_MIN));
+ ATF_REQUIRE(sdp_put_int16(&test, (int16_t)INT8_MAX));
+ ATF_REQUIRE(sdp_put_int16(&test, (int16_t)INT16_MIN));
+ ATF_REQUIRE(sdp_put_int16(&test, (int16_t)INT16_MAX));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x11, 0x00, 0x00, // int16 0
+ 0x11, 0xff, 0x80, // int16 -128
+ 0x11, 0x00, 0x7f, // int16 127
+ 0x11, 0x80, 0x00, // int16 -32768
+ 0x11, 0x7f, 0xff, // int16 32767
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_int32);
+
+ATF_TC_HEAD(check_sdp_put_int32, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_int32 results");
+}
+
+ATF_TC_BODY(check_sdp_put_int32, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_int32(&test, (int32_t)0));
+ ATF_REQUIRE(sdp_put_int32(&test, (int32_t)INT8_MIN));
+ ATF_REQUIRE(sdp_put_int32(&test, (int32_t)INT8_MAX));
+ ATF_REQUIRE(sdp_put_int32(&test, (int32_t)INT16_MIN));
+ ATF_REQUIRE(sdp_put_int32(&test, (int32_t)INT16_MAX));
+ ATF_REQUIRE(sdp_put_int32(&test, (int32_t)INT32_MIN));
+ ATF_REQUIRE(sdp_put_int32(&test, (int32_t)INT32_MAX));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x12, 0x00, 0x00, 0x00, // int32 0
+ 0x00,
+ 0x12, 0xff, 0xff, 0xff, // int32 -128
+ 0x80,
+ 0x12, 0x00, 0x00, 0x00, // int32 127
+ 0x7f,
+ 0x12, 0xff, 0xff, 0x80, // int32 -32768
+ 0x00,
+ 0x12, 0x00, 0x00, 0x7f, // int32 32767
+ 0xff,
+ 0x12, 0x80, 0x00, 0x00, // int32 -2147483648
+ 0x00,
+ 0x12, 0x7f, 0xff, 0xff, // int32 2147483647
+ 0xff,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_int64);
+
+ATF_TC_HEAD(check_sdp_put_int64, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_int64 results");
+}
+
+ATF_TC_BODY(check_sdp_put_int64, tc)
+{
+ uint8_t buf[256];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)0));
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)INT8_MIN));
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)INT8_MAX));
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)INT16_MIN));
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)INT16_MAX));
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)INT32_MIN));
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)INT32_MAX));
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)INT64_MIN));
+ ATF_REQUIRE(sdp_put_int64(&test, (int64_t)INT64_MAX));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x13, 0x00, 0x00, 0x00, // int64 0
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x13, 0xff, 0xff, 0xff, // int64 -128
+ 0xff, 0xff, 0xff, 0xff,
+ 0x80,
+ 0x13, 0x00, 0x00, 0x00, // int64 127
+ 0x00, 0x00, 0x00, 0x00,
+ 0x7f,
+ 0x13, 0xff, 0xff, 0xff, // int64 -32768
+ 0xff, 0xff, 0xff, 0x80,
+ 0x00,
+ 0x13, 0x00, 0x00, 0x00, // int64 32767
+ 0x00, 0x00, 0x00, 0x7f,
+ 0xff,
+ 0x13, 0xff, 0xff, 0xff, // int64 -2147483648
+ 0xff, 0x80, 0x00, 0x00,
+ 0x00,
+ 0x13, 0x00, 0x00, 0x00, // int64 2147483647
+ 0x00, 0x7f, 0xff, 0xff,
+ 0xff,
+ 0x13, 0x80, 0x00, 0x00, // int64 -9223372036854775808
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x13, 0x7f, 0xff, 0xff, // int64 9223372036854775807
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_seq);
+
+ATF_TC_HEAD(check_sdp_put_seq, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_seq results");
+}
+
+ATF_TC_BODY(check_sdp_put_seq, tc)
+{
+ uint8_t buf[512];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_seq(&test, (ssize_t)0));
+ ATF_REQUIRE(sdp_put_seq(&test, (ssize_t)UINT8_MAX));
+ ATF_REQUIRE(sdp_put_seq(&test, (ssize_t)UINT8_MAX + 1));
+ ATF_REQUIRE(sdp_put_seq(&test, (ssize_t)-1));
+ ATF_CHECK_EQ(sdp_put_seq(&test, (ssize_t)UINT16_MAX), false); /* no room */
+ ATF_CHECK_EQ(sdp_put_seq(&test, (ssize_t)SSIZE_MAX), false); /* no room */
+ test.end = test.next;
+ test.next = buf;
+
+ /* (not a valid element list) */
+ const uint8_t expect[] = {
+ 0x35, 0x00, // seq8(0)
+ 0x35, 0xff, // seq8(255)
+ 0x36, 0x01, 0x00, // seq16(256)
+ 0x36, 0x01, 0xf6, // seq16(502) <- sizeof(buf) - 7 - 3
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_alt);
+
+ATF_TC_HEAD(check_sdp_put_alt, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_alt results");
+}
+
+ATF_TC_BODY(check_sdp_put_alt, tc)
+{
+ uint8_t buf[512];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ ATF_REQUIRE(sdp_put_alt(&test, (ssize_t)0));
+ ATF_REQUIRE(sdp_put_alt(&test, (ssize_t)UINT8_MAX));
+ ATF_REQUIRE(sdp_put_alt(&test, (ssize_t)UINT8_MAX + 1));
+ ATF_REQUIRE(sdp_put_alt(&test, (ssize_t)-1));
+ ATF_CHECK_EQ(sdp_put_alt(&test, (ssize_t)UINT16_MAX), false); /* no room */
+ ATF_CHECK_EQ(sdp_put_alt(&test, (ssize_t)SSIZE_MAX), false); /* no room */
+ test.end = test.next;
+ test.next = buf;
+
+ /* (not a valid element list) */
+ const uint8_t expect[] = {
+ 0x3d, 0x00, // alt8(0)
+ 0x3d, 0xff, // alt8(255)
+ 0x3e, 0x01, 0x00, // alt16(256)
+ 0x3e, 0x01, 0xf6, // alt16(502) <- sizeof(buf) - 7 - 3
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_str);
+
+ATF_TC_HEAD(check_sdp_put_str, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_str results");
+}
+
+ATF_TC_BODY(check_sdp_put_str, tc)
+{
+ uint8_t buf[512];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ /*
+ * this does not test str16 or str32, but that is
+ * handled by the same code as sdp_put_seq above..
+ */
+
+ ATF_REQUIRE(sdp_put_str(&test, "Hello World!", 5));
+ ATF_REQUIRE(sdp_put_str(&test, "Hello\0World", 11));
+ ATF_REQUIRE(sdp_put_str(&test, "Hello World!", -1));
+ ATF_REQUIRE(sdp_put_str(&test, "Hello\0World", -1));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x25, 0x05, 0x48, 0x65, // str8 "Hello"
+ 0x6c, 0x6c, 0x6f,
+ 0x25, 0x0b, 0x48, 0x65, // str8 "Hello\0World"
+ 0x6c, 0x6c, 0x6f, 0x00,
+ 0x57, 0x6f, 0x72, 0x6c,
+ 0x64,
+ 0x25, 0x0c, 0x48, 0x65, // str8 "Hello World!"
+ 0x6c, 0x6c, 0x6f, 0x20,
+ 0x57, 0x6f, 0x72, 0x6c,
+ 0x64, 0x21,
+ 0x25, 0x05, 0x48, 0x65, // str8 "Hello"
+ 0x6c, 0x6c, 0x6f,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_put_url);
+
+ATF_TC_HEAD(check_sdp_put_url, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_put_url results");
+}
+
+ATF_TC_BODY(check_sdp_put_url, tc)
+{
+ uint8_t buf[512];
+ sdp_data_t test = { buf, buf + sizeof(buf) };
+
+ /*
+ * this does not test url16 or url32, but that is
+ * handled by the same code as sdp_put_seq above..
+ */
+
+ ATF_REQUIRE(sdp_put_url(&test, "http://www.netbsd.org/", 21));
+ ATF_REQUIRE(sdp_put_url(&test, "http://www.netbsd.org/", -1));
+ test.end = test.next;
+ test.next = buf;
+
+ const uint8_t expect[] = {
+ 0x45, 0x15, 0x68, 0x74, // url8 "http://www.netbsd.org"
+ 0x74, 0x70, 0x3a, 0x2f,
+ 0x2f, 0x77, 0x77, 0x77,
+ 0x2e, 0x6e, 0x65, 0x74,
+ 0x62, 0x73, 0x64, 0x2e,
+ 0x6f, 0x72, 0x67,
+ 0x45, 0x16, 0x68, 0x74, // url8 "http://www.netbsd.org/"
+ 0x74, 0x70, 0x3a, 0x2f,
+ 0x2f, 0x77, 0x77, 0x77,
+ 0x2e, 0x6e, 0x65, 0x74,
+ 0x62, 0x73, 0x64, 0x2e,
+ 0x6f, 0x72, 0x67, 0x2f,
+ };
+
+ ATF_REQUIRE_EQ(test.end - test.next, sizeof(expect));
+ ATF_CHECK(memcmp(expect, test.next, sizeof(expect)) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, check_sdp_put_data);
+ ATF_TP_ADD_TC(tp, check_sdp_put_attr);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uuid);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uuid16);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uuid32);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uuid128);
+ ATF_TP_ADD_TC(tp, check_sdp_put_bool);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uint);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uint8);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uint16);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uint32);
+ ATF_TP_ADD_TC(tp, check_sdp_put_uint64);
+ ATF_TP_ADD_TC(tp, check_sdp_put_int);
+ ATF_TP_ADD_TC(tp, check_sdp_put_int8);
+ ATF_TP_ADD_TC(tp, check_sdp_put_int16);
+ ATF_TP_ADD_TC(tp, check_sdp_put_int32);
+ ATF_TP_ADD_TC(tp, check_sdp_put_int64);
+ ATF_TP_ADD_TC(tp, check_sdp_put_seq);
+ ATF_TP_ADD_TC(tp, check_sdp_put_alt);
+ ATF_TP_ADD_TC(tp, check_sdp_put_str);
+ ATF_TP_ADD_TC(tp, check_sdp_put_url);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libbluetooth/t_sdp_set.c b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_set.c
new file mode 100644
index 0000000..be5d953
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbluetooth/t_sdp_set.c
@@ -0,0 +1,359 @@
+/* $NetBSD: t_sdp_set.c,v 1.2 2011/04/07 08:29:50 plunky Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Iain Hibbert.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <limits.h>
+#include <sdp.h>
+#include <string.h>
+
+ATF_TC(check_sdp_set_bool);
+
+ATF_TC_HEAD(check_sdp_set_bool, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_set_bool results");
+}
+
+ATF_TC_BODY(check_sdp_set_bool, tc)
+{
+ uint8_t data[] = {
+ 0x28, 0x00, // bool false
+ 0x00, // nil
+ 0x28, // bool <invalid>
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t discard;
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_BOOL);
+ ATF_REQUIRE(sdp_set_bool(&test, true));
+ ATF_CHECK_EQ(test.next[1], 0x01);
+ ATF_REQUIRE(sdp_set_bool(&test, false));
+ ATF_CHECK_EQ(test.next[1], 0x00);
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_NIL);
+ ATF_CHECK_EQ(sdp_set_bool(&test, true), false); /* not bool */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_BOOL);
+ ATF_CHECK_EQ(sdp_set_bool(&test, true), false); /* no value */
+}
+
+ATF_TC(check_sdp_set_uint);
+
+ATF_TC_HEAD(check_sdp_set_uint, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_set_uint results");
+}
+
+ATF_TC_BODY(check_sdp_set_uint, tc)
+{
+ uint8_t data[] = {
+ 0x08, 0x00, // uint8 0x00
+ 0x00, // nil
+ 0x09, 0x00, 0x00, // uint16 0x0000
+ 0x0a, 0x00, 0x00, 0x00, // uint32 0x00000000
+ 0x00,
+ 0x0b, 0x00, 0x00, 0x00, // uint64 0x0000000000000000
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x0c, 0x00, 0x44, 0x00, // uint128 0x00440044004400440044004400440044
+ 0x44, 0x00, 0x44, 0x00,
+ 0x44, 0x00, 0x44, 0x00,
+ 0x44, 0x00, 0x44, 0x00,
+ 0x00,
+ 0x09, 0x00, // uint16 <invalid>
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t discard;
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_UINT8);
+ ATF_REQUIRE(sdp_set_uint(&test, 0x44));
+ ATF_CHECK_EQ(sdp_set_uint(&test, UINT8_MAX + 1), false); /* too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_NIL);
+ ATF_CHECK_EQ(sdp_set_uint(&test, 0x00), false); /* not uint */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_UINT16);
+ ATF_REQUIRE(sdp_set_uint(&test, 0xabcd));
+ ATF_CHECK_EQ(sdp_set_uint(&test, UINT16_MAX + 1), false); /* too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_UINT32);
+ ATF_REQUIRE(sdp_set_uint(&test, 0xdeadbeef));
+ ATF_CHECK_EQ(sdp_set_uint(&test, (uintmax_t)UINT32_MAX + 1), false); /* too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_UINT64);
+ ATF_REQUIRE(sdp_set_uint(&test, 0xc0ffeecafec0ffee));
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_UINT128);
+ ATF_REQUIRE(sdp_set_uint(&test, 0xabcdef0123456789));
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_UINT16);
+ ATF_CHECK_EQ(sdp_set_uint(&test, 0x3344), false); /* no value */
+
+ const uint8_t expect[] = {
+ 0x08, 0x44, // uint8 0x44
+ 0x00, // nil
+ 0x09, 0xab, 0xcd, // uint16 0xabcd
+ 0x0a, 0xde, 0xad, 0xbe, // uint32 0xdeadbeef
+ 0xef,
+ 0x0b, 0xc0, 0xff, 0xee, // uint64 0xc0ffeecafec0ffee
+ 0xca, 0xfe, 0xc0, 0xff,
+ 0xee,
+ 0x0c, 0x00, 0x00, 0x00, // uint128 0x0000000000000000abcdef0123456789
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xab, 0xcd, 0xef,
+ 0x01, 0x23, 0x45, 0x67,
+ 0x89,
+ 0x09, 0x00, // uint16 <invalid>
+ };
+
+ ATF_REQUIRE_EQ(sizeof(data), sizeof(expect));
+ ATF_CHECK(memcmp(expect, data, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_set_int);
+
+ATF_TC_HEAD(check_sdp_set_int, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_set_int results");
+}
+
+ATF_TC_BODY(check_sdp_set_int, tc)
+{
+ uint8_t data[] = {
+ 0x10, 0x00, // int8 0
+ 0x00, // nil
+ 0x11, 0x00, 0x00, // int16 0
+ 0x12, 0x00, 0x00, 0x00, // int32 0
+ 0x00,
+ 0x13, 0x00, 0x00, 0x00, // int64 0
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00,
+ 0x14, 0x00, 0x44, 0x00, // int128 0x00440044004400440044004400440044
+ 0x44, 0x00, 0x44, 0x00,
+ 0x44, 0x00, 0x44, 0x00,
+ 0x44, 0x00, 0x44, 0x00,
+ 0x00,
+ 0x11, 0x00, // int16 <invalid>
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t discard;
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_INT8);
+ ATF_REQUIRE(sdp_set_int(&test, -1));
+ ATF_CHECK_EQ(sdp_set_int(&test, INT8_MAX + 1), false); /* too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_NIL);
+ ATF_CHECK_EQ(sdp_set_int(&test, 33), false); /* not int */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_INT16);
+ ATF_REQUIRE(sdp_set_int(&test, 789));
+ ATF_CHECK_EQ(sdp_set_int(&test, INT16_MIN - 1), false); /* too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_INT32);
+ ATF_REQUIRE(sdp_set_int(&test, -4567));
+ ATF_CHECK_EQ(sdp_set_int(&test, (intmax_t)INT32_MAX + 1), false); /* too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_INT64);
+ ATF_REQUIRE(sdp_set_int(&test, -3483738234));
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_INT128);
+ ATF_REQUIRE(sdp_set_int(&test, 3423489463464));
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_INT16);
+ ATF_CHECK_EQ(sdp_set_int(&test, 1234), false); /* no value */
+
+ const uint8_t expect[] = {
+ 0x10, 0xff, // int8 -1
+ 0x00, // nil
+ 0x11, 0x03, 0x15, // int16 789
+ 0x12, 0xff, 0xff, 0xee, // int32 -4567
+ 0x29,
+ 0x13, 0xff, 0xff, 0xff, // int64 -3483738234
+ 0xff, 0x30, 0x5a, 0x5f,
+ 0x86,
+ 0x14, 0x00, 0x00, 0x00, // int128 3423489463464
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x03,
+ 0x1d, 0x17, 0xdf, 0x94,
+ 0xa8,
+ 0x11, 0x00, // int16 <invalid>
+ };
+
+ ATF_REQUIRE_EQ(sizeof(data), sizeof(expect));
+ ATF_CHECK(memcmp(expect, data, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_set_seq);
+
+ATF_TC_HEAD(check_sdp_set_seq, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_set_seq results");
+}
+
+ATF_TC_BODY(check_sdp_set_seq, tc)
+{
+ uint8_t data[] = {
+ 0x35, 0x03, // seq8(3)
+ 0x11, 0xff, 0xff, // int16 -1
+ 0x36, 0x01, 0x00, // seq16(256)
+ 0x09, 0xff, 0xff, // uint16 0xffff
+ 0x37, 0x01, 0x02, 0x03, // seq32(16909060)
+ 0x04,
+ 0x36, 0x00, // seq16(<invalid>)
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t discard;
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_SEQ8);
+ ATF_REQUIRE(sdp_set_seq(&test, 0));
+ ATF_CHECK_EQ(sdp_set_seq(&test, UINT8_MAX), false); /* data too big */
+ ATF_CHECK_EQ(sdp_set_seq(&test, UINT16_MAX), false); /* size too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_INT16);
+ ATF_CHECK_EQ(sdp_set_seq(&test, 33), false); /* not seq */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_SEQ16);
+ ATF_REQUIRE(sdp_set_seq(&test, 3));
+ ATF_CHECK_EQ(sdp_set_seq(&test, SSIZE_MAX), false); /* size too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_SEQ32);
+ ATF_REQUIRE(sdp_set_seq(&test, 0));
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_SEQ16);
+ ATF_CHECK_EQ(sdp_set_seq(&test, 22), false); /* no size */
+
+ const uint8_t expect[] = {
+ 0x35, 0x00, // seq8(0)
+ 0x11, 0xff, 0xff, // int16 -1
+ 0x36, 0x00, 0x03, // seq16(3)
+ 0x09, 0xff, 0xff, // uint16 0xffff
+ 0x37, 0x00, 0x00, 0x00, // seq32(0)
+ 0x00,
+ 0x36, 0x00, // seq16(<invalid>)
+ };
+
+ ATF_REQUIRE_EQ(sizeof(data), sizeof(expect));
+ ATF_CHECK(memcmp(expect, data, sizeof(expect)) == 0);
+}
+
+ATF_TC(check_sdp_set_alt);
+
+ATF_TC_HEAD(check_sdp_set_alt, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sdp_set_alt results");
+}
+
+ATF_TC_BODY(check_sdp_set_alt, tc)
+{
+ uint8_t data[] = {
+ 0x3d, 0x06, // alt8(6)
+ 0x11, 0xff, 0xff, // int16 -1
+ 0x3e, 0xff, 0xff, // alt16(65535)
+ 0x3f, 0x01, 0x02, 0x03, // alt32(16909060)
+ 0x04,
+ 0x0a, 0x00, 0x00, 0x00, // uint32 0x00000003
+ 0x03,
+ 0x3e, 0x00, // alt16(<invalid>)
+ };
+ sdp_data_t test = { data, data + sizeof(data) };
+ sdp_data_t discard;
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_ALT8);
+ ATF_REQUIRE(sdp_set_alt(&test, 0));
+ ATF_CHECK_EQ(sdp_set_alt(&test, UINT8_MAX), false); /* data too big */
+ ATF_CHECK_EQ(sdp_set_alt(&test, UINT16_MAX), false); /* size too big */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_INT16);
+ ATF_CHECK_EQ(sdp_set_alt(&test, 27), false); /* not alt */
+ ATF_REQUIRE(sdp_get_data(&test, &discard));
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_ALT16);
+ ATF_REQUIRE(sdp_set_alt(&test, 10));
+ ATF_CHECK_EQ(sdp_set_alt(&test, SSIZE_MAX), false); /* size too big */
+ ATF_REQUIRE(sdp_get_alt(&test, &discard));
+ ATF_CHECK_EQ(sdp_data_type(&discard), SDP_DATA_ALT32);
+ ATF_CHECK(sdp_set_alt(&discard, -1)); /* end of alt16 */
+ ATF_CHECK_EQ(sdp_set_alt(&discard, 6), false); /* data too big */
+
+ ATF_CHECK_EQ(sdp_data_type(&test), SDP_DATA_ALT16);
+ ATF_CHECK_EQ(sdp_set_alt(&test, 22), false); /* no size */
+
+ const uint8_t expect[] = {
+ 0x3d, 0x00, // alt8(0)
+ 0x11, 0xff, 0xff, // int16 -1
+ 0x3e, 0x00, 0x0a, // alt16(10)
+ 0x3f, 0x00, 0x00, 0x00, // alt32(5)
+ 0x05,
+ 0x0a, 0x00, 0x00, 0x00, // uint32 0x00000003
+ 0x03,
+ 0x3e, 0x00, // alt16(<invalid>)
+ };
+
+ ATF_REQUIRE_EQ(sizeof(data), sizeof(expect));
+ ATF_CHECK(memcmp(expect, data, sizeof(expect)) == 0);
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, check_sdp_set_bool);
+ ATF_TP_ADD_TC(tp, check_sdp_set_uint);
+ ATF_TP_ADD_TC(tp, check_sdp_set_int);
+ ATF_TP_ADD_TC(tp, check_sdp_set_seq);
+ ATF_TP_ADD_TC(tp, check_sdp_set_alt);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c b/contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c
new file mode 100644
index 0000000..da67c1b3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c
@@ -0,0 +1,3975 @@
+/* $NetBSD: t_bpfjit.c,v 1.6 2014/07/08 21:07:52 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2011-2012, 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_bpfjit.c,v 1.6 2014/07/08 21:07:52 alnsn Exp $");
+
+#include <atf-c.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <net/bpf.h>
+#include <net/bpfjit.h>
+
+static uint8_t deadbeef_at_5[16] = {
+ 0, 0xf1, 2, 0xf3, 4, 0xde, 0xad, 0xbe, 0xef, 0xff
+};
+
+static inline
+unsigned int jitcall(bpfjit_func_t fn,
+ const uint8_t *pkt, unsigned int wirelen, unsigned int buflen)
+{
+ bpf_args_t args;
+
+ args.pkt = pkt;
+ args.wirelen = wirelen;
+ args.buflen = buflen;
+
+ return fn(NULL, &args);
+}
+
+ATF_TC(libbpfjit_empty);
+ATF_TC_HEAD(libbpfjit_empty, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that JIT compilation of an empty bpf program fails");
+}
+
+ATF_TC_BODY(libbpfjit_empty, tc)
+{
+ struct bpf_insn dummy;
+
+ ATF_CHECK(bpfjit_generate_code(NULL, &dummy, 0) == NULL);
+}
+
+ATF_TC(libbpfjit_alu_add_k);
+ATF_TC_HEAD(libbpfjit_alu_add_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_ADD+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_alu_add_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 3),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 5);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_sub_k);
+ATF_TC_HEAD(libbpfjit_alu_sub_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_SUB+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_alu_sub_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1),
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_K, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_mul_k);
+ATF_TC_HEAD(libbpfjit_alu_mul_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_MUL+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_alu_mul_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(0xfffffffd));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div0_k);
+ATF_TC_HEAD(libbpfjit_alu_div0_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=0");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div0_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ //ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div1_k);
+ATF_TC_HEAD(libbpfjit_alu_div1_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=1");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div1_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 7),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 7);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div2_k);
+ATF_TC_HEAD(libbpfjit_alu_div2_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=2");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div2_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 7),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 3);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div4_k);
+ATF_TC_HEAD(libbpfjit_alu_div4_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=4");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div4_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(0x3fffffff));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div10_k);
+ATF_TC_HEAD(libbpfjit_alu_div10_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=10");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div10_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 10),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(429484384));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div10000_k);
+ATF_TC_HEAD(libbpfjit_alu_div10000_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=10000");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div10000_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 10000),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(429484));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div7609801_k);
+ATF_TC_HEAD(libbpfjit_alu_div7609801_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=7609801");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div7609801_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294967295)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, UINT32_C(7609801)),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 564);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div80000000_k);
+ATF_TC_HEAD(libbpfjit_alu_div80000000_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=0x80000000");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div80000000_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffde)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, UINT32_C(0x80000000)),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_and_k);
+ATF_TC_HEAD(libbpfjit_alu_and_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_AND+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_alu_and_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdead),
+ BPF_STMT(BPF_ALU+BPF_AND+BPF_K, 0xbeef),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == (0xdead&0xbeef));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_or_k);
+ATF_TC_HEAD(libbpfjit_alu_or_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_OR+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_alu_or_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdead0000),
+ BPF_STMT(BPF_ALU+BPF_OR+BPF_K, 0x0000beef),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0xdeadbeef);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_lsh_k);
+ATF_TC_HEAD(libbpfjit_alu_lsh_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_LSH+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_alu_lsh_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 16),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0xbeef0000);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_lsh0_k);
+ATF_TC_HEAD(libbpfjit_alu_lsh0_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_LSH+BPF_K with k=0");
+}
+
+ATF_TC_BODY(libbpfjit_alu_lsh0_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0xdeadbeef);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_rsh_k);
+ATF_TC_HEAD(libbpfjit_alu_rsh_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_RSH+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_alu_rsh_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_K, 16),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0x0000dead);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_rsh0_k);
+ATF_TC_HEAD(libbpfjit_alu_rsh0_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_RSH+BPF_K with k=0");
+}
+
+ATF_TC_BODY(libbpfjit_alu_rsh0_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0xdeadbeef);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_modulo_k);
+ATF_TC_HEAD(libbpfjit_alu_modulo_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of modulo logic of BPF_ALU+BPF_K operations");
+}
+
+ATF_TC_BODY(libbpfjit_alu_modulo_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0x7fffff77)),
+
+ /* (7FFFFF77 * 0FFFFF77) = 07FFFFB2,F0004951 */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_K, UINT32_C(0x0fffff77)),
+
+ /* 07FFFFB2,F0004951 << 1 = 0FFFFF65,E00092A2 */
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 1),
+
+ /* 0FFFFF65,E00092A2 + DDDDDDDD = 0FFFFF66,BDDE707F */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xdddddddd)),
+
+ /* 0FFFFF66,BDDE707F - FFFFFFFF = 0FFFFF65,BDDE7080 */
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_K, UINT32_C(0xffffffff)),
+
+ /* 0FFFFF65,BDDE7080 | 0000030C = 0FFFFF65,BDDE738C */
+ BPF_STMT(BPF_ALU+BPF_OR+BPF_K, UINT32_C(0x0000030c)),
+
+ /* -0FFFFF65,BDDE738C mod(2^64) = F000009A,42218C74 */
+ BPF_STMT(BPF_ALU+BPF_NEG, 0),
+
+ /* F000009A,42218C74 & FFFFFF0F = F000009A,42218C04 */
+ BPF_STMT(BPF_ALU+BPF_AND+BPF_K, UINT32_C(0xffffff0f)),
+
+ /* F000009A,42218C74 >> 3 = 1E000013,48443180 */
+ /* 00000000,42218C74 >> 3 = 00000000,08443180 */
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_K, 3),
+
+ /* 00000000,08443180 * 7FFFFF77 = 042218BB,93818280 */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_K, UINT32_C(0x7fffff77)),
+
+ /* 042218BB,93818280 / DEAD = 000004C0,71CBBBC3 */
+ /* 00000000,93818280 / DEAD = 00000000,0000A994 */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, UINT32_C(0xdead)),
+
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) != UINT32_C(0x71cbbbc3));
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(0x0000a994));
+
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_add_x);
+ATF_TC_HEAD(libbpfjit_alu_add_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_ADD+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_alu_add_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 3),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 5);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_sub_x);
+ATF_TC_HEAD(libbpfjit_alu_sub_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_SUB+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_alu_sub_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_mul_x);
+ATF_TC_HEAD(libbpfjit_alu_mul_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_MUL+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_alu_mul_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(0xfffffffd));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div0_x);
+ATF_TC_HEAD(libbpfjit_alu_div0_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=0");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div0_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div1_x);
+ATF_TC_HEAD(libbpfjit_alu_div1_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=1");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div1_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 7),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 7);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div2_x);
+ATF_TC_HEAD(libbpfjit_alu_div2_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=2");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div2_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 7),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 3);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div4_x);
+ATF_TC_HEAD(libbpfjit_alu_div4_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=4");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div4_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 4),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(0x3fffffff));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div10_x);
+ATF_TC_HEAD(libbpfjit_alu_div10_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=10");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div10_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 10),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(429484384));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div10000_x);
+ATF_TC_HEAD(libbpfjit_alu_div10000_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=10000");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div10000_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 10000),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(429484));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div7609801_x);
+ATF_TC_HEAD(libbpfjit_alu_div7609801_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=7609801");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div7609801_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294967295)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(7609801)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 564);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_div80000000_x);
+ATF_TC_HEAD(libbpfjit_alu_div80000000_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=0x80000000");
+}
+
+ATF_TC_BODY(libbpfjit_alu_div80000000_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_MAX - 33),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0x80000000)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_and_x);
+ATF_TC_HEAD(libbpfjit_alu_and_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_AND+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_alu_and_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdead),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0xbeef),
+ BPF_STMT(BPF_ALU+BPF_AND+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == (0xdead&0xbeef));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_or_x);
+ATF_TC_HEAD(libbpfjit_alu_or_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_OR+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_alu_or_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdead0000),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0x0000beef),
+ BPF_STMT(BPF_ALU+BPF_OR+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0xdeadbeef);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_lsh_x);
+ATF_TC_HEAD(libbpfjit_alu_lsh_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_LSH+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_alu_lsh_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 16),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0xbeef0000);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_lsh0_x);
+ATF_TC_HEAD(libbpfjit_alu_lsh0_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_LSH+BPF_X with k=0");
+}
+
+ATF_TC_BODY(libbpfjit_alu_lsh0_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0xdeadbeef);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_rsh_x);
+ATF_TC_HEAD(libbpfjit_alu_rsh_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_RSH+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_alu_rsh_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 16),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0x0000dead);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_rsh0_x);
+ATF_TC_HEAD(libbpfjit_alu_rsh0_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_RSH+BPF_X with k=0");
+}
+
+ATF_TC_BODY(libbpfjit_alu_rsh0_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0xdeadbeef);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_modulo_x);
+ATF_TC_HEAD(libbpfjit_alu_modulo_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of modulo logic of BPF_ALU+BPF_X operations");
+}
+
+ATF_TC_BODY(libbpfjit_alu_modulo_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0x7fffff77)),
+
+ /* (7FFFFF77 * 0FFFFF77) = 07FFFFB2,F0004951 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0x0fffff77)),
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0),
+
+ /* 07FFFFB2,F0004951 << 1 = 0FFFFF65,E00092A2 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, 1),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_X, 0),
+
+ /* 0FFFFF65,E00092A2 + DDDDDDDD = 0FFFFF66,BDDE707F */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0xdddddddd)),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+
+ /* 0FFFFF66,BDDE707F - FFFFFFFF = 0FFFFF65,BDDE7080 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_X, 0),
+
+ /* 0FFFFF65,BDDE7080 | 0000030C = 0FFFFF65,BDDE738C */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0x0000030c)),
+ BPF_STMT(BPF_ALU+BPF_OR+BPF_X, 0),
+
+ /* -0FFFFF65,BDDE738C mod(2^64) = F000009A,42218C74 */
+ BPF_STMT(BPF_ALU+BPF_NEG, 0),
+
+ /* F000009A,42218C74 & FFFFFF0F = F000009A,42218C04 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0xffffff0f)),
+ BPF_STMT(BPF_ALU+BPF_AND+BPF_X, 0),
+
+ /* F000009A,42218C74 >> 3 = 1E000013,48443180 */
+ /* 00000000,42218C74 >> 3 = 00000000,08443180 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, 3),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_X, 0),
+
+ /* 00000000,08443180 * 7FFFFF77 = 042218BB,93818280 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0x7fffff77)),
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0),
+
+ /* 042218BB,93818280 / DEAD = 000004C0,71CBBBC3 */
+ /* 00000000,93818280 / DEAD = 00000000,0000A994 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0xdead)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) != UINT32_C(0x71cbbbc3));
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(0x0000a994));
+
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_alu_neg);
+ATF_TC_HEAD(libbpfjit_alu_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_NEG");
+}
+
+ATF_TC_BODY(libbpfjit_alu_neg, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 777),
+ BPF_STMT(BPF_ALU+BPF_NEG, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0u-777u);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_ja);
+ATF_TC_HEAD(libbpfjit_jmp_ja, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JA");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_ja, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_JMP+BPF_JA, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_jgt_k);
+ATF_TC_HEAD(libbpfjit_jmp_jgt_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JGT+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_jgt_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 7, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 2, 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 9, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 4, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 6, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 5, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 7);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_jge_k);
+ATF_TC_HEAD(libbpfjit_jmp_jge_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JGE+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_jge_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 8, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 3, 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 9, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 5, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 7, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 6, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 1, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 7);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_jeq_k);
+ATF_TC_HEAD(libbpfjit_jmp_jeq_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JEQ+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_jeq_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 8, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 3, 1, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 9, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 5, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 7, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 6, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 1, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 7);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 7);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 1);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_jset_k);
+ATF_TC_HEAD(libbpfjit_jmp_jset_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JSET+BPF_K");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_jset_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 8, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 4, 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 3, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 2, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 1, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 2, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 7, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 1);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 5);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_modulo_k);
+ATF_TC_HEAD(libbpfjit_jmp_modulo_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of modulo logic of BPF_JMP+BPF_K operations");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_modulo_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0x7fffff77)),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 4),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, UINT32_C(0xfffff770), 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, UINT32_C(0xfffff770), 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, UINT32_C(0xfffff771), 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, UINT32_C(0xfffff770), 0, 3),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, UINT32_C(0xfffff770), 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, UINT32_C(0xfffff771), 1, 0),
+ BPF_STMT(BPF_JMP+BPF_JA, 1),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+
+ /* FFFFF770+FFFFF770 = 00000001,FFFFEEE0 */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xfffff770)),
+
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, UINT32_C(0xffffeee0), 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, UINT32_C(0xffffeee0), 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, UINT32_C(0xffffeee1), 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, UINT32_C(0xffffeee0), 0, 3),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, UINT32_C(0xffffeee0), 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, UINT32_C(0xffffeee1), 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_jgt_x);
+ATF_TC_HEAD(libbpfjit_jmp_jgt_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JGT+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_jgt_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 7),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 3, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 9),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 4),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 6),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 4, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 7);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_jge_x);
+ATF_TC_HEAD(libbpfjit_jmp_jge_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JGE+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_jge_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 8),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 3, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 9),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 7),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 6),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 4, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 7);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_jeq_x);
+ATF_TC_HEAD(libbpfjit_jmp_jeq_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JEQ+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_jeq_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 8),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 2, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 9),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 7),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 1, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 7);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 7);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 1);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_jset_x);
+ATF_TC_HEAD(libbpfjit_jmp_jset_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JSET+BPF_X");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_jset_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 8),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 4),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 3, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 4, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 7),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 1);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 5);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_jmp_modulo_x);
+ATF_TC_HEAD(libbpfjit_jmp_modulo_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of modulo logic of BPF_JMP+BPF_X operations");
+}
+
+ATF_TC_BODY(libbpfjit_jmp_modulo_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0x7fffff77)),
+ /* FFFFF770 << 4 = FFFFF770 */
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 4),
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xfffff770)),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xfffff771)),
+ BPF_JUMP(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
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ld_abs);
+ATF_TC_HEAD(libbpfjit_ld_abs, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_ABS");
+}
+
+ATF_TC_BODY(libbpfjit_ld_abs, tc)
+{
+ static struct bpf_insn insns[3][2] = {
+ {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ }
+ };
+
+ static size_t lengths[3] = { 1, 2, 4 };
+ static unsigned int expected[3] = { 0xde, 0xdead, 0xdeadbeef };
+
+ size_t i, l;
+ uint8_t *pkt = deadbeef_at_5;
+ size_t pktsize = sizeof(deadbeef_at_5);
+
+ size_t insn_count = sizeof(insns[0]) / sizeof(insns[0][0]);
+
+ for (i = 0; i < 3; i++) {
+ bpfjit_func_t code;
+
+ ATF_CHECK(bpf_validate(insns[i], insn_count));
+
+ code = bpfjit_generate_code(NULL, insns[i], insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (l = 1; l < 5 + lengths[i]; l++) {
+ ATF_CHECK(jitcall(code, pkt, l, l) == 0);
+ ATF_CHECK(jitcall(code, pkt, pktsize, l) == 0);
+ }
+
+ l = 5 + lengths[i];
+ ATF_CHECK(jitcall(code, pkt, l, l) == expected[i]);
+ ATF_CHECK(jitcall(code, pkt, pktsize, l) == expected[i]);
+
+ l = pktsize;
+ ATF_CHECK(jitcall(code, pkt, l, l) == expected[i]);
+
+ bpfjit_free_code(code);
+ }
+}
+
+ATF_TC(libbpfjit_ld_abs_k_overflow);
+ATF_TC_HEAD(libbpfjit_ld_abs_k_overflow, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_ABS with overflow in k+4");
+}
+
+ATF_TC_BODY(libbpfjit_ld_abs_k_overflow, tc)
+{
+ static struct bpf_insn insns[12][3] = {
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, UINT32_MAX - 1),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX - 1),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX - 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX - 3),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, UINT32_MAX - 1),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX - 1),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX - 2),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX - 3),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ }
+ };
+
+ int i;
+ uint8_t pkt[8] = { 0 };
+
+ size_t insn_count = sizeof(insns[0]) / sizeof(insns[0][0]);
+
+ for (i = 0; i < 3; i++) {
+ bpfjit_func_t code;
+
+ ATF_CHECK(bpf_validate(insns[i], insn_count));
+
+ code = bpfjit_generate_code(NULL, insns[i], insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+ }
+}
+
+ATF_TC(libbpfjit_ld_ind);
+ATF_TC_HEAD(libbpfjit_ld_ind, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(libbpfjit_ld_ind, tc)
+{
+ static struct bpf_insn insns[6][3] = {
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ }
+ };
+
+ static size_t lengths[6] = { 1, 2, 4, 1, 2, 4 };
+
+ static unsigned int expected[6] = {
+ 0xde, 0xdead, 0xdeadbeef,
+ 0xde, 0xdead, 0xdeadbeef
+ };
+
+ size_t i, l;
+ uint8_t *pkt = deadbeef_at_5;
+ size_t pktsize = sizeof(deadbeef_at_5);
+
+ size_t insn_count = sizeof(insns[0]) / sizeof(insns[0][0]);
+
+ for (i = 0; i < 3; i++) {
+ bpfjit_func_t code;
+
+ ATF_CHECK(bpf_validate(insns[i], insn_count));
+
+ code = bpfjit_generate_code(NULL, insns[i], insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (l = 1; l < 5 + lengths[i]; l++) {
+ ATF_CHECK(jitcall(code, pkt, l, l) == 0);
+ ATF_CHECK(jitcall(code, pkt, pktsize, l) == 0);
+ }
+
+ l = 5 + lengths[i];
+ ATF_CHECK(jitcall(code, pkt, l, l) == expected[i]);
+ ATF_CHECK(jitcall(code, pkt, pktsize, l) == expected[i]);
+
+ l = pktsize;
+ ATF_CHECK(jitcall(code, pkt, l, l) == expected[i]);
+
+ bpfjit_free_code(code);
+ }
+}
+
+ATF_TC(libbpfjit_ld_ind_k_overflow);
+ATF_TC_HEAD(libbpfjit_ld_ind_k_overflow, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IND with overflow in k+4");
+}
+
+ATF_TC_BODY(libbpfjit_ld_ind_k_overflow, tc)
+{
+ static struct bpf_insn insns[12][3] = {
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, UINT32_MAX - 1),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 1),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 2),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, UINT32_MAX - 1),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 1),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 2),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 3),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ }
+ };
+
+ int i;
+ uint8_t pkt[8] = { 0 };
+
+ size_t insn_count = sizeof(insns[0]) / sizeof(insns[0][0]);
+
+ for (i = 0; i < 3; i++) {
+ bpfjit_func_t code;
+
+ ATF_CHECK(bpf_validate(insns[i], insn_count));
+
+ code = bpfjit_generate_code(NULL, insns[i], insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ bpfjit_free_code(code);
+ }
+}
+
+ATF_TC(libbpfjit_ld_ind_x_overflow1);
+ATF_TC_HEAD(libbpfjit_ld_ind_x_overflow1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IND with overflow in X+4");
+}
+
+ATF_TC_BODY(libbpfjit_ld_ind_x_overflow1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_LEN, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_MISC+BPF_TAX, 0),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[8] = { 10, 20, 30, 40, 50, 60, 70, 80 };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++) {
+ ATF_CHECK(bpf_filter(insns, pkt, i, i) == 10 * i);
+ ATF_CHECK(jitcall(code, pkt, i, i) == 10 * i);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ld_ind_x_overflow2);
+ATF_TC_HEAD(libbpfjit_ld_ind_x_overflow2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IND with overflow in X+4");
+}
+
+ATF_TC_BODY(libbpfjit_ld_ind_x_overflow2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_LEN, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_ST, 3),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 3),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[8] = { 10, 20, 30, 40, 50, 60, 70, 80 };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++) {
+ ATF_CHECK(bpf_filter(insns, pkt, i, i) == 10 * i);
+ ATF_CHECK(jitcall(code, pkt, i, i) == 10 * i);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ld_len);
+ATF_TC_HEAD(libbpfjit_ld_len, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_W+BPF_LEN");
+}
+
+ATF_TC_BODY(libbpfjit_ld_len, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[32]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < sizeof(pkt); i++)
+ ATF_CHECK(jitcall(code, pkt, i, 1) == i);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ld_imm);
+ATF_TC_HEAD(libbpfjit_ld_imm, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IMM");
+}
+
+ATF_TC_BODY(libbpfjit_ld_imm, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ldx_imm1);
+ATF_TC_HEAD(libbpfjit_ldx_imm1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_IMM");
+}
+
+ATF_TC_BODY(libbpfjit_ldx_imm1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_MAX - 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX - 5);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ldx_imm2);
+ATF_TC_HEAD(libbpfjit_ldx_imm2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_IMM");
+}
+
+ATF_TC_BODY(libbpfjit_ldx_imm2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_STMT(BPF_LD+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ldx_len1);
+ATF_TC_HEAD(libbpfjit_ldx_len1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_LEN");
+}
+
+ATF_TC_BODY(libbpfjit_ldx_len1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[5]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i < sizeof(pkt); i++) {
+ ATF_CHECK(jitcall(code, pkt, i, 1) == i);
+ ATF_CHECK(jitcall(code, pkt, i + 1, i) == i + 1);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ldx_len2);
+ATF_TC_HEAD(libbpfjit_ldx_len2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_LEN");
+}
+
+ATF_TC_BODY(libbpfjit_ldx_len2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LD+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[5]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 5, 1) == UINT32_MAX);
+ ATF_CHECK(jitcall(code, pkt, 6, 5) == 7);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_ldx_msh);
+ATF_TC_HEAD(libbpfjit_ldx_msh, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_MSH");
+}
+
+ATF_TC_BODY(libbpfjit_ldx_msh, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[2] = { 0, 0x7a };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 40);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_misc_tax);
+ATF_TC_HEAD(libbpfjit_misc_tax, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_MISC+BPF_TAX");
+}
+
+ATF_TC_BODY(libbpfjit_misc_tax, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 3),
+ BPF_STMT(BPF_MISC+BPF_TAX, 0),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[] = { 0, 11, 22, 33, 44, 55 };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, sizeof(pkt), sizeof(pkt)) == 55);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_misc_txa);
+ATF_TC_HEAD(libbpfjit_misc_txa, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_MISC+BPF_TXA");
+}
+
+ATF_TC_BODY(libbpfjit_misc_txa, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 391),
+ BPF_STMT(BPF_MISC+BPF_TXA, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 391);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_st1);
+ATF_TC_HEAD(libbpfjit_st1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(libbpfjit_st1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ST, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_LD+BPF_MEM, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[16]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++)
+ ATF_CHECK(jitcall(code, pkt, i, sizeof(pkt)) == i);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_st2);
+ATF_TC_HEAD(libbpfjit_st2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(libbpfjit_st2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ST, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_LD+BPF_MEM, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_st3);
+ATF_TC_HEAD(libbpfjit_st3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(libbpfjit_st3, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ST, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 100),
+ BPF_STMT(BPF_ST, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 200),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 301, 2, 0),
+ BPF_STMT(BPF_LD+BPF_MEM, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ BPF_STMT(BPF_LD+BPF_MEM, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[2]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_REQUIRE(BPF_MEMWORDS > 1);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 102);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_st4);
+ATF_TC_HEAD(libbpfjit_st4, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(libbpfjit_st4, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ST, 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 100),
+ BPF_STMT(BPF_ST, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 200),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 301, 2, 0),
+ BPF_STMT(BPF_LD+BPF_MEM, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ BPF_STMT(BPF_LD+BPF_MEM, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[2]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_REQUIRE(BPF_MEMWORDS > 6);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 102);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_st5);
+ATF_TC_HEAD(libbpfjit_st5, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(libbpfjit_st5, tc)
+{
+ struct bpf_insn insns[5*BPF_MEMWORDS+2];
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ size_t k;
+ bpfjit_func_t code;
+ uint8_t pkt[BPF_MEMWORDS]; /* the program doesn't read any data */
+
+ memset(insns, 0, sizeof(insns));
+
+ /* for each k do M[k] = k */
+ for (k = 0; k < BPF_MEMWORDS; k++) {
+ insns[2*k].code = BPF_LD+BPF_IMM;
+ insns[2*k].k = 3*k;
+ insns[2*k+1].code = BPF_ST;
+ insns[2*k+1].k = k;
+ }
+
+ /* load wirelen into A */
+ insns[2*BPF_MEMWORDS].code = BPF_LD+BPF_W+BPF_LEN;
+
+ /* for each k, if (A == k + 1) return M[k] */
+ for (k = 0; k < BPF_MEMWORDS; k++) {
+ insns[2*BPF_MEMWORDS+3*k+1].code = BPF_JMP+BPF_JEQ+BPF_K;
+ insns[2*BPF_MEMWORDS+3*k+1].k = k+1;
+ insns[2*BPF_MEMWORDS+3*k+1].jt = 0;
+ insns[2*BPF_MEMWORDS+3*k+1].jf = 2;
+ insns[2*BPF_MEMWORDS+3*k+2].code = BPF_LD+BPF_MEM;
+ insns[2*BPF_MEMWORDS+3*k+2].k = k;
+ insns[2*BPF_MEMWORDS+3*k+3].code = BPF_RET+BPF_A;
+ insns[2*BPF_MEMWORDS+3*k+3].k = 0;
+ }
+
+ insns[5*BPF_MEMWORDS+1].code = BPF_RET+BPF_K;
+ insns[5*BPF_MEMWORDS+1].k = UINT32_MAX;
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (k = 1; k <= sizeof(pkt); k++)
+ ATF_CHECK(jitcall(code, pkt, k, k) == 3*(k-1));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_stx1);
+ATF_TC_HEAD(libbpfjit_stx1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_STX");
+}
+
+ATF_TC_BODY(libbpfjit_stx1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_STX, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[16]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++)
+ ATF_CHECK(jitcall(code, pkt, i, sizeof(pkt)) == i);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_stx2);
+ATF_TC_HEAD(libbpfjit_stx2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_STX");
+}
+
+ATF_TC_BODY(libbpfjit_stx2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_STX, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0),
+ BPF_STMT(BPF_MISC+BPF_TXA, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_stx3);
+ATF_TC_HEAD(libbpfjit_stx3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_STX");
+}
+
+ATF_TC_BODY(libbpfjit_stx3, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_STX, 5),
+ BPF_STMT(BPF_STX, 2),
+ BPF_STMT(BPF_STX, 3),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 2),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 3),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 6),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[16]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++)
+ ATF_CHECK(jitcall(code, pkt, i, sizeof(pkt)) == 3 * i);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_stx4);
+ATF_TC_HEAD(libbpfjit_stx4, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_STX");
+}
+
+ATF_TC_BODY(libbpfjit_stx4, tc)
+{
+ struct bpf_insn insns[5*BPF_MEMWORDS+2];
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ size_t k;
+ bpfjit_func_t code;
+ uint8_t pkt[BPF_MEMWORDS]; /* the program doesn't read any data */
+
+ memset(insns, 0, sizeof(insns));
+
+ /* for each k do M[k] = k */
+ for (k = 0; k < BPF_MEMWORDS; k++) {
+ insns[2*k].code = BPF_LDX+BPF_W+BPF_IMM;
+ insns[2*k].k = 3*k;
+ insns[2*k+1].code = BPF_STX;
+ insns[2*k+1].k = k;
+ }
+
+ /* load wirelen into A */
+ insns[2*BPF_MEMWORDS].code = BPF_LD+BPF_W+BPF_LEN;
+
+ /* for each k, if (A == k + 1) return M[k] */
+ for (k = 0; k < BPF_MEMWORDS; k++) {
+ insns[2*BPF_MEMWORDS+3*k+1].code = BPF_JMP+BPF_JEQ+BPF_K;
+ insns[2*BPF_MEMWORDS+3*k+1].k = k+1;
+ insns[2*BPF_MEMWORDS+3*k+1].jt = 0;
+ insns[2*BPF_MEMWORDS+3*k+1].jf = 2;
+ insns[2*BPF_MEMWORDS+3*k+2].code = BPF_LD+BPF_MEM;
+ insns[2*BPF_MEMWORDS+3*k+2].k = k;
+ insns[2*BPF_MEMWORDS+3*k+3].code = BPF_RET+BPF_A;
+ insns[2*BPF_MEMWORDS+3*k+3].k = 0;
+ }
+
+ insns[5*BPF_MEMWORDS+1].code = BPF_RET+BPF_K;
+ insns[5*BPF_MEMWORDS+1].k = UINT32_MAX;
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (k = 1; k <= sizeof(pkt); k++)
+ ATF_CHECK(jitcall(code, pkt, k, k) == 3*(k-1));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_opt_ld_abs_1);
+ATF_TC_HEAD(libbpfjit_opt_ld_abs_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_ABS");
+}
+
+ATF_TC_BODY(libbpfjit_opt_ld_abs_1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 8),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 4),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_opt_ld_abs_2);
+ATF_TC_HEAD(libbpfjit_opt_ld_abs_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_ABS");
+}
+
+ATF_TC_BODY(libbpfjit_opt_ld_abs_2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 5),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_opt_ld_abs_3);
+ATF_TC_HEAD(libbpfjit_opt_ld_abs_3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_ABS");
+}
+
+ATF_TC_BODY(libbpfjit_opt_ld_abs_3, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 3, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 5),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_opt_ld_ind_1);
+ATF_TC_HEAD(libbpfjit_opt_ld_ind_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(libbpfjit_opt_ld_ind_1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 12),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 8),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 14),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 18),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 4),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 18),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_opt_ld_ind_2);
+ATF_TC_HEAD(libbpfjit_opt_ld_ind_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(libbpfjit_opt_ld_ind_2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 5),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_opt_ld_ind_3);
+ATF_TC_HEAD(libbpfjit_opt_ld_ind_3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(libbpfjit_opt_ld_ind_3, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 15),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 15),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 11),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 3, 7),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 6),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 11),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 4),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_opt_ld_ind_4);
+ATF_TC_HEAD(libbpfjit_opt_ld_ind_4, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(libbpfjit_opt_ld_ind_4, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 11),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 19),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 15),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 3, 7),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 6),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 15),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 4),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_abc_ja);
+ATF_TC_HEAD(libbpfjit_abc_ja, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test ABC optimization with a single BPF_JMP+BPF_JA");
+}
+
+ATF_TC_BODY(libbpfjit_abc_ja, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 3), /* min. length 4 */
+ BPF_STMT(BPF_JMP+BPF_JA, 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, UINT32_MAX - 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 2), /* min. length 6 */
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 6),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[6] = {0, 0, /* UINT32_MAX: */ 255, 255, 255, 255};
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_abc_ja_over);
+ATF_TC_HEAD(libbpfjit_abc_ja_over, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test ABC optimization when BPF_JMP+BPF_JA jumps over all loads");
+}
+
+ATF_TC_BODY(libbpfjit_abc_ja_over, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_JMP+BPF_JA, 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 3),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 4),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 5),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 6),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_MAX);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_abc_ld_chain);
+ATF_TC_HEAD(libbpfjit_abc_ld_chain, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test ABC optimization of a chain of BPF_LD instructions "
+ "with exits leading to a single BPF_RET");
+}
+
+ATF_TC_BODY(libbpfjit_abc_ld_chain, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 3), /* min. length 4 */
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 8, 0, 4),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 4), /* min. length 6 */
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 7, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 6), /* min. length 10 */
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 6, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 123456789),
+ BPF_STMT(BPF_RET+BPF_K, 987654321),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[10] = {};
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+
+ /* !(pkt[3] == 8) => return 123456789 */
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 123456789);
+
+ /* !(pkt[4:2] >= 7) => too short or return 123456789 */
+ pkt[3] = 8;
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 123456789);
+
+ /* !(pkt[6:4] > 6) => too short or return 987654321 */
+ pkt[4] = pkt[5] = 1;
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 987654321);
+
+ /* (pkt[6:4] > 6) => too short or return 123456789 */
+ pkt[6] = pkt[7] = pkt[8] = pkt[9] = 1;
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 123456789);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_examples_1);
+ATF_TC_HEAD(libbpfjit_examples_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test the first example from bpf(4) - "
+ "accept Reverse ARP requests");
+}
+
+ATF_TC_BODY(libbpfjit_examples_1, tc)
+{
+ /*
+ * The following filter is taken from the Reverse ARP
+ * Daemon. It accepts only Reverse ARP requests.
+ */
+ struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8035, 0, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 20),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 3, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 42),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[22] = {};
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+
+ /* The packet doesn't match. */
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+
+ /* Still no match after setting the protocol field. */
+ pkt[12] = 0x80; pkt[13] = 0x35;
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+
+ /* Set RARP message type. */
+ pkt[21] = 3;
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 42);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+
+ /* Change RARP message type. */
+ pkt[20] = 3;
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_examples_2);
+ATF_TC_HEAD(libbpfjit_examples_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test the second example from bpf(4) - "
+ "accept IP packets between two specified hosts");
+}
+
+ATF_TC_BODY(libbpfjit_examples_2, tc)
+{
+ /*
+ * This filter accepts only IP packets between host 128.3.112.15
+ * and 128.3.112.35.
+ */
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x0800, 0, 8),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 4),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[34] = {};
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+ ATF_CHECK(jitcall(code, pkt, 23, 23) == 0);
+ ATF_CHECK(jitcall(code, pkt, 24, 24) == 0);
+ ATF_CHECK(jitcall(code, pkt, 25, 25) == 0);
+ ATF_CHECK(jitcall(code, pkt, 26, 26) == 0);
+ ATF_CHECK(jitcall(code, pkt, 27, 27) == 0);
+ ATF_CHECK(jitcall(code, pkt, 28, 28) == 0);
+ ATF_CHECK(jitcall(code, pkt, 29, 29) == 0);
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+ ATF_CHECK(jitcall(code, pkt, 31, 31) == 0);
+ ATF_CHECK(jitcall(code, pkt, 32, 32) == 0);
+ ATF_CHECK(jitcall(code, pkt, 33, 33) == 0);
+
+ /* The packet doesn't match. */
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ /* Still no match after setting the protocol field. */
+ pkt[12] = 8;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ pkt[26] = 128; pkt[27] = 3; pkt[28] = 112; pkt[29] = 15;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ pkt[30] = 128; pkt[31] = 3; pkt[32] = 112; pkt[33] = 35;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == UINT32_MAX);
+
+ /* Swap the ip addresses. */
+ pkt[26] = 128; pkt[27] = 3; pkt[28] = 112; pkt[29] = 35;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ pkt[30] = 128; pkt[31] = 3; pkt[32] = 112; pkt[33] = 15;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == UINT32_MAX);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+ ATF_CHECK(jitcall(code, pkt, 23, 23) == 0);
+ ATF_CHECK(jitcall(code, pkt, 24, 24) == 0);
+ ATF_CHECK(jitcall(code, pkt, 25, 25) == 0);
+ ATF_CHECK(jitcall(code, pkt, 26, 26) == 0);
+ ATF_CHECK(jitcall(code, pkt, 27, 27) == 0);
+ ATF_CHECK(jitcall(code, pkt, 28, 28) == 0);
+ ATF_CHECK(jitcall(code, pkt, 29, 29) == 0);
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+ ATF_CHECK(jitcall(code, pkt, 31, 31) == 0);
+ ATF_CHECK(jitcall(code, pkt, 32, 32) == 0);
+ ATF_CHECK(jitcall(code, pkt, 33, 33) == 0);
+
+ /* Change the protocol field. */
+ pkt[13] = 8;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_examples_3);
+ATF_TC_HEAD(libbpfjit_examples_3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test the third example from bpf(4) - "
+ "accept TCP finger packets");
+}
+
+ATF_TC_BODY(libbpfjit_examples_3, tc)
+{
+ /*
+ * This filter returns only TCP finger packets.
+ */
+ struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x0800, 0, 10),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 23),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 6, 0, 8),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 20),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x1fff, 6, 0),
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 14),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 14),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 79, 2, 0),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 16),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 79, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[30] = {};
+
+ /* Set IP fragment offset to non-zero. */
+ pkt[20] = 1; pkt[21] = 1;
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+ ATF_CHECK(jitcall(code, pkt, 23, 23) == 0);
+ ATF_CHECK(jitcall(code, pkt, 24, 24) == 0);
+ ATF_CHECK(jitcall(code, pkt, 25, 25) == 0);
+ ATF_CHECK(jitcall(code, pkt, 26, 26) == 0);
+ ATF_CHECK(jitcall(code, pkt, 27, 27) == 0);
+ ATF_CHECK(jitcall(code, pkt, 28, 28) == 0);
+ ATF_CHECK(jitcall(code, pkt, 29, 29) == 0);
+
+ /* The packet doesn't match. */
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Still no match after setting the protocol field. */
+ pkt[12] = 8;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Get one step closer to the match. */
+ pkt[23] = 6;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Set IP fragment offset to zero. */
+ pkt[20] = 0x20; pkt[21] = 0;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Set IP header length to 12. */
+ pkt[14] = 0xd3;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Match one branch of the program. */
+ pkt[27] = 79;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == UINT32_MAX);
+
+ /* Match the other branch of the program. */
+ pkt[29] = 79; pkt[27] = 0;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == UINT32_MAX);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+ ATF_CHECK(jitcall(code, pkt, 23, 23) == 0);
+ ATF_CHECK(jitcall(code, pkt, 24, 24) == 0);
+ ATF_CHECK(jitcall(code, pkt, 25, 25) == 0);
+ ATF_CHECK(jitcall(code, pkt, 26, 26) == 0);
+ ATF_CHECK(jitcall(code, pkt, 27, 27) == 0);
+ ATF_CHECK(jitcall(code, pkt, 28, 28) == 0);
+ ATF_CHECK(jitcall(code, pkt, 29, 29) == 0);
+
+ /* Set IP header length to 16. Packet is too short. */
+ pkt[14] = 4;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_cop_no_ctx);
+ATF_TC_HEAD(libbpfjit_cop_no_ctx, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that BPF_MISC|BPF_COP "
+ "instruction can't be accepted without a context");
+}
+
+ATF_TC_BODY(libbpfjit_cop_no_ctx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_MISC+BPF_COP, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(!bpf_validate(insns, insn_count));
+
+ ATF_CHECK(bpfjit_generate_code(NULL, insns, insn_count) == NULL);
+}
+
+ATF_TC(libbpfjit_copx_no_ctx);
+ATF_TC_HEAD(libbpfjit_copx_no_ctx, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that BPF_MISC|BPF_COPX "
+ "instruction can't be accepted without a context");
+}
+
+ATF_TC_BODY(libbpfjit_copx_no_ctx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(!bpf_validate(insns, insn_count));
+
+ ATF_CHECK(bpfjit_generate_code(NULL, insns, insn_count) == NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * For every new test please also add a similar test
+ * to ../../net/bpfjit/t_bpfjit.c
+ */
+ ATF_TP_ADD_TC(tp, libbpfjit_empty);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_add_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_sub_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_mul_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div0_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div1_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div2_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div4_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div10_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div10000_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div7609801_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div80000000_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_and_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_or_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_lsh_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_lsh0_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_rsh_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_rsh0_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_modulo_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_add_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_sub_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_mul_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div0_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div1_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div2_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div4_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div10_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div10000_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div7609801_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_div80000000_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_and_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_or_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_lsh_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_lsh0_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_rsh_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_rsh0_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_modulo_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_alu_neg);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_ja);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_jgt_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_jge_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_jeq_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_jset_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_modulo_k);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_jgt_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_jge_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_jeq_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_jset_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_jmp_modulo_x);
+ ATF_TP_ADD_TC(tp, libbpfjit_ld_abs);
+ ATF_TP_ADD_TC(tp, libbpfjit_ld_abs_k_overflow);
+ ATF_TP_ADD_TC(tp, libbpfjit_ld_ind);
+ ATF_TP_ADD_TC(tp, libbpfjit_ld_ind_k_overflow);
+ ATF_TP_ADD_TC(tp, libbpfjit_ld_ind_x_overflow1);
+ ATF_TP_ADD_TC(tp, libbpfjit_ld_ind_x_overflow2);
+ ATF_TP_ADD_TC(tp, libbpfjit_ld_len);
+ ATF_TP_ADD_TC(tp, libbpfjit_ld_imm);
+ ATF_TP_ADD_TC(tp, libbpfjit_ldx_imm1);
+ ATF_TP_ADD_TC(tp, libbpfjit_ldx_imm2);
+ ATF_TP_ADD_TC(tp, libbpfjit_ldx_len1);
+ ATF_TP_ADD_TC(tp, libbpfjit_ldx_len2);
+ ATF_TP_ADD_TC(tp, libbpfjit_ldx_msh);
+ ATF_TP_ADD_TC(tp, libbpfjit_misc_tax);
+ ATF_TP_ADD_TC(tp, libbpfjit_misc_txa);
+ ATF_TP_ADD_TC(tp, libbpfjit_st1);
+ ATF_TP_ADD_TC(tp, libbpfjit_st2);
+ ATF_TP_ADD_TC(tp, libbpfjit_st3);
+ ATF_TP_ADD_TC(tp, libbpfjit_st4);
+ ATF_TP_ADD_TC(tp, libbpfjit_st5);
+ ATF_TP_ADD_TC(tp, libbpfjit_stx1);
+ ATF_TP_ADD_TC(tp, libbpfjit_stx2);
+ ATF_TP_ADD_TC(tp, libbpfjit_stx3);
+ ATF_TP_ADD_TC(tp, libbpfjit_stx4);
+ ATF_TP_ADD_TC(tp, libbpfjit_opt_ld_abs_1);
+ ATF_TP_ADD_TC(tp, libbpfjit_opt_ld_abs_2);
+ ATF_TP_ADD_TC(tp, libbpfjit_opt_ld_abs_3);
+ ATF_TP_ADD_TC(tp, libbpfjit_opt_ld_ind_1);
+ ATF_TP_ADD_TC(tp, libbpfjit_opt_ld_ind_2);
+ ATF_TP_ADD_TC(tp, libbpfjit_opt_ld_ind_3);
+ ATF_TP_ADD_TC(tp, libbpfjit_opt_ld_ind_4);
+ ATF_TP_ADD_TC(tp, libbpfjit_abc_ja);
+ ATF_TP_ADD_TC(tp, libbpfjit_abc_ja_over);
+ ATF_TP_ADD_TC(tp, libbpfjit_abc_ld_chain);
+ ATF_TP_ADD_TC(tp, libbpfjit_examples_1);
+ ATF_TP_ADD_TC(tp, libbpfjit_examples_2);
+ ATF_TP_ADD_TC(tp, libbpfjit_examples_3);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_no_ctx);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_no_ctx);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libbpfjit/t_cop.c b/contrib/netbsd-tests/lib/libbpfjit/t_cop.c
new file mode 100644
index 0000000..7b3b086
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbpfjit/t_cop.c
@@ -0,0 +1,657 @@
+/* $NetBSD: t_cop.c,v 1.4 2014/07/13 21:35:33 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2013-2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_cop.c,v 1.4 2014/07/13 21:35:33 alnsn Exp $");
+
+#include <atf-c.h>
+#include <stdint.h>
+#include <string.h>
+
+#define __BPF_PRIVATE
+#include <net/bpf.h>
+#include <net/bpfjit.h>
+
+static uint32_t retA(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+static uint32_t retBL(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+static uint32_t retWL(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+static uint32_t retNF(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+static uint32_t setARG(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+
+static const bpf_copfunc_t copfuncs[] = {
+ &retA,
+ &retBL,
+ &retWL,
+ &retNF,
+ &setARG
+};
+
+static const bpf_ctx_t ctx = {
+ .copfuncs = copfuncs,
+ .nfuncs = sizeof(copfuncs) / sizeof(copfuncs[0]),
+ .extwords = 0
+};
+
+static uint32_t
+retA(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return A;
+}
+
+static uint32_t
+retBL(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return args->buflen;
+}
+
+static uint32_t
+retWL(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return args->wirelen;
+}
+
+static uint32_t
+retNF(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return bc->nfuncs;
+}
+
+/*
+ * COP function with a side effect.
+ */
+static uint32_t
+setARG(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+ bool *arg = (bool *)args->arg;
+ bool old = *arg;
+
+ *arg = true;
+ return old;
+}
+
+ATF_TC(libbpfjit_cop_no_ctx);
+ATF_TC_HEAD(libbpfjit_cop_no_ctx, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that bpf program with BPF_COP "
+ "instruction isn't valid without a context");
+}
+
+ATF_TC_BODY(libbpfjit_cop_no_ctx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_MISC+BPF_COP, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ bpfjit_func_t code;
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(!bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TC(libbpfjit_cop_ret_A);
+ATF_TC_HEAD(libbpfjit_cop_ret_A, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns a content of the A register");
+}
+
+ATF_TC_BODY(libbpfjit_cop_ret_A, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 0), // retA
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 13);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_cop_ret_buflen);
+ATF_TC_HEAD(libbpfjit_cop_ret_buflen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns the buflen argument");
+}
+
+ATF_TC_BODY(libbpfjit_cop_ret_buflen, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 1), // retBL
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == sizeof(pkt));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_cop_ret_wirelen);
+ATF_TC_HEAD(libbpfjit_cop_ret_wirelen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns the wirelen argument");
+}
+
+ATF_TC_BODY(libbpfjit_cop_ret_wirelen, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 2), // retWL
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == sizeof(pkt));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_cop_ret_nfuncs);
+ATF_TC_HEAD(libbpfjit_cop_ret_nfuncs, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns nfuncs member of the context argument");
+}
+
+ATF_TC_BODY(libbpfjit_cop_ret_nfuncs, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 3), // retNF
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == ctx.nfuncs);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_cop_side_effect);
+ATF_TC_HEAD(libbpfjit_cop_side_effect, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that ABC optimization doesn't skip BPF_COP call");
+}
+
+ATF_TC_BODY(libbpfjit_cop_side_effect, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0),
+ BPF_STMT(BPF_MISC+BPF_COP, 4), // setARG
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 99999),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ bool arg = false;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = NULL,
+ .arg = &arg
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+ ATF_CHECK(arg == true);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_cop_copx);
+ATF_TC_HEAD(libbpfjit_cop_copx, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test BPF_COP call followed by BPF_COPX call");
+}
+
+ATF_TC_BODY(libbpfjit_cop_copx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1), /* A <- 1 */
+ BPF_STMT(BPF_MISC+BPF_COP, 0), /* retA */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0), /* A = P[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+ BPF_STMT(BPF_MISC+BPF_COPX, 0), /* retNF */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 2 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3 + ctx.nfuncs);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_cop_invalid_index);
+ATF_TC_HEAD(libbpfjit_cop_invalid_index, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that out-of-range coprocessor function fails validation");
+}
+
+ATF_TC_BODY(libbpfjit_cop_invalid_index, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 6), // invalid index
+ BPF_STMT(BPF_RET+BPF_K, 27)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpfjit_generate_code(&ctx, insns, insn_count) == NULL);
+}
+
+ATF_TC(libbpfjit_copx_no_ctx);
+ATF_TC_HEAD(libbpfjit_copx_no_ctx, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that bpf program with BPF_COPX "
+ "instruction isn't valid without a context");
+}
+
+ATF_TC_BODY(libbpfjit_copx_no_ctx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_MISC+BPF_COP, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ bpfjit_func_t code;
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(!bpf_validate(insns, insn_count));
+
+ code = bpfjit_generate_code(NULL, insns, insn_count);
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TC(libbpfjit_copx_ret_A);
+ATF_TC_HEAD(libbpfjit_copx_ret_A, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns a content of the A register");
+}
+
+ATF_TC_BODY(libbpfjit_copx_ret_A, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LDX+BPF_IMM, 0), // retA
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 13);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_copx_ret_buflen);
+ATF_TC_HEAD(libbpfjit_copx_ret_buflen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns the buflen argument");
+}
+
+ATF_TC_BODY(libbpfjit_copx_ret_buflen, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LDX+BPF_IMM, 1), // retBL
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == sizeof(pkt));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_copx_ret_wirelen);
+ATF_TC_HEAD(libbpfjit_copx_ret_wirelen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns the wirelen argument");
+}
+
+ATF_TC_BODY(libbpfjit_copx_ret_wirelen, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_IMM, 2), // retWL
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == sizeof(pkt));
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_copx_ret_nfuncs);
+ATF_TC_HEAD(libbpfjit_copx_ret_nfuncs, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns nfuncs member of the context argument");
+}
+
+ATF_TC_BODY(libbpfjit_copx_ret_nfuncs, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LDX+BPF_IMM, 3), // retNF
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == ctx.nfuncs);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_copx_side_effect);
+ATF_TC_HEAD(libbpfjit_copx_side_effect, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that ABC optimization doesn't skip BPF_COPX call");
+}
+
+ATF_TC_BODY(libbpfjit_copx_side_effect, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0),
+ BPF_STMT(BPF_LDX+BPF_IMM, 4), // setARG
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 99999),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ bool arg = false;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = NULL,
+ .arg = &arg
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+ ATF_CHECK(arg == true);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_copx_cop);
+ATF_TC_HEAD(libbpfjit_copx_cop, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test BPF_COPX call followed by BPF_COP call");
+}
+
+ATF_TC_BODY(libbpfjit_copx_cop, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_IMM, 2), /* X <- 2 */
+ BPF_STMT(BPF_MISC+BPF_COPX, 0), /* retWL */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0), /* A = P[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+ BPF_STMT(BPF_MISC+BPF_COP, 3), /* retNF */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 2 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 5 + ctx.nfuncs);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_copx_invalid_index);
+ATF_TC_HEAD(libbpfjit_copx_invalid_index, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that out-of-range BPF_COPX call fails at runtime");
+}
+
+ATF_TC_BODY(libbpfjit_copx_invalid_index, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_IMM, 5), // invalid index
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_K, 27)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * For every new test please also add a similar test
+ * to ../../net/bpfjit/t_cop.c
+ */
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_no_ctx);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_ret_A);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_ret_buflen);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_ret_wirelen);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_ret_nfuncs);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_side_effect);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_copx);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_invalid_index);
+
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_no_ctx);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_ret_A);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_ret_buflen);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_ret_wirelen);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_ret_nfuncs);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_side_effect);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_cop);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_invalid_index);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libbpfjit/t_extmem.c b/contrib/netbsd-tests/lib/libbpfjit/t_extmem.c
new file mode 100644
index 0000000..ab6ea88
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libbpfjit/t_extmem.c
@@ -0,0 +1,483 @@
+/* $NetBSD: t_extmem.c,v 1.3 2014/07/14 19:11:15 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_extmem.c,v 1.3 2014/07/14 19:11:15 alnsn Exp $");
+
+#include <atf-c.h>
+#include <stdint.h>
+#include <string.h>
+
+#define __BPF_PRIVATE
+#include <net/bpf.h>
+#include <net/bpfjit.h>
+
+static uint32_t retM(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+
+static const bpf_copfunc_t copfuncs[] = {
+ &retM
+};
+
+static const bpf_ctx_t ctx = {
+ .copfuncs = copfuncs,
+ .nfuncs = sizeof(copfuncs) / sizeof(copfuncs[0]),
+ .extwords = 4,
+ .preinited = BPF_MEMWORD_INIT(0) | BPF_MEMWORD_INIT(3),
+};
+
+static uint32_t
+retM(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return args->mem[(uintptr_t)args->arg];
+}
+
+
+ATF_TC(libbpfjit_extmem_load_default);
+ATF_TC_HEAD(libbpfjit_extmem_load_default, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that external memory "
+ "is zero initialized by default");
+}
+
+ATF_TC_BODY(libbpfjit_extmem_load_default, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_MEM, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_extmem_load_preinited);
+ATF_TC_HEAD(libbpfjit_extmem_load_preinited, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test a load of external "
+ "pre-initialized memory");
+}
+
+ATF_TC_BODY(libbpfjit_extmem_load_preinited, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_MEM, 3),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_extmem_invalid_load);
+ATF_TC_HEAD(libbpfjit_extmem_invalid_load, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that out-of-range load "
+ "fails validation");
+}
+
+ATF_TC_BODY(libbpfjit_extmem_invalid_load, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_MEM, 4),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpfjit_generate_code(&ctx, insns, insn_count) == NULL);
+}
+
+ATF_TC(libbpfjit_extmem_store);
+ATF_TC_HEAD(libbpfjit_extmem_store, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test stores to external memory");
+}
+
+ATF_TC_BODY(libbpfjit_extmem_store, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1), /* A <- 1 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2), /* X <- 2 */
+ BPF_STMT(BPF_ST, 1), /* M[1] <- A */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_STX, 2), /* M[2] <- X */
+ BPF_STMT(BPF_ST, 3), /* M[3] <- A */
+ BPF_STMT(BPF_RET+BPF_A, 0) /* ret A */
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 7;
+
+ mem[1] = mem[2] = 0xdeadbeef;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3);
+
+ bpfjit_free_code(code);
+
+ ATF_CHECK(mem[0] == 0);
+ ATF_CHECK(mem[1] == 1);
+ ATF_CHECK(mem[2] == 2);
+ ATF_CHECK(mem[3] == 3);
+}
+
+ATF_TC(libbpfjit_extmem_side_effect);
+ATF_TC_HEAD(libbpfjit_extmem_side_effect, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that ABC optimization doesn\'t "
+ "skip stores to external memory");
+}
+
+ATF_TC_BODY(libbpfjit_extmem_side_effect, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0), /* A <- P[0] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2), /* X <- 2 */
+ BPF_STMT(BPF_ST, 1), /* M[1] <- A */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_STX, 2), /* M[2] <- X */
+ BPF_STMT(BPF_ST, 3), /* M[3] <- A */
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 99), /* A <- P[99] */
+ BPF_STMT(BPF_RET+BPF_A, 0) /* ret A */
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 1 };
+ uint32_t mem[ctx.extwords];
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 7;
+
+ mem[1] = mem[2] = 0xdeadbeef;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+
+ bpfjit_free_code(code);
+
+ ATF_CHECK(mem[0] == 0);
+ ATF_CHECK(mem[1] == 1);
+ ATF_CHECK(mem[2] == 2);
+ ATF_CHECK(mem[3] == 3);
+}
+
+ATF_TC(libbpfjit_extmem_invalid_store);
+ATF_TC_HEAD(libbpfjit_extmem_invalid_store, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that out-of-range store "
+ "fails validation");
+}
+
+ATF_TC_BODY(libbpfjit_extmem_invalid_store, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_ST, 4),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_CHECK(bpfjit_generate_code(&ctx, insns, insn_count) == NULL);
+}
+
+ATF_TC(libbpfjit_cop_ret_mem);
+ATF_TC_HEAD(libbpfjit_cop_ret_mem, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns a content of external memory word");
+}
+
+ATF_TC_BODY(libbpfjit_cop_ret_mem, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_ST, 2),
+ BPF_STMT(BPF_LD+BPF_IMM, 137),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_MISC+BPF_COP, 0), // retM
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+ void *arg = (void*)(uintptr_t)2;
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .arg = arg,
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 13);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_cop_ret_preinited_mem);
+ATF_TC_HEAD(libbpfjit_cop_ret_preinited_mem, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function that "
+ "returns a content of external pre-initialized memory word");
+}
+
+ATF_TC_BODY(libbpfjit_cop_ret_preinited_mem, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_ST, 2),
+ BPF_STMT(BPF_LD+BPF_IMM, 137),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_MISC+BPF_COP, 0), // retM
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+ void *arg = (void*)(uintptr_t)3;
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .arg = arg,
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_copx_ret_mem);
+ATF_TC_HEAD(libbpfjit_copx_ret_mem, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns a content of external memory word");
+}
+
+ATF_TC_BODY(libbpfjit_copx_ret_mem, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_ST, 2),
+ BPF_STMT(BPF_LD+BPF_IMM, 137),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_LDX+BPF_IMM, 0), // retM
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+ void *arg = (void*)(uintptr_t)2;
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .arg = arg,
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 13);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TC(libbpfjit_copx_ret_preinited_mem);
+ATF_TC_HEAD(libbpfjit_copx_ret_preinited_mem, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function that "
+ "returns a content of external pre-initialized memory word");
+}
+
+ATF_TC_BODY(libbpfjit_copx_ret_preinited_mem, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_ST, 2),
+ BPF_STMT(BPF_LD+BPF_IMM, 137),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_LDX+BPF_IMM, 0), // retM
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+ void *arg = (void*)(uintptr_t)3;
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .arg = arg,
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ code = bpfjit_generate_code(&ctx, insns, insn_count);
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3);
+
+ bpfjit_free_code(code);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * For every new test please also add a similar test
+ * to ../../net/bpfjit/t_extmem.c
+ */
+ ATF_TP_ADD_TC(tp, libbpfjit_extmem_load_default);
+ ATF_TP_ADD_TC(tp, libbpfjit_extmem_load_preinited);
+ ATF_TP_ADD_TC(tp, libbpfjit_extmem_invalid_load);
+ ATF_TP_ADD_TC(tp, libbpfjit_extmem_store);
+ ATF_TP_ADD_TC(tp, libbpfjit_extmem_side_effect);
+ ATF_TP_ADD_TC(tp, libbpfjit_extmem_invalid_store);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_ret_mem);
+ ATF_TP_ADD_TC(tp, libbpfjit_cop_ret_preinited_mem);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_ret_mem);
+ ATF_TP_ADD_TC(tp, libbpfjit_copx_ret_preinited_mem);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/aarch64/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/aarch64/exec_prot_support.c
new file mode 100644
index 0000000..56a1be8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/aarch64/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2014/08/10 05:47:38 matt Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2014/08/10 05:47:38 matt Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/aarch64/return_one.S b/contrib/netbsd-tests/lib/libc/arch/aarch64/return_one.S
new file mode 100644
index 0000000..d237982
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/aarch64/return_one.S
@@ -0,0 +1,10 @@
+/* $NetBSD: return_one.S,v 1.1 2014/08/10 05:47:38 matt Exp $ */
+
+#include <machine/asm.h>
+
+ENTRY_NP(return_one)
+ mov x0, #1
+ ret
+ .globl return_one_end
+return_one_end:
+END(return_one)
diff --git a/contrib/netbsd-tests/lib/libc/arch/alpha/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/alpha/exec_prot_support.c
new file mode 100644
index 0000000..ba1cd8b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/alpha/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/alpha/return_one.S b/contrib/netbsd-tests/lib/libc/arch/alpha/return_one.S
new file mode 100644
index 0000000..5308876
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/alpha/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/arm/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/arm/exec_prot_support.c
new file mode 100644
index 0000000..ba1cd8b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/arm/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/arm/return_one.S b/contrib/netbsd-tests/lib/libc/arch/arm/return_one.S
new file mode 100644
index 0000000..18800e2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/arm/return_one.S
@@ -0,0 +1,11 @@
+/* $NetBSD: return_one.S,v 1.2 2014/01/26 20:42:06 matt Exp $ */
+
+#include <machine/asm.h>
+
+ENTRY_NP(return_one)
+ mov r0, #1
+ RET
+ .align 0
+ .globl return_one_end
+return_one_end:
+END(return_one)
diff --git a/contrib/netbsd-tests/lib/libc/arch/hppa/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/hppa/exec_prot_support.c
new file mode 100644
index 0000000..ba1cd8b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/hppa/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/hppa/return_one.S b/contrib/netbsd-tests/lib/libc/arch/hppa/return_one.S
new file mode 100644
index 0000000..5308876
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/hppa/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/i386/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/i386/exec_prot_support.c
new file mode 100644
index 0000000..11a20f5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/i386/exec_prot_support.c
@@ -0,0 +1,65 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $");
+
+#include <stdlib.h>
+#include <sys/sysctl.h>
+
+#include "../../common/exec_prot.h"
+
+/*
+ * Support for executable space protection has always been erratic under i386.
+ * Originally IA-32 can't do per-page execute permission, so it is
+ * implemented using different executable segments for %cs (code segment).
+ * This only allows coarse grained protection, especially when memory starts
+ * being fragmented.
+ * Later, PAE was introduced together with a NX/XD bit in the page table
+ * entry to offer per-page permission.
+ */
+int
+exec_prot_support(void)
+{
+ int pae;
+ size_t pae_len = sizeof(pae);
+
+ if (sysctlbyname("machdep.pae", &pae, &pae_len, NULL, 0) == -1)
+ return PARTIAL_XP;
+
+ if (pae == 1) {
+ if (system("cpuctl identify 0 | grep -q NOX") == 0 ||
+ system("cpuctl identify 0 | grep -q XD") == 0)
+ return PERPAGE_XP;
+ }
+
+ return PARTIAL_XP;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/i386/return_one.S b/contrib/netbsd-tests/lib/libc/arch/i386/return_one.S
new file mode 100644
index 0000000..f80fd74
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/i386/return_one.S
@@ -0,0 +1,10 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: return_one.S,v 1.1 2011/07/18 23:16:09 jym Exp $");
+
+_ENTRY(return_one)
+ movl $0x1,%eax
+ ret
+LABEL(return_one_end)
diff --git a/contrib/netbsd-tests/lib/libc/arch/ia64/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/ia64/exec_prot_support.c
new file mode 100644
index 0000000..ba1cd8b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/ia64/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S b/contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S
new file mode 100644
index 0000000..5308876
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/m68k/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/m68k/exec_prot_support.c
new file mode 100644
index 0000000..ba1cd8b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/m68k/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:09 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/m68k/return_one.S b/contrib/netbsd-tests/lib/libc/arch/m68k/return_one.S
new file mode 100644
index 0000000..5308876
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/m68k/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/mips/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/mips/exec_prot_support.c
new file mode 100644
index 0000000..474cfc7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/mips/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/mips/return_one.S b/contrib/netbsd-tests/lib/libc/arch/mips/return_one.S
new file mode 100644
index 0000000..3495260
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/mips/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/or1k/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/or1k/exec_prot_support.c
new file mode 100644
index 0000000..623456b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/or1k/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2014/09/03 19:34:26 matt Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2014/09/03 19:34:26 matt Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return PERPAGE_XP;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/or1k/return_one.S b/contrib/netbsd-tests/lib/libc/arch/or1k/return_one.S
new file mode 100644
index 0000000..ba3d678
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/or1k/return_one.S
@@ -0,0 +1,12 @@
+/* $NetBSD: return_one.S,v 1.1 2014/09/03 19:34:26 matt Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end
+
+ENTRY_NP(return_one)
+ l.addi r11, r0, 1
+ l.jr lr
+ l.nop
+return_one_end:
+END(return_one)
diff --git a/contrib/netbsd-tests/lib/libc/arch/powerpc/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/powerpc/exec_prot_support.c
new file mode 100644
index 0000000..81c1d86
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/powerpc/exec_prot_support.c
@@ -0,0 +1,52 @@
+/* $NetBSD: exec_prot_support.c,v 1.2 2012/03/16 08:51:47 matt Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.2 2012/03/16 08:51:47 matt Exp $");
+
+#include "../../common/exec_prot.h"
+
+#include <sys/sysctl.h>
+
+int
+exec_prot_support(void)
+{
+ int execprot = 0;
+ size_t len = sizeof(execprot);
+
+ if (sysctlbyname("machdep.execprot", &execprot, &len, NULL, 0) < 0)
+ return NOTIMPL;
+
+ if (execprot)
+ return PERPAGE_XP;
+
+ return NO_XP;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S b/contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S
new file mode 100644
index 0000000..d40298e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S
@@ -0,0 +1,11 @@
+/* $NetBSD: return_one.S,v 1.2 2012/03/16 08:51:47 matt Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end
+
+_ENTRY(return_one)
+ li %r3, 1
+ blr
+return_one_end:
+END(return_one)
diff --git a/contrib/netbsd-tests/lib/libc/arch/powerpc64/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/powerpc64/exec_prot_support.c
new file mode 100644
index 0000000..474cfc7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/powerpc64/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/powerpc64/return_one.S b/contrib/netbsd-tests/lib/libc/arch/powerpc64/return_one.S
new file mode 100644
index 0000000..3495260
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/powerpc64/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/riscv/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/riscv/exec_prot_support.c
new file mode 100644
index 0000000..91c5ff4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/riscv/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2014/09/19 17:36:26 matt Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2014/09/19 17:36:26 matt Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return PERPAGE_XP;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S b/contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S
new file mode 100644
index 0000000..43ddd2c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S
@@ -0,0 +1,11 @@
+/* $NetBSD: return_one.S,v 1.1 2014/09/19 17:36:26 matt Exp $ */
+
+#include <machine/asm.h>
+
+ .globl return_one_end
+
+ENTRY_NP(return_one)
+ li v0, 1
+ ret
+return_one_end:
+END(return_one)
diff --git a/contrib/netbsd-tests/lib/libc/arch/sh3/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/sh3/exec_prot_support.c
new file mode 100644
index 0000000..474cfc7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/sh3/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/sh3/return_one.S b/contrib/netbsd-tests/lib/libc/arch/sh3/return_one.S
new file mode 100644
index 0000000..3495260
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/sh3/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/sparc/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/sparc/exec_prot_support.c
new file mode 100644
index 0000000..474cfc7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/sparc/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/sparc/return_one.S b/contrib/netbsd-tests/lib/libc/arch/sparc/return_one.S
new file mode 100644
index 0000000..3495260
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/sparc/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/sparc64/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/sparc64/exec_prot_support.c
new file mode 100644
index 0000000..474cfc7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/sparc64/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/sparc64/return_one.S b/contrib/netbsd-tests/lib/libc/arch/sparc64/return_one.S
new file mode 100644
index 0000000..3495260
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/sparc64/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/vax/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/vax/exec_prot_support.c
new file mode 100644
index 0000000..474cfc7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/vax/exec_prot_support.c
@@ -0,0 +1,41 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
+
+#include "../../common/exec_prot.h"
+
+int
+exec_prot_support(void)
+{
+ return NOTIMPL;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/vax/return_one.S b/contrib/netbsd-tests/lib/libc/arch/vax/return_one.S
new file mode 100644
index 0000000..3495260
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/vax/return_one.S
@@ -0,0 +1,8 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+
+#include <machine/asm.h>
+
+.globl return_one, return_one_end;
+
+return_one: return_one_end:
+ nop
diff --git a/contrib/netbsd-tests/lib/libc/arch/x86_64/exec_prot_support.c b/contrib/netbsd-tests/lib/libc/arch/x86_64/exec_prot_support.c
new file mode 100644
index 0000000..2d8363d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/x86_64/exec_prot_support.c
@@ -0,0 +1,50 @@
+/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:11 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:11 jym Exp $");
+
+#include <stdlib.h>
+
+#include "../../common/exec_prot.h"
+
+/*
+ * When the NX/XD flag is present, the protection should be enabled.
+ */
+int
+exec_prot_support(void)
+{
+ if (system("cpuctl identify 0 | grep -q NOX") == 0 ||
+ system("cpuctl identify 0 | grep -q XD") == 0)
+ return PERPAGE_XP;
+
+ return NO_XP;
+}
diff --git a/contrib/netbsd-tests/lib/libc/arch/x86_64/return_one.S b/contrib/netbsd-tests/lib/libc/arch/x86_64/return_one.S
new file mode 100644
index 0000000..0903001
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/arch/x86_64/return_one.S
@@ -0,0 +1,10 @@
+/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:11 jym Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: return_one.S,v 1.1 2011/07/18 23:16:11 jym Exp $");
+
+_ENTRY(return_one)
+ movq $0x1, %rax
+ retq
+LABEL(return_one_end)
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c
new file mode 100644
index 0000000..c9e0cc8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c
@@ -0,0 +1,185 @@
+/* $NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+#define DIR "dir"
+#define FILE "dir/faccessat"
+#define BASEFILE "faccessat"
+#define LINK "dir/symlink"
+#define BASELINK "symlink"
+#define FILEERR "dir/faccessaterr"
+
+ATF_TC(faccessat_fd);
+ATF_TC_HEAD(faccessat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that faccessat works with fd");
+}
+ATF_TC_BODY(faccessat_fd, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, F_OK, 0) == 0);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(faccessat_fdcwd);
+ATF_TC_HEAD(faccessat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that faccessat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(faccessat_fdcwd, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(chdir(DIR) == 0);
+ ATF_REQUIRE(faccessat(AT_FDCWD, BASEFILE, F_OK, 0) == 0);
+}
+
+ATF_TC(faccessat_fdcwderr);
+ATF_TC_HEAD(faccessat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that faccessat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(faccessat_fdcwderr, tc)
+{
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(faccessat(AT_FDCWD, FILEERR, F_OK, 0) == -1);
+}
+
+ATF_TC(faccessat_fderr1);
+ATF_TC_HEAD(faccessat_fderr1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that faccessat fail with bad path");
+}
+ATF_TC_BODY(faccessat_fderr1, tc)
+{
+ int dfd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(faccessat(dfd, FILEERR, F_OK, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(faccessat_fderr2);
+ATF_TC_HEAD(faccessat_fderr2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that faccessat fails with bad fdat");
+}
+ATF_TC_BODY(faccessat_fderr2, tc)
+{
+ int dfd;
+ int fd;
+ char cwd[MAXPATHLEN];
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(getcwd(cwd, MAXPATHLEN), O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, F_OK, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(faccessat_fderr3);
+ATF_TC_HEAD(faccessat_fderr3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that faccessat fails with fd as -1");
+}
+ATF_TC_BODY(faccessat_fderr3, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(faccessat(-1, FILE, F_OK, 0) == -1);
+}
+
+ATF_TC(faccessat_fdlink);
+ATF_TC_HEAD(faccessat_fdlink, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that faccessat works on symlink");
+}
+ATF_TC_BODY(faccessat_fdlink, tc)
+{
+ int dfd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(symlink(FILE, LINK) == 0); /* NB: FILE does not exists */
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+
+ ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, 0) == -1);
+ ATF_REQUIRE(errno == ENOENT);
+
+ ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, AT_SYMLINK_NOFOLLOW) == 0);
+
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, faccessat_fd);
+ ATF_TP_ADD_TC(tp, faccessat_fdcwd);
+ ATF_TP_ADD_TC(tp, faccessat_fdcwderr);
+ ATF_TP_ADD_TC(tp, faccessat_fderr1);
+ ATF_TP_ADD_TC(tp, faccessat_fderr2);
+ ATF_TP_ADD_TC(tp, faccessat_fderr3);
+ ATF_TP_ADD_TC(tp, faccessat_fdlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c b/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c
new file mode 100644
index 0000000..462d53d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c
@@ -0,0 +1,197 @@
+/* $NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+#define DIR "dir"
+#define FILE "dir/fchmodat"
+#define BASEFILE "fchmodat"
+#define LINK "dir/symlink"
+#define BASELINK "symlink"
+#define FILEERR "dir/fchmodaterr"
+
+ATF_TC(fchmodat_fd);
+ATF_TC_HEAD(fchmodat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchmodat works with fd");
+}
+ATF_TC_BODY(fchmodat_fd, tc)
+{
+ int dfd;
+ int fd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fchmodat(dfd, BASEFILE, 0600, 0) == 0);
+ ATF_REQUIRE(close(dfd) == 0);
+
+ ATF_REQUIRE(stat(FILE, &st) == 0);
+ ATF_REQUIRE(st.st_mode = 0600);
+}
+
+ATF_TC(fchmodat_fdcwd);
+ATF_TC_HEAD(fchmodat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that fchmodat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(fchmodat_fdcwd, tc)
+{
+ int fd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(chdir(DIR) == 0);
+ ATF_REQUIRE(fchmodat(AT_FDCWD, BASEFILE, 0600, 0) == 0);
+
+ ATF_REQUIRE(stat(BASEFILE, &st) == 0);
+ ATF_REQUIRE(st.st_mode = 0600);
+}
+
+ATF_TC(fchmodat_fdcwderr);
+ATF_TC_HEAD(fchmodat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that fchmodat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(fchmodat_fdcwderr, tc)
+{
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(fchmodat(AT_FDCWD, FILEERR, 0600, 0) == -1);
+}
+
+ATF_TC(fchmodat_fderr1);
+ATF_TC_HEAD(fchmodat_fderr1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchmodat fail with bad path");
+}
+ATF_TC_BODY(fchmodat_fderr1, tc)
+{
+ int dfd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fchmodat(dfd, FILEERR, 0600, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(fchmodat_fderr2);
+ATF_TC_HEAD(fchmodat_fderr2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchmodat fails with bad fdat");
+}
+ATF_TC_BODY(fchmodat_fderr2, tc)
+{
+ int dfd;
+ int fd;
+ char cwd[MAXPATHLEN];
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(getcwd(cwd, MAXPATHLEN), O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fchmodat(dfd, BASEFILE, 0600, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(fchmodat_fderr3);
+ATF_TC_HEAD(fchmodat_fderr3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchmodat fails with fd as -1");
+}
+ATF_TC_BODY(fchmodat_fderr3, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(fchmodat(-1, FILE, 0600, 0) == -1);
+}
+
+ATF_TC(fchmodat_fdlink);
+ATF_TC_HEAD(fchmodat_fdlink, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchmodat works on symlink");
+}
+ATF_TC_BODY(fchmodat_fdlink, tc)
+{
+ int dfdlink;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(symlink(FILE, LINK) == 0);
+
+ ATF_REQUIRE((dfdlink = open(DIR, O_RDONLY, 0)) != -1);
+
+ ATF_REQUIRE(fchmodat(dfdlink, BASELINK, 0600, 0) == -1);
+ ATF_REQUIRE(errno = ENOENT);
+
+ ATF_REQUIRE(fchmodat(dfdlink, BASELINK, 0600, AT_SYMLINK_NOFOLLOW) == 0);
+
+ ATF_REQUIRE(close(dfdlink) == 0);
+
+ ATF_REQUIRE(lstat(LINK, &st) == 0);
+ ATF_REQUIRE(st.st_mode = 0600);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fchmodat_fd);
+ ATF_TP_ADD_TC(tp, fchmodat_fdcwd);
+ ATF_TP_ADD_TC(tp, fchmodat_fdcwderr);
+ ATF_TP_ADD_TC(tp, fchmodat_fderr1);
+ ATF_TP_ADD_TC(tp, fchmodat_fderr2);
+ ATF_TP_ADD_TC(tp, fchmodat_fderr3);
+ ATF_TP_ADD_TC(tp, fchmodat_fdlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_fchownat.c b/contrib/netbsd-tests/lib/libc/c063/t_fchownat.c
new file mode 100644
index 0000000..80c7606
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_fchownat.c
@@ -0,0 +1,247 @@
+/* $NetBSD: t_fchownat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fchownat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <sys/param.h>
+
+#define DIR "dir"
+#define FILE "dir/fchownat"
+#define BASEFILE "fchownat"
+#define LINK "dir/symlink"
+#define BASELINK "symlink"
+#define FILEERR "dir/fchownaterr"
+#define USER "nobody"
+
+static int getuser(uid_t *, gid_t *);
+
+static int getuser(uid_t *uid, gid_t *gid)
+{
+ struct passwd *pw;
+
+ if ((pw = getpwnam(USER)) == NULL)
+ return -1;
+
+ *uid = pw->pw_uid;
+ *gid = pw->pw_gid;
+
+ return 0;
+}
+
+ATF_TC(fchownat_fd);
+ATF_TC_HEAD(fchownat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchownat works with fd");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(fchownat_fd, tc)
+{
+ int dfd;
+ int fd;
+ uid_t uid;
+ gid_t gid;
+ struct stat st;
+
+ ATF_REQUIRE(getuser(&uid, &gid) == 0);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fchownat(dfd, BASEFILE, uid, gid, 0) == 0);
+ ATF_REQUIRE(close(dfd) == 0);
+
+ ATF_REQUIRE(stat(FILE, &st) == 0);
+ ATF_REQUIRE(st.st_uid == uid);
+ ATF_REQUIRE(st.st_gid == gid);
+}
+
+ATF_TC(fchownat_fdcwd);
+ATF_TC_HEAD(fchownat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that fchownat works with fd as AT_FDCWD");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(fchownat_fdcwd, tc)
+{
+ int fd;
+ uid_t uid;
+ gid_t gid;
+ struct stat st;
+
+ ATF_REQUIRE(getuser(&uid, &gid) == 0);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(chdir(DIR) == 0);
+ ATF_REQUIRE(fchownat(AT_FDCWD, BASEFILE, uid, gid, 0) == 0);
+
+ ATF_REQUIRE(stat(BASEFILE, &st) == 0);
+ ATF_REQUIRE(st.st_uid == uid);
+ ATF_REQUIRE(st.st_gid == gid);
+}
+
+ATF_TC(fchownat_fdcwderr);
+ATF_TC_HEAD(fchownat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that fchownat fails with fd as AT_FDCWD and bad path");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(fchownat_fdcwderr, tc)
+{
+ uid_t uid;
+ gid_t gid;
+
+ ATF_REQUIRE(getuser(&uid, &gid) == 0);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(fchownat(AT_FDCWD, FILEERR, uid, gid, 0) == -1);
+}
+
+ATF_TC(fchownat_fderr1);
+ATF_TC_HEAD(fchownat_fderr1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchownat fail with bad path");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(fchownat_fderr1, tc)
+{
+ int dfd;
+ uid_t uid;
+ gid_t gid;
+
+ ATF_REQUIRE(getuser(&uid, &gid) == 0);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fchownat(dfd, FILEERR, uid, gid, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(fchownat_fderr2);
+ATF_TC_HEAD(fchownat_fderr2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchownat fails with bad fdat");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(fchownat_fderr2, tc)
+{
+ int dfd;
+ int fd;
+ char cwd[MAXPATHLEN];
+ uid_t uid;
+ gid_t gid;
+
+ ATF_REQUIRE(getuser(&uid, &gid) == 0);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(getcwd(cwd, MAXPATHLEN), O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fchownat(dfd, BASEFILE, uid, gid, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(fchownat_fderr3);
+ATF_TC_HEAD(fchownat_fderr3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchownat fails with fd as -1");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(fchownat_fderr3, tc)
+{
+ int fd;
+ uid_t uid;
+ gid_t gid;
+
+ ATF_REQUIRE(getuser(&uid, &gid) == 0);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(fchownat(-1, FILE, uid, gid, 0) == -1);
+}
+
+ATF_TC(fchownat_fdlink);
+ATF_TC_HEAD(fchownat_fdlink, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fchownat works on symlink");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(fchownat_fdlink, tc)
+{
+ int dfd;
+ uid_t uid;
+ gid_t gid;
+ struct stat st;
+
+ ATF_REQUIRE(getuser(&uid, &gid) == 0);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(symlink(FILE, LINK) == 0); /* Target does not exists */
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+
+ ATF_REQUIRE(fchownat(dfd, BASELINK, uid, gid, 0) == -1);
+ ATF_REQUIRE(errno == ENOENT);
+
+ ATF_REQUIRE(fchownat(dfd, BASELINK, uid, gid,
+ AT_SYMLINK_NOFOLLOW) == 0);
+
+ ATF_REQUIRE(close(dfd) == 0);
+
+ ATF_REQUIRE(lstat(LINK, &st) == 0);
+ ATF_REQUIRE(st.st_uid == uid);
+ ATF_REQUIRE(st.st_gid == gid);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fchownat_fd);
+ ATF_TP_ADD_TC(tp, fchownat_fdcwd);
+ ATF_TP_ADD_TC(tp, fchownat_fdcwderr);
+ ATF_TP_ADD_TC(tp, fchownat_fderr1);
+ ATF_TP_ADD_TC(tp, fchownat_fderr2);
+ ATF_TP_ADD_TC(tp, fchownat_fderr3);
+ ATF_TP_ADD_TC(tp, fchownat_fdlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c b/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c
new file mode 100644
index 0000000..d557b00
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c
@@ -0,0 +1,94 @@
+/* $NetBSD: t_fexecve.c,v 1.2 2013/03/17 04:35:59 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fexecve.c,v 1.2 2013/03/17 04:35:59 jmmv Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+ATF_TC(fexecve);
+ATF_TC_HEAD(fexecve, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fexecve works");
+}
+ATF_TC_BODY(fexecve, tc)
+{
+ int status;
+ pid_t pid;
+ const char *const argv[] = { "touch", "test", NULL };
+ const char *const envp[] = { NULL };
+
+ ATF_REQUIRE((pid = fork()) != -1);
+ if (pid == 0) {
+ int fd;
+
+ if ((fd = open("/usr/bin/touch", O_RDONLY, 0)) == -1)
+ err(EXIT_FAILURE, "open /usr/bin/touch");
+
+ if (fexecve(fd, __UNCONST(argv), __UNCONST(envp)) == -1) {
+ int error;
+ if (errno == ENOSYS)
+ error = 76;
+ else
+ error = EXIT_FAILURE;
+ err(error, "fexecve");
+ }
+ }
+
+ ATF_REQUIRE(waitpid(pid, &status, 0) != -1);
+ if (!WIFEXITED(status))
+ atf_tc_fail("child process did not exit cleanly");
+ if (WEXITSTATUS(status) == 76)
+ atf_tc_expect_fail("fexecve not implemented");
+ else
+ ATF_REQUIRE(WEXITSTATUS(status) == EXIT_SUCCESS);
+
+ ATF_REQUIRE(access("test", F_OK) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fexecve);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_fstatat.c b/contrib/netbsd-tests/lib/libc/c063/t_fstatat.c
new file mode 100644
index 0000000..a48cd57
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_fstatat.c
@@ -0,0 +1,196 @@
+/* $NetBSD: t_fstatat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fstatat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+#define DIR "dir"
+#define FILE "dir/fstatat"
+#define BASEFILE "fstatat"
+#define LINK "dir/symlink"
+#define BASELINK "symlink"
+#define FILEERR "dir/symlink"
+
+ATF_TC(fstatat_fd);
+ATF_TC_HEAD(fstatat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fstatat works with fd");
+}
+ATF_TC_BODY(fstatat_fd, tc)
+{
+ int dfd;
+ int fd;
+ struct stat st1, st2;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fstatat(dfd, BASEFILE, &st1, 0) == 0);
+ ATF_REQUIRE(close(dfd) == 0);
+
+ ATF_REQUIRE(stat(FILE, &st2) == 0);
+ ATF_REQUIRE(memcmp(&st1, &st2, sizeof(st1)) == 0);
+}
+
+ATF_TC(fstatat_fdcwd);
+ATF_TC_HEAD(fstatat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that fstatat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(fstatat_fdcwd, tc)
+{
+ int fd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(chdir(DIR) == 0);
+ ATF_REQUIRE(fstatat(AT_FDCWD, BASEFILE, &st, 0) == 0);
+}
+
+ATF_TC(fstatat_fdcwderr);
+ATF_TC_HEAD(fstatat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that fstatat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(fstatat_fdcwderr, tc)
+{
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(fstatat(AT_FDCWD, FILEERR, &st, 0) == -1);
+}
+
+ATF_TC(fstatat_fderr1);
+ATF_TC_HEAD(fstatat_fderr1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fstatat fail with bad path");
+}
+ATF_TC_BODY(fstatat_fderr1, tc)
+{
+ int dfd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fstatat(dfd, FILEERR, &st, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(fstatat_fderr2);
+ATF_TC_HEAD(fstatat_fderr2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fstatat fails with bad fdat");
+}
+ATF_TC_BODY(fstatat_fderr2, tc)
+{
+ int dfd;
+ int fd;
+ char cwd[MAXPATHLEN];
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(getcwd(cwd, MAXPATHLEN), O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(fstatat(dfd, BASEFILE, &st, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(fstatat_fderr3);
+ATF_TC_HEAD(fstatat_fderr3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fstatat fails with fd as -1");
+}
+ATF_TC_BODY(fstatat_fderr3, tc)
+{
+ int fd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(fstatat(-1, FILE, &st, 0) == -1);
+}
+
+ATF_TC(fstatat_fdlink);
+ATF_TC_HEAD(fstatat_fdlink, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fstatat works on symlink");
+}
+ATF_TC_BODY(fstatat_fdlink, tc)
+{
+ int dfd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(symlink(FILE, LINK) == 0); /* target does not exists */
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+
+ ATF_REQUIRE(fstatat(dfd, BASELINK, &st, 0) == -1);
+ ATF_REQUIRE(errno == ENOENT);
+
+ ATF_REQUIRE(fstatat(dfd, BASELINK, &st, AT_SYMLINK_NOFOLLOW) == 0);
+
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fstatat_fd);
+ ATF_TP_ADD_TC(tp, fstatat_fdcwd);
+ ATF_TP_ADD_TC(tp, fstatat_fdcwderr);
+ ATF_TP_ADD_TC(tp, fstatat_fderr1);
+ ATF_TP_ADD_TC(tp, fstatat_fderr2);
+ ATF_TP_ADD_TC(tp, fstatat_fderr3);
+ ATF_TP_ADD_TC(tp, fstatat_fdlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_linkat.c b/contrib/netbsd-tests/lib/libc/c063/t_linkat.c
new file mode 100644
index 0000000..b49a3f0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_linkat.c
@@ -0,0 +1,217 @@
+/* $NetBSD: t_linkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_linkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#define ODIR "olddir"
+#define NDIR "newdir"
+#define FILE "olddir/old"
+#define BASEFILE "old"
+#define RELFILE "../olddir/old"
+#define TARGET "newdir/new"
+#define BASETARGET "new"
+#define LINK "olddir/symlink"
+#define BASELINK "symlink"
+#define FILEERR "olddir/olderr"
+
+ATF_TC(linkat_fd);
+ATF_TC_HEAD(linkat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that linkat works with fd");
+}
+ATF_TC_BODY(linkat_fd, tc)
+{
+ int ofd, nfd, fd;
+ struct stat ost, nst;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE((ofd = open(ODIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((nfd = open(NDIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(linkat(ofd, BASEFILE, nfd, BASETARGET, 0) == 0);
+ ATF_REQUIRE(close(ofd) == 0);
+ ATF_REQUIRE(close(nfd) == 0);
+
+ ATF_REQUIRE(stat(FILE, &ost) == 0);
+ ATF_REQUIRE(stat(TARGET, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino == nst.st_ino);
+}
+
+ATF_TC(linkat_fdcwd);
+ATF_TC_HEAD(linkat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that linkat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(linkat_fdcwd, tc)
+{
+ int fd;
+ struct stat ost, nst;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(linkat(AT_FDCWD, FILE, AT_FDCWD, TARGET, 0) == 0);
+
+ ATF_REQUIRE(stat(FILE, &ost) == 0);
+ ATF_REQUIRE(stat(TARGET, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino == nst.st_ino);
+}
+
+ATF_TC(linkat_fdcwderr);
+ATF_TC_HEAD(linkat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that linkat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(linkat_fdcwderr, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(linkat(AT_FDCWD, FILEERR, AT_FDCWD, TARGET, 0) == -1);
+}
+
+ATF_TC(linkat_fderr);
+ATF_TC_HEAD(linkat_fderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that linkat fails with fd as -1");
+}
+ATF_TC_BODY(linkat_fderr, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(linkat(-1, FILE, AT_FDCWD, TARGET, 0) == -1);
+ ATF_REQUIRE(linkat(AT_FDCWD, FILE, -1, TARGET, 0) == -1);
+ ATF_REQUIRE(linkat(-1, FILE, -1, TARGET, 0) == -1);
+}
+
+ATF_TC(linkat_fdlink1);
+ATF_TC_HEAD(linkat_fdlink1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that linkat works on symlink target");
+}
+ATF_TC_BODY(linkat_fdlink1, tc)
+{
+ int ofd, nfd, fd;
+ struct stat ost, nst;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+ ATF_REQUIRE(symlink(RELFILE, LINK) == 0);
+
+ ATF_REQUIRE((ofd = open(ODIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((nfd = open(NDIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(linkat(ofd, BASELINK, nfd, BASETARGET,
+ AT_SYMLINK_FOLLOW) == 0);
+ ATF_REQUIRE(close(ofd) == 0);
+ ATF_REQUIRE(close(nfd) == 0);
+
+ ATF_REQUIRE(lstat(LINK, &ost) == 0);
+ ATF_REQUIRE(lstat(TARGET, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino != nst.st_ino);
+
+ ATF_REQUIRE(lstat(FILE, &ost) == 0);
+ ATF_REQUIRE(lstat(TARGET, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino == nst.st_ino);
+}
+
+
+ATF_TC(linkat_fdlink2);
+ATF_TC_HEAD(linkat_fdlink2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that linkat works on symlink source");
+}
+ATF_TC_BODY(linkat_fdlink2, tc)
+{
+ int ofd, nfd, fd;
+ struct stat ost, nst;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+ ATF_REQUIRE(symlink(RELFILE, LINK) == 0);
+
+ ATF_REQUIRE((ofd = open(ODIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((nfd = open(NDIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(linkat(ofd, BASELINK, nfd, BASETARGET, 0) == 0);
+ ATF_REQUIRE(close(ofd) == 0);
+ ATF_REQUIRE(close(nfd) == 0);
+
+ ATF_REQUIRE(lstat(LINK, &ost) == 0);
+ ATF_REQUIRE(lstat(TARGET, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino == nst.st_ino);
+
+ ATF_REQUIRE(lstat(FILE, &ost) == 0);
+ ATF_REQUIRE(lstat(TARGET, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino != nst.st_ino);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, linkat_fd);
+ ATF_TP_ADD_TC(tp, linkat_fdcwd);
+ ATF_TP_ADD_TC(tp, linkat_fdcwderr);
+ ATF_TP_ADD_TC(tp, linkat_fderr);
+ ATF_TP_ADD_TC(tp, linkat_fdlink1);
+ ATF_TP_ADD_TC(tp, linkat_fdlink2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_mkdirat.c b/contrib/netbsd-tests/lib/libc/c063/t_mkdirat.c
new file mode 100644
index 0000000..23c53d7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_mkdirat.c
@@ -0,0 +1,120 @@
+/* $NetBSD: t_mkdirat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mkdirat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#define DIR "dir"
+#define SDIR "dir/openat"
+#define BASESDIR "openat"
+#define SDIRERR "dir/openaterr"
+
+ATF_TC(mkdirat_fd);
+ATF_TC_HEAD(mkdirat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that mkdirat works with fd");
+}
+ATF_TC_BODY(mkdirat_fd, tc)
+{
+ int dfd;
+ mode_t mode = 0755;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(mkdirat(dfd, BASESDIR, mode) != -1);
+ ATF_REQUIRE(close(dfd) == 0);
+ ATF_REQUIRE(access(SDIR, F_OK) == 0);
+}
+
+ATF_TC(mkdirat_fdcwd);
+ATF_TC_HEAD(mkdirat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that mkdirat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(mkdirat_fdcwd, tc)
+{
+ mode_t mode = 0755;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(mkdirat(AT_FDCWD, SDIR, mode) != -1);
+ ATF_REQUIRE(access(SDIR, F_OK) == 0);
+}
+
+ATF_TC(mkdirat_fdcwderr);
+ATF_TC_HEAD(mkdirat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that mkdirat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(mkdirat_fdcwderr, tc)
+{
+ mode_t mode = 0755;
+
+ ATF_REQUIRE(mkdirat(AT_FDCWD, SDIRERR, mode) == -1);
+}
+
+ATF_TC(mkdirat_fderr);
+ATF_TC_HEAD(mkdirat_fderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that mkdirat fails with fd as -1");
+}
+ATF_TC_BODY(mkdirat_fderr, tc)
+{
+ int fd;
+ mode_t mode = 0755;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(SDIR, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(mkdirat(-1, SDIR, mode) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mkdirat_fd);
+ ATF_TP_ADD_TC(tp, mkdirat_fdcwd);
+ ATF_TP_ADD_TC(tp, mkdirat_fdcwderr);
+ ATF_TP_ADD_TC(tp, mkdirat_fderr);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c b/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c
new file mode 100644
index 0000000..1ae023c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c
@@ -0,0 +1,124 @@
+/* $NetBSD: t_mkfifoat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mkfifoat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#define DIR "dir"
+#define FIFO "dir/openat"
+#define BASEFIFO "openat"
+#define FIFOERR "dir/openaterr"
+
+ATF_TC(mkfifoat_fd);
+ATF_TC_HEAD(mkfifoat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that mkfifoat works with fd");
+}
+ATF_TC_BODY(mkfifoat_fd, tc)
+{
+ int dfd;
+ int fd;
+ mode_t mode = 0600;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(access(FIFO, F_OK) == 0);
+}
+
+ATF_TC(mkfifoat_fdcwd);
+ATF_TC_HEAD(mkfifoat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that mkfifoat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(mkfifoat_fdcwd, tc)
+{
+ int fd;
+ mode_t mode = 0600;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = mkfifoat(AT_FDCWD, FIFO, mode)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(access(FIFO, F_OK) == 0);
+}
+
+ATF_TC(mkfifoat_fdcwderr);
+ATF_TC_HEAD(mkfifoat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that mkfifoat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(mkfifoat_fdcwderr, tc)
+{
+ int fd;
+ mode_t mode = 0600;
+
+ ATF_REQUIRE((fd = mkfifoat(AT_FDCWD, FIFOERR, mode)) == -1);
+}
+
+ATF_TC(mkfifoat_fderr);
+ATF_TC_HEAD(mkfifoat_fderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that mkfifoat fails with fd as -1");
+}
+ATF_TC_BODY(mkfifoat_fderr, tc)
+{
+ int fd;
+ mode_t mode = 0600;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FIFO, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE((fd = mkfifoat(-1, FIFO, mode)) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mkfifoat_fd);
+ ATF_TP_ADD_TC(tp, mkfifoat_fdcwd);
+ ATF_TP_ADD_TC(tp, mkfifoat_fdcwderr);
+ ATF_TP_ADD_TC(tp, mkfifoat_fderr);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c b/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c
new file mode 100644
index 0000000..b04a159
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c
@@ -0,0 +1,150 @@
+/* $NetBSD: t_mknodat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mknodat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#define DIR "dir"
+#define FILE "dir/openat"
+#define BASEFILE "openat"
+#define FILEERR "dir/openaterr"
+
+static dev_t get_devnull(void);
+
+static dev_t
+get_devnull(void)
+{
+ struct stat st;
+
+ if (stat(_PATH_DEVNULL, &st) != 0)
+ return NODEV;
+
+ return st.st_rdev;
+}
+
+
+ATF_TC(mknodat_fd);
+ATF_TC_HEAD(mknodat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that mknodat works with fd");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(mknodat_fd, tc)
+{
+ int dfd;
+ int fd;
+ dev_t dev;
+ mode_t mode = S_IFCHR|0600;
+
+ ATF_REQUIRE((dev = get_devnull()) != NODEV);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(access(FILE, F_OK) == 0);
+}
+
+ATF_TC(mknodat_fdcwd);
+ATF_TC_HEAD(mknodat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that mknodat works with fd as AT_FDCWD");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(mknodat_fdcwd, tc)
+{
+ int fd;
+ dev_t dev;
+ mode_t mode = S_IFCHR|0600;
+
+ ATF_REQUIRE((dev = get_devnull()) != NODEV);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = mknodat(AT_FDCWD, FILE, mode, dev)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(access(FILE, F_OK) == 0);
+}
+
+ATF_TC(mknodat_fdcwderr);
+ATF_TC_HEAD(mknodat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that mknodat fails with fd as AT_FDCWD and bad path");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(mknodat_fdcwderr, tc)
+{
+ int fd;
+ dev_t dev;
+ mode_t mode = S_IFCHR|0600;
+
+ ATF_REQUIRE((dev = get_devnull()) != NODEV);
+ ATF_REQUIRE((fd = mknodat(AT_FDCWD, FILEERR, mode, dev)) == -1);
+}
+
+ATF_TC(mknodat_fderr);
+ATF_TC_HEAD(mknodat_fderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that mknodat fails with fd as -1");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(mknodat_fderr, tc)
+{
+ int fd;
+ dev_t dev;
+ mode_t mode = S_IFCHR|0600;
+
+ ATF_REQUIRE((dev = get_devnull()) != NODEV);
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE((fd = mknodat(-1, FILE, mode, dev)) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mknodat_fd);
+ ATF_TP_ADD_TC(tp, mknodat_fdcwd);
+ ATF_TP_ADD_TC(tp, mknodat_fdcwderr);
+ ATF_TP_ADD_TC(tp, mknodat_fderr);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_o_search.c b/contrib/netbsd-tests/lib/libc/c063/t_o_search.c
new file mode 100644
index 0000000..d9dbe19
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_o_search.c
@@ -0,0 +1,278 @@
+/* $NetBSD: t_o_search.c,v 1.4 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_o_search.c,v 1.4 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <sys/param.h>
+
+/*
+ * dholland 20130112: disable tests that require O_SEARCH semantics
+ * until a decision is reached about the semantics of O_SEARCH and a
+ * non-broken implementation is available.
+ */
+#if (O_MASK & O_SEARCH) != 0
+#define USE_O_SEARCH
+#endif
+
+#define DIR "dir"
+#define FILE "dir/o_search"
+#define BASEFILE "o_search"
+
+
+ATF_TC(o_search_perm1);
+ATF_TC_HEAD(o_search_perm1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that openat enforces search permission");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+ATF_TC_BODY(o_search_perm1, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 644) == 0);
+
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1);
+ ATF_REQUIRE(errno == EACCES);
+
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+#ifdef USE_O_SEARCH
+
+ATF_TC(o_search_root_flag1);
+ATF_TC_HEAD(o_search_root_flag1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that root openat honours O_SEARCH");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(o_search_root_flag1, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY|O_SEARCH, 0)) != -1);
+
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 644) == 0);
+
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 444) == 0);
+
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
+
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(o_search_unpriv_flag1);
+ATF_TC_HEAD(o_search_unpriv_flag1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that openat honours O_SEARCH");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+ATF_TC_BODY(o_search_unpriv_flag1, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY|O_SEARCH, 0)) != -1);
+
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 644) == 0);
+
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 444) == 0);
+
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
+
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+#endif /* USE_O_SEARCH */
+
+ATF_TC(o_search_perm2);
+ATF_TC_HEAD(o_search_perm2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that faccessat enforces search permission");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+ATF_TC_BODY(o_search_perm2, tc)
+{
+ int dfd;
+ int fd;
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 644) == 0);
+
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == -1);
+ ATF_REQUIRE(errno == EACCES);
+
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+#ifdef USE_O_SEARCH
+
+ATF_TC(o_search_root_flag2);
+ATF_TC_HEAD(o_search_root_flag2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that root fstatat honours O_SEARCH");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(o_search_root_flag2, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY|O_SEARCH, 0)) != -1);
+
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 644) == 0);
+
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 444) == 0);
+
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0);
+
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(o_search_unpriv_flag2);
+ATF_TC_HEAD(o_search_unpriv_flag2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that fstatat honours O_SEARCH");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+ATF_TC_BODY(o_search_unpriv_flag2, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY|O_SEARCH, 0)) != -1);
+
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 644) == 0);
+
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0);
+
+ ATF_REQUIRE(fchmod(dfd, 444) == 0);
+
+ ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0);
+
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+#endif /* USE_O_SEARCH */
+
+
+ATF_TC(o_search_notdir);
+ATF_TC_HEAD(o_search_notdir, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that openat fails with non dir fd");
+}
+ATF_TC_BODY(o_search_notdir, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_RDWR|O_SEARCH, 0644)) != -1);
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1);
+ ATF_REQUIRE(errno == ENOTDIR);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, o_search_perm1);
+#ifdef USE_O_SEARCH
+ ATF_TP_ADD_TC(tp, o_search_root_flag1);
+ ATF_TP_ADD_TC(tp, o_search_unpriv_flag1);
+#endif
+ ATF_TP_ADD_TC(tp, o_search_perm2);
+#ifdef USE_O_SEARCH
+ ATF_TP_ADD_TC(tp, o_search_root_flag2);
+ ATF_TP_ADD_TC(tp, o_search_unpriv_flag2);
+#endif
+ ATF_TP_ADD_TC(tp, o_search_notdir);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_openat.c b/contrib/netbsd-tests/lib/libc/c063/t_openat.c
new file mode 100644
index 0000000..79b5f38
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_openat.c
@@ -0,0 +1,165 @@
+/* $NetBSD: t_openat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_openat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+#define DIR "dir"
+#define FILE "dir/openat"
+#define BASEFILE "openat"
+#define FILEERR "dir/openaterr"
+
+ATF_TC(openat_fd);
+ATF_TC_HEAD(openat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that openat works with fd");
+}
+ATF_TC_BODY(openat_fd, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(close(dfd) == 0);
+ ATF_REQUIRE(close(fd) == 0);
+}
+
+ATF_TC(openat_fdcwd);
+ATF_TC_HEAD(openat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that openat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(openat_fdcwd, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(chdir(DIR) == 0);
+ ATF_REQUIRE((fd = openat(AT_FDCWD, BASEFILE, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+}
+
+ATF_TC(openat_fdcwderr);
+ATF_TC_HEAD(openat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that openat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(openat_fdcwderr, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = openat(AT_FDCWD, FILEERR, O_RDONLY, 0)) == -1);
+}
+
+ATF_TC(openat_fderr1);
+ATF_TC_HEAD(openat_fderr1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that openat fail with bad path");
+}
+ATF_TC_BODY(openat_fderr1, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((fd = openat(dfd, FILEERR, O_RDONLY, 0)) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(openat_fderr2);
+ATF_TC_HEAD(openat_fderr2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that openat fails with bad fdat");
+}
+ATF_TC_BODY(openat_fderr2, tc)
+{
+ int dfd;
+ int fd;
+ char cwd[MAXPATHLEN];
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(getcwd(cwd, MAXPATHLEN), O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDONLY, 0)) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(openat_fderr3);
+ATF_TC_HEAD(openat_fderr3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that openat fails with fd as -1");
+}
+ATF_TC_BODY(openat_fderr3, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((fd = openat(-1, FILE, O_RDONLY, 0)) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, openat_fd);
+ ATF_TP_ADD_TC(tp, openat_fdcwd);
+ ATF_TP_ADD_TC(tp, openat_fdcwderr);
+ ATF_TP_ADD_TC(tp, openat_fderr1);
+ ATF_TP_ADD_TC(tp, openat_fderr2);
+ ATF_TP_ADD_TC(tp, openat_fderr3);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c b/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c
new file mode 100644
index 0000000..d354ff5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c
@@ -0,0 +1,157 @@
+/* $NetBSD: t_readlinkat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_readlinkat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+#define DIR "dir"
+#define FILE "dir/readlinkat"
+#define BASEFILE "readlinkat"
+#define LINK "dir/symlink"
+#define BASELINK "symlink"
+#define FILEERR "dir/readlinkaterr"
+
+ATF_TC(readlinkat_fd);
+ATF_TC_HEAD(readlinkat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that readlinkat works with fd");
+}
+ATF_TC_BODY(readlinkat_fd, tc)
+{
+ int dfd;
+ int fd;
+ ssize_t len;
+ char buf[MAXPATHLEN];
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(symlink(FILE, LINK) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ len = readlinkat(dfd, BASELINK, buf, sizeof(buf)-1);
+ ATF_REQUIRE(len != -1);
+ buf[len] = 0;
+ ATF_REQUIRE(close(dfd) == 0);
+
+ ATF_REQUIRE(strcmp(buf, FILE) == 0);
+}
+
+ATF_TC(readlinkat_fdcwd);
+ATF_TC_HEAD(readlinkat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that readlinkat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(readlinkat_fdcwd, tc)
+{
+ int fd;
+ ssize_t len;
+ char buf[MAXPATHLEN];
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(symlink(FILE, LINK) == 0);
+
+ len = readlinkat(AT_FDCWD, LINK, buf, sizeof(buf)-1);
+ ATF_REQUIRE(len != -1);
+ buf[len] = 0;
+
+ ATF_REQUIRE(strcmp(buf, FILE) == 0);
+}
+
+ATF_TC(readlinkat_fdcwderr);
+ATF_TC_HEAD(readlinkat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that readlinkat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(readlinkat_fdcwderr, tc)
+{
+ char buf[MAXPATHLEN];
+
+ ATF_REQUIRE(readlinkat(AT_FDCWD, LINK, buf, sizeof(buf)) == -1);
+}
+
+ATF_TC(readlinkat_fderr1);
+ATF_TC_HEAD(readlinkat_fderr1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that readlinkat fail with bad path");
+}
+ATF_TC_BODY(readlinkat_fderr1, tc)
+{
+ int dfd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(readlinkat(dfd, FILEERR, F_OK, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(readlinkat_fderr2);
+ATF_TC_HEAD(readlinkat_fderr2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that readlinkat fails with fd as -1");
+}
+ATF_TC_BODY(readlinkat_fderr2, tc)
+{
+ int fd;
+ char buf[MAXPATHLEN];
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(symlink(FILE, LINK) == 0);
+
+ ATF_REQUIRE(readlinkat(-1, LINK, buf, sizeof(buf)) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, readlinkat_fd);
+ ATF_TP_ADD_TC(tp, readlinkat_fdcwd);
+ ATF_TP_ADD_TC(tp, readlinkat_fdcwderr);
+ ATF_TP_ADD_TC(tp, readlinkat_fderr1);
+ ATF_TP_ADD_TC(tp, readlinkat_fderr2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_renameat.c b/contrib/netbsd-tests/lib/libc/c063/t_renameat.c
new file mode 100644
index 0000000..e297f2a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_renameat.c
@@ -0,0 +1,152 @@
+/* $NetBSD: t_renameat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_renameat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#define ODIR "olddir"
+#define NDIR "newdir"
+#define FILE "olddir/old"
+#define BASEFILE "old"
+#define RELFILE "../olddir/old"
+#define TARGET "newdir/new"
+#define BASETARGET "new"
+#define FILEERR "olddir/olderr"
+
+ATF_TC(renameat_fd);
+ATF_TC_HEAD(renameat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that renameat works with fd");
+}
+ATF_TC_BODY(renameat_fd, tc)
+{
+ int ofd, nfd, fd;
+ struct stat ost, nst;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(stat(FILE, &ost) == 0);
+
+ ATF_REQUIRE((ofd = open(ODIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE((nfd = open(NDIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(renameat(ofd, BASEFILE, nfd, BASETARGET) == 0);
+ ATF_REQUIRE(close(ofd) == 0);
+ ATF_REQUIRE(close(nfd) == 0);
+
+ ATF_REQUIRE(stat(TARGET, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino == nst.st_ino);
+}
+
+ATF_TC(renameat_fdcwd);
+ATF_TC_HEAD(renameat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that renameat works with fd as AT_FDCWD");
+}
+
+ATF_TC_BODY(renameat_fdcwd, tc)
+{
+ int fd;
+ struct stat ost, nst;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(stat(FILE, &ost) == 0);
+
+ ATF_REQUIRE(renameat(AT_FDCWD, FILE, AT_FDCWD, TARGET) == 0);
+
+ ATF_REQUIRE(stat(TARGET, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino == nst.st_ino);
+}
+
+ATF_TC(renameat_fdcwderr);
+ATF_TC_HEAD(renameat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that renameat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(renameat_fdcwderr, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(renameat(AT_FDCWD, FILEERR, AT_FDCWD, TARGET) == -1);
+}
+
+ATF_TC(renameat_fderr);
+ATF_TC_HEAD(renameat_fderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that renameat fails with fd as -1");
+}
+ATF_TC_BODY(renameat_fderr, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(renameat(-1, FILE, AT_FDCWD, TARGET) == -1);
+ ATF_REQUIRE(renameat(AT_FDCWD, FILE, -1, TARGET) == -1);
+ ATF_REQUIRE(renameat(-1, FILE, -1, TARGET) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, renameat_fd);
+ ATF_TP_ADD_TC(tp, renameat_fdcwd);
+ ATF_TP_ADD_TC(tp, renameat_fdcwderr);
+ ATF_TP_ADD_TC(tp, renameat_fderr);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_symlinkat.c b/contrib/netbsd-tests/lib/libc/c063/t_symlinkat.c
new file mode 100644
index 0000000..d62f289
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_symlinkat.c
@@ -0,0 +1,150 @@
+/* $NetBSD: t_symlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_symlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#define ODIR "olddir"
+#define NDIR "newdir"
+#define FILE "olddir/old"
+#define BASEFILE "old"
+#define RELFILE "../olddir/old"
+#define LINK "newdir/symlink"
+#define BASELINK "symlink"
+#define FILEERR "olddir/olderr"
+
+ATF_TC(symlinkat_fd);
+ATF_TC_HEAD(symlinkat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that symlinkat works with fd");
+}
+ATF_TC_BODY(symlinkat_fd, tc)
+{
+ int dfd, fd;
+ struct stat ost, nst;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE((dfd = open(NDIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(symlinkat(RELFILE, dfd, BASELINK) == 0);
+ ATF_REQUIRE(close(dfd) == 0);
+
+ ATF_REQUIRE(stat(FILE, &ost) == 0);
+ ATF_REQUIRE(stat(LINK, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino == nst.st_ino);
+}
+
+ATF_TC(symlinkat_fdcwd);
+ATF_TC_HEAD(symlinkat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that symlinkat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(symlinkat_fdcwd, tc)
+{
+ int fd;
+ struct stat ost, nst;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(symlinkat(RELFILE, AT_FDCWD, LINK) == 0);
+
+ ATF_REQUIRE(stat(FILE, &ost) == 0);
+ ATF_REQUIRE(stat(LINK, &nst) == 0);
+ ATF_REQUIRE(ost.st_ino == nst.st_ino);
+}
+
+ATF_TC(symlinkat_fdcwderr);
+ATF_TC_HEAD(symlinkat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that symlinkat works with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(symlinkat_fdcwderr, tc)
+{
+ int fd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(symlinkat(FILEERR, AT_FDCWD, LINK) == 0);
+ ATF_REQUIRE(lstat(LINK, &st) == 0);
+ ATF_REQUIRE(stat(LINK, &st) == -1);
+ ATF_REQUIRE(errno == ENOENT);
+
+}
+
+ATF_TC(symlinkat_fderr);
+ATF_TC_HEAD(symlinkat_fderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that symlinkat fails with fd as -1");
+}
+ATF_TC_BODY(symlinkat_fderr, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(ODIR, 0755) == 0);
+ ATF_REQUIRE(mkdir(NDIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) != -1);
+
+ ATF_REQUIRE(symlinkat(RELFILE, -1, LINK) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, symlinkat_fd);
+ ATF_TP_ADD_TC(tp, symlinkat_fdcwd);
+ ATF_TP_ADD_TC(tp, symlinkat_fdcwderr);
+ ATF_TP_ADD_TC(tp, symlinkat_fderr);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c b/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c
new file mode 100644
index 0000000..79aa7aa
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c
@@ -0,0 +1,176 @@
+/* $NetBSD: t_unlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_unlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+#define DIR "dir"
+#define FILE "dir/unlinkat"
+#define BASEFILE "unlinkat"
+#define FILEERR "dir/unlinkaterr"
+
+ATF_TC(unlinkat_fd);
+ATF_TC_HEAD(unlinkat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that unlinkat works with fd");
+}
+ATF_TC_BODY(unlinkat_fd, tc)
+{
+ int dfd;
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(unlinkat(dfd, BASEFILE, 0) == 0);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(unlinkat_fdcwd);
+ATF_TC_HEAD(unlinkat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that unlinkat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(unlinkat_fdcwd, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(chdir(DIR) == 0);
+ ATF_REQUIRE(unlinkat(AT_FDCWD, BASEFILE, 0) == 0);
+}
+
+ATF_TC(unlinkat_fdcwderr);
+ATF_TC_HEAD(unlinkat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that unlinkat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(unlinkat_fdcwderr, tc)
+{
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(unlinkat(AT_FDCWD, FILEERR, 0) == -1);
+}
+
+ATF_TC(unlinkat_fderr1);
+ATF_TC_HEAD(unlinkat_fderr1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that unlinkat fail with bad path");
+}
+ATF_TC_BODY(unlinkat_fderr1, tc)
+{
+ int dfd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(unlinkat(dfd, FILEERR, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(unlinkat_fderr2);
+ATF_TC_HEAD(unlinkat_fderr2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that unlinkat fails with bad fdat");
+}
+ATF_TC_BODY(unlinkat_fderr2, tc)
+{
+ int dfd;
+ int fd;
+ char cwd[MAXPATHLEN];
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(getcwd(cwd, MAXPATHLEN), O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(unlinkat(dfd, BASEFILE, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(unlinkat_fderr3);
+ATF_TC_HEAD(unlinkat_fderr3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that unlinkat fails with fd as -1");
+}
+ATF_TC_BODY(unlinkat_fderr3, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(unlinkat(-1, FILE, 0) == -1);
+}
+
+ATF_TC(unlinkat_dir);
+ATF_TC_HEAD(unlinkat_dir, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that unlinkat can remove directories");
+}
+ATF_TC_BODY(unlinkat_dir, tc)
+{
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+
+ ATF_REQUIRE(unlinkat(AT_FDCWD, DIR, 0) == -1);
+ ATF_REQUIRE(errno == EPERM);
+ ATF_REQUIRE(unlinkat(AT_FDCWD, DIR, AT_REMOVEDIR) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, unlinkat_fd);
+ ATF_TP_ADD_TC(tp, unlinkat_fdcwd);
+ ATF_TP_ADD_TC(tp, unlinkat_fdcwderr);
+ ATF_TP_ADD_TC(tp, unlinkat_fderr1);
+ ATF_TP_ADD_TC(tp, unlinkat_fderr2);
+ ATF_TP_ADD_TC(tp, unlinkat_fderr3);
+ ATF_TP_ADD_TC(tp, unlinkat_dir);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c b/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c
new file mode 100644
index 0000000..9f21fd6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c
@@ -0,0 +1,212 @@
+/* $NetBSD: t_utimensat.c,v 1.5 2013/03/17 04:46:06 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_utimensat.c,v 1.5 2013/03/17 04:46:06 jmmv Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/time.h>
+
+#define DIR "dir"
+#define FILE "dir/utimensat"
+#define BASEFILE "utimensat"
+#define LINK "dir/symlink"
+#define BASELINK "symlink"
+#define FILEERR "dir/symlink"
+
+const struct timespec tptr[] = {
+ { 0x12345678, 987654321 },
+ { 0x15263748, 123456789 },
+};
+
+ATF_TC(utimensat_fd);
+ATF_TC_HEAD(utimensat_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that utimensat works with fd");
+}
+ATF_TC_BODY(utimensat_fd, tc)
+{
+ int dfd;
+ int fd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(utimensat(dfd, BASEFILE, tptr, 0) == 0);
+ ATF_REQUIRE(close(dfd) == 0);
+
+ ATF_REQUIRE(stat(FILE, &st) == 0);
+ ATF_REQUIRE(st.st_atimespec.tv_sec == tptr[0].tv_sec);
+ ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec);
+ ATF_REQUIRE(st.st_mtimespec.tv_sec == tptr[1].tv_sec);
+ ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec);
+}
+
+ATF_TC(utimensat_fdcwd);
+ATF_TC_HEAD(utimensat_fdcwd, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that utimensat works with fd as AT_FDCWD");
+}
+ATF_TC_BODY(utimensat_fdcwd, tc)
+{
+ int fd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(chdir(DIR) == 0);
+ ATF_REQUIRE(utimensat(AT_FDCWD, BASEFILE, tptr, 0) == 0);
+
+ ATF_REQUIRE(stat(BASEFILE, &st) == 0);
+ ATF_REQUIRE(st.st_atimespec.tv_sec == tptr[0].tv_sec);
+ ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec);
+ ATF_REQUIRE(st.st_mtimespec.tv_sec == tptr[1].tv_sec);
+ ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec);
+}
+
+ATF_TC(utimensat_fdcwderr);
+ATF_TC_HEAD(utimensat_fdcwderr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "See that utimensat fails with fd as AT_FDCWD and bad path");
+}
+ATF_TC_BODY(utimensat_fdcwderr, tc)
+{
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(utimensat(AT_FDCWD, FILEERR, tptr, 0) == -1);
+}
+
+ATF_TC(utimensat_fderr1);
+ATF_TC_HEAD(utimensat_fderr1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that utimensat fail with bad path");
+}
+ATF_TC_BODY(utimensat_fderr1, tc)
+{
+ int dfd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(utimensat(dfd, FILEERR, tptr, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(utimensat_fderr2);
+ATF_TC_HEAD(utimensat_fderr2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that utimensat fails with bad fdat");
+}
+ATF_TC_BODY(utimensat_fderr2, tc)
+{
+ int dfd;
+ int fd;
+ char cwd[MAXPATHLEN];
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE((dfd = open(getcwd(cwd, MAXPATHLEN), O_RDONLY, 0)) != -1);
+ ATF_REQUIRE(utimensat(dfd, BASEFILE, tptr, 0) == -1);
+ ATF_REQUIRE(close(dfd) == 0);
+}
+
+ATF_TC(utimensat_fderr3);
+ATF_TC_HEAD(utimensat_fderr3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that utimensat fails with fd as -1");
+}
+ATF_TC_BODY(utimensat_fderr3, tc)
+{
+ int fd;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(utimensat(-1, FILE, tptr, 0) == -1);
+}
+
+ATF_TC(utimensat_fdlink);
+ATF_TC_HEAD(utimensat_fdlink, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that utimensat works on symlink");
+}
+ATF_TC_BODY(utimensat_fdlink, tc)
+{
+ int dfd;
+ struct stat st;
+
+ ATF_REQUIRE(mkdir(DIR, 0755) == 0);
+ ATF_REQUIRE(symlink(FILE, LINK) == 0); /* NB: FILE does not exists */
+
+ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
+
+ ATF_REQUIRE(utimensat(dfd, BASELINK, tptr, 0) == -1);
+ ATF_REQUIRE(errno = ENOENT);
+
+ ATF_REQUIRE(utimensat(dfd, BASELINK, tptr, AT_SYMLINK_NOFOLLOW) == 0);
+
+ ATF_REQUIRE(close(dfd) == 0);
+
+ ATF_REQUIRE(lstat(LINK, &st) == 0);
+ ATF_REQUIRE(st.st_atimespec.tv_sec == tptr[0].tv_sec);
+ ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec);
+ ATF_REQUIRE(st.st_mtimespec.tv_sec == tptr[1].tv_sec);
+ ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, utimensat_fd);
+ ATF_TP_ADD_TC(tp, utimensat_fdcwd);
+ ATF_TP_ADD_TC(tp, utimensat_fdcwderr);
+ ATF_TP_ADD_TC(tp, utimensat_fderr1);
+ ATF_TP_ADD_TC(tp, utimensat_fderr2);
+ ATF_TP_ADD_TC(tp, utimensat_fderr3);
+ ATF_TP_ADD_TC(tp, utimensat_fdlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/common/exec_prot.h b/contrib/netbsd-tests/lib/libc/common/exec_prot.h
new file mode 100644
index 0000000..6e17f97
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/common/exec_prot.h
@@ -0,0 +1,61 @@
+/* $NetBSD: exec_prot.h,v 1.1 2011/07/18 23:16:11 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jean-Yves Migeon.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _TESTS_EXEC_PROT_H_
+#define _TESTS_EXEC_PROT_H_
+
+/*
+ * Prototype definitions of external helper functions for executable
+ * mapping tests.
+ */
+
+/*
+ * Trivial MD shellcode that justs returns 1.
+ */
+int return_one(void); /* begin marker -- shellcode entry */
+int return_one_end(void); /* end marker */
+
+/*
+ * MD callback to verify whether host offers executable space protection.
+ * Returns execute protection level.
+ */
+int exec_prot_support(void);
+
+/* execute protection level */
+enum {
+ NOTIMPL = -1, /* callback not implemented */
+ NO_XP, /* no execute protection */
+ PERPAGE_XP, /* per-page execute protection */
+ PARTIAL_XP /* partial execute protection. Depending on where the
+ page is located in virtual memory, executable space
+ protection may be enforced or not. */
+};
+#endif
diff --git a/contrib/netbsd-tests/lib/libc/db/README b/contrib/netbsd-tests/lib/libc/db/README
new file mode 100644
index 0000000..68f0ec7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/db/README
@@ -0,0 +1,66 @@
+# $NetBSD: README,v 1.1 2011/01/07 15:05:58 pgoyette Exp $
+# @(#)README 8.8 (Berkeley) 7/31/94
+
+Fairly large files (the command files) are built in this directory during
+the test runs, and even larger files (the database files) are created in
+"/var/tmp". If the latter directory doesn't exist, set the environmental
+variable TMPDIR to a directory where the files can be built.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+The script file consists of lines with an initial character which is
+the command for that line, or an initial character indicating a key
+or data entry for a previous command.
+
+Legal command characters are as follows:
+
+c: compare a record
+ + must be followed by [kK][dD]; the data value in the database
+ associated with the specified key is compared to the specified
+ data value.
+e: echo a string
+ + writes out the rest of the line into the output file; if the
+ last character is not a carriage-return, a newline is appended.
+f: set the flags for the next command
+ + no value zero's the flags
+g: do a get command
+ + must be followed by [kK]
+ + writes out the retrieved data DBT.
+o [r]: dump [reverse]
+ + dump the database out, if 'r' is set, in reverse order.
+p: do a put command
+ + must be followed by [kK][dD]
+r: do a del command
+ + must be followed by [kK] unless R_CURSOR flag set.
+S: sync the database
+s: do a seq command
+ + must be followed by [kK] if R_CURSOR flag set.
+ + writes out the retrieved data DBT.
+
+Legal key/data characters are as follows:
+
+D [file]: data file
+ + set the current data value to the contents of the file
+d [data]:
+ + set the current key value to the contents of the line.
+K [file]: key file
+ + set the current key value to the contents of the file
+k [data]:
+ + set the current key value to the contents of the line.
+
+Blank lines, lines with leading white space, and lines with leading
+hash marks (#) are ignored.
+
+Options to dbtest are as follows:
+
+ -d: Set the DB_LOCK flag.
+ -f: Use the file argument as the database file.
+ -i: Use the rest of the argument to set elements in the info
+ structure. If the type is btree, then "-i cachesize=10240"
+ will set BTREEINFO.cachesize to 10240.
+ -o: The rest of the argument is the output file instead of
+ using stdout.
+ -s: Don't delete the database file before opening it, i.e.
+ use the database file from a previous run.
+
+Dbtest requires two arguments, the type of access "hash", "recno"
+or "btree", and the script name or "-" to indicate stdin.
diff --git a/contrib/netbsd-tests/lib/libc/db/h_db.c b/contrib/netbsd-tests/lib/libc/db/h_db.c
new file mode 100644
index 0000000..dfb1385
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/db/h_db.c
@@ -0,0 +1,731 @@
+/* $NetBSD: h_db.c,v 1.1 2011/01/07 15:05:58 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 1992, 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. 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.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\
+ The Regents of the University of California. All rights reserved.");
+#endif /* not lint */
+
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)dbtest.c 8.17 (Berkeley) 9/1/94";
+#else
+__RCSID("$NetBSD: h_db.c,v 1.1 2011/01/07 15:05:58 pgoyette Exp $");
+#endif
+#endif /* not lint */
+
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <err.h>
+#include <db.h>
+
+enum S { COMMAND, COMPARE, GET, PUT, REMOVE, SEQ, SEQFLAG, KEY, DATA };
+
+static void compare(DBT *, DBT *);
+static DBTYPE dbtype(const char *);
+static void dump(DB *, int);
+static void get(DB *, DBT *);
+static void getdata(DB *, DBT *, DBT *);
+static void put(DB *, DBT *, DBT *);
+static void rem(DB *, DBT *);
+static const char *sflags(int);
+static void synk(DB *);
+static void *rfile(char *, size_t *);
+static void seq(DB *, DBT *);
+static u_int setflags(char *);
+static void *setinfo(DBTYPE, char *);
+static void usage(void) __attribute__((__noreturn__));
+static void *xcopy(void *, size_t);
+static void chkcmd(enum S);
+static void chkdata(enum S);
+static void chkkey(enum S);
+
+#ifdef STATISTICS
+extern void __bt_stat(DB *);
+#endif
+
+static DBTYPE type; /* Database type. */
+static void *infop; /* Iflags. */
+static size_t lineno; /* Current line in test script. */
+static u_int flags; /* Current DB flags. */
+static int ofd = STDOUT_FILENO; /* Standard output fd. */
+
+static DB *XXdbp; /* Global for gdb. */
+static size_t XXlineno; /* Fast breakpoint for gdb. */
+
+int
+main(int argc, char *argv[])
+{
+ extern int optind;
+ extern char *optarg;
+ enum S command = COMMAND, state;
+ DB *dbp;
+ DBT data, key, keydata;
+ size_t len;
+ int ch, oflags, sflag;
+ char *fname, *infoarg, *p, *t, buf[8 * 1024];
+ bool unlink_dbfile;
+
+ infoarg = NULL;
+ fname = NULL;
+ unlink_dbfile = false;
+ oflags = O_CREAT | O_RDWR;
+ sflag = 0;
+ while ((ch = getopt(argc, argv, "f:i:lo:s")) != -1)
+ switch (ch) {
+ case 'f':
+ fname = optarg;
+ break;
+ case 'i':
+ infoarg = optarg;
+ break;
+ case 'l':
+ oflags |= DB_LOCK;
+ break;
+ case 'o':
+ if ((ofd = open(optarg,
+ O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
+ err(1, "Cannot create `%s'", optarg);
+ break;
+ case 's':
+ sflag = 1;
+ break;
+ case '?':
+ default:
+ usage();
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 2)
+ usage();
+
+ /* Set the type. */
+ type = dbtype(*argv++);
+
+ /* Open the descriptor file. */
+ if (strcmp(*argv, "-") && freopen(*argv, "r", stdin) == NULL)
+ err(1, "Cannot reopen `%s'", *argv);
+
+ /* Set up the db structure as necessary. */
+ if (infoarg == NULL)
+ infop = NULL;
+ else
+ for (p = strtok(infoarg, ",\t "); p != NULL;
+ p = strtok(0, ",\t "))
+ if (*p != '\0')
+ infop = setinfo(type, p);
+
+ /*
+ * Open the DB. Delete any preexisting copy, you almost never
+ * want it around, and it often screws up tests.
+ */
+ if (fname == NULL) {
+ const char *q = getenv("TMPDIR");
+ if (q == NULL)
+ q = "/var/tmp";
+ (void)snprintf(buf, sizeof(buf), "%s/__dbtest", q);
+ fname = buf;
+ (void)unlink(buf);
+ unlink_dbfile = true;
+ } else if (!sflag)
+ (void)unlink(fname);
+
+ if ((dbp = dbopen(fname,
+ oflags, S_IRUSR | S_IWUSR, type, infop)) == NULL)
+ err(1, "Cannot dbopen `%s'", fname);
+ XXdbp = dbp;
+ if (unlink_dbfile)
+ (void)unlink(fname);
+
+ state = COMMAND;
+ for (lineno = 1;
+ (p = fgets(buf, sizeof(buf), stdin)) != NULL; ++lineno) {
+ /* Delete the newline, displaying the key/data is easier. */
+ if (ofd == STDOUT_FILENO && (t = strchr(p, '\n')) != NULL)
+ *t = '\0';
+ if ((len = strlen(buf)) == 0 || isspace((unsigned char)*p) ||
+ *p == '#')
+ continue;
+
+ /* Convenient gdb break point. */
+ if (XXlineno == lineno)
+ XXlineno = 1;
+ switch (*p) {
+ case 'c': /* compare */
+ chkcmd(state);
+ state = KEY;
+ command = COMPARE;
+ break;
+ case 'e': /* echo */
+ chkcmd(state);
+ /* Don't display the newline, if CR at EOL. */
+ if (p[len - 2] == '\r')
+ --len;
+ if (write(ofd, p + 1, len - 1) != (ssize_t)len - 1 ||
+ write(ofd, "\n", 1) != 1)
+ err(1, "write failed");
+ break;
+ case 'g': /* get */
+ chkcmd(state);
+ state = KEY;
+ command = GET;
+ break;
+ case 'p': /* put */
+ chkcmd(state);
+ state = KEY;
+ command = PUT;
+ break;
+ case 'r': /* remove */
+ chkcmd(state);
+ if (flags == R_CURSOR) {
+ rem(dbp, &key);
+ state = COMMAND;
+ } else {
+ state = KEY;
+ command = REMOVE;
+ }
+ break;
+ case 'S': /* sync */
+ chkcmd(state);
+ synk(dbp);
+ state = COMMAND;
+ break;
+ case 's': /* seq */
+ chkcmd(state);
+ if (flags == R_CURSOR) {
+ state = KEY;
+ command = SEQ;
+ } else
+ seq(dbp, &key);
+ break;
+ case 'f':
+ flags = setflags(p + 1);
+ break;
+ case 'D': /* data file */
+ chkdata(state);
+ data.data = rfile(p + 1, &data.size);
+ goto ldata;
+ case 'd': /* data */
+ chkdata(state);
+ data.data = xcopy(p + 1, len - 1);
+ data.size = len - 1;
+ldata: switch (command) {
+ case COMPARE:
+ compare(&keydata, &data);
+ break;
+ case PUT:
+ put(dbp, &key, &data);
+ break;
+ default:
+ errx(1, "line %zu: command doesn't take data",
+ lineno);
+ }
+ if (type != DB_RECNO)
+ free(key.data);
+ free(data.data);
+ state = COMMAND;
+ break;
+ case 'K': /* key file */
+ chkkey(state);
+ if (type == DB_RECNO)
+ errx(1, "line %zu: 'K' not available for recno",
+ lineno);
+ key.data = rfile(p + 1, &key.size);
+ goto lkey;
+ case 'k': /* key */
+ chkkey(state);
+ if (type == DB_RECNO) {
+ static recno_t recno;
+ recno = atoi(p + 1);
+ key.data = &recno;
+ key.size = sizeof(recno);
+ } else {
+ key.data = xcopy(p + 1, len - 1);
+ key.size = len - 1;
+ }
+lkey: switch (command) {
+ case COMPARE:
+ getdata(dbp, &key, &keydata);
+ state = DATA;
+ break;
+ case GET:
+ get(dbp, &key);
+ if (type != DB_RECNO)
+ free(key.data);
+ state = COMMAND;
+ break;
+ case PUT:
+ state = DATA;
+ break;
+ case REMOVE:
+ rem(dbp, &key);
+ if ((type != DB_RECNO) && (flags != R_CURSOR))
+ free(key.data);
+ state = COMMAND;
+ break;
+ case SEQ:
+ seq(dbp, &key);
+ if ((type != DB_RECNO) && (flags != R_CURSOR))
+ free(key.data);
+ state = COMMAND;
+ break;
+ default:
+ errx(1, "line %zu: command doesn't take a key",
+ lineno);
+ }
+ break;
+ case 'o':
+ dump(dbp, p[1] == 'r');
+ break;
+ default:
+ errx(1, "line %zu: %s: unknown command character",
+ lineno, p);
+ }
+ }
+#ifdef STATISTICS
+ /*
+ * -l must be used (DB_LOCK must be set) for this to be
+ * used, otherwise a page will be locked and it will fail.
+ */
+ if (type == DB_BTREE && oflags & DB_LOCK)
+ __bt_stat(dbp);
+#endif
+ if ((*dbp->close)(dbp))
+ err(1, "db->close failed");
+ (void)close(ofd);
+ return 0;
+}
+
+#define NOOVERWRITE "put failed, would overwrite key\n"
+
+static void
+compare(DBT *db1, DBT *db2)
+{
+ size_t len;
+ u_char *p1, *p2;
+
+ if (db1->size != db2->size)
+ printf("compare failed: key->data len %zu != data len %zu\n",
+ db1->size, db2->size);
+
+ len = MIN(db1->size, db2->size);
+ for (p1 = db1->data, p2 = db2->data; len--;)
+ if (*p1++ != *p2++) {
+ printf("compare failed at offset %lu\n",
+ (unsigned long)(p1 - (u_char *)db1->data));
+ break;
+ }
+}
+
+static void
+get(DB *dbp, DBT *kp)
+{
+ DBT data;
+
+ switch ((*dbp->get)(dbp, kp, &data, flags)) {
+ case 0:
+ (void)write(ofd, data.data, data.size);
+ if (ofd == STDOUT_FILENO)
+ (void)write(ofd, "\n", 1);
+ break;
+ case -1:
+ err(1, "line %zu: get failed", lineno);
+ /* NOTREACHED */
+ case 1:
+#define NOSUCHKEY "get failed, no such key\n"
+ if (ofd != STDOUT_FILENO)
+ (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
+ else
+ (void)fprintf(stderr, "%zu: %.*s: %s",
+ lineno, (int)MIN(kp->size, 20),
+ (const char *)kp->data,
+ NOSUCHKEY);
+#undef NOSUCHKEY
+ break;
+ }
+}
+
+static void
+getdata(DB *dbp, DBT *kp, DBT *dp)
+{
+ switch ((*dbp->get)(dbp, kp, dp, flags)) {
+ case 0:
+ return;
+ case -1:
+ err(1, "line %zu: getdata failed", lineno);
+ /* NOTREACHED */
+ case 1:
+ errx(1, "line %zu: getdata failed, no such key", lineno);
+ /* NOTREACHED */
+ }
+}
+
+static void
+put(DB *dbp, DBT *kp, DBT *dp)
+{
+ switch ((*dbp->put)(dbp, kp, dp, flags)) {
+ case 0:
+ break;
+ case -1:
+ err(1, "line %zu: put failed", lineno);
+ /* NOTREACHED */
+ case 1:
+ (void)write(ofd, NOOVERWRITE, sizeof(NOOVERWRITE) - 1);
+ break;
+ }
+}
+
+static void
+rem(DB *dbp, DBT *kp)
+{
+ switch ((*dbp->del)(dbp, kp, flags)) {
+ case 0:
+ break;
+ case -1:
+ err(1, "line %zu: rem failed", lineno);
+ /* NOTREACHED */
+ case 1:
+#define NOSUCHKEY "rem failed, no such key\n"
+ if (ofd != STDOUT_FILENO)
+ (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
+ else if (flags != R_CURSOR)
+ (void)fprintf(stderr, "%zu: %.*s: %s",
+ lineno, (int)MIN(kp->size, 20),
+ (const char *)kp->data, NOSUCHKEY);
+ else
+ (void)fprintf(stderr,
+ "%zu: rem of cursor failed\n", lineno);
+#undef NOSUCHKEY
+ break;
+ }
+}
+
+static void
+synk(DB *dbp)
+{
+ switch ((*dbp->sync)(dbp, flags)) {
+ case 0:
+ break;
+ case -1:
+ err(1, "line %zu: synk failed", lineno);
+ /* NOTREACHED */
+ }
+}
+
+static void
+seq(DB *dbp, DBT *kp)
+{
+ DBT data;
+
+ switch (dbp->seq(dbp, kp, &data, flags)) {
+ case 0:
+ (void)write(ofd, data.data, data.size);
+ if (ofd == STDOUT_FILENO)
+ (void)write(ofd, "\n", 1);
+ break;
+ case -1:
+ err(1, "line %zu: seq failed", lineno);
+ /* NOTREACHED */
+ case 1:
+#define NOSUCHKEY "seq failed, no such key\n"
+ if (ofd != STDOUT_FILENO)
+ (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1);
+ else if (flags == R_CURSOR)
+ (void)fprintf(stderr, "%zu: %.*s: %s",
+ lineno, (int)MIN(kp->size, 20),
+ (const char *)kp->data, NOSUCHKEY);
+ else
+ (void)fprintf(stderr,
+ "%zu: seq (%s) failed\n", lineno, sflags(flags));
+#undef NOSUCHKEY
+ break;
+ }
+}
+
+static void
+dump(DB *dbp, int rev)
+{
+ DBT key, data;
+ int xflags, nflags;
+
+ if (rev) {
+ xflags = R_LAST;
+ nflags = R_PREV;
+ } else {
+ xflags = R_FIRST;
+ nflags = R_NEXT;
+ }
+ for (;; xflags = nflags)
+ switch (dbp->seq(dbp, &key, &data, xflags)) {
+ case 0:
+ (void)write(ofd, data.data, data.size);
+ if (ofd == STDOUT_FILENO)
+ (void)write(ofd, "\n", 1);
+ break;
+ case 1:
+ goto done;
+ case -1:
+ err(1, "line %zu: (dump) seq failed", lineno);
+ /* NOTREACHED */
+ }
+done: return;
+}
+
+static u_int
+setflags(char *s)
+{
+ char *p;
+
+ for (; isspace((unsigned char)*s); ++s);
+ if (*s == '\n' || *s == '\0')
+ return 0;
+ if ((p = strchr(s, '\n')) != NULL)
+ *p = '\0';
+ if (!strcmp(s, "R_CURSOR")) return R_CURSOR;
+ if (!strcmp(s, "R_FIRST")) return R_FIRST;
+ if (!strcmp(s, "R_IAFTER")) return R_IAFTER;
+ if (!strcmp(s, "R_IBEFORE")) return R_IBEFORE;
+ if (!strcmp(s, "R_LAST")) return R_LAST;
+ if (!strcmp(s, "R_NEXT")) return R_NEXT;
+ if (!strcmp(s, "R_NOOVERWRITE")) return R_NOOVERWRITE;
+ if (!strcmp(s, "R_PREV")) return R_PREV;
+ if (!strcmp(s, "R_SETCURSOR")) return R_SETCURSOR;
+
+ errx(1, "line %zu: %s: unknown flag", lineno, s);
+ /* NOTREACHED */
+}
+
+static const char *
+sflags(int xflags)
+{
+ switch (xflags) {
+ case R_CURSOR: return "R_CURSOR";
+ case R_FIRST: return "R_FIRST";
+ case R_IAFTER: return "R_IAFTER";
+ case R_IBEFORE: return "R_IBEFORE";
+ case R_LAST: return "R_LAST";
+ case R_NEXT: return "R_NEXT";
+ case R_NOOVERWRITE: return "R_NOOVERWRITE";
+ case R_PREV: return "R_PREV";
+ case R_SETCURSOR: return "R_SETCURSOR";
+ }
+
+ return "UNKNOWN!";
+}
+
+static DBTYPE
+dbtype(const char *s)
+{
+ if (!strcmp(s, "btree"))
+ return DB_BTREE;
+ if (!strcmp(s, "hash"))
+ return DB_HASH;
+ if (!strcmp(s, "recno"))
+ return DB_RECNO;
+ errx(1, "%s: unknown type (use btree, hash or recno)", s);
+ /* NOTREACHED */
+}
+
+static void *
+setinfo(DBTYPE dtype, char *s)
+{
+ static BTREEINFO ib;
+ static HASHINFO ih;
+ static RECNOINFO rh;
+ char *eq;
+
+ if ((eq = strchr(s, '=')) == NULL)
+ errx(1, "%s: illegal structure set statement", s);
+ *eq++ = '\0';
+ if (!isdigit((unsigned char)*eq))
+ errx(1, "%s: structure set statement must be a number", s);
+
+ switch (dtype) {
+ case DB_BTREE:
+ if (!strcmp("flags", s)) {
+ ib.flags = atoi(eq);
+ return &ib;
+ }
+ if (!strcmp("cachesize", s)) {
+ ib.cachesize = atoi(eq);
+ return &ib;
+ }
+ if (!strcmp("maxkeypage", s)) {
+ ib.maxkeypage = atoi(eq);
+ return &ib;
+ }
+ if (!strcmp("minkeypage", s)) {
+ ib.minkeypage = atoi(eq);
+ return &ib;
+ }
+ if (!strcmp("lorder", s)) {
+ ib.lorder = atoi(eq);
+ return &ib;
+ }
+ if (!strcmp("psize", s)) {
+ ib.psize = atoi(eq);
+ return &ib;
+ }
+ break;
+ case DB_HASH:
+ if (!strcmp("bsize", s)) {
+ ih.bsize = atoi(eq);
+ return &ih;
+ }
+ if (!strcmp("ffactor", s)) {
+ ih.ffactor = atoi(eq);
+ return &ih;
+ }
+ if (!strcmp("nelem", s)) {
+ ih.nelem = atoi(eq);
+ return &ih;
+ }
+ if (!strcmp("cachesize", s)) {
+ ih.cachesize = atoi(eq);
+ return &ih;
+ }
+ if (!strcmp("lorder", s)) {
+ ih.lorder = atoi(eq);
+ return &ih;
+ }
+ break;
+ case DB_RECNO:
+ if (!strcmp("flags", s)) {
+ rh.flags = atoi(eq);
+ return &rh;
+ }
+ if (!strcmp("cachesize", s)) {
+ rh.cachesize = atoi(eq);
+ return &rh;
+ }
+ if (!strcmp("lorder", s)) {
+ rh.lorder = atoi(eq);
+ return &rh;
+ }
+ if (!strcmp("reclen", s)) {
+ rh.reclen = atoi(eq);
+ return &rh;
+ }
+ if (!strcmp("bval", s)) {
+ rh.bval = atoi(eq);
+ return &rh;
+ }
+ if (!strcmp("psize", s)) {
+ rh.psize = atoi(eq);
+ return &rh;
+ }
+ break;
+ }
+ errx(1, "%s: unknown structure value", s);
+ /* NOTREACHED */
+}
+
+static void *
+rfile(char *name, size_t *lenp)
+{
+ struct stat sb;
+ void *p;
+ int fd;
+ char *np;
+
+ for (; isspace((unsigned char)*name); ++name)
+ continue;
+ if ((np = strchr(name, '\n')) != NULL)
+ *np = '\0';
+ if ((fd = open(name, O_RDONLY, 0)) == -1 || fstat(fd, &sb) == -1)
+ err(1, "Cannot open `%s'", name);
+#ifdef NOT_PORTABLE
+ if (sb.st_size > (off_t)SIZE_T_MAX) {
+ errno = E2BIG;
+ err("Cannot process `%s'", name);
+ }
+#endif
+ if ((p = malloc((size_t)sb.st_size)) == NULL)
+ err(1, "Cannot allocate %zu bytes", (size_t)sb.st_size);
+ if (read(fd, p, (ssize_t)sb.st_size) != (ssize_t)sb.st_size)
+ err(1, "read failed");
+ *lenp = (size_t)sb.st_size;
+ (void)close(fd);
+ return p;
+}
+
+static void *
+xcopy(void *text, size_t len)
+{
+ void *p;
+
+ if ((p = malloc(len)) == NULL)
+ err(1, "Cannot allocate %zu bytes", len);
+ (void)memmove(p, text, len);
+ return p;
+}
+
+static void
+chkcmd(enum S state)
+{
+ if (state != COMMAND)
+ errx(1, "line %zu: not expecting command", lineno);
+}
+
+static void
+chkdata(enum S state)
+{
+ if (state != DATA)
+ errx(1, "line %zu: not expecting data", lineno);
+}
+
+static void
+chkkey(enum S state)
+{
+ if (state != KEY)
+ errx(1, "line %zu: not expecting a key", lineno);
+}
+
+static void
+usage(void)
+{
+ (void)fprintf(stderr,
+ "Usage: %s [-l] [-f file] [-i info] [-o file] type script\n",
+ getprogname());
+ exit(1);
+}
diff --git a/contrib/netbsd-tests/lib/libc/db/t_db.sh b/contrib/netbsd-tests/lib/libc/db/t_db.sh
new file mode 100755
index 0000000..52244e3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/db/t_db.sh
@@ -0,0 +1,920 @@
+# $NetBSD: t_db.sh,v 1.4 2013/07/29 10:43:15 skrll Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+prog()
+{
+ echo $(atf_get_srcdir)/h_db
+}
+
+dict()
+{
+ if [ -f /usr/share/dict/words ]; then
+ echo /usr/share/dict/words
+ elif [ -f /usr/dict/words ]; then
+ echo /usr/dict/words
+ else
+ atf_fail "no dictionary found"
+ fi
+}
+
+SEVEN_SEVEN="abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg"
+
+atf_test_case small_btree
+small_btree_head()
+{
+ atf_set "descr" \
+ "Checks btree database using small keys and small data" \
+ "pairs: takes the first hundred entries in the dictionary," \
+ "and makes them be key/data pairs."
+}
+small_btree_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ sed 200q $(dict) >exp
+
+ for i in `sed 200q $(dict)`; do
+ echo p
+ echo k$i
+ echo d$i
+ echo g
+ echo k$i
+ done >in
+
+ atf_check -o file:exp "$(prog)" btree in
+}
+
+atf_test_case small_hash
+small_hash_head()
+{
+ atf_set "descr" \
+ "Checks hash database using small keys and small data" \
+ "pairs: takes the first hundred entries in the dictionary," \
+ "and makes them be key/data pairs."
+}
+small_hash_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ sed 200q $(dict) >exp
+
+ for i in `sed 200q $(dict)`; do
+ echo p
+ echo k$i
+ echo d$i
+ echo g
+ echo k$i
+ done >in
+
+ atf_check -o file:exp "$(prog)" hash in
+}
+
+atf_test_case small_recno
+small_recno_head()
+{
+ atf_set "descr" \
+ "Checks recno database using small keys and small data" \
+ "pairs: takes the first hundred entries in the dictionary," \
+ "and makes them be key/data pairs."
+}
+small_recno_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ sed 200q $(dict) >exp
+
+ sed 200q $(dict) |
+ awk '{
+ ++i;
+ printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
+ }' >in
+
+ atf_check -o file:exp "$(prog)" recno in
+}
+
+atf_test_case medium_btree
+medium_btree_head()
+{
+ atf_set "descr" \
+ "Checks btree database using small keys and medium" \
+ "data pairs: takes the first 200 entries in the" \
+ "dictionary, and gives them each a medium size data entry."
+}
+medium_btree_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+ echo $mdata |
+ awk '{ for (i = 1; i < 201; ++i) print $0 }' >exp
+
+ for i in $(sed 200q $(dict)); do
+ echo p
+ echo k$i
+ echo d$mdata
+ echo g
+ echo k$i
+ done >in
+
+ atf_check -o file:exp "$(prog)" btree in
+}
+
+atf_test_case medium_hash
+medium_hash_head()
+{
+ atf_set "descr" \
+ "Checks hash database using small keys and medium" \
+ "data pairs: takes the first 200 entries in the" \
+ "dictionary, and gives them each a medium size data entry."
+}
+medium_hash_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+ echo $mdata |
+ awk '{ for (i = 1; i < 201; ++i) print $0 }' >exp
+
+ for i in $(sed 200q $(dict)); do
+ echo p
+ echo k$i
+ echo d$mdata
+ echo g
+ echo k$i
+ done >in
+
+ atf_check -o file:exp "$(prog)" hash in
+}
+
+atf_test_case medium_recno
+medium_recno_head()
+{
+ atf_set "descr" \
+ "Checks recno database using small keys and medium" \
+ "data pairs: takes the first 200 entries in the" \
+ "dictionary, and gives them each a medium size data entry."
+}
+medium_recno_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+ echo $mdata |
+ awk '{ for (i = 1; i < 201; ++i) print $0 }' >exp
+
+ echo $mdata |
+ awk '{ for (i = 1; i < 201; ++i)
+ printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
+ }' >in
+
+ atf_check -o file:exp "$(prog)" recno in
+}
+
+atf_test_case big_btree
+big_btree_head()
+{
+ atf_set "descr" \
+ "Checks btree database using small keys and big data" \
+ "pairs: inserts the programs in /bin with their paths" \
+ "as their keys."
+}
+big_btree_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ (find /bin -type f -print | xargs cat) >exp
+
+ for psize in 512 16384 65536; do
+ echo "checking page size: $psize"
+
+ for i in `find /bin -type f -print`; do
+ echo p
+ echo k$i
+ echo D$i
+ echo g
+ echo k$i
+ done >in
+
+ atf_check "$(prog)" -o out btree in
+ cmp -s exp out || atf_fail "test failed for page size: $psize"
+ done
+}
+
+atf_test_case big_hash
+big_hash_head()
+{
+ atf_set "descr" \
+ "Checks hash database using small keys and big data" \
+ "pairs: inserts the programs in /bin with their paths" \
+ "as their keys."
+}
+big_hash_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ (find /bin -type f -print | xargs cat) >exp
+
+ for i in `find /bin -type f -print`; do
+ echo p
+ echo k$i
+ echo D$i
+ echo g
+ echo k$i
+ done >in
+
+ atf_check "$(prog)" -o out hash in
+ cmp -s exp out || atf_fail "test failed"
+}
+
+atf_test_case big_recno
+big_recno_head()
+{
+ atf_set "descr" \
+ "Checks recno database using small keys and big data" \
+ "pairs: inserts the programs in /bin with their paths" \
+ "as their keys."
+}
+big_recno_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ (find /bin -type f -print | xargs cat) >exp
+
+ find /bin -type f -print |
+ awk '{
+ ++i;
+ printf("p\nk%d\nD%s\ng\nk%d\n", i, $0, i);
+ }' >in
+
+ for psize in 512 16384 65536; do
+ echo "checking page size: $psize"
+
+ atf_check "$(prog)" -o out recno in
+ cmp -s exp out || atf_fail "test failed for page size: $psize"
+ done
+}
+
+atf_test_case random_recno
+random_recno_head()
+{
+ atf_set "descr" "Checks recno database using random entries"
+}
+random_recno_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ echo $SEVEN_SEVEN |
+ awk '{
+ for (i = 37; i <= 37 + 88 * 17; i += 17) {
+ if (i % 41)
+ s = substr($0, 1, i % 41);
+ else
+ s = substr($0, 1);
+ printf("input key %d: %s\n", i, s);
+ }
+ for (i = 1; i <= 15; ++i) {
+ if (i % 41)
+ s = substr($0, 1, i % 41);
+ else
+ s = substr($0, 1);
+ printf("input key %d: %s\n", i, s);
+ }
+ for (i = 19234; i <= 19234 + 61 * 27; i += 27) {
+ if (i % 41)
+ s = substr($0, 1, i % 41);
+ else
+ s = substr($0, 1);
+ printf("input key %d: %s\n", i, s);
+ }
+ exit
+ }' >exp
+
+ cat exp |
+ awk 'BEGIN {
+ i = 37;
+ incr = 17;
+ }
+ {
+ printf("p\nk%d\nd%s\n", i, $0);
+ if (i == 19234 + 61 * 27)
+ exit;
+ if (i == 37 + 88 * 17) {
+ i = 1;
+ incr = 1;
+ } else if (i == 15) {
+ i = 19234;
+ incr = 27;
+ } else
+ i += incr;
+ }
+ END {
+ for (i = 37; i <= 37 + 88 * 17; i += 17)
+ printf("g\nk%d\n", i);
+ for (i = 1; i <= 15; ++i)
+ printf("g\nk%d\n", i);
+ for (i = 19234; i <= 19234 + 61 * 27; i += 27)
+ printf("g\nk%d\n", i);
+ }' >in
+
+ atf_check -o file:exp "$(prog)" recno in
+}
+
+atf_test_case reverse_recno
+reverse_recno_head()
+{
+ atf_set "descr" "Checks recno database using reverse order entries"
+}
+reverse_recno_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ echo $SEVEN_SEVEN |
+ awk ' {
+ for (i = 1500; i; --i) {
+ if (i % 34)
+ s = substr($0, 1, i % 34);
+ else
+ s = substr($0, 1);
+ printf("input key %d: %s\n", i, s);
+ }
+ exit;
+ }' >exp
+
+ cat exp |
+ awk 'BEGIN {
+ i = 1500;
+ }
+ {
+ printf("p\nk%d\nd%s\n", i, $0);
+ --i;
+ }
+ END {
+ for (i = 1500; i; --i)
+ printf("g\nk%d\n", i);
+ }' >in
+
+ atf_check -o file:exp "$(prog)" recno in
+}
+
+atf_test_case alternate_recno
+alternate_recno_head()
+{
+ atf_set "descr" "Checks recno database using alternating order entries"
+}
+alternate_recno_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ echo $SEVEN_SEVEN |
+ awk ' {
+ for (i = 1; i < 1200; i += 2) {
+ if (i % 34)
+ s = substr($0, 1, i % 34);
+ else
+ s = substr($0, 1);
+ printf("input key %d: %s\n", i, s);
+ }
+ for (i = 2; i < 1200; i += 2) {
+ if (i % 34)
+ s = substr($0, 1, i % 34);
+ else
+ s = substr($0, 1);
+ printf("input key %d: %s\n", i, s);
+ }
+ exit;
+ }' >exp
+
+ cat exp |
+ awk 'BEGIN {
+ i = 1;
+ even = 0;
+ }
+ {
+ printf("p\nk%d\nd%s\n", i, $0);
+ i += 2;
+ if (i >= 1200) {
+ if (even == 1)
+ exit;
+ even = 1;
+ i = 2;
+ }
+ }
+ END {
+ for (i = 1; i < 1200; ++i)
+ printf("g\nk%d\n", i);
+ }' >in
+
+ atf_check "$(prog)" -o out recno in
+
+ sort -o exp exp
+ sort -o out out
+
+ cmp -s exp out || atf_fail "test failed"
+}
+
+h_delete()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ type=$1
+
+ echo $SEVEN_SEVEN |
+ awk '{
+ for (i = 1; i <= 120; ++i)
+ printf("%05d: input key %d: %s\n", i, i, $0);
+ }' >exp
+
+ cat exp |
+ awk '{
+ printf("p\nk%d\nd%s\n", ++i, $0);
+ }
+ END {
+ printf("fR_NEXT\n");
+ for (i = 1; i <= 120; ++i)
+ printf("s\n");
+ printf("fR_CURSOR\ns\nkXX\n");
+ printf("r\n");
+ printf("fR_NEXT\ns\n");
+ printf("fR_CURSOR\ns\nk1\n");
+ printf("r\n");
+ printf("fR_FIRST\ns\n");
+ }' >in
+
+ # For btree, the records are ordered by the string representation
+ # of the key value. So sort the expected output file accordingly,
+ # and set the seek_last key to the last expected key value.
+
+ if [ "$type" = "btree" ] ; then
+ sed -e 's/kXX/k99/' < in > tmp
+ mv tmp in
+ sort -d -k4 < exp > tmp
+ mv tmp exp
+ echo $SEVEN_SEVEN |
+ awk '{
+ printf("%05d: input key %d: %s\n", 99, 99, $0);
+ printf("seq failed, no such key\n");
+ printf("%05d: input key %d: %s\n", 1, 1, $0);
+ printf("%05d: input key %d: %s\n", 10, 10, $0);
+ exit;
+ }' >> exp
+ else
+ # For recno, records are ordered by numerical key value. No sort
+ # is needed, but still need to set proper seek_last key value.
+ sed -e 's/kXX/k120/' < in > tmp
+ mv tmp in
+ echo $SEVEN_SEVEN |
+ awk '{
+ printf("%05d: input key %d: %s\n", 120, 120, $0);
+ printf("seq failed, no such key\n");
+ printf("%05d: input key %d: %s\n", 1, 1, $0);
+ printf("%05d: input key %d: %s\n", 2, 2, $0);
+ exit;
+ }' >> exp
+ fi
+
+ atf_check "$(prog)" -o out $type in
+ atf_check -o file:exp cat out
+}
+
+atf_test_case delete_btree
+delete_btree_head()
+{
+ atf_set "descr" "Checks removing records in btree database"
+}
+delete_btree_body()
+{
+ h_delete btree
+}
+
+atf_test_case delete_recno
+delete_recno_head()
+{
+ atf_set "descr" "Checks removing records in recno database"
+}
+delete_recno_body()
+{
+ h_delete recno
+}
+
+h_repeated()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ echo "" |
+ awk 'BEGIN {
+ for (i = 1; i <= 10; ++i) {
+ printf("p\nkkey1\nD/bin/sh\n");
+ printf("p\nkkey2\nD/bin/csh\n");
+ if (i % 8 == 0) {
+ printf("c\nkkey2\nD/bin/csh\n");
+ printf("c\nkkey1\nD/bin/sh\n");
+ printf("e\t%d of 10 (comparison)\n", i);
+ } else
+ printf("e\t%d of 10 \n", i);
+ printf("r\nkkey1\nr\nkkey2\n");
+ }
+ }' >in
+
+ $(prog) btree in
+}
+
+atf_test_case repeated_btree
+repeated_btree_head()
+{
+ atf_set "descr" \
+ "Checks btree database with repeated small keys and" \
+ "big data pairs. Makes sure that overflow pages are reused"
+}
+repeated_btree_body()
+{
+ h_repeated btree
+}
+
+atf_test_case repeated_hash
+repeated_hash_head()
+{
+ atf_set "descr" \
+ "Checks hash database with repeated small keys and" \
+ "big data pairs. Makes sure that overflow pages are reused"
+}
+repeated_hash_body()
+{
+ h_repeated hash
+}
+
+atf_test_case duplicate_btree
+duplicate_btree_head()
+{
+ atf_set "descr" "Checks btree database with duplicate keys"
+}
+duplicate_btree_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ echo $SEVEN_SEVEN |
+ awk '{
+ for (i = 1; i <= 543; ++i)
+ printf("%05d: input key %d: %s\n", i, i, $0);
+ exit;
+ }' >exp
+
+ cat exp |
+ awk '{
+ if (i++ % 2)
+ printf("p\nkduplicatekey\nd%s\n", $0);
+ else
+ printf("p\nkunique%dkey\nd%s\n", i, $0);
+ }
+ END {
+ printf("o\n");
+ }' >in
+
+ atf_check -o file:exp -x "$(prog) -iflags=1 btree in | sort"
+}
+
+h_cursor_flags()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ type=$1
+
+ echo $SEVEN_SEVEN |
+ awk '{
+ for (i = 1; i <= 20; ++i)
+ printf("%05d: input key %d: %s\n", i, i, $0);
+ exit;
+ }' >exp
+
+ # Test that R_CURSOR doesn't succeed before cursor initialized
+ cat exp |
+ awk '{
+ if (i == 10)
+ exit;
+ printf("p\nk%d\nd%s\n", ++i, $0);
+ }
+ END {
+ printf("fR_CURSOR\nr\n");
+ printf("eR_CURSOR SHOULD HAVE FAILED\n");
+ }' >in
+
+ atf_check -o ignore -e ignore -s ne:0 "$(prog)" -o out $type in
+ atf_check -s ne:0 test -s out
+
+ cat exp |
+ awk '{
+ if (i == 10)
+ exit;
+ printf("p\nk%d\nd%s\n", ++i, $0);
+ }
+ END {
+ printf("fR_CURSOR\np\nk1\ndsome data\n");
+ printf("eR_CURSOR SHOULD HAVE FAILED\n");
+ }' >in
+
+ atf_check -o ignore -e ignore -s ne:0 "$(prog)" -o out $type in
+ atf_check -s ne:0 test -s out
+}
+
+atf_test_case cursor_flags_btree
+cursor_flags_btree_head()
+{
+ atf_set "descr" \
+ "Checks use of cursor flags without initialization in btree database"
+}
+cursor_flags_btree_body()
+{
+ h_cursor_flags btree
+}
+
+atf_test_case cursor_flags_recno
+cursor_flags_recno_head()
+{
+ atf_set "descr" \
+ "Checks use of cursor flags without initialization in recno database"
+}
+cursor_flags_recno_body()
+{
+ h_cursor_flags recno
+}
+
+atf_test_case reverse_order_recno
+reverse_order_recno_head()
+{
+ atf_set "descr" "Checks reverse order inserts in recno database"
+}
+reverse_order_recno_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ echo $SEVEN_SEVEN |
+ awk '{
+ for (i = 1; i <= 779; ++i)
+ printf("%05d: input key %d: %s\n", i, i, $0);
+ exit;
+ }' >exp
+
+ cat exp |
+ awk '{
+ if (i == 0) {
+ i = 1;
+ printf("p\nk1\nd%s\n", $0);
+ printf("%s\n", "fR_IBEFORE");
+ } else
+ printf("p\nk1\nd%s\n", $0);
+ }
+ END {
+ printf("or\n");
+ }' >in
+
+ atf_check -o file:exp "$(prog)" recno in
+}
+
+atf_test_case small_page_btree
+small_page_btree_head()
+{
+ atf_set "descr" \
+ "Checks btree database with lots of keys and small page" \
+ "size: takes the first 20000 entries in the dictionary," \
+ "reverses them, and gives them each a small size data" \
+ "entry. Uses a small page size to make sure the btree" \
+ "split code gets hammered."
+}
+small_page_btree_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ mdata=abcdefghijklmnopqrstuvwxy
+ echo $mdata |
+ awk '{ for (i = 1; i < 20001; ++i) print $0 }' >exp
+
+ for i in `sed 20000q $(dict) | rev`; do
+ echo p
+ echo k$i
+ echo d$mdata
+ echo g
+ echo k$i
+ done >in
+
+ atf_check -o file:exp "$(prog)" -i psize=512 btree in
+}
+
+h_byte_orders()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ type=$1
+
+ sed 50q $(dict) >exp
+ for order in 1234 4321; do
+ for i in `sed 50q $(dict)`; do
+ echo p
+ echo k$i
+ echo d$i
+ echo g
+ echo k$i
+ done >in
+
+ atf_check -o file:exp "$(prog)" -ilorder=$order -f byte.file $type in
+
+ for i in `sed 50q $(dict)`; do
+ echo g
+ echo k$i
+ done >in
+
+ atf_check -o file:exp "$(prog)" -s -ilorder=$order -f byte.file $type in
+ done
+}
+
+atf_test_case byte_orders_btree
+byte_orders_btree_head()
+{
+ atf_set "descr" "Checks btree database using differing byte orders"
+}
+byte_orders_btree_body()
+{
+ h_byte_orders btree
+}
+
+atf_test_case byte_orders_hash
+byte_orders_hash_head()
+{
+ atf_set "descr" "Checks hash database using differing byte orders"
+}
+byte_orders_hash_body()
+{
+ h_byte_orders hash
+}
+
+h_bsize_ffactor()
+{
+ bsize=$1
+ ffactor=$2
+
+ echo "bucketsize $bsize, fill factor $ffactor"
+ atf_check -o file:exp "$(prog)" "-ibsize=$bsize,\
+ffactor=$ffactor,nelem=25000,cachesize=65536" hash in
+}
+
+atf_test_case bsize_ffactor
+bsize_ffactor_head()
+{
+ atf_set "timeout" "480"
+ atf_set "descr" "Checks hash database with various" \
+ "bucketsizes and fill factors"
+}
+bsize_ffactor_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ echo $SEVEN_SEVEN |
+ awk '{
+ for (i = 1; i <= 10000; ++i) {
+ if (i % 34)
+ s = substr($0, 1, i % 34);
+ else
+ s = substr($0, 1);
+ printf("%s\n", s);
+ }
+ exit;
+
+ }' >exp
+
+ sed 10000q $(dict) |
+ awk 'BEGIN {
+ ds="'$SEVEN_SEVEN'"
+ }
+ {
+ if (++i % 34)
+ s = substr(ds, 1, i % 34);
+ else
+ s = substr(ds, 1);
+ printf("p\nk%s\nd%s\n", $0, s);
+ }' >in
+
+ sed 10000q $(dict) |
+ awk '{
+ ++i;
+ printf("g\nk%s\n", $0);
+ }' >>in
+
+ h_bsize_ffactor 256 11
+ h_bsize_ffactor 256 14
+ h_bsize_ffactor 256 21
+
+ h_bsize_ffactor 512 21
+ h_bsize_ffactor 512 28
+ h_bsize_ffactor 512 43
+
+ h_bsize_ffactor 1024 43
+ h_bsize_ffactor 1024 57
+ h_bsize_ffactor 1024 85
+
+ h_bsize_ffactor 2048 85
+ h_bsize_ffactor 2048 114
+ h_bsize_ffactor 2048 171
+
+ h_bsize_ffactor 4096 171
+ h_bsize_ffactor 4096 228
+ h_bsize_ffactor 4096 341
+
+ h_bsize_ffactor 8192 341
+ h_bsize_ffactor 8192 455
+ h_bsize_ffactor 8192 683
+}
+
+# FIXME: what does it test?
+atf_test_case four_char_hash
+four_char_hash_head()
+{
+ atf_set "descr" \
+ "Checks hash database with 4 char key and" \
+ "value insert on a 65536 bucket size"
+}
+four_char_hash_body()
+{
+ TMPDIR="$(pwd)/db_dir"; export TMPDIR
+ mkdir ${TMPDIR}
+
+ cat >in <<EOF
+p
+k1234
+d1234
+r
+k1234
+EOF
+
+ atf_check "$(prog)" -i bsize=65536 hash in
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case small_btree
+ atf_add_test_case small_hash
+ atf_add_test_case small_recno
+ atf_add_test_case medium_btree
+ atf_add_test_case medium_hash
+ atf_add_test_case medium_recno
+ atf_add_test_case big_btree
+ atf_add_test_case big_hash
+ atf_add_test_case big_recno
+ atf_add_test_case random_recno
+ atf_add_test_case reverse_recno
+ atf_add_test_case alternate_recno
+ atf_add_test_case delete_btree
+ atf_add_test_case delete_recno
+ atf_add_test_case repeated_btree
+ atf_add_test_case repeated_hash
+ atf_add_test_case duplicate_btree
+ atf_add_test_case cursor_flags_btree
+ atf_add_test_case cursor_flags_recno
+ atf_add_test_case reverse_order_recno
+ atf_add_test_case small_page_btree
+ atf_add_test_case byte_orders_btree
+ atf_add_test_case byte_orders_hash
+ atf_add_test_case bsize_ffactor
+ atf_add_test_case four_char_hash
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c b/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c
new file mode 100644
index 0000000..32de6e7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c
@@ -0,0 +1,58 @@
+/* $NetBSD: t_execve.c,v 1.1 2014/04/29 06:29:02 uebayasi Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <errno.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <unistd.h>
+
+ATF_TC(t_execve_null);
+
+ATF_TC_HEAD(t_execve_null, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Tests an empty execve(2) executing");
+}
+
+ATF_TC_BODY(t_execve_null, tc)
+{
+ int err;
+
+ err = execve(NULL, NULL, NULL);
+ ATF_REQUIRE(err == -1);
+ ATF_REQUIRE(errno == EFAULT);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_execve_null);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/isqemu.h b/contrib/netbsd-tests/lib/libc/gen/isqemu.h
new file mode 100644
index 0000000..7d73a22
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/isqemu.h
@@ -0,0 +1,63 @@
+/* $NetBSD: isqemu.h,v 1.3 2013/04/14 12:46:29 martin Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 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/sysctl.h>
+#include <stdbool.h>
+#include <string.h>
+#include <errno.h>
+#include <err.h>
+
+static __inline bool
+isQEMU(void) {
+#if defined(__i386__) || defined(__x86_64__)
+ char name[1024];
+ size_t len = sizeof(name);
+
+ if (sysctlbyname("machdep.cpu_brand", name, &len, NULL, 0) == -1) {
+ if (errno == ENOENT)
+ return false;
+ err(EXIT_FAILURE, "sysctl");
+ }
+ return strstr(name, "QEMU") != NULL;
+#else
+ return false;
+#endif
+}
+
+#ifdef TEST
+int
+main(void) {
+ return isQEMU();
+}
+#endif
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_fileactions.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_fileactions.c
new file mode 100644
index 0000000..d923370
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_fileactions.c
@@ -0,0 +1,104 @@
+/* $NetBSD: h_fileactions.c,v 1.1 2012/02/13 21:03:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles Zhang <charles@NetBSD.org> and
+ * Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 <unistd.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+#define BUFSIZE 16
+
+/*
+ * This checks (hardcoded) the assumptions that are setup from the
+ * main test program via posix spawn file actions.
+ * Program exits with EXIT_SUCCESS or EXIT_FAILURE accordingly
+ * (and does some stderr diagnostics in case of errors).
+ */
+int
+main(int argc, char **argv)
+{
+ int res = EXIT_SUCCESS;
+ char buf[BUFSIZE];
+ struct stat sb0, sb1;
+
+ strcpy(buf, "test...");
+ /* file desc 3 should be closed via addclose */
+ if (read(3, buf, BUFSIZE) != -1 || errno != EBADF) {
+ fprintf(stderr, "%s: filedesc 3 is not closed\n",
+ getprogname());
+ res = EXIT_FAILURE;
+ }
+ /* file desc 4 should be closed via closeonexec */
+ if (read(4, buf, BUFSIZE) != -1 || errno != EBADF) {
+ fprintf(stderr, "%s: filedesc 4 is not closed\n",
+ getprogname());
+ res = EXIT_FAILURE;
+ }
+ /* file desc 5 remains open */
+ if (write(5, buf, BUFSIZE) <= 0) {
+ fprintf(stderr, "%s: could not write to filedesc 5\n",
+ getprogname());
+ res = EXIT_FAILURE;
+ }
+ /* file desc 6 should be open (via addopen) */
+ if (write(6, buf, BUFSIZE) <= 0) {
+ fprintf(stderr, "%s: could not write to filedesc 6\n",
+ getprogname());
+ res = EXIT_FAILURE;
+ }
+ /* file desc 7 should refer to stdout */
+ fflush(stdout);
+ if (fstat(fileno(stdout), &sb0) != 0) {
+ fprintf(stderr, "%s: could not fstat stdout\n",
+ getprogname());
+ res = EXIT_FAILURE;
+ }
+ if (fstat(7, &sb1) != 0) {
+ fprintf(stderr, "%s: could not fstat filedesc 7\n",
+ getprogname());
+ res = EXIT_FAILURE;
+ }
+ if (write(7, buf, strlen(buf)) <= 0) {
+ fprintf(stderr, "%s: could not write to filedesc 7\n",
+ getprogname());
+ res = EXIT_FAILURE;
+ }
+ if (memcmp(&sb0, &sb1, sizeof sb0) != 0) {
+ fprintf(stderr, "%s: stat results differ\n", getprogname());
+ res = EXIT_FAILURE;
+ }
+
+ return res;
+}
+
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_nonexec.sh b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_nonexec.sh
new file mode 100755
index 0000000..deee6fe
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_nonexec.sh
@@ -0,0 +1,3 @@
+#! /nonexistent
+
+# this is just a dummy script, trying to be non-executable
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_spawn.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_spawn.c
new file mode 100644
index 0000000..dbf5da5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_spawn.c
@@ -0,0 +1,50 @@
+/* $NetBSD: h_spawn.c,v 1.1 2012/02/13 21:03:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles Zhang <charles@NetBSD.org> and
+ * Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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>
+
+int
+main(int argc, char **argv)
+{
+ unsigned long ret;
+ char *endp;
+
+ if (argc < 2) {
+ fprintf(stderr, "usage:\n\t%s (retcode)\n", getprogname());
+ exit(255);
+ }
+ ret = strtoul(argv[1], &endp, 10);
+
+ fprintf(stderr, "%s exiting with status %lu\n", getprogname(), ret);
+ return ret;
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_spawnattr.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_spawnattr.c
new file mode 100644
index 0000000..1f13c54
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_spawnattr.c
@@ -0,0 +1,90 @@
+/* $NetBSD: h_spawnattr.c,v 1.1 2012/02/13 21:03:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles Zhang <charles@NetBSD.org> and
+ * Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+
+/*
+ * Helper to test the hardcoded assumptions from t_spawnattr.c
+ * Exit with apropriate exit status and print diagnostics to
+ * stderr explaining what is wrong.
+ */
+int
+main(int argc, char **argv)
+{
+ int parent_pipe, res = EXIT_SUCCESS;
+ sigset_t sig;
+ struct sigaction act;
+ ssize_t rd;
+ char tmp;
+
+ sigemptyset(&sig);
+ if (sigprocmask(0, NULL, &sig) < 0) {
+ fprintf(stderr, "%s: sigprocmask error\n", getprogname());
+ res = EXIT_FAILURE;
+ }
+ if (!sigismember(&sig, SIGUSR1)) {
+ fprintf(stderr, "%s: SIGUSR not in procmask\n", getprogname());
+ res = EXIT_FAILURE;
+ }
+ if (sigaction(SIGUSR1, NULL, &act) < 0) {
+ fprintf(stderr, "%s: sigaction error\n", getprogname());
+ res = EXIT_FAILURE;
+ }
+ if (act.sa_sigaction != (void *)SIG_DFL) {
+ fprintf(stderr, "%s: SIGUSR1 action != SIG_DFL\n",
+ getprogname());
+ res = EXIT_FAILURE;
+ }
+
+ if (argc >= 2) {
+ parent_pipe = atoi(argv[1]);
+ if (parent_pipe > 2) {
+ printf("%s: waiting for command from parent on pipe "
+ "%d\n", getprogname(), parent_pipe);
+ rd = read(parent_pipe, &tmp, 1);
+ if (rd == 1) {
+ printf("%s: got command %c from parent\n",
+ getprogname(), tmp);
+ } else if (rd == -1) {
+ printf("%s: %d is no pipe, errno %d\n",
+ getprogname(), parent_pipe, errno);
+ res = EXIT_FAILURE;
+ }
+ }
+ }
+
+ return res;
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
new file mode 100644
index 0000000..1cf6433
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
@@ -0,0 +1,385 @@
+/* $NetBSD: t_fileactions.c,v 1.5 2012/04/09 19:42:07 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles Zhang <charles@NetBSD.org> and
+ * Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <spawn.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+
+ATF_TC(t_spawn_openmode);
+
+ATF_TC_HEAD(t_spawn_openmode, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test the proper handling of 'mode' for 'open' fileactions");
+ atf_tc_set_md_var(tc, "require.progs", "/bin/cat");
+}
+
+static off_t
+filesize(const char * restrict fname)
+{
+ struct stat st;
+ int err;
+
+ err = stat(fname, &st);
+ ATF_REQUIRE(err == 0);
+ return st.st_size;
+}
+
+#define TESTFILE "./the_input_data"
+#define CHECKFILE "./the_output_data"
+#define TESTCONTENT "marry has a little lamb"
+
+static void
+make_testfile(const char *restrict file)
+{
+ FILE *f;
+ size_t written;
+
+ f = fopen(file, "w");
+ ATF_REQUIRE(f != NULL);
+ written = fwrite(TESTCONTENT, 1, strlen(TESTCONTENT), f);
+ fclose(f);
+ ATF_REQUIRE(written == strlen(TESTCONTENT));
+}
+
+static void
+empty_outfile(const char *restrict filename)
+{
+ FILE *f;
+
+ f = fopen(filename, "w");
+ ATF_REQUIRE(f != NULL);
+ fclose(f);
+}
+
+ATF_TC_BODY(t_spawn_openmode, tc)
+{
+ int status, err;
+ pid_t pid;
+ size_t insize, outsize;
+ char * const args[2] = { __UNCONST("cat"), NULL };
+ posix_spawn_file_actions_t fa;
+
+ /*
+ * try a "cat < testfile > checkfile"
+ */
+ make_testfile(TESTFILE);
+ unlink(CHECKFILE);
+
+ posix_spawn_file_actions_init(&fa);
+ posix_spawn_file_actions_addopen(&fa, fileno(stdin),
+ TESTFILE, O_RDONLY, 0);
+ posix_spawn_file_actions_addopen(&fa, fileno(stdout),
+ CHECKFILE, O_WRONLY|O_CREAT, 0600);
+ err = posix_spawn(&pid, "/bin/cat", &fa, NULL, args, NULL);
+ posix_spawn_file_actions_destroy(&fa);
+
+ ATF_REQUIRE(err == 0);
+
+ /* ok, wait for the child to finish */
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS);
+
+ /* now check that input and output have the same size */
+ insize = filesize(TESTFILE);
+ outsize = filesize(CHECKFILE);
+ ATF_REQUIRE(insize == strlen(TESTCONTENT));
+ ATF_REQUIRE(insize == outsize);
+
+ /*
+ * try a "cat < testfile >> checkfile"
+ */
+ make_testfile(TESTFILE);
+ make_testfile(CHECKFILE);
+
+ posix_spawn_file_actions_init(&fa);
+ posix_spawn_file_actions_addopen(&fa, fileno(stdin),
+ TESTFILE, O_RDONLY, 0);
+ posix_spawn_file_actions_addopen(&fa, fileno(stdout),
+ CHECKFILE, O_WRONLY|O_APPEND, 0);
+ err = posix_spawn(&pid, "/bin/cat", &fa, NULL, args, NULL);
+ posix_spawn_file_actions_destroy(&fa);
+
+ ATF_REQUIRE(err == 0);
+
+ /* ok, wait for the child to finish */
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS);
+
+ /* now check that output is twice as long as input */
+ insize = filesize(TESTFILE);
+ outsize = filesize(CHECKFILE);
+ ATF_REQUIRE(insize == strlen(TESTCONTENT));
+ ATF_REQUIRE(insize*2 == outsize);
+
+ /*
+ * try a "cat < testfile > checkfile" with input and output swapped
+ */
+ make_testfile(TESTFILE);
+ empty_outfile(CHECKFILE);
+
+ posix_spawn_file_actions_init(&fa);
+ posix_spawn_file_actions_addopen(&fa, fileno(stdout),
+ TESTFILE, O_RDONLY, 0);
+ posix_spawn_file_actions_addopen(&fa, fileno(stdin),
+ CHECKFILE, O_WRONLY, 0);
+ err = posix_spawn(&pid, "/bin/cat", &fa, NULL, args, NULL);
+ posix_spawn_file_actions_destroy(&fa);
+
+ ATF_REQUIRE(err == 0);
+
+ /* ok, wait for the child to finish */
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_FAILURE);
+
+ /* now check that input and output are still the same size */
+ insize = filesize(TESTFILE);
+ outsize = filesize(CHECKFILE);
+ ATF_REQUIRE(insize == strlen(TESTCONTENT));
+ ATF_REQUIRE(outsize == 0);
+}
+
+ATF_TC(t_spawn_reopen);
+
+ATF_TC_HEAD(t_spawn_reopen, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "an open filehandle can be replaced by a 'open' fileaction");
+ atf_tc_set_md_var(tc, "require.progs", "/bin/cat");
+}
+
+ATF_TC_BODY(t_spawn_reopen, tc)
+{
+ int status, err;
+ pid_t pid;
+ char * const args[2] = { __UNCONST("cat"), NULL };
+ posix_spawn_file_actions_t fa;
+
+ /*
+ * make sure stdin is open in the parent
+ */
+ freopen("/dev/zero", "r", stdin);
+ /*
+ * now request an open for this fd again in the child
+ */
+ posix_spawn_file_actions_init(&fa);
+ posix_spawn_file_actions_addopen(&fa, fileno(stdin),
+ "/dev/null", O_RDONLY, 0);
+ err = posix_spawn(&pid, "/bin/cat", &fa, NULL, args, NULL);
+ posix_spawn_file_actions_destroy(&fa);
+
+ ATF_REQUIRE(err == 0);
+
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS);
+}
+
+ATF_TC(t_spawn_open_nonexistent);
+
+ATF_TC_HEAD(t_spawn_open_nonexistent, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "posix_spawn fails when a file to open does not exist");
+ atf_tc_set_md_var(tc, "require.progs", "/bin/cat");
+}
+
+ATF_TC_BODY(t_spawn_open_nonexistent, tc)
+{
+ int err, status;
+ pid_t pid;
+ char * const args[2] = { __UNCONST("cat"), NULL };
+ posix_spawn_file_actions_t fa;
+
+ posix_spawn_file_actions_init(&fa);
+ posix_spawn_file_actions_addopen(&fa, STDIN_FILENO,
+ "./non/ex/ist/ent", O_RDONLY, 0);
+ err = posix_spawn(&pid, "/bin/cat", &fa, NULL, args, NULL);
+ if (err == 0) {
+ /*
+ * The child has been created - it should fail and
+ * return exit code 127
+ */
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 127);
+ } else {
+ /*
+ * The error has been noticed early enough, no child has
+ * been run
+ */
+ ATF_REQUIRE(err == ENOENT);
+ }
+ posix_spawn_file_actions_destroy(&fa);
+}
+
+ATF_TC(t_spawn_open_nonexistent_diag);
+
+ATF_TC_HEAD(t_spawn_open_nonexistent_diag, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "posix_spawn fails when a file to open does not exist "
+ "and delivers proper diagnostic");
+ atf_tc_set_md_var(tc, "require.progs", "/bin/cat");
+}
+
+ATF_TC_BODY(t_spawn_open_nonexistent_diag, tc)
+{
+ int err;
+ pid_t pid;
+ char * const args[2] = { __UNCONST("cat"), NULL };
+ posix_spawnattr_t attr;
+ posix_spawn_file_actions_t fa;
+
+ posix_spawnattr_init(&attr);
+ /*
+ * POSIX_SPAWN_RETURNERROR is a NetBSD specific flag that
+ * will cause a "proper" return value from posix_spawn(2)
+ * instead of a (potential) success there and a 127 exit
+ * status from the child process (c.f. the non-diag variant
+ * of this test).
+ */
+ posix_spawnattr_setflags(&attr, POSIX_SPAWN_RETURNERROR);
+ posix_spawn_file_actions_init(&fa);
+ posix_spawn_file_actions_addopen(&fa, STDIN_FILENO,
+ "./non/ex/ist/ent", O_RDONLY, 0);
+ err = posix_spawn(&pid, "/bin/cat", &fa, &attr, args, NULL);
+ ATF_REQUIRE(err == ENOENT);
+ posix_spawn_file_actions_destroy(&fa);
+ posix_spawnattr_destroy(&attr);
+}
+
+ATF_TC(t_spawn_fileactions);
+
+ATF_TC_HEAD(t_spawn_fileactions, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Tests various complex fileactions");
+}
+
+ATF_TC_BODY(t_spawn_fileactions, tc)
+{
+ int fd1, fd2, fd3, status, err;
+ pid_t pid;
+ char * const args[2] = { __UNCONST("h_fileactions"), NULL };
+ char helper[FILENAME_MAX];
+ posix_spawn_file_actions_t fa;
+
+ posix_spawn_file_actions_init(&fa);
+
+ closefrom(fileno(stderr)+1);
+
+ fd1 = open("/dev/null", O_RDONLY);
+ ATF_REQUIRE(fd1 == 3);
+
+ fd2 = open("/dev/null", O_WRONLY, O_CLOEXEC);
+ ATF_REQUIRE(fd2 == 4);
+
+ fd3 = open("/dev/null", O_WRONLY);
+ ATF_REQUIRE(fd3 == 5);
+
+ posix_spawn_file_actions_addclose(&fa, fd1);
+ posix_spawn_file_actions_addopen(&fa, 6, "/dev/null", O_RDWR, 0);
+ posix_spawn_file_actions_adddup2(&fa, 1, 7);
+
+ snprintf(helper, sizeof helper, "%s/h_fileactions",
+ atf_tc_get_config_var(tc, "srcdir"));
+ err = posix_spawn(&pid, helper, &fa, NULL, args, NULL);
+ posix_spawn_file_actions_destroy(&fa);
+
+ ATF_REQUIRE(err == 0);
+
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS);
+}
+
+ATF_TC(t_spawn_empty_fileactions);
+
+ATF_TC_HEAD(t_spawn_empty_fileactions, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "posix_spawn with empty fileactions (PR kern/46038)");
+ atf_tc_set_md_var(tc, "require.progs", "/bin/cat");
+}
+
+ATF_TC_BODY(t_spawn_empty_fileactions, tc)
+{
+ int status, err;
+ pid_t pid;
+ char * const args[2] = { __UNCONST("cat"), NULL };
+ posix_spawn_file_actions_t fa;
+ size_t insize, outsize;
+
+ /*
+ * try a "cat < testfile > checkfile", but set up stdin/stdout
+ * already in the parent and pass empty file actions to the child.
+ */
+ make_testfile(TESTFILE);
+ unlink(CHECKFILE);
+
+ freopen(TESTFILE, "r", stdin);
+ freopen(CHECKFILE, "w", stdout);
+
+ posix_spawn_file_actions_init(&fa);
+ err = posix_spawn(&pid, "/bin/cat", &fa, NULL, args, NULL);
+ posix_spawn_file_actions_destroy(&fa);
+
+ ATF_REQUIRE(err == 0);
+
+ /* ok, wait for the child to finish */
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS);
+
+ /* now check that input and output have the same size */
+ insize = filesize(TESTFILE);
+ outsize = filesize(CHECKFILE);
+ ATF_REQUIRE(insize == strlen(TESTCONTENT));
+ ATF_REQUIRE(insize == outsize);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_spawn_fileactions);
+ ATF_TP_ADD_TC(tp, t_spawn_open_nonexistent);
+ ATF_TP_ADD_TC(tp, t_spawn_open_nonexistent_diag);
+ ATF_TP_ADD_TC(tp, t_spawn_reopen);
+ ATF_TP_ADD_TC(tp, t_spawn_openmode);
+ ATF_TP_ADD_TC(tp, t_spawn_empty_fileactions);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c
new file mode 100644
index 0000000..178374b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c
@@ -0,0 +1,184 @@
+/* $NetBSD: t_spawn.c,v 1.1 2012/02/13 21:03:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles Zhang <charles@NetBSD.org> and
+ * Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 <atf-c.h>
+#include <spawn.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/wait.h>
+
+ATF_TC(t_spawn_ls);
+
+ATF_TC_HEAD(t_spawn_ls, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Tests a simple posix_spawn executing /bin/ls");
+}
+
+ATF_TC_BODY(t_spawn_ls, tc)
+{
+ char * const args[] = { __UNCONST("ls"), __UNCONST("-la"), NULL };
+ int err;
+
+ err = posix_spawn(NULL, "/bin/ls", NULL, NULL, args, NULL);
+ ATF_REQUIRE(err == 0);
+}
+
+ATF_TC(t_spawnp_ls);
+
+ATF_TC_HEAD(t_spawnp_ls, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Tests a simple posix_spawnp executing ls via $PATH");
+}
+
+ATF_TC_BODY(t_spawnp_ls, tc)
+{
+ char * const args[] = { __UNCONST("ls"), __UNCONST("-la"), NULL };
+ int err;
+
+ err = posix_spawnp(NULL, "ls", NULL, NULL, args, NULL);
+ ATF_REQUIRE(err == 0);
+}
+
+ATF_TC(t_spawn_zero);
+
+ATF_TC_HEAD(t_spawn_zero, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "posix_spawn an invalid binary");
+}
+
+ATF_TC_BODY(t_spawn_zero, tc)
+{
+ char buf[FILENAME_MAX];
+ char * const args[] = { __UNCONST("h_zero"), NULL };
+ int err;
+
+ snprintf(buf, sizeof buf, "%s/h_zero", atf_tc_get_config_var(tc, "srcdir"));
+ err = posix_spawn(NULL, buf, NULL, NULL, args, NULL);
+ ATF_REQUIRE_MSG(err == ENOEXEC, "expected error %d, got %d when spawning %s", ENOEXEC, err, buf);
+}
+
+ATF_TC(t_spawn_missing);
+
+ATF_TC_HEAD(t_spawn_missing, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "posix_spawn a non existant binary");
+}
+
+ATF_TC_BODY(t_spawn_missing, tc)
+{
+ char buf[FILENAME_MAX];
+ char * const args[] = { __UNCONST("h_nonexist"), NULL };
+ int err;
+
+ snprintf(buf, sizeof buf, "%s/h_nonexist",
+ atf_tc_get_config_var(tc, "srcdir"));
+ err = posix_spawn(NULL, buf, NULL, NULL, args, NULL);
+ ATF_REQUIRE_MSG(err == ENOENT, "expected error %d, got %d when spawning %s", ENOENT, err, buf);
+}
+
+ATF_TC(t_spawn_nonexec);
+
+ATF_TC_HEAD(t_spawn_nonexec, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "posix_spawn a script with non existing interpreter");
+}
+
+ATF_TC_BODY(t_spawn_nonexec, tc)
+{
+ char buf[FILENAME_MAX];
+ char * const args[] = { __UNCONST("h_nonexec"), NULL };
+ int err;
+
+ snprintf(buf, sizeof buf, "%s/h_nonexec",
+ atf_tc_get_config_var(tc, "srcdir"));
+ err = posix_spawn(NULL, buf, NULL, NULL, args, NULL);
+ ATF_REQUIRE_MSG(err == ENOENT, "expected error %d, got %d when spawning %s", ENOENT, err, buf);
+}
+
+ATF_TC(t_spawn_child);
+
+ATF_TC_HEAD(t_spawn_child, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "posix_spawn a child and get it's return code");
+}
+
+ATF_TC_BODY(t_spawn_child, tc)
+{
+ char buf[FILENAME_MAX];
+ char * const args0[] = { __UNCONST("h_spawn"), __UNCONST("0"), NULL };
+ char * const args1[] = { __UNCONST("h_spawn"), __UNCONST("1"), NULL };
+ char * const args7[] = { __UNCONST("h_spawn"), __UNCONST("7"), NULL };
+ int err, status;
+ pid_t pid;
+
+ snprintf(buf, sizeof buf, "%s/h_spawn",
+ atf_tc_get_config_var(tc, "srcdir"));
+
+ err = posix_spawn(&pid, buf, NULL, NULL, args0, NULL);
+ ATF_REQUIRE(err == 0);
+ ATF_REQUIRE(pid > 0);
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 0);
+
+ err = posix_spawn(&pid, buf, NULL, NULL, args1, NULL);
+ ATF_REQUIRE(err == 0);
+ ATF_REQUIRE(pid > 0);
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 1);
+
+ err = posix_spawn(&pid, buf, NULL, NULL, args7, NULL);
+ ATF_REQUIRE(err == 0);
+ ATF_REQUIRE(pid > 0);
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 7);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_spawn_ls);
+ ATF_TP_ADD_TC(tp, t_spawnp_ls);
+ ATF_TP_ADD_TC(tp, t_spawn_zero);
+ ATF_TP_ADD_TC(tp, t_spawn_missing);
+ ATF_TP_ADD_TC(tp, t_spawn_nonexec);
+ ATF_TP_ADD_TC(tp, t_spawn_child);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
new file mode 100644
index 0000000..eb99c41
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
@@ -0,0 +1,173 @@
+/* $NetBSD: t_spawnattr.c,v 1.1 2012/02/13 21:03:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles Zhang <charles@NetBSD.org> and
+ * Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sched.h>
+#include <signal.h>
+#include <spawn.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+#define MAX(a, b) (a) > (b) ? (a) : (b)
+#define MIN(a, b) (a) > (b) ? (b) : (a)
+
+static int get_different_scheduler(void);
+static int get_different_priority(void);
+
+static int
+get_different_scheduler()
+{
+ int scheduler, max, min, new;
+
+ max = MAX(MAX(SCHED_FIFO, SCHED_OTHER), SCHED_RR);
+ min = MIN(MIN(SCHED_FIFO, SCHED_OTHER), SCHED_RR);
+
+ /* get current schedule policy */
+ scheduler = sched_getscheduler(0);
+
+ /* new scheduler */
+ new = (scheduler + 1);
+ if (new > max)
+ new = min;
+
+ return new;
+}
+
+static int
+get_different_priority()
+{
+ int scheduler, max, min, new, priority;
+ struct sched_param param;
+
+ /* get current schedule policy */
+ scheduler = sched_getscheduler(0);
+
+ max = sched_get_priority_max(scheduler);
+ min = sched_get_priority_min(scheduler);
+
+ sched_getparam(0, &param);
+ priority = param.sched_priority;
+
+ /* new schedule policy */
+ new = (priority + 1);
+ if (new > max)
+ new = min;
+
+ return new;
+}
+
+ATF_TC(t_spawnattr);
+
+ATF_TC_HEAD(t_spawnattr, tc)
+{
+ atf_tc_set_md_var(tc, "require.user", "root");
+ atf_tc_set_md_var(tc, "descr",
+ "Tests posix_spawn with scheduler attributes");
+}
+
+ATF_TC_BODY(t_spawnattr, tc)
+{
+ int pid, scheduler, child_scheduler, priority, status, err, pfd[2];
+ char helper_arg[128];
+ char * const args[] = { __UNCONST("h_spawnattr"), helper_arg, NULL };
+ struct sched_param sp, child_sp;
+ sigset_t sig;
+ posix_spawnattr_t attr;
+ char helper[FILENAME_MAX];
+
+ /*
+ * create a pipe to controll the child
+ */
+ err = pipe(pfd);
+ ATF_REQUIRE_MSG(err == 0, "could not create pipe, errno %d", errno);
+ sprintf(helper_arg, "%d", pfd[0]);
+
+ posix_spawnattr_init(&attr);
+
+ scheduler = get_different_scheduler();
+ priority = get_different_priority();
+ sp.sched_priority = priority;
+
+ sigemptyset(&sig);
+ sigaddset(&sig, SIGUSR1);
+
+ posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSCHEDULER |
+ POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETPGROUP |
+ POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF |
+ POSIX_SPAWN_SETSIGDEF);
+ posix_spawnattr_setpgroup(&attr, 0);
+ posix_spawnattr_setschedparam(&attr, &sp);
+ posix_spawnattr_setschedpolicy(&attr, scheduler);
+ posix_spawnattr_setsigmask(&attr, &sig);
+ posix_spawnattr_setsigdefault(&attr, &sig);
+
+ sprintf(helper, "%s/h_spawnattr",
+ atf_tc_get_config_var(tc, "srcdir"));
+ err = posix_spawn(&pid, helper, NULL, &attr, args, NULL);
+ ATF_REQUIRE_MSG(err == 0, "error %d", err);
+
+ child_scheduler = sched_getscheduler(pid);
+ ATF_REQUIRE_MSG(scheduler == child_scheduler,
+ "scheduler = %d, child_scheduler = %d, pid %d, errno %d",
+ scheduler, child_scheduler, pid, errno);
+
+ sched_getparam(pid, &child_sp);
+ ATF_REQUIRE_MSG(child_sp.sched_priority == sp.sched_priority,
+ "priority is: %d, but we requested: %d",
+ child_sp.sched_priority, sp.sched_priority);
+
+ ATF_REQUIRE_MSG(pid == getpgid(pid), "child pid: %d, child pgid: %d",
+ pid, getpgid(pid));
+
+ /* ready, let child go */
+ write(pfd[1], "q", 1);
+ close(pfd[0]);
+ close(pfd[1]);
+
+ /* wait and check result from child */
+ waitpid(pid, &status, 0);
+ ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS);
+
+ posix_spawnattr_destroy(&attr);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_spawnattr);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_alarm.c b/contrib/netbsd-tests/lib/libc/gen/t_alarm.c
new file mode 100644
index 0000000..d9e903d1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_alarm.c
@@ -0,0 +1,150 @@
+/* $NetBSD: t_alarm.c,v 1.2 2011/05/10 06:58:17 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_alarm.c,v 1.2 2011/05/10 06:58:17 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+
+static bool fail;
+static void handler(int);
+
+static void
+handler(int signo)
+{
+
+ if (signo == SIGALRM)
+ fail = false;
+}
+
+ATF_TC(alarm_basic);
+ATF_TC_HEAD(alarm_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of alarm(3)");
+}
+
+ATF_TC_BODY(alarm_basic, tc)
+{
+
+ ATF_REQUIRE(signal(SIGALRM, handler) == 0);
+
+ fail = true;
+
+ (void)alarm(1);
+ (void)sleep(2);
+
+ if (fail != false)
+ atf_tc_fail("alarm(3) failed to deliver signal");
+}
+
+ATF_TC(alarm_fork);
+ATF_TC_HEAD(alarm_fork, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Does fork(2) clear a pending alarm?");
+}
+
+ATF_TC_BODY(alarm_fork, tc)
+{
+ unsigned int rv;
+ pid_t pid;
+ int sta;
+
+ /*
+ * Any pending alarms should be
+ * cleared in the child process.
+ */
+ (void)alarm(60);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ rv = alarm(0);
+
+ if (rv != 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)alarm(0);
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("pending alarm was not cleared for child");
+}
+
+ATF_TC(alarm_previous);
+ATF_TC_HEAD(alarm_previous, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test return value from alarm(3)");
+}
+
+ATF_TC_BODY(alarm_previous, tc)
+{
+ unsigned int rv;
+
+ /*
+ * See that alarm(3) returns the amount
+ * left on the timer from the previous call.
+ */
+ rv = alarm(60);
+
+ if (rv != 0)
+ goto fail;
+
+ rv = alarm(0);
+
+ if (rv < 50)
+ goto fail;
+
+ (void)alarm(0);
+
+ return;
+
+fail:
+ atf_tc_fail("invalid return value from alarm(3)");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, alarm_basic);
+ ATF_TP_ADD_TC(tp, alarm_fork);
+ ATF_TP_ADD_TC(tp, alarm_previous);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_assert.c b/contrib/netbsd-tests/lib/libc/gen/t_assert.c
new file mode 100644
index 0000000..140417a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_assert.c
@@ -0,0 +1,132 @@
+/* $NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static void handler(int);
+
+static void
+handler(int signo)
+{
+ /* Nothing. */
+}
+
+ATF_TC(assert_false);
+ATF_TC_HEAD(assert_false, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that assert(3) works, #1");
+}
+
+ATF_TC_BODY(assert_false, tc)
+{
+ struct sigaction sa;
+ pid_t pid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ (void)closefrom(0);
+ (void)memset(&sa, 0, sizeof(struct sigaction));
+
+ sa.sa_flags = 0;
+ sa.sa_handler = handler;
+
+ (void)sigemptyset(&sa.sa_mask);
+ (void)sigaction(SIGABRT, &sa, 0);
+
+ assert(1 == 1);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFSIGNALED(sta) != 0 || WIFEXITED(sta) == 0)
+ atf_tc_fail("assert(3) fired haphazardly");
+}
+
+ATF_TC(assert_true);
+ATF_TC_HEAD(assert_true, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that assert(3) works, #2");
+}
+
+ATF_TC_BODY(assert_true, tc)
+{
+ struct sigaction sa;
+ pid_t pid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ (void)closefrom(0);
+ (void)memset(&sa, 0, sizeof(struct sigaction));
+
+ sa.sa_flags = 0;
+ sa.sa_handler = handler;
+
+ (void)sigemptyset(&sa.sa_mask);
+ (void)sigaction(SIGABRT, &sa, 0);
+
+ assert(1 == 2);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != SIGABRT)
+ atf_tc_fail("assert(3) did not fire");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, assert_false);
+ ATF_TP_ADD_TC(tp, assert_true);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c b/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c
new file mode 100644
index 0000000..6c82cb4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c
@@ -0,0 +1,200 @@
+/* $NetBSD: t_basedirname.c,v 1.2 2011/07/07 09:49:59 jruoho Exp $ */
+
+/*
+ * Regression test for basename(3).
+ *
+ * Written by Jason R. Thorpe <thorpej@NetBSD.org>, Oct. 2002.
+ * Public domain.
+ */
+
+#include <atf-c.h>
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libgen.h>
+
+struct {
+ const char *input;
+ const char *output;
+} test_basename_table[] = {
+/*
+ * The following are taken from the "Sample Input and Output Strings
+ * for basename()" table in IEEE Std 1003.1-2001.
+ */
+ { "/usr/lib", "lib" },
+ { "/usr/", "usr" },
+ { "/", "/" },
+ { "///", "/" },
+ { "//usr//lib//", "lib" },
+/*
+ * IEEE Std 1003.1-2001:
+ *
+ * If path is a null pointer or points to an empty string,
+ * basename() shall return a pointer to the string "." .
+ */
+ { "", "." },
+ { NULL, "." },
+/*
+ * IEEE Std 1003.1-2001:
+ *
+ * If the string is exactly "//", it is implementation-defined
+ * whether "/" or "//" is returned.
+ *
+ * The NetBSD implementation returns "/".
+ */
+ { "//", "/" },
+
+ { NULL, NULL }
+};
+
+struct {
+ const char *input;
+ const char *output;
+} test_dirname_table[] = {
+/*
+ * The following are taken from the "Sample Input and Output Strings
+ * for dirname()" table in IEEE Std 1003.1-2001.
+ */
+ { "/usr/lib", "/usr" },
+ { "/usr/", "/" },
+ { "usr", "." },
+ { "/", "/" },
+ { ".", "." },
+ { "..", "." },
+/*
+ * IEEE Std 1003.1-2001:
+ *
+ * If path is a null pointer or points to an empty string,
+ * dirname() shall return a pointer to the string "." .
+ */
+ { "", "." },
+ { NULL, "." },
+/*
+ * IEEE Std 1003.1-2001:
+ *
+ * Since the meaning of the leading "//" is implementation-defined,
+ * dirname("//foo") may return either "//" or "/" (but nothing else).
+ *
+ * The NetBSD implementation returns "/".
+ */
+ { "//foo", "/" },
+/*
+ * Make sure the trailing slashes after the directory name component
+ * get trimmed. The Std does not talk about this, but this is what
+ * Solaris 8's dirname(3) does.
+ */
+ { "/usr///lib", "/usr" },
+
+ { NULL, NULL }
+};
+
+ATF_TC(basename_posix);
+ATF_TC_HEAD(basename_posix, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test basename(3) with POSIX examples");
+}
+
+ATF_TC_BODY(basename_posix, tc)
+{
+ char testbuf[32], *base;
+ int i;
+
+ for (i = 0; test_basename_table[i].output != NULL; i++) {
+ if (test_basename_table[i].input != NULL) {
+ if (strlen(test_basename_table[i].input) >=
+ sizeof(testbuf))
+ atf_tc_skip("Testbuf too small!");
+ strcpy(testbuf, test_basename_table[i].input);
+ base = basename(testbuf);
+ } else
+ base = basename(NULL);
+
+ /*
+ * basename(3) is allowed to modify the input buffer.
+ * However, that is considered hostile by some programs,
+ * and so we elect to consider this an error.
+ *
+ * This is not a problem, as basename(3) is also allowed
+ * to return a pointer to a statically-allocated buffer
+ * (it is explicitly not required to be reentrant).
+ */
+ if (test_basename_table[i].input != NULL &&
+ strcmp(test_basename_table[i].input, testbuf) != 0) {
+ fprintf(stderr,
+ "Input buffer for \"%s\" was modified\n",
+ test_basename_table[i].input);
+ atf_tc_fail("Input buffer was modified.");
+ }
+
+ /* Make sure the result is correct. */
+ if (strcmp(test_basename_table[i].output, base) != 0) {
+ fprintf(stderr,
+ "Input \"%s\", output \"%s\", expected \"%s\"\n",
+ test_basename_table[i].input ==
+ NULL ? "(null)" : test_basename_table[i].input,
+ base, test_basename_table[i].output);
+ atf_tc_fail("Output does not match expected value.");
+ }
+ }
+}
+
+
+ATF_TC(dirname_posix);
+ATF_TC_HEAD(dirname_posix, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test dirname(3) with POSIX examples");
+}
+
+ATF_TC_BODY(dirname_posix, tc)
+{
+ char testbuf[32], *base;
+ int i;
+
+ for (i = 0; test_dirname_table[i].output != NULL; i++) {
+ if (test_dirname_table[i].input != NULL) {
+ if (strlen(test_dirname_table[i].input) >=
+ sizeof(testbuf))
+ atf_tc_skip("Testbuf too small!");
+ strcpy(testbuf, test_dirname_table[i].input);
+ base = dirname(testbuf);
+ } else
+ base = dirname(NULL);
+
+ /*
+ * dirname(3) is allowed to modify the input buffer.
+ * However, that is considered hostile by some programs,
+ * and so we elect to consider this an error.
+ *
+ * This is not a problem, as dirname(3) is also allowed
+ * to return a pointer to a statically-allocated buffer
+ * (it is explicitly not required to be reentrant).
+ */
+ if (test_dirname_table[i].input != NULL &&
+ strcmp(test_dirname_table[i].input, testbuf) != 0) {
+ fprintf(stderr,
+ "Input buffer for \"%s\" was modified\n",
+ test_dirname_table[i].input);
+ atf_tc_fail("Input buffer was modified.");
+ }
+
+ /* Make sure the result is correct. */
+ if (strcmp(test_dirname_table[i].output, base) != 0) {
+ fprintf(stderr,
+ "Input \"%s\", output \"%s\", expected \"%s\"\n",
+ test_dirname_table[i].input ==
+ NULL ? "(null)" : test_dirname_table[i].input,
+ base, test_dirname_table[i].output);
+ atf_tc_fail("Output does not match expected value.");
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, basename_posix);
+ ATF_TP_ADD_TC(tp, dirname_posix);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_closefrom.c b/contrib/netbsd-tests/lib/libc/gen/t_closefrom.c
new file mode 100644
index 0000000..75ebabb
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_closefrom.c
@@ -0,0 +1,173 @@
+/* $NetBSD: t_closefrom.c,v 1.4 2011/05/11 08:11:36 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_closefrom.c,v 1.4 2011/05/11 08:11:36 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <unistd.h>
+
+static const char path[] = "closefrom";
+
+ATF_TC_WITH_CLEANUP(closefrom_basic);
+ATF_TC_HEAD(closefrom_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of closefrom(3), #1");
+}
+
+ATF_TC_BODY(closefrom_basic, tc)
+{
+ int fd, cur1, cur2;
+
+ (void)closefrom(STDERR_FILENO + 1);
+
+ fd = open(path, O_RDONLY | O_CREAT, 0400);
+ ATF_REQUIRE(fd >= 0);
+
+ cur1 = fcntl(0, F_MAXFD);
+
+ ATF_REQUIRE(cur1 == STDERR_FILENO + 1);
+ ATF_REQUIRE(closefrom(cur1) == 0);
+
+ cur2 = fcntl(0, F_MAXFD);
+
+ ATF_REQUIRE(cur1 - 1 == cur2);
+ ATF_REQUIRE(close(fd) == -1);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(closefrom_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(closefrom_buffer);
+ATF_TC_HEAD(closefrom_buffer, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of closefrom(3), #2");
+}
+
+ATF_TC_BODY(closefrom_buffer, tc)
+{
+ int buf[16], cur, half;
+ size_t i;
+
+ /*
+ * Open a buffer of descriptors, close the half of
+ * these and verify that the result is consistent.
+ */
+ ATF_REQUIRE(closefrom(STDERR_FILENO + 1) == 0);
+
+ cur = fcntl(0, F_MAXFD);
+ ATF_REQUIRE(cur == STDERR_FILENO);
+
+ for (i = 0; i < __arraycount(buf); i++) {
+ buf[i] = open(path, O_RDWR | O_CREAT, 0600);
+ ATF_REQUIRE(buf[i] >= 0);
+ }
+
+ cur = fcntl(0, F_MAXFD);
+ ATF_REQUIRE(cur == __arraycount(buf) + STDERR_FILENO);
+
+ half = STDERR_FILENO + __arraycount(buf) / 2;
+ ATF_REQUIRE(closefrom(half) == 0);
+
+ cur = fcntl(0, F_MAXFD);
+ ATF_REQUIRE(cur == half - 1);
+
+ for (i = 0; i < __arraycount(buf); i++)
+ (void)close(buf[i]);
+}
+
+ATF_TC_CLEANUP(closefrom_buffer, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(closefrom_err);
+ATF_TC_HEAD(closefrom_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from closefrom(3)");
+}
+
+ATF_TC_BODY(closefrom_err, tc)
+{
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, closefrom(-INT_MAX) == -1);
+}
+
+ATF_TC(closefrom_one);
+ATF_TC_HEAD(closefrom_one, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test closefrom(1)");
+}
+
+ATF_TC_BODY(closefrom_one, tc)
+{
+ pid_t pid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (closefrom(1) != 0)
+ _exit(10);
+
+ _exit(fcntl(0, F_MAXFD));
+ }
+
+
+ (void)wait(&sta);
+
+ /*
+ * STDIN_FILENO sould still be open; WEXITSTATUS(1) == 0.
+ */
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != 0)
+ atf_tc_fail("not all descriptors were closed");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, closefrom_basic);
+ ATF_TP_ADD_TC(tp, closefrom_buffer);
+ ATF_TP_ADD_TC(tp, closefrom_err);
+ ATF_TP_ADD_TC(tp, closefrom_one);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_cpuset.c b/contrib/netbsd-tests/lib/libc/gen/t_cpuset.c
new file mode 100644
index 0000000..9eca03b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_cpuset.c
@@ -0,0 +1,114 @@
+/* $NetBSD: t_cpuset.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_cpuset.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $");
+
+#include <atf-c.h>
+#include <limits.h>
+#include <stdio.h>
+#include <sched.h>
+
+ATF_TC(cpuset_err);
+ATF_TC_HEAD(cpuset_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from cpuset(3)");
+}
+
+ATF_TC_BODY(cpuset_err, tc)
+{
+ cpuset_t *set;
+
+ set = cpuset_create();
+ ATF_REQUIRE(set != NULL);
+
+ ATF_CHECK(cpuset_set(-1, set) == -1);
+ ATF_CHECK(cpuset_clr(-1, set) == -1);
+ ATF_CHECK(cpuset_isset(-1, set) == -1);
+
+ ATF_CHECK(cpuset_set(INT_MAX, set) == -1);
+ ATF_CHECK(cpuset_clr(INT_MAX, set) == -1);
+ ATF_CHECK(cpuset_isset(INT_MAX, set) == -1);
+
+ cpuset_destroy(set);
+}
+
+ATF_TC(cpuset_set);
+ATF_TC_HEAD(cpuset_set, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cpuset_set(3)");
+}
+
+ATF_TC_BODY(cpuset_set, tc)
+{
+ cpuset_t *set;
+
+ set = cpuset_create();
+ ATF_REQUIRE(set != NULL);
+
+ ATF_REQUIRE(cpuset_set(0, set) == 0);
+ ATF_REQUIRE(cpuset_isset(0, set) > 0);
+ ATF_REQUIRE(cpuset_clr(0, set) == 0);
+ ATF_REQUIRE(cpuset_isset(0, set) == 0);
+
+ cpuset_destroy(set);
+}
+
+ATF_TC(cpuset_size);
+ATF_TC_HEAD(cpuset_size, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test puset_size(3)");
+}
+
+ATF_TC_BODY(cpuset_size, tc)
+{
+ cpuset_t *set;
+ size_t size;
+
+ set = cpuset_create();
+ ATF_REQUIRE(set != NULL);
+
+ size = cpuset_size(set);
+
+ ATF_CHECK(cpuset_set((size * 8) - 1, set) == 0);
+ ATF_CHECK(cpuset_set((size * 8) + 1, set) == -1);
+
+ cpuset_destroy(set);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, cpuset_err);
+ ATF_TP_ADD_TC(tp, cpuset_set);
+ ATF_TP_ADD_TC(tp, cpuset_size);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_dir.c b/contrib/netbsd-tests/lib/libc/gen/t_dir.c
new file mode 100644
index 0000000..81412c1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_dir.c
@@ -0,0 +1,165 @@
+/* $NetBSD: t_dir.c,v 1.6 2013/10/19 17:45:00 christos Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <assert.h>
+#include <dirent.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/stat.h>
+
+ATF_TC(seekdir_basic);
+ATF_TC_HEAD(seekdir_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check telldir(3) and seekdir(3) "
+ "for correct behavior (PR lib/24324)");
+}
+
+ATF_TC_BODY(seekdir_basic, tc)
+{
+ DIR *dp;
+ char *wasname;
+ struct dirent *entry;
+ long here;
+
+ mkdir("t", 0755);
+ creat("t/a", 0600);
+ creat("t/b", 0600);
+ creat("t/c", 0600);
+
+ dp = opendir("t");
+ if ( dp == NULL)
+ atf_tc_fail("Could not open temp directory.");
+
+ /* skip two for . and .. */
+ entry = readdir(dp);
+ entry = readdir(dp);
+
+ /* get first entry */
+ entry = readdir(dp);
+ here = telldir(dp);
+
+ /* get second entry */
+ entry = readdir(dp);
+ wasname = strdup(entry->d_name);
+ if (wasname == NULL)
+ atf_tc_fail("cannot allocate memory");
+
+ /* get third entry */
+ entry = readdir(dp);
+
+ /* try to return to the position after the first entry */
+ seekdir(dp, here);
+ entry = readdir(dp);
+
+ if (entry == NULL)
+ atf_tc_fail("entry 1 not found");
+ if (strcmp(entry->d_name, wasname) != 0)
+ atf_tc_fail("1st seekdir found wrong name");
+
+ /* try again, and throw in a telldir() for good measure */
+ seekdir(dp, here);
+ here = telldir(dp);
+ entry = readdir(dp);
+
+ if (entry == NULL)
+ atf_tc_fail("entry 2 not found");
+ if (strcmp(entry->d_name, wasname) != 0)
+ atf_tc_fail("2nd seekdir found wrong name");
+
+ /* One more time, to make sure that telldir() doesn't affect result */
+ seekdir(dp, here);
+ entry = readdir(dp);
+
+ if (entry == NULL)
+ atf_tc_fail("entry 3 not found");
+ if (strcmp(entry->d_name, wasname) != 0)
+ atf_tc_fail("3rd seekdir found wrong name");
+
+ closedir(dp);
+}
+
+ATF_TC(telldir_leak);
+ATF_TC_HEAD(telldir_leak, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Check telldir(3) for memory leakage (PR lib/24324)");
+}
+
+ATF_TC_BODY(telldir_leak, tc)
+{
+ DIR *dp;
+ char *memused;
+ int i;
+ int oktouse = 4096;
+
+ dp = opendir(".");
+ if (dp == NULL)
+ atf_tc_fail("Could not open current directory");
+
+ (void)telldir(dp);
+ memused = sbrk(0);
+ closedir(dp);
+
+ for (i = 0; i < 1000; i++) {
+ dp = opendir(".");
+ if (dp == NULL)
+ atf_tc_fail("Could not open current directory");
+
+ (void)telldir(dp);
+ closedir(dp);
+
+ if ((char *)sbrk(0) - memused > oktouse) {
+ (void)printf("Used %td extra bytes for %d telldir "
+ "calls", ((char *)sbrk(0) - memused), i);
+ oktouse = (char *)sbrk(0) - memused;
+ }
+ }
+ if (oktouse > 4096) {
+ atf_tc_fail("Failure: leaked %d bytes", oktouse);
+ } else {
+ (void)printf("OK: used %td bytes\n", (char *)(sbrk(0))-memused);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, seekdir_basic);
+ ATF_TP_ADD_TC(tp, telldir_leak);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c b/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c
new file mode 100644
index 0000000..9561a3c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c
@@ -0,0 +1,136 @@
+/* $NetBSD: t_floatunditf.c,v 1.5 2014/02/02 08:16:22 martin Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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 <atf-c.h>
+#include <atf-c/config.h>
+#include <inttypes.h>
+#include <math.h>
+
+#ifdef __HAVE_LONG_DOUBLE
+static const struct {
+ uint64_t u64;
+ long double ld;
+} testcases[] = {
+ { 0xffffffffffffffffULL, 0xf.fffffffffffffffp+60L },
+ { 0xfffffffffffffffeULL, 0xf.ffffffffffffffep+60L },
+ { 0xfffffffffffffffdULL, 0xf.ffffffffffffffdp+60L },
+ { 0xfffffffffffffffcULL, 0xf.ffffffffffffffcp+60L },
+ { 0x7fffffffffffffffULL, 0xf.ffffffffffffffep+59L },
+ { 0x3fffffffffffffffULL, 0xf.ffffffffffffffcp+58L },
+ { 0x1fffffffffffffffULL, 0xf.ffffffffffffff8p+57L },
+ { 0xfffffffffffffffULL, 0xf.ffffffffffffffp+56L },
+ { 0x7ffffffffffffffULL, 0xf.fffffffffffffep+55L },
+ { 0x3ffffffffffffffULL, 0xf.fffffffffffffcp+54L },
+ { 0x1ffffffffffffffULL, 0xf.fffffffffffff8p+53L },
+ { 0xffffffffffffffULL, 0xf.fffffffffffffp+52L },
+ { 0x7fffffffffffffULL, 0xf.ffffffffffffep+51L },
+ { 0x3fffffffffffffULL, 0xf.ffffffffffffcp+50L },
+ { 0x1fffffffffffffULL, 0xf.ffffffffffff8p+49L },
+ { 0xfffffffffffffULL, 0xf.ffffffffffffp+48L },
+ { 0x7ffffffffffffULL, 0xf.fffffffffffep+47L },
+ { 0x3ffffffffffffULL, 0xf.fffffffffffcp+46L },
+ { 0x1ffffffffffffULL, 0xf.fffffffffff8p+45L },
+ { 0xffffffffffffULL, 0xf.fffffffffffp+44L },
+ { 0x7fffffffffffULL, 0xf.ffffffffffep+43L },
+ { 0x3fffffffffffULL, 0xf.ffffffffffcp+42L },
+ { 0x1fffffffffffULL, 0xf.ffffffffff8p+41L },
+ { 0xfffffffffffULL, 0xf.ffffffffffp+40L },
+ { 0x7ffffffffffULL, 0xf.fffffffffep+39L },
+ { 0x3ffffffffffULL, 0xf.fffffffffcp+38L },
+ { 0x1ffffffffffULL, 0xf.fffffffff8p+37L },
+ { 0xffffffffffULL, 0xf.fffffffffp+36L },
+ { 0x7fffffffffULL, 0xf.ffffffffep+35L },
+ { 0x3fffffffffULL, 0xf.ffffffffcp+34L },
+ { 0x1fffffffffULL, 0xf.ffffffff8p+33L },
+ { 0xfffffffffULL, 0xf.ffffffffp+32L },
+ { 0x7ffffffffULL, 0xf.fffffffep+31L },
+ { 0x3ffffffffULL, 0xf.fffffffcp+30L },
+ { 0x1ffffffffULL, 0xf.fffffff8p+29L },
+ { 0xffffffffULL, 0xf.fffffffp+28L },
+ { 0x7fffffffULL, 0xf.ffffffep+27L },
+ { 0x3fffffffULL, 0xf.ffffffcp+26L },
+ { 0x1fffffffULL, 0xf.ffffff8p+25L },
+ { 0xfffffffULL, 0xf.ffffffp+24L },
+ { 0x7ffffffULL, 0xf.fffffep+23L },
+ { 0x3ffffffULL, 0xf.fffffcp+22L },
+ { 0x1ffffffULL, 0xf.fffff8p+21L },
+ { 0xffffffULL, 0xf.fffffp+20L },
+ { 0x7fffffULL, 0xf.ffffep+19L },
+ { 0x3fffffULL, 0xf.ffffcp+18L },
+ { 0x1fffffULL, 0xf.ffff8p+17L },
+ { 0xfffffULL, 0xf.ffffp+16L },
+ { 0x7ffffULL, 0xf.fffep+15L },
+ { 0x3ffffULL, 0xf.fffcp+14L },
+ { 0x1ffffULL, 0xf.fff8p+13L },
+ { 0xffffULL, 0xf.fffp+12L },
+ { 0x7fffULL, 0xf.ffep+11L },
+ { 0x3fffULL, 0xf.ffcp+10L },
+ { 0x1fffULL, 0xf.ff8p+9L },
+ { 0xfffULL, 0xf.ffp+8L },
+ { 0x7ffULL, 0xf.fep+7L },
+ { 0x3ffULL, 0xf.fcp+6L },
+ { 0x1ffULL, 0xf.f8p+5L },
+ { 0xffULL, 0xf.fp+4L },
+ { 0x7fULL, 0xf.ep+3L },
+ { 0x3fULL, 0xf.cp+2L },
+ { 0x1fULL, 0xf.8p+1L },
+ { 0xfULL, 0xfp+0L },
+ { 0x7ULL, 0xep-1L },
+ { 0x3ULL, 0xcp-2L },
+ { 0x1ULL, 0x8p-3L },
+};
+#endif
+
+ATF_TC(floatunditf);
+ATF_TC_HEAD(floatunditf, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Verify that uint64 -> long double conversion works");
+}
+
+ATF_TC_BODY(floatunditf, tc)
+{
+#ifndef __HAVE_LONG_DOUBLE
+ atf_tc_skip("Requires long double support");
+#else
+ size_t i;
+
+ for (i = 0; i < __arraycount(testcases); ++i)
+ ATF_CHECK_MSG(
+ testcases[i].ld == (long double)testcases[i].u64,
+ "#%zu: expected %.20Lf, got %.20Lf\n", i,
+ testcases[i].ld,
+ (long double)testcases[i].u64);
+#endif
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, floatunditf);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_fmtcheck.c b/contrib/netbsd-tests/lib/libc/gen/t_fmtcheck.c
new file mode 100644
index 0000000..ab95400
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_fmtcheck.c
@@ -0,0 +1,117 @@
+/* $NetBSD: t_fmtcheck.c,v 1.3 2014/06/14 08:19:02 apb Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code was contributed to The NetBSD Foundation by Allen Briggs.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+const char *fmtcheck(const char *f1, const char *f2)
+ __attribute__((__format_arg__(2)));
+
+#include <err.h>
+
+struct test_fmt {
+ const char *fmt1;
+ const char *fmt2;
+ int correct;
+} test_fmts[] = {
+ { "%d", "%d", 1 },
+ { "%2d", "%2.2d", 1 },
+ { "%x", "%d", 1 },
+ { "%u", "%d", 1 },
+ { "%03d", "%d", 1 },
+ { "%-2d", "%d", 1 },
+ { "%d", "%-12.1d", 1 },
+ { "%d", "%-01.3d", 1 },
+ { "%X", "%-01.3d", 1 },
+ { "%D", "%ld", 1 },
+ { "%s", "%s", 1 },
+ { "%s", "This is a %s test", 1 },
+ { "Hi, there. This is a %s test", "%s", 1 },
+ { "%d", "%s", 2 },
+ { "%e", "%s", 2 },
+ { "%r", "%d", 2 },
+ { "%*.2d", "%*d", 1 },
+ { "%2.*d", "%*d", 2 },
+ { "%*d", "%*d", 1 },
+ { "%-3", "%d", 2 },
+ { "%d %s", "%d", 2 },
+ { "%*.*.*d", "%*.*.*d", 2 },
+ { "%d", "%d %s", 1 },
+ { "%40s", "%20s", 1 },
+ { "%x %x %x", "%o %u %d", 1 },
+ { "%o %u %d", "%x %x %X", 1 },
+ { "%#o %u %#-d", "%x %#x %X", 1 },
+ { "%qd", "%llx", 1 },
+ { "%%", "%llx", 1 },
+ { "%ld %30s %#llx %-10.*e", "This number %lu%% and string %s has %qd numbers and %.*g floats", 1 },
+ { "%o", "%lx", 2 },
+ { "%p", "%lu", 2 },
+};
+
+ATF_TC(fmtcheck_basic);
+ATF_TC_HEAD(fmtcheck_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test fmtcheck(3)");
+}
+
+ATF_TC_BODY(fmtcheck_basic, tc)
+{
+ unsigned int i, r;
+ const char *f, *cf, *f1, *f2;
+
+ r = 0;
+ for (i = 0 ; i < __arraycount(test_fmts); i++) {
+ f1 = test_fmts[i].fmt1;
+ f2 = test_fmts[i].fmt2;
+ f = fmtcheck(f1, f2);
+ if (test_fmts[i].correct == 1) {
+ cf = f1;
+ } else {
+ cf = f2;
+ }
+ if (f != cf) {
+ r++;
+ atf_tc_fail_nonfatal("Test %d: (%s) vs. (%s) failed "
+ "(should have returned %s)", i, f1, f2,
+ (test_fmts[i].correct == 1) ? "1st" : "2nd");
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fmtcheck_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c b/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c
new file mode 100644
index 0000000..f90d8cf
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c
@@ -0,0 +1,167 @@
+/* $NetBSD: t_fnmatch.c,v 1.3 2012/04/08 09:58:59 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fnmatch.c,v 1.3 2012/04/08 09:58:59 jruoho Exp $");
+
+#include <atf-c.h>
+#include <fnmatch.h>
+#include <stdio.h>
+
+ATF_TC(fnmatch_backslashes);
+ATF_TC_HEAD(fnmatch_backslashes, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test translation of '\\' with fnmatch(3) (PR lib/41558)");
+}
+
+ATF_TC_BODY(fnmatch_backslashes, tc)
+{
+ const int rv = fnmatch(/* pattern */ "\\", "\\", 0);
+
+ if (rv != FNM_NOMATCH)
+ atf_tc_fail("fnmatch(3) did not translate '\\'");
+}
+
+ATF_TC(fnmatch_casefold);
+ATF_TC_HEAD(fnmatch_casefold, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test FNM_CASEFOLD");
+}
+
+ATF_TC_BODY(fnmatch_casefold, tc)
+{
+ ATF_CHECK(fnmatch("xxx", "XXX", 0) != 0);
+ ATF_CHECK(fnmatch("XXX", "xxx", 0) != 0);
+ ATF_CHECK(fnmatch("xxx", "XxX", 0) != 0);
+ ATF_CHECK(fnmatch("XxX", "xxx", 0) != 0);
+ ATF_CHECK(fnmatch("x*x", "XXX", 0) != 0);
+ ATF_CHECK(fnmatch("**x", "XXX", 0) != 0);
+ ATF_CHECK(fnmatch("*?x", "XXX", 0) != 0);
+
+ ATF_CHECK(fnmatch("xxx", "XXX", FNM_CASEFOLD) == 0);
+ ATF_CHECK(fnmatch("XXX", "xxx", FNM_CASEFOLD) == 0);
+ ATF_CHECK(fnmatch("xxx", "XxX", FNM_CASEFOLD) == 0);
+ ATF_CHECK(fnmatch("XxX", "xxx", FNM_CASEFOLD) == 0);
+ ATF_CHECK(fnmatch("x*x", "XXX", FNM_CASEFOLD) == 0);
+ ATF_CHECK(fnmatch("**x", "XXX", FNM_CASEFOLD) == 0);
+ ATF_CHECK(fnmatch("*?x", "XXX", FNM_CASEFOLD) == 0);
+}
+
+ATF_TC(fnmatch_leadingdir);
+ATF_TC_HEAD(fnmatch_leadingdir, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test FNM_LEADING_DIR");
+}
+
+ATF_TC_BODY(fnmatch_leadingdir, tc)
+{
+ ATF_CHECK(fnmatch("", "/*", 0) != 0);
+ ATF_CHECK(fnmatch(" ", " /*", 0) != 0);
+ ATF_CHECK(fnmatch("x", "x/*", 0) != 0);
+ ATF_CHECK(fnmatch("///", "////*", 0) != 0);
+
+ ATF_CHECK(fnmatch("", "/*", FNM_LEADING_DIR) == 0);
+ ATF_CHECK(fnmatch(" ", " /*", FNM_LEADING_DIR) == 0);
+ ATF_CHECK(fnmatch("x", "x/*", FNM_LEADING_DIR) == 0);
+ ATF_CHECK(fnmatch("///", "////*", FNM_LEADING_DIR) == 0);
+}
+
+ATF_TC(fnmatch_noescape);
+ATF_TC_HEAD(fnmatch_noescape, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test FNM_NOESCAPE");
+}
+
+ATF_TC_BODY(fnmatch_noescape, tc)
+{
+ ATF_CHECK(fnmatch(" \\x", " \\x", 0) != 0);
+ ATF_CHECK(fnmatch("xx\\x", "xx\\x", 0) != 0);
+ ATF_CHECK(fnmatch("\\xxx", "\\xxx", 0) != 0);
+
+ ATF_CHECK(fnmatch(" \\x", " \\x", FNM_NOESCAPE) == 0);
+ ATF_CHECK(fnmatch("xx\\x", "xx\\x", FNM_NOESCAPE) == 0);
+ ATF_CHECK(fnmatch("\\xxx", "\\xxx", FNM_NOESCAPE) == 0);
+}
+
+ATF_TC(fnmatch_pathname);
+ATF_TC_HEAD(fnmatch_pathname, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test FNM_PATHNAME");
+}
+
+ATF_TC_BODY(fnmatch_pathname, tc)
+{
+ ATF_CHECK(fnmatch("???x", "xxx/x", FNM_PATHNAME) != 0);
+ ATF_CHECK(fnmatch("***x", "xxx/x", FNM_PATHNAME) != 0);
+
+ ATF_CHECK(fnmatch("???x", "xxxx", FNM_PATHNAME) == 0);
+ ATF_CHECK(fnmatch("*/xxx", "/xxx", FNM_PATHNAME) == 0);
+ ATF_CHECK(fnmatch("x/*.y", "x/z.y", FNM_PATHNAME) == 0);
+}
+
+ATF_TC(fnmatch_period);
+ATF_TC_HEAD(fnmatch_period, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test FNM_PERIOD");
+}
+
+ATF_TC_BODY(fnmatch_period, tc)
+{
+ ATF_CHECK(fnmatch("*x*", "X", FNM_PERIOD) != 0);
+ ATF_CHECK(fnmatch("*x*", "X", FNM_PERIOD | FNM_CASEFOLD) == 0);
+
+ ATF_CHECK(fnmatch("x?y", "x.y", FNM_PATHNAME | FNM_PERIOD) == 0);
+ ATF_CHECK(fnmatch("x*y", "x.y", FNM_PATHNAME | FNM_PERIOD) == 0);
+ ATF_CHECK(fnmatch("*.c", "x.c", FNM_PATHNAME | FNM_PERIOD) == 0);
+ ATF_CHECK(fnmatch("*/?", "x/y", FNM_PATHNAME | FNM_PERIOD) == 0);
+ ATF_CHECK(fnmatch("*/*", "x/y", FNM_PATHNAME | FNM_PERIOD) == 0);
+ ATF_CHECK(fnmatch(".*/?", ".x/y", FNM_PATHNAME | FNM_PERIOD) == 0);
+ ATF_CHECK(fnmatch("*/.?", "x/.y", FNM_PATHNAME | FNM_PERIOD) == 0);
+ ATF_CHECK(fnmatch("x[.]y", "x.y", FNM_PATHNAME | FNM_PERIOD) == 0);
+
+ ATF_CHECK(fnmatch("?x/y", ".x/y", FNM_PATHNAME | FNM_PERIOD) != 0);
+ ATF_CHECK(fnmatch("*x/y", ".x/y", FNM_PATHNAME | FNM_PERIOD) != 0);
+ ATF_CHECK(fnmatch("x/?y", "x/.y", FNM_PATHNAME | FNM_PERIOD) != 0);
+ ATF_CHECK(fnmatch("x/*y", "x/.y", FNM_PATHNAME | FNM_PERIOD) != 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fnmatch_backslashes);
+ ATF_TP_ADD_TC(tp, fnmatch_casefold);
+ ATF_TP_ADD_TC(tp, fnmatch_leadingdir);
+ ATF_TP_ADD_TC(tp, fnmatch_noescape);
+ ATF_TP_ADD_TC(tp, fnmatch_pathname);
+ ATF_TP_ADD_TC(tp, fnmatch_period);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_fpclassify.c b/contrib/netbsd-tests/lib/libc/gen/t_fpclassify.c
new file mode 100644
index 0000000..21dea9e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_fpclassify.c
@@ -0,0 +1,206 @@
+/* $NetBSD: t_fpclassify.c,v 1.3 2011/10/01 21:47:08 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifndef _FLOAT_IEEE754
+
+ATF_TC(no_test);
+ATF_TC_HEAD(no_test, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Dummy test");
+}
+
+ATF_TC_BODY(no_test,tc)
+{
+ atf_tc_skip("Test not available on this architecture");
+}
+
+#else /* defined(_FLOAT_IEEE754) */
+
+ATF_TC(fpclassify_float);
+ATF_TC_HEAD(fpclassify_float, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test float operations");
+}
+
+ATF_TC_BODY(fpclassify_float, tc)
+{
+ float d0, d1, d2, f, ip;
+ int e, i;
+
+ d0 = FLT_MIN;
+ ATF_REQUIRE_EQ(fpclassify(d0), FP_NORMAL);
+ f = frexpf(d0, &e);
+ ATF_REQUIRE_EQ(e, FLT_MIN_EXP);
+ ATF_REQUIRE_EQ(f, 0.5);
+ d1 = d0;
+
+ /* shift a "1" bit through the mantissa (skip the implicit bit) */
+ for (i = 1; i < FLT_MANT_DIG; i++) {
+ d1 /= 2;
+ ATF_REQUIRE_EQ(fpclassify(d1), FP_SUBNORMAL);
+ ATF_REQUIRE(d1 > 0 && d1 < d0);
+
+ d2 = ldexpf(d0, -i);
+ ATF_REQUIRE_EQ(d2, d1);
+
+ d2 = modff(d1, &ip);
+ ATF_REQUIRE_EQ(d2, d1);
+ ATF_REQUIRE_EQ(ip, 0);
+
+ f = frexpf(d1, &e);
+ ATF_REQUIRE_EQ(e, FLT_MIN_EXP - i);
+ ATF_REQUIRE_EQ(f, 0.5);
+ }
+
+ d1 /= 2;
+ ATF_REQUIRE_EQ(fpclassify(d1), FP_ZERO);
+ f = frexpf(d1, &e);
+ ATF_REQUIRE_EQ(e, 0);
+ ATF_REQUIRE_EQ(f, 0);
+}
+
+ATF_TC(fpclassify_double);
+ATF_TC_HEAD(fpclassify_double, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test double operations");
+}
+
+ATF_TC_BODY(fpclassify_double, tc)
+{
+ double d0, d1, d2, f, ip;
+ int e, i;
+
+ d0 = DBL_MIN;
+ ATF_REQUIRE_EQ(fpclassify(d0), FP_NORMAL);
+ f = frexp(d0, &e);
+ ATF_REQUIRE_EQ(e, DBL_MIN_EXP);
+ ATF_REQUIRE_EQ(f, 0.5);
+ d1 = d0;
+
+ /* shift a "1" bit through the mantissa (skip the implicit bit) */
+ for (i = 1; i < DBL_MANT_DIG; i++) {
+ d1 /= 2;
+ ATF_REQUIRE_EQ(fpclassify(d1), FP_SUBNORMAL);
+ ATF_REQUIRE(d1 > 0 && d1 < d0);
+
+ d2 = ldexp(d0, -i);
+ ATF_REQUIRE_EQ(d2, d1);
+
+ d2 = modf(d1, &ip);
+ ATF_REQUIRE_EQ(d2, d1);
+ ATF_REQUIRE_EQ(ip, 0);
+
+ f = frexp(d1, &e);
+ ATF_REQUIRE_EQ(e, DBL_MIN_EXP - i);
+ ATF_REQUIRE_EQ(f, 0.5);
+ }
+
+ d1 /= 2;
+ ATF_REQUIRE_EQ(fpclassify(d1), FP_ZERO);
+ f = frexp(d1, &e);
+ ATF_REQUIRE_EQ(e, 0);
+ ATF_REQUIRE_EQ(f, 0);
+}
+
+/*
+ * XXX NetBSD doesn't have long-double flavors of frexp, ldexp, and modf,
+ * XXX so this test is disabled.
+ */
+
+#ifdef TEST_LONG_DOUBLE
+
+ATF_TC(fpclassify_long_double);
+ATF_TC_HEAD(fpclassify_long_double, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test long double operations");
+}
+
+ATF_TC_BODY(fpclassify_long_double, tc)
+{
+ long double d0, d1, d2, f, ip;
+ int e, i;
+
+ d0 = LDBL_MIN;
+ ATF_REQUIRE_EQ(fpclassify(d0), FP_NORMAL);
+ f = frexpl(d0, &e);
+ ATF_REQUIRE_EQ(e, LDBL_MIN_EXP);
+ ATF_REQUIRE_EQ(f, 0.5);
+ d1 = d0;
+
+ /* shift a "1" bit through the mantissa (skip the implicit bit) */
+ for (i = 1; i < LDBL_MANT_DIG; i++) {
+ d1 /= 2;
+ ATF_REQUIRE_EQ(fpclassify(d1), FP_SUBNORMAL);
+ ATF_REQUIRE(d1 > 0 && d1 < d0);
+
+ d2 = ldexpl(d0, -i);
+ ATF_REQUIRE_EQ(d2, d1);
+
+ d2 = modfl(d1, &ip);
+ ATF_REQUIRE_EQ(d2, d1);
+ ATF_REQUIRE_EQ(ip, 0);
+
+ f = frexpl(d1, &e);
+ ATF_REQUIRE_EQ(e, LDBL_MIN_EXP - i);
+ ATF_REQUIRE_EQ(f, 0.5);
+ }
+
+ d1 /= 2;
+ ATF_REQUIRE_EQ(fpclassify(d1), FP_ZERO);
+ f = frexpl(d1, &e);
+ ATF_REQUIRE_EQ(e, 0);
+ ATF_REQUIRE_EQ(f, 0);
+}
+#endif /* TEST_LONG_DOUBLE */
+#endif /* _FLOAT_IEEE754 */
+
+ATF_TP_ADD_TCS(tp)
+{
+
+#ifndef _FLOAT_IEEE754
+ ATF_TP_ADD_TC(tp, no_test);
+#else
+ ATF_TP_ADD_TC(tp, fpclassify_float);
+ ATF_TP_ADD_TC(tp, fpclassify_double);
+#ifdef TEST_LONG_DOUBLE
+ ATF_TP_ADD_TC(tp, fpclassify_long_double);
+#endif /* TEST_LONG_DOUBLE */
+#endif /* _FLOAT_IEEE754 */
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c b/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c
new file mode 100644
index 0000000..998eb85
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c
@@ -0,0 +1,355 @@
+/* $NetBSD: t_fpsetmask.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 1995 The NetBSD Foundation, 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 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 <atf-c.h>
+#include <atf-c/config.h>
+
+#include <stdio.h>
+#include <signal.h>
+#include <float.h>
+#include <setjmp.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "isqemu.h"
+
+#ifndef _FLOAT_IEEE754
+
+ATF_TC(no_test);
+ATF_TC_HEAD(no_test, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Dummy test case");
+}
+
+ATF_TC_BODY(no_test, tc)
+{
+
+ atf_tc_skip("Test not available on this architecture.");
+}
+
+#else /* defined(_FLOAT_IEEE754) */
+
+#include <ieeefp.h>
+
+const char *skip_mesg;
+const char *skip_arch;
+
+void sigfpe(int, siginfo_t *, void *);
+
+volatile sig_atomic_t signal_caught;
+volatile int sicode;
+
+static volatile const float f_one = 1.0;
+static volatile const float f_zero = 0.0;
+static volatile const double d_one = 1.0;
+static volatile const double d_zero = 0.0;
+static volatile const long double ld_one = 1.0;
+static volatile const long double ld_zero = 0.0;
+
+static volatile const float f_huge = FLT_MAX;
+static volatile const float f_tiny = FLT_MIN;
+static volatile const double d_huge = DBL_MAX;
+static volatile const double d_tiny = DBL_MIN;
+static volatile const long double ld_huge = LDBL_MAX;
+static volatile const long double ld_tiny = LDBL_MIN;
+
+static volatile float f_x;
+static volatile double d_x;
+static volatile long double ld_x;
+
+/* trip divide by zero */
+static void
+f_dz(void)
+{
+
+ f_x = f_one / f_zero;
+}
+
+static void
+d_dz(void)
+{
+
+ d_x = d_one / d_zero;
+}
+
+static void
+ld_dz(void)
+{
+
+ ld_x = ld_one / ld_zero;
+}
+
+/* trip invalid operation */
+static void
+d_inv(void)
+{
+
+ d_x = d_zero / d_zero;
+}
+
+static void
+ld_inv(void)
+{
+
+ ld_x = ld_zero / ld_zero;
+}
+
+static void
+f_inv(void)
+{
+
+ f_x = f_zero / f_zero;
+}
+
+/* trip overflow */
+static void
+f_ofl(void)
+{
+
+ f_x = f_huge * f_huge;
+}
+
+static void
+d_ofl(void)
+{
+
+ d_x = d_huge * d_huge;
+}
+
+static void
+ld_ofl(void)
+{
+
+ ld_x = ld_huge * ld_huge;
+}
+
+/* trip underflow */
+static void
+f_ufl(void)
+{
+
+ f_x = f_tiny * f_tiny;
+}
+
+static void
+d_ufl(void)
+{
+
+ d_x = d_tiny * d_tiny;
+}
+
+static void
+ld_ufl(void)
+{
+
+ ld_x = ld_tiny * ld_tiny;
+}
+
+struct ops {
+ void (*op)(void);
+ fp_except mask;
+ int sicode;
+};
+
+static const struct ops float_ops[] = {
+ { f_dz, FP_X_DZ, FPE_FLTDIV },
+ { f_inv, FP_X_INV, FPE_FLTINV },
+ { f_ofl, FP_X_OFL, FPE_FLTOVF },
+ { f_ufl, FP_X_UFL, FPE_FLTUND },
+ { NULL, 0, 0 }
+};
+
+static const struct ops double_ops[] = {
+ { d_dz, FP_X_DZ, FPE_FLTDIV },
+ { d_inv, FP_X_INV, FPE_FLTINV },
+ { d_ofl, FP_X_OFL, FPE_FLTOVF },
+ { d_ufl, FP_X_UFL, FPE_FLTUND },
+ { NULL, 0, 0 }
+};
+
+static const struct ops long_double_ops[] = {
+ { ld_dz, FP_X_DZ, FPE_FLTDIV },
+ { ld_inv, FP_X_INV, FPE_FLTINV },
+ { ld_ofl, FP_X_OFL, FPE_FLTOVF },
+ { ld_ufl, FP_X_UFL, FPE_FLTUND },
+ { NULL, 0, 0 }
+};
+
+static sigjmp_buf b;
+
+static void
+fpsetmask_masked(const struct ops *test_ops)
+{
+ struct sigaction sa;
+ fp_except ex1, ex2;
+ const struct ops *t;
+
+ /* mask all exceptions, clear history */
+ fpsetmask(0);
+ fpsetsticky(0);
+
+ /* set up signal handler */
+ sa.sa_sigaction = sigfpe;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_SIGINFO;
+ sigaction(SIGFPE, &sa, 0);
+ signal_caught = 0;
+
+ /*
+ * exceptions masked, check whether "sticky" bits are set correctly
+ */
+ for (t = test_ops; t->op != NULL; t++) {
+ (*t->op)();
+ ex1 = fpgetsticky();
+ ATF_CHECK_EQ(ex1 & t->mask, t->mask);
+ ATF_CHECK_EQ(signal_caught, 0);
+
+ /* check correct fpsetsticky() behaviour */
+ ex2 = fpsetsticky(0);
+ ATF_CHECK_EQ(fpgetsticky(), 0);
+ ATF_CHECK_EQ(ex1, ex2);
+ }
+}
+
+/* force delayed exceptions to be delivered */
+#define BARRIER() fpsetmask(0); f_x = f_one * f_one
+
+static void
+fpsetmask_unmasked(const struct ops *test_ops)
+{
+ struct sigaction sa;
+ int r;
+ const struct ops *volatile t;
+
+ /* mask all exceptions, clear history */
+ fpsetmask(0);
+ fpsetsticky(0);
+
+ /* set up signal handler */
+ sa.sa_sigaction = sigfpe;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_SIGINFO;
+ sigaction(SIGFPE, &sa, 0);
+ signal_caught = 0;
+
+ /*
+ * exception unmasked, check SIGFPE delivery and correct siginfo
+ */
+ for (t = test_ops; t->op != NULL; t++) {
+ fpsetmask(t->mask);
+ r = sigsetjmp(b, 1);
+ if (!r) {
+ (*t->op)();
+ BARRIER();
+ }
+ ATF_CHECK_EQ(signal_caught, 1);
+ ATF_CHECK_EQ(sicode, t->sicode);
+ signal_caught = 0;
+ }
+}
+
+void
+sigfpe(int s, siginfo_t *si, void *c)
+{
+ signal_caught = 1;
+ sicode = si->si_code;
+ siglongjmp(b, 1);
+}
+
+#define TEST(m, t) \
+ ATF_TC(m##_##t); \
+ \
+ ATF_TC_HEAD(m##_##t, tc) \
+ { \
+ \
+ atf_tc_set_md_var(tc, "descr", \
+ "Test " ___STRING(m) " exceptions for " \
+ ___STRING(t) "values"); \
+ } \
+ \
+ ATF_TC_BODY(m##_##t, tc) \
+ { \
+ if (strcmp(MACHINE, "macppc") == 0) \
+ atf_tc_expect_fail("PR port-macppc/46319"); \
+ \
+ if (isQEMU()) \
+ atf_tc_expect_fail("PR misc/44767"); \
+ \
+ m(t##_ops); \
+ }
+
+TEST(fpsetmask_masked, float)
+TEST(fpsetmask_masked, double)
+TEST(fpsetmask_masked, long_double)
+TEST(fpsetmask_unmasked, float)
+TEST(fpsetmask_unmasked, double)
+TEST(fpsetmask_unmasked, long_double)
+
+ATF_TC(fpsetmask_basic);
+ATF_TC_HEAD(fpsetmask_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of fpsetmask(3)");
+}
+
+ATF_TC_BODY(fpsetmask_basic, tc)
+{
+ size_t i;
+ fp_except_t msk, lst[] = { FP_X_INV, FP_X_DZ, FP_X_OFL, FP_X_UFL };
+
+ msk = fpgetmask();
+ for (i = 0; i < __arraycount(lst); i++) {
+ fpsetmask(msk | lst[i]);
+ ATF_CHECK((fpgetmask() & lst[i]) != 0);
+ fpsetmask(msk & lst[i]);
+ ATF_CHECK((fpgetmask() & lst[i]) == 0);
+ }
+
+}
+
+#endif /* defined(_FLOAT_IEEE754) */
+
+ATF_TP_ADD_TCS(tp)
+{
+
+#ifndef _FLOAT_IEEE754
+ ATF_TP_ADD_TC(tp, no_test);
+#else
+ ATF_TP_ADD_TC(tp, fpsetmask_basic);
+ ATF_TP_ADD_TC(tp, fpsetmask_masked_float);
+ ATF_TP_ADD_TC(tp, fpsetmask_masked_double);
+ ATF_TP_ADD_TC(tp, fpsetmask_masked_long_double);
+ ATF_TP_ADD_TC(tp, fpsetmask_unmasked_float);
+ ATF_TP_ADD_TC(tp, fpsetmask_unmasked_double);
+ ATF_TP_ADD_TC(tp, fpsetmask_unmasked_long_double);
+#endif
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_fpsetround.c b/contrib/netbsd-tests/lib/libc/gen/t_fpsetround.c
new file mode 100644
index 0000000..0f23e74
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_fpsetround.c
@@ -0,0 +1,163 @@
+/* $NetBSD: t_fpsetround.c,v 1.6 2011/10/01 17:46:10 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fpsetround.c,v 1.6 2011/10/01 17:46:10 christos Exp $");
+
+#include <float.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <atf-c.h>
+
+ATF_TC(fpsetround_basic);
+ATF_TC_HEAD(fpsetround_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Minimal testing of fpgetround(3) and fpsetround(3)");
+}
+
+#ifdef _FLOAT_IEEE754
+#include <ieeefp.h>
+
+static const struct {
+ const char *n;
+ int rm;
+ int rf;
+} rnd[] = {
+ { "RN", FP_RN, 1 },
+ { "RP", FP_RP, 2 },
+ { "RM", FP_RM, 3 },
+ { "RZ", FP_RZ, 0 },
+
+};
+
+static const struct {
+ const char *n;
+ int v[4];
+} tst[] = { /* RN RP RM RZ */
+ { "1.1", { 1, 1, 2, 1 } },
+ { "1.5", { 1, 2, 2, 1 } },
+ { "1.9", { 1, 2, 2, 1 } },
+ { "2.1", { 2, 2, 3, 2 } },
+ { "2.5", { 2, 2, 3, 2 } },
+ { "2.9", { 2, 3, 3, 2 } },
+ { "-1.1", { -1, -1, -1, -2 } },
+ { "-1.5", { -1, -2, -1, -2 } },
+ { "-1.9", { -1, -2, -1, -2 } },
+ { "-2.1", { -2, -2, -2, -3 } },
+ { "-2.5", { -2, -2, -2, -3 } },
+ { "-2.9", { -2, -3, -2, -3 } },
+};
+
+static const char *
+getname(int r)
+{
+ for (size_t i = 0; i < __arraycount(rnd); i++)
+ if (rnd[i].rm == r)
+ return rnd[i].n;
+ return "*unknown*";
+}
+
+static void
+test(int r)
+{
+ int did = 0;
+ for (size_t i = 0; i < __arraycount(tst); i++) {
+ double d = strtod(tst[i].n, NULL);
+ int g = (int)rint(d);
+ int e = tst[i].v[r];
+ ATF_CHECK_EQ(g, e);
+ if (g != e) {
+ if (!did) {
+ fprintf(stderr, "Mode Value Result Expected\n");
+ did = 1;
+ }
+ fprintf(stderr, "%4.4s %-5.5s %6d %8d\n", rnd[r].n,
+ tst[i].n, (int)rint(d), tst[i].v[r]);
+ }
+ }
+}
+#endif
+
+
+ATF_TC_BODY(fpsetround_basic, tc)
+{
+
+#ifndef _FLOAT_IEEE754
+ atf_tc_skip("Test not applicable on this architecture.");
+#else
+ int r;
+
+ ATF_CHECK_EQ(r = fpgetround(), FP_RN);
+ if (FP_RN != r)
+ fprintf(stderr, "default expected=%s got=%s\n", getname(FP_RN),
+ getname(r));
+ ATF_CHECK_EQ(FLT_ROUNDS, 1);
+
+ for (size_t i = 0; i < __arraycount(rnd); i++) {
+ const size_t j = (i + 1) & 3;
+ const int o = rnd[i].rm;
+ const int n = rnd[j].rm;
+
+ ATF_CHECK_EQ(r = fpsetround(n), o);
+ if (o != r)
+ fprintf(stderr, "set %s expected=%s got=%s\n",
+ getname(n), getname(o), getname(r));
+ ATF_CHECK_EQ(r = fpgetround(), n);
+ if (n != r)
+ fprintf(stderr, "get expected=%s got=%s\n", getname(n),
+ getname(r));
+ ATF_CHECK_EQ(r = FLT_ROUNDS, rnd[j].rf);
+ if (r != rnd[j].rf)
+ fprintf(stderr, "rounds expected=%x got=%x\n",
+ rnd[j].rf, r);
+ test(r);
+ }
+#endif /* _FLOAT_IEEE754 */
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fpsetround_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_ftok.c b/contrib/netbsd-tests/lib/libc/gen/t_ftok.c
new file mode 100644
index 0000000..100bd1b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_ftok.c
@@ -0,0 +1,107 @@
+/* $NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $");
+
+#include <sys/types.h>
+#include <sys/ipc.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+static const char *path = "ftok";
+static const char *hlnk = "hlnk";
+static const char *slnk = "slnk";
+static const int key = 123456789;
+
+ATF_TC(ftok_err);
+ATF_TC_HEAD(ftok_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from ftok(3)");
+}
+
+ATF_TC_BODY(ftok_err, tc)
+{
+ ATF_REQUIRE(ftok("/a/b/c/d/e/f/g/h/i", key) == -1);
+}
+
+ATF_TC_WITH_CLEANUP(ftok_link);
+ATF_TC_HEAD(ftok_link, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that links return the same key");
+}
+
+ATF_TC_BODY(ftok_link, tc)
+{
+ key_t k1, k2, k3;
+ int fd;
+
+ fd = open(path, O_RDONLY | O_CREAT);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(link(path, hlnk) == 0);
+ ATF_REQUIRE(symlink(path, slnk) == 0);
+
+ k1 = ftok(path, key);
+ k2 = ftok(hlnk, key);
+ k3 = ftok(slnk, key);
+
+ ATF_REQUIRE(k1 != -1);
+ ATF_REQUIRE(k2 != -1);
+ ATF_REQUIRE(k3 != -1);
+
+ if (k1 != k2)
+ atf_tc_fail("ftok(3) gave different key for a hard link");
+
+ if (k1 != k3)
+ atf_tc_fail("ftok(3) gave different key for a symbolic link");
+
+ ATF_REQUIRE(unlink(path) == 0);
+ ATF_REQUIRE(unlink(hlnk) == 0);
+ ATF_REQUIRE(unlink(slnk) == 0);
+}
+
+ATF_TC_CLEANUP(ftok_link, tc)
+{
+ (void)unlink(path);
+ (void)unlink(hlnk);
+ (void)unlink(slnk);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, ftok_err);
+ ATF_TP_ADD_TC(tp, ftok_link);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c b/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
new file mode 100644
index 0000000..76c287a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
@@ -0,0 +1,151 @@
+/* $NetBSD: t_getcwd.c,v 1.3 2011/07/27 05:04:11 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getcwd.c,v 1.3 2011/07/27 05:04:11 jruoho Exp $");
+
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fts.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+
+ATF_TC(getcwd_err);
+ATF_TC_HEAD(getcwd_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions in getcwd(3)");
+}
+
+ATF_TC_BODY(getcwd_err, tc)
+{
+ char buf[MAXPATHLEN];
+
+ errno = 0;
+
+ ATF_REQUIRE(getcwd(buf, 0) == NULL);
+ ATF_REQUIRE(errno == EINVAL);
+
+ errno = 0;
+
+ ATF_REQUIRE(getcwd((void *)-1, sizeof(buf)) == NULL);
+ ATF_REQUIRE(errno == EFAULT);
+}
+
+ATF_TC(getcwd_fts);
+ATF_TC_HEAD(getcwd_fts, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of getcwd(3)");
+}
+
+ATF_TC_BODY(getcwd_fts, tc)
+{
+ const char *str = NULL;
+ char buf[MAXPATHLEN];
+ char *argv[2];
+ FTSENT *ftse;
+ FTS *fts;
+ int ops;
+ short depth;
+
+ /*
+ * Do not traverse too deep; cf. PR bin/45180.
+ */
+ depth = 2;
+
+ argv[1] = NULL;
+ argv[0] = __UNCONST("/");
+
+ /*
+ * Test that getcwd(3) works with basic
+ * system directories. Note that having
+ * no FTS_NOCHDIR specified should ensure
+ * that the current directory is visited.
+ */
+ ops = FTS_PHYSICAL | FTS_NOSTAT;
+ fts = fts_open(argv, ops, NULL);
+
+ if (fts == NULL) {
+ str = "failed to initialize fts(3)";
+ goto out;
+ }
+
+ while ((ftse = fts_read(fts)) != NULL) {
+
+ if (ftse->fts_level < 1)
+ continue;
+
+ if (ftse->fts_level > depth) {
+ (void)fts_set(fts, ftse, FTS_SKIP);
+ continue;
+ }
+
+ switch(ftse->fts_info) {
+
+ case FTS_DP:
+
+ (void)memset(buf, 0, sizeof(buf));
+
+ if (getcwd(buf, sizeof(buf)) == NULL) {
+ str = "getcwd(3) failed";
+ goto out;
+ }
+
+ if (strstr(ftse->fts_path, buf) == NULL) {
+ str = "getcwd(3) returned incorrect path";
+ goto out;
+ }
+
+ break;
+
+ default:
+ break;
+ }
+ }
+
+out:
+ if (fts != NULL)
+ (void)fts_close(fts);
+
+ if (str != NULL)
+ atf_tc_fail("%s", str);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getcwd_err);
+ ATF_TP_ADD_TC(tp, getcwd_fts);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_getgrent.c b/contrib/netbsd-tests/lib/libc/gen/t_getgrent.c
new file mode 100644
index 0000000..df9cdd1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_getgrent.c
@@ -0,0 +1,181 @@
+/* $NetBSD: t_getgrent.c,v 1.2 2011/05/11 19:06:45 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2009, Stathis Kamperis
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getgrent.c,v 1.2 2011/05/11 19:06:45 njoly Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <grp.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+ATF_TC(getgrent_loop);
+ATF_TC_HEAD(getgrent_loop, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sequential getgrent(2)");
+}
+
+ATF_TC_BODY(getgrent_loop, tc)
+{
+ struct group *gr;
+ size_t i, j;
+
+ /*
+ * Loop over the group database. The first
+ * call returns the first entry and subsequent
+ * calls return the rest of the entries.
+ */
+ i = j = 0;
+
+ while((gr = getgrent()) != NULL)
+ i++;
+
+ /*
+ * Rewind the database to the beginning
+ * and loop over again until the end.
+ */
+ setgrent();
+
+ while((gr = getgrent()) != NULL)
+ j++;
+
+ if (i != j)
+ atf_tc_fail("sequential getgrent(3) failed");
+
+ /*
+ * Close the database and reopen it.
+ * The getgrent(3) call should always
+ * automatically rewind the database.
+ */
+ endgrent();
+
+ j = 0;
+
+ while((gr = getgrent()) != NULL)
+ j++;
+
+ if (i != j)
+ atf_tc_fail("getgrent(3) did not rewind");
+}
+
+ATF_TC(getgrent_setgid);
+ATF_TC_HEAD(getgrent_setgid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test consistency of the group db");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(getgrent_setgid, tc)
+{
+ struct group *gr, *gr1, *gr2;
+ int rv, sta;
+ pid_t pid;
+
+ /*
+ * Verify that the database is consistent.
+ *
+ * Note that because of the static buffers
+ * used by getgrent(3), fork(2) is required,
+ * even without the setgid(2) check.
+ */
+ while((gr = getgrent()) != NULL) {
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ gr1 = getgrgid(gr->gr_gid);
+
+ if (gr1 == NULL)
+ _exit(EXIT_FAILURE);
+
+ gr2 = getgrnam(gr->gr_name);
+
+ if (gr2 == NULL)
+ _exit(EXIT_FAILURE);
+
+ rv = setgid(gr->gr_gid);
+
+ if (rv != 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ goto fail;
+ }
+
+ return;
+
+fail:
+ atf_tc_fail("group database is inconsistent");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getgrent_loop);
+ ATF_TP_ADD_TC(tp, getgrent_setgid);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_glob.c b/contrib/netbsd-tests/lib/libc/gen/t_glob.c
new file mode 100644
index 0000000..ff62b63
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_glob.c
@@ -0,0 +1,273 @@
+/* $NetBSD: t_glob.c,v 1.3 2013/01/02 11:28:48 martin Exp $ */
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_glob.c,v 1.3 2013/01/02 11:28:48 martin Exp $");
+
+#include <atf-c.h>
+
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#include <dirent.h>
+#include <glob.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "../../../h_macros.h"
+
+
+#ifdef DEBUG
+#define DPRINTF(a) printf a
+#else
+#define DPRINTF(a)
+#endif
+
+struct gl_file {
+ const char *name;
+ int dir;
+};
+
+static struct gl_file a[] = {
+ { "1", 0 },
+ { "b", 1 },
+ { "3", 0 },
+ { "4", 0 },
+};
+
+static struct gl_file b[] = {
+ { "x", 0 },
+ { "y", 0 },
+ { "z", 0 },
+ { "w", 0 },
+};
+
+struct gl_dir {
+ const char *name; /* directory name */
+ const struct gl_file *dir;
+ size_t len, pos;
+};
+
+static struct gl_dir d[] = {
+ { "a", a, __arraycount(a), 0 },
+ { "a/b", b, __arraycount(b), 0 },
+};
+
+static const char *glob_star[] = {
+ "a/1", "a/3", "a/4", "a/b", "a/b/w", "a/b/x", "a/b/y", "a/b/z",
+};
+
+static const char *glob_star_not[] = {
+ "a/1", "a/3", "a/4", "a/b",
+};
+
+static void
+trim(char *buf, size_t len, const char *name)
+{
+ char *path = buf, *epath = buf + len;
+ while (path < epath && (*path++ = *name++) != '\0')
+ continue;
+ path--;
+ while (path > buf && *--path == '/')
+ *path = '\0';
+}
+
+static void *
+gl_opendir(const char *dir)
+{
+ size_t i;
+ char buf[MAXPATHLEN];
+ trim(buf, sizeof(buf), dir);
+
+ for (i = 0; i < __arraycount(d); i++)
+ if (strcmp(buf, d[i].name) == 0) {
+ DPRINTF(("opendir %s %zu\n", buf, i));
+ return &d[i];
+ }
+ errno = ENOENT;
+ return NULL;
+}
+
+static struct dirent *
+gl_readdir(void *v)
+{
+ static struct dirent dir;
+ struct gl_dir *dd = v;
+ if (dd->pos < dd->len) {
+ const struct gl_file *f = &dd->dir[dd->pos++];
+ strcpy(dir.d_name, f->name);
+ dir.d_namlen = strlen(f->name);
+ dir.d_ino = dd->pos;
+ dir.d_type = f->dir ? DT_DIR : DT_REG;
+ DPRINTF(("readdir %s %d\n", dir.d_name, dir.d_type));
+ dir.d_reclen = _DIRENT_RECLEN(&dir, dir.d_namlen);
+ return &dir;
+ }
+ return NULL;
+}
+
+static int
+gl_stat(const char *name , __gl_stat_t *st)
+{
+ char buf[MAXPATHLEN];
+ trim(buf, sizeof(buf), name);
+ memset(st, 0, sizeof(*st));
+
+ if (strcmp(buf, "a") == 0 || strcmp(buf, "a/b") == 0) {
+ st->st_mode |= _S_IFDIR;
+ return 0;
+ }
+
+ if (buf[0] == 'a' && buf[1] == '/') {
+ struct gl_file *f;
+ size_t offs, count;
+
+ if (buf[2] == 'b' && buf[3] == '/') {
+ offs = 4;
+ count = __arraycount(b);
+ f = b;
+ } else {
+ offs = 2;
+ count = __arraycount(a);
+ f = a;
+ }
+
+ for (size_t i = 0; i < count; i++)
+ if (strcmp(f[i].name, buf + offs) == 0)
+ return 0;
+ }
+ DPRINTF(("stat %s %d\n", buf, st->st_mode));
+ errno = ENOENT;
+ return -1;
+}
+
+static int
+gl_lstat(const char *name , __gl_stat_t *st)
+{
+ return gl_stat(name, st);
+}
+
+static void
+gl_closedir(void *v)
+{
+ struct gl_dir *dd = v;
+ dd->pos = 0;
+ DPRINTF(("closedir %p\n", dd));
+}
+
+static void
+run(const char *p, int flags, const char **res, size_t len)
+{
+ glob_t gl;
+ size_t i;
+
+ memset(&gl, 0, sizeof(gl));
+ gl.gl_opendir = gl_opendir;
+ gl.gl_readdir = gl_readdir;
+ gl.gl_closedir = gl_closedir;
+ gl.gl_stat = gl_stat;
+ gl.gl_lstat = gl_lstat;
+
+ RZ(glob(p, GLOB_ALTDIRFUNC | flags, NULL, &gl));
+
+ for (i = 0; i < gl.gl_pathc; i++)
+ DPRINTF(("%s\n", gl.gl_pathv[i]));
+
+ ATF_CHECK(len == gl.gl_pathc);
+ for (i = 0; i < gl.gl_pathc; i++)
+ ATF_CHECK_STREQ(gl.gl_pathv[i], res[i]);
+
+ globfree(&gl);
+}
+
+
+ATF_TC(glob_star);
+ATF_TC_HEAD(glob_star, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test glob(3) ** with GLOB_STAR");
+}
+
+ATF_TC_BODY(glob_star, tc)
+{
+ run("a/**", GLOB_STAR, glob_star, __arraycount(glob_star));
+}
+
+ATF_TC(glob_star_not);
+ATF_TC_HEAD(glob_star_not, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test glob(3) ** without GLOB_STAR");
+}
+
+
+ATF_TC_BODY(glob_star_not, tc)
+{
+ run("a/**", 0, glob_star_not, __arraycount(glob_star_not));
+}
+
+#if 0
+ATF_TC(glob_nocheck);
+ATF_TC_HEAD(glob_nocheck, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test glob(3) pattern with backslash and GLOB_NOCHECK");
+}
+
+
+ATF_TC_BODY(glob_nocheck, tc)
+{
+ static const char pattern[] = { 'f', 'o', 'o', '\\', ';', 'b', 'a',
+ 'r', '\0' };
+ static const char *glob_nocheck[] = {
+ pattern
+ };
+ run(pattern, GLOB_NOCHECK, glob_nocheck, __arraycount(glob_nocheck));
+}
+#endif
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, glob_star);
+ ATF_TP_ADD_TC(tp, glob_star_not);
+/*
+ * Remove this test for now - the GLOB_NOCHECK return value has been
+ * re-defined to return a modified pattern in revision 1.33 of glob.c
+ *
+ * ATF_TP_ADD_TC(tp, glob_nocheck);
+ */
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
new file mode 100644
index 0000000..1af579e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
@@ -0,0 +1,312 @@
+/* $NetBSD: t_humanize_number.c,v 1.8 2012/03/18 07:14:08 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010, 2011 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <err.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <util.h>
+
+const struct hnopts {
+ size_t ho_len;
+ int64_t ho_num;
+ const char *ho_suffix;
+ int ho_scale;
+ int ho_flags;
+ int ho_retval; /* expected return value */
+ const char *ho_retstr; /* expected string in buffer */
+} hnopts[] = {
+ /*
+ * Rev. 1.6 produces "10.0".
+ */
+ { 5, 10737418236ULL * 1024, "",
+ HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL, 3, "10T" },
+
+ { 5, 10450000, "",
+ HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL, 3, "10M" },
+ { 5, 10500000, "", /* just for reference */
+ HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL, 3, "10M" },
+
+ /*
+ * Trailing space. Rev. 1.7 produces "1 ".
+ */
+ { 5, 1, "", 0, HN_NOSPACE, 1, "1" },
+
+ { 5, 1, "", 0, 0, 2, "1 " }, /* just for reference */
+ { 5, 1, "", 0, HN_B, 3, "1 B" }, /* and more ... */
+ { 5, 1, "", 0, HN_DECIMAL, 2, "1 " },
+ { 5, 1, "", 0, HN_NOSPACE | HN_B, 2, "1B" },
+ { 5, 1, "", 0, HN_B | HN_DECIMAL, 3, "1 B" },
+ { 5, 1, "", 0, HN_NOSPACE | HN_B | HN_DECIMAL, 2, "1B" },
+
+ /*
+ * Space and HN_B. Rev. 1.7 produces "1B".
+ */
+ { 5, 1, "", HN_AUTOSCALE, HN_B, 3, "1 B" },
+ { 5, 1000, "", /* just for reference */
+ HN_AUTOSCALE, HN_B, 3, "1 K" },
+
+ /*
+ * Truncated output. Rev. 1.7 produces "1.0 K".
+ */
+ { 6, 1000, "A", HN_AUTOSCALE, HN_DECIMAL, -1, "" },
+
+ /*
+ * Failure case reported by Greg Troxel <gdt@NetBSD.org>.
+ * Rev. 1.11 incorrectly returns 5 with filling the buffer
+ * with "1000".
+ */
+ { 5, 1048258238, "",
+ HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL, 4, "1.0G" },
+ /* Similar case it prints 1000 where it shouldn't */
+ { 5, 1023488, "",
+ HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL, 4, "1.0M" },
+ { 5, 1023999, "",
+ HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL, 4, "1.0M" },
+};
+
+struct hnflags {
+ int hf_flags;
+ const char *hf_name;
+};
+
+const struct hnflags scale_flags[] = {
+ { HN_GETSCALE, "HN_GETSCALE" },
+ { HN_AUTOSCALE, "HN_AUTOSCALE" },
+};
+const struct hnflags normal_flags[] = {
+ { HN_DECIMAL, "HN_DECIMAL" },
+ { HN_NOSPACE, "HN_NOSPACE" },
+ { HN_B, "HN_B" },
+ { HN_DIVISOR_1000, "HN_DIVISOR_1000" },
+};
+
+const char *formatflags(char *, size_t, const struct hnflags *, size_t, int);
+void newline(void);
+void w_printf(const char *, ...) __printflike(1, 2);
+int main(int, char *[]);
+
+const char *
+formatflags(char *buf, size_t buflen, const struct hnflags *hfs,
+ size_t hfslen, int flags)
+{
+ const struct hnflags *hf;
+ char *p = buf;
+ ssize_t len = buflen;
+ unsigned int i, found;
+ int n;
+
+ if (flags == 0) {
+ snprintf(buf, buflen, "0");
+ return (buf);
+ }
+ for (i = found = 0; i < hfslen && flags & ~found; i++) {
+ hf = &hfs[i];
+ if (flags & hf->hf_flags) {
+ found |= hf->hf_flags;
+ n = snprintf(p, len, "|%s", hf->hf_name);
+ if (n >= len) {
+ p = buf;
+ len = buflen;
+ /* Print `flags' as number */
+ goto bad;
+ }
+ p += n;
+ len -= n;
+ }
+ }
+ flags &= ~found;
+ if (flags)
+bad:
+ snprintf(p, len, "|0x%x", flags);
+ return (*buf == '|' ? buf + 1 : buf);
+}
+
+static int col, bol = 1;
+void
+newline(void)
+{
+
+ fprintf(stderr, "\n");
+ col = 0;
+ bol = 1;
+}
+
+void
+w_printf(const char *fmt, ...)
+{
+ char buf[80];
+ va_list ap;
+ int n;
+
+ va_start(ap, fmt);
+ if (col >= 0) {
+ n = vsnprintf(buf, sizeof(buf), fmt, ap);
+ if (n >= (int)sizeof(buf)) {
+ col = -1;
+ goto overflow;
+ } else if (n == 0)
+ goto out;
+
+ if (!bol) {
+ if (col + n > 75)
+ fprintf(stderr, "\n "), col = 4;
+ else
+ fprintf(stderr, " "), col++;
+ }
+ fprintf(stderr, "%s", buf);
+ col += n;
+ bol = 0;
+ } else {
+overflow:
+ vfprintf(stderr, fmt, ap);
+ }
+out:
+ va_end(ap);
+}
+
+ATF_TC(humanize_number_basic);
+ATF_TC_HEAD(humanize_number_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test humanize_number(3)");
+}
+
+ATF_TC_BODY(humanize_number_basic, tc)
+{
+ char fbuf[128];
+ const struct hnopts *ho;
+ char *buf = NULL;
+ size_t buflen = 0;
+ unsigned int i;
+ int rv = 0;
+
+ for (i = 0; i < __arraycount(hnopts); i++) {
+ ho = &hnopts[i];
+ if (buflen < ho->ho_len) {
+ buflen = ho->ho_len;
+ buf = realloc(buf, buflen);
+ if (buf == NULL)
+ atf_tc_fail("realloc(..., %zu) failed", buflen);
+ }
+
+ rv = humanize_number(buf, ho->ho_len, ho->ho_num,
+ ho->ho_suffix, ho->ho_scale, ho->ho_flags);
+
+ if (rv == ho->ho_retval &&
+ (rv == -1 || strcmp(buf, ho->ho_retstr) == 0))
+ continue;
+
+ w_printf("humanize_number(\"%s\", %zu, %" PRId64 ",",
+ ho->ho_retstr, ho->ho_len, ho->ho_num);
+ w_printf("\"%s\",", ho->ho_suffix);
+ w_printf("%s,", formatflags(fbuf, sizeof(fbuf), scale_flags,
+ sizeof(scale_flags) / sizeof(scale_flags[0]),
+ ho->ho_scale));
+ w_printf("%s)", formatflags(fbuf, sizeof(fbuf), normal_flags,
+ sizeof(normal_flags) / sizeof(normal_flags[0]),
+ ho->ho_flags));
+ w_printf("= %d,", ho->ho_retval);
+ w_printf("but got");
+ w_printf("%d/[%s]", rv, rv == -1 ? "" : buf);
+ newline();
+ atf_tc_fail_nonfatal("Failed for table entry %d", i);
+ }
+}
+
+ATF_TC(humanize_number_big);
+ATF_TC_HEAD(humanize_number_big, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test humanize "
+ "big numbers (PR lib/44097)");
+}
+
+ATF_TC_BODY(humanize_number_big, tc)
+{
+ char buf[1024];
+ int rv;
+
+ /*
+ * Seems to work.
+ */
+ (void)memset(buf, 0, sizeof(buf));
+
+ rv = humanize_number(buf, 10, 10000, "", HN_AUTOSCALE, HN_NOSPACE);
+
+ ATF_REQUIRE(rv != -1);
+ ATF_CHECK_STREQ(buf, "10000");
+
+ /*
+ * A bogus value with large number.
+ */
+ (void)memset(buf, 0, sizeof(buf));
+
+ rv = humanize_number(buf, 10, INT64_MAX, "", HN_AUTOSCALE, HN_NOSPACE);
+
+ ATF_REQUIRE(rv != -1);
+ ATF_REQUIRE(strcmp(buf, "0") != 0);
+
+ /*
+ * Large buffer with HN_AUTOSCALE. Entirely bogus.
+ */
+ (void)memset(buf, 0, sizeof(buf));
+
+ rv = humanize_number(buf, sizeof(buf), 10000, "",
+ HN_AUTOSCALE, HN_NOSPACE);
+
+ ATF_REQUIRE(rv != -1);
+ ATF_REQUIRE(strcmp(buf, "0%d%s%d%s%s%s") != 0);
+
+ /*
+ * Tight buffer.
+ *
+ * The man page says that len must be at least 4.
+ * 3 works, but anything less that will not. This
+ * is because baselen starts with 2 for positive
+ * numbers.
+ */
+ (void)memset(buf, 0, sizeof(buf));
+
+ rv = humanize_number(buf, 3, 1, "", HN_AUTOSCALE, HN_NOSPACE);
+
+ ATF_REQUIRE(rv != -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, humanize_number_basic);
+ ATF_TP_ADD_TC(tp, humanize_number_big);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_isnan.c b/contrib/netbsd-tests/lib/libc/gen/t_isnan.c
new file mode 100644
index 0000000..2a97b9a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_isnan.c
@@ -0,0 +1,67 @@
+/* $NetBSD: t_isnan.c,v 1.4 2014/02/09 21:26:07 jmmv Exp $ */
+
+/*
+ * This file is in the Public Domain.
+ *
+ * The nan test is blatently copied by Simon Burge from the infinity
+ * test by Ben Harris.
+ */
+
+#include <sys/param.h>
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#include <math.h>
+#include <string.h>
+
+ATF_TC(isnan_basic);
+ATF_TC_HEAD(isnan_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Verify that isnan(3) works");
+}
+
+ATF_TC_BODY(isnan_basic, tc)
+{
+#if defined(__m68k__)
+ atf_tc_skip("Test not applicable on " MACHINE_ARCH);
+#endif
+
+#ifdef NAN
+ /* NAN is meant to be a (float)NaN. */
+ ATF_CHECK(isnan(NAN) != 0);
+ ATF_CHECK(isnan((double)NAN) != 0);
+#else
+ atf_tc_skip("Test not applicable");
+#endif
+}
+
+ATF_TC(isinf_basic);
+ATF_TC_HEAD(isinf_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Verify that isinf(3) works");
+}
+
+ATF_TC_BODY(isinf_basic, tc)
+{
+#if defined(__m68k__)
+ atf_tc_skip("Test not applicable on " MACHINE_ARCH);
+#endif
+
+ /* HUGE_VAL is meant to be an infinity. */
+ ATF_CHECK(isinf(HUGE_VAL) != 0);
+
+ /* HUGE_VALF is the float analog of HUGE_VAL. */
+ ATF_CHECK(isinf(HUGE_VALF) != 0);
+
+ /* HUGE_VALL is the long double analog of HUGE_VAL. */
+ ATF_CHECK(isinf(HUGE_VALL) != 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, isnan_basic);
+ ATF_TP_ADD_TC(tp, isinf_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_nice.c b/contrib/netbsd-tests/lib/libc/gen/t_nice.c
new file mode 100644
index 0000000..f4a62e9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_nice.c
@@ -0,0 +1,193 @@
+/* $NetBSD: t_nice.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_nice.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $");
+
+#include <sys/resource.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <limits.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+static void *threadfunc(void *);
+
+static void *
+threadfunc(void *arg)
+{
+ int pri, val;
+
+ val = *(int *)arg;
+
+ errno = 0;
+ pri = getpriority(PRIO_PROCESS, 0);
+ ATF_REQUIRE(errno == 0);
+
+ if (pri != val)
+ atf_tc_fail("nice(3) value was not propagated to threads");
+
+ return NULL;
+}
+
+ATF_TC(nice_err);
+ATF_TC_HEAD(nice_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test nice(3) for invalid parameters (PR lib/42587)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(nice_err, tc)
+{
+ int i;
+
+ /*
+ * The call should fail with EPERM if the
+ * supplied parameter is negative and the
+ * caller does not have privileges.
+ */
+ for (i = -20; i < 0; i++) {
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EPERM, nice(i) == -1);
+ }
+}
+
+ATF_TC(nice_priority);
+ATF_TC_HEAD(nice_priority, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test nice(3) vs. getpriority(2)");
+}
+
+ATF_TC_BODY(nice_priority, tc)
+{
+ int i, pri, nic;
+ pid_t pid;
+ int sta;
+
+ for (i = 0; i <= 20; i++) {
+
+ nic = nice(i);
+ ATF_REQUIRE(nic != -1);
+
+ errno = 0;
+ pri = getpriority(PRIO_PROCESS, 0);
+ ATF_REQUIRE(errno == 0);
+
+ if (nic != pri)
+ atf_tc_fail("nice(3) and getpriority(2) conflict");
+
+ /*
+ * Also verify that the nice(3) values
+ * are inherited by child processes.
+ */
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ errno = 0;
+ pri = getpriority(PRIO_PROCESS, 0);
+ ATF_REQUIRE(errno == 0);
+
+ if (nic != pri)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("nice(3) value was not inherited");
+ }
+}
+
+ATF_TC(nice_root);
+ATF_TC_HEAD(nice_root, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that nice(3) works");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(nice_root, tc)
+{
+ int i;
+
+ for (i = -20; i <= 20; i++) {
+
+ ATF_REQUIRE(nice(i) != -1);
+ }
+}
+
+ATF_TC(nice_thread);
+ATF_TC_HEAD(nice_thread, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test nice(3) with threads");
+}
+
+ATF_TC_BODY(nice_thread, tc)
+{
+ pthread_t tid[5];
+ int rv, val;
+ size_t i;
+
+ /*
+ * Test that the scheduling priority is
+ * propagated to all system scope threads.
+ */
+ for (i = 0; i < __arraycount(tid); i++) {
+
+ val = nice(i);
+ ATF_REQUIRE(val != -1);
+
+ rv = pthread_create(&tid[i], NULL, threadfunc, &val);
+ ATF_REQUIRE(rv == 0);
+
+ rv = pthread_join(tid[i], NULL);
+ ATF_REQUIRE(rv == 0);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, nice_err);
+ ATF_TP_ADD_TC(tp, nice_priority);
+ ATF_TP_ADD_TC(tp, nice_root);
+ ATF_TP_ADD_TC(tp, nice_thread);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_pause.c b/contrib/netbsd-tests/lib/libc/gen/t_pause.c
new file mode 100644
index 0000000..62a74c9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_pause.c
@@ -0,0 +1,114 @@
+/* $NetBSD: t_pause.c,v 1.1 2011/05/10 13:03:06 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_pause.c,v 1.1 2011/05/10 13:03:06 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+
+static bool fail;
+static void handler(int);
+
+static void
+handler(int signo)
+{
+
+ if (signo == SIGALRM)
+ fail = false;
+}
+
+ATF_TC(pause_basic);
+ATF_TC_HEAD(pause_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of pause(3), #1");
+}
+
+ATF_TC_BODY(pause_basic, tc)
+{
+
+ fail = true;
+
+ ATF_REQUIRE(signal(SIGALRM, handler) == 0);
+
+ (void)alarm(1);
+
+ if (pause() != -1 || fail != false)
+ atf_tc_fail("pause(3) did not cancel out from a signal");
+}
+
+ATF_TC(pause_kill);
+ATF_TC_HEAD(pause_kill, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of pause(3), #2");
+}
+
+ATF_TC_BODY(pause_kill, tc)
+{
+ pid_t pid;
+ int sta;
+
+ fail = true;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ (void)pause();
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)sleep(1);
+
+ if (fail != true)
+ atf_tc_fail("child terminated before signal");
+
+ (void)kill(pid, SIGKILL);
+ (void)sleep(1);
+ (void)wait(&sta);
+
+ if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != SIGKILL)
+ atf_tc_fail("pause(3) did not cancel from SIGKILL");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, pause_basic);
+ ATF_TP_ADD_TC(tp, pause_kill);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_raise.c b/contrib/netbsd-tests/lib/libc/gen/t_raise.c
new file mode 100644
index 0000000..adc032f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_raise.c
@@ -0,0 +1,190 @@
+/* $NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $");
+
+#include <atf-c.h>
+
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+static bool fail;
+static int count;
+static void handler_err(int);
+static void handler_ret(int);
+static void handler_stress(int);
+static int sig[] = { SIGALRM, SIGIO, SIGUSR1, SIGUSR2, SIGPWR };
+
+static void
+handler_stress(int signo)
+{
+ count++;
+}
+
+static void
+handler_err(int signo)
+{
+ size_t i;
+
+ for (i = 0; i < __arraycount(sig); i++) {
+
+ if (sig[i] == signo) {
+ fail = false;
+ break;
+ }
+ }
+}
+
+static void
+handler_ret(int signo)
+{
+
+ (void)sleep(1);
+
+ fail = false;
+}
+
+ATF_TC(raise_err);
+ATF_TC_HEAD(raise_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test raise(3) for invalid parameters");
+}
+
+ATF_TC_BODY(raise_err, tc)
+{
+ int i = 0;
+
+ while (i < 10) {
+
+ ATF_REQUIRE(raise(10240 + i) == -1);
+
+ i++;
+ }
+}
+
+ATF_TC(raise_ret);
+ATF_TC_HEAD(raise_ret, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test return order of raise(3)");
+}
+
+ATF_TC_BODY(raise_ret, tc)
+{
+ struct sigaction sa;
+
+ fail = true;
+
+ sa.sa_flags = 0;
+ sa.sa_handler = handler_ret;
+
+ /*
+ * Verify that raise(3) does not return
+ * before the signal handler returns.
+ */
+ ATF_REQUIRE(sigemptyset(&sa.sa_mask) == 0);
+ ATF_REQUIRE(sigaction(SIGUSR1, &sa, 0) == 0);
+ ATF_REQUIRE(raise(SIGUSR1) == 0);
+
+ if (fail != false)
+ atf_tc_fail("raise(3) returned before signal handler");
+}
+
+ATF_TC(raise_sig);
+ATF_TC_HEAD(raise_sig, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of raise(3)");
+}
+
+ATF_TC_BODY(raise_sig, tc)
+{
+ struct timespec tv, tr;
+ struct sigaction sa;
+ size_t i;
+
+ for (i = 0; i < __arraycount(sig); i++) {
+
+ (void)memset(&sa, 0, sizeof(struct sigaction));
+
+ fail = true;
+
+ tv.tv_sec = 0;
+ tv.tv_nsec = 2;
+
+ sa.sa_flags = 0;
+ sa.sa_handler = handler_err;
+
+ ATF_REQUIRE(sigemptyset(&sa.sa_mask) == 0);
+ ATF_REQUIRE(sigaction(sig[i], &sa, 0) == 0);
+
+ ATF_REQUIRE(raise(sig[i]) == 0);
+ ATF_REQUIRE(nanosleep(&tv, &tr) == 0);
+
+ if (fail != false)
+ atf_tc_fail("raise(3) did not raise a signal");
+ }
+}
+
+ATF_TC(raise_stress);
+ATF_TC_HEAD(raise_stress, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic stress test with raise(3)");
+}
+
+ATF_TC_BODY(raise_stress, tc)
+{
+ static const int maxiter = 1000 * 10;
+ struct sigaction sa;
+ int i;
+
+ sa.sa_flags = 0;
+ sa.sa_handler = handler_stress;
+
+ ATF_REQUIRE(sigemptyset(&sa.sa_mask) == 0);
+ ATF_REQUIRE(sigaction(SIGUSR1, &sa, 0) == 0);
+
+ for (count = i = 0; i < maxiter; i++)
+ (void)raise(SIGUSR1);
+
+ if (count != maxiter)
+ atf_tc_fail("not all signals were catched");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, raise_err);
+ ATF_TP_ADD_TC(tp, raise_ret);
+ ATF_TP_ADD_TC(tp, raise_sig);
+ ATF_TP_ADD_TC(tp, raise_stress);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_randomid.c b/contrib/netbsd-tests/lib/libc/gen/t_randomid.c
new file mode 100644
index 0000000..8377806
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_randomid.c
@@ -0,0 +1,93 @@
+/* $NetBSD: t_randomid.c,v 1.3 2011/07/07 09:49:59 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <sys/types.h>
+
+#include <assert.h>
+#include <inttypes.h>
+#include <randomid.h>
+#include <stdio.h>
+#include <string.h>
+
+#define PERIOD 30000
+
+uint64_t last[65536];
+
+ATF_TC(randomid_basic);
+ATF_TC_HEAD(randomid_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check randomid(3)");
+}
+
+ATF_TC_BODY(randomid_basic, tc)
+{
+ static randomid_t ctx = NULL;
+ uint64_t lowest, n, diff;
+ uint16_t id;
+
+ memset(last, 0, sizeof(last));
+ ctx = randomid_new(16, (long)3600);
+
+ lowest = UINT64_MAX;
+
+ for (n = 0; n < 1000000; n++) {
+ id = randomid(ctx);
+
+ if (last[id] > 0) {
+ diff = n - last[id];
+
+ if (diff <= lowest) {
+ if (lowest != UINT64_MAX)
+ printf("id %5d: last call at %9"PRIu64
+ ", current call %9"PRIu64
+ " (diff %5"PRIu64"), "
+ "lowest %"PRIu64"\n",
+ id, last[id], n, diff, lowest);
+
+ ATF_REQUIRE_MSG(diff >= PERIOD,
+ "diff (%"PRIu64") less than minimum "
+ "period (%d)", diff, PERIOD);
+
+ lowest = diff;
+ }
+ }
+
+ last[id] = n;
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, randomid_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_realpath.c b/contrib/netbsd-tests/lib/libc/gen/t_realpath.c
new file mode 100644
index 0000000..d4998c7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_realpath.c
@@ -0,0 +1,152 @@
+/* $NetBSD: t_realpath.c,v 1.2 2012/03/27 07:54:58 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_realpath.c,v 1.2 2012/03/27 07:54:58 njoly Exp $");
+
+#include <sys/param.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static const struct {
+ const char *path;
+ const char *result;
+} paths[] = {
+
+ { "/", "/" },
+ { "///////", "/" },
+ { "", NULL },
+ { " ", NULL },
+ { "/ ", NULL },
+ { " /", NULL },
+ { "/etc///", "/etc" },
+ { "///////etc", "/etc" },
+ { "/a/b/c/d/e", NULL },
+ { " /usr/bin ", NULL },
+ { "\\//////usr//bin", NULL },
+ { "//usr//bin//", "/usr/bin" },
+ { "//////usr//bin//", "/usr/bin" },
+ { "/usr/bin//////////", "/usr/bin" },
+};
+
+ATF_TC(realpath_basic);
+ATF_TC_HEAD(realpath_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of realpath(3)");
+}
+
+ATF_TC_BODY(realpath_basic, tc)
+{
+ char buf[MAXPATHLEN];
+ char *ptr;
+ size_t i;
+
+ for (i = 0; i < __arraycount(paths); i++) {
+
+ (void)memset(buf, '\0', sizeof(buf));
+
+ ptr = realpath(paths[i].path, buf);
+
+ if (ptr == NULL && paths[i].result == NULL)
+ continue;
+
+ if (ptr == NULL && paths[i].result != NULL)
+ atf_tc_fail("realpath failed for '%s'", paths[i].path);
+
+ if (strcmp(paths[i].result, buf) != 0)
+ atf_tc_fail("expected '%s', got '%s'",
+ paths[i].result, buf);
+ }
+}
+
+ATF_TC(realpath_huge);
+ATF_TC_HEAD(realpath_huge, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test huge path with realpath(3)");
+}
+
+ATF_TC_BODY(realpath_huge, tc)
+{
+ char result[MAXPATHLEN] = { 0 };
+ char buffer[MAXPATHLEN] = { 0 };
+
+ (void)memset(buffer, '/', sizeof(buffer) - 1);
+
+ ATF_CHECK(realpath(buffer, result) != NULL);
+ ATF_CHECK(strlen(result) == 1);
+ ATF_CHECK(result[0] == '/');
+}
+
+ATF_TC(realpath_symlink);
+ATF_TC_HEAD(realpath_symlink, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test symbolic link with realpath(3)");
+}
+
+ATF_TC_BODY(realpath_symlink, tc)
+{
+ char path[MAXPATHLEN] = { 0 };
+ char slnk[MAXPATHLEN] = { 0 };
+ char resb[MAXPATHLEN] = { 0 };
+ int fd;
+
+ (void)getcwd(path, sizeof(path));
+ (void)getcwd(slnk, sizeof(slnk));
+
+ (void)strlcat(path, "/realpath", sizeof(path));
+ (void)strlcat(slnk, "/symbolic", sizeof(slnk));
+
+ fd = open(path, O_RDONLY | O_CREAT, 0600);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(symlink(path, slnk) == 0);
+ ATF_REQUIRE(close(fd) == 0);
+
+ ATF_REQUIRE(realpath(slnk, resb) != NULL);
+ ATF_REQUIRE(strcmp(resb, path) == 0);
+
+ ATF_REQUIRE(unlink(path) == 0);
+ ATF_REQUIRE(unlink(slnk) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, realpath_basic);
+ ATF_TP_ADD_TC(tp, realpath_huge);
+ ATF_TP_ADD_TC(tp, realpath_symlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c b/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c
new file mode 100644
index 0000000..89818f0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c
@@ -0,0 +1,132 @@
+/* $NetBSD: t_setdomainname.c,v 1.2 2012/03/25 08:17:54 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_setdomainname.c,v 1.2 2012/03/25 08:17:54 joerg Exp $");
+
+#include <sys/param.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+static char domain[MAXHOSTNAMELEN];
+
+static const char domains[][MAXHOSTNAMELEN] = {
+ "1234567890",
+ "abcdefghijklmnopqrst",
+ "!#\xa4%&/(..xasS812=!=!(I(!;X;;X.as.dasa=?;,..<>|**^\xa8",
+ "--------------------------------------------------------------------"
+};
+
+ATF_TC_WITH_CLEANUP(setdomainname_basic);
+ATF_TC_HEAD(setdomainname_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of setdomainname(3)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(setdomainname_basic, tc)
+{
+ char name[MAXHOSTNAMELEN];
+ size_t i;
+
+ for (i = 0; i < __arraycount(domains); i++) {
+
+ (void)memset(name, 0, sizeof(name));
+
+ ATF_REQUIRE(setdomainname(domains[i],sizeof(domains[i])) == 0);
+ ATF_REQUIRE(getdomainname(name, sizeof(name)) == 0);
+ ATF_REQUIRE(strcmp(domains[i], name) == 0);
+ }
+
+ (void)setdomainname(domain, sizeof(domain));
+}
+
+ATF_TC_CLEANUP(setdomainname_basic, tc)
+{
+ (void)setdomainname(domain, sizeof(domain));
+}
+
+ATF_TC_WITH_CLEANUP(setdomainname_limit);
+ATF_TC_HEAD(setdomainname_limit, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Too long domain name errors out?");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(setdomainname_limit, tc)
+{
+ char name[MAXHOSTNAMELEN + 1];
+
+ (void)memset(name, 0, sizeof(name));
+
+ ATF_REQUIRE(setdomainname(name, sizeof(name)) == -1);
+}
+
+ATF_TC_CLEANUP(setdomainname_limit, tc)
+{
+ (void)setdomainname(domain, sizeof(domain));
+}
+
+ATF_TC_WITH_CLEANUP(setdomainname_perm);
+ATF_TC_HEAD(setdomainname_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Can normal user set the domain name?");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(setdomainname_perm, tc)
+{
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EPERM, setdomainname(domain, sizeof(domain)) == -1);
+}
+
+ATF_TC_CLEANUP(setdomainname_perm, tc)
+{
+ (void)setdomainname(domain, sizeof(domain));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ (void)memset(domain, 0, sizeof(domain));
+
+ ATF_REQUIRE(getdomainname(domain, sizeof(domain)) == 0);
+
+ ATF_TP_ADD_TC(tp, setdomainname_basic);
+ ATF_TP_ADD_TC(tp, setdomainname_limit);
+ ATF_TP_ADD_TC(tp, setdomainname_perm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c b/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c
new file mode 100644
index 0000000..a753ac7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c
@@ -0,0 +1,132 @@
+/* $NetBSD: t_sethostname.c,v 1.3 2012/03/25 08:17:54 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_sethostname.c,v 1.3 2012/03/25 08:17:54 joerg Exp $");
+
+#include <sys/param.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+static char host[MAXHOSTNAMELEN];
+
+static const char hosts[][MAXHOSTNAMELEN] = {
+ "1234567890",
+ "abcdefghijklmnopqrst",
+ "!#\xa4%&/(..xasS812=!=!(I(!;X;;X.as.dasa=?;,..<>|**^\xa8",
+ "--------------------------------------------------------------------"
+};
+
+ATF_TC_WITH_CLEANUP(sethostname_basic);
+ATF_TC_HEAD(sethostname_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of sethostname(3)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(sethostname_basic, tc)
+{
+ char name[MAXHOSTNAMELEN];
+ size_t i;
+
+ for (i = 0; i < __arraycount(hosts); i++) {
+
+ (void)memset(name, 0, sizeof(name));
+
+ ATF_REQUIRE(sethostname(hosts[i], sizeof(hosts[i])) == 0);
+ ATF_REQUIRE(gethostname(name, sizeof(name)) == 0);
+ ATF_REQUIRE(strcmp(hosts[i], name) == 0);
+ }
+
+ (void)sethostname(host, sizeof(host));
+}
+
+ATF_TC_CLEANUP(sethostname_basic, tc)
+{
+ (void)sethostname(host, sizeof(host));
+}
+
+ATF_TC_WITH_CLEANUP(sethostname_limit);
+ATF_TC_HEAD(sethostname_limit, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Too long host name errors out?");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(sethostname_limit, tc)
+{
+ char name[MAXHOSTNAMELEN + 1];
+
+ (void)memset(name, 0, sizeof(name));
+
+ ATF_REQUIRE(sethostname(name, sizeof(name)) == -1);
+}
+
+ATF_TC_CLEANUP(sethostname_limit, tc)
+{
+ (void)sethostname(host, sizeof(host));
+}
+
+ATF_TC_WITH_CLEANUP(sethostname_perm);
+ATF_TC_HEAD(sethostname_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Can normal user set the host name?");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(sethostname_perm, tc)
+{
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EPERM, sethostname(host, sizeof(host)) == -1);
+}
+
+ATF_TC_CLEANUP(sethostname_perm, tc)
+{
+ (void)sethostname(host, sizeof(host));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ (void)memset(host, 0, sizeof(host));
+
+ ATF_REQUIRE(gethostname(host, sizeof(host)) == 0);
+
+ ATF_TP_ADD_TC(tp, sethostname_basic);
+ ATF_TP_ADD_TC(tp, sethostname_limit);
+ ATF_TP_ADD_TC(tp, sethostname_perm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c b/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c
new file mode 100644
index 0000000..2fb53e4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c
@@ -0,0 +1,500 @@
+/* $NetBSD: t_siginfo.c,v 1.23 2014/02/09 21:26:07 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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 <atf-c.h>
+#include <atf-c/config.h>
+
+#include <sys/inttypes.h>
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+#include <sys/time.h>
+#include <sys/ucontext.h>
+#include <sys/wait.h>
+
+#include <assert.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <setjmp.h>
+#include <float.h>
+
+#ifdef HAVE_FENV
+#include <fenv.h>
+#elif defined(_FLOAT_IEEE754)
+#include <ieeefp.h>
+#endif
+
+#include "isqemu.h"
+
+/* for sigbus */
+volatile char *addr;
+
+/* for sigchild */
+pid_t child;
+int code;
+int status;
+
+/* for sigfpe */
+sig_atomic_t fltdiv_signalled = 0;
+sig_atomic_t intdiv_signalled = 0;
+
+static void
+sig_debug(int signo, siginfo_t *info, ucontext_t *ctx)
+{
+ unsigned int i;
+
+ printf("%d %p %p\n", signo, info, ctx);
+ if (info != NULL) {
+ printf("si_signo=%d\n", info->si_signo);
+ printf("si_errno=%d\n", info->si_errno);
+ printf("si_code=%d\n", info->si_code);
+ printf("si_value.sival_int=%d\n", info->si_value.sival_int);
+ }
+ if (ctx != NULL) {
+ printf("uc_flags 0x%x\n", ctx->uc_flags);
+ printf("uc_link %p\n", ctx->uc_link);
+ for (i = 0; i < __arraycount(ctx->uc_sigmask.__bits); i++)
+ printf("uc_sigmask[%d] 0x%x\n", i,
+ ctx->uc_sigmask.__bits[i]);
+ printf("uc_stack %p %lu 0x%x\n", ctx->uc_stack.ss_sp,
+ (unsigned long)ctx->uc_stack.ss_size,
+ ctx->uc_stack.ss_flags);
+ for (i = 0; i < __arraycount(ctx->uc_mcontext.__gregs); i++)
+ printf("uc_mcontext.greg[%d] 0x%lx\n", i,
+ (long)ctx->uc_mcontext.__gregs[i]);
+ }
+}
+
+static void
+sigalrm_action(int signo, siginfo_t *info, void *ptr)
+{
+
+ sig_debug(signo, info, (ucontext_t *)ptr);
+
+ ATF_REQUIRE_EQ(info->si_signo, SIGALRM);
+ ATF_REQUIRE_EQ(info->si_code, SI_TIMER);
+ ATF_REQUIRE_EQ(info->si_value.sival_int, ITIMER_REAL);
+
+ atf_tc_pass();
+ /* NOTREACHED */
+}
+
+ATF_TC(sigalarm);
+
+ATF_TC_HEAD(sigalarm, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that signal trampoline correctly calls SIGALRM handler");
+}
+
+ATF_TC_BODY(sigalarm, tc)
+{
+ struct sigaction sa;
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = sigalrm_action;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGALRM, &sa, NULL);
+ for (;;) {
+ alarm(1);
+ sleep(1);
+ }
+ atf_tc_fail("SIGALRM handler wasn't called");
+}
+
+static void
+sigchild_action(int signo, siginfo_t *info, void *ptr)
+{
+ if (info != NULL) {
+ printf("info=%p\n", info);
+ printf("ptr=%p\n", ptr);
+ printf("si_signo=%d\n", info->si_signo);
+ printf("si_errno=%d\n", info->si_errno);
+ printf("si_code=%d\n", info->si_code);
+ printf("si_uid=%d\n", info->si_uid);
+ printf("si_pid=%d\n", info->si_pid);
+ printf("si_status=%d\n", info->si_status);
+ printf("si_utime=%lu\n", (unsigned long int)info->si_utime);
+ printf("si_stime=%lu\n", (unsigned long int)info->si_stime);
+ }
+ ATF_REQUIRE_EQ(info->si_code, code);
+ ATF_REQUIRE_EQ(info->si_signo, SIGCHLD);
+ ATF_REQUIRE_EQ(info->si_uid, getuid());
+ ATF_REQUIRE_EQ(info->si_pid, child);
+ if (WIFEXITED(info->si_status))
+ ATF_REQUIRE_EQ(WEXITSTATUS(info->si_status), status);
+ else if (WIFSTOPPED(info->si_status))
+ ATF_REQUIRE_EQ(WSTOPSIG(info->si_status), status);
+ else if (WIFSIGNALED(info->si_status))
+ ATF_REQUIRE_EQ(WTERMSIG(info->si_status), status);
+}
+
+static void
+setchildhandler(void (*action)(int, siginfo_t *, void *))
+{
+ struct sigaction sa;
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = action;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGCHLD, &sa, NULL);
+}
+
+static void
+sigchild_setup(void)
+{
+ sigset_t set;
+ struct rlimit rlim;
+
+ (void)getrlimit(RLIMIT_CORE, &rlim);
+ rlim.rlim_cur = rlim.rlim_max;
+ (void)setrlimit(RLIMIT_CORE, &rlim);
+
+ setchildhandler(sigchild_action);
+ sigemptyset(&set);
+ sigaddset(&set, SIGCHLD);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+}
+
+ATF_TC(sigchild_normal);
+ATF_TC_HEAD(sigchild_normal, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that signal trampoline correctly calls SIGCHLD handler "
+ "when child exits normally");
+}
+
+ATF_TC_BODY(sigchild_normal, tc)
+{
+ sigset_t set;
+
+ sigchild_setup();
+
+ status = 25;
+ code = CLD_EXITED;
+
+ switch ((child = fork())) {
+ case 0:
+ sleep(1);
+ exit(status);
+ case -1:
+ atf_tc_fail("fork failed");
+ default:
+ sigemptyset(&set);
+ sigsuspend(&set);
+ }
+}
+
+ATF_TC(sigchild_dump);
+ATF_TC_HEAD(sigchild_dump, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that signal trampoline correctly calls SIGCHLD handler "
+ "when child segfaults");
+}
+
+ATF_TC_BODY(sigchild_dump, tc)
+{
+ sigset_t set;
+
+ sigchild_setup();
+
+ status = SIGSEGV;
+ code = CLD_DUMPED;
+
+ switch ((child = fork())) {
+ case 0:
+ sleep(1);
+ *(volatile long *)0 = 0;
+ atf_tc_fail("Child did not segfault");
+ /* NOTREACHED */
+ case -1:
+ atf_tc_fail("fork failed");
+ default:
+ sigemptyset(&set);
+ sigsuspend(&set);
+ }
+}
+
+ATF_TC(sigchild_kill);
+ATF_TC_HEAD(sigchild_kill, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that signal trampoline correctly calls SIGCHLD handler "
+ "when child is killed");
+}
+
+ATF_TC_BODY(sigchild_kill, tc)
+{
+ sigset_t set;
+
+ sigchild_setup();
+
+ status = SIGPIPE;
+ code = CLD_KILLED;
+
+ switch ((child = fork())) {
+ case 0:
+ sigemptyset(&set);
+ sigsuspend(&set);
+ break;
+ case -1:
+ atf_tc_fail("fork failed");
+ default:
+ kill(child, SIGPIPE);
+ sigemptyset(&set);
+ sigsuspend(&set);
+ }
+}
+
+static sigjmp_buf sigfpe_flt_env;
+static void
+sigfpe_flt_action(int signo, siginfo_t *info, void *ptr)
+{
+
+ sig_debug(signo, info, (ucontext_t *)ptr);
+
+ if (fltdiv_signalled++ != 0)
+ atf_tc_fail("FPE handler called more than once");
+
+ ATF_REQUIRE_EQ(info->si_signo, SIGFPE);
+ ATF_REQUIRE_EQ(info->si_code, FPE_FLTDIV);
+ ATF_REQUIRE_EQ(info->si_errno, 0);
+
+ siglongjmp(sigfpe_flt_env, 1);
+}
+
+ATF_TC(sigfpe_flt);
+ATF_TC_HEAD(sigfpe_flt, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that signal trampoline correctly calls SIGFPE handler "
+ "for floating div-by-zero");
+}
+
+ATF_TC_BODY(sigfpe_flt, tc)
+{
+ struct sigaction sa;
+ double d = strtod("0", NULL);
+
+ if (isQEMU())
+ atf_tc_skip("Test does not run correctly under QEMU");
+#if defined(__powerpc__)
+ atf_tc_skip("Test not valid on powerpc");
+#endif
+ if (sigsetjmp(sigfpe_flt_env, 0) == 0) {
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = sigfpe_flt_action;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGFPE, &sa, NULL);
+#ifdef HAVE_FENV
+ feenableexcept(FE_ALL_EXCEPT);
+#elif defined(_FLOAT_IEEE754)
+ fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP);
+#endif
+ printf("%g\n", 1 / d);
+ }
+ if (fltdiv_signalled == 0)
+ atf_tc_fail("FPE signal handler was not invoked");
+}
+
+static sigjmp_buf sigfpe_int_env;
+static void
+sigfpe_int_action(int signo, siginfo_t *info, void *ptr)
+{
+
+ sig_debug(signo, info, (ucontext_t *)ptr);
+
+ if (intdiv_signalled++ != 0)
+ atf_tc_fail("INTDIV handler called more than once");
+
+ ATF_REQUIRE_EQ(info->si_signo, SIGFPE);
+ ATF_REQUIRE_EQ(info->si_code, FPE_INTDIV);
+ atf_tc_expect_pass();
+ ATF_REQUIRE_EQ(info->si_errno, 0);
+
+ siglongjmp(sigfpe_int_env, 1);
+}
+
+ATF_TC(sigfpe_int);
+ATF_TC_HEAD(sigfpe_int, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that signal trampoline correctly calls SIGFPE handler "
+ "for integer div-by-zero (PR port-i386/43655)");
+}
+
+ATF_TC_BODY(sigfpe_int, tc)
+{
+ struct sigaction sa;
+ long l = strtol("0", NULL, 10);
+
+#if defined(__powerpc__)
+ atf_tc_skip("Test not valid on powerpc");
+#endif
+ if (sigsetjmp(sigfpe_int_env, 0) == 0) {
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = sigfpe_int_action;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGFPE, &sa, NULL);
+#ifdef HAVE_FENV
+ feenableexcept(FE_ALL_EXCEPT);
+#elif defined(_FLOAT_IEEE754)
+ fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP);
+#endif
+ printf("%ld\n", 1 / l);
+ }
+ if (intdiv_signalled == 0)
+ atf_tc_fail("FPE signal handler was not invoked");
+}
+
+static void
+sigsegv_action(int signo, siginfo_t *info, void *ptr)
+{
+
+ sig_debug(signo, info, (ucontext_t *)ptr);
+
+ ATF_REQUIRE_EQ(info->si_signo, SIGSEGV);
+ ATF_REQUIRE_EQ(info->si_errno, 0);
+ ATF_REQUIRE_EQ(info->si_code, SEGV_MAPERR);
+ ATF_REQUIRE_EQ(info->si_addr, (void *)0);
+
+ atf_tc_pass();
+ /* NOTREACHED */
+}
+
+ATF_TC(sigsegv);
+ATF_TC_HEAD(sigsegv, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that signal trampoline correctly calls SIGSEGV handler");
+}
+
+ATF_TC_BODY(sigsegv, tc)
+{
+ struct sigaction sa;
+
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = sigsegv_action;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGSEGV, &sa, NULL);
+
+ *(volatile long *)0 = 0;
+ atf_tc_fail("Test did not fault as expected");
+}
+
+static void
+sigbus_action(int signo, siginfo_t *info, void *ptr)
+{
+
+ printf("si_addr = %p\n", info->si_addr);
+ sig_debug(signo, info, (ucontext_t *)ptr);
+
+ ATF_REQUIRE_EQ(info->si_signo, SIGBUS);
+ ATF_REQUIRE_EQ(info->si_errno, 0);
+ ATF_REQUIRE_EQ(info->si_code, BUS_ADRALN);
+
+#if defined(__i386__) || defined(__x86_64__)
+ atf_tc_expect_fail("x86 architecture does not correctly "
+ "report the address where the unaligned access occured");
+#endif
+ ATF_REQUIRE_EQ(info->si_addr, (volatile void *)addr);
+
+ atf_tc_pass();
+ /* NOTREACHED */
+}
+
+ATF_TC(sigbus_adraln);
+ATF_TC_HEAD(sigbus_adraln, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that signal trampoline correctly calls SIGBUS handler "
+ "for invalid address alignment");
+}
+
+ATF_TC_BODY(sigbus_adraln, tc)
+{
+ struct sigaction sa;
+
+#if defined(__alpha__)
+ int rv, val;
+ size_t len = sizeof(val);
+ rv = sysctlbyname("machdep.unaligned_sigbus", &val, &len, NULL, 0);
+ ATF_REQUIRE(rv == 0);
+ if (val == 0)
+ atf_tc_skip("SIGBUS signal not enabled for unaligned accesses");
+#endif
+
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = sigbus_action;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGBUS, &sa, NULL);
+
+ /* Enable alignment checks for x86. 0x40000 is PSL_AC. */
+#if defined(__i386__)
+ __asm__("pushf; orl $0x40000, (%esp); popf");
+#elif defined(__amd64__)
+ __asm__("pushf; orl $0x40000, (%rsp); popf");
+#endif
+
+ addr = calloc(2, sizeof(int));
+ ATF_REQUIRE(addr != NULL);
+
+ if (isQEMU())
+ atf_tc_expect_fail("QEMU fails to trap unaligned accesses");
+
+ /* Force an unaligned access */
+ addr++;
+ printf("now trying to access unaligned address %p\n", addr);
+ ATF_REQUIRE_EQ(*(volatile int *)addr, 0);
+
+ atf_tc_fail("Test did not fault as expected");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sigalarm);
+ ATF_TP_ADD_TC(tp, sigchild_normal);
+ ATF_TP_ADD_TC(tp, sigchild_dump);
+ ATF_TP_ADD_TC(tp, sigchild_kill);
+ ATF_TP_ADD_TC(tp, sigfpe_flt);
+ ATF_TP_ADD_TC(tp, sigfpe_int);
+ ATF_TP_ADD_TC(tp, sigsegv);
+ ATF_TP_ADD_TC(tp, sigbus_adraln);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
new file mode 100644
index 0000000..e4dc94e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
@@ -0,0 +1,337 @@
+/* $NetBSD: t_sleep.c,v 1.8 2014/07/15 14:56:34 gson Exp $ */
+
+/*-
+ * Copyright (c) 2006 Frank Kardel
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <errno.h>
+#include <poll.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <sys/cdefs.h>
+#include <sys/event.h>
+#include <sys/signal.h>
+
+#include "isqemu.h"
+
+#define BILLION 1000000000LL /* nano-seconds per second */
+#define MILLION 1000000LL /* nano-seconds per milli-second */
+
+#define ALARM 6 /* SIGALRM after this many seconds */
+#define MAXSLEEP 22 /* Maximum delay in seconds */
+#define KEVNT_TIMEOUT 10300 /* measured in milli-seconds */
+#define FUZZ (40 * MILLION) /* scheduling fuzz accepted - 40 ms */
+
+/*
+ * Timer notes
+ *
+ * Most tests use FUZZ as their initial delay value, but 'sleep'
+ * starts at 1sec (since it cannot handle sub-second intervals).
+ * Subsequent passes double the previous interval, up to MAXSLEEP.
+ *
+ * The current values result in 5 passes for the 'sleep' test (at 1,
+ * 2, 4, 8, and 16 seconds) and 10 passes for the other tests (at
+ * 0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56, 5.12, 10.24, and 20.48
+ * seconds).
+ *
+ * The ALARM is only set if the current pass's delay is longer, and
+ * only if the ALARM has not already been triggered.
+ *
+ * The 'kevent' test needs the ALARM to be set on a different pass
+ * from when the KEVNT_TIMEOUT fires. So set ALARM to fire on the
+ * penultimate pass, and the KEVNT_TIMEOUT on the final pass. We
+ * set KEVNT_TIMEOUT just barely long enough to put it into the
+ * last test pass, and set MAXSLEEP a couple seconds longer than
+ * necessary, in order to avoid a QEMU bug which nearly doubles
+ * some timers.
+ */
+
+static volatile int sig;
+
+int sleeptest(int (*)(struct timespec *, struct timespec *), bool, bool);
+int do_nanosleep(struct timespec *, struct timespec *);
+int do_select(struct timespec *, struct timespec *);
+int do_poll(struct timespec *, struct timespec *);
+int do_sleep(struct timespec *, struct timespec *);
+int do_kevent(struct timespec *, struct timespec *);
+void sigalrm(int);
+
+void
+sigalrm(int s)
+{
+
+ sig++;
+}
+
+int
+do_nanosleep(struct timespec *delay, struct timespec *remain)
+{
+ int ret;
+
+ if (nanosleep(delay, remain) == -1)
+ ret = (errno == EINTR ? 0 : errno);
+ else
+ ret = 0;
+ return ret;
+}
+
+int
+do_select(struct timespec *delay, struct timespec *remain)
+{
+ int ret;
+ struct timeval tv;
+
+ TIMESPEC_TO_TIMEVAL(&tv, delay);
+ if (select(0, NULL, NULL, NULL, &tv) == -1)
+ ret = (errno == EINTR ? 0 : errno);
+ else
+ ret = 0;
+ return ret;
+}
+
+int
+do_poll(struct timespec *delay, struct timespec *remain)
+{
+ int ret;
+ struct timeval tv;
+
+ TIMESPEC_TO_TIMEVAL(&tv, delay);
+ if (pollts(NULL, 0, delay, NULL) == -1)
+ ret = (errno == EINTR ? 0 : errno);
+ else
+ ret = 0;
+ return ret;
+}
+
+int
+do_sleep(struct timespec *delay, struct timespec *remain)
+{
+ struct timeval tv;
+
+ TIMESPEC_TO_TIMEVAL(&tv, delay);
+ remain->tv_sec = sleep(delay->tv_sec);
+ remain->tv_nsec = 0;
+
+ return 0;
+}
+
+int
+do_kevent(struct timespec *delay, struct timespec *remain)
+{
+ struct kevent ktimer;
+ struct kevent kresult;
+ int rtc, kq, kerrno;
+ int tmo;
+
+ ATF_REQUIRE_MSG((kq = kqueue()) != -1, "kqueue: %s", strerror(errno));
+
+ tmo = KEVNT_TIMEOUT;
+
+ /*
+ * If we expect the KEVNT_TIMEOUT to fire, and we're running
+ * under QEMU, make sure the delay is long enough to account
+ * for the effects of PR kern/43997 !
+ */
+ if (isQEMU() &&
+ tmo/1000 < delay->tv_sec && tmo/500 > delay->tv_sec)
+ delay->tv_sec = MAXSLEEP;
+
+ EV_SET(&ktimer, 1, EVFILT_TIMER, EV_ADD, 0, tmo, 0);
+
+ rtc = kevent(kq, &ktimer, 1, &kresult, 1, delay);
+ kerrno = errno;
+
+ (void)close(kq);
+
+ if (rtc == -1) {
+ ATF_REQUIRE_MSG(kerrno == EINTR, "kevent: %s", strerror(errno));
+ return 0;
+ }
+
+ if (delay->tv_sec * BILLION + delay->tv_nsec > tmo * MILLION)
+ ATF_REQUIRE_MSG(rtc > 0,
+ "kevent: KEVNT_TIMEOUT did not cause EVFILT_TIMER event");
+
+ return 0;
+}
+
+ATF_TC(nanosleep);
+ATF_TC_HEAD(nanosleep, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test nanosleep(2) timing");
+ atf_tc_set_md_var(tc, "timeout", "65");
+}
+
+ATF_TC_BODY(nanosleep, tc)
+{
+
+ sleeptest(do_nanosleep, true, false);
+}
+
+ATF_TC(select);
+ATF_TC_HEAD(select, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test select(2) timing");
+ atf_tc_set_md_var(tc, "timeout", "65");
+}
+
+ATF_TC_BODY(select, tc)
+{
+
+ sleeptest(do_select, true, true);
+}
+
+ATF_TC(poll);
+ATF_TC_HEAD(poll, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test poll(2) timing");
+ atf_tc_set_md_var(tc, "timeout", "65");
+}
+
+ATF_TC_BODY(poll, tc)
+{
+
+ sleeptest(do_poll, true, true);
+}
+
+ATF_TC(sleep);
+ATF_TC_HEAD(sleep, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test sleep(3) timing");
+ atf_tc_set_md_var(tc, "timeout", "65");
+}
+
+ATF_TC_BODY(sleep, tc)
+{
+
+ sleeptest(do_sleep, false, false);
+}
+
+ATF_TC(kevent);
+ATF_TC_HEAD(kevent, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test kevent(2) timing");
+ atf_tc_set_md_var(tc, "timeout", "65");
+}
+
+ATF_TC_BODY(kevent, tc)
+{
+
+ sleeptest(do_kevent, true, true);
+}
+
+int
+sleeptest(int (*test)(struct timespec *, struct timespec *),
+ bool subsec, bool sim_remain)
+{
+ struct timespec tsa, tsb, tslp, tremain;
+ int64_t delta1, delta2, delta3, round;
+
+ sig = 0;
+ signal(SIGALRM, sigalrm);
+
+ if (subsec) {
+ round = 1;
+ delta3 = FUZZ;
+ } else {
+ round = 1000000000;
+ delta3 = round;
+ }
+
+ tslp.tv_sec = delta3 / 1000000000;
+ tslp.tv_nsec = delta3 % 1000000000;
+
+ while (tslp.tv_sec <= MAXSLEEP) {
+ /*
+ * disturb sleep by signal on purpose
+ */
+ if (tslp.tv_sec > ALARM && sig == 0)
+ alarm(ALARM);
+
+ clock_gettime(CLOCK_REALTIME, &tsa);
+ (*test)(&tslp, &tremain);
+ clock_gettime(CLOCK_REALTIME, &tsb);
+
+ if (sim_remain) {
+ timespecsub(&tsb, &tsa, &tremain);
+ timespecsub(&tslp, &tremain, &tremain);
+ }
+
+ delta1 = (int64_t)tsb.tv_sec - (int64_t)tsa.tv_sec;
+ delta1 *= BILLION;
+ delta1 += (int64_t)tsb.tv_nsec - (int64_t)tsa.tv_nsec;
+
+ delta2 = (int64_t)tremain.tv_sec * BILLION;
+ delta2 += (int64_t)tremain.tv_nsec;
+
+ delta3 = (int64_t)tslp.tv_sec * BILLION;
+ delta3 += (int64_t)tslp.tv_nsec - delta1 - delta2;
+
+ delta3 /= round;
+ delta3 *= round;
+
+ if (delta3 > FUZZ || delta3 < -FUZZ) {
+ if (!sim_remain)
+ atf_tc_expect_fail("Long reschedule latency "
+ "due to PR kern/43997");
+
+ atf_tc_fail("Reschedule latency %"PRId64" exceeds "
+ "allowable fuzz %lld", delta3, FUZZ);
+ }
+ delta3 = (int64_t)tslp.tv_sec * 2 * BILLION;
+ delta3 += (int64_t)tslp.tv_nsec * 2;
+
+ delta3 /= round;
+ delta3 *= round;
+ if (delta3 < FUZZ)
+ break;
+ tslp.tv_sec = delta3 / BILLION;
+ tslp.tv_nsec = delta3 % BILLION;
+ }
+ ATF_REQUIRE_MSG(sig == 1, "Alarm did not fire!");
+
+ atf_tc_pass();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, nanosleep);
+ ATF_TP_ADD_TC(tp, select);
+ ATF_TP_ADD_TC(tp, poll);
+ ATF_TP_ADD_TC(tp, sleep);
+ ATF_TP_ADD_TC(tp, kevent);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_syslog.c b/contrib/netbsd-tests/lib/libc/gen/t_syslog.c
new file mode 100644
index 0000000..c9417c0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_syslog.c
@@ -0,0 +1,56 @@
+/* $NetBSD: t_syslog.c,v 1.2 2012/03/18 07:00:51 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (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/types.h>
+
+#include <atf-c.h>
+#include <syslog.h>
+
+ATF_TC(syslog_pthread);
+ATF_TC_HEAD(syslog_pthread, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test that syslog(3) "
+ "works when linked to pthread(3) (PR lib/44248)");
+ atf_tc_set_md_var(tc, "timeout", "2");
+}
+
+ATF_TC_BODY(syslog_pthread, tc)
+{
+ syslog(LOG_DEBUG, "from tests/lib/libc/gen/t_syslog");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, syslog_pthread);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_time.c b/contrib/netbsd-tests/lib/libc/gen/t_time.c
new file mode 100644
index 0000000..bfbdc73
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_time.c
@@ -0,0 +1,114 @@
+/* $NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+
+ATF_TC(time_copy);
+ATF_TC_HEAD(time_copy, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test the return values of time(3)");
+}
+
+ATF_TC_BODY(time_copy, tc)
+{
+ time_t t1, t2 = 0;
+
+ t1 = time(&t2);
+
+ if (t1 != t2)
+ atf_tc_fail("incorrect return values from time(3)");
+}
+
+ATF_TC(time_mono);
+ATF_TC_HEAD(time_mono, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test monotonicity of time(3)");
+}
+
+ATF_TC_BODY(time_mono, tc)
+{
+ const size_t maxiter = 10;
+ time_t t1, t2;
+ size_t i;
+
+ for (i = 0; i < maxiter; i++) {
+
+ t1 = time(NULL);
+ (void)sleep(1);
+ t2 = time(NULL);
+
+ (void)fprintf(stderr, "%"PRId64" vs. %"PRId64"\n",
+ (int64_t)t1, (int64_t)t2);
+
+ if (t1 >= t2)
+ atf_tc_fail("time(3) is not monotonic");
+ }
+}
+
+ATF_TC(time_timeofday);
+ATF_TC_HEAD(time_timeofday, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test time(3) vs. gettimeofday(2)");
+}
+
+ATF_TC_BODY(time_timeofday, tc)
+{
+ struct timeval tv = { 0, 0 };
+ time_t t;
+
+ t = time(NULL);
+ ATF_REQUIRE(gettimeofday(&tv, NULL) == 0);
+
+ (void)fprintf(stderr, "%"PRId64" vs. %"PRId64"\n",
+ (int64_t)t, (int64_t)tv.tv_sec);
+
+ if (t != tv.tv_sec)
+ atf_tc_fail("time(3) and gettimeofday(2) differ");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, time_copy);
+ ATF_TP_ADD_TC(tp, time_mono);
+ ATF_TP_ADD_TC(tp, time_timeofday);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c b/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
new file mode 100644
index 0000000..0c10c24
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
@@ -0,0 +1,188 @@
+/* $NetBSD: t_ttyname.c,v 1.3 2011/05/01 18:14:01 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_ttyname.c,v 1.3 2011/05/01 18:14:01 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static long ttymax = 0;
+
+ATF_TC(ttyname_err);
+ATF_TC_HEAD(ttyname_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors in ttyname(3)");
+}
+
+ATF_TC_BODY(ttyname_err, tc)
+{
+ int fd;
+
+ fd = open("XXX", O_RDONLY);
+
+ if (fd < 0) {
+
+ errno = 0;
+
+ ATF_REQUIRE(isatty(fd) != -1);
+ ATF_REQUIRE(errno == EBADF);
+
+ errno = 0;
+
+ ATF_REQUIRE(ttyname(fd) == NULL);
+ ATF_REQUIRE(errno == EBADF);
+ }
+
+ fd = open("/etc/passwd", O_RDONLY);
+
+ if (fd >= 0) {
+
+ errno = 0;
+
+ ATF_REQUIRE(isatty(fd) != -1);
+ ATF_REQUIRE(errno == ENOTTY);
+
+ errno = 0;
+
+ ATF_REQUIRE(ttyname(fd) == NULL);
+ ATF_REQUIRE(errno == ENOTTY);
+ }
+}
+
+ATF_TC(ttyname_r_err);
+ATF_TC_HEAD(ttyname_r_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors in ttyname_r(3)");
+}
+
+ATF_TC_BODY(ttyname_r_err, tc)
+{
+ char sbuf[0];
+ char *buf;
+ int fd;
+ int rv;
+
+ buf = malloc(ttymax + 1);
+
+ if (buf == NULL)
+ return;
+
+ (void)memset(buf, '\0', ttymax + 1);
+
+ if (isatty(STDIN_FILENO) != 0) {
+
+ rv = ttyname_r(STDIN_FILENO, sbuf, sizeof(sbuf));
+ ATF_REQUIRE(rv == ERANGE);
+ }
+
+ rv = ttyname_r(-1, buf, ttymax);
+ ATF_REQUIRE(rv == EBADF);
+
+ fd = open("/etc/passwd", O_RDONLY);
+
+ if (fd >= 0) {
+ rv = ttyname_r(fd, buf, ttymax);
+ ATF_REQUIRE(rv == ENOTTY);
+ ATF_REQUIRE(close(fd) == 0);
+ }
+
+ free(buf);
+}
+
+ATF_TC(ttyname_r_stdin);
+ATF_TC_HEAD(ttyname_r_stdin, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ttyname_r(3) with stdin(3)");
+}
+
+ATF_TC_BODY(ttyname_r_stdin, tc)
+{
+ const char *str;
+ char *buf;
+ int rv;
+
+ if (isatty(STDIN_FILENO) == 0)
+ return;
+
+ buf = malloc(ttymax + 1);
+
+ if (buf == NULL)
+ return;
+
+ (void)memset(buf, '\0', ttymax + 1);
+
+ str = ttyname(STDIN_FILENO);
+ rv = ttyname_r(STDIN_FILENO, buf, ttymax);
+
+ ATF_REQUIRE(rv == 0);
+ ATF_REQUIRE(str != NULL);
+
+ if (strcmp(str, buf) != 0)
+ atf_tc_fail("ttyname(3) and ttyname_r(3) conflict");
+
+ free(buf);
+}
+
+ATF_TC(ttyname_stdin);
+ATF_TC_HEAD(ttyname_stdin, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ttyname(3) with stdin(3)");
+}
+
+ATF_TC_BODY(ttyname_stdin, tc)
+{
+
+ if (isatty(STDIN_FILENO) != 0)
+ ATF_REQUIRE(ttyname(STDIN_FILENO) != NULL);
+
+ (void)close(STDIN_FILENO);
+
+ ATF_REQUIRE(isatty(STDIN_FILENO) != 1);
+ ATF_REQUIRE(ttyname(STDIN_FILENO) == NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ttymax = sysconf(_SC_TTY_NAME_MAX);
+ ATF_REQUIRE(ttymax >= 0);
+
+ ATF_TP_ADD_TC(tp, ttyname_err);
+ ATF_TP_ADD_TC(tp, ttyname_r_err);
+ ATF_TP_ADD_TC(tp, ttyname_r_stdin);
+ ATF_TP_ADD_TC(tp, ttyname_stdin);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_vis.c b/contrib/netbsd-tests/lib/libc/gen/t_vis.c
new file mode 100644
index 0000000..525bafa
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/gen/t_vis.c
@@ -0,0 +1,155 @@
+/* $NetBSD: t_vis.c,v 1.7 2014/09/08 19:01:03 christos Exp $ */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code was contributed to The NetBSD Foundation by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <string.h>
+#include <stdlib.h>
+#include <err.h>
+#include <vis.h>
+
+static int styles[] = {
+ VIS_OCTAL,
+ VIS_CSTYLE,
+ VIS_SP,
+ VIS_TAB,
+ VIS_NL,
+ VIS_WHITE,
+ VIS_SAFE,
+#if 0 /* Not reversible */
+ VIS_NOSLASH,
+#endif
+ VIS_HTTP1808,
+ VIS_MIMESTYLE,
+#if 0 /* Not supported by vis(3) */
+ VIS_HTTP1866,
+#endif
+};
+
+#define SIZE 256
+
+ATF_TC(strvis_basic);
+ATF_TC_HEAD(strvis_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test strvis(3)");
+}
+
+ATF_TC_BODY(strvis_basic, tc)
+{
+ char *srcbuf, *dstbuf, *visbuf;
+ unsigned int i, j;
+
+ ATF_REQUIRE((dstbuf = malloc(SIZE)) != NULL);
+ ATF_REQUIRE((srcbuf = malloc(SIZE)) != NULL);
+ ATF_REQUIRE((visbuf = malloc(SIZE * 4 + 1)) != NULL);
+
+ for (i = 0; i < SIZE; i++)
+ srcbuf[i] = (char)i;
+
+ for (i = 0; i < __arraycount(styles); i++) {
+ ATF_REQUIRE(strsvisx(visbuf, srcbuf, SIZE, styles[i], "") > 0);
+ memset(dstbuf, 0, SIZE);
+ ATF_REQUIRE(strunvisx(dstbuf, visbuf,
+ styles[i] & (VIS_HTTP1808|VIS_MIMESTYLE)) > 0);
+ for (j = 0; j < SIZE; j++)
+ if (dstbuf[j] != (char)j)
+ atf_tc_fail_nonfatal("Failed for style %x, "
+ "char %d [%d]", styles[i], j, dstbuf[j]);
+ }
+ free(dstbuf);
+ free(srcbuf);
+ free(visbuf);
+}
+
+ATF_TC(strvis_null);
+ATF_TC_HEAD(strvis_null, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strvis(3) NULL");
+}
+
+ATF_TC_BODY(strvis_null, tc)
+{
+ char dst[] = "fail";
+ strvis(dst, NULL, VIS_SAFE);
+ ATF_REQUIRE(dst[0] == '\0' && dst[1] == 'a');
+}
+
+ATF_TC(strvis_empty);
+ATF_TC_HEAD(strvis_empty, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strvis(3) empty");
+}
+
+ATF_TC_BODY(strvis_empty, tc)
+{
+ char dst[] = "fail";
+ strvis(dst, "", VIS_SAFE);
+ ATF_REQUIRE(dst[0] == '\0' && dst[1] == 'a');
+}
+
+ATF_TC(strunvis_hex);
+ATF_TC_HEAD(strunvis_hex, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strunvis(3) \\xXX");
+}
+
+ATF_TC_BODY(strunvis_hex, tc)
+{
+ static const struct {
+ const char *e;
+ const char *d;
+ int error;
+ } ed[] = {
+ { "\\xff", "\xff", 1 },
+ { "\\x1", "\x1", 1 },
+ { "\\x1\\x02", "\x1\x2", 2 },
+ { "\\x1x", "\x1x", 2 },
+ { "\\xx", "", -1 },
+ };
+ char uv[10];
+
+ for (size_t i = 0; i < __arraycount(ed); i++) {
+ ATF_REQUIRE(strunvis(uv, ed[i].e) == ed[i].error);
+ if (ed[i].error > 0)
+ ATF_REQUIRE(memcmp(ed[i].d, uv, ed[i].error) == 0);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strvis_basic);
+ ATF_TP_ADD_TC(tp, strvis_null);
+ ATF_TP_ADD_TC(tp, strvis_empty);
+ ATF_TP_ADD_TC(tp, strunvis_hex);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/hash/data/md5test-in b/contrib/netbsd-tests/lib/libc/hash/data/md5test-in
new file mode 100644
index 0000000..763e4f9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/hash/data/md5test-in
@@ -0,0 +1,7 @@
+
+a
+abc
+message digest
+abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
+12345678901234567890123456789012345678901234567890123456789012345678901234567890
diff --git a/contrib/netbsd-tests/lib/libc/hash/data/md5test-out b/contrib/netbsd-tests/lib/libc/hash/data/md5test-out
new file mode 100644
index 0000000..bb86bb6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/hash/data/md5test-out
@@ -0,0 +1,7 @@
+d41d8cd98f00b204e9800998ecf8427e
+0cc175b9c0f1b6a831c399e269772661
+900150983cd24fb0d6963f7d28e17f72
+f96b697d7cb7938d525a2f31aaf161d0
+c3fcd3d76192e4007dfb496cca67e13b
+d174ab98d277d9f5a5611c2c9f419d9f
+57edf4a22be3c955ac49da2e2107b67a
diff --git a/contrib/netbsd-tests/lib/libc/hash/data/sha1test-in b/contrib/netbsd-tests/lib/libc/hash/data/sha1test-in
new file mode 100644
index 0000000..632d133
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/hash/data/sha1test-in
@@ -0,0 +1,2 @@
+abc
+abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq
diff --git a/contrib/netbsd-tests/lib/libc/hash/data/sha1test-out b/contrib/netbsd-tests/lib/libc/hash/data/sha1test-out
new file mode 100644
index 0000000..c23a058
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/hash/data/sha1test-out
@@ -0,0 +1,2 @@
+a9993e364706816aba3e25717850c26c9cd0d89d
+84983e441c3bd26ebaae4aa1f95129e5e54670f1
diff --git a/contrib/netbsd-tests/lib/libc/hash/data/sha1test2-out b/contrib/netbsd-tests/lib/libc/hash/data/sha1test2-out
new file mode 100644
index 0000000..a483a0e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/hash/data/sha1test2-out
@@ -0,0 +1 @@
+34aa973cd4c4daa4f61eeb2bdbad27316534016f
diff --git a/contrib/netbsd-tests/lib/libc/hash/h_hash.c b/contrib/netbsd-tests/lib/libc/hash/h_hash.c
new file mode 100644
index 0000000..33b9f9a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/hash/h_hash.c
@@ -0,0 +1,167 @@
+/* $NetBSD: h_hash.c,v 1.1 2011/01/02 22:03:25 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Combined MD5/SHA1 time and regression test.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <md5.h>
+#include <sha1.h>
+
+
+int mflag, rflag, sflag, tflag;
+
+static void
+usage(void)
+{
+ (void)fprintf(stderr,
+ "Usage:\t%s -r[ms] < test-file\n"
+ "\t%s -t[ms]\n",
+ getprogname(), getprogname());
+ exit(1);
+ /* NOTREACHED */
+}
+
+static void
+hexdump (unsigned char *buf, int len)
+{
+ int i;
+ for (i=0; i<len; i++) {
+ printf("%02x", buf[i]);
+ }
+ printf("\n");
+}
+
+
+static void
+timetest(void)
+{
+ printf("sorry, not yet\n");
+}
+
+#define CHOMP(buf, len, last) \
+ if ((len > 0) && \
+ (buf[len-1] == '\n')) { \
+ buf[len-1] = '\0'; \
+ len--; \
+ last = 1; \
+ }
+
+static void
+regress(void)
+{
+ unsigned char buf[1024];
+ unsigned char out[20];
+ int len, outlen, last;
+
+ while (fgets((char *)buf, sizeof(buf), stdin) != NULL) {
+ last = 0;
+
+ len = strlen((char *)buf);
+ CHOMP(buf, len, last);
+ if (mflag) {
+ MD5_CTX ctx;
+
+ MD5Init(&ctx);
+ MD5Update(&ctx, buf, len);
+ while (!last &&
+ fgets((char *)buf, sizeof(buf), stdin) != NULL) {
+ len = strlen((char *)buf);
+ CHOMP(buf, len, last);
+ MD5Update(&ctx, buf, len);
+ }
+ MD5Final(out, &ctx);
+ outlen = 16;
+ } else {
+ SHA1_CTX ctx;
+
+ SHA1Init(&ctx);
+ SHA1Update(&ctx, buf, len);
+ while (!last &&
+ fgets((char *)buf, sizeof(buf), stdin) != NULL) {
+ len = strlen((char *)buf);
+ CHOMP(buf, len, last);
+ SHA1Update(&ctx, buf, len);
+ }
+ SHA1Final(out, &ctx);
+ outlen = 20;
+ }
+ hexdump(out, outlen);
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ int ch;
+
+ while ((ch = getopt(argc, argv, "mrst")) != -1)
+ switch (ch) {
+ case 'm':
+ mflag = 1;
+ break;
+ case 'r':
+ rflag = 1;
+ break;
+ case 's':
+ sflag = 1;
+ break;
+ case 't':
+ tflag = 1;
+ break;
+ case '?':
+ default:
+ usage();
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc > 0)
+ usage();
+
+ if (!(mflag || sflag))
+ mflag = 1;
+
+ if ((mflag ^ sflag) != 1)
+ usage();
+
+ if ((tflag ^ rflag) != 1)
+ usage();
+
+ if (tflag)
+ timetest();
+
+ if (rflag)
+ regress();
+
+ exit(0);
+
+}
diff --git a/contrib/netbsd-tests/lib/libc/hash/t_hash.sh b/contrib/netbsd-tests/lib/libc/hash/t_hash.sh
new file mode 100755
index 0000000..719f19d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/hash/t_hash.sh
@@ -0,0 +1,67 @@
+# $NetBSD: t_hash.sh,v 1.1 2011/01/02 22:03:25 pgoyette Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+prog()
+{
+ echo "$(atf_get_srcdir)/h_hash"
+}
+
+datadir()
+{
+ echo "$(atf_get_srcdir)/data"
+}
+
+atf_test_case md5
+md5_head()
+{
+ atf_set "descr" "Checks MD5 functions"
+}
+md5_body()
+{
+ atf_check -o file:"$(datadir)/md5test-out" -x \
+ "$(prog) -r < $(datadir)/md5test-in"
+}
+
+atf_test_case sha1
+sha1_head()
+{
+ atf_set "descr" "Checks SHA1 functions"
+}
+sha1_body()
+{
+ atf_check -o file:"$(datadir)/sha1test-out" -x \
+ "$(prog) -rs < $(datadir)/sha1test-in"
+
+ atf_check -o file:"$(datadir)/sha1test2-out" -x \
+ "jot -s '' -b 'a' -n 1000000 | $(prog) -rs"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case md5
+ atf_add_test_case sha1
+}
diff --git a/contrib/netbsd-tests/lib/libc/hash/t_sha2.c b/contrib/netbsd-tests/lib/libc/hash/t_sha2.c
new file mode 100644
index 0000000..a45e82a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/hash/t_sha2.c
@@ -0,0 +1,243 @@
+/* $NetBSD: t_sha2.c,v 1.3 2012/09/26 22:23:30 joerg Exp $ */
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_sha2.c,v 1.3 2012/09/26 22:23:30 joerg Exp $");
+
+#include <atf-c.h>
+#include <sys/types.h>
+#include <sha2.h>
+#include <string.h>
+
+ATF_TC(t_sha256);
+ATF_TC(t_sha384);
+ATF_TC(t_sha512);
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_sha256);
+ ATF_TP_ADD_TC(tp, t_sha384);
+ ATF_TP_ADD_TC(tp, t_sha512);
+
+ return atf_no_error();
+}
+
+struct testvector {
+ const char *vector;
+ const char *hash;
+};
+
+static const struct testvector test256[] = {
+ { "hello, world", "09ca7e4eaa6e8ae9c7d261167129184883644d07dfba7cbfbc4c8a2e08360d5b" },
+ { "", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" },
+ { "a", "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb" },
+ { "ab", "fb8e20fc2e4c3f248c60c39bd652f3c1347298bb977b8b4d5903b85055620603" },
+ { "abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" },
+ { "abcd", "88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589" },
+ { "abcde", "36bbe50ed96841d10443bcb670d6554f0a34b761be67ec9c4a8ad2c0c44ca42c" },
+ { "abcdef", "bef57ec7f53a6d40beb640a780a639c83bc29ac8a9816f1fc6c5c6dcd93c4721" },
+ { "abcdefg", "7d1a54127b222502f5b79b5fb0803061152a44f92b37e23c6527baf665d4da9a" },
+ { "abcdefgh", "9c56cc51b374c3ba189210d5b6d4bf57790d351c96c47c02190ecf1e430635ab" },
+ { "abcdefghi", "19cc02f26df43cc571bc9ed7b0c4d29224a3ec229529221725ef76d021c8326f" },
+ { "abcdefghij", "72399361da6a7754fec986dca5b7cbaf1c810a28ded4abaf56b2106d06cb78b0" },
+ { "abcdefghijk", "ca2f2069ea0c6e4658222e06f8dd639659cbb5e67cbbba6734bc334a3799bc68" },
+ { "abcdefghijkl", "d682ed4ca4d989c134ec94f1551e1ec580dd6d5a6ecde9f3d35e6e4a717fbde4" },
+ { "abcdefghijklm", "ff10304f1af23606ede1e2d8abcdc94c229047a61458d809d8bbd53ede1f6598" },
+ { "abcdefghijklmn", "0653c7e992d7aad40cb2635738b870e4c154afb346340d02c797d490dd52d5f9" },
+ { "abcdefghijklmno", "41c7760c50efde99bf574ed8fffc7a6dd3405d546d3da929b214c8945acf8a97" },
+ { "abcdefghijklmnop", "f39dac6cbaba535e2c207cd0cd8f154974223c848f727f98b3564cea569b41cf" },
+ { "abcdefghijklmnopq", "918a954ac4dfb54ac39f068d9868227f69ab39bc362e2c9b0083bf6a109d6ad7" },
+ { "abcdefghijklmnopqr", "2d1222692afaf56e95a8ab00879ed023a00db3e26fa14236e542748579285efa" },
+ { "abcdefghijklmnopqrs", "e250f886728b77ba63722c7e65fc73e203101a84281b32332fd67cc6a1ae3e22" },
+ { "abcdefghijklmnopqrst", "dd65eea0329dcb94b17187af9dff28c31a1d78026737a16af75979a1fa4618e5" },
+ { "abcdefghijklmnopqrstu", "25f62a5a3d414ec6e20907df7f367f2b72625aade552db64c07933f6044fc49a" },
+ { "abcdefghijklmnopqrstuv", "f69f9b70d1c9a5442258ca76f8b0a7a45fcb4e31c36141b6357ec591328b0624" },
+ { "abcdefghijklmnopqrstuvw", "7f07818e14d08944ce145629ca54332f5cfad148c590efbcb5c377f4d336e5f4" },
+ { "abcdefghijklmnopqrstuvwq", "063132d7fbec0acb79b2f228777eec8885e7f09bc1896b3ce5aa1843e83de048" },
+};
+
+static const struct testvector test384[] = {
+ { "hello, world", "1fcdb6059ce05172a26bbe2a3ccc88ed5a8cd5fc53edfd9053304d429296a6da23b1cd9e5c9ed3bb34f00418a70cdb7e" },
+ { "", "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b" },
+ { "a", "54a59b9f22b0b80880d8427e548b7c23abd873486e1f035dce9cd697e85175033caa88e6d57bc35efae0b5afd3145f31" },
+ { "ab", "c7be03ba5bcaa384727076db0018e99248e1a6e8bd1b9ef58a9ec9dd4eeebb3f48b836201221175befa74ddc3d35afdd" },
+ { "abc", "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7" },
+ { "abcd", "1165b3406ff0b52a3d24721f785462ca2276c9f454a116c2b2ba20171a7905ea5a026682eb659c4d5f115c363aa3c79b" },
+ { "abcde", "4c525cbeac729eaf4b4665815bc5db0c84fe6300068a727cf74e2813521565abc0ec57a37ee4d8be89d097c0d2ad52f0" },
+ { "abcdef", "c6a4c65b227e7387b9c3e839d44869c4cfca3ef583dea64117859b808c1e3d8ae689e1e314eeef52a6ffe22681aa11f5" },
+ { "abcdefg", "9f11fc131123f844c1226f429b6a0a6af0525d9f40f056c7fc16cdf1b06bda08e302554417a59fa7dcf6247421959d22" },
+ { "abcdefgh", "9000cd7cada59d1d2eb82912f7f24e5e69cc5517f68283b005fa27c285b61e05edf1ad1a8a9bded6fd29eb87d75ad806" },
+ { "abcdefghi", "ef54915b60cf062b8dd0c29ae3cad69abe6310de63ac081f46ef019c5c90897caefd79b796cfa81139788a260ded52df" },
+ { "abcdefghij", "a12070030a02d86b0ddacd0d3a5b598344513d0a051e7355053e556a0055489c1555399b03342845c4adde2dc44ff66c" },
+ { "abcdefghijk", "2440d0e751fe5b8b1aba067e20be00b9deecc5e218b0b4b37202de824bcd04294d67c8d0b73e393afa844fa9ca25fa51" },
+ { "abcdefghijkl", "103ca96c06a1ce798f08f8eff0dfb0ccdb567d48b285b23d0cd773454667a3c2fa5f1b58d9cdf2329bd9979730bfaaff" },
+ { "abcdefghijklm", "89a7179df195462f047393c36e4843183eb38404bdfbacfd0b0f9c2556632a2799f19c3ecf48bdb7c9bdf95d3f6c3704" },
+ { "abcdefghijklmn", "3bc463b0a5614d39fd207cbfd108534bce68d5438235c6c577b34b70fe219954adceaf8808d1fad4a44fc9c420ea8ff1" },
+ { "abcdefghijklmno", "5149860ee76dd6666308189e60090d615e36ce0c0ef753a610cca0524a022900489d70167a47cc74c4dd9f9f340066af" },
+ { "abcdefghijklmnop", "96d3c1b54b1938600abe5b57232e185df1c5856f74656b8f9837c5317cf5b22ac38226fafc8c946b9d20aca1b0c53a98" },
+ { "abcdefghijklmnopq", "dae0d8c29d8f1137df3afb8f502dc474d3bbb56de0c10fc219547826f23f38f37ec29e4ed203908e6e7955c83a138129" },
+ { "abcdefghijklmnopqr", "5cfa62716d985d3b1efab0ed3460e7b7f6af9439ae8ee5c58b20e68607eeec3e8c6df8481f5f36e726eaa56512acea6e" },
+ { "abcdefghijklmnopqrs", "c5d404fc93b0e59ecb5f40446da201876faf18a0af46e577ae2f7a4fe56dc4c419afff7edec90ff3de160d0c5e7a5ec1" },
+ { "abcdefghijklmnopqrst", "bc1511cd8b813544cb60b13d1ceb63e81f46aa3ca114a23fc5c3aba54f9965cdf9afa68e2dc2a680934e429dff5aa7f2" },
+ { "abcdefghijklmnopqrstu", "8f18622d37e0aceabba191e3836b30e8970aca202ce6e811f586ec5f950edb7bf799cc88a18468a3effb063397242d95" },
+ { "abcdefghijklmnopqrstuv", "c8a4f46e609626543ce6c1362721fcbe95c8e7405aaee61da4f2da1740f0351172c98a66530f8607bf8609e387ff8456" },
+ { "abcdefghijklmnopqrstuvw", "2daff33b3bd67de61550070696b431d54b1397b40d053912b07a94260812185907726e3efbe9ae9fc078659cd2ce36db" },
+ { "abcdefghijklmnopqrstuvwq", "87dc70a2eaa0dd0b687f91f26383866161026e41bb310a9e32b7a17c99284db85b9743476a30caeedf3fbb3c8072bc5e" },
+};
+
+static const struct testvector test512[] = {
+ { "hello, world", "8710339dcb6814d0d9d2290ef422285c9322b7163951f9a0ca8f883d3305286f44139aa374848e4174f5aada663027e4548637b6d19894aec4fb6c46a139fbf9" },
+ { "", "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" },
+ { "a", "1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75" },
+ { "ab", "2d408a0717ec188158278a796c689044361dc6fdde28d6f04973b80896e1823975cdbf12eb63f9e0591328ee235d80e9b5bf1aa6a44f4617ff3caf6400eb172d" },
+ { "abc", "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f" },
+ { "abcd", "d8022f2060ad6efd297ab73dcc5355c9b214054b0d1776a136a669d26a7d3b14f73aa0d0ebff19ee333368f0164b6419a96da49e3e481753e7e96b716bdccb6f" },
+ { "abcde", "878ae65a92e86cac011a570d4c30a7eaec442b85ce8eca0c2952b5e3cc0628c2e79d889ad4d5c7c626986d452dd86374b6ffaa7cd8b67665bef2289a5c70b0a1" },
+ { "abcdef", "e32ef19623e8ed9d267f657a81944b3d07adbb768518068e88435745564e8d4150a0a703be2a7d88b61e3d390c2bb97e2d4c311fdc69d6b1267f05f59aa920e7" },
+ { "abcdefg", "d716a4188569b68ab1b6dfac178e570114cdf0ea3a1cc0e31486c3e41241bc6a76424e8c37ab26f096fc85ef9886c8cb634187f4fddff645fb099f1ff54c6b8c" },
+ { "abcdefgh", "a3a8c81bc97c2560010d7389bc88aac974a104e0e2381220c6e084c4dccd1d2d17d4f86db31c2a851dc80e6681d74733c55dcd03dd96f6062cdda12a291ae6ce" },
+ { "abcdefghi", "f22d51d25292ca1d0f68f69aedc7897019308cc9db46efb75a03dd494fc7f126c010e8ade6a00a0c1a5f1b75d81e0ed5a93ce98dc9b833db7839247b1d9c24fe" },
+ { "abcdefghij", "ef6b97321f34b1fea2169a7db9e1960b471aa13302a988087357c520be957ca119c3ba68e6b4982c019ec89de3865ccf6a3cda1fe11e59f98d99f1502c8b9745" },
+ { "abcdefghijk", "2798fd001ee8800e3da09ee99ae9600de2d0ccf464ab782c92fcc06ce3847cef0743365f1d49c2c8b4426db1635433f937d508672a9d0cb673b84f368eca1b23" },
+ { "abcdefghijkl", "17807c728ee3ba35e7cf7af823116d26e41e5d4d6c2ff1f3720d3d96aacb6f69de642e63d5b73fc396c12be38b2bd5d884257c32c8f6d0854ae6b540f86dda2e" },
+ { "abcdefghijklm", "e11a66f7b9a2acda5663e9434377137d73ea560a32782230412642a463c8558123bfb7c0dbf17851e9aa58cc9587c3b4f5e3f7f38dcb6f890702e5bed4d5b54a" },
+ { "abcdefghijklmn", "8334134081070bf7fcc8bf1c242d24bb3182a5119e5fb19d8bbf6b9d0cdb7fed5336e83415fce93094c0e55123cf69e14d7ae41b22289232699824e31125b6d9" },
+ { "abcdefghijklmno", "db723f341a042d8de1aa813efd5e02fc1745ccbe259486257514804e2ec4bcebb2a46f1e4ad442154943f9e97e1bc47c3ae0eddab7de0c01a9c51f15342a5b19" },
+ { "abcdefghijklmnop", "d0cadd6834fa0c157b36cca30ee8b0b1435d841aa5b5ac850c11ae80a1440f51743e98fb1f1e7376c70f2f65404f088c28bcb4a511df2e64111f8f7424364b60" },
+ { "abcdefghijklmnopq", "6196942a8495b721f82bbc385c74c1f10eeadf35db8adc9cf1a05ddeed19351228279644cd5d686ee48a31631ebb64747a2b68b733dd6015e3d27750878fa875" },
+ { "abcdefghijklmnopqr", "fb3bd1fc157ea6f7a6728986a59b271b766fb723f6b7cf2b4194437435f2c497f33b6a56ae7eb3830fa9e04d5ebb4cb5e3f4d4bd812c498bdf0167e125de3fba" },
+ { "abcdefghijklmnopqrs", "836f9ecf2aa02f522a94f1370af45a9fd538ac3c70e3b709d614b2f8981881d6b0070fc6387b74ee371fc2549309f82926e78084b401deb61a106c399089bee8" },
+ { "abcdefghijklmnopqrst", "8cd9c137651425fb32d193d99b281735ec68eb5fd296f16459d1b33eac7badcfce0dca22eadaa5f209fa4ac3bbecd41342bac8b8a5dc3626e7f22cdc96e17cb4" },
+ { "abcdefghijklmnopqrstu", "7079853a3e36241a8d83639f168ef38e883d7f72851a84ef3ed4d91c6a3896cf542b8b4518c2816fb19d4692a4b9aae65cb857e3642ce0a3936e20363bcbd4ca" },
+ { "abcdefghijklmnopqrstuv", "a4e8a90b7058fb078e6cdcfd0c6a33c366437eb9084eac657830356804c9f9b53f121496d8e972d8707a4cf02615e6f58ed1a770c28ac79ffd845401fe18a928" },
+ { "abcdefghijklmnopqrstuvw", "d91b1fd7c7785975493826719f333d090b214ff42351c84d8f8b2538509a28d2d59a36d0ac798d99d3908083b072a4be606ae391def5daa74156350fec71dd24" },
+ { "abcdefghijklmnopqrstuvwq", "404eb5652173323320cac6bf8d9714aef0747693a8ab4570700c6262268d367f30e31c44fa66860568ff058fe39c9aa8dac76bc78566c691a884cb9052c4aa0a" },
+};
+
+static void
+digest2string(const uint8_t *digest, char *string, size_t len)
+{
+ while (len--) {
+ if (*digest / 16 < 10)
+ *string++ = '0' + *digest / 16;
+ else
+ *string++ = 'a' + *digest / 16 - 10;
+ if (*digest % 16 < 10)
+ *string++ = '0' + *digest % 16;
+ else
+ *string++ = 'a' + *digest % 16 - 10;
+ ++digest;
+ }
+ *string = '\0';
+}
+
+ATF_TC_HEAD(t_sha256, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test SHA256 functions for consistent results");
+}
+
+ATF_TC_BODY(t_sha256, tc)
+{
+ size_t i, j, len;
+ SHA256_CTX ctx;
+ unsigned char buf[256];
+ unsigned char digest[8 + SHA256_DIGEST_LENGTH];
+ char output[SHA256_DIGEST_STRING_LENGTH];
+
+ for (i = 0; i < sizeof(test256) / sizeof(test256[0]); ++i) {
+ len = strlen(test256[i].vector);
+ for (j = 0; j < 8; ++j) {
+ SHA256_Init(&ctx);
+ memcpy(buf + j, test256[i].vector, len);
+ SHA256_Update(&ctx, buf + j, len);
+ SHA256_Final(digest + j, &ctx);
+ digest2string(digest + j, output, SHA256_DIGEST_LENGTH);
+ ATF_CHECK_STREQ(test256[i].hash, output);
+ }
+ }
+}
+
+ATF_TC_HEAD(t_sha384, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test SHA384 functions for consistent results");
+}
+
+ATF_TC_BODY(t_sha384, tc)
+{
+ size_t i, j, len;
+ SHA384_CTX ctx;
+ unsigned char buf[384];
+ unsigned char digest[8 + SHA384_DIGEST_LENGTH];
+ char output[SHA384_DIGEST_STRING_LENGTH];
+
+ for (i = 0; i < sizeof(test384) / sizeof(test384[0]); ++i) {
+ len = strlen(test384[i].vector);
+ for (j = 0; j < 8; ++j) {
+ SHA384_Init(&ctx);
+ memcpy(buf + j, test384[i].vector, len);
+ SHA384_Update(&ctx, buf + j, len);
+ SHA384_Final(digest + j, &ctx);
+ digest2string(digest + j, output, SHA384_DIGEST_LENGTH);
+ ATF_CHECK_STREQ(test384[i].hash, output);
+ }
+ }
+}
+
+ATF_TC_HEAD(t_sha512, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test SHA512 functions for consistent results");
+}
+
+ATF_TC_BODY(t_sha512, tc)
+{
+ size_t i, j, len;
+ SHA512_CTX ctx;
+ unsigned char buf[512];
+ unsigned char digest[8 + SHA512_DIGEST_LENGTH];
+ char output[SHA512_DIGEST_STRING_LENGTH];
+
+ for (i = 0; i < sizeof(test512) / sizeof(test512[0]); ++i) {
+ len = strlen(test512[i].vector);
+ for (j = 0; j < 8; ++j) {
+ SHA512_Init(&ctx);
+ memcpy(buf + j, test512[i].vector, len);
+ SHA512_Update(&ctx, buf + j, len);
+ SHA512_Final(digest + j, &ctx);
+ digest2string(digest + j, output, SHA512_DIGEST_LENGTH);
+ ATF_CHECK_STREQ(test512[i].hash, output);
+ }
+ }
+}
diff --git a/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c b/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c
new file mode 100644
index 0000000..99f75b3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c
@@ -0,0 +1,170 @@
+/* $NetBSD: t_inet_network.c,v 1.3 2011/07/15 11:27:23 jruoho Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Brian Ginsbach.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_inet_network.c,v 1.3 2011/07/15 11:27:23 jruoho Exp $");
+
+#include <arpa/inet.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <string.h>
+
+#define H_REQUIRE(input, expected) \
+ ATF_REQUIRE_EQ_MSG(inet_network(input), (in_addr_t) expected, \
+ "inet_network(%s) returned: 0x%08X, expected: %s", #input, \
+ inet_network(input), #expected)
+
+ATF_TC(inet_addr_basic);
+ATF_TC_HEAD(inet_addr_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks inet_addr(3)");
+}
+
+ATF_TC_BODY(inet_addr_basic, tc)
+{
+ static const char *addrs[] = {
+ "127.0.0.1", "99.99.99.99", "0.0.0.0", "255.255.255.255" };
+
+ struct in_addr ia;
+ const char *ian;
+ in_addr_t addr;
+ size_t i;
+
+ for (i = 0; i < __arraycount(addrs); i++) {
+
+ (void)fprintf(stderr, "checking %s\n", addrs[i]);;
+
+ addr = inet_addr(addrs[i]);
+ ia.s_addr = addr;
+ ian = inet_ntoa(ia);
+
+ ATF_REQUIRE(ian != NULL);
+ ATF_CHECK(strcmp(ian, addrs[i]) == 0);
+ }
+}
+
+ATF_TC(inet_addr_err);
+ATF_TC_HEAD(inet_addr_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Invalid addresses with inet_addr(3)");
+}
+
+ATF_TC_BODY(inet_addr_err, tc)
+{
+ static const char *addrs[] = {
+ ". . . .", "1.2.3.", "0.0.0.256", "255.255.255.256",
+ "................................................",
+ "a.b.c.d", "0x0.0x1.0x2.0x3", "-1.-1.-1.-1", "", " "};
+
+ struct in_addr ia;
+ const char *ian;
+ in_addr_t addr;
+ size_t i;
+
+ for (i = 0; i < __arraycount(addrs); i++) {
+
+ (void)fprintf(stderr, "checking %s\n", addrs[i]);;
+
+ addr = inet_addr(addrs[i]);
+ ia.s_addr = addr;
+ ian = inet_ntoa(ia);
+
+ ATF_REQUIRE(ian != NULL);
+ ATF_CHECK(strcmp(ian, addrs[i]) != 0);
+ }
+}
+
+ATF_TC(inet_network_basic);
+ATF_TC_HEAD(inet_network_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks inet_network(3)");
+}
+
+ATF_TC_BODY(inet_network_basic, tc)
+{
+
+ H_REQUIRE("0x12", 0x00000012);
+ H_REQUIRE("127.1", 0x00007f01);
+ H_REQUIRE("127.1.2.3", 0x7f010203);
+ H_REQUIRE("0X12", 0x00000012);
+ H_REQUIRE("0", 0x0);
+ H_REQUIRE("01.02.07.077", 0x0102073f);
+ H_REQUIRE("0x1.23.045.0", 0x01172500);
+ H_REQUIRE("0x12.0x34", 0x00001234);
+
+ /* This is valid (because of the trailing space after the digit). */
+ H_REQUIRE("1 bar", 0x00000001);
+}
+
+ATF_TC(inet_network_err);
+ATF_TC_HEAD(inet_network_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Invalid addresses w/ inet_network(3)");
+}
+
+ATF_TC_BODY(inet_network_err, tc)
+{
+ /* Malformed requests. */
+ H_REQUIRE("4.2.3.1.", 0xffffffff);
+ H_REQUIRE("0x123456", 0xffffffff);
+ H_REQUIRE("0x12.0x345", 0xffffffff);
+ H_REQUIRE("1.2.3.4.5", 0xffffffff);
+ H_REQUIRE("1..3.4", 0xffffffff);
+ H_REQUIRE(".", 0xffffffff);
+ H_REQUIRE("1.", 0xffffffff);
+ H_REQUIRE(".1", 0xffffffff);
+ H_REQUIRE("0x", 0xffffffff);
+ H_REQUIRE("", 0xffffffff);
+ H_REQUIRE(" ", 0xffffffff);
+ H_REQUIRE("bar", 0xffffffff);
+ H_REQUIRE("1.2bar", 0xffffffff);
+ H_REQUIRE("1.", 0xffffffff);
+ H_REQUIRE("\xc3\x8a\xc3\x83\xc3\x95\xc3\x8b\xc3\x85\xc3\x8e",
+ 0xffffffff);
+ H_REQUIRE("255.255.255.255", 0xffffffff);
+ H_REQUIRE("x", 0xffffffff);
+ H_REQUIRE("078", 0xffffffff);
+ H_REQUIRE("127.0xfff", 0xffffffff);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, inet_addr_basic);
+ ATF_TP_ADD_TC(tp, inet_addr_err);
+ ATF_TP_ADD_TC(tp, inet_network_basic);
+ ATF_TP_ADD_TC(tp, inet_network_err);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_io.c b/contrib/netbsd-tests/lib/libc/locale/t_io.c
new file mode 100644
index 0000000..782bed8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_io.c
@@ -0,0 +1,178 @@
+/* $NetBSD: t_io.c,v 1.4 2014/01/21 00:32:16 yamt Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_io.c,v 1.4 2014/01/21 00:32:16 yamt Exp $");
+
+#include <sys/param.h>
+#include <errno.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+#include <atf-c.h>
+
+
+ATF_TC(bad_big5_wprintf);
+ATF_TC_HEAD(bad_big5_wprintf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test bad big5 wchar wprintf");
+}
+
+ATF_TC_BODY(bad_big5_wprintf, tc)
+{
+ /* XXX implementation detail knowledge (wchar_t encoding) */
+ wchar_t ibuf[] = { 0xcf10, 0 };
+ setlocale(LC_CTYPE, "zh_TW.Big5");
+ ATF_REQUIRE_ERRNO(EILSEQ, wprintf(L"%ls\n", ibuf) < 0);
+ ATF_REQUIRE(ferror(stdout));
+}
+
+ATF_TC(bad_big5_swprintf);
+ATF_TC_HEAD(bad_big5_swprintf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test bad big5 wchar swprintf");
+}
+
+ATF_TC_BODY(bad_big5_swprintf, tc)
+{
+ /* XXX implementation detail knowledge (wchar_t encoding) */
+ wchar_t ibuf[] = { 0xcf10, 0 };
+ wchar_t obuf[20];
+ setlocale(LC_CTYPE, "zh_TW.Big5");
+ ATF_REQUIRE_ERRNO(EILSEQ,
+ swprintf(obuf, sizeof(obuf), L"%ls\n", ibuf) < 0);
+}
+
+ATF_TC(good_big5_wprintf);
+ATF_TC_HEAD(good_big5_wprintf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test good big5 wchar wprintf");
+}
+
+ATF_TC_BODY(good_big5_wprintf, tc)
+{
+ /* XXX implementation detail knowledge (wchar_t encoding) */
+ wchar_t ibuf[] = { 0xcf40, 0 };
+ setlocale(LC_CTYPE, "zh_TW.Big5");
+ ATF_REQUIRE_EQ(wprintf(L"%ls\n", ibuf), 2);
+}
+
+ATF_TC(good_big5_swprintf);
+ATF_TC_HEAD(good_big5_swprintf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test good big5 wchar swprintf");
+}
+
+ATF_TC_BODY(good_big5_swprintf, tc)
+{
+ /* XXX implementation detail knowledge (wchar_t encoding) */
+ wchar_t ibuf[] = { 0xcf40, 0 };
+ wchar_t obuf[20];
+ setlocale(LC_CTYPE, "zh_TW.Big5");
+ ATF_REQUIRE_EQ(swprintf(obuf, sizeof(obuf), L"%ls\n", ibuf), 2);
+}
+
+struct ibuf {
+ off_t off;
+ size_t buflen;
+ const char *buf;
+};
+
+static int
+readfn(void *vp, char *buf, int len)
+{
+ struct ibuf *ib = vp;
+ size_t todo = MIN((size_t)len, ib->buflen - ib->off);
+
+ memcpy(buf, ib->buf + ib->off, todo);
+ ib->off += todo;
+ return todo;
+}
+
+ATF_TC(good_big5_getwc);
+ATF_TC_HEAD(good_big5_getwc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test good big5 wchar getwc");
+}
+
+ATF_TC_BODY(good_big5_getwc, tc)
+{
+ const char buf[] = { 0xcf, 0x40 };
+ struct ibuf ib = {
+ .buf = buf,
+ .buflen = sizeof(buf),
+ };
+ FILE *fp = funopen(&ib, readfn, NULL, NULL, NULL);
+
+ ATF_REQUIRE(fp != NULL);
+ setlocale(LC_CTYPE, "zh_TW.Big5");
+ /* XXX implementation detail knowledge (wchar_t encoding) */
+ ATF_REQUIRE_EQ(getwc(fp), 0xcf40);
+ fclose(fp);
+}
+
+ATF_TC(bad_big5_getwc);
+ATF_TC_HEAD(bad_big5_getwc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test bad big5 wchar getwc");
+}
+
+ATF_TC_BODY(bad_big5_getwc, tc)
+{
+ const char buf[] = { 0xcf, 0x20 };
+ struct ibuf ib = {
+ .buf = buf,
+ .buflen = sizeof(buf),
+ };
+ FILE *fp = funopen(&ib, readfn, NULL, NULL, NULL);
+
+ ATF_REQUIRE(fp != NULL);
+ setlocale(LC_CTYPE, "zh_TW.Big5");
+ ATF_REQUIRE_EQ(getwc(fp), WEOF);
+ fclose(fp);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, bad_big5_wprintf);
+ ATF_TP_ADD_TC(tp, bad_big5_swprintf);
+ ATF_TP_ADD_TC(tp, good_big5_wprintf);
+ ATF_TP_ADD_TC(tp, good_big5_swprintf);
+ ATF_TP_ADD_TC(tp, good_big5_getwc);
+ ATF_TP_ADD_TC(tp, bad_big5_getwc);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c b/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c
new file mode 100644
index 0000000..b4ad841
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c
@@ -0,0 +1,267 @@
+/* $NetBSD: t_mbrtowc.c,v 1.1 2011/07/15 07:35:21 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by YAMAMOTO Takashi
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c)2003 Citrus 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_mbrtowc.c,v 1.1 2011/07/15 07:35:21 jruoho Exp $");
+
+#include <errno.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <vis.h>
+#include <wchar.h>
+
+#include <atf-c.h>
+
+#define SIZE 256
+
+static struct test {
+ const char *locale;
+ const char *data;
+ const wchar_t wchars[64];
+ const wchar_t widths[64];
+ size_t length;
+} tests[] = {
+{
+ "C",
+ "ABCD01234_\\",
+ { 0x41, 0x42, 0x43, 0x44, 0x30, 0x31, 0x32, 0x33, 0x34, 0x5F, 0x5C },
+ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ 11
+}, {
+ "en_US.UTF-8",
+ "[\001\177][\302\200\337\277][\340\240\200\357\277\277][\360\220\200"
+ "\200\367\277\277\277][\370\210\200\200\200\373\277\277\277\277][\374"
+ "\204\200\200\200\200\375\277\277\277\277\277]",
+ { 0x5b, 0x01, 0x7f, 0x5d, 0x5b, 0x80, 0x7ff, 0x5d, 0x5b, 0x800, 0xffff,
+ 0x5d, 0x5b, 0x10000, 0x1fffff, 0x5d, 0x5b, 0x200000, 0x3ffffff, 0x5d,
+ 0x5b, 0x4000000, 0x7fffffff, 0x5d },
+ { 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 4, 4, 1, 1, 5, 5, 1, 1, 6, 6, 1 },
+ 24
+}, {
+ "ja_JP.ISO2022-JP2",
+ "\033$BF|K\1348l\033(BA\033$B$\"\033(BB\033$B$$\033(B",
+ { 0x4200467c, 0x42004b5c, 0x4200386c, 0x41, 0x42002422, 0x42, 0x42002424 },
+ { 5, 2, 2, 4, 5, 4, 5 },
+ 7
+}, {
+ "ja_JP.SJIS",
+ "\223\372\226{\214\352A\202\240B\202\242",
+ { 0x93fa, 0x967b, 0x8cea, 0x41, 0x82a0, 0x42, 0x82a2 },
+ { 2, 2, 2, 1, 2, 1, 2 },
+ 7
+}, {
+ "ja_JP.eucJP",
+ "\306\374\313\334\270\354A\244\242B\244\244",
+ { 0xc6fc, 0xcbdc, 0xb8ec, 0x41, 0xa4a2, 0x42, 0xa4a4 },
+ { 2, 2, 2, 1, 2, 1, 2 },
+ 7
+}, {
+ NULL,
+ NULL,
+ { },
+ { },
+ 0
+}
+};
+
+static void
+h_ctype2(const struct test *t, bool use_mbstate)
+{
+ mbstate_t *stp;
+ mbstate_t st;
+ char buf[SIZE];
+ char *str;
+ size_t n;
+
+ ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
+ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL);
+
+ (void)strvis(buf, t->data, VIS_WHITE | VIS_OCTAL);
+ (void)printf("Checking string: \"%s\"\n", buf);
+
+ ATF_REQUIRE((str = setlocale(LC_ALL, NULL)) != NULL);
+ (void)printf("Using locale: %s\n", str);
+
+ (void)printf("Using mbstate: %s\n", use_mbstate ? "yes" : "no");
+
+ (void)memset(&st, 0, sizeof(st));
+// mbrtowc(0, 0, 0, &st); /* XXX for ISO2022-JP */
+ stp = use_mbstate ? &st : 0;
+
+ for (n = 9; n > 0; n--) {
+ const char *src = t->data;
+ wchar_t dst;
+ size_t nchar = 0;
+ int width = 0;
+
+ ATF_REQUIRE(mbsinit(stp) != 0);
+
+ for (;;) {
+ size_t rv = mbrtowc(&dst, src, n, stp);
+
+ if (rv == 0)
+ break;
+
+ if (rv == (size_t)-2) {
+ src += n;
+ width += n;
+
+ continue;
+ }
+ if (rv == (size_t)-1) {
+ ATF_REQUIRE_EQ(errno, EILSEQ);
+ atf_tc_fail("Invalid sequence");
+ /* NOTREACHED */
+ }
+
+ width += rv;
+ src += rv;
+
+ if (dst != t->wchars[nchar] ||
+ width != t->widths[nchar]) {
+ (void)printf("At position %zd:\n", nchar);
+ (void)printf(" expected: 0x%04X (%u)\n",
+ t->wchars[nchar], t->widths[nchar]);
+ (void)printf(" got : 0x%04X (%u)\n",
+ dst, width);
+ atf_tc_fail("Test failed");
+ }
+
+ nchar++;
+ width = 0;
+ }
+
+ ATF_REQUIRE_EQ_MSG(dst, 0, "Incorrect terminating character: "
+ "0x%04X (expected: 0x00)", dst);
+
+ ATF_REQUIRE_EQ_MSG(nchar, t->length, "Incorrect length: "
+ "%zd (expected: %zd)", nchar, t->length);
+ }
+
+ {
+ wchar_t wbuf[SIZE];
+ size_t rv;
+ char const *src = t->data;
+ int i;
+
+ (void)memset(wbuf, 0xFF, sizeof(wbuf));
+
+ rv = mbsrtowcs(wbuf, &src, SIZE, stp);
+
+ ATF_REQUIRE_EQ_MSG(rv, t->length, "Incorrect length: %zd "
+ "(expected: %zd)", rv, t->length);
+ ATF_REQUIRE_EQ(src, NULL);
+
+ for (i = 0; wbuf[i] != 0; ++i) {
+ if (wbuf[i] == t->wchars[i])
+ continue;
+
+ (void)printf("At position %d:\n", i);
+ (void)printf(" expected: 0x%04X\n", t->wchars[i]);
+ (void)printf(" got : 0x%04X\n", wbuf[i]);
+ atf_tc_fail("Test failed");
+ }
+
+ ATF_REQUIRE_EQ_MSG((size_t)i, t->length, "Incorrect length: "
+ "%d (expected: %zd)", i, t->length);
+ }
+
+ (void)printf("Ok.\n");
+}
+
+ATF_TC(mbrtowc_internal);
+ATF_TC_HEAD(mbrtowc_internal, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks mbrtowc(3) and mbsrtowcs(3) (using internal "
+ "state) with different locales");
+}
+ATF_TC_BODY(mbrtowc_internal, tc)
+{
+ struct test *t;
+
+ for (t = &tests[0]; t->data != NULL; ++t)
+ h_ctype2(t, false);
+}
+
+ATF_TC(mbrtowc_object);
+ATF_TC_HEAD(mbrtowc_object, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks mbrtowc(3) and mbsrtowcs(3) (using state "
+ "object) with different locales");
+}
+ATF_TC_BODY(mbrtowc_object, tc)
+{
+ struct test *t;
+
+ for (t = &tests[0]; t->data != NULL; ++t)
+ h_ctype2(t, true);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mbrtowc_internal);
+ ATF_TP_ADD_TC(tp, mbrtowc_object);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_mbsnrtowcs.c b/contrib/netbsd-tests/lib/libc/locale/t_mbsnrtowcs.c
new file mode 100644
index 0000000..446d7ef
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_mbsnrtowcs.c
@@ -0,0 +1,98 @@
+/* $NetBSD: t_mbsnrtowcs.c,v 1.2 2014/05/06 00:41:26 yamt Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mbsnrtowcs.c,v 1.2 2014/05/06 00:41:26 yamt Exp $");
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+
+#include <atf-c.h>
+
+static const struct test {
+ const char *locale;
+ const char *data;
+ size_t limit;
+ const wchar_t output1[64];
+ size_t output1_len;
+ const wchar_t output2[64];
+ size_t output2_len;
+} tests[] = {
+ { "C", "ABCD0123", 4, { 0x41, 0x42, 0x43, 0x44 }, 4,
+ { 0x30, 0x31, 0x32, 0x33, 0x0 }, 5 },
+ { "en_US.UTF-8", "ABCD0123", 4, { 0x41, 0x42, 0x43, 0x44 }, 4,
+ { 0x30, 0x31, 0x32, 0x33, 0x0 }, 5 },
+ { "en_US.UTF-8", "ABC\303\2440123", 4, { 0x41, 0x42, 0x43, }, 3,
+ { 0xe4, 0x30, 0x31, 0x32, 0x33, 0x0 }, 6 },
+};
+
+ATF_TC(mbsnrtowcs);
+ATF_TC_HEAD(mbsnrtowcs, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks mbsnrtowc(3) with different locales");
+}
+ATF_TC_BODY(mbsnrtowcs, tc)
+{
+ size_t i;
+ const struct test *t;
+ mbstate_t state;
+ wchar_t buf[64];
+ const char *src;
+ size_t len;
+
+ for (i = 0; i < __arraycount(tests); ++i) {
+ t = &tests[i];
+ ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
+ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL);
+ memset(&state, 0, sizeof(state));
+ src = t->data;
+ len = mbsnrtowcs(buf, &src, t->limit,
+ __arraycount(buf), &state);
+ ATF_REQUIRE_EQ(src, t->data + t->limit);
+ ATF_REQUIRE_EQ(len, t->output1_len);
+ ATF_REQUIRE(wmemcmp(t->output1, buf, len) == 0);
+ len = mbsnrtowcs(buf, &src, strlen(src) + 1,
+ __arraycount(buf), &state);
+ ATF_REQUIRE_EQ(len, strlen(t->data) - t->limit);
+ ATF_REQUIRE(wmemcmp(t->output2, buf, len + 1) == 0);
+ ATF_REQUIRE_EQ(src, NULL);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mbsnrtowcs);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c b/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
new file mode 100644
index 0000000..ec06729
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
@@ -0,0 +1,202 @@
+/* $NetBSD: t_mbstowcs.c,v 1.1 2011/07/15 07:35:21 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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.
+ */
+
+/*-
+ * Copyright (c)2003 Citrus 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_mbstowcs.c,v 1.1 2011/07/15 07:35:21 jruoho Exp $");
+
+#include <errno.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <vis.h>
+#include <wchar.h>
+
+#include <atf-c.h>
+
+#define REQUIRE_ERRNO(x, v) \
+ ATF_REQUIRE_MSG((x) != (v), "%s: %s", #x, strerror(errno))
+
+#define SIZE 256
+
+static struct test {
+ const char *locale;
+ const char *data;
+ wchar_t wchars[64];
+ int widths[64];
+ int width;
+} tests[] = {
+{
+ "en_US.UTF-8",
+ "[\001\177][\302\200\337\277][\340\240\200\357\277\277][\360\220\200"
+ "\200\367\277\277\277][\370\210\200\200\200\373\277\277\277\277][\374"
+ "\204\200\200\200\200\375\277\277\277\277\277]",
+ {
+ 0x5B, 0x01, 0x7F, 0x5D, 0x5B, 0x80, 0x07FF, 0x5D, 0x5B, 0x0800,
+ 0xFFFF, 0x5D, 0x5B, 0x10000, 0x1FFFFF, 0x5D, 0x5B, 0x200000,
+ 0x3FFFFFF, 0x5D, 0x5B, 0x4000000, 0x7FFFFFFF, 0x5D, 0x0A
+ },
+ { 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1,
+ 1, 1, -1, -1, 1, 1, -1, -1, 1, -1
+ },
+ -1
+}, {
+ "ja_JP.ISO2022-JP",
+ "\033$B#J#I#S$G$9!#\033(Baaaa\033$B$\"$$$&$($*\033(B",
+ {
+ 0x4200234A, 0x42002349, 0x42002353, 0x42002447, 0x42002439,
+ 0x42002123, 0x61, 0x61, 0x61, 0x61, 0x42002422, 0x42002424,
+ 0x42002426, 0x42002428, 0x4200242A, 0x0A
+ },
+ { 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, -1 },
+ 26
+}, {
+ "ja_JP.SJIS",
+ "\202r\202i\202h\202r\202\305\202\267\201Baaaa\202\240\202\242"
+ "\202\244\202\246\202\250",
+ {
+ 0x8272, 0x8269, 0x8268, 0x8272, 0x82C5, 0x82B7, 0x8142, 0x61,
+ 0x61, 0x61, 0x61, 0x82A0, 0x82A2, 0x82A4, 0x82A6, 0x82A8, 0x0A
+ },
+ { 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, -1 },
+ 28
+}, {
+ "ja_JP.eucJP",
+ "\243\305\243\325\243\303\244\307\244\271\241\243aaaa\244\242\244"
+ "\244\244\246\244\250\244\252",
+ {
+ 0xA3C5, 0xA3D5, 0xA3C3, 0xA4C7, 0xA4B9, 0xA1A3, 0x61, 0x61, 0x61,
+ 0x61, 0xA4A2, 0xA4A4, 0xA4A6, 0xA4A8, 0xA4AA, 0x0A
+ },
+ { 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, -1 },
+ 26
+}, {
+ NULL,
+ NULL,
+ {},
+ {},
+ 0
+}
+};
+
+ATF_TC(mbstowcs_basic);
+ATF_TC_HEAD(mbstowcs_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks wide character functions with different locales");
+}
+ATF_TC_BODY(mbstowcs_basic, tc)
+{
+ struct test *t;
+
+ for (t = &tests[0]; t->data != NULL; ++t) {
+ wchar_t wbuf[SIZE];
+ char buf[SIZE];
+ char visbuf[SIZE];
+ char *str;
+ int i;
+
+ ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
+ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL);
+
+ (void)strvis(visbuf, t->data, VIS_WHITE | VIS_OCTAL);
+ (void)printf("Checking string: \"%s\"\n", visbuf);
+
+ ATF_REQUIRE((str = setlocale(LC_ALL, NULL)) != NULL);
+ (void)printf("Using locale: %s\n", str);
+
+ REQUIRE_ERRNO((ssize_t)mbstowcs(wbuf, t->data, SIZE-1), -1);
+ REQUIRE_ERRNO((ssize_t)wcstombs(buf, wbuf, SIZE-1), -1);
+
+ if (strcmp(buf, t->data) != 0) {
+ (void)strvis(visbuf, buf, VIS_WHITE | VIS_OCTAL);
+ (void)printf("Conversion to wcs and back failed: "
+ "\"%s\"\n", visbuf);
+ atf_tc_fail("Test failed");
+ }
+
+ /* The output here is implementation-dependent. */
+
+ for (i = 0; wbuf[i] != 0; ++i) {
+ if (wbuf[i] == t->wchars[i] &&
+ wcwidth(wbuf[i]) == t->widths[i])
+ continue;
+
+ (void)printf("At position %d:\n", i);
+ (void)printf(" expected: 0x%04X (%d)\n",
+ t->wchars[i], t->widths[i]);
+ (void)printf(" got : 0x%04X (%d)\n", wbuf[i],
+ wcwidth(wbuf[i]));
+ atf_tc_fail("Test failed");
+ }
+
+ if (wcswidth(wbuf, SIZE-1) != t->width) {
+ (void)printf("Incorrect wcswidth:\n");
+ (void)printf(" expected: %d\n", t->width);
+ (void)printf(" got : %d\n", wcswidth(wbuf, SIZE-1));
+ atf_tc_fail("Test failed");
+ }
+
+ (void)printf("Ok.\n");
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, mbstowcs_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c b/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c
new file mode 100644
index 0000000..62f62b1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c
@@ -0,0 +1,143 @@
+/* $NetBSD: t_mbtowc.c,v 1.1 2011/04/09 17:45:25 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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.
+ */
+
+/*-
+ * Copyright (c)2007 Citrus 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_mbtowc.c,v 1.1 2011/04/09 17:45:25 pgoyette Exp $");
+
+#include <errno.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <vis.h>
+#include <wchar.h>
+
+#include <atf-c.h>
+
+static void
+h_mbtowc(const char *locale, const char *illegal, const char *legal)
+{
+ char buf[64];
+ size_t stateful, ret;
+ char *str;
+
+ ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
+ ATF_REQUIRE(setlocale(LC_CTYPE, locale) != NULL);
+
+ ATF_REQUIRE((str = setlocale(LC_ALL, NULL)) != NULL);
+ (void)printf("Using locale: %s\n", str);
+
+ stateful = wctomb(NULL, L'\0');
+ (void)printf("Locale is state-%sdependent\n",
+ stateful ? "in" : "");
+
+ /* initialize internal state */
+ ret = mbtowc(NULL, NULL, 0);
+ ATF_REQUIRE(stateful ? ret : !ret);
+
+ (void)strvis(buf, illegal, VIS_WHITE | VIS_OCTAL);
+ (void)printf("Checking illegal sequence: \"%s\"\n", buf);
+
+ ret = mbtowc(NULL, illegal, strlen(illegal));
+ (void)printf("mbtowc() returned: %zd\n", ret);
+ ATF_REQUIRE_EQ(ret, (size_t)-1);
+ (void)printf("errno: %s\n", strerror(errno));
+ ATF_REQUIRE_EQ(errno, EILSEQ);
+
+ /* if this is stateless encoding, this re-initialization is not required. */
+ if (stateful) {
+ /* re-initialize internal state */
+ ret = mbtowc(NULL, NULL, 0);
+ ATF_REQUIRE(stateful ? ret : !ret);
+ }
+
+ /* valid multibyte sequence case */
+ (void)strvis(buf, legal, VIS_WHITE | VIS_OCTAL);
+ (void)printf("Checking legal sequence: \"%s\"\n", buf);
+
+ errno = 0;
+ ret = mbtowc(NULL, legal, strlen(legal));
+ (void)printf("mbtowc() returned: %zd\n", ret);
+ ATF_REQUIRE(ret != (size_t)-1);
+ (void)printf("errno: %s\n", strerror(errno));
+ ATF_REQUIRE_EQ(errno, 0);
+
+ (void)printf("Ok.\n");
+}
+
+ATF_TC(mbtowc);
+ATF_TC_HEAD(mbtowc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks mbtowc(3)");
+}
+ATF_TC_BODY(mbtowc, tc)
+{
+ h_mbtowc("en_US.UTF-8", "\240", "\302\240");
+ h_mbtowc("ja_JP.ISO2022-JP", "\033$B", "\033$B$\"\033(B");
+ h_mbtowc("ja_JP.SJIS", "\202", "\202\240");
+ h_mbtowc("ja_JP.eucJP", "\244", "\244\242");
+ h_mbtowc("zh_CN.GB18030", "\241", "\241\241");
+ h_mbtowc("zh_TW.Big5", "\241", "\241@");
+ h_mbtowc("zh_TW.eucTW", "\241", "\241\241");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, mbtowc);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_wcscspn.c b/contrib/netbsd-tests/lib/libc/locale/t_wcscspn.c
new file mode 100644
index 0000000..10756b5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_wcscspn.c
@@ -0,0 +1,58 @@
+/* $NetBSD: t_wcscspn.c,v 1.1 2011/11/21 23:50:45 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_wcscspn.c,v 1.1 2011/11/21 23:50:45 joerg Exp $");
+
+#include <atf-c.h>
+#include <wchar.h>
+
+ATF_TC(wcscspn);
+ATF_TC_HEAD(wcscspn, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test wcscspn(3)");
+}
+
+ATF_TC_BODY(wcscspn, tc)
+{
+ ATF_CHECK_EQ(wcscspn(L"abcdefghijklmnop", L""), 16);
+ ATF_CHECK_EQ(wcscspn(L"abcdefghijklmnop", L"a"), 0);
+ ATF_CHECK_EQ(wcscspn(L"abcdefghijklmnop", L"b"), 1);
+ ATF_CHECK_EQ(wcscspn(L"abcdefghijklmnop", L"cd"), 2);
+ ATF_CHECK_EQ(wcscspn(L"abcdefghijklmnop", L"qrstuvwxyz"), 16);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, wcscspn);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_wcspbrk.c b/contrib/netbsd-tests/lib/libc/locale/t_wcspbrk.c
new file mode 100644
index 0000000..57c1ac5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_wcspbrk.c
@@ -0,0 +1,62 @@
+/* $NetBSD: t_wcspbrk.c,v 1.1 2011/11/21 23:50:45 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_wcspbrk.c,v 1.1 2011/11/21 23:50:45 joerg Exp $");
+
+#include <atf-c.h>
+#include <wchar.h>
+
+ATF_TC(wcspbrk);
+ATF_TC_HEAD(wcspbrk, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test wcspbrk(3)");
+}
+
+ATF_TC_BODY(wcspbrk, tc)
+{
+ static const wchar_t s[] = L"abcdefghijklmnop";
+
+ ATF_CHECK_EQ(wcspbrk(s, L""), NULL);
+ ATF_CHECK_EQ(wcspbrk(s, L"qrst"), NULL);
+ ATF_CHECK_EQ(wcspbrk(s, L"a"), s);
+ ATF_CHECK_EQ(wcspbrk(s, L"b"), s + 1);
+ ATF_CHECK_EQ(wcspbrk(s, L"ab"), s);
+ ATF_CHECK_EQ(wcspbrk(s, L"cdef"), s + 2);
+ ATF_CHECK_EQ(wcspbrk(s, L"fedc"), s + 2);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, wcspbrk);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_wcsspn.c b/contrib/netbsd-tests/lib/libc/locale/t_wcsspn.c
new file mode 100644
index 0000000..2083650
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_wcsspn.c
@@ -0,0 +1,60 @@
+/* $NetBSD: t_wcsspn.c,v 1.1 2011/11/21 23:50:45 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_wcsspn.c,v 1.1 2011/11/21 23:50:45 joerg Exp $");
+
+#include <atf-c.h>
+#include <wchar.h>
+
+ATF_TC(wcsspn);
+ATF_TC_HEAD(wcsspn, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test wcsspn(3)");
+}
+
+ATF_TC_BODY(wcsspn, tc)
+{
+ ATF_CHECK_EQ(wcsspn(L"abcdefghijklmnop", L""), 0);
+ ATF_CHECK_EQ(wcsspn(L"abcdefghijklmnop", L"a"), 1);
+ ATF_CHECK_EQ(wcsspn(L"abcdefghijklmnop", L"b"), 0);
+ ATF_CHECK_EQ(wcsspn(L"abcdefghijklmnop", L"ab"), 2);
+ ATF_CHECK_EQ(wcsspn(L"abcdefghijklmnop", L"abc"), 3);
+ ATF_CHECK_EQ(wcsspn(L"abcdefghijklmnop", L"abce"), 3);
+ ATF_CHECK_EQ(wcsspn(L"abcdefghijklmnop", L"abcdefghijklmnop"), 16);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, wcsspn);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c b/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c
new file mode 100644
index 0000000..85b1ee1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c
@@ -0,0 +1,456 @@
+/* $NetBSD: t_wcstod.c,v 1.3 2011/10/01 17:56:11 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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.
+ */
+
+/*-
+ * Copyright (c)2005 Citrus 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_wcstod.c,v 1.3 2011/10/01 17:56:11 christos Exp $");
+
+#include <errno.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+#include <atf-c.h>
+
+#define ALT_HUGE_VAL -1
+#define ALT_MINUS_HUGE_VAL -2
+#define ALT_NAN -3
+
+#if !defined(__vax__)
+static struct test {
+ const wchar_t *wcs;
+ size_t len;
+ double val;
+ int err;
+} tests[] = {
+{ L"IN", 0, 0, 0 },
+{ L"+IN", 0, 0, 0 },
+{ L"-IN", 0, 0, 0 },
+{ L"INX", 0, 0, 0 },
+{ L"+INX", 0, 0, 0 },
+{ L"-INX", 0, 0, 0 },
+{ L"INF", 3, ALT_HUGE_VAL, 0 },
+{ L"+INF", 4, ALT_HUGE_VAL, 0 },
+{ L"-INF", 4, ALT_MINUS_HUGE_VAL, 0 },
+{ L"INFX", 3, ALT_HUGE_VAL, 0 },
+{ L"+INFX", 4, ALT_HUGE_VAL, 0 },
+{ L"-INFX", 4, ALT_MINUS_HUGE_VAL, 0 },
+{ L" IN", 0, 0, 0 },
+{ L" +IN", 0, 0, 0 },
+{ L" -IN", 0, 0, 0 },
+{ L" INX", 0, 0, 0 },
+{ L" +INX", 0, 0, 0 },
+{ L" -INX", 0, 0, 0 },
+{ L"+ INF", 0, 0, 0 },
+{ L"- INF", 0, 0, 0 },
+{ L" INF", 8, ALT_HUGE_VAL, 0 },
+{ L" +INF", 9, ALT_HUGE_VAL, 0 },
+{ L" -INF", 9, ALT_MINUS_HUGE_VAL, 0 },
+{ L" INFX", 8, ALT_HUGE_VAL, 0 },
+{ L" +INFX", 9, ALT_HUGE_VAL, 0 },
+{ L" -INFX", 9, ALT_MINUS_HUGE_VAL, 0 },
+{ L" INFINIT", 8, ALT_HUGE_VAL, 0 },
+{ L" +INFINIT", 9, ALT_HUGE_VAL, 0 },
+{ L" -INFINIT", 9, ALT_MINUS_HUGE_VAL, 0 },
+{ L" INFINITY", 13, ALT_HUGE_VAL, 0 },
+{ L" +INFINITY", 14, ALT_HUGE_VAL, 0 },
+{ L" -INFINITY", 14, ALT_MINUS_HUGE_VAL, 0 },
+{ L" INFINITYX", 13, ALT_HUGE_VAL, 0 },
+{ L" +INFINITYX", 14, ALT_HUGE_VAL, 0 },
+{ L" -INFINITYX", 14, ALT_MINUS_HUGE_VAL, 0 },
+
+/* NAN */
+{ L"NA", 0, 0, 0 },
+{ L"+NA", 0, 0, 0 },
+{ L"-NA", 0, 0, 0 },
+{ L"NAX", 0, 0, 0 },
+{ L"+NAX", 0, 0, 0 },
+{ L"-NAX", 0, 0, 0 },
+{ L"NAN", 3, ALT_NAN, 0 },
+{ L"+NAN", 4, ALT_NAN, 0 },
+{ L"-NAN", 4, ALT_NAN, 0 },
+{ L"NANX", 3, ALT_NAN, 0 },
+{ L"+NANX", 4, ALT_NAN, 0 },
+{ L"-NANX", 4, ALT_NAN, 0 },
+{ L" NA", 0, 0, 0 },
+{ L" +NA", 0, 0, 0 },
+{ L" -NA", 0, 0, 0 },
+{ L" NAX", 0, 0, 0 },
+{ L" +NAX", 0, 0, 0 },
+{ L" -NAX", 0, 0, 0 },
+{ L"+ NAN", 0, 0, 0 },
+{ L"- NAN", 0, 0, 0 },
+{ L" NAN", 8, ALT_NAN, 0 },
+{ L" +NAN", 9, ALT_NAN, 0 },
+{ L" -NAN", 9, ALT_NAN, 0 },
+{ L" NANX", 8, ALT_NAN, 0 },
+{ L" +NANX", 9, ALT_NAN, 0 },
+{ L" -NANX", 9, ALT_NAN, 0 },
+
+{ L"0", 1, 0, 0 },
+{ L"+0", 2, 0, 0 },
+{ L"-0", 2, 0, 0 },
+{ L" 0", 11, 0, 0 },
+{ L" +0", 12, 0, 0 },
+{ L" -0", 12, 0, 0 },
+{ L"+ 0", 0, 0, 0 },
+{ L"- 0", 0, 0, 0 },
+
+{ L".", 0, 0, 0 },
+{ L".0", 2, 0, 0 },
+{ L".00", 3, 0, 0 },
+{ L".000", 4, 0, 0 },
+
+{ L"0.", 2, 0, 0 },
+{ L"+0.", 3, 0, 0 },
+{ L"-0.", 3, 0, 0 },
+{ L" 0.", 12, 0, 0 },
+{ L" +0.", 13, 0, 0 },
+{ L" -0.", 13, 0, 0 },
+
+{ L"0.0", 3, 0, 0 },
+{ L"+0.0", 4, 0, 0 },
+{ L"-0.0", 4, 0, 0 },
+{ L" 0.0", 13, 0, 0 },
+{ L" +0.0", 14, 0, 0 },
+{ L" -0.0", 14, 0, 0 },
+
+{ L"000", 3, 0, 0 },
+{ L"+000", 4, 0, 0 },
+{ L"-000", 4, 0, 0 },
+{ L" 000", 13, 0, 0 },
+{ L" +000", 14, 0, 0 },
+{ L" -000", 14, 0, 0 },
+
+{ L"000.", 4, 0, 0 },
+{ L"+000.", 5, 0, 0 },
+{ L"-000.", 5, 0, 0 },
+{ L" 000.", 14, 0, 0 },
+{ L" +000.", 15, 0, 0 },
+{ L" -000.", 15, 0, 0 },
+
+{ L"000.0", 5, 0, 0 },
+{ L"+000.0", 6, 0, 0 },
+{ L"-000.0", 6, 0, 0 },
+{ L" 000.0", 15, 0, 0 },
+{ L" +000.0", 16, 0, 0 },
+{ L" -000.0", 16, 0, 0 },
+
+
+{ L"0.0.", 3, 0, 0 },
+{ L"+0.0.", 4, 0, 0 },
+{ L"-0.0.", 4, 0, 0 },
+{ L" 0.0.", 13, 0, 0 },
+{ L" +0.0.", 14, 0, 0 },
+{ L" -0.0.", 14, 0, 0 },
+
+{ L"0.0.0", 3, 0, 0 },
+{ L"+0.0.0", 4, 0, 0 },
+{ L"-0.0.0", 4, 0, 0 },
+{ L" 0.0.0", 13, 0, 0 },
+{ L" +0.0.0", 14, 0, 0 },
+{ L" -0.0.0", 14, 0, 0 },
+
+/* XXX: FIXME */
+#if defined(__linux__)
+{ L"0X", 2, 0, 0 },
+{ L"+0X", 3, 0, 0 },
+{ L"-0X", 3, 0, 0 },
+#else
+{ L"0X", 1, 0, 0 },
+{ L"+0X", 2, 0, 0 },
+{ L"-0X", 2, 0, 0 },
+#endif
+
+/* XXX: SunOS 5.8's wcstod(3) doesn't accept hex */
+#if !defined(__SunOS__)
+#if defined(__linux__)
+{ L"0X.", 3, 0, 0 },
+{ L"+0X.", 4, 0, 0 },
+{ L"-0X.", 4, 0, 0 },
+{ L" 0X.", 13, 0, 0 },
+{ L" +0X.", 14, 0, 0 },
+{ L" -0X.", 14, 0, 0 },
+#else
+{ L"0X.", 1, 0, 0 },
+{ L"+0X.", 2, 0, 0 },
+{ L"-0X.", 2, 0, 0 },
+{ L" 0X.", 11, 0, 0 },
+{ L" +0X.", 12, 0, 0 },
+{ L" -0X.", 12, 0, 0 },
+#endif
+/* XXX: FIXME */
+#if defined(__NetBSD__) || defined(__linux__)
+{ L"0X.0", 4, 0, 0 },
+{ L"+0X.0", 5, 0, 0 },
+{ L"-0X.0", 5, 0, 0 },
+{ L" 0X.0", 14, 0, 0 },
+{ L" +0X.0", 15, 0, 0 },
+{ L" -0X.0", 15, 0, 0 },
+
+{ L"0X.0P", 4, 0, 0 },
+{ L"+0X.0P", 5, 0, 0 },
+{ L"-0X.0P", 5, 0, 0 },
+{ L" 0X.0P", 14, 0, 0 },
+{ L" +0X.0P", 15, 0, 0 },
+{ L" -0X.0P", 15, 0, 0 },
+#else
+{ L"0X.0", 1, 0, 0 },
+{ L"+0X.0", 2, 0, 0 },
+{ L"-0X.0", 2, 0, 0 },
+{ L" 0X.0", 11, 0, 0 },
+{ L" +0X.0", 12, 0, 0 },
+{ L" -0X.0", 12, 0, 0 },
+
+{ L"0X.0P", 1, 0, 0 },
+{ L"+0X.0P", 2, 0, 0 },
+{ L"-0X.0P", 2, 0, 0 },
+{ L" 0X.0P", 11, 0, 0 },
+{ L" +0X.0P", 12, 0, 0 },
+{ L" -0X.0P", 12, 0, 0 },
+#endif
+
+{ L"0X0", 3, 0, 0 },
+{ L"+0X0", 4, 0, 0 },
+{ L"-0X0", 4, 0, 0 },
+{ L" 0X0", 13, 0, 0 },
+{ L" +0X0", 14, 0, 0 },
+{ L" -0X0", 14, 0, 0 },
+
+{ L"00X0.0", 2, 0, 0 },
+{ L"+00X0.0", 3, 0, 0 },
+{ L"-00X0.0", 3, 0, 0 },
+{ L" 00X0.0", 12, 0, 0 },
+{ L" +00X0.0", 13, 0, 0 },
+{ L" -00X0.0", 13, 0, 0 },
+
+{ L"0X0P", 3, 0, 0 },
+{ L"+0X0P", 4, 0, 0 },
+{ L"-0X0P", 4, 0, 0 },
+{ L" 0X0P", 13, 0, 0 },
+{ L" +0X0P", 14, 0, 0 },
+{ L" -0X0P", 14, 0, 0 },
+
+{ L"0X0.", 4, 0, 0 },
+{ L"+0X0.", 5, 0, 0 },
+{ L"-0X0.", 5, 0, 0 },
+{ L" 0X0.", 14, 0, 0 },
+{ L" +0X0.", 15, 0, 0 },
+{ L" -0X0.", 15, 0, 0 },
+
+{ L"0X0.0", 5, 0, 0 },
+{ L"+0X0.0", 6, 0, 0 },
+{ L"-0X0.0", 6, 0, 0 },
+{ L" 0X0.0", 15, 0, 0 },
+{ L" +0X0.0", 16, 0, 0 },
+{ L" -0X0.0", 16, 0, 0 },
+
+{ L"0X0.P", 4, 0, 0 },
+{ L"+0X0.P", 5, 0, 0 },
+{ L"-0X0.P", 5, 0, 0 },
+{ L" 0X0.P", 14, 0, 0 },
+{ L" +0X0.P", 15, 0, 0 },
+{ L" -0X0.P", 15, 0, 0 },
+
+{ L"0X0.P", 4, 0, 0 },
+{ L"+0X0.P", 5, 0, 0 },
+{ L"-0X0.P", 5, 0, 0 },
+{ L" 0X0.P", 14, 0, 0 },
+{ L" +0X0.P", 15, 0, 0 },
+{ L" -0X0.P", 15, 0, 0 },
+
+#endif
+{ L"0.12345678", 10, 0.12345678, 0 },
+{ L"+0.12345678", 11, +0.12345678, 0 },
+{ L"-0.12345678", 11, -0.12345678, 0 },
+{ L" 0.12345678", 15, 0.12345678, 0 },
+{ L" +0.12345678", 16, +0.12345678, 0 },
+{ L" -0.12345678", 16, -0.12345678, 0 },
+
+{ L"0.12345E67", 10, 0.12345E67, 0 },
+{ L"+0.12345E67", 11, +0.12345E67, 0 },
+{ L"-0.12345E67", 11, -0.12345E67, 0 },
+{ L" 0.12345E67", 15, 0.12345E67, 0 },
+{ L" +0.12345E67", 16, +0.12345E67, 0 },
+{ L" -0.12345E67", 16, -0.12345E67, 0 },
+
+{ L"0.12345E+6", 10, 0.12345E+6, 0 },
+{ L"+0.12345E+6", 11, +0.12345E+6, 0 },
+{ L"-0.12345E+6", 11, -0.12345E+6, 0 },
+{ L" 0.12345E+6", 15, 0.12345E+6, 0 },
+{ L" +0.12345E+6", 16, +0.12345E+6, 0 },
+{ L" -0.12345E+6", 16, -0.12345E+6, 0 },
+
+{ L"0.98765E-4", 10, 0.98765E-4, 0 },
+{ L"+0.98765E-4", 11, +0.98765E-4, 0 },
+{ L"-0.98765E-4", 11, -0.98765E-4, 0 },
+{ L" 0.98765E-4", 15, 0.98765E-4, 0 },
+{ L" +0.98765E-4", 16, +0.98765E-4, 0 },
+{ L" -0.98765E-4", 16, -0.98765E-4, 0 },
+
+{ L"12345678E9", 10, 12345678E9, 0 },
+{ L"+12345678E9", 11, +12345678E9, 0 },
+{ L"-12345678E9", 11, -12345678E9, 0 },
+{ L" 12345678E9", 15, 12345678E9, 0 },
+{ L" +12345678E9", 16, +12345678E9, 0 },
+{ L" -12345678E9", 16, -12345678E9, 0 },
+
+/* XXX: SunOS 5.8's wcstod(3) doesn't accept hex */
+#if !defined(__SunOS__)
+{ L"0x1P+2", 6, 4, 0 },
+{ L"+0x1P+2", 7, +4, 0 },
+{ L"-0x1P+2", 7, -4, 0 },
+{ L" 0x1P+2", 11, 4, 0 },
+{ L" +0x1P+2", 12, +4, 0 },
+{ L" -0x1P+2", 12, -4, 0 },
+
+{ L"0x1.0P+2", 8, 4, 0 },
+{ L"+0x1.0P+2", 9, +4, 0 },
+{ L"-0x1.0P+2", 9, -4, 0 },
+{ L" 0x1.0P+2", 13, 4, 0 },
+{ L" +0x1.0P+2", 14, +4, 0 },
+{ L" -0x1.0P+2", 14, -4, 0 },
+
+{ L"0x1P-2", 6, 0.25, 0 },
+{ L"+0x1P-2", 7, +0.25, 0 },
+{ L"-0x1P-2", 7, -0.25, 0 },
+{ L" 0x1P-2", 11, 0.25, 0 },
+{ L" +0x1P-2", 12, +0.25, 0 },
+{ L" -0x1P-2", 12, -0.25, 0 },
+
+{ L"0x1.0P-2", 8, 0.25, 0 },
+{ L"+0x1.0P-2", 9, +0.25, 0 },
+{ L"-0x1.0P-2", 9, -0.25, 0 },
+{ L" 0x1.0P-2", 13, 0.25, 0 },
+{ L" +0x1.0P-2", 14, +0.25, 0 },
+{ L" -0x1.0P-2", 14, -0.25, 0 },
+#endif
+
+{ NULL, 0, 0, 0 }
+};
+#endif /* !defined(__vax__) */
+
+ATF_TC(wcstod);
+ATF_TC_HEAD(wcstod, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks wcstod(3)");
+}
+ATF_TC_BODY(wcstod, tc)
+{
+#if defined(__vax__)
+#else
+ struct test *t;
+#endif
+
+#if !defined(__vax__)
+ for (t = &tests[0]; t->wcs != NULL; ++t) {
+ double d;
+ size_t n;
+ wchar_t *tail;
+ char *buf;
+
+ /* we do not supported %ls nor %S yet. */
+ n = wcstombs(NULL, t->wcs, 0);
+ ATF_REQUIRE((buf = (void *)malloc(n + 1)) != NULL);
+ (void)wcstombs(buf, t->wcs, n + 1);
+ (void)printf("Checking wcstod(\"%s\", &tail):\n", buf);
+ free(buf);
+
+ errno = 0;
+ d = wcstod(t->wcs, &tail);
+ (void)printf("[errno]\n");
+ (void)printf(" got : %s\n", strerror(errno));
+ (void)printf(" expected: %s\n", strerror(t->err));
+ ATF_REQUIRE_EQ(errno, t->err);
+
+ n = (size_t)(tail - t->wcs);
+ (void)printf("[endptr - nptr]\n");
+ (void)printf(" got : %zd\n", n);
+ (void)printf(" expected: %zd\n", t->len);
+ ATF_REQUIRE_EQ(n, t->len);
+
+ (void)printf("[result]\n");
+ (void)printf(" real: %F\n", d);
+ if (t->val == ALT_HUGE_VAL) {
+ (void)printf(" expected: %F\n", HUGE_VAL);
+ ATF_REQUIRE(isinf(d));
+ ATF_REQUIRE_EQ(d, HUGE_VAL);
+ } else if (t->val == ALT_MINUS_HUGE_VAL) {
+ (void)printf(" expected: %F\n", -HUGE_VAL);
+ ATF_REQUIRE(isinf(d));
+ ATF_REQUIRE_EQ(d, -HUGE_VAL);
+ } else if (t->val == ALT_NAN) {
+ (void)printf(" expected: %F\n", NAN);
+ ATF_REQUIRE(isnan(d));
+ } else {
+ (void)printf(" expected: %F\n", t->val);
+ ATF_REQUIRE_EQ(d, t->val);
+ }
+
+ (void)printf("\n");
+ }
+#else /* !defined(__vax__) */
+ atf_tc_skip("Test is unavailable on vax.");
+#endif /* !defined(__vax__) */
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, wcstod);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c b/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c
new file mode 100644
index 0000000..f553c8c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c
@@ -0,0 +1,205 @@
+/* $NetBSD: t_wctomb.c,v 1.3 2013/03/25 15:31:03 gson Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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.
+ */
+
+/*-
+ * Copyright (c)2004 Citrus 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_wctomb.c,v 1.3 2013/03/25 15:31:03 gson Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <locale.h>
+#include <vis.h>
+#include <wchar.h>
+#include <string.h>
+#include <limits.h>
+
+#include <atf-c.h>
+
+#define TC_WCTOMB 0
+#define TC_WCRTOMB 1
+#define TC_WCRTOMB_ST 2
+
+static struct test {
+ const char *locale;
+ const char *data;
+ size_t wclen;
+ size_t mblen[16];
+} tests[] = {
+{
+ "ja_JP.ISO2022-JP",
+ "\x1b$B" /* JIS X 0208-1983 */
+ "\x46\x7c\x4b\x5c\x38\x6c" /* "nihongo" */
+ "\x1b(B" /* ISO 646 */
+ "ABC"
+ "\x1b(I" /* JIS X 0201 katakana */
+ "\xb1\xb2\xb3" /* "aiu" */
+ "\x1b(B", /* ISO 646 */
+ 3 + 3 + 3,
+ { 3+2, 2, 2, 3+1, 1, 1, 3+1, 1, 1, 3+1 }
+}, {
+ "C",
+ "ABC",
+ 3,
+ { 1, 1, 1, 1 }
+}, { NULL, NULL, 0, { } }
+};
+
+static void
+h_wctomb(const struct test *t, char tc)
+{
+ wchar_t wcs[16 + 2];
+ char buf[128];
+ char cs[MB_LEN_MAX];
+ const char *pcs;
+ char *str;
+ mbstate_t st;
+ mbstate_t *stp = NULL;
+ size_t sz, ret, i;
+
+ ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
+ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL);
+
+ (void)strvis(buf, t->data, VIS_WHITE | VIS_OCTAL);
+ (void)printf("Checking sequence: \"%s\"\n", buf);
+
+ ATF_REQUIRE((str = setlocale(LC_ALL, NULL)) != NULL);
+ (void)printf("Using locale: %s\n", str);
+
+ if (tc == TC_WCRTOMB_ST) {
+ (void)memset(&st, 0, sizeof(st));
+ stp = &st;
+ }
+
+ wcs[t->wclen] = L'X'; /* poison */
+ pcs = t->data;
+ sz = mbsrtowcs(wcs, &pcs, t->wclen + 2, NULL);
+ ATF_REQUIRE_EQ_MSG(sz, t->wclen, "mbsrtowcs() returned: "
+ "%zu, expected: %zu", sz, t->wclen);
+ ATF_REQUIRE_EQ(wcs[t->wclen], 0);
+
+ for (i = 0; i < t->wclen + 1; i++) {
+ if (tc == TC_WCTOMB)
+ ret = wctomb(cs, wcs[i]);
+ else
+ ret = wcrtomb(cs, wcs[i], stp);
+
+ if (ret == t->mblen[i])
+ continue;
+
+ (void)printf("At position %zd:\n", i);
+ (void)printf(" expected: %zd\n", t->mblen[i]);
+ (void)printf(" got : %zd\n", ret);
+ atf_tc_fail("Test failed");
+ /* NOTREACHED */
+ }
+
+ (void)printf("Ok.\n");
+}
+
+ATF_TC(wctomb);
+ATF_TC_HEAD(wctomb, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks wctomb(3)");
+}
+ATF_TC_BODY(wctomb, tc)
+{
+ struct test *t;
+
+ (void)printf("Checking wctomb()\n");
+
+ for (t = &tests[0]; t->data != NULL; ++t)
+ h_wctomb(t, TC_WCTOMB);
+}
+
+ATF_TC(wcrtomb_state);
+ATF_TC_HEAD(wcrtomb_state, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks wcrtomb(3) (using state object)");
+}
+ATF_TC_BODY(wcrtomb_state, tc)
+{
+ struct test *t;
+
+ (void)printf("Checking wcrtomb() (with state object)\n");
+
+ for (t = &tests[0]; t->data != NULL; ++t)
+ h_wctomb(t, TC_WCRTOMB_ST);
+}
+
+ATF_TC(wcrtomb);
+ATF_TC_HEAD(wcrtomb, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks wcrtomb(3) (using internal state)");
+}
+ATF_TC_BODY(wcrtomb, tc)
+{
+ struct test *t;
+
+ (void)printf("Checking wcrtomb() (using internal state)\n");
+
+ for (t = &tests[0]; t->data != NULL; ++t)
+ h_wctomb(t, TC_WCRTOMB);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, wctomb);
+ ATF_TP_ADD_TC(tp, wcrtomb);
+ ATF_TP_ADD_TC(tp, wcrtomb_state);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/gen_ether_subr b/contrib/netbsd-tests/lib/libc/net/gen_ether_subr
new file mode 100755
index 0000000..9f9b63c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/gen_ether_subr
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+awk '
+BEGIN {
+ print
+ print "#include <ctype.h>"
+ print "#include <sys/types.h>"
+ print "#include <errno.h>"
+ print
+ print "#define ETHER_ADDR_LEN 6"
+ print
+ print "int ether_aton_r(u_char *dest, size_t len, const char *str);"
+ print
+}
+/^ether_aton_r/ {
+ print prevline
+ out = 1
+}
+{
+ if (out) print
+ else prevline = $0
+}
+/^}$/ {
+ if (out) exit(0)
+}' $1 >$2
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/README b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/README
new file mode 100644
index 0000000..e856fe7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/README
@@ -0,0 +1,7 @@
+This test may fail if
+
+ - your /etc/services file is not in sync with what this test expects
+ - your /etc/hosts file or DNS have unusual entries for "localhost"
+ (a duplicate "localhost 127.0.0.1" line in /etc/hosts for example)
+
+On kernels without IPv6 support some of the tests are skipped.
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/basics_v4.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/basics_v4.exp
new file mode 100644
index 0000000..d2945f2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/basics_v4.exp
@@ -0,0 +1,36 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv http
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv tftp
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv tftp
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv tftp
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv echo
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv echo
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv echo
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/basics_v4v6.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/basics_v4v6.exp
new file mode 100644
index 0000000..0238f83
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/basics_v4v6.exp
@@ -0,0 +1,42 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv http
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai3: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv tftp
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv tftp
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv tftp
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai2: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai3: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv echo
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv echo
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv echo
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai2: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai3: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/h_gai.c b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/h_gai.c
new file mode 100644
index 0000000..939fcdb
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/h_gai.c
@@ -0,0 +1,186 @@
+/* $NetBSD: h_gai.c,v 1.1 2011/01/12 02:58:40 pgoyette Exp $ */
+
+/*
+ * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, and 2002 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 <netdb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+
+#include <arpa/inet.h>
+
+struct addrinfo ai;
+
+char host[NI_MAXHOST];
+char serv[NI_MAXSERV];
+int vflag = 0;
+
+static void usage(void);
+static void print1(const char *, const struct addrinfo *, char *, char *);
+int main(int, char *[]);
+
+static void
+usage()
+{
+ fprintf(stderr, "usage: test [-f family] [-s socktype] [-p proto] [-DPRSv46] host serv\n");
+}
+
+static void
+print1(const char *title, const struct addrinfo *res, char *h, char *s)
+{
+ const char *start, *end;
+ int error;
+ const int niflag = NI_NUMERICHOST;
+
+ if (res->ai_addr) {
+ error = getnameinfo(res->ai_addr, res->ai_addr->sa_len,
+ host, sizeof(host), serv, sizeof(serv),
+ niflag);
+ h = host;
+ s = serv;
+ } else
+ error = 0;
+
+ if (vflag) {
+ start = "\t";
+ end = "\n";
+ } else {
+ start = " ";
+ end = "";
+ }
+ printf("%s%s", title, end);
+ printf("%sflags 0x%x%s", start, res->ai_flags, end);
+ printf("%sfamily %d%s", start, res->ai_family, end);
+ printf("%ssocktype %d%s", start, res->ai_socktype, end);
+ printf("%sprotocol %d%s", start, res->ai_protocol, end);
+ printf("%saddrlen %d%s", start, res->ai_addrlen, end);
+ if (error)
+ printf("%serror %d%s", start, error, end);
+ else {
+ printf("%shost %s%s", start, h, end);
+ printf("%sserv %s%s", start, s, end);
+ }
+#if 0
+ if (res->ai_canonname)
+ printf("%scname \"%s\"%s", start, res->ai_canonname, end);
+#endif
+ if (!vflag)
+ printf("\n");
+
+}
+
+int
+main(int argc, char *argv[])
+{
+ struct addrinfo *res;
+ int error, i;
+ char *p, *q;
+ extern int optind;
+ extern char *optarg;
+ int c;
+ char nbuf[10];
+
+ memset(&ai, 0, sizeof(ai));
+ ai.ai_family = PF_UNSPEC;
+ ai.ai_flags |= AI_CANONNAME;
+ while ((c = getopt(argc, argv, "Df:p:PRs:Sv46")) != -1) {
+ switch (c) {
+ case 'D':
+ ai.ai_socktype = SOCK_DGRAM;
+ break;
+ case 'f':
+ ai.ai_family = atoi(optarg);
+ break;
+ case 'p':
+ ai.ai_protocol = atoi(optarg);
+ break;
+ case 'P':
+ ai.ai_flags |= AI_PASSIVE;
+ break;
+ case 'R':
+ ai.ai_socktype = SOCK_RAW;
+ break;
+ case 's':
+ ai.ai_socktype = atoi(optarg);
+ break;
+ case 'S':
+ ai.ai_socktype = SOCK_STREAM;
+ break;
+ case 'v':
+ vflag++;
+ break;
+ case '4':
+ ai.ai_family = PF_INET;
+ break;
+ case '6':
+ ai.ai_family = PF_INET6;
+ break;
+ default:
+ usage();
+ exit(1);
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 2){
+ usage();
+ exit(1);
+ }
+
+ p = *argv[0] ? argv[0] : NULL;
+ q = *argv[1] ? argv[1] : NULL;
+
+ strncpy(nbuf, "(empty)", sizeof(nbuf));
+ print1("arg:", &ai, p ? p : nbuf , q ? q : nbuf);
+
+ error = getaddrinfo(p, q, &ai, &res);
+ if (error) {
+ printf("%s\n", gai_strerror(error));
+ exit(1);
+ }
+
+ i = 1;
+ do {
+ snprintf(nbuf, sizeof(nbuf), "ai%d:", i);
+ print1(nbuf, res, NULL, NULL);
+
+ i++;
+ } while ((res = res->ai_next) != NULL);
+ printf("\n");
+
+ exit(0);
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_host_v4.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_host_v4.exp
new file mode 100644
index 0000000..21059c7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_host_v4.exp
@@ -0,0 +1,38 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv echo
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv tftp
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv http
+ai1: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv http
+ai2: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv http
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv echo
+ai1: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv echo
+ai2: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv echo
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv tftp
+ai1: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv tftp
+ai2: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv tftp
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv http
+ai2: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv http
+
+arg: flags 0x2 family 0 socktype 1 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 2 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_host_v4v6.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_host_v4v6.exp
new file mode 100644
index 0000000..7d30fea
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_host_v4v6.exp
@@ -0,0 +1,56 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv http
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv echo
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+ai3: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv tftp
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+ai3: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv http
+ai1: flags 0x3 family 24 socktype 2 protocol 17 addrlen 28 host :: serv http
+ai2: flags 0x3 family 24 socktype 1 protocol 6 addrlen 28 host :: serv http
+ai3: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv http
+ai4: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv http
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv echo
+ai1: flags 0x3 family 24 socktype 2 protocol 17 addrlen 28 host :: serv echo
+ai2: flags 0x3 family 24 socktype 1 protocol 6 addrlen 28 host :: serv echo
+ai3: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv echo
+ai4: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv echo
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv tftp
+ai1: flags 0x3 family 24 socktype 2 protocol 17 addrlen 28 host :: serv tftp
+ai2: flags 0x3 family 24 socktype 1 protocol 6 addrlen 28 host :: serv tftp
+ai3: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv tftp
+ai4: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv tftp
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x3 family 24 socktype 2 protocol 17 addrlen 28 host :: serv http
+ai2: flags 0x3 family 24 socktype 1 protocol 6 addrlen 28 host :: serv http
+ai3: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv http
+ai4: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv http
+
+arg: flags 0x2 family 0 socktype 1 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 2 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_serv_v4.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_serv_v4.exp
new file mode 100644
index 0000000..9de5c56
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_serv_v4.exp
@@ -0,0 +1,14 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv (empty)
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv 0
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv (empty)
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv (empty)
+hostname nor servname provided, or not known
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_serv_v4v6.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_serv_v4v6.exp
new file mode 100644
index 0000000..1df5663
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/no_serv_v4v6.exp
@@ -0,0 +1,16 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv (empty)
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv 0
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv (empty)
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv 0
+ai2: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv 0
+ai3: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv 0
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv (empty)
+hostname nor servname provided, or not known
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/scoped.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/scoped.exp
new file mode 100644
index 0000000..d06d163
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/scoped.exp
@@ -0,0 +1,4 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host fe80::1%lo0 serv http
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host fe80::1%lo0 serv http
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host fe80::1%lo0 serv http
+
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/sock_raw_v4.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/sock_raw_v4.exp
new file mode 100644
index 0000000..bc850e0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/sock_raw_v4.exp
@@ -0,0 +1,13 @@
+arg: flags 0x2 family 0 socktype 3 protocol 0 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 3 protocol 0 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 3 protocol 59 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv 80
+servname not supported for ai_socktype
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv www
+servname not supported for ai_socktype
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host ::1 serv (empty)
+ai1: flags 0x2 family 24 socktype 3 protocol 59 addrlen 28 host ::1 serv 0
+
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/sock_raw_v4v6.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/sock_raw_v4v6.exp
new file mode 100644
index 0000000..a4f2fb8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/sock_raw_v4v6.exp
@@ -0,0 +1,15 @@
+arg: flags 0x2 family 0 socktype 3 protocol 0 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 24 socktype 3 protocol 0 addrlen 28 host ::1 serv 0
+ai2: flags 0x2 family 2 socktype 3 protocol 0 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 24 socktype 3 protocol 59 addrlen 28 host ::1 serv 0
+ai2: flags 0x2 family 2 socktype 3 protocol 59 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv 80
+servname not supported for ai_socktype
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv www
+servname not supported for ai_socktype
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host ::1 serv (empty)
+ai1: flags 0x2 family 24 socktype 3 protocol 59 addrlen 28 host ::1 serv 0
+
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/spec_fam_v4.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/spec_fam_v4.exp
new file mode 100644
index 0000000..1c0ce43
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/spec_fam_v4.exp
@@ -0,0 +1,6 @@
+arg: flags 0x2 family 2 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 24 socktype 0 protocol 0 addrlen 0 host localhost serv http
+No address associated with hostname
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/spec_fam_v4v6.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/spec_fam_v4v6.exp
new file mode 100644
index 0000000..e24036e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/spec_fam_v4v6.exp
@@ -0,0 +1,8 @@
+arg: flags 0x2 family 2 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 24 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 24 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 24 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh
new file mode 100755
index 0000000..94a3c0b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh
@@ -0,0 +1,198 @@
+# $NetBSD: t_getaddrinfo.sh,v 1.2 2011/06/15 07:54:32 jmmv Exp $
+
+#
+# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, and 2002 WIDE Project.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce 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 project nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+check_output()
+{
+ if [ "$2" = "none" ] ; then
+ exp="${1}.exp"
+ elif [ "$2" = "hosts" ] ; then
+ # Determine if localhost has an IPv6 address or not
+ lcl=$( cat /etc/hosts | \
+ sed -e 's/#.*$//' -e 's/[ ][ ]*/ /g' | \
+ awk '/ localhost($| )/ {printf "%s ", $1}' )
+ if [ "${lcl%*::*}" = "${lcl}" ] ; then
+ exp="${1}_v4.exp"
+ else
+ exp="${1}_v4v6.exp"
+ fi
+ elif [ "$2" = "ifconfig" ] ; then
+ lcl=$( ifconfig lo0 | grep inet6 )
+ if [ -n "${lcl}" ] ; then
+ exp="${1}_v4v6.exp"
+ else
+ exp="${1}_v4.exp"
+ fi
+ else
+ atf_fail "Invalid family_match_type $2 requested."
+ fi
+
+ cmp -s $(atf_get_srcdir)/data/${exp} out && return
+ diff -u $(atf_get_srcdir)/data/${exp} out && \
+ atf_fail "Actual output does not match expected output"
+}
+
+atf_test_case basic
+basic_head()
+{
+ atf_set "descr" "Testing basic ones"
+}
+basic_body()
+{
+ TEST=$(atf_get_srcdir)/h_gai
+
+ ( $TEST ::1 http
+ $TEST 127.0.0.1 http
+ $TEST localhost http
+ $TEST ::1 tftp
+ $TEST 127.0.0.1 tftp
+ $TEST localhost tftp
+ $TEST ::1 echo
+ $TEST 127.0.0.1 echo
+ $TEST localhost echo ) > out 2>&1
+
+ check_output basics hosts
+}
+
+atf_test_case specific
+specific_head()
+{
+ atf_set "descr" "Testing specific address family"
+}
+specific_body()
+{
+ TEST=$(atf_get_srcdir)/h_gai
+
+ ( $TEST -4 localhost http
+ $TEST -6 localhost http ) > out 2>&1
+
+ check_output spec_fam hosts
+}
+
+atf_test_case empty_hostname
+empty_hostname_head()
+{
+ atf_set "descr" "Testing empty hostname"
+}
+empty_hostname_body()
+{
+ TEST=$(atf_get_srcdir)/h_gai
+
+ ( $TEST '' http
+ $TEST '' echo
+ $TEST '' tftp
+ $TEST '' 80
+ $TEST -P '' http
+ $TEST -P '' echo
+ $TEST -P '' tftp
+ $TEST -P '' 80
+ $TEST -S '' 80
+ $TEST -D '' 80 ) > out 2>&1
+
+ check_output no_host ifconfig
+}
+
+atf_test_case empty_servname
+empty_servname_head()
+{
+ atf_set "descr" "Testing empty service name"
+}
+empty_servname_body()
+{
+ TEST=$(atf_get_srcdir)/h_gai
+
+ ( $TEST ::1 ''
+ $TEST 127.0.0.1 ''
+ $TEST localhost ''
+ $TEST '' '' ) > out 2>&1
+
+ check_output no_serv hosts
+}
+
+atf_test_case sock_raw
+sock_raw_head()
+{
+ atf_set "descr" "Testing raw socket"
+}
+sock_raw_body()
+{
+ TEST=$(atf_get_srcdir)/h_gai
+
+ ( $TEST -R -p 0 localhost ''
+ $TEST -R -p 59 localhost ''
+ $TEST -R -p 59 localhost 80
+ $TEST -R -p 59 localhost www
+ $TEST -R -p 59 ::1 '' ) > out 2>&1
+
+ check_output sock_raw hosts
+}
+
+atf_test_case unsupported_family
+unsupported_family_head()
+{
+ atf_set "descr" "Testing unsupported family"
+}
+unsupported_family_body()
+{
+ TEST=$(atf_get_srcdir)/h_gai
+
+ ( $TEST -f 99 localhost '' ) > out 2>&1
+
+ check_output unsup_fam none
+}
+
+atf_test_case scopeaddr
+scopeaddr_head()
+{
+ atf_set "descr" "Testing scoped address format"
+}
+scopeaddr_body()
+{
+ TEST=$(atf_get_srcdir)/h_gai
+
+ ( $TEST fe80::1%lo0 http
+# IF=`ifconfig -a | grep -v '^ ' | \
+# sed -e 's/:.*//' | head -1 | awk '{print $1}'`
+# $TEST fe80::1%$IF http
+ ) > out 2>&1
+
+ check_output scoped none
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+ atf_add_test_case specific
+ atf_add_test_case empty_hostname
+ atf_add_test_case empty_servname
+ atf_add_test_case sock_raw
+ atf_add_test_case unsupported_family
+ atf_add_test_case scopeaddr
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/unsup_fam.exp b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/unsup_fam.exp
new file mode 100644
index 0000000..b6133c0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/unsup_fam.exp
@@ -0,0 +1,2 @@
+arg: flags 0x2 family 99 socktype 0 protocol 0 addrlen 0 host localhost serv (empty)
+ai_family not supported
diff --git a/contrib/netbsd-tests/lib/libc/net/h_dns_server.c b/contrib/netbsd-tests/lib/libc/net/h_dns_server.c
new file mode 100644
index 0000000..47472de
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/h_dns_server.c
@@ -0,0 +1,298 @@
+/* $NetBSD: h_dns_server.c,v 1.4 2014/03/29 16:10:54 gson Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Andreas Gustafsson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * A minimal DNS server capable of providing canned answers to the
+ * specific queries issued by t_hostent.sh and nothing more.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: h_dns_server.c,v 1.4 2014/03/29 16:10:54 gson Exp $");
+
+#include <ctype.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <memory.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <netinet6/in6.h>
+
+union sockaddr_either {
+ struct sockaddr s;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+};
+
+#ifdef DEBUG
+#define DPRINTF(...) fprintf(stderr, __VA_ARGS__)
+#else
+#define DPRINTF(...)
+#endif
+
+/* A DNS question and its corresponding answer */
+
+struct dns_data {
+ size_t qname_size;
+ const char *qname; /* Wire-encode question name */
+ int qtype;
+ size_t answer_size;
+ const char *answer; /* One wire-encoded answer RDATA */
+};
+
+/* Convert C string constant to length + data pair */
+#define STR_DATA(s) sizeof(s) - 1, s
+
+/* Canned DNS queestion-answer pairs */
+struct dns_data data[] = {
+ /* Forward mappings */
+ /* localhost IN A -> 127.0.0.1 */
+ { STR_DATA("\011localhost\000"), 1,
+ STR_DATA("\177\000\000\001") },
+ /* localhost IN AAAA -> ::1 */
+ { STR_DATA("\011localhost\000"), 28,
+ STR_DATA("\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001") },
+ /* sixthavenue.astron.com IN A -> 38.117.134.16 */
+ { STR_DATA("\013sixthavenue\006astron\003com\000"), 1,
+ STR_DATA("\046\165\206\020") },
+ /* sixthavenue.astron.com IN AAAA -> 2620:106:3003:1f00:3e4a:92ff:fef4:e180 */
+ { STR_DATA("\013sixthavenue\006astron\003com\000"), 28,
+ STR_DATA("\x26\x20\x01\x06\x30\x03\x1f\x00\x3e\x4a\x92\xff\xfe\xf4\xe1\x80") },
+ /* Reverse mappings */
+ { STR_DATA("\0011\0010\0010\003127\007in-addr\004arpa\000"), 12,
+ STR_DATA("\011localhost\000") },
+ { STR_DATA("\0011\0010\0010\0010\0010\0010\0010\0010"
+ "\0010\0010\0010\0010\0010\0010\0010\0010"
+ "\0010\0010\0010\0010\0010\0010\0010\0010"
+ "\0010\0010\0010\0010\0010\0010\0010\0010"
+ "\003ip6\004arpa\000"), 12,
+ STR_DATA("\011localhost\000") },
+ { STR_DATA("\00216\003134\003117\00238"
+ "\007in-addr\004arpa\000"), 12,
+ STR_DATA("\013sixthavenue\006astron\003com\000") },
+ { STR_DATA("\0010\0018\0011\001e\0014\001f\001e\001f"
+ "\001f\001f\0012\0019\001a\0014\001e\0013"
+ "\0010\0010\001f\0011\0013\0010\0010\0013"
+ "\0016\0010\0011\0010\0010\0012\0016\0012"
+ "\003ip6\004arpa\000"), 12,
+ STR_DATA("\013sixthavenue\006astron\003com\000") },
+ /* End marker */
+ { STR_DATA(""), 0, STR_DATA("") }
+};
+
+/*
+ * Compare two DNS names for equality. If equal, return their
+ * length, and if not, return zero. Does not handle compression.
+ */
+static int
+name_eq(const unsigned char *a, const unsigned char *b) {
+ const unsigned char *a_save = a;
+ for (;;) {
+ int i;
+ int lena = *a++;
+ int lenb = *b++;
+ if (lena != lenb)
+ return 0;
+ if (lena == 0)
+ return a - a_save;
+ for (i = 0; i < lena; i++)
+ if (tolower(a[i]) != tolower(b[i]))
+ return 0;
+ a += lena;
+ b += lena;
+ }
+}
+
+#ifdef DEBUG
+static char *
+name2str(const void *v, char *buf, size_t buflen) {
+ const unsigned char *a = v;
+ char *b = buf;
+ char *eb = buf + buflen;
+
+#define ADDC(c) do { \
+ if (b < eb) \
+ *b++ = c; \
+ else \
+ return NULL; \
+ } while (/*CONSTCOND*/0)
+ for (int did = 0;; did++) {
+ int lena = *a++;
+ if (lena == 0) {
+ ADDC('\0');
+ return buf;
+ }
+ if (did)
+ ADDC('.');
+ for (int i = 0; i < lena; i++)
+ ADDC(a[i]);
+ a += lena;
+ }
+}
+#endif
+
+int main(int argc, char **argv) {
+ int s, r, protocol;
+ union sockaddr_either saddr;
+ struct dns_data *dp;
+ unsigned char *p;
+ char pidfile_name[40];
+ FILE *f;
+ int one = 1;
+#ifdef DEBUG
+ char buf1[1024], buf2[1024];
+#endif
+
+ if (argc < 2 || ((protocol = argv[1][0]) != '4' && protocol != '6'))
+ errx(1, "usage: dns_server 4 | 6");
+ s = socket(protocol == '4' ? PF_INET : PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
+ if (s < 0)
+ err(1, "socket");
+ if (protocol == '4') {
+ memset(&saddr.sin, 0, sizeof(saddr.sin));
+ saddr.sin.sin_family = AF_INET;
+ saddr.sin.sin_len = sizeof(saddr.sin);
+ saddr.sin.sin_port = htons(53);
+ saddr.sin.sin_addr.s_addr = INADDR_ANY;
+ } else {
+ static struct in6_addr loopback = IN6ADDR_LOOPBACK_INIT;
+ memset(&saddr.sin6, 0, sizeof(saddr.sin6));
+ saddr.sin6.sin6_family = AF_INET6;
+ saddr.sin6.sin6_len = sizeof(saddr.sin6);
+ saddr.sin6.sin6_port = htons(53);
+ saddr.sin6.sin6_addr = loopback;
+ }
+
+ r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof one);
+ if (r < 0)
+ err(1, "setsockopt");
+
+ r = bind(s,
+ (struct sockaddr *) &saddr,
+ protocol == '4' ? sizeof(struct sockaddr_in) :
+ sizeof(struct sockaddr_in6));
+ if (r < 0)
+ err(1, "bind");
+
+ snprintf(pidfile_name, sizeof pidfile_name,
+ "dns_server_%c.pid", protocol);
+ f = fopen(pidfile_name, "w");
+ fprintf(f, "%d", getpid());
+ fclose(f);
+#ifdef DEBUG
+ daemon(0, 1);
+#else
+ daemon(0, 0);
+#endif
+
+ for (;;) {
+ unsigned char buf[512];
+ union sockaddr_either from;
+ ssize_t nrecv, nsent;
+ socklen_t fromlen =
+ protocol == '4' ? sizeof(struct sockaddr_in) :
+ sizeof(struct sockaddr_in6);
+ memset(buf, 0, sizeof buf);
+ nrecv = recvfrom(s, buf, sizeof buf, 0, &from.s, &fromlen);
+ if (nrecv < 0)
+ err(1, "recvfrom");
+ if (nrecv < 12) {
+ DPRINTF("Too short %zd\n", nrecv);
+ continue;
+ }
+ if ((buf[2] & 0x80) != 0) {
+ DPRINTF("Not a query 0x%x\n", buf[2]);
+ continue;
+ }
+ if (!(buf[4] == 0 && buf[5] == 1)) {
+ DPRINTF("QCOUNT is not 1 0x%x 0x%x\n", buf[4], buf[5]);
+ continue; /* QDCOUNT is not 1 */
+ }
+
+ for (dp = data; dp->qname_size != 0; dp++) {
+ int qtype, qclass;
+ p = buf + 12; /* Point to QNAME */
+ int n = name_eq(p, (const unsigned char *) dp->qname);
+ if (n == 0) {
+ DPRINTF("no match name %s != %s\n",
+ name2str(p, buf1, sizeof(buf1)),
+ name2str(dp->qname, buf2, sizeof(buf2)));
+ continue; /* Name does not match */
+ }
+ DPRINTF("match name %s\n",
+ name2str(p, buf1, sizeof(buf1)));
+ p += n; /* Skip QNAME */
+ qtype = *p++ << 8;
+ qtype |= *p++;
+ if (qtype != dp->qtype) {
+ DPRINTF("no match name 0x%x != 0x%x\n",
+ qtype, dp->qtype);
+ continue;
+ }
+ DPRINTF("match type 0x%x\n", qtype);
+ qclass = *p++ << 8;
+ qclass |= *p++;
+ if (qclass != 1) { /* IN */
+ DPRINTF("no match class %d != 1\n", qclass);
+ continue;
+ }
+ DPRINTF("match class %d\n", qclass);
+ goto found;
+ }
+ continue;
+ found:
+ buf[2] |= 0x80; /* QR */
+ buf[3] |= 0x80; /* RA */
+ memset(buf + 6, 0, 6); /* Clear ANCOUNT, NSCOUNT, ARCOUNT */
+ buf[7] = 1; /* ANCOUNT */
+ memcpy(p, dp->qname, dp->qname_size);
+ p += dp->qname_size;
+ *p++ = dp->qtype >> 8;
+ *p++ = dp->qtype & 0xFF;
+ *p++ = 0;
+ *p++ = 1; /* IN */
+ memset(p, 0, 4); /* TTL = 0 */
+ p += 4;
+ *p++ = 0; /* RDLENGTH MSB */
+ *p++ = dp->answer_size; /* RDLENGTH LSB */
+ memcpy(p, dp->answer, dp->answer_size);
+ p += dp->answer_size;
+ nsent = sendto(s, buf, p - buf, 0, &from.s, fromlen);
+ DPRINTF("sent %zd\n", nsent);
+ if (nsent != p - buf)
+ warn("sendto");
+ }
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/h_hostent.c b/contrib/netbsd-tests/lib/libc/net/h_hostent.c
new file mode 100644
index 0000000..4a72923
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/h_hostent.c
@@ -0,0 +1,195 @@
+/* $NetBSD: h_hostent.c,v 1.2 2014/01/09 02:18:10 christos Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: h_hostent.c,v 1.2 2014/01/09 02:18:10 christos Exp $");
+
+#include <stdio.h>
+#include <string.h>
+#include <nsswitch.h>
+#include <netdb.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <err.h>
+
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include "hostent.h"
+
+extern const char *__res_conf_name;
+
+static void
+phostent(const struct hostent *h)
+{
+ size_t i;
+ char buf[1024];
+ const int af = h->h_length == NS_INADDRSZ ? AF_INET : AF_INET6;
+
+ printf("name=%s, length=%d, addrtype=%d, aliases=[",
+ h->h_name, h->h_length, h->h_addrtype);
+
+ for (i = 0; h->h_aliases[i]; i++)
+ printf("%s%s", i == 0 ? "" : " ", h->h_aliases[i]);
+
+ printf("] addr_list=[");
+
+ for (i = 0; h->h_addr_list[i]; i++)
+ printf("%s%s", i == 0 ? "" : " ", inet_ntop(af,
+ h->h_addr_list[i], buf, (socklen_t)sizeof(buf)));
+
+ printf("]\n");
+}
+
+static void
+usage(void)
+{
+ (void)fprintf(stderr, "Usage: %s [-f <hostsfile>] "
+ "[-t <any|dns|nis|files>] "
+ "[-46a] <name|address>\n", getprogname());
+ exit(EXIT_FAILURE);
+}
+
+static void
+getby(int (*f)(void *, void *, va_list), struct getnamaddr *info, ...)
+{
+ va_list ap;
+ int e;
+
+ va_start(ap, info);
+ e = (*f)(info, NULL, ap);
+ va_end(ap);
+ switch (e) {
+ case NS_SUCCESS:
+ phostent(info->hp);
+ break;
+ default:
+ printf("error %d\n", e);
+ break;
+ }
+}
+
+static void
+geta(struct hostent *hp) {
+ if (hp == NULL)
+ printf("error %d\n", h_errno);
+ else
+ phostent(hp);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int (*f)(void *, void *, va_list) = NULL;
+ const char *type = "any";
+ int c, af, e, byaddr, len;
+ struct hostent hent;
+ struct getnamaddr info;
+ char buf[4096];
+
+ af = AF_INET;
+ byaddr = 0;
+ len = 0;
+ info.hp = &hent;
+ info.buf = buf;
+ info.buflen = sizeof(buf);
+ info.he = &e;
+
+ while ((c = getopt(argc, argv, "46af:r:t:")) != -1) {
+ switch (c) {
+ case '4':
+ af = AF_INET;
+ break;
+ case '6':
+ af = AF_INET6;
+ break;
+ case 'a':
+ byaddr++;
+ break;
+ case 'f':
+ _hf_sethostsfile(optarg);
+ break;
+ case 'r':
+ __res_conf_name = optarg;
+ break;
+ case 't':
+ type = optarg;
+ break;
+ default:
+ usage();
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 1)
+ usage();
+
+ switch (*type) {
+ case 'a':
+ break;
+ case 'd':
+ f = byaddr ? _dns_gethtbyaddr : _dns_gethtbyname;
+ break;
+#ifdef YP
+ case 'n':
+ f = byaddr ? _yp_gethtbyaddr : _yp_gethtbyname;
+ break;
+#endif
+ case 'f':
+ f = byaddr ? _hf_gethtbyaddr : _hf_gethtbyname;
+ break;
+ default:
+ errx(EXIT_FAILURE, "Unknown db type `%s'", type);
+ }
+
+ if (byaddr) {
+ struct in6_addr addr;
+ af = strchr(*argv, ':') ? AF_INET6 : AF_INET;
+ len = af == AF_INET ? NS_INADDRSZ : NS_IN6ADDRSZ;
+ if (inet_pton(af, *argv, &addr) == -1)
+ err(EXIT_FAILURE, "Can't parse `%s'", *argv);
+ if (*type == 'a')
+ geta(gethostbyaddr((const char *)&addr, len, af));
+ else
+ getby(f, &info, &addr, len, af);
+ } else {
+ if (*type == 'a')
+ geta(gethostbyname2(*argv, af));
+ else
+ getby(f, &info, *argv, len, af);
+ }
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/h_nsd_recurse.c b/contrib/netbsd-tests/lib/libc/net/h_nsd_recurse.c
new file mode 100644
index 0000000..2f315d2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/h_nsd_recurse.c
@@ -0,0 +1,107 @@
+/* $NetBSD: h_nsd_recurse.c,v 1.2 2011/01/13 02:24:51 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_nsd_recurse.c,v 1.2 2011/01/13 02:24:51 pgoyette Exp $");
+
+#define _REENTRANT
+
+#include <assert.h>
+#include <nsswitch.h>
+#include <pthread.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static const ns_src testsrc[] = {
+ { "test", NS_SUCCESS },
+ { NULL, 0 }
+};
+
+static int
+func3(void *rv, void *cb_data, va_list ap)
+{
+ (void)printf("func3: enter\n");
+ (void)printf("func3: exit\n");
+
+ return NS_SUCCESS;
+}
+
+static int
+func2(void *rv, void *cb_data, va_list ap)
+{
+ static const ns_dtab dtab[] = {
+ { "test", func3, NULL },
+ { NULL, NULL, NULL }
+ };
+ int r;
+
+ (void)printf("func2: enter\n");
+ r = nsdispatch(NULL, dtab, "test", "test", testsrc);
+ (void)printf("func2: exit\n");
+
+ return r;
+}
+
+static int
+func1(void)
+{
+ static const ns_dtab dtab[] = {
+ { "test", func2, NULL },
+ { NULL, NULL, NULL }
+ };
+ int r;
+
+ (void)printf("func1: enter\n");
+ r = nsdispatch(NULL, dtab, "test", "test", testsrc);
+ (void)printf("func1: exit\n");
+
+ return r;
+}
+
+static void *
+thrfunc(void *arg)
+{
+ pthread_exit(NULL);
+}
+
+int
+main(int argc, char *argv[])
+{
+ pthread_t thr;
+ void *threval;
+
+ assert(pthread_create(&thr, NULL, thrfunc, NULL) == 0);
+ assert(func1() == NS_SUCCESS);
+ assert(pthread_join(thr, &threval) == 0);
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/h_protoent.c b/contrib/netbsd-tests/lib/libc/net/h_protoent.c
new file mode 100644
index 0000000..f37a85c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/h_protoent.c
@@ -0,0 +1,97 @@
+/* $NetBSD: h_protoent.c,v 1.2 2011/04/07 18:14:09 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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 <netdb.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <stdio.h>
+
+static void
+pserv(const struct protoent *prp)
+{
+ char **pp;
+
+ printf("name=%s, proto=%d, aliases=",
+ prp->p_name, prp->p_proto);
+ for (pp = prp->p_aliases; *pp; pp++)
+ printf("%s ", *pp);
+ printf("\n");
+}
+
+static void
+usage(void)
+{
+ (void)fprintf(stderr, "Usage: %s\n"
+ "\t%s -p <proto>\n"
+ "\t%s -n <name>\n", getprogname(), getprogname(),
+ getprogname());
+ exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+ struct protoent *prp;
+ const char *proto = NULL, *name = NULL;
+ int c;
+
+ while ((c = getopt(argc, argv, "p:n:")) != -1) {
+ switch (c) {
+ case 'n':
+ name = optarg;
+ break;
+ case 'p':
+ proto = optarg;
+ break;
+ default:
+ usage();
+ }
+ }
+
+ if (proto && name)
+ usage();
+ if (proto) {
+ if ((prp = getprotobynumber(atoi(proto))) != NULL)
+ pserv(prp);
+ return 0;
+ }
+ if (name) {
+ if ((prp = getprotobyname(name)) != NULL)
+ pserv(prp);
+ return 0;
+ }
+
+ setprotoent(0);
+ while ((prp = getprotoent()) != NULL)
+ pserv(prp);
+ endprotoent();
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/h_servent.c b/contrib/netbsd-tests/lib/libc/net/h_servent.c
new file mode 100644
index 0000000..6d7efd8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/h_servent.c
@@ -0,0 +1,100 @@
+/* $NetBSD: h_servent.c,v 1.2 2011/04/07 18:14:09 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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 <netdb.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <stdio.h>
+
+static void
+pserv(const struct servent *svp)
+{
+ char **pp;
+
+ printf("name=%s, port=%d, proto=%s, aliases=",
+ svp->s_name, ntohs((uint16_t)svp->s_port), svp->s_proto);
+ for (pp = svp->s_aliases; *pp; pp++)
+ printf("%s ", *pp);
+ printf("\n");
+}
+
+static void
+usage(void)
+{
+ (void)fprintf(stderr, "Usage: %s\n"
+ "\t%s -p <port> [-P <proto>]\n"
+ "\t%s -n <name> [-P <proto>]\n", getprogname(), getprogname(),
+ getprogname());
+ exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+ struct servent *svp;
+ const char *port = NULL, *proto = NULL, *name = NULL;
+ int c;
+
+ while ((c = getopt(argc, argv, "p:n:P:")) != -1) {
+ switch (c) {
+ case 'n':
+ name = optarg;
+ break;
+ case 'p':
+ port = optarg;
+ break;
+ case 'P':
+ proto = optarg;
+ break;
+ default:
+ usage();
+ }
+ }
+
+ if (port && name)
+ usage();
+ if (port) {
+ if ((svp = getservbyport(htons(atoi(port)), proto)) != NULL)
+ pserv(svp);
+ return 0;
+ }
+ if (name) {
+ if ((svp = getservbyname(name, proto)) != NULL)
+ pserv(svp);
+ return 0;
+ }
+
+ setservent(0);
+ while ((svp = getservent()) != NULL)
+ pserv(svp);
+ endservent();
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/hosts b/contrib/netbsd-tests/lib/libc/net/hosts
new file mode 100644
index 0000000..87ccbe8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/hosts
@@ -0,0 +1,11 @@
+# $NetBSD: hosts,v 1.1 2013/08/16 15:29:45 christos Exp $
+#
+# Host Database
+# This file should contain the addresses and aliases
+# for local hosts that share this file.
+# It is used only for "ifconfig" and other operations
+# before the nameserver is started.
+#
+#
+::1 localhost localhost. localhost.localdomain.
+127.0.0.1 localhost localhost. localhost.localdomain.
diff --git a/contrib/netbsd-tests/lib/libc/net/resolv.conf b/contrib/netbsd-tests/lib/libc/net/resolv.conf
new file mode 100644
index 0000000..bbc8559
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/resolv.conf
@@ -0,0 +1 @@
+nameserver 127.0.0.1
diff --git a/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c b/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c
new file mode 100644
index 0000000..6ca3c5b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c
@@ -0,0 +1,104 @@
+/* $NetBSD: t_ether_aton.c,v 1.1 2011/11/01 22:36:53 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_ether_aton.c,v 1.1 2011/11/01 22:36:53 pgoyette Exp $");
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <err.h>
+#include <string.h>
+#include <errno.h>
+
+#define ETHER_ADDR_LEN 6
+
+int ether_aton_r(u_char *dest, size_t len, const char *str);
+
+static const struct {
+ u_char res[ETHER_ADDR_LEN];
+ const char *str;
+ int error;
+} tests[] = {
+ { { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab }, "01:23:45:67:89:ab", 0 },
+ { { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "0:1:22-3:14:05", 0 },
+ { { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "000122031405", 0 },
+ { { 0x0a, 0x0B, 0xcc, 0xdD, 0xEE, 0x0f }, "0a0BccdDEE0f", 0 },
+#define ZERO { 0, 0, 0, 0, 0, 0 }
+ { ZERO, "0:1:2-3:04:05:06", ENAMETOOLONG },
+ { ZERO, "0:1:2-3:04:", ENOBUFS },
+ { ZERO, "0:1:2-3:04:x7", EINVAL },
+ { ZERO, "1:x-3:04:05:7", EINVAL },
+ { ZERO, NULL, 0 },
+};
+
+ATF_TC(tc_ether_aton);
+ATF_TC_HEAD(tc_ether_aton, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check that ether_aton(3) works");
+}
+
+ATF_TC_BODY(tc_ether_aton, tc)
+{
+ u_char dest[ETHER_ADDR_LEN];
+ size_t t;
+ int e, r;
+ const char *s;
+
+ for (t = 0; tests[t].str; t++) {
+ s = tests[t].str;
+ if ((e = tests[t].error) == 0) {
+ if (ether_aton_r(dest, sizeof(dest), s) != e)
+ atf_tc_fail("failed on `%s'", s);
+ if (memcmp(dest, tests[t].res, sizeof(dest)) != 0)
+ atf_tc_fail("unexpected result on `%s'", s);
+ } else {
+ if ((r = ether_aton_r(dest, sizeof(dest), s)) != e)
+ atf_tc_fail("unexpectedly succeeded on `%s' "
+ "(%d != %d)", s, r, e);
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, tc_ether_aton);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/t_getprotoent.c b/contrib/netbsd-tests/lib/libc/net/t_getprotoent.c
new file mode 100644
index 0000000..1c1a0e0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/t_getprotoent.c
@@ -0,0 +1,233 @@
+/* $NetBSD: t_getprotoent.c,v 1.2 2012/04/04 10:03:53 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getprotoent.c,v 1.2 2012/04/04 10:03:53 joerg Exp $");
+
+#include <atf-c.h>
+#include <netdb.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+
+static const struct {
+ const char *name;
+ int number;
+} protos[] = {
+
+ { "icmp", 1 }, { "tcp", 6 }, { "udp", 17 }, { "gre", 47 },
+ { "esp", 50 }, { "ah", 51 }, { "sctp", 132}, { "ipv6-icmp", 58 }
+};
+
+ATF_TC(endprotoent_rewind);
+ATF_TC_HEAD(endprotoent_rewind, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check that endprotoent(3) rewinds");
+}
+
+ATF_TC_BODY(endprotoent_rewind, tc)
+{
+ struct protoent *p;
+ int i = 0;
+
+ setprotoent(0);
+
+ while ((p = getprotoent()) != NULL && i <= 10) {
+ ATF_REQUIRE(p->p_proto == i);
+ i++;
+ }
+
+ i = 0;
+ endprotoent();
+
+ while ((p = getprotoent()) != NULL && i <= 10) {
+ ATF_REQUIRE(p->p_proto == i);
+ i++;
+ }
+
+ endprotoent();
+}
+
+ATF_TC(getprotobyname_basic);
+ATF_TC_HEAD(getprotobyname_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of getprotobyname(3)");
+}
+
+ATF_TC_BODY(getprotobyname_basic, tc)
+{
+ struct protoent *p;
+ size_t i;
+
+ for (i = 0; i < __arraycount(protos); i++) {
+
+ p = getprotobyname(protos[i].name);
+
+ ATF_REQUIRE(p != NULL);
+ ATF_REQUIRE(p->p_proto == protos[i].number);
+ ATF_REQUIRE(strcmp(p->p_name, protos[i].name) == 0);
+ }
+
+ endprotoent();
+}
+
+ATF_TC(getprotobyname_err);
+ATF_TC_HEAD(getprotobyname_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test EOF from getprotobyname(3)");
+}
+
+ATF_TC_BODY(getprotobyname_err, tc)
+{
+ static const char * name[] =
+ { "xxx", "yyy", "xyz", ".as.d}9x.._?!!#\xa4,\xa8^//&%%,",
+ "0", "", "tCp", "uDp", "t c p", "tcp ", " tcp" };
+
+ size_t i;
+
+ for (i = 0; i < __arraycount(name); i++)
+ ATF_REQUIRE(getprotobyname(name[i]) == NULL);
+
+ endprotoent();
+}
+
+ATF_TC(getprotobynumber_basic);
+ATF_TC_HEAD(getprotobynumber_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of getprotobynumber(3)");
+}
+
+ATF_TC_BODY(getprotobynumber_basic, tc)
+{
+ struct protoent *p;
+ size_t i;
+
+ /*
+ * No ATF_CHECK() due static storage.
+ */
+ for (i = 0; i < __arraycount(protos); i++) {
+
+ p = getprotobynumber(protos[i].number);
+
+ ATF_REQUIRE(p != NULL);
+ ATF_REQUIRE(p->p_proto == protos[i].number);
+ ATF_REQUIRE(strcmp(p->p_name, protos[i].name) == 0);
+ }
+
+ endprotoent();
+}
+
+ATF_TC(getprotobynumber_err);
+ATF_TC_HEAD(getprotobynumber_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test EOF from getprotobynumber(3)");
+}
+
+ATF_TC_BODY(getprotobynumber_err, tc)
+{
+ static const int number[] = { -1, -99999, INT_MAX, 1000000000 };
+ size_t i;
+
+ for (i = 0; i < __arraycount(number); i++)
+ ATF_REQUIRE(getprotobynumber(number[i]) == NULL);
+
+ endprotoent();
+}
+
+ATF_TC(getprotoent_next);
+ATF_TC_HEAD(getprotoent_next, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "getprotoent(3) returns next line?");
+}
+
+ATF_TC_BODY(getprotoent_next, tc)
+{
+ struct protoent *p;
+ int i = 0;
+
+ /*
+ * The range [0, 60] is already reserved by IANA.
+ */
+ while ((p = getprotoent()) != NULL && i <= 60) {
+ ATF_CHECK(p->p_proto == i);
+ i++;
+ }
+
+ endprotoent();
+}
+
+ATF_TC(setprotoent_rewind);
+ATF_TC_HEAD(setprotoent_rewind, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check that setprotoent(3) rewinds");
+}
+
+ATF_TC_BODY(setprotoent_rewind, tc)
+{
+ struct protoent *p;
+
+ setprotoent(0);
+
+ p = getprotoent();
+ ATF_REQUIRE(p->p_proto == 0);
+
+ p = getprotoent();
+ ATF_REQUIRE(p->p_proto == 1);
+
+ p = getprotoent();
+ ATF_REQUIRE(p->p_proto == 2);
+
+ setprotoent(0);
+
+ p = getprotoent();
+ ATF_REQUIRE(p->p_proto == 0);
+
+ p = getprotoent();
+ ATF_REQUIRE(p->p_proto == 1);
+
+ p = getprotoent();
+ ATF_REQUIRE(p->p_proto == 2);
+
+ endprotoent();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getprotobyname_basic);
+ ATF_TP_ADD_TC(tp, getprotobyname_err);
+ ATF_TP_ADD_TC(tp, getprotobynumber_basic);
+ ATF_TP_ADD_TC(tp, getprotobynumber_err);
+ ATF_TP_ADD_TC(tp, endprotoent_rewind);
+ ATF_TP_ADD_TC(tp, getprotoent_next);
+ ATF_TP_ADD_TC(tp, setprotoent_rewind);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/t_hostent.sh b/contrib/netbsd-tests/lib/libc/net/t_hostent.sh
new file mode 100755
index 0000000..b597b6d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/t_hostent.sh
@@ -0,0 +1,240 @@
+# $NetBSD: t_hostent.sh,v 1.10 2014/01/13 11:08:14 gson Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+n6="sixthavenue.astron.com"
+a6="2620:106:3003:1f00:3e4a:92ff:fef4:e180"
+ans6="name=$n6, length=16, addrtype=24, aliases=[] addr_list=[$a6]\n"
+
+n4="sixthavenue.astron.com"
+a4="38.117.134.16"
+ans4="name=$n4, length=4, addrtype=2, aliases=[] addr_list=[$a4]\n"
+
+l6="localhost"
+al6="::1"
+loc6="name=$l6, length=16, addrtype=24, aliases=[localhost. localhost.localdomain.] addr_list=[$al6]\n"
+
+l4="localhost"
+al4="127.0.0.1"
+loc4="name=$l4, length=4, addrtype=2, aliases=[localhost. localhost.localdomain.] addr_list=[$al4]\n"
+
+dir="$(atf_get_srcdir)"
+res="-r ${dir}/resolv.conf"
+
+# Hijack DNS traffic using a single rump server instance and a DNS
+# server listening on its loopback address.
+
+start_dns_server() {
+ export RUMP_SERVER=unix:///tmp/rumpserver
+ rump_server -lrumpdev -lrumpnet -lrumpnet_net -lrumpnet_netinet \
+ -lrumpnet_netinet6 -lrumpnet_local $RUMP_SERVER
+ HIJACK_DNS="LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK='socket=inet:inet6'"
+ eval $HIJACK_DNS ${dir}/h_dns_server $1
+}
+
+stop_dns_server() {
+ export RUMP_SERVER=unix:///tmp/rumpserver
+ kill $(cat dns_server_$1.pid)
+ rump.halt
+}
+
+atf_test_case gethostbyname4 cleanup
+gethostbyname4_head()
+{
+ atf_set "descr" "Checks gethostbyname2(3) for AF_INET (auto, as determined by nsswitch.conf(5)"
+}
+gethostbyname4_body()
+{
+ start_dns_server 4
+ atf_check -o inline:"$ans4" -x "$HIJACK_DNS ${dir}/h_hostent ${res} -t auto -4 $n4"
+}
+gethostbyname4_cleanup()
+{
+ stop_dns_server 4
+}
+
+atf_test_case gethostbyname6 cleanup cleanup
+gethostbyname6_head()
+{
+ atf_set "descr" "Checks gethostbyname2(3) for AF_INET6 (auto, as determined by nsswitch.conf(5)"
+}
+gethostbyname6_body()
+{
+ start_dns_server 4
+ atf_check -o inline:"$ans6" -x "$HIJACK_DNS ${dir}/h_hostent ${res} -t auto -6 $n6"
+}
+gethostbyname6_cleanup()
+{
+ stop_dns_server 4
+}
+
+atf_test_case gethostbyaddr4 cleanup
+gethostbyaddr4_head()
+{
+ atf_set "descr" "Checks gethostbyaddr(3) for AF_INET (auto, as determined by nsswitch.conf(5)"
+}
+gethostbyaddr4_body()
+{
+ start_dns_server 4
+ atf_check -o inline:"$ans4" -x "$HIJACK_DNS ${dir}/h_hostent ${res} -t auto -a $a4"
+}
+gethostbyaddr4_cleanup()
+{
+ stop_dns_server 4
+}
+
+atf_test_case gethostbyaddr6 cleanup
+gethostbyaddr6_head()
+{
+ atf_set "descr" "Checks gethostbyaddr(3) for AF_INET6 (auto, as determined by nsswitch.conf(5)"
+}
+gethostbyaddr6_body()
+{
+ start_dns_server 4
+ atf_check -o inline:"$ans6" -x "$HIJACK_DNS ${dir}/h_hostent ${res} -t auto -a $a6"
+}
+gethostbyaddr6_cleanup()
+{
+ stop_dns_server 4
+}
+
+atf_test_case hostsbynamelookup4
+hostsbynamelookup4_head()
+{
+ atf_set "descr" "Checks /etc/hosts name lookup for AF_INET"
+}
+hostsbynamelookup4_body()
+{
+ atf_check -o inline:"$loc4" -x "${dir}/h_hostent -f ${dir}/hosts -t file -4 $l4"
+}
+
+atf_test_case hostsbynamelookup6
+hostsbynamelookup6_head()
+{
+ atf_set "descr" "Checks /etc/hosts name lookup for AF_INET6"
+}
+hostsbynamelookup6_body()
+{
+ atf_check -o inline:"$loc6" -x "${dir}/h_hostent -f ${dir}/hosts -t file -6 $l6"
+}
+
+atf_test_case hostsbyaddrlookup4
+hostsbyaddrlookup4_head()
+{
+ atf_set "descr" "Checks /etc/hosts address lookup for AF_INET"
+}
+hostsbyaddrlookup4_body()
+{
+ atf_check -o inline:"$loc4" -x "${dir}/h_hostent -f ${dir}/hosts -t file -4 -a $al4"
+}
+
+atf_test_case hostsbyaddrlookup6
+hostsbyaddrlookup6_head()
+{
+ atf_set "descr" "Checks /etc/hosts address lookup for AF_INET6"
+}
+hostsbyaddrlookup6_body()
+{
+ atf_check -o inline:"$loc6" -x "${dir}/h_hostent -f ${dir}/hosts -t file -6 -a $al6"
+}
+
+atf_test_case dnsbynamelookup4 cleanup
+dnsbynamelookup4_head()
+{
+ atf_set "descr" "Checks DNS name lookup for AF_INET"
+}
+dnsbynamelookup4_body()
+{
+ start_dns_server 4
+ atf_check -o inline:"$ans4" -x "$HIJACK_DNS ${dir}/h_hostent ${res} -t dns -4 $n4"
+}
+dnsbynamelookup4_cleanup()
+{
+ stop_dns_server 4
+}
+
+atf_test_case dnsbynamelookup6 cleanup
+dnsbynamelookup6_head()
+{
+ atf_set "descr" "Checks DNS name lookup for AF_INET6"
+}
+dnsbynamelookup6_body()
+{
+ start_dns_server 4
+ atf_check -o inline:"$ans6" -x "$HIJACK_DNS ${dir}/h_hostent ${res} -t dns -6 $n6"
+}
+dnsbynamelookup6_cleanup()
+{
+ stop_dns_server 4
+}
+
+atf_test_case dnsbyaddrlookup4 cleanup
+dnsbyaddrlookup4_head()
+{
+ atf_set "descr" "Checks DNS address lookup for AF_INET"
+}
+dnsbyaddrlookup4_body()
+{
+ start_dns_server 4
+ atf_check -o inline:"$ans4" -x "$HIJACK_DNS ${dir}/h_hostent ${res} -t dns -4 -a $a4"
+}
+dnsbyaddrlookup4_cleanup()
+{
+ stop_dns_server 4
+}
+
+atf_test_case dnsbyaddrlookup6 cleanup
+dnsbyaddrlookup6_head()
+{
+ atf_set "descr" "Checks dns address lookup for AF_INET6"
+}
+dnsbyaddrlookup6_body()
+{
+ start_dns_server 4
+ atf_check -o inline:"$ans6" -x "$HIJACK_DNS ${dir}/h_hostent ${res} -t dns -6 -a $a6"
+}
+dnsbyaddrlookup6_cleanup()
+{
+ stop_dns_server 4
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case gethostbyname4
+ atf_add_test_case gethostbyname6
+ atf_add_test_case gethostbyaddr4
+ atf_add_test_case gethostbyaddr6
+
+ atf_add_test_case hostsbynamelookup4
+ atf_add_test_case hostsbynamelookup6
+ atf_add_test_case hostsbyaddrlookup4
+ atf_add_test_case hostsbyaddrlookup6
+
+ atf_add_test_case dnsbynamelookup4
+ atf_add_test_case dnsbynamelookup6
+ atf_add_test_case dnsbyaddrlookup4
+ atf_add_test_case dnsbyaddrlookup6
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/t_nsdispatch.sh b/contrib/netbsd-tests/lib/libc/net/t_nsdispatch.sh
new file mode 100755
index 0000000..b584369
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/t_nsdispatch.sh
@@ -0,0 +1,51 @@
+# $NetBSD: t_nsdispatch.sh,v 1.1 2011/01/13 01:56:44 pgoyette Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case recurse
+recurse_head()
+{
+ atf_set "descr" "Checks recursive calls to nsdispatch()" \
+ "within threaded program"
+}
+recurse_body()
+{
+ cat >exp <<EOF
+func1: enter
+func2: enter
+func3: enter
+func3: exit
+func2: exit
+func1: exit
+EOF
+
+ atf_check -o file:exp "$(atf_get_srcdir)/h_nsd_recurse"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case recurse
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/t_protoent.sh b/contrib/netbsd-tests/lib/libc/net/t_protoent.sh
new file mode 100755
index 0000000..322d426
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/t_protoent.sh
@@ -0,0 +1,91 @@
+# $NetBSD: t_protoent.sh,v 1.2 2012/09/03 15:32:18 christos Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case protoent
+protoent_head()
+{
+ atf_set "descr" "Checks {get,set,end}protoent(3)"
+}
+protoent_body()
+{
+ #
+ # Munge original to:
+ # (1) match output format of the test program
+ # (2) fold all names for the same port/proto together
+ # (3) prune duplicates
+ #
+ tr '\t' ' ' </etc/protocols | awk '
+ function add(key, name, i, n, ar) {
+ n = split(names[key], ar);
+ for (i = 1; i <= n; i++) {
+ if (name == ar[i]) {
+ return;
+ }
+ }
+ delete ar;
+ names[key] = names[key] " " name;
+ }
+ {
+ sub("#.*", "", $0);
+ gsub(" *", " ", $0);
+ if (NF == 0) {
+ next;
+ }
+ add($2, $1, 0);
+ for (i = 3; i <= NF; i++) {
+ add($2, $i, 1);
+ }
+ }
+ END {
+ for (key in names) {
+ proto = key;
+
+ n = split(names[key], ar);
+ printf "name=%s, proto=%s, aliases=", ar[1], proto;
+ for (i=2; i<=n; i++) {
+ if (i>2) {
+ printf " ";
+ }
+ printf "%s", ar[i];
+ }
+ printf "\n";
+ delete ar;
+ }
+ }
+ ' | sort >exp
+
+ # run test program
+ "$(atf_get_srcdir)/h_protoent" | sed 's/ *$//' | sort >out
+
+ diff -u exp out || \
+ atf_fail "Observed output does not match reference output"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case protoent
+}
diff --git a/contrib/netbsd-tests/lib/libc/net/t_servent.sh b/contrib/netbsd-tests/lib/libc/net/t_servent.sh
new file mode 100755
index 0000000..b9aa2b7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/net/t_servent.sh
@@ -0,0 +1,93 @@
+# $NetBSD: t_servent.sh,v 1.1 2011/01/12 17:32:27 pgoyette Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case servent
+servent_head()
+{
+ atf_set "descr" "Checks {get,set,end}servent(3)"
+}
+servent_body()
+{
+ #
+ # Munge original to:
+ # (1) match output format of the test program
+ # (2) fold all names for the same port/proto together
+ # (3) prune duplicates
+ #
+ tr '\t' ' ' </etc/services | awk '
+ function add(key, name, i, n, ar) {
+ n = split(names[key], ar);
+ for (i=1; i<=n; i++) {
+ if (name == ar[i]) {
+ return;
+ }
+ }
+ delete ar;
+ names[key] = names[key] " " name;
+ }
+
+ {
+ sub("#.*", "", $0);
+ gsub(" *", " ", $0);
+ if (NF==0) {
+ next;
+ }
+ add($2, $1, 0);
+ for (i=3; i<=NF; i++) {
+ add($2, $i, 1);
+ }
+ }
+ END {
+ for (key in names) {
+ portproto = key;
+ sub("/", ", proto=", portproto);
+ portproto = "port=" portproto;
+
+ n = split(names[key], ar);
+ printf "name=%s, %s, aliases=", ar[1], portproto;
+ for (i=2; i<=n; i++) {
+ if (i>2) {
+ printf " ";
+ }
+ printf "%s", ar[i];
+ }
+ printf "\n";
+ delete ar;
+ }
+ }
+ ' | sort >exp
+
+ # run test program
+ "$(atf_get_srcdir)/h_servent" | sed 's/ *$//' | sort >out
+
+ diff -u exp out || atf_fail "Observed output does not match reference output"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case servent
+}
diff --git a/contrib/netbsd-tests/lib/libc/regex/README b/contrib/netbsd-tests/lib/libc/regex/README
new file mode 100644
index 0000000..6d9a28c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/README
@@ -0,0 +1,33 @@
+regular expression test set
+Lines are at least three fields, separated by one or more tabs. "" stands
+for an empty field. First field is an RE. Second field is flags. If
+C flag given, regcomp() is expected to fail, and the third field is the
+error name (minus the leading REG_).
+
+Otherwise it is expected to succeed, and the third field is the string to
+try matching it against. If there is no fourth field, the match is
+expected to fail. If there is a fourth field, it is the substring that
+the RE is expected to match. If there is a fifth field, it is a comma-
+separated list of what the subexpressions should match, with - indicating
+no match for that one. In both the fourth and fifth fields, a (sub)field
+starting with @ indicates that the (sub)expression is expected to match
+a null string followed by the stuff after the @; this provides a way to
+test where null strings match. The character `N' in REs and strings
+is newline, `S' is space, `T' is tab, `Z' is NUL.
+
+The full list of flags:
+ - placeholder, does nothing
+ b RE is a BRE, not an ERE
+ & try it as both an ERE and a BRE
+ C regcomp() error expected, third field is error name
+ i REG_ICASE
+ m ("mundane") REG_NOSPEC
+ s REG_NOSUB (not really testable)
+ n REG_NEWLINE
+ ^ REG_NOTBOL
+ $ REG_NOTEOL
+ # REG_STARTEND (see below)
+ p REG_PEND
+
+For REG_STARTEND, the start/end offsets are those of the substring
+enclosed in ().
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/anchor.in b/contrib/netbsd-tests/lib/libc/regex/data/anchor.in
new file mode 100644
index 0000000..d145408
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/anchor.in
@@ -0,0 +1,33 @@
+# anchoring and REG_NEWLINE
+^abc$ & abc abc
+a^b - a^b
+a^b b a^b a^b
+a$b - a$b
+a$b b a$b a$b
+^ & abc @abc
+$ & abc @
+^$ & "" @
+$^ - "" @
+\($\)\(^\) b "" @
+# stop retching, those are legitimate (although disgusting)
+^^ - "" @
+$$ - "" @
+b$ & abNc
+b$ &n abNc b
+^b$ & aNbNc
+^b$ &n aNbNc b
+^$ &n aNNb @Nb
+^$ n abc
+^$ n abcN @
+$^ n aNNb @Nb
+\($\)\(^\) bn aNNb @Nb
+^^ n^ aNNb @Nb
+$$ n aNNb @NN
+^a ^ a
+a$ $ a
+^a ^n aNb
+^b ^n aNb b
+a$ $n bNa
+b$ $n bNa b
+a*(^b$)c* - b b
+a*\(^b$\)c* b b b
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/att/README b/contrib/netbsd-tests/lib/libc/regex/data/att/README
new file mode 100644
index 0000000..e2ee6f6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/att/README
@@ -0,0 +1,8 @@
+AT&T test data from: http://www2.research.att.com/~gsf/testregex/
+
+Quoting from the page:
+ testregex.c 2004-05-31 is the latest source for the AT&T Research
+ regression test harness for the X/Open regex pattern match interface.
+ See testregex(1) for option and test input details. The source and
+ test data posted here are license free.
+
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/att/basic.dat b/contrib/netbsd-tests/lib/libc/regex/data/att/basic.dat
new file mode 100644
index 0000000..4399ca1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/att/basic.dat
@@ -0,0 +1,216 @@
+NOTE all standard compliant implementations should pass these : 2002-05-31
+
+BE abracadabra$ abracadabracadabra (7,18)
+BE a...b abababbb (2,7)
+BE XXXXXX ..XXXXXX (2,8)
+E \) () (1,2)
+BE a] a]a (0,2)
+B } } (0,1)
+E \} } (0,1)
+BE \] ] (0,1)
+B ] ] (0,1)
+E ] ] (0,1)
+B { { (0,1)
+B } } (0,1)
+BE ^a ax (0,1)
+BE \^a a^a (1,3)
+BE a\^ a^ (0,2)
+BE a$ aa (1,2)
+BE a\$ a$ (0,2)
+BE ^$ NULL (0,0)
+E $^ NULL (0,0)
+E a($) aa (1,2)(2,2)
+E a*(^a) aa (0,1)(0,1)
+E (..)*(...)* a (0,0)
+E (..)*(...)* abcd (0,4)(2,4)
+E (ab|a)(bc|c) abc (0,3)(0,2)(2,3)
+E (ab)c|abc abc (0,3)(0,2)
+E a{0}b ab (1,2)
+E (a*)(b?)(b+)b{3} aaabbbbbbb (0,10)(0,3)(3,4)(4,7)
+E (a*)(b{0,1})(b{1,})b{3} aaabbbbbbb (0,10)(0,3)(3,4)(4,7)
+E a{9876543210} NULL BADBR
+E ((a|a)|a) a (0,1)(0,1)(0,1)
+E (a*)(a|aa) aaaa (0,4)(0,3)(3,4)
+E a*(a.|aa) aaaa (0,4)(2,4)
+E a(b)|c(d)|a(e)f aef (0,3)(?,?)(?,?)(1,2)
+E (a|b)?.* b (0,1)(0,1)
+E (a|b)c|a(b|c) ac (0,2)(0,1)
+E (a|b)c|a(b|c) ab (0,2)(?,?)(1,2)
+E (a|b)*c|(a|ab)*c abc (0,3)(1,2)
+E (a|b)*c|(a|ab)*c xc (1,2)
+E (.a|.b).*|.*(.a|.b) xa (0,2)(0,2)
+E a?(ab|ba)ab abab (0,4)(0,2)
+E a?(ac{0}b|ba)ab abab (0,4)(0,2)
+E ab|abab abbabab (0,2)
+E aba|bab|bba baaabbbaba (5,8)
+E aba|bab baaabbbaba (6,9)
+E (aa|aaa)*|(a|aaaaa) aa (0,2)(0,2)
+E (a.|.a.)*|(a|.a...) aa (0,2)(0,2)
+E ab|a xabc (1,3)
+E ab|a xxabc (2,4)
+Ei (Ab|cD)* aBcD (0,4)(2,4)
+BE [^-] --a (2,3)
+BE [a-]* --a (0,3)
+BE [a-m-]* --amoma-- (0,4)
+E :::1:::0:|:::1:1:0: :::0:::1:::1:::0: (8,17)
+E :::1:::0:|:::1:1:1: :::0:::1:::1:::0: (8,17)
+{E [[:upper:]] A (0,1) [[<element>]] not supported
+E [[:lower:]]+ `az{ (1,3)
+E [[:upper:]]+ @AZ[ (1,3)
+BE [[-]] [[-]] (2,4)
+BE [[.NIL.]] NULL ECOLLATE
+BE [[=aleph=]] NULL ECOLLATE
+}
+BE$ \n \n (0,1)
+BEn$ \n \n (0,1)
+BE$ [^a] \n (0,1)
+BE$ \na \na (0,2)
+E (a)(b)(c) abc (0,3)(0,1)(1,2)(2,3)
+BE xxx xxx (0,3)
+E1 (^|[ (,;])((([Ff]eb[^ ]* *|0*2/|\* */?)0*[6-7]))([^0-9]|$) feb 6, (0,6)
+E1 (^|[ (,;])((([Ff]eb[^ ]* *|0*2/|\* */?)0*[6-7]))([^0-9]|$) 2/7 (0,3)
+E1 (^|[ (,;])((([Ff]eb[^ ]* *|0*2/|\* */?)0*[6-7]))([^0-9]|$) feb 1,Feb 6 (5,11)
+E3 ((((((((((((((((((((((((((((((x)))))))))))))))))))))))))))))) x (0,1)(0,1)(0,1)
+E3 ((((((((((((((((((((((((((((((x))))))))))))))))))))))))))))))* xx (0,2)(1,2)(1,2)
+E a?(ab|ba)* ababababababababababababababababababababababababababababababababababababababababa (0,81)(79,81)
+E abaa|abbaa|abbbaa|abbbbaa ababbabbbabbbabbbbabbbbaa (18,25)
+E abaa|abbaa|abbbaa|abbbbaa ababbabbbabbbabbbbabaa (18,22)
+E aaac|aabc|abac|abbc|baac|babc|bbac|bbbc baaabbbabac (7,11)
+BE$ .* \x01\xff (0,2)
+E aaaa|bbbb|cccc|ddddd|eeeeee|fffffff|gggg|hhhh|iiiii|jjjjj|kkkkk|llll XaaaXbbbXcccXdddXeeeXfffXgggXhhhXiiiXjjjXkkkXlllXcbaXaaaa (53,57)
+L aaaa\nbbbb\ncccc\nddddd\neeeeee\nfffffff\ngggg\nhhhh\niiiii\njjjjj\nkkkkk\nllll XaaaXbbbXcccXdddXeeeXfffXgggXhhhXiiiXjjjXkkkXlllXcbaXaaaa NOMATCH
+E a*a*a*a*a*b aaaaaaaaab (0,10)
+BE ^ NULL (0,0)
+BE $ NULL (0,0)
+BE ^$ NULL (0,0)
+BE ^a$ a (0,1)
+BE abc abc (0,3)
+BE abc xabcy (1,4)
+BE abc ababc (2,5)
+BE ab*c abc (0,3)
+BE ab*bc abc (0,3)
+BE ab*bc abbc (0,4)
+BE ab*bc abbbbc (0,6)
+E ab+bc abbc (0,4)
+E ab+bc abbbbc (0,6)
+E ab?bc abbc (0,4)
+E ab?bc abc (0,3)
+E ab?c abc (0,3)
+BE ^abc$ abc (0,3)
+BE ^abc abcc (0,3)
+BE abc$ aabc (1,4)
+BE ^ abc (0,0)
+BE $ abc (3,3)
+BE a.c abc (0,3)
+BE a.c axc (0,3)
+BE a.*c axyzc (0,5)
+BE a[bc]d abd (0,3)
+BE a[b-d]e ace (0,3)
+BE a[b-d] aac (1,3)
+BE a[-b] a- (0,2)
+BE a[b-] a- (0,2)
+BE a] a] (0,2)
+BE a[]]b a]b (0,3)
+BE a[^bc]d aed (0,3)
+BE a[^-b]c adc (0,3)
+BE a[^]b]c adc (0,3)
+E ab|cd abc (0,2)
+E ab|cd abcd (0,2)
+E a\(b a(b (0,3)
+E a\(*b ab (0,2)
+E a\(*b a((b (0,4)
+E ((a)) abc (0,1)(0,1)(0,1)
+E (a)b(c) abc (0,3)(0,1)(2,3)
+E a+b+c aabbabc (4,7)
+E a* aaa (0,3)
+E (a*)* - (0,0)(0,0)
+E (a*)+ - (0,0)(0,0)
+E (a*|b)* - (0,0)(0,0)
+E (a+|b)* ab (0,2)(1,2)
+E (a+|b)+ ab (0,2)(1,2)
+E (a+|b)? ab (0,1)(0,1)
+BE [^ab]* cde (0,3)
+E (^)* - (0,0)(0,0)
+BE a* NULL (0,0)
+E ([abc])*d abbbcd (0,6)(4,5)
+E ([abc])*bcd abcd (0,4)(0,1)
+E a|b|c|d|e e (0,1)
+E (a|b|c|d|e)f ef (0,2)(0,1)
+E ((a*|b))* - (0,0)(0,0)(0,0)
+BE abcd*efg abcdefg (0,7)
+BE ab* xabyabbbz (1,3)
+BE ab* xayabbbz (1,2)
+E (ab|cd)e abcde (2,5)(2,4)
+BE [abhgefdc]ij hij (0,3)
+E (a|b)c*d abcd (1,4)(1,2)
+E (ab|ab*)bc abc (0,3)(0,1)
+E a([bc]*)c* abc (0,3)(1,3)
+E a([bc]*)(c*d) abcd (0,4)(1,3)(3,4)
+E a([bc]+)(c*d) abcd (0,4)(1,3)(3,4)
+E a([bc]*)(c+d) abcd (0,4)(1,2)(2,4)
+E a[bcd]*dcdcde adcdcde (0,7)
+E (ab|a)b*c abc (0,3)(0,2)
+E ((a)(b)c)(d) abcd (0,4)(0,3)(0,1)(1,2)(3,4)
+BE [A-Za-z_][A-Za-z0-9_]* alpha (0,5)
+E ^a(bc+|b[eh])g|.h$ abh (1,3)
+E (bc+d$|ef*g.|h?i(j|k)) effgz (0,5)(0,5)
+E (bc+d$|ef*g.|h?i(j|k)) ij (0,2)(0,2)(1,2)
+E (bc+d$|ef*g.|h?i(j|k)) reffgz (1,6)(1,6)
+E (((((((((a))))))))) a (0,1)(0,1)(0,1)(0,1)(0,1)(0,1)(0,1)(0,1)(0,1)(0,1)
+BE multiple words multiple words yeah (0,14)
+E (.*)c(.*) abcde (0,5)(0,2)(3,5)
+BE abcd abcd (0,4)
+E a(bc)d abcd (0,4)(1,3)
+E a[-]?c ac (0,3)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Qaddafi (0,15)(?,?)(10,12)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Mo'ammar Gadhafi (0,16)(?,?)(11,13)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Kaddafi (0,15)(?,?)(10,12)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Qadhafi (0,15)(?,?)(10,12)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Gadafi (0,14)(?,?)(10,11)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Mu'ammar Qadafi (0,15)(?,?)(11,12)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Moamar Gaddafi (0,14)(?,?)(9,11)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Mu'ammar Qadhdhafi (0,18)(?,?)(13,15)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Khaddafi (0,16)(?,?)(11,13)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Ghaddafy (0,16)(?,?)(11,13)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Ghadafi (0,15)(?,?)(11,12)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Ghaddafi (0,16)(?,?)(11,13)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muamar Kaddafi (0,14)(?,?)(9,11)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Quathafi (0,16)(?,?)(11,13)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Muammar Gheddafi (0,16)(?,?)(11,13)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Moammar Khadafy (0,15)(?,?)(11,12)
+E M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] Moammar Qudhafi (0,15)(?,?)(10,12)
+E a+(b|c)*d+ aabcdd (0,6)(3,4)
+E ^.+$ vivi (0,4)
+E ^(.+)$ vivi (0,4)(0,4)
+E ^([^!.]+).att.com!(.+)$ gryphon.att.com!eby (0,19)(0,7)(16,19)
+E ^([^!]+!)?([^!]+)$ bas (0,3)(?,?)(0,3)
+E ^([^!]+!)?([^!]+)$ bar!bas (0,7)(0,4)(4,7)
+E ^([^!]+!)?([^!]+)$ foo!bas (0,7)(0,4)(4,7)
+E ^.+!([^!]+!)([^!]+)$ foo!bar!bas (0,11)(4,8)(8,11)
+E ((foo)|(bar))!bas bar!bas (0,7)(0,3)(?,?)(0,3)
+E ((foo)|(bar))!bas foo!bar!bas (4,11)(4,7)(?,?)(4,7)
+E ((foo)|(bar))!bas foo!bas (0,7)(0,3)(0,3)
+E ((foo)|bar)!bas bar!bas (0,7)(0,3)
+E ((foo)|bar)!bas foo!bar!bas (4,11)(4,7)
+E ((foo)|bar)!bas foo!bas (0,7)(0,3)(0,3)
+E (foo|(bar))!bas bar!bas (0,7)(0,3)(0,3)
+E (foo|(bar))!bas foo!bar!bas (4,11)(4,7)(4,7)
+E (foo|(bar))!bas foo!bas (0,7)(0,3)
+E (foo|bar)!bas bar!bas (0,7)(0,3)
+E (foo|bar)!bas foo!bar!bas (4,11)(4,7)
+E (foo|bar)!bas foo!bas (0,7)(0,3)
+E ^(([^!]+!)?([^!]+)|.+!([^!]+!)([^!]+))$ foo!bar!bas (0,11)(0,11)(?,?)(?,?)(4,8)(8,11)
+E ^([^!]+!)?([^!]+)$|^.+!([^!]+!)([^!]+)$ bas (0,3)(?,?)(0,3)
+E ^([^!]+!)?([^!]+)$|^.+!([^!]+!)([^!]+)$ bar!bas (0,7)(0,4)(4,7)
+E ^([^!]+!)?([^!]+)$|^.+!([^!]+!)([^!]+)$ foo!bar!bas (0,11)(?,?)(?,?)(4,8)(8,11)
+E ^([^!]+!)?([^!]+)$|^.+!([^!]+!)([^!]+)$ foo!bas (0,7)(0,4)(4,7)
+E ^(([^!]+!)?([^!]+)|.+!([^!]+!)([^!]+))$ bas (0,3)(0,3)(?,?)(0,3)
+E ^(([^!]+!)?([^!]+)|.+!([^!]+!)([^!]+))$ bar!bas (0,7)(0,7)(0,4)(4,7)
+E ^(([^!]+!)?([^!]+)|.+!([^!]+!)([^!]+))$ foo!bar!bas (0,11)(0,11)(?,?)(?,?)(4,8)(8,11)
+E ^(([^!]+!)?([^!]+)|.+!([^!]+!)([^!]+))$ foo!bas (0,7)(0,7)(0,4)(4,7)
+E .*(/XXX).* /XXX (0,4)(0,4)
+E .*(\\XXX).* \XXX (0,4)(0,4)
+E \\XXX \XXX (0,4)
+E .*(/000).* /000 (0,4)(0,4)
+E .*(\\000).* \000 (0,4)(0,4)
+E \\000 \000 (0,4)
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/att/categorization.dat b/contrib/netbsd-tests/lib/libc/regex/data/att/categorization.dat
new file mode 100644
index 0000000..d348512
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/att/categorization.dat
@@ -0,0 +1,62 @@
+NOTE regex implementation categorization 2004-05-31
+
+?E aa* xaxaax (1,2) POSITION=leftmost
+; POSITION=bug
+
+?E (a*)(ab)*(b*) abc (0,2)(0,1)(?,?)(1,2) ASSOCIATIVITY=right
+|E (a*)(ab)*(b*) abc (0,2)(0,0)(0,2)(2,2) ASSOCIATIVITY=left
+; ASSOCIATIVITY=bug
+
+?E ((a*)(ab)*)((b*)(a*)) aba (0,3)(0,2)(0,0)(0,2)(2,3)(2,2)(2,3) SUBEXPRESSION=precedence
+|E ((a*)(ab)*)((b*)(a*)) aba (0,3)(0,1)(0,1)(?,?)(1,3)(1,2)(2,3) SUBEXPRESSION=grouping
+; SUBEXPRESSION=bug
+
+?E (...?.?)* xxxxxx (0,6)(4,6) REPEAT_LONGEST=first
+|E (...?.?)* xxxxxx (0,6)(2,6) REPEAT_LONGEST=last
+|E (...?.?)* xxxxxx OK REPEAT_LONGEST=unknown
+; REPEAT_LONGEST=bug
+
+?E (a|ab)(bc|c) abcabc (0,3)(0,2)(2,3) EXPECTED
+|E (a|ab)(bc|c) abcabc (0,3)(0,1)(1,3) BUG=alternation-order
+; BUG=alternation-order-UNKNOWN
+
+?E (aba|a*b)(aba|a*b) ababa (0,5)(0,2)(2,5) EXPECTED
+|E (aba|a*b)(aba|a*b) ababa (0,4)(0,3)(3,4) BUG=first-match
+; BUG=unknown-match
+
+?B a\(b\)*\1 a NOMATCH EXPECTED
+|B a\(b\)*\1 a (0,1) BUG=nomatch-match
+|B a\(b\)*\1 abab (0,2)(1,2) # BUG=repeat-any
+; BUG=nomatch-match-UNKNOWN
+
+?E (a*){2} xxxxx (0,0)(0,0) EXPECTED
+|E (a*){2} xxxxx (5,5)(5,5) BUG=range-null
+; BUG=range-null-UNKNOWN
+
+?B a\(b\)*\1 abab NOMATCH EXPECTED
+|B a\(b\)*\1 abab (0,1) # BUG=nomatch-match
+|B a\(b\)*\1 abab (0,2)(1,2) BUG=repeat-any
+; BUG=repeat-any-UNKNOWN
+
+?E (a*)* a (0,1)(0,1) EXPECTED
+|E (a*)* ax (0,1)(0,1) BUG=repeat-null-unknown
+|E (a*)* a (0,1)(1,1) BUG=repeat-null
+; BUG=repeat-null-UNKNOWN
+
+?E (aba|a*b)* ababa (0,5)(2,5) EXPECTED
+|E (aba|a*b)* ababa (0,5)(3,4) BUG=repeat-short
+|E (aba|a*b)* ababa (0,4)(3,4) # LENGTH=first
+; BUG=repeat-short-UNKNOWN
+
+?E (a(b)?)+ aba (0,3)(2,3) EXPECTED
+|E (a(b)?)+ aba (0,3)(2,3)(1,2) BUG=repeat-artifact
+; BUG=repeat-artifact-UNKNOWN
+
+?B \(a\(b\)*\)*\2 abab NOMATCH EXPECTED
+|B \(a\(b\)*\)*\2 abab (0,4)(2,3)(1,2) BUG=repeat-artifact-nomatch
+; BUG=repeat-artifact-nomatch-UNKNOWN
+
+?E (a?)((ab)?)(b?)a?(ab)?b? abab (0,4)(0,1)(1,1)(?,?)(1,2)(2,4) BUG=subexpression-first
+|E .*(.*) ab (0,2)(2,2) EXPECTED
+|E .*(.*) ab (0,2)(0,2) BUG=subexpression-first
+; BUG=subexpression-first-UNKNOWN
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/att/forcedassoc.dat b/contrib/netbsd-tests/lib/libc/regex/data/att/forcedassoc.dat
new file mode 100644
index 0000000..39f3111
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/att/forcedassoc.dat
@@ -0,0 +1,30 @@
+NOTE left-assoc:pass-all right-assoc:pass-all : 2002-04-29
+
+E (a|ab)(c|bcd) abcd (0,4)(0,1)(1,4)
+E (a|ab)(bcd|c) abcd (0,4)(0,1)(1,4)
+E (ab|a)(c|bcd) abcd (0,4)(0,1)(1,4)
+E (ab|a)(bcd|c) abcd (0,4)(0,1)(1,4)
+E ((a|ab)(c|bcd))(d*) abcd (0,4)(0,4)(0,1)(1,4)(4,4)
+E ((a|ab)(bcd|c))(d*) abcd (0,4)(0,4)(0,1)(1,4)(4,4)
+E ((ab|a)(c|bcd))(d*) abcd (0,4)(0,4)(0,1)(1,4)(4,4)
+E ((ab|a)(bcd|c))(d*) abcd (0,4)(0,4)(0,1)(1,4)(4,4)
+E (a|ab)((c|bcd)(d*)) abcd (0,4)(0,2)(2,4)(2,3)(3,4)
+E (a|ab)((bcd|c)(d*)) abcd (0,4)(0,2)(2,4)(2,3)(3,4)
+E (ab|a)((c|bcd)(d*)) abcd (0,4)(0,2)(2,4)(2,3)(3,4)
+E (ab|a)((bcd|c)(d*)) abcd (0,4)(0,2)(2,4)(2,3)(3,4)
+E (a*)(b|abc) abc (0,3)(0,0)(0,3)
+E (a*)(abc|b) abc (0,3)(0,0)(0,3)
+E ((a*)(b|abc))(c*) abc (0,3)(0,3)(0,0)(0,3)(3,3)
+E ((a*)(abc|b))(c*) abc (0,3)(0,3)(0,0)(0,3)(3,3)
+E (a*)((b|abc)(c*)) abc (0,3)(0,1)(1,3)(1,2)(2,3)
+E (a*)((abc|b)(c*)) abc (0,3)(0,1)(1,3)(1,2)(2,3)
+E (a*)(b|abc) abc (0,3)(0,0)(0,3)
+E (a*)(abc|b) abc (0,3)(0,0)(0,3)
+E ((a*)(b|abc))(c*) abc (0,3)(0,3)(0,0)(0,3)(3,3)
+E ((a*)(abc|b))(c*) abc (0,3)(0,3)(0,0)(0,3)(3,3)
+E (a*)((b|abc)(c*)) abc (0,3)(0,1)(1,3)(1,2)(2,3)
+E (a*)((abc|b)(c*)) abc (0,3)(0,1)(1,3)(1,2)(2,3)
+E (a|ab) ab (0,2)(0,2)
+E (ab|a) ab (0,2)(0,2)
+E (a|ab)(b*) ab (0,2)(0,2)(2,2)
+E (ab|a)(b*) ab (0,2)(0,2)(2,2)
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/att/leftassoc.dat b/contrib/netbsd-tests/lib/libc/regex/data/att/leftassoc.dat
new file mode 100644
index 0000000..9c068c6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/att/leftassoc.dat
@@ -0,0 +1,16 @@
+NOTE left-assoc:pass-all right-assoc:pass-none : 2002-04-29
+
+E (a|ab)(c|bcd)(d*) abcd (0,4)(0,1)(1,4)(4,4)
+E (a|ab)(bcd|c)(d*) abcd (0,4)(0,1)(1,4)(4,4)
+E (ab|a)(c|bcd)(d*) abcd (0,4)(0,1)(1,4)(4,4)
+E (ab|a)(bcd|c)(d*) abcd (0,4)(0,1)(1,4)(4,4)
+
+E (a*)(b|abc)(c*) abc (0,3)(0,0)(0,3)(3,3)
+E (a*)(abc|b)(c*) abc (0,3)(0,0)(0,3)(3,3)
+E (a*)(b|abc)(c*) abc (0,3)(0,0)(0,3)(3,3)
+E (a*)(abc|b)(c*) abc (0,3)(0,0)(0,3)(3,3)
+
+E (a|ab)(c|bcd)(d|.*) abcd (0,4)(0,1)(1,4)(4,4)
+E (a|ab)(bcd|c)(d|.*) abcd (0,4)(0,1)(1,4)(4,4)
+E (ab|a)(c|bcd)(d|.*) abcd (0,4)(0,1)(1,4)(4,4)
+E (ab|a)(bcd|c)(d|.*) abcd (0,4)(0,1)(1,4)(4,4)
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/att/nullsubexpr.dat b/contrib/netbsd-tests/lib/libc/regex/data/att/nullsubexpr.dat
new file mode 100644
index 0000000..c73d8f0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/att/nullsubexpr.dat
@@ -0,0 +1,73 @@
+NOTE null subexpression matches : 2002-06-06
+
+E (a*)* a (0,1)(0,1)
+E SAME x (0,0)(0,0)
+E SAME aaaaaa (0,6)(0,6)
+E SAME aaaaaax (0,6)(0,6)
+E (a*)+ a (0,1)(0,1)
+E SAME x (0,0)(0,0)
+E SAME aaaaaa (0,6)(0,6)
+E SAME aaaaaax (0,6)(0,6)
+E (a+)* a (0,1)(0,1)
+E SAME x (0,0)
+E SAME aaaaaa (0,6)(0,6)
+E SAME aaaaaax (0,6)(0,6)
+E (a+)+ a (0,1)(0,1)
+E SAME x NOMATCH
+E SAME aaaaaa (0,6)(0,6)
+E SAME aaaaaax (0,6)(0,6)
+
+E ([a]*)* a (0,1)(0,1)
+E SAME x (0,0)(0,0)
+E SAME aaaaaa (0,6)(0,6)
+E SAME aaaaaax (0,6)(0,6)
+E ([a]*)+ a (0,1)(0,1)
+E SAME x (0,0)(0,0)
+E SAME aaaaaa (0,6)(0,6)
+E SAME aaaaaax (0,6)(0,6)
+E ([^b]*)* a (0,1)(0,1)
+E SAME b (0,0)(0,0)
+E SAME aaaaaa (0,6)(0,6)
+E SAME aaaaaab (0,6)(0,6)
+E ([ab]*)* a (0,1)(0,1)
+E SAME aaaaaa (0,6)(0,6)
+E SAME ababab (0,6)(0,6)
+E SAME bababa (0,6)(0,6)
+E SAME b (0,1)(0,1)
+E SAME bbbbbb (0,6)(0,6)
+E SAME aaaabcde (0,5)(0,5)
+E ([^a]*)* b (0,1)(0,1)
+E SAME bbbbbb (0,6)(0,6)
+E SAME aaaaaa (0,0)(0,0)
+E ([^ab]*)* ccccxx (0,6)(0,6)
+E SAME ababab (0,0)(0,0)
+
+E ((z)+|a)* zabcde (0,2)(1,2)
+
+{E a+? aaaaaa (0,1) no *? +? mimimal match ops
+E (a) aaa (0,1)(0,1)
+E (a*?) aaa (0,0)(0,0)
+E (a)*? aaa (0,0)
+E (a*?)*? aaa (0,0)
+}
+
+B \(a*\)*\(x\) x (0,1)(0,0)(0,1)
+B \(a*\)*\(x\) ax (0,2)(0,1)(1,2)
+B \(a*\)*\(x\) axa (0,2)(0,1)(1,2)
+B \(a*\)*\(x\)\(\1\) x (0,1)(0,0)(0,1)(1,1)
+B \(a*\)*\(x\)\(\1\) ax (0,2)(1,1)(1,2)(2,2)
+B \(a*\)*\(x\)\(\1\) axa (0,3)(0,1)(1,2)(2,3)
+B \(a*\)*\(x\)\(\1\)\(x\) axax (0,4)(0,1)(1,2)(2,3)(3,4)
+B \(a*\)*\(x\)\(\1\)\(x\) axxa (0,3)(1,1)(1,2)(2,2)(2,3)
+
+E (a*)*(x) x (0,1)(0,0)(0,1)
+E (a*)*(x) ax (0,2)(0,1)(1,2)
+E (a*)*(x) axa (0,2)(0,1)(1,2)
+
+E (a*)+(x) x (0,1)(0,0)(0,1)
+E (a*)+(x) ax (0,2)(0,1)(1,2)
+E (a*)+(x) axa (0,2)(0,1)(1,2)
+
+E (a*){2}(x) x (0,1)(0,0)(0,1)
+E (a*){2}(x) ax (0,2)(1,1)(1,2)
+E (a*){2}(x) axa (0,2)(1,1)(1,2)
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/att/repetition.dat b/contrib/netbsd-tests/lib/libc/regex/data/att/repetition.dat
new file mode 100644
index 0000000..c24749c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/att/repetition.dat
@@ -0,0 +1,140 @@
+NOTE implicit vs. explicit repetitions : 2009-02-02
+
+# Glenn Fowler <gsf@research.att.com>
+# conforming matches (column 4) must match one of the following BREs
+# NOMATCH
+# (0,.)\((\(.\),\(.\))(?,?)(\2,\3)\)*
+# (0,.)\((\(.\),\(.\))(\2,\3)(?,?)\)*
+# i.e., each 3-tuple has two identical elements and one (?,?)
+
+E ((..)|(.)) NULL NOMATCH
+E ((..)|(.))((..)|(.)) NULL NOMATCH
+E ((..)|(.))((..)|(.))((..)|(.)) NULL NOMATCH
+
+E ((..)|(.)){1} NULL NOMATCH
+E ((..)|(.)){2} NULL NOMATCH
+E ((..)|(.)){3} NULL NOMATCH
+
+E ((..)|(.))* NULL (0,0)
+
+E ((..)|(.)) a (0,1)(0,1)(?,?)(0,1)
+E ((..)|(.))((..)|(.)) a NOMATCH
+E ((..)|(.))((..)|(.))((..)|(.)) a NOMATCH
+
+E ((..)|(.)){1} a (0,1)(0,1)(?,?)(0,1)
+E ((..)|(.)){2} a NOMATCH
+E ((..)|(.)){3} a NOMATCH
+
+E ((..)|(.))* a (0,1)(0,1)(?,?)(0,1)
+
+E ((..)|(.)) aa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.))((..)|(.)) aa (0,2)(0,1)(?,?)(0,1)(1,2)(?,?)(1,2)
+E ((..)|(.))((..)|(.))((..)|(.)) aa NOMATCH
+
+E ((..)|(.)){1} aa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.)){2} aa (0,2)(1,2)(?,?)(1,2)
+E ((..)|(.)){3} aa NOMATCH
+
+E ((..)|(.))* aa (0,2)(0,2)(0,2)(?,?)
+
+E ((..)|(.)) aaa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.))((..)|(.)) aaa (0,3)(0,2)(0,2)(?,?)(2,3)(?,?)(2,3)
+E ((..)|(.))((..)|(.))((..)|(.)) aaa (0,3)(0,1)(?,?)(0,1)(1,2)(?,?)(1,2)(2,3)(?,?)(2,3)
+
+E ((..)|(.)){1} aaa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.)){2} aaa (0,3)(2,3)(?,?)(2,3)
+E ((..)|(.)){3} aaa (0,3)(2,3)(?,?)(2,3)
+
+E ((..)|(.))* aaa (0,3)(2,3)(?,?)(2,3)
+
+E ((..)|(.)) aaaa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.))((..)|(.)) aaaa (0,4)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)
+E ((..)|(.))((..)|(.))((..)|(.)) aaaa (0,4)(0,2)(0,2)(?,?)(2,3)(?,?)(2,3)(3,4)(?,?)(3,4)
+
+E ((..)|(.)){1} aaaa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.)){2} aaaa (0,4)(2,4)(2,4)(?,?)
+E ((..)|(.)){3} aaaa (0,4)(3,4)(?,?)(3,4)
+
+E ((..)|(.))* aaaa (0,4)(2,4)(2,4)(?,?)
+
+E ((..)|(.)) aaaaa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.))((..)|(.)) aaaaa (0,4)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)
+E ((..)|(.))((..)|(.))((..)|(.)) aaaaa (0,5)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)(4,5)(?,?)(4,5)
+
+E ((..)|(.)){1} aaaaa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.)){2} aaaaa (0,4)(2,4)(2,4)(?,?)
+E ((..)|(.)){3} aaaaa (0,5)(4,5)(?,?)(4,5)
+
+E ((..)|(.))* aaaaa (0,5)(4,5)(?,?)(4,5)
+
+E ((..)|(.)) aaaaaa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.))((..)|(.)) aaaaaa (0,4)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)
+E ((..)|(.))((..)|(.))((..)|(.)) aaaaaa (0,6)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)(4,6)(4,6)(?,?)
+
+E ((..)|(.)){1} aaaaaa (0,2)(0,2)(0,2)(?,?)
+E ((..)|(.)){2} aaaaaa (0,4)(2,4)(2,4)(?,?)
+E ((..)|(.)){3} aaaaaa (0,6)(4,6)(4,6)(?,?)
+
+E ((..)|(.))* aaaaaa (0,6)(4,6)(4,6)(?,?)
+
+NOTE additional repetition tests graciously provided by Chris Kuklewicz www.haskell.org 2009-02-02
+
+# These test a bug in OS X / FreeBSD / NetBSD, and libtree.
+# Linux/GLIBC gets the {8,} and {8,8} wrong.
+
+:HA#100:E X(.?){0,}Y X1234567Y (0,9)(7,8)
+:HA#101:E X(.?){1,}Y X1234567Y (0,9)(7,8)
+:HA#102:E X(.?){2,}Y X1234567Y (0,9)(7,8)
+:HA#103:E X(.?){3,}Y X1234567Y (0,9)(7,8)
+:HA#104:E X(.?){4,}Y X1234567Y (0,9)(7,8)
+:HA#105:E X(.?){5,}Y X1234567Y (0,9)(7,8)
+:HA#106:E X(.?){6,}Y X1234567Y (0,9)(7,8)
+:HA#107:E X(.?){7,}Y X1234567Y (0,9)(7,8)
+:HA#108:E X(.?){8,}Y X1234567Y (0,9)(8,8)
+:HA#110:E X(.?){0,8}Y X1234567Y (0,9)(7,8)
+:HA#111:E X(.?){1,8}Y X1234567Y (0,9)(7,8)
+:HA#112:E X(.?){2,8}Y X1234567Y (0,9)(7,8)
+:HA#113:E X(.?){3,8}Y X1234567Y (0,9)(7,8)
+:HA#114:E X(.?){4,8}Y X1234567Y (0,9)(7,8)
+:HA#115:E X(.?){5,8}Y X1234567Y (0,9)(7,8)
+:HA#116:E X(.?){6,8}Y X1234567Y (0,9)(7,8)
+:HA#117:E X(.?){7,8}Y X1234567Y (0,9)(7,8)
+:HA#118:E X(.?){8,8}Y X1234567Y (0,9)(8,8)
+
+# These test a fixed bug in my regex-tdfa that did not keep the expanded
+# form properly grouped, so right association did the wrong thing with
+# these ambiguous patterns (crafted just to test my code when I became
+# suspicious of my implementation). The first subexpression should use
+# "ab" then "a" then "bcd".
+
+# OS X / FreeBSD / NetBSD badly fail many of these, with impossible
+# results like (0,6)(4,5)(6,6).
+
+:HA#260:E (a|ab|c|bcd){0,}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#261:E (a|ab|c|bcd){1,}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#262:E (a|ab|c|bcd){2,}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#263:E (a|ab|c|bcd){3,}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#264:E (a|ab|c|bcd){4,}(d*) ababcd NOMATCH
+:HA#265:E (a|ab|c|bcd){0,10}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#266:E (a|ab|c|bcd){1,10}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#267:E (a|ab|c|bcd){2,10}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#268:E (a|ab|c|bcd){3,10}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#269:E (a|ab|c|bcd){4,10}(d*) ababcd NOMATCH
+:HA#270:E (a|ab|c|bcd)*(d*) ababcd (0,6)(3,6)(6,6)
+:HA#271:E (a|ab|c|bcd)+(d*) ababcd (0,6)(3,6)(6,6)
+
+# The above worked on Linux/GLIBC but the following often fail.
+# They also trip up OS X / FreeBSD / NetBSD:
+
+:HA#280:E (ab|a|c|bcd){0,}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#281:E (ab|a|c|bcd){1,}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#282:E (ab|a|c|bcd){2,}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#283:E (ab|a|c|bcd){3,}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#284:E (ab|a|c|bcd){4,}(d*) ababcd NOMATCH
+:HA#285:E (ab|a|c|bcd){0,10}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#286:E (ab|a|c|bcd){1,10}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#287:E (ab|a|c|bcd){2,10}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#288:E (ab|a|c|bcd){3,10}(d*) ababcd (0,6)(3,6)(6,6)
+:HA#289:E (ab|a|c|bcd){4,10}(d*) ababcd NOMATCH
+:HA#290:E (ab|a|c|bcd)*(d*) ababcd (0,6)(3,6)(6,6)
+:HA#291:E (ab|a|c|bcd)+(d*) ababcd (0,6)(3,6)(6,6)
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/att/rightassoc.dat b/contrib/netbsd-tests/lib/libc/regex/data/att/rightassoc.dat
new file mode 100644
index 0000000..ed7f28e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/att/rightassoc.dat
@@ -0,0 +1,16 @@
+NOTE left-assoc:pass-none right-assoc:pass-all : 2002-04-29
+
+E (a|ab)(c|bcd)(d*) abcd (0,4)(0,2)(2,3)(3,4)
+E (a|ab)(bcd|c)(d*) abcd (0,4)(0,2)(2,3)(3,4)
+E (ab|a)(c|bcd)(d*) abcd (0,4)(0,2)(2,3)(3,4)
+E (ab|a)(bcd|c)(d*) abcd (0,4)(0,2)(2,3)(3,4)
+
+E (a*)(b|abc)(c*) abc (0,3)(0,1)(1,2)(2,3)
+E (a*)(abc|b)(c*) abc (0,3)(0,1)(1,2)(2,3)
+E (a*)(b|abc)(c*) abc (0,3)(0,1)(1,2)(2,3)
+E (a*)(abc|b)(c*) abc (0,3)(0,1)(1,2)(2,3)
+
+E (a|ab)(c|bcd)(d|.*) abcd (0,4)(0,2)(2,3)(3,4)
+E (a|ab)(bcd|c)(d|.*) abcd (0,4)(0,2)(2,3)(3,4)
+E (ab|a)(c|bcd)(d|.*) abcd (0,4)(0,2)(2,3)(3,4)
+E (ab|a)(bcd|c)(d|.*) abcd (0,4)(0,2)(2,3)(3,4)
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/backref.in b/contrib/netbsd-tests/lib/libc/regex/data/backref.in
new file mode 100644
index 0000000..cc59b06
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/backref.in
@@ -0,0 +1,21 @@
+# back references, ugh
+a\(b\)\2c bC ESUBREG
+a\(b\1\)c bC ESUBREG
+a\(b*\)c\1d b abbcbbd abbcbbd bb
+a\(b*\)c\1d b abbcbd
+a\(b*\)c\1d b abbcbbbd
+^\(.\)\1 b abc
+a\([bc]\)\1d b abcdabbd abbd b
+a\(\([bc]\)\2\)*d b abbccd abbccd
+a\(\([bc]\)\2\)*d b abbcbd
+# actually, this next one probably ought to fail, but the spec is unclear
+a\(\(b\)*\2\)*d b abbbd abbbd
+# here is a case that no NFA implementation does right
+\(ab*\)[ab]*\1 b ababaaa ababaaa a
+# check out normal matching in the presence of back refs
+\(a\)\1bcd b aabcd aabcd
+\(a\)\1bc*d b aabcd aabcd
+\(a\)\1bc*d b aabd aabd
+\(a\)\1bc*d b aabcccd aabcccd
+\(a\)\1bc*[ce]d b aabcccd aabcccd
+^\(a\)\1b\(c\)*cd$ b aabcccd aabcccd
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/basic.in b/contrib/netbsd-tests/lib/libc/regex/data/basic.in
new file mode 100644
index 0000000..d1e3aa9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/basic.in
@@ -0,0 +1,5 @@
+# basics
+a & a a
+abc & abc abc
+abc|de - abc abc
+a|b|c - abc a
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/bracket.in b/contrib/netbsd-tests/lib/libc/regex/data/bracket.in
new file mode 100644
index 0000000..53a0b20
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/bracket.in
@@ -0,0 +1,55 @@
+# brackets, and numerous perversions thereof
+a[b]c & abc abc
+a[ab]c & abc abc
+a[^ab]c & adc adc
+a[]b]c & a]c a]c
+a[[b]c & a[c a[c
+a[-b]c & a-c a-c
+a[^]b]c & adc adc
+a[^-b]c & adc adc
+a[b-]c & a-c a-c
+a[b &C EBRACK
+a[] &C EBRACK
+a[1-3]c & a2c a2c
+a[3-1]c &C ERANGE
+a[1-3-5]c &C ERANGE
+a[[.-.]--]c & a-c a-c
+a[1- &C ERANGE
+a[[. &C EBRACK
+a[[.x &C EBRACK
+a[[.x. &C EBRACK
+a[[.x.] &C EBRACK
+a[[.x.]] & ax ax
+a[[.x,.]] &C ECOLLATE
+a[[.one.]]b & a1b a1b
+a[[.notdef.]]b &C ECOLLATE
+a[[.].]]b & a]b a]b
+a[[:alpha:]]c & abc abc
+a[[:notdef:]]c &C ECTYPE
+a[[: &C EBRACK
+a[[:alpha &C EBRACK
+a[[:alpha:] &C EBRACK
+a[[:alpha,:] &C ECTYPE
+a[[:]:]]b &C ECTYPE
+a[[:-:]]b &C ECTYPE
+a[[:alph:]] &C ECTYPE
+a[[:alphabet:]] &C ECTYPE
+[[:alnum:]]+ - -%@a0X- a0X
+[[:alpha:]]+ - -%@aX0- aX
+[[:blank:]]+ - aSSTb SST
+[[:cntrl:]]+ - aNTb NT
+[[:digit:]]+ - a019b 019
+[[:graph:]]+ - Sa%bS a%b
+[[:lower:]]+ - AabC ab
+[[:print:]]+ - NaSbN aSb
+[[:punct:]]+ - S%-&T %-&
+[[:space:]]+ - aSNTb SNT
+[[:upper:]]+ - aBCd BC
+[[:xdigit:]]+ - p0f3Cq 0f3C
+a[[=b=]]c & abc abc
+a[[= &C EBRACK
+a[[=b &C EBRACK
+a[[=b= &C EBRACK
+a[[=b=] &C EBRACK
+a[[=b,=]] &C ECOLLATE
+a[[=one=]]b & a1b a1b
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/c_comments.in b/contrib/netbsd-tests/lib/libc/regex/data/c_comments.in
new file mode 100644
index 0000000..ea3faf9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/c_comments.in
@@ -0,0 +1,17 @@
+# Let's have some fun -- try to match a C comment.
+# first the obvious, which looks okay at first glance...
+/\*.*\*/ - /*x*/ /*x*/
+# but...
+/\*.*\*/ - /*x*/y/*z*/ /*x*/y/*z*/
+# okay, we must not match */ inside; try to do that...
+/\*([^*]|\*[^/])*\*/ - /*x*/ /*x*/
+/\*([^*]|\*[^/])*\*/ - /*x*/y/*z*/ /*x*/
+# but...
+/\*([^*]|\*[^/])*\*/ - /*x**/y/*z*/ /*x**/y/*z*/
+# and a still fancier version, which does it right (I think)...
+/\*([^*]|\*+[^*/])*\*+/ - /*x*/ /*x*/
+/\*([^*]|\*+[^*/])*\*+/ - /*x*/y/*z*/ /*x*/
+/\*([^*]|\*+[^*/])*\*+/ - /*x**/y/*z*/ /*x**/
+/\*([^*]|\*+[^*/])*\*+/ - /*x****/y/*z*/ /*x****/
+/\*([^*]|\*+[^*/])*\*+/ - /*x**x*/y/*z*/ /*x**x*/
+/\*([^*]|\*+[^*/])*\*+/ - /*x***x/y/*z*/ /*x***x/y/*z*/
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/complex.in b/contrib/netbsd-tests/lib/libc/regex/data/complex.in
new file mode 100644
index 0000000..e114058
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/complex.in
@@ -0,0 +1,23 @@
+# complexities
+a(((b)))c - abc abc
+a(b|(c))d - abd abd
+a(b*|c)d - abbd abbd
+# just gotta have one DFA-buster, of course
+a[ab]{20} - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab
+# and an inline expansion in case somebody gets tricky
+a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab] - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab
+# and in case somebody just slips in an NFA...
+a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night) - aaaaabaaaabaaaabaaaabweeknights aaaaabaaaabaaaabaaaabweeknights
+# fish for anomalies as the number of states passes 32
+12345678901234567890123456789 - a12345678901234567890123456789b 12345678901234567890123456789
+123456789012345678901234567890 - a123456789012345678901234567890b 123456789012345678901234567890
+1234567890123456789012345678901 - a1234567890123456789012345678901b 1234567890123456789012345678901
+12345678901234567890123456789012 - a12345678901234567890123456789012b 12345678901234567890123456789012
+123456789012345678901234567890123 - a123456789012345678901234567890123b 123456789012345678901234567890123
+# and one really big one, beyond any plausible word width
+1234567890123456789012345678901234567890123456789012345678901234567890 - a1234567890123456789012345678901234567890123456789012345678901234567890b 1234567890123456789012345678901234567890123456789012345678901234567890
+# fish for problems as brackets go past 8
+[ab][cd][ef][gh][ij][kl][mn] - xacegikmoq acegikm
+[ab][cd][ef][gh][ij][kl][mn][op] - xacegikmoq acegikmo
+[ab][cd][ef][gh][ij][kl][mn][op][qr] - xacegikmoqy acegikmoq
+[ab][cd][ef][gh][ij][kl][mn][op][q] - xacegikmoqy acegikmoq
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/error.in b/contrib/netbsd-tests/lib/libc/regex/data/error.in
new file mode 100644
index 0000000..61e0ea4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/error.in
@@ -0,0 +1,30 @@
+# certain syntax errors and non-errors
+| C EMPTY
+| b | |
+* C BADRPT
+* b * *
++ C BADRPT
+? C BADRPT
+"" &C EMPTY
+() - abc @abc
+\(\) b abc @abc
+a||b C EMPTY
+|ab C EMPTY
+ab| C EMPTY
+(|a)b C EMPTY
+(a|)b C EMPTY
+(*a) C BADRPT
+(+a) C BADRPT
+(?a) C BADRPT
+({1}a) C BADRPT
+\(\{1\}a\) bC BADRPT
+(a|*b) C BADRPT
+(a|+b) C BADRPT
+(a|?b) C BADRPT
+(a|{1}b) C BADRPT
+^* C BADRPT
+^* b * *
+^+ C BADRPT
+^? C BADRPT
+^{1} C BADRPT
+^\{1\} bC BADRPT
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/meta.in b/contrib/netbsd-tests/lib/libc/regex/data/meta.in
new file mode 100644
index 0000000..4533d35
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/meta.in
@@ -0,0 +1,21 @@
+# metacharacters, backslashes
+a.c & abc abc
+a[bc]d & abd abd
+a\*c & a*c a*c
+a\\b & a\b a\b
+a\\\*b & a\*b a\*b
+a\bc & abc abc
+a\ &C EESCAPE
+a\\bc & a\bc a\bc
+\{ bC BADRPT
+a\[b & a[b a[b
+a[b &C EBRACK
+# trailing $ is a peculiar special case for the BRE code
+a$ & a a
+a$ & a$
+a\$ & a
+a\$ & a$ a$
+a\\$ & a
+a\\$ & a$
+a\\$ & a\$
+a\\$ & a\ a\
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/nospec.in b/contrib/netbsd-tests/lib/libc/regex/data/nospec.in
new file mode 100644
index 0000000..baf8d04
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/nospec.in
@@ -0,0 +1,7 @@
+# plain strings, with the NOSPEC flag
+abc m abc abc
+abc m xabcy abc
+abc m xyz
+a*b m aba*b a*b
+a*b m ab
+"" mC EMPTY
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/paren.in b/contrib/netbsd-tests/lib/libc/regex/data/paren.in
new file mode 100644
index 0000000..9d206ce
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/paren.in
@@ -0,0 +1,19 @@
+# parentheses and perversions thereof
+a(b)c - abc abc
+a\(b\)c b abc abc
+a( C EPAREN
+a( b a( a(
+a\( - a( a(
+a\( bC EPAREN
+a\(b bC EPAREN
+a(b C EPAREN
+a(b b a(b a(b
+# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly)
+a) - a) a)
+) - ) )
+# end gagging (in a just world, those *should* give EPAREN)
+a) b a) a)
+a\) bC EPAREN
+\) bC EPAREN
+a()b - ab ab
+a\(\)b b ab ab
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/regress.in b/contrib/netbsd-tests/lib/libc/regex/data/regress.in
new file mode 100644
index 0000000..afd832a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/regress.in
@@ -0,0 +1,9 @@
+# past problems, and suspected problems
+(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A]) - A1 A1
+abcdefghijklmnop i abcdefghijklmnop abcdefghijklmnop
+abcdefghijklmnopqrstuv i abcdefghijklmnopqrstuv abcdefghijklmnopqrstuv
+(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN]) - CC11 CC11
+CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a - CC11 CC11
+Char \([a-z0-9_]*\)\[.* b Char xyz[k Char xyz[k xyz
+a?b - ab ab
+-\{0,1\}[0-9]*$ b -5 -5
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/repet_bounded.in b/contrib/netbsd-tests/lib/libc/regex/data/repet_bounded.in
new file mode 100644
index 0000000..ee6ff4c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/repet_bounded.in
@@ -0,0 +1,45 @@
+# the dreaded bounded repetitions
+{ & { {
+{abc & {abc {abc
+{1 C BADRPT
+{1} C BADRPT
+a{b & a{b a{b
+a{1}b - ab ab
+a\{1\}b b ab ab
+a{1,}b - ab ab
+a\{1,\}b b ab ab
+a{1,2}b - aab aab
+a\{1,2\}b b aab aab
+a{1 C EBRACE
+a\{1 bC EBRACE
+a{1a C EBRACE
+a\{1a bC EBRACE
+a{1a} C BADBR
+a\{1a\} bC BADBR
+a{,2} - a{,2} a{,2}
+a\{,2\} bC BADBR
+a{,} - a{,} a{,}
+a\{,\} bC BADBR
+a{1,x} C BADBR
+a\{1,x\} bC BADBR
+a{1,x C EBRACE
+a\{1,x bC EBRACE
+a{300} C BADBR
+a\{300\} bC BADBR
+a{1,0} C BADBR
+a\{1,0\} bC BADBR
+ab{0,0}c - abcac ac
+ab\{0,0\}c b abcac ac
+ab{0,1}c - abcac abc
+ab\{0,1\}c b abcac abc
+ab{0,3}c - abbcac abbc
+ab\{0,3\}c b abbcac abbc
+ab{1,1}c - acabc abc
+ab\{1,1\}c b acabc abc
+ab{1,3}c - acabc abc
+ab\{1,3\}c b acabc abc
+ab{2,2}c - abcabbc abbc
+ab\{2,2\}c b abcabbc abbc
+ab{2,4}c - abcabbc abbc
+ab\{2,4\}c b abcabbc abbc
+((a{1,10}){1,10}){1,10} - a a a,a
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/repet_multi.in b/contrib/netbsd-tests/lib/libc/regex/data/repet_multi.in
new file mode 100644
index 0000000..da97bad
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/repet_multi.in
@@ -0,0 +1,21 @@
+# multiple repetitions
+a** &C BADRPT
+a++ C BADRPT
+a?? C BADRPT
+a*+ C BADRPT
+a*? C BADRPT
+a+* C BADRPT
+a+? C BADRPT
+a?* C BADRPT
+a?+ C BADRPT
+a{1}{1} C BADRPT
+a*{1} C BADRPT
+a+{1} C BADRPT
+a?{1} C BADRPT
+a{1}* C BADRPT
+a{1}+ C BADRPT
+a{1}? C BADRPT
+a*{b} - a{b} a{b}
+a\{1\}\{1\} bC BADRPT
+a*\{1\} bC BADRPT
+a\{1\}* bC BADRPT
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/repet_ordinary.in b/contrib/netbsd-tests/lib/libc/regex/data/repet_ordinary.in
new file mode 100644
index 0000000..08bc286
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/repet_ordinary.in
@@ -0,0 +1,10 @@
+# ordinary repetitions
+ab*c & abc abc
+ab+c - abc abc
+ab?c - abc abc
+a\(*\)b b a*b a*b
+a\(**\)b b ab ab
+a\(***\)b bC BADRPT
+*a b *a *a
+**a b a a
+***a bC BADRPT
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/startend.in b/contrib/netbsd-tests/lib/libc/regex/data/startend.in
new file mode 100644
index 0000000..c396e58
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/startend.in
@@ -0,0 +1,9 @@
+# check out the STARTEND option
+[abc] &# a(b)c b
+[abc] &# a(d)c
+[abc] &# a(bc)d b
+[abc] &# a(dc)d c
+. &# a()c
+b.*c &# b(bc)c bc
+b.* &# b(bc)c bc
+.*c &# b(bc)c bc
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/subexp.in b/contrib/netbsd-tests/lib/libc/regex/data/subexp.in
new file mode 100644
index 0000000..c7bcc06
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/subexp.in
@@ -0,0 +1,57 @@
+# subexpressions
+a(b)(c)d - abcd abcd b,c
+a(((b)))c - abc abc b,b,b
+a(b|(c))d - abd abd b,-
+a(b*|c|e)d - abbd abbd bb
+a(b*|c|e)d - acd acd c
+a(b*|c|e)d - ad ad @d
+a(b?)c - abc abc b
+a(b?)c - ac ac @c
+a(b+)c - abc abc b
+a(b+)c - abbbc abbbc bbb
+a(b*)c - ac ac @c
+(a|ab)(bc([de]+)f|cde) - abcdef abcdef a,bcdef,de
+# the regression tester only asks for 9 subexpressions
+a(b)(c)(d)(e)(f)(g)(h)(i)(j)k - abcdefghijk abcdefghijk b,c,d,e,f,g,h,i,j
+a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l - abcdefghijkl abcdefghijkl b,c,d,e,f,g,h,i,j,k
+a([bc]?)c - abc abc b
+a([bc]?)c - ac ac @c
+a([bc]+)c - abc abc b
+a([bc]+)c - abcc abcc bc
+a([bc]+)bc - abcbc abcbc bc
+a(bb+|b)b - abb abb b
+a(bbb+|bb+|b)b - abb abb b
+a(bbb+|bb+|b)b - abbb abbb bb
+a(bbb+|bb+|b)bb - abbb abbb b
+(.*).* - abcdef abcdef abcdef
+(a*)* - bc @b @b
+
+# do we get the right subexpression when it is used more than once?
+a(b|c)*d - ad ad -
+a(b|c)*d - abcd abcd c
+a(b|c)+d - abd abd b
+a(b|c)+d - abcd abcd c
+a(b|c?)+d - ad ad @d
+a(b|c?)+d - abcd abcd @d
+a(b|c){0,0}d - ad ad -
+a(b|c){0,1}d - ad ad -
+a(b|c){0,1}d - abd abd b
+a(b|c){0,2}d - ad ad -
+a(b|c){0,2}d - abcd abcd c
+a(b|c){0,}d - ad ad -
+a(b|c){0,}d - abcd abcd c
+a(b|c){1,1}d - abd abd b
+a(b|c){1,1}d - acd acd c
+a(b|c){1,2}d - abd abd b
+a(b|c){1,2}d - abcd abcd c
+a(b|c){1,}d - abd abd b
+a(b|c){1,}d - abcd abcd c
+a(b|c){2,2}d - acbd acbd b
+a(b|c){2,2}d - abcd abcd c
+a(b|c){2,4}d - abcd abcd c
+a(b|c){2,4}d - abcbd abcbd b
+a(b|c){2,4}d - abcbcd abcbcd c
+a(b|c){2,}d - abcd abcd c
+a(b|c){2,}d - abcbd abcbd b
+a(b+|((c)*))+d - abd abd @d,@d,-
+a(b+|((c)*))+d - abcd abcd @d,@d,-
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/subtle.in b/contrib/netbsd-tests/lib/libc/regex/data/subtle.in
new file mode 100644
index 0000000..92d68bb
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/subtle.in
@@ -0,0 +1,21 @@
+# subtleties of matching
+abc & xabcy abc
+a\(b\)?c\1d b acd
+aBc i Abc Abc
+a[Bc]*d i abBCcd abBCcd
+0[[:upper:]]1 &i 0a1 0a1
+0[[:lower:]]1 &i 0A1 0A1
+a[^b]c &i abc
+a[^b]c &i aBc
+a[^b]c &i adc adc
+[a]b[c] - abc abc
+[a]b[a] - aba aba
+[abc]b[abc] - abc abc
+[abc]b[abd] - abd abd
+a(b?c)+d - accd accd
+(wee|week)(knights|night) - weeknights weeknights
+(we|wee|week|frob)(knights|night|day) - weeknights weeknights
+a[bc]d - xyzaaabcaababdacd abd
+a[ab]c - aaabc abc
+abc s abc abc
+a* & b @b
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/word_bound.in b/contrib/netbsd-tests/lib/libc/regex/data/word_bound.in
new file mode 100644
index 0000000..e09a329
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/word_bound.in
@@ -0,0 +1,13 @@
+# word boundaries (ick)
+[[:<:]]a & a a
+[[:<:]]a & ba
+[[:<:]]a & -a a
+a[[:>:]] & a a
+a[[:>:]] & ab
+a[[:>:]] & a- a
+[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc abc
+[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc-q abc
+[[:<:]]a.c[[:>:]] & axc-dayc-dazce-abc axc
+[[:<:]]b.c[[:>:]] & a_bxc-byc_d-bzc-q bzc
+[[:<:]].x..[[:>:]] & y_xa_-_xb_y-_xc_-axdc _xc_
+[[:<:]]a_b[[:>:]] & x_a_b
diff --git a/contrib/netbsd-tests/lib/libc/regex/data/zero.in b/contrib/netbsd-tests/lib/libc/regex/data/zero.in
new file mode 100644
index 0000000..2786944
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/data/zero.in
@@ -0,0 +1,7 @@
+# cases involving NULs
+aZb & a a
+aZb &p a
+aZb &p# (aZb) aZb
+aZ*b &p# (ab) ab
+a.b &# (aZb) aZb
+a.* &# (aZb)c aZb
diff --git a/contrib/netbsd-tests/lib/libc/regex/debug.c b/contrib/netbsd-tests/lib/libc/regex/debug.c
new file mode 100644
index 0000000..c1528b9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/debug.c
@@ -0,0 +1,266 @@
+/* $NetBSD: debug.c,v 1.2 2011/10/10 04:32:41 christos Exp $ */
+
+/*-
+ * Copyright (c) 1993 The NetBSD Foundation, 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 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 <ctype.h>
+#include <limits.h>
+#include <regex.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <sys/types.h>
+
+/* Don't sort these! */
+#include "utils.h"
+#include "regex2.h"
+
+#include "test_regex.h"
+
+static void s_print(struct re_guts *, FILE *);
+static char *regchar(int);
+
+/*
+ * regprint - print a regexp for debugging
+ */
+void
+regprint(regex_t *r, FILE *d)
+{
+ struct re_guts *g = r->re_g;
+ int c;
+ int last;
+ int nincat[NC];
+
+ fprintf(d, "%ld states, %zu categories", (long)g->nstates,
+ g->ncategories);
+ fprintf(d, ", first %ld last %ld", (long)g->firststate,
+ (long)g->laststate);
+ if (g->iflags&USEBOL)
+ fprintf(d, ", USEBOL");
+ if (g->iflags&USEEOL)
+ fprintf(d, ", USEEOL");
+ if (g->iflags&BAD)
+ fprintf(d, ", BAD");
+ if (g->nsub > 0)
+ fprintf(d, ", nsub=%ld", (long)g->nsub);
+ if (g->must != NULL)
+ fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen,
+ g->must);
+ if (g->backrefs)
+ fprintf(d, ", backrefs");
+ if (g->nplus > 0)
+ fprintf(d, ", nplus %ld", (long)g->nplus);
+ fprintf(d, "\n");
+ s_print(g, d);
+ for (size_t i = 0; i < g->ncategories; i++) {
+ nincat[i] = 0;
+ for (c = CHAR_MIN; c <= CHAR_MAX; c++)
+ if (g->categories[c] == i)
+ nincat[i]++;
+ }
+ fprintf(d, "cc0#%d", nincat[0]);
+ for (size_t i = 1; i < g->ncategories; i++)
+ if (nincat[i] == 1) {
+ for (c = CHAR_MIN; c <= CHAR_MAX; c++)
+ if (g->categories[c] == i)
+ break;
+ fprintf(d, ", %zu=%s", i, regchar(c));
+ }
+ fprintf(d, "\n");
+ for (size_t i = 1; i < g->ncategories; i++)
+ if (nincat[i] != 1) {
+ fprintf(d, "cc%zu\t", i);
+ last = -1;
+ for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */
+ if (c <= CHAR_MAX && g->categories[c] == i) {
+ if (last < 0) {
+ fprintf(d, "%s", regchar(c));
+ last = c;
+ }
+ } else {
+ if (last >= 0) {
+ if (last != c-1)
+ fprintf(d, "-%s",
+ regchar(c-1));
+ last = -1;
+ }
+ }
+ fprintf(d, "\n");
+ }
+}
+
+/*
+ * s_print - print the strip for debugging
+ */
+static void
+s_print(struct re_guts *g, FILE *d)
+{
+ sop *s;
+ cset *cs;
+ int done = 0;
+ sop opnd;
+ int col = 0;
+ ssize_t last;
+ sopno offset = 2;
+# define GAP() { if (offset % 5 == 0) { \
+ if (col > 40) { \
+ fprintf(d, "\n\t"); \
+ col = 0; \
+ } else { \
+ fprintf(d, " "); \
+ col++; \
+ } \
+ } else \
+ col++; \
+ offset++; \
+ }
+
+ if (OP(g->strip[0]) != OEND)
+ fprintf(d, "missing initial OEND!\n");
+ for (s = &g->strip[1]; !done; s++) {
+ opnd = OPND(*s);
+ switch (OP(*s)) {
+ case OEND:
+ fprintf(d, "\n");
+ done = 1;
+ break;
+ case OCHAR:
+ if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL)
+ fprintf(d, "\\%c", (char)opnd);
+ else
+ fprintf(d, "%s", regchar((char)opnd));
+ break;
+ case OBOL:
+ fprintf(d, "^");
+ break;
+ case OEOL:
+ fprintf(d, "$");
+ break;
+ case OBOW:
+ fprintf(d, "\\{");
+ break;
+ case OEOW:
+ fprintf(d, "\\}");
+ break;
+ case OANY:
+ fprintf(d, ".");
+ break;
+ case OANYOF:
+ fprintf(d, "[(%ld)", (long)opnd);
+ cs = &g->sets[opnd];
+ last = -1;
+ for (size_t i = 0; i < g->csetsize+1; i++) /* +1 flushes */
+ if (CHIN(cs, i) && i < g->csetsize) {
+ if (last < 0) {
+ fprintf(d, "%s", regchar(i));
+ last = i;
+ }
+ } else {
+ if (last >= 0) {
+ if (last != (ssize_t)i - 1)
+ fprintf(d, "-%s",
+ regchar(i - 1));
+ last = -1;
+ }
+ }
+ fprintf(d, "]");
+ break;
+ case OBACK_:
+ fprintf(d, "(\\<%ld>", (long)opnd);
+ break;
+ case O_BACK:
+ fprintf(d, "<%ld>\\)", (long)opnd);
+ break;
+ case OPLUS_:
+ fprintf(d, "(+");
+ if (OP(*(s+opnd)) != O_PLUS)
+ fprintf(d, "<%ld>", (long)opnd);
+ break;
+ case O_PLUS:
+ if (OP(*(s-opnd)) != OPLUS_)
+ fprintf(d, "<%ld>", (long)opnd);
+ fprintf(d, "+)");
+ break;
+ case OQUEST_:
+ fprintf(d, "(?");
+ if (OP(*(s+opnd)) != O_QUEST)
+ fprintf(d, "<%ld>", (long)opnd);
+ break;
+ case O_QUEST:
+ if (OP(*(s-opnd)) != OQUEST_)
+ fprintf(d, "<%ld>", (long)opnd);
+ fprintf(d, "?)");
+ break;
+ case OLPAREN:
+ fprintf(d, "((<%ld>", (long)opnd);
+ break;
+ case ORPAREN:
+ fprintf(d, "<%ld>))", (long)opnd);
+ break;
+ case OCH_:
+ fprintf(d, "<");
+ if (OP(*(s+opnd)) != OOR2)
+ fprintf(d, "<%ld>", (long)opnd);
+ break;
+ case OOR1:
+ if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_)
+ fprintf(d, "<%ld>", (long)opnd);
+ fprintf(d, "|");
+ break;
+ case OOR2:
+ fprintf(d, "|");
+ if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH)
+ fprintf(d, "<%ld>", (long)opnd);
+ break;
+ case O_CH:
+ if (OP(*(s-opnd)) != OOR1)
+ fprintf(d, "<%ld>", (long)opnd);
+ fprintf(d, ">");
+ break;
+ default:
+ fprintf(d, "!%d(%d)!", OP(*s), opnd);
+ break;
+ }
+ if (!done)
+ GAP();
+ }
+}
+
+/*
+ * regchar - make a character printable
+ */
+static char * /* -> representation */
+regchar(int ch)
+{
+ static char buf[10];
+
+ if (isprint(ch) || ch == ' ')
+ sprintf(buf, "%c", ch);
+ else
+ sprintf(buf, "\\%o", ch);
+ return(buf);
+}
diff --git a/contrib/netbsd-tests/lib/libc/regex/main.c b/contrib/netbsd-tests/lib/libc/regex/main.c
new file mode 100644
index 0000000..eac4e2d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/main.c
@@ -0,0 +1,523 @@
+/* $NetBSD: main.c,v 1.2 2011/09/16 16:13:18 plunky Exp $ */
+
+/*-
+ * Copyright (c) 1993 The NetBSD Foundation, 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 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 <assert.h>
+#include <regex.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+
+#include "test_regex.h"
+
+char *progname;
+int debug = 0;
+int line = 0;
+int status = 0;
+
+int copts = REG_EXTENDED;
+int eopts = 0;
+regoff_t startoff = 0;
+regoff_t endoff = 0;
+
+static char empty = '\0';
+
+static char *eprint(int);
+static int efind(char *);
+
+/*
+ * main - do the simple case, hand off to regress() for regression
+ */
+int
+main(int argc, char *argv[])
+{
+ regex_t re;
+# define NS 10
+ regmatch_t subs[NS];
+ char erbuf[100];
+ int err;
+ size_t len;
+ int c;
+ int errflg = 0;
+ int i;
+ extern int optind;
+ extern char *optarg;
+
+ progname = argv[0];
+
+ while ((c = getopt(argc, argv, "c:e:S:E:x")) != -1)
+ switch (c) {
+ case 'c': /* compile options */
+ copts = options('c', optarg);
+ break;
+ case 'e': /* execute options */
+ eopts = options('e', optarg);
+ break;
+ case 'S': /* start offset */
+ startoff = (regoff_t)atoi(optarg);
+ break;
+ case 'E': /* end offset */
+ endoff = (regoff_t)atoi(optarg);
+ break;
+ case 'x': /* Debugging. */
+ debug++;
+ break;
+ case '?':
+ default:
+ errflg++;
+ break;
+ }
+ if (errflg) {
+ fprintf(stderr, "usage: %s ", progname);
+ fprintf(stderr, "[-c copt][-C][-d] [re]\n");
+ exit(2);
+ }
+
+ if (optind >= argc) {
+ regress(stdin);
+ exit(status);
+ }
+
+ err = regcomp(&re, argv[optind++], copts);
+ if (err) {
+ len = regerror(err, &re, erbuf, sizeof(erbuf));
+ fprintf(stderr, "error %s, %zd/%zd `%s'\n",
+ eprint(err), len, (size_t)sizeof(erbuf), erbuf);
+ exit(status);
+ }
+ regprint(&re, stdout);
+
+ if (optind >= argc) {
+ regfree(&re);
+ exit(status);
+ }
+
+ if (eopts&REG_STARTEND) {
+ subs[0].rm_so = startoff;
+ subs[0].rm_eo = strlen(argv[optind]) - endoff;
+ }
+ err = regexec(&re, argv[optind], (size_t)NS, subs, eopts);
+ if (err) {
+ len = regerror(err, &re, erbuf, sizeof(erbuf));
+ fprintf(stderr, "error %s, %zd/%zd `%s'\n",
+ eprint(err), len, (size_t)sizeof(erbuf), erbuf);
+ exit(status);
+ }
+ if (!(copts&REG_NOSUB)) {
+ len = (int)(subs[0].rm_eo - subs[0].rm_so);
+ if (subs[0].rm_so != -1) {
+ if (len != 0)
+ printf("match `%.*s'\n", (int)len,
+ argv[optind] + subs[0].rm_so);
+ else
+ printf("match `'@%.1s\n",
+ argv[optind] + subs[0].rm_so);
+ }
+ for (i = 1; i < NS; i++)
+ if (subs[i].rm_so != -1)
+ printf("(%d) `%.*s'\n", i,
+ (int)(subs[i].rm_eo - subs[i].rm_so),
+ argv[optind] + subs[i].rm_so);
+ }
+ exit(status);
+}
+
+/*
+ * regress - main loop of regression test
+ */
+void
+regress(FILE *in)
+{
+ char inbuf[1000];
+# define MAXF 10
+ char *f[MAXF];
+ int nf;
+ int i;
+ char erbuf[100];
+ size_t ne;
+ const char *badpat = "invalid regular expression";
+# define SHORT 10
+ const char *bpname = "REG_BADPAT";
+ regex_t re;
+
+ while (fgets(inbuf, sizeof(inbuf), in) != NULL) {
+ line++;
+ if (inbuf[0] == '#' || inbuf[0] == '\n')
+ continue; /* NOTE CONTINUE */
+ inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */
+ if (debug)
+ fprintf(stdout, "%d:\n", line);
+ nf = split(inbuf, f, MAXF, "\t\t");
+ if (nf < 3) {
+ fprintf(stderr, "bad input, line %d\n", line);
+ exit(1);
+ }
+ for (i = 0; i < nf; i++)
+ if (strcmp(f[i], "\"\"") == 0)
+ f[i] = &empty;
+ if (nf <= 3)
+ f[3] = NULL;
+ if (nf <= 4)
+ f[4] = NULL;
+ try(f[0], f[1], f[2], f[3], f[4], options('c', f[1]));
+ if (opt('&', f[1])) /* try with either type of RE */
+ try(f[0], f[1], f[2], f[3], f[4],
+ options('c', f[1]) &~ REG_EXTENDED);
+ }
+
+ ne = regerror(REG_BADPAT, NULL, erbuf, sizeof(erbuf));
+ if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) {
+ fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n",
+ erbuf, badpat);
+ status = 1;
+ }
+ ne = regerror(REG_BADPAT, NULL, erbuf, (size_t)SHORT);
+ if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' ||
+ ne != strlen(badpat)+1) {
+ fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n",
+ erbuf, SHORT-1, badpat);
+ status = 1;
+ }
+ ne = regerror(REG_ITOA|REG_BADPAT, NULL, erbuf, sizeof(erbuf));
+ if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) {
+ fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n",
+ erbuf, bpname);
+ status = 1;
+ }
+ re.re_endp = bpname;
+ ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf));
+ if (atoi(erbuf) != (int)REG_BADPAT) {
+ fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n",
+ erbuf, (long)REG_BADPAT);
+ status = 1;
+ } else if (ne != strlen(erbuf)+1) {
+ fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n",
+ erbuf, (long)REG_BADPAT);
+ status = 1;
+ }
+}
+
+/*
+ - try - try it, and report on problems
+ == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts);
+ */
+void
+try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts)
+{
+ regex_t re;
+# define NSUBS 10
+ regmatch_t subs[NSUBS];
+# define NSHOULD 15
+ char *should[NSHOULD];
+ int nshould;
+ char erbuf[100];
+ int err;
+ int len;
+ const char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE";
+ int i;
+ char *grump;
+ char f0copy[1000];
+ char f2copy[1000];
+
+ strcpy(f0copy, f0);
+ re.re_endp = (opts&REG_PEND) ? f0copy + strlen(f0copy) : NULL;
+ fixstr(f0copy);
+ err = regcomp(&re, f0copy, opts);
+ if (err != 0 && (!opt('C', f1) || err != efind(f2))) {
+ /* unexpected error or wrong error */
+ len = regerror(err, &re, erbuf, sizeof(erbuf));
+ fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n",
+ line, type, eprint(err), len,
+ (int)sizeof(erbuf), erbuf);
+ status = 1;
+ } else if (err == 0 && opt('C', f1)) {
+ /* unexpected success */
+ fprintf(stderr, "%d: %s should have given REG_%s\n",
+ line, type, f2);
+ status = 1;
+ err = 1; /* so we won't try regexec */
+ }
+
+ if (err != 0) {
+ regfree(&re);
+ return;
+ }
+
+ strcpy(f2copy, f2);
+ fixstr(f2copy);
+
+ if (options('e', f1)&REG_STARTEND) {
+ if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL)
+ fprintf(stderr, "%d: bad STARTEND syntax\n", line);
+ subs[0].rm_so = strchr(f2, '(') - f2 + 1;
+ subs[0].rm_eo = strchr(f2, ')') - f2;
+ }
+ err = regexec(&re, f2copy, NSUBS, subs, options('e', f1));
+
+ if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) {
+ /* unexpected error or wrong error */
+ len = regerror(err, &re, erbuf, sizeof(erbuf));
+ fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n",
+ line, type, eprint(err), len,
+ (int)sizeof(erbuf), erbuf);
+ status = 1;
+ } else if (err != 0) {
+ /* nothing more to check */
+ } else if (f3 == NULL) {
+ /* unexpected success */
+ fprintf(stderr, "%d: %s exec should have failed\n",
+ line, type);
+ status = 1;
+ err = 1; /* just on principle */
+ } else if (opts&REG_NOSUB) {
+ /* nothing more to check */
+ } else if ((grump = check(f2, subs[0], f3)) != NULL) {
+ fprintf(stderr, "%d: %s %s\n", line, type, grump);
+ status = 1;
+ err = 1;
+ }
+
+ if (err != 0 || f4 == NULL) {
+ regfree(&re);
+ return;
+ }
+
+ for (i = 1; i < NSHOULD; i++)
+ should[i] = NULL;
+ nshould = split(f4, &should[1], NSHOULD-1, ",");
+ if (nshould == 0) {
+ nshould = 1;
+ should[1] = &empty;
+ }
+ for (i = 1; i < NSUBS; i++) {
+ grump = check(f2, subs[i], should[i]);
+ if (grump != NULL) {
+ fprintf(stderr, "%d: %s $%d %s\n", line,
+ type, i, grump);
+ status = 1;
+ err = 1;
+ }
+ }
+
+ regfree(&re);
+}
+
+/*
+ - options - pick options out of a regression-test string
+ == int options(int type, char *s);
+ */
+int
+options(int type, char *s)
+{
+ char *p;
+ int o = (type == 'c') ? copts : eopts;
+ const char *legal = (type == 'c') ? "bisnmp" : "^$#tl";
+
+ for (p = s; *p != '\0'; p++)
+ if (strchr(legal, *p) != NULL)
+ switch (*p) {
+ case 'b':
+ o &= ~REG_EXTENDED;
+ break;
+ case 'i':
+ o |= REG_ICASE;
+ break;
+ case 's':
+ o |= REG_NOSUB;
+ break;
+ case 'n':
+ o |= REG_NEWLINE;
+ break;
+ case 'm':
+ o &= ~REG_EXTENDED;
+ o |= REG_NOSPEC;
+ break;
+ case 'p':
+ o |= REG_PEND;
+ break;
+ case '^':
+ o |= REG_NOTBOL;
+ break;
+ case '$':
+ o |= REG_NOTEOL;
+ break;
+ case '#':
+ o |= REG_STARTEND;
+ break;
+ case 't': /* trace */
+ o |= REG_TRACE;
+ break;
+ case 'l': /* force long representation */
+ o |= REG_LARGE;
+ break;
+ case 'r': /* force backref use */
+ o |= REG_BACKR;
+ break;
+ }
+ return(o);
+}
+
+/*
+ - opt - is a particular option in a regression string?
+ == int opt(int c, char *s);
+ */
+int /* predicate */
+opt(int c, char *s)
+{
+ return(strchr(s, c) != NULL);
+}
+
+/*
+ - fixstr - transform magic characters in strings
+ == void fixstr(char *p);
+ */
+void
+fixstr(char *p)
+{
+ if (p == NULL)
+ return;
+
+ for (; *p != '\0'; p++)
+ if (*p == 'N')
+ *p = '\n';
+ else if (*p == 'T')
+ *p = '\t';
+ else if (*p == 'S')
+ *p = ' ';
+ else if (*p == 'Z')
+ *p = '\0';
+}
+
+/*
+ * check - check a substring match
+ */
+char * /* NULL or complaint */
+check(char *str, regmatch_t sub, char *should)
+{
+ int len;
+ int shlen;
+ char *p;
+ static char grump[500];
+ char *at = NULL;
+
+ if (should != NULL && strcmp(should, "-") == 0)
+ should = NULL;
+ if (should != NULL && should[0] == '@') {
+ at = should + 1;
+ should = &empty;
+ }
+
+ /* check rm_so and rm_eo for consistency */
+ if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) ||
+ (sub.rm_so != -1 && sub.rm_eo == -1) ||
+ (sub.rm_so != -1 && sub.rm_so < 0) ||
+ (sub.rm_eo != -1 && sub.rm_eo < 0) ) {
+ sprintf(grump, "start %ld end %ld", (long)sub.rm_so,
+ (long)sub.rm_eo);
+ return(grump);
+ }
+
+ /* check for no match */
+ if (sub.rm_so == -1) {
+ if (should == NULL)
+ return(NULL);
+ else {
+ sprintf(grump, "did not match");
+ return(grump);
+ }
+ }
+
+ /* check for in range */
+ if (sub.rm_eo > (ssize_t)strlen(str)) {
+ sprintf(grump, "start %ld end %ld, past end of string",
+ (long)sub.rm_so, (long)sub.rm_eo);
+ return(grump);
+ }
+
+ len = (int)(sub.rm_eo - sub.rm_so);
+ p = str + sub.rm_so;
+
+ /* check for not supposed to match */
+ if (should == NULL) {
+ sprintf(grump, "matched `%.*s'", len, p);
+ return(grump);
+ }
+
+ /* check for wrong match */
+ shlen = (int)strlen(should);
+ if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) {
+ sprintf(grump, "matched `%.*s' instead", len, p);
+ return(grump);
+ }
+ if (shlen > 0)
+ return(NULL);
+
+ /* check null match in right place */
+ if (at == NULL)
+ return(NULL);
+ shlen = strlen(at);
+ if (shlen == 0)
+ shlen = 1; /* force check for end-of-string */
+ if (strncmp(p, at, shlen) != 0) {
+ sprintf(grump, "matched null at `%.20s'", p);
+ return(grump);
+ }
+ return(NULL);
+}
+
+/*
+ * eprint - convert error number to name
+ */
+static char *
+eprint(int err)
+{
+ static char epbuf[100];
+ size_t len;
+
+ len = regerror(REG_ITOA|err, NULL, epbuf, sizeof(epbuf));
+ assert(len <= sizeof(epbuf));
+ return(epbuf);
+}
+
+/*
+ * efind - convert error name to number
+ */
+static int
+efind(char *name)
+{
+ static char efbuf[100];
+ regex_t re;
+
+ sprintf(efbuf, "REG_%s", name);
+ assert(strlen(efbuf) < sizeof(efbuf));
+ re.re_endp = efbuf;
+ (void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf));
+ return(atoi(efbuf));
+}
diff --git a/contrib/netbsd-tests/lib/libc/regex/split.c b/contrib/netbsd-tests/lib/libc/regex/split.c
new file mode 100644
index 0000000..2a26b50
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/split.c
@@ -0,0 +1,344 @@
+/* $NetBSD: split.c,v 1.1 2011/01/08 18:10:31 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 1993 The NetBSD Foundation, 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 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 <regex.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "test_regex.h"
+
+/*
+ * split - divide a string into fields, like awk split()
+ *
+ * returns number of fields, including overflow
+ *
+ * fields[] list is not NULL-terminated
+ * nfields number of entries available in fields[]
+ * sep "" white, "c" single char, "ab" [ab]+
+ */
+int
+split(char *string, char *fields[], int nfields, const char *sep)
+{
+ char *p = string;
+ char c; /* latest character */
+ char sepc = *sep;
+ char sepc2;
+ int fn;
+ char **fp = fields;
+ const char *sepp;
+ int trimtrail;
+
+ /* white space */
+ if (sepc == '\0') {
+ while ((c = *p++) == ' ' || c == '\t')
+ continue;
+ p--;
+ trimtrail = 1;
+ sep = " \t"; /* note, code below knows this is 2 long */
+ sepc = ' ';
+ } else
+ trimtrail = 0;
+ sepc2 = sep[1]; /* now we can safely pick this up */
+
+ /* catch empties */
+ if (*p == '\0')
+ return(0);
+
+ /* single separator */
+ if (sepc2 == '\0') {
+ fn = nfields;
+ for (;;) {
+ *fp++ = p;
+ fn--;
+ if (fn == 0)
+ break;
+ while ((c = *p++) != sepc)
+ if (c == '\0')
+ return(nfields - fn);
+ *(p-1) = '\0';
+ }
+ /* we have overflowed the fields vector -- just count them */
+ fn = nfields;
+ for (;;) {
+ while ((c = *p++) != sepc)
+ if (c == '\0')
+ return(fn);
+ fn++;
+ }
+ /* not reached */
+ }
+
+ /* two separators */
+ if (sep[2] == '\0') {
+ fn = nfields;
+ for (;;) {
+ *fp++ = p;
+ fn--;
+ while ((c = *p++) != sepc && c != sepc2)
+ if (c == '\0') {
+ if (trimtrail && **(fp-1) == '\0')
+ fn++;
+ return(nfields - fn);
+ }
+ if (fn == 0)
+ break;
+ *(p-1) = '\0';
+ while ((c = *p++) == sepc || c == sepc2)
+ continue;
+ p--;
+ }
+ /* we have overflowed the fields vector -- just count them */
+ fn = nfields;
+ while (c != '\0') {
+ while ((c = *p++) == sepc || c == sepc2)
+ continue;
+ p--;
+ fn++;
+ while ((c = *p++) != '\0' && c != sepc && c != sepc2)
+ continue;
+ }
+ /* might have to trim trailing white space */
+ if (trimtrail) {
+ p--;
+ while ((c = *--p) == sepc || c == sepc2)
+ continue;
+ p++;
+ if (*p != '\0') {
+ if (fn == nfields+1)
+ *p = '\0';
+ fn--;
+ }
+ }
+ return(fn);
+ }
+
+ /* n separators */
+ fn = 0;
+ for (;;) {
+ if (fn < nfields)
+ *fp++ = p;
+ fn++;
+ for (;;) {
+ c = *p++;
+ if (c == '\0')
+ return(fn);
+ sepp = sep;
+ while ((sepc = *sepp++) != '\0' && sepc != c)
+ continue;
+ if (sepc != '\0') /* it was a separator */
+ break;
+ }
+ if (fn < nfields)
+ *(p-1) = '\0';
+ for (;;) {
+ c = *p++;
+ sepp = sep;
+ while ((sepc = *sepp++) != '\0' && sepc != c)
+ continue;
+ if (sepc == '\0') /* it wasn't a separator */
+ break;
+ }
+ p--;
+ }
+
+ /* not reached */
+}
+
+#ifdef TEST_SPLIT
+
+
+/*
+ * test program
+ * pgm runs regression
+ * pgm sep splits stdin lines by sep
+ * pgm str sep splits str by sep
+ * pgm str sep n splits str by sep n times
+ */
+int
+main(int argc, char *argv[])
+{
+ char buf[512];
+ int n;
+# define MNF 10
+ char *fields[MNF];
+
+ if (argc > 4)
+ for (n = atoi(argv[3]); n > 0; n--) {
+ (void) strcpy(buf, argv[1]);
+ }
+ else if (argc > 3)
+ for (n = atoi(argv[3]); n > 0; n--) {
+ (void) strcpy(buf, argv[1]);
+ (void) split(buf, fields, MNF, argv[2]);
+ }
+ else if (argc > 2)
+ dosplit(argv[1], argv[2]);
+ else if (argc > 1)
+ while (fgets(buf, sizeof(buf), stdin) != NULL) {
+ buf[strlen(buf)-1] = '\0'; /* stomp newline */
+ dosplit(buf, argv[1]);
+ }
+ else
+ regress();
+
+ exit(0);
+}
+
+void
+dosplit(char *string, char *seps)
+{
+# define NF 5
+ char *fields[NF];
+ int nf;
+
+ nf = split(string, fields, NF, seps);
+ print(nf, NF, fields);
+}
+
+void
+print(int nf, int nfp, char *fields)
+{
+ int fn;
+ int bound;
+
+ bound = (nf > nfp) ? nfp : nf;
+ printf("%d:\t", nf);
+ for (fn = 0; fn < bound; fn++)
+ printf("\"%s\"%s", fields[fn], (fn+1 < nf) ? ", " : "\n");
+}
+
+#define RNF 5 /* some table entries know this */
+struct {
+ char *str;
+ char *seps;
+ int nf;
+ char *fi[RNF];
+} tests[] = {
+ "", " ", 0, { "" },
+ " ", " ", 2, { "", "" },
+ "x", " ", 1, { "x" },
+ "xy", " ", 1, { "xy" },
+ "x y", " ", 2, { "x", "y" },
+ "abc def g ", " ", 5, { "abc", "def", "", "g", "" },
+ " a bcd", " ", 4, { "", "", "a", "bcd" },
+ "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" },
+ " a b c d ", " ", 6, { "", "a", "b", "c", "d " },
+
+ "", " _", 0, { "" },
+ " ", " _", 2, { "", "" },
+ "x", " _", 1, { "x" },
+ "x y", " _", 2, { "x", "y" },
+ "ab _ cd", " _", 2, { "ab", "cd" },
+ " a_b c ", " _", 5, { "", "a", "b", "c", "" },
+ "a b c_d e f", " _", 6, { "a", "b", "c", "d", "e f" },
+ " a b c d ", " _", 6, { "", "a", "b", "c", "d " },
+
+ "", " _~", 0, { "" },
+ " ", " _~", 2, { "", "" },
+ "x", " _~", 1, { "x" },
+ "x y", " _~", 2, { "x", "y" },
+ "ab _~ cd", " _~", 2, { "ab", "cd" },
+ " a_b c~", " _~", 5, { "", "a", "b", "c", "" },
+ "a b_c d~e f", " _~", 6, { "a", "b", "c", "d", "e f" },
+ "~a b c d ", " _~", 6, { "", "a", "b", "c", "d " },
+
+ "", " _~-", 0, { "" },
+ " ", " _~-", 2, { "", "" },
+ "x", " _~-", 1, { "x" },
+ "x y", " _~-", 2, { "x", "y" },
+ "ab _~- cd", " _~-", 2, { "ab", "cd" },
+ " a_b c~", " _~-", 5, { "", "a", "b", "c", "" },
+ "a b_c-d~e f", " _~-", 6, { "a", "b", "c", "d", "e f" },
+ "~a-b c d ", " _~-", 6, { "", "a", "b", "c", "d " },
+
+ "", " ", 0, { "" },
+ " ", " ", 2, { "", "" },
+ "x", " ", 1, { "x" },
+ "xy", " ", 1, { "xy" },
+ "x y", " ", 2, { "x", "y" },
+ "abc def g ", " ", 4, { "abc", "def", "g", "" },
+ " a bcd", " ", 3, { "", "a", "bcd" },
+ "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" },
+ " a b c d ", " ", 6, { "", "a", "b", "c", "d " },
+
+ "", "", 0, { "" },
+ " ", "", 0, { "" },
+ "x", "", 1, { "x" },
+ "xy", "", 1, { "xy" },
+ "x y", "", 2, { "x", "y" },
+ "abc def g ", "", 3, { "abc", "def", "g" },
+ "\t a bcd", "", 2, { "a", "bcd" },
+ " a \tb\t c ", "", 3, { "a", "b", "c" },
+ "a b c d e ", "", 5, { "a", "b", "c", "d", "e" },
+ "a b\tc d e f", "", 6, { "a", "b", "c", "d", "e f" },
+ " a b c d e f ", "", 6, { "a", "b", "c", "d", "e f " },
+
+ NULL, NULL, 0, { NULL },
+};
+
+void
+regress(void)
+{
+ char buf[512];
+ int n;
+ char *fields[RNF+1];
+ int nf;
+ int i;
+ int printit;
+ char *f;
+
+ for (n = 0; tests[n].str != NULL; n++) {
+ (void) strcpy(buf, tests[n].str);
+ fields[RNF] = NULL;
+ nf = split(buf, fields, RNF, tests[n].seps);
+ printit = 0;
+ if (nf != tests[n].nf) {
+ printf("split `%s' by `%s' gave %d fields, not %d\n",
+ tests[n].str, tests[n].seps, nf, tests[n].nf);
+ printit = 1;
+ } else if (fields[RNF] != NULL) {
+ printf("split() went beyond array end\n");
+ printit = 1;
+ } else {
+ for (i = 0; i < nf && i < RNF; i++) {
+ f = fields[i];
+ if (f == NULL)
+ f = "(NULL)";
+ if (strcmp(f, tests[n].fi[i]) != 0) {
+ printf("split `%s' by `%s', field %d is `%s', not `%s'\n",
+ tests[n].str, tests[n].seps,
+ i, fields[i], tests[n].fi[i]);
+ printit = 1;
+ }
+ }
+ }
+ if (printit)
+ print(nf, RNF, fields);
+ }
+}
+#endif
diff --git a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c
new file mode 100644
index 0000000..468492c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c
@@ -0,0 +1,210 @@
+/* $NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $");
+
+#include <stdio.h>
+#include <regex.h>
+#include <string.h>
+#include <stdlib.h>
+#include <err.h>
+#include <atf-c.h>
+
+#ifndef REGEX_MAXSIZE
+#define REGEX_MAXSIZE 9999
+#endif
+
+static char *
+mkstr(const char *str, size_t len)
+{
+ size_t slen = strlen(str);
+ char *p = malloc(slen * len + 1);
+ ATF_REQUIRE(p != NULL);
+ for (size_t i = 0; i < len; i++)
+ strcpy(&p[i * slen], str);
+ return p;
+}
+
+static char *
+concat(const char *d, const char *s)
+{
+ size_t dlen = strlen(d);
+ size_t slen = strlen(s);
+ char *p = malloc(dlen + slen + 1);
+
+ ATF_REQUIRE(p != NULL);
+ strcpy(p, d);
+ strcpy(p + dlen, s);
+ return p;
+}
+
+static char *
+p0(size_t len)
+{
+ char *d, *s1, *s2;
+ s1 = mkstr("\\(", len);
+ s2 = concat(s1, ")");
+ free(s1);
+ d = concat("(", s2);
+ free(s2);
+ return d;
+}
+
+static char *
+p1(size_t len)
+{
+ char *d, *s1, *s2, *s3;
+ s1 = mkstr("\\(", 60);
+ s2 = mkstr("(.*)", len);
+ s3 = concat(s1, s2);
+ free(s2);
+ free(s1);
+ s1 = concat(s3, ")");
+ free(s3);
+ d = concat("(", s1);
+ free(s1);
+ return d;
+}
+
+static char *
+ps(const char *m, const char *s, size_t len)
+{
+ char *d, *s1, *s2, *s3;
+ s1 = mkstr(m, len);
+ s2 = mkstr(s, len);
+ s3 = concat(s1, s2);
+ free(s2);
+ free(s1);
+ d = concat("(.?)", s3);
+ free(s3);
+ return d;
+}
+
+static char *
+p2(size_t len)
+{
+ return ps("((.*){0,255}", ")", len);
+}
+
+static char *
+p3(size_t len)
+{
+ return ps("(.\\{0,}", ")", len);
+}
+
+static char *
+p4(size_t len)
+{
+ return ps("((.*){1,255}", ")", len);
+}
+
+static char *
+p5(size_t len)
+{
+ return ps("(", "){1,100}", len);
+}
+
+static char *
+p6(size_t len)
+{
+ char *d, *s1, *s2;
+ s1 = mkstr("(?:(.*)|", len);
+ s2 = concat(s1, "(.*)");
+ free(s1);
+ s1 = mkstr(")", len);
+ d = concat(s2, s1);
+ free(s1);
+ free(s2);
+ return d;
+}
+
+static const struct {
+ char *(*pattern)(size_t);
+ int type;
+} tests[] = {
+ { p0, REG_EXTENDED },
+ { p1, REG_EXTENDED },
+ { p2, REG_EXTENDED },
+ { p3, REG_EXTENDED },
+ { p4, REG_EXTENDED },
+ { p5, REG_EXTENDED },
+ { p6, REG_BASIC },
+};
+
+ATF_TC(regcomp_too_big);
+
+ATF_TC_HEAD(regcomp_too_big, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that large patterns don't"
+ " crash, but return a proper error code");
+ // libtre needs it.
+ atf_tc_set_md_var(tc, "timeout", "600");
+ atf_tc_set_md_var(tc, "require.memory", "120M");
+}
+
+ATF_TC_BODY(regcomp_too_big, tc)
+{
+ regex_t re;
+ int e;
+
+ for (size_t i = 0; i < __arraycount(tests); i++) {
+ char *d = (*tests[i].pattern)(REGEX_MAXSIZE);
+ e = regcomp(&re, d, tests[i].type);
+ if (e) {
+ char ebuf[1024];
+ (void)regerror(e, &re, ebuf, sizeof(ebuf));
+ ATF_REQUIRE_MSG(e == REG_ESPACE,
+ "regcomp returned %d (%s) for pattern %zu [%s]", e, ebuf,
+ i, d);
+ free(d);
+ continue;
+ }
+ free(d);
+ (void)regexec(&re, "aaaaaaaaaaa", 0, NULL, 0);
+ regfree(&re);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, regcomp_too_big);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/regex/t_regex.sh b/contrib/netbsd-tests/lib/libc/regex/t_regex.sh
new file mode 100755
index 0000000..bef3ac9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/t_regex.sh
@@ -0,0 +1,73 @@
+# $NetBSD: t_regex.sh,v 1.1 2012/08/24 20:24:40 jmmv Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+check()
+{
+ local dataname="${1}"; shift
+
+ prog="$(atf_get_srcdir)/h_regex"
+ data="$(atf_get_srcdir)/data/${dataname}.in"
+
+ atf_check -x "${prog} <${data}"
+ atf_check -x "${prog} -el <${data}"
+ atf_check -x "${prog} -er <${data}"
+}
+
+create_tc()
+{
+ local name="${1}"; shift
+ local descr="${1}"; shift
+
+ atf_test_case "${name}"
+ eval "${name}_head() { atf_set 'descr' '${descr}'; }"
+ eval "${name}_body() { check '${name}'; }"
+
+ atf_add_test_case "${name}"
+}
+
+atf_init_test_cases()
+{
+ create_tc basic "Checks basic functionality"
+ create_tc paren "Checks parentheses"
+ create_tc anchor "Checks anchors and REG_NEWLINE"
+ create_tc error "Checks syntax errors and non-errors"
+ create_tc meta "Checks metacharacters and backslashes"
+ create_tc backref "Checks back references"
+ create_tc repet_ordinary "Checks ordinary repetitions"
+ create_tc repet_bounded "Checks bounded repetitions"
+ create_tc repet_multi "Checks multiple repetitions"
+ create_tc bracket "Checks brackets"
+ create_tc complex "Checks various complex examples"
+ create_tc subtle "Checks various subtle examples"
+ create_tc c_comments "Checks matching C comments"
+ create_tc subexp "Checks subexpressions"
+ create_tc startend "Checks STARTEND option"
+ create_tc nospec "Checks NOSPEC option"
+ create_tc zero "Checks NULs"
+ create_tc word_bound "Checks word boundaries"
+ create_tc regress "Checks various past problems and suspected problems"
+}
diff --git a/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c b/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c
new file mode 100644
index 0000000..beaeb04
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c
@@ -0,0 +1,629 @@
+/* $NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $");
+
+#include <sys/param.h>
+
+#include <stdio.h>
+#include <regex.h>
+#include <string.h>
+#include <stdlib.h>
+#include <vis.h>
+#include <ctype.h>
+#include <atf-c.h>
+
+static const char sep[] = "\r\n\t";
+static const char delim[3] = "\\\\\0";
+
+
+static void
+fail(const char *pattern, const char *input, size_t lineno) {
+ fprintf(stderr,
+ "skipping failed test at line %zu (pattern=%s, input=%s)\n",
+ lineno, pattern, input);
+}
+
+static int
+bug(const char *pattern, const char *input, size_t lineno) {
+ static const struct {
+ const char *p;
+ const char *i;
+ } b[] = {
+#if defined(REGEX_SPENCER)
+ /*
+ * The default libc implementation by Henry Spencer
+ */
+ { "a[-]?c", "ac" }, // basic.dat
+ { "(a*)*", "a" }, // categorization.dat
+ { "(aba|a*b)*", "ababa" }, // categorization.dat
+ { "\\(a\\(b\\)*\\)*\\2", "abab" }, // categorization.dat
+ { "(a*)*", "aaaaaa" }, // nullsubexpression.dat
+ { "(a*)*", "aaaaaax" }, // nullsubexpression.dat
+ { "(a*)+", "a" }, // nullsubexpression.dat
+ { "(a*)+", "aaaaaa" }, // nullsubexpression.dat
+ { "(a*)+", "aaaaaax" }, // nullsubexpression.dat
+ { "([a]*)*", "a" }, // nullsubexpression.dat
+ { "([a]*)*", "aaaaaa" }, // nullsubexpression.dat
+ { "([a]*)*", "aaaaaax" }, // nullsubexpression.dat
+ { "([a]*)+", "a" }, // nullsubexpression.dat
+ { "([a]*)+", "aaaaaa" }, // nullsubexpression.dat
+ { "([a]*)+", "aaaaaax" }, // nullsubexpression.dat
+ { "([^b]*)*", "a" }, // nullsubexpression.dat
+ { "([^b]*)*", "aaaaaa" }, // nullsubexpression.dat
+ { "([^b]*)*", "aaaaaab" }, // nullsubexpression.dat
+ { "([ab]*)*", "a" }, // nullsubexpression.dat
+ { "([ab]*)*", "aaaaaa" }, // nullsubexpression.dat
+ { "([ab]*)*", "ababab" }, // nullsubexpression.dat
+ { "([ab]*)*", "bababa" }, // nullsubexpression.dat
+ { "([ab]*)*", "b" }, // nullsubexpression.dat
+ { "([ab]*)*", "bbbbbb" }, // nullsubexpression.dat
+ { "([ab]*)*", "aaaabcde" }, // nullsubexpression.dat
+ { "([^a]*)*", "b" }, // nullsubexpression.dat
+ { "([^a]*)*", "bbbbbb" }, // nullsubexpression.dat
+ { "([^ab]*)*", "ccccxx" }, // nullsubexpression.dat
+ { "\\(a*\\)*\\(x\\)", "ax" }, // nullsubexpression.dat
+ { "\\(a*\\)*\\(x\\)", "axa" }, // nullsubexpression.dat
+ { "\\(a*\\)*\\(x\\)\\(\\1\\)", "x" }, // nullsubexpression.dat
+/* crash! */ { "\\(a*\\)*\\(x\\)\\(\\1\\)", "ax" }, // nullsubexpression.dat
+/* crash! */ { "\\(a*\\)*\\(x\\)\\(\\1\\)\\(x\\)", "axxa" }, // ""
+ { "(a*)*(x)", "ax" }, // nullsubexpression.dat
+ { "(a*)*(x)", "axa" }, // nullsubexpression.dat
+ { "(a*)+(x)", "ax" }, // nullsubexpression.dat
+ { "(a*)+(x)", "axa" }, // nullsubexpression.dat
+ { "((a|ab)(c|bcd))(d*)", "abcd" }, // forcedassoc.dat
+ { "((a|ab)(bcd|c))(d*)", "abcd" }, // forcedassoc.dat
+ { "((ab|a)(c|bcd))(d*)", "abcd" }, // forcedassoc.dat
+ { "((ab|a)(bcd|c))(d*)", "abcd" }, // forcedassoc.dat
+ { "((a*)(b|abc))(c*)", "abc" }, // forcedassoc.dat
+ { "((a*)(abc|b))(c*)", "abc" }, // forcedassoc.dat
+ { "((..)|(.)){2}", "aaa" }, // repetition.dat
+ { "((..)|(.)){3}", "aaa" }, // repetition.dat
+ { "((..)|(.)){3}", "aaaa" }, // repetition.dat
+ { "((..)|(.)){3}", "aaaaa" }, // repetition.dat
+ { "X(.?){0,}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){1,}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){2,}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){3,}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){4,}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){5,}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){6,}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){7,}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){0,8}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){1,8}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){2,8}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){3,8}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){4,8}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){5,8}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){6,8}Y", "X1234567Y" }, // repetition.dat
+ { "X(.?){7,8}Y", "X1234567Y" }, // repetition.dat
+ { "(a|ab|c|bcd){0,}(d*)", "ababcd" }, // repetition.dat
+ { "(a|ab|c|bcd){1,}(d*)", "ababcd" }, // repetition.dat
+ { "(a|ab|c|bcd){2,}(d*)", "ababcd" }, // repetition.dat
+ { "(a|ab|c|bcd){3,}(d*)", "ababcd" }, // repetition.dat
+ { "(a|ab|c|bcd){1,10}(d*)", "ababcd" }, // repetition.dat
+ { "(a|ab|c|bcd){2,10}(d*)", "ababcd" }, // repetition.dat
+ { "(a|ab|c|bcd){3,10}(d*)", "ababcd" }, // repetition.dat
+ { "(a|ab|c|bcd)*(d*)", "ababcd" }, // repetition.dat
+ { "(a|ab|c|bcd)+(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd){0,}(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd){1,}(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd){2,}(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd){3,}(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd){1,10}(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd){2,10}(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd){3,10}(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd)*(d*)", "ababcd" }, // repetition.dat
+ { "(ab|a|c|bcd)+(d*)", "ababcd" }, // repetition.dat
+#elif defined(REGEX_TRE)
+ { "a[-]?c", "ac" }, // basic.dat
+ { "a\\(b\\)*\\1", "a" }, // categorization.dat
+ { "a\\(b\\)*\\1", "abab" }, // categorization.dat
+ { "\\(a\\(b\\)*\\)*\\2", "abab" }, // categorization.dat
+ { "\\(a*\\)*\\(x\\)\\(\\1\\)", "ax" }, // categorization.dat
+ { "\\(a*\\)*\\(x\\)\\(\\1\\)\\(x\\)", "axxa" }, // ""
+ { "((..)|(.))*", "aa" }, // repetition.dat
+ { "((..)|(.))*", "aaa" }, // repetition.dat
+ { "((..)|(.))*", "aaaaa" }, // repetition.dat
+ { "X(.?){7,}Y", "X1234567Y" }, // repetition.dat
+#else
+ { "", "" }
+#endif
+ };
+
+ for (size_t i = 0; i < __arraycount(b); i++) {
+ if (strcmp(pattern, b[i].p) == 0 &&
+ strcmp(input, b[i].i) == 0) {
+ fail(pattern, input, lineno);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+#ifdef REGEX_SPENCER
+#define HAVE_BRACES 1
+#define HAVE_MINIMAL 0
+#endif
+#ifndef HAVE_BRACES
+#define HAVE_BRACES 1
+#endif
+#ifndef HAVE_MINIMAL
+#define HAVE_MINIMAL 1
+#endif
+
+static int
+optional(const char *s)
+{
+ static const struct{
+ const char *n;
+ int v;
+ } nv[]= {
+ { "[[<element>]] not supported", HAVE_BRACES },
+ { "no *? +? mimimal match ops", HAVE_MINIMAL },
+ };
+
+ for (size_t i = 0; i < __arraycount(nv); i++)
+ if (strcmp(nv[i].n, s) == 0) {
+ if (nv[i].v)
+ return 0;
+ fprintf(stderr, "skipping unsupported [%s] tests\n", s);
+ return 1;
+ }
+
+ ATF_REQUIRE_MSG(0, "Unknown feature: %s", s);
+ return 0;
+}
+
+static int
+unsupported(const char *s)
+{
+ static const char *we[] = {
+#if defined(REGEX_SPENCER)
+ "ASSOCIATIVITY=left", // have right associativity
+ "SUBEXPRESSION=precedence", // have grouping subexpression
+ "REPEAT_LONGEST=last", // have first repeat longest
+ "BUG=alternation-order", // don't have it
+ "BUG=first-match", // don't have it
+ "BUG=nomatch-match", // don't have it
+ "BUG=repeat-any", // don't have it
+ "BUG=range-null", // don't have it
+ "BUG=repeat-null-unknown", // don't have it
+ "BUG=repeat-null", // don't have it
+ "BUG=repeat-artifact", // don't have it
+ "BUG=subexpression-first", // don't have it
+#elif defined(REGEX_TRE)
+ "ASSOCIATIVITY=right", // have left associativity
+ "SUBEXPRESSION=grouping", // have precedence subexpression
+ "REPEAT_LONGEST=first", // have last repeat longest
+ "LENGTH=first", // have last length
+ "BUG=alternation-order", // don't have it
+ "BUG=first-match", // don't have it
+ "BUG=range-null", // don't have it
+ "BUG=repeat-null", // don't have it
+ "BUG=repeat-artifact", // don't have it
+ "BUG=subexpression-first", // don't have it
+ "BUG=repeat-short", // don't have it
+#endif
+ };
+
+ if (s == NULL)
+ return 0;
+
+ while (*s == '#' || isspace((unsigned char)*s))
+ s++;
+
+ for (size_t i = 0; i < __arraycount(we); i++)
+ if (strcmp(we[i], s) == 0)
+ return 1;
+ return 0;
+}
+
+static void
+geterror(const char *s, int *comp, int *exec)
+{
+ static const struct {
+ const char *n;
+ int v;
+ int ce;
+ } nv[] = {
+#define COMP 1
+#define EXEC 2
+ { "OK", 0, COMP|EXEC },
+#define _DO(a, b) { # a, REG_ ## a, b },
+ _DO(NOMATCH, EXEC)
+ _DO(BADPAT, COMP)
+ _DO(ECOLLATE, COMP)
+ _DO(ECTYPE, COMP)
+ _DO(EESCAPE, COMP)
+ _DO(ESUBREG, COMP)
+ _DO(EBRACK, COMP)
+ _DO(EPAREN, COMP)
+ _DO(EBRACE, COMP)
+ _DO(BADBR, COMP)
+ _DO(ERANGE, COMP)
+ _DO(ESPACE, EXEC)
+ _DO(BADRPT, COMP)
+ _DO(EMPTY, COMP)
+ _DO(ASSERT, COMP)
+ _DO(INVARG, COMP)
+ _DO(ENOSYS, COMP)
+#undef _DO
+ };
+ *comp = 0;
+ *exec = 0;
+ for (size_t i = 0; i < __arraycount(nv); i++)
+ if (strcmp(s, nv[i].n) == 0) {
+ if (nv[i].ce & COMP)
+ *comp = nv[i].v;
+ if (nv[i].ce & EXEC)
+ *exec = nv[i].v;
+ return;
+ }
+ ATF_REQUIRE_MSG(0, "Unknown error %s", s);
+ return;
+}
+
+static int
+getflags(char *s)
+{
+ int flags = 0;
+
+ for (;; s++)
+ switch (*s) {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ *s = '\0';
+ break;
+ case '\0':
+ return flags;
+ case 'B':
+ case 'E':
+ case 'F':
+ case 'L':
+ break;
+ case 'i':
+ flags |= REG_ICASE;
+ *s = '\0';
+ break;
+ case '$':
+ *s = '\0';
+ break;
+ case 'n':
+ *s = '\0';
+ break;
+ default:
+ ATF_REQUIRE_MSG(0, "Unknown char %c", *s);
+ break;
+ }
+}
+
+static size_t
+getmatches(const char *s)
+{
+ size_t i;
+ char *q;
+ for (i = 0; (q = strchr(s, '(')) != NULL; i++, s = q + 1)
+ continue;
+ ATF_REQUIRE_MSG(i != 0, "No parentheses found");
+ return i;
+}
+
+static void
+checkcomment(const char *s, size_t lineno)
+{
+ if (s && strstr(s, "BUG") != NULL)
+ fprintf(stderr, "Expected %s at line %zu\n", s, lineno);
+}
+
+static void
+checkmatches(const char *matches, size_t nm, const regmatch_t *pm,
+ size_t lineno)
+{
+ if (nm == 0)
+ return;
+
+ char *res;
+ size_t len = strlen(matches) + 1, off = 0;
+
+ ATF_REQUIRE((res = strdup(matches)) != NULL);
+ for (size_t i = 0; i < nm; i++) {
+ int l;
+ if (pm[i].rm_so == -1 && pm[i].rm_eo == -1)
+ l = snprintf(res + off, len - off, "(?,?)");
+ else
+ l = snprintf(res + off, len - off, "(%lld,%lld)",
+ (long long)pm[i].rm_so, (long long)pm[i].rm_eo);
+ ATF_REQUIRE_MSG((size_t) l < len - off, "String too long %s"
+ " cur=%d, max=%zu", res, l, len - off);
+ off += l;
+ }
+ ATF_REQUIRE_STREQ_MSG(res, matches, " at line %zu", lineno);
+ free(res);
+}
+
+static void
+att_test(const struct atf_tc *tc, const char *data_name)
+{
+ regex_t re;
+ char *line, *lastpattern = NULL, data_path[MAXPATHLEN];
+ size_t len, lineno = 0;
+ int skipping = 0;
+ FILE *input_file;
+
+ snprintf(data_path, sizeof(data_path), "%s/data/%s.dat",
+ atf_tc_get_config_var(tc, "srcdir"), data_name);
+
+ input_file = fopen(data_path, "r");
+ if (input_file == NULL)
+ atf_tc_fail("Failed to open input file %s", data_path);
+
+ for (; (line = fparseln(input_file, &len, &lineno, delim, 0))
+ != NULL; free(line)) {
+ char *name, *pattern, *input, *matches, *comment;
+ regmatch_t *pm;
+ size_t nm;
+#ifdef DEBUG
+ fprintf(stderr, "[%s]\n", line);
+#endif
+ if ((name = strtok(line, sep)) == NULL)
+ continue;
+
+ /*
+ * We check these early so that we skip the lines quickly
+ * in order to do more strict testing on the other arguments
+ * The same characters are also tested in the switch below
+ */
+ if (*name == '}') {
+ skipping = 0;
+ continue;
+ }
+ if (skipping)
+ continue;
+ if (*name == ';' || *name == '#' || strcmp(name, "NOTE") == 0)
+ continue;
+ if (*name == ':') {
+ /* Skip ":HA#???:" prefix */
+ while (*++name && *name != ':')
+ continue;
+ if (*name)
+ name++;
+ }
+
+ ATF_REQUIRE_MSG((pattern = strtok(NULL, sep)) != NULL,
+ "Missing pattern at line %zu", lineno);
+ ATF_REQUIRE_MSG((input = strtok(NULL, sep)) != NULL,
+ "Missing input at line %zu", lineno);
+
+ if (strchr(name, '$')) {
+ ATF_REQUIRE(strunvis(pattern, pattern) != -1);
+ ATF_REQUIRE(strunvis(input, input) != -1);
+ }
+
+
+ if (strcmp(input, "NULL") == 0)
+ *input = '\0';
+
+ if (strcmp(pattern, "SAME") == 0) {
+ ATF_REQUIRE(lastpattern != NULL);
+ pattern = lastpattern;
+ } else {
+ free(lastpattern);
+ ATF_REQUIRE((lastpattern = strdup(pattern)) != NULL);
+ }
+
+ ATF_REQUIRE_MSG((matches = strtok(NULL, sep)) != NULL,
+ "Missing matches at line %zu", lineno);
+
+ comment = strtok(NULL, sep);
+ switch (*name) {
+ case '{': /* Begin optional implementation */
+ if (optional(comment)) {
+ skipping++;
+ continue;
+ }
+ name++; /* We have it, so ignore */
+ break;
+ case '}': /* End optional implementation */
+ skipping = 0;
+ continue;
+ case '?': /* Optional */
+ case '|': /* Alternative */
+ if (unsupported(comment))
+ continue;
+ name++; /* We have it, so ignore */
+ break;
+ case '#': /* Comment */
+ case ';': /* Skip */
+ continue;
+ default:
+ break;
+ }
+
+ /* XXX: Our bug */
+ if (bug(pattern, input, lineno))
+ continue;
+
+ int comp, exec;
+ if (*matches != '(') {
+ geterror(matches, &comp, &exec);
+ pm = NULL;
+ nm = 0;
+ } else {
+ comp = exec = 0;
+ nm = getmatches(matches);
+ ATF_REQUIRE((pm = calloc(nm, sizeof(*pm))) != NULL);
+ }
+
+
+
+ int iflags = getflags(name);
+ for (; *name; name++) {
+ int flags;
+ switch (*name) {
+ case 'B':
+ flags = REG_BASIC;
+ break;
+ case 'E':
+ flags = REG_EXTENDED;
+ break;
+ case 'L':
+ flags = REG_NOSPEC;
+ break;
+ default:
+ ATF_REQUIRE_MSG(0, "Bad name %c", *name);
+ continue;
+ }
+ int c = regcomp(&re, pattern, flags | iflags);
+ ATF_REQUIRE_MSG(c == comp,
+ "regcomp returned %d for pattern %s at line %zu",
+ c, pattern, lineno);
+ if (c)
+ continue;
+ int e = regexec(&re, input, nm, pm, 0);
+ ATF_REQUIRE_MSG(e == exec, "Expected error %d,"
+ " got %d at line %zu", exec, e, lineno);
+ checkmatches(matches, nm, pm, lineno);
+ checkcomment(comment, lineno);
+ regfree(&re);
+ }
+ free(pm);
+ }
+
+ fclose(input_file);
+}
+
+ATF_TC(basic);
+ATF_TC_HEAD(basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests basic functionality");
+}
+ATF_TC_BODY(basic, tc)
+{
+ att_test(tc, "basic");
+}
+
+ATF_TC(categorization);
+ATF_TC_HEAD(categorization, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests implementation categorization");
+}
+ATF_TC_BODY(categorization, tc)
+{
+ att_test(tc, "categorization");
+}
+
+ATF_TC(nullsubexpr);
+ATF_TC_HEAD(nullsubexpr, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests (...)*");
+}
+ATF_TC_BODY(nullsubexpr, tc)
+{
+ att_test(tc, "nullsubexpr");
+}
+
+ATF_TC(leftassoc);
+ATF_TC_HEAD(leftassoc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests left-associative "
+ "implementations");
+}
+ATF_TC_BODY(leftassoc, tc)
+{
+#if SKIP_LEFTASSOC
+ /* jmmv: I converted the original shell-based tests to C and they
+ * disabled this test in a very unconventional way without giving
+ * any explation. Mark as broken here, but I don't know why. */
+ atf_tc_expect_fail("Reason for breakage unknown");
+#endif
+ att_test(tc, "leftassoc");
+}
+
+ATF_TC(rightassoc);
+ATF_TC_HEAD(rightassoc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests right-associative "
+ "implementations");
+}
+ATF_TC_BODY(rightassoc, tc)
+{
+#if SKIP_RIGHTASSOC
+ /* jmmv: I converted the original shell-based tests to C and they
+ * disabled this test in a very unconventional way without giving
+ * any explation. Mark as broken here, but I don't know why. */
+ atf_tc_expect_fail("Reason for breakage unknown");
+#endif
+ att_test(tc, "rightassoc");
+}
+
+ATF_TC(forcedassoc);
+ATF_TC_HEAD(forcedassoc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests subexpression grouping to "
+ "force association");
+}
+ATF_TC_BODY(forcedassoc, tc)
+{
+ att_test(tc, "forcedassoc");
+}
+
+ATF_TC(repetition);
+ATF_TC_HEAD(repetition, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests implicit vs. explicit "
+ "repetition");
+}
+ATF_TC_BODY(repetition, tc)
+{
+ att_test(tc, "repetition");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, basic);
+ ATF_TP_ADD_TC(tp, categorization);
+ ATF_TP_ADD_TC(tp, nullsubexpr);
+ ATF_TP_ADD_TC(tp, leftassoc);
+ ATF_TP_ADD_TC(tp, rightassoc);
+ ATF_TP_ADD_TC(tp, forcedassoc);
+ ATF_TP_ADD_TC(tp, repetition);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/regex/test_regex.h b/contrib/netbsd-tests/lib/libc/regex/test_regex.h
new file mode 100644
index 0000000..1d9f59d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/regex/test_regex.h
@@ -0,0 +1,44 @@
+/* $NetBSD: test_regex.h,v 1.1 2011/01/08 18:10:31 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* from main.c */
+void regress(FILE *);
+void try(char *, char *, char *, char *, char *, int);
+int options(int, char *);
+int opt(int, char *);
+void fixstr(char *);
+char *check(char *, regmatch_t, char *);
+
+/* from split.c */
+int split(char *string, char *fields[], int nfields, const char *sep);
+
+/* from debug.c */
+void regprint(regex_t *r, FILE *d);
diff --git a/contrib/netbsd-tests/lib/libc/rpc/h_testbits.x b/contrib/netbsd-tests/lib/libc/rpc/h_testbits.x
new file mode 100644
index 0000000..cbddfcc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/rpc/h_testbits.x
@@ -0,0 +1,21 @@
+/* $NetBSD: h_testbits.x,v 1.1 2011/01/08 06:59:37 pgoyette Exp $ */
+
+enum smallenum {
+ SE_ONE = 1,
+ SE_TWO = 2
+};
+
+enum medenum {
+ ME_NEG = -1234,
+ ME_ONE = 1,
+ ME_TWO = 2,
+ ME_MANY = 1234
+};
+
+enum bigenum {
+ BE_ONE = 1,
+ BE_TWO = 2,
+ BE_MANY = 1234,
+ BE_LOTS = 1234567
+};
+
diff --git a/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c b/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c
new file mode 100644
index 0000000..cc1ec09
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c
@@ -0,0 +1,157 @@
+/* $NetBSD: t_rpc.c,v 1.3 2013/02/28 15:56:53 christos Exp $ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_rpc.c,v 1.3 2013/02/28 15:56:53 christos Exp $");
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <rpc/rpc.h>
+#include <stdlib.h>
+#include <err.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <unistd.h>
+
+
+#ifndef TEST
+#include <atf-c.h>
+
+#define ERRX(ev, msg, ...) ATF_REQUIRE_MSG(0, msg, __VA_ARGS__)
+
+#define SKIPX(ev, msg, ...) do { \
+ atf_tc_skip(msg, __VA_ARGS__); \
+ return; \
+} while(/*CONSTCOND*/0)
+
+#else
+#define ERRX(ev, msg, ...) errx(ev, msg, __VA_ARGS__)
+#define SKIPX(ev, msg, ...) errx(ev, msg, __VA_ARGS__)
+#endif
+
+
+#define RPCBPROC_NULL 0
+
+static int
+reply(caddr_t replyp, struct netbuf * raddrp, struct netconfig * nconf)
+{
+ char host[NI_MAXHOST];
+ struct sockaddr *sock = raddrp->buf;
+ int error;
+
+
+ error = getnameinfo(sock, sock->sa_len, host, sizeof(host), NULL, 0, 0);
+ if (error)
+ warnx("Cannot resolve address (%s)", gai_strerror(error));
+ else
+ printf("response from: %s\n", host);
+ return 0;
+}
+
+extern bool __rpc_control(int, void *);
+
+static void
+onehost(const char *host, const char *transp)
+{
+ CLIENT *clnt;
+ struct netbuf addr;
+ struct timeval tv;
+
+ /*
+ * Magic!
+ */
+ tv.tv_sec = 0;
+ tv.tv_usec = 500000;
+#define CLCR_SET_RPCB_TIMEOUT 2
+ __rpc_control(CLCR_SET_RPCB_TIMEOUT, &tv);
+
+ if ((clnt = clnt_create(host, RPCBPROG, RPCBVERS, transp)) == NULL)
+ SKIPX(EXIT_FAILURE, "clnt_create (%s)", clnt_spcreateerror(""));
+
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ if (clnt_call(clnt, RPCBPROC_NULL, xdr_void, NULL, xdr_void, NULL, tv)
+ != RPC_SUCCESS)
+ ERRX(EXIT_FAILURE, "clnt_call (%s)", clnt_sperror(clnt, ""));
+ clnt_control(clnt, CLGET_SVC_ADDR, (char *) &addr);
+ reply(NULL, &addr, NULL);
+}
+
+#ifdef TEST
+static void
+allhosts(void)
+{
+ enum clnt_stat clnt_stat;
+
+ clnt_stat = rpc_broadcast(RPCBPROG, RPCBVERS, RPCBPROC_NULL,
+ (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_void,
+ NULL, (resultproc_t)reply, transp);
+ if (clnt_stat != RPC_SUCCESS && clnt_stat != RPC_TIMEDOUT)
+ ERRX(EXIT_FAILURE, "%s", clnt_sperrno(clnt_stat));
+}
+
+int
+main(int argc, char *argv[])
+{
+ int ch;
+ const char *transp = "udp";
+
+
+ while ((ch = getopt(argc, argv, "ut")) != -1)
+ switch (ch) {
+ case 't':
+ transp = "tcp";
+ break;
+ case 'u':
+ transp = "udp";
+ break;
+ default:
+ fprintf(stderr, "Usage: %s -[t|u] [<hostname>...]\n",
+ getprogname());
+ return EXIT_FAILURE;
+ }
+
+ if (argc == optind)
+ allhosts();
+ else
+ for (; optind < argc; optind++)
+ onehost(argv[optind], transp);
+
+ return EXIT_SUCCESS;
+}
+
+#else
+
+ATF_TC(get_svc_addr_tcp);
+ATF_TC_HEAD(get_svc_addr_tcp, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks CLGET_SVC_ADDR for tcp");
+
+}
+
+ATF_TC_BODY(get_svc_addr_tcp, tc)
+{
+ onehost("localhost", "tcp");
+
+}
+
+ATF_TC(get_svc_addr_udp);
+ATF_TC_HEAD(get_svc_addr_udp, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks CLGET_SVC_ADDR for udp");
+}
+
+ATF_TC_BODY(get_svc_addr_udp, tc)
+{
+ onehost("localhost", "udp");
+
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, get_svc_addr_udp);
+ ATF_TP_ADD_TC(tp, get_svc_addr_tcp);
+
+ return atf_no_error();
+}
+
+#endif
diff --git a/contrib/netbsd-tests/lib/libc/rpc/t_xdr.c b/contrib/netbsd-tests/lib/libc/rpc/t_xdr.c
new file mode 100644
index 0000000..2a68eb4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/rpc/t_xdr.c
@@ -0,0 +1,129 @@
+/* $NetBSD: t_xdr.c,v 1.1 2011/01/08 06:59:37 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Ben Harris.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 2001 Ben Harris
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_xdr.c,v 1.1 2011/01/08 06:59:37 pgoyette Exp $");
+
+#include <rpc/types.h>
+#include <rpc/xdr.h>
+
+#include <string.h>
+
+#include <atf-c.h>
+
+#include "h_testbits.h"
+
+char xdrdata[] = {
+ 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* double 1.0 */
+ 0x00, 0x00, 0x00, 0x01, /* enum smallenum SE_ONE */
+ 0xff, 0xff, 0xfb, 0x2e, /* enum medenum ME_NEG */
+ 0x00, 0x12, 0xd6, 0x87, /* enum bigenum BE_LOTS */
+};
+
+ATF_TC(xdr);
+ATF_TC_HEAD(xdr, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks encoding/decoding of doubles and enumerations");
+}
+ATF_TC_BODY(xdr, tc)
+{
+ XDR x;
+ double d;
+ smallenum s;
+ medenum m;
+ bigenum b;
+ char newdata[sizeof(xdrdata)];
+
+ xdrmem_create(&x, xdrdata, sizeof(xdrdata), XDR_DECODE);
+
+ ATF_REQUIRE_MSG(xdr_double(&x, &d), "xdr_double DECODE failed");
+ ATF_REQUIRE_EQ_MSG(d, 1.0, "double 1.0 decoded as %g", d);
+
+ ATF_REQUIRE_MSG(xdr_smallenum(&x, &s), "xdr_smallenum DECODE failed");
+ ATF_REQUIRE_EQ_MSG(s, SE_ONE, "SE_ONE decoded as %d", s);
+
+ ATF_REQUIRE_MSG(xdr_medenum(&x, &m), "xdr_medenum DECODE failed");
+ ATF_REQUIRE_EQ_MSG(m, ME_NEG, "ME_NEG decoded as %d", m);
+
+ ATF_REQUIRE_MSG(xdr_bigenum(&x, &b), "xdr_bigenum DECODE failed");
+ ATF_REQUIRE_EQ_MSG(b, BE_LOTS, "BE_LOTS decoded as %d", b);
+
+ xdr_destroy(&x);
+
+
+ xdrmem_create(&x, newdata, sizeof(newdata), XDR_ENCODE);
+
+ ATF_REQUIRE_MSG(xdr_double(&x, &d), "xdr_double ENCODE failed");
+ ATF_REQUIRE_MSG(xdr_smallenum(&x, &s), "xdr_smallenum ENCODE failed");
+ ATF_REQUIRE_MSG(xdr_medenum(&x, &m), "xdr_medenum ENCODE failed");
+ ATF_REQUIRE_MSG(xdr_bigenum(&x, &b), "xdr_bigenum ENCODE failed");
+ ATF_REQUIRE_MSG(memcmp(newdata, xdrdata, sizeof(xdrdata)) == 0,
+ "xdr ENCODE result differs");
+
+ xdr_destroy(&x);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, xdr);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c b/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c
new file mode 100644
index 0000000..4d2a93b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c
@@ -0,0 +1,196 @@
+/* $NetBSD: t_setjmp.c,v 1.1 2010/12/27 19:35:31 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Copyright (c) 1994 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 for the
+ * NetBSD Project. See http://www.NetBSD.org/ for
+ * information about NetBSD.
+ * 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: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_setjmp.c,v 1.1 2010/12/27 19:35:31 pgoyette Exp $");
+
+#include <sys/types.h>
+
+#include <errno.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#define REQUIRE_ERRNO(x) ATF_REQUIRE_MSG(x, "%s", strerror(errno))
+
+#define TEST_SETJMP 0
+#define TEST_U_SETJMP 1
+#define TEST_SIGSETJMP_SAVE 2
+#define TEST_SIGSETJMP_NOSAVE 3
+
+static int expectsignal;
+
+static void
+aborthandler(int signo)
+{
+ ATF_REQUIRE_MSG(expectsignal, "kill(SIGABRT) succeeded");
+ atf_tc_pass();
+}
+
+static void
+h_check(int test)
+{
+ struct sigaction sa;
+ jmp_buf jb;
+ sigjmp_buf sjb;
+ sigset_t ss;
+ int i, x;
+
+ i = getpid();
+
+ if (test == TEST_SETJMP || test == TEST_SIGSETJMP_SAVE)
+ expectsignal = 0;
+ else if (test == TEST_U_SETJMP || test == TEST_SIGSETJMP_NOSAVE)
+ expectsignal = 1;
+ else
+ atf_tc_fail("unknown test");
+
+ sa.sa_handler = aborthandler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ REQUIRE_ERRNO(sigaction(SIGABRT, &sa, NULL) != -1);
+ REQUIRE_ERRNO(sigemptyset(&ss) != -1);
+ REQUIRE_ERRNO(sigaddset(&ss, SIGABRT) != -1);
+ REQUIRE_ERRNO(sigprocmask(SIG_BLOCK, &ss, NULL) != -1);
+
+ if (test == TEST_SETJMP)
+ x = setjmp(jb);
+ else if (test == TEST_U_SETJMP)
+ x = _setjmp(jb);
+ else
+ x = sigsetjmp(sjb, !expectsignal);
+
+ if (x != 0) {
+ ATF_REQUIRE_MSG(x == i, "setjmp returned wrong value");
+ kill(i, SIGABRT);
+ ATF_REQUIRE_MSG(!expectsignal, "kill(SIGABRT) failed");
+ atf_tc_pass();
+ }
+
+ REQUIRE_ERRNO(sigprocmask(SIG_UNBLOCK, &ss, NULL) != -1);
+
+ if (test == TEST_SETJMP)
+ longjmp(jb, i);
+ else if (test == TEST_U_SETJMP)
+ _longjmp(jb, i);
+ else
+ siglongjmp(sjb, i);
+
+ atf_tc_fail("jmp failed");
+}
+
+ATF_TC(setjmp);
+ATF_TC_HEAD(setjmp, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks setjmp(3)");
+}
+ATF_TC_BODY(setjmp, tc)
+{
+ h_check(TEST_SETJMP);
+}
+
+ATF_TC(_setjmp);
+ATF_TC_HEAD(_setjmp, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks _setjmp(3)");
+}
+ATF_TC_BODY(_setjmp, tc)
+{
+ h_check(TEST_U_SETJMP);
+}
+
+ATF_TC(sigsetjmp_save);
+ATF_TC_HEAD(sigsetjmp_save, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks sigsetjmp(3) with savemask enabled");
+}
+ATF_TC_BODY(sigsetjmp_save, tc)
+{
+ h_check(TEST_SIGSETJMP_SAVE);
+}
+
+ATF_TC(sigsetjmp_nosave);
+ATF_TC_HEAD(sigsetjmp_nosave, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks sigsetjmp(3) with savemask disabled");
+}
+ATF_TC_BODY(sigsetjmp_nosave, tc)
+{
+ h_check(TEST_SIGSETJMP_NOSAVE);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, setjmp);
+ ATF_TP_ADD_TC(tp, _setjmp);
+ ATF_TP_ADD_TC(tp, sigsetjmp_save);
+ ATF_TP_ADD_TC(tp, sigsetjmp_nosave);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c b/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c
new file mode 100644
index 0000000..4437c92
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c
@@ -0,0 +1,218 @@
+/* $NetBSD: t_threadjmp.c,v 1.1 2011/04/21 18:58:20 martin Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Copyright (c) 1994 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 for the
+ * NetBSD Project. See http://www.NetBSD.org/ for
+ * information about NetBSD.
+ * 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: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_threadjmp.c,v 1.1 2011/04/21 18:58:20 martin Exp $");
+
+#include <sys/types.h>
+
+#include <errno.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <pthread.h>
+
+#include <atf-c.h>
+
+#define REQUIRE_ERRNO(x) ATF_REQUIRE_MSG(x, "%s", strerror(errno))
+
+#define TEST_SETJMP 0
+#define TEST_U_SETJMP 1
+#define TEST_SIGSETJMP_SAVE 2
+#define TEST_SIGSETJMP_NOSAVE 3
+
+static pthread_t myself = NULL;
+
+static int expectsignal;
+
+static void
+aborthandler(int signo)
+{
+ ATF_REQUIRE(myself == pthread_self());
+ ATF_REQUIRE_MSG(expectsignal, "kill(SIGABRT) succeeded");
+ atf_tc_pass();
+}
+
+static void
+h_check(int test)
+{
+ struct sigaction sa;
+ jmp_buf jb;
+ sigjmp_buf sjb;
+ sigset_t ss;
+ int i, x;
+
+ myself = pthread_self();
+ i = getpid();
+
+ if (test == TEST_SETJMP || test == TEST_SIGSETJMP_SAVE)
+ expectsignal = 0;
+ else if (test == TEST_U_SETJMP || test == TEST_SIGSETJMP_NOSAVE)
+ expectsignal = 1;
+ else
+ atf_tc_fail("unknown test");
+
+ sa.sa_handler = aborthandler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ REQUIRE_ERRNO(sigaction(SIGABRT, &sa, NULL) != -1);
+ REQUIRE_ERRNO(sigemptyset(&ss) != -1);
+ REQUIRE_ERRNO(sigaddset(&ss, SIGABRT) != -1);
+ REQUIRE_ERRNO(sigprocmask(SIG_BLOCK, &ss, NULL) != -1);
+ ATF_REQUIRE(myself == pthread_self());
+
+ if (test == TEST_SETJMP)
+ x = setjmp(jb);
+ else if (test == TEST_U_SETJMP)
+ x = _setjmp(jb);
+ else
+ x = sigsetjmp(sjb, !expectsignal);
+
+ if (x != 0) {
+ ATF_REQUIRE(myself == pthread_self());
+ ATF_REQUIRE_MSG(x == i, "setjmp returned wrong value");
+ kill(i, SIGABRT);
+ ATF_REQUIRE_MSG(!expectsignal, "kill(SIGABRT) failed");
+ ATF_REQUIRE(myself == pthread_self());
+ atf_tc_pass();
+ }
+
+ ATF_REQUIRE(myself == pthread_self());
+ REQUIRE_ERRNO(sigprocmask(SIG_UNBLOCK, &ss, NULL) != -1);
+
+ if (test == TEST_SETJMP)
+ longjmp(jb, i);
+ else if (test == TEST_U_SETJMP)
+ _longjmp(jb, i);
+ else
+ siglongjmp(sjb, i);
+
+ atf_tc_fail("jmp failed");
+}
+
+ATF_TC(setjmp);
+ATF_TC_HEAD(setjmp, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks pthread_self() and setjmp(3)");
+}
+ATF_TC_BODY(setjmp, tc)
+{
+ h_check(TEST_SETJMP);
+}
+
+ATF_TC(_setjmp);
+ATF_TC_HEAD(_setjmp, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks pthread_self() and _setjmp(3)");
+}
+ATF_TC_BODY(_setjmp, tc)
+{
+ h_check(TEST_U_SETJMP);
+}
+
+ATF_TC(sigsetjmp_save);
+ATF_TC_HEAD(sigsetjmp_save, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks pthread_self() and sigsetjmp(3) with savemask enabled");
+}
+ATF_TC_BODY(sigsetjmp_save, tc)
+{
+ h_check(TEST_SIGSETJMP_SAVE);
+}
+
+ATF_TC(sigsetjmp_nosave);
+ATF_TC_HEAD(sigsetjmp_nosave, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks pthread_self() and sigsetjmp(3) with savemask disabled");
+}
+ATF_TC_BODY(sigsetjmp_nosave, tc)
+{
+ h_check(TEST_SIGSETJMP_NOSAVE);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * These test cases try to verify setjmp and friends in a program
+ * linked with pthreads, and verify that pthread_self() stays
+ * consistent throughout the program. A setcontext() call invoked
+ * by *setjmp() might clobber the TLS special register used to
+ * implement pthread_self().
+ */
+ ATF_TP_ADD_TC(tp, setjmp);
+ ATF_TP_ADD_TC(tp, _setjmp);
+ ATF_TP_ADD_TC(tp, sigsetjmp_save);
+ ATF_TP_ADD_TC(tp, sigsetjmp_nosave);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_fgets.c b/contrib/netbsd-tests/lib/libc/ssp/h_fgets.c
new file mode 100644
index 0000000..ad9376a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_fgets.c
@@ -0,0 +1,46 @@
+/* $NetBSD: h_fgets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_fgets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ int len = atoi(argv[1]);
+ (void)fgets(b, len, stdin);
+ (void)printf("%s\n", b);
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_getcwd.c b/contrib/netbsd-tests/lib/libc/ssp/h_getcwd.c
new file mode 100644
index 0000000..68e3a6f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_getcwd.c
@@ -0,0 +1,47 @@
+/* $NetBSD: h_getcwd.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_getcwd.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <sys/param.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[MAXPATHLEN];
+ size_t len = atoi(argv[1]);
+ (void)getcwd(b, len);
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_gets.c b/contrib/netbsd-tests/lib/libc/ssp/h_gets.c
new file mode 100644
index 0000000..8c601b0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_gets.c
@@ -0,0 +1,43 @@
+/* $NetBSD: h_gets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_gets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ (void)gets(b);
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_memcpy.c b/contrib/netbsd-tests/lib/libc/ssp/h_memcpy.c
new file mode 100644
index 0000000..1950f73
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_memcpy.c
@@ -0,0 +1,48 @@
+/* $NetBSD: h_memcpy.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_memcpy.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ int len = atoi(argv[1]);
+
+ (void)memcpy(b, "1020202020202", len);
+ (void)printf("%*.*s\n", len, len, b);
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_memmove.c b/contrib/netbsd-tests/lib/libc/ssp/h_memmove.c
new file mode 100644
index 0000000..0ebfd29
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_memmove.c
@@ -0,0 +1,48 @@
+/* $NetBSD: h_memmove.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_memmove.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ int len = atoi(argv[1]);
+
+ (void)memmove(b, "1020202020202", len);
+ (void)printf("%*.*s\n", len, len, b);
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_memset.c b/contrib/netbsd-tests/lib/libc/ssp/h_memset.c
new file mode 100644
index 0000000..65ed5f2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_memset.c
@@ -0,0 +1,45 @@
+/* $NetBSD: h_memset.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_memset.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ size_t len = atoi(argv[1]);
+ (void)memset(b, 0, len);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_raw.c b/contrib/netbsd-tests/lib/libc/ssp/h_raw.c
new file mode 100644
index 0000000..a232481
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_raw.c
@@ -0,0 +1,57 @@
+/* $NetBSD: h_raw.c,v 1.6 2011/07/24 14:00:36 christos Exp $ */
+
+/*
+ * Copyright (c) 2011 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_raw.c,v 1.6 2011/07/24 14:00:36 christos Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void poke(int *, size_t);
+
+void
+poke(int *b, size_t index)
+{
+ size_t i;
+ volatile int sum = 0;
+
+ b[index] = 42;
+ for (i = 0; i < 10; i++)
+ sum += b[i];
+}
+
+int
+main(int argc, char *argv[])
+{
+ int b[10];
+
+ poke(b, atoi(argv[1]));
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_read.c b/contrib/netbsd-tests/lib/libc/ssp/h_read.c
new file mode 100644
index 0000000..5240af2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_read.c
@@ -0,0 +1,47 @@
+/* $NetBSD: h_read.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_read.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <sys/param.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[MAXPATHLEN];
+ size_t len = atoi(argv[1]);
+ (void)read(0, b, len);
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c b/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c
new file mode 100644
index 0000000..c18faed
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c
@@ -0,0 +1,47 @@
+/* $NetBSD: h_readlink.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_readlink.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <sys/param.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[MAXPATHLEN];
+ size_t len = atoi(argv[1]);
+ (void)readlink("/", b, len);
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c b/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c
new file mode 100644
index 0000000..93575a8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c
@@ -0,0 +1,45 @@
+/* $NetBSD: h_snprintf.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_snprintf.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ size_t len = atoi(argv[1]);
+ (void)snprintf(b, len, "%s", "0123456789");
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_sprintf.c b/contrib/netbsd-tests/lib/libc/ssp/h_sprintf.c
new file mode 100644
index 0000000..0f6d0cb
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_sprintf.c
@@ -0,0 +1,43 @@
+/* $NetBSD: h_sprintf.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_sprintf.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ (void)sprintf(b, "%s", argv[1]);
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_stpcpy.c b/contrib/netbsd-tests/lib/libc/ssp/h_stpcpy.c
new file mode 100644
index 0000000..c8dfbb7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_stpcpy.c
@@ -0,0 +1,49 @@
+/* $NetBSD: h_stpcpy.c,v 1.1 2014/04/06 19:28:59 christos Exp $ */
+
+/*
+ * Copyright (c) 2014 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_stpcpy.c,v 1.1 2014/04/06 19:28:59 christos Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ char *q = stpcpy(b, argv[1]);
+
+ if ((size_t)(q - b) != strlen(argv[1]))
+ abort();
+
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_stpncpy.c b/contrib/netbsd-tests/lib/libc/ssp/h_stpncpy.c
new file mode 100644
index 0000000..c03d2a8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_stpncpy.c
@@ -0,0 +1,56 @@
+/* $NetBSD: h_stpncpy.c,v 1.2 2014/04/07 15:09:20 christos Exp $ */
+
+/*
+ * Copyright (c) 2014 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_stpncpy.c,v 1.2 2014/04/07 15:09:20 christos Exp $");
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ int len = atoi(argv[1]);
+#if __GNUC_PREREQ__(4, 8)
+ char *q = stpncpy(b, "1020202020202", len);
+
+ if (q - b != len)
+ abort();
+#else
+ // gcc-4.5 lacks __builtin___stpncpy_chk, lose.
+ (void)strncpy(b, "1020202020202", len);
+#endif
+
+ (void)printf("%*.*s\n", len, len, b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_strcat.c b/contrib/netbsd-tests/lib/libc/ssp/h_strcat.c
new file mode 100644
index 0000000..687acf7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_strcat.c
@@ -0,0 +1,46 @@
+/* $NetBSD: h_strcat.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_strcat.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <string.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ (void)strcpy(b, "1");
+ (void)strcat(b, argv[1]);
+
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_strcpy.c b/contrib/netbsd-tests/lib/libc/ssp/h_strcpy.c
new file mode 100644
index 0000000..2a7f1f5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_strcpy.c
@@ -0,0 +1,45 @@
+/* $NetBSD: h_strcpy.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_strcpy.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <string.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ (void)strcpy(b, argv[1]);
+
+ (void)printf("%s\n", b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_strncat.c b/contrib/netbsd-tests/lib/libc/ssp/h_strncat.c
new file mode 100644
index 0000000..0d66c7b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_strncat.c
@@ -0,0 +1,48 @@
+/* $NetBSD: h_strncat.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_strncat.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ int len = atoi(argv[1]);
+ (void)strcpy(b, "1");
+ (void)strncat(b, "1020202020202", len);
+
+ (void)printf("%*.*s\n", len, len, b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_strncpy.c b/contrib/netbsd-tests/lib/libc/ssp/h_strncpy.c
new file mode 100644
index 0000000..fddf67b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_strncpy.c
@@ -0,0 +1,47 @@
+/* $NetBSD: h_strncpy.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_strncpy.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ int len = atoi(argv[1]);
+ (void)strncpy(b, "1020202020202", len);
+
+ (void)printf("%*.*s\n", len, len, b);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_vsnprintf.c b/contrib/netbsd-tests/lib/libc/ssp/h_vsnprintf.c
new file mode 100644
index 0000000..0f6af85
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_vsnprintf.c
@@ -0,0 +1,57 @@
+/* $NetBSD: h_vsnprintf.c,v 1.3 2012/03/15 02:02:22 joerg Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_vsnprintf.c,v 1.3 2012/03/15 02:02:22 joerg Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+static void wrap(size_t, const char *, ...) __printflike(2, 3);
+
+void
+wrap(size_t len, const char *fmt, ...)
+{
+ char b[10];
+ va_list ap;
+ va_start(ap, fmt);
+ (void)vsnprintf(b, len, fmt, ap);
+ (void)printf("%s\n", b);
+ va_end(ap);
+}
+
+int
+main(int argc, char *argv[])
+{
+ size_t len = atoi(argv[1]);
+ wrap(len, "%s", "012345678901234567890");
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_vsprintf.c b/contrib/netbsd-tests/lib/libc/ssp/h_vsprintf.c
new file mode 100644
index 0000000..c7fc780
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/h_vsprintf.c
@@ -0,0 +1,55 @@
+/* $NetBSD: h_vsprintf.c,v 1.3 2012/03/15 02:02:22 joerg Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_vsprintf.c,v 1.3 2012/03/15 02:02:22 joerg Exp $");
+
+#include <stdio.h>
+#include <stdarg.h>
+
+static void wrap(const char *, ...) __printflike(1, 2);
+
+static void
+wrap(const char *fmt, ...)
+{
+ char b[10];
+ va_list ap;
+ va_start(ap, fmt);
+ (void)vsprintf(b, fmt, ap);
+ (void)printf("%s\n", b);
+ va_end(ap);
+}
+
+int
+main(int argc, char *argv[])
+{
+ wrap("%s", argv[1]);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh
new file mode 100755
index 0000000..0514348
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh
@@ -0,0 +1,308 @@
+# $NetBSD: t_ssp.sh,v 1.7 2014/04/06 19:28:59 christos Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+h_pass()
+{
+ echo "Executing command [ $2$1 ]"
+ eval $2 atf_check -s exit:0 -o ignore -e ignore $1
+}
+
+h_fail()
+{
+ echo "Executing command [ $2$1 ]"
+ eval $2 atf_check -s signal:6 -o ignore -e ignore $1
+}
+
+atf_test_case sprintf
+sprintf_head()
+{
+ atf_set "descr" "Checks sprintf(3)"
+}
+sprintf_body()
+{
+ prog="$(atf_get_srcdir)/h_sprintf"
+
+ h_pass "$prog ok"
+ h_fail "$prog 0123456789"
+}
+
+atf_test_case vsprintf
+vsprintf_head()
+{
+ atf_set "descr" "Checks vsprintf(3)"
+}
+vsprintf_body()
+{
+ prog="$(atf_get_srcdir)/h_vsprintf"
+
+ h_pass "$prog ok"
+ h_fail "$prog 0123456789"
+}
+
+atf_test_case snprintf
+snprintf_head()
+{
+ atf_set "descr" "Checks snprintf(3)"
+}
+snprintf_body()
+{
+ prog="$(atf_get_srcdir)/h_snprintf"
+
+ h_pass "$prog 10"
+ h_fail "$prog 11"
+}
+
+atf_test_case vsnprintf
+vsnprintf_head()
+{
+ atf_set "descr" "Checks vsnprintf(3)"
+}
+vsnprintf_body()
+{
+ prog="$(atf_get_srcdir)/h_vsnprintf"
+
+ h_pass "$prog 10"
+ h_fail "$prog 11"
+}
+
+atf_test_case gets
+gets_head()
+{
+ atf_set "descr" "Checks gets(3)"
+}
+gets_body()
+{
+ prog="$(atf_get_srcdir)/h_gets"
+
+ h_pass "$prog" "echo ok |"
+ h_fail "$prog" "echo 0123456789 |"
+}
+
+atf_test_case fgets
+fgets_head()
+{
+ atf_set "descr" "Checks fgets(3)"
+}
+fgets_body()
+{
+ prog="$(atf_get_srcdir)/h_fgets"
+
+ h_pass "$prog 10" "echo ok |"
+ h_fail "$prog 11" "echo busted |"
+}
+
+atf_test_case memcpy
+memcpy_head()
+{
+ atf_set "descr" "Checks memcpy(3)"
+}
+memcpy_body()
+{
+ prog="$(atf_get_srcdir)/h_memcpy"
+
+ h_pass "$prog 10"
+ h_fail "$prog 11"
+}
+
+atf_test_case memmove
+memmove_head()
+{
+ atf_set "descr" "Checks memmove(3)"
+}
+memmove_body()
+{
+ prog="$(atf_get_srcdir)/h_memmove"
+
+ h_pass "$prog 10"
+ h_fail "$prog 11"
+}
+
+atf_test_case memset
+memset_head()
+{
+ atf_set "descr" "Checks memset(3)"
+}
+memset_body()
+{
+ prog="$(atf_get_srcdir)/h_memset"
+
+ h_pass "$prog 10"
+ h_fail "$prog 11"
+}
+
+atf_test_case strcpy
+strcpy_head()
+{
+ atf_set "descr" "Checks strcpy(3)"
+}
+strcpy_body()
+{
+ prog="$(atf_get_srcdir)/h_strcpy"
+
+ h_pass "$prog 0123456"
+ h_fail "$prog 0123456789"
+}
+
+atf_test_case stpcpy
+stpcpy_head()
+{
+ atf_set "descr" "Checks stpcpy(3)"
+}
+stpcpy_body()
+{
+ prog="$(atf_get_srcdir)/h_stpcpy"
+
+ h_pass "$prog 0123456"
+ h_fail "$prog 0123456789"
+}
+
+atf_test_case strcat
+strcat_head()
+{
+ atf_set "descr" "Checks strcat(3)"
+}
+strcat_body()
+{
+ prog="$(atf_get_srcdir)/h_strcat"
+
+ h_pass "$prog 0123456"
+ h_fail "$prog 0123456789ABCDEF"
+}
+
+atf_test_case strncpy
+strncpy_head()
+{
+ atf_set "descr" "Checks strncpy(3)"
+}
+strncpy_body()
+{
+ prog="$(atf_get_srcdir)/h_strncpy"
+
+ h_pass "$prog 10"
+ h_fail "$prog 11"
+}
+
+atf_test_case stpncpy
+stpncpy_head()
+{
+ atf_set "descr" "Checks stpncpy(3)"
+}
+stpncpy_body()
+{
+ prog="$(atf_get_srcdir)/h_stpncpy"
+
+ h_pass "$prog 10"
+ h_fail "$prog 11"
+}
+
+atf_test_case strncat
+strncat_head()
+{
+ atf_set "descr" "Checks strncat(3)"
+}
+strncat_body()
+{
+ prog="$(atf_get_srcdir)/h_strncat"
+
+ h_pass "$prog 8"
+ h_fail "$prog 9"
+}
+
+atf_test_case raw
+raw_head()
+{
+ atf_set "descr" "Checks raw array overflow"
+}
+raw_body()
+{
+ prog="$(atf_get_srcdir)/h_raw"
+
+ h_pass "$prog 9"
+ h_fail "$prog 10"
+}
+
+atf_test_case read
+read_head()
+{
+ atf_set "descr" "Checks read(2)"
+}
+read_body()
+{
+ prog="$(atf_get_srcdir)/h_read"
+
+ h_pass "$prog 1024" "echo foo |"
+ h_fail "$prog 1025" "echo bar |"
+}
+
+atf_test_case readlink
+readlink_head()
+{
+ atf_set "descr" "Checks readlink(2)"
+}
+readlink_body()
+{
+ prog="$(atf_get_srcdir)/h_readlink"
+
+ h_pass "$prog 1024"
+ h_fail "$prog 1025"
+}
+
+atf_test_case getcwd
+getcwd_head()
+{
+ atf_set "descr" "Checks getcwd(3)"
+}
+getcwd_body()
+{
+ prog="$(atf_get_srcdir)/h_getcwd"
+
+ h_pass "$prog 1024"
+ h_fail "$prog 1025"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case sprintf
+ atf_add_test_case vsprintf
+ atf_add_test_case snprintf
+ atf_add_test_case vsnprintf
+ atf_add_test_case gets
+ atf_add_test_case fgets
+ atf_add_test_case memcpy
+ atf_add_test_case memmove
+ atf_add_test_case memset
+ atf_add_test_case stpcpy
+ atf_add_test_case stpncpy
+ atf_add_test_case strcat
+ atf_add_test_case strcpy
+ atf_add_test_case strncat
+ atf_add_test_case strncpy
+ atf_add_test_case raw
+ atf_add_test_case read
+ atf_add_test_case readlink
+ atf_add_test_case getcwd
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_clearerr.c b/contrib/netbsd-tests/lib/libc/stdio/t_clearerr.c
new file mode 100644
index 0000000..251804e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_clearerr.c
@@ -0,0 +1,93 @@
+/* $NetBSD: t_clearerr.c,v 1.1 2011/05/01 16:36:37 jruoho Exp $ */
+
+/*
+ * Copyright (c) 2009, Stathis Kamperis
+ * All rights reserved.
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_clearerr.c,v 1.1 2011/05/01 16:36:37 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+
+static const char path[] = "/etc/passwd";
+
+ATF_TC(clearerr_basic);
+ATF_TC_HEAD(clearerr_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of clearerr(3)");
+}
+
+ATF_TC_BODY(clearerr_basic, tc)
+{
+ char buf[2048];
+ FILE *fp;
+
+ fp = fopen(path, "r");
+ ATF_REQUIRE(fp != NULL);
+
+ while (feof(fp) == 0)
+ (void)fread(buf, sizeof(buf), 1, fp);
+
+ ATF_REQUIRE(feof(fp) != 0);
+
+ errno = 0;
+ clearerr(fp);
+
+ ATF_REQUIRE(errno == 0);
+ ATF_REQUIRE(feof(fp) == 0);
+ ATF_REQUIRE(fclose(fp) != EOF);
+}
+
+ATF_TC(clearerr_err);
+ATF_TC_HEAD(clearerr_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that clearerr(3) does not fail");
+}
+
+ATF_TC_BODY(clearerr_err, tc)
+{
+ FILE *fp;
+
+ fp = fopen(path, "r");
+
+ ATF_REQUIRE(fp != NULL);
+ ATF_REQUIRE(fclose(fp) == 0);
+
+ errno = 0;
+ clearerr(fp);
+
+ ATF_REQUIRE(errno == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, clearerr_basic);
+ ATF_TP_ADD_TC(tp, clearerr_err);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c b/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c
new file mode 100644
index 0000000..766070c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c
@@ -0,0 +1,171 @@
+/* $NetBSD: t_fflush.c,v 1.1 2011/09/11 05:15:55 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fflush.c,v 1.1 2011/09/11 05:15:55 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+
+static const char *path = "fflush";
+
+ATF_TC_WITH_CLEANUP(fflush_err);
+ATF_TC_HEAD(fflush_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from fflush(3)");
+}
+
+ATF_TC_BODY(fflush_err, tc)
+{
+ FILE *f;
+
+ f = fopen(path, "w");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fflush(NULL) == 0);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ f = fopen(path, "r");
+ ATF_REQUIRE(f != NULL);
+
+ /*
+ * In NetBSD the call should fail if the supplied
+ * parameteris not an open stream or the stream is
+ * not open for writing.
+ */
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, fflush(f) == EOF);
+
+ ATF_REQUIRE(fclose(f) == 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, fflush(f) == EOF);
+
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(fflush_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(fflush_seek);
+ATF_TC_HEAD(fflush_seek, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test file offsets with fflush(3)");
+}
+
+ATF_TC_BODY(fflush_seek, tc)
+{
+ char buf[12];
+ int fd = -1;
+ FILE *f;
+
+ /*
+ * IEEE Std 1003.1-2008:
+ *
+ * "For a stream open for reading, if the file
+ * is not already at EOF, and the file is one
+ * capable of seeking, the file offset of the
+ * underlying open file description shall be
+ * adjusted so that the next operation on the
+ * open file description deals with the byte
+ * after the last one read from or written to
+ * the stream being flushed."
+ */
+ f = fopen(path, "w");
+ ATF_REQUIRE(f != NULL);
+
+ ATF_REQUIRE(fwrite("garbage", 1, 7, f) == 7);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ f = fopen(path, "r+");
+ ATF_REQUIRE(f != NULL);
+
+ fd = fileno(f);
+ ATF_REQUIRE(fd != -1);
+
+ ATF_REQUIRE(fread(buf, 1, 3, f) == 3);
+ ATF_REQUIRE(fflush(f) == 0);
+ ATF_REQUIRE(fseek(f, 0, SEEK_CUR) == 0);
+
+ /*
+ * Verify that the offsets are right and that
+ * a read operation resumes at the correct location.
+ */
+ ATF_REQUIRE(ftell(f) == 3);
+ ATF_REQUIRE(lseek(fd, 0, SEEK_CUR) == 3);
+ ATF_REQUIRE(fgetc(f) == 'b');
+
+ ATF_REQUIRE(fclose(f) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(fflush_seek, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(fpurge_err);
+ATF_TC_HEAD(fpurge_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from fpurge(3)");
+}
+
+ATF_TC_BODY(fpurge_err, tc)
+{
+ FILE *f;
+
+ f = fopen(path, "w");
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, fpurge(f) == EOF);
+
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(fpurge_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fflush_err);
+ ATF_TP_ADD_TC(tp, fflush_seek);
+ ATF_TP_ADD_TC(tp, fpurge_err);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c b/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c
new file mode 100644
index 0000000..212c7c86
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c
@@ -0,0 +1,1166 @@
+/* $NetBSD: t_fmemopen.c,v 1.4 2013/10/19 17:45:00 christos Exp $ */
+
+/*-
+ * Copyright (c)2010 Takehiko NOZAKI,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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__)
+#include <atf-c.h>
+#else
+#if defined(__linux__)
+#define _GNU_SOURCE
+#include <features.h>
+#endif
+#include <assert.h>
+#include <stdio.h>
+#define ATF_TC(arg0) static void arg0##_head(void)
+#define ATF_TC_HEAD(arg0, arg1) static void arg0##_head()
+#define atf_tc_set_md_var(arg0, arg1, ...) do { \
+ printf(__VA_ARGS__); \
+ puts(""); \
+} while (/*CONSTCOND*/0)
+#define ATF_TC_BODY(arg0, arg1) static void arg0##_body()
+#define ATF_CHECK(arg0) assert(arg0)
+#define ATF_TP_ADD_TCS(arg0) int main(void)
+#define ATF_TP_ADD_TC(arg0, arg1) arg1##_head(); arg1##_body()
+#define atf_no_error() 0
+#endif
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+
+const char *mode_rwa[] = {
+ "r", "rb", "r+", "rb+", "r+b",
+ "w", "wb", "w+", "wb+", "w+b",
+ "a", "ab", "a+", "ab+", "a+b",
+ NULL
+};
+
+const char *mode_r[] = { "r", "rb", "r+", "rb+", "r+b", NULL };
+const char *mode_w[] = { "w", "wb", "w+", "wb+", "w+b", NULL };
+const char *mode_a[] = { "a", "ab", "a+", "ab+", "a+b", NULL };
+
+struct testcase {
+ const char *s;
+ off_t n;
+} testcases[] = {
+#define TESTSTR(s) { s, sizeof(s)-1 }
+ TESTSTR("\0he quick brown fox jumps over the lazy dog"),
+ TESTSTR("T\0e quick brown fox jumps over the lazy dog"),
+ TESTSTR("Th\0 quick brown fox jumps over the lazy dog"),
+ TESTSTR("The\0quick brown fox jumps over the lazy dog"),
+ TESTSTR("The \0uick brown fox jumps over the lazy dog"),
+ TESTSTR("The q\0ick brown fox jumps over the lazy dog"),
+ TESTSTR("The qu\0ck brown fox jumps over the lazy dog"),
+ TESTSTR("The qui\0k brown fox jumps over the lazy dog"),
+ TESTSTR("The quic\0 brown fox jumps over the lazy dog"),
+ TESTSTR("The quick\0brown fox jumps over the lazy dog"),
+ TESTSTR("The quick \0rown fox jumps over the lazy dog"),
+ TESTSTR("The quick b\0own fox jumps over the lazy dog"),
+ TESTSTR("The quick br\0wn fox jumps over the lazy dog"),
+ TESTSTR("The quick bro\0n fox jumps over the lazy dog"),
+ TESTSTR("The quick brow\0 fox jumps over the lazy dog"),
+ TESTSTR("The quick brown\0fox jumps over the lazy dog"),
+ TESTSTR("The quick brown \0ox jumps over the lazy dog"),
+ TESTSTR("The quick brown f\0x jumps over the lazy dog"),
+ TESTSTR("The quick brown fo\0 jumps over the lazy dog"),
+ TESTSTR("The quick brown fox\0jumps over the lazy dog"),
+ TESTSTR("The quick brown fox \0umps over the lazy dog"),
+ TESTSTR("The quick brown fox j\0mps over the lazy dog"),
+ TESTSTR("The quick brown fox ju\0ps over the lazy dog"),
+ TESTSTR("The quick brown fox jum\0s over the lazy dog"),
+ TESTSTR("The quick brown fox jump\0 over the lazy dog"),
+ TESTSTR("The quick brown fox jumps\0over the lazy dog"),
+ TESTSTR("The quick brown fox jumps \0ver the lazy dog"),
+ TESTSTR("The quick brown fox jumps o\0er the lazy dog"),
+ TESTSTR("The quick brown fox jumps ov\0r the lazy dog"),
+ TESTSTR("The quick brown fox jumps ove\0 the lazy dog"),
+ TESTSTR("The quick brown fox jumps over\0the lazy dog"),
+ TESTSTR("The quick brown fox jumps over \0he lazy dog"),
+ TESTSTR("The quick brown fox jumps over t\0e lazy dog"),
+ TESTSTR("The quick brown fox jumps over th\0 lazy dog"),
+ TESTSTR("The quick brown fox jumps over the\0lazy dog"),
+ TESTSTR("The quick brown fox jumps over the \0azy dog"),
+ TESTSTR("The quick brown fox jumps over the l\0zy dog"),
+ TESTSTR("The quick brown fox jumps over the la\0y dog"),
+ TESTSTR("The quick brown fox jumps over the laz\0 dog"),
+ TESTSTR("The quick brown fox jumps over the lazy\0dog"),
+ TESTSTR("The quick brown fox jumps over the lazy \0og"),
+ TESTSTR("The quick brown fox jumps over the lazy d\0g"),
+ TESTSTR("The quick brown fox jumps over the lazy do\0"),
+ TESTSTR("The quick brown fox jumps over the lazy dog"),
+ { NULL, 0 },
+};
+
+ATF_TC(test00);
+ATF_TC_HEAD(test00, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test00");
+}
+ATF_TC_BODY(test00, tc)
+{
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (p = &mode_rwa[0]; *p != NULL; ++p) {
+ fp = fmemopen(&buf[0], sizeof(buf), *p);
+/*
+ * Upon successful completion, fmemopen() shall return a pointer to the
+ * object controlling the stream.
+ */
+ ATF_CHECK(fp != NULL);
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+}
+
+ATF_TC(test01);
+ATF_TC_HEAD(test01, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test01");
+}
+ATF_TC_BODY(test01, tc)
+{
+ const char **p;
+ const char *mode[] = {
+ "r+", "rb+", "r+b",
+ "w+", "wb+", "w+b",
+ "a+", "ab+", "a+b",
+ NULL
+ };
+ FILE *fp;
+
+ for (p = &mode[0]; *p != NULL; ++p) {
+/*
+ * If a null pointer is specified as the buf argument, fmemopen() shall
+ * allocate size bytes of memory as if by a call to malloc().
+ */
+ fp = fmemopen(NULL, BUFSIZ, *p);
+ ATF_CHECK(fp != NULL);
+
+/*
+ * If buf is a null pointer, the initial position shall always be set
+ * to the beginning of the buffer.
+ */
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+}
+
+ATF_TC(test02);
+ATF_TC_HEAD(test02, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test02");
+}
+ATF_TC_BODY(test02, tc)
+{
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (p = &mode_r[0]; *p != NULL; ++p) {
+
+ memset(&buf[0], 0x1, sizeof(buf));
+ fp = fmemopen(&buf[0], sizeof(buf), *p);
+ ATF_CHECK(fp != NULL);
+
+/*
+ * This position is initially set to either the beginning of the buffer
+ * (for r and w modes)
+ */
+ ATF_CHECK((unsigned char)buf[0] == 0x1);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+/*
+ * The stream also maintains the size of the current buffer contents.
+ * For modes r and r+ the size is set to the value given by the size argument.
+ */
+#if !defined(__GLIBC__)
+ ATF_CHECK(fseeko(fp, (off_t)0, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)sizeof(buf));
+#endif
+ ATF_CHECK(fclose(fp) == 0);
+ }
+}
+
+ATF_TC(test03);
+ATF_TC_HEAD(test03, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test03");
+}
+ATF_TC_BODY(test03, tc)
+{
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (p = &mode_w[0]; *p != NULL; ++p) {
+
+ memset(&buf[0], 0x1, sizeof(buf));
+ fp = fmemopen(&buf[0], sizeof(buf), *p);
+ ATF_CHECK(fp != NULL);
+
+/*
+ * This position is initially set to either the beginning of the buffer
+ * (for r and w modes)
+ */
+ ATF_CHECK(buf[0] == '\0');
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+/*
+ * For modes w and w+ the initial size is zero
+ */
+ ATF_CHECK(fseeko(fp, (off_t)0, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+}
+
+ATF_TC(test04);
+ATF_TC_HEAD(test04, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test04");
+}
+ATF_TC_BODY(test04, tc)
+{
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+/*
+ * or to the first null byte in the buffer (for a modes)
+ */
+ for (p = &mode_a[0]; *p != NULL; ++p) {
+
+ memset(&buf[0], 0x1, sizeof(buf));
+ fp = fmemopen(&buf[0], sizeof(buf), *p);
+ ATF_CHECK(fp != NULL);
+
+ ATF_CHECK((unsigned char)buf[0] == 0x1);
+
+/* If no null byte is found in append mode,
+ * the initial position is set to one byte after the end of the buffer.
+ */
+#if !defined(__GLIBC__)
+ ATF_CHECK(ftello(fp) == (off_t)sizeof(buf));
+#endif
+
+/*
+ * and for modes a and a+ the initial size is either the position of the
+ * first null byte in the buffer or the value of the size argument
+ * if no null byte is found.
+ */
+#if !defined(__GLIBC__)
+ ATF_CHECK(fseeko(fp, (off_t)0, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)sizeof(buf));
+#endif
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+}
+
+ATF_TC(test05);
+ATF_TC_HEAD(test05, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test05");
+}
+ATF_TC_BODY(test05, tc)
+{
+ const char **p;
+ FILE *fp;
+ char buf[BUFSIZ];
+
+ for (p = &mode_rwa[0]; *p != NULL; ++p) {
+/*
+ * Otherwise, a null pointer shall be returned, and errno shall be set
+ * to indicate the error.
+ */
+ errno = 0;
+ fp = fmemopen(NULL, (size_t)0, *p);
+ ATF_CHECK(fp == NULL);
+ ATF_CHECK(errno == EINVAL);
+
+ errno = 0;
+ fp = fmemopen((void *)&buf[0], 0, *p);
+ ATF_CHECK(fp == NULL);
+ ATF_CHECK(errno == EINVAL);
+ }
+}
+
+ATF_TC(test06);
+ATF_TC_HEAD(test06, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test06");
+}
+ATF_TC_BODY(test06, tc)
+{
+ const char **p;
+ const char *mode[] = { "", " ", "???", NULL };
+ FILE *fp;
+
+ for (p = &mode[0]; *p != NULL; ++p) {
+/*
+ * The value of the mode argument is not valid.
+ */
+ fp = fmemopen(NULL, 1, *p);
+ ATF_CHECK(fp == NULL);
+ ATF_CHECK(errno == EINVAL);
+ }
+}
+
+ATF_TC(test07);
+ATF_TC_HEAD(test07, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test07");
+}
+ATF_TC_BODY(test07, tc)
+{
+#if !defined(__GLIBC__)
+ const char **p;
+ const char *mode[] = {
+ "r", "rb",
+ "w", "wb",
+ "a", "ab",
+ NULL
+ };
+ FILE *fp;
+
+ for (p = &mode[0]; *p != NULL; ++p) {
+/*
+ * Because this feature is only useful when the stream is opened for updating
+ * (because there is no way to get a pointer to the buffer) the fmemopen()
+ * call may fail if the mode argument does not include a '+' .
+ */
+ errno = 0;
+ fp = fmemopen(NULL, 1, *p);
+ ATF_CHECK(fp == NULL);
+ ATF_CHECK(errno == EINVAL);
+ }
+#endif
+}
+
+ATF_TC(test08);
+ATF_TC_HEAD(test08, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test08");
+}
+ATF_TC_BODY(test08, tc)
+{
+#if !defined(__GLIBC__)
+ const char **p;
+ const char *mode[] = {
+ "r+", "rb+", "r+b",
+ "w+", "wb+", "w+b",
+ "a+", "ab+", "a+b",
+ NULL
+ };
+ FILE *fp;
+
+ for (p = &mode[0]; *p != NULL; ++p) {
+/*
+ * The buf argument is a null pointer and the allocation of a buffer of
+ * length size has failed.
+ */
+ fp = fmemopen(NULL, SIZE_MAX, *p);
+ ATF_CHECK(fp == NULL);
+ ATF_CHECK(errno == ENOMEM);
+ }
+#endif
+}
+
+/*
+ * test09 - test14:
+ * An attempt to seek a memory buffer stream to a negative position or to a
+ * position larger than the buffer size given in the size argument shall fail.
+ */
+
+ATF_TC(test09);
+ATF_TC_HEAD(test09, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test09");
+}
+ATF_TC_BODY(test09, tc)
+{
+ struct testcase *t;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+ off_t i;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ for (p = &mode_rwa[0]; *p != NULL; ++p) {
+
+ memcpy(&buf[0], t->s, t->n);
+ fp = fmemopen(&buf[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+
+/*
+ * test fmemopen_seek(SEEK_SET)
+ */
+ /* zero */
+ ATF_CHECK(fseeko(fp, (off_t)0, SEEK_SET) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ /* positive */
+ for (i = (off_t)1; i <= (off_t)t->n; ++i) {
+ ATF_CHECK(fseeko(fp, i, SEEK_SET) == 0);
+ ATF_CHECK(ftello(fp) == i);
+ }
+ /* positive + OOB */
+ ATF_CHECK(fseeko(fp, t->n + 1, SEEK_SET) == -1);
+ ATF_CHECK(ftello(fp) == t->n);
+
+ /* negative + OOB */
+ ATF_CHECK(fseeko(fp, (off_t)-1, SEEK_SET) == -1);
+ ATF_CHECK(ftello(fp) == t->n);
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+const char *mode_rw[] = {
+ "r", "rb", "r+", "rb+", "r+b",
+ "w", "wb", "w+", "wb+", "w+b",
+ NULL
+};
+
+ATF_TC(test10);
+ATF_TC_HEAD(test10, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test10");
+}
+ATF_TC_BODY(test10, tc)
+{
+ struct testcase *t;
+ off_t i;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ for (p = &mode_rw[0]; *p != NULL; ++p) {
+
+ memcpy(&buf[0], t->s, t->n);
+ fp = fmemopen(&buf[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+
+/*
+ * test fmemopen_seek(SEEK_CUR)
+ */
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ /* zero */
+ ATF_CHECK(fseeko(fp, (off_t)0, SEEK_CUR) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ /* negative & OOB */
+ ATF_CHECK(fseeko(fp, (off_t)-1, SEEK_CUR) == -1);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ /* positive */
+ for (i = 0; i < (off_t)t->n; ++i) {
+ ATF_CHECK(fseeko(fp, (off_t)1, SEEK_CUR) == 0);
+ ATF_CHECK(ftello(fp) == i + 1);
+ }
+
+ /* positive & OOB */
+ ATF_CHECK(fseeko(fp, (off_t)1, SEEK_CUR) == -1);
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test11);
+ATF_TC_HEAD(test11, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test11");
+}
+ATF_TC_BODY(test11, tc)
+{
+ struct testcase *t;
+ off_t len, rest, i;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ /* test fmemopen_seek(SEEK_CUR) */
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ len = (off_t)strnlen(t->s, t->n);
+ rest = (off_t)t->n - len;
+ for (p = &mode_a[0]; *p != NULL; ++p) {
+
+ memcpy(&buf[0], t->s, t->n);
+ fp = fmemopen(&buf[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+/*
+ * test fmemopen_seek(SEEK_CUR)
+ */
+#if defined(__GLIBC__)
+ if (i < (off_t)t->n) {
+#endif
+ /* zero */
+ ATF_CHECK(fseeko(fp, (off_t)0, SEEK_CUR) == 0);
+ ATF_CHECK(ftello(fp) == len);
+
+ /* posive */
+ for (i = (off_t)1; i <= rest; ++i) {
+ ATF_CHECK(fseeko(fp, (off_t)1, SEEK_CUR) == 0);
+ ATF_CHECK(ftello(fp) == len + i);
+ }
+
+ /* positive + OOB */
+ ATF_CHECK(fseeko(fp, (off_t)1, SEEK_CUR) == -1);
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+
+ /* negative */
+ for (i = (off_t)1; i <= (off_t)t->n; ++i) {
+ ATF_CHECK(fseeko(fp, (off_t)-1, SEEK_CUR) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)t->n - i);
+ }
+
+ /* negative + OOB */
+ ATF_CHECK(fseeko(fp, (off_t)-1, SEEK_CUR) == -1);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+#if defined(__GLIBC__)
+ }
+#endif
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test12);
+ATF_TC_HEAD(test12, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test12");
+}
+ATF_TC_BODY(test12, tc)
+{
+ struct testcase *t;
+ off_t len, rest, i;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ /* test fmemopen_seek(SEEK_END) */
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ len = (off_t)strnlen(t->s, t->n);
+ rest = t->n - len;
+ for (p = &mode_r[0]; *p != NULL; ++p) {
+
+ memcpy(buf, t->s, t->n);
+ fp = fmemopen(&buf[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+
+/*
+ * test fmemopen_seek(SEEK_END)
+ */
+#if !defined(__GLIBC__)
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ /* zero */
+ ATF_CHECK(fseeko(fp, (off_t)0, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == len);
+
+ /* positive + OOB */
+ ATF_CHECK(fseeko(fp, rest + 1, SEEK_END) == -1);
+ ATF_CHECK(ftello(fp) == len);
+
+ /* negative + OOB */
+ ATF_CHECK(fseeko(fp, -(len + 1), SEEK_END) == -1);
+ ATF_CHECK(ftello(fp) == len);
+
+ /* positive */
+ for (i = 1; i <= rest; ++i) {
+ ATF_CHECK(fseeko(fp, i, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == len + i);
+ }
+
+ /* negative */
+ for (i = 1; i < len; ++i) {
+ ATF_CHECK(fseeko(fp, -i, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == len - i);
+ }
+#endif
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test13);
+ATF_TC_HEAD(test13, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test13");
+}
+ATF_TC_BODY(test13, tc)
+{
+ struct testcase *t;
+ off_t i;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ /* test fmemopen_seek(SEEK_END) */
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ for (p = &mode_w[0]; *p != NULL; ++p) {
+
+ memcpy(buf, t->s, t->n);
+ fp = fmemopen(&buf[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+/*
+ * test fmemopen_seek(SEEK_END)
+ */
+#if !defined(__GLIBC__)
+ ATF_CHECK(ftello(fp) == (off_t)0);
+ ATF_CHECK(buf[0] == '\0');
+
+ /* zero */
+ ATF_CHECK(fseeko(fp, (off_t)0, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ /* positive + OOB */
+ ATF_CHECK(fseeko(fp, (off_t)t->n + 1, SEEK_END) == -1);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ /* negative + OOB */
+ ATF_CHECK(fseeko(fp, -1, SEEK_END) == -1);
+ ATF_CHECK(ftello(fp) == (off_t)0);
+
+ /* positive */
+ for (i = 1; i <= t->n; ++i) {
+ ATF_CHECK(fseeko(fp, i, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == i);
+ }
+#endif
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test14);
+ATF_TC_HEAD(test14, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test14");
+}
+ATF_TC_BODY(test14, tc)
+{
+ struct testcase *t;
+ off_t len, rest, i;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ /* test fmemopen_seek(SEEK_END) */
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ len = (off_t)strnlen(t->s, t->n);
+ rest = (off_t)t->n - len;
+ for (p = &mode_a[0]; *p != NULL; ++p) {
+
+ memcpy(buf, t->s, t->n);
+ fp = fmemopen(&buf[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+/*
+ * test fmemopen_seek(SEEK_END)
+ */
+#if !defined(__GLIBC__)
+ ATF_CHECK(ftello(fp) == len);
+
+ /* zero */
+ ATF_CHECK(fseeko(fp, 0, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == len);
+
+ /* positive + OOB */
+ ATF_CHECK(fseeko(fp, rest + 1, SEEK_END) == -1);
+ ATF_CHECK(ftello(fp) == len);
+
+ /* negative + OOB */
+ ATF_CHECK(fseeko(fp, -(len + 1), SEEK_END) == -1);
+ ATF_CHECK(ftello(fp) == len);
+
+ /* positive */
+ for (i = 1; i <= rest; ++i) {
+ ATF_CHECK(fseeko(fp, i, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == len + i);
+ }
+
+ /* negative */
+ for (i = 1; i < len; ++i) {
+ ATF_CHECK(fseeko(fp, -i, SEEK_END) == 0);
+ ATF_CHECK(ftello(fp) == len - i);
+ }
+#endif
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+const char *mode_rw1[] = {
+ "r", "rb", "r+", "rb+", "r+b",
+ "w+", "wb+",
+ NULL
+};
+
+/* test15 - 18:
+ * When a stream open for writing is flushed or closed, a null byte is written
+ * at the current position or at the end of the buffer, depending on the size
+ * of the contents.
+ */
+
+ATF_TC(test15);
+ATF_TC_HEAD(test15, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test15");
+}
+ATF_TC_BODY(test15, tc)
+{
+ struct testcase *t;
+ const char **p;
+ char buf0[BUFSIZ];
+ FILE *fp;
+ int i;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ for (p = &mode_rw1[0]; *p != NULL; ++p) {
+
+ memcpy(&buf0[0], t->s, t->n);
+ fp = fmemopen(&buf0[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+/*
+ * test fmemopen_read + fgetc(3)
+ */
+ for (i = 0; i < t->n; ++i) {
+ ATF_CHECK(ftello(fp) == (off_t)i);
+ ATF_CHECK(fgetc(fp) == buf0[i]);
+ ATF_CHECK(feof(fp) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)i + 1);
+ }
+ ATF_CHECK(fgetc(fp) == EOF);
+ ATF_CHECK(feof(fp) != 0);
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test16);
+ATF_TC_HEAD(test16, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test16");
+}
+ATF_TC_BODY(test16, tc)
+{
+ struct testcase *t;
+ const char **p;
+ char buf0[BUFSIZ], buf1[BUFSIZ];
+ FILE *fp;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ for (p = &mode_rw1[0]; *p != NULL; ++p) {
+
+ memcpy(&buf0[0], t->s, t->n);
+ buf1[t->n] = 0x1;
+ fp = fmemopen(&buf0[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+/*
+ * test fmemopen_read + fread(4)
+ */
+ ATF_CHECK(ftello(fp) == (off_t)0);
+ ATF_CHECK(fread(&buf1[0], 1, sizeof(buf1), fp) == (size_t)t->n);
+ ATF_CHECK(feof(fp) != 0);
+ ATF_CHECK(memcmp(&buf0[0], &buf1[0], t->n) == 0);
+ ATF_CHECK((unsigned char)buf1[t->n] == 0x1);
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+const char *mode_a1[] = { "a+", "ab+", NULL };
+
+ATF_TC(test17);
+ATF_TC_HEAD(test17, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test17");
+}
+ATF_TC_BODY(test17, tc)
+{
+ struct testcase *t;
+ size_t len;
+ int i;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ len = strnlen(t->s, t->n);
+ for (p = &mode_a1[0]; *p != NULL; ++p) {
+
+ memcpy(&buf[0], t->s, t->n);
+ fp = fmemopen(&buf[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+/*
+ * test fmemopen_read + fgetc(3)
+ */
+#if defined(__GLIBC__)
+ if (i < t->n) {
+#endif
+ for (i = len; i < t->n; ++i) {
+ ATF_CHECK(ftello(fp) == (off_t)i);
+ ATF_CHECK(fgetc(fp) == buf[i]);
+ ATF_CHECK(feof(fp) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)i + 1);
+ }
+ ATF_CHECK(fgetc(fp) == EOF);
+ ATF_CHECK(feof(fp) != 0);
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+ rewind(fp);
+ for (i = 0; i < t->n; ++i) {
+ ATF_CHECK(ftello(fp) == (off_t)i);
+ ATF_CHECK(fgetc(fp) == buf[i]);
+ ATF_CHECK(feof(fp) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)i + 1);
+ }
+ ATF_CHECK(fgetc(fp) == EOF);
+ ATF_CHECK(feof(fp) != 0);
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+#if defined(__GLIBC__)
+ }
+#endif
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test18);
+ATF_TC_HEAD(test18, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test18");
+}
+ATF_TC_BODY(test18, tc)
+{
+ struct testcase *t;
+ size_t len;
+ const char **p;
+ char buf0[BUFSIZ], buf1[BUFSIZ];
+ FILE *fp;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ len = strnlen(t->s, t->n);
+ for (p = &mode_a1[0]; *p != NULL; ++p) {
+
+ memcpy(&buf0[0], t->s, t->n);
+ buf1[t->n - len] = 0x1;
+ fp = fmemopen(&buf0[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+/*
+ * test fmemopen_read + fread(3)
+ */
+#if defined(__GLIBC__)
+ if (i < t->n) {
+#endif
+ ATF_CHECK(ftello(fp) == (off_t)len);
+ ATF_CHECK(fread(&buf1[0], 1, sizeof(buf1), fp)
+ == t->n - len);
+ ATF_CHECK(feof(fp) != 0);
+ ATF_CHECK(!memcmp(&buf0[len], &buf1[0], t->n - len));
+ ATF_CHECK((unsigned char)buf1[t->n - len] == 0x1);
+ rewind(fp);
+ buf1[t->n] = 0x1;
+ ATF_CHECK(ftello(fp) == (off_t)0);
+ ATF_CHECK(fread(&buf1[0], 1, sizeof(buf1), fp)
+ == (size_t)t->n);
+ ATF_CHECK(feof(fp) != 0);
+ ATF_CHECK(!memcmp(&buf0[0], &buf1[0], t->n));
+ ATF_CHECK((unsigned char)buf1[t->n] == 0x1);
+#if defined(__GLIBC__)
+ }
+#endif
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+/*
+ * test19 - test22:
+ * If a stream open for update is flushed or closed and the last write has
+ * advanced the current buffer size, a null byte is written at the end of the
+ * buffer if it fits.
+ */
+
+const char *mode_rw2[] = {
+ "r+", "rb+", "r+b",
+ "w", "wb", "w+", "wb+", "w+b",
+ NULL
+};
+
+ATF_TC(test19);
+ATF_TC_HEAD(test19, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test19");
+}
+ATF_TC_BODY(test19, tc)
+{
+ struct testcase *t;
+ int i;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ for (p = &mode_rw2[0]; *p != NULL; ++p) {
+
+ memcpy(&buf[0], t->s, t->n);
+ buf[t->n] = 0x1;
+ fp = fmemopen(&buf[0], t->n + 1, *p);
+ ATF_CHECK(fp != NULL);
+ setbuf(fp, NULL);
+/*
+ * test fmemopen_write + fputc(3)
+ */
+ for (i = 0; i < t->n; ++i) {
+ ATF_CHECK(ftello(fp) == (off_t)i);
+ ATF_CHECK(fputc(t->s[i], fp) == t->s[i]);
+ ATF_CHECK(buf[i] == t->s[i]);
+ ATF_CHECK(ftello(fp) == (off_t)i + 1);
+ ATF_CHECK(buf[i] == t->s[i]);
+#if !defined(__GLIBC__)
+ ATF_CHECK(buf[i + 1] == '\0');
+#endif
+ }
+
+/* don't accept non nul character at end of buffer */
+ ATF_CHECK(fputc(0x1, fp) == EOF);
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+ ATF_CHECK(feof(fp) == 0);
+
+/* accept nul character at end of buffer */
+ ATF_CHECK(fputc('\0', fp) == '\0');
+ ATF_CHECK(ftello(fp) == (off_t)t->n + 1);
+ ATF_CHECK(feof(fp) == 0);
+
+/* reach EOF */
+ ATF_CHECK(fputc('\0', fp) == EOF);
+ ATF_CHECK(ftello(fp) == (off_t)t->n + 1);
+
+ /* compare */
+ ATF_CHECK(memcmp(&buf[0], t->s, t->n) == 0);
+ ATF_CHECK(buf[t->n] == '\0');
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test20);
+ATF_TC_HEAD(test20, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test20");
+}
+ATF_TC_BODY(test20, tc)
+{
+ struct testcase *t;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ for (p = &mode_rw2[0]; *p != NULL; ++p) {
+
+ memcpy(&buf[0], t->s, t->n);
+ buf[t->n] = 0x1;
+ fp = fmemopen(&buf[0], t->n + 1, *p);
+ ATF_CHECK(fp != NULL);
+ setbuf(fp, NULL);
+ ATF_CHECK(fwrite(t->s, 1, t->n, fp) == (size_t)t->n);
+/*
+ * test fmemopen_write + fwrite(3)
+ */
+#if !defined(__GLIBC__)
+ ATF_CHECK(buf[t->n] == '\0');
+
+/* don't accept non nul character at end of buffer */
+ ATF_CHECK(fwrite("\x1", 1, 1, fp) == 0);
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+ ATF_CHECK(feof(fp) == 0);
+#endif
+
+/* accept nul character at end of buffer */
+ ATF_CHECK(fwrite("\x0", 1, 1, fp) == 1);
+ ATF_CHECK(ftello(fp) == (off_t)t->n + 1);
+ ATF_CHECK(feof(fp) == 0);
+
+/* reach EOF */
+ ATF_CHECK(fputc('\0', fp) == EOF);
+ ATF_CHECK(ftello(fp) == (off_t)t->n + 1);
+
+/* compare */
+ ATF_CHECK(memcmp(&buf[0], t->s, t->n) == 0);
+ ATF_CHECK(buf[t->n] == '\0');
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test21);
+ATF_TC_HEAD(test21, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test21");
+}
+ATF_TC_BODY(test21, tc)
+{
+ struct testcase *t;
+ int len, i;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (t = &testcases[0]; t->s != NULL; ++t) {
+ len = strnlen(t->s, t->n);
+ for (p = &mode_a[0]; *p != NULL; ++p) {
+ memcpy(&buf[0], t->s, t->n);
+ fp = fmemopen(&buf[0], t->n, *p);
+ ATF_CHECK(fp != NULL);
+ setbuf(fp, NULL);
+/*
+ * test fmemopen_write + fputc(3)
+ */
+ if (len < t->n) {
+ for (i = len; i < t->n - 1; ++i) {
+ ATF_CHECK(ftello(fp) == (off_t)i);
+ ATF_CHECK(fputc(t->s[i - len], fp)
+ == t->s[i - len]);
+ ATF_CHECK(buf[i] == t->s[i - len]);
+ ATF_CHECK(ftello(fp) == (off_t)i + 1);
+#if !defined(__GLIBC__)
+ ATF_CHECK(buf[i + 1] == '\0');
+#endif
+ }
+
+/* don't accept non nul character at end of buffer */
+ ATF_CHECK(ftello(fp) == (off_t)t->n - 1);
+ ATF_CHECK(fputc(0x1, fp) == EOF);
+ ATF_CHECK(ftello(fp) == (off_t)t->n - 1);
+
+/* accept nul character at end of buffer */
+ ATF_CHECK(ftello(fp) == (off_t)t->n - 1);
+ ATF_CHECK(fputc('\0', fp) == '\0');
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+ }
+
+/* reach EOF */
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+ ATF_CHECK(fputc('\0', fp) == EOF);
+ ATF_CHECK(ftello(fp) == (off_t)t->n);
+
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+}
+
+ATF_TC(test22);
+ATF_TC_HEAD(test22, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "test22");
+}
+ATF_TC_BODY(test22, tc)
+{
+ struct testcase *t0, *t1;
+ size_t len0, len1, nleft;
+ const char **p;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ for (t0 = &testcases[0]; t0->s != NULL; ++t0) {
+ len0 = strnlen(t0->s, t0->n);
+ for (t1 = &testcases[0]; t1->s != NULL; ++t1) {
+ len1 = strnlen(t1->s, t1->n);
+ for (p = &mode_a[0]; *p != NULL; ++p) {
+
+ memcpy(&buf[0], t0->s, t0->n);
+ fp = fmemopen(&buf[0], t0->n, *p);
+ ATF_CHECK(fp != NULL);
+ setbuf(fp, NULL);
+/*
+ * test fmemopen_write + fwrite(3)
+ */
+ nleft = t0->n - len0;
+#if !defined(__GLIBC__)
+ if (nleft == 0 || len1 == nleft - 1) {
+ ATF_CHECK(fwrite(t1->s, 1, t1->n, fp)
+ == nleft);
+ ATF_CHECK(ftell(fp) == t1->n);
+ } else {
+ ATF_CHECK(fwrite(t1->s, 1, t1->n, fp)
+ == nleft - 1);
+ ATF_CHECK(ftell(fp) == t1->n - 1);
+ }
+#endif
+ ATF_CHECK(fclose(fp) == 0);
+ }
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, test00);
+ ATF_TP_ADD_TC(tp, test01);
+ ATF_TP_ADD_TC(tp, test02);
+ ATF_TP_ADD_TC(tp, test03);
+ ATF_TP_ADD_TC(tp, test04);
+ ATF_TP_ADD_TC(tp, test05);
+ ATF_TP_ADD_TC(tp, test06);
+ ATF_TP_ADD_TC(tp, test07);
+ ATF_TP_ADD_TC(tp, test08);
+ ATF_TP_ADD_TC(tp, test09);
+ ATF_TP_ADD_TC(tp, test10);
+ ATF_TP_ADD_TC(tp, test11);
+ ATF_TP_ADD_TC(tp, test12);
+ ATF_TP_ADD_TC(tp, test13);
+ ATF_TP_ADD_TC(tp, test14);
+ ATF_TP_ADD_TC(tp, test15);
+ ATF_TP_ADD_TC(tp, test16);
+ ATF_TP_ADD_TC(tp, test17);
+ ATF_TP_ADD_TC(tp, test18);
+ ATF_TP_ADD_TC(tp, test19);
+ ATF_TP_ADD_TC(tp, test20);
+ ATF_TP_ADD_TC(tp, test21);
+ ATF_TP_ADD_TC(tp, test22);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c b/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c
new file mode 100644
index 0000000..c5b8921
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c
@@ -0,0 +1,442 @@
+/* $NetBSD: t_fopen.c,v 1.3 2011/09/14 14:34:37 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fopen.c,v 1.3 2011/09/14 14:34:37 martin Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char *path = "fopen";
+
+ATF_TC_WITH_CLEANUP(fdopen_close);
+ATF_TC_HEAD(fdopen_close, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "See that descriptors are closed");
+}
+
+ATF_TC_BODY(fdopen_close, tc)
+{
+ FILE *f;
+ int fd;
+
+ /*
+ * Check that the file descriptor
+ * used to fdopen(3) a stream is
+ * closed once the stream is closed.
+ */
+ fd = open(path, O_RDWR | O_CREAT);
+
+ ATF_REQUIRE(fd >= 0);
+
+ f = fdopen(fd, "w+");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fclose(f) == 0);
+ ATF_REQUIRE(close(fd) == -1);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(fdopen_close, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(fdopen_err);
+ATF_TC_HEAD(fdopen_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from fdopen(3)");
+}
+
+ATF_TC_BODY(fdopen_err, tc)
+{
+ int fd;
+
+ fd = open(path, O_RDONLY | O_CREAT);
+ ATF_REQUIRE(fd >= 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, fdopen(fd, "w") == NULL);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, fdopen(fd, "a") == NULL);
+
+ ATF_REQUIRE(close(fd) == 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, fdopen(fd, "r") == NULL);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, fdopen(-1, "w+") == NULL);
+
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(fdopen_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(fdopen_seek);
+ATF_TC_HEAD(fdopen_seek, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test stream position with fdopen(3)");
+}
+
+ATF_TC_BODY(fdopen_seek, tc)
+{
+ FILE *f;
+ int fd;
+
+ /*
+ * Verify that the file position associated
+ * with the stream corresponds with the offset
+ * set earlier for the file descriptor.
+ */
+ fd = open(path, O_RDWR | O_CREAT);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(write(fd, "garbage", 7) == 7);
+ ATF_REQUIRE(lseek(fd, 3, SEEK_SET) == 3);
+
+ f = fdopen(fd, "r+");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(ftell(f) == 3);
+ ATF_REQUIRE(fclose(f) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(fdopen_seek, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(fopen_err);
+ATF_TC_HEAD(fopen_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from fopen(3)");
+}
+
+ATF_TC_BODY(fopen_err, tc)
+{
+ static const char *mode[] = {
+ "x", "xr", "xr", "+r+", "R", "W+", " aXX", "Xr", " r+", "" };
+
+ char buf[PATH_MAX + 1];
+ size_t i;
+ FILE *f;
+
+ f = fopen(path, "w+");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ /*
+ * Note that also "invalid" characters
+ * may follow the mode-string whenever
+ * the first character is valid.
+ */
+ for (i = 0; i < __arraycount(mode); i++) {
+
+ errno = 0;
+ f = fopen(path, mode[i]);
+
+ if (f == NULL && errno == EINVAL)
+ continue;
+
+ if (f != NULL)
+ (void)fclose(f);
+
+ atf_tc_fail_nonfatal("opened file as '%s'", mode[i]);
+ }
+
+ (void)unlink(path);
+ (void)memset(buf, 'x', sizeof(buf));
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EISDIR, fopen("/usr/bin", "w") == NULL);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, fopen("/a/b/c/d/e/f", "r") == NULL);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, fopen(buf, "r+") == NULL);
+}
+
+ATF_TC_CLEANUP(fopen_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(fopen_append);
+ATF_TC_HEAD(fopen_append, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that append-mode works");
+}
+
+ATF_TC_BODY(fopen_append, tc)
+{
+ char buf[15];
+ FILE *f;
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ f = fopen(path, "w+");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fwrite("garbage", 1, 7, f) == 7);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ f = fopen(path, "a");
+
+ ATF_REQUIRE(fwrite("garbage", 1, 7, f) == 7);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ f = fopen(path, "r");
+
+ ATF_REQUIRE(fread(buf, 1, sizeof(buf), f) == 14);
+ ATF_REQUIRE(strncmp(buf, "garbagegarbage", 14) == 0);
+
+ ATF_REQUIRE(fclose(f) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(fopen_append, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(fopen_mode);
+ATF_TC_HEAD(fopen_mode, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test fopen(3) modes");
+}
+
+ATF_TC_BODY(fopen_mode, tc)
+{
+ size_t i;
+ FILE *f;
+
+ static const char *mode[] = {
+ "r", "r+", "w", "w+", "a", "a+",
+ "rb", "r+b", "wb", "w+b", "ab", "a+b"
+ "re", "r+e", "we", "w+e", "ae", "a+e"
+ "rf", "r+f", "wf", "w+f", "af", "a+f"
+ };
+
+ f = fopen(path, "w+");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ /*
+ * Verify that various modes work.
+ */
+ for (i = 0; i < __arraycount(mode); i++) {
+
+ f = fopen(path, mode[i]);
+
+ if (f != NULL) {
+ ATF_REQUIRE(fclose(f) == 0);
+ continue;
+ }
+
+ atf_tc_fail_nonfatal("failed to open file as %s", mode[i]);
+ }
+
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(fopen_mode, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(fopen_perm);
+ATF_TC_HEAD(fopen_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with fopen(3)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(fopen_perm, tc)
+{
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EACCES, fopen("/bin/ls", "a+") == NULL);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EACCES, fopen("/bin/ls", "w+") == NULL);
+}
+
+ATF_TC(fopen_regular);
+ATF_TC_HEAD(fopen_regular, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test fopen(3) with 'f' mode");
+}
+
+ATF_TC_BODY(fopen_regular, tc)
+{
+ static const char *mode[] = { "rf", "r+f", "wf", "w+f", "af", "a+f" };
+ static const char *devs[] = { _PATH_DEVNULL };
+
+ size_t i, j;
+ FILE *f;
+
+ for (i = 0; i < __arraycount(devs); i++) {
+
+ for (j = 0; j < __arraycount(mode); j++) {
+
+ errno = 0;
+ f = fopen(devs[i], mode[j]);
+
+ if (f == NULL && errno == EFTYPE)
+ continue;
+
+ if (f != NULL)
+ (void)fclose(f);
+
+ atf_tc_fail_nonfatal("opened %s as %s",
+ devs[i], mode[j]);
+ }
+ }
+}
+
+ATF_TC_WITH_CLEANUP(fopen_seek);
+ATF_TC_HEAD(fopen_seek, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test initial stream position");
+}
+
+ATF_TC_BODY(fopen_seek, tc)
+{
+ FILE *f;
+
+ f = fopen(path, "w+");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fwrite("garbage", 1, 7, f) == 7);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ /*
+ * The position of the stream should be
+ * at the start, except for append-mode.
+ */
+ f = fopen(path, "r");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(ftello(f) == 0);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ f = fopen(path, "a");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(ftello(f) == 7);
+ ATF_REQUIRE(fclose(f) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(fopen_seek, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(freopen_std);
+ATF_TC_HEAD(freopen_std, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of freopen(3)");
+}
+
+ATF_TC_BODY(freopen_std, tc)
+{
+ FILE *std[2] = { stdin, stdout };
+ char buf[15];
+ size_t i;
+ FILE *f;
+
+ /*
+ * Associate a standard stream with a custom stream.
+ * Then write to the standard stream and verify that
+ * the result now appears in the custom stream.
+ */
+ for (i = 0; i < __arraycount(std); i++) {
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ f = fopen(path, "w+");
+ ATF_REQUIRE(f != NULL);
+
+ f = freopen(path, "w+", std[i]);
+ ATF_REQUIRE(f != NULL);
+
+ ATF_REQUIRE(fwrite("garbage", 1, 7, f) == 7);
+ ATF_REQUIRE(fprintf(std[i], "garbage") == 7);
+ ATF_REQUIRE(fclose(f) == 0);
+
+ f = fopen(path, "r");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fread(buf, 1, sizeof(buf), f) == 14);
+ ATF_REQUIRE(strncmp(buf, "garbagegarbage", 14) == 0);
+
+ ATF_REQUIRE(fclose(f) == 0);
+ }
+
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(freopen_std, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fdopen_close);
+ ATF_TP_ADD_TC(tp, fdopen_err);
+ ATF_TP_ADD_TC(tp, fdopen_seek);
+ ATF_TP_ADD_TC(tp, fopen_append);
+ ATF_TP_ADD_TC(tp, fopen_err);
+ ATF_TP_ADD_TC(tp, fopen_mode);
+ ATF_TP_ADD_TC(tp, fopen_perm);
+ ATF_TP_ADD_TC(tp, fopen_regular);
+ ATF_TP_ADD_TC(tp, fopen_seek);
+ ATF_TP_ADD_TC(tp, freopen_std);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_fputc.c b/contrib/netbsd-tests/lib/libc/stdio/t_fputc.c
new file mode 100644
index 0000000..ed7c0dc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_fputc.c
@@ -0,0 +1,194 @@
+/* $NetBSD: t_fputc.c,v 1.1 2011/09/11 09:02:46 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fputc.c,v 1.1 2011/09/11 09:02:46 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char *path = "fputc";
+static void puterr(int (*)(int, FILE *));
+static void putstr(int (*)(int, FILE *));
+
+static void
+puterr(int (*func)(int, FILE *))
+{
+ FILE *f;
+
+ f = fopen(path, "w+");
+
+ ATF_REQUIRE(f != NULL);
+ ATF_REQUIRE(fclose(f) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+ ATF_REQUIRE(func('x', f) == EOF);
+}
+
+static void
+putstr(int (*func)(int, FILE *))
+{
+ const char *str = "1234567890x";
+ unsigned short i = 0;
+ char buf[10];
+ FILE *f;
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ f = fopen(path, "w+");
+ ATF_REQUIRE(f != NULL);
+
+ while (str[i] != 'x') {
+ ATF_REQUIRE(func(str[i], f) == str[i]);
+ i++;
+ }
+
+ ATF_REQUIRE(fclose(f) == 0);
+
+ f = fopen(path, "r");
+ ATF_REQUIRE(f != NULL);
+
+ ATF_REQUIRE(fread(buf, 1, 10, f) == 10);
+ ATF_REQUIRE(strncmp(buf, str, 10) == 0);
+
+ ATF_REQUIRE(fclose(f) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_WITH_CLEANUP(fputc_basic);
+ATF_TC_HEAD(fputc_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of fputc(3)");
+}
+
+ATF_TC_BODY(fputc_basic, tc)
+{
+ putstr(fputc);
+}
+
+ATF_TC_CLEANUP(fputc_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(fputc_err);
+ATF_TC_HEAD(fputc_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from fputc(3)");
+}
+
+ATF_TC_BODY(fputc_err, tc)
+{
+ puterr(fputc);
+}
+
+ATF_TC_CLEANUP(fputc_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(putc_basic);
+ATF_TC_HEAD(putc_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of putc(3)");
+}
+
+ATF_TC_BODY(putc_basic, tc)
+{
+ putstr(putc);
+}
+
+ATF_TC_CLEANUP(putc_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(putc_err);
+ATF_TC_HEAD(putc_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from putc(3)");
+}
+
+ATF_TC_BODY(putc_err, tc)
+{
+ puterr(putc);
+}
+
+ATF_TC_CLEANUP(putc_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(putc_unlocked_basic);
+ATF_TC_HEAD(putc_unlocked_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of putc_unlocked(3)");
+}
+
+ATF_TC_BODY(putc_unlocked_basic, tc)
+{
+ putstr(putc_unlocked);
+}
+
+ATF_TC_CLEANUP(putc_unlocked_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(putc_unlocked_err);
+ATF_TC_HEAD(putc_unlocked_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from putc_unlocked(3)");
+}
+
+ATF_TC_BODY(putc_unlocked_err, tc)
+{
+ puterr(putc_unlocked);
+}
+
+ATF_TC_CLEANUP(putc_unlocked_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fputc_basic);
+ ATF_TP_ADD_TC(tp, fputc_err);
+ ATF_TP_ADD_TC(tp, putc_basic);
+ ATF_TP_ADD_TC(tp, putc_err);
+ ATF_TP_ADD_TC(tp, putc_unlocked_basic);
+ ATF_TP_ADD_TC(tp, putc_unlocked_err);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_mktemp.c b/contrib/netbsd-tests/lib/libc/stdio/t_mktemp.c
new file mode 100644
index 0000000..e423060
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_mktemp.c
@@ -0,0 +1,54 @@
+/* $NetBSD: t_mktemp.c,v 1.1 2013/04/22 21:05:12 christos Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mktemp.c,v 1.1 2013/04/22 21:05:12 christos Exp $");
+
+#include <atf-c.h>
+#include <stdlib.h>
+
+ATF_TC(mktemp_not_exist);
+ATF_TC_HEAD(mktemp_not_exist, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that mktemp does not fail on"
+ " a path that does not exist");
+}
+
+ATF_TC_BODY(mktemp_not_exist, tc)
+{
+ char template[] = "I will barf/XXXXXX";
+ ATF_REQUIRE(mktemp(template) != NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, mktemp_not_exist);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_popen.c b/contrib/netbsd-tests/lib/libc/stdio/t_popen.c
new file mode 100644
index 0000000..699498c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_popen.c
@@ -0,0 +1,135 @@
+/* $NetBSD: t_popen.c,v 1.4 2013/02/15 23:27:19 christos Exp $ */
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matthias Scheler.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__COPYRIGHT("@(#) Copyright (c) 1999\
+ The NetBSD Foundation, Inc. All rights reserved.");
+#endif /* not lint */
+
+#ifndef lint
+__RCSID("$NetBSD: t_popen.c,v 1.4 2013/02/15 23:27:19 christos Exp $");
+#endif /* not lint */
+
+#include <atf-c.h>
+
+#include <sys/param.h>
+
+#include <errno.h>
+#include <err.h>
+#include <paths.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+
+#define _PATH_CAT "/bin/cat"
+#define BUFSIZE (640*1024)
+ /* 640KB ought to be enough for everyone. */
+#define DATAFILE "popen.data"
+
+#define TEST_ERROR(a) \
+ do \
+ { \
+ warn(a); \
+ atf_tc_fail("Check stderr for error details."); \
+ } while ( /*CONSTCOND*/ 0 )
+
+ATF_TC_WITH_CLEANUP(popen_zeropad);
+ATF_TC_HEAD(popen_zeropad, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "output format zero padding");
+}
+
+ATF_TC_BODY(popen_zeropad, tc)
+{
+ char *buffer, command[MAXPATHLEN];
+ int idx, in;
+ FILE *my_pipe;
+
+ if ((buffer = malloc(BUFSIZE)) == NULL)
+ atf_tc_skip("Unable to allocate buffer.");
+
+ srand ((unsigned int)time(NULL));
+
+ for (idx = 0; idx < BUFSIZE; idx++)
+ buffer[idx]=(char)rand();
+
+ (void)snprintf(command, sizeof(command), "%s >%s",
+ _PATH_CAT, DATAFILE);
+
+ if ((my_pipe = popen(command, "w")) == NULL)
+ TEST_ERROR("popen write");
+
+ if (fwrite(buffer, sizeof(char), BUFSIZE, my_pipe) != BUFSIZE)
+ TEST_ERROR("fwrite");
+
+ if (pclose(my_pipe) == -1)
+ TEST_ERROR("pclose");
+
+ (void)snprintf(command, sizeof(command), "%s %s", _PATH_CAT, DATAFILE);
+
+ if ((my_pipe = popen(command, "r")) == NULL)
+ TEST_ERROR("popen read");
+
+ idx = 0;
+ while ((in = fgetc(my_pipe)) != EOF)
+ if (idx == BUFSIZE) {
+ errno = EFBIG;
+ TEST_ERROR("read");
+ }
+ else if ((char)in != buffer[idx++]) {
+ errno = EINVAL;
+ TEST_ERROR("read");
+ }
+
+ if (idx < BUFSIZE) {
+ errno = EIO;
+ TEST_ERROR("read");
+ }
+
+ if (pclose(my_pipe) == -1)
+ TEST_ERROR("pclose");
+}
+
+ATF_TC_CLEANUP(popen_zeropad, tc)
+{
+ (void)unlink(DATAFILE);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, popen_zeropad);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_printf.c b/contrib/netbsd-tests/lib/libc/stdio/t_printf.c
new file mode 100644
index 0000000..95b4b2c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_printf.c
@@ -0,0 +1,194 @@
+/* $NetBSD: t_printf.c,v 1.8 2012/04/11 16:21:42 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+#include <sys/resource.h>
+#include <atf-c.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <time.h>
+#include <stdlib.h>
+
+ATF_TC(snprintf_c99);
+ATF_TC_HEAD(snprintf_c99, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Test printf(3) C99 conformance (PR lib/22019)");
+}
+
+ATF_TC_BODY(snprintf_c99, tc)
+{
+ char s[4];
+
+ (void)memset(s, '\0', sizeof(s));
+ (void)snprintf(s, sizeof(s), "%#.o", 0);
+ (void)printf("printf = %#.o\n", 0);
+ (void)fprintf(stderr, "snprintf = %s", s);
+
+ ATF_REQUIRE(strlen(s) == 1);
+ ATF_REQUIRE(s[0] == '0');
+}
+
+ATF_TC(snprintf_dotzero);
+ATF_TC_HEAD(snprintf_dotzero, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "PR lib/32951: %%.0f formats (0.0,0.5] to \"0.\"");
+}
+
+ATF_TC_BODY(snprintf_dotzero, tc)
+{
+ char s[4];
+
+ ATF_CHECK(snprintf(s, sizeof(s), "%.0f", 0.1) == 1);
+ ATF_REQUIRE_STREQ(s, "0");
+}
+
+ATF_TC(snprintf_posarg);
+ATF_TC_HEAD(snprintf_posarg, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test for positional arguments");
+}
+
+ATF_TC_BODY(snprintf_posarg, tc)
+{
+ char s[16];
+
+ ATF_CHECK(snprintf(s, sizeof(s), "%1$d", -23) == 3);
+ ATF_REQUIRE_STREQ(s, "-23");
+}
+
+ATF_TC(snprintf_posarg_width);
+ATF_TC_HEAD(snprintf_posarg_width, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test for positional arguments with "
+ "field width");
+}
+
+ATF_TC_BODY(snprintf_posarg_width, tc)
+{
+ char s[16];
+
+ ATF_CHECK(snprintf(s, sizeof(s), "%1$*2$d", -23, 4) == 4);
+ ATF_REQUIRE_STREQ(s, " -23");
+}
+
+ATF_TC(snprintf_posarg_error);
+ATF_TC_HEAD(snprintf_posarg_error, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test for positional arguments out "
+ "of bounds");
+}
+
+ATF_TC_BODY(snprintf_posarg_error, tc)
+{
+ char s[16], fmt[32];
+
+ snprintf(fmt, sizeof(fmt), "%%%zu$d", SIZE_MAX / sizeof(size_t));
+
+ ATF_CHECK(snprintf(s, sizeof(s), fmt, -23) == -1);
+}
+
+ATF_TC(snprintf_float);
+ATF_TC_HEAD(snprintf_float, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test that floating conversions don't"
+ " leak memory");
+}
+
+ATF_TC_BODY(snprintf_float, tc)
+{
+ union {
+ double d;
+ uint64_t bits;
+ } u;
+ uint32_t ul, uh;
+ time_t now;
+ char buf[1000];
+ struct rlimit rl;
+
+ rl.rlim_cur = rl.rlim_max = 1 * 1024 * 1024;
+ ATF_CHECK(setrlimit(RLIMIT_AS, &rl) != -1);
+ rl.rlim_cur = rl.rlim_max = 1 * 1024 * 1024;
+ ATF_CHECK(setrlimit(RLIMIT_DATA, &rl) != -1);
+
+ time(&now);
+ srand(now);
+ for (size_t i = 0; i < 10000; i++) {
+ ul = rand();
+ uh = rand();
+ u.bits = (uint64_t)uh << 32 | ul;
+ ATF_CHECK(snprintf(buf, sizeof buf, " %.2f", u.d) != -1);
+ }
+}
+
+ATF_TC(sprintf_zeropad);
+ATF_TC_HEAD(sprintf_zeropad, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test output format zero padding (PR lib/44113)");
+}
+
+ATF_TC_BODY(sprintf_zeropad, tc)
+{
+ char str[1024];
+
+ ATF_CHECK(sprintf(str, "%010f", 0.0) == 10);
+ ATF_REQUIRE_STREQ(str, "000.000000");
+
+ /* ieeefp */
+#ifndef __vax__
+ /* printf(3) should ignore zero padding for nan/inf */
+ ATF_CHECK(sprintf(str, "%010f", NAN) == 10);
+ ATF_REQUIRE_STREQ(str, " nan");
+ ATF_CHECK(sprintf(str, "%010f", INFINITY) == 10);
+ ATF_REQUIRE_STREQ(str, " inf");
+#endif
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, snprintf_c99);
+ ATF_TP_ADD_TC(tp, snprintf_dotzero);
+ ATF_TP_ADD_TC(tp, snprintf_posarg);
+ ATF_TP_ADD_TC(tp, snprintf_posarg_width);
+ ATF_TP_ADD_TC(tp, snprintf_posarg_error);
+ ATF_TP_ADD_TC(tp, snprintf_float);
+ ATF_TP_ADD_TC(tp, sprintf_zeropad);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c b/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c
new file mode 100644
index 0000000..fea35a7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c
@@ -0,0 +1,81 @@
+/* $NetBSD: t_scanf.c,v 1.3 2012/03/18 07:00:51 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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 <atf-c.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+#define NUM -0x1234
+#define STRNUM ___STRING(NUM)
+
+ATF_TC(sscanf_neghex);
+ATF_TC_HEAD(sscanf_neghex, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "PR lib/21691: %%i and %%x fail with negative hex numbers");
+}
+
+ATF_TC_BODY(sscanf_neghex, tc)
+{
+ int i;
+
+ sscanf(STRNUM, "%i", &i);
+ ATF_REQUIRE(i == NUM);
+
+ sscanf(STRNUM, "%x", &i);
+ ATF_REQUIRE(i == NUM);
+}
+
+ATF_TC(sscanf_whitespace);
+ATF_TC_HEAD(sscanf_whitespace, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "verify sscanf skips all whitespace");
+}
+
+ATF_TC_BODY(sscanf_whitespace, tc)
+{
+ const char str[] = "\f\n\r\t\v%z";
+ char c;
+
+ /* set of "white space" symbols from isspace(3) */
+ c = 0;
+ (void)sscanf(str, "%%%c", &c);
+ ATF_REQUIRE(c == 'z');
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sscanf_neghex);
+ ATF_TP_ADD_TC(tp, sscanf_whitespace);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c b/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c
new file mode 100644
index 0000000..b2f91c4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c
@@ -0,0 +1,178 @@
+/* $NetBSD: h_atexit.c,v 1.1 2011/01/12 19:44:08 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code was contributed to The NetBSD Foundation by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_atexit.c,v 1.1 2011/01/12 19:44:08 pgoyette Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+
+extern int __cxa_atexit(void (*func)(void *), void *, void *);
+extern void __cxa_finalize(void *);
+
+static int dso_handle_1;
+static int dso_handle_2;
+static int dso_handle_3;
+
+static int arg_1;
+static int arg_2;
+static int arg_3;
+
+static int exiting_state;
+
+#define ASSERT(expr) \
+do { \
+ if ((expr) == 0) { \
+ write(STDERR_FILENO, __func__, strlen(__func__)); \
+ write(STDERR_FILENO, ": ", 2); \
+ write(STDERR_FILENO, __STRING(expr), \
+ strlen(__STRING(expr))); \
+ write(STDERR_FILENO, "\n", 1); \
+ my_abort(); \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SUCCESS() \
+do { \
+ write(STDOUT_FILENO, __func__, strlen(__func__)); \
+ write(STDOUT_FILENO, "\n", 1); \
+} while (/*CONSTCOND*/0)
+
+static void
+my_abort(void)
+{
+
+ kill(getpid(), SIGABRT);
+ /* NOTREACHED */
+}
+
+static void
+cxa_handler_5(void *arg)
+{
+ static int cxa_handler_5_called;
+
+ ASSERT(arg == (void *)&arg_1);
+ ASSERT(cxa_handler_5_called == 0);
+ ASSERT(exiting_state == 5);
+
+ exiting_state--;
+ cxa_handler_5_called = 1;
+ SUCCESS();
+}
+
+static void
+cxa_handler_4(void *arg)
+{
+ static int cxa_handler_4_called;
+
+ ASSERT(arg == (void *)&arg_1);
+ ASSERT(cxa_handler_4_called == 0);
+ ASSERT(exiting_state == 4);
+
+ exiting_state--;
+ cxa_handler_4_called = 1;
+ SUCCESS();
+}
+
+static void
+cxa_handler_3(void *arg)
+{
+ static int cxa_handler_3_called;
+
+ ASSERT(arg == (void *)&arg_2);
+ ASSERT(cxa_handler_3_called == 0);
+ ASSERT(exiting_state == 3);
+
+ exiting_state--;
+ cxa_handler_3_called = 1;
+ SUCCESS();
+}
+
+static void
+cxa_handler_2(void *arg)
+{
+ static int cxa_handler_2_called;
+
+ ASSERT(arg == (void *)&arg_3);
+ ASSERT(cxa_handler_2_called == 0);
+ ASSERT(exiting_state == 2);
+
+ exiting_state--;
+ cxa_handler_2_called = 1;
+ SUCCESS();
+}
+
+static void
+normal_handler_1(void)
+{
+ static int normal_handler_1_called;
+
+ ASSERT(normal_handler_1_called == 0);
+ ASSERT(exiting_state == 1);
+
+ exiting_state--;
+ normal_handler_1_called = 1;
+ SUCCESS();
+}
+
+static void
+normal_handler_0(void)
+{
+ static int normal_handler_0_called;
+
+ ASSERT(normal_handler_0_called == 0);
+ ASSERT(exiting_state == 0);
+
+ normal_handler_0_called = 1;
+ SUCCESS();
+}
+
+int
+main(int argc, char *argv[])
+{
+
+ exiting_state = 5;
+
+ ASSERT(0 == atexit(normal_handler_0));
+ ASSERT(0 == atexit(normal_handler_1));
+ ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, &dso_handle_1));
+ ASSERT(0 == __cxa_atexit(cxa_handler_5, &arg_1, &dso_handle_1));
+ ASSERT(0 == __cxa_atexit(cxa_handler_3, &arg_2, &dso_handle_2));
+ ASSERT(0 == __cxa_atexit(cxa_handler_2, &arg_3, &dso_handle_3));
+
+ __cxa_finalize(&dso_handle_1);
+ __cxa_finalize(&dso_handle_2);
+ exit(0);
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
new file mode 100644
index 0000000..074e4dd
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
@@ -0,0 +1,127 @@
+/* $NetBSD: h_getopt.c,v 1.1 2011/01/01 23:56:49 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <err.h>
+
+#define WS "\t\n "
+#define debug 0
+
+int
+main(int argc, char *argv[])
+{
+ size_t len, lineno = 0;
+ char *line, *ptr, *optstring = NULL, *result = NULL;
+ char buf[1024];
+ char *args[100];
+ char arg[100];
+ int nargs = -1;
+ int c;
+
+ while ((line = fparseln(stdin, &len, &lineno, NULL, 0)) != NULL) {
+ if (strncmp(line, "load:", 5) == 0) {
+ if (optstring)
+ free(optstring);
+ optstring = strtok(&line[6], WS);
+ if (optstring == NULL)
+ errx(1, "missing optstring at line %ld",
+ (unsigned long)lineno);
+ optstring = strdup(optstring);
+ if (debug)
+ fprintf(stderr, "optstring = %s\n", optstring);
+ } else if (strncmp(line, "args:", 5) == 0) {
+ for (; nargs >= 0; nargs--) {
+ if (args[nargs] != NULL)
+ free(args[nargs]);
+ }
+ args[nargs = 0] = strtok(&line[6], WS);
+ if (args[nargs] == NULL)
+ errx(1, "missing args at line %ld",
+ (unsigned long)lineno);
+
+ args[nargs] = strdup(args[nargs]);
+ while ((args[++nargs] = strtok(NULL, WS)) != NULL)
+ args[nargs] = strdup(args[nargs]);
+ if (debug) {
+ int i = 0;
+ for (i = 0; i < nargs; i++)
+ fprintf(stderr, "argv[%d] = %s\n", i,
+ args[i]);
+ }
+ } else if (strncmp(line, "result:", 7) == 0) {
+ buf[0] = '\0';
+ optind = optreset = 1;
+ if (result)
+ free(result);
+ result = strtok(&line[8], WS);
+ if (result == NULL)
+ errx(1, "missing result at line %ld",
+ (unsigned long)lineno);
+ result = strdup(result);
+ if (nargs == -1)
+ errx(1, "result: without args:");
+ if (debug)
+ fprintf(stderr, "result = %s\n", result);
+ while ((c = getopt(nargs, args, optstring)) != -1) {
+ if (c == ':')
+ err(1, "`:' found as argument char");
+ if ((ptr = strchr(optstring, c)) == NULL) {
+ snprintf(arg, sizeof(arg), "!%c,", c);
+ strcat(buf, arg);
+ continue;
+ }
+ if (ptr[1] != ':')
+ snprintf(arg, sizeof(arg), "%c,", c);
+ else
+ snprintf(arg, sizeof(arg), "%c=%s,",
+ c, optarg);
+ strcat(buf, arg);
+ }
+ len = strlen(buf);
+ if (len > 0) {
+ buf[len - 1] = '|';
+ buf[len] = '\0';
+ } else {
+ buf[0] = '|';
+ buf[1] = '\0';
+ }
+ snprintf(arg, sizeof(arg), "%d", nargs - optind);
+ strcat(buf, arg);
+ if (strcmp(buf, result) != 0)
+ errx(1, "`%s' != `%s'", buf, result);
+ }
+ free(line);
+ }
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
new file mode 100644
index 0000000..17258f5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
@@ -0,0 +1,239 @@
+/* $NetBSD: h_getopt_long.c,v 1.1 2011/01/01 23:56:49 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <ctype.h>
+#include <err.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define SKIPWS(p) while (isspace((int)(*p))) p++
+#define WS "\t\n "
+
+int
+main(int argc, char *argv[])
+{
+ size_t len, lineno = 0;
+ char *line, *eptr, *longopt, *ptr, *optstring = NULL, *result = NULL;
+ char buf[1024];
+ char *args[128];
+ char arg[256];
+ int nargs = -1;
+ int c;
+ int nlongopts = 0;
+ int maxnlongopts = 0;
+ int *longopt_flags = NULL;
+ struct option *longopts = NULL;
+
+ while ((line = fparseln(stdin, &len, &lineno, NULL, 0)) != NULL) {
+ if (strncmp(line, "optstring:", 10) == 0) {
+ if (optstring)
+ free(optstring);
+ optstring = strtok(&line[11], WS);
+ if (optstring == NULL)
+ errx(1, "missing optstring at line %ld",
+ (unsigned long)lineno);
+ optstring = strdup(optstring);
+ } else if (strncmp(line, "longopts:", 9) == 0) {
+ if (longopts) {
+ int i;
+ for (i = 0; i < nlongopts; i++)
+ if (longopts[i].name != NULL)
+ free(__UNCONST(longopts[i].name));
+ free(longopts);
+ }
+ if (longopt_flags)
+ free(longopt_flags);
+ nlongopts = 0;
+ ptr = strtok(&line[10], WS);
+ if (ptr == NULL)
+ errx(1, "missing longopts at line %ld",
+ (unsigned long)lineno);
+ maxnlongopts = strtoul(ptr, &eptr, 10);
+ if (*eptr != '\0')
+ warnx("garbage in longopts at line %ld",
+ (unsigned long)lineno);
+ maxnlongopts++; /* space for trailer */
+ longopts =
+ (struct option *)calloc(sizeof(struct option),
+ maxnlongopts);
+ if (longopts == NULL)
+ err(1, "calloc");
+ longopt_flags = (int *)calloc(sizeof(int), maxnlongopts);
+ if (longopt_flags == NULL)
+ err(1, "calloc");
+ } else if (strncmp(line, "longopt:", 8) == 0) {
+ if (longopts == NULL)
+ errx(1, "longopt: without longopts at line %ld",
+ (unsigned long)lineno);
+ if (nlongopts >= maxnlongopts)
+ errx(1, "longopt: too many options at line %ld",
+ (unsigned long)lineno);
+ /* name */
+ ptr = &line[9];
+ SKIPWS(ptr);
+ longopt = strsep(&ptr, ",");
+ if (longopt == NULL)
+ errx(1, "missing longopt at line %ld",
+ (unsigned long)lineno);
+ longopts[nlongopts].name = strdup(longopt);
+ /* has_arg */
+ SKIPWS(ptr);
+ longopt = strsep(&ptr, ",");
+ if (*longopt != '\0') {
+ if (strncmp(longopt, "0", 1) == 0 ||
+ strncmp(longopt, "no_argument", 2) == 0)
+ longopts[nlongopts].has_arg = no_argument;
+ else if (strncmp(longopt, "1", 1) == 0 ||
+ strncmp(longopt, "required_argument", 8) == 0)
+ longopts[nlongopts].has_arg = required_argument;
+ else if (strncmp(longopt, "2", 1) == 0 ||
+ strncmp(longopt, "optional_argument", 8) == 0)
+ longopts[nlongopts].has_arg = optional_argument;
+ else
+ errx(1, "unknown has_arg %s at line %ld",
+ longopt, (unsigned long)lineno);
+ }
+ /* flag */
+ SKIPWS(ptr);
+ longopt = strsep(&ptr, ",");
+ if (*longopt != '\0' &&
+ strncmp(longopt, "NULL", 4) != 0)
+ longopts[nlongopts].flag = &longopt_flags[nlongopts];
+ /* val */
+ SKIPWS(ptr);
+ longopt = strsep(&ptr, ",");
+ if (*longopt == '\0')
+ errx(1, "missing val at line %ld",
+ (unsigned long)lineno);
+ if (*longopt != '\'') {
+ longopts[nlongopts].val =
+ (int)strtoul(longopt, &eptr, 10);
+ if (*eptr != '\0')
+ errx(1, "invalid val at line %ld",
+ (unsigned long)lineno);
+ } else
+ longopts[nlongopts].val = (int)longopt[1];
+ nlongopts++;
+ } else if (strncmp(line, "args:", 5) == 0) {
+ for (; nargs >= 0; nargs--) {
+ if (args[nargs] != NULL)
+ free(args[nargs]);
+ }
+ args[nargs = 0] = strtok(&line[6], WS);
+ if (args[nargs] == NULL)
+ errx(1, "Missing args");
+
+ args[nargs] = strdup(args[nargs]);
+ while ((args[++nargs] = strtok(NULL, WS)) != NULL)
+ args[nargs] = strdup(args[nargs]);
+ } else if (strncmp(line, "result:", 7) == 0) {
+ int li;
+ buf[0] = '\0';
+ optind = optreset = 1;
+ if (result)
+ free(result);
+ result = strtok(&line[8], WS);
+ if (result == NULL)
+ errx(1, "missing result at line %ld",
+ (unsigned long)lineno);
+ if (optstring == NULL)
+ errx(1, "result: without optstring");
+ if (longopts == NULL || nlongopts == 0)
+ errx(1, "result: without longopts");
+ result = strdup(result);
+ if (nargs == -1)
+ errx(1, "result: without args");
+ li = -2;
+ while ((c = getopt_long(nargs, args, optstring,
+ longopts, &li)) != -1) {
+ if (c == ':')
+ errx(1, "`:' found as argument char");
+ if (li == -2) {
+ ptr = strchr(optstring, c);
+ if (ptr == NULL) {
+ snprintf(arg, sizeof(arg),
+ "!%c,", c);
+ strcat(buf, arg);
+ continue;
+ }
+ if (ptr[1] != ':')
+ snprintf(arg, sizeof(arg),
+ "%c,", c);
+ else
+ snprintf(arg, sizeof(arg),
+ "%c=%s,", c, optarg);
+ } else {
+ switch (longopts[li].has_arg) {
+ case no_argument:
+ snprintf(arg, sizeof(arg), "-%s,",
+ longopts[li].name);
+ break;
+ case required_argument:
+ snprintf(arg, sizeof(arg),
+ "-%s=%s,",
+ longopts[li].name, optarg);
+ break;
+ case optional_argument:
+ snprintf(arg, sizeof(arg),
+ "-%s%s%s,",
+ longopts[li].name,
+ (optarg)? "=" : "",
+ (optarg)? optarg : "");
+ break;
+ default:
+ errx(1, "internal error");
+ }
+ }
+ strcat(buf, arg);
+ li = -2;
+ }
+ len = strlen(buf);
+ if (len > 0) {
+ buf[len - 1] = '|';
+ buf[len] = '\0';
+ } else {
+ buf[0] = '|';
+ buf[1] = '\0';
+ }
+ snprintf(arg, sizeof(arg), "%d", nargs - optind);
+ strcat(buf, arg);
+ if (strcmp(buf, result) != 0)
+ errx(1, "`%s' != `%s'", buf, result);
+ } else
+ errx(1, "unknown directive at line %ld",
+ (unsigned long)lineno);
+ free(line);
+ }
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_abs.c b/contrib/netbsd-tests/lib/libc/stdlib/t_abs.c
new file mode 100644
index 0000000..282a125
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_abs.c
@@ -0,0 +1,154 @@
+/* $NetBSD: t_abs.c,v 1.3 2014/03/01 22:38:13 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_abs.c,v 1.3 2014/03/01 22:38:13 joerg Exp $");
+
+#include <atf-c.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <stdlib.h>
+
+ATF_TC(abs_basic);
+ATF_TC_HEAD(abs_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that abs(3) works");
+}
+
+ATF_TC_BODY(abs_basic, tc)
+{
+ static const struct {
+ int val;
+ int res;
+ } table[] = {
+ { 0, 0 },
+ { +0, 0 },
+ { -0, 0 },
+ { -0x1010, 0x1010 },
+ { INT_MAX, INT_MAX },
+ { -INT_MAX, INT_MAX },
+ };
+
+ for (size_t i = 0; i < __arraycount(table); i++)
+ ATF_CHECK(abs(table[i].val) == table[i].res);
+}
+
+ATF_TC(imaxabs_basic);
+ATF_TC_HEAD(imaxabs_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that imaxabs(3) works");
+}
+
+ATF_TC_BODY(imaxabs_basic, tc)
+{
+ static const struct {
+ intmax_t val;
+ intmax_t res;
+ } table[] = {
+ { 0, 0 },
+ { INT_MAX, INT_MAX },
+ { -INT_MAX, INT_MAX },
+ { LONG_MAX, LONG_MAX },
+ { -LONG_MAX, LONG_MAX },
+ { LLONG_MAX, LLONG_MAX },
+ { -LLONG_MAX, LLONG_MAX },
+ { INT_MAX, INT_MAX },
+ { -INT_MAX, INT_MAX },
+ };
+
+ for (size_t i = 0; i < __arraycount(table); i++)
+ ATF_CHECK(imaxabs(table[i].val) == table[i].res);
+}
+
+ATF_TC(labs_basic);
+ATF_TC_HEAD(labs_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that labs(3) works");
+}
+
+ATF_TC_BODY(labs_basic, tc)
+{
+ static const struct {
+ long val;
+ long res;
+ } table[] = {
+ { 0, 0 },
+ { +0, 0 },
+ { -0, 0 },
+ { -1, 1 },
+ { LONG_MAX, LONG_MAX },
+ { -LONG_MAX, LONG_MAX },
+ { INT_MAX, INT_MAX },
+ { -INT_MAX, INT_MAX },
+ };
+
+ for (size_t i = 0; i < __arraycount(table); i++)
+ ATF_CHECK(labs(table[i].val) == table[i].res);
+}
+
+ATF_TC(llabs_basic);
+ATF_TC_HEAD(llabs_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that llabs(3) works");
+}
+
+ATF_TC_BODY(llabs_basic, tc)
+{
+ static const struct {
+ long long val;
+ long long res;
+ } table[] = {
+ { 0, 0 },
+ { +0, 0 },
+ { -0, 0 },
+ { -1, 1 },
+ { INT_MAX, INT_MAX },
+ { -INT_MAX, INT_MAX },
+ { LONG_MAX, LONG_MAX },
+ { -LONG_MAX, LONG_MAX },
+ { LLONG_MAX, LLONG_MAX },
+ { -LLONG_MAX, LLONG_MAX },
+ { -0x100000000LL, 0x100000000LL },
+ };
+
+ for (size_t i = 0; i < __arraycount(table); i++)
+ ATF_CHECK(llabs(table[i].val) == table[i].res);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, abs_basic);
+ ATF_TP_ADD_TC(tp, imaxabs_basic);
+ ATF_TP_ADD_TC(tp, labs_basic);
+ ATF_TP_ADD_TC(tp, llabs_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_atexit.sh b/contrib/netbsd-tests/lib/libc/stdlib/t_atexit.sh
new file mode 100755
index 0000000..d11268b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_atexit.sh
@@ -0,0 +1,54 @@
+# $NetBSD: t_atexit.sh,v 1.1 2011/01/12 19:44:08 pgoyette Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case atexit
+atexit_head()
+{
+ atf_set "descr" "Checks atexit(3) and __cxa_atexit()/__cxa_finalize()"
+}
+atexit_body()
+{
+ $(atf_get_srcdir)/h_atexit >out \
+ || atf_fail "h_exit failed, see output of the test for details"
+
+ cat >exp <<EOF
+cxa_handler_5
+cxa_handler_4
+cxa_handler_3
+cxa_handler_2
+normal_handler_1
+normal_handler_0
+EOF
+
+ diff -Nru exp out \
+ || atf_fail "h_exit failed, see output of the test for details"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case atexit
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_atoi.c b/contrib/netbsd-tests/lib/libc/stdlib/t_atoi.c
new file mode 100644
index 0000000..3e0c35f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_atoi.c
@@ -0,0 +1,121 @@
+/* $NetBSD: t_atoi.c,v 1.2 2012/03/29 05:56:36 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_atoi.c,v 1.2 2012/03/29 05:56:36 jruoho Exp $");
+
+#include <atf-c.h>
+#include <float.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+ATF_TC(atof_strtod);
+ATF_TC_HEAD(atof_strtod, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that atof(3) matches the corresponding strtod(3) call");
+}
+
+ATF_TC_BODY(atof_strtod, tc)
+{
+ char buf[128];
+
+ (void)snprintf(buf, sizeof(buf), "%f\n", DBL_MAX);
+
+ ATF_REQUIRE(atof("0") == strtod("0", NULL));
+ ATF_REQUIRE(atof("-1") == strtod("-1", NULL));
+ ATF_REQUIRE(atof(buf) == strtod(buf, NULL));
+}
+
+ATF_TC(atoi_strtol);
+ATF_TC_HEAD(atoi_strtol, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that atoi(3) matches the corresponding strtol(3) call");
+}
+
+ATF_TC_BODY(atoi_strtol, tc)
+{
+ char buf[64];
+
+ (void)snprintf(buf, sizeof(buf), "%d\n", INT_MAX);
+
+ ATF_REQUIRE(atoi("0") == strtol("0", NULL, 10));
+ ATF_REQUIRE(atoi("-1") == strtol("-1", NULL, 10));
+ ATF_REQUIRE(atoi(buf) == strtol(buf, NULL, 10));
+}
+
+ATF_TC(atol_strtol);
+ATF_TC_HEAD(atol_strtol, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that atol(3) matches the corresponding strtol(3) call");
+}
+
+ATF_TC_BODY(atol_strtol, tc)
+{
+ char buf[64];
+
+ (void)snprintf(buf, sizeof(buf), "%ld\n", LONG_MAX);
+
+ ATF_REQUIRE(atol("0") == strtol("0", NULL, 10));
+ ATF_REQUIRE(atol("-1") == strtol("-1", NULL, 10));
+ ATF_REQUIRE(atol(buf) == strtol(buf, NULL, 10));
+}
+
+ATF_TC(atoll_strtoll);
+ATF_TC_HEAD(atoll_strtoll, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that atoll(3) matches the corresponding strtoll(3) call");
+}
+
+ATF_TC_BODY(atoll_strtoll, tc)
+{
+ char buf[128];
+
+ (void)snprintf(buf, sizeof(buf), "%lld\n", LLONG_MAX);
+
+ ATF_REQUIRE(atoll("0") == strtoll("0", NULL, 10));
+ ATF_REQUIRE(atoll("-1") == strtoll("-1", NULL, 10));
+ ATF_REQUIRE(atoll(buf) == strtoll(buf, NULL, 10));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, atof_strtod);
+ ATF_TP_ADD_TC(tp, atoi_strtol);
+ ATF_TP_ADD_TC(tp, atol_strtol);
+ ATF_TP_ADD_TC(tp, atoll_strtoll);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_div.c b/contrib/netbsd-tests/lib/libc/stdlib/t_div.c
new file mode 100644
index 0000000..376f357
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_div.c
@@ -0,0 +1,98 @@
+/* $NetBSD: t_div.c,v 1.2 2011/07/07 11:12:18 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define NUM 1999236
+#define DENOM 1000000
+#define QUOT 1
+#define REM 999236
+
+ATF_TC(div_basic);
+ATF_TC_HEAD(div_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test div(3) for correctness");
+}
+
+ATF_TC_BODY(div_basic, tc)
+{
+ div_t d;
+
+ d = div(NUM, DENOM);
+
+ ATF_CHECK(d.quot == QUOT);
+ ATF_CHECK(d.rem == REM);
+}
+
+ATF_TC(ldiv_basic);
+ATF_TC_HEAD(ldiv_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test ldiv(3) for correctness");
+}
+
+ATF_TC_BODY(ldiv_basic, tc)
+{
+ ldiv_t ld;
+
+ ld = ldiv(NUM, DENOM);
+
+ ATF_CHECK(ld.quot == QUOT);
+ ATF_CHECK(ld.rem == REM);
+}
+
+ATF_TC(lldiv_basic);
+ATF_TC_HEAD(lldiv_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test lllldiv(3) for correctness");
+}
+
+ATF_TC_BODY(lldiv_basic, tc)
+{
+ lldiv_t lld;
+
+ lld = lldiv(NUM, DENOM);
+
+ ATF_CHECK(lld.quot == QUOT);
+ ATF_CHECK(lld.rem == REM);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, div_basic);
+ ATF_TP_ADD_TC(tp, ldiv_basic);
+ ATF_TP_ADD_TC(tp, lldiv_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_exit.c b/contrib/netbsd-tests/lib/libc/stdlib/t_exit.c
new file mode 100644
index 0000000..067cb51
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_exit.c
@@ -0,0 +1,186 @@
+/* $NetBSD: t_exit.c,v 1.1 2011/05/09 07:31:51 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_exit.c,v 1.1 2011/05/09 07:31:51 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static bool fail;
+static void func(void);
+
+static void
+func(void)
+{
+ fail = false;
+}
+
+ATF_TC(exit_atexit);
+ATF_TC_HEAD(exit_atexit, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of atexit(3)");
+}
+
+ATF_TC_BODY(exit_atexit, tc)
+{
+ pid_t pid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (atexit(func) != 0)
+ _exit(EXIT_FAILURE);
+
+ fail = true;
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("atexit(3) failed");
+
+ if (fail != false)
+ atf_tc_fail("atexit(3) was not called");
+}
+
+ATF_TC(exit_basic);
+ATF_TC_HEAD(exit_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of exit(3)");
+}
+
+ATF_TC_BODY(exit_basic, tc)
+{
+ pid_t pid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+ exit(EXIT_SUCCESS);
+ exit(EXIT_FAILURE);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("exit(3) did not exit successfully");
+}
+
+ATF_TC(exit_status);
+ATF_TC_HEAD(exit_status, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test exit(3) status");
+}
+
+ATF_TC_BODY(exit_status, tc)
+{
+ const int n = 10;
+ int i, sta;
+ pid_t pid;
+
+ for (i = 0; i < n; i++) {
+
+ pid = fork();
+
+ if (pid < 0)
+ exit(EXIT_FAILURE);
+
+ if (pid == 0)
+ exit(i);
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != i)
+ atf_tc_fail("invalid exit(3) status");
+ }
+}
+
+ATF_TC(exit_tmpfile);
+ATF_TC_HEAD(exit_tmpfile, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Temporary files are unlinked?");
+}
+
+ATF_TC_BODY(exit_tmpfile, tc)
+{
+ int sta, fd = -1;
+ char buf[12];
+ pid_t pid;
+ FILE *f;
+
+ (void)strlcpy(buf, "exit.XXXXXX", sizeof(buf));
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ fd = mkstemp(buf);
+
+ if (fd < 0)
+ exit(EXIT_FAILURE);
+
+ exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("failed to create temporary file");
+
+ f = fdopen(fd, "r");
+
+ if (f != NULL)
+ atf_tc_fail("exit(3) did not clear temporary file");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, exit_atexit);
+ ATF_TP_ADD_TC(tp, exit_basic);
+ ATF_TP_ADD_TC(tp, exit_status);
+ ATF_TP_ADD_TC(tp, exit_tmpfile);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
new file mode 100644
index 0000000..35d6874
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
@@ -0,0 +1,199 @@
+/* $NetBSD: t_getenv.c,v 1.2 2011/07/15 13:54:31 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getenv.c,v 1.2 2011/07/15 13:54:31 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+extern char **environ;
+
+ATF_TC(clearenv_basic);
+ATF_TC_HEAD(clearenv_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test user clearing environment directly");
+}
+
+ATF_TC_BODY(clearenv_basic, tc)
+{
+ char name[1024], value[1024];
+
+ for (size_t i = 0; i < 1024; i++) {
+ snprintf(name, sizeof(name), "crap%zu", i);
+ snprintf(value, sizeof(value), "%zu", i);
+ ATF_CHECK(setenv(name, value, 1) != -1);
+ }
+
+ *environ = NULL;
+
+ for (size_t i = 0; i < 1; i++) {
+ snprintf(name, sizeof(name), "crap%zu", i);
+ snprintf(value, sizeof(value), "%zu", i);
+ ATF_CHECK(setenv(name, value, 1) != -1);
+ }
+
+ ATF_CHECK_STREQ(getenv("crap0"), "0");
+ ATF_CHECK(getenv("crap1") == NULL);
+ ATF_CHECK(getenv("crap2") == NULL);
+}
+
+ATF_TC(getenv_basic);
+ATF_TC_HEAD(getenv_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test setenv(3), getenv(3)");
+}
+
+ATF_TC_BODY(getenv_basic, tc)
+{
+ ATF_CHECK(setenv("EVIL", "very=bad", 1) != -1);
+ ATF_CHECK_STREQ(getenv("EVIL"), "very=bad");
+ ATF_CHECK(getenv("EVIL=very") == NULL);
+ ATF_CHECK(unsetenv("EVIL") != -1);
+}
+
+ATF_TC(putenv_basic);
+ATF_TC_HEAD(putenv_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test putenv(3), getenv(3), unsetenv(3)");
+}
+
+
+ATF_TC_BODY(putenv_basic, tc)
+{
+ char string[1024];
+
+ snprintf(string, sizeof(string), "crap=true");
+ ATF_CHECK(putenv(string) != -1);
+ ATF_CHECK_STREQ(getenv("crap"), "true");
+ string[1] = 'l';
+ ATF_CHECK_STREQ(getenv("clap"), "true");
+ ATF_CHECK(getenv("crap") == NULL);
+ string[1] = 'r';
+ ATF_CHECK(unsetenv("crap") != -1);
+ ATF_CHECK(getenv("crap") == NULL);
+
+ ATF_CHECK_ERRNO(EINVAL, putenv(NULL) == -1);
+ ATF_CHECK_ERRNO(EINVAL, putenv(__UNCONST("val")) == -1);
+ ATF_CHECK_ERRNO(EINVAL, putenv(__UNCONST("=val")) == -1);
+}
+
+ATF_TC(setenv_basic);
+ATF_TC_HEAD(setenv_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test setenv(3), getenv(3), unsetenv(3)");
+ atf_tc_set_md_var(tc, "timeout", "300");
+}
+
+ATF_TC_BODY(setenv_basic, tc)
+{
+ const size_t numvars = 8192;
+ size_t i, offset;
+ char name[1024];
+ char value[1024];
+
+ offset = lrand48();
+ for (i = 0; i < numvars; i++) {
+ (void)snprintf(name, sizeof(name), "var%zu",
+ (i * 7 + offset) % numvars);
+ (void)snprintf(value, sizeof(value), "value%ld", lrand48());
+ ATF_CHECK(setenv(name, value, 1) != -1);
+ ATF_CHECK(setenv(name, "foo", 0) != -1);
+ ATF_CHECK_STREQ(getenv(name), value);
+ }
+
+ offset = lrand48();
+ for (i = 0; i < numvars; i++) {
+ (void)snprintf(name, sizeof(name), "var%zu",
+ (i * 11 + offset) % numvars);
+ ATF_CHECK(unsetenv(name) != -1);
+ ATF_CHECK(getenv(name) == NULL);
+ ATF_CHECK(unsetenv(name) != -1);
+ }
+
+ ATF_CHECK_ERRNO(EINVAL, setenv(NULL, "val", 1) == -1);
+ ATF_CHECK_ERRNO(EINVAL, setenv("", "val", 1) == -1);
+ ATF_CHECK_ERRNO(EINVAL, setenv("v=r", "val", 1) == -1);
+ ATF_CHECK_ERRNO(EINVAL, setenv("var", NULL, 1) == -1);
+
+ ATF_CHECK(setenv("var", "=val", 1) == 0);
+ ATF_CHECK_STREQ(getenv("var"), "=val");
+}
+
+ATF_TC(setenv_mixed);
+ATF_TC_HEAD(setenv_mixed, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test mixing setenv(3), unsetenv(3) and putenv(3)");
+}
+
+ATF_TC_BODY(setenv_mixed, tc)
+{
+ char string[32];
+
+ (void)strcpy(string, "mixedcrap=putenv");
+
+ ATF_CHECK(setenv("mixedcrap", "setenv", 1) != -1);
+ ATF_CHECK_STREQ(getenv("mixedcrap"), "setenv");
+ ATF_CHECK(putenv(string) != -1);
+ ATF_CHECK_STREQ(getenv("mixedcrap"), "putenv");
+ ATF_CHECK(unsetenv("mixedcrap") != -1);
+ ATF_CHECK(getenv("mixedcrap") == NULL);
+
+ ATF_CHECK(putenv(string) != -1);
+ ATF_CHECK_STREQ(getenv("mixedcrap"), "putenv");
+ ATF_CHECK(setenv("mixedcrap", "setenv", 1) != -1);
+ ATF_CHECK_STREQ(getenv("mixedcrap"), "setenv");
+ ATF_CHECK(unsetenv("mixedcrap") != -1);
+ ATF_CHECK(getenv("mixedcrap") == NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, clearenv_basic);
+ ATF_TP_ADD_TC(tp, getenv_basic);
+ ATF_TP_ADD_TC(tp, putenv_basic);
+ ATF_TP_ADD_TC(tp, setenv_basic);
+ ATF_TP_ADD_TC(tp, setenv_mixed);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv_thread.c b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv_thread.c
new file mode 100644
index 0000000..d935629
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv_thread.c
@@ -0,0 +1,250 @@
+/* $NetBSD: t_getenv_thread.c,v 1.2 2012/03/15 02:02:23 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matthias Scheler.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getenv_thread.c,v 1.2 2012/03/15 02:02:23 joerg Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#define THREADED_NUM_THREADS 8
+#define THREADED_NUM_VARS 16
+#define THREADED_VAR_NAME "THREADED%zu"
+#define THREADED_RUN_TIME 10
+
+static void *thread_getenv_r(void *);
+static void *thread_putenv(void *);
+static void *thread_setenv(void *);
+static void *thread_unsetenv(void *);
+
+static void *
+thread_getenv_r(void *arg)
+{
+ time_t endtime;
+
+ endtime = *(time_t *)arg;
+ do {
+ size_t i;
+ char name[32], value[128];
+
+ i = lrand48() % THREADED_NUM_VARS;
+ (void)snprintf(name, sizeof(name), THREADED_VAR_NAME, i);
+
+ if (getenv_r(name, value, sizeof(value)) == -1) {
+ ATF_CHECK(errno == ENOENT);
+ }
+ } while (time(NULL) < endtime);
+
+ return NULL;
+}
+
+
+static void *
+thread_putenv(void *arg)
+{
+ time_t endtime;
+ size_t i;
+ static char vars[THREADED_NUM_VARS][128];
+
+ for (i = 0; i < THREADED_NUM_VARS; i++) {
+ (void)snprintf(vars[i], sizeof(vars[i]),
+ THREADED_VAR_NAME "=putenv %ld", i, lrand48());
+ }
+
+ endtime = *(time_t *)arg;
+ do {
+ char name[128];
+
+ i = lrand48() % THREADED_NUM_VARS;
+ (void)strlcpy(name, vars[i], sizeof(name));
+ *strchr(name, '=') = '\0';
+
+ ATF_CHECK(unsetenv(name) != -1);
+ ATF_CHECK(putenv(vars[i]) != -1);
+ } while (time(NULL) < endtime);
+
+ return NULL;
+}
+
+static void *
+thread_setenv(void *arg)
+{
+ time_t endtime;
+
+ endtime = *(time_t *)arg;
+ do {
+ size_t i;
+ char name[32], value[64];
+
+ i = lrand48() % THREADED_NUM_VARS;
+ (void)snprintf(name, sizeof(name), THREADED_VAR_NAME, i);
+ (void)snprintf(value, sizeof(value), "setenv %ld", lrand48());
+
+ ATF_CHECK(setenv(name, value, 1) != -1);
+ } while (time(NULL) < endtime);
+
+ return NULL;
+}
+
+static void *
+thread_unsetenv(void *arg)
+{
+ time_t endtime;
+
+ endtime = *(time_t *)arg;
+ do {
+ size_t i;
+ char name[32];
+
+ i = lrand48() % THREADED_NUM_VARS;
+ (void)snprintf(name, sizeof(name), THREADED_VAR_NAME, i);
+
+ ATF_CHECK(unsetenv(name) != -1);
+ } while (time(NULL) < endtime);
+
+ return NULL;
+}
+
+ATF_TC(getenv_r_thread);
+ATF_TC_HEAD(getenv_r_thread, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test getenv_r(3) with threads");
+ atf_tc_set_md_var(tc, "timeout", "%d", THREADED_RUN_TIME + 5);
+}
+
+ATF_TC_BODY(getenv_r_thread, tc)
+{
+ pthread_t threads[THREADED_NUM_THREADS];
+ time_t endtime;
+ size_t i, j;
+
+ endtime = time(NULL) + THREADED_RUN_TIME;
+
+ for (i = j = 0; j < 2; j++) {
+
+ ATF_CHECK(pthread_create(&threads[i++], NULL, thread_getenv_r,
+ &endtime) == 0);
+ }
+
+ for (j = 0; j < i; j++)
+ ATF_CHECK(pthread_join(threads[j], NULL) == 0);
+}
+
+ATF_TC(putenv_thread);
+ATF_TC_HEAD(putenv_thread, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test concurrent access by putenv(3)");
+ atf_tc_set_md_var(tc, "timeout", "%d", THREADED_RUN_TIME + 5);
+}
+
+ATF_TC_BODY(putenv_thread, tc)
+{
+ pthread_t threads[THREADED_NUM_THREADS];
+ time_t endtime;
+ size_t i, j;
+
+ endtime = time(NULL) + THREADED_RUN_TIME;
+
+ for (i = j = 0; j < 2; j++) {
+
+ ATF_CHECK(pthread_create(&threads[i++], NULL, thread_putenv,
+ &endtime) == 0);
+ }
+
+ for (j = 0; j < i; j++)
+ ATF_CHECK(pthread_join(threads[j], NULL) == 0);
+}
+
+ATF_TC(setenv_thread);
+ATF_TC_HEAD(setenv_thread, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test concurrent access by setenv(3)");
+ atf_tc_set_md_var(tc, "timeout", "%d", THREADED_RUN_TIME + 5);
+}
+
+ATF_TC_BODY(setenv_thread, tc)
+{
+ pthread_t threads[THREADED_NUM_THREADS];
+ time_t endtime;
+ size_t i, j;
+
+ endtime = time(NULL) + THREADED_RUN_TIME;
+
+ for (i = j = 0; j < 2; j++) {
+
+ ATF_CHECK(pthread_create(&threads[i++], NULL, thread_setenv,
+ &endtime) == 0);
+ }
+
+ for (j = 0; j < i; j++)
+ ATF_CHECK(pthread_join(threads[j], NULL) == 0);
+}
+
+ATF_TC(unsetenv_thread);
+ATF_TC_HEAD(unsetenv_thread, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test unsetenv(3) with threads");
+ atf_tc_set_md_var(tc, "timeout", "%d", THREADED_RUN_TIME + 5);
+}
+
+ATF_TC_BODY(unsetenv_thread, tc)
+{
+ pthread_t threads[THREADED_NUM_THREADS];
+ time_t endtime;
+ size_t i, j;
+
+ endtime = time(NULL) + THREADED_RUN_TIME;
+
+ for (i = j = 0; j < 2; j++) {
+
+ ATF_CHECK(pthread_create(&threads[i++], NULL, thread_unsetenv,
+ &endtime) == 0);
+ }
+
+ for (j = 0; j < i; j++)
+ ATF_CHECK(pthread_join(threads[j], NULL) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getenv_r_thread);
+ ATF_TP_ADD_TC(tp, putenv_thread);
+ ATF_TP_ADD_TC(tp, setenv_thread);
+ ATF_TP_ADD_TC(tp, unsetenv_thread);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_getopt.sh b/contrib/netbsd-tests/lib/libc/stdlib/t_getopt.sh
new file mode 100755
index 0000000..cc10f65
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_getopt.sh
@@ -0,0 +1,123 @@
+# $NetBSD: t_getopt.sh,v 1.1 2011/01/01 23:56:49 pgoyette Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+h_getopt()
+{
+ atf_check -e save:stderr -x "$(atf_get_srcdir)/h_getopt" <<EOF
+load: $1
+args: $2
+result: $3
+EOF
+ cat stderr
+ rm -f stderr
+}
+
+h_getopt_long()
+{
+ atf_check -e save:stderr -x "$(atf_get_srcdir)/h_getopt_long" <<EOF
+$1
+args: $2
+result: $3
+EOF
+ cat stderr
+ rm -f stderr
+}
+
+atf_test_case getopt
+getopt_head()
+{
+ atf_set "descr" "Checks getopt(3)"
+}
+getopt_body()
+{
+ load="c:d"
+
+ h_getopt "${load}" "foo -c 1 -d foo" "c=1,d|1"
+ h_getopt "${load}" "foo -d foo bar" "d|2"
+ h_getopt "${load}" "foo -c 2 foo bar" "c=2|2"
+ h_getopt "${load}" "foo -e 1 foo bar" "!?|3"
+ h_getopt "${load}" "foo -d -- -c 1" "d|2"
+ h_getopt "${load}" "foo -c- 1" "c=-|1"
+ h_getopt "${load}" "foo -d - 1" "d|2"
+}
+
+atf_test_case getopt_long
+getopt_long_head()
+{
+ atf_set "descr" "Checks getopt_long(3)"
+}
+getopt_long_body()
+{
+ # GNU libc tests with these
+ load="optstring: abc:
+longopts: 5
+longopt: required, required_argument, , 'r'
+longopt: optional, optional_argument, , 'o'
+longopt: none, no_argument, , 'n'
+longopt: color, no_argument, , 'C'
+longopt: colour, no_argument, , 'C'"
+
+ h_getopt_long "${load}" "foo --req foobar" "-required=foobar|0"
+ h_getopt_long "${load}" "foo --opt=bazbug" "-optional=bazbug|0"
+
+ # This is problematic
+ #
+ # GNU libc 2.1.3 this fails with ambiguous result
+ # h_getopt_long "${load}" "foo --col" "!?|0"
+ #
+ # GNU libc 2.2 >= this works
+ h_getopt_long "${load}" "foo --col" "-color|0"
+
+ h_getopt_long "${load}" "foo --colour" "-colour|0"
+
+ # This is the real GNU libc test!
+ args="foo -a -b -cfoobar --required foobar --optional=bazbug --none random --col --color --colour"
+ # GNU libc 2.1.3 this fails with ambiguous
+ #result="a,b,c=foobar,-required=foobar,-optional=bazbug,-none,!?,-color,-colour|1"
+ #
+ # GNU libc 2.2 >= this works
+ result="a,b,c=foobar,-required=foobar,-optional=bazbug,-none,-color,-color,-colour|1"
+ h_getopt_long "${load}" "${args}" "${result}"
+
+ #
+ # The order of long options in the long option array should not matter.
+ # An exact match should never be treated as ambiguous.
+ #
+ load="optstring: fgl
+longopts: 3
+longopt: list-foobar, no_argument, lopt, 'f'
+longopt: list-goobar, no_argument, lopt, 'g'
+longopt: list, no_argument, lopt, 'l'"
+ h_getopt_long "${load}" "foo --list" "-list|0"
+}
+
+
+atf_init_test_cases()
+{
+ atf_add_test_case getopt
+ atf_add_test_case getopt_long
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c b/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c
new file mode 100644
index 0000000..099b3e7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c
@@ -0,0 +1,399 @@
+/* $NetBSD: t_hsearch.c,v 1.4 2014/07/20 20:17:21 christos Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Copyright (c) 2001 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 for the
+ * NetBSD Project. See http://www.NetBSD.org/ for
+ * information about NetBSD.
+ * 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: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_hsearch.c,v 1.4 2014/07/20 20:17:21 christos Exp $");
+
+#include <errno.h>
+#include <search.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <atf-c.h>
+
+#define REQUIRE_ERRNO(x) ATF_REQUIRE_MSG(x, "%s", strerror(errno))
+
+ATF_TC(hsearch_basic);
+ATF_TC_HEAD(hsearch_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks basic insertions and searching");
+}
+
+ATF_TC_BODY(hsearch_basic, tc)
+{
+ ENTRY e, *ep;
+ char ch[2];
+ int i;
+
+ REQUIRE_ERRNO(hcreate(16) != 0);
+
+ /* ch[1] should be constant from here on down. */
+ ch[1] = '\0';
+
+ /* Basic insertions. Check enough that there'll be collisions. */
+ for (i = 0; i < 26; i++) {
+ ch[0] = 'a' + i;
+ e.key = strdup(ch); /* ptr to provided key is kept! */
+ ATF_REQUIRE(e.key != NULL);
+ e.data = (void *)(intptr_t)i;
+
+ ep = hsearch(e, ENTER);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, ch);
+ ATF_REQUIRE_EQ((intptr_t)ep->data, i);
+ }
+
+ /* e.key should be constant from here on down. */
+ e.key = ch;
+
+ /* Basic lookups. */
+ for (i = 0; i < 26; i++) {
+ ch[0] = 'a' + i;
+
+ ep = hsearch(e, FIND);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, ch);
+ ATF_REQUIRE_EQ((intptr_t)ep->data, i);
+ }
+
+ hdestroy1(free, NULL);
+}
+
+ATF_TC(hsearch_duplicate);
+ATF_TC_HEAD(hsearch_duplicate, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that inserting duplicate "
+ "doesn't overwrite existing data");
+}
+
+ATF_TC_BODY(hsearch_duplicate, tc)
+{
+ ENTRY e, *ep;
+
+ REQUIRE_ERRNO(hcreate(16));
+
+ e.key = __UNCONST("a");
+ e.data = (void *)(intptr_t) 0;
+
+ ep = hsearch(e, ENTER);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "a");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 0);
+
+ e.data = (void *)(intptr_t)12345;
+
+ ep = hsearch(e, ENTER);
+ ep = hsearch(e, FIND);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "a");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 0);
+
+ hdestroy();
+}
+
+ATF_TC(hsearch_nonexistent);
+ATF_TC_HEAD(hsearch_nonexistent, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks searching for non-existent entry");
+}
+
+ATF_TC_BODY(hsearch_nonexistent, tc)
+{
+ ENTRY e, *ep;
+
+ REQUIRE_ERRNO(hcreate(16));
+
+ e.key = __UNCONST("A");
+ ep = hsearch(e, FIND);
+ ATF_REQUIRE_EQ(ep, NULL);
+
+ hdestroy();
+}
+
+ATF_TC(hsearch_two);
+ATF_TC_HEAD(hsearch_two, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that searching doesn't overwrite previous search results");
+}
+
+ATF_TC_BODY(hsearch_two, tc)
+{
+ ENTRY e, *ep, *ep2;
+
+ REQUIRE_ERRNO(hcreate(16));
+
+ e.key = __UNCONST("a");
+ e.data = (void*)(intptr_t)0;
+
+ ep = hsearch(e, ENTER);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "a");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 0);
+
+ e.key = __UNCONST("b");
+ e.data = (void*)(intptr_t)1;
+
+ ep = hsearch(e, ENTER);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "b");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 1);
+
+ e.key = __UNCONST("a");
+ ep = hsearch(e, FIND);
+
+ e.key = __UNCONST("b");
+ ep2 = hsearch(e, FIND);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "a");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 0);
+
+ ATF_REQUIRE(ep2 != NULL);
+ ATF_REQUIRE_STREQ(ep2->key, "b");
+ ATF_REQUIRE_EQ((intptr_t)ep2->data, 1);
+
+ hdestroy();
+}
+
+ATF_TC(hsearch_r_basic);
+ATF_TC_HEAD(hsearch_r_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks basic insertions and searching");
+}
+
+ATF_TC_BODY(hsearch_r_basic, tc)
+{
+ ENTRY e, *ep;
+ char ch[2];
+ int i;
+ struct hsearch_data t;
+
+ REQUIRE_ERRNO(hcreate_r(16, &t) != 0);
+
+ /* ch[1] should be constant from here on down. */
+ ch[1] = '\0';
+
+ /* Basic insertions. Check enough that there'll be collisions. */
+ for (i = 0; i < 26; i++) {
+ ch[0] = 'a' + i;
+ e.key = strdup(ch); /* ptr to provided key is kept! */
+ ATF_REQUIRE(e.key != NULL);
+ e.data = (void *)(intptr_t)i;
+
+ ATF_REQUIRE(hsearch_r(e, ENTER, &ep, &t) == 1);
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, ch);
+ ATF_REQUIRE_EQ((intptr_t)ep->data, i);
+ }
+
+ /* e.key should be constant from here on down. */
+ e.key = ch;
+
+ /* Basic lookups. */
+ for (i = 0; i < 26; i++) {
+ ch[0] = 'a' + i;
+
+ ATF_REQUIRE(hsearch_r(e, FIND, &ep, &t) == 1);
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, ch);
+ ATF_REQUIRE_EQ((intptr_t)ep->data, i);
+ }
+
+ hdestroy1_r(&t, free, NULL);
+}
+
+ATF_TC(hsearch_r_duplicate);
+ATF_TC_HEAD(hsearch_r_duplicate, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that inserting duplicate "
+ "doesn't overwrite existing data");
+}
+
+ATF_TC_BODY(hsearch_r_duplicate, tc)
+{
+ ENTRY e, *ep;
+ struct hsearch_data t;
+
+ REQUIRE_ERRNO(hcreate_r(16, &t));
+
+ e.key = __UNCONST("a");
+ e.data = (void *)(intptr_t) 0;
+
+ ATF_REQUIRE(hsearch_r(e, ENTER, &ep, &t) == 1);
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "a");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 0);
+
+ e.data = (void *)(intptr_t)12345;
+
+ ATF_REQUIRE(hsearch_r(e, ENTER, &ep, &t) == 1);
+ ATF_REQUIRE(hsearch_r(e, FIND, &ep, &t) == 1);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "a");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 0);
+
+ hdestroy_r(&t);
+}
+
+ATF_TC(hsearch_r_nonexistent);
+ATF_TC_HEAD(hsearch_r_nonexistent, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks searching for non-existent entry");
+}
+
+ATF_TC_BODY(hsearch_r_nonexistent, tc)
+{
+ ENTRY e, *ep;
+ struct hsearch_data t;
+
+ REQUIRE_ERRNO(hcreate_r(16, &t));
+
+ e.key = __UNCONST("A");
+ ATF_REQUIRE(hsearch_r(e, FIND, &ep, &t) == 1);
+ ATF_REQUIRE_EQ(ep, NULL);
+
+ hdestroy_r(&t);
+}
+
+ATF_TC(hsearch_r_two);
+ATF_TC_HEAD(hsearch_r_two, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that searching doesn't overwrite previous search results");
+}
+
+ATF_TC_BODY(hsearch_r_two, tc)
+{
+ ENTRY e, *ep, *ep2;
+ struct hsearch_data t;
+
+ REQUIRE_ERRNO(hcreate_r(16, &t));
+
+ e.key = __UNCONST("a");
+ e.data = (void*)(intptr_t)0;
+
+ ATF_REQUIRE(hsearch_r(e, ENTER, &ep, &t) == 1);
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "a");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 0);
+
+ e.key = __UNCONST("b");
+ e.data = (void*)(intptr_t)1;
+
+ ATF_REQUIRE(hsearch_r(e, ENTER, &ep, &t) == 1);
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "b");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 1);
+
+ e.key = __UNCONST("a");
+ ATF_REQUIRE(hsearch_r(e, FIND, &ep, &t) == 1);
+
+ e.key = __UNCONST("b");
+ ATF_REQUIRE(hsearch_r(e, FIND, &ep2, &t) == 1);
+
+ ATF_REQUIRE(ep != NULL);
+ ATF_REQUIRE_STREQ(ep->key, "a");
+ ATF_REQUIRE_EQ((intptr_t)ep->data, 0);
+
+ ATF_REQUIRE(ep2 != NULL);
+ ATF_REQUIRE_STREQ(ep2->key, "b");
+ ATF_REQUIRE_EQ((intptr_t)ep2->data, 1);
+
+ hdestroy_r(&t);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, hsearch_basic);
+ ATF_TP_ADD_TC(tp, hsearch_duplicate);
+ ATF_TP_ADD_TC(tp, hsearch_nonexistent);
+ ATF_TP_ADD_TC(tp, hsearch_two);
+
+ ATF_TP_ADD_TC(tp, hsearch_r_basic);
+ ATF_TP_ADD_TC(tp, hsearch_r_duplicate);
+ ATF_TP_ADD_TC(tp, hsearch_r_nonexistent);
+ ATF_TP_ADD_TC(tp, hsearch_r_two);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_mi_vector_hash.c b/contrib/netbsd-tests/lib/libc/stdlib/t_mi_vector_hash.c
new file mode 100644
index 0000000..77d6443
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_mi_vector_hash.c
@@ -0,0 +1,95 @@
+/* $NetBSD: t_mi_vector_hash.c,v 1.3 2011/07/07 11:12:18 jruoho Exp $ */
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mi_vector_hash.c,v 1.3 2011/07/07 11:12:18 jruoho Exp $");
+
+#include <atf-c.h>
+#include <stdlib.h>
+#include <string.h>
+
+ATF_TC(mi_vector_hash_basic);
+ATF_TC_HEAD(mi_vector_hash_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test mi_vector_hash_vector_hash for consistent results");
+}
+
+static const struct testvector {
+ const char *vector;
+ uint32_t hashes[3];
+} testv[] = {
+ { "hello, world", { 0xd38f7f21, 0xbf6be9ab, 0x37a0e989 } },
+ { "", { 0x9b2ec03d, 0xdb2b69ae, 0xbd49d10d } },
+ { "a", { 0x9454baa3, 0xb711c708, 0x29eec818 } },
+ { "ab", { 0x9a5dca90, 0xdd212644, 0x9879ac41 } },
+ { "abc", { 0x0b91c470, 0x4770cdf5, 0x251e4793 } },
+ { "abcd", { 0x5f128df3, 0xf5a667a6, 0x5ae61fa5 } },
+ { "abcde", { 0x4cbae281, 0x799c0ed5, 0x03a96866 } },
+ { "abcdef", { 0x507a54c8, 0xb6bd06f4, 0xde922732 } },
+ { "abcdefg", { 0xae2bca5d, 0x61e960ef, 0xb9e6762c } },
+ { "abcdefgh", { 0xd1021264, 0x87f6988f, 0x053f775e } },
+ { "abcdefghi", { 0xe380defc, 0xfc35a811, 0x3a7b0a5f } },
+ { "abcdefghij", { 0x9a504408, 0x70d2e89d, 0xc9cac242 } },
+ { "abcdefghijk", { 0x376117d0, 0x89f434d4, 0xe52b8e4c } },
+ { "abcdefghijkl", { 0x92253599, 0x7b6ff99e, 0x0b1b3ea5 } },
+ { "abcdefghijklm", { 0x92ee6a52, 0x55587d47, 0x3122b031 } },
+ { "abcdefghijklmn", { 0x827baf08, 0x1d0ada73, 0xfec330e0 } },
+ { "abcdefghijklmno", { 0x06ab787d, 0xc1ad17c2, 0x11dccf31 } },
+ { "abcdefghijklmnop", { 0x2cf18103, 0x638c9268, 0xfa1ecf51 } },
+};
+
+ATF_TC_BODY(mi_vector_hash_basic, tc)
+{
+ size_t i, j, len;
+ uint32_t hashes[3];
+ char buf[256];
+
+ for (j = 0; j < 8; ++j) {
+ for (i = 0; i < sizeof(testv) / sizeof(testv[0]); ++i) {
+ len = strlen(testv[i].vector);
+ strcpy(buf + j, testv[i].vector);
+ mi_vector_hash(buf + j, len, 0, hashes);
+ ATF_CHECK_EQ(hashes[0], testv[i].hashes[0]);
+ ATF_CHECK_EQ(hashes[1], testv[i].hashes[1]);
+ ATF_CHECK_EQ(hashes[2], testv[i].hashes[2]);
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, mi_vector_hash_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c b/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c
new file mode 100644
index 0000000..47afb84
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c
@@ -0,0 +1,88 @@
+/* $NetBSD: t_posix_memalign.c,v 1.2 2011/07/07 11:12:18 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_posix_memalign.c,v 1.2 2011/07/07 11:12:18 jruoho Exp $");
+
+#include <atf-c.h>
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+ATF_TC(posix_memalign_basic);
+ATF_TC_HEAD(posix_memalign_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks posix_memalign(3)");
+}
+ATF_TC_BODY(posix_memalign_basic, tc)
+{
+ size_t size[] = {
+ 1, 2, 3, 4, 10, 100, 16384, 32768, 65536
+ };
+ size_t align[] = {
+ 512, 1024, 16, 32, 64, 4, 2048, 16, 2
+ };
+
+ size_t i;
+ void *p;
+
+ for (i = 0; i < __arraycount(size); i++) {
+ int ret;
+ p = (void*)0x1;
+
+ (void)printf("Checking posix_memalign(&p, %zd, %zd)...\n",
+ align[i], size[i]);
+ ret = posix_memalign(&p, align[i], size[i]);
+
+ if ( align[i] < sizeof(void *))
+ ATF_REQUIRE_EQ_MSG(ret, EINVAL,
+ "posix_memalign: %s", strerror(ret));
+ else {
+ ATF_REQUIRE_EQ_MSG(ret, 0,
+ "posix_memalign: %s", strerror(ret));
+ ATF_REQUIRE_EQ_MSG(((intptr_t)p) & (align[i] - 1), 0,
+ "p = %p", p);
+ free(p);
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, posix_memalign_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_random.c b/contrib/netbsd-tests/lib/libc/stdlib/t_random.c
new file mode 100644
index 0000000..9a6d21e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_random.c
@@ -0,0 +1,82 @@
+/* $NetBSD: t_random.c,v 1.3 2012/03/29 08:56:06 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_random.c,v 1.3 2012/03/29 08:56:06 jruoho Exp $");
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * TODO: Add some general RNG tests (cf. the famous "diehard" tests?).
+ */
+
+ATF_TC(random_same);
+ATF_TC_HEAD(random_same, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that random(3) does not always return the same "
+ "value when the seed is initialized to zero");
+}
+
+#define MAX_ITER 10
+
+ATF_TC_BODY(random_same, tc)
+{
+ long buf[MAX_ITER];
+ size_t i, j;
+
+ /*
+ * See CVE-2012-1577.
+ */
+ srandom(0);
+
+ for (i = 0; i < __arraycount(buf); i++) {
+
+ buf[i] = random();
+
+ for (j = 0; j < i; j++) {
+
+ (void)fprintf(stderr, "i = %zu, j = %zu: "
+ "%ld vs. %ld\n", i, j, buf[i], buf[j]);
+
+ ATF_CHECK(buf[i] != buf[j]);
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, random_same);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c b/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
new file mode 100644
index 0000000..d7ebe1b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
@@ -0,0 +1,335 @@
+/* $NetBSD: t_strtod.c,v 1.31 2012/09/26 07:24:38 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Public domain, Otto Moerbeek <otto@drijf.net>, 2006. */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_strtod.c,v 1.31 2012/09/26 07:24:38 jruoho Exp $");
+
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#if defined(__i386__) || defined(__amd64__) || defined(__sparc__)
+#include <fenv.h>
+#endif
+
+#if !defined(__vax__)
+static const char * const inf_strings[] =
+ { "Inf", "INF", "-Inf", "-INF", "Infinity", "+Infinity",
+ "INFINITY", "-INFINITY", "InFiNiTy", "+InFiNiTy" };
+const char *nan_string = "NaN(x)y";
+#endif
+
+ATF_TC(strtod_basic);
+ATF_TC_HEAD(strtod_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of strtod(3)");
+}
+
+ATF_TC_BODY(strtod_basic, tc)
+{
+ static const size_t n = 1024 * 1000;
+
+ for (size_t i = 1; i < n; i = i + 1024) {
+ char buf[512];
+ (void)snprintf(buf, sizeof(buf), "%zu.%zu", i, i + 1);
+
+ errno = 0;
+ double d = strtod(buf, NULL);
+
+ ATF_REQUIRE(d > 0.0);
+ ATF_REQUIRE(errno == 0);
+ }
+}
+
+ATF_TC(strtod_hex);
+ATF_TC_HEAD(strtod_hex, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A strtod(3) with hexadecimals");
+}
+
+#ifdef __vax__
+#define SMALL_NUM 1.0e-38
+#else
+#define SMALL_NUM 1.0e-40
+#endif
+
+ATF_TC_BODY(strtod_hex, tc)
+{
+ const char *str;
+ char *end;
+ volatile double d;
+
+ str = "-0x0";
+ d = strtod(str, &end); /* -0.0 */
+
+ ATF_REQUIRE(end == str + 4);
+ ATF_REQUIRE(signbit(d) != 0);
+ ATF_REQUIRE(fabs(d) < SMALL_NUM);
+
+ str = "-0x";
+ d = strtod(str, &end); /* -0.0 */
+
+ ATF_REQUIRE(end == str + 2);
+ ATF_REQUIRE(signbit(d) != 0);
+ ATF_REQUIRE(fabs(d) < SMALL_NUM);
+}
+
+ATF_TC(strtod_inf);
+ATF_TC_HEAD(strtod_inf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A strtod(3) with INF (PR lib/33262)");
+}
+
+ATF_TC_BODY(strtod_inf, tc)
+{
+#ifndef __vax__
+ for (size_t i = 0; i < __arraycount(inf_strings); i++) {
+ volatile double d = strtod(inf_strings[i], NULL);
+ ATF_REQUIRE(isinf(d) != 0);
+ }
+#else
+ atf_tc_skip("vax not supported");
+#endif
+}
+
+ATF_TC(strtof_inf);
+ATF_TC_HEAD(strtof_inf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A strtof(3) with INF (PR lib/33262)");
+}
+
+ATF_TC_BODY(strtof_inf, tc)
+{
+#ifndef __vax__
+ for (size_t i = 0; i < __arraycount(inf_strings); i++) {
+ volatile float f = strtof(inf_strings[i], NULL);
+ ATF_REQUIRE(isinf(f) != 0);
+ }
+#else
+ atf_tc_skip("vax not supported");
+#endif
+}
+
+ATF_TC(strtold_inf);
+ATF_TC_HEAD(strtold_inf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A strtold(3) with INF (PR lib/33262)");
+}
+
+ATF_TC_BODY(strtold_inf, tc)
+{
+#ifndef __vax__
+# ifdef __HAVE_LONG_DOUBLE
+
+ for (size_t i = 0; i < __arraycount(inf_strings); i++) {
+ volatile long double ld = strtold(inf_strings[i], NULL);
+ ATF_REQUIRE(isinf(ld) != 0);
+ }
+# else
+ atf_tc_skip("Requires long double support");
+# endif
+#else
+ atf_tc_skip("vax not supported");
+#endif
+}
+
+ATF_TC(strtod_nan);
+ATF_TC_HEAD(strtod_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A strtod(3) with NaN");
+}
+
+ATF_TC_BODY(strtod_nan, tc)
+{
+#ifndef __vax__
+ char *end;
+
+ volatile double d = strtod(nan_string, &end);
+ ATF_REQUIRE(isnan(d) != 0);
+ ATF_REQUIRE(strcmp(end, "y") == 0);
+#else
+ atf_tc_skip("vax not supported");
+#endif
+}
+
+ATF_TC(strtof_nan);
+ATF_TC_HEAD(strtof_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A strtof(3) with NaN");
+}
+
+ATF_TC_BODY(strtof_nan, tc)
+{
+#ifndef __vax__
+ char *end;
+
+ volatile float f = strtof(nan_string, &end);
+ ATF_REQUIRE(isnanf(f) != 0);
+ ATF_REQUIRE(strcmp(end, "y") == 0);
+#else
+ atf_tc_skip("vax not supported");
+#endif
+}
+
+ATF_TC(strtold_nan);
+ATF_TC_HEAD(strtold_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A strtold(3) with NaN (PR lib/45020)");
+}
+
+ATF_TC_BODY(strtold_nan, tc)
+{
+#ifndef __vax__
+# ifdef __HAVE_LONG_DOUBLE
+
+ char *end;
+
+ volatile long double ld = strtold(nan_string, &end);
+ ATF_REQUIRE(isnan(ld) != 0);
+ ATF_REQUIRE(__isnanl(ld) != 0);
+ ATF_REQUIRE(strcmp(end, "y") == 0);
+# else
+ atf_tc_skip("Requires long double support");
+# endif
+#else
+ atf_tc_skip("vax not supported");
+#endif
+}
+
+ATF_TC(strtod_round);
+ATF_TC_HEAD(strtod_round, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test rouding in strtod(3)");
+}
+
+ATF_TC_BODY(strtod_round, tc)
+{
+#if defined(__i386__) || defined(__amd64__) || defined(__sparc__)
+
+ /*
+ * Test that strtod(3) honors the current rounding mode.
+ * The used value is somewhere near 1 + DBL_EPSILON + FLT_EPSILON.
+ */
+ const char *val =
+ "1.00000011920928977282585492503130808472633361816406";
+
+ (void)fesetround(FE_UPWARD);
+
+ volatile double d1 = strtod(val, NULL);
+
+ (void)fesetround(FE_DOWNWARD);
+
+ volatile double d2 = strtod(val, NULL);
+
+ if (fabs(d1 - d2) > 0.0)
+ return;
+ else {
+ atf_tc_expect_fail("PR misc/44767");
+ atf_tc_fail("strtod(3) did not honor fesetround(3)");
+ }
+#else
+ atf_tc_skip("Requires one of i386, amd64 or sparc");
+#endif
+}
+
+ATF_TC(strtod_underflow);
+ATF_TC_HEAD(strtod_underflow, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test underflow in strtod(3)");
+}
+
+ATF_TC_BODY(strtod_underflow, tc)
+{
+
+ const char *tmp =
+ "0.0000000000000000000000000000000000000000000000000000"
+ "000000000000000000000000000000000000000000000000000000"
+ "000000000000000000000000000000000000000000000000000000"
+ "000000000000000000000000000000000000000000000000000000"
+ "000000000000000000000000000000000000000000000000000000"
+ "000000000000000000000000000000000000000000000000000000"
+ "000000000000000000000000000000000000000000000000000000"
+ "000000000000000002";
+
+ errno = 0;
+ volatile double d = strtod(tmp, NULL);
+
+ if (d != 0 || errno != ERANGE)
+ atf_tc_fail("strtod(3) did not detect underflow");
+}
+
+/*
+ * Bug found by Geza Herman.
+ * See
+ * http://www.exploringbinary.com/a-bug-in-the-bigcomp-function-of-david-gays-strtod/
+ */
+ATF_TC(strtod_gherman_bug);
+ATF_TC_HEAD(strtod_gherman_bug, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test a bug found by Geza Herman");
+}
+
+ATF_TC_BODY(strtod_gherman_bug, tc)
+{
+
+ const char *str =
+ "1.8254370818746402660437411213933955878019332885742187";
+
+ errno = 0;
+ volatile double d = strtod(str, NULL);
+
+ ATF_CHECK(d == 0x1.d34fd8378ea83p+0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strtod_basic);
+ ATF_TP_ADD_TC(tp, strtod_hex);
+ ATF_TP_ADD_TC(tp, strtod_inf);
+ ATF_TP_ADD_TC(tp, strtof_inf);
+ ATF_TP_ADD_TC(tp, strtold_inf);
+ ATF_TP_ADD_TC(tp, strtod_nan);
+ ATF_TP_ADD_TC(tp, strtof_nan);
+ ATF_TP_ADD_TC(tp, strtold_nan);
+ ATF_TP_ADD_TC(tp, strtod_round);
+ ATF_TP_ADD_TC(tp, strtod_underflow);
+ ATF_TP_ADD_TC(tp, strtod_gherman_bug);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c b/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c
new file mode 100644
index 0000000..5a0c6d0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c
@@ -0,0 +1,234 @@
+/* $NetBSD: t_strtol.c,v 1.5 2011/06/14 02:45:58 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_strtol.c,v 1.5 2011/06/14 02:45:58 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+
+struct test {
+ const char *str;
+ int64_t res;
+ int base;
+ const char *end;
+};
+
+static void check(struct test *, long int, long long int, char *);
+
+static void
+check(struct test *t, long int li, long long int lli, char *end)
+{
+
+ if (li != -1 && li != t->res)
+ atf_tc_fail_nonfatal("strtol(%s, &end, %d) failed "
+ "(rv = %ld)", t->str, t->base, li);
+
+ if (lli != -1 && lli != t->res)
+ atf_tc_fail_nonfatal("strtoll(%s, NULL, %d) failed "
+ "(rv = %lld)", t->str, t->base, lli);
+
+ if (t->end != NULL && strcmp(t->end, end) != 0)
+ atf_tc_fail_nonfatal("invalid end pointer ('%s') from "
+ "strtol(%s, &end, %d)", end, t->str, t->base);
+}
+
+ATF_TC(strtol_base);
+ATF_TC_HEAD(strtol_base, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strtol(3) with different bases");
+}
+
+ATF_TC_BODY(strtol_base, tc)
+{
+ struct test t[] = {
+ { "123456789", 123456789, 0, NULL },
+ { "111010110111100110100010101", 123456789, 2, NULL },
+ { "22121022020212200", 123456789, 3, NULL },
+ { "13112330310111", 123456789, 4, NULL },
+ { "223101104124", 123456789, 5, NULL },
+ { "20130035113", 123456789, 6, NULL },
+ { "3026236221", 123456789, 7, NULL },
+ { "726746425", 123456789, 8, NULL },
+ { "277266780", 123456789, 9, NULL },
+ { "123456789", 123456789, 10, NULL },
+ { "63762A05", 123456789, 11, NULL },
+ { "35418A99", 123456789, 12, NULL },
+ { "1C767471", 123456789, 13, NULL },
+ { "12579781", 123456789, 14, NULL },
+ { "AC89BC9", 123456789, 15, NULL },
+ { "75BCD15", 123456789, 16, NULL },
+ { "123456789", 342391, 8, NULL },
+ { "0123456789", 342391, 0, NULL },
+ { "0123456789", 123456789, 10, NULL },
+ { "0x75bcd15", 123456789, 0, NULL },
+ };
+
+ long long int lli;
+ long int li;
+ char *end;
+ size_t i;
+
+ for (i = 0; i < __arraycount(t); i++) {
+
+ li = strtol(t[i].str, &end, t[i].base);
+ lli = strtoll(t[i].str, NULL, t[i].base);
+
+ check(&t[i], li, lli, end);
+ }
+}
+
+ATF_TC(strtol_case);
+ATF_TC_HEAD(strtol_case, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Case insensitivity with strtol(3)");
+}
+
+ATF_TC_BODY(strtol_case, tc)
+{
+ struct test t[] = {
+ { "abcd", 0xabcd, 16, NULL },
+ { " dcba", 0xdcba, 16, NULL },
+ { "abcd dcba", 0xabcd, 16, " dcba" },
+ { "abc0x123", 0xabc0, 16, NULL },
+ { "abcd\0x123", 0xabcd, 16, "\0x123" },
+ { "ABCD", 0xabcd, 16, NULL },
+ { "aBcD", 0xabcd, 16, NULL },
+ { "0xABCD", 0xabcd, 16, NULL },
+ { "0xABCDX", 0xabcd, 16, "X" },
+ };
+
+ long long int lli;
+ long int li;
+ char *end;
+ size_t i;
+
+ for (i = 0; i < __arraycount(t); i++) {
+
+ li = strtol(t[i].str, &end, t[i].base);
+ lli = strtoll(t[i].str, NULL, t[i].base);
+
+ check(&t[i], li, lli, end);
+ }
+}
+
+ATF_TC(strtol_range);
+ATF_TC_HEAD(strtol_range, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ERANGE from strtol(3)");
+}
+
+ATF_TC_BODY(strtol_range, tc)
+{
+
+#if LONG_MAX == 0x7fffffff /* XXX: Is this portable? */
+
+ struct test t[] = {
+ { "20000000000", 2147483647, 8, NULL },
+ { "2147483648", 2147483647, 10, NULL },
+ { "80000000", 2147483647, 16, NULL },
+ };
+#else
+ struct test t[] = {
+ { "1000000000000000000000", 9223372036854775807, 8, NULL },
+ { "9223372036854775808", 9223372036854775807, 10, NULL },
+ { "8000000000000000", 9223372036854775807, 16, NULL },
+ };
+#endif
+
+ long int li;
+ char *end;
+ size_t i;
+
+ for (i = 0; i < __arraycount(t); i++) {
+
+ errno = 0;
+ li = strtol(t[i].str, &end, t[i].base);
+
+ if (errno != ERANGE)
+ atf_tc_fail("strtol(3) did not catch ERANGE");
+
+ check(&t[i], li, -1, end);
+ }
+}
+
+ATF_TC(strtol_signed);
+ATF_TC_HEAD(strtol_signed, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of strtol(3)");
+}
+
+ATF_TC_BODY(strtol_signed, tc)
+{
+ struct test t[] = {
+ { "1", 1, 0, NULL },
+ { " 2", 2, 0, NULL },
+ { " 3", 3, 0, NULL },
+ { " -3", -3, 0, NULL },
+ { "--1", 0, 0, "--1" },
+ { "+-2", 0, 0, "+-2" },
+ { "++3", 0, 0, "++3" },
+ { "+9", 9, 0, NULL },
+ { "+123", 123, 0, NULL },
+ { "-1 3", -1, 0, " 3" },
+ { "-1.3", -1, 0, ".3" },
+ { "- 3", 0, 0, "- 3" },
+ { "+33.", 33, 0, "." },
+ { "30x0", 30, 0, "x0" },
+ };
+
+ long long int lli;
+ long int li;
+ char *end;
+ size_t i;
+
+ for (i = 0; i < __arraycount(t); i++) {
+
+ li = strtol(t[i].str, &end, t[i].base);
+ lli = strtoll(t[i].str, NULL, t[i].base);
+
+ check(&t[i], li, lli, end);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strtol_base);
+ ATF_TP_ADD_TC(tp, strtol_case);
+ ATF_TP_ADD_TC(tp, strtol_range);
+ ATF_TP_ADD_TC(tp, strtol_signed);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_system.c b/contrib/netbsd-tests/lib/libc/stdlib/t_system.c
new file mode 100644
index 0000000..235005b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_system.c
@@ -0,0 +1,83 @@
+/* $NetBSD: t_system.c,v 1.1 2011/09/11 10:32:23 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_system.c,v 1.1 2011/09/11 10:32:23 jruoho Exp $");
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char *path = "system";
+
+ATF_TC_WITH_CLEANUP(system_basic);
+ATF_TC_HEAD(system_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of system(3)");
+}
+
+ATF_TC_BODY(system_basic, tc)
+{
+ char buf[23];
+ int fd, i = 2;
+
+ ATF_REQUIRE(system("/bin/echo -n > system") == 0);
+
+ while (i >= 0) {
+ ATF_REQUIRE(system("/bin/echo -n garbage >> system") == 0);
+ i--;
+ }
+
+ fd = open(path, O_RDONLY);
+ ATF_REQUIRE(fd >= 0);
+
+ (void)memset(buf, '\0', sizeof(buf));
+
+ ATF_REQUIRE(read(fd, buf, 21) == 21);
+ ATF_REQUIRE(strcmp(buf, "garbagegarbagegarbage") == 0);
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(system_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, system_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_bm.c b/contrib/netbsd-tests/lib/libc/string/t_bm.c
new file mode 100644
index 0000000..5ec4022
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_bm.c
@@ -0,0 +1,102 @@
+/* $Id: t_bm.c,v 1.1 2014/06/23 10:53:20 shm Exp $ */
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Mateusz Kocielski.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$Id: t_bm.c,v 1.1 2014/06/23 10:53:20 shm Exp $");
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <bm.h>
+#include <string.h>
+#include <stdlib.h>
+
+ATF_TC(bm);
+ATF_TC_HEAD(bm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test bm(3)");
+}
+
+typedef struct {
+ const char *pattern;
+ const char *text;
+ const char *freq;
+ ssize_t match;
+} t_testcase;
+
+const t_testcase testcases[] = {
+ {"test", "test", NULL, 0},
+ {"test", "ttest", NULL, 1},
+ {"test", "tes", NULL, -1},
+ {"test", "testtesttest", NULL, 0},
+ {"test", "testtesttesttesttesttest", NULL, 0},
+ {"test", "------------------------", NULL, -1},
+ {"a", "a", NULL, 0},
+ {"a", "ba", NULL, 1},
+ {"a", "bba", NULL, 2},
+ {"bla", "bl", NULL, -1},
+ {"a", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", NULL, -1},
+ {"test", "qfwiofjqeiwofjioqewfjeiqwjfiqewjfioqewfjioewqjfioewqjfioewqjoi",
+ NULL, -1},
+ {"needle", "haystack", NULL, -1},
+ {"netbsd", "freebsd netbsd openbsd", NULL, 8},
+};
+
+ATF_TC_BODY(bm, tc)
+{
+ size_t ts;
+ u_char *off;
+ char *text;
+ bm_pat *pattern;
+
+ for (ts = 0; ts < sizeof(testcases)/sizeof(t_testcase); ts++) {
+ ATF_CHECK(pattern = bm_comp((const u_char *)testcases[ts].pattern,
+ strlen(testcases[ts].pattern), (const u_char *)testcases[ts].freq));
+
+ ATF_REQUIRE(text = strdup(testcases[ts].text));
+ off = bm_exec(pattern, (u_char *)text, strlen(text));
+
+ if (testcases[ts].match == -1)
+ ATF_CHECK_EQ(off, NULL);
+ else
+ ATF_CHECK_EQ(testcases[ts].match,
+ (off-(u_char *)text));
+
+ bm_free(pattern);
+ free(text);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, bm);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_memchr.c b/contrib/netbsd-tests/lib/libc/string/t_memchr.c
new file mode 100644
index 0000000..296f1f8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_memchr.c
@@ -0,0 +1,194 @@
+/* $NetBSD: t_memchr.c,v 1.3 2012/04/06 07:53:10 jruoho Exp $ */
+
+/*
+ * Written by J.T. Conklin <jtc@acorntoolworks.com>
+ * Public domain.
+ */
+
+#include <atf-c.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+ATF_TC(memchr_basic);
+ATF_TC_HEAD(memchr_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memchr(3) results, #1");
+}
+
+ATF_TC_BODY(memchr_basic, tc)
+{
+ /* try to trick the compiler */
+ void * (*f)(const void *, int, size_t) = memchr;
+
+ unsigned int a, t;
+ void *off, *off2;
+ char buf[32];
+
+ struct tab {
+ const char *val;
+ size_t len;
+ char match;
+ ssize_t off;
+ };
+
+ const struct tab tab[] = {
+ { "", 0, 0, 0 },
+
+ { "/", 0, 0, 0 },
+ { "/", 1, 1, 0 },
+ { "/a", 2, 1, 0 },
+ { "/ab", 3, 1, 0 },
+ { "/abc", 4, 1, 0 },
+ { "/abcd", 5, 1, 0 },
+ { "/abcde", 6, 1, 0 },
+ { "/abcdef", 7, 1, 0 },
+ { "/abcdefg", 8, 1, 0 },
+
+ { "a/", 1, 0, 0 },
+ { "a/", 2, 1, 1 },
+ { "a/b", 3, 1, 1 },
+ { "a/bc", 4, 1, 1 },
+ { "a/bcd", 5, 1, 1 },
+ { "a/bcde", 6, 1, 1 },
+ { "a/bcdef", 7, 1, 1 },
+ { "a/bcdefg", 8, 1, 1 },
+
+ { "ab/", 2, 0, 0 },
+ { "ab/", 3, 1, 2 },
+ { "ab/c", 4, 1, 2 },
+ { "ab/cd", 5, 1, 2 },
+ { "ab/cde", 6, 1, 2 },
+ { "ab/cdef", 7, 1, 2 },
+ { "ab/cdefg", 8, 1, 2 },
+
+ { "abc/", 3, 0, 0 },
+ { "abc/", 4, 1, 3 },
+ { "abc/d", 5, 1, 3 },
+ { "abc/de", 6, 1, 3 },
+ { "abc/def", 7, 1, 3 },
+ { "abc/defg", 8, 1, 3 },
+
+ { "abcd/", 4, 0, 0 },
+ { "abcd/", 5, 1, 4 },
+ { "abcd/e", 6, 1, 4 },
+ { "abcd/ef", 7, 1, 4 },
+ { "abcd/efg", 8, 1, 4 },
+
+ { "abcde/", 5, 0, 0 },
+ { "abcde/", 6, 1, 5 },
+ { "abcde/f", 7, 1, 5 },
+ { "abcde/fg", 8, 1, 5 },
+
+ { "abcdef/", 6, 0, 0 },
+ { "abcdef/", 7, 1, 6 },
+ { "abcdef/g", 8, 1, 6 },
+
+ { "abcdefg/", 7, 0, 0 },
+ { "abcdefg/", 8, 1, 7 },
+
+ { "\xff\xff\xff\xff" "efg/", 8, 1, 7 },
+ { "a" "\xff\xff\xff\xff" "fg/", 8, 1, 7 },
+ { "ab" "\xff\xff\xff\xff" "g/", 8, 1, 7 },
+ { "abc" "\xff\xff\xff\xff" "/", 8, 1, 7 },
+ };
+
+ for (a = 1; a < 1 + sizeof(long); ++a) {
+ for (t = 0; t < (sizeof(tab) / sizeof(tab[0])); ++t) {
+ buf[a-1] = '/';
+ strcpy(&buf[a], tab[t].val);
+
+ off = f(&buf[a], '/', tab[t].len);
+ if (tab[t].match == 0) {
+ if (off != 0) {
+ fprintf(stderr, "a = %d, t = %d\n",
+ a, t);
+ atf_tc_fail("should not have found "
+ " char past len");
+ }
+ } else if (tab[t].match == 1) {
+ if (tab[t].off != ((char*)off - &buf[a])) {
+ fprintf(stderr, "a = %d, t = %d\n",
+ a, t);
+ atf_tc_fail("char not found at "
+ "correct offset");
+ }
+ } else {
+ fprintf(stderr, "a = %d, t = %d\n", a, t);
+ atf_tc_fail("Corrupt test case data");
+ }
+
+ /* check zero extension of char arg */
+ off2 = f(&buf[a], 0xffffff00 | '/', tab[t].len);
+ if (off2 != off)
+ atf_tc_fail("zero extension of char arg "
+ "failed");
+ }
+ }
+}
+
+ATF_TC(memchr_simple);
+ATF_TC_HEAD(memchr_simple, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memchr(3) results, #2");
+}
+
+ATF_TC_BODY(memchr_simple, tc)
+{
+ char buf[] = "abcdefg";
+ short i = 7;
+
+ ATF_CHECK(memchr(buf, 'a', 0) == NULL);
+ ATF_CHECK(memchr(buf, 'g', 0) == NULL);
+ ATF_CHECK(memchr(buf, 'x', 7) == NULL);
+
+ ATF_CHECK(memchr("\0", 'x', 0) == NULL);
+ ATF_CHECK(memchr("\0", 'x', 1) == NULL);
+
+ while (i <= 14) {
+
+ ATF_CHECK(memchr(buf, 'a', i) == buf + 0);
+ ATF_CHECK(memchr(buf, 'b', i) == buf + 1);
+ ATF_CHECK(memchr(buf, 'c', i) == buf + 2);
+ ATF_CHECK(memchr(buf, 'd', i) == buf + 3);
+ ATF_CHECK(memchr(buf, 'e', i) == buf + 4);
+ ATF_CHECK(memchr(buf, 'f', i) == buf + 5);
+ ATF_CHECK(memchr(buf, 'g', i) == buf + 6);
+
+ i *= 2;
+ }
+}
+
+ATF_TC(memrchr_simple);
+ATF_TC_HEAD(memrchr_simple, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memrchr(3) results");
+}
+
+ATF_TC_BODY(memrchr_simple, tc)
+{
+ char buf[] = "abcdabcd";
+
+ ATF_CHECK(memrchr(buf, 'a', 0) == NULL);
+ ATF_CHECK(memrchr(buf, 'g', 0) == NULL);
+ ATF_CHECK(memrchr(buf, 'x', 8) == NULL);
+
+ ATF_CHECK(memrchr("\0", 'x', 0) == NULL);
+ ATF_CHECK(memrchr("\0", 'x', 1) == NULL);
+
+ ATF_CHECK(memrchr(buf, 'a', 8) == buf + 4);
+ ATF_CHECK(memrchr(buf, 'b', 8) == buf + 5);
+ ATF_CHECK(memrchr(buf, 'c', 8) == buf + 6);
+ ATF_CHECK(memrchr(buf, 'd', 8) == buf + 7);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, memchr_basic);
+ ATF_TP_ADD_TC(tp, memchr_simple);
+ ATF_TP_ADD_TC(tp, memrchr_simple);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_memcpy.c b/contrib/netbsd-tests/lib/libc/string/t_memcpy.c
new file mode 100644
index 0000000..6485a88
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_memcpy.c
@@ -0,0 +1,150 @@
+/* $NetBSD: t_memcpy.c,v 1.5 2013/03/17 02:23:31 christos Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <md5.h>
+
+#include <sys/types.h>
+
+#define ALIGNMENTS 16
+#define LENGTHS 4
+#define BLOCKTYPES 4
+
+MD5_CTX mc[1];
+
+typedef unsigned char testBlock_t[ALIGNMENTS * LENGTHS];
+
+testBlock_t bss1, bss2;
+
+unsigned char *start[BLOCKTYPES] = {
+ bss1, bss2
+};
+
+char result[100];
+const char goodResult[] = "7b405d24bc03195474c70ddae9e1f8fb";
+
+static void
+runTest(unsigned char *b1, unsigned char *b2)
+{
+ int i, j, k, m;
+ size_t n;
+
+ for (i = 0; i < ALIGNMENTS; ++i) {
+ for (j = 0; j < ALIGNMENTS; ++j) {
+ k = sizeof(testBlock_t) - (i > j ? i : j);
+ for (m = 0; m < k; ++m) {
+ for (n = 0; n < sizeof(testBlock_t); ++n) {
+ b1[n] = (unsigned char)random();
+ b2[n] = (unsigned char)random();
+ }
+ memcpy(b1 + i, b2 + j, m);
+ MD5Update(mc, b1, sizeof(testBlock_t));
+ MD5Update(mc, b2, sizeof(testBlock_t));
+ }
+ }
+ }
+}
+
+ATF_TC(memcpy_basic);
+ATF_TC_HEAD(memcpy_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memcpy results");
+}
+
+ATF_TC_BODY(memcpy_basic, tc)
+{
+ int i, j;
+ testBlock_t auto1, auto2;
+
+ start[2] = auto1;
+ start[3] = auto2;
+
+ srandom(0L);
+ MD5Init(mc);
+ for (i = 0; i < BLOCKTYPES; ++i)
+ for (j = 0; j < BLOCKTYPES; ++j)
+ if (i != j)
+ runTest(start[i], start[j]);
+ MD5End(mc, result);
+ ATF_REQUIRE_EQ(strcmp(result, goodResult), 0);
+}
+
+ATF_TC(memccpy_simple);
+ATF_TC_HEAD(memccpy_simple, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memccpy(3) results");
+}
+
+ATF_TC_BODY(memccpy_simple, tc)
+{
+ char buf[100];
+ char c = ' ';
+
+ (void)memset(buf, c, sizeof(buf));
+
+ ATF_CHECK(memccpy(buf, "foo bar", c, sizeof(buf)) != NULL);
+ ATF_CHECK(buf[4] == c);
+
+ ATF_CHECK(memccpy(buf, "foo bar", '\0', sizeof(buf) - 1) != NULL);
+ ATF_CHECK(buf[8] == c);
+
+ ATF_CHECK(memccpy(buf, "foo bar", 'x', 7) == NULL);
+ ATF_CHECK(strncmp(buf, "foo bar", 7) == 0);
+
+ ATF_CHECK(memccpy(buf, "xxxxxxx", 'r', 7) == NULL);
+ ATF_CHECK(strncmp(buf, "xxxxxxx", 7) == 0);
+}
+
+ATF_TC(memcpy_return);
+ATF_TC_HEAD(memcpy_return, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memcpy(3) return value");
+}
+
+ATF_TC_BODY(memcpy_return, tc)
+{
+ char *b = (char *)0x1;
+ char c[2];
+ ATF_REQUIRE_EQ(memcpy(b, b, 0), b);
+ ATF_REQUIRE_EQ(memcpy(c, "ab", sizeof(c)), c);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, memcpy_basic);
+ ATF_TP_ADD_TC(tp, memcpy_return);
+ ATF_TP_ADD_TC(tp, memccpy_simple);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_memmem.c b/contrib/netbsd-tests/lib/libc/string/t_memmem.c
new file mode 100644
index 0000000..1e87af8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_memmem.c
@@ -0,0 +1,100 @@
+/* $NetBSD: t_memmem.c,v 1.2 2011/07/07 08:27:36 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2005 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Perry E. Metzger of Metzger, Dowdeswell & Co. LLC.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+char p0[] = "";
+int lp0 = 0;
+char p1[] = "0123";
+int lp1 = 4;
+char p2[] = "456";
+int lp2 = 3;
+char p3[] = "789";
+int lp3 = 3;
+char p4[] = "abc";
+int lp4 = 3;
+char p5[] = "0";
+int lp5 = 1;
+char p6[] = "9";
+int lp6 = 1;
+char p7[] = "654";
+int lp7 = 3;
+
+char b0[] = "";
+int lb0 = 0;
+char b1[] = "0";
+int lb1 = 1;
+char b2[] = "0123456789";
+int lb2 = 10;
+
+#define expect(b) \
+ if (!(b)) { \
+ fprintf(stderr, "failed on line %d\n", __LINE__); \
+ atf_tc_fail("Check stderr for test id/line"); \
+ }
+
+ATF_TC(memmem_basic);
+ATF_TC_HEAD(memmem_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test memmem results");
+}
+
+ATF_TC_BODY(memmem_basic, tc)
+{
+
+ expect(memmem(b2, lb2, p0, lp0) == b2);
+ expect(memmem(b0, lb0, p0, lp0) == b0);
+ expect(memmem(b0, lb0, p1, lp1) == NULL);
+ expect(memmem(b1, lb1, p1, lp1) == NULL);
+
+ expect(memmem(b2, lb2, p1, lp1) == b2);
+ expect(memmem(b2, lb2, p2, lp2) == (b2 + 4));
+ expect(memmem(b2, lb2, p3, lp3) == (b2 + 7));
+
+ expect(memmem(b2, lb2, p5, lp5) == b2);
+ expect(memmem(b2, lb2, p6, lp6) == (b2 + 9));
+
+ expect(memmem(b2, lb2, p4, lp4) == NULL);
+ expect(memmem(b2, lb2, p7, lp7) == NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, memmem_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_memset.c b/contrib/netbsd-tests/lib/libc/string/t_memset.c
new file mode 100644
index 0000000..c1fb385
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_memset.c
@@ -0,0 +1,207 @@
+/* $NetBSD: t_memset.c,v 1.3 2013/03/17 02:23:31 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_memset.c,v 1.3 2013/03/17 02:23:31 christos Exp $");
+
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static long page = 0;
+static void fill(char *, size_t, char);
+static bool check(char *, size_t, char);
+
+ATF_TC(memset_array);
+ATF_TC_HEAD(memset_array, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memset(3) with arrays");
+}
+
+ATF_TC_BODY(memset_array, tc)
+{
+ char buf[1024];
+
+ (void)memset(buf, 0, sizeof(buf));
+
+ if (check(buf, sizeof(buf), 0) != true)
+ atf_tc_fail("memset(3) did not fill a static buffer");
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ if (check(buf, sizeof(buf), 'x') != true)
+ atf_tc_fail("memset(3) did not fill a static buffer");
+}
+
+ATF_TC(memset_return);
+ATF_TC_HEAD(memset_return, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memset(3) return value");
+}
+
+ATF_TC_BODY(memset_return, tc)
+{
+ char *b = (char *)0x1;
+ char c[2];
+ ATF_REQUIRE_EQ(memset(b, 0, 0), b);
+ ATF_REQUIRE_EQ(memset(c, 2, sizeof(c)), c);
+}
+
+ATF_TC(memset_basic);
+ATF_TC_HEAD(memset_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of memset(3)");
+}
+
+ATF_TC_BODY(memset_basic, tc)
+{
+ char *buf, *ret;
+
+ buf = malloc(page);
+ ret = malloc(page);
+
+ ATF_REQUIRE(buf != NULL);
+ ATF_REQUIRE(ret != NULL);
+
+ fill(ret, page, 0);
+ memset(buf, 0, page);
+
+ ATF_REQUIRE(memcmp(ret, buf, page) == 0);
+
+ fill(ret, page, 'x');
+ memset(buf, 'x', page);
+
+ ATF_REQUIRE(memcmp(ret, buf, page) == 0);
+
+ free(buf);
+ free(ret);
+}
+
+ATF_TC(memset_nonzero);
+ATF_TC_HEAD(memset_nonzero, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memset(3) with non-zero params");
+}
+
+ATF_TC_BODY(memset_nonzero, tc)
+{
+ const size_t n = 0x7f;
+ char *buf;
+ size_t i;
+
+ buf = malloc(page);
+ ATF_REQUIRE(buf != NULL);
+
+ for (i = 0x21; i < n; i++) {
+
+ (void)memset(buf, i, page);
+
+ if (check(buf, page, i) != true)
+ atf_tc_fail("memset(3) did not fill properly");
+ }
+
+ free(buf);
+}
+
+ATF_TC(memset_struct);
+ATF_TC_HEAD(memset_struct, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test memset(3) with a structure");
+}
+
+ATF_TC_BODY(memset_struct, tc)
+{
+ struct stat st;
+
+ st.st_dev = 0;
+ st.st_ino = 1;
+ st.st_mode = 2;
+ st.st_nlink = 3;
+ st.st_uid = 4;
+ st.st_gid = 5;
+ st.st_rdev = 6;
+ st.st_size = 7;
+ st.st_atime = 8;
+ st.st_mtime = 9;
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ ATF_CHECK(st.st_dev == 0);
+ ATF_CHECK(st.st_ino == 0);
+ ATF_CHECK(st.st_mode == 0);
+ ATF_CHECK(st.st_nlink == 0);
+ ATF_CHECK(st.st_uid == 0);
+ ATF_CHECK(st.st_gid == 0);
+ ATF_CHECK(st.st_rdev == 0);
+ ATF_CHECK(st.st_size == 0);
+ ATF_CHECK(st.st_atime == 0);
+ ATF_CHECK(st.st_mtime == 0);
+}
+
+static void
+fill(char *buf, size_t len, char x)
+{
+ size_t i;
+
+ for (i = 0; i < len; i++)
+ buf[i] = x;
+}
+
+static bool
+check(char *buf, size_t len, char x)
+{
+ size_t i;
+
+ for (i = 0; i < len; i++) {
+
+ if (buf[i] != x)
+ return false;
+ }
+
+ return true;
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ page = sysconf(_SC_PAGESIZE);
+ ATF_REQUIRE(page >= 0);
+
+ ATF_TP_ADD_TC(tp, memset_array);
+ ATF_TP_ADD_TC(tp, memset_basic);
+ ATF_TP_ADD_TC(tp, memset_nonzero);
+ ATF_TP_ADD_TC(tp, memset_struct);
+ ATF_TP_ADD_TC(tp, memset_return);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_popcount.c b/contrib/netbsd-tests/lib/libc/string/t_popcount.c
new file mode 100644
index 0000000..2bae52f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_popcount.c
@@ -0,0 +1,198 @@
+/* $NetBSD: t_popcount.c,v 1.4 2011/07/07 08:27:36 jruoho Exp $ */
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_popcount.c,v 1.4 2011/07/07 08:27:36 jruoho Exp $");
+
+#include <atf-c.h>
+#include <strings.h>
+
+static unsigned int byte_count[256];
+
+static void
+popcount_init(const char *cfg_var)
+{
+ unsigned int i, j;
+
+ if (strcasecmp(cfg_var, "YES") == 0 ||
+ strcasecmp(cfg_var, "Y") == 0 ||
+ strcasecmp(cfg_var, "1") == 0 ||
+ strcasecmp(cfg_var, "T") == 0 ||
+ strcasecmp(cfg_var, "TRUE") == 0) {
+ for (i = 0; i < 256; ++i) {
+ byte_count[i] = 0;
+ for (j = i; j != 0; j >>= 1) {
+ if (j & 1)
+ ++byte_count[i];
+ }
+ }
+ return;
+ }
+
+ atf_tc_skip("config variable \"run_popcount\" not set to YES/TRUE");
+}
+
+unsigned int test_parts[256] = {
+ 0x318e53e6U, 0x11710316U, 0x62608ffaU, 0x67e0f562U,
+ 0xe432e82cU, 0x9862e8b2U, 0x7d96a627U, 0x3f74ad31U,
+ 0x3cecf906U, 0xcdc0dcb4U, 0x241dab64U, 0x31e6133eU,
+ 0x23086ad4U, 0x721d5a91U, 0xc483da53U, 0x6a62af52U,
+ 0xf3f5c386U, 0xe0de3f77U, 0x65afe528U, 0xf4816485U,
+ 0x40ccbf08U, 0x25df49c1U, 0xae5a6ee0U, 0xab36ccadU,
+ 0x87e1ec29U, 0x60ca2407U, 0x49d62e47U, 0xa09f2df5U,
+ 0xaf4c1c68U, 0x8ef08d50U, 0x624cfd2fU, 0xa6a36f20U,
+ 0x68aaf879U, 0x0fe9deabU, 0x5c9a4060U, 0x215d8f08U,
+ 0x55e84712U, 0xea1f1681U, 0x3a10b8a1U, 0x08e06632U,
+ 0xcbc875e2U, 0x31e53258U, 0xcd3807a4U, 0xb9d17516U,
+ 0x8fbfd9abU, 0x6651b555U, 0x550fb381U, 0x05061b9dU,
+ 0x35aef3f2U, 0x9175078cU, 0xae0f14daU, 0x92a2d5f8U,
+ 0x70d968feU, 0xe86f41c5U, 0x5cfaf39fU, 0x8499b18dU,
+ 0xb33f879aU, 0x0a68ad3dU, 0x9323ecc1U, 0x060037ddU,
+ 0xb91a5051U, 0xa0dbebf6U, 0x3e6aa6f1U, 0x7b422b5bU,
+ 0x599e811eU, 0x199f7594U, 0xca453365U, 0x1cda6f48U,
+ 0xe9c75d2cU, 0x6a873217U, 0x79c45d72U, 0x143b8e37U,
+ 0xa11df26eU, 0xaf31f80aU, 0x311bf759U, 0x2378563cU,
+ 0x9ab95fa5U, 0xfcf4d47cU, 0x1f7db268U, 0xd64b09e1U,
+ 0xad7936daU, 0x7a59005cU, 0x45b173d3U, 0xc1a71b32U,
+ 0x7d9f0de2U, 0xa9ac3792U, 0x9e7f9966U, 0x7f0b8080U,
+ 0xece6c06fU, 0x78d92a3cU, 0x6d5f8f6cU, 0xc50ca544U,
+ 0x5d8ded27U, 0xd27a8462U, 0x4bcd13ccU, 0xd49075f2U,
+ 0xa8d52acfU, 0x41915d97U, 0x564f7062U, 0xefb046e2U,
+ 0xe296277aU, 0x605b0ea3U, 0x10b2c3a1U, 0x4e8e5c66U,
+ 0x4bd8ec04U, 0x29935be9U, 0x381839f3U, 0x555d8824U,
+ 0xd6befddbU, 0x5d8d6d6eU, 0xb2fdb7b4U, 0xb471c8fcU,
+ 0xc2fd325bU, 0x932d2487U, 0xbdbbadefU, 0x66c8895dU,
+ 0x5d77857aU, 0x259f1cc0U, 0x302037faU, 0xda9aa7a8U,
+ 0xb112c6aaU, 0x78f74192U, 0xfd4da741U, 0xfa5765c1U,
+ 0x6ea1bc5cU, 0xd283f39cU, 0x268ae67dU, 0xdedcd134U,
+ 0xbbf92410U, 0x6b45fb55U, 0x2f75ac71U, 0x64bf2ca5U,
+ 0x8b99675aU, 0x3f4923b6U, 0x7e610550U, 0x04b1c06dU,
+ 0x8f92e7c6U, 0x45cb608bU, 0x2d06d1f2U, 0x79cf387aU,
+ 0xfd3ed225U, 0x243eee20U, 0x2cbefc6fU, 0x8286cbaaU,
+ 0x70d4c182U, 0x054e3cc6U, 0xb66c5362U, 0x0c73fa5dU,
+ 0x539948feU, 0xec638563U, 0x0cf04ab6U, 0xec7b52f4U,
+ 0x58eeffceU, 0x6fe8049aU, 0xb3b33332U, 0x2e33bfdbU,
+ 0xcc817567U, 0x71ac57c8U, 0x4bab3ac7U, 0x327c558bU,
+ 0x82a6d279U, 0x5adf71daU, 0x1074a656U, 0x3c533c1fU,
+ 0x82fdbe69U, 0x21b4f6afU, 0xd59580e8U, 0x0de824ebU,
+ 0xa510941bU, 0x7cd91144U, 0xa8c10631U, 0x4c839267U,
+ 0x5d503c2fU, 0xe1567d55U, 0x23910cc7U, 0xdb1bdc34U,
+ 0x2a866704U, 0x33e21f0cU, 0x5c7681b4U, 0x818651caU,
+ 0xb1d18162U, 0x225ad014U, 0xadf7d6baU, 0xac548d9bU,
+ 0xe94736e5U, 0x2279c5f1U, 0x33215d2cU, 0xdc8ab90eU,
+ 0xf5e3d7f2U, 0xedcb15cfU, 0xc9a43c4cU, 0xfc678fc6U,
+ 0x43796b95U, 0x3f8b700cU, 0x867bbc72U, 0x81f71fecU,
+ 0xd00cad7dU, 0x302c458fU, 0x8ae21accU, 0x05850ce8U,
+ 0x7764d8e8U, 0x8a36cd68U, 0x40b44bd7U, 0x1cffaeb7U,
+ 0x2b248f34U, 0x1eefdbafU, 0x574d7437U, 0xe86cd935U,
+ 0xf53dd1c8U, 0x1b022513U, 0xef2d249bU, 0x94fb2b08U,
+ 0x15d3eff8U, 0x14245e1bU, 0x82aa8425U, 0x53959028U,
+ 0x9c5f9b80U, 0x325e0c82U, 0x3e236c24U, 0x74e1dd36U,
+ 0x9890df3fU, 0xaf9701a2U, 0x023b3413U, 0x7634c67eU,
+ 0x55cf5e45U, 0x56d2a95bU, 0xb6db869bU, 0xac19e260U,
+ 0xdd310740U, 0x26d68f84U, 0x45bebf17U, 0xe4a7728fU,
+ 0xf082e66eU, 0xb2fe3c10U, 0x2db1fa2cU, 0x4b3dfcfaU,
+ 0xc7b3a672U, 0xaeadc67bU, 0x6cce6f2bU, 0x8263dbbfU,
+ 0xd9724d5bU, 0xbcc767b5U, 0x8d563798U, 0x2db764b4U,
+ 0x76e0cee7U, 0xd34f9a67U, 0x035c810aU, 0x3f56bdc1U,
+ 0x5b3f2c84U, 0x0baca8c0U, 0xfe979a77U, 0x484ca775U,
+ 0xbdc7f104U, 0xc06c3efbU, 0xdbc5f32cU, 0x44b017e7U,
+};
+
+ATF_TC(popcount_basic);
+ATF_TC_HEAD(popcount_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test popcount results");
+ atf_tc_set_md_var(tc, "timeout", "0");
+}
+
+ATF_TC_BODY(popcount_basic, tc)
+{
+ unsigned int i, r;
+
+ popcount_init(atf_tc_get_config_var_wd(tc, "run_popcount", "NO"));
+
+ for (i = 0; i < 0xffffffff; ++i) {
+ r = byte_count[i & 255] + byte_count[(i >> 8) & 255]
+ + byte_count[(i >> 16) & 255]
+ + byte_count[(i >> 24) & 255];
+
+ ATF_CHECK_EQ(r, popcount(i));
+ }
+ ATF_CHECK_EQ(popcount(0xffffffff), 32);
+}
+
+ATF_TC(popcountll_basic);
+ATF_TC_HEAD(popcountll_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test popcountll results");
+ atf_tc_set_md_var(tc, "timeout", "0");
+}
+
+ATF_TC_BODY(popcountll_basic, tc)
+{
+ unsigned int i, j, r, r2, p;
+ unsigned long long v;
+
+ popcount_init(atf_tc_get_config_var_wd(tc, "run_popcount", "NO"));
+
+ for (j = 0; j < 256; ++j) {
+ p = test_parts[j];
+ r2 = byte_count[p & 255] + byte_count[(p >> 8) & 255]
+ + byte_count[(p >> 16) & 255]
+ + byte_count[(p >> 24) & 255];
+
+ for (i = 0; i < 0xffffffff; ++i) {
+ r = byte_count[i & 255] + byte_count[(i >> 8) & 255]
+ + byte_count[(i >> 16) & 255]
+ + byte_count[(i >> 24) & 255] + r2;
+
+ v = (((unsigned long long)i) << 32) + p;
+ ATF_CHECK_EQ(r, popcountll(v));
+ v = (((unsigned long long)p) << 32) + i;
+ ATF_CHECK_EQ(r, popcountll(v));
+ }
+ }
+
+ ATF_CHECK_EQ(popcountll(0xffffffffffffffffULL), 64);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, popcount_basic);
+ ATF_TP_ADD_TC(tp, popcountll_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strcat.c b/contrib/netbsd-tests/lib/libc/string/t_strcat.c
new file mode 100644
index 0000000..bd98691
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strcat.c
@@ -0,0 +1,153 @@
+/* $NetBSD: t_strcat.c,v 1.2 2011/07/14 05:46:04 jruoho Exp $ */
+
+/*
+ * Written by J.T. Conklin <jtc@acorntoolworks.com>
+ * Public domain.
+ */
+
+#include <atf-c.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+ATF_TC(strcat_basic);
+ATF_TC_HEAD(strcat_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strcat(3) results");
+}
+
+ATF_TC_BODY(strcat_basic, tc)
+{
+ /* try to trick the compiler */
+ char * (*f)(char *, const char *s) = strcat;
+
+ unsigned int a0, a1, t0, t1;
+ char buf0[64];
+ char buf1[64];
+ char *ret;
+
+ struct tab {
+ const char* val;
+ size_t len;
+ };
+
+ const struct tab tab[] = {
+ /*
+ * patterns that check for all combinations of leading and
+ * trailing unaligned characters (on a 64 bit processor)
+ */
+
+ { "", 0 },
+ { "a", 1 },
+ { "ab", 2 },
+ { "abc", 3 },
+ { "abcd", 4 },
+ { "abcde", 5 },
+ { "abcdef", 6 },
+ { "abcdefg", 7 },
+ { "abcdefgh", 8 },
+ { "abcdefghi", 9 },
+ { "abcdefghij", 10 },
+ { "abcdefghijk", 11 },
+ { "abcdefghijkl", 12 },
+ { "abcdefghijklm", 13 },
+ { "abcdefghijklmn", 14 },
+ { "abcdefghijklmno", 15 },
+ { "abcdefghijklmnop", 16 },
+ { "abcdefghijklmnopq", 17 },
+ { "abcdefghijklmnopqr", 18 },
+ { "abcdefghijklmnopqrs", 19 },
+ { "abcdefghijklmnopqrst", 20 },
+ { "abcdefghijklmnopqrstu", 21 },
+ { "abcdefghijklmnopqrstuv", 22 },
+ { "abcdefghijklmnopqrstuvw", 23 },
+
+ /*
+ * patterns that check for the cases where the expression:
+ *
+ * ((word - 0x7f7f..7f) & 0x8080..80)
+ *
+ * returns non-zero even though there are no zero bytes in
+ * the word.
+ */
+
+ { "" "\xff\xff\xff\xff\xff\xff\xff\xff" "abcdefgh", 16 },
+ { "a" "\xff\xff\xff\xff\xff\xff\xff\xff" "bcdefgh", 16 },
+ { "ab" "\xff\xff\xff\xff\xff\xff\xff\xff" "cdefgh", 16 },
+ { "abc" "\xff\xff\xff\xff\xff\xff\xff\xff" "defgh", 16 },
+ { "abcd" "\xff\xff\xff\xff\xff\xff\xff\xff" "efgh", 16 },
+ { "abcde" "\xff\xff\xff\xff\xff\xff\xff\xff" "fgh", 16 },
+ { "abcdef" "\xff\xff\xff\xff\xff\xff\xff\xff" "gh", 16 },
+ { "abcdefg" "\xff\xff\xff\xff\xff\xff\xff\xff" "h", 16 },
+ { "abcdefgh" "\xff\xff\xff\xff\xff\xff\xff\xff" "", 16 },
+ };
+
+ for (a0 = 0; a0 < sizeof(long); ++a0) {
+ for (a1 = 0; a1 < sizeof(long); ++a1) {
+ for (t0 = 0; t0 < __arraycount(tab); ++t0) {
+ for (t1 = 0; t1 < __arraycount(tab); ++t1) {
+
+ memcpy(&buf0[a0], tab[t0].val,
+ tab[t0].len + 1);
+ memcpy(&buf1[a1], tab[t1].val,
+ tab[t1].len + 1);
+
+ ret = f(&buf0[a0], &buf1[a1]);
+
+ /*
+ * verify strcat returns address
+ * of first parameter
+ */
+ if (&buf0[a0] != ret) {
+ fprintf(stderr, "a0 %d, a1 %d, "
+ "t0 %d, t1 %d\n",
+ a0, a1, t0, t1);
+ atf_tc_fail("strcat did not "
+ "return its first arg");
+ }
+
+ /* verify string copied correctly */
+ if (memcmp(&buf0[a0] + tab[t0].len,
+ &buf1[a1],
+ tab[t1].len + 1) != 0) {
+ fprintf(stderr, "a0 %d, a1 %d, "
+ "t0 %d, t1 %d\n",
+ a0, a1, t0, t1);
+ atf_tc_fail("string not copied "
+ "correctly");
+ }
+ }
+ }
+ }
+ }
+}
+
+ATF_TC(strncat_simple);
+ATF_TC_HEAD(strncat_simple, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strncat(3) results");
+}
+
+ATF_TC_BODY(strncat_simple, tc)
+{
+ char buf[100] = "abcdefg";
+
+ ATF_CHECK(strncat(buf, "xxx", 0) == buf);
+ ATF_CHECK(strcmp(buf, "abcdefg") == 0);
+ ATF_CHECK(strncat(buf, "xxx", 1) == buf);
+ ATF_CHECK(strcmp(buf, "abcdefgx") == 0);
+ ATF_CHECK(strncat(buf, "xxx", 2) == buf);
+ ATF_CHECK(strcmp(buf, "abcdefgxxx") == 0);
+ ATF_CHECK(strncat(buf, "\0", 1) == buf);
+ ATF_CHECK(strcmp(buf, "abcdefgxxx") == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strcat_basic);
+ ATF_TP_ADD_TC(tp, strncat_simple);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strchr.c b/contrib/netbsd-tests/lib/libc/string/t_strchr.c
new file mode 100644
index 0000000..958b186
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strchr.c
@@ -0,0 +1,292 @@
+/* $NetBSD: t_strchr.c,v 1.1 2011/07/07 08:59:33 jruoho Exp $ */
+
+/*
+ * Written by J.T. Conklin <jtc@acorntoolworks.com>
+ * Public domain.
+ */
+
+#include <atf-c.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+static char *slow_strchr(char *, int);
+static void verify_strchr(char *, int, unsigned int, unsigned int);
+
+char * (*volatile strchr_fn)(const char *, int);
+
+static char *
+slow_strchr(char *buf, int ch)
+{
+ unsigned char c = 1;
+
+ ch &= 0xff;
+
+ for (; c != 0; buf++) {
+ c = *buf;
+ if (c == ch)
+ return buf;
+ }
+ return 0;
+}
+
+static void
+verify_strchr(char *buf, int ch, unsigned int t, unsigned int a)
+{
+ const char *off, *ok_off;
+
+ off = strchr_fn(buf, ch);
+ ok_off = slow_strchr(buf, ch);
+ if (off == ok_off)
+ return;
+
+ fprintf(stderr, "test_strchr(\"%s\", %#x) gave %zd not %zd (test %d, "
+ "alignment %d)\n",
+ buf, ch, off ? off - buf : -1, ok_off ? ok_off - buf : -1, t, a);
+
+ atf_tc_fail("Check stderr for details");
+}
+
+ATF_TC(strchr_basic);
+ATF_TC_HEAD(strchr_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test strchr(3) results");
+}
+
+ATF_TC_BODY(strchr_basic, tc)
+{
+ unsigned int t, a;
+ char *off;
+ char buf[32];
+
+ const char *tab[] = {
+ "",
+ "a",
+ "aa",
+ "abc",
+ "abcd",
+ "abcde",
+ "abcdef",
+ "abcdefg",
+ "abcdefgh",
+
+ "/",
+ "//",
+ "/a",
+ "/a/",
+ "/ab",
+ "/ab/",
+ "/abc",
+ "/abc/",
+ "/abcd",
+ "/abcd/",
+ "/abcde",
+ "/abcde/",
+ "/abcdef",
+ "/abcdef/",
+ "/abcdefg",
+ "/abcdefg/",
+ "/abcdefgh",
+ "/abcdefgh/",
+
+ "a/",
+ "a//",
+ "a/a",
+ "a/a/",
+ "a/ab",
+ "a/ab/",
+ "a/abc",
+ "a/abc/",
+ "a/abcd",
+ "a/abcd/",
+ "a/abcde",
+ "a/abcde/",
+ "a/abcdef",
+ "a/abcdef/",
+ "a/abcdefg",
+ "a/abcdefg/",
+ "a/abcdefgh",
+ "a/abcdefgh/",
+
+ "ab/",
+ "ab//",
+ "ab/a",
+ "ab/a/",
+ "ab/ab",
+ "ab/ab/",
+ "ab/abc",
+ "ab/abc/",
+ "ab/abcd",
+ "ab/abcd/",
+ "ab/abcde",
+ "ab/abcde/",
+ "ab/abcdef",
+ "ab/abcdef/",
+ "ab/abcdefg",
+ "ab/abcdefg/",
+ "ab/abcdefgh",
+ "ab/abcdefgh/",
+
+ "abc/",
+ "abc//",
+ "abc/a",
+ "abc/a/",
+ "abc/ab",
+ "abc/ab/",
+ "abc/abc",
+ "abc/abc/",
+ "abc/abcd",
+ "abc/abcd/",
+ "abc/abcde",
+ "abc/abcde/",
+ "abc/abcdef",
+ "abc/abcdef/",
+ "abc/abcdefg",
+ "abc/abcdefg/",
+ "abc/abcdefgh",
+ "abc/abcdefgh/",
+
+ "abcd/",
+ "abcd//",
+ "abcd/a",
+ "abcd/a/",
+ "abcd/ab",
+ "abcd/ab/",
+ "abcd/abc",
+ "abcd/abc/",
+ "abcd/abcd",
+ "abcd/abcd/",
+ "abcd/abcde",
+ "abcd/abcde/",
+ "abcd/abcdef",
+ "abcd/abcdef/",
+ "abcd/abcdefg",
+ "abcd/abcdefg/",
+ "abcd/abcdefgh",
+ "abcd/abcdefgh/",
+
+ "abcde/",
+ "abcde//",
+ "abcde/a",
+ "abcde/a/",
+ "abcde/ab",
+ "abcde/ab/",
+ "abcde/abc",
+ "abcde/abc/",
+ "abcde/abcd",
+ "abcde/abcd/",
+ "abcde/abcde",
+ "abcde/abcde/",
+ "abcde/abcdef",
+ "abcde/abcdef/",
+ "abcde/abcdefg",
+ "abcde/abcdefg/",
+ "abcde/abcdefgh",
+ "abcde/abcdefgh/",
+
+ "abcdef/",
+ "abcdef//",
+ "abcdef/a",
+ "abcdef/a/",
+ "abcdef/ab",
+ "abcdef/ab/",
+ "abcdef/abc",
+ "abcdef/abc/",
+ "abcdef/abcd",
+ "abcdef/abcd/",
+ "abcdef/abcde",
+ "abcdef/abcde/",
+ "abcdef/abcdef",
+ "abcdef/abcdef/",
+ "abcdef/abcdefg",
+ "abcdef/abcdefg/",
+ "abcdef/abcdefgh",
+ "abcdef/abcdefgh/",
+
+ "abcdefg/",
+ "abcdefg//",
+ "abcdefg/a",
+ "abcdefg/a/",
+ "abcdefg/ab",
+ "abcdefg/ab/",
+ "abcdefg/abc",
+ "abcdefg/abc/",
+ "abcdefg/abcd",
+ "abcdefg/abcd/",
+ "abcdefg/abcde",
+ "abcdefg/abcde/",
+ "abcdefg/abcdef",
+ "abcdefg/abcdef/",
+ "abcdefg/abcdefg",
+ "abcdefg/abcdefg/",
+ "abcdefg/abcdefgh",
+ "abcdefg/abcdefgh/",
+
+ "abcdefgh/",
+ "abcdefgh//",
+ "abcdefgh/a",
+ "abcdefgh/a/",
+ "abcdefgh/ab",
+ "abcdefgh/ab/",
+ "abcdefgh/abc",
+ "abcdefgh/abc/",
+ "abcdefgh/abcd",
+ "abcdefgh/abcd/",
+ "abcdefgh/abcde",
+ "abcdefgh/abcde/",
+ "abcdefgh/abcdef",
+ "abcdefgh/abcdef/",
+ "abcdefgh/abcdefg",
+ "abcdefgh/abcdefg/",
+ "abcdefgh/abcdefgh",
+ "abcdefgh/abcdefgh/",
+ };
+
+
+ strchr_fn = dlsym(dlopen(0, RTLD_LAZY), "test_strchr");
+ if (!strchr_fn)
+ strchr_fn = strchr;
+
+ for (a = 3; a < 3 + sizeof(long); ++a) {
+ /* Put char and a \0 before the buffer */
+ buf[a-1] = '/';
+ buf[a-2] = '0';
+ buf[a-3] = 0xff;
+ for (t = 0; t < (sizeof(tab) / sizeof(tab[0])); ++t) {
+ int len = strlen(tab[t]) + 1;
+ memcpy(&buf[a], tab[t], len);
+
+ /* Put the char we are looking for after the \0 */
+ buf[a + len] = '/';
+
+ /* Check search for NUL at end of string */
+ verify_strchr(buf + a, 0, t, a);
+
+ /* Then for the '/' in the strings */
+ verify_strchr(buf + a, '/', t, a);
+
+ /* check zero extension of char arg */
+ verify_strchr(buf + a, 0xffffff00 | '/', t, a);
+
+ /* Replace all the '/' with 0xff */
+ while ((off = slow_strchr(buf + a, '/')) != NULL)
+ *off = 0xff;
+
+ buf[a + len] = 0xff;
+
+ /* Check we can search for 0xff as well as '/' */
+ verify_strchr(buf + a, 0xff, t, a);
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strchr_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strcmp.c b/contrib/netbsd-tests/lib/libc/string/t_strcmp.c
new file mode 100644
index 0000000..14e2e9c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strcmp.c
@@ -0,0 +1,136 @@
+/* $NetBSD: t_strcmp.c,v 1.4 2012/03/25 08:17:54 joerg Exp $ */
+
+/*
+ * Written by J.T. Conklin <jtc@acorntoolworks.com>
+ * Public domain.
+ */
+
+#include <atf-c.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+ATF_TC(strcmp_basic);
+ATF_TC_HEAD(strcmp_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strcmp(3) results, #1");
+}
+
+ATF_TC_BODY(strcmp_basic, tc)
+{
+ /* try to trick the compiler */
+ int (*f)(const char *, const char *s) = strcmp;
+
+ unsigned int a0, a1, t;
+ char buf0[64];
+ char buf1[64];
+ int ret;
+
+ struct tab {
+ const char* val0;
+ const char* val1;
+ int ret;
+ };
+
+ const struct tab tab[] = {
+ { "", "", 0 },
+
+ { "a", "a", 0 },
+ { "a", "b", -1 },
+ { "b", "a", +1 },
+ { "", "a", -1 },
+ { "a", "", +1 },
+
+ { "aa", "aa", 0 },
+ { "aa", "ab", -1 },
+ { "ab", "aa", +1 },
+ { "a", "aa", -1 },
+ { "aa", "a", +1 },
+
+ { "aaa", "aaa", 0 },
+ { "aaa", "aab", -1 },
+ { "aab", "aaa", +1 },
+ { "aa", "aaa", -1 },
+ { "aaa", "aa", +1 },
+
+ { "aaaa", "aaaa", 0 },
+ { "aaaa", "aaab", -1 },
+ { "aaab", "aaaa", +1 },
+ { "aaa", "aaaa", -1 },
+ { "aaaa", "aaa", +1 },
+
+ { "aaaaa", "aaaaa", 0 },
+ { "aaaaa", "aaaab", -1 },
+ { "aaaab", "aaaaa", +1 },
+ { "aaaa", "aaaaa", -1 },
+ { "aaaaa", "aaaa", +1 },
+
+ { "aaaaaa", "aaaaaa", 0 },
+ { "aaaaaa", "aaaaab", -1 },
+ { "aaaaab", "aaaaaa", +1 },
+ { "aaaaa", "aaaaaa", -1 },
+ { "aaaaaa", "aaaaa", +1 },
+ };
+
+ for (a0 = 0; a0 < sizeof(long); ++a0) {
+ for (a1 = 0; a1 < sizeof(long); ++a1) {
+ for (t = 0; t < __arraycount(tab); ++t) {
+ memcpy(&buf0[a0], tab[t].val0,
+ strlen(tab[t].val0) + 1);
+ memcpy(&buf1[a1], tab[t].val1,
+ strlen(tab[t].val1) + 1);
+
+ ret = f(&buf0[a0], &buf1[a1]);
+
+ if ((ret == 0 && tab[t].ret != 0) ||
+ (ret < 0 && tab[t].ret >= 0) ||
+ (ret > 0 && tab[t].ret <= 0)) {
+ fprintf(stderr, "a0 %d, a1 %d, t %d\n",
+ a0, a1, t);
+ fprintf(stderr, "\"%s\" \"%s\" %d\n",
+ &buf0[a0], &buf1[a1], ret);
+ atf_tc_fail("Check stderr for details");
+ }
+ }
+ }
+ }
+}
+
+ATF_TC(strcmp_simple);
+ATF_TC_HEAD(strcmp_simple, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strcmp(3) results, #2");
+}
+
+ATF_TC_BODY(strcmp_simple, tc)
+{
+ char buf1[10] = "xxx";
+ char buf2[10] = "xxy";
+
+ ATF_CHECK(strcmp(buf1, buf1) == 0);
+ ATF_CHECK(strcmp(buf2, buf2) == 0);
+
+ ATF_CHECK(strcmp("x\xf6x", "xox") > 0);
+ ATF_CHECK(strcmp("xxx", "xxxyyy") < 0);
+ ATF_CHECK(strcmp("xxxyyy", "xxx") > 0);
+
+ ATF_CHECK(strcmp(buf1 + 0, buf2 + 0) < 0);
+ ATF_CHECK(strcmp(buf1 + 1, buf2 + 1) < 0);
+ ATF_CHECK(strcmp(buf1 + 2, buf2 + 2) < 0);
+ ATF_CHECK(strcmp(buf1 + 3, buf2 + 3) == 0);
+
+ ATF_CHECK(strcmp(buf2 + 0, buf1 + 0) > 0);
+ ATF_CHECK(strcmp(buf2 + 1, buf1 + 1) > 0);
+ ATF_CHECK(strcmp(buf2 + 2, buf1 + 2) > 0);
+ ATF_CHECK(strcmp(buf2 + 3, buf1 + 3) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strcmp_basic);
+ ATF_TP_ADD_TC(tp, strcmp_simple);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strcpy.c b/contrib/netbsd-tests/lib/libc/string/t_strcpy.c
new file mode 100644
index 0000000..285371e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strcpy.c
@@ -0,0 +1,124 @@
+/* $NetBSD: t_strcpy.c,v 1.1 2011/07/07 08:59:33 jruoho Exp $ */
+
+/*
+ * Written by J.T. Conklin <jtc@acorntoolworks.com>
+ * Public domain.
+ */
+
+#include <atf-c.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+ATF_TC(strcpy_basic);
+ATF_TC_HEAD(strcpy_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strcpy(3) results");
+}
+
+ATF_TC_BODY(strcpy_basic, tc)
+{
+ /* try to trick the compiler */
+ char * (*f)(char *, const char *s) = strcpy;
+
+ unsigned int a0, a1, t;
+ char buf0[64];
+ char buf1[64];
+ char *ret;
+
+ struct tab {
+ const char* val;
+ size_t len;
+ };
+
+ const struct tab tab[] = {
+ /*
+ * patterns that check for all combinations of leading and
+ * trailing unaligned characters (on a 64 bit processor)
+ */
+
+ { "", 0 },
+ { "a", 1 },
+ { "ab", 2 },
+ { "abc", 3 },
+ { "abcd", 4 },
+ { "abcde", 5 },
+ { "abcdef", 6 },
+ { "abcdefg", 7 },
+ { "abcdefgh", 8 },
+ { "abcdefghi", 9 },
+ { "abcdefghij", 10 },
+ { "abcdefghijk", 11 },
+ { "abcdefghijkl", 12 },
+ { "abcdefghijklm", 13 },
+ { "abcdefghijklmn", 14 },
+ { "abcdefghijklmno", 15 },
+ { "abcdefghijklmnop", 16 },
+ { "abcdefghijklmnopq", 17 },
+ { "abcdefghijklmnopqr", 18 },
+ { "abcdefghijklmnopqrs", 19 },
+ { "abcdefghijklmnopqrst", 20 },
+ { "abcdefghijklmnopqrstu", 21 },
+ { "abcdefghijklmnopqrstuv", 22 },
+ { "abcdefghijklmnopqrstuvw", 23 },
+
+ /*
+ * patterns that check for the cases where the expression:
+ *
+ * ((word - 0x7f7f..7f) & 0x8080..80)
+ *
+ * returns non-zero even though there are no zero bytes in
+ * the word.
+ */
+
+ { "" "\xff\xff\xff\xff\xff\xff\xff\xff" "abcdefgh", 16 },
+ { "a" "\xff\xff\xff\xff\xff\xff\xff\xff" "bcdefgh", 16 },
+ { "ab" "\xff\xff\xff\xff\xff\xff\xff\xff" "cdefgh", 16 },
+ { "abc" "\xff\xff\xff\xff\xff\xff\xff\xff" "defgh", 16 },
+ { "abcd" "\xff\xff\xff\xff\xff\xff\xff\xff" "efgh", 16 },
+ { "abcde" "\xff\xff\xff\xff\xff\xff\xff\xff" "fgh", 16 },
+ { "abcdef" "\xff\xff\xff\xff\xff\xff\xff\xff" "gh", 16 },
+ { "abcdefg" "\xff\xff\xff\xff\xff\xff\xff\xff" "h", 16 },
+ { "abcdefgh" "\xff\xff\xff\xff\xff\xff\xff\xff" "", 16 },
+ };
+
+ for (a0 = 0; a0 < sizeof(long); ++a0) {
+ for (a1 = 0; a1 < sizeof(long); ++a1) {
+ for (t = 0; t < (sizeof(tab) / sizeof(tab[0])); ++t) {
+
+ memcpy(&buf1[a1], tab[t].val, tab[t].len + 1);
+ ret = f(&buf0[a0], &buf1[a1]);
+
+ /*
+ * verify strcpy returns address of
+ * first parameter
+ */
+ if (&buf0[a0] != ret) {
+ fprintf(stderr, "a0 %d, a1 %d, t %d\n",
+ a0, a1, t);
+ atf_tc_fail("strcpy did not return "
+ "its first arg");
+ }
+
+ /*
+ * verify string was copied correctly
+ */
+ if (memcmp(&buf0[a0], &buf1[a1],
+ tab[t].len + 1) != 0) {
+ fprintf(stderr, "a0 %d, a1 %d, t %d\n",
+ a0, a1, t);
+ atf_tc_fail("not correctly copied");
+ }
+ }
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strcpy_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strcspn.c b/contrib/netbsd-tests/lib/libc/string/t_strcspn.c
new file mode 100644
index 0000000..d38cdb4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strcspn.c
@@ -0,0 +1,58 @@
+/* $NetBSD: t_strcspn.c,v 1.1 2011/11/21 23:50:45 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_strcspn.c,v 1.1 2011/11/21 23:50:45 joerg Exp $");
+
+#include <atf-c.h>
+#include <string.h>
+
+ATF_TC(strcspn);
+ATF_TC_HEAD(strcspn, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strcspn(3)");
+}
+
+ATF_TC_BODY(strcspn, tc)
+{
+ ATF_CHECK_EQ(strcspn("abcdefghijklmnop", ""), 16);
+ ATF_CHECK_EQ(strcspn("abcdefghijklmnop", "a"), 0);
+ ATF_CHECK_EQ(strcspn("abcdefghijklmnop", "b"), 1);
+ ATF_CHECK_EQ(strcspn("abcdefghijklmnop", "cd"), 2);
+ ATF_CHECK_EQ(strcspn("abcdefghijklmnop", "qrstuvwxyz"), 16);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strcspn);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strerror.c b/contrib/netbsd-tests/lib/libc/string/t_strerror.c
new file mode 100644
index 0000000..c0e9c06
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strerror.c
@@ -0,0 +1,135 @@
+/* $NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <limits.h>
+#include <locale.h>
+#include <string.h>
+
+ATF_TC(strerror_basic);
+ATF_TC_HEAD(strerror_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of strerror(3)");
+}
+
+ATF_TC_BODY(strerror_basic, tc)
+{
+ int i;
+
+ for (i = 1; i < sys_nerr; i++)
+ ATF_REQUIRE(strstr(strerror(i), "Unknown error:") == NULL);
+
+ for (; i < sys_nerr + 10; i++)
+ ATF_REQUIRE(strstr(strerror(i), "Unknown error:") != NULL);
+}
+
+ATF_TC(strerror_err);
+ATF_TC_HEAD(strerror_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from strerror(3)");
+}
+
+ATF_TC_BODY(strerror_err, tc)
+{
+
+ errno = 0;
+
+ ATF_REQUIRE(strstr(strerror(INT_MAX), "Unknown error:") != NULL);
+ ATF_REQUIRE(errno == EINVAL);
+
+ errno = 0;
+
+ ATF_REQUIRE(strstr(strerror(INT_MIN), "Unknown error:") != NULL);
+ ATF_REQUIRE(errno == EINVAL);
+}
+
+ATF_TC(strerror_r_basic);
+ATF_TC_HEAD(strerror_r_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of strerror_r(3)");
+}
+
+ATF_TC_BODY(strerror_r_basic, tc)
+{
+ char buf[512];
+ int i;
+
+ for (i = 1; i < sys_nerr; i++) {
+ ATF_REQUIRE(strerror_r(i, buf, sizeof(buf)) == 0);
+ ATF_REQUIRE(strstr(buf, "Unknown error:") == NULL);
+ }
+
+ for (; i < sys_nerr + 10; i++) {
+ ATF_REQUIRE(strerror_r(i, buf, sizeof(buf)) == EINVAL);
+ ATF_REQUIRE(strstr(buf, "Unknown error:") != NULL);
+ }
+}
+
+ATF_TC(strerror_r_err);
+ATF_TC_HEAD(strerror_r_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from strerror_r(3)");
+}
+
+ATF_TC_BODY(strerror_r_err, tc)
+{
+ char buf[512];
+ int rv;
+
+ rv = strerror_r(EPERM, buf, 1);
+ ATF_REQUIRE(rv == ERANGE);
+
+ rv = strerror_r(INT_MAX, buf, sizeof(buf));
+
+ ATF_REQUIRE(rv == EINVAL);
+ ATF_REQUIRE(strstr(buf, "Unknown error:") != NULL);
+
+ rv = strerror_r(INT_MIN, buf, sizeof(buf));
+
+ ATF_REQUIRE(rv == EINVAL);
+ ATF_REQUIRE(strstr(buf, "Unknown error:") != NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ (void)setlocale(LC_ALL, "C");
+
+ ATF_TP_ADD_TC(tp, strerror_basic);
+ ATF_TP_ADD_TC(tp, strerror_err);
+ ATF_TP_ADD_TC(tp, strerror_r_basic);
+ ATF_TP_ADD_TC(tp, strerror_r_err);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_stresep.c b/contrib/netbsd-tests/lib/libc/string/t_stresep.c
new file mode 100644
index 0000000..4678e55
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_stresep.c
@@ -0,0 +1,72 @@
+/* $NetBSD: t_stresep.c,v 1.3 2013/02/15 23:56:32 christos Exp $ */
+
+/*-
+ * Copyright (c) 2005 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define expect(a) \
+ if ((p = stresep(&q, " ", '\\')) == NULL || strcmp(p, a)) { \
+ fprintf(stderr, "failed on line %d: %s != %s\n", \
+ __LINE__, p, a); \
+ atf_tc_fail("Check stderr for test id/line"); \
+ }
+
+ATF_TC(stresep_basic);
+ATF_TC_HEAD(stresep_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test stresep results");
+}
+
+ATF_TC_BODY(stresep_basic, tc)
+{
+ char brkstr[] = "foo\\ \\ bar baz bar\\ foo\\ bar\\ \\ foo \\ \\ \\ "
+ "baz bar\\ \\ ";
+ char *p, *q = brkstr;
+
+ expect("foo bar");
+ expect("baz");
+ expect("bar foo ");
+ expect("bar foo");
+ expect(" baz");
+ expect("bar ");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, stresep_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strlen.c b/contrib/netbsd-tests/lib/libc/string/t_strlen.c
new file mode 100644
index 0000000..66158fd
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strlen.c
@@ -0,0 +1,199 @@
+/* $NetBSD: t_strlen.c,v 1.5 2011/07/14 07:33:20 jruoho Exp $ */
+
+/*
+ * Written by J.T. Conklin <jtc@acorntoolworks.com>
+ * Public domain.
+ */
+
+#include <atf-c.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <unistd.h>
+
+static void write_num(int);
+
+static void
+write_num(int val)
+{
+ char buf[20];
+ int i;
+
+ for (i = sizeof buf; --i >= 0;) {
+ buf[i] = '0' + val % 10;
+ val /= 10;
+ if (val == 0) {
+ write(2, buf + i, sizeof buf - i);
+ return;
+ }
+ }
+ write(2, "overflow", 8);
+}
+
+ATF_TC(strlen_basic);
+ATF_TC_HEAD(strlen_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strlen(3) results");
+}
+
+ATF_TC_BODY(strlen_basic, tc)
+{
+ /* try to trick the compiler */
+ size_t (*strlen_fn)(const char *);
+
+ unsigned int a, t;
+ size_t len;
+ char buf[64];
+
+ struct tab {
+ const char* val;
+ size_t len;
+ };
+
+ const struct tab tab[] = {
+ /*
+ * patterns that check for all combinations of leading and
+ * trailing unaligned characters (on a 64 bit processor)
+ */
+
+ { "", 0 },
+ { "a", 1 },
+ { "ab", 2 },
+ { "abc", 3 },
+ { "abcd", 4 },
+ { "abcde", 5 },
+ { "abcdef", 6 },
+ { "abcdefg", 7 },
+ { "abcdefgh", 8 },
+ { "abcdefghi", 9 },
+ { "abcdefghij", 10 },
+ { "abcdefghijk", 11 },
+ { "abcdefghijkl", 12 },
+ { "abcdefghijklm", 13 },
+ { "abcdefghijklmn", 14 },
+ { "abcdefghijklmno", 15 },
+ { "abcdefghijklmnop", 16 },
+ { "abcdefghijklmnopq", 17 },
+ { "abcdefghijklmnopqr", 18 },
+ { "abcdefghijklmnopqrs", 19 },
+ { "abcdefghijklmnopqrst", 20 },
+ { "abcdefghijklmnopqrstu", 21 },
+ { "abcdefghijklmnopqrstuv", 22 },
+ { "abcdefghijklmnopqrstuvw", 23 },
+
+ /*
+ * patterns that check for the cases where the expression:
+ *
+ * ((word - 0x7f7f..7f) & 0x8080..80)
+ *
+ * returns non-zero even though there are no zero bytes in
+ * the word.
+ */
+
+ { "" "\xff\xff\xff\xff\xff\xff\xff\xff" "abcdefgh", 16 },
+ { "a" "\xff\xff\xff\xff\xff\xff\xff\xff" "bcdefgh", 16 },
+ { "ab" "\xff\xff\xff\xff\xff\xff\xff\xff" "cdefgh", 16 },
+ { "abc" "\xff\xff\xff\xff\xff\xff\xff\xff" "defgh", 16 },
+ { "abcd" "\xff\xff\xff\xff\xff\xff\xff\xff" "efgh", 16 },
+ { "abcde" "\xff\xff\xff\xff\xff\xff\xff\xff" "fgh", 16 },
+ { "abcdef" "\xff\xff\xff\xff\xff\xff\xff\xff" "gh", 16 },
+ { "abcdefg" "\xff\xff\xff\xff\xff\xff\xff\xff" "h", 16 },
+ { "abcdefgh" "\xff\xff\xff\xff\xff\xff\xff\xff" "", 16 },
+ };
+
+ /*
+ * During testing it is useful have the rest of the program
+ * use a known good version!
+ */
+ strlen_fn = dlsym(dlopen(NULL, RTLD_LAZY), "test_strlen");
+ if (!strlen_fn)
+ strlen_fn = strlen;
+
+ for (a = 0; a < sizeof(long); ++a) {
+ for (t = 0; t < (sizeof(tab) / sizeof(tab[0])); ++t) {
+
+ memcpy(&buf[a], tab[t].val, tab[t].len + 1);
+ len = strlen_fn(&buf[a]);
+
+ if (len != tab[t].len) {
+ /* Write error without using printf / strlen */
+ write(2, "alignment ", 10);
+ write_num(a);
+ write(2, ", test ", 7);
+ write_num(t);
+ write(2, ", got len ", 10);
+ write_num(len);
+ write(2, ", not ", 6);
+ write_num(tab[t].len);
+ write(2, ", for '", 7);
+ write(2, tab[t].val, tab[t].len);
+ write(2, "'\n", 2);
+ atf_tc_fail("See stderr for details");
+ }
+ }
+ }
+}
+
+ATF_TC(strlen_huge);
+ATF_TC_HEAD(strlen_huge, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strlen(3) with huge strings");
+}
+
+ATF_TC_BODY(strlen_huge, tc)
+{
+ long page;
+ char *str;
+ size_t i;
+
+ page = sysconf(_SC_PAGESIZE);
+ ATF_REQUIRE(page >= 0);
+
+ for (i = 1; i < 1000; i = i + 100) {
+
+ str = malloc(i * page + 1);
+
+ if (str == NULL)
+ continue;
+
+ (void)memset(str, 'x', i * page);
+ str[i * page] = '\0';
+
+ ATF_REQUIRE(strlen(str) == i * page);
+ free(str);
+ }
+}
+
+ATF_TC(strnlen_basic);
+ATF_TC_HEAD(strnlen_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A naive test of strnlen(3)");
+}
+
+ATF_TC_BODY(strnlen_basic, tc)
+{
+ char buf[1];
+
+ buf[0] = '\0';
+
+ ATF_CHECK(strnlen(buf, 000) == 0);
+ ATF_CHECK(strnlen(buf, 111) == 0);
+
+ ATF_CHECK(strnlen("xxx", 0) == 0);
+ ATF_CHECK(strnlen("xxx", 1) == 1);
+ ATF_CHECK(strnlen("xxx", 2) == 2);
+ ATF_CHECK(strnlen("xxx", 3) == 3);
+ ATF_CHECK(strnlen("xxx", 9) == 3);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strlen_basic);
+ ATF_TP_ADD_TC(tp, strlen_huge);
+ ATF_TP_ADD_TC(tp, strnlen_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strpbrk.c b/contrib/netbsd-tests/lib/libc/string/t_strpbrk.c
new file mode 100644
index 0000000..d0f2d9b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strpbrk.c
@@ -0,0 +1,62 @@
+/* $NetBSD: t_strpbrk.c,v 1.1 2011/11/21 23:50:45 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_strpbrk.c,v 1.1 2011/11/21 23:50:45 joerg Exp $");
+
+#include <atf-c.h>
+#include <string.h>
+
+ATF_TC(strpbrk);
+ATF_TC_HEAD(strpbrk, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strpbrk(3)");
+}
+
+ATF_TC_BODY(strpbrk, tc)
+{
+ static const char s[] = "abcdefghijklmnop";
+
+ ATF_CHECK_EQ(strpbrk(s, ""), NULL);
+ ATF_CHECK_EQ(strpbrk(s, "qrst"), NULL);
+ ATF_CHECK_EQ(strpbrk(s, "a"), s);
+ ATF_CHECK_EQ(strpbrk(s, "b"), s + 1);
+ ATF_CHECK_EQ(strpbrk(s, "ab"), s);
+ ATF_CHECK_EQ(strpbrk(s, "cdef"), s + 2);
+ ATF_CHECK_EQ(strpbrk(s, "fedc"), s + 2);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strpbrk);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strrchr.c b/contrib/netbsd-tests/lib/libc/string/t_strrchr.c
new file mode 100644
index 0000000..038daff
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strrchr.c
@@ -0,0 +1,257 @@
+/* $NetBSD: t_strrchr.c,v 1.1 2011/07/07 08:59:33 jruoho Exp $ */
+
+/*
+ * Written by J.T. Conklin <jtc@acorntoolworks.com>
+ * Public domain.
+ */
+
+#include <atf-c.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+ATF_TC(strrchr_basic);
+ATF_TC_HEAD(strrchr_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strrchr(3) results");
+}
+
+ATF_TC_BODY(strrchr_basic, tc)
+{
+ /* try to trick the compiler */
+ char * (*f)(const char *, int) = strrchr;
+
+ unsigned int a, t;
+ char *off, *off2;
+ char buf[32];
+
+ struct tab {
+ const char* val;
+ char match;
+ ssize_t f_off; /* offset of first match */
+ ssize_t l_off; /* offset of last match */
+ };
+
+ const struct tab tab[] = {
+ { "", 0, 0, 0 },
+ { "a", 0, 0, 0 },
+ { "aa", 0, 0, 0 },
+ { "abc", 0, 0, 0 },
+ { "abcd", 0, 0, 0 },
+ { "abcde", 0, 0, 0 },
+ { "abcdef", 0, 0, 0 },
+ { "abcdefg", 0, 0, 0 },
+ { "abcdefgh", 0, 0, 0 },
+
+ { "/", 1, 0, 0 },
+ { "//", 1, 0, 1 },
+ { "/a", 1, 0, 0 },
+ { "/a/", 1, 0, 2 },
+ { "/ab", 1, 0, 0 },
+ { "/ab/", 1, 0, 3 },
+ { "/abc", 1, 0, 0 },
+ { "/abc/", 1, 0, 4 },
+ { "/abcd", 1, 0, 0 },
+ { "/abcd/", 1, 0, 5 },
+ { "/abcde", 1, 0, 0 },
+ { "/abcde/", 1, 0, 6 },
+ { "/abcdef", 1, 0, 0 },
+ { "/abcdef/", 1, 0, 7 },
+ { "/abcdefg", 1, 0, 0 },
+ { "/abcdefg/", 1, 0, 8 },
+ { "/abcdefgh", 1, 0, 0 },
+ { "/abcdefgh/", 1, 0, 9 },
+
+ { "a/", 1, 1, 1 },
+ { "a//", 1, 1, 2 },
+ { "a/a", 1, 1, 1 },
+ { "a/a/", 1, 1, 3 },
+ { "a/ab", 1, 1, 1 },
+ { "a/ab/", 1, 1, 4 },
+ { "a/abc", 1, 1, 1 },
+ { "a/abc/", 1, 1, 5 },
+ { "a/abcd", 1, 1, 1 },
+ { "a/abcd/", 1, 1, 6 },
+ { "a/abcde", 1, 1, 1 },
+ { "a/abcde/", 1, 1, 7 },
+ { "a/abcdef", 1, 1, 1 },
+ { "a/abcdef/", 1, 1, 8 },
+ { "a/abcdefg", 1, 1, 1 },
+ { "a/abcdefg/", 1, 1, 9 },
+ { "a/abcdefgh", 1, 1, 1 },
+ { "a/abcdefgh/", 1, 1, 10 },
+
+ { "ab/", 1, 2, 2 },
+ { "ab//", 1, 2, 3 },
+ { "ab/a", 1, 2, 2 },
+ { "ab/a/", 1, 2, 4 },
+ { "ab/ab", 1, 2, 2 },
+ { "ab/ab/", 1, 2, 5 },
+ { "ab/abc", 1, 2, 2 },
+ { "ab/abc/", 1, 2, 6 },
+ { "ab/abcd", 1, 2, 2 },
+ { "ab/abcd/", 1, 2, 7 },
+ { "ab/abcde", 1, 2, 2 },
+ { "ab/abcde/", 1, 2, 8 },
+ { "ab/abcdef", 1, 2, 2 },
+ { "ab/abcdef/", 1, 2, 9 },
+ { "ab/abcdefg", 1, 2, 2 },
+ { "ab/abcdefg/", 1, 2, 10 },
+ { "ab/abcdefgh", 1, 2, 2 },
+ { "ab/abcdefgh/", 1, 2, 11 },
+
+ { "abc/", 1, 3, 3 },
+ { "abc//", 1, 3, 4 },
+ { "abc/a", 1, 3, 3 },
+ { "abc/a/", 1, 3, 5 },
+ { "abc/ab", 1, 3, 3 },
+ { "abc/ab/", 1, 3, 6 },
+ { "abc/abc", 1, 3, 3 },
+ { "abc/abc/", 1, 3, 7 },
+ { "abc/abcd", 1, 3, 3 },
+ { "abc/abcd/", 1, 3, 8 },
+ { "abc/abcde", 1, 3, 3 },
+ { "abc/abcde/", 1, 3, 9 },
+ { "abc/abcdef", 1, 3, 3 },
+ { "abc/abcdef/", 1, 3, 10 },
+ { "abc/abcdefg", 1, 3, 3 },
+ { "abc/abcdefg/", 1, 3, 11 },
+ { "abc/abcdefgh", 1, 3, 3 },
+ { "abc/abcdefgh/", 1, 3, 12 },
+
+ { "abcd/", 1, 4, 4 },
+ { "abcd//", 1, 4, 5 },
+ { "abcd/a", 1, 4, 4 },
+ { "abcd/a/", 1, 4, 6 },
+ { "abcd/ab", 1, 4, 4 },
+ { "abcd/ab/", 1, 4, 7 },
+ { "abcd/abc", 1, 4, 4 },
+ { "abcd/abc/", 1, 4, 8 },
+ { "abcd/abcd", 1, 4, 4 },
+ { "abcd/abcd/", 1, 4, 9 },
+ { "abcd/abcde", 1, 4, 4 },
+ { "abcd/abcde/", 1, 4, 10 },
+ { "abcd/abcdef", 1, 4, 4 },
+ { "abcd/abcdef/", 1, 4, 11 },
+ { "abcd/abcdefg", 1, 4, 4 },
+ { "abcd/abcdefg/", 1, 4, 12 },
+ { "abcd/abcdefgh", 1, 4, 4 },
+ { "abcd/abcdefgh/", 1, 4, 13 },
+
+ { "abcde/", 1, 5, 5 },
+ { "abcde//", 1, 5, 6 },
+ { "abcde/a", 1, 5, 5 },
+ { "abcde/a/", 1, 5, 7 },
+ { "abcde/ab", 1, 5, 5 },
+ { "abcde/ab/", 1, 5, 8 },
+ { "abcde/abc", 1, 5, 5 },
+ { "abcde/abc/", 1, 5, 9 },
+ { "abcde/abcd", 1, 5, 5 },
+ { "abcde/abcd/", 1, 5, 10 },
+ { "abcde/abcde", 1, 5, 5 },
+ { "abcde/abcde/", 1, 5, 11 },
+ { "abcde/abcdef", 1, 5, 5 },
+ { "abcde/abcdef/", 1, 5, 12 },
+ { "abcde/abcdefg", 1, 5, 5 },
+ { "abcde/abcdefg/", 1, 5, 13 },
+ { "abcde/abcdefgh", 1, 5, 5 },
+ { "abcde/abcdefgh/", 1, 5, 14 },
+
+ { "abcdef/", 1, 6, 6 },
+ { "abcdef//", 1, 6, 7 },
+ { "abcdef/a", 1, 6, 6 },
+ { "abcdef/a/", 1, 6, 8 },
+ { "abcdef/ab", 1, 6, 6 },
+ { "abcdef/ab/", 1, 6, 9 },
+ { "abcdef/abc", 1, 6, 6 },
+ { "abcdef/abc/", 1, 6, 10 },
+ { "abcdef/abcd", 1, 6, 6 },
+ { "abcdef/abcd/", 1, 6, 11 },
+ { "abcdef/abcde", 1, 6, 6 },
+ { "abcdef/abcde/", 1, 6, 12 },
+ { "abcdef/abcdef", 1, 6, 6 },
+ { "abcdef/abcdef/", 1, 6, 13 },
+ { "abcdef/abcdefg", 1, 6, 6 },
+ { "abcdef/abcdefg/", 1, 6, 14 },
+ { "abcdef/abcdefgh", 1, 6, 6 },
+ { "abcdef/abcdefgh/", 1, 6, 15 },
+
+ { "abcdefg/", 1, 7, 7 },
+ { "abcdefg//", 1, 7, 8 },
+ { "abcdefg/a", 1, 7, 7 },
+ { "abcdefg/a/", 1, 7, 9 },
+ { "abcdefg/ab", 1, 7, 7 },
+ { "abcdefg/ab/", 1, 7, 10 },
+ { "abcdefg/abc", 1, 7, 7 },
+ { "abcdefg/abc/", 1, 7, 11 },
+ { "abcdefg/abcd", 1, 7, 7 },
+ { "abcdefg/abcd/", 1, 7, 12 },
+ { "abcdefg/abcde", 1, 7, 7 },
+ { "abcdefg/abcde/", 1, 7, 13 },
+ { "abcdefg/abcdef", 1, 7, 7 },
+ { "abcdefg/abcdef/", 1, 7, 14 },
+ { "abcdefg/abcdefg", 1, 7, 7 },
+ { "abcdefg/abcdefg/", 1, 7, 15 },
+ { "abcdefg/abcdefgh", 1, 7, 7 },
+ { "abcdefg/abcdefgh/", 1, 7, 16 },
+
+ { "abcdefgh/", 1, 8, 8 },
+ { "abcdefgh//", 1, 8, 9 },
+ { "abcdefgh/a", 1, 8, 8 },
+ { "abcdefgh/a/", 1, 8, 10 },
+ { "abcdefgh/ab", 1, 8, 8 },
+ { "abcdefgh/ab/", 1, 8, 11 },
+ { "abcdefgh/abc", 1, 8, 8 },
+ { "abcdefgh/abc/", 1, 8, 12 },
+ { "abcdefgh/abcd", 1, 8, 8 },
+ { "abcdefgh/abcd/", 1, 8, 13 },
+ { "abcdefgh/abcde", 1, 8, 8 },
+ { "abcdefgh/abcde/", 1, 8, 14 },
+ { "abcdefgh/abcdef", 1, 8, 8 },
+ { "abcdefgh/abcdef/", 1, 8, 15 },
+ { "abcdefgh/abcdefg", 1, 8, 8 },
+ { "abcdefgh/abcdefg/", 1, 8, 16 },
+ { "abcdefgh/abcdefgh", 1, 8, 8 },
+ { "abcdefgh/abcdefgh/", 1, 8, 17 },
+ };
+
+ for (a = 0; a < sizeof(long); ++a) {
+ for (t = 0; t < (sizeof(tab) / sizeof(tab[0])); ++t) {
+ strcpy(&buf[a], tab[t].val);
+
+ off = f(&buf[a], '/');
+ if (tab[t].match == 0) {
+ if (off != 0) {
+ fprintf(stderr, "a %d, t %d\n", a, t);
+ atf_tc_fail("strrchr should not have "
+ "found the character");
+ }
+ } else if (tab[t].match == 1) {
+ if (tab[t].l_off != (off - &buf[a])) {
+ fprintf(stderr, "a %d, t %d\n", a, t);
+ atf_tc_fail("strrchr returns wrong "
+ "offset");
+ }
+ } else {
+ fprintf(stderr, "a %d, t %d\n", a, t);
+ atf_tc_fail("bad test case data");
+ }
+
+ /* check zero extension of char arg */
+ off2 = f(&buf[a], 0xffffff00 | '/');
+ if (off != off2) {
+ fprintf(stderr, "a %d, t %d\n", a, t);
+ atf_tc_fail("zero extension of char arg fails");
+ }
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strrchr_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strspn.c b/contrib/netbsd-tests/lib/libc/string/t_strspn.c
new file mode 100644
index 0000000..6782181
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_strspn.c
@@ -0,0 +1,60 @@
+/* $NetBSD: t_strspn.c,v 1.1 2011/11/21 23:50:45 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_strspn.c,v 1.1 2011/11/21 23:50:45 joerg Exp $");
+
+#include <atf-c.h>
+#include <string.h>
+
+ATF_TC(strspn);
+ATF_TC_HEAD(strspn, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strspn(3)");
+}
+
+ATF_TC_BODY(strspn, tc)
+{
+ ATF_CHECK_EQ(strspn("abcdefghijklmnop", ""), 0);
+ ATF_CHECK_EQ(strspn("abcdefghijklmnop", "a"), 1);
+ ATF_CHECK_EQ(strspn("abcdefghijklmnop", "b"), 0);
+ ATF_CHECK_EQ(strspn("abcdefghijklmnop", "ab"), 2);
+ ATF_CHECK_EQ(strspn("abcdefghijklmnop", "abc"), 3);
+ ATF_CHECK_EQ(strspn("abcdefghijklmnop", "abce"), 3);
+ ATF_CHECK_EQ(strspn("abcdefghijklmnop", "abcdefghijklmnop"), 16);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strspn);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/string/t_swab.c b/contrib/netbsd-tests/lib/libc/string/t_swab.c
new file mode 100644
index 0000000..797397a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/string/t_swab.c
@@ -0,0 +1,95 @@
+/* $NetBSD: t_swab.c,v 1.2 2011/07/07 08:27:36 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code was contributed to The NetBSD Foundation by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <err.h>
+
+#define MAXCHK 100
+
+static void
+build(char *a, char *b, size_t n) {
+ size_t i;
+
+ n >>= 1;
+ for (i = 0; i < n; i += 2) {
+ b[i+1] = a[i] = (char)i;
+ b[i] = a[i+1] = (char)(i+1);
+ }
+ for (n <<= 1; n < MAXCHK; n++)
+ a[n] = b[n] = (char)~0;
+}
+
+static void
+dump(const char *f, char *b, size_t l)
+{
+
+ printf("%s ", f);
+ while (l--)
+ printf("%.2x ", (unsigned char)*b++);
+ printf("\n");
+}
+
+ATF_TC(swab_basic);
+ATF_TC_HEAD(swab_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test swab results");
+}
+
+ATF_TC_BODY(swab_basic, tc)
+{
+ char a[MAXCHK], b[MAXCHK], r[MAXCHK];
+ size_t i;
+
+ for (i = 0; i < MAXCHK; i += 2) {
+ build(a, b, i);
+ (void)memset(r, ~0, MAXCHK);
+ swab(a, r, i);
+ if (memcmp(b, r, MAXCHK) != 0) {
+ fprintf(stderr, "pattern mismatch at %lu bytes",
+ (unsigned long)i);
+ dump("expect:", b, MAXCHK);
+ dump("result:", r, MAXCHK);
+ atf_tc_fail("Check stderr for details");
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, swab_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sync/all_sync_ops_linkable.c b/contrib/netbsd-tests/lib/libc/sync/all_sync_ops_linkable.c
new file mode 100644
index 0000000..0f2068a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sync/all_sync_ops_linkable.c
@@ -0,0 +1,168 @@
+/* $NetBSD: all_sync_ops_linkable.c,v 1.4 2014/02/21 10:26:25 martin Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This is a simple link-time test to verify all builtin atomic sync
+ * operations are available. Depending on the exact cpu/arch code generator
+ * options, some of these need support functions (which on NetBSD we
+ * typically provide in src/common/lib/libc/atomic).
+ *
+ * The list of operations has been extracted from sync-builtins.def file
+ * in the gcc distribution (as of gcc 4.8.2).
+ */
+
+#include <machine/types.h>
+#include <sys/inttypes.h>
+
+volatile uint8_t u8 = 0;
+volatile uint16_t u16 = 0;
+volatile uint32_t u32 = 0;
+
+#ifdef __HAVE_ATOMIC64_OPS
+volatile uint64_t u64 = 0;
+#endif
+
+int
+main(int argc, char **argv)
+{
+ __sync_synchronize();
+ __sync_add_and_fetch(&u8, 1);
+ __sync_add_and_fetch_1(&u8, 1);
+ __sync_add_and_fetch_2(&u16, 1);
+ __sync_add_and_fetch_4(&u32, 1);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_add_and_fetch_8(&u64, 1);
+#endif
+ __sync_bool_compare_and_swap(&u8, 1, 2);
+ __sync_bool_compare_and_swap_1(&u8, 1, 2);
+ __sync_bool_compare_and_swap_2(&u16, 1, 2);
+ __sync_bool_compare_and_swap_4(&u32, 1, 2);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_bool_compare_and_swap_8(&u64, 1, 2);
+#endif
+ __sync_fetch_and_add(&u8, 1);
+ __sync_fetch_and_add_1(&u8, 1);
+ __sync_fetch_and_add_2(&u16, 1);
+ __sync_fetch_and_add_4(&u32, 1);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_fetch_and_add_8(&u64, 1);
+#endif
+ __sync_fetch_and_and(&u8, 0x80);
+ __sync_fetch_and_and_1(&u8, 0x80);
+ __sync_fetch_and_and_2(&u16, 0x80);
+ __sync_fetch_and_and_4(&u32, 0x80);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_fetch_and_and_8(&u64, 0x80);
+#endif
+#ifndef __clang__
+ __sync_fetch_and_nand(&u8, 0x80);
+ __sync_fetch_and_nand_1(&u8, 0x80);
+ __sync_fetch_and_nand_2(&u16, 0x80);
+ __sync_fetch_and_nand_4(&u32, 0x80);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_fetch_and_nand_8(&u64, 0x80);
+#endif
+#endif
+ __sync_fetch_and_or(&u8, 0x80);
+ __sync_fetch_and_or_1(&u8, 0x80);
+ __sync_fetch_and_or_2(&u16, 0x80);
+ __sync_fetch_and_or_4(&u32, 0x80);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_fetch_and_or_8(&u64, 0x80);
+#endif
+ __sync_fetch_and_sub(&u8, 0x80);
+ __sync_fetch_and_sub_1(&u8, 0x80);
+ __sync_fetch_and_sub_2(&u16, 0x80);
+ __sync_fetch_and_sub_4(&u32, 0x80);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_fetch_and_sub_8(&u64, 0x80);
+#endif
+ __sync_fetch_and_xor(&u8, 0x80);
+ __sync_fetch_and_xor_1(&u8, 0x80);
+ __sync_fetch_and_xor_2(&u16, 0x80);
+ __sync_fetch_and_xor_4(&u32, 0x80);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_fetch_and_xor_8(&u64, 0x80);
+#endif
+ __sync_lock_release(&u8);
+ __sync_lock_release_1(&u8);
+ __sync_lock_release_2(&u16);
+ __sync_lock_release_4(&u32);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_lock_release_8(&u64);
+#endif
+ __sync_lock_test_and_set(&u8, 5);
+ __sync_lock_test_and_set_1(&u8, 5);
+ __sync_lock_test_and_set_2(&u16, 5);
+ __sync_lock_test_and_set_4(&u32, 5);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_lock_test_and_set_8(&u64, 5);
+#endif
+#ifndef __clang__
+ __sync_nand_and_fetch(&u8, 5);
+ __sync_nand_and_fetch_1(&u8, 5);
+ __sync_nand_and_fetch_2(&u16, 5);
+ __sync_nand_and_fetch_4(&u32, 5);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_nand_and_fetch_8(&u64, 5);
+#endif
+#endif
+ __sync_or_and_fetch(&u8, 5);
+ __sync_or_and_fetch_1(&u8, 5);
+ __sync_or_and_fetch_2(&u16, 5);
+ __sync_or_and_fetch_4(&u32, 5);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_or_and_fetch_8(&u64, 5);
+#endif
+ __sync_sub_and_fetch(&u8, 5);
+ __sync_sub_and_fetch_1(&u8, 5);
+ __sync_sub_and_fetch_2(&u16, 5);
+ __sync_sub_and_fetch_4(&u32, 5);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_sub_and_fetch_8(&u64, 5);
+#endif
+ __sync_val_compare_and_swap(&u8, 5, 9);
+ __sync_val_compare_and_swap_1(&u8, 5, 9);
+ __sync_val_compare_and_swap_2(&u16, 5, 9);
+ __sync_val_compare_and_swap_4(&u32, 5, 9);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_val_compare_and_swap_8(&u64, 5, 9);
+#endif
+ __sync_xor_and_fetch(&u8, 5);
+ __sync_xor_and_fetch_1(&u8, 5);
+ __sync_xor_and_fetch_2(&u16, 5);
+ __sync_xor_and_fetch_4(&u32, 5);
+#ifdef __HAVE_ATOMIC64_OPS
+ __sync_xor_and_fetch_8(&u64, 5);
+#endif
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_access.c b/contrib/netbsd-tests/lib/libc/sys/t_access.c
new file mode 100644
index 0000000..f15afc2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_access.c
@@ -0,0 +1,210 @@
+/* $NetBSD: t_access.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_access.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+static const char path[] = "access";
+static const int mode[4] = { R_OK, W_OK, X_OK, F_OK };
+
+ATF_TC_WITH_CLEANUP(access_access);
+ATF_TC_HEAD(access_access, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test access(2) for EACCES");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(access_access, tc)
+{
+ const int perm[3] = { 0200, 0400, 0000 };
+ size_t i;
+ int fd;
+
+ fd = open(path, O_RDONLY | O_CREAT);
+
+ if (fd < 0)
+ return;
+
+ for (i = 0; i < __arraycount(mode) - 1; i++) {
+
+ ATF_REQUIRE(fchmod(fd, perm[i]) == 0);
+
+ errno = 0;
+
+ ATF_REQUIRE(access(path, mode[i]) != 0);
+ ATF_REQUIRE(errno == EACCES);
+ }
+
+ ATF_REQUIRE(close(fd) == 0);
+}
+
+ATF_TC_CLEANUP(access_access, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(access_fault);
+ATF_TC_HEAD(access_fault, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test access(2) for EFAULT");
+}
+
+ATF_TC_BODY(access_fault, tc)
+{
+ size_t i;
+
+ for (i = 0; i < __arraycount(mode); i++) {
+
+ errno = 0;
+
+ ATF_REQUIRE(access(NULL, mode[i]) != 0);
+ ATF_REQUIRE(errno == EFAULT);
+
+ errno = 0;
+
+ ATF_REQUIRE(access((char *)-1, mode[i]) != 0);
+ ATF_REQUIRE(errno == EFAULT);
+ }
+}
+
+ATF_TC(access_inval);
+ATF_TC_HEAD(access_inval, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test access(2) for EINVAL");
+}
+
+ATF_TC_BODY(access_inval, tc)
+{
+
+ errno = 0;
+
+ ATF_REQUIRE(access("/usr", -1) != 0);
+ ATF_REQUIRE(errno == EINVAL);
+}
+
+ATF_TC(access_notdir);
+ATF_TC_HEAD(access_notdir, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test access(2) for ENOTDIR");
+}
+
+ATF_TC_BODY(access_notdir, tc)
+{
+ size_t i;
+
+ for (i = 0; i < __arraycount(mode); i++) {
+
+ errno = 0;
+
+ /*
+ * IEEE Std 1003.1-2008 about ENOTDIR:
+ *
+ * "A component of the path prefix is not a directory,
+ * or the path argument contains at least one non-<slash>
+ * character and ends with one or more trailing <slash>
+ * characters and the last pathname component names an
+ * existing file that is neither a directory nor a symbolic
+ * link to a directory."
+ */
+ ATF_REQUIRE(access("/etc/passwd//", mode[i]) != 0);
+ ATF_REQUIRE(errno == ENOTDIR);
+ }
+}
+
+ATF_TC(access_notexist);
+ATF_TC_HEAD(access_notexist, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test access(2) for ENOENT");
+}
+
+ATF_TC_BODY(access_notexist, tc)
+{
+ size_t i;
+
+ for (i = 0; i < __arraycount(mode); i++) {
+
+ errno = 0;
+
+ ATF_REQUIRE(access("", mode[i]) != 0);
+ ATF_REQUIRE(errno == ENOENT);
+ }
+}
+
+ATF_TC(access_toolong);
+ATF_TC_HEAD(access_toolong, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test access(2) for ENAMETOOLONG");
+}
+
+ATF_TC_BODY(access_toolong, tc)
+{
+ char *buf;
+ size_t i;
+
+ buf = malloc(PATH_MAX);
+
+ if (buf == NULL)
+ return;
+
+ for (i = 0; i < PATH_MAX; i++)
+ buf[i] = 'x';
+
+ for (i = 0; i < __arraycount(mode); i++) {
+
+ errno = 0;
+
+ ATF_REQUIRE(access(buf, mode[i]) != 0);
+ ATF_REQUIRE(errno == ENAMETOOLONG);
+ }
+
+ free(buf);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, access_access);
+ ATF_TP_ADD_TC(tp, access_fault);
+ ATF_TP_ADD_TC(tp, access_inval);
+ ATF_TP_ADD_TC(tp, access_notdir);
+ ATF_TP_ADD_TC(tp, access_notexist);
+ ATF_TP_ADD_TC(tp, access_toolong);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_chroot.c b/contrib/netbsd-tests/lib/libc/sys/t_chroot.c
new file mode 100644
index 0000000..ce71708
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_chroot.c
@@ -0,0 +1,313 @@
+/* $NetBSD: t_chroot.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_chroot.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+ATF_TC(chroot_basic);
+ATF_TC_HEAD(chroot_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of chroot(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(chroot_basic, tc)
+{
+ char buf[PATH_MAX];
+ int fd, sta;
+ pid_t pid;
+
+ (void)memset(buf, '\0', sizeof(buf));
+ (void)getcwd(buf, sizeof(buf));
+ (void)strlcat(buf, "/dir", sizeof(buf));
+
+ ATF_REQUIRE(mkdir(buf, 0500) == 0);
+ ATF_REQUIRE(chdir(buf) == 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (chroot(buf) != 0)
+ _exit(EXIT_FAILURE);
+
+ errno = 0;
+
+ if (chroot("/root") != -1)
+ _exit(EXIT_FAILURE);
+
+ if (errno != ENOENT)
+ _exit(EXIT_FAILURE);
+
+ fd = open("file", O_RDONLY | O_CREAT, 0600);
+
+ if (fd < 0)
+ _exit(EXIT_FAILURE);
+
+ if (close(fd) != 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("chroot(2) failed");
+
+ (void)chdir("/");
+ (void)strlcat(buf, "/file", sizeof(buf));
+
+ fd = open(buf, O_RDONLY);
+
+ if (fd < 0)
+ atf_tc_fail("chroot(2) did not change the root directory");
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(buf) == 0);
+}
+
+ATF_TC(chroot_err);
+ATF_TC_HEAD(chroot_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of chroot(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(chroot_err, tc)
+{
+ char buf[PATH_MAX + 1];
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, chroot(buf) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, chroot((void *)-1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, chroot("/a/b/c/d/e/f/g/h/i/j") == -1);
+}
+
+ATF_TC(chroot_perm);
+ATF_TC_HEAD(chroot_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with chroot(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(chroot_perm, tc)
+{
+ static char buf[LINE_MAX];
+ pid_t pid;
+ int sta;
+
+ (void)memset(buf, '\0', sizeof(buf));
+ ATF_REQUIRE(getcwd(buf, sizeof(buf)) != NULL);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ errno = 0;
+
+ if (chroot(buf) != -1)
+ _exit(EXIT_FAILURE);
+
+ if (errno != EPERM)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("chroot(2) succeeded as unprivileged user");
+}
+
+ATF_TC(fchroot_basic);
+ATF_TC_HEAD(fchroot_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of fchroot(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(fchroot_basic, tc)
+{
+ char buf[PATH_MAX];
+ int fd, sta;
+ pid_t pid;
+
+ (void)memset(buf, '\0', sizeof(buf));
+ (void)getcwd(buf, sizeof(buf));
+ (void)strlcat(buf, "/dir", sizeof(buf));
+
+ ATF_REQUIRE(mkdir(buf, 0500) == 0);
+ ATF_REQUIRE(chdir(buf) == 0);
+
+ fd = open(buf, O_RDONLY);
+ ATF_REQUIRE(fd >= 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (fchroot(fd) != 0)
+ _exit(EXIT_FAILURE);
+
+ if (close(fd) != 0)
+ _exit(EXIT_FAILURE);
+
+ fd = open("file", O_RDONLY | O_CREAT, 0600);
+
+ if (fd < 0)
+ _exit(EXIT_FAILURE);
+
+ if (close(fd) != 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("fchroot(2) failed");
+
+ (void)chdir("/");
+ (void)strlcat(buf, "/file", sizeof(buf));
+
+ fd = open(buf, O_RDONLY);
+
+ if (fd < 0)
+ atf_tc_fail("fchroot(2) did not change the root directory");
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(buf) == 0);
+}
+
+ATF_TC(fchroot_err);
+ATF_TC_HEAD(fchroot_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of fchroot(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(fchroot_err, tc)
+{
+ int fd;
+
+ fd = open("/etc/passwd", O_RDONLY);
+ ATF_REQUIRE(fd >= 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, fchroot(-1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOTDIR, fchroot(fd) == -1);
+
+ ATF_REQUIRE(close(fd) == 0);
+}
+
+ATF_TC(fchroot_perm);
+ATF_TC_HEAD(fchroot_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with fchroot(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(fchroot_perm, tc)
+{
+ static char buf[LINE_MAX];
+ struct passwd *pw;
+ int fd, sta;
+ pid_t pid;
+
+ (void)memset(buf, '\0', sizeof(buf));
+ ATF_REQUIRE(getcwd(buf, sizeof(buf)) != NULL);
+
+ pw = getpwnam("nobody");
+ fd = open(buf, O_RDONLY);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(pw != NULL);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ (void)setuid(pw->pw_uid);
+
+ errno = 0;
+
+ if (fchroot(fd) != -1)
+ _exit(EXIT_FAILURE);
+
+ if (errno != EPERM)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("fchroot(2) succeeded as unprivileged user");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, chroot_basic);
+ ATF_TP_ADD_TC(tp, chroot_err);
+ ATF_TP_ADD_TC(tp, chroot_perm);
+ ATF_TP_ADD_TC(tp, fchroot_basic);
+ ATF_TP_ADD_TC(tp, fchroot_err);
+ ATF_TP_ADD_TC(tp, fchroot_perm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c b/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c
new file mode 100644
index 0000000..69890fd
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c
@@ -0,0 +1,212 @@
+/* $NetBSD: t_clock_gettime.c,v 1.1 2011/10/15 06:42:16 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank Kardel.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 2006 Frank Kardel
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_clock_gettime.c,v 1.1 2011/10/15 06:42:16 jruoho Exp $");
+
+#include <sys/param.h>
+#include <sys/sysctl.h>
+
+#include <machine/int_limits.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "../../../h_macros.h"
+
+#define MINPOSDIFF 15000000 /* 15 ms for now */
+#define TIMEOUT 5
+
+#define TC_HARDWARE "kern.timecounter.hardware"
+#define TC_CHOICE "kern.timecounter.choice"
+
+static void
+check_timecounter(void)
+{
+ struct timespec tsa, tsb, tsl, res;
+ long long mindiff = INTMAX_MAX;
+ time_t endlimit;
+
+#define CL(x) \
+ do { \
+ if ((x) != -1) \
+ break; \
+ atf_tc_fail_nonfatal("%s: %s", #x, strerror(errno)); \
+ return; \
+ } while (0)
+
+ CL(clock_gettime(CLOCK_REALTIME, &tsa));
+ tsl = tsa;
+
+ CL(time(&endlimit));
+ endlimit += TIMEOUT + 1;
+
+ while ((time_t)tsa.tv_sec < endlimit) {
+ long long diff;
+
+ CL(clock_gettime(CLOCK_REALTIME, &tsb));
+ diff = 1000000000LL * (tsb.tv_sec - tsa.tv_sec)
+ + tsb.tv_nsec - tsa.tv_nsec;
+
+ if (diff > 0 && mindiff > diff)
+ mindiff = diff;
+
+ if (diff < 0 || diff > MINPOSDIFF) {
+ long long elapsed;
+ (void)printf("%stime TSA: 0x%jx.%08jx, TSB: 0x%jx.%08jx, "
+ "diff = %lld nsec, ", (diff < 0) ? "BAD " : "",
+ (uintmax_t)tsa.tv_sec, (uintmax_t)tsa.tv_nsec,
+ (uintmax_t)tsb.tv_sec, (uintmax_t)tsb.tv_nsec, diff);
+
+ elapsed = 1000000000LL * (tsb.tv_sec - tsl.tv_sec)
+ + tsb.tv_nsec - tsl.tv_nsec;
+
+
+ (void)printf("%lld nsec\n", elapsed);
+ tsl = tsb;
+
+ ATF_CHECK(diff >= 0);
+ if (diff < 0)
+ return;
+ }
+
+ tsa.tv_sec = tsb.tv_sec;
+ tsa.tv_nsec = tsb.tv_nsec;
+ }
+
+ if (clock_getres(CLOCK_REALTIME, &res) == 0) {
+ long long r = res.tv_sec * 1000000000 + res.tv_nsec;
+
+ (void)printf("Claimed resolution: %lld nsec (%f Hz) or "
+ "better\n", r, 1.0 / r * 1e9);
+ (void)printf("Observed minimum non zero delta: %lld "
+ "nsec\n", mindiff);
+ }
+
+#undef CL
+}
+
+ATF_TC(clock_gettime_real);
+ATF_TC_HEAD(clock_gettime_real, tc)
+{
+ atf_tc_set_md_var(tc, "require.user", "root");
+ atf_tc_set_md_var(tc, "descr",
+ "Checks the monotonicity of the CLOCK_REALTIME implementation");
+ atf_tc_set_md_var(tc, "timeout", "300");
+}
+
+ATF_TC_BODY(clock_gettime_real, tc)
+{
+ char name[128], cbuf[512], ctrbuf[10240];
+ size_t cbufsiz = sizeof(cbuf);
+ size_t ctrbufsiz = sizeof(ctrbuf);
+ const char *p;
+ char *save;
+ int quality, n;
+
+ if (sysctlbyname(TC_HARDWARE, cbuf, &cbufsiz, NULL, 0) != 0) {
+ (void)printf("\nChecking legacy time implementation "
+ "for %d seconds\n", TIMEOUT);
+ check_timecounter();
+ return;
+ /* NOTREACHED */
+ }
+ (void)printf("%s = %s\n", TC_HARDWARE, cbuf);
+ REQUIRE_LIBC(save = strdup(cbuf), NULL);
+
+ RL(sysctlbyname(TC_CHOICE, ctrbuf, &ctrbufsiz, NULL, 0));
+ (void)printf("%s = %s\n", TC_CHOICE, ctrbuf);
+
+ for (p = ctrbuf, n = 0; sscanf(p, "%127[^(](q=%d, f=%*u Hz)%*[ ]%n",
+ name, &quality, &n) == 2; p += n) {
+ struct timespec ts;
+ int ret;
+
+ if (quality < 0)
+ continue;
+
+ (void)printf("\nChecking %s for %d seconds\n", name, TIMEOUT);
+ CHECK_LIBC(ret = sysctlbyname(TC_HARDWARE, NULL, 0,
+ name, strlen(name)), -1);
+ if (ret == -1)
+ continue;
+
+ /* wait a bit to select new counter in clockinterrupt */
+ ts.tv_sec = 0;
+ ts.tv_nsec = 100000000;
+ (void)nanosleep(&ts, NULL);
+
+ check_timecounter();
+ }
+
+ RL(sysctlbyname(TC_HARDWARE, NULL, 0, save, strlen(save)));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, clock_gettime_real);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_clone.c b/contrib/netbsd-tests/lib/libc/sys/t_clone.c
new file mode 100644
index 0000000..ea33f32
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_clone.c
@@ -0,0 +1,252 @@
+/* $NetBSD: t_clone.c,v 1.3 2011/12/12 20:55:44 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_clone.c,v 1.3 2011/12/12 20:55:44 joerg Exp $");
+
+#include <sys/mman.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <sched.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#define STACKSIZE (8 * 1024)
+#define FROBVAL 41973
+#define CHILDEXIT 0xa5
+
+static int
+dummy(void *arg)
+{
+
+ return 0;
+}
+
+static int
+clone_func(void *arg)
+{
+ long *frobp = arg, diff;
+
+ printf("child: stack ~= %p, frobme = %p\n", &frobp, frobp);
+ fflush(stdout);
+
+ if (frobp[0] != getppid())
+ return 1;
+
+ if (frobp[0] == getpid())
+ return 2;
+
+ diff = labs(frobp[1] - (long) &frobp);
+
+ if (diff > 1024)
+ return 3;
+
+ frobp[1] = FROBVAL;
+
+ return (CHILDEXIT);
+}
+
+ATF_TC(clone_basic);
+ATF_TC_HEAD(clone_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks clone(2)");
+}
+
+ATF_TC_BODY(clone_basic, tc)
+{
+ sigset_t mask;
+ void *allocstack, *stack;
+ pid_t pid;
+ volatile long frobme[2];
+ int stat;
+
+ allocstack = mmap(NULL, STACKSIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
+ MAP_PRIVATE|MAP_ANON, -1, (off_t) 0);
+
+ ATF_REQUIRE_ERRNO(errno, allocstack != MAP_FAILED);
+
+ stack = allocstack;
+#ifndef __MACHINE_STACK_GROWS_UP
+ stack = (char *)stack + STACKSIZE;
+#endif
+
+ printf("parent: stack = %p, frobme = %p\n", stack, frobme);
+ fflush(stdout);
+
+ frobme[0] = (long)getpid();
+ frobme[1] = (long)stack;
+
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGUSR1);
+
+ ATF_REQUIRE_ERRNO(errno, sigprocmask(SIG_BLOCK, &mask, NULL) != -1);
+
+ switch (pid = __clone(clone_func, stack,
+ CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|SIGUSR1,
+ __UNVOLATILE(frobme))) {
+ case 0:
+ atf_tc_fail("clone() returned 0");
+ /*NOTREACHED*/
+ case -1:
+ atf_tc_fail("clone() failed: %s", strerror(errno));
+ /*NOTREACHED*/
+ default:
+ while (waitpid(pid, &stat, __WCLONE) != pid)
+ continue;
+ }
+
+ ATF_REQUIRE_MSG(WIFEXITED(stat) != 0, "child didn't exit");
+
+ printf("parent: childexit = 0x%x, frobme = %ld\n",
+ WEXITSTATUS(stat), frobme[1]);
+
+ switch (WEXITSTATUS(stat)) {
+ case CHILDEXIT:
+ ATF_REQUIRE_EQ(frobme[1], FROBVAL);
+ break;
+ case 1:
+ atf_tc_fail("child: argument does not contain parent's pid");
+ /*NOTREACHED*/
+ case 2:
+ atf_tc_fail("child: called in parent's pid");
+ /*NOTREACHED*/
+ case 3:
+ atf_tc_fail("child: called with bad stack");
+ /*NOTREACHED*/
+ default:
+ atf_tc_fail("child returned unknown code: %d",
+ WEXITSTATUS(stat));
+ /*NOTREACHED*/
+ }
+
+ ATF_REQUIRE_ERRNO(errno, munmap(allocstack, STACKSIZE) != -1);
+}
+
+ATF_TC(clone_null_stack);
+ATF_TC_HEAD(clone_null_stack, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that clone(2) fails when stack pointer is NULL");
+}
+
+ATF_TC_BODY(clone_null_stack, tc)
+{
+ int rv;
+
+ rv = __clone(dummy, NULL,
+ CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|SIGCHLD, NULL);
+
+ ATF_REQUIRE_EQ(rv, -1);
+ ATF_REQUIRE_EQ(errno, EINVAL);
+}
+
+ATF_TC(clone_null_func);
+ATF_TC_HEAD(clone_null_func, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that clone(2) fails when function pointer is NULL");
+}
+
+ATF_TC_BODY(clone_null_func, tc)
+{
+ void *allocstack, *stack;
+ int rv;
+
+ allocstack = mmap(NULL, STACKSIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
+ MAP_PRIVATE|MAP_ANON, -1, (off_t) 0);
+ ATF_REQUIRE_ERRNO(errno, allocstack != MAP_FAILED);
+ stack = allocstack;
+#ifndef __MACHINE_STACK_GROWS_UP
+ stack = (char *)stack + STACKSIZE;
+#endif
+
+ errno = 0;
+ rv = __clone(0, stack,
+ CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|SIGCHLD, NULL);
+
+ ATF_REQUIRE_EQ(rv, -1);
+ ATF_REQUIRE_EQ(errno, EINVAL);
+
+ ATF_REQUIRE_ERRNO(errno, munmap(allocstack, STACKSIZE) != -1);
+}
+
+ATF_TC(clone_out_of_proc);
+ATF_TC_HEAD(clone_out_of_proc, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that clone(2) fails when running out of processes");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(clone_out_of_proc, tc)
+{
+ struct rlimit rl;
+ int rv;
+
+ ATF_REQUIRE_ERRNO(errno, getrlimit(RLIMIT_NPROC, &rl) != -1);
+
+ rl.rlim_cur = 0;
+ rl.rlim_max = 0;
+
+ ATF_REQUIRE_ERRNO(errno, setrlimit(RLIMIT_NPROC, &rl) != -1);
+
+ errno = 0;
+ rv = __clone(dummy, malloc(10240),
+ CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|SIGCHLD, (void *)&rl);
+
+ ATF_REQUIRE_EQ(rv, -1);
+ ATF_REQUIRE_EQ(errno, EAGAIN);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, clone_basic);
+ ATF_TP_ADD_TC(tp, clone_null_stack);
+ ATF_TP_ADD_TC(tp, clone_null_func);
+ ATF_TP_ADD_TC(tp, clone_out_of_proc);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_connect.c b/contrib/netbsd-tests/lib/libc/sys/t_connect.c
new file mode 100644
index 0000000..d161ee3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_connect.c
@@ -0,0 +1,99 @@
+/* $NetBSD: t_connect.c,v 1.1 2011/11/05 18:19:02 jruoho Exp $ */
+/*
+ * Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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 <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+#include <atf-c.h>
+
+ATF_TC(connect_low_port);
+ATF_TC_HEAD(connect_low_port, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that low-port allocation "
+ "works");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(connect_low_port, tc)
+{
+ struct sockaddr_in sin, sinlist;
+ int sd, val, slist;
+ socklen_t slen;
+
+ slist = socket(AF_INET, SOCK_STREAM, 0);
+ sd = socket(AF_INET, SOCK_STREAM, 0);
+
+ /* bind listening socket */
+ memset(&sinlist, 0, sizeof(sinlist));
+ sinlist.sin_family = AF_INET;
+ sinlist.sin_port = htons(31522);
+ sinlist.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+ ATF_REQUIRE_EQ(bind(slist,
+ (struct sockaddr *)&sinlist, sizeof(sinlist)), 0);
+ ATF_REQUIRE_EQ(listen(slist, 1), 0);
+
+ val = IP_PORTRANGE_LOW;
+ if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE, &val,
+ sizeof(val)) == -1)
+ atf_tc_fail("setsockopt failed: %s", strerror(errno));
+
+ memset(&sin, 0, sizeof(sin));
+
+ sin.sin_port = htons(31522);
+ sin.sin_addr.s_addr = inet_addr("127.0.0.1");
+ sin.sin_family = AF_INET;
+
+ if (connect(sd, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
+ int serrno = errno;
+ atf_tc_fail("connect failed: %s%s",
+ strerror(serrno),
+ serrno != EACCES ? "" :
+ " (see http://mail-index.netbsd.org/"
+ "source-changes/2007/12/16/0011.html)");
+ }
+
+ slen = sizeof(sin);
+ ATF_REQUIRE_EQ(getsockname(sd, (struct sockaddr *)&sin, &slen), 0);
+ ATF_REQUIRE_EQ(slen, sizeof(sin));
+ ATF_REQUIRE(ntohs(sin.sin_port) <= IPPORT_RESERVEDMAX);
+
+ close(sd);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, connect_low_port);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_dup.c b/contrib/netbsd-tests/lib/libc/sys/t_dup.c
new file mode 100644
index 0000000..a2623c0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_dup.c
@@ -0,0 +1,385 @@
+/* $NetBSD: t_dup.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_dup.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $");
+
+#include <sys/resource.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sysexits.h>
+
+static char path[] = "dup";
+static void check_mode(bool, bool, bool);
+
+static void
+check_mode(bool _dup, bool _dup2, bool _dup3)
+{
+ int mode[3] = { O_RDONLY, O_WRONLY, O_RDWR };
+ int perm[5] = { 0700, 0400, 0600, 0444, 0666 };
+ struct stat st, st1;
+ int fd, fd1, fd2;
+ size_t i, j;
+
+ /*
+ * Check that a duplicated descriptor
+ * retains the mode of the original file.
+ */
+ for (i = 0; i < __arraycount(mode); i++) {
+
+ for (j = 0; j < __arraycount(perm); j++) {
+
+ fd1 = open(path, mode[i] | O_CREAT, perm[j]);
+ fd2 = open("/etc/passwd", O_RDONLY);
+
+ ATF_REQUIRE(fd1 >= 0);
+ ATF_REQUIRE(fd2 >= 0);
+
+ if (_dup != false)
+ fd = dup(fd1);
+ else if (_dup2 != false)
+ fd = dup2(fd1, fd2);
+ else if (_dup3 != false)
+ fd = dup3(fd1, fd2, O_CLOEXEC);
+ else {
+ fd = -1;
+ }
+
+ ATF_REQUIRE(fd >= 0);
+
+ (void)memset(&st, 0, sizeof(struct stat));
+ (void)memset(&st1, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(fstat(fd, &st) == 0);
+ ATF_REQUIRE(fstat(fd1, &st1) == 0);
+
+ if (st.st_mode != st1.st_mode)
+ atf_tc_fail("invalid mode");
+
+ (void)close(fd);
+ (void)close(fd1);
+ (void)close(fd2);
+ (void)unlink(path);
+ }
+ }
+}
+
+ATF_TC(dup2_basic);
+ATF_TC_HEAD(dup2_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of dup2(2)");
+}
+
+ATF_TC_BODY(dup2_basic, tc)
+{
+ int fd, fd1, fd2;
+
+ fd1 = open("/etc/passwd", O_RDONLY);
+ fd2 = open("/etc/passwd", O_RDONLY);
+
+ ATF_REQUIRE(fd1 >= 0);
+ ATF_REQUIRE(fd2 >= 0);
+
+ fd = dup2(fd1, fd2);
+ ATF_REQUIRE(fd >= 0);
+
+ if (fd != fd2)
+ atf_tc_fail("invalid descriptor");
+
+ (void)close(fd);
+ (void)close(fd1);
+
+ ATF_REQUIRE(close(fd2) != 0);
+}
+
+ATF_TC(dup2_err);
+ATF_TC_HEAD(dup2_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of dup2(2)");
+}
+
+ATF_TC_BODY(dup2_err, tc)
+{
+ int fd;
+
+ fd = open("/etc/passwd", O_RDONLY);
+ ATF_REQUIRE(fd >= 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup2(-1, -1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup2(fd, -1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup2(-1, fd) == -1);
+
+ /*
+ * Note that this should not fail with EINVAL.
+ */
+ ATF_REQUIRE(dup2(fd, fd) != -1);
+
+ (void)close(fd);
+}
+
+ATF_TC(dup2_max);
+ATF_TC_HEAD(dup2_max, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test dup2(2) against limits");
+}
+
+ATF_TC_BODY(dup2_max, tc)
+{
+ struct rlimit res;
+
+ (void)memset(&res, 0, sizeof(struct rlimit));
+ (void)getrlimit(RLIMIT_NOFILE, &res);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup2(STDERR_FILENO, res.rlim_cur + 1) == -1);
+}
+
+ATF_TC_WITH_CLEANUP(dup2_mode);
+ATF_TC_HEAD(dup2_mode, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of dup2(2)");
+}
+
+ATF_TC_BODY(dup2_mode, tc)
+{
+ check_mode(false, true, false);
+}
+
+ATF_TC_CLEANUP(dup2_mode, tc)
+{
+ (void)unlink(path);
+}
+
+
+ATF_TC(dup3_err);
+ATF_TC_HEAD(dup3_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test error conditions of dup3(2) (PR lib/45148)");
+}
+
+ATF_TC_BODY(dup3_err, tc)
+{
+ int fd;
+
+ fd = open("/etc/passwd", O_RDONLY);
+ ATF_REQUIRE(fd >= 0);
+
+ errno = 0;
+ ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) != -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup3(-1, -1, O_CLOEXEC) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup3(fd, -1, O_CLOEXEC) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup3(-1, fd, O_CLOEXEC) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, dup3(fd, 1, O_NOFOLLOW) == -1);
+
+ (void)close(fd);
+}
+
+ATF_TC(dup3_max);
+ATF_TC_HEAD(dup3_max, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test dup3(2) against limits");
+}
+
+ATF_TC_BODY(dup3_max, tc)
+{
+ struct rlimit res;
+
+ (void)memset(&res, 0, sizeof(struct rlimit));
+ (void)getrlimit(RLIMIT_NOFILE, &res);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup3(STDERR_FILENO,
+ res.rlim_cur + 1, O_CLOEXEC) == -1);
+}
+
+ATF_TC_WITH_CLEANUP(dup3_mode);
+ATF_TC_HEAD(dup3_mode, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of dup3(2)");
+}
+
+ATF_TC_BODY(dup3_mode, tc)
+{
+ check_mode(false, false, true);
+}
+
+ATF_TC_CLEANUP(dup3_mode, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(dup_err);
+ATF_TC_HEAD(dup_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of dup(2)");
+}
+
+ATF_TC_BODY(dup_err, tc)
+{
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, dup(-1) == -1);
+}
+
+ATF_TC_WITH_CLEANUP(dup_max);
+ATF_TC_HEAD(dup_max, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test dup(2) against limits");
+}
+
+ATF_TC_BODY(dup_max, tc)
+{
+ struct rlimit res;
+ int *buf, fd, sta;
+ size_t i, n;
+ pid_t pid;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ /*
+ * Open a temporary file until the
+ * maximum number of open files is
+ * reached. Ater that dup(2) family
+ * should fail with EMFILE.
+ */
+ (void)closefrom(0);
+ (void)memset(&res, 0, sizeof(struct rlimit));
+
+ n = 10;
+ res.rlim_cur = res.rlim_max = n;
+ if (setrlimit(RLIMIT_NOFILE, &res) != 0)
+ _exit(EX_OSERR);
+
+ buf = calloc(n, sizeof(int));
+
+ if (buf == NULL)
+ _exit(EX_OSERR);
+
+ buf[0] = mkstemp(path);
+
+ if (buf[0] < 0)
+ _exit(EX_OSERR);
+
+ for (i = 1; i < n; i++) {
+
+ buf[i] = open(path, O_RDONLY);
+
+ if (buf[i] < 0)
+ _exit(EX_OSERR);
+ }
+
+ errno = 0;
+ fd = dup(buf[0]);
+
+ if (fd != -1 || errno != EMFILE)
+ _exit(EX_DATAERR);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS) {
+
+ if (WEXITSTATUS(sta) == EX_OSERR)
+ atf_tc_fail("system call error");
+
+ if (WEXITSTATUS(sta) == EX_DATAERR)
+ atf_tc_fail("dup(2) dupped more than RLIMIT_NOFILE");
+
+ atf_tc_fail("unknown error");
+ }
+
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(dup_max, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(dup_mode);
+ATF_TC_HEAD(dup_mode, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of dup(2)");
+}
+
+ATF_TC_BODY(dup_mode, tc)
+{
+ check_mode(true, false, false);
+}
+
+ATF_TC_CLEANUP(dup_mode, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, dup2_basic);
+ ATF_TP_ADD_TC(tp, dup2_err);
+ ATF_TP_ADD_TC(tp, dup2_max);
+ ATF_TP_ADD_TC(tp, dup2_mode);
+ ATF_TP_ADD_TC(tp, dup3_err);
+ ATF_TP_ADD_TC(tp, dup3_max);
+ ATF_TP_ADD_TC(tp, dup3_mode);
+ ATF_TP_ADD_TC(tp, dup_err);
+ ATF_TP_ADD_TC(tp, dup_max);
+ ATF_TP_ADD_TC(tp, dup_mode);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_fsync.c b/contrib/netbsd-tests/lib/libc/sys/t_fsync.c
new file mode 100644
index 0000000..e61ea7e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_fsync.c
@@ -0,0 +1,120 @@
+/* $NetBSD: t_fsync.c,v 1.2 2012/03/18 07:00:52 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_fsync.c,v 1.2 2012/03/18 07:00:52 jruoho Exp $");
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+ATF_TC(fsync_err);
+ATF_TC_HEAD(fsync_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test error conditions of fsync(2) (PR kern/30)");
+}
+
+ATF_TC_BODY(fsync_err, tc)
+{
+ int i, fd[2];
+
+ /*
+ * The fsync(2) call should fail with EBADF
+ * when the 'fd' is not a valid descriptor.
+ */
+ for (i = 1; i < 1024; i = i + 128) {
+
+ errno = 0;
+
+ ATF_REQUIRE(fsync(-i) == -1);
+ ATF_REQUIRE(errno == EBADF);
+ }
+
+ /*
+ * On the other hand, EINVAL should follow
+ * if the operation is not possible with
+ * the file descriptor.
+ */
+ ATF_REQUIRE(pipe(fd) == 0);
+
+ errno = 0;
+
+ ATF_REQUIRE(fsync(fd[0]) == -1);
+ ATF_REQUIRE(errno == EINVAL);
+
+ errno = 0;
+
+ ATF_REQUIRE(fsync(fd[1]) == -1);
+ ATF_REQUIRE(errno == EINVAL);
+
+ ATF_REQUIRE(close(fd[0]) == 0);
+ ATF_REQUIRE(close(fd[1]) == 0);
+}
+
+ATF_TC(fsync_sync);
+ATF_TC_HEAD(fsync_sync, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of fsync(2)");
+}
+
+ATF_TC_BODY(fsync_sync, tc)
+{
+ char buf[128];
+ int fd, i;
+
+ for (i = 0; i < 10; i++) {
+
+ (void)snprintf(buf, sizeof(buf), "t_fsync-%d", i);
+
+ fd = mkstemp(buf);
+
+ ATF_REQUIRE(fd != -1);
+ ATF_REQUIRE(write(fd, "0", 1) == 1);
+ ATF_REQUIRE(fsync(fd) == 0);
+
+ ATF_REQUIRE(unlink(buf) == 0);
+ ATF_REQUIRE(close(fd) == 0);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fsync_err);
+ ATF_TP_ADD_TC(tp, fsync_sync);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c b/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
new file mode 100644
index 0000000..3a2d9f7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
@@ -0,0 +1,129 @@
+/* $NetBSD: t_getcontext.c,v 1.3 2011/07/14 04:59:14 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_getcontext.c,v 1.3 2011/07/14 04:59:14 jruoho Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <ucontext.h>
+
+#define STACKSZ (10*1024)
+#define DEPTH 3
+
+static int calls;
+
+static void
+run(int n, ...)
+{
+ va_list va;
+ int i, ia;
+
+ ATF_REQUIRE_EQ(n, DEPTH - calls - 1);
+
+ va_start(va, n);
+ for (i = 0; i < 9; i++) {
+ ia = va_arg(va, int);
+ ATF_REQUIRE_EQ(i, ia);
+ }
+ va_end(va);
+
+ calls++;
+}
+
+ATF_TC(getcontext_err);
+ATF_TC_HEAD(getcontext_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from getcontext(2)");
+}
+
+ATF_TC_BODY(getcontext_err, tc)
+{
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, getcontext((void *)-1) == -1);
+}
+
+ATF_TC(setcontext_err);
+ATF_TC_HEAD(setcontext_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from setcontext(2)");
+}
+
+ATF_TC_BODY(setcontext_err, tc)
+{
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, setcontext((void *)-1) == -1);
+}
+
+ATF_TC(setcontext_link);
+ATF_TC_HEAD(setcontext_link, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks get/make/setcontext(), context linking via uc_link(), "
+ "and argument passing to the new context");
+}
+
+ATF_TC_BODY(setcontext_link, tc)
+{
+ ucontext_t uc[DEPTH];
+ ucontext_t save;
+ volatile int i = 0; /* avoid longjmp clobbering */
+
+ for (i = 0; i < DEPTH; ++i) {
+ ATF_REQUIRE_EQ(getcontext(&uc[i]), 0);
+
+ uc[i].uc_stack.ss_sp = malloc(STACKSZ);
+ uc[i].uc_stack.ss_size = STACKSZ;
+ uc[i].uc_link = (i > 0) ? &uc[i - 1] : &save;
+
+ makecontext(&uc[i], (void *)run, 10, i,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8);
+ }
+
+ ATF_REQUIRE_EQ(getcontext(&save), 0);
+
+ if (calls == 0)
+ ATF_REQUIRE_EQ(setcontext(&uc[DEPTH-1]), 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getcontext_err);
+ ATF_TP_ADD_TC(tp, setcontext_err);
+ ATF_TP_ADD_TC(tp, setcontext_link);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c b/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c
new file mode 100644
index 0000000..9a8ec8e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c
@@ -0,0 +1,171 @@
+/* $NetBSD: t_getgroups.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getgroups.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+ATF_TC(getgroups_err);
+ATF_TC_HEAD(getgroups_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors in getgroups(2)");
+}
+
+ATF_TC_BODY(getgroups_err, tc)
+{
+ gid_t gidset[NGROUPS_MAX];
+
+ errno = 0;
+
+ ATF_REQUIRE(getgroups(10, (gid_t *)-1) == -1);
+ ATF_REQUIRE(errno == EFAULT);
+
+ errno = 0;
+
+ ATF_REQUIRE(getgroups(-1, gidset) == -1);
+ ATF_REQUIRE(errno == EINVAL);
+}
+
+ATF_TC(getgroups_getgid);
+ATF_TC_HEAD(getgroups_getgid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test getgid(2) from getgroups(2)");
+}
+
+ATF_TC_BODY(getgroups_getgid, tc)
+{
+ gid_t gidset[NGROUPS_MAX];
+ gid_t gid = getgid();
+ int i, n;
+
+ /*
+ * Check that getgid(2) is found from
+ * the GIDs returned by getgroups(2).
+ */
+ n = getgroups(NGROUPS_MAX, gidset);
+
+ for (i = 0; i < n; i++) {
+
+ if (gidset[i] == gid)
+ return;
+ }
+
+ atf_tc_fail("getgid(2) not found from getgroups(2)");
+}
+
+ATF_TC(getgroups_setgid);
+ATF_TC_HEAD(getgroups_setgid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setgid(2) from getgroups(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(getgroups_setgid, tc)
+{
+ gid_t gidset[NGROUPS_MAX];
+ int i, n, rv, sta;
+ pid_t pid;
+
+ /*
+ * Check that we can setgid(2)
+ * to the returned group IDs.
+ */
+ n = getgroups(NGROUPS_MAX, gidset);
+ ATF_REQUIRE(n >= 0);
+
+ for (i = 0; i < n; i++) {
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ rv = setgid(gidset[i]);
+
+ if (rv != 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("getgroups(2) is inconsistent");
+ }
+}
+
+ATF_TC(getgroups_zero);
+ATF_TC_HEAD(getgroups_zero, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test getgroups(2) with zero param");
+}
+
+ATF_TC_BODY(getgroups_zero, tc)
+{
+ const gid_t val = 123456789;
+ gid_t gidset[NGROUPS_MAX];
+ size_t i;
+
+ /*
+ * If the first parameter is zero, the number
+ * of groups should be returned but the supplied
+ * buffer should remain intact.
+ */
+ for (i = 0; i < __arraycount(gidset); i++)
+ gidset[i] = val;
+
+ ATF_REQUIRE(getgroups(0, gidset) >= 0);
+
+ for (i = 0; i < __arraycount(gidset); i++) {
+
+ if (gidset[i] != val)
+ atf_tc_fail("getgroups(2) modified the buffer");
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getgroups_err);
+ ATF_TP_ADD_TC(tp, getgroups_getgid);
+ ATF_TP_ADD_TC(tp, getgroups_setgid);
+ ATF_TP_ADD_TC(tp, getgroups_zero);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c b/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c
new file mode 100644
index 0000000..b384541
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c
@@ -0,0 +1,211 @@
+/* $NetBSD: t_getitimer.c,v 1.2 2012/03/22 18:20:46 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getitimer.c,v 1.2 2012/03/22 18:20:46 christos Exp $");
+
+#include <sys/time.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <limits.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+
+static bool fail;
+static void sighandler(int);
+
+static void
+sighandler(int signo)
+{
+
+ if (signo == SIGALRM || signo == SIGVTALRM)
+ fail = false;
+}
+
+ATF_TC(getitimer_empty);
+ATF_TC_HEAD(getitimer_empty, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "getitimer(2) before setitimer(2)");
+}
+
+ATF_TC_BODY(getitimer_empty, tc)
+{
+ struct itimerval it;
+
+ /*
+ * Verify that the passed structure remains
+ * empty after calling getitimer(2) but before
+ * actually arming the timer with setitimer(2).
+ */
+ (void)memset(&it, 0, sizeof(struct itimerval));
+
+ ATF_REQUIRE(getitimer(ITIMER_REAL, &it) == 0);
+
+ if (it.it_value.tv_sec != 0 || it.it_value.tv_usec != 0)
+ goto fail;
+
+ ATF_REQUIRE(getitimer(ITIMER_VIRTUAL, &it) == 0);
+
+ if (it.it_value.tv_sec != 0 || it.it_value.tv_usec != 0)
+ goto fail;
+
+ ATF_REQUIRE(getitimer(ITIMER_PROF, &it) == 0);
+
+ if (it.it_value.tv_sec != 0 || it.it_value.tv_usec != 0)
+ goto fail;
+
+ return;
+
+fail:
+ atf_tc_fail("getitimer(2) modfied the timer before it was armed");
+}
+
+ATF_TC(getitimer_err);
+ATF_TC_HEAD(getitimer_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from getitimer(2)");
+}
+
+ATF_TC_BODY(getitimer_err, tc)
+{
+ struct itimerval it;
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, getitimer(-1, &it) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, getitimer(INT_MAX, &it) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, getitimer(ITIMER_REAL, (void *)-1) == -1);
+}
+
+ATF_TC(setitimer_basic);
+ATF_TC_HEAD(setitimer_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of setitimer(2)");
+}
+
+ATF_TC_BODY(setitimer_basic, tc)
+{
+ struct itimerval it;
+
+ it.it_value.tv_sec = 0;
+ it.it_value.tv_usec = 100;
+
+ it.it_interval.tv_sec = 0;
+ it.it_interval.tv_usec = 0;
+
+ fail = true;
+
+ ATF_REQUIRE(signal(SIGALRM, sighandler) != SIG_ERR);
+ ATF_REQUIRE(setitimer(ITIMER_REAL, &it, NULL) == 0);
+
+ /*
+ * Although the interaction between
+ * setitimer(2) and sleep(3) can be
+ * unspecified, it is assumed that one
+ * second suspension will be enough for
+ * the timer to fire.
+ */
+ (void)sleep(1);
+
+ if (fail != false)
+ atf_tc_fail("timer did not fire");
+}
+
+ATF_TC(setitimer_err);
+ATF_TC_HEAD(setitimer_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from setitimer(2)"
+ " (PR standards/44927)");
+}
+
+ATF_TC_BODY(setitimer_err, tc)
+{
+ struct itimerval it, ot;
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, setitimer(-1, &it, &ot) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, setitimer(INT_MAX, &it, &ot) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, setitimer(ITIMER_REAL,(void*)-1, &ot) == -1);
+}
+
+ATF_TC(setitimer_old);
+ATF_TC_HEAD(setitimer_old, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test old values from setitimer(2)");
+}
+
+ATF_TC_BODY(setitimer_old, tc)
+{
+ struct itimerval it, ot;
+
+ /*
+ * Make two calls; the second one
+ * should store the old values.
+ */
+ it.it_value.tv_sec = 4;
+ it.it_value.tv_usec = 3;
+
+ it.it_interval.tv_sec = 0;
+ it.it_interval.tv_usec = 0;
+
+ ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0);
+
+ it.it_value.tv_sec = 2;
+ it.it_value.tv_usec = 1;
+
+ it.it_interval.tv_sec = 0;
+ it.it_interval.tv_usec = 0;
+
+ ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0);
+
+ if (ot.it_value.tv_sec != 4 || ot.it_value.tv_usec != 3)
+ atf_tc_fail("setitimer(2) did not store old values");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getitimer_empty);
+ ATF_TP_ADD_TC(tp, getitimer_err);
+ ATF_TP_ADD_TC(tp, setitimer_basic);
+ ATF_TP_ADD_TC(tp, setitimer_err);
+ ATF_TP_ADD_TC(tp, setitimer_old);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getlogin.c b/contrib/netbsd-tests/lib/libc/sys/t_getlogin.c
new file mode 100644
index 0000000..8c2b199
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getlogin.c
@@ -0,0 +1,237 @@
+/* $NetBSD: t_getlogin.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getlogin.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <sys/param.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+ATF_TC(getlogin_r_err);
+ATF_TC_HEAD(getlogin_r_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from getlogin_r(2)");
+}
+
+ATF_TC_BODY(getlogin_r_err, tc)
+{
+ char small[0];
+
+ ATF_REQUIRE(getlogin_r(small, sizeof(small)) == ERANGE);
+}
+
+ATF_TC(getlogin_same);
+ATF_TC_HEAD(getlogin_same, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "getlogin(2) vs. getlogin_r(2)");
+}
+
+ATF_TC_BODY(getlogin_same, tc)
+{
+ char buf[MAXLOGNAME];
+ char *str;
+
+ str = getlogin();
+
+ if (str == NULL)
+ return;
+
+ ATF_REQUIRE(getlogin_r(buf, sizeof(buf)) == 0);
+
+ if (strcmp(str, buf) != 0)
+ atf_tc_fail("getlogin(2) and getlogin_r(2) differ");
+}
+
+ATF_TC(setlogin_basic);
+ATF_TC_HEAD(setlogin_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that setlogin(2) works");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(setlogin_basic, tc)
+{
+ char *name;
+ pid_t pid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ (void)setsid();
+
+ if (setlogin("foobar") != 0)
+ _exit(EXIT_FAILURE);
+
+ name = getlogin();
+
+ if (name == NULL)
+ _exit(EXIT_FAILURE);
+
+ if (strcmp(name, "foobar") != 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("setlogin(2) failed to set login name");
+}
+
+ATF_TC(setlogin_err);
+ATF_TC_HEAD(setlogin_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from setlogin(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(setlogin_err, tc)
+{
+ char buf[MAXLOGNAME + 1];
+ char *name;
+ pid_t pid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ if (pid == 0) {
+
+ (void)setsid();
+
+ errno = 0;
+
+ if (setlogin(buf) != -1)
+ _exit(EINVAL);
+
+ if (errno != EINVAL)
+ _exit(EINVAL);
+
+ errno = 0;
+
+ if (setlogin((void *)-1) != -1)
+ _exit(EFAULT);
+
+ if (errno != EFAULT)
+ _exit(EFAULT);
+
+ name = getlogin();
+
+ if (name == NULL)
+ _exit(EXIT_FAILURE);
+
+ if (strcmp(name, "foobar") == 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS) {
+
+ if (WEXITSTATUS(sta) == EFAULT)
+ atf_tc_fail("expected EFAULT, but the call succeeded");
+
+ if (WEXITSTATUS(sta) == EINVAL)
+ atf_tc_fail("expected EINVAL, but the call succeeded");
+
+ atf_tc_fail("setlogin(2) failed, but login name was set");
+ }
+}
+
+ATF_TC(setlogin_perm);
+ATF_TC_HEAD(setlogin_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setlogin(2) as normal user");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(setlogin_perm, tc)
+{
+ char *name;
+ pid_t pid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ (void)setsid();
+
+ errno = 0;
+
+ if (setlogin("foobar") != -1)
+ _exit(EXIT_FAILURE);
+
+ if (errno != EPERM)
+ _exit(EXIT_FAILURE);
+
+ name = getlogin();
+
+ if (name == NULL)
+ _exit(EXIT_FAILURE);
+
+ if (strcmp(name, "foobar") == 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("login name was set as an unprivileged user");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getlogin_r_err);
+ ATF_TP_ADD_TC(tp, getlogin_same);
+ ATF_TP_ADD_TC(tp, setlogin_basic);
+ ATF_TP_ADD_TC(tp, setlogin_err);
+ ATF_TP_ADD_TC(tp, setlogin_perm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getpid.c b/contrib/netbsd-tests/lib/libc/sys/t_getpid.c
new file mode 100644
index 0000000..b3ed393
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getpid.c
@@ -0,0 +1,134 @@
+/* $NetBSD: t_getpid.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getpid.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+static int maxiter = 10;
+static void *threadfunc(void *);
+
+static void *
+threadfunc(void *arg)
+{
+ *(pid_t *)arg = getpid();
+
+ return NULL;
+}
+
+ATF_TC(getpid_process);
+ATF_TC_HEAD(getpid_process, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test getpid(2) with processes");
+}
+
+ATF_TC_BODY(getpid_process, tc)
+{
+ pid_t ppid, fpid, cpid, tpid, wpid;
+ int i, sta;
+
+ for (i = 0; i < maxiter; i++) {
+
+ tpid = getpid();
+ fpid = fork();
+
+ ATF_REQUIRE(fpid >= 0);
+
+ if (fpid == 0) {
+
+ cpid = getpid();
+ ppid = getppid();
+
+ if (tpid != ppid)
+ _exit(EXIT_FAILURE);
+
+ if (cpid == ppid)
+ _exit(EXIT_FAILURE);
+
+ if (tpid == fpid)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ wpid = wait(&sta);
+
+ if (wpid != fpid)
+ atf_tc_fail("PID mismatch");
+
+ ATF_REQUIRE(WIFEXITED(sta) != 0);
+
+ if (WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("PID mismatch");
+ }
+}
+
+ATF_TC(getpid_thread);
+ATF_TC_HEAD(getpid_thread, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test getpid(2) with threads");
+}
+
+ATF_TC_BODY(getpid_thread, tc)
+{
+ pid_t pid, tpid;
+ pthread_t tid;
+ int i, rv;
+
+ for (i = 0; i < maxiter; i++) {
+
+ pid = getpid();
+
+ rv = pthread_create(&tid, NULL, threadfunc, &tpid);
+ ATF_REQUIRE(rv == 0);
+
+ rv = pthread_join(tid, NULL);
+ ATF_REQUIRE(rv == 0);
+
+ if (pid != tpid)
+ atf_tc_fail("Unequal PIDs");
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getpid_process);
+ ATF_TP_ADD_TC(tp, getpid_thread);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c b/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c
new file mode 100644
index 0000000..6c4218a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c
@@ -0,0 +1,197 @@
+/* $NetBSD: t_getrusage.c,v 1.3 2014/09/03 19:24:12 matt Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getrusage.c,v 1.3 2014/09/03 19:24:12 matt Exp $");
+
+#include <sys/resource.h>
+#include <sys/time.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdint.h>
+#include <string.h>
+
+static void work(void);
+static void sighandler(int);
+
+static const size_t maxiter = 2000;
+
+static void
+sighandler(int signo)
+{
+ /* Nothing. */
+}
+
+static void
+work(void)
+{
+ size_t n = UINT16_MAX * 10;
+
+ while (n > 0) {
+#ifdef __or1k__
+ asm volatile("l.nop"); /* Do something. */
+#else
+ asm volatile("nop"); /* Do something. */
+#endif
+ n--;
+ }
+}
+
+ATF_TC(getrusage_err);
+ATF_TC_HEAD(getrusage_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions");
+}
+
+ATF_TC_BODY(getrusage_err, tc)
+{
+ struct rusage ru;
+
+ errno = 0;
+
+ ATF_REQUIRE(getrusage(INT_MAX, &ru) != 0);
+ ATF_REQUIRE(errno == EINVAL);
+
+ errno = 0;
+
+ ATF_REQUIRE(getrusage(RUSAGE_SELF, (void *)0) != 0);
+ ATF_REQUIRE(errno == EFAULT);
+}
+
+ATF_TC(getrusage_sig);
+ATF_TC_HEAD(getrusage_sig, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test signal count with getrusage(2)");
+}
+
+ATF_TC_BODY(getrusage_sig, tc)
+{
+ struct rusage ru;
+ const long n = 5;
+ int i;
+
+ /*
+ * Test that signals are recorded.
+ */
+ ATF_REQUIRE(signal(SIGUSR1, sighandler) != SIG_ERR);
+
+ for (i = 0; i < n; i++)
+ ATF_REQUIRE(raise(SIGUSR1) == 0);
+
+ (void)memset(&ru, 0, sizeof(struct rusage));
+ ATF_REQUIRE(getrusage(RUSAGE_SELF, &ru) == 0);
+
+ if (n != ru.ru_nsignals)
+ atf_tc_fail("getrusage(2) did not record signals");
+}
+
+ATF_TC(getrusage_utime_back);
+ATF_TC_HEAD(getrusage_utime_back, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test bogus values from getrusage(2)");
+}
+
+ATF_TC_BODY(getrusage_utime_back, tc)
+{
+ struct rusage ru1, ru2;
+ size_t i;
+
+ /*
+ * Test that two consecutive calls are sane.
+ */
+ atf_tc_expect_fail("PR kern/30115");
+
+ for (i = 0; i < maxiter; i++) {
+
+ (void)memset(&ru1, 0, sizeof(struct rusage));
+ (void)memset(&ru2, 0, sizeof(struct rusage));
+
+ work();
+
+ ATF_REQUIRE(getrusage(RUSAGE_SELF, &ru1) == 0);
+
+ work();
+
+ ATF_REQUIRE(getrusage(RUSAGE_SELF, &ru2) == 0);
+
+ if (timercmp(&ru2.ru_utime, &ru1.ru_utime, <) != 0)
+ atf_tc_fail("user time went backwards");
+ }
+
+ atf_tc_fail("anticipated error did not occur");
+}
+
+ATF_TC(getrusage_utime_zero);
+ATF_TC_HEAD(getrusage_utime_zero, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test zero utime from getrusage(2)");
+}
+
+ATF_TC_BODY(getrusage_utime_zero, tc)
+{
+ struct rusage ru;
+ size_t i;
+
+ /*
+ * Test that getrusage(2) does not return
+ * zero user time for the calling process.
+ *
+ * See also (duplicate) PR port-amd64/41734.
+ */
+ atf_tc_expect_fail("PR kern/30115");
+
+ for (i = 0; i < maxiter; i++) {
+
+ work();
+
+ (void)memset(&ru, 0, sizeof(struct rusage));
+
+ ATF_REQUIRE(getrusage(RUSAGE_SELF, &ru) == 0);
+
+ if (ru.ru_utime.tv_sec == 0 && ru.ru_utime.tv_usec == 0)
+ atf_tc_fail("zero user time from getrusage(2)");
+ }
+
+ atf_tc_fail("anticipated error did not occur");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getrusage_err);
+ ATF_TP_ADD_TC(tp, getrusage_sig);
+ ATF_TP_ADD_TC(tp, getrusage_utime_back);
+ ATF_TP_ADD_TC(tp, getrusage_utime_zero);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getsid.c b/contrib/netbsd-tests/lib/libc/sys/t_getsid.c
new file mode 100644
index 0000000..76b54ab
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getsid.c
@@ -0,0 +1,119 @@
+/* $NetBSD: t_getsid.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_getsid.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+ATF_TC(getsid_current);
+ATF_TC_HEAD(getsid_current, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test getsid(0)");
+}
+
+ATF_TC_BODY(getsid_current, tc)
+{
+ pid_t sid;
+
+ sid = getsid(0);
+ ATF_REQUIRE(sid != -1);
+
+ if (sid != getsid(getpid()))
+ atf_tc_fail("getsid(0) did not match the calling process");
+}
+
+ATF_TC(getsid_err);
+ATF_TC_HEAD(getsid_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions in getsid(2)");
+}
+
+ATF_TC_BODY(getsid_err, tc)
+{
+
+ errno = 0;
+
+ ATF_REQUIRE(getsid(-1) == -1);
+ ATF_REQUIRE(errno == ESRCH);
+}
+
+ATF_TC(getsid_process);
+ATF_TC_HEAD(getsid_process, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test getsid(2) with processes");
+}
+
+ATF_TC_BODY(getsid_process, tc)
+{
+ pid_t csid, pid, ppid, sid;
+ int sta;
+
+ sid = getsid(0);
+ pid = fork();
+
+ ATF_REQUIRE(pid >= 0);
+ ATF_REQUIRE(sid != -1);
+
+ if (pid == 0) {
+
+ csid = getsid(0);
+ ppid = getppid();
+
+ if (sid != csid)
+ _exit(EXIT_FAILURE);
+
+ if (getsid(ppid) != csid)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("invalid session ID");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, getsid_current);
+ ATF_TP_ADD_TC(tp, getsid_err);
+ ATF_TP_ADD_TC(tp, getsid_process);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c b/contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c
new file mode 100644
index 0000000..1cf303b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c
@@ -0,0 +1,86 @@
+/* $NetBSD: t_gettimeofday.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_gettimeofday.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <sys/time.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <string.h>
+
+ATF_TC(gettimeofday_err);
+ATF_TC_HEAD(gettimeofday_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from gettimeofday(2)");
+}
+
+ATF_TC_BODY(gettimeofday_err, tc)
+{
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EFAULT, gettimeofday((void *)-1, NULL) != 0);
+}
+
+ATF_TC(gettimeofday_mono);
+ATF_TC_HEAD(gettimeofday_mono, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test monotonicity of gettimeofday(2)");
+}
+
+ATF_TC_BODY(gettimeofday_mono, tc)
+{
+ static const size_t maxiter = 100;
+ struct timeval tv1, tv2;
+ size_t i;
+
+ for (i = 0; i < maxiter; i++) {
+
+ (void)memset(&tv1, 0, sizeof(struct timeval));
+ (void)memset(&tv2, 0, sizeof(struct timeval));
+
+ ATF_REQUIRE(gettimeofday(&tv1, NULL) == 0);
+ ATF_REQUIRE(gettimeofday(&tv2, NULL) == 0);
+
+ if (timercmp(&tv2, &tv1, <) != 0)
+ atf_tc_fail("time went backwards");
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, gettimeofday_err);
+ ATF_TP_ADD_TC(tp, gettimeofday_mono);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_issetugid.c b/contrib/netbsd-tests/lib/libc/sys/t_issetugid.c
new file mode 100644
index 0000000..b76ba39
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_issetugid.c
@@ -0,0 +1,148 @@
+/* $NetBSD: t_issetugid.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_issetugid.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+static bool check(int (*fuid)(uid_t), int (*fgid)(gid_t));
+
+static bool
+check(int (*fuid)(uid_t), int (*fgid)(gid_t))
+{
+ struct passwd *pw;
+ pid_t pid;
+ int sta;
+
+ pw = getpwnam("nobody");
+
+ if (pw == NULL)
+ return false;
+
+ pid = fork();
+
+ if (pid < 0)
+ return false;
+
+ if (pid == 0) {
+
+ if (fuid != NULL && (*fuid)(pw->pw_uid) != 0)
+ _exit(EXIT_FAILURE);
+
+ if (fgid != NULL && (*fgid)(pw->pw_gid) != 0)
+ _exit(EXIT_FAILURE);
+
+ if (issetugid() != 1)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ return false;
+
+ return true;
+}
+
+ATF_TC(issetugid_egid);
+ATF_TC_HEAD(issetugid_egid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A test of issetugid(2), eff. GID");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(issetugid_egid, tc)
+{
+
+ if (check(NULL, setegid) != true)
+ atf_tc_fail("issetugid(2) failed with effective GID");
+}
+
+ATF_TC(issetugid_euid);
+ATF_TC_HEAD(issetugid_euid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A test of issetugid(2), eff. UID");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(issetugid_euid, tc)
+{
+
+ if (check(seteuid, NULL) != true)
+ atf_tc_fail("issetugid(2) failed with effective UID");
+}
+
+ATF_TC(issetugid_rgid);
+ATF_TC_HEAD(issetugid_rgid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A test of issetugid(2), real GID");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(issetugid_rgid, tc)
+{
+
+ if (check(NULL, setgid) != true)
+ atf_tc_fail("issetugid(2) failed with real GID");
+}
+
+ATF_TC(issetugid_ruid);
+ATF_TC_HEAD(issetugid_ruid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A test of issetugid(2), real UID");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(issetugid_ruid, tc)
+{
+
+ if (check(setuid, NULL) != true)
+ atf_tc_fail("issetugid(2) failed with real UID");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, issetugid_egid);
+ ATF_TP_ADD_TC(tp, issetugid_euid);
+ ATF_TP_ADD_TC(tp, issetugid_rgid);
+ ATF_TP_ADD_TC(tp, issetugid_ruid);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_kevent.c b/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
new file mode 100644
index 0000000..73ffbf8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
@@ -0,0 +1,180 @@
+/* $NetBSD: t_kevent.c,v 1.6 2012/11/29 09:13:44 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundatiom
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_kevent.c,v 1.6 2012/11/29 09:13:44 martin Exp $");
+
+#include <sys/types.h>
+#include <sys/event.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <err.h>
+#include <sys/drvctlio.h>
+#include <sys/event.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+
+ATF_TC(kevent_zerotimer);
+ATF_TC_HEAD(kevent_zerotimer, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that kevent with a 0 timer "
+ "does not crash the system (PR lib/45618)");
+}
+
+ATF_TC_BODY(kevent_zerotimer, tc)
+{
+ struct kevent ev;
+ int kq;
+
+ ATF_REQUIRE((kq = kqueue()) != -1);
+ EV_SET(&ev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 1, 0);
+ ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) != -1);
+ ATF_REQUIRE(kevent(kq, NULL, 0, &ev, 1, NULL) == 1);
+}
+
+ATF_TC(kqueue_desc_passing);
+ATF_TC_HEAD(kqueue_desc_passing, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that passing a kqueue to "
+ "another process does not crash the kernel (PR 46463)");
+}
+
+ATF_TC_BODY(kqueue_desc_passing, tc)
+{
+ pid_t child;
+ int s[2], storage, status, kq;
+ struct cmsghdr *msg;
+ struct iovec iov;
+ struct msghdr m;
+ struct kevent ev;
+
+ ATF_REQUIRE((kq = kqueue()) != -1);
+
+ // atf_tc_skip("crashes kernel (PR 46463)");
+
+ ATF_REQUIRE(socketpair(AF_LOCAL, SOCK_STREAM, 0, s) != -1);
+ msg = malloc(CMSG_SPACE(sizeof(int)));
+ m.msg_iov = &iov;
+ m.msg_iovlen = 1;
+ m.msg_name = NULL;
+ m.msg_namelen = 0;
+ m.msg_control = msg;
+ m.msg_controllen = CMSG_SPACE(sizeof(int));
+
+ child = fork();
+ if (child == 0) {
+ close(s[0]);
+
+ iov.iov_base = &storage;
+ iov.iov_len = sizeof(int);
+ m.msg_iov = &iov;
+ m.msg_iovlen = 1;
+
+ if (recvmsg(s[1], &m, 0) == -1)
+ err(1, "child: could not recvmsg");
+
+ kq = *(int *)CMSG_DATA(msg);
+ printf("child (pid %d): received kq fd %d\n", getpid(), kq);
+ exit(0);
+ }
+
+ close(s[1]);
+
+ iov.iov_base = &storage;
+ iov.iov_len = sizeof(int);
+
+ msg->cmsg_level = SOL_SOCKET;
+ msg->cmsg_type = SCM_RIGHTS;
+ msg->cmsg_len = CMSG_LEN(sizeof(int));
+
+ *(int *)CMSG_DATA(msg) = kq;
+
+ EV_SET(&ev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 1, 0);
+ ATF_CHECK(kevent(kq, &ev, 1, NULL, 0, NULL) != -1);
+
+ printf("parent (pid %d): sending kq fd %d\n", getpid(), kq);
+ if (sendmsg(s[0], &m, 0) == -1) {
+ ATF_REQUIRE_EQ_MSG(errno, EBADF, "errno is %d", errno);
+ atf_tc_skip("PR kern/46523");
+ }
+
+ close(kq);
+
+ waitpid(child, &status, 0);
+ ATF_CHECK(WIFEXITED(status) && WEXITSTATUS(status)==0);
+}
+
+ATF_TC(kqueue_unsupported_fd);
+ATF_TC_HEAD(kqueue_unsupported_fd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that watching an fd whose"
+ " type is not supported does not crash the kernel");
+}
+
+ATF_TC_BODY(kqueue_unsupported_fd, tc)
+{
+ /* mqueue and semaphore use fnullop_kqueue also */
+ int fd, kq;
+ struct kevent ev;
+
+ fd = open(DRVCTLDEV, O_RDONLY);
+ if (fd == -1 && errno == ENOENT)
+ atf_tc_skip("no " DRVCTLDEV " available for testing");
+ ATF_REQUIRE(fd != -1);
+ ATF_REQUIRE((kq = kqueue()) != -1);
+
+ EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR,
+ NOTE_DELETE|NOTE_WRITE|NOTE_EXTEND|NOTE_ATTRIB|NOTE_LINK|
+ NOTE_RENAME|NOTE_REVOKE, 0, 0);
+
+ ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) == -1);
+ ATF_REQUIRE_ERRNO(EOPNOTSUPP, true);
+
+ (void)close(fd);
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, kevent_zerotimer);
+ ATF_TP_ADD_TC(tp, kqueue_desc_passing);
+ ATF_TP_ADD_TC(tp, kqueue_unsupported_fd);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_kill.c b/contrib/netbsd-tests/lib/libc/sys/t_kill.c
new file mode 100644
index 0000000..2f42862
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_kill.c
@@ -0,0 +1,312 @@
+/* $NetBSD: t_kill.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_kill.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+ATF_TC(kill_basic);
+ATF_TC_HEAD(kill_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that kill(2) works");
+}
+
+ATF_TC_BODY(kill_basic, tc)
+{
+ const int sig[] = { SIGHUP, SIGINT, SIGKILL, SIGTERM };
+ pid_t pid;
+ size_t i;
+ int sta;
+
+ for (i = 0; i < __arraycount(sig); i++) {
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ switch (pid) {
+
+ case 0:
+ pause();
+ break;
+
+ default:
+ ATF_REQUIRE(kill(pid, sig[i]) == 0);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != sig[i])
+ atf_tc_fail("kill(2) failed to kill child");
+ }
+}
+
+ATF_TC(kill_err);
+ATF_TC_HEAD(kill_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of kill(2)");
+}
+
+ATF_TC_BODY(kill_err, tc)
+{
+ int rv, sta;
+ pid_t pid;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ errno = 0;
+ rv = kill(getpid(), -1);
+
+ if (rv == 0 || errno != EINVAL)
+ _exit(EINVAL);
+
+ errno = 0;
+ rv = kill(INT_MAX, SIGUSR1);
+
+ if (rv == 0 || errno != ESRCH)
+ _exit(ESRCH);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS) {
+
+ if (WEXITSTATUS(sta) == EINVAL)
+ atf_tc_fail("expected EINVAL, but kill(2) succeeded");
+
+ if (WEXITSTATUS(sta) == ESRCH)
+ atf_tc_fail("expected ESRCH, but kill(2) succeeded");
+
+ atf_tc_fail("unknown error from kill(2)");
+ }
+}
+
+ATF_TC(kill_perm);
+ATF_TC_HEAD(kill_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test kill(2) permissions");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(kill_perm, tc)
+{
+ struct passwd *pw;
+ pid_t cpid, ppid;
+ uid_t cuid = 0;
+ uid_t puid = 0;
+ int sta;
+
+ /*
+ * Test that kill(2) fails when called
+ * for a PID owned by another user.
+ */
+ pw = getpwnam("operator");
+
+ if (pw != NULL)
+ cuid = pw->pw_uid;
+
+ pw = getpwnam("nobody");
+
+ if (pw != NULL)
+ puid = pw->pw_uid;
+
+ if (cuid == 0 || puid == 0 || cuid == puid)
+ atf_tc_fail("getpwnam(3) failed");
+
+ ppid = fork();
+
+ if (ppid < 0)
+ _exit(EXIT_FAILURE);
+
+ if (ppid == 0) {
+
+ cpid = fork();
+
+ if (cpid < 0)
+ _exit(EXIT_FAILURE);
+
+ if (cpid == 0) {
+
+ if (setuid(cuid) < 0)
+ _exit(EXIT_FAILURE);
+ else {
+ (void)sleep(1);
+ }
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ /*
+ * Try to kill the child after having
+ * set the real and effective UID.
+ */
+ if (setuid(puid) != 0)
+ _exit(EXIT_FAILURE);
+
+ errno = 0;
+
+ if (kill(cpid, SIGKILL) == 0)
+ _exit(EPERM);
+
+ if (errno != EPERM)
+ _exit(EPERM);
+
+ (void)waitpid(cpid, &sta, 0);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)waitpid(ppid, &sta, 0);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) == EPERM)
+ atf_tc_fail("killed a process of another user");
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("unknown error from kill(2)");
+}
+
+ATF_TC(kill_pgrp_neg);
+ATF_TC_HEAD(kill_pgrp_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test kill(2) with process group, #2");
+}
+
+ATF_TC_BODY(kill_pgrp_neg, tc)
+{
+ const int maxiter = 3;
+ pid_t cpid, ppid;
+ int i, sta;
+
+ ppid = fork();
+ ATF_REQUIRE(ppid >= 0);
+
+ if (ppid == 0) {
+
+ ATF_REQUIRE(setpgid(0, 0) == 0);
+
+ for (i = 0; i < maxiter; i++) {
+
+ cpid = fork();
+ ATF_REQUIRE(cpid >= 0);
+
+ if (cpid == 0)
+ pause();
+ }
+
+ /*
+ * Test the variant of killpg(3); if the process number
+ * is negative but not -1, the signal should be sent to
+ * all processes whose process group ID is equal to the
+ * absolute value of the process number.
+ */
+ ATF_REQUIRE(kill(-getpgrp(), SIGKILL) == 0);
+
+ (void)sleep(1);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)waitpid(ppid, &sta, 0);
+
+ if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != SIGKILL)
+ atf_tc_fail("failed to kill(2) a process group");
+}
+
+ATF_TC(kill_pgrp_zero);
+ATF_TC_HEAD(kill_pgrp_zero, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test kill(2) with process group, #1");
+}
+
+ATF_TC_BODY(kill_pgrp_zero, tc)
+{
+ const int maxiter = 3;
+ pid_t cpid, ppid;
+ int i, sta;
+
+ ppid = fork();
+ ATF_REQUIRE(ppid >= 0);
+
+ if (ppid == 0) {
+
+ ATF_REQUIRE(setpgid(0, 0) == 0);
+
+ for (i = 0; i < maxiter; i++) {
+
+ cpid = fork();
+ ATF_REQUIRE(cpid >= 0);
+
+ if (cpid == 0)
+ pause();
+ }
+
+ /*
+ * If the supplied process number is zero,
+ * the signal should be sent to all processes
+ * under the current process group.
+ */
+ ATF_REQUIRE(kill(0, SIGKILL) == 0);
+
+ (void)sleep(1);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)waitpid(ppid, &sta, 0);
+
+ if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != SIGKILL)
+ atf_tc_fail("failed to kill(2) a process group");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, kill_basic);
+ ATF_TP_ADD_TC(tp, kill_err);
+ ATF_TP_ADD_TC(tp, kill_perm);
+ ATF_TP_ADD_TC(tp, kill_pgrp_neg);
+ ATF_TP_ADD_TC(tp, kill_pgrp_zero);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_link.c b/contrib/netbsd-tests/lib/libc/sys/t_link.c
new file mode 100644
index 0000000..b58c4c9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_link.c
@@ -0,0 +1,229 @@
+/* $NetBSD: t_link.c,v 1.2 2014/04/21 14:39:36 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_link.c,v 1.2 2014/04/21 14:39:36 martin Exp $");
+
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char *getpath(void);
+static char path[] = "link";
+static const char *pathl;
+
+static const char *
+getpath(void)
+{
+ static char buf[LINE_MAX];
+
+ (void)memset(buf, '\0', sizeof(buf));
+
+ if (getcwd(buf, sizeof(buf)) == NULL)
+ return NULL;
+
+ (void)strlcat(buf, path, sizeof(buf));
+ (void)strlcat(buf, ".link", sizeof(buf));
+
+ return buf;
+}
+
+ATF_TC_WITH_CLEANUP(link_count);
+ATF_TC_HEAD(link_count, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "link(2) counts are incremented?");
+}
+
+ATF_TC_BODY(link_count, tc)
+{
+ struct stat sa, sb;
+ int fd;
+
+ (void)memset(&sa, 0, sizeof(struct stat));
+ (void)memset(&sb, 0, sizeof(struct stat));
+
+ pathl = getpath();
+ fd = open(path, O_RDWR | O_CREAT, 0600);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(pathl != NULL);
+
+ ATF_REQUIRE(stat(path, &sa) == 0);
+ ATF_REQUIRE(link(path, pathl) == 0);
+ ATF_REQUIRE(stat(path, &sb) == 0);
+
+ if (sa.st_nlink != sb.st_nlink - 1)
+ atf_tc_fail("incorrect link(2) count");
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+ ATF_REQUIRE(unlink(pathl) == 0);
+}
+
+ATF_TC_CLEANUP(link_count, tc)
+{
+ (void)unlink(path);
+ (void)unlink(pathl);
+}
+
+ATF_TC_WITH_CLEANUP(link_err);
+ATF_TC_HEAD(link_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of link(2)");
+}
+
+ATF_TC_BODY(link_err, tc)
+{
+ char buf[MAXPATHLEN + 1];
+ int fd;
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ pathl = getpath();
+ fd = open(path, O_RDWR | O_CREAT, 0600);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(pathl != NULL);
+
+ errno = 0;
+ ATF_REQUIRE(link(path, pathl) == 0);
+ ATF_REQUIRE_ERRNO(EEXIST, link(path, pathl) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, link(buf, "xxx") == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, link(path, "/d/c/b/a") == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, link("/a/b/c/d", path) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, link("/a/b/c/d", "/d/c/b/a") == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, link(path, (const char *)-1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, link((const char *)-1, "xxx") == -1);
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+ ATF_REQUIRE(unlink(pathl) == 0);
+}
+
+ATF_TC_CLEANUP(link_err, tc)
+{
+ (void)unlink(path);
+ (void)unlink(pathl);
+}
+
+ATF_TC(link_perm);
+ATF_TC_HEAD(link_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with link(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(link_perm, tc)
+{
+ int rv;
+
+ errno = 0;
+ rv = link("/root", "/root.link");
+ ATF_REQUIRE_MSG(rv == -1 && (errno == EACCES || errno == EPERM),
+ "link to a directory did not fail with EPERM or EACCESS; link() "
+ "returned %d, errno %d", rv, errno);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EACCES,
+ link("/root/.profile", "/root/.profile.link") == -1);
+}
+
+ATF_TC_WITH_CLEANUP(link_stat);
+ATF_TC_HEAD(link_stat, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check stat(2) of a linked file");
+}
+
+ATF_TC_BODY(link_stat, tc)
+{
+ struct stat sa, sb;
+ int fd;
+
+ (void)memset(&sa, 0, sizeof(struct stat));
+ (void)memset(&sb, 0, sizeof(struct stat));
+
+ pathl = getpath();
+ fd = open(path, O_RDWR | O_CREAT, 0600);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(pathl != NULL);
+
+ ATF_REQUIRE(link(path, pathl) == 0);
+ ATF_REQUIRE(stat(path, &sa) == 0);
+ ATF_REQUIRE(lstat(pathl, &sb) == 0);
+
+ if (sa.st_uid != sb.st_uid)
+ atf_tc_fail("unequal UIDs");
+
+ if (sa.st_mode != sb.st_mode)
+ atf_tc_fail("unequal modes");
+
+ if (sa.st_ino != sb.st_ino)
+ atf_tc_fail("unequal inodes");
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+ ATF_REQUIRE(unlink(pathl) == 0);
+}
+
+ATF_TC_CLEANUP(link_stat, tc)
+{
+ (void)unlink(path);
+ (void)unlink(pathl);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, link_count);
+ ATF_TP_ADD_TC(tp, link_err);
+ ATF_TP_ADD_TC(tp, link_perm);
+ ATF_TP_ADD_TC(tp, link_stat);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_listen.c b/contrib/netbsd-tests/lib/libc/sys/t_listen.c
new file mode 100644
index 0000000..71201d3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_listen.c
@@ -0,0 +1,134 @@
+/* $NetBSD: t_listen.c,v 1.4 2012/03/18 07:00:52 jruoho Exp $ */
+/*
+ * Copyright (c) 2007 The NetBSD Foundation, 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 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 <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+static const char *path = "listen";
+
+ATF_TC_WITH_CLEANUP(listen_err);
+ATF_TC_HEAD(listen_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks errors from listen(2) (PR standards/46150)");
+}
+
+ATF_TC_BODY(listen_err, tc)
+{
+ static const size_t siz = sizeof(struct sockaddr_in);
+ struct sockaddr_in sina, sinb;
+ int fda, fdb, fdc;
+
+ (void)memset(&sina, 0, sizeof(struct sockaddr_in));
+ (void)memset(&sinb, 0, sizeof(struct sockaddr_in));
+
+ sina.sin_family = AF_INET;
+ sina.sin_port = htons(31522);
+ sina.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+ sinb.sin_family = AF_INET;
+ sinb.sin_port = htons(31522);
+ sinb.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+ fda = socket(AF_INET, SOCK_STREAM, 0);
+ fdb = socket(AF_INET, SOCK_STREAM, 0);
+ fdc = open("listen", O_RDWR | O_CREAT, 0600);
+
+ ATF_REQUIRE(fda >= 0 && fdb >= 0 && fdc >= 0);
+ ATF_REQUIRE_ERRNO(ENOTSOCK, listen(fdc, 1) == -1);
+
+ (void)close(fdc);
+ (void)unlink(path);
+
+ ATF_REQUIRE(bind(fda, (struct sockaddr *)&sina, siz) == 0);
+ ATF_REQUIRE(listen(fda, 1) == 0);
+
+ /*
+ * According to IEEE Std 1003.1-2008: if the socket is
+ * already connected, the call should fail with EINVAL.
+ */
+ ATF_REQUIRE(connect(fdb, (struct sockaddr *)&sinb, siz) == 0);
+ ATF_REQUIRE_ERRNO(EINVAL, listen(fdb, 1) == -1);
+
+ (void)close(fda);
+ (void)close(fdb);
+
+ ATF_REQUIRE_ERRNO(EBADF, connect(fdb,
+ (struct sockaddr *)&sinb, siz) == -1);
+}
+
+ATF_TC_CLEANUP(listen_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(listen_low_port);
+ATF_TC_HEAD(listen_low_port, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Does low-port allocation work?");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(listen_low_port, tc)
+{
+ int sd, val;
+
+ sd = socket(AF_INET, SOCK_STREAM, 0);
+
+ val = IP_PORTRANGE_LOW;
+ if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE, &val,
+ sizeof(val)) == -1)
+ atf_tc_fail("setsockopt failed: %s", strerror(errno));
+
+ if (listen(sd, 5) == -1) {
+ int serrno = errno;
+ atf_tc_fail("listen failed: %s%s",
+ strerror(serrno),
+ serrno != EACCES ? "" :
+ " (see http://mail-index.netbsd.org/"
+ "source-changes/2007/12/16/0011.html)");
+ }
+
+ close(sd);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, listen_err);
+ ATF_TP_ADD_TC(tp, listen_low_port);
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_lwp_create.c b/contrib/netbsd-tests/lib/libc/sys/t_lwp_create.c
new file mode 100644
index 0000000..02545fe
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_lwp_create.c
@@ -0,0 +1,247 @@
+/* $NetBSD: t_lwp_create.c,v 1.2 2012/05/22 09:23:39 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This code is partly based on code by Joel Sing <joel at sing.id.au>
+ */
+
+#include <atf-c.h>
+#include <lwp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ucontext.h>
+#include <inttypes.h>
+#include <errno.h>
+
+#ifdef __alpha__
+#include <machine/alpha_cpu.h>
+#endif
+#ifdef __amd64__
+#include <machine/vmparam.h>
+#include <machine/psl.h>
+#endif
+#ifdef __hppa__
+#include <machine/psl.h>
+#endif
+#ifdef __i386__
+#include <machine/segments.h>
+#include <machine/psl.h>
+#endif
+#if defined(__m68k__) || defined(__sh3__) || defined __vax__
+#include <machine/psl.h>
+#endif
+
+volatile lwpid_t the_lwp_id = 0;
+
+static void lwp_main_func(void* arg)
+{
+ the_lwp_id = _lwp_self();
+ _lwp_exit();
+}
+
+/*
+ * Hard to document - see usage examples below.
+ */
+#define INVALID_UCONTEXT(ARCH,NAME,DESC) \
+static void ARCH##_##NAME(ucontext_t *); \
+ATF_TC(lwp_create_##ARCH##_fail_##NAME); \
+ATF_TC_HEAD(lwp_create_##ARCH##_fail_##NAME, tc) \
+{ \
+ atf_tc_set_md_var(tc, "descr", "verify rejection of invalid ucontext " \
+ "on " #ARCH " due to " DESC); \
+} \
+ \
+ATF_TC_BODY(lwp_create_##ARCH##_fail_##NAME, tc) \
+{ \
+ ucontext_t uc; \
+ lwpid_t lid; \
+ int error; \
+ \
+ getcontext(&uc); \
+ uc.uc_flags = _UC_CPU; \
+ ARCH##_##NAME(&uc); \
+ \
+ error = _lwp_create(&uc, 0, &lid); \
+ ATF_REQUIRE(error != 0 && errno == EINVAL); \
+} \
+static void ARCH##_##NAME(ucontext_t *uc) \
+{
+
+
+ATF_TC(lwp_create_works);
+ATF_TC_HEAD(lwp_create_works, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Verify creation of a lwp and waiting"
+ " for it to finish");
+}
+
+ATF_TC_BODY(lwp_create_works, tc)
+{
+ ucontext_t uc;
+ lwpid_t lid;
+ int error;
+ void *stack;
+ static const size_t ssize = 16*1024;
+
+ stack = malloc(ssize);
+ _lwp_makecontext(&uc, lwp_main_func, NULL, NULL, stack, ssize);
+
+ error = _lwp_create(&uc, 0, &lid);
+ ATF_REQUIRE(error == 0);
+
+ error = _lwp_wait(lid, NULL);
+ ATF_REQUIRE(error == 0);
+ ATF_REQUIRE(lid == the_lwp_id);
+}
+
+INVALID_UCONTEXT(generic, no_uc_cpu, "not setting cpu registers")
+ uc->uc_flags &= ~_UC_CPU;
+}
+
+#ifdef __alpha__
+INVALID_UCONTEXT(alpha, pslset, "trying to clear the USERMODE flag")
+ uc->uc_mcontext.__gregs[_REG_PS] &= ~ALPHA_PSL_USERMODE;
+}
+INVALID_UCONTEXT(alpha, pslclr, "trying to set a 'must be zero' flag")
+ uc->uc_mcontext.__gregs[_REG_PS] |= ALPHA_PSL_IPL_HIGH;
+}
+#endif
+#ifdef __amd64__
+INVALID_UCONTEXT(amd64, untouchable_rflags, "forbidden rflags changed")
+ uc->uc_mcontext.__gregs[_REG_RFLAGS] |= PSL_MBZ;
+}
+/*
+ * XXX: add invalid GS/DS selector tests
+ */
+INVALID_UCONTEXT(amd64, pc_too_high,
+ "instruction pointer outside userland address space")
+ uc->uc_mcontext.__gregs[_REG_RIP] = VM_MAXUSER_ADDRESS;
+}
+#endif
+#ifdef __arm__
+INVALID_UCONTEXT(arm, invalid_mode, "psr or r15 set to non-user-mode")
+ uc->uc_mcontext.__gregs[_REG_PC] |= 0x1f /*PSR_SYS32_MODE*/;
+ uc->uc_mcontext.__gregs[_REG_CPSR] |= 0x03 /*R15_MODE_SVC*/;
+}
+#endif
+#ifdef __hppa__
+INVALID_UCONTEXT(hppa, invalid_1, "set illegal bits in psw")
+ uc->uc_mcontext.__gregs[_REG_PSW] |= PSW_MBZ;
+}
+INVALID_UCONTEXT(hppa, invalid_0, "clear illegal bits in psw")
+ uc->uc_mcontext.__gregs[_REG_PSW] &= ~PSW_MBS;
+}
+#endif
+#ifdef __i386__
+INVALID_UCONTEXT(i386, untouchable_eflags, "changing forbidden eflags")
+ uc->uc_mcontext.__gregs[_REG_EFL] |= PSL_IOPL;
+}
+INVALID_UCONTEXT(i386, priv_escalation, "modifying priviledge level")
+ uc->uc_mcontext.__gregs[_REG_CS] &= ~SEL_RPL;
+}
+#endif
+#ifdef __m68k__
+INVALID_UCONTEXT(m68k, invalid_ps_bits,
+ "setting forbidden bits in the ps register")
+ uc->uc_mcontext.__gregs[_REG_PS] |= (PSL_MBZ|PSL_IPL|PSL_S);
+}
+#endif
+#ifdef __sh3__
+INVALID_UCONTEXT(sh3, modify_userstatic,
+ "modifying illegal bits in the status register")
+ uc->uc_mcontext.__gregs[_REG_SR] |= PSL_MD;
+}
+#endif
+#ifdef __sparc__
+INVALID_UCONTEXT(sparc, pc_odd, "mis-aligned instruction pointer")
+ uc->uc_mcontext.__gregs[_REG_PC] = 0x100002;
+}
+INVALID_UCONTEXT(sparc, npc_odd, "mis-aligned next instruction pointer")
+ uc->uc_mcontext.__gregs[_REG_nPC] = 0x100002;
+}
+INVALID_UCONTEXT(sparc, pc_null, "NULL instruction pointer")
+ uc->uc_mcontext.__gregs[_REG_PC] = 0;
+}
+INVALID_UCONTEXT(sparc, npc_null, "NULL next instruction pointer")
+ uc->uc_mcontext.__gregs[_REG_nPC] = 0;
+}
+#endif
+#ifdef __vax__
+INVALID_UCONTEXT(vax, psl_0, "clearing forbidden bits in psl")
+ uc->uc_mcontext.__gregs[_REG_PSL] &= ~(PSL_U | PSL_PREVU);
+}
+INVALID_UCONTEXT(vax, psl_1, "setting forbidden bits in psl")
+ uc->uc_mcontext.__gregs[_REG_PSL] |= PSL_IPL | PSL_IS;
+}
+INVALID_UCONTEXT(vax, psl_cm, "setting CM bit in psl")
+ uc->uc_mcontext.__gregs[_REG_PSL] |= PSL_CM;
+}
+#endif
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, lwp_create_works);
+ ATF_TP_ADD_TC(tp, lwp_create_generic_fail_no_uc_cpu);
+#ifdef __alpha__
+ ATF_TP_ADD_TC(tp, lwp_create_alpha_fail_pslset);
+ ATF_TP_ADD_TC(tp, lwp_create_alpha_fail_pslclr);
+#endif
+#ifdef __amd64__
+ ATF_TP_ADD_TC(tp, lwp_create_amd64_fail_untouchable_rflags);
+ ATF_TP_ADD_TC(tp, lwp_create_amd64_fail_pc_too_high);
+#endif
+#ifdef __arm__
+ ATF_TP_ADD_TC(tp, lwp_create_arm_fail_invalid_mode);
+#endif
+#ifdef __hppa__
+ ATF_TP_ADD_TC(tp, lwp_create_hppa_fail_invalid_1);
+ ATF_TP_ADD_TC(tp, lwp_create_hppa_fail_invalid_0);
+#endif
+#ifdef __i386__
+ ATF_TP_ADD_TC(tp, lwp_create_i386_fail_untouchable_eflags);
+ ATF_TP_ADD_TC(tp, lwp_create_i386_fail_priv_escalation);
+#endif
+#ifdef __m68k__
+ ATF_TP_ADD_TC(tp, lwp_create_m68k_fail_invalid_ps_bits);
+#endif
+#ifdef __sh3__
+ ATF_TP_ADD_TC(tp, lwp_create_sh3_fail_modify_userstatic);
+#endif
+#ifdef __sparc__
+ ATF_TP_ADD_TC(tp, lwp_create_sparc_fail_pc_odd);
+ ATF_TP_ADD_TC(tp, lwp_create_sparc_fail_npc_odd);
+ ATF_TP_ADD_TC(tp, lwp_create_sparc_fail_pc_null);
+ ATF_TP_ADD_TC(tp, lwp_create_sparc_fail_npc_null);
+#endif
+#ifdef __vax__
+ ATF_TP_ADD_TC(tp, lwp_create_vax_fail_psl_0);
+ ATF_TP_ADD_TC(tp, lwp_create_vax_fail_psl_1);
+ ATF_TP_ADD_TC(tp, lwp_create_vax_fail_psl_cm);
+#endif
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_lwp_ctl.c b/contrib/netbsd-tests/lib/libc/sys/t_lwp_ctl.c
new file mode 100644
index 0000000..1b28f75
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_lwp_ctl.c
@@ -0,0 +1,74 @@
+/* $NetBSD: t_lwp_ctl.c,v 1.2 2012/03/18 06:20:51 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_lwp_ctl.c,v 1.2 2012/03/18 06:20:51 jruoho Exp $");
+
+#include <sys/lwpctl.h>
+
+#include <atf-c.h>
+#include <lwp.h>
+#include <stdio.h>
+#include <time.h>
+
+ATF_TC(lwpctl_counter);
+ATF_TC_HEAD(lwpctl_counter, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks lwpctl preemption counter");
+}
+
+ATF_TC_BODY(lwpctl_counter, tc)
+{
+ lwpctl_t *lc;
+ struct timespec ts;
+ int ctr1, ctr2;
+
+ ATF_REQUIRE(_lwp_ctl(LWPCTL_FEATURE_PCTR, &lc) == 0);
+
+ /* Ensure that preemption is reported. */
+ ctr1 = lc->lc_pctr;
+ (void)printf("pctr = %d\n", ctr1);
+ ts.tv_nsec = 10*1000000;
+ ts.tv_sec = 0;
+
+ ATF_REQUIRE(nanosleep(&ts, 0) != -1);
+
+ ctr2 = lc->lc_pctr;
+ (void)printf("pctr = %d\n", ctr2);
+
+ ATF_REQUIRE_MSG(ctr1 != ctr2, "counters match");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, lwpctl_counter);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mincore.c b/contrib/netbsd-tests/lib/libc/sys/t_mincore.c
new file mode 100644
index 0000000..553207a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mincore.c
@@ -0,0 +1,318 @@
+/* $NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $");
+
+#include <sys/mman.h>
+#include <sys/shm.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <kvm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/resource.h>
+
+static long page = 0;
+static const char path[] = "mincore";
+static size_t check_residency(void *, size_t);
+
+static size_t
+check_residency(void *addr, size_t npgs)
+{
+ size_t i, resident;
+ char *vec;
+
+ vec = malloc(npgs);
+
+ ATF_REQUIRE(vec != NULL);
+ ATF_REQUIRE(mincore(addr, npgs * page, vec) == 0);
+
+ for (i = resident = 0; i < npgs; i++) {
+
+ if (vec[i] != 0)
+ resident++;
+
+#if 0
+ (void)fprintf(stderr, "page 0x%p is %sresident\n",
+ (char *)addr + (i * page), vec[i] ? "" : "not ");
+#endif
+ }
+
+ free(vec);
+
+ return resident;
+}
+
+ATF_TC(mincore_err);
+ATF_TC_HEAD(mincore_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from mincore(2)");
+}
+
+ATF_TC_BODY(mincore_err, tc)
+{
+ char *map, *vec;
+
+ map = mmap(NULL, page, PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
+ vec = malloc(page);
+
+ ATF_REQUIRE(vec != NULL);
+ ATF_REQUIRE(map != MAP_FAILED);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, mincore(map, 0, vec) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOMEM, mincore(0, page, vec) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, mincore(map, page, (void *)-1) == -1);
+
+ free(vec);
+ ATF_REQUIRE(munmap(map, page) == 0);
+}
+
+ATF_TC_WITH_CLEANUP(mincore_resid);
+ATF_TC_HEAD(mincore_resid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test page residency with mincore(2)");
+}
+
+ATF_TC_BODY(mincore_resid, tc)
+{
+ void *addr, *addr2, *addr3, *buf;
+ size_t npgs = 0, resident;
+ struct stat st;
+ int fd, rv;
+ struct rlimit rlim;
+
+ ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, &rlim) == 0);
+ rlim.rlim_cur = rlim.rlim_max;
+ ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, &rlim) == 0);
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ fd = open(path, O_RDWR | O_CREAT, 0700);
+ buf = malloc(page * 5);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(buf != NULL);
+
+ rv = write(fd, buf, page * 5);
+ ATF_REQUIRE(rv >= 0);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(fstat(fd, &st) == 0);
+
+ addr = mmap(NULL, (size_t)st.st_size, PROT_READ,
+ MAP_FILE | MAP_SHARED, fd, (off_t) 0);
+
+ ATF_REQUIRE(addr != MAP_FAILED);
+
+ (void)close(fd);
+
+ npgs = st.st_size / page;
+
+ if (st.st_size % page != 0)
+ npgs++;
+
+ (void)check_residency(addr, npgs);
+
+ rv = mlock(addr, npgs * page);
+ if (rv == -1 && errno == EAGAIN)
+ atf_tc_skip("hit process resource limits");
+ ATF_REQUIRE(munmap(addr, st.st_size) == 0);
+
+ npgs = 128;
+
+ addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE,
+ MAP_ANON | MAP_PRIVATE | MAP_WIRED, -1, (off_t)0);
+
+ if (addr == MAP_FAILED)
+ atf_tc_skip("could not mmap wired anonymous test area, system "
+ "might be low on memory");
+
+ ATF_REQUIRE(check_residency(addr, npgs) == npgs);
+ ATF_REQUIRE(munmap(addr, npgs * page) == 0);
+
+ npgs = 128;
+
+ addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE,
+ MAP_ANON | MAP_PRIVATE, -1, (off_t)0);
+
+ ATF_REQUIRE(addr != MAP_FAILED);
+
+ /*
+ * Check that the in-core pages match the locked pages.
+ */
+ ATF_REQUIRE(check_residency(addr, npgs) == 0);
+
+ errno = 0;
+ if (mlockall(MCL_CURRENT|MCL_FUTURE) != 0 && errno != ENOMEM)
+ atf_tc_fail("mlockall(2) failed");
+ if (errno == ENOMEM)
+ atf_tc_skip("mlockall() exceeded process resource limits");
+
+ resident = check_residency(addr, npgs);
+ if (resident < npgs)
+ atf_tc_fail("mlockall(MCL_FUTURE) succeeded, still only "
+ "%zu pages of the newly mapped %zu pages are resident",
+ resident, npgs);
+
+ addr2 = mmap(NULL, npgs * page, PROT_READ, MAP_ANON, -1, (off_t)0);
+ addr3 = mmap(NULL, npgs * page, PROT_NONE, MAP_ANON, -1, (off_t)0);
+
+ if (addr2 == MAP_FAILED || addr3 == MAP_FAILED)
+ atf_tc_skip("could not mmap more anonymous test pages with "
+ "mlockall(MCL_FUTURE) in effect, system "
+ "might be low on memory");
+
+ ATF_REQUIRE(check_residency(addr2, npgs) == npgs);
+ ATF_REQUIRE(check_residency(addr3, npgs) == 0);
+ ATF_REQUIRE(mprotect(addr3, npgs * page, PROT_READ) == 0);
+ ATF_REQUIRE(check_residency(addr, npgs) == npgs);
+ ATF_REQUIRE(check_residency(addr2, npgs) == npgs);
+
+ (void)munlockall();
+
+ ATF_REQUIRE(madvise(addr2, npgs * page, MADV_FREE) == 0);
+ ATF_REQUIRE(check_residency(addr2, npgs) == 0);
+
+ (void)memset(addr, 0, npgs * page);
+
+ ATF_REQUIRE(madvise(addr, npgs * page, MADV_FREE) == 0);
+ ATF_REQUIRE(check_residency(addr, npgs) == 0);
+
+ (void)munmap(addr, npgs * page);
+ (void)munmap(addr2, npgs * page);
+ (void)munmap(addr3, npgs * page);
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(mincore_resid, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(mincore_shmseg);
+ATF_TC_HEAD(mincore_shmseg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "residency of shared memory");
+}
+
+ATF_TC_BODY(mincore_shmseg, tc)
+{
+ size_t npgs = 128;
+ void *addr = NULL;
+ int shmid;
+
+ shmid = shmget(IPC_PRIVATE, npgs * page,
+ IPC_CREAT | S_IRUSR | S_IWUSR);
+
+ ATF_REQUIRE(shmid != -1);
+
+ addr = shmat(shmid, NULL, 0);
+
+ ATF_REQUIRE(addr != NULL);
+ ATF_REQUIRE(check_residency(addr, npgs) == 0);
+
+ (void)memset(addr, 0xff, npgs * page);
+
+ ATF_REQUIRE(check_residency(addr, npgs) == npgs);
+ ATF_REQUIRE(madvise(addr, npgs * page, MADV_FREE) == 0);
+
+ /*
+ * NOTE! Even though we have MADV_FREE'd the range,
+ * there is another reference (the kernel's) to the
+ * object which owns the pages. In this case, the
+ * kernel does not simply free the pages, as haphazardly
+ * freeing pages when there are still references to
+ * an object can cause data corruption (say, the other
+ * referencer doesn't expect the pages to be freed,
+ * and is surprised by the subsequent ZFOD).
+ *
+ * Because of this, we simply report the number of
+ * pages still resident, for information only.
+ */
+ npgs = check_residency(addr, npgs);
+
+ (void)fprintf(stderr, "%zu pages still resident\n", npgs);
+
+ ATF_REQUIRE(shmdt(addr) == 0);
+ ATF_REQUIRE(shmctl(shmid, IPC_RMID, NULL) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ page = sysconf(_SC_PAGESIZE);
+ ATF_REQUIRE(page >= 0);
+
+ ATF_TP_ADD_TC(tp, mincore_err);
+ ATF_TP_ADD_TC(tp, mincore_resid);
+ ATF_TP_ADD_TC(tp, mincore_shmseg);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_minherit.c b/contrib/netbsd-tests/lib/libc/sys/t_minherit.c
new file mode 100644
index 0000000..0bdf6bc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_minherit.c
@@ -0,0 +1,200 @@
+/* $NetBSD: t_minherit.c,v 1.1 2014/07/18 12:34:52 christos Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_minherit.c,v 1.1 2014/07/18 12:34:52 christos Exp $");
+
+#include <sys/param.h>
+#include <sys/mman.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+static long page;
+
+static void *
+makemap(int v, int f) {
+ void *map = mmap(NULL, page, PROT_READ|PROT_WRITE,
+ MAP_SHARED|MAP_ANON, -1, 0);
+ ATF_REQUIRE(map != MAP_FAILED);
+ memset(map, v, page);
+ if (f != 666)
+ ATF_REQUIRE(minherit(map, page, f) == 0);
+ else
+ ATF_REQUIRE(minherit(map, page, f) == -1);
+ return map;
+}
+
+ATF_TC(minherit_copy);
+ATF_TC_HEAD(minherit_copy, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test for MAP_INHERIT_COPY from minherit(2)");
+}
+
+ATF_TC_BODY(minherit_copy, tc)
+{
+ void *map1 = makemap(1, MAP_INHERIT_COPY);
+ void *map2 = makemap(1, MAP_INHERIT_COPY);
+ switch (fork()) {
+ default:
+ ATF_REQUIRE(wait(NULL) != -1);
+ ATF_REQUIRE(memcmp(map1, map2, page) == 0);
+ break;
+ case -1:
+ ATF_REQUIRE(0);
+ break;
+ case 0:
+ ATF_REQUIRE(memcmp(map1, map2, page) == 0);
+ memset(map1, 0, page);
+ exit(0);
+ }
+}
+
+ATF_TC(minherit_share);
+ATF_TC_HEAD(minherit_share, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test for MAP_INHERIT_SHARE from minherit(2)");
+}
+
+ATF_TC_BODY(minherit_share, tc)
+{
+ void *map1 = makemap(1, MAP_INHERIT_SHARE);
+ void *map2 = makemap(1, MAP_INHERIT_SHARE);
+
+ switch (fork()) {
+ default:
+ ATF_REQUIRE(wait(NULL) != -1);
+ memset(map2, 0, page);
+ ATF_REQUIRE(memcmp(map1, map2, page) == 0);
+ break;
+ case -1:
+ ATF_REQUIRE(0);
+ break;
+ case 0:
+ ATF_REQUIRE(memcmp(map1, map2, page) == 0);
+ memset(map1, 0, page);
+ exit(0);
+ }
+}
+
+static void
+segv(int n) {
+ _exit(n);
+}
+
+ATF_TC(minherit_none);
+ATF_TC_HEAD(minherit_none, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test for MAP_INHERIT_NONE from minherit(2)");
+}
+
+ATF_TC_BODY(minherit_none, tc)
+{
+ void *map1 = makemap(0, MAP_INHERIT_NONE);
+ int status;
+
+ switch (fork()) {
+ default:
+ ATF_REQUIRE(wait(&status) != -1);
+ ATF_REQUIRE(WEXITSTATUS(status) == SIGSEGV);
+ break;
+ case -1:
+ ATF_REQUIRE(0);
+ break;
+ case 0:
+ ATF_REQUIRE(signal(SIGSEGV, segv) != SIG_ERR);
+ memset(map1, 0, page);
+ exit(0);
+ }
+}
+
+ATF_TC(minherit_zero);
+ATF_TC_HEAD(minherit_zero, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test for MAP_INHERIT_ZERO from minherit(2)");
+}
+
+ATF_TC_BODY(minherit_zero, tc)
+{
+ void *map1 = makemap(1, MAP_INHERIT_ZERO);
+ void *map2 = makemap(0, MAP_INHERIT_SHARE);
+
+ switch (fork()) {
+ default:
+ ATF_REQUIRE(wait(NULL) != -1);
+ memset(map2, 1, page);
+ ATF_REQUIRE(memcmp(map1, map2, page) == 0);
+ break;
+ case -1:
+ ATF_REQUIRE(0);
+ break;
+ case 0:
+ ATF_REQUIRE(memcmp(map1, map2, page) == 0);
+ memset(map1, 2, page);
+ exit(0);
+ }
+}
+
+ATF_TC(minherit_bad);
+ATF_TC_HEAD(minherit_bad, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test for bad minherit(2)");
+}
+
+ATF_TC_BODY(minherit_bad, tc)
+{
+ (void)makemap(0, 666);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ page = sysconf(_SC_PAGESIZE);
+ ATF_REQUIRE(page >= 0);
+
+ ATF_TP_ADD_TC(tp, minherit_copy);
+ ATF_TP_ADD_TC(tp, minherit_share);
+ ATF_TP_ADD_TC(tp, minherit_none);
+ ATF_TP_ADD_TC(tp, minherit_zero);
+ ATF_TP_ADD_TC(tp, minherit_bad);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mkdir.c b/contrib/netbsd-tests/lib/libc/sys/t_mkdir.c
new file mode 100644
index 0000000..d97a20b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mkdir.c
@@ -0,0 +1,210 @@
+/* $NetBSD: t_mkdir.c,v 1.2 2011/10/15 07:38:31 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2008, 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe and Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_mkdir.c,v 1.2 2011/10/15 07:38:31 jruoho Exp $");
+
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+ATF_TC(mkdir_err);
+ATF_TC_HEAD(mkdir_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks errors from mkdir(2)");
+}
+
+ATF_TC_BODY(mkdir_err, tc)
+{
+ char buf[PATH_MAX + 1];
+ int fd;
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ fd = open("/etc", O_RDONLY);
+
+ if (fd >= 0) {
+
+ (void)close(fd);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EEXIST, mkdir("/etc", 0500) == -1);
+ }
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, mkdir((void *)-1, 0500) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, mkdir(buf, 0500) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, mkdir("/a/b/c/d/e/f/g/h/i/j/k", 0500) == -1);
+}
+
+ATF_TC_WITH_CLEANUP(mkdir_perm);
+ATF_TC_HEAD(mkdir_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks permissions with mkdir(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(mkdir_perm, tc)
+{
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EACCES, mkdir("/usr/__nonexistent__", 0500) == -1);
+}
+
+ATF_TC_CLEANUP(mkdir_perm, tc)
+{
+ (void)rmdir("/usr/__nonexistent__");
+}
+
+ATF_TC_WITH_CLEANUP(mkdir_mode);
+ATF_TC_HEAD(mkdir_mode, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that UIDs and GIDs are right "
+ "for a directory created with mkdir(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(mkdir_mode, tc)
+{
+ static const char *path = "/tmp/mkdir";
+ struct stat st_a, st_b;
+ struct passwd *pw;
+ pid_t pid;
+ int sta;
+
+ (void)memset(&st_a, 0, sizeof(struct stat));
+ (void)memset(&st_b, 0, sizeof(struct stat));
+
+ pw = getpwnam("nobody");
+
+ ATF_REQUIRE(pw != NULL);
+ ATF_REQUIRE(stat("/tmp", &st_a) == 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (setuid(pw->pw_uid) != 0)
+ _exit(EXIT_FAILURE);
+
+ if (mkdir(path, 0500) != 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)sleep(1);
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("failed to create '%s'", path);
+
+ ATF_REQUIRE(stat(path, &st_b) == 0);
+ ATF_REQUIRE(rmdir(path) == 0);
+
+ /*
+ * The directory's owner ID should be set to the
+ * effective UID, whereas the group ID should be
+ * set to that of the parent directory.
+ */
+ if (st_b.st_uid != pw->pw_uid)
+ atf_tc_fail("invalid UID for '%s'", path);
+
+ if (st_b.st_gid != st_a.st_gid)
+ atf_tc_fail("GID did not follow the parent directory");
+}
+
+ATF_TC_CLEANUP(mkdir_mode, tc)
+{
+ (void)rmdir("/tmp/mkdir");
+}
+
+ATF_TC(mkdir_trail);
+ATF_TC_HEAD(mkdir_trail, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks mkdir(2) for trailing slashes");
+}
+
+ATF_TC_BODY(mkdir_trail, tc)
+{
+ const char *tests[] = {
+ /*
+ * IEEE 1003.1 second ed. 2.2.2.78:
+ *
+ * If the pathname refers to a directory, it may also have
+ * one or more trailing slashes. Multiple successive slashes
+ * are considered to be the same as one slash.
+ */
+ "dir1/",
+ "dir2//",
+
+ NULL,
+ };
+
+ const char **test;
+
+ for (test = &tests[0]; *test != NULL; ++test) {
+
+ (void)printf("Checking \"%s\"\n", *test);
+ (void)rmdir(*test);
+
+ ATF_REQUIRE(mkdir(*test, 0777) == 0);
+ ATF_REQUIRE(rename(*test, "foo") == 0);
+ ATF_REQUIRE(rename("foo/", *test) == 0);
+ ATF_REQUIRE(rmdir(*test) == 0);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mkdir_err);
+ ATF_TP_ADD_TC(tp, mkdir_perm);
+ ATF_TP_ADD_TC(tp, mkdir_mode);
+ ATF_TP_ADD_TC(tp, mkdir_trail);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mkfifo.c b/contrib/netbsd-tests/lib/libc/sys/t_mkfifo.c
new file mode 100644
index 0000000..56bc4c8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mkfifo.c
@@ -0,0 +1,276 @@
+/* $NetBSD: t_mkfifo.c,v 1.2 2011/11/02 06:04:48 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mkfifo.c,v 1.2 2011/11/02 06:04:48 jruoho Exp $");
+
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char path[] = "fifo";
+static void support(void);
+
+static void
+support(void)
+{
+
+ errno = 0;
+
+ if (mkfifo(path, 0600) == 0) {
+ ATF_REQUIRE(unlink(path) == 0);
+ return;
+ }
+
+ if (errno == EOPNOTSUPP)
+ atf_tc_skip("the kernel does not support FIFOs");
+ else {
+ atf_tc_fail("mkfifo(2) failed");
+ }
+}
+
+ATF_TC_WITH_CLEANUP(mkfifo_block);
+ATF_TC_HEAD(mkfifo_block, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that FIFOs block");
+}
+
+ATF_TC_BODY(mkfifo_block, tc)
+{
+ int sta, fd = -1;
+ pid_t pid;
+
+ support();
+
+ ATF_REQUIRE(mkfifo(path, 0600) == 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ /*
+ * If we open the FIFO as read-only (write-only),
+ * the call should block until another process
+ * opens the FIFO for writing (reading).
+ */
+ fd = open(path, O_RDONLY);
+
+ _exit(EXIT_FAILURE); /* NOTREACHED */
+ }
+
+ (void)sleep(1);
+
+ ATF_REQUIRE(kill(pid, SIGKILL) == 0);
+
+ (void)wait(&sta);
+
+ if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != SIGKILL)
+ atf_tc_fail("FIFO did not block");
+
+ (void)close(fd);
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(mkfifo_block, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mkfifo_err);
+ATF_TC_HEAD(mkfifo_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erros from mkfifo(2)");
+}
+
+ATF_TC_BODY(mkfifo_err, tc)
+{
+ char buf[PATH_MAX + 1];
+
+ support();
+
+ (void)memset(buf, 'x', sizeof(buf));
+ ATF_REQUIRE(mkfifo(path, 0600) == 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, mkfifo((char *)-1, 0600) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EEXIST, mkfifo("/etc/passwd", 0600) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EEXIST, mkfifo(path, 0600) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, mkfifo(buf, 0600) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, mkfifo("/a/b/c/d/e/f/g", 0600) == -1);
+
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(mkfifo_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mkfifo_nonblock);
+ATF_TC_HEAD(mkfifo_nonblock, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test O_NONBLOCK with FIFOs");
+}
+
+ATF_TC_BODY(mkfifo_nonblock, tc)
+{
+ int fd, sta;
+ pid_t pid;
+
+ support();
+
+ fd = -1;
+ ATF_REQUIRE(mkfifo(path, 0600) == 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ /*
+ * If we open the FIFO as O_NONBLOCK, the O_RDONLY
+ * call should return immediately, whereas the call
+ * for write-only should fail with ENXIO.
+ */
+ fd = open(path, O_RDONLY | O_NONBLOCK);
+
+ if (fd >= 0)
+ _exit(EXIT_SUCCESS);
+
+ (void)pause(); /* NOTREACHED */
+ }
+
+ (void)sleep(1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENXIO, open(path, O_WRONLY | O_NONBLOCK) == -1);
+
+ (void)kill(pid, SIGKILL);
+ (void)wait(&sta);
+
+ if (WIFSIGNALED(sta) != 0 || WTERMSIG(sta) == SIGKILL)
+ atf_tc_fail("FIFO blocked for O_NONBLOCK open(2)");
+
+ (void)close(fd);
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(mkfifo_nonblock, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mkfifo_perm);
+ATF_TC_HEAD(mkfifo_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with mkfifo(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(mkfifo_perm, tc)
+{
+
+ support();
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EACCES, mkfifo("/root/fifo", 0600) == -1);
+
+ ATF_REQUIRE(mkfifo(path, 0600) == 0);
+
+ /*
+ * For some reason this fails with EFTYPE...
+ */
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFTYPE, chmod(path, 1777) == -1);
+
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(mkfifo_perm, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mkfifo_stat);
+ATF_TC_HEAD(mkfifo_stat, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mkfifo(2) with stat");
+}
+
+ATF_TC_BODY(mkfifo_stat, tc)
+{
+ struct stat st;
+
+ support();
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(mkfifo(path, 0600) == 0);
+ ATF_REQUIRE(stat(path, &st) == 0);
+
+ if (S_ISFIFO(st.st_mode) == 0)
+ atf_tc_fail("invalid mode from mkfifo(2)");
+
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(mkfifo_stat, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mkfifo_block);
+ ATF_TP_ADD_TC(tp, mkfifo_err);
+ ATF_TP_ADD_TC(tp, mkfifo_nonblock);
+ ATF_TP_ADD_TC(tp, mkfifo_perm);
+ ATF_TP_ADD_TC(tp, mkfifo_stat);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mknod.c b/contrib/netbsd-tests/lib/libc/sys/t_mknod.c
new file mode 100644
index 0000000..b394b31
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mknod.c
@@ -0,0 +1,192 @@
+/* $NetBSD: t_mknod.c,v 1.2 2012/03/18 07:00:52 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mknod.c,v 1.2 2012/03/18 07:00:52 jruoho Exp $");
+
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+static char path[] = "node";
+
+ATF_TC_WITH_CLEANUP(mknod_err);
+ATF_TC_HEAD(mknod_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test error conditions of mknod(2) (PR kern/45111)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(mknod_err, tc)
+{
+ char buf[PATH_MAX + 1];
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, mknod(path, S_IFCHR, -1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, mknod(buf, S_IFCHR, 0) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, mknod((char *)-1, S_IFCHR, 0) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, mknod("/a/b/c/d/e/f/g", S_IFCHR, 0) == -1);
+}
+
+ATF_TC_CLEANUP(mknod_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mknod_exist);
+ATF_TC_HEAD(mknod_exist, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test EEXIST from mknod(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(mknod_exist, tc)
+{
+ int fd;
+
+ fd = open("/etc/passwd", O_RDONLY);
+
+ if (fd >= 0) {
+
+ (void)close(fd);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EEXIST,
+ mknod("/etc/passwd", S_IFCHR, 0) == -1);
+ }
+
+ ATF_REQUIRE(mknod(path, S_IFCHR, 0) == 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EEXIST, mknod(path, S_IFCHR, 0) == -1);
+
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(mknod_exist, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mknod_perm);
+ATF_TC_HEAD(mknod_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions of mknod(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(mknod_perm, tc)
+{
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EPERM, mknod(path, S_IFCHR, 0) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EPERM, mknod(path, S_IFBLK, 0) == -1);
+}
+
+ATF_TC_CLEANUP(mknod_perm, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mknod_stat);
+ATF_TC_HEAD(mknod_stat, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of mknod(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(mknod_stat, tc)
+{
+ struct stat st;
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(mknod(path, S_IFCHR, 0) == 0);
+ ATF_REQUIRE(stat(path, &st) == 0);
+
+ if (S_ISCHR(st.st_mode) == 0)
+ atf_tc_fail_nonfatal("invalid mode from mknod(2) (S_IFCHR)");
+
+ ATF_REQUIRE(unlink(path) == 0);
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(mknod(path, S_IFBLK, 0) == 0);
+ ATF_REQUIRE(stat(path, &st) == 0);
+
+ if (S_ISBLK(st.st_mode) == 0)
+ atf_tc_fail_nonfatal("invalid mode from mknod(2) (S_IFBLK)");
+
+ ATF_REQUIRE(unlink(path) == 0);
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(mknod(path, S_IFREG, 0) == 0);
+ ATF_REQUIRE(stat(path, &st) == 0);
+
+ if (S_ISREG(st.st_mode) == 0)
+ atf_tc_fail_nonfatal("invalid mode from mknod(2) (S_IFREG)");
+
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(mknod_stat, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, mknod_err);
+ ATF_TP_ADD_TC(tp, mknod_exist);
+ ATF_TP_ADD_TC(tp, mknod_perm);
+ ATF_TP_ADD_TC(tp, mknod_stat);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mlock.c b/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
new file mode 100644
index 0000000..52576f7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
@@ -0,0 +1,244 @@
+/* $NetBSD: t_mlock.c,v 1.5 2014/02/26 20:49:26 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mlock.c,v 1.5 2014/02/26 20:49:26 martin Exp $");
+
+#include <sys/mman.h>
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <atf-c.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+static long page = 0;
+
+ATF_TC(mlock_clip);
+ATF_TC_HEAD(mlock_clip, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test with mlock(2) that UVM only "
+ "clips if the clip address is within the entry (PR kern/44788)");
+}
+
+ATF_TC_BODY(mlock_clip, tc)
+{
+ void *buf;
+
+ buf = malloc(page);
+ ATF_REQUIRE(buf != NULL);
+
+ if (page < 1024)
+ atf_tc_skip("page size too small");
+
+ for (size_t i = page; i >= 1; i = i - 1024) {
+ (void)mlock(buf, page - i);
+ (void)munlock(buf, page - i);
+ }
+
+ free(buf);
+}
+
+ATF_TC(mlock_err);
+ATF_TC_HEAD(mlock_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test error conditions in mlock(2) and munlock(2)");
+}
+
+ATF_TC_BODY(mlock_err, tc)
+{
+ unsigned long vmin = 0;
+ size_t len = sizeof(vmin);
+ void *invalid_ptr;
+ int null_errno = ENOMEM; /* error expected for NULL */
+
+ if (sysctlbyname("vm.minaddress", &vmin, &len, NULL, 0) != 0)
+ atf_tc_fail("failed to read vm.minaddress");
+
+ if (vmin > 0)
+ null_errno = EINVAL; /* NULL is not inside user VM */
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(null_errno, mlock(NULL, page) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(null_errno, mlock((char *)0, page) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, mlock((char *)-1, page) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(null_errno, munlock(NULL, page) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(null_errno, munlock((char *)0, page) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, munlock((char *)-1, page) == -1);
+
+ /*
+ * Try to create a pointer to an unmapped page - first after current
+ * brk will likely do.
+ */
+ invalid_ptr = (void*)(((uintptr_t)sbrk(0)+page) & ~(page-1));
+ printf("testing with (hopefully) invalid pointer %p\n", invalid_ptr);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOMEM, mlock(invalid_ptr, page) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOMEM, munlock(invalid_ptr, page) == -1);
+}
+
+ATF_TC(mlock_limits);
+ATF_TC_HEAD(mlock_limits, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test system limits with mlock(2)");
+}
+
+ATF_TC_BODY(mlock_limits, tc)
+{
+ struct rlimit res;
+ void *buf;
+ pid_t pid;
+ int sta;
+
+ buf = malloc(page);
+ ATF_REQUIRE(buf != NULL);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ for (ssize_t i = page; i >= 2; i -= 100) {
+
+ res.rlim_cur = i - 1;
+ res.rlim_max = i - 1;
+
+ (void)fprintf(stderr, "trying to lock %zd bytes "
+ "with %zu byte limit\n", i, (size_t)res.rlim_cur);
+
+ if (setrlimit(RLIMIT_MEMLOCK, &res) != 0)
+ _exit(EXIT_FAILURE);
+
+ errno = 0;
+
+ if (mlock(buf, i) != -1 || errno != EAGAIN) {
+ (void)munlock(buf, i);
+ _exit(EXIT_FAILURE);
+ }
+ }
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("mlock(2) locked beyond system limits");
+
+ free(buf);
+}
+
+ATF_TC(mlock_mmap);
+ATF_TC_HEAD(mlock_mmap, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mlock(2)-mmap(2) interaction");
+}
+
+ATF_TC_BODY(mlock_mmap, tc)
+{
+ static const int flags = MAP_ANON | MAP_PRIVATE | MAP_WIRED;
+ void *buf;
+
+ /*
+ * Make a wired RW mapping and check that mlock(2)
+ * does not fail for the (already locked) mapping.
+ */
+ buf = mmap(NULL, page, PROT_READ | PROT_WRITE, flags, -1, 0);
+
+ ATF_REQUIRE(buf != MAP_FAILED);
+ ATF_REQUIRE(mlock(buf, page) == 0);
+ ATF_REQUIRE(munlock(buf, page) == 0);
+ ATF_REQUIRE(munmap(buf, page) == 0);
+ ATF_REQUIRE(munlock(buf, page) != 0);
+
+ /*
+ * But it should be impossible to mlock(2) a PROT_NONE mapping.
+ */
+ buf = mmap(NULL, page, PROT_NONE, flags, -1, 0);
+
+ ATF_REQUIRE(buf != MAP_FAILED);
+ ATF_REQUIRE(mlock(buf, page) != 0);
+ ATF_REQUIRE(munmap(buf, page) == 0);
+}
+
+ATF_TC(mlock_nested);
+ATF_TC_HEAD(mlock_nested, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that consecutive mlock(2) calls succeed");
+}
+
+ATF_TC_BODY(mlock_nested, tc)
+{
+ const size_t maxiter = 100;
+ void *buf;
+
+ buf = malloc(page);
+ ATF_REQUIRE(buf != NULL);
+
+ for (size_t i = 0; i < maxiter; i++)
+ ATF_REQUIRE(mlock(buf, page) == 0);
+
+ ATF_REQUIRE(munlock(buf, page) == 0);
+ free(buf);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ page = sysconf(_SC_PAGESIZE);
+ ATF_REQUIRE(page >= 0);
+
+ ATF_TP_ADD_TC(tp, mlock_clip);
+ ATF_TP_ADD_TC(tp, mlock_err);
+ ATF_TP_ADD_TC(tp, mlock_limits);
+ ATF_TP_ADD_TC(tp, mlock_mmap);
+ ATF_TP_ADD_TC(tp, mlock_nested);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mmap.c b/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
new file mode 100644
index 0000000..c6b97b1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
@@ -0,0 +1,505 @@
+/* $NetBSD: t_mmap.c,v 1.7 2012/06/14 17:47:58 bouyer Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c)2004 YAMAMOTO Takashi,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mmap.c,v 1.7 2012/06/14 17:47:58 bouyer Exp $");
+
+#include <sys/param.h>
+#include <sys/mman.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <paths.h>
+#include <machine/disklabel.h>
+
+static long page = 0;
+static char path[] = "mmap";
+static void map_check(void *, int);
+static void map_sighandler(int);
+static void testloan(void *, void *, char, int);
+
+#define BUFSIZE (32 * 1024) /* enough size to trigger sosend_loan */
+
+static void
+map_check(void *map, int flag)
+{
+
+ if (flag != 0) {
+ ATF_REQUIRE(map == MAP_FAILED);
+ return;
+ }
+
+ ATF_REQUIRE(map != MAP_FAILED);
+ ATF_REQUIRE(munmap(map, page) == 0);
+}
+
+void
+testloan(void *vp, void *vp2, char pat, int docheck)
+{
+ char buf[BUFSIZE];
+ char backup[BUFSIZE];
+ ssize_t nwritten;
+ ssize_t nread;
+ int fds[2];
+ int val;
+
+ val = BUFSIZE;
+
+ if (docheck != 0)
+ (void)memcpy(backup, vp, BUFSIZE);
+
+ if (socketpair(AF_LOCAL, SOCK_STREAM, PF_UNSPEC, fds) != 0)
+ atf_tc_fail("socketpair() failed");
+
+ val = BUFSIZE;
+
+ if (setsockopt(fds[1], SOL_SOCKET, SO_RCVBUF, &val, sizeof(val)) != 0)
+ atf_tc_fail("setsockopt() failed, SO_RCVBUF");
+
+ val = BUFSIZE;
+
+ if (setsockopt(fds[0], SOL_SOCKET, SO_SNDBUF, &val, sizeof(val)) != 0)
+ atf_tc_fail("setsockopt() failed, SO_SNDBUF");
+
+ if (fcntl(fds[0], F_SETFL, O_NONBLOCK) != 0)
+ atf_tc_fail("fcntl() failed");
+
+ nwritten = write(fds[0], (char *)vp + page, BUFSIZE - page);
+
+ if (nwritten == -1)
+ atf_tc_fail("write() failed");
+
+ /* Break loan. */
+ (void)memset(vp2, pat, BUFSIZE);
+
+ nread = read(fds[1], buf + page, BUFSIZE - page);
+
+ if (nread == -1)
+ atf_tc_fail("read() failed");
+
+ if (nread != nwritten)
+ atf_tc_fail("too short read");
+
+ if (docheck != 0 && memcmp(backup, buf + page, nread) != 0)
+ atf_tc_fail("data mismatch");
+
+ ATF_REQUIRE(close(fds[0]) == 0);
+ ATF_REQUIRE(close(fds[1]) == 0);
+}
+
+static void
+map_sighandler(int signo)
+{
+ _exit(signo);
+}
+
+ATF_TC(mmap_block);
+ATF_TC_HEAD(mmap_block, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mmap(2) with a block device");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(mmap_block, tc)
+{
+ static const int mib[] = { CTL_HW, HW_DISKNAMES };
+ static const unsigned int miblen = __arraycount(mib);
+ char *map, *dk, *drives, dev[PATH_MAX];
+ size_t len;
+ int fd = -1;
+
+ atf_tc_skip("The test case causes a panic (PR kern/38889, kern/46592)");
+
+ ATF_REQUIRE(sysctl(mib, miblen, NULL, &len, NULL, 0) == 0);
+ drives = malloc(len);
+ ATF_REQUIRE(drives != NULL);
+ ATF_REQUIRE(sysctl(mib, miblen, drives, &len, NULL, 0) == 0);
+ for (dk = strtok(drives, " "); dk != NULL; dk = strtok(NULL, " ")) {
+ sprintf(dev, _PATH_DEV "%s%c", dk, 'a'+RAW_PART);
+ fprintf(stderr, "trying: %s\n", dev);
+
+ if ((fd = open(dev, O_RDONLY)) >= 0) {
+ (void)fprintf(stderr, "using %s\n", dev);
+ break;
+ }
+ }
+ free(drives);
+
+ if (fd < 0)
+ atf_tc_skip("failed to find suitable block device");
+
+ map = mmap(NULL, 4096, PROT_READ, MAP_FILE, fd, 0);
+ ATF_REQUIRE(map != MAP_FAILED);
+
+ (void)fprintf(stderr, "first byte %x\n", *map);
+ ATF_REQUIRE(close(fd) == 0);
+ (void)fprintf(stderr, "first byte %x\n", *map);
+
+ ATF_REQUIRE(munmap(map, 4096) == 0);
+}
+
+ATF_TC(mmap_err);
+ATF_TC_HEAD(mmap_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of mmap(2)");
+}
+
+ATF_TC_BODY(mmap_err, tc)
+{
+ size_t addr = SIZE_MAX;
+ void *map;
+
+ errno = 0;
+ map = mmap(NULL, 3, PROT_READ, MAP_FILE|MAP_PRIVATE, -1, 0);
+
+ ATF_REQUIRE(map == MAP_FAILED);
+ ATF_REQUIRE(errno == EBADF);
+
+ errno = 0;
+ map = mmap(&addr, page, PROT_READ, MAP_FIXED|MAP_PRIVATE, -1, 0);
+
+ ATF_REQUIRE(map == MAP_FAILED);
+ ATF_REQUIRE(errno == EINVAL);
+
+ errno = 0;
+ map = mmap(NULL, page, PROT_READ, MAP_ANON|MAP_PRIVATE, INT_MAX, 0);
+
+ ATF_REQUIRE(map == MAP_FAILED);
+ ATF_REQUIRE(errno == EINVAL);
+}
+
+ATF_TC_WITH_CLEANUP(mmap_loan);
+ATF_TC_HEAD(mmap_loan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test uvm page loanout with mmap(2)");
+}
+
+ATF_TC_BODY(mmap_loan, tc)
+{
+ char buf[BUFSIZE];
+ char *vp, *vp2;
+ int fd;
+
+ fd = open(path, O_RDWR | O_CREAT, 0600);
+ ATF_REQUIRE(fd >= 0);
+
+ (void)memset(buf, 'x', sizeof(buf));
+ (void)write(fd, buf, sizeof(buf));
+
+ vp = mmap(NULL, BUFSIZE, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_PRIVATE, fd, 0);
+
+ ATF_REQUIRE(vp != MAP_FAILED);
+
+ vp2 = vp;
+
+ testloan(vp, vp2, 'A', 0);
+ testloan(vp, vp2, 'B', 1);
+
+ ATF_REQUIRE(munmap(vp, BUFSIZE) == 0);
+
+ vp = mmap(NULL, BUFSIZE, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_SHARED, fd, 0);
+
+ vp2 = mmap(NULL, BUFSIZE, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_SHARED, fd, 0);
+
+ ATF_REQUIRE(vp != MAP_FAILED);
+ ATF_REQUIRE(vp2 != MAP_FAILED);
+
+ testloan(vp, vp2, 'E', 1);
+
+ ATF_REQUIRE(munmap(vp, BUFSIZE) == 0);
+ ATF_REQUIRE(munmap(vp2, BUFSIZE) == 0);
+}
+
+ATF_TC_CLEANUP(mmap_loan, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mmap_prot_1);
+ATF_TC_HEAD(mmap_prot_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mmap(2) protections, #1");
+}
+
+ATF_TC_BODY(mmap_prot_1, tc)
+{
+ void *map;
+ int fd;
+
+ /*
+ * Open a file write-only and try to
+ * map it read-only. This should fail.
+ */
+ fd = open(path, O_WRONLY | O_CREAT, 0700);
+
+ if (fd < 0)
+ return;
+
+ ATF_REQUIRE(write(fd, "XXX", 3) == 3);
+
+ map = mmap(NULL, 3, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, 0);
+ map_check(map, 1);
+
+ map = mmap(NULL, 3, PROT_WRITE, MAP_FILE|MAP_PRIVATE, fd, 0);
+ map_check(map, 0);
+
+ ATF_REQUIRE(close(fd) == 0);
+}
+
+ATF_TC_CLEANUP(mmap_prot_1, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(mmap_prot_2);
+ATF_TC_HEAD(mmap_prot_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mmap(2) protections, #2");
+}
+
+ATF_TC_BODY(mmap_prot_2, tc)
+{
+ char buf[2];
+ void *map;
+ pid_t pid;
+ int sta;
+
+ /*
+ * Make a PROT_NONE mapping and try to access it.
+ * If we catch a SIGSEGV, all works as expected.
+ */
+ map = mmap(NULL, page, PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0);
+ ATF_REQUIRE(map != MAP_FAILED);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+ ATF_REQUIRE(signal(SIGSEGV, map_sighandler) != SIG_ERR);
+ ATF_REQUIRE(strlcpy(buf, map, sizeof(buf)) != 0);
+ }
+
+ (void)wait(&sta);
+
+ ATF_REQUIRE(WIFEXITED(sta) != 0);
+ ATF_REQUIRE(WEXITSTATUS(sta) == SIGSEGV);
+ ATF_REQUIRE(munmap(map, page) == 0);
+}
+
+ATF_TC_WITH_CLEANUP(mmap_prot_3);
+ATF_TC_HEAD(mmap_prot_3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mmap(2) protections, #3");
+}
+
+ATF_TC_BODY(mmap_prot_3, tc)
+{
+ char buf[2];
+ int fd, sta;
+ void *map;
+ pid_t pid;
+
+ /*
+ * Open a file, change the permissions
+ * to read-only, and try to map it as
+ * PROT_NONE. This should succeed, but
+ * the access should generate SIGSEGV.
+ */
+ fd = open(path, O_RDWR | O_CREAT, 0700);
+
+ if (fd < 0)
+ return;
+
+ ATF_REQUIRE(write(fd, "XXX", 3) == 3);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(chmod(path, 0444) == 0);
+
+ fd = open(path, O_RDONLY);
+ ATF_REQUIRE(fd != -1);
+
+ map = mmap(NULL, 3, PROT_NONE, MAP_FILE | MAP_SHARED, fd, 0);
+ ATF_REQUIRE(map != MAP_FAILED);
+
+ pid = fork();
+
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+ ATF_REQUIRE(signal(SIGSEGV, map_sighandler) != SIG_ERR);
+ ATF_REQUIRE(strlcpy(buf, map, sizeof(buf)) != 0);
+ }
+
+ (void)wait(&sta);
+
+ ATF_REQUIRE(WIFEXITED(sta) != 0);
+ ATF_REQUIRE(WEXITSTATUS(sta) == SIGSEGV);
+ ATF_REQUIRE(munmap(map, 3) == 0);
+}
+
+ATF_TC_CLEANUP(mmap_prot_3, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(mmap_truncate);
+ATF_TC_HEAD(mmap_truncate, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mmap(2) and ftruncate(2)");
+}
+
+ATF_TC_BODY(mmap_truncate, tc)
+{
+ char *map;
+ long i;
+ int fd;
+
+ fd = open(path, O_RDWR | O_CREAT, 0700);
+
+ if (fd < 0)
+ return;
+
+ /*
+ * See that ftruncate(2) works
+ * while the file is mapped.
+ */
+ ATF_REQUIRE(ftruncate(fd, page) == 0);
+
+ map = mmap(NULL, page, PROT_READ | PROT_WRITE, MAP_FILE|MAP_PRIVATE,
+ fd, 0);
+ ATF_REQUIRE(map != MAP_FAILED);
+
+ for (i = 0; i < page; i++)
+ map[i] = 'x';
+
+ ATF_REQUIRE(ftruncate(fd, 0) == 0);
+ ATF_REQUIRE(ftruncate(fd, page / 8) == 0);
+ ATF_REQUIRE(ftruncate(fd, page / 4) == 0);
+ ATF_REQUIRE(ftruncate(fd, page / 2) == 0);
+ ATF_REQUIRE(ftruncate(fd, page / 12) == 0);
+ ATF_REQUIRE(ftruncate(fd, page / 64) == 0);
+
+ ATF_REQUIRE(close(fd) == 0);
+}
+
+ATF_TC_CLEANUP(mmap_truncate, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(mmap_va0);
+ATF_TC_HEAD(mmap_va0, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mmap(2) and vm.user_va0_disable");
+}
+
+ATF_TC_BODY(mmap_va0, tc)
+{
+ int flags = MAP_ANON | MAP_FIXED | MAP_PRIVATE;
+ size_t len = sizeof(int);
+ void *map;
+ int val;
+
+ /*
+ * Make an anonymous fixed mapping at zero address. If the address
+ * is restricted as noted in security(7), the syscall should fail.
+ */
+ if (sysctlbyname("vm.user_va0_disable", &val, &len, NULL, 0) != 0)
+ atf_tc_fail("failed to read vm.user_va0_disable");
+
+ map = mmap(NULL, page, PROT_EXEC, flags, -1, 0);
+ map_check(map, val);
+
+ map = mmap(NULL, page, PROT_READ, flags, -1, 0);
+ map_check(map, val);
+
+ map = mmap(NULL, page, PROT_WRITE, flags, -1, 0);
+ map_check(map, val);
+
+ map = mmap(NULL, page, PROT_READ|PROT_WRITE, flags, -1, 0);
+ map_check(map, val);
+
+ map = mmap(NULL, page, PROT_EXEC|PROT_READ|PROT_WRITE, flags, -1, 0);
+ map_check(map, val);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ page = sysconf(_SC_PAGESIZE);
+ ATF_REQUIRE(page >= 0);
+
+ ATF_TP_ADD_TC(tp, mmap_block);
+ ATF_TP_ADD_TC(tp, mmap_err);
+ ATF_TP_ADD_TC(tp, mmap_loan);
+ ATF_TP_ADD_TC(tp, mmap_prot_1);
+ ATF_TP_ADD_TC(tp, mmap_prot_2);
+ ATF_TP_ADD_TC(tp, mmap_prot_3);
+ ATF_TP_ADD_TC(tp, mmap_truncate);
+ ATF_TP_ADD_TC(tp, mmap_va0);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c b/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c
new file mode 100644
index 0000000..c534e11
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c
@@ -0,0 +1,359 @@
+/* $NetBSD: t_mprotect.c,v 1.3 2011/07/20 22:53:44 jym Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mprotect.c,v 1.3 2011/07/20 22:53:44 jym Exp $");
+
+#include <sys/param.h>
+#include <sys/mman.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../common/exec_prot.h"
+
+static long page = 0;
+static int pax_global = -1;
+static int pax_enabled = -1;
+static char path[] = "mmap";
+
+static void sighandler(int);
+static bool paxinit(void);
+static bool paxset(int, int);
+
+static void
+sighandler(int signo)
+{
+ _exit(signo);
+}
+
+static bool
+paxinit(void)
+{
+ size_t len = sizeof(int);
+ int rv;
+
+ rv = sysctlbyname("security.pax.mprotect.global",
+ &pax_global, &len, NULL, 0);
+
+ if (rv != 0)
+ return false;
+
+ rv = sysctlbyname("security.pax.mprotect.enabled",
+ &pax_enabled, &len, NULL, 0);
+
+ if (rv != 0)
+ return false;
+
+ return paxset(1, 1);
+}
+
+static bool
+paxset(int global, int enabled)
+{
+ size_t len = sizeof(int);
+ int rv;
+
+ rv = sysctlbyname("security.pax.mprotect.global",
+ NULL, NULL, &global, len);
+
+ if (rv != 0)
+ return false;
+
+ rv = sysctlbyname("security.pax.mprotect.enabled",
+ NULL, NULL, &enabled, len);
+
+ if (rv != 0)
+ return false;
+
+ return true;
+}
+
+
+ATF_TC_WITH_CLEANUP(mprotect_access);
+ATF_TC_HEAD(mprotect_access, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test for EACCES from mprotect(2)");
+}
+
+ATF_TC_BODY(mprotect_access, tc)
+{
+ int prot[2] = { PROT_NONE, PROT_READ };
+ void *map;
+ size_t i;
+ int fd;
+
+ fd = open(path, O_RDONLY | O_CREAT);
+ ATF_REQUIRE(fd >= 0);
+
+ /*
+ * The call should fail with EACCES if we try to mark
+ * a PROT_NONE or PROT_READ file/section as PROT_WRITE.
+ */
+ for (i = 0; i < __arraycount(prot); i++) {
+
+ map = mmap(NULL, page, prot[i], MAP_SHARED, fd, 0);
+
+ if (map == MAP_FAILED)
+ continue;
+
+ errno = 0;
+
+ ATF_REQUIRE(mprotect(map, page, PROT_WRITE) != 0);
+ ATF_REQUIRE(errno == EACCES);
+ ATF_REQUIRE(munmap(map, page) == 0);
+ }
+
+ ATF_REQUIRE(close(fd) == 0);
+}
+
+ATF_TC_CLEANUP(mprotect_access, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(mprotect_err);
+ATF_TC_HEAD(mprotect_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of mprotect(2)");
+}
+
+ATF_TC_BODY(mprotect_err, tc)
+{
+ errno = 0;
+
+ ATF_REQUIRE(mprotect((char *)-1, 1, PROT_READ) != 0);
+ ATF_REQUIRE(errno == EINVAL);
+}
+
+ATF_TC(mprotect_exec);
+ATF_TC_HEAD(mprotect_exec, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test mprotect(2) executable space protections");
+}
+
+/*
+ * Trivial function -- should fit into a page
+ */
+ATF_TC_BODY(mprotect_exec, tc)
+{
+ pid_t pid;
+ void *map;
+ int sta, xp_support;
+
+ xp_support = exec_prot_support();
+
+ switch (xp_support) {
+ case NOTIMPL:
+ atf_tc_skip(
+ "Execute protection callback check not implemented");
+ break;
+ case NO_XP:
+ atf_tc_skip(
+ "Host does not support executable space protection");
+ break;
+ case PARTIAL_XP: case PERPAGE_XP: default:
+ break;
+ }
+
+ /*
+ * Map a page read/write and copy a trivial assembly function inside.
+ * We will then change the mapping rights:
+ * - first by setting the execution right, and check that we can
+ * call the code found in the allocated page.
+ * - second by removing the execution right. This should generate
+ * a SIGSEGV on architectures that can enforce --x permissions.
+ */
+
+ map = mmap(NULL, page, PROT_WRITE|PROT_READ, MAP_ANON, -1, 0);
+ ATF_REQUIRE(map != MAP_FAILED);
+
+ memcpy(map, (void *)return_one,
+ (uintptr_t)return_one_end - (uintptr_t)return_one);
+
+ /* give r-x rights then call code in page */
+ ATF_REQUIRE(mprotect(map, page, PROT_EXEC|PROT_READ) == 0);
+ ATF_REQUIRE(((int (*)(void))map)() == 1);
+
+ /* remove --x right */
+ ATF_REQUIRE(mprotect(map, page, PROT_READ) == 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+ ATF_REQUIRE(signal(SIGSEGV, sighandler) != SIG_ERR);
+ ATF_CHECK(((int (*)(void))map)() == 1);
+ _exit(0);
+ }
+
+ (void)wait(&sta);
+
+ ATF_REQUIRE(munmap(map, page) == 0);
+
+ ATF_REQUIRE(WIFEXITED(sta) != 0);
+
+ switch (xp_support) {
+ case PARTIAL_XP:
+ /* Partial protection might fail; skip the test when it does */
+ if (WEXITSTATUS(sta) != SIGSEGV) {
+ atf_tc_skip("Host only supports "
+ "partial executable space protection");
+ }
+ break;
+ case PERPAGE_XP: default:
+ /* Per-page --x protection should not fail */
+ ATF_REQUIRE(WEXITSTATUS(sta) == SIGSEGV);
+ break;
+ }
+}
+
+ATF_TC(mprotect_pax);
+ATF_TC_HEAD(mprotect_pax, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "PaX restrictions and mprotect(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(mprotect_pax, tc)
+{
+ const int prot[4] = { PROT_NONE, PROT_READ, PROT_WRITE };
+ const char *str = NULL;
+ void *map;
+ size_t i;
+ int rv;
+
+ if (paxinit() != true)
+ return;
+
+ /*
+ * As noted in the original PaX documentation [1],
+ * the following restrictions should apply:
+ *
+ * (1) creating executable anonymous mappings
+ *
+ * (2) creating executable/writable file mappings
+ *
+ * (3) making a non-executable mapping executable
+ *
+ * (4) making an executable/read-only file mapping
+ * writable except for performing relocations
+ * on an ET_DYN ELF file (non-PIC shared library)
+ *
+ * The following will test only the case (3).
+ *
+ * [1] http://pax.grsecurity.net/docs/mprotect.txt
+ *
+ * (Sun Apr 3 11:06:53 EEST 2011.)
+ */
+ for (i = 0; i < __arraycount(prot); i++) {
+
+ map = mmap(NULL, page, prot[i], MAP_ANON, -1, 0);
+
+ if (map == MAP_FAILED)
+ continue;
+
+ rv = mprotect(map, 1, prot[i] | PROT_EXEC);
+
+ (void)munmap(map, page);
+
+ if (rv == 0) {
+ str = "non-executable mapping made executable";
+ goto out;
+ }
+ }
+
+out:
+ if (pax_global != -1 && pax_enabled != -1)
+ (void)paxset(pax_global, pax_enabled);
+
+ if (str != NULL)
+ atf_tc_fail("%s", str);
+}
+
+ATF_TC(mprotect_write);
+ATF_TC_HEAD(mprotect_write, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mprotect(2) write protections");
+}
+
+ATF_TC_BODY(mprotect_write, tc)
+{
+ pid_t pid;
+ void *map;
+ int sta;
+
+ /*
+ * Map a page read/write, change the protection
+ * to read-only with mprotect(2), and try to write
+ * to the page. This should generate a SIGSEGV.
+ */
+ map = mmap(NULL, page, PROT_WRITE|PROT_READ, MAP_ANON, -1, 0);
+ ATF_REQUIRE(map != MAP_FAILED);
+
+ ATF_REQUIRE(strlcpy(map, "XXX", 3) == 3);
+ ATF_REQUIRE(mprotect(map, page, PROT_READ) == 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+ ATF_REQUIRE(signal(SIGSEGV, sighandler) != SIG_ERR);
+ ATF_REQUIRE(strlcpy(map, "XXX", 3) == 0);
+ }
+
+ (void)wait(&sta);
+
+ ATF_REQUIRE(WIFEXITED(sta) != 0);
+ ATF_REQUIRE(WEXITSTATUS(sta) == SIGSEGV);
+ ATF_REQUIRE(munmap(map, page) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ page = sysconf(_SC_PAGESIZE);
+ ATF_REQUIRE(page >= 0);
+
+ ATF_TP_ADD_TC(tp, mprotect_access);
+ ATF_TP_ADD_TC(tp, mprotect_err);
+ ATF_TP_ADD_TC(tp, mprotect_exec);
+ ATF_TP_ADD_TC(tp, mprotect_pax);
+ ATF_TP_ADD_TC(tp, mprotect_write);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c b/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c
new file mode 100644
index 0000000..1e74d60
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c
@@ -0,0 +1,358 @@
+/* $NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $");
+
+#include <sys/msg.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <time.h>
+#include <unistd.h>
+
+#define MSG_KEY 12345689
+#define MSG_MTYPE_1 0x41
+
+struct msg {
+ long mtype;
+ char buf[3];
+};
+
+static void clean(void);
+
+static void
+clean(void)
+{
+ int id;
+
+ if ((id = msgget(MSG_KEY, 0)) != -1)
+ (void)msgctl(id, IPC_RMID, 0);
+}
+
+ATF_TC_WITH_CLEANUP(msgctl_err);
+ATF_TC_HEAD(msgctl_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from msgctl(2)");
+}
+
+ATF_TC_BODY(msgctl_err, tc)
+{
+ const int cmd[] = { IPC_STAT, IPC_SET, IPC_RMID };
+ struct msqid_ds msgds;
+ size_t i;
+ int id;
+
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, msgctl(id, INT_MAX, &msgds) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, msgctl(id, IPC_STAT, (void *)-1) == -1);
+
+ for (i = 0; i < __arraycount(cmd); i++) {
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, msgctl(-1, cmd[i], &msgds) == -1);
+ }
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgctl_err, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgctl_perm);
+ATF_TC_HEAD(msgctl_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with msgctl(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(msgctl_perm, tc)
+{
+ struct msqid_ds msgds;
+ struct passwd *pw;
+ pid_t pid;
+ int sta;
+ int id;
+
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+
+ pw = getpwnam("nobody");
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+
+ ATF_REQUIRE(id != -1);
+ ATF_REQUIRE(pw != NULL);
+ ATF_REQUIRE(msgctl(id, IPC_STAT, &msgds) == 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (setuid(pw->pw_uid) != 0)
+ _exit(EX_OSERR);
+
+ msgds.msg_perm.uid = getuid();
+ msgds.msg_perm.gid = getgid();
+
+ errno = 0;
+
+ if (msgctl(id, IPC_SET, &msgds) == 0)
+ _exit(EXIT_FAILURE);
+
+ if (errno != EPERM)
+ _exit(EXIT_FAILURE);
+
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+
+ if (msgctl(id, IPC_STAT, &msgds) != 0)
+ _exit(EX_OSERR);
+
+ msgds.msg_qbytes = 1;
+
+ if (msgctl(id, IPC_SET, &msgds) == 0)
+ _exit(EXIT_FAILURE);
+
+ if (errno != EPERM)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0) {
+
+ if (WEXITSTATUS(sta) == EX_OSERR)
+ atf_tc_fail("system call failed");
+
+ if (WEXITSTATUS(sta) == EXIT_FAILURE)
+ atf_tc_fail("UID %u manipulated root's "
+ "message queue", pw->pw_uid);
+ }
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgctl_perm, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgctl_pid);
+ATF_TC_HEAD(msgctl_pid, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that PIDs are updated");
+}
+
+ATF_TC_BODY(msgctl_pid, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ struct msqid_ds msgds;
+ int id, sta;
+ pid_t pid;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ (void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)sleep(1);
+ (void)wait(&sta);
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+
+ ATF_REQUIRE(msgctl(id, IPC_STAT, &msgds) == 0);
+
+ if (pid != msgds.msg_lspid)
+ atf_tc_fail("the PID of last msgsnd(2) was not updated");
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ (void)msgrcv(id, &msg,
+ sizeof(struct msg), MSG_MTYPE_1, IPC_NOWAIT);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)sleep(1);
+ (void)wait(&sta);
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+
+ ATF_REQUIRE(msgctl(id, IPC_STAT, &msgds) == 0);
+
+ if (pid != msgds.msg_lrpid)
+ atf_tc_fail("the PID of last msgrcv(2) was not updated");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgctl_pid, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgctl_set);
+ATF_TC_HEAD(msgctl_set, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test msgctl(2) with IPC_SET");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(msgctl_set, tc)
+{
+ struct msqid_ds msgds;
+ struct passwd *pw;
+ int id;
+
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+
+ pw = getpwnam("nobody");
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+
+ ATF_REQUIRE(id != -1);
+ ATF_REQUIRE(pw != NULL);
+ ATF_REQUIRE(msgctl(id, IPC_STAT, &msgds) == 0);
+
+ msgds.msg_perm.uid = pw->pw_uid;
+
+ if (msgctl(id, IPC_SET, &msgds) != 0)
+ atf_tc_fail("root failed to change the UID of message queue");
+
+ msgds.msg_perm.uid = getuid();
+ msgds.msg_perm.gid = pw->pw_gid;
+
+ if (msgctl(id, IPC_SET, &msgds) != 0)
+ atf_tc_fail("root failed to change the GID of message queue");
+
+ /*
+ * Note: setting the qbytes to zero fails even as root.
+ */
+ msgds.msg_qbytes = 1;
+ msgds.msg_perm.gid = getgid();
+
+ if (msgctl(id, IPC_SET, &msgds) != 0)
+ atf_tc_fail("root failed to change qbytes of message queue");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgctl_set, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgctl_time);
+ATF_TC_HEAD(msgctl_time, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that access times are updated");
+}
+
+ATF_TC_BODY(msgctl_time, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ struct msqid_ds msgds;
+ time_t t;
+ int id;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ t = time(NULL);
+
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+ (void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+ (void)msgctl(id, IPC_STAT, &msgds);
+
+ if (llabs(t - msgds.msg_stime) > 1)
+ atf_tc_fail("time of last msgsnd(2) was not updated");
+
+ if (msgds.msg_rtime != 0)
+ atf_tc_fail("time of last msgrcv(2) was updated incorrectly");
+
+ t = time(NULL);
+
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+ (void)msgrcv(id, &msg, sizeof(struct msg), MSG_MTYPE_1, IPC_NOWAIT);
+ (void)msgctl(id, IPC_STAT, &msgds);
+
+ if (llabs(t - msgds.msg_rtime) > 1)
+ atf_tc_fail("time of last msgrcv(2) was not updated");
+
+ /*
+ * Note: this is non-zero even after the memset(3).
+ */
+ if (msgds.msg_stime == 0)
+ atf_tc_fail("time of last msgsnd(2) was updated incorrectly");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgctl_time, tc)
+{
+ clean();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, msgctl_err);
+ ATF_TP_ADD_TC(tp, msgctl_perm);
+ ATF_TP_ADD_TC(tp, msgctl_pid);
+ ATF_TP_ADD_TC(tp, msgctl_set);
+ ATF_TP_ADD_TC(tp, msgctl_time);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgget.c b/contrib/netbsd-tests/lib/libc/sys/t_msgget.c
new file mode 100644
index 0000000..e26cde2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msgget.c
@@ -0,0 +1,292 @@
+/* $NetBSD: t_msgget.c,v 1.2 2014/02/27 00:59:50 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_msgget.c,v 1.2 2014/02/27 00:59:50 joerg Exp $");
+
+#include <sys/msg.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <time.h>
+#include <unistd.h>
+
+#define MSG_KEY 12345689
+
+static void clean(void);
+
+static void
+clean(void)
+{
+ int id;
+
+ if ((id = msgget(MSG_KEY, 0)) != -1)
+ (void)msgctl(id, IPC_RMID, 0);
+}
+
+ATF_TC_WITH_CLEANUP(msgget_excl);
+ATF_TC_HEAD(msgget_excl, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test msgget(2) with IPC_EXCL");
+}
+
+ATF_TC_BODY(msgget_excl, tc)
+{
+ int id;
+
+ /*
+ * Create a message queue and re-open it with
+ * O_CREAT and IPC_EXCL set. This should fail.
+ */
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+
+ if (id < 0)
+ atf_tc_fail("failed to create message queue");
+
+ errno = 0;
+
+ if (msgget(MSG_KEY, IPC_CREAT | IPC_EXCL | 0600) != -1)
+ atf_tc_fail("msgget(2) failed for IPC_EXCL");
+
+ ATF_REQUIRE(errno == EEXIST);
+
+ /*
+ * However, the same call should succeed
+ * when IPC_EXCL is not set in the flags.
+ */
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+
+ if (id < 0)
+ atf_tc_fail("msgget(2) failed to re-open");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgget_excl, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgget_exit);
+ATF_TC_HEAD(msgget_exit, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that XSI message queues are "
+ "not removed when the process exits");
+}
+
+ATF_TC_BODY(msgget_exit, tc)
+{
+ int id, sta;
+ pid_t pid;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (msgget(MSG_KEY, IPC_CREAT | IPC_EXCL | 0600) == -1)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("failed to create message queue");
+
+ id = msgget(MSG_KEY, 0);
+
+ if (id == -1)
+ atf_tc_fail("message queue was removed on process exit");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgget_exit, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgget_init);
+ATF_TC_HEAD(msgget_init, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that msgget(2) initializes data structures properly");
+}
+
+ATF_TC_BODY(msgget_init, tc)
+{
+ const uid_t uid = geteuid();
+ const gid_t gid = getegid();
+ struct msqid_ds msgds;
+ time_t t;
+ int id;
+
+ (void)memset(&msgds, 0x9, sizeof(struct msqid_ds));
+
+ t = time(NULL);
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+
+ ATF_REQUIRE(id !=-1);
+ ATF_REQUIRE(msgctl(id, IPC_STAT, &msgds) == 0);
+
+ ATF_CHECK(msgds.msg_qnum == 0);
+ ATF_CHECK(msgds.msg_lspid == 0);
+ ATF_CHECK(msgds.msg_lrpid == 0);
+ ATF_CHECK(msgds.msg_rtime == 0);
+ ATF_CHECK(msgds.msg_stime == 0);
+ ATF_CHECK(msgds.msg_perm.uid == uid);
+ ATF_CHECK(msgds.msg_perm.gid == gid);
+ ATF_CHECK(msgds.msg_perm.cuid == uid);
+ ATF_CHECK(msgds.msg_perm.cgid == gid);
+ ATF_CHECK(msgds.msg_perm.mode == 0600);
+
+ if (llabs(t - msgds.msg_ctime) > 5)
+ atf_tc_fail("msgget(2) initialized current time incorrectly");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgget_init, tc)
+{
+ clean();
+}
+
+ATF_TC(msgget_limit);
+ATF_TC_HEAD(msgget_limit, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test msgget(2) against system limits");
+}
+
+ATF_TC_BODY(msgget_limit, tc)
+{
+ size_t len = sizeof(int);
+ bool fail = false;
+ int i, lim = 0;
+ int *buf;
+
+ if (sysctlbyname("kern.ipc.msgmni", &lim, &len, NULL, 0) != 0)
+ atf_tc_skip("failed to read kern.ipc.msgmni sysctl");
+
+ buf = calloc(lim + 1, sizeof(*buf));
+ ATF_REQUIRE(buf != NULL);
+
+ for (i = 0; i < lim; i++) {
+
+ buf[i] = msgget(MSG_KEY + i, IPC_CREAT | IPC_EXCL | 0600);
+
+ (void)fprintf(stderr, "key[%d] = %d\n", i, buf[i]);
+
+ /*
+ * This test only works when there are zero existing
+ * message queues. Thus, bypass the unit test when
+ * this precondition is not met, for reason or another.
+ */
+ if (buf[i] == -1)
+ goto out;
+ }
+
+ i++;
+ errno = 0;
+
+ buf[i] = msgget(MSG_KEY + i, IPC_CREAT | IPC_EXCL | 0600);
+
+ if (buf[i] != -1 || errno != ENOSPC)
+ fail = true;
+
+out: /* Remember to clean-up. */
+ for (i = 0; i < lim; i++)
+ (void)msgctl(buf[i], IPC_RMID, 0);
+
+ free(buf);
+
+ if (fail != false)
+ atf_tc_fail("msgget(2) opened more than %d queues", lim);
+}
+
+ATF_TC_WITH_CLEANUP(msgget_mode);
+ATF_TC_HEAD(msgget_mode, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test different modes with msgget(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(msgget_mode, tc)
+{
+ static const mode_t mode[] = {
+ S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR, S_IRWXG, S_IRGRP,
+ S_IWGRP, S_IXGRP, S_IRWXO, S_IROTH, S_IWOTH, S_IXOTH
+ };
+
+ struct msqid_ds msgds;
+ size_t i;
+ int id;
+
+ for (i = 0; i < __arraycount(mode); i++) {
+
+ (void)fprintf(stderr, "testing mode %d\n", mode[i]);
+ (void)memset(&msgds, 0, sizeof(struct msqid_ds));
+
+ id = msgget(MSG_KEY, IPC_CREAT | IPC_EXCL | (int)mode[i]);
+
+ ATF_REQUIRE(id != -1);
+ ATF_REQUIRE(msgctl(id, IPC_STAT, &msgds) == 0);
+ ATF_REQUIRE(msgds.msg_perm.mode == mode[i]);
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+ }
+}
+
+ATF_TC_CLEANUP(msgget_mode, tc)
+{
+ clean();
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, msgget_excl);
+ ATF_TP_ADD_TC(tp, msgget_exit);
+ ATF_TP_ADD_TC(tp, msgget_init);
+ ATF_TP_ADD_TC(tp, msgget_limit);
+ ATF_TP_ADD_TC(tp, msgget_mode);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c b/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c
new file mode 100644
index 0000000..e32be26
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c
@@ -0,0 +1,342 @@
+/* $NetBSD: t_msgrcv.c,v 1.3 2013/07/24 11:44:10 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_msgrcv.c,v 1.3 2013/07/24 11:44:10 skrll Exp $");
+
+#include <sys/msg.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <time.h>
+#include <unistd.h>
+
+#define MSG_KEY 1234
+#define MSG_MTYPE_1 0x41
+#define MSG_MTYPE_2 0x42
+#define MSG_MTYPE_3 0x43
+#define MSG_LEN 3
+
+struct msg {
+ long mtype;
+ char buf[MSG_LEN];
+};
+
+static void clean(void);
+
+static void
+clean(void)
+{
+ int id;
+
+ if ((id = msgget(MSG_KEY, 0)) != -1)
+ (void)msgctl(id, IPC_RMID, 0);
+}
+
+ATF_TC_WITH_CLEANUP(msgrcv_basic);
+ATF_TC_HEAD(msgrcv_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of msgrcv(2)");
+}
+
+ATF_TC_BODY(msgrcv_basic, tc)
+{
+ struct msg msg1 = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ struct msg msg2 = { MSG_MTYPE_1, { 'x', 'y', 'z' } };
+ int id;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ (void)msgsnd(id, &msg1, MSG_LEN, IPC_NOWAIT);
+ (void)msgrcv(id, &msg2, MSG_LEN, MSG_MTYPE_1, IPC_NOWAIT);
+
+ ATF_CHECK(msg1.buf[0] == msg2.buf[0]);
+ ATF_CHECK(msg1.buf[1] == msg2.buf[1]);
+ ATF_CHECK(msg1.buf[2] == msg2.buf[2]);
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgrcv_basic, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgrcv_block);
+ATF_TC_HEAD(msgrcv_block, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that msgrcv(2) blocks");
+}
+
+ATF_TC_BODY(msgrcv_block, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ int id, sta;
+ pid_t pid;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (msgrcv(id, &msg, MSG_LEN, MSG_MTYPE_1, 0) < 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ /*
+ * Below msgsnd(2) should unblock the child,
+ * and hence kill(2) should fail with ESRCH.
+ */
+ (void)sleep(1);
+ (void)msgsnd(id, &msg, MSG_LEN, IPC_NOWAIT);
+ (void)sleep(1);
+ (void)kill(pid, SIGKILL);
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WIFSIGNALED(sta) != 0)
+ atf_tc_fail("msgrcv(2) did not block");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgrcv_block, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgrcv_err);
+ATF_TC_HEAD(msgrcv_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from msgrcv(2)");
+}
+
+ATF_TC_BODY(msgrcv_err, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ int id, r = 0;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(ENOMSG, msgrcv(id, &msg,
+ MSG_LEN, MSG_MTYPE_1, IPC_NOWAIT) == -1);
+
+ ATF_REQUIRE(msgsnd(id, &msg, MSG_LEN, IPC_NOWAIT) == 0);
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EFAULT, msgrcv(id, (void *)-1,
+ MSG_LEN, MSG_MTYPE_1, IPC_NOWAIT) == -1);
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EINVAL, msgrcv(-1, &msg,
+ MSG_LEN, MSG_MTYPE_1, IPC_NOWAIT) == -1);
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EINVAL, msgrcv(-1, &msg,
+ SSIZE_MAX, MSG_MTYPE_1, IPC_NOWAIT) == -1);
+
+ ATF_REQUIRE(msgsnd(id, &msg, MSG_LEN, IPC_NOWAIT) == 0);
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(E2BIG, msgrcv(id, &r,
+ MSG_LEN - 1, MSG_MTYPE_1, IPC_NOWAIT) == -1);
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgrcv_err, tc)
+{
+ clean();
+}
+
+
+ATF_TC_WITH_CLEANUP(msgrcv_mtype);
+ATF_TC_HEAD(msgrcv_mtype, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test message types with msgrcv(2)");
+}
+
+ATF_TC_BODY(msgrcv_mtype, tc)
+{
+ struct msg msg1 = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ struct msg msg2 = { MSG_MTYPE_3, { 'x', 'y', 'z' } };
+ int id;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ (void)msgsnd(id, &msg1, MSG_LEN, IPC_NOWAIT);
+ (void)msgrcv(id, &msg2, MSG_LEN, MSG_MTYPE_2, IPC_NOWAIT);
+
+ ATF_CHECK(msg1.buf[0] != msg2.buf[0]); /* Different mtype. */
+ ATF_CHECK(msg1.buf[1] != msg2.buf[1]);
+ ATF_CHECK(msg1.buf[2] != msg2.buf[2]);
+
+ (void)msgrcv(id, &msg2, MSG_LEN, MSG_MTYPE_1, IPC_NOWAIT);
+
+ ATF_CHECK(msg1.buf[0] == msg2.buf[0]); /* Same mtype. */
+ ATF_CHECK(msg1.buf[1] == msg2.buf[1]);
+ ATF_CHECK(msg1.buf[2] == msg2.buf[2]);
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgrcv_mtype, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgrcv_nonblock);
+ATF_TC_HEAD(msgrcv_nonblock, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test msgrcv(2) with IPC_NOWAIT");
+ atf_tc_set_md_var(tc, "timeout", "10");
+}
+
+ATF_TC_BODY(msgrcv_nonblock, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ const ssize_t n = 10;
+ int id, sta;
+ ssize_t i;
+ pid_t pid;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ for (i = 0; i < n; i++) {
+
+ ATF_REQUIRE(msgsnd(id, &msg, MSG_LEN, IPC_NOWAIT) == 0);
+ }
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ while (i != 0) {
+
+ if (msgrcv(id, &msg, MSG_LEN, MSG_MTYPE_1,
+ IPC_NOWAIT) == -1)
+ _exit(EXIT_FAILURE);
+
+ i--;
+ }
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)sleep(2);
+ (void)kill(pid, SIGKILL);
+ (void)wait(&sta);
+
+ if (WIFSIGNALED(sta) != 0 || WTERMSIG(sta) == SIGKILL)
+ atf_tc_fail("msgrcv(2) blocked with IPC_NOWAIT");
+
+ if (WIFEXITED(sta) == 0 && WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("msgrcv(2) failed");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgrcv_nonblock, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgrcv_truncate);
+ATF_TC_HEAD(msgrcv_truncate, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test msgrcv(2) with MSG_NOERROR");
+}
+
+ATF_TC_BODY(msgrcv_truncate, tc)
+{
+#define MSG_SMALLLEN 2
+ struct msgsmall {
+ long mtype;
+ char buf[MSG_SMALLLEN];
+ };
+
+ struct msg msg1 = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ struct msgsmall msg2 = { MSG_MTYPE_1, { 'x', 'y' } };
+ int id;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ (void)msgsnd(id, &msg1, MSG_LEN, IPC_NOWAIT);
+ (void)msgrcv(id, &msg2, MSG_SMALLLEN,
+ MSG_MTYPE_1, IPC_NOWAIT | MSG_NOERROR);
+
+ ATF_CHECK(msg1.buf[0] == msg2.buf[0]);
+ ATF_CHECK(msg1.buf[1] == msg2.buf[1]);
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgrcv_truncate, tc)
+{
+ clean();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, msgrcv_basic);
+ ATF_TP_ADD_TC(tp, msgrcv_block);
+ ATF_TP_ADD_TC(tp, msgrcv_err);
+ ATF_TP_ADD_TC(tp, msgrcv_mtype);
+ ATF_TP_ADD_TC(tp, msgrcv_nonblock);
+ ATF_TP_ADD_TC(tp, msgrcv_truncate);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c b/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
new file mode 100644
index 0000000..5493789
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
@@ -0,0 +1,338 @@
+/* $NetBSD: t_msgsnd.c,v 1.2 2011/11/05 08:47:54 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_msgsnd.c,v 1.2 2011/11/05 08:47:54 jruoho Exp $");
+
+#include <sys/msg.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <time.h>
+#include <unistd.h>
+
+#define MSG_KEY 1234
+#define MSG_MTYPE_1 0x41
+#define MSG_MTYPE_2 0x42
+#define MSG_MTYPE_3 0x43
+
+struct msg {
+ long mtype;
+ char buf[3];
+};
+
+static void clean(void);
+
+static void
+clean(void)
+{
+ int id;
+
+ if ((id = msgget(MSG_KEY, 0)) != -1)
+ (void)msgctl(id, IPC_RMID, 0);
+}
+
+ATF_TC_WITH_CLEANUP(msgsnd_block);
+ATF_TC_HEAD(msgsnd_block, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that msgsnd(2) blocks");
+ atf_tc_set_md_var(tc, "timeout", "10");
+}
+
+ATF_TC_BODY(msgsnd_block, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ int id, sta;
+ pid_t pid;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ /*
+ * Enqueue messages until some limit (e.g. the maximum
+ * number of messages in the queue or the maximum number
+ * of bytes in the queue) is reached. After this the call
+ * should block when the IPC_NOWAIT is not set.
+ */
+ for (;;) {
+
+ if (msgsnd(id, &msg, sizeof(struct msg), 0) < 0)
+ _exit(EXIT_FAILURE);
+ }
+ }
+
+ (void)sleep(2);
+ (void)kill(pid, SIGKILL);
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) != 0 || WIFSIGNALED(sta) == 0)
+ atf_tc_fail("msgsnd(2) did not block");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgsnd_block, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgsnd_count);
+ATF_TC_HEAD(msgsnd_count, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that msgsnd(2) increments the amount of "
+ "message in the queue, as given by msgctl(2)");
+ atf_tc_set_md_var(tc, "timeout", "10");
+}
+
+ATF_TC_BODY(msgsnd_count, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ struct msqid_ds ds;
+ size_t i = 0;
+ int id, rv;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ for (;;) {
+
+ errno = 0;
+ rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+
+ if (rv == 0) {
+ i++;
+ continue;
+ }
+
+ if (rv == -1 && errno == EAGAIN)
+ break;
+
+ atf_tc_fail("failed to enqueue a message");
+ }
+
+ (void)memset(&ds, 0, sizeof(struct msqid_ds));
+ (void)msgctl(id, IPC_STAT, &ds);
+
+ if (ds.msg_qnum != i)
+ atf_tc_fail("incorrect message count");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgsnd_count, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgsnd_err);
+ATF_TC_HEAD(msgsnd_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from msgsnd(2)");
+}
+
+ATF_TC_BODY(msgsnd_err, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ int id;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EFAULT, msgsnd(id, (void *)-1,
+ sizeof(struct msg), IPC_NOWAIT) == -1);
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EINVAL, msgsnd(-1, &msg,
+ sizeof(struct msg), IPC_NOWAIT) == -1);
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EINVAL, msgsnd(-1, &msg,
+ SSIZE_MAX, IPC_NOWAIT) == -1);
+
+ errno = 0;
+ msg.mtype = 0;
+
+ ATF_REQUIRE_ERRNO(EINVAL, msgsnd(id, &msg,
+ sizeof(struct msg), IPC_NOWAIT) == -1);
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgsnd_err, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgsnd_nonblock);
+ATF_TC_HEAD(msgsnd_nonblock, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test msgsnd(2) with IPC_NOWAIT");
+ atf_tc_set_md_var(tc, "timeout", "10");
+}
+
+ATF_TC_BODY(msgsnd_nonblock, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ int id, rv, sta;
+ pid_t pid;
+
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+ ATF_REQUIRE(id != -1);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ for (;;) {
+
+ errno = 0;
+ rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
+
+ if (rv == -1 && errno == EAGAIN)
+ _exit(EXIT_SUCCESS);
+ }
+ }
+
+ (void)sleep(2);
+ (void)kill(pid, SIGKILL);
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WIFSIGNALED(sta) != 0)
+ atf_tc_fail("msgsnd(2) blocked with IPC_NOWAIT");
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgsnd_nonblock, tc)
+{
+ clean();
+}
+
+ATF_TC_WITH_CLEANUP(msgsnd_perm);
+ATF_TC_HEAD(msgsnd_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with msgsnd(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(msgsnd_perm, tc)
+{
+ struct msg msg = { MSG_MTYPE_1, { 'a', 'b', 'c' } };
+ struct passwd *pw;
+ int id, sta;
+ pid_t pid;
+ uid_t uid;
+
+ pw = getpwnam("nobody");
+ id = msgget(MSG_KEY, IPC_CREAT | 0600);
+
+ ATF_REQUIRE(id != -1);
+ ATF_REQUIRE(pw != NULL);
+
+ uid = pw->pw_uid;
+ ATF_REQUIRE(uid != 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ /*
+ * Try to enqueue a message to the queue
+ * created by root as RW for owner only.
+ */
+ if (setuid(uid) != 0)
+ _exit(EX_OSERR);
+
+ id = msgget(MSG_KEY, 0);
+
+ if (id == -1)
+ _exit(EX_OSERR);
+
+ errno = 0;
+
+ if (msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT) == 0)
+ _exit(EXIT_FAILURE);
+
+ if (errno != EACCES)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS) {
+
+ if (errno == EX_OSERR)
+ atf_tc_fail("system call failed");
+
+ atf_tc_fail("UID %u enqueued message to root's queue", uid);
+ }
+
+ ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);
+}
+
+ATF_TC_CLEANUP(msgsnd_perm, tc)
+{
+ clean();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, msgsnd_block);
+ ATF_TP_ADD_TC(tp, msgsnd_count);
+ ATF_TP_ADD_TC(tp, msgsnd_err);
+ ATF_TP_ADD_TC(tp, msgsnd_nonblock);
+ ATF_TP_ADD_TC(tp, msgsnd_perm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msync.c b/contrib/netbsd-tests/lib/libc/sys/t_msync.c
new file mode 100644
index 0000000..9743300
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msync.c
@@ -0,0 +1,237 @@
+/* $NetBSD: t_msync.c,v 1.2 2012/03/16 06:15:17 matt Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_msync.c,v 1.2 2012/03/16 06:15:17 matt Exp $");
+
+#include <sys/mman.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static long page = 0;
+static const off_t off = 512;
+static const char path[] = "msync";
+
+static const char *msync_sync(const char *, int);
+
+static const char *
+msync_sync(const char *garbage, int flags)
+{
+ char *buf, *map = MAP_FAILED;
+ const char *str = NULL;
+ size_t i, len;
+ ssize_t tot;
+ int fd, rv;
+
+ /*
+ * Create a temporary file, write
+ * one page to it, and map the file.
+ */
+ buf = malloc(page);
+
+ if (buf == NULL)
+ return NULL;
+
+ for (i = 0; i < (size_t)page; i++)
+ buf[i] = 'x';
+
+ fd = open(path, O_RDWR | O_CREAT, 0700);
+
+ if (fd < 0) {
+ str = "failed to open";
+ goto out;
+ }
+
+ tot = 0;
+
+ while (tot < page) {
+
+ rv = write(fd, buf, sizeof(buf));
+
+ if (rv < 0) {
+ str = "failed to write";
+ goto out;
+ }
+
+ tot += rv;
+ }
+
+ map = mmap(NULL, page, PROT_READ | PROT_WRITE, MAP_FILE|MAP_PRIVATE,
+ fd, 0);
+
+ if (map == MAP_FAILED) {
+ str = "failed to map";
+ goto out;
+ }
+
+ /*
+ * Seek to an arbitrary offset and
+ * write garbage to this position.
+ */
+ if (lseek(fd, off, SEEK_SET) != off) {
+ str = "failed to seek";
+ goto out;
+ }
+
+ len = strlen(garbage);
+ rv = write(fd, garbage, len);
+
+ if (rv != (ssize_t)len) {
+ str = "failed to write garbage";
+ goto out;
+ }
+
+ /*
+ * Synchronize the mapping and verify
+ * that garbage is at the given offset.
+ */
+ if (msync(map, page, flags) != 0) {
+ str = "failed to msync";
+ goto out;
+ }
+
+ if (memcmp(map + off, garbage, len) != 0) {
+ str = "msync did not synchronize";
+ goto out;
+ }
+
+out:
+ free(buf);
+
+ (void)close(fd);
+ (void)unlink(path);
+
+ if (map != MAP_FAILED)
+ (void)munmap(map, page);
+
+ return str;
+}
+
+ATF_TC(msync_async);
+ATF_TC_HEAD(msync_async, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test of msync(2), MS_ASYNC");
+}
+
+ATF_TC_BODY(msync_async, tc)
+{
+ const char *str;
+
+ str = msync_sync("garbage", MS_ASYNC);
+
+ if (str != NULL)
+ atf_tc_fail("%s", str);
+}
+
+ATF_TC(msync_err);
+ATF_TC_HEAD(msync_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions in msync(2)");
+}
+
+ATF_TC_BODY(msync_err, tc)
+{
+
+ char *map = MAP_FAILED;
+
+ /*
+ * Test that invalid flags error out.
+ */
+ ATF_REQUIRE(msync_sync("error", -1) != NULL);
+ ATF_REQUIRE(msync_sync("error", INT_MAX) != NULL);
+
+ errno = 0;
+
+ /*
+ * Map a page and then unmap to get an unmapped address.
+ */
+ map = mmap(NULL, page, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE,
+ -1, 0);
+ ATF_REQUIRE(map != MAP_FAILED);
+
+ (void)munmap(map, page);
+
+ ATF_REQUIRE(msync(map, page, MS_SYNC) != 0);
+ ATF_REQUIRE(errno == EFAULT);
+}
+
+ATF_TC(msync_invalidate);
+ATF_TC_HEAD(msync_invalidate, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test of msync(2), MS_INVALIDATE");
+}
+
+ATF_TC_BODY(msync_invalidate, tc)
+{
+ const char *str;
+
+ str = msync_sync("garbage", MS_INVALIDATE);
+
+ if (str != NULL)
+ atf_tc_fail("%s", str);
+}
+
+ATF_TC(msync_sync);
+ATF_TC_HEAD(msync_sync, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test of msync(2), MS_SYNC");
+}
+
+ATF_TC_BODY(msync_sync, tc)
+{
+ const char *str;
+
+ str = msync_sync("garbage", MS_SYNC);
+
+ if (str != NULL)
+ atf_tc_fail("%s", str);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ page = sysconf(_SC_PAGESIZE);
+
+ ATF_REQUIRE(page >= 0);
+ ATF_REQUIRE(page > off);
+
+ ATF_TP_ADD_TC(tp, msync_async);
+ ATF_TP_ADD_TC(tp, msync_err);
+ ATF_TP_ADD_TC(tp, msync_invalidate);
+ ATF_TP_ADD_TC(tp, msync_sync);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c b/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c
new file mode 100644
index 0000000..317d667
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c
@@ -0,0 +1,187 @@
+/* $NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $");
+
+#include <sys/time.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <time.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+static void
+handler(int signo)
+{
+ /* Nothing. */
+}
+
+ATF_TC(nanosleep_basic);
+ATF_TC_HEAD(nanosleep_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that nanosleep(2) works");
+}
+
+ATF_TC_BODY(nanosleep_basic, tc)
+{
+ static const size_t maxiter = 10;
+ struct timespec ts1, ts2, tsn;
+ size_t i;
+
+ for (i = 1; i < maxiter; i++) {
+
+ tsn.tv_sec = 0;
+ tsn.tv_nsec = i;
+
+ (void)memset(&ts1, 0, sizeof(struct timespec));
+ (void)memset(&ts2, 0, sizeof(struct timespec));
+
+ ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &ts1) == 0);
+ ATF_REQUIRE(nanosleep(&tsn, NULL) == 0);
+ ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &ts2) == 0);
+
+ /*
+ * Verify that we slept at least one nanosecond.
+ */
+ if (timespeccmp(&ts2, &ts1, <=) != 0) {
+
+ (void)fprintf(stderr,
+ "sleep time:: sec %llu, nsec %lu\n\t\t"
+ "ts1: sec %llu, nsec %lu\n\t\t"
+ "ts2: sec %llu, nsec %lu\n",
+ (unsigned long long)tsn.tv_sec, tsn.tv_nsec,
+ (unsigned long long)ts1.tv_sec, ts1.tv_nsec,
+ (unsigned long long)ts2.tv_sec, ts2.tv_nsec);
+
+ atf_tc_fail_nonfatal("inaccuracies in sleep time "
+ "(resolution = %lu nsec)", tsn.tv_nsec);
+ }
+ }
+}
+
+ATF_TC(nanosleep_err);
+ATF_TC_HEAD(nanosleep_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test errors from nanosleep(2) (PR bin/14558)");
+}
+
+ATF_TC_BODY(nanosleep_err, tc)
+{
+ struct timespec ts;
+
+ ts.tv_sec = 1;
+ ts.tv_nsec = -1;
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, nanosleep(&ts, NULL) == -1);
+
+ ts.tv_sec = 1;
+ ts.tv_nsec = 1000000000;
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, nanosleep(&ts, NULL) == -1);
+
+ ts.tv_sec = -1;
+ ts.tv_nsec = 0;
+ errno = 0;
+ ATF_REQUIRE_ERRNO(0, nanosleep(&ts, NULL) == 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, nanosleep((void *)-1, NULL) == -1);
+}
+
+ATF_TC(nanosleep_sig);
+ATF_TC_HEAD(nanosleep_sig, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test signal for nanosleep(2)");
+}
+
+ATF_TC_BODY(nanosleep_sig, tc)
+{
+ struct timespec tsn, tsr;
+ pid_t pid;
+ int sta;
+
+ /*
+ * Test that a signal interrupts nanosleep(2).
+ *
+ * (In which case the return value should be -1 and the
+ * second parameter should contain the unslept time.)
+ */
+ pid = fork();
+
+ ATF_REQUIRE(pid >= 0);
+ ATF_REQUIRE(signal(SIGINT, handler) == 0);
+
+ if (pid == 0) {
+
+ tsn.tv_sec = 10;
+ tsn.tv_nsec = 0;
+
+ tsr.tv_sec = 0;
+ tsr.tv_nsec = 0;
+
+ errno = 0;
+
+ if (nanosleep(&tsn, &tsr) != -1)
+ _exit(EXIT_FAILURE);
+
+ if (errno != EINTR)
+ _exit(EXIT_FAILURE);
+
+ if (tsr.tv_sec == 0 && tsr.tv_nsec == 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)sleep(1);
+ (void)kill(pid, SIGINT);
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("signal did not interrupt nanosleep(2)");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, nanosleep_basic);
+ ATF_TP_ADD_TC(tp, nanosleep_err);
+ ATF_TP_ADD_TC(tp, nanosleep_sig);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_pipe.c b/contrib/netbsd-tests/lib/libc/sys/t_pipe.c
new file mode 100644
index 0000000..b30b94d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_pipe.c
@@ -0,0 +1,163 @@
+/* $NetBSD: t_pipe.c,v 1.3 2011/10/31 15:41:31 christos Exp $ */
+
+/*-
+ * Copyright (c) 2001, 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_pipe.c,v 1.3 2011/10/31 15:41:31 christos Exp $");
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <poll.h>
+#include <sched.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+static pid_t pid;
+static int nsiginfo = 0;
+
+/*
+ * This is used for both parent and child. Handle parent's SIGALRM,
+ * the childs SIGINFO doesn't need anything.
+ */
+static void
+sighand(int sig)
+{
+ if (sig == SIGALRM) {
+ kill(pid, SIGINFO);
+ }
+ if (sig == SIGINFO) {
+ nsiginfo++;
+ }
+}
+
+ATF_TC(pipe_restart);
+ATF_TC_HEAD(pipe_restart, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that writing to pipe "
+ "works correctly after being interrupted and restarted "
+ "(kern/14087)");
+}
+
+ATF_TC_BODY(pipe_restart, tc)
+{
+ int pp[2], st;
+ ssize_t sz, todo, done;
+ char *f;
+ sigset_t asigset, osigset, emptysigset;
+
+ /* Initialise signal masks */
+ RL(sigemptyset(&emptysigset));
+ RL(sigemptyset(&asigset));
+ RL(sigaddset(&asigset, SIGINFO));
+
+ /* Register signal handlers for both read and writer */
+ REQUIRE_LIBC(signal(SIGINFO, sighand), SIG_ERR);
+ REQUIRE_LIBC(signal(SIGALRM, sighand), SIG_ERR);
+
+ todo = 2 * 1024 * 1024;
+ REQUIRE_LIBC(f = malloc(todo), NULL);
+
+ RL(pipe(pp));
+
+ RL(pid = fork());
+ if (pid == 0) {
+ /* child */
+ RL(close(pp[1]));
+
+ /* Do inital write. This should succeed, make
+ * the other side do partial write and wait for us to pick
+ * rest up.
+ */
+ RL(done = read(pp[0], f, 128 * 1024));
+
+ /* Wait until parent is alarmed and awakens us */
+ RL(sigprocmask(SIG_BLOCK, &asigset, &osigset));
+ while (nsiginfo == 0) {
+ if (sigsuspend(&emptysigset) != -1 || errno != EINTR)
+ atf_tc_fail("sigsuspend(&emptysigset): %s",
+ strerror(errno));
+ }
+ RL(sigprocmask(SIG_SETMASK, &osigset, NULL));
+
+ /* Read all what parent wants to give us */
+ while((sz = read(pp[0], f, 1024 * 1024)) > 0)
+ done += sz;
+
+ /*
+ * Exit with 1 if number of bytes read doesn't match
+ * number of expected bytes
+ */
+ printf("Read: %#zx\n", (size_t)done);
+ printf("Expected: %#zx\n", (size_t)todo);
+
+ exit(done != todo);
+
+ /* NOTREACHED */
+ } else {
+ RL(close(pp[0]));
+
+ /*
+ * Arrange for alarm after two seconds. Since we have
+ * handler setup for SIGARLM, the write(2) call should
+ * be restarted internally by kernel.
+ */
+ (void)alarm(2);
+
+ /* We write exactly 'todo' bytes. The very first write(2)
+ * should partially succeed, block and eventually
+ * be restarted by kernel
+ */
+ while(todo > 0 && ((sz = write(pp[1], f, todo)) > 0))
+ todo -= sz;
+
+ /* Close the pipe, so that child would stop reading */
+ RL(close(pp[1]));
+
+ /* And pickup child's exit status */
+ RL(waitpid(pid, &st, 0));
+
+ ATF_REQUIRE_EQ(WEXITSTATUS(st), 0);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, pipe_restart);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c b/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c
new file mode 100644
index 0000000..51f2240
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c
@@ -0,0 +1,188 @@
+/* $NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $");
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/resource.h>
+
+static void
+run(int flags)
+{
+ int fd[2], i;
+
+ while ((i = open("/", O_RDONLY)) < 3)
+ ATF_REQUIRE(i != -1);
+
+ ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1);
+
+ ATF_REQUIRE(pipe2(fd, flags) == 0);
+
+ ATF_REQUIRE(fd[0] == 3);
+ ATF_REQUIRE(fd[1] == 4);
+
+ if (flags & O_CLOEXEC) {
+ ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) != 0);
+ ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) != 0);
+ } else {
+ ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) == 0);
+ ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) == 0);
+ }
+
+ if (flags & O_NONBLOCK) {
+ ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) != 0);
+ ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) != 0);
+ } else {
+ ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) == 0);
+ ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0);
+ }
+
+ if (flags & O_NOSIGPIPE) {
+ ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) != 0);
+ ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) != 0);
+ } else {
+ ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) == 0);
+ ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) == 0);
+ }
+
+ ATF_REQUIRE(close(fd[0]) != -1);
+ ATF_REQUIRE(close(fd[1]) != -1);
+}
+
+ATF_TC(pipe2_basic);
+ATF_TC_HEAD(pipe2_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of pipe2(2)");
+}
+
+ATF_TC_BODY(pipe2_basic, tc)
+{
+ run(0);
+}
+
+ATF_TC(pipe2_consume);
+ATF_TC_HEAD(pipe2_consume, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that consuming file descriptors "
+ "with pipe2(2) does not crash the system (PR kern/46457)");
+}
+
+ATF_TC_BODY(pipe2_consume, tc)
+{
+ struct rlimit rl;
+ int err, filedes[2];
+
+ err = fcntl(4, F_CLOSEM);
+ ATF_REQUIRE(err == 0);
+
+ err = getrlimit(RLIMIT_NOFILE, &rl);
+ ATF_REQUIRE(err == 0);
+ /*
+ * The heart of this test is to run against the number of open
+ * file descriptor limit in the middle of a pipe2() call - i.e.
+ * before the call only a single descriptor may be openend.
+ */
+ rl.rlim_cur = 4;
+ err = setrlimit(RLIMIT_NOFILE, &rl);
+ ATF_REQUIRE(err == 0);
+
+ err = pipe2(filedes, O_CLOEXEC);
+ ATF_REQUIRE(err == -1);
+}
+
+ATF_TC(pipe2_nonblock);
+ATF_TC_HEAD(pipe2_nonblock, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A non-blocking test of pipe2(2)");
+}
+
+ATF_TC_BODY(pipe2_nonblock, tc)
+{
+ run(O_NONBLOCK);
+}
+
+ATF_TC(pipe2_cloexec);
+ATF_TC_HEAD(pipe2_cloexec, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A close-on-exec test of pipe2(2)");
+}
+
+ATF_TC_BODY(pipe2_cloexec, tc)
+{
+ run(O_CLOEXEC);
+}
+
+ATF_TC(pipe2_nosigpipe);
+ATF_TC_HEAD(pipe2_nosigpipe, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A no sigpipe test of pipe2(2)");
+}
+
+ATF_TC_BODY(pipe2_nosigpipe, tc)
+{
+ run(O_NOSIGPIPE);
+}
+
+ATF_TC(pipe2_einval);
+ATF_TC_HEAD(pipe2_einval, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A error check of pipe2(2)");
+}
+
+ATF_TC_BODY(pipe2_einval, tc)
+{
+ int fd[2];
+ ATF_REQUIRE_ERRNO(EINVAL, pipe2(fd, O_ASYNC) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, pipe2_basic);
+ ATF_TP_ADD_TC(tp, pipe2_consume);
+ ATF_TP_ADD_TC(tp, pipe2_nonblock);
+ ATF_TP_ADD_TC(tp, pipe2_cloexec);
+ ATF_TP_ADD_TC(tp, pipe2_nosigpipe);
+ ATF_TP_ADD_TC(tp, pipe2_einval);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_poll.c b/contrib/netbsd-tests/lib/libc/sys/t_poll.c
new file mode 100644
index 0000000..7a786d2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_poll.c
@@ -0,0 +1,392 @@
+/* $NetBSD: t_poll.c,v 1.3 2012/03/18 07:00:52 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matthias Scheler.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/time.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <poll.h>
+#include <stdio.h>
+#include <signal.h>
+#include <unistd.h>
+
+static int desc;
+
+static void
+child1(void)
+{
+ struct pollfd pfd;
+
+ pfd.fd = desc;
+ pfd.events = POLLIN | POLLHUP | POLLOUT;
+
+ (void)poll(&pfd, 1, 2000);
+ (void)printf("child1 exit\n");
+}
+
+static void
+child2(void)
+{
+ struct pollfd pfd;
+
+ pfd.fd = desc;
+ pfd.events = POLLIN | POLLHUP | POLLOUT;
+
+ (void)sleep(1);
+ (void)poll(&pfd, 1, INFTIM);
+ (void)printf("child2 exit\n");
+}
+
+static void
+child3(void)
+{
+ struct pollfd pfd;
+
+ (void)sleep(5);
+
+ pfd.fd = desc;
+ pfd.events = POLLIN | POLLHUP | POLLOUT;
+
+ (void)poll(&pfd, 1, INFTIM);
+ (void)printf("child3 exit\n");
+}
+
+ATF_TC(poll_3way);
+ATF_TC_HEAD(poll_3way, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "15");
+ atf_tc_set_md_var(tc, "descr",
+ "Check for 3-way collision for descriptor. First child comes "
+ "and polls on descriptor, second child comes and polls, first "
+ "child times out and exits, third child comes and polls. When "
+ "the wakeup event happens, the two remaining children should "
+ "both be awaken. (kern/17517)");
+}
+
+ATF_TC_BODY(poll_3way, tc)
+{
+ int pf[2];
+ int status, i;
+ pid_t pid;
+
+ pipe(pf);
+ desc = pf[0];
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+ (void)close(pf[1]);
+ child1();
+ _exit(0);
+ /* NOTREACHED */
+ }
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+ (void)close(pf[1]);
+ child2();
+ _exit(0);
+ /* NOTREACHED */
+ }
+
+ pid = fork();
+ ATF_REQUIRE( pid >= 0);
+
+ if (pid == 0) {
+ (void)close(pf[1]);
+ child3();
+ _exit(0);
+ /* NOTREACHED */
+ }
+
+ (void)sleep(10);
+
+ (void)printf("parent write\n");
+
+ ATF_REQUIRE(write(pf[1], "konec\n", 6) == 6);
+
+ for(i = 0; i < 3; ++i)
+ (void)wait(&status);
+
+ (void)printf("parent terminated\n");
+}
+
+ATF_TC(poll_basic);
+ATF_TC_HEAD(poll_basic, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "10");
+ atf_tc_set_md_var(tc, "descr",
+ "Basis functionality test for poll(2)");
+}
+
+ATF_TC_BODY(poll_basic, tc)
+{
+ int fds[2];
+ struct pollfd pfds[2];
+ int ret;
+
+ ATF_REQUIRE_EQ(pipe(fds), 0);
+
+ pfds[0].fd = fds[0];
+ pfds[0].events = POLLIN;
+ pfds[1].fd = fds[1];
+ pfds[1].events = POLLOUT;
+
+ /*
+ * Check that we get a timeout waiting for data on the read end
+ * of our pipe.
+ */
+ pfds[0].revents = -1;
+ pfds[1].revents = -1;
+ ATF_REQUIRE_EQ_MSG(ret = poll(&pfds[0], 1, 1), 0,
+ "got: %d", ret);
+ ATF_REQUIRE_EQ_MSG(pfds[0].revents, 0, "got: %d", pfds[0].revents);
+ ATF_REQUIRE_EQ_MSG(pfds[1].revents, -1, "got: %d", pfds[1].revents);
+
+ /* Check that the write end of the pipe as reported as ready. */
+ pfds[0].revents = -1;
+ pfds[1].revents = -1;
+ ATF_REQUIRE_EQ_MSG(ret = poll(&pfds[1], 1, 1), 1,
+ "got: %d", ret);
+ ATF_REQUIRE_EQ_MSG(pfds[0].revents, -1, "got: %d", pfds[0].revents);
+ ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",\
+ pfds[1].revents);
+
+ /* Check that only the write end of the pipe as reported as ready. */
+ pfds[0].revents = -1;
+ pfds[1].revents = -1;
+ ATF_REQUIRE_EQ_MSG(ret = poll(pfds, 2, 1), 1,
+ "got: %d", ret);
+ ATF_REQUIRE_EQ_MSG(pfds[0].revents, 0, "got: %d", pfds[0].revents);
+ ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",
+ pfds[1].revents);
+
+ /* Write data to our pipe. */
+ ATF_REQUIRE_EQ(write(fds[1], "", 1), 1);
+
+ /* Check that both ends of our pipe are reported as ready. */
+ pfds[0].revents = -1;
+ pfds[1].revents = -1;
+ ATF_REQUIRE_EQ_MSG(ret = poll(pfds, 2, 1), 2,
+ "got: %d", ret);
+ ATF_REQUIRE_EQ_MSG(pfds[0].revents, POLLIN, "got: %d",
+ pfds[0].revents);
+ ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",
+ pfds[1].revents);
+
+ ATF_REQUIRE_EQ(close(fds[0]), 0);
+ ATF_REQUIRE_EQ(close(fds[1]), 0);
+}
+
+ATF_TC(poll_err);
+ATF_TC_HEAD(poll_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check errors from poll(2)");
+}
+
+ATF_TC_BODY(poll_err, tc)
+{
+ struct pollfd pfd;
+ int fd = 0;
+
+ pfd.fd = fd;
+ pfd.events = POLLIN;
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, poll((struct pollfd *)-1, 1, -1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, poll(&pfd, 1, -2) == -1);
+}
+
+ATF_TC(pollts_basic);
+ATF_TC_HEAD(pollts_basic, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "10");
+ atf_tc_set_md_var(tc, "descr",
+ "Basis functionality test for pollts(2)");
+}
+
+ATF_TC_BODY(pollts_basic, tc)
+{
+ int fds[2];
+ struct pollfd pfds[2];
+ struct timespec timeout;
+ int ret;
+
+ ATF_REQUIRE_EQ(pipe(fds), 0);
+
+ pfds[0].fd = fds[0];
+ pfds[0].events = POLLIN;
+ pfds[1].fd = fds[1];
+ pfds[1].events = POLLOUT;
+
+ /* Use a timeout of 1 second. */
+ timeout.tv_sec = 1;
+ timeout.tv_nsec = 0;
+
+ /*
+ * Check that we get a timeout waiting for data on the read end
+ * of our pipe.
+ */
+ pfds[0].revents = -1;
+ pfds[1].revents = -1;
+ ATF_REQUIRE_EQ_MSG(ret = pollts(&pfds[0], 1, &timeout, NULL), 0,
+ "got: %d", ret);
+ ATF_REQUIRE_EQ_MSG(pfds[0].revents, 0, "got: %d", pfds[0].revents);
+ ATF_REQUIRE_EQ_MSG(pfds[1].revents, -1, "got: %d", pfds[1].revents);
+
+ /* Check that the write end of the pipe as reported as ready. */
+ pfds[0].revents = -1;
+ pfds[1].revents = -1;
+ ATF_REQUIRE_EQ_MSG(ret = pollts(&pfds[1], 1, &timeout, NULL), 1,
+ "got: %d", ret);
+ ATF_REQUIRE_EQ_MSG(pfds[0].revents, -1, "got: %d", pfds[0].revents);
+ ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",\
+ pfds[1].revents);
+
+ /* Check that only the write end of the pipe as reported as ready. */
+ pfds[0].revents = -1;
+ pfds[1].revents = -1;
+ ATF_REQUIRE_EQ_MSG(ret = pollts(pfds, 2, &timeout, NULL), 1,
+ "got: %d", ret);
+ ATF_REQUIRE_EQ_MSG(pfds[0].revents, 0, "got: %d", pfds[0].revents);
+ ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",
+ pfds[1].revents);
+
+ /* Write data to our pipe. */
+ ATF_REQUIRE_EQ(write(fds[1], "", 1), 1);
+
+ /* Check that both ends of our pipe are reported as ready. */
+ pfds[0].revents = -1;
+ pfds[1].revents = -1;
+ ATF_REQUIRE_EQ_MSG(ret = pollts(pfds, 2, &timeout, NULL), 2,
+ "got: %d", ret);
+ ATF_REQUIRE_EQ_MSG(pfds[0].revents, POLLIN, "got: %d",
+ pfds[0].revents);
+ ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",
+ pfds[1].revents);
+
+ ATF_REQUIRE_EQ(close(fds[0]), 0);
+ ATF_REQUIRE_EQ(close(fds[1]), 0);
+}
+
+ATF_TC(pollts_err);
+ATF_TC_HEAD(pollts_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check errors from pollts(2)");
+}
+
+ATF_TC_BODY(pollts_err, tc)
+{
+ struct timespec timeout;
+ struct pollfd pfd;
+ int fd = 0;
+
+ pfd.fd = fd;
+ pfd.events = POLLIN;
+
+ timeout.tv_sec = 1;
+ timeout.tv_nsec = 0;
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, pollts((void *)-1, 1, &timeout, NULL) == -1);
+
+ timeout.tv_sec = -1;
+ timeout.tv_nsec = -1;
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, pollts(&pfd, 1, &timeout, NULL) == -1);
+}
+
+ATF_TC(pollts_sigmask);
+ATF_TC_HEAD(pollts_sigmask, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "10");
+ atf_tc_set_md_var(tc, "descr",
+ "Check that pollts(2) restores the signal mask (PR kern/44986)");
+}
+
+ATF_TC_BODY(pollts_sigmask, tc)
+{
+ int fd;
+ struct pollfd pfd;
+ struct timespec timeout;
+ sigset_t mask;
+ int ret;
+
+ fd = open(_PATH_DEVNULL, O_RDONLY);
+ ATF_REQUIRE(fd >= 0);
+
+ pfd.fd = fd;
+ pfd.events = POLLIN;
+
+ /* Use a timeout of 1 second. */
+ timeout.tv_sec = 1;
+ timeout.tv_nsec = 0;
+
+ /* Unblock all signals. */
+ ATF_REQUIRE_EQ(sigfillset(&mask), 0);
+ ATF_REQUIRE_EQ(sigprocmask(SIG_UNBLOCK, &mask, NULL), 0);
+
+ /*
+ * Check that pollts(2) immediately returns. We block *all*
+ * signals during pollts(2).
+ */
+ ATF_REQUIRE_EQ_MSG(ret = pollts(&pfd, 1, &timeout, &mask), 1,
+ "got: %d", ret);
+
+ /* Check that signals are now longer blocked. */
+ ATF_REQUIRE_EQ(sigprocmask(SIG_SETMASK, NULL, &mask), 0);
+ ATF_REQUIRE_EQ_MSG(sigismember(&mask, SIGUSR1), 0,
+ "signal mask was changed.");
+
+ ATF_REQUIRE_EQ(close(fd), 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, poll_3way);
+ ATF_TP_ADD_TC(tp, poll_basic);
+ ATF_TP_ADD_TC(tp, poll_err);
+ ATF_TP_ADD_TC(tp, pollts_basic);
+ ATF_TP_ADD_TC(tp, pollts_err);
+ ATF_TP_ADD_TC(tp, pollts_sigmask);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_posix_fadvise.c b/contrib/netbsd-tests/lib/libc/sys/t_posix_fadvise.c
new file mode 100644
index 0000000..da4e746
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_posix_fadvise.c
@@ -0,0 +1,165 @@
+/* $NetBSD: t_posix_fadvise.c,v 1.1 2011/10/15 06:10:26 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by YAMAMOTO Takashi.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c)2005 YAMAMOTO Takashi,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_posix_fadvise.c,v 1.1 2011/10/15 06:10:26 jruoho Exp $");
+
+#include <sys/fcntl.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../../h_macros.h"
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+ATF_TC(posix_fadvise);
+ATF_TC_HEAD(posix_fadvise, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks posix_fadvise(2)");
+}
+
+ATF_TC(posix_fadvise_reg);
+ATF_TC_HEAD(posix_fadvise_reg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks posix_fadvise(2) "
+ "for regular files");
+}
+
+ATF_TC_BODY(posix_fadvise, tc)
+{
+ int fd;
+ int pipe_fds[2];
+ int badfd = 10;
+ int ret;
+
+ RL(fd = open("/dev/null", O_RDWR));
+
+ (void)close(badfd);
+ RL(pipe(pipe_fds));
+
+ /*
+ * it's hard to check if posix_fadvise is working properly.
+ * only check return values here.
+ */
+
+ /* posix_fadvise shouldn't affect errno. */
+
+#define CE(x, exp) \
+ do { \
+ int save = errno; \
+ errno = 999; \
+ ATF_CHECK_EQ_MSG(ret = (x), exp, "got: %d", ret); \
+ ATF_CHECK_EQ_MSG(errno, 999, "got: %s", strerror(errno)); \
+ errno = save; \
+ } while (0);
+
+ CE(posix_fadvise(fd, 0, 0, -1), EINVAL);
+ CE(posix_fadvise(pipe_fds[0], 0, 0, POSIX_FADV_NORMAL), ESPIPE);
+ CE(posix_fadvise(badfd, 0, 0, POSIX_FADV_NORMAL), EBADF);
+ CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NORMAL), 0);
+ CE(posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL), 0);
+ CE(posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM), 0);
+ CE(posix_fadvise(fd, 0, 0, POSIX_FADV_WILLNEED), 0);
+ CE(posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED), 0);
+ CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE), 0);
+}
+
+ATF_TC_BODY(posix_fadvise_reg, tc)
+{
+ int rfd, ret;
+
+ rump_init();
+ RL(rfd = rump_sys_open("/a_file", O_CREAT, 0666));
+
+ CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_NORMAL), 0);
+ CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_SEQUENTIAL), 0);
+ CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_RANDOM), 0);
+ CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_WILLNEED), 0);
+ CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_NOREUSE), 0);
+
+ CE(rump_sys_posix_fadvise(rfd,
+ INT64_MAX-getpagesize(), getpagesize(), POSIX_FADV_NORMAL), 0);
+ CE(rump_sys_posix_fadvise(rfd,
+ INT64_MAX-getpagesize(), getpagesize(), POSIX_FADV_SEQUENTIAL), 0);
+ CE(rump_sys_posix_fadvise(rfd,
+ INT64_MAX-getpagesize(), getpagesize(), POSIX_FADV_RANDOM), 0);
+ CE(rump_sys_posix_fadvise(rfd,
+ INT64_MAX-getpagesize(), getpagesize(), POSIX_FADV_WILLNEED), 0);
+ CE(rump_sys_posix_fadvise(rfd,
+ INT64_MAX-getpagesize(), getpagesize(), POSIX_FADV_NOREUSE), 0);
+
+ //atf_tc_expect_signal(-1, "http://mail-index.netbsd.org/source-changes-d/2010/11/11/msg002508.html");
+ CE(rump_sys_posix_fadvise(rfd,
+ INT64_MAX-getpagesize(), getpagesize(), POSIX_FADV_DONTNEED), 0);
+ CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_DONTNEED), 0);
+#undef CE
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, posix_fadvise);
+ ATF_TP_ADD_TC(tp, posix_fadvise_reg);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_recvmmsg.c b/contrib/netbsd-tests/lib/libc/sys/t_recvmmsg.c
new file mode 100644
index 0000000..76bc7dd
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_recvmmsg.c
@@ -0,0 +1,161 @@
+/* $NetBSD: t_recvmmsg.c,v 1.1 2012/06/22 18:45:23 christos Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jared McNeill and Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_recvmmsg.c,v 1.1 2012/06/22 18:45:23 christos Exp $");
+
+#include <atf-c.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+
+#include <string.h>
+#include <time.h>
+#include <stdint.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sched.h>
+
+#define BUFSIZE 65536
+#define NPKTS 50
+
+#define min(a, b) ((a) < (b) ? (a) : (b))
+static int debug;
+
+
+ATF_TC(recvmmsg_basic);
+ATF_TC_HEAD(recvmmsg_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of recvmmsg(2)");
+}
+
+ATF_TC_BODY(recvmmsg_basic, tc)
+{
+ int fd[2], error, i, cnt;
+ uint8_t *buf;
+ struct mmsghdr *mmsghdr;
+ struct iovec *iov;
+ unsigned int mmsgcnt, n;
+ int status;
+ off_t off;
+ uint8_t DGRAM[1316] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, };
+
+ error = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd);
+ ATF_REQUIRE_MSG(error != -1, "socketpair failed (%s)", strerror(errno));
+
+ buf = malloc(BUFSIZE);
+ ATF_REQUIRE_MSG(buf != NULL, "malloc failed (%s)", strerror(errno));
+
+ mmsgcnt = BUFSIZE / sizeof(DGRAM);
+ mmsghdr = malloc(sizeof(*mmsghdr) * mmsgcnt);
+ ATF_REQUIRE_MSG(mmsghdr != NULL, "malloc failed (%s)", strerror(errno));
+ iov = malloc(sizeof(*iov) * mmsgcnt);
+ ATF_REQUIRE_MSG(iov != NULL, "malloc failed (%s)", strerror(errno));
+
+ for (off = 0, n = 0; n < mmsgcnt; n++) {
+ iov[n].iov_base = buf + off;
+ iov[n].iov_len = sizeof(DGRAM);
+ off += iov[n].iov_len;
+ mmsghdr[n].msg_hdr.msg_iov = &iov[n];
+ mmsghdr[n].msg_hdr.msg_iovlen = 1;
+ mmsghdr[n].msg_hdr.msg_name = NULL;
+ mmsghdr[n].msg_hdr.msg_namelen = 0;
+ }
+
+ switch (fork()) {
+ case -1:
+ ATF_REQUIRE_MSG(0, "fork failed (%s)", strerror(errno));
+ break;
+
+ case 0:
+ n = NPKTS;
+ if (debug)
+ printf("waiting for %u messages (max %u per syscall)\n", n,
+ mmsgcnt);
+ while (n > 0) {
+ struct timespec ts = { 1, 0 };
+ cnt = recvmmsg(fd[1], mmsghdr, min(mmsgcnt, n),
+ MSG_WAITALL, &ts);
+ ATF_REQUIRE_MSG(cnt != -1, "recvmmsg failed (%s)",
+ strerror(errno));
+ ATF_REQUIRE_MSG(cnt != 0, "recvmmsg timeout");
+ if (debug)
+ printf("recvmmsg: got %u messages\n", cnt);
+ for (i = 0; i < cnt; i++) {
+ ATF_CHECK_EQ_MSG(mmsghdr[i].msg_len,
+ sizeof(DGRAM), "packet length");
+ ATF_CHECK_EQ_MSG(
+ ((uint8_t *)iov[i].iov_base)[0],
+ NPKTS - n + i, "packet contents");
+ }
+ n -= cnt;
+ }
+ if (debug)
+ printf("done!\n");
+ exit(0);
+ /*NOTREACHED*/
+ default:
+ sched_yield();
+
+ for (n = 0; n < NPKTS; n++) {
+ if (debug)
+ printf("sending packet %u/%u...\n", (n+1),
+ NPKTS);
+ do {
+ DGRAM[0] = n;
+ error = send(fd[0], DGRAM, sizeof(DGRAM), 0);
+ } while (error == -1 && errno == ENOBUFS);
+ if (error == -1)
+ ATF_REQUIRE_MSG(error != -1, "send failed (%s)",
+ strerror(errno));
+ }
+ error = wait(&status);
+ ATF_REQUIRE_MSG(error != -1, "wait failed (%s)",
+ strerror(errno));
+ break;
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, recvmmsg_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
new file mode 100644
index 0000000..10fd6d6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
@@ -0,0 +1,186 @@
+/* $NetBSD: t_revoke.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_revoke.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $");
+
+#include <sys/resource.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char path[] = "revoke";
+
+ATF_TC_WITH_CLEANUP(revoke_basic);
+ATF_TC_HEAD(revoke_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of revoke(2)");
+}
+
+ATF_TC_BODY(revoke_basic, tc)
+{
+ struct rlimit res;
+ char tmp[10];
+ size_t i, n;
+ int *buf;
+
+ (void)memset(&res, 0, sizeof(struct rlimit));
+ (void)getrlimit(RLIMIT_NOFILE, &res);
+
+ if ((n = res.rlim_cur / 10) == 0)
+ n = 10;
+
+ buf = calloc(n, sizeof(int));
+ ATF_REQUIRE(buf != NULL);
+
+ buf[0] = open(path, O_RDWR | O_CREAT, 0600);
+ ATF_REQUIRE(buf[0] >= 0);
+
+ for (i = 1; i < n; i++) {
+ buf[i] = open(path, O_RDWR);
+ ATF_REQUIRE(buf[i] >= 0);
+ }
+
+ ATF_REQUIRE(revoke(path) == 0);
+
+ for (i = 0; i < n; i++) {
+
+ ATF_REQUIRE(read(buf[i], tmp, sizeof(tmp)) == -1);
+
+ (void)close(buf[i]);
+ }
+
+ free(buf);
+
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(revoke_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(revoke_err);
+ATF_TC_HEAD(revoke_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from revoke(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(revoke_err, tc)
+{
+ char buf[1024 + 1]; /* XXX: From the manual page... */
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, revoke((char *)-1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, revoke(buf) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EPERM, revoke("/etc/passwd") == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, revoke("/etc/xxx/yyy") == -1);
+}
+
+ATF_TC_WITH_CLEANUP(revoke_perm);
+ATF_TC_HEAD(revoke_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions revoke(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(revoke_perm, tc)
+{
+ struct passwd *pw;
+ int fd, sta;
+ pid_t pid;
+
+ pw = getpwnam("nobody");
+ fd = open(path, O_RDWR | O_CREAT, 0600);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(pw != NULL);
+ ATF_REQUIRE(revoke(path) == 0);
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ if (setuid(pw->pw_uid) != 0)
+ _exit(EXIT_FAILURE);
+
+ errno = 0;
+
+ if (revoke(path) == 0)
+ _exit(EXIT_FAILURE);
+
+ if (errno != EACCES)
+ _exit(EXIT_FAILURE);
+
+ if (close(fd) != 0)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("revoke(2) did not obey permissions");
+
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(revoke_perm, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, revoke_basic);
+ ATF_TP_ADD_TC(tp, revoke_err);
+ ATF_TP_ADD_TC(tp, revoke_perm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_select.c b/contrib/netbsd-tests/lib/libc/sys/t_select.c
new file mode 100644
index 0000000..4316acf
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_select.c
@@ -0,0 +1,215 @@
+/* $NetBSD: t_select.c,v 1.3 2012/03/18 07:00:52 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundatiom
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/wait.h>
+#include <err.h>
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#include <atf-c.h>
+
+static sig_atomic_t keep_going = 1;
+
+static void
+sig_handler(int signum)
+{
+ keep_going = 0;
+}
+
+static void
+sigchld(int signum)
+{
+}
+
+static char
+xtoa(uint8_t n)
+{
+ static const char xarray[] = "0123456789abcdef";
+ assert(n < sizeof(xarray));
+ return xarray[n];
+}
+
+static const char *
+prmask(const sigset_t *m, char *buf, size_t len)
+{
+ size_t j = 2;
+ assert(len >= 3 + sizeof(*m));
+ buf[0] = '0';
+ buf[1] = 'x';
+#define N(p, a) (((p) >> ((a) * 4)) & 0xf)
+ for (size_t i = __arraycount(m->__bits); i > 0; i--) {
+ uint32_t p = m->__bits[i - 1];
+ for (size_t k = sizeof(p); k > 0; k--)
+ buf[j++] = xtoa(N(p, k - 1));
+ }
+ buf[j] = '\0';
+ return buf;
+}
+
+static void
+child(const struct timespec *ts)
+{
+ struct sigaction sa;
+ sigset_t set, oset, nset;
+ char obuf[sizeof(oset) + 3], nbuf[sizeof(nset) + 3];
+ int fd;
+
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = sig_handler;
+ if ((fd = open("/dev/null", O_RDONLY)) == -1)
+ err(1, "open");
+
+ if (sigaction(SIGTERM, &sa, NULL) == -1)
+ err(1, "sigaction");
+
+ sigfillset(&set);
+ if (sigprocmask(SIG_BLOCK, &set, NULL) == -1)
+ err(1, "sigprocmask");
+
+ if (sigprocmask(SIG_BLOCK, NULL, &oset) == -1)
+ err(1, "sigprocmask");
+
+ sigemptyset(&set);
+
+ for (;;) {
+ fd_set rset;
+ FD_ZERO(&rset);
+ FD_SET(fd, &rset);
+ if (pselect(1, &rset, NULL, NULL, ts, &set) == -1) {
+ if(errno == EINTR) {
+ if (!keep_going)
+ break;
+ }
+ }
+ if (ts)
+ break;
+ }
+ if (sigprocmask(SIG_BLOCK, NULL, &nset) == -1)
+ err(1, "sigprocmask");
+ if (memcmp(&oset, &nset, sizeof(oset)) != 0)
+ atf_tc_fail("pselect() masks don't match "
+ "after timeout %s != %s",
+ prmask(&nset, nbuf, sizeof(nbuf)),
+ prmask(&oset, obuf, sizeof(obuf)));
+}
+
+ATF_TC(pselect_sigmask);
+ATF_TC_HEAD(pselect_sigmask, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks pselect's temporary mask "
+ "setting when a signal is received (PR lib/43625)");
+}
+
+ATF_TC_BODY(pselect_sigmask, tc)
+{
+ pid_t pid;
+ int status;
+
+ signal(SIGCHLD, sigchld);
+
+ switch (pid = fork()) {
+ case 0:
+ child(NULL);
+ case -1:
+ err(1, "fork");
+ default:
+ sleep(1);
+ if (kill(pid, SIGTERM) == -1)
+ err(1, "kill");
+ sleep(1);
+ switch (waitpid(pid, &status, WNOHANG)) {
+ case -1:
+ err(1, "wait");
+ case 0:
+ if (kill(pid, SIGKILL) == -1)
+ err(1, "kill");
+ atf_tc_fail("pselect() did not receive signal");
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+ATF_TC(pselect_timeout);
+ATF_TC_HEAD(pselect_timeout, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks pselect's temporary mask "
+ "setting when a timeout occurs");
+}
+
+ATF_TC_BODY(pselect_timeout, tc)
+{
+ pid_t pid;
+ int status;
+ static const struct timespec zero = { 0, 0 };
+
+ signal(SIGCHLD, sigchld);
+
+ switch (pid = fork()) {
+ case 0:
+ child(&zero);
+ break;
+ case -1:
+ err(1, "fork");
+ default:
+ sleep(1);
+ switch (waitpid(pid, &status, WNOHANG)) {
+ case -1:
+ err(1, "wait");
+ case 0:
+ if (kill(pid, SIGKILL) == -1)
+ err(1, "kill");
+ atf_tc_fail("pselect() did not receive signal");
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, pselect_sigmask);
+ ATF_TP_ADD_TC(tp, pselect_timeout);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c b/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
new file mode 100644
index 0000000..c760cfb
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
@@ -0,0 +1,522 @@
+/* $NetBSD: t_setrlimit.c,v 1.4 2012/06/12 23:56:19 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_setrlimit.c,v 1.4 2012/06/12 23:56:19 christos Exp $");
+
+#include <sys/resource.h>
+#include <sys/mman.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <lwp.h>
+#include <signal.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ucontext.h>
+#include <unistd.h>
+
+static void sighandler(int);
+static const char path[] = "setrlimit";
+
+static const int rlimit[] = {
+ RLIMIT_AS,
+ RLIMIT_CORE,
+ RLIMIT_CPU,
+ RLIMIT_DATA,
+ RLIMIT_FSIZE,
+ RLIMIT_MEMLOCK,
+ RLIMIT_NOFILE,
+ RLIMIT_NPROC,
+ RLIMIT_RSS,
+ RLIMIT_SBSIZE,
+ RLIMIT_STACK
+};
+
+ATF_TC(setrlimit_basic);
+ATF_TC_HEAD(setrlimit_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic soft limit test");
+}
+
+ATF_TC_BODY(setrlimit_basic, tc)
+{
+ struct rlimit res;
+ int *buf, lim;
+ size_t i;
+
+ buf = calloc(__arraycount(rlimit), sizeof(int));
+
+ if (buf == NULL)
+ atf_tc_fail("initialization failed");
+
+ for (i = lim = 0; i < __arraycount(rlimit); i++) {
+
+ (void)memset(&res, 0, sizeof(struct rlimit));
+
+ if (getrlimit(rlimit[i], &res) != 0)
+ continue;
+
+ if (res.rlim_cur == RLIM_INFINITY || res.rlim_cur == 0)
+ continue;
+
+ if (res.rlim_cur == res.rlim_max) /* An unprivileged run. */
+ continue;
+
+ buf[i] = res.rlim_cur;
+ res.rlim_cur = res.rlim_cur - 1;
+
+ if (setrlimit(rlimit[i], &res) != 0) {
+ lim = rlimit[i];
+ goto out;
+ }
+ }
+
+out:
+ for (i = 0; i < __arraycount(rlimit); i++) {
+
+ (void)memset(&res, 0, sizeof(struct rlimit));
+
+ if (buf[i] == 0)
+ continue;
+
+ if (getrlimit(rlimit[i], &res) != 0)
+ continue;
+
+ res.rlim_cur = buf[i];
+
+ (void)setrlimit(rlimit[i], &res);
+ }
+
+ if (lim != 0)
+ atf_tc_fail("failed to set limit (%d)", lim);
+}
+
+ATF_TC(setrlimit_current);
+ATF_TC_HEAD(setrlimit_current, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "setrlimit(3) with current limits");
+}
+
+ATF_TC_BODY(setrlimit_current, tc)
+{
+ struct rlimit res;
+ size_t i;
+
+ for (i = 0; i < __arraycount(rlimit); i++) {
+
+ (void)memset(&res, 0, sizeof(struct rlimit));
+
+ ATF_REQUIRE(getrlimit(rlimit[i], &res) == 0);
+ ATF_REQUIRE(setrlimit(rlimit[i], &res) == 0);
+ }
+}
+
+ATF_TC(setrlimit_err);
+ATF_TC_HEAD(setrlimit_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions");
+}
+
+ATF_TC_BODY(setrlimit_err, tc)
+{
+ struct rlimit res;
+ size_t i;
+
+ for (i = 0; i < __arraycount(rlimit); i++) {
+
+ errno = 0;
+
+ ATF_REQUIRE(getrlimit(rlimit[i], (void *)0) != 0);
+ ATF_REQUIRE(errno == EFAULT);
+ }
+
+ errno = 0;
+
+ ATF_REQUIRE(getrlimit(INT_MAX, &res) != 0);
+ ATF_REQUIRE(errno == EINVAL);
+}
+
+ATF_TC_WITH_CLEANUP(setrlimit_fsize);
+ATF_TC_HEAD(setrlimit_fsize, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_FSIZE");
+}
+
+ATF_TC_BODY(setrlimit_fsize, tc)
+{
+ struct rlimit res;
+ int fd, sta;
+ pid_t pid;
+
+ fd = open(path, O_RDWR | O_CREAT, 0700);
+
+ if (fd < 0)
+ atf_tc_fail("initialization failed");
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ res.rlim_cur = 2;
+ res.rlim_max = 2;
+
+ if (setrlimit(RLIMIT_FSIZE, &res) != 0)
+ _exit(EXIT_FAILURE);
+
+ if (signal(SIGXFSZ, sighandler) == SIG_ERR)
+ _exit(EXIT_FAILURE);
+
+ /*
+ * The third call should generate a SIGXFSZ.
+ */
+ (void)write(fd, "X", 1);
+ (void)write(fd, "X", 1);
+ (void)write(fd, "X", 1);
+
+ _exit(EXIT_FAILURE);
+ }
+
+ (void)close(fd);
+ (void)wait(&sta);
+ (void)unlink(path);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("RLIMIT_FSIZE not enforced");
+}
+
+ATF_TC_CLEANUP(setrlimit_fsize, tc)
+{
+ (void)unlink(path);
+}
+
+static void
+sighandler(int signo)
+{
+
+ if (signo != SIGXFSZ)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+}
+
+ATF_TC(setrlimit_memlock);
+ATF_TC_HEAD(setrlimit_memlock, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_MEMLOCK");
+}
+
+ATF_TC_BODY(setrlimit_memlock, tc)
+{
+ struct rlimit res;
+ void *buf;
+ long page;
+ pid_t pid;
+ int sta;
+
+ page = sysconf(_SC_PAGESIZE);
+ ATF_REQUIRE(page >= 0);
+
+ buf = malloc(page);
+ pid = fork();
+
+ if (buf == NULL || pid < 0)
+ atf_tc_fail("initialization failed");
+
+ if (pid == 0) {
+
+ /*
+ * Try to lock a page while
+ * RLIMIT_MEMLOCK is zero.
+ */
+ if (mlock(buf, page) != 0)
+ _exit(EXIT_FAILURE);
+
+ if (munlock(buf, page) != 0)
+ _exit(EXIT_FAILURE);
+
+ res.rlim_cur = 0;
+ res.rlim_max = 0;
+
+ if (setrlimit(RLIMIT_MEMLOCK, &res) != 0)
+ _exit(EXIT_FAILURE);
+
+ if (mlock(buf, page) != 0)
+ _exit(EXIT_SUCCESS);
+
+ (void)munlock(buf, page);
+
+ _exit(EXIT_FAILURE);
+ }
+
+ free(buf);
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("RLIMIT_MEMLOCK not enforced");
+}
+
+ATF_TC(setrlimit_nofile_1);
+ATF_TC_HEAD(setrlimit_nofile_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_NOFILE, #1");
+}
+
+ATF_TC_BODY(setrlimit_nofile_1, tc)
+{
+ struct rlimit res;
+ int fd, i, rv, sta;
+ pid_t pid;
+
+ res.rlim_cur = 0;
+ res.rlim_max = 0;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ /*
+ * Close all descriptors, set RLIMIT_NOFILE
+ * to zero, and try to open a random file.
+ * This should fail with EMFILE.
+ */
+ for (i = 0; i < 1024; i++)
+ (void)close(i);
+
+ rv = setrlimit(RLIMIT_NOFILE, &res);
+
+ if (rv != 0)
+ _exit(EXIT_FAILURE);
+
+ errno = 0;
+ fd = open("/etc/passwd", O_RDONLY);
+
+ if (fd >= 0 || errno != EMFILE)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("RLIMIT_NOFILE not enforced");
+}
+
+ATF_TC(setrlimit_nofile_2);
+ATF_TC_HEAD(setrlimit_nofile_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_NOFILE, #2");
+}
+
+ATF_TC_BODY(setrlimit_nofile_2, tc)
+{
+ static const rlim_t lim = 12;
+ struct rlimit res;
+ int fd, i, rv, sta;
+ pid_t pid;
+
+ /*
+ * See that an arbitrary limit on
+ * open files is being enforced.
+ */
+ res.rlim_cur = lim;
+ res.rlim_max = lim;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ for (i = 0; i < 1024; i++)
+ (void)close(i);
+
+ rv = setrlimit(RLIMIT_NOFILE, &res);
+
+ if (rv != 0)
+ _exit(EXIT_FAILURE);
+
+ for (i = 0; i < (int)lim; i++) {
+
+ fd = open("/etc/passwd", O_RDONLY);
+
+ if (fd < 0)
+ _exit(EXIT_FAILURE);
+ }
+
+ /*
+ * After the limit has been reached,
+ * EMFILE should again follow.
+ */
+ fd = open("/etc/passwd", O_RDONLY);
+
+ if (fd >= 0 || errno != EMFILE)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("RLIMIT_NOFILE not enforced");
+}
+
+ATF_TC(setrlimit_nproc);
+ATF_TC_HEAD(setrlimit_nproc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_NPROC");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(setrlimit_nproc, tc)
+{
+ struct rlimit res;
+ pid_t pid, cpid;
+ int sta;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ /*
+ * Set RLIMIT_NPROC to zero and try to fork.
+ */
+ res.rlim_cur = 0;
+ res.rlim_max = 0;
+
+ if (setrlimit(RLIMIT_NPROC, &res) != 0)
+ _exit(EXIT_FAILURE);
+
+ cpid = fork();
+
+ if (cpid < 0)
+ _exit(EXIT_SUCCESS);
+
+ _exit(EXIT_FAILURE);
+ }
+
+ (void)waitpid(pid, &sta, 0);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("RLIMIT_NPROC not enforced");
+}
+
+ATF_TC(setrlimit_nthr);
+ATF_TC_HEAD(setrlimit_nthr, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_NTHR");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+static void
+func(lwpid_t *id)
+{
+ printf("thread %d\n", *id);
+ fflush(stdout);
+ _lwp_exit();
+}
+
+ATF_TC_BODY(setrlimit_nthr, tc)
+{
+ struct rlimit res;
+ lwpid_t lwpid;
+ ucontext_t c;
+
+ /*
+ * Set RLIMIT_NTHR to zero and try to create a thread.
+ */
+ res.rlim_cur = 0;
+ res.rlim_max = 0;
+ ATF_REQUIRE(setrlimit(RLIMIT_NTHR, &res) == 0);
+ ATF_REQUIRE(getcontext(&c) == 0);
+ c.uc_link = NULL;
+ sigemptyset(&c.uc_sigmask);
+ c.uc_stack.ss_flags = 0;
+ c.uc_stack.ss_size = 4096;
+ ATF_REQUIRE((c.uc_stack.ss_sp = malloc(c.uc_stack.ss_size)) != NULL);
+ makecontext(&c, func, 1, &lwpid);
+ ATF_CHECK_ERRNO(EAGAIN, _lwp_create(&c, 0, &lwpid) == -1);
+}
+
+ATF_TC(setrlimit_perm);
+ATF_TC_HEAD(setrlimit_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setrlimit(2) for EPERM");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(setrlimit_perm, tc)
+{
+ struct rlimit res;
+ size_t i;
+
+ /*
+ * Try to raise the maximum limits as an user.
+ */
+ for (i = 0; i < __arraycount(rlimit); i++) {
+
+ ATF_REQUIRE(getrlimit(rlimit[i], &res) == 0);
+
+ if (res.rlim_max == UINT64_MAX) /* Overflow. */
+ continue;
+
+ errno = 0;
+ res.rlim_max = res.rlim_max + 1;
+
+ ATF_CHECK_ERRNO(EPERM, setrlimit(rlimit[i], &res) != 0);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, setrlimit_basic);
+ ATF_TP_ADD_TC(tp, setrlimit_current);
+ ATF_TP_ADD_TC(tp, setrlimit_err);
+ ATF_TP_ADD_TC(tp, setrlimit_fsize);
+ ATF_TP_ADD_TC(tp, setrlimit_memlock);
+ ATF_TP_ADD_TC(tp, setrlimit_nofile_1);
+ ATF_TP_ADD_TC(tp, setrlimit_nofile_2);
+ ATF_TP_ADD_TC(tp, setrlimit_nproc);
+ ATF_TP_ADD_TC(tp, setrlimit_perm);
+ ATF_TP_ADD_TC(tp, setrlimit_nthr);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_setuid.c b/contrib/netbsd-tests/lib/libc/sys/t_setuid.c
new file mode 100644
index 0000000..d2bf523
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_setuid.c
@@ -0,0 +1,122 @@
+/* $NetBSD: t_setuid.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_setuid.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+ATF_TC(setuid_perm);
+ATF_TC_HEAD(setuid_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setuid(0) as normal user");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(setuid_perm, tc)
+{
+ errno = 0;
+
+ ATF_REQUIRE(setuid(0) == -1);
+ ATF_REQUIRE(errno == EPERM);
+}
+
+ATF_TC(setuid_real);
+ATF_TC_HEAD(setuid_real, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test setuid(2) with real UID");
+}
+
+ATF_TC_BODY(setuid_real, tc)
+{
+ uid_t uid = getuid();
+
+ ATF_REQUIRE(setuid(uid) == 0);
+
+ ATF_REQUIRE(getuid() == uid);
+ ATF_REQUIRE(geteuid() == uid);
+}
+
+ATF_TC(setuid_root);
+ATF_TC_HEAD(setuid_root, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of setuid(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(setuid_root, tc)
+{
+ struct passwd *pw;
+ int rv, sta;
+ pid_t pid;
+ uid_t uid;
+
+ while ((pw = getpwent()) != NULL) {
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ rv = setuid(pw->pw_uid);
+
+ if (rv != 0)
+ _exit(EXIT_FAILURE);
+
+ uid = getuid();
+
+ if (uid != pw->pw_uid)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("failed to change UID to %u", pw->pw_uid);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, setuid_perm);
+ ATF_TP_ADD_TC(tp, setuid_real);
+ ATF_TP_ADD_TC(tp, setuid_root);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c b/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c
new file mode 100644
index 0000000..8022353
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c
@@ -0,0 +1,154 @@
+/* $NetBSD: t_sigaction.c,v 1.2 2012/11/07 16:51:16 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sigaction.c,v 1.2 2012/11/07 16:51:16 pgoyette Exp $");
+
+#include <sys/wait.h>
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#include "../../../h_macros.h"
+
+static bool handler_called = false;
+
+static void
+handler(int signo)
+{
+ handler_called = true;
+}
+
+static void
+sa_resethand_child(const int flags)
+{
+ struct sigaction sa;
+
+ sa.sa_flags = flags;
+ sa.sa_handler = &handler;
+ sigemptyset(&sa.sa_mask);
+
+ sigaction(SIGUSR1, &sa, NULL);
+ kill(getpid(), SIGUSR1);
+ exit(handler_called ? EXIT_SUCCESS : EXIT_FAILURE);
+}
+
+static void
+wait_and_check_child(const pid_t pid, const char *fail_message)
+{
+ int status;
+
+ (void)waitpid(pid, &status, 0);
+
+ if (WIFEXITED(status))
+ ATF_CHECK_EQ(EXIT_SUCCESS, WEXITSTATUS(status));
+ else
+ atf_tc_fail("%s; raw exit status was %d", fail_message, status);
+}
+
+static void
+catch(int sig)
+{
+ return;
+}
+
+ATF_TC(sigaction_basic);
+ATF_TC_HEAD(sigaction_basic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks for correct I&D cache"
+ "synchronization after copying out the trampoline code.");
+}
+
+ATF_TC_BODY(sigaction_basic, tc)
+{
+ static struct sigaction sa;
+
+ sa.sa_handler = catch;
+
+ sigaction(SIGUSR1, &sa, 0);
+ kill(getpid(), SIGUSR1);
+ atf_tc_pass();
+}
+
+ATF_TC(sigaction_noflags);
+ATF_TC_HEAD(sigaction_noflags, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks programming a signal with "
+ "sigaction(2) but without any flags");
+}
+
+ATF_TC_BODY(sigaction_noflags, tc)
+{
+ const pid_t pid = fork();
+ if (pid == -1)
+ atf_tc_fail_errno("fork(2) failed");
+ else if (pid == 0)
+ sa_resethand_child(0);
+ else
+ wait_and_check_child(pid, "Child process did not exit cleanly;"
+ " it failed to process the signal");
+}
+
+ATF_TC(sigaction_resethand);
+ATF_TC_HEAD(sigaction_resethand, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that SA_RESETHAND works");
+}
+
+ATF_TC_BODY(sigaction_resethand, tc)
+{
+ const pid_t pid = fork();
+ if (pid == -1)
+ atf_tc_fail_errno("fork(2) failed");
+ else if (pid == 0)
+ sa_resethand_child(SA_RESETHAND);
+ else {
+ wait_and_check_child(pid, "Child process did not exit cleanly;"
+ " it either failed to process the signal or SA_RESETHAND"
+ " is broken");
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sigaction_basic);
+ ATF_TP_ADD_TC(tp, sigaction_noflags);
+ ATF_TP_ADD_TC(tp, sigaction_resethand);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c b/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c
new file mode 100644
index 0000000..f9e0c63
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c
@@ -0,0 +1,103 @@
+/* $NetBSD: t_sigqueue.c,v 1.4 2011/07/07 16:31:11 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_sigqueue.c,v 1.4 2011/07/07 16:31:11 jruoho Exp $");
+
+
+#include <atf-c.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sched.h>
+#include <unistd.h>
+
+static void handler(int, siginfo_t *, void *);
+
+#define VALUE (int)0xc001dad1
+static int value;
+
+static void
+handler(int signo, siginfo_t *info, void *data)
+{
+ value = info->si_value.sival_int;
+ kill(0, SIGINFO);
+}
+
+ATF_TC(sigqueue_basic);
+ATF_TC_HEAD(sigqueue_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks sigqueue(3) sigval delivery");
+}
+
+ATF_TC_BODY(sigqueue_basic, tc)
+{
+ struct sigaction sa;
+ union sigval sv;
+
+ sa.sa_sigaction = handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_SIGINFO;
+
+ if (sigaction(SIGUSR1, &sa, NULL) != 0)
+ atf_tc_fail("sigaction failed");
+
+ sv.sival_int = VALUE;
+
+ if (sigqueue(0, SIGUSR1, sv) != 0)
+ atf_tc_fail("sigqueue failed");
+
+ sched_yield();
+ ATF_REQUIRE_EQ(sv.sival_int, value);
+}
+
+ATF_TC(sigqueue_err);
+ATF_TC_HEAD(sigqueue_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from sigqueue(3)");
+}
+
+ATF_TC_BODY(sigqueue_err, tc)
+{
+ union sigval sv;
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, sigqueue(getpid(), -1, sv) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sigqueue_basic);
+ ATF_TP_ADD_TC(tp, sigqueue_err);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_sigtimedwait.c b/contrib/netbsd-tests/lib/libc/sys/t_sigtimedwait.c
new file mode 100644
index 0000000..64b68d9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_sigtimedwait.c
@@ -0,0 +1,126 @@
+/* $NetBSD: t_sigtimedwait.c,v 1.2 2013/03/08 23:18:00 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_sigtimedwait.c,v 1.2 2013/03/08 23:18:00 martin Exp $");
+
+#include <sys/time.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <atf-c.h>
+
+
+ATF_TC(sigtimedwait_all0timeout);
+
+ATF_TC_HEAD(sigtimedwait_all0timeout, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "10");
+ atf_tc_set_md_var(tc, "descr", "Test for PR kern/47625: sigtimedwait"
+ " with a timeout value of all zero should return imediately");
+}
+
+ATF_TC_BODY(sigtimedwait_all0timeout, tc)
+{
+ sigset_t block;
+ struct timespec ts, before, after, len;
+ siginfo_t info;
+ int r;
+
+ sigemptyset(&block);
+ ts.tv_sec = 0;
+ ts.tv_nsec = 0;
+ clock_gettime(CLOCK_MONOTONIC, &before);
+ r = sigtimedwait(&block, &info, &ts);
+ clock_gettime(CLOCK_MONOTONIC, &after);
+ ATF_REQUIRE(r == -1);
+ ATF_REQUIRE_ERRNO(EAGAIN, errno);
+ timespecsub(&after, &before, &len);
+ ATF_REQUIRE(len.tv_sec < 1);
+}
+
+ATF_TC(sigtimedwait_NULL_timeout);
+
+ATF_TC_HEAD(sigtimedwait_NULL_timeout, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "10");
+ atf_tc_set_md_var(tc, "descr", "Test sigtimedwait() without timeout");
+}
+
+ATF_TC_BODY(sigtimedwait_NULL_timeout, tc)
+{
+ sigset_t sig;
+ siginfo_t info;
+ struct itimerval it;
+ int r;
+
+ /* arrange for a SIGALRM signal in a few seconds */
+ memset(&it, 0, sizeof it);
+ it.it_value.tv_sec = 5;
+ ATF_REQUIRE(setitimer(ITIMER_REAL, &it, NULL) == 0);
+
+ /* wait without timeout */
+ sigemptyset(&sig);
+ sigaddset(&sig, SIGALRM);
+ r = sigtimedwait(&sig, &info, NULL);
+ ATF_REQUIRE(r == SIGALRM);
+}
+
+ATF_TC(sigtimedwait_small_timeout);
+
+ATF_TC_HEAD(sigtimedwait_small_timeout, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "15");
+ atf_tc_set_md_var(tc, "descr", "Test sigtimedwait with a small "
+ "timeout");
+}
+
+ATF_TC_BODY(sigtimedwait_small_timeout, tc)
+{
+ sigset_t block;
+ struct timespec ts;
+ siginfo_t info;
+ int r;
+
+ sigemptyset(&block);
+ ts.tv_sec = 5;
+ ts.tv_nsec = 0;
+ r = sigtimedwait(&block, &info, &ts);
+ ATF_REQUIRE(r == -1);
+ ATF_REQUIRE_ERRNO(EAGAIN, errno);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, sigtimedwait_all0timeout);
+ ATF_TP_ADD_TC(tp, sigtimedwait_NULL_timeout);
+ ATF_TP_ADD_TC(tp, sigtimedwait_small_timeout);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c b/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c
new file mode 100644
index 0000000..532629c3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c
@@ -0,0 +1,137 @@
+/* $NetBSD: t_socketpair.c,v 1.1 2011/11/05 18:19:02 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_socketpair.c,v 1.1 2011/11/05 18:19:02 jruoho Exp $");
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <errno.h>
+
+static void
+connected(int fd)
+{
+ struct sockaddr_un addr;
+ socklen_t len = (socklen_t)sizeof(addr);
+ ATF_REQUIRE(getpeername(fd, (struct sockaddr*)(void *)&addr,
+ &len) == 0);
+}
+
+static void
+run(int flags)
+{
+ int fd[2], i;
+
+ while ((i = open("/", O_RDONLY)) < 3)
+ ATF_REQUIRE(i != -1);
+
+ ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1);
+
+ ATF_REQUIRE(socketpair(AF_UNIX, SOCK_DGRAM | flags, 0, fd) == 0);
+
+ ATF_REQUIRE(fd[0] == 3);
+ ATF_REQUIRE(fd[1] == 4);
+
+ connected(fd[0]);
+ connected(fd[1]);
+
+ if (flags & SOCK_CLOEXEC) {
+ ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) != 0);
+ ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) != 0);
+ } else {
+ ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) == 0);
+ ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) == 0);
+ }
+
+ if (flags & SOCK_NONBLOCK) {
+ ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) != 0);
+ ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) != 0);
+ } else {
+ ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) == 0);
+ ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0);
+ }
+
+ ATF_REQUIRE(close(fd[0]) != -1);
+ ATF_REQUIRE(close(fd[1]) != -1);
+}
+
+ATF_TC(socketpair_basic);
+ATF_TC_HEAD(socketpair_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of socketpair(2)");
+}
+
+ATF_TC_BODY(socketpair_basic, tc)
+{
+ run(0);
+}
+
+ATF_TC(socketpair_nonblock);
+ATF_TC_HEAD(socketpair_nonblock, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A non-blocking test of socketpair(2)");
+}
+
+ATF_TC_BODY(socketpair_nonblock, tc)
+{
+ run(SOCK_NONBLOCK);
+}
+
+ATF_TC(socketpair_cloexec);
+ATF_TC_HEAD(socketpair_cloexec, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A close-on-exec of socketpair(2)");
+}
+
+ATF_TC_BODY(socketpair_cloexec, tc)
+{
+ run(SOCK_CLOEXEC);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, socketpair_basic);
+ ATF_TP_ADD_TC(tp, socketpair_nonblock);
+ ATF_TP_ADD_TC(tp, socketpair_cloexec);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_stat.c b/contrib/netbsd-tests/lib/libc/sys/t_stat.c
new file mode 100644
index 0000000..0312e2f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_stat.c
@@ -0,0 +1,417 @@
+/* $NetBSD: t_stat.c,v 1.4 2012/03/17 08:37:08 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_stat.c,v 1.4 2012/03/17 08:37:08 jruoho Exp $");
+
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+
+#include <arpa/inet.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <fts.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <stdio.h>
+
+static const char *path = "stat";
+
+ATF_TC_WITH_CLEANUP(stat_chflags);
+ATF_TC_HEAD(stat_chflags, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test chflags(2) with stat(2)");
+}
+
+ATF_TC_BODY(stat_chflags, tc)
+{
+ struct stat sa, sb;
+ int fd;
+
+ (void)memset(&sa, 0, sizeof(struct stat));
+ (void)memset(&sb, 0, sizeof(struct stat));
+
+ fd = open(path, O_RDONLY | O_CREAT);
+
+ ATF_REQUIRE(fd != -1);
+ ATF_REQUIRE(stat(path, &sa) == 0);
+ ATF_REQUIRE(chflags(path, UF_NODUMP) == 0);
+ ATF_REQUIRE(stat(path, &sb) == 0);
+
+ if (sa.st_flags == sb.st_flags)
+ atf_tc_fail("stat(2) did not detect chflags(2)");
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(stat_chflags, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(stat_dir);
+ATF_TC_HEAD(stat_dir, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test stat(2) with directories");
+}
+
+ATF_TC_BODY(stat_dir, tc)
+{
+ const short depth = 2;
+ struct stat sa, sb;
+ char *argv[2];
+ FTSENT *ftse;
+ FTS *fts;
+ int ops;
+
+ argv[1] = NULL;
+ argv[0] = __UNCONST("/");
+
+ ops = FTS_NOCHDIR;
+ ops |= FTS_PHYSICAL;
+
+ fts = fts_open(argv, ops, NULL);
+ ATF_REQUIRE(fts != NULL);
+
+ while ((ftse = fts_read(fts)) != NULL) {
+
+ if (ftse->fts_level < 1)
+ continue;
+
+ if (ftse->fts_level > depth) {
+ (void)fts_set(fts, ftse, FTS_SKIP);
+ continue;
+ }
+
+ switch(ftse->fts_info) {
+
+ case FTS_DP:
+
+ (void)memset(&sa, 0, sizeof(struct stat));
+ (void)memset(&sb, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(stat(ftse->fts_parent->fts_path,&sa) == 0);
+ ATF_REQUIRE(chdir(ftse->fts_path) == 0);
+ ATF_REQUIRE(stat(".", &sb) == 0);
+
+ /*
+ * The previous two stat(2) calls
+ * should be for the same directory.
+ */
+ if (sa.st_dev != sb.st_dev || sa.st_ino != sb.st_ino)
+ atf_tc_fail("inconsistent stat(2)");
+
+ /*
+ * Check that fts(3)'s stat(2)
+ * call equals the manual one.
+ */
+ if (sb.st_ino != ftse->fts_statp->st_ino)
+ atf_tc_fail("stat(2) and fts(3) differ");
+
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ (void)fts_close(fts);
+}
+
+ATF_TC(stat_err);
+ATF_TC_HEAD(stat_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from the stat(2) family");
+}
+
+ATF_TC_BODY(stat_err, tc)
+{
+ char buf[NAME_MAX + 1];
+ struct stat st;
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, fstat(-1, &st) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, stat(buf, &st) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, lstat(buf, &st) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, stat((void *)-1, &st) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, lstat((void *)-1, &st) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, stat("/etc/passwd", (void *)-1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, lstat("/etc/passwd", (void *)-1) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, stat("/a/b/c/d/e/f/g/h/i/j/k", &st) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, lstat("/a/b/c/d/e/f/g/h/i/j/k", &st) == -1);
+}
+
+ATF_TC_WITH_CLEANUP(stat_mtime);
+ATF_TC_HEAD(stat_mtime, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test modification times with stat(2)");
+}
+
+ATF_TC_BODY(stat_mtime, tc)
+{
+ struct stat sa, sb;
+ int fd[3];
+ size_t i;
+
+ for (i = 0; i < __arraycount(fd); i++) {
+
+ (void)memset(&sa, 0, sizeof(struct stat));
+ (void)memset(&sb, 0, sizeof(struct stat));
+
+ fd[i] = open(path, O_WRONLY | O_CREAT);
+
+ ATF_REQUIRE(fd[i] != -1);
+ ATF_REQUIRE(write(fd[i], "X", 1) == 1);
+ ATF_REQUIRE(stat(path, &sa) == 0);
+
+ (void)sleep(1);
+
+ ATF_REQUIRE(write(fd[i], "X", 1) == 1);
+ ATF_REQUIRE(stat(path, &sb) == 0);
+
+ ATF_REQUIRE(close(fd[i]) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+
+ if (sa.st_mtime == sb.st_mtime)
+ atf_tc_fail("mtimes did not change");
+ }
+}
+
+ATF_TC_CLEANUP(stat_mtime, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(stat_perm);
+ATF_TC_HEAD(stat_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with stat(2)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(stat_perm, tc)
+{
+ struct stat sa, sb;
+ gid_t gid;
+ uid_t uid;
+ int fd;
+
+ (void)memset(&sa, 0, sizeof(struct stat));
+ (void)memset(&sb, 0, sizeof(struct stat));
+
+ uid = getuid();
+ gid = getgid();
+
+ fd = open(path, O_RDONLY | O_CREAT);
+
+ ATF_REQUIRE(fd != -1);
+ ATF_REQUIRE(fstat(fd, &sa) == 0);
+ ATF_REQUIRE(stat(path, &sb) == 0);
+
+ if (gid != sa.st_gid || sa.st_gid != sb.st_gid)
+ atf_tc_fail("invalid GID");
+
+ if (uid != sa.st_uid || sa.st_uid != sb.st_uid)
+ atf_tc_fail("invalid UID");
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(stat_perm, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(stat_size);
+ATF_TC_HEAD(stat_size, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test file sizes with stat(2)");
+}
+
+ATF_TC_BODY(stat_size, tc)
+{
+ struct stat sa, sb, sc;
+ const size_t n = 10;
+ size_t i;
+ int fd;
+
+ fd = open(path, O_WRONLY | O_CREAT);
+ ATF_REQUIRE(fd >= 0);
+
+ for (i = 0; i < n; i++) {
+
+ (void)memset(&sa, 0, sizeof(struct stat));
+ (void)memset(&sb, 0, sizeof(struct stat));
+ (void)memset(&sc, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(fstat(fd, &sa) == 0);
+ ATF_REQUIRE(write(fd, "X", 1) == 1);
+ ATF_REQUIRE(fstat(fd, &sb) == 0);
+ ATF_REQUIRE(stat(path, &sc) == 0);
+
+ if (sa.st_size + 1 != sb.st_size)
+ atf_tc_fail("invalid file size");
+
+ if (sb.st_size != sc.st_size)
+ atf_tc_fail("stat(2) and fstat(2) mismatch");
+ }
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(stat_size, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(stat_socket);
+ATF_TC_HEAD(stat_socket, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test fstat(2) with "
+ "a socket (PR kern/46077)");
+}
+
+ATF_TC_BODY(stat_socket, tc)
+{
+ struct sockaddr_in addr;
+ struct stat st;
+ uint32_t iaddr;
+ int fd, flags;
+
+ (void)memset(&st, 0, sizeof(struct stat));
+ (void)memset(&addr, 0, sizeof(struct sockaddr_in));
+
+ fd = socket(AF_INET, SOCK_STREAM, 0);
+ ATF_REQUIRE(fd >= 0);
+
+ flags = fcntl(fd, F_GETFL);
+
+ ATF_REQUIRE(flags != -1);
+ ATF_REQUIRE(fcntl(fd, F_SETFL, flags | O_NONBLOCK) != -1);
+ ATF_REQUIRE(inet_pton(AF_INET, "127.0.0.1", &iaddr) == 1);
+
+ addr.sin_port = htons(42);
+ addr.sin_family = AF_INET;
+ addr.sin_addr.s_addr = iaddr;
+
+ errno = 0;
+
+ ATF_REQUIRE_ERRNO(EINPROGRESS,
+ connect(fd, (struct sockaddr *)&addr,
+ sizeof(struct sockaddr_in)) == -1);
+
+ errno = 0;
+
+ if (fstat(fd, &st) != 0 || errno != 0)
+ atf_tc_fail("fstat(2) failed for a EINPROGRESS socket");
+
+ (void)close(fd);
+}
+
+ATF_TC_WITH_CLEANUP(stat_symlink);
+ATF_TC_HEAD(stat_symlink, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test symbolic links with stat(2)");
+}
+
+ATF_TC_BODY(stat_symlink, tc)
+{
+ const char *pathlink = "pathlink";
+ struct stat sa, sb;
+ int fd;
+
+ (void)memset(&sa, 0, sizeof(struct stat));
+ (void)memset(&sb, 0, sizeof(struct stat));
+
+ fd = open(path, O_WRONLY | O_CREAT);
+
+ ATF_REQUIRE(fd >= 0);
+ ATF_REQUIRE(symlink(path, pathlink) == 0);
+ ATF_REQUIRE(stat(pathlink, &sa) == 0);
+ ATF_REQUIRE(lstat(pathlink, &sb) == 0);
+
+ if (S_ISLNK(sa.st_mode) != 0)
+ atf_tc_fail("stat(2) detected symbolic link");
+
+ if (S_ISLNK(sb.st_mode) == 0)
+ atf_tc_fail("lstat(2) did not detect symbolic link");
+
+ if (sa.st_mode == sb.st_mode)
+ atf_tc_fail("inconsistencies between stat(2) and lstat(2)");
+
+ ATF_REQUIRE(unlink(path) == 0);
+ ATF_REQUIRE(unlink(pathlink) == 0);
+}
+
+ATF_TC_CLEANUP(stat_symlink, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, stat_chflags);
+ ATF_TP_ADD_TC(tp, stat_dir);
+ ATF_TP_ADD_TC(tp, stat_err);
+ ATF_TP_ADD_TC(tp, stat_mtime);
+ ATF_TP_ADD_TC(tp, stat_perm);
+ ATF_TP_ADD_TC(tp, stat_size);
+ ATF_TP_ADD_TC(tp, stat_socket);
+ ATF_TP_ADD_TC(tp, stat_symlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_swapcontext.c b/contrib/netbsd-tests/lib/libc/sys/t_swapcontext.c
new file mode 100644
index 0000000..de36c88
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_swapcontext.c
@@ -0,0 +1,133 @@
+/* $NetBSD: t_swapcontext.c,v 1.3 2013/05/05 10:28:11 skrll Exp $ */
+
+/*
+ * Copyright (c) 2012 Emmanuel Dreyfus. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD");
+
+#include <ucontext.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <lwp.h>
+
+#include <atf-c.h>
+
+#define STACKSIZE 65536
+
+char stack[STACKSIZE];
+ucontext_t nctx;
+ucontext_t octx;
+void *otls;
+void *ntls;
+int val1, val2;
+int alter_tlsbase;
+
+/* ARGSUSED0 */
+static void
+swapfunc(void *arg)
+{
+ ntls = _lwp_getprivate();
+ printf("after swapcontext TLS pointer = %p\n", ntls);
+
+ if (alter_tlsbase) {
+ ATF_REQUIRE_EQ(ntls, &val1);
+ printf("TLS pointer modified by swapcontext()\n");
+ } else {
+ ATF_REQUIRE_EQ(ntls, &val2);
+ printf("TLS pointer left untouched by swapcontext()\n");
+ }
+
+ /* Go back in main */
+ ATF_REQUIRE(swapcontext(&nctx, &octx));
+
+ /* NOTREACHED */
+ return;
+}
+
+static void
+mainfunc(void)
+{
+ printf("Testing if swapcontext() alters TLS pointer if _UC_TLSBASE "
+ "is %s\n", (alter_tlsbase) ? "left set" : "cleared");
+
+ _lwp_setprivate(&val1);
+ printf("before swapcontext TLS pointer = %p\n", &val1);
+
+ ATF_REQUIRE(getcontext(&nctx) == 0);
+
+ nctx.uc_stack.ss_sp = stack;
+ nctx.uc_stack.ss_size = sizeof(stack);
+
+#ifndef _UC_TLSBASE
+ ATF_REQUIRE_MSG(0, "_UC_TLSBASE is not defined");
+#else /* _UC_TLSBASE */
+ ATF_REQUIRE(nctx.uc_flags & _UC_TLSBASE);
+ if (!alter_tlsbase)
+ nctx.uc_flags &= ~_UC_TLSBASE;
+#endif /* _UC_TLSBASE */
+
+ makecontext(&nctx, swapfunc, 0);
+
+ _lwp_setprivate(&val2);
+ otls = _lwp_getprivate();
+ printf("before swapcontext TLS pointer = %p\n", otls);
+ ATF_REQUIRE(swapcontext(&octx, &nctx) == 0);
+
+ printf("Test completed\n");
+}
+
+
+ATF_TC(swapcontext1);
+ATF_TC_HEAD(swapcontext1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Testing if swapcontext() can let "
+ "TLS pointer untouched");
+}
+ATF_TC_BODY(swapcontext1, tc)
+{
+ alter_tlsbase = 0;
+ mainfunc();
+}
+
+ATF_TC(swapcontext2);
+ATF_TC_HEAD(swapcontext2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Testing if swapcontext() can "
+ "modify TLS pointer");
+}
+ATF_TC_BODY(swapcontext2, tc)
+{
+ alter_tlsbase = 1;
+ mainfunc();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, swapcontext1);
+ ATF_TP_ADD_TC(tp, swapcontext2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c b/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
new file mode 100644
index 0000000..ce1fb99
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
@@ -0,0 +1,207 @@
+/* $NetBSD: t_timer_create.c,v 1.4 2012/03/18 07:00:52 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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 <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+static timer_t t;
+static bool fail = true;
+
+static void
+timer_signal_handler(int signo, siginfo_t *si, void *osi)
+{
+ timer_t *tp;
+
+ tp = si->si_value.sival_ptr;
+
+ if (*tp == t && signo == SIGALRM)
+ fail = false;
+
+ (void)fprintf(stderr, "%s: %s\n", __func__, strsignal(signo));
+}
+
+static void
+timer_signal_create(clockid_t cid, bool expire)
+{
+ struct itimerspec tim;
+ struct sigaction act;
+ struct sigevent evt;
+ sigset_t set;
+
+ t = 0;
+ fail = true;
+
+ (void)memset(&evt, 0, sizeof(struct sigevent));
+ (void)memset(&act, 0, sizeof(struct sigaction));
+ (void)memset(&tim, 0, sizeof(struct itimerspec));
+
+ /*
+ * Set handler.
+ */
+ act.sa_flags = SA_SIGINFO;
+ act.sa_sigaction = timer_signal_handler;
+
+ ATF_REQUIRE(sigemptyset(&set) == 0);
+ ATF_REQUIRE(sigemptyset(&act.sa_mask) == 0);
+
+ /*
+ * Block SIGALRM while configuring the timer.
+ */
+ ATF_REQUIRE(sigaction(SIGALRM, &act, NULL) == 0);
+ ATF_REQUIRE(sigaddset(&set, SIGALRM) == 0);
+ ATF_REQUIRE(sigprocmask(SIG_SETMASK, &set, NULL) == 0);
+
+ /*
+ * Create the timer (SIGEV_SIGNAL).
+ */
+ evt.sigev_signo = SIGALRM;
+ evt.sigev_value.sival_ptr = &t;
+ evt.sigev_notify = SIGEV_SIGNAL;
+
+ ATF_REQUIRE(timer_create(cid, &evt, &t) == 0);
+
+ /*
+ * Start the timer. After this, unblock the signal.
+ */
+ tim.it_value.tv_sec = expire ? 5 : 1;
+ tim.it_value.tv_nsec = 0;
+
+ ATF_REQUIRE(timer_settime(t, 0, &tim, NULL) == 0);
+
+ (void)sigprocmask(SIG_UNBLOCK, &set, NULL);
+ (void)sleep(2);
+
+ if (expire) {
+ if (!fail)
+ atf_tc_fail("timer fired too soon");
+ } else {
+ if (fail)
+ atf_tc_fail("timer failed to fire");
+ }
+
+ ATF_REQUIRE(timer_delete(t) == 0);
+}
+
+ATF_TC(timer_create_err);
+ATF_TC_HEAD(timer_create_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Check errors from timer_create(2) (PR lib/42434");
+}
+
+ATF_TC_BODY(timer_create_err, tc)
+{
+ struct sigevent ev;
+
+ (void)memset(&ev, 0, sizeof(struct sigevent));
+
+ errno = 0;
+ ev.sigev_signo = -1;
+ ev.sigev_notify = SIGEV_SIGNAL;
+
+ ATF_REQUIRE_ERRNO(EINVAL, timer_create(CLOCK_REALTIME, &ev, &t) == -1);
+
+ errno = 0;
+ ev.sigev_signo = SIGUSR1;
+ ev.sigev_notify = SIGEV_THREAD + 100;
+
+ ATF_REQUIRE_ERRNO(EINVAL, timer_create(CLOCK_REALTIME, &ev, &t) == -1);
+}
+
+ATF_TC(timer_create_real);
+ATF_TC_HEAD(timer_create_real, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks timer_create(2) with CLOCK_REALTIME and sigevent(3), "
+ "SIGEV_SIGNAL");
+}
+
+ATF_TC_BODY(timer_create_real, tc)
+{
+ timer_signal_create(CLOCK_REALTIME, false);
+}
+
+ATF_TC(timer_create_mono);
+ATF_TC_HEAD(timer_create_mono, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks timer_create(2) with CLOCK_MONOTONIC and sigevent(3), "
+ "SIGEV_SIGNAL");
+}
+
+ATF_TC_BODY(timer_create_mono, tc)
+{
+ timer_signal_create(CLOCK_MONOTONIC, false);
+}
+
+ATF_TC(timer_create_real_expire);
+ATF_TC_HEAD(timer_create_real_expire, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks timer_create(2) with CLOCK_REALTIME and sigevent(3), "
+ "SIGEV_SIGNAL, with expiration");
+}
+
+ATF_TC_BODY(timer_create_real_expire, tc)
+{
+ timer_signal_create(CLOCK_REALTIME, true);
+}
+
+ATF_TC(timer_create_mono_expire);
+ATF_TC_HEAD(timer_create_mono_expire, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks timer_create(2) with CLOCK_MONOTONIC and sigevent(3), "
+ "SIGEV_SIGNAL, with expiration");
+}
+
+ATF_TC_BODY(timer_create_mono_expire, tc)
+{
+ timer_signal_create(CLOCK_MONOTONIC, true);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, timer_create_err);
+ ATF_TP_ADD_TC(tp, timer_create_real);
+ ATF_TP_ADD_TC(tp, timer_create_mono);
+ ATF_TP_ADD_TC(tp, timer_create_real_expire);
+ ATF_TP_ADD_TC(tp, timer_create_mono_expire);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_truncate.c b/contrib/netbsd-tests/lib/libc/sys/t_truncate.c
new file mode 100644
index 0000000..50a9cba
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_truncate.c
@@ -0,0 +1,175 @@
+/* $NetBSD: t_truncate.c,v 1.2 2011/08/18 19:48:03 dholland Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_truncate.c,v 1.2 2011/08/18 19:48:03 dholland Exp $");
+
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char path[] = "truncate";
+static const size_t sizes[] = { 8, 16, 512, 1024, 2048, 4094, 3000, 30 };
+
+ATF_TC_WITH_CLEANUP(ftruncate_basic);
+ATF_TC_HEAD(ftruncate_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of ftruncate(2)");
+}
+
+ATF_TC_BODY(ftruncate_basic, tc)
+{
+ struct stat st;
+ size_t i;
+ int fd;
+
+ fd = open(path, O_RDWR | O_CREAT, 0600);
+ ATF_REQUIRE(fd >= 0);
+
+ for (i = 0; i < __arraycount(sizes); i++) {
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(ftruncate(fd, sizes[i]) == 0);
+ ATF_REQUIRE(fstat(fd, &st) == 0);
+
+ (void)fprintf(stderr, "truncating to %zu bytes\n", sizes[i]);
+
+ if (sizes[i] != (size_t)st.st_size)
+ atf_tc_fail("ftruncate(2) did not truncate");
+ }
+
+ (void)close(fd);
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(ftruncate_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(ftruncate_err);
+ATF_TC_HEAD(ftruncate_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from ftruncate(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(ftruncate_err, tc)
+{
+ int fd;
+
+ fd = open("/etc/passwd", O_RDONLY, 0400);
+ ATF_REQUIRE(fd >= 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, ftruncate(-1, 999) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, ftruncate(fd, 999) == -1);
+
+ (void)close(fd);
+}
+
+ATF_TC_WITH_CLEANUP(truncate_basic);
+ATF_TC_HEAD(truncate_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of truncate(2)");
+}
+
+ATF_TC_BODY(truncate_basic, tc)
+{
+ struct stat st;
+ size_t i;
+ int fd;
+
+ fd = open(path, O_RDWR | O_CREAT, 0600);
+ ATF_REQUIRE(fd >= 0);
+
+ for (i = 0; i < __arraycount(sizes); i++) {
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ ATF_REQUIRE(truncate(path, sizes[i]) == 0);
+ ATF_REQUIRE(fstat(fd, &st) == 0);
+
+ (void)fprintf(stderr, "truncating to %zu bytes\n", sizes[i]);
+
+ if (sizes[i] != (size_t)st.st_size)
+ atf_tc_fail("truncate(2) did not truncate");
+ }
+
+ (void)close(fd);
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(truncate_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(truncate_err);
+ATF_TC_HEAD(truncate_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from truncate(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(truncate_err, tc)
+{
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, truncate((void *)-1, 999) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EISDIR, truncate("/etc", 999) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, truncate("/a/b/c/d/e/f/g", 999) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EACCES, truncate("/usr/bin/fpr", 999) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, ftruncate_basic);
+ ATF_TP_ADD_TC(tp, ftruncate_err);
+ ATF_TP_ADD_TC(tp, truncate_basic);
+ ATF_TP_ADD_TC(tp, truncate_err);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_ucontext.c b/contrib/netbsd-tests/lib/libc/sys/t_ucontext.c
new file mode 100644
index 0000000..27d6740
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_ucontext.c
@@ -0,0 +1,76 @@
+/* $NetBSD: t_ucontext.c,v 1.1 2011/10/15 06:54:52 jruoho Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_ucontext.c,v 1.1 2011/10/15 06:54:52 jruoho Exp $");
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <ucontext.h>
+
+ATF_TC(ucontext_basic);
+ATF_TC_HEAD(ucontext_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks {get,set}context(2)");
+}
+
+ATF_TC_BODY(ucontext_basic, tc)
+{
+ ucontext_t u, v, w;
+ volatile int x, y;
+
+ x = 0;
+ y = 0;
+
+ printf("Start\n");
+
+ getcontext(&u);
+ y++;
+
+ printf("x == %d\n", x);
+
+ getcontext(&v);
+
+ if ( x < 20 ) {
+ x++;
+ getcontext(&w);
+ setcontext(&u);
+ }
+
+ printf("End, y = %d\n", y);
+ ATF_REQUIRE_EQ(y, 21);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, ucontext_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_umask.c b/contrib/netbsd-tests/lib/libc/sys/t_umask.c
new file mode 100644
index 0000000..748cbdc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_umask.c
@@ -0,0 +1,205 @@
+/* $NetBSD: t_umask.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_umask.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $");
+
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char path[] = "umask";
+static const mode_t mask[] = {
+ S_IRWXU,
+ S_IRUSR,
+ S_IWUSR,
+ S_IXUSR,
+ S_IRWXG,
+ S_IRGRP,
+ S_IWGRP,
+ S_IXGRP,
+ S_IRWXO,
+ S_IROTH,
+ S_IWOTH,
+ S_IXOTH
+};
+
+ATF_TC_WITH_CLEANUP(umask_fork);
+ATF_TC_HEAD(umask_fork, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check that umask(2) is inherited");
+}
+
+ATF_TC_BODY(umask_fork, tc)
+{
+ mode_t mode;
+ pid_t pid;
+ size_t i;
+ int sta;
+
+ for (i = 0; i < __arraycount(mask) - 1; i++) {
+
+ (void)umask(mask[i] | mask[i + 1]);
+
+ pid = fork();
+
+ if (pid < 0)
+ continue;
+
+ if (pid == 0) {
+
+ mode = umask(mask[i]);
+
+ if (mode != (mask[i] | mask[i + 1]))
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ goto fail;
+ }
+
+ return;
+
+fail:
+ (void)umask(S_IWGRP | S_IWOTH);
+
+ atf_tc_fail("umask(2) was not inherited");
+}
+
+ATF_TC_CLEANUP(umask_fork, tc)
+{
+ (void)umask(S_IWGRP | S_IWOTH);
+}
+
+ATF_TC_WITH_CLEANUP(umask_open);
+ATF_TC_HEAD(umask_open, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of open(2) and umask(2)");
+}
+
+ATF_TC_BODY(umask_open, tc)
+{
+ const char *str = NULL;
+ struct stat st;
+ size_t i;
+ int fd;
+
+ for (i = 0; i < __arraycount(mask); i++) {
+
+ (void)umask(mask[i]);
+
+ fd = open(path, O_RDWR | O_CREAT, 0777);
+
+ if (fd < 0)
+ continue;
+
+ (void)memset(&st, 0, sizeof(struct stat));
+
+ if (stat(path, &st) != 0) {
+ str = "failed to stat(2)";
+ goto out;
+ }
+
+ if ((st.st_mode & mask[i]) != 0) {
+ str = "invalid umask(2)";
+ goto out;
+ }
+
+ if (unlink(path) != 0) {
+ str = "failed to unlink(2)";
+ goto out;
+ }
+
+ }
+
+out:
+ (void)umask(S_IWGRP | S_IWOTH);
+
+ if (str != NULL)
+ atf_tc_fail("%s", str);
+}
+
+ATF_TC_CLEANUP(umask_open, tc)
+{
+ (void)umask(S_IWGRP | S_IWOTH);
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(umask_previous);
+ATF_TC_HEAD(umask_previous, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test the return value from umask(2)");
+}
+
+ATF_TC_BODY(umask_previous, tc)
+{
+ mode_t mode;
+ size_t i;
+
+ for (i = 0; i < __arraycount(mask); i++) {
+
+ mode = umask(mask[i]);
+ mode = umask(mask[i]);
+
+ if (mode != mask[i])
+ goto fail;
+ }
+
+ return;
+
+fail:
+ (void)umask(S_IWGRP | S_IWOTH);
+
+ atf_tc_fail("umask(2) did not return the previous mask");
+}
+
+ATF_TC_CLEANUP(umask_previous, tc)
+{
+ (void)umask(S_IWGRP | S_IWOTH);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, umask_fork);
+ ATF_TP_ADD_TC(tp, umask_open);
+ ATF_TP_ADD_TC(tp, umask_previous);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_unlink.c b/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
new file mode 100644
index 0000000..38bff4c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
@@ -0,0 +1,158 @@
+/* $NetBSD: t_unlink.c,v 1.2 2014/04/21 18:05:17 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_unlink.c,v 1.2 2014/04/21 18:05:17 martin Exp $");
+
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+
+static char path[] = "unlink";
+
+ATF_TC_WITH_CLEANUP(unlink_basic);
+ATF_TC_HEAD(unlink_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of unlink(2)");
+}
+
+ATF_TC_BODY(unlink_basic, tc)
+{
+ const size_t n = 512;
+ size_t i;
+ int fd;
+
+ for (i = 0; i < n; i++) {
+
+ fd = open(path, O_RDWR | O_CREAT, 0666);
+
+ ATF_REQUIRE(fd != -1);
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, open(path, O_RDONLY) == -1);
+ }
+}
+
+ATF_TC_CLEANUP(unlink_basic, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(unlink_err);
+ATF_TC_HEAD(unlink_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test error conditions of unlink(2)");
+}
+
+ATF_TC_BODY(unlink_err, tc)
+{
+ char buf[PATH_MAX + 1];
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBUSY, unlink("/") == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENAMETOOLONG, unlink(buf) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, unlink("/a/b/c/d/e/f/g/h/i/j/k/l/m") == -1);
+}
+
+ATF_TC_CLEANUP(unlink_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(unlink_fifo);
+ATF_TC_HEAD(unlink_fifo, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test unlink(2) for a FIFO");
+}
+
+ATF_TC_BODY(unlink_fifo, tc)
+{
+
+ ATF_REQUIRE(mkfifo(path, 0666) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(ENOENT, open(path, O_RDONLY) == -1);
+}
+
+ATF_TC_CLEANUP(unlink_fifo, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(unlink_perm);
+ATF_TC_HEAD(unlink_perm, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test permissions with unlink(2)");
+ atf_tc_set_md_var(tc, "require.user", "unprivileged");
+}
+
+ATF_TC_BODY(unlink_perm, tc)
+{
+ int rv;
+
+ errno = 0;
+ rv = unlink("/etc");
+ ATF_REQUIRE_MSG(rv == -1 && (errno == EACCES || errno == EPERM),
+ "unlinking a directory did not fail with EPERM or EACCESS; "
+ "unlink() returned %d, errno %d", rv, errno);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EACCES, unlink("/root/.profile") == -1);
+}
+
+ATF_TC_CLEANUP(unlink_perm, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, unlink_basic);
+ ATF_TP_ADD_TC(tp, unlink_err);
+ ATF_TP_ADD_TC(tp, unlink_fifo);
+ ATF_TP_ADD_TC(tp, unlink_perm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_write.c b/contrib/netbsd-tests/lib/libc/sys/t_write.c
new file mode 100644
index 0000000..2b1324a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/sys/t_write.c
@@ -0,0 +1,226 @@
+/* $NetBSD: t_write.c,v 1.2 2011/10/19 16:19:30 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2001, 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_write.c,v 1.2 2011/10/19 16:19:30 jruoho Exp $");
+
+#include <sys/uio.h>
+#include <sys/syslimits.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+
+static void sighandler(int);
+
+static bool fail = false;
+static const char *path = "write";
+
+static void
+sighandler(int signo)
+{
+ fail = false;
+}
+
+ATF_TC_WITH_CLEANUP(write_err);
+ATF_TC_HEAD(write_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks errors from write(2)");
+}
+
+ATF_TC_BODY(write_err, tc)
+{
+ char rbuf[3] = { 'a', 'b', 'c' };
+ char wbuf[3] = { 'x', 'y', 'z' };
+ int fd;
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EBADF, write(-1, wbuf, sizeof(wbuf)) == -1);
+
+ fd = open(path, O_RDWR | O_CREAT);
+
+ if (fd >= 0) {
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(0, write(fd, wbuf, 3) == 3);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, write(fd, wbuf, SIZE_MAX) == -1);
+
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EFAULT, write(fd, (void *)-1, 1) == -1);
+
+ /*
+ * Check that the above bogus write(2)
+ * calls did not corrupt the file.
+ */
+ ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0);
+ ATF_REQUIRE(read(fd, rbuf, 3) == 3);
+ ATF_REQUIRE(memcmp(rbuf, wbuf, 3) == 0);
+
+ (void)close(fd);
+ (void)unlink(path);
+ }
+}
+
+ATF_TC_CLEANUP(write_err, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(write_pipe);
+ATF_TC_HEAD(write_pipe, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks for EPIPE from write(2)");
+}
+
+ATF_TC_BODY(write_pipe, tc)
+{
+ int fds[2];
+
+ ATF_REQUIRE(pipe(fds) == 0);
+ ATF_REQUIRE(signal(SIGPIPE, sighandler) == 0);
+
+ ATF_REQUIRE(write(fds[1], "x", 1) != -1);
+ ATF_REQUIRE(close(fds[0]) == 0);
+
+ errno = 0;
+ fail = true;
+
+ if (write(fds[1], "x", 1) != -1 || errno != EPIPE)
+ atf_tc_fail_nonfatal("expected EPIPE but write(2) succeeded");
+
+ ATF_REQUIRE(close(fds[1]) == 0);
+
+ if (fail != false)
+ atf_tc_fail_nonfatal("SIGPIPE was not raised");
+}
+
+ATF_TC_WITH_CLEANUP(write_pos);
+ATF_TC_HEAD(write_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that write(2) "
+ "updates the file position");
+}
+
+ATF_TC_BODY(write_pos, tc)
+{
+ const size_t n = 123;
+ size_t i;
+ int fd;
+
+ fd = open(path, O_RDWR | O_CREAT);
+ ATF_REQUIRE(fd >= 0);
+
+ for (i = 0; i < n; i++) {
+ ATF_REQUIRE(write(fd, "x", 1) == 1);
+ ATF_REQUIRE(lseek(fd, 0, SEEK_CUR) == (off_t)(i + 1));
+ }
+
+ ATF_REQUIRE(close(fd) == 0);
+ ATF_REQUIRE(unlink(path) == 0);
+}
+
+ATF_TC_CLEANUP(write_pos, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC_WITH_CLEANUP(write_ret);
+ATF_TC_HEAD(write_ret, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks return values from write(2)");
+}
+
+ATF_TC_BODY(write_ret, tc)
+{
+ const size_t n = 99;
+ char buf[123];
+ size_t i, j;
+ int fd;
+
+ fd = open(path, O_WRONLY | O_CREAT);
+ ATF_REQUIRE(fd >= 0);
+
+ (void)memset(buf, 'x', sizeof(buf));
+
+ for (i = j = 0; i < n; i++)
+ j += write(fd, buf, sizeof(buf));
+
+ if (j != n * 123)
+ atf_tc_fail("inconsistent return values from write(2)");
+
+ (void)close(fd);
+ (void)unlink(path);
+}
+
+ATF_TC_CLEANUP(write_ret, tc)
+{
+ (void)unlink(path);
+}
+
+ATF_TC(writev_iovmax);
+ATF_TC_HEAD(writev_iovmax, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "10");
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that file descriptor is properly FILE_UNUSE()d "
+ "when iovcnt is greater than IOV_MAX");
+}
+
+ATF_TC_BODY(writev_iovmax, tc)
+{
+ ssize_t retval;
+
+ (void)printf("Calling writev(2, NULL, IOV_MAX + 1)...\n");
+
+ errno = 0;
+ retval = writev(2, NULL, IOV_MAX + 1);
+
+ ATF_REQUIRE_EQ_MSG(retval, -1, "got: %zd", retval);
+ ATF_REQUIRE_EQ_MSG(errno, EINVAL, "got: %s", strerror(errno));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, write_err);
+ ATF_TP_ADD_TC(tp, write_pipe);
+ ATF_TP_ADD_TC(tp, write_pos);
+ ATF_TP_ADD_TC(tp, write_ret);
+ ATF_TP_ADD_TC(tp, writev_iovmax);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/t_cdb.c b/contrib/netbsd-tests/lib/libc/t_cdb.c
new file mode 100644
index 0000000..5e88e65
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/t_cdb.c
@@ -0,0 +1,158 @@
+/* $NetBSD: t_cdb.c,v 1.1 2012/09/27 00:38:57 joerg Exp $ */
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_cdb.c,v 1.1 2012/09/27 00:38:57 joerg Exp $");
+
+#include <atf-c.h>
+#include <assert.h>
+#include <cdbr.h>
+#include <cdbw.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define MAXKEYS 16384
+
+static const char database_name[] = "test.cdb";
+
+uint32_t keys[MAXKEYS];
+
+static int
+cmp_keys(const void *a_, const void *b_)
+{
+ uint32_t a = *(const uint32_t *)a_;
+ uint32_t b = *(const uint32_t *)b_;
+
+ return a > b ? 1 : (a < b ? 1 : 0);
+}
+
+static void
+init_keys(size_t len)
+{
+ uint32_t sorted_keys[MAXKEYS];
+ size_t i;
+
+ assert(len <= MAXKEYS);
+
+ if (len == 0)
+ return;
+
+ do {
+ for (i = 0; i < len; ++i)
+ sorted_keys[i] = keys[i] = arc4random();
+
+ qsort(sorted_keys, len, sizeof(*sorted_keys), cmp_keys);
+ for (i = 1; i < len; ++i) {
+ if (sorted_keys[i - 1] == sorted_keys[i])
+ break;
+ }
+ } while (i != len);
+}
+
+static void
+write_database(size_t len)
+{
+ struct cdbw *db;
+ int fd;
+ size_t i;
+ uint32_t buf[2];
+
+ ATF_REQUIRE((db = cdbw_open()) != NULL);
+ ATF_REQUIRE((fd = creat(database_name, S_IRUSR|S_IWUSR)) != -1);
+ for (i = 0; i < len; ++i) {
+ buf[0] = i;
+ buf[1] = keys[i];
+ ATF_REQUIRE(cdbw_put(db, &keys[i], sizeof(keys[i]),
+ buf, sizeof(buf)) == 0);
+ }
+ ATF_REQUIRE(cdbw_output(db, fd, "test database", arc4random) == 0);
+ cdbw_close(db);
+ ATF_REQUIRE(close(fd) == 0);
+}
+
+static void
+check_database(size_t len)
+{
+ struct cdbr *db;
+ size_t i, data_len;
+ const void *data;
+ uint32_t buf[2];
+
+ ATF_REQUIRE((db = cdbr_open(database_name, CDBR_DEFAULT)) != NULL);
+ ATF_REQUIRE_EQ(cdbr_entries(db), len);
+ for (i = 0; i < len; ++i) {
+ ATF_REQUIRE(cdbr_find(db, &keys[i], sizeof(keys[i]),
+ &data, &data_len) != -1);
+ ATF_REQUIRE_EQ(data_len, sizeof(buf));
+ memcpy(buf, data, sizeof(buf));
+ ATF_REQUIRE_EQ(buf[0], i);
+ ATF_REQUIRE_EQ(buf[1], keys[i]);
+ }
+ cdbr_close(db);
+}
+
+ATF_TC_WITH_CLEANUP(cdb);
+
+ATF_TC_HEAD(cdb, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test cdb(5) reading and writing");
+}
+
+ATF_TC_BODY(cdb, tc)
+{
+ size_t i, sizes[] = { 0, 16, 64, 1024, 2048 };
+ for (i = 0; i < __arraycount(sizes); ++i) {
+ init_keys(sizes[i]);
+ write_database(sizes[i]);
+ check_database(sizes[i]);
+ unlink(database_name);
+ }
+}
+
+ATF_TC_CLEANUP(cdb, tc)
+{
+
+ unlink(database_name);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, cdb);
+
+ return atf_no_error();
+}
+
diff --git a/contrib/netbsd-tests/lib/libc/t_convfp.c b/contrib/netbsd-tests/lib/libc/t_convfp.c
new file mode 100644
index 0000000..de68690
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/t_convfp.c
@@ -0,0 +1,155 @@
+/* $NetBSD: t_convfp.c,v 1.7 2011/06/14 11:58:22 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2003 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * This value is representable as an unsigned int, but not as an int.
+ * According to ISO C it must survive the convsion back from a double
+ * to an unsigned int (everything > -1 and < UINT_MAX+1 has to)
+ */
+#define UINT_TESTVALUE (INT_MAX+42U)
+
+/* The same for unsigned long */
+#define ULONG_TESTVALUE (LONG_MAX+42UL)
+
+
+ATF_TC(conv_uint);
+ATF_TC_HEAD(conv_uint, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test conversions to unsigned int");
+}
+
+ATF_TC_BODY(conv_uint, tc)
+{
+ unsigned int ui;
+ double d;
+
+ /* unsigned int test */
+ d = UINT_TESTVALUE;
+ ui = (unsigned int)d;
+
+ if (ui != UINT_TESTVALUE)
+ atf_tc_fail("FAILED: unsigned int %u (0x%x) != %u (0x%x)",
+ ui, ui, UINT_TESTVALUE, UINT_TESTVALUE);
+}
+
+ATF_TC(conv_ulong);
+
+ATF_TC_HEAD(conv_ulong, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test conversions to unsigned long");
+}
+
+ATF_TC_BODY(conv_ulong, tc)
+{
+ unsigned long ul;
+ long double dt;
+ double d;
+
+ /* unsigned long vs. {long} double test */
+ if (sizeof(d) > sizeof(ul)) {
+ d = ULONG_TESTVALUE;
+ ul = (unsigned long)d;
+ printf("testing double vs. long\n");
+ } else if (sizeof(dt) > sizeof(ul)) {
+ dt = ULONG_TESTVALUE;
+ ul = (unsigned long)dt;
+ printf("testing long double vs. long\n");
+ } else {
+ printf("sizeof(long) = %zu, sizeof(double) = %zu, "
+ "sizeof(long double) = %zu\n",
+ sizeof(ul), sizeof(d), sizeof(dt));
+ atf_tc_skip("no suitable {long} double type found");
+ }
+
+ if (ul != ULONG_TESTVALUE)
+ atf_tc_fail("unsigned long %lu (0x%lx) != %lu (0x%lx)",
+ ul, ul, ULONG_TESTVALUE, ULONG_TESTVALUE);
+}
+
+ATF_TC(cast_ulong);
+
+ATF_TC_HEAD(cast_ulong, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "test double to unsigned long cast");
+}
+
+ATF_TC_BODY(cast_ulong, tc)
+{
+ double nv;
+ unsigned long uv;
+
+ nv = 5.6;
+ uv = (unsigned long)nv;
+
+ ATF_CHECK_EQ_MSG(uv, 5,
+ "%.3f casted to unsigned long is %lu", nv, uv);
+}
+
+ATF_TC(cast_ulong2);
+
+ATF_TC_HEAD(cast_ulong2, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "test double/long double casts to unsigned long");
+}
+
+ATF_TC_BODY(cast_ulong2, tc)
+{
+ double dv = 1.9;
+ long double ldv = dv;
+ unsigned long l1 = dv;
+ unsigned long l2 = ldv;
+
+ ATF_CHECK_EQ_MSG(l1, 1,
+ "double 1.9 casted to unsigned long should be 1, but is %lu", l1);
+
+ ATF_CHECK_EQ_MSG(l2, 1,
+ "long double 1.9 casted to unsigned long should be 1, but is %lu",
+ l2);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, conv_uint);
+ ATF_TP_ADD_TC(tp, conv_ulong);
+ ATF_TP_ADD_TC(tp, cast_ulong);
+ ATF_TP_ADD_TC(tp, cast_ulong2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/t_gdtoa.c b/contrib/netbsd-tests/lib/libc/t_gdtoa.c
new file mode 100644
index 0000000..e040603
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/t_gdtoa.c
@@ -0,0 +1,67 @@
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_gdtoa.c,v 1.4 2012/09/27 08:19:18 martin Exp $");
+
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* reported by Maksymilian Arciemowicz */
+
+ATF_TC(long_format);
+
+ATF_TC_HEAD(long_format, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test printf with %%1.262159f format");
+}
+
+ATF_TC_BODY(long_format, tc)
+{
+ char *buf;
+ ATF_REQUIRE_EQ(262161, asprintf(&buf, "%1.262159f", 1.1));
+ free(buf);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, long_format);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/termios/t_tcsetpgrp.c b/contrib/netbsd-tests/lib/libc/termios/t_tcsetpgrp.c
new file mode 100644
index 0000000..66b1735
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/termios/t_tcsetpgrp.c
@@ -0,0 +1,87 @@
+/* $NetBSD: t_tcsetpgrp.c,v 1.3 2012/03/18 07:14:08 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_tcsetpgrp.c,v 1.3 2012/03/18 07:14:08 jruoho Exp $");
+
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+ATF_TC(tcsetpgrp_err);
+ATF_TC_HEAD(tcsetpgrp_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test errors from tcsetpgrp(3)"
+ " (PR lib/41673)");
+}
+
+ATF_TC_BODY(tcsetpgrp_err, tc)
+{
+ int rv, sta;
+ pid_t pid;
+
+ if (isatty(STDIN_FILENO) == 0)
+ return;
+
+ pid = fork();
+ ATF_REQUIRE(pid >= 0);
+
+ if (pid == 0) {
+
+ /*
+ * The child process ID doesn't match any active
+ * process group ID, so the following call should
+ * fail with EPERM (and not EINVAL).
+ */
+ errno = 0;
+ rv = tcsetpgrp(STDIN_FILENO, getpid());
+
+ if (rv == 0 || errno != EPERM)
+ _exit(EXIT_FAILURE);
+
+ _exit(EXIT_SUCCESS);
+ }
+
+ (void)wait(&sta);
+
+ if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
+ atf_tc_fail("wrong errno");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, tcsetpgrp_err);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/time/t_mktime.c b/contrib/netbsd-tests/lib/libc/time/t_mktime.c
new file mode 100644
index 0000000..8092361
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/time/t_mktime.c
@@ -0,0 +1,155 @@
+/* $NetBSD: t_mktime.c,v 1.5 2012/03/18 07:33:58 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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 <atf-c.h>
+
+#include <err.h>
+#include <errno.h>
+#include <string.h>
+#include <time.h>
+
+ATF_TC(localtime_r_gmt);
+ATF_TC_HEAD(localtime_r_gmt, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that localtime_r(3) "
+ "returns localtime, not GMT (PR lib/28324)");
+}
+
+ATF_TC_BODY(localtime_r_gmt, tc)
+{
+ struct tm *t;
+ struct tm tt;
+ time_t x;
+
+ x = time(NULL);
+ localtime_r(&x, &tt);
+ t = localtime(&x);
+
+ if (t->tm_sec != tt.tm_sec || t->tm_min != tt.tm_min ||
+ t->tm_hour != tt.tm_hour || t->tm_mday != tt.tm_mday)
+ atf_tc_fail("inconsistencies between "
+ "localtime(3) and localtime_r(3)");
+}
+
+ATF_TC(mktime_negyear);
+ATF_TC_HEAD(mktime_negyear, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test mktime(3) with negative year");
+}
+
+ATF_TC_BODY(mktime_negyear, tc)
+{
+ struct tm tms;
+ time_t t;
+
+ (void)memset(&tms, 0, sizeof(tms));
+ tms.tm_year = ~0;
+
+ errno = 0;
+ t = mktime(&tms);
+ ATF_REQUIRE_ERRNO(0, t != (time_t)-1);
+}
+
+ATF_TC(timegm_epoch);
+ATF_TC_HEAD(timegm_epoch, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test timegm(3) close to the epoch");
+}
+
+ATF_TC_BODY(timegm_epoch, tc)
+{
+ struct tm tms;
+ time_t t;
+
+ /* midnight on 1 Jan 1970 */
+ (void)memset(&tms, 0, sizeof(tms));
+ errno = 0;
+ tms.tm_year = 1970 - 1900;
+ tms.tm_mday = 1;
+ t = timegm(&tms);
+ ATF_REQUIRE_ERRNO(0, t == (time_t)0);
+
+ /* one second after midnight on 1 Jan 1970 */
+ (void)memset(&tms, 0, sizeof(tms));
+ errno = 0;
+ tms.tm_year = 1970 - 1900;
+ tms.tm_mday = 1;
+ tms.tm_sec = 1;
+ t = timegm(&tms);
+ ATF_REQUIRE_ERRNO(0, t == (time_t)1);
+
+ /*
+ * 1969-12-31 23:59:59 = one second before the epoch.
+ * Result should be -1 with errno = 0.
+ */
+ (void)memset(&tms, 0, sizeof(tms));
+ errno = 0;
+ tms.tm_year = 1969 - 1900;
+ tms.tm_mon = 12 - 1;
+ tms.tm_mday = 31;
+ tms.tm_hour = 23;
+ tms.tm_min = 59;
+ tms.tm_sec = 59;
+ t = timegm(&tms);
+ ATF_REQUIRE_ERRNO(0, t == (time_t)-1);
+
+ /*
+ * Another way of getting one second before the epoch:
+ * Set date to 1 Jan 1970, and time to -1 second.
+ */
+ (void)memset(&tms, 0, sizeof(tms));
+ errno = 0;
+ tms.tm_year = 1970 - 1900;
+ tms.tm_mday = 1;
+ tms.tm_sec = -1;
+ t = timegm(&tms);
+ ATF_REQUIRE_ERRNO(0, t == (time_t)-1);
+
+ /*
+ * Two seconds before the epoch.
+ */
+ (void)memset(&tms, 0, sizeof(tms));
+ errno = 0;
+ tms.tm_year = 1970 - 1900;
+ tms.tm_mday = 1;
+ tms.tm_sec = -2;
+ t = timegm(&tms);
+ ATF_REQUIRE_ERRNO(0, t == (time_t)-2);
+
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, localtime_r_gmt);
+ ATF_TP_ADD_TC(tp, mktime_negyear);
+ ATF_TP_ADD_TC(tp, timegm_epoch);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/time/t_strptime.c b/contrib/netbsd-tests/lib/libc/time/t_strptime.c
new file mode 100644
index 0000000..c0f9cdf
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/time/t_strptime.c
@@ -0,0 +1,252 @@
+/* $NetBSD: t_strptime.c,v 1.1 2011/01/13 00:14:10 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by David Laight.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_strptime.c,v 1.1 2011/01/13 00:14:10 pgoyette Exp $");
+
+#include <time.h>
+
+#include <atf-c.h>
+
+static void
+h_pass(const char *buf, const char *fmt, int len,
+ int tm_sec, int tm_min, int tm_hour, int tm_mday,
+ int tm_mon, int tm_year, int tm_wday, int tm_yday)
+{
+ struct tm tm = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL };
+ const char *ret, *exp;
+
+ exp = buf + len;
+ ret = strptime(buf, fmt, &tm);
+
+ ATF_REQUIRE_MSG(ret == exp,
+ "strptime(\"%s\", \"%s\", tm): incorrect return code: "
+ "expected: %p, got: %p", buf, fmt, exp, ret);
+
+#define H_REQUIRE_FIELD(field) \
+ ATF_REQUIRE_MSG(tm.field == field, \
+ "strptime(\"%s\", \"%s\", tm): incorrect %s: " \
+ "expected: %d, but got: %d", buf, fmt, \
+ ___STRING(field), field, tm.field)
+
+ H_REQUIRE_FIELD(tm_sec);
+ H_REQUIRE_FIELD(tm_min);
+ H_REQUIRE_FIELD(tm_hour);
+ H_REQUIRE_FIELD(tm_mday);
+ H_REQUIRE_FIELD(tm_mon);
+ H_REQUIRE_FIELD(tm_year);
+ H_REQUIRE_FIELD(tm_wday);
+ H_REQUIRE_FIELD(tm_yday);
+
+#undef H_REQUIRE_FIELD
+}
+
+static void
+h_fail(const char *buf, const char *fmt)
+{
+ struct tm tm = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL };
+
+ ATF_REQUIRE_MSG(strptime(buf, fmt, &tm) == NULL, "strptime(\"%s\", "
+ "\"%s\", &tm) should fail, but it didn't", buf, fmt);
+}
+
+ATF_TC(common);
+
+ATF_TC_HEAD(common, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks strptime(3): various checks");
+}
+
+ATF_TC_BODY(common, tc)
+{
+
+ h_pass("Tue Jan 20 23:27:46 1998", "%a %b %d %T %Y",
+ 24, 46, 27, 23, 20, 0, 98, 2, -1);
+ h_pass("Tue Jan 20 23:27:46 1998", "%a %b %d %H:%M:%S %Y",
+ 24, 46, 27, 23, 20, 0, 98, 2, -1);
+ h_pass("Tue Jan 20 23:27:46 1998", "%c",
+ 24, 46, 27, 23, 20, 0, 98, 2, -1);
+ h_pass("Fri Mar 4 20:05:34 2005", "%a %b %e %H:%M:%S %Y",
+ 24, 34, 5, 20, 4, 2, 105, 5, -1);
+ h_pass("5\t3 4 8pm:05:34 2005", "%w%n%m%t%d%n%k%p:%M:%S %Y",
+ 21, 34, 5, 20, 4, 2, 105, 5, -1);
+ h_pass("Fri Mar 4 20:05:34 2005", "%c",
+ 24, 34, 5, 20, 4, 2, 105, 5, -1);
+
+ h_pass("x20y", "x%Cy", 4, -1, -1, -1, -1, -1, 100, -1, -1);
+ h_pass("x84y", "x%yy", 4, -1, -1, -1, -1, -1, 84, -1, -1);
+ h_pass("x2084y", "x%C%yy", 6, -1, -1, -1, -1, -1, 184, -1, -1);
+ h_pass("x8420y", "x%y%Cy", 6, -1, -1, -1, -1, -1, 184, -1, -1);
+ h_pass("%20845", "%%%C%y5", 6, -1, -1, -1, -1, -1, 184, -1, -1);
+ h_fail("%", "%E%");
+
+ h_pass("1980", "%Y", 4, -1, -1, -1, -1, -1, 80, -1, -1);
+ h_pass("1980", "%EY", 4, -1, -1, -1, -1, -1, 80, -1, -1);
+
+ h_pass("0", "%S", 1, 0, -1, -1, -1, -1, -1, -1, -1);
+ h_pass("59", "%S", 2, 59, -1, -1, -1, -1, -1, -1, -1);
+ h_pass("60", "%S", 2, 60, -1, -1, -1, -1, -1, -1, -1);
+ h_pass("61", "%S", 2, 61, -1, -1, -1, -1, -1, -1, -1);
+ h_fail("62", "%S");
+}
+
+ATF_TC(day);
+
+ATF_TC_HEAD(day, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks strptime(3): day names");
+}
+
+ATF_TC_BODY(day, tc)
+{
+
+ h_pass("Sun", "%a", 3, -1, -1, -1, -1, -1, -1, 0, -1);
+ h_pass("Sunday", "%a", 6, -1, -1, -1, -1, -1, -1, 0, -1);
+ h_pass("Mon", "%a", 3, -1, -1, -1, -1, -1, -1, 1, -1);
+ h_pass("Monday", "%a", 6, -1, -1, -1, -1, -1, -1, 1, -1);
+ h_pass("Tue", "%a", 3, -1, -1, -1, -1, -1, -1, 2, -1);
+ h_pass("Tuesday", "%a", 7, -1, -1, -1, -1, -1, -1, 2, -1);
+ h_pass("Wed", "%a", 3, -1, -1, -1, -1, -1, -1, 3, -1);
+ h_pass("Wednesday", "%a", 9, -1, -1, -1, -1, -1, -1, 3, -1);
+ h_pass("Thu", "%a", 3, -1, -1, -1, -1, -1, -1, 4, -1);
+ h_pass("Thursday", "%a", 8, -1, -1, -1, -1, -1, -1, 4, -1);
+ h_pass("Fri", "%a", 3, -1, -1, -1, -1, -1, -1, 5, -1);
+ h_pass("Friday", "%a", 6, -1, -1, -1, -1, -1, -1, 5, -1);
+ h_pass("Sat", "%a", 3, -1, -1, -1, -1, -1, -1, 6, -1);
+ h_pass("Saturday", "%a", 8, -1, -1, -1, -1, -1, -1, 6, -1);
+ h_pass("Saturn", "%a", 3, -1, -1, -1, -1, -1, -1, 6, -1);
+ h_fail("Moon", "%a");
+ h_pass("Sun", "%A", 3, -1, -1, -1, -1, -1, -1, 0, -1);
+ h_pass("Sunday", "%A", 6, -1, -1, -1, -1, -1, -1, 0, -1);
+ h_pass("Mon", "%A", 3, -1, -1, -1, -1, -1, -1, 1, -1);
+ h_pass("Monday", "%A", 6, -1, -1, -1, -1, -1, -1, 1, -1);
+ h_pass("Tue", "%A", 3, -1, -1, -1, -1, -1, -1, 2, -1);
+ h_pass("Tuesday", "%A", 7, -1, -1, -1, -1, -1, -1, 2, -1);
+ h_pass("Wed", "%A", 3, -1, -1, -1, -1, -1, -1, 3, -1);
+ h_pass("Wednesday", "%A", 9, -1, -1, -1, -1, -1, -1, 3, -1);
+ h_pass("Thu", "%A", 3, -1, -1, -1, -1, -1, -1, 4, -1);
+ h_pass("Thursday", "%A", 8, -1, -1, -1, -1, -1, -1, 4, -1);
+ h_pass("Fri", "%A", 3, -1, -1, -1, -1, -1, -1, 5, -1);
+ h_pass("Friday", "%A", 6, -1, -1, -1, -1, -1, -1, 5, -1);
+ h_pass("Sat", "%A", 3, -1, -1, -1, -1, -1, -1, 6, -1);
+ h_pass("Saturday", "%A", 8, -1, -1, -1, -1, -1, -1, 6, -1);
+ h_pass("Saturn", "%A", 3, -1, -1, -1, -1, -1, -1, 6, -1);
+ h_fail("Moon", "%A");
+
+ h_pass("mon", "%a", 3, -1, -1, -1, -1, -1, -1, 1, -1);
+ h_pass("tueSDay", "%A", 7, -1, -1, -1, -1, -1, -1, 2, -1);
+ h_pass("sunday", "%A", 6, -1, -1, -1, -1, -1, -1, 0, -1);
+ h_fail("sunday", "%EA");
+ h_pass("SaturDay", "%A", 8, -1, -1, -1, -1, -1, -1, 6, -1);
+ h_fail("SaturDay", "%OA");
+}
+
+ATF_TC(month);
+
+ATF_TC_HEAD(month, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks strptime(3): month names");
+}
+
+ATF_TC_BODY(month, tc)
+{
+
+ h_pass("Jan", "%b", 3, -1, -1, -1, -1, 0, -1, -1, -1);
+ h_pass("January", "%b", 7, -1, -1, -1, -1, 0, -1, -1, -1);
+ h_pass("Feb", "%b", 3, -1, -1, -1, -1, 1, -1, -1, -1);
+ h_pass("February", "%b", 8, -1, -1, -1, -1, 1, -1, -1, -1);
+ h_pass("Mar", "%b", 3, -1, -1, -1, -1, 2, -1, -1, -1);
+ h_pass("March", "%b", 5, -1, -1, -1, -1, 2, -1, -1, -1);
+ h_pass("Apr", "%b", 3, -1, -1, -1, -1, 3, -1, -1, -1);
+ h_pass("April", "%b", 5, -1, -1, -1, -1, 3, -1, -1, -1);
+ h_pass("May", "%b", 3, -1, -1, -1, -1, 4, -1, -1, -1);
+ h_pass("Jun", "%b", 3, -1, -1, -1, -1, 5, -1, -1, -1);
+ h_pass("June", "%b", 4, -1, -1, -1, -1, 5, -1, -1, -1);
+ h_pass("Jul", "%b", 3, -1, -1, -1, -1, 6, -1, -1, -1);
+ h_pass("July", "%b", 4, -1, -1, -1, -1, 6, -1, -1, -1);
+ h_pass("Aug", "%b", 3, -1, -1, -1, -1, 7, -1, -1, -1);
+ h_pass("August", "%b", 6, -1, -1, -1, -1, 7, -1, -1, -1);
+ h_pass("Sep", "%b", 3, -1, -1, -1, -1, 8, -1, -1, -1);
+ h_pass("September", "%b", 9, -1, -1, -1, -1, 8, -1, -1, -1);
+ h_pass("Oct", "%b", 3, -1, -1, -1, -1, 9, -1, -1, -1);
+ h_pass("October", "%b", 7, -1, -1, -1, -1, 9, -1, -1, -1);
+ h_pass("Nov", "%b", 3, -1, -1, -1, -1, 10, -1, -1, -1);
+ h_pass("November", "%b", 8, -1, -1, -1, -1, 10, -1, -1, -1);
+ h_pass("Dec", "%b", 3, -1, -1, -1, -1, 11, -1, -1, -1);
+ h_pass("December", "%b", 8, -1, -1, -1, -1, 11, -1, -1, -1);
+ h_pass("Mayor", "%b", 3, -1, -1, -1, -1, 4, -1, -1, -1);
+ h_pass("Mars", "%b", 3, -1, -1, -1, -1, 2, -1, -1, -1);
+ h_fail("Rover", "%b");
+ h_pass("Jan", "%B", 3, -1, -1, -1, -1, 0, -1, -1, -1);
+ h_pass("January", "%B", 7, -1, -1, -1, -1, 0, -1, -1, -1);
+ h_pass("Feb", "%B", 3, -1, -1, -1, -1, 1, -1, -1, -1);
+ h_pass("February", "%B", 8, -1, -1, -1, -1, 1, -1, -1, -1);
+ h_pass("Mar", "%B", 3, -1, -1, -1, -1, 2, -1, -1, -1);
+ h_pass("March", "%B", 5, -1, -1, -1, -1, 2, -1, -1, -1);
+ h_pass("Apr", "%B", 3, -1, -1, -1, -1, 3, -1, -1, -1);
+ h_pass("April", "%B", 5, -1, -1, -1, -1, 3, -1, -1, -1);
+ h_pass("May", "%B", 3, -1, -1, -1, -1, 4, -1, -1, -1);
+ h_pass("Jun", "%B", 3, -1, -1, -1, -1, 5, -1, -1, -1);
+ h_pass("June", "%B", 4, -1, -1, -1, -1, 5, -1, -1, -1);
+ h_pass("Jul", "%B", 3, -1, -1, -1, -1, 6, -1, -1, -1);
+ h_pass("July", "%B", 4, -1, -1, -1, -1, 6, -1, -1, -1);
+ h_pass("Aug", "%B", 3, -1, -1, -1, -1, 7, -1, -1, -1);
+ h_pass("August", "%B", 6, -1, -1, -1, -1, 7, -1, -1, -1);
+ h_pass("Sep", "%B", 3, -1, -1, -1, -1, 8, -1, -1, -1);
+ h_pass("September", "%B", 9, -1, -1, -1, -1, 8, -1, -1, -1);
+ h_pass("Oct", "%B", 3, -1, -1, -1, -1, 9, -1, -1, -1);
+ h_pass("October", "%B", 7, -1, -1, -1, -1, 9, -1, -1, -1);
+ h_pass("Nov", "%B", 3, -1, -1, -1, -1, 10, -1, -1, -1);
+ h_pass("November", "%B", 8, -1, -1, -1, -1, 10, -1, -1, -1);
+ h_pass("Dec", "%B", 3, -1, -1, -1, -1, 11, -1, -1, -1);
+ h_pass("December", "%B", 8, -1, -1, -1, -1, 11, -1, -1, -1);
+ h_pass("Mayor", "%B", 3, -1, -1, -1, -1, 4, -1, -1, -1);
+ h_pass("Mars", "%B", 3, -1, -1, -1, -1, 2, -1, -1, -1);
+ h_fail("Rover", "%B");
+
+ h_pass("september", "%b", 9, -1, -1, -1, -1, 8, -1, -1, -1);
+ h_pass("septembe", "%B", 3, -1, -1, -1, -1, 8, -1, -1, -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, common);
+ ATF_TP_ADD_TC(tp, day);
+ ATF_TP_ADD_TC(tp, month);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c b/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c
new file mode 100644
index 0000000..c455d33
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c
@@ -0,0 +1,60 @@
+/* $NetBSD: h_tls_dlopen.c,v 1.5 2013/10/21 19:14:16 joerg Exp $ */
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: h_tls_dlopen.c,v 1.5 2013/10/21 19:14:16 joerg Exp $");
+
+#include <atf-c.h>
+#include <unistd.h>
+#include <sys/tls.h>
+
+#ifdef __HAVE_NO___THREAD
+#define __thread
+#endif
+
+extern __thread int var1;
+extern __thread int var2;
+extern __thread int *var3;
+__thread int var5 = 1;
+static __thread pid_t (*local_var)(void) = getpid;
+
+void testf_dso_helper(int x, int y);
+
+void
+testf_dso_helper(int x, int y)
+{
+ var1 = x;
+ var2 = y;
+ var3 = &optind;
+ ATF_CHECK_EQ(local_var, getpid);
+}
diff --git a/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c b/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c
new file mode 100644
index 0000000..591823e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c
@@ -0,0 +1,113 @@
+/* $NetBSD: t_tls_dlopen.c,v 1.3 2012/01/17 20:34:57 joerg Exp $ */
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_tls_dlopen.c,v 1.3 2012/01/17 20:34:57 joerg Exp $");
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#include <sys/tls.h>
+
+#ifdef __HAVE_NO___THREAD
+#define __thread
+#endif
+
+ATF_TC(t_tls_dlopen);
+
+ATF_TC_HEAD(t_tls_dlopen, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test (un)initialized TLS variables and dlopen");
+}
+
+void (*testf_helper)(int, int);
+
+__thread int var1 = 1;
+__thread int var2;
+__thread int *var3 = &optind;
+int var4_helper;
+__thread int *var4 = &var4_helper;
+
+static void *
+testf(void *dummy)
+{
+ ATF_CHECK_EQ(var1, 1);
+ ATF_CHECK_EQ(var2, 0);
+ ATF_CHECK_EQ(var3, &optind);
+ ATF_CHECK_EQ(var4, &var4_helper);
+ testf_helper(2, 2);
+ ATF_CHECK_EQ(var1, 2);
+ ATF_CHECK_EQ(var2, 2);
+ testf_helper(3, 3);
+ ATF_CHECK_EQ(var1, 3);
+ ATF_CHECK_EQ(var2, 3);
+ ATF_CHECK_EQ(var3, &optind);
+
+ return NULL;
+}
+
+ATF_TC_BODY(t_tls_dlopen, tc)
+{
+ void *handle;
+ pthread_t t;
+
+#ifdef __HAVE_NO___THREAD
+ atf_tc_skip("no TLS support on this platform");
+#endif
+
+ handle = dlopen("h_tls_dlopen.so", RTLD_NOW | RTLD_LOCAL);
+ ATF_REQUIRE(handle != NULL);
+
+ testf_helper = dlsym(handle, "testf_dso_helper");
+ ATF_REQUIRE(testf_helper != NULL);
+
+ testf(NULL);
+
+ pthread_create(&t, 0, testf, 0);
+ pthread_join(t, NULL);
+
+ pthread_create(&t, 0, testf, 0);
+ pthread_join(t, NULL);
+
+ dlclose(handle);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_tls_dlopen);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c b/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c
new file mode 100644
index 0000000..9d242ae
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c
@@ -0,0 +1,105 @@
+/* $NetBSD: t_tls_dynamic.c,v 1.3 2012/01/17 20:34:57 joerg Exp $ */
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_tls_dynamic.c,v 1.3 2012/01/17 20:34:57 joerg Exp $");
+
+#include <atf-c.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#include <sys/tls.h>
+
+#ifdef __HAVE_NO___THREAD
+#define __thread
+#endif
+
+ATF_TC(t_tls_dynamic);
+
+ATF_TC_HEAD(t_tls_dynamic, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test (un)initialized TLS variables in dynamic binaries");
+}
+
+void testf_dso_helper(int, int);
+
+extern __thread int var1;
+extern __thread int var2;
+extern __thread pid_t (*dso_var1)(void);
+
+__thread int *var3 = &optind;
+int var4_helper;
+__thread int *var4 = &var4_helper;
+
+static void *
+testf(void *dummy)
+{
+ ATF_CHECK_EQ(var1, 1);
+ ATF_CHECK_EQ(var2, 0);
+ testf_dso_helper(2, 2);
+ ATF_CHECK_EQ(var1, 2);
+ ATF_CHECK_EQ(var2, 2);
+ testf_dso_helper(3, 3);
+ ATF_CHECK_EQ(var1, 3);
+ ATF_CHECK_EQ(var2, 3);
+ ATF_CHECK_EQ(var3, &optind);
+ ATF_CHECK_EQ(var4, &var4_helper);
+ ATF_CHECK_EQ(dso_var1, getpid);
+
+ return NULL;
+}
+
+ATF_TC_BODY(t_tls_dynamic, tc)
+{
+ pthread_t t;
+
+#ifdef __HAVE_NO___THREAD
+ atf_tc_skip("no TLS support on this platform");
+#endif
+
+ testf(NULL);
+
+ pthread_create(&t, 0, testf, 0);
+ pthread_join(t, NULL);
+
+ pthread_create(&t, 0, testf, 0);
+ pthread_join(t, NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_tls_dynamic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c b/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c
new file mode 100644
index 0000000..7751a16
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c
@@ -0,0 +1,93 @@
+/* $NetBSD: t_tls_static.c,v 1.2 2012/01/17 20:34:57 joerg Exp $ */
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_tls_static.c,v 1.2 2012/01/17 20:34:57 joerg Exp $");
+
+#include <atf-c.h>
+#include <pthread.h>
+
+#include <sys/tls.h>
+
+#ifdef __HAVE_NO___THREAD
+#define __thread
+#endif
+
+ATF_TC(t_tls_static);
+
+ATF_TC_HEAD(t_tls_static, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test (un)initialized TLS variables in static binaries");
+}
+
+void testf_helper(void);
+
+__thread int var1 = 1;
+__thread int var2;
+
+static void *
+testf(void *dummy)
+{
+ ATF_CHECK_EQ(var1, 1);
+ ATF_CHECK_EQ(var2, 0);
+ testf_helper();
+ ATF_CHECK_EQ(var1, -1);
+ ATF_CHECK_EQ(var2, -1);
+
+ return NULL;
+}
+
+ATF_TC_BODY(t_tls_static, tc)
+{
+ pthread_t t;
+
+#ifdef __HAVE_NO___THREAD
+ atf_tc_skip("no TLS support on this platform");
+#endif
+
+ testf(NULL);
+
+ pthread_create(&t, 0, testf, 0);
+ pthread_join(t, NULL);
+
+ pthread_create(&t, 0, testf, 0);
+ pthread_join(t, NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_tls_static);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c b/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c
new file mode 100644
index 0000000..da3b6f0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c
@@ -0,0 +1,53 @@
+/* $NetBSD: t_tls_static_helper.c,v 1.2 2012/01/17 20:34:57 joerg Exp $ */
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_tls_static_helper.c,v 1.2 2012/01/17 20:34:57 joerg Exp $");
+
+#include <sys/tls.h>
+
+#ifdef __HAVE_NO___THREAD
+#define __thread
+#endif
+
+extern __thread int var1;
+extern __thread int var2;
+
+void testf_helper(void);
+
+void
+testf_helper(void)
+{
+ var1 = -1;
+ var2 = -1;
+}
diff --git a/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c b/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c
new file mode 100644
index 0000000..a12e07a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c
@@ -0,0 +1,56 @@
+/* $NetBSD: h_tls_dynamic.c,v 1.5 2013/10/21 19:11:17 joerg Exp $ */
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: h_tls_dynamic.c,v 1.5 2013/10/21 19:11:17 joerg Exp $");
+
+#include <unistd.h>
+#include <sys/tls.h>
+
+#ifdef __HAVE_NO___THREAD
+#define __thread
+#endif
+
+__thread int var1 = 1;
+__thread int var2;
+
+__thread pid_t (*dso_var1)(void) = getpid;
+
+void testf_dso_helper(int x, int y);
+
+void
+testf_dso_helper(int x, int y)
+{
+ var1 = x;
+ var2 = y;
+}
diff --git a/contrib/netbsd-tests/lib/libc/ttyio/t_ptm.c b/contrib/netbsd-tests/lib/libc/ttyio/t_ptm.c
new file mode 100644
index 0000000..5346898
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ttyio/t_ptm.c
@@ -0,0 +1,174 @@
+/* $NetBSD: t_ptm.c,v 1.1 2011/01/13 03:19:57 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2004, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_ptm.c,v 1.1 2011/01/13 03:19:57 pgoyette Exp $");
+
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#define REQUIRE_ERRNO(x, v) \
+ ATF_REQUIRE_MSG(x != v, "%s: %s", #x, strerror(errno))
+
+ATF_TC(ptm);
+
+ATF_TC_HEAD(ptm, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks /dev/ptm device");
+}
+
+ATF_TC_BODY(ptm, tc)
+{
+ struct stat stm, sts;
+ struct ptmget ptm;
+ int fdm;
+ struct group *gp;
+
+ if ((fdm = open("/dev/ptm", O_RDWR)) == -1) {
+ if (errno == ENOENT || errno == ENODEV)
+ atf_tc_skip("/dev/ptm: %s", strerror(errno));
+ atf_tc_fail("/dev/ptm: %s", strerror(errno));
+ }
+
+ REQUIRE_ERRNO(fstat(fdm, &stm), -1);
+ ATF_REQUIRE_EQ(major(stm.st_rdev), 165);
+ REQUIRE_ERRNO(ioctl(fdm, TIOCPTMGET, &ptm), -1);
+
+ ATF_REQUIRE_MSG(strncmp(ptm.cn, "/dev/pty", 8) == 0
+ || strncmp(ptm.cn, "/dev/null", 9) == 0,
+ "bad master name: %s", ptm.cn);
+
+ ATF_REQUIRE_MSG(strncmp(ptm.sn, "/dev/tty", 8) == 0
+ || strncmp(ptm.sn, "/dev/pts/", 9) == 0,
+ "bad slave name: %s", ptm.sn);
+
+ if (strncmp(ptm.cn, "/dev/null", 9) != 0) {
+ REQUIRE_ERRNO(fstat(ptm.cfd, &stm), -1);
+ REQUIRE_ERRNO(stat(ptm.cn, &sts), -1);
+ ATF_REQUIRE_EQ(stm.st_rdev, sts.st_rdev);
+ }
+
+ REQUIRE_ERRNO(fstat(ptm.sfd, &stm), -1);
+ REQUIRE_ERRNO(stat(ptm.sn, &sts), -1);
+ ATF_REQUIRE_EQ(stm.st_rdev, sts.st_rdev);
+
+ ATF_REQUIRE_EQ_MSG(sts.st_uid, getuid(), "bad slave uid");
+
+ ATF_REQUIRE_MSG((gp = getgrnam("tty")) != NULL,
+ "cannot find `tty' group");
+ ATF_REQUIRE_EQ_MSG(sts.st_gid, gp->gr_gid, "bad slave grid");
+
+ (void)close(ptm.sfd);
+ (void)close(ptm.cfd);
+ (void)close(fdm);
+}
+
+/*
+ * On NetBSD /dev/ptyp0 == /dev/pts/0 so we can check for major
+ * and minor device numbers. This check is non-portable. This
+ * check is now disabled because we might not have /dev/ptyp0
+ * at all.
+ */
+
+/*
+ * #define PTY_DEVNO_CHECK
+ */
+
+ATF_TC(ptmx);
+
+ATF_TC_HEAD(ptmx, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks /dev/ptmx device");
+}
+
+ATF_TC_BODY(ptmx, tc)
+{
+ struct stat stm, sts;
+ char *pty;
+ int fdm, fds;
+ struct group *gp;
+
+ if ((fdm = posix_openpt(O_RDWR|O_NOCTTY)) == -1) {
+ if (errno == ENOENT || errno == ENODEV)
+ atf_tc_skip("/dev/ptmx: %s", strerror(errno));
+
+ atf_tc_fail("/dev/ptmx: %s", strerror(errno));
+ }
+
+ REQUIRE_ERRNO(fstat(fdm, &stm), -1);
+
+#ifdef PTY_DEVNO_CHECK
+ REQUIRE_ERRNO(stat("/dev/ptyp0", &sts), -1);
+
+ ATF_REQUIRE_EQ_MSG(major(stm.st_rdev), major(sts.st_rdev),
+ "bad master major number");
+#endif
+
+ REQUIRE_ERRNO(grantpt(fdm), -1);
+ REQUIRE_ERRNO(unlockpt(fdm), -1);
+ REQUIRE_ERRNO((pty = ptsname(fdm)), NULL);
+
+ REQUIRE_ERRNO((fds = open(pty, O_RDWR|O_NOCTTY)), -1);
+ REQUIRE_ERRNO(fstat(fds, &sts), -1);
+
+#ifdef PTY_DEVNO_CHECK
+ ATF_REQUIRE_EQ_MSG(minor(stm.st_rdev), minor(sts.st_rdev),
+ "bad slave minor number");
+#endif
+
+ ATF_REQUIRE_EQ_MSG(sts.st_uid, getuid(), "bad slave uid");
+ ATF_REQUIRE_MSG((gp = getgrnam("tty")) != NULL,
+ "cannot find `tty' group");
+
+ ATF_REQUIRE_EQ_MSG(sts.st_gid, gp->gr_gid, "bad slave gid");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, ptm);
+ ATF_TP_ADD_TC(tp, ptmx);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c b/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c
new file mode 100644
index 0000000..5a5ec0f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c
@@ -0,0 +1,163 @@
+/* $NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $ */
+
+/*
+ * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Andrew Brown.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $");
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <err.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+
+#if defined(__NetBSD__)
+#include <util.h>
+#elif defined(__bsdi__)
+int openpty(int *, int *, char *, struct termios *, struct winsize *);
+#elif defined(__FreeBSD__)
+#include <libutil.h>
+#else
+#error where openpty?
+#endif
+
+#include <atf-c.h>
+
+#define REQUIRE_ERRNO(x, v) ATF_REQUIRE_MSG(x != v, "%s: %s", #x, strerror(errno))
+
+ATF_TC(ioctl);
+ATF_TC_HEAD(ioctl, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that ioctl calls are restarted "
+ "properly after being interrupted");
+}
+
+/* ARGSUSED */
+static void
+sigchld(int nsig)
+{
+ REQUIRE_ERRNO(wait(NULL), -1);
+}
+
+ATF_TC_BODY(ioctl, tc)
+{
+ int m, s, rc;
+ char name[128], buf[128];
+ struct termios term;
+ struct sigaction sa;
+
+ /* unbuffer stdout */
+ setbuf(stdout, NULL);
+
+ /*
+ * Create default termios settings for later use
+ */
+ memset(&term, 0, sizeof(term));
+ term.c_iflag = TTYDEF_IFLAG;
+ term.c_oflag = TTYDEF_OFLAG;
+ term.c_cflag = TTYDEF_CFLAG;
+ term.c_lflag = TTYDEF_LFLAG;
+ cfsetspeed(&term, TTYDEF_SPEED);
+
+ /* get a tty */
+ REQUIRE_ERRNO(openpty(&m, &s, name, &term, NULL), -1);
+
+ switch (fork()) {
+ case -1:
+ atf_tc_fail("fork(): %s", strerror(errno));
+ /* NOTREACHED */
+ case 0:
+ /* wait for parent to get set up */
+ (void)sleep(1);
+ (void)printf("child1: exiting\n");
+ exit(0);
+ /* NOTREACHED */
+ default:
+ (void)printf("parent: spawned child1\n");
+ break;
+ }
+
+ switch (fork()) {
+ case -1:
+ atf_tc_fail("fork(): %s", strerror(errno));
+ /* NOTREACHED */
+ case 0:
+ /* wait for parent to get upset */
+ (void)sleep(2);
+ /* drain the tty q */
+ if (read(m, buf, sizeof(buf)) == -1)
+ err(1, "read");
+ (void)printf("child2: exiting\n");
+ exit(0);
+ /* NOTREACHED */
+ default:
+ (void)printf("parent: spawned child2\n");
+ break;
+ }
+
+ /* set up a restarting signal handler */
+ (void)sigemptyset(&sa.sa_mask);
+ sa.sa_handler = sigchld;
+ sa.sa_flags = SA_RESTART;
+ REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1);
+
+ /* put something in the output q */
+ REQUIRE_ERRNO(write(s, "Hello world\n", 12), -1);
+
+ /* ask for output to drain but don't drain it */
+ rc = 0;
+ if (tcsetattr(s, TCSADRAIN, &term) == -1) {
+ (void)printf("parent: tcsetattr: %s\n", strerror(errno));
+ rc = 1;
+ }
+
+ /* wait for last child */
+ sa.sa_handler = SIG_DFL;
+ REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1);
+ (void) wait(NULL);
+
+ ATF_REQUIRE_EQ(rc, 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, ioctl);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libcrypt/t_crypt.c b/contrib/netbsd-tests/lib/libcrypt/t_crypt.c
new file mode 100644
index 0000000..1a192cb
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcrypt/t_crypt.c
@@ -0,0 +1,145 @@
+/* $NetBSD: t_crypt.c,v 1.3 2011/12/28 22:07:40 christos Exp $ */
+
+/*
+ * This version is derived from the original implementation of FreeSec
+ * (release 1.1) by David Burren. I've reviewed the changes made in
+ * OpenBSD (as of 2.7) and modified the original code in a similar way
+ * where applicable. I've also made it reentrant and made a number of
+ * other changes.
+ * - Solar Designer <solar at openwall.com>
+ */
+
+/*
+ * FreeSec: libcrypt for NetBSD
+ *
+ * Copyright (c) 1994 David Burren
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 other 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.
+ *
+ * $Owl: Owl/packages/glibc/crypt_freesec.c,v 1.6 2010/02/20 14:45:06 solar Exp $
+ * Id: crypt.c,v 1.15 1994/09/13 04:58:49 davidb Exp
+ *
+ * This is an original implementation of the DES and the crypt(3) interfaces
+ * by David Burren <davidb at werj.com.au>.
+ *
+ * An excellent reference on the underlying algorithm (and related
+ * algorithms) is:
+ *
+ * B. Schneier, Applied Cryptography: protocols, algorithms,
+ * and source code in C, John Wiley & Sons, 1994.
+ *
+ * Note that in that book's description of DES the lookups for the initial,
+ * pbox, and final permutations are inverted (this has been brought to the
+ * attention of the author). A list of errata for this book has been
+ * posted to the sci.crypt newsgroup by the author and is available for FTP.
+ *
+ * ARCHITECTURE ASSUMPTIONS:
+ * This code used to have some nasty ones, but these have been removed
+ * by now. The code requires a 32-bit integer type, though.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_crypt.c,v 1.3 2011/12/28 22:07:40 christos Exp $");
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+static const struct {
+ const char *hash;
+ const char *pw;
+} tests[] = {
+/* "new"-style */
+/* 0 */ { "_J9..CCCCXBrJUJV154M", "U*U*U*U*" },
+/* 1 */ { "_J9..CCCCXUhOBTXzaiE", "U*U***U" },
+/* 2 */ { "_J9..CCCC4gQ.mB/PffM", "U*U***U*" },
+/* 3 */ { "_J9..XXXXvlzQGqpPPdk", "*U*U*U*U" },
+/* 4 */ { "_J9..XXXXsqM/YSSP..Y", "*U*U*U*U*" },
+/* 5 */ { "_J9..XXXXVL7qJCnku0I", "*U*U*U*U*U*U*U*U" },
+/* 6 */ { "_J9..XXXXAj8cFbP5scI", "*U*U*U*U*U*U*U*U*" },
+/* 7 */ { "_J9..SDizh.vll5VED9g", "ab1234567" },
+/* 8 */ { "_J9..SDizRjWQ/zePPHc", "cr1234567" },
+/* 9 */ { "_J9..SDizxmRI1GjnQuE", "zxyDPWgydbQjgq" },
+/* 10 */ { "_K9..SaltNrQgIYUAeoY", "726 even" },
+/* 11 */ { "_J9..SDSD5YGyRCr4W4c", "" },
+/* "old"-style, valid salts */
+/* 12 */ { "CCNf8Sbh3HDfQ", "U*U*U*U*" },
+/* 13 */ { "CCX.K.MFy4Ois", "U*U***U" },
+/* 14 */ { "CC4rMpbg9AMZ.", "U*U***U*" },
+/* 15 */ { "XXxzOu6maQKqQ", "*U*U*U*U" },
+/* 16 */ { "SDbsugeBiC58A", "" },
+/* 17 */ { "./xZjzHv5vzVE", "password" },
+/* 18 */ { "0A2hXM1rXbYgo", "password" },
+/* 19 */ { "A9RXdR23Y.cY6", "password" },
+/* 20 */ { "ZziFATVXHo2.6", "password" },
+/* 21 */ { "zZDDIZ0NOlPzw", "password" },
+/* "old"-style, "reasonable" invalid salts, UFC-crypt behavior expected */
+/* 22 */ { "\001\002wyd0KZo65Jo", "password" },
+/* 23 */ { "a_C10Dk/ExaG.", "password" },
+/* 24 */ { "~\377.5OTsRVjwLo", "password" },
+/* The below are erroneous inputs, so NULL return is expected/required */
+/* 25 */ { "", "" }, /* no salt */
+/* 26 */ { " ", "" }, /* setting string is too short */
+/* 27 */ { "a:", "" }, /* unsafe character */
+/* 28 */ { "\na", "" }, /* unsafe character */
+/* 29 */ { "_/......", "" }, /* setting string is too short for its type */
+/* 30 */ { "_........", "" }, /* zero iteration count */
+/* 31 */ { "_/!......", "" }, /* invalid character in count */
+/* 32 */ { "_/......!", "" }, /* invalid character in salt */
+/* 33 */ { NULL, NULL }
+};
+
+ATF_TC(crypt_salts);
+
+ATF_TC_HEAD(crypt_salts, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "crypt(3) salt consistency checks");
+}
+
+ATF_TC_BODY(crypt_salts, tc)
+{
+ for (size_t i = 0; tests[i].hash; i++) {
+ char *hash = crypt(tests[i].pw, tests[i].hash);
+ if (!hash) {
+ ATF_CHECK_MSG(0, "Test %zu NULL\n", i);
+ continue;
+ }
+ if (strcmp(hash, "*0") == 0 && strlen(tests[i].hash) < 13)
+ continue; /* expected failure */
+ if (strcmp(hash, tests[i].hash))
+ ATF_CHECK_MSG(0, "Test %zu %s != %s\n",
+ i, hash, tests[i].hash);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, crypt_salts);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libcurses/atf.terminfo b/contrib/netbsd-tests/lib/libcurses/atf.terminfo
new file mode 100644
index 0000000..fcd34b6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/atf.terminfo
@@ -0,0 +1,44 @@
+# Based on xterm capabilities
+atf|atf automatic test frame pseudo terminal,
+ am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
+ colors#8, cols#80, it#8, lines#24, pairs#64,
+ acsc=++\,\,--..00``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+ bel=bel, blink=blink, bold=bold, cbt=cbt, civis=civis, clear=clear,
+ cnorm=cnorm, cr=^M, csr=csr%i%p1%d;%p2%dX, cub=cub%p1%dX,
+ cub1=^H, cud=cud%p1%dX, cud1=^J, cuf=cuf%p1%dX, cuf1=,
+ cup=cup%i%p1%d;%p2%dX, cuu=cuu%p1%dX, cuu1=, cvvis=cvvis,
+ dch=dch%p1%dX, dch1=, dl=dl%p1%dX, dl1= , dim=dim, ech=ech%p1%dX,
+ ed=ed, el=el, el1=el1, enacs=enacs, flash=flash, home=home,
+ hpa=hpa%i%p1%dX, ht=^I, hts=hts, ich=ich%p1%dX, il=il%p1%dX,
+ il1=il1, ind=^M, indn=indn%p1%dX, invis=invis,
+ is2=is2, kDC=\E[3;2~, kEND=\E[1;2F, kHOM=\E[1;2H,
+ kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~, kPRV=\E[5;2~,
+ kRIT=\E[1;2C, kb2=\EOE, kbs=^H, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB,
+ kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kend=\EOF, kent=\EOM,
+ kf1=\EOP, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[1;2P,
+ kf14=\E[1;2Q, kf15=\E[1;2R, kf16=\E[1;2S, kf17=\E[15;2~,
+ kf18=\E[17;2~, kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~,
+ kf21=\E[20;2~, kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~,
+ kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S,
+ kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5~,
+ kf32=\E[19;5~, kf33=\E[20;5~, kf34=\E[21;5~, kf35=\E[23;5~,
+ kf36=\E[24;5~, kf37=\E[1;6P, kf38=\E[1;6Q, kf39=\E[1;6R, kf4=\EOS,
+ kf40=\E[1;6S, kf41=\E[15;6~, kf42=\E[17;6~, kf43=\E[18;6~,
+ kf44=\E[19;6~, kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~,
+ kf48=\E[24;6~, kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q,
+ kf51=\E[1;3R, kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~,
+ kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~, kf58=\E[21;3~,
+ kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~, kf61=\E[1;4P,
+ kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+ khome=\EOH, kich1=\E[2~, kind=\E[1;2B, kmous=\E[M, knp=\E[6~,
+ kpp=\E[5~, kri=\E[1;2A, mc0=mc0, mc4=mc4, mc5=mc5,
+ op=op, rc=rc, rev=rev, ri=ri, rin=rin%p1%dX, rmacs=rmacs,
+ rmam=rmam, rmcup=rmcup, rmir=rmir, rmkx=rmkx,
+ rmm=rmm, rmso=rmso, rmul=rmul, rs1=rs1,
+ rs2=rs2, sc=sc, setab=setab%p1%dX,
+ setaf=setaf%p1%dX, setb=setb%p1%dX, setf=setf%p1%dX,
+ sgr=sgr%p1%d;%p2%d;%p3%d;%p4%d;%p5%d;%p6%d;%p7%d;%p8;%d;%p9%dX,
+ sgr0=sgr0, smacs=smacs, smam=smam, smcup=smcup,
+ smir=smir, smkx=smkx, smm=smm, smso=smso, smul=smul,
+ tbc=tbc, u6=u6%d;%dX, u7=u7, u8=u8, u9=u9,
+ vpa=vpa%p1%dX
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/addch.chk b/contrib/netbsd-tests/lib/libcurses/check_files/addch.chk
new file mode 100644
index 0000000..3e2c6bb
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/addch.chk
@@ -0,0 +1 @@
+smsotrmso \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/addchstr.chk b/contrib/netbsd-tests/lib/libcurses/check_files/addchstr.chk
new file mode 100644
index 0000000..42286d0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/addchstr.chk
@@ -0,0 +1 @@
+revabcdehomesgr0 \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/addstr.chk b/contrib/netbsd-tests/lib/libcurses/check_files/addstr.chk
new file mode 100644
index 0000000..6a81654
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/addstr.chk
@@ -0,0 +1 @@
+abcde \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/attributes.chk b/contrib/netbsd-tests/lib/libcurses/check_files/attributes.chk
new file mode 100644
index 0000000..be35b56
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/attributes.chk
@@ -0,0 +1 @@
+smsoblinkhellormsosgr0 \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/background1.chk b/contrib/netbsd-tests/lib/libcurses/check_files/background1.chk
new file mode 100644
index 0000000..e52e439
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/background1.chk
@@ -0,0 +1 @@
+smulAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup2;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup3;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup4;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup5;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup6;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup7;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup8;1XAAAA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20;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup21;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup22;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup23;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup24;1XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcup1;1Xrmul \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/background2.chk b/contrib/netbsd-tests/lib/libcurses/check_files/background2.chk
new file mode 100644
index 0000000..55a2163
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/background2.chk
@@ -0,0 +1 @@
+smula test stringrmul \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/background3.chk b/contrib/netbsd-tests/lib/libcurses/check_files/background3.chk
new file mode 100644
index 0000000..732f4cc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/background3.chk
@@ -0,0 +1 @@
+cup3;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/background4.chk b/contrib/netbsd-tests/lib/libcurses/check_files/background4.chk
new file mode 100644
index 0000000..05698e2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/background4.chk
@@ -0,0 +1,6 @@
+cup1;14Xcup3;6Xrevwindow
+B1BBBB
+BBBBBB
+BBBBBB
+BBBBBB
+BBBBBBcup4;8Xsgr0 \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/background5.chk b/contrib/netbsd-tests/lib/libcurses/check_files/background5.chk
new file mode 100644
index 0000000..6c37975
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/background5.chk
@@ -0,0 +1,3 @@
+cup1;14Xcup4;8Xrevhell
+o worl
+dsgr0 \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/bell.chk b/contrib/netbsd-tests/lib/libcurses/check_files/bell.chk
new file mode 100644
index 0000000..f4d3c21
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/bell.chk
@@ -0,0 +1 @@
+bel \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/box_standout.chk b/contrib/netbsd-tests/lib/libcurses/check_files/box_standout.chk
new file mode 100644
index 0000000..5bd91e1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/box_standout.chk
@@ -0,0 +1,5 @@
+revsmacsqqqqrmacs
+sgr0smsosmacsxrmacssmacsxrmacs
+smacsxrmacssmacsxrmacs
+smacsxrmacssmacsxrmacs
+smacsxrmacssmacsxrmacscup8;7Xrmsorevsmacsqqqqrmacscup3;6Xsgr0 \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/chgat1.chk b/contrib/netbsd-tests/lib/libcurses/check_files/chgat1.chk
new file mode 100644
index 0000000..e9b8b58
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/chgat1.chk
@@ -0,0 +1 @@
+setaf7Xsetab0Xdsetaf3Xsetab6Xrev homesgr0 \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/chgat2.chk b/contrib/netbsd-tests/lib/libcurses/check_files/chgat2.chk
new file mode 100644
index 0000000..cadfb37
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/chgat2.chk
@@ -0,0 +1 @@
+setaf7Xsetab0Xeop \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/chgat3.chk b/contrib/netbsd-tests/lib/libcurses/check_files/chgat3.chk
new file mode 100644
index 0000000..7d57a90
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/chgat3.chk
@@ -0,0 +1 @@
+homesetaf3Xsetab6Xsmulde cup1;1Xrmulop \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear1.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear1.chk
new file mode 100644
index 0000000..9c7d34f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear1.chk
@@ -0,0 +1 @@
+clear \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear10.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear10.chk
new file mode 100644
index 0000000..1baa2a5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear10.chk
@@ -0,0 +1 @@
+cup7;7X EEEEE \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear2.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear2.chk
new file mode 100644
index 0000000..f25000b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear2.chk
@@ -0,0 +1 @@
+cup6;6Xabcdecup21;6Xfghijcup11;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear3.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear3.chk
new file mode 100644
index 0000000..dfdd90d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear3.chk
@@ -0,0 +1 @@
+cup21;6Xelcup11;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear4.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear4.chk
new file mode 100644
index 0000000..abe5be8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear4.chk
@@ -0,0 +1 @@
+elhome \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear5.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear5.chk
new file mode 100644
index 0000000..d9df62d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear5.chk
@@ -0,0 +1,23 @@
+homeel
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+elhome \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear6.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear6.chk
new file mode 100644
index 0000000..ff815d3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear6.chk
@@ -0,0 +1 @@
+abccup7;7Xefgcup4;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear7.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear7.chk
new file mode 100644
index 0000000..8b392c3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear7.chk
@@ -0,0 +1 @@
+cup7;7Xelcup4;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear8.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear8.chk
new file mode 100644
index 0000000..9c9354e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear8.chk
@@ -0,0 +1,6 @@
+cup4;6X
+EEEEE
+EEEEE
+EEEEE
+EEEEE
+EEEEE cup3;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/clear9.chk b/contrib/netbsd-tests/lib/libcurses/check_files/clear9.chk
new file mode 100644
index 0000000..c5834a1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/clear9.chk
@@ -0,0 +1,6 @@
+cup3;6X
+EEEEE
+EEEEE
+EEEEE
+EEEEE
+EEEEE cup3;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/color_blank_draw.chk b/contrib/netbsd-tests/lib/libcurses/check_files/color_blank_draw.chk
new file mode 100644
index 0000000..42ad0e2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/color_blank_draw.chk
@@ -0,0 +1,24 @@
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xel
+opsetaf7Xsetab0Xelhomeop \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/color_blue_back.chk b/contrib/netbsd-tests/lib/libcurses/check_files/color_blue_back.chk
new file mode 100644
index 0000000..5c02e4d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/color_blue_back.chk
@@ -0,0 +1,24 @@
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xel
+opopsetab4Xelhome \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/color_default.chk b/contrib/netbsd-tests/lib/libcurses/check_files/color_default.chk
new file mode 100644
index 0000000..d23ddaf
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/color_default.chk
@@ -0,0 +1,24 @@
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopel
+opopelhomeop \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/color_red_fore.chk b/contrib/netbsd-tests/lib/libcurses/check_files/color_red_fore.chk
new file mode 100644
index 0000000..3ad4513
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/color_red_fore.chk
@@ -0,0 +1,24 @@
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xel
+opopsetaf1Xelhomeop \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/color_set.chk b/contrib/netbsd-tests/lib/libcurses/check_files/color_set.chk
new file mode 100644
index 0000000..d8363b7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/color_set.chk
@@ -0,0 +1 @@
+setaf1Xsetab2Xtestingop \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/color_start.chk b/contrib/netbsd-tests/lib/libcurses/check_files/color_start.chk
new file mode 100644
index 0000000..d314d07
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/color_start.chk
@@ -0,0 +1 @@
+op \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin1.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin1.chk
new file mode 100644
index 0000000..826062a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin1.chk
@@ -0,0 +1 @@
+cup11;15X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin10.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin10.chk
new file mode 100644
index 0000000..d5c8ea5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin10.chk
@@ -0,0 +1 @@
+cup11;15Xt s i cup12;15Xg e t cup13;15Xn t s cup14;15X n t scup15;15Xt n t cup16;15X t n t \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin11.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin11.chk
new file mode 100644
index 0000000..9315b76
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin11.chk
@@ -0,0 +1,4 @@
+cup3;6Xel
+ el
+ elcup6;7Xel
+ elcup8;7Xelcup3;6Xcup11;15Xelcup12;15Xelcup13;15Xelcup14;16Xelcup15;15Xelcup16;16Xelcup11;15X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin12.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin12.chk
new file mode 100644
index 0000000..bc1a526
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin12.chk
@@ -0,0 +1,4 @@
+cup3;6Xt s i
+ g e t
+ n t scup6;7Xn t s
+ t n tcup8;7Xt n tcup8;11X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin13.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin13.chk
new file mode 100644
index 0000000..f2a8913
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin13.chk
@@ -0,0 +1 @@
+cup11;16Xe t ncup12;16Xt s icup13;16Xg e tcup14;15Xi g ecup15;16Xi g ecup16;15Xs i g \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin14.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin14.chk
new file mode 100644
index 0000000..e7fd505
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin14.chk
@@ -0,0 +1 @@
+cup11;15Xtesticup12;15Xgtestcup13;15Xngtescup14;16Xngtescup15;15Xtingtcup16;16Xtingt \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin2.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin2.chk
new file mode 100644
index 0000000..aac0671
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin2.chk
@@ -0,0 +1,6 @@
+cup3;6Xtestin
+ gtesti
+ ngtest
+ ingtes
+ tingte
+ stingtcup8;11X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin3.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin3.chk
new file mode 100644
index 0000000..317cd93
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin3.chk
@@ -0,0 +1 @@
+cup12;16Xtestincup13;16Xgtesticup14;16Xngtestcup15;16Xingtescup16;16Xtingtecup17;16Xstingt \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin4.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin4.chk
new file mode 100644
index 0000000..4fa78a9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin4.chk
@@ -0,0 +1,6 @@
+cup3;6Xel
+ el
+ el
+ el
+ el
+ elcup12;16Xelcup13;16Xelcup14;16Xelcup15;16Xelcup16;16Xelcup17;16Xelcup11;15X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin5.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin5.chk
new file mode 100644
index 0000000..4f0d7da
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin5.chk
@@ -0,0 +1 @@
+testingtecup12;15Xstingtestcup13;15Xingtestincup14;15Xgtestingtcup15;15Xestingtescup16;15Xtingtesticup16;23X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin6.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin6.chk
new file mode 100644
index 0000000..314dac8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin6.chk
@@ -0,0 +1,6 @@
+cup3;6Xtestin
+ stingt
+ ingtes
+ gtesti
+ esting
+ tingtecup8;11X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin7.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin7.chk
new file mode 100644
index 0000000..d10a7c2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin7.chk
@@ -0,0 +1,6 @@
+cup3;6Xel
+ el
+ el
+ el
+ el
+ elcup11;15Xelcup12;15Xelcup13;15Xelcup14;15Xelcup15;15Xelcup16;15Xel \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin8.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin8.chk
new file mode 100644
index 0000000..bc1a526
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin8.chk
@@ -0,0 +1,4 @@
+cup3;6Xt s i
+ g e t
+ n t scup6;7Xn t s
+ t n tcup8;7Xt n tcup8;11X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/copywin9.chk b/contrib/netbsd-tests/lib/libcurses/check_files/copywin9.chk
new file mode 100644
index 0000000..f2a8913
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/copywin9.chk
@@ -0,0 +1 @@
+cup11;16Xe t ncup12;16Xt s icup13;16Xg e tcup14;15Xi g ecup15;16Xi g ecup16;15Xs i g \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/curs_set1.chk b/contrib/netbsd-tests/lib/libcurses/check_files/curs_set1.chk
new file mode 100644
index 0000000..81a818c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/curs_set1.chk
@@ -0,0 +1 @@
+civis \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/curs_set2.chk b/contrib/netbsd-tests/lib/libcurses/check_files/curs_set2.chk
new file mode 100644
index 0000000..7682463
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/curs_set2.chk
@@ -0,0 +1 @@
+cnorm \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/curs_set3.chk b/contrib/netbsd-tests/lib/libcurses/check_files/curs_set3.chk
new file mode 100644
index 0000000..0f3e744
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/curs_set3.chk
@@ -0,0 +1 @@
+cvvis \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/curses_start.chk b/contrib/netbsd-tests/lib/libcurses/check_files/curses_start.chk
new file mode 100644
index 0000000..7c4f92c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/curses_start.chk
@@ -0,0 +1 @@
+enacsenacssmcupcnormclearclear \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/fill.chk b/contrib/netbsd-tests/lib/libcurses/check_files/fill.chk
new file mode 100644
index 0000000..2d89374
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/fill.chk
@@ -0,0 +1,23 @@
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEhome
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE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EEEEEEEEEEEEEEEEEEEEEEE
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
+EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/home.chk b/contrib/netbsd-tests/lib/libcurses/check_files/home.chk
new file mode 100644
index 0000000..0247178
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/home.chk
@@ -0,0 +1 @@
+home \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/timeout.chk b/contrib/netbsd-tests/lib/libcurses/check_files/timeout.chk
new file mode 100644
index 0000000..6463b1e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/timeout.chk
@@ -0,0 +1 @@
+asmkx
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/wborder.chk b/contrib/netbsd-tests/lib/libcurses/check_files/wborder.chk
new file mode 100644
index 0000000..50857fa
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/wborder.chk
@@ -0,0 +1,6 @@
+smacslqqqqkrmacs
+ smacsxrmacs smacsxrmacs
+ smacsxrmacs smacsxrmacs
+ smacsxrmacs smacsxrmacs
+ smacsxrmacs smacsxrmacs
+ smacsmqqqqjrmacscup3;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/wborder_refresh.chk b/contrib/netbsd-tests/lib/libcurses/check_files/wborder_refresh.chk
new file mode 100644
index 0000000..0247178
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/wborder_refresh.chk
@@ -0,0 +1 @@
+home \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/wgetstr.chk b/contrib/netbsd-tests/lib/libcurses/check_files/wgetstr.chk
new file mode 100644
index 0000000..770eab4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/wgetstr.chk
@@ -0,0 +1 @@
+input \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/wgetstr_refresh.chk b/contrib/netbsd-tests/lib/libcurses/check_files/wgetstr_refresh.chk
new file mode 100644
index 0000000..e8bbed5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/wgetstr_refresh.chk
@@ -0,0 +1,2 @@
+
+ \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/window.chk b/contrib/netbsd-tests/lib/libcurses/check_files/window.chk
new file mode 100644
index 0000000..732f4cc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/window.chk
@@ -0,0 +1 @@
+cup3;6X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/wprintw_refresh.chk b/contrib/netbsd-tests/lib/libcurses/check_files/wprintw_refresh.chk
new file mode 100644
index 0000000..53794ad
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/wprintw_refresh.chk
@@ -0,0 +1 @@
+cup3;6Xhellocup3;10X \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/wscrl1.chk b/contrib/netbsd-tests/lib/libcurses/check_files/wscrl1.chk
new file mode 100644
index 0000000..627141d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/wscrl1.chk
@@ -0,0 +1 @@
+cup4;7Xxxxxhome \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/check_files/wscrl2.chk b/contrib/netbsd-tests/lib/libcurses/check_files/wscrl2.chk
new file mode 100644
index 0000000..ee36e55
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/check_files/wscrl2.chk
@@ -0,0 +1 @@
+cup4;7Xelcup6;7Xxxxxhome \ No newline at end of file
diff --git a/contrib/netbsd-tests/lib/libcurses/director/director.c b/contrib/netbsd-tests/lib/libcurses/director/director.c
new file mode 100644
index 0000000..c73ddae
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/director/director.c
@@ -0,0 +1,279 @@
+/* $NetBSD: director.c,v 1.10 2012/06/03 23:19:11 joerg Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <termios.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <util.h>
+#include <err.h>
+#include "returns.h"
+
+void yyparse(void);
+#define DEF_TERMPATH "."
+#define DEF_TERM "atf"
+#define DEF_SLAVE "./slave"
+
+const char *def_check_path = "./"; /* default check path */
+const char *def_include_path = "./"; /* default include path */
+
+extern size_t nvars; /* In testlang_conf.y */
+saved_data_t saved_output; /* In testlang_conf.y */
+int cmdpipe[2]; /* command pipe between director and slave */
+int slvpipe[2]; /* reply pipe back from slave */
+int master; /* pty to the slave */
+int verbose; /* control verbosity of tests */
+const char *check_path; /* path to prepend to check files for output
+ validation */
+const char *include_path; /* path to prepend to include files */
+char *cur_file; /* name of file currently being read */
+
+void init_parse_variables(int); /* in testlang_parse.y */
+
+/*
+ * Handle the slave exiting unexpectedly, try to recover the exit message
+ * and print it out.
+ */
+static void
+slave_died(int param)
+{
+ char last_words[256];
+ size_t count;
+
+ fprintf(stderr, "ERROR: Slave has exited\n");
+ if (saved_output.count > 0) {
+ fprintf(stderr, "output from slave: ");
+ for (count = 0; count < saved_output.count; count ++) {
+ if (isprint((unsigned char)saved_output.data[count]))
+ fprintf(stderr, "%c", saved_output.data[count]);
+ }
+ fprintf(stderr, "\n");
+ }
+
+ if ((count = read(master, &last_words, 255)) > 0) {
+ last_words[count] = '\0';
+ fprintf(stderr, "slave exited with message \"%s\"\n",
+ last_words);
+ }
+
+ exit(2);
+}
+
+
+static void
+usage(void)
+{
+ fprintf(stderr, "Usage: %s [-v] [-I include-path] [-C check-path] "
+ "[-T terminfo-file] [-s pathtoslave] [-t term] "
+ "commandfile\n", getprogname());
+ fprintf(stderr, " where:\n");
+ fprintf(stderr, " -v enables verbose test output\n");
+ fprintf(stderr, " -T is a directory containing the terminfo.cdb "
+ "file, or a file holding the terminfo description n");
+ fprintf(stderr, " -s is the path to the slave executable\n");
+ fprintf(stderr, " -t is value to set TERM to for the test\n");
+ fprintf(stderr, " -I is the directory to include files\n");
+ fprintf(stderr, " -C is the directory for config files\n");
+ fprintf(stderr, " commandfile is a file of test directives\n");
+ exit(1);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ extern char *optarg;
+ extern int optind;
+ const char *termpath, *term, *slave;
+ int ch;
+ pid_t slave_pid;
+ extern FILE *yyin;
+ char *arg1, *arg2, *arg3, *arg4;
+ struct termios term_attr;
+ struct stat st;
+
+ termpath = term = slave = NULL;
+ verbose = 0;
+
+ while ((ch = getopt(argc, argv, "vC:I:p:s:t:T:")) != -1) {
+ switch(ch) {
+ case 'I':
+ include_path = optarg;
+ break;
+ case 'C':
+ check_path = optarg;
+ break;
+ case 'T':
+ termpath = optarg;
+ break;
+ case 'p':
+ termpath = optarg;
+ break;
+ case 's':
+ slave = optarg;
+ break;
+ case 't':
+ term = optarg;
+ break;
+ case 'v':
+ verbose = 1;
+ break;
+ case '?':
+ default:
+ usage();
+ break;
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+ if (argc < 1)
+ usage();
+
+ if (termpath == NULL)
+ termpath = DEF_TERMPATH;
+
+ if (slave == NULL)
+ slave = DEF_SLAVE;
+
+ if (term == NULL)
+ term = DEF_TERM;
+
+ if (check_path == NULL)
+ check_path = getenv("CHECK_PATH");
+ if ((check_path == NULL) || (check_path[0] == '\0')) {
+ warn("$CHECK_PATH not set, defaulting to %s", def_check_path);
+ check_path = def_check_path;
+ }
+
+ if (include_path == NULL)
+ include_path = getenv("INCLUDE_PATH");
+ if ((include_path == NULL) || (include_path[0] == '\0')) {
+ warn("$INCLUDE_PATH not set, defaulting to %s",
+ def_include_path);
+ include_path = def_include_path;
+ }
+
+ signal(SIGCHLD, slave_died);
+
+ if (setenv("TERM", term, 1) != 0)
+ err(2, "Failed to set TERM variable");
+
+ if (stat(termpath, &st) == -1)
+ err(1, "Cannot stat %s", termpath);
+
+ if (S_ISDIR(st.st_mode)) {
+ char tinfo[MAXPATHLEN];
+ int l = snprintf(tinfo, sizeof(tinfo), "%s/%s", termpath,
+ "terminfo.cdb");
+ if (stat(tinfo, &st) == -1)
+ err(1, "Cannot stat `%s'", tinfo);
+ if (l >= 4)
+ tinfo[l - 4] = '\0';
+ if (setenv("TERMINFO", tinfo, 1) != 0)
+ err(1, "Failed to set TERMINFO variable");
+ } else {
+ int fd;
+ char *tinfo;
+ if ((fd = open(termpath, O_RDONLY)) == -1)
+ err(1, "Cannot open `%s'", termpath);
+ if ((tinfo = mmap(NULL, (size_t)st.st_size, PROT_READ, MAP_FILE,
+ fd, 0)) == MAP_FAILED)
+ err(1, "Cannot map `%s'", termpath);
+ if (setenv("TERMINFO", tinfo, 1) != 0)
+ err(1, "Failed to set TERMINFO variable");
+ close(fd);
+ munmap(tinfo, (size_t)st.st_size);
+ }
+
+ if (pipe(cmdpipe) < 0)
+ err(1, "Command pipe creation failed");
+
+ if (pipe(slvpipe) < 0)
+ err(1, "Slave pipe creation failed");
+
+ /*
+ * Create default termios settings for later use
+ */
+ memset(&term_attr, 0, sizeof(term_attr));
+ term_attr.c_iflag = TTYDEF_IFLAG;
+ term_attr.c_oflag = TTYDEF_OFLAG;
+ term_attr.c_cflag = TTYDEF_CFLAG;
+ term_attr.c_lflag = TTYDEF_LFLAG;
+ cfsetspeed(&term_attr, TTYDEF_SPEED);
+ term_attr.c_cc[VERASE] = '\b';
+ term_attr.c_cc[VKILL] = '\025'; /* ^U */
+
+ if ((slave_pid = forkpty(&master, NULL, &term_attr, NULL)) < 0)
+ err(1, "Fork of pty for slave failed\n");
+
+ if (slave_pid == 0) {
+ /* slave side, just exec the slave process */
+ if (asprintf(&arg1, "%d", cmdpipe[0]) < 0)
+ err(1, "arg1 conversion failed");
+
+ if (asprintf(&arg2, "%d", cmdpipe[1]) < 0)
+ err(1, "arg2 conversion failed");
+
+ if (asprintf(&arg3, "%d", slvpipe[0]) < 0)
+ err(1, "arg3 conversion failed");
+
+ if (asprintf(&arg4, "%d", slvpipe[1]) < 0)
+ err(1, "arg4 conversion failed");
+
+ if (execl(slave, slave, arg1, arg2, arg3, arg4, NULL) < 0)
+ err(1, "Exec of slave %s failed", slave);
+
+ /* NOT REACHED */
+ }
+
+ fcntl(master, F_SETFL, O_NONBLOCK);
+
+ if ((yyin = fopen(argv[0], "r")) == NULL)
+ err(1, "Cannot open command file %s", argv[0]);
+
+ if ((cur_file = strdup(argv[0])) == NULL)
+ err(2, "Failed to alloc memory for test file name");
+
+ init_parse_variables(1);
+
+ yyparse();
+ fclose(yyin);
+
+ exit(0);
+}
diff --git a/contrib/netbsd-tests/lib/libcurses/director/returns.h b/contrib/netbsd-tests/lib/libcurses/director/returns.h
new file mode 100644
index 0000000..150e358
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/director/returns.h
@@ -0,0 +1,66 @@
+/* $NetBSD: returns.h,v 1.1 2011/04/10 09:55:09 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+#ifndef CTF_RETURNS_H
+#define CTF_RETURNS_H 1
+
+
+typedef enum {
+ ret_number = 1,
+ ret_string,
+ ret_byte,
+ ret_err,
+ ret_ok,
+ ret_null,
+ ret_nonnull,
+ ret_var,
+ ret_ref,
+ ret_count,
+ ret_slave_error
+} returns_enum_t;
+
+typedef struct {
+ returns_enum_t return_type;
+ void *return_value; /* used if return_type is ret_num or
+ or ret_byte or ret_string */
+ size_t return_len; /* number of bytes in return_value iff
+ return_type is ret_byte */
+ int return_index; /* index into var array for return
+ if return_type is ret_var */
+} returns_t;
+
+typedef struct {
+ size_t count;
+ size_t allocated;
+ size_t readp;
+ char *data;
+} saved_data_t;
+
+#endif /* CTF_RETURNS_H */
diff --git a/contrib/netbsd-tests/lib/libcurses/director/testlang_conf.l b/contrib/netbsd-tests/lib/libcurses/director/testlang_conf.l
new file mode 100644
index 0000000..a732afc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/director/testlang_conf.l
@@ -0,0 +1,437 @@
+%{
+/* $NetBSD: testlang_conf.l,v 1.7 2013/11/21 11:06:04 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+
+#include <curses.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+#include <err.h>
+#include "returns.h"
+#include "testlang_parse.h"
+
+#define MAX_INCLUDES 32 /* limit for the number of nested includes */
+
+int yylex(void);
+
+extern size_t line;
+extern char *include_path; /* from director.c */
+extern char *cur_file; /* from director.c */
+
+static int include_stack[MAX_INCLUDES];
+static char *include_files[MAX_INCLUDES];
+static int include_ptr = 0;
+
+static char *
+dequote(const char *s, size_t *len)
+{
+ const unsigned char *p;
+ char *buf, *q;
+
+ *len = 0;
+ p = (const unsigned char *)s;
+ while (*p) {
+ if (*p == '\\' && *(p+1)) {
+ if (isdigit(*(p+1)) && *(p+2) && isdigit(*(p+2)) &&
+ *(p+3) && isdigit(*(p+3)))
+ p += 3;
+ else
+ ++p;
+ }
+ ++(*len);
+ ++p;
+ }
+
+ buf = malloc(*len + 1);
+ if (buf == NULL)
+ return NULL;
+
+ p = (const unsigned char *)s;
+ q = buf;
+ while (*p) {
+ if (*p == '\\' && *(p+1)) {
+ ++p;
+ if (isdigit(*p)) {
+ if (*(p+1) && isdigit(*(p+1)) && *(p+2) &&
+ isdigit(*(p+2))) {
+ *q++ = ((*p - '0') * 8 + (*(p+1) - '0')) * 8 + (*(p+2) - '0');
+ p += 3;
+ } else {
+ *q++ = *p++;
+ }
+ } else {
+ switch (*p) {
+ case 'e':
+ /* escape */
+ *q++ = '\e';
+ p++;
+ break;
+
+ case 'n':
+ /* newline */
+ *q++ = '\n';
+ p++;
+ break;
+
+ case 'r':
+ /* carriage return */
+ *q++ = '\r';
+ p++;
+ break;
+
+ case 't':
+ /* tab */
+ *q++ = '\t';
+ p++;
+ break;
+
+ case '\\':
+ /* backslash */
+ *q++ = '\\';
+ p++;
+ break;
+
+ default:
+ *q++ = *p++;
+ }
+ }
+ } else
+ *q++ = *p++;
+ }
+ *q++ = '\0';
+
+ return buf;
+}
+%}
+
+HEX 0[xX][0-9a-zA-Z]+
+STRING [0-9a-z!#-&(-^ \t%._\\]+
+numeric [-0-9]+
+PCHAR (\\.|[^ \t\n])
+ASSIGN [aA][sS][sS][iI][gG][nN]
+CALL2 [cC][aA][lL][lL]2
+CALL3 [cC][aA][lL][lL]3
+CALL4 [cC][aA][lL][lL]4
+CALL [cC][aA][lL][lL]
+CHECK [cC][hH][eE][cC][kK]
+DELAY [dD][eE][lL][aA][yY]
+INPUT [iI][nN][pP][uU][tT]
+NOINPUT [nN][oO][iI][nN][pP][uU][tT]
+OK_RET [oO][kK]
+ERR_RET [eE][rR][rR]
+COMPARE [cC][oO][mM][pP][aA][rR][eE]
+COMPAREND [cC][oO][mM][pP][aA][rR][eE][Nn][Dd]
+FILENAME [A-Za-z0-9.][A-Za-z0-9./_-]+
+VARNAME [A-Za-z][A-Za-z0-9_-]+
+NULL_RET NULL
+NON_NULL NON_NULL
+BYTE BYTE
+OR \|
+LHB \(
+RHB \)
+
+%x incl
+%option noinput nounput
+
+%%
+
+include BEGIN(incl);
+
+<incl>[ \t]* /* eat the whitespace */
+<incl>[^ \t\n]+ { /* got the include file name */
+ char inc_file[MAXPATHLEN];
+
+ if (include_ptr > MAX_INCLUDES) {
+ fprintf(stderr,
+ "Maximum number of nested includes exceeded "
+ "at line %zu of file %s\n", line, cur_file);
+ exit(2);
+ }
+
+ if (yytext[0] != '/') {
+ if (strlcpy(inc_file, include_path, sizeof(inc_file))
+ >= sizeof(inc_file))
+ err(2, "CHECK_PATH too long");
+ if ((include_path[strlen(include_path) - 1] != '/') &&
+ ((strlcat(inc_file, "/", sizeof(inc_file))
+ >= sizeof(inc_file))))
+ err(2, "Could not append / to include file path");
+ } else {
+ inc_file[0] = '\0';
+ }
+
+ if (strlcat(inc_file, yytext, sizeof(inc_file))
+ >= sizeof(inc_file))
+ err(2, "Path to include file path overflowed");
+
+ yyin = fopen(inc_file, "r" );
+
+ if (!yyin)
+ err(1, "Error opening %s", inc_file);
+
+ yypush_buffer_state(yy_create_buffer(yyin, YY_BUF_SIZE));
+
+ include_stack[include_ptr] = line;
+ include_files[include_ptr++] = cur_file;
+ cur_file = strdup(inc_file);
+ if (cur_file == NULL)
+ err(2, "Cannot allocate new include file string");
+ line = 0;
+ BEGIN(INITIAL);
+ }
+
+<<EOF>> {
+ yypop_buffer_state();
+
+ if ( !YY_CURRENT_BUFFER )
+ {
+ yyterminate();
+ }
+
+ if (--include_ptr < 0)
+ err(2, "Include stack underflow");
+
+ free(cur_file);
+ cur_file = include_files[include_ptr];
+ line = include_stack[include_ptr];
+ }
+
+{ASSIGN} {
+ return ASSIGN;
+ }
+
+{CALL2} {
+ return CALL2;
+ }
+
+{CALL3} {
+ return CALL3;
+ }
+
+{CALL4} {
+ return CALL4;
+ }
+
+{CALL} {
+ return CALL;
+ }
+
+{CHECK} {
+ return CHECK;
+ }
+
+{DELAY} {
+ return DELAY;
+ }
+
+{INPUT} {
+ return INPUT;
+ }
+
+{NOINPUT} {
+ return NOINPUT;
+ }
+
+{COMPARE} {
+ return COMPARE;
+ }
+
+{COMPAREND} {
+ return COMPAREND;
+ }
+
+{NON_NULL} {
+ return NON_NULL;
+ }
+
+{NULL_RET} {
+ return NULL_RET;
+ }
+
+{OK_RET} {
+ return OK_RET;
+ }
+
+{ERR_RET} {
+ return ERR_RET;
+ }
+
+{OR} {
+ return OR;
+ }
+
+{LHB} {
+ return LHB;
+ }
+
+{RHB} {
+ return RHB;
+ }
+
+{HEX} {
+ /* Hex value, convert to decimal and return numeric */
+ unsigned long val;
+
+ if (sscanf(yytext, "%lx", &val) != 1)
+ err(1, "Bad hex conversion");
+
+ asprintf(&yylval.string, "%ld", val);
+ return numeric;
+ }
+
+
+{numeric} {
+ if ((yylval.string = strdup(yytext)) == NULL)
+ err(1, "Cannot allocate numeric string");
+ return numeric;
+}
+
+{VARNAME} {
+ if ((yylval.string = strdup(yytext)) == NULL)
+ err(1, "Cannot allocate string for varname");
+ return VARNAME;
+ }
+
+{FILENAME} {
+ size_t len;
+
+ if ((yylval.string = dequote(yytext, &len)) == NULL)
+ err(1, "Cannot allocate filename string");
+ return FILENAME;
+ }
+
+ /* path */
+\/{PCHAR}+ {
+ size_t len;
+ if ((yylval.string = dequote(yytext, &len)) == NULL)
+ err(1, "Cannot allocate string");
+ return PATH;
+ }
+
+\'{STRING}\' {
+ char *p;
+ size_t len;
+
+ if ((yylval.retval = malloc(sizeof(returns_t))) == NULL)
+ err(1, "Cannot allocate return struct");
+ p = yytext;
+ p++; /* skip the leading ' */
+ if ((yylval.retval->return_value = dequote(p, &len))
+ == NULL)
+ err(1, "Cannot allocate string");
+
+ yylval.retval->return_type = ret_byte;
+ /* trim trailing ' */
+ yylval.retval->return_len = len - 1;
+ return BYTE;
+ }
+
+\`{STRING}\` {
+ char *p, *str;
+ size_t len, chlen;
+ size_t i;
+ chtype *rv;
+
+ if ((yylval.retval = malloc(sizeof(returns_t))) == NULL)
+ err(1, "Cannot allocate return struct");
+ p = yytext;
+ p++; /* skip the leading ' */
+ if ((str = dequote(p, &len)) == NULL)
+ err(1, "Cannot allocate string");
+ len--; /* trim trailing ` */
+ if ((len % 2) != 0)
+ len--;
+
+ chlen = ((len / 2) + 1) * sizeof(chtype);
+ if ((yylval.retval->return_value = malloc(chlen))
+ == NULL)
+ err(1, "Cannot allocate chtype array");
+
+ rv = yylval.retval->return_value;
+ for (i = 0; i < len; i += 2)
+ *rv++ = (str[i] << 8) | str[i+1];
+ *rv = __NORMAL | '\0'; /* terminates chtype array */
+ yylval.retval->return_type = ret_byte;
+ yylval.retval->return_len = chlen;
+ return BYTE;
+ }
+
+\"{STRING}\" {
+ char *p;
+ size_t len;
+
+ p = yytext;
+ p++; /* skip the leading " */
+ if ((yylval.string = dequote(p, &len)) == NULL)
+ err(1, "Cannot allocate string");
+
+ /* remove trailing " */
+ yylval.string[len - 1] = '\0';
+ return STRING;
+ }
+
+\${VARNAME} {
+ char *p;
+
+ p = yytext;
+ p++; /* skip $ before var name */
+ if ((yylval.string = strdup(p)) == NULL)
+ err(1, "Cannot allocate string for varname");
+ return VARIABLE;
+ }
+
+ /* comments, white-outs */
+[ \t\r] |
+#.* ;
+^#.*\n |
+#.*\n |
+\\\n |
+^\n {
+line++; }
+
+ /* eol on a line with data. need to process, return eol */
+\n {
+ line++;
+ return EOL;
+ }
+
+. {
+ }
+
+%%
+
+int
+yywrap(void)
+{
+ return 1;
+}
diff --git a/contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y b/contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y
new file mode 100644
index 0000000..37c813f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y
@@ -0,0 +1,1617 @@
+%{
+/* $NetBSD: testlang_parse.y,v 1.13 2012/09/19 11:51:56 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+#include <assert.h>
+#include <curses.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <err.h>
+#include <unistd.h>
+#include <poll.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/syslimits.h>
+#include <time.h>
+#include <vis.h>
+#include <stdint.h>
+#include "returns.h"
+
+#define YYDEBUG 1
+
+extern int verbose;
+extern int cmdpipe[2];
+extern int slvpipe[2];
+extern int master;
+extern struct pollfd readfd;
+extern char *check_path;
+extern char *cur_file; /* from director.c */
+
+int yylex(void);
+
+size_t line;
+
+static int input_delay;
+
+/* time delay between inputs chars - default to 0.1ms minimum to prevent
+ * problems with input tests
+ */
+#define DELAY_MIN 0.1
+
+/* time delay after a function call - allows the slave time to
+ * run the function and output data before we do other actions.
+ * Set this to 50ms.
+ */
+#define POST_CALL_DELAY 50
+
+static struct timespec delay_spec = {0, 1000 * DELAY_MIN};
+static struct timespec delay_post_call = {0, 1000 * POST_CALL_DELAY};
+
+static char *input_str; /* string to feed in as input */
+static bool no_input; /* don't need more input */
+
+#define READ_PIPE 0
+#define WRITE_PIPE 1
+
+const char *returns_enum_names[] = {
+ "unused", "numeric", "string", "byte", "ERR", "OK", "NULL", "not NULL",
+ "variable", "reference", "returns count", "slave error"
+};
+
+typedef enum {
+ arg_static,
+ arg_byte,
+ arg_var,
+ arg_null
+} args_state_t;
+
+static const char *args_enum_names[] = {
+ "static", "byte", "var", "NULL"
+};
+
+typedef struct {
+ args_state_t arg_type;
+ size_t arg_len;
+ char *arg_string;
+ int var_index;
+} args_t;
+
+typedef struct {
+ char *function;
+ int nrets; /* number of returns */
+ returns_t *returns; /* array of expected returns */
+ int nargs; /* number of arguments */
+ args_t *args; /* arguments for the call */
+} cmd_line_t;
+
+static cmd_line_t command;
+
+typedef struct {
+ char *name;
+ size_t len;
+ returns_enum_t type;
+ void *value;
+} var_t;
+
+static size_t nvars; /* Number of declared variables */
+static var_t *vars; /* Variables defined during the test. */
+
+static int check_function_table(char *, const char *[], int);
+static int find_var_index(const char *);
+static void assign_arg(args_state_t, void *);
+static int assign_var(char *);
+void init_parse_variables(int);
+static void validate(int, void *);
+static void validate_return(const char *, const char *, int);
+static void validate_variable(int, returns_enum_t, const void *, int, int);
+static void validate_byte(returns_t *, returns_t *, int);
+static void write_cmd_pipe(char *);
+static void write_cmd_pipe_args(args_state_t, void *);
+static void read_cmd_pipe(returns_t *);
+static void write_func_and_args(void);
+static void compare_streams(char *, bool);
+static void do_function_call(size_t);
+static void save_slave_output(bool);
+static void validate_type(returns_enum_t, returns_t *, int);
+static void set_var(returns_enum_t, char *, void *);
+static void validate_reference(int, void *);
+static char *numeric_or(char *, char *);
+static char *get_numeric_var(const char *);
+static void perform_delay(struct timespec *);
+
+static const char *input_functions[] = {
+ "getch", "getnstr", "getstr", "mvgetnstr", "mvgetstr", "mvgetnstr",
+ "mvgetstr", "mvscanw", "mvwscanw", "scanw", "wgetch", "wgetnstr",
+ "wgetstr"
+};
+
+static const unsigned ninput_functions =
+ sizeof(input_functions) / sizeof(char *);
+
+saved_data_t saved_output;
+
+%}
+
+%union {
+ char *string;
+ returns_t *retval;
+}
+
+%token <string> PATH
+%token <string> STRING
+%token <retval> BYTE
+%token <string> VARNAME
+%token <string> FILENAME
+%token <string> VARIABLE
+%token <string> REFERENCE
+%token <string> NULL_RET
+%token <string> NON_NULL
+%token <string> ERR_RET
+%token <string> OK_RET
+%token <string> numeric
+%token <string> DELAY
+%token <string> INPUT
+%token <string> COMPARE
+%token <string> COMPAREND
+%token <string> ASSIGN
+%token EOL CALL CHECK NOINPUT OR LHB RHB
+%token CALL2 CALL3 CALL4 DRAIN
+
+%nonassoc OR
+
+%%
+
+statement : /* empty */
+ | assign statement
+ | call statement
+ | call2 statement
+ | call3 statement
+ | call4 statement
+ | check statement
+ | delay statement
+ | input statement
+ | noinput statement
+ | compare statement
+ | comparend statement
+ | eol statement
+ ;
+
+assign : ASSIGN VARNAME numeric {set_var(ret_number, $2, $3);} eol
+ | ASSIGN VARNAME LHB expr RHB {set_var(ret_number, $2, $<string>4);} eol
+ | ASSIGN VARNAME STRING {set_var(ret_string, $2, $3);} eol
+ | ASSIGN VARNAME BYTE {set_var(ret_byte, $2, $3);} eol
+ ;
+
+call : CALL result fn_name args eol {
+ do_function_call(1);
+}
+ ;
+
+call2 : CALL2 result result fn_name args eol {
+ do_function_call(2);
+}
+ ;
+
+call3 : CALL3 result result result fn_name args eol {
+ do_function_call(3);
+}
+ ;
+
+call4 : CALL4 result result result result fn_name args eol {
+ do_function_call(4);
+ }
+ ;
+
+check : CHECK var returns eol {
+ returns_t retvar;
+ var_t *vptr;
+ if (command.returns[0].return_index == -1)
+ err(1, "Undefined variable in check statement, line %zu"
+ " of file %s", line, cur_file);
+
+ if (verbose) {
+ fprintf(stderr, "Checking contents of variable %s for %s\n",
+ vars[command.returns[0].return_index].name,
+ returns_enum_names[command.returns[1].return_type]);
+ }
+
+ if (((command.returns[1].return_type == ret_byte) &&
+ (vars[command.returns[0].return_index].type != ret_byte)) ||
+ vars[command.returns[0].return_index].type != ret_string)
+ err(1, "Var type %s (%d) does not match return type %s (%d)",
+ returns_enum_names[
+ vars[command.returns[0].return_index].type],
+ vars[command.returns[0].return_index].type,
+ returns_enum_names[command.returns[1].return_type],
+ command.returns[1].return_type);
+
+ switch (command.returns[1].return_type) {
+ case ret_err:
+ validate_variable(0, ret_string, "ERR",
+ command.returns[0].return_index, 0);
+ break;
+
+ case ret_ok:
+ validate_variable(0, ret_string, "OK",
+ command.returns[0].return_index, 0);
+ break;
+
+ case ret_null:
+ validate_variable(0, ret_string, "NULL",
+ command.returns[0].return_index, 0);
+ break;
+
+ case ret_nonnull:
+ validate_variable(0, ret_string, "NULL",
+ command.returns[0].return_index, 1);
+ break;
+
+ case ret_string:
+ case ret_number:
+ if (verbose) {
+ fprintf(stderr, " %s == returned %s\n",
+ (const char *)command.returns[1].return_value,
+ (const char *)
+ vars[command.returns[0].return_index].value);
+ }
+ validate_variable(0, ret_string,
+ command.returns[1].return_value,
+ command.returns[0].return_index, 0);
+ break;
+
+ case ret_byte:
+ vptr = &vars[command.returns[0].return_index];
+ retvar.return_len = vptr->len;
+ retvar.return_type = vptr->type;
+ retvar.return_value = vptr->value;
+ validate_byte(&retvar, &command.returns[1], 0);
+ break;
+
+ default:
+ err(1, "Malformed check statement at line %zu "
+ "of file %s", line, cur_file);
+ break;
+ }
+
+ init_parse_variables(0);
+ }
+ ;
+
+delay : DELAY numeric eol {
+ /* set the inter-character delay */
+ if (sscanf($2, "%d", &input_delay) == 0)
+ err(1, "delay specification %s could not be converted to "
+ "numeric at line %zu of file %s", $2, line, cur_file);
+ if (verbose) {
+ fprintf(stderr, "Set input delay to %d ms\n", input_delay);
+ }
+
+ if (input_delay < DELAY_MIN)
+ input_delay = DELAY_MIN;
+ /*
+ * Fill in the timespec structure now ready for use later.
+ * The delay is specified in milliseconds so convert to timespec
+ * values
+ */
+ delay_spec.tv_sec = input_delay / 1000;
+ delay_spec.tv_nsec = (input_delay - 1000 * delay_spec.tv_sec) * 1000;
+ if (verbose) {
+ fprintf(stderr, "set delay to %jd.%jd\n",
+ (intmax_t)delay_spec.tv_sec,
+ (intmax_t)delay_spec.tv_nsec);
+ }
+
+ init_parse_variables(0);
+ }
+ ;
+
+input : INPUT STRING eol {
+ if (input_str != NULL) {
+ warnx("%s, %zu: Discarding unused input string",
+ cur_file, line);
+ free(input_str);
+ }
+
+ if ((input_str = malloc(strlen($2) + 1)) == NULL)
+ err(2, "Cannot allocate memory for input string");
+
+ strlcpy(input_str, $2, strlen($2) + 1);
+}
+ ;
+
+
+noinput : NOINPUT eol {
+ if (input_str != NULL) {
+ warnx("%s, %zu: Discarding unused input string",
+ cur_file, line);
+ free(input_str);
+ }
+
+ no_input = true;
+ }
+
+compare : COMPARE PATH eol
+ | COMPARE FILENAME eol
+{
+ compare_streams($2, true);
+}
+ ;
+
+
+comparend : COMPAREND PATH eol
+ | COMPAREND FILENAME eol
+{
+ compare_streams($2, false);
+}
+ ;
+
+
+result : returns
+ | var
+ | reference
+ ;
+
+returns : numeric { assign_rets(ret_number, $1); }
+ | LHB expr RHB { assign_rets(ret_number, $<string>2); }
+ | STRING { assign_rets(ret_string, $1); }
+ | BYTE { assign_rets(ret_byte, (void *) $1); }
+ | ERR_RET { assign_rets(ret_err, NULL); }
+ | OK_RET { assign_rets(ret_ok, NULL); }
+ | NULL_RET { assign_rets(ret_null, NULL); }
+ | NON_NULL { assign_rets(ret_nonnull, NULL); }
+ ;
+
+var : VARNAME {
+ assign_rets(ret_var, $1);
+ }
+ ;
+
+reference : VARIABLE {
+ assign_rets(ret_ref, $1);
+ }
+
+fn_name : VARNAME {
+ if (command.function != NULL)
+ free(command.function);
+
+ command.function = malloc(strlen($1) + 1);
+ if (command.function == NULL)
+ err(1, "Could not allocate memory for function name");
+ strcpy(command.function, $1);
+ }
+ ;
+
+expr : numeric
+ | VARIABLE
+ { $<string>$ = get_numeric_var($1); }
+ | expr OR expr
+ { $<string>$ = numeric_or($<string>1, $<string>3); }
+ ;
+
+args : /* empty */
+ | LHB expr RHB { assign_arg(arg_static, $<string>2); } args
+ | numeric { assign_arg(arg_static, $1); } args
+ | STRING { assign_arg(arg_static, $1); } args
+ | BYTE { assign_arg(arg_byte, $1); } args
+ | PATH { assign_arg(arg_static, $1); } args
+ | FILENAME { assign_arg(arg_static, $1); } args
+ | VARNAME { assign_arg(arg_static, $1); } args
+ | VARIABLE { assign_arg(arg_var, $1); } args
+ | NULL_RET { assign_arg(arg_null, $1); } args
+ ;
+
+eol : EOL
+ ;
+
+%%
+
+static void
+excess(const char *fname, size_t lineno, const char *func, const char *comment,
+ const void *data, size_t datalen)
+{
+ size_t dstlen = datalen * 4 + 1;
+ char *dst = malloc(dstlen);
+
+ if (dst == NULL)
+ err(1, "malloc");
+
+ if (strnvisx(dst, dstlen, data, datalen, VIS_WHITE | VIS_OCTAL) == -1)
+ err(1, "strnvisx");
+
+ warnx("%s, %zu: [%s] Excess %zu bytes%s [%s]",
+ fname, lineno, func, datalen, comment, dst);
+ free(dst);
+}
+
+/*
+ * Get the value of a variable, error if the variable has not been set or
+ * is not a numeric type.
+ */
+static char *
+get_numeric_var(const char *var)
+{
+ int i;
+
+ if ((i = find_var_index(var)) < 0)
+ err(1, "Variable %s is undefined", var);
+
+ if (vars[i].type != ret_number)
+ err(1, "Variable %s is not a numeric type", var);
+
+ return vars[i].value;
+}
+
+/*
+ * Perform a bitwise OR on two numbers and return the result.
+ */
+static char *
+numeric_or(char *n1, char *n2)
+{
+ unsigned long i1, i2, result;
+ char *ret;
+
+ i1 = strtoul(n1, NULL, 10);
+ i2 = strtoul(n2, NULL, 10);
+
+ result = i1 | i2;
+ asprintf(&ret, "%lu", result);
+
+ if (verbose) {
+ fprintf(stderr, "numeric or of 0x%lx (%s) and 0x%lx (%s)"
+ " results in 0x%lx (%s)\n",
+ i1, n1, i2, n2, result, ret);
+ }
+
+ return ret;
+}
+
+/*
+ * Sleep for the specified time, handle the sleep getting interrupted
+ * by a signal.
+ */
+static void
+perform_delay(struct timespec *ts)
+{
+ struct timespec delay_copy, delay_remainder;
+
+ delay_copy = *ts;
+ while (nanosleep(&delay_copy, &delay_remainder) < 0) {
+ if (errno != EINTR)
+ err(2, "nanosleep returned error");
+ delay_copy = delay_remainder;
+ }
+}
+
+/*
+ * Assign the value given to the named variable.
+ */
+static void
+set_var(returns_enum_t type, char *name, void *value)
+{
+ int i;
+ char *number;
+ returns_t *ret;
+
+ i = find_var_index(name);
+ if (i < 0)
+ i = assign_var(name);
+
+ vars[i].type = type;
+ if ((type == ret_number) || (type == ret_string)) {
+ number = value;
+ vars[i].len = strlen(number) + 1;
+ vars[i].value = malloc(vars[i].len + 1);
+ if (vars[i].value == NULL)
+ err(1, "Could not malloc memory for assign string");
+ strcpy(vars[i].value, number);
+ } else {
+ /* can only be a byte value */
+ ret = value;
+ vars[i].len = ret->return_len;
+ vars[i].value = malloc(vars[i].len);
+ if (vars[i].value == NULL)
+ err(1, "Could not malloc memory to assign byte string");
+ memcpy(vars[i].value, ret->return_value, vars[i].len);
+ }
+}
+
+/*
+ * Add a new variable to the vars array, the value will be assigned later,
+ * when a test function call returns.
+ */
+static int
+assign_var(char *varname)
+{
+ var_t *temp;
+ char *name;
+
+ if ((name = malloc(strlen(varname) + 1)) == NULL)
+ err(1, "Alloc of varname failed");
+
+ if ((temp = realloc(vars, sizeof(*temp) * (nvars + 1))) == NULL) {
+ free(name);
+ err(1, "Realloc of vars array failed");
+ }
+
+ strcpy(name, varname);
+ vars = temp;
+ vars[nvars].name = name;
+ vars[nvars].len = 0;
+ vars[nvars].value = NULL;
+ nvars++;
+
+ return (nvars - 1);
+}
+
+/*
+ * Allocate and assign a new argument of the given type.
+ */
+static void
+assign_arg(args_state_t arg_type, void *arg)
+{
+ args_t *temp, cur;
+ char *str = arg;
+ returns_t *ret;
+
+ if (verbose) {
+ fprintf(stderr, "function is >%s<, adding arg >%s< type %s\n",
+ command.function, str, args_enum_names[arg_type]);
+ }
+
+ cur.arg_type = arg_type;
+ switch (arg_type) {
+ case arg_var:
+ cur.var_index = find_var_index(arg);
+ if (cur.var_index < 0)
+ err(1, "Invalid variable %s at line %zu of file %s",
+ str, line, cur_file);
+ cur.arg_type = ret_string;
+ break;
+
+ case arg_byte:
+ ret = arg;
+ cur.arg_len = ret->return_len;
+ cur.arg_string = malloc(cur.arg_len);
+ if (cur.arg_string == NULL)
+ err(1, "Could not malloc memory for arg bytes");
+ memcpy(cur.arg_string, ret->return_value, cur.arg_len);
+ break;
+
+ case arg_null:
+ cur.arg_len = 0;
+ cur.arg_string = NULL;
+ break;
+
+ default:
+ cur.arg_len = strlen(str);
+ cur.arg_string = malloc(cur.arg_len + 1);
+ if (cur.arg_string == NULL)
+ err(1, "Could not malloc memory for arg string");
+ strcpy(cur.arg_string, arg);
+ }
+
+ temp = realloc(command.args, sizeof(*temp) * (command.nargs + 1));
+ if (temp == NULL)
+ err(1, "Failed to reallocate args");
+ command.args = temp;
+ memcpy(&command.args[command.nargs], &cur, sizeof(args_t));
+ command.nargs++;
+}
+
+/*
+ * Allocate and assign a new return.
+ */
+static void
+assign_rets(returns_enum_t ret_type, void *ret)
+{
+ returns_t *temp, cur;
+ char *ret_str;
+ returns_t *ret_ret;
+
+ cur.return_type = ret_type;
+ if (ret_type != ret_var) {
+ if ((ret_type == ret_number) || (ret_type == ret_string)) {
+ ret_str = ret;
+ cur.return_len = strlen(ret_str) + 1;
+ cur.return_value = malloc(cur.return_len + 1);
+ if (cur.return_value == NULL)
+ err(1,
+ "Could not malloc memory for arg string");
+ strcpy(cur.return_value, ret_str);
+ } else if (ret_type == ret_byte) {
+ ret_ret = ret;
+ cur.return_len = ret_ret->return_len;
+ cur.return_value = malloc(cur.return_len);
+ if (cur.return_value == NULL)
+ err(1,
+ "Could not malloc memory for byte string");
+ memcpy(cur.return_value, ret_ret->return_value,
+ cur.return_len);
+ } else if (ret_type == ret_ref) {
+ if ((cur.return_index = find_var_index(ret)) < 0)
+ err(1, "Undefined variable reference");
+ }
+ } else {
+ cur.return_index = find_var_index(ret);
+ if (cur.return_index < 0)
+ cur.return_index = assign_var(ret);
+ }
+
+ temp = realloc(command.returns, sizeof(*temp) * (command.nrets + 1));
+ if (temp == NULL)
+ err(1, "Failed to reallocate returns");
+ command.returns = temp;
+ memcpy(&command.returns[command.nrets], &cur, sizeof(returns_t));
+ command.nrets++;
+}
+
+/*
+ * Find the given variable name in the var array and return the i
+ * return -1 if var is not found.
+ */
+static int
+find_var_index(const char *var_name)
+{
+ int result;
+ size_t i;
+
+ result = -1;
+
+ for (i = 0; i < nvars; i++) {
+ if (strcmp(var_name, vars[i].name) == 0) {
+ result = i;
+ break;
+ }
+ }
+
+ return result;
+}
+
+/*
+ * Check the given function name in the given table of names, return 1 if
+ * there is a match.
+ */
+static int check_function_table(char *function, const char *table[],
+ int nfunctions)
+{
+ int i;
+
+ for (i = 0; i < nfunctions; i++) {
+ if ((strlen(function) == strlen(table[i])) &&
+ (strcmp(function, table[i]) == 0))
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ * Compare the output from the slave against the given file and report
+ * any differences.
+ */
+static void
+compare_streams(char *filename, bool discard)
+{
+ char check_file[PATH_MAX], drain[100], ref, data;
+ struct pollfd fds[2];
+ int nfd, check_fd;
+ ssize_t result;
+ size_t offs;
+
+ /*
+ * Don't prepend check path iff check file has an absolute
+ * path.
+ */
+ if (filename[0] != '/') {
+ if (strlcpy(check_file, check_path, sizeof(check_file))
+ >= sizeof(check_file))
+ err(2, "CHECK_PATH too long");
+
+ if (strlcat(check_file, "/", sizeof(check_file))
+ >= sizeof(check_file))
+ err(2, "Could not append / to check file path");
+ } else {
+ check_file[0] = '\0';
+ }
+
+ if (strlcat(check_file, filename, sizeof(check_file))
+ >= sizeof(check_file))
+ err(2, "Path to check file path overflowed");
+
+ if ((check_fd = open(check_file, O_RDONLY, 0)) < 0)
+ err(2, "failed to open file %s line %zu of file %s",
+ check_file, line, cur_file);
+
+ fds[0].fd = check_fd;
+ fds[0].events = POLLIN;
+ fds[1].fd = master;
+ fds[1].events = POLLIN;
+
+ nfd = 2;
+ /*
+ * if we have saved output then only check for data in the
+ * reference file since the slave data may already be drained.
+ */
+ if (saved_output.count > 0)
+ nfd = 1;
+
+ offs = 0;
+ while (poll(fds, nfd, 500) == nfd) {
+ if (fds[0].revents & POLLIN) {
+ if ((result = read(check_fd, &ref, 1)) < 1) {
+ if (result != 0) {
+ err(2,
+ "Bad read on file %s", check_file);
+ } else {
+ break;
+ }
+ }
+ }
+
+ if (saved_output.count > 0) {
+ data = saved_output.data[saved_output.readp];
+ saved_output.count--;
+ saved_output.readp++;
+ /* run out of saved data, switch to file */
+ if (saved_output.count == 0)
+ nfd = 2;
+ } else {
+ if (fds[0].revents & POLLIN) {
+ if (read(master, &data, 1) < 1)
+ err(2, "Bad read on slave pty");
+ } else
+ continue;
+ }
+
+ if (verbose) {
+ fprintf(stderr, "Comparing reference byte 0x%x (%c)"
+ " against slave byte 0x%x (%c)\n",
+ ref, (ref >= ' ') ? ref : '-',
+ data, (data >= ' ' )? data : '-');
+ }
+
+ if (ref != data) {
+ errx(2, "%s, %zu: refresh data from slave does "
+ "not match expected from file %s offs %zu "
+ "[reference 0x%x (%c) != slave 0x%x (%c)]",
+ cur_file, line, check_file, offs,
+ ref, (ref >= ' ') ? ref : '-',
+ data, (data >= ' ') ? data : '-');
+ }
+
+ offs++;
+ }
+
+
+ if (saved_output.count > 0)
+ excess(cur_file, line, __func__, " from slave",
+ &saved_output.data[saved_output.readp], saved_output.count);
+
+ /* discard any excess saved output if required */
+ if (discard) {
+ saved_output.count = 0;
+ saved_output.readp = 0;
+ }
+
+ if ((result = poll(&fds[0], 2, 0)) != 0) {
+ if (result == -1)
+ err(2, "poll of file descriptors failed");
+
+ if ((fds[1].revents & POLLIN) == POLLIN) {
+ save_slave_output(true);
+ } else if ((fds[0].revents & POLLIN) == POLLIN) {
+ /*
+ * handle excess in file if it exists. Poll
+ * says there is data until EOF is read.
+ * Check next read is EOF, if it is not then
+ * the file really has more data than the
+ * slave produced so flag this as a warning.
+ */
+ result = read(check_fd, drain, sizeof(drain));
+ if (result == -1)
+ err(1, "read of data file failed");
+
+ if (result > 0) {
+ excess(check_file, 0, __func__, "", drain,
+ result);
+ }
+ }
+ }
+
+ close(check_fd);
+}
+
+/*
+ * Pass a function call and arguments to the slave and wait for the
+ * results. The variable nresults determines how many returns we expect
+ * back from the slave. These results will be validated against the
+ * expected returns or assigned to variables.
+ */
+static void
+do_function_call(size_t nresults)
+{
+#define MAX_RESULTS 4
+ char *p;
+ int do_input;
+ size_t i;
+ struct pollfd fds[3];
+ returns_t response[MAX_RESULTS], returns_count;
+ assert(nresults <= MAX_RESULTS);
+
+ do_input = check_function_table(command.function, input_functions,
+ ninput_functions);
+
+ write_func_and_args();
+
+ /*
+ * We should get the number of returns back here, grab it before
+ * doing input otherwise it will confuse the input poll
+ */
+ read_cmd_pipe(&returns_count);
+ if (returns_count.return_type != ret_count)
+ err(2, "expected return type of ret_count but received %s",
+ returns_enum_names[returns_count.return_type]);
+
+ perform_delay(&delay_post_call); /* let slave catch up */
+
+ if (verbose) {
+ fprintf(stderr, "Expect %zu results from slave, slave "
+ "reported %zu\n", nresults, returns_count.return_len);
+ }
+
+ if ((no_input == false) && (do_input == 1)) {
+ if (verbose) {
+ fprintf(stderr, "doing input with inputstr >%s<\n",
+ input_str);
+ }
+
+ if (input_str == NULL)
+ errx(2, "%s, %zu: Call to input function "
+ "but no input defined", cur_file, line);
+
+ fds[0].fd = slvpipe[READ_PIPE];
+ fds[0].events = POLLIN;
+ fds[1].fd = master;
+ fds[1].events = POLLOUT;
+ p = input_str;
+ save_slave_output(false);
+ while(*p != '\0') {
+ perform_delay(&delay_spec);
+
+ if (poll(fds, 2, 0) < 0)
+ err(2, "poll failed");
+ if (fds[0].revents & POLLIN) {
+ warnx("%s, %zu: Slave function "
+ "returned before end of input string",
+ cur_file, line);
+ break;
+ }
+ if ((fds[1].revents & POLLOUT) == 0)
+ continue;
+ if (verbose) {
+ fprintf(stderr, "Writing char >%c< to slave\n",
+ *p);
+ }
+ if (write(master, p, 1) != 1) {
+ warn("%s, %zu: Slave function write error",
+ cur_file, line);
+ break;
+ }
+ p++;
+
+ }
+ save_slave_output(false);
+
+ if (verbose) {
+ fprintf(stderr, "Input done.\n");
+ }
+
+ /* done with the input string, free the resources */
+ free(input_str);
+ input_str = NULL;
+ }
+
+ if (verbose) {
+ fds[0].fd = slvpipe[READ_PIPE];
+ fds[0].events = POLLIN;
+
+ fds[1].fd = slvpipe[WRITE_PIPE];
+ fds[1].events = POLLOUT;
+
+ fds[2].fd = master;
+ fds[2].events = POLLIN | POLLOUT;
+
+ i = poll(&fds[0], 3, 1000);
+ fprintf(stderr, "Poll returned %zu\n", i);
+ for (i = 0; i < 3; i++) {
+ fprintf(stderr, "revents for fd[%zu] = 0x%x\n",
+ i, fds[i].revents);
+ }
+ }
+
+ /* drain any trailing output */
+ save_slave_output(false);
+
+ for (i = 0; i < returns_count.return_len; i++) {
+ read_cmd_pipe(&response[i]);
+ }
+
+ /*
+ * Check for a slave error in the first return slot, if the
+ * slave errored then we may not have the number of returns we
+ * expect but in this case we should report the slave error
+ * instead of a return count mismatch.
+ */
+ if ((returns_count.return_len > 0) &&
+ (response[0].return_type == ret_slave_error))
+ err(2, "Slave returned error: %s",
+ (const char *)response[0].return_value);
+
+ if (returns_count.return_len != nresults)
+ err(2, "Incorrect number of returns from slave, expected %zu "
+ "but received %zu", nresults, returns_count.return_len);
+
+ if (verbose) {
+ for (i = 0; i < nresults; i++) {
+ if ((response[i].return_type != ret_byte) &&
+ (response[i].return_type != ret_err) &&
+ (response[i].return_type != ret_ok))
+ fprintf(stderr,
+ "received response >%s< "
+ "expected",
+ (const char *)response[i].return_value);
+ else
+ fprintf(stderr, "received");
+
+ fprintf(stderr, " return_type %s\n",
+ returns_enum_names[command.returns[i].return_type]);
+ }
+ }
+
+ for (i = 0; i < nresults; i++) {
+ if (command.returns[i].return_type != ret_var) {
+ validate(i, &response[i]);
+ } else {
+ vars[command.returns[i].return_index].len =
+ response[i].return_len;
+ vars[command.returns[i].return_index].value =
+ response[i].return_value;
+ vars[command.returns[i].return_index].type =
+ response[i].return_type;
+ }
+ }
+
+ if (verbose && (saved_output.count > 0))
+ excess(cur_file, line, __func__, " from slave",
+ &saved_output.data[saved_output.readp], saved_output.count);
+
+ init_parse_variables(0);
+}
+
+/*
+ * Write the function and command arguments to the command pipe.
+ */
+static void
+write_func_and_args(void)
+{
+ int i;
+
+ if (verbose) {
+ fprintf(stderr, "calling function >%s<\n", command.function);
+ }
+
+ write_cmd_pipe(command.function);
+ for (i = 0; i < command.nargs; i++) {
+ if (command.args[i].arg_type == arg_var)
+ write_cmd_pipe_args(command.args[i].arg_type,
+ &vars[command.args[i].var_index]);
+ else
+ write_cmd_pipe_args(command.args[i].arg_type,
+ &command.args[i]);
+ }
+
+ write_cmd_pipe(NULL); /* signal end of arguments */
+}
+
+/*
+ * Initialise the command structure - if initial is non-zero then just set
+ * everything to sane values otherwise free any memory that was allocated
+ * when building the structure.
+ */
+void
+init_parse_variables(int initial)
+{
+ int i, result;
+ struct pollfd slave_pty;
+
+ if (initial == 0) {
+ free(command.function);
+ for (i = 0; i < command.nrets; i++) {
+ if (command.returns[i].return_type == ret_number)
+ free(command.returns[i].return_value);
+ }
+ free(command.returns);
+
+ for (i = 0; i < command.nargs; i++) {
+ if (command.args[i].arg_type != arg_var)
+ free(command.args[i].arg_string);
+ }
+ free(command.args);
+ } else {
+ line = 0;
+ input_delay = 0;
+ vars = NULL;
+ nvars = 0;
+ input_str = NULL;
+ saved_output.allocated = 0;
+ saved_output.count = 0;
+ saved_output.readp = 0;
+ saved_output.data = NULL;
+ }
+
+ no_input = false;
+ command.function = NULL;
+ command.nargs = 0;
+ command.args = NULL;
+ command.nrets = 0;
+ command.returns = NULL;
+
+ /*
+ * Check the slave pty for stray output from the slave, at this
+ * point we should not see any data as it should have been
+ * consumed by the test functions. If we see data then we have
+ * either a bug or are not handling an output generating function
+ * correctly.
+ */
+ slave_pty.fd = master;
+ slave_pty.events = POLLIN;
+ result = poll(&slave_pty, 1, 0);
+
+ if (result < 0)
+ err(2, "Poll of slave pty failed");
+ else if (result > 0)
+ warnx("%s, %zu: Unexpected data from slave", cur_file, line);
+}
+
+/*
+ * Validate the response against the expected return. The variable
+ * i is the i into the rets array in command.
+ */
+static void
+validate(int i, void *data)
+{
+ char *response;
+ returns_t *byte_response;
+
+ byte_response = data;
+ if ((command.returns[i].return_type != ret_byte) &&
+ (command.returns[i].return_type != ret_err) &&
+ (command.returns[i].return_type != ret_ok)) {
+ if ((byte_response->return_type == ret_byte) ||
+ (byte_response->return_type == ret_err) ||
+ (byte_response->return_type == ret_ok))
+ err(1, "%s: expecting type %s, received type %s"
+ " at line %zu of file %s", __func__,
+ returns_enum_names[command.returns[i].return_type],
+ returns_enum_names[byte_response->return_type],
+ line, cur_file);
+
+ response = byte_response->return_value;
+ }
+
+ switch (command.returns[i].return_type) {
+ case ret_err:
+ validate_type(ret_err, byte_response, 0);
+ break;
+
+ case ret_ok:
+ validate_type(ret_ok, byte_response, 0);
+ break;
+
+ case ret_null:
+ validate_return("NULL", response, 0);
+ break;
+
+ case ret_nonnull:
+ validate_return("NULL", response, 1);
+ break;
+
+ case ret_string:
+ case ret_number:
+ validate_return(command.returns[i].return_value,
+ response, 0);
+ break;
+
+ case ret_ref:
+ validate_reference(i, response);
+ break;
+
+ case ret_byte:
+ validate_byte(&command.returns[i], byte_response, 0);
+ break;
+
+ default:
+ err(1, "Malformed statement at line %zu of file %s",
+ line, cur_file);
+ break;
+ }
+}
+
+/*
+ * Validate the return against the contents of a variable.
+ */
+static void
+validate_reference(int i, void *data)
+{
+ char *response;
+ returns_t *byte_response;
+ var_t *varp;
+
+ varp = &vars[command.returns[i].return_index];
+
+ byte_response = data;
+ if (command.returns[i].return_type != ret_byte)
+ response = data;
+
+ if (verbose) {
+ fprintf(stderr,
+ "%s: return type of %s, value %s \n", __func__,
+ returns_enum_names[varp->type],
+ (const char *)varp->value);
+ }
+
+ switch (varp->type) {
+ case ret_string:
+ case ret_number:
+ validate_return(varp->value, response, 0);
+ break;
+
+ case ret_byte:
+ validate_byte(varp->value, byte_response, 0);
+ break;
+
+ default:
+ err(1,
+ "Invalid return type for reference at line %zu of file %s",
+ line, cur_file);
+ break;
+ }
+}
+
+/*
+ * Validate the return type against the expected type, throw an error
+ * if they don't match.
+ */
+static void
+validate_type(returns_enum_t expected, returns_t *value, int check)
+{
+ if (((check == 0) && (expected != value->return_type)) ||
+ ((check == 1) && (expected == value->return_type)))
+ err(1, "Validate expected type %s %s %s line %zu of file %s",
+ returns_enum_names[expected],
+ (check == 0)? "matching" : "not matching",
+ returns_enum_names[value->return_type], line, cur_file);
+
+ if (verbose) {
+ fprintf(stderr, "Validate expected type %s %s %s line %zu"
+ " of file %s\n",
+ returns_enum_names[expected],
+ (check == 0)? "matching" : "not matching",
+ returns_enum_names[value->return_type], line, cur_file);
+ }
+}
+
+/*
+ * Validate the return value against the expected value, throw an error
+ * if they don't match.
+ */
+static void
+validate_return(const char *expected, const char *value, int check)
+{
+ if (((check == 0) && strcmp(expected, value) != 0) ||
+ ((check == 1) && strcmp(expected, value) == 0))
+ errx(1, "Validate expected %s %s %s line %zu of file %s",
+ expected,
+ (check == 0)? "matching" : "not matching", value,
+ line, cur_file);
+ if (verbose) {
+ fprintf(stderr, "Validated expected value %s %s %s "
+ "at line %zu of file %s\n", expected,
+ (check == 0)? "matches" : "does not match",
+ value, line, cur_file);
+ }
+}
+
+/*
+ * Validate the return value against the expected value, throw an error
+ * if they don't match expectations.
+ */
+static void
+validate_byte(returns_t *expected, returns_t *value, int check)
+{
+ char *ch;
+ size_t i;
+
+ if (verbose) {
+ ch = value->return_value;
+ fprintf(stderr, "checking returned byte stream: ");
+ for (i = 0; i < value->return_len; i++)
+ fprintf(stderr, "%s0x%x", (i != 0)? ", " : "", ch[i]);
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "%s byte stream: ",
+ (check == 0)? "matches" : "does not match");
+ ch = (char *) expected->return_value;
+ for (i = 0; i < expected->return_len; i++)
+ fprintf(stderr, "%s0x%x", (i != 0)? ", " : "", ch[i]);
+ fprintf(stderr, "\n");
+ }
+
+ /*
+ * No chance of a match if lengths differ...
+ */
+ if ((check == 0) && (expected->return_len != value->return_len))
+ errx(1, "Byte validation failed, length mismatch, expected %zu,"
+ "received %zu", expected->return_len, value->return_len);
+
+ /*
+ * If check is 0 then we want to throw an error IFF the byte streams
+ * do not match, if check is 1 then throw an error if the byte
+ * streams match.
+ */
+ if (((check == 0) && memcmp(expected->return_value, value->return_value,
+ value->return_len) != 0) ||
+ ((check == 1) && (expected->return_len == value->return_len) &&
+ memcmp(expected->return_value, value->return_value,
+ value->return_len) == 0))
+ errx(1, "Validate expected %s byte stream at line %zu"
+ "of file %s",
+ (check == 0)? "matching" : "not matching", line, cur_file);
+ if (verbose) {
+ fprintf(stderr, "Validated expected %s byte stream "
+ "at line %zu of file %s\n",
+ (check == 0)? "matching" : "not matching",
+ line, cur_file);
+ }
+}
+
+/*
+ * Validate the variable at i against the expected value, throw an
+ * error if they don't match, if check is non-zero then the match is
+ * negated.
+ */
+static void
+validate_variable(int ret, returns_enum_t type, const void *value, int i,
+ int check)
+{
+ returns_t *retval;
+ var_t *varptr;
+
+ retval = &command.returns[ret];
+ varptr = &vars[command.returns[ret].return_index];
+
+ if (varptr->value == NULL)
+ err(1, "Variable %s has no value assigned to it", varptr->name);
+
+
+ if (varptr->type != type)
+ err(1, "Variable %s is not the expected type", varptr->name);
+
+ if (type != ret_byte) {
+ if ((((check == 0) && strcmp(value, varptr->value) != 0))
+ || ((check == 1) && strcmp(value, varptr->value) == 0))
+ err(1, "Variable %s contains %s instead of %s"
+ " value %s at line %zu of file %s",
+ varptr->name, (const char *)varptr->value,
+ (check == 0)? "expected" : "not matching",
+ (const char *)value,
+ line, cur_file);
+ if (verbose) {
+ fprintf(stderr, "Variable %s contains %s value "
+ "%s at line %zu of file %s\n",
+ varptr->name,
+ (check == 0)? "expected" : "not matching",
+ (const char *)varptr->value, line, cur_file);
+ }
+ } else {
+ if ((check == 0) && (retval->return_len != varptr->len))
+ err(1, "Byte validation failed, length mismatch");
+
+ /*
+ * If check is 0 then we want to throw an error IFF
+ * the byte streams do not match, if check is 1 then
+ * throw an error if the byte streams match.
+ */
+ if (((check == 0) && memcmp(retval->return_value, varptr->value,
+ varptr->len) != 0) ||
+ ((check == 1) && (retval->return_len == varptr->len) &&
+ memcmp(retval->return_value, varptr->value,
+ varptr->len) == 0))
+ err(1, "Validate expected %s byte stream at line %zu"
+ " of file %s",
+ (check == 0)? "matching" : "not matching",
+ line, cur_file);
+ if (verbose) {
+ fprintf(stderr, "Validated expected %s byte stream "
+ "at line %zu of file %s\n",
+ (check == 0)? "matching" : "not matching",
+ line, cur_file);
+ }
+ }
+}
+
+/*
+ * Write a string to the command pipe - we feed the number of bytes coming
+ * down first to allow storage allocation and then follow up with the data.
+ * If cmd is NULL then feed a -1 down the pipe to say the end of the args.
+ */
+static void
+write_cmd_pipe(char *cmd)
+{
+ args_t arg;
+ size_t len;
+
+ if (cmd == NULL)
+ len = 0;
+ else
+ len = strlen(cmd);
+
+ arg.arg_type = arg_static;
+ arg.arg_len = len;
+ arg.arg_string = cmd;
+ write_cmd_pipe_args(arg.arg_type, &arg);
+
+}
+
+static void
+write_cmd_pipe_args(args_state_t type, void *data)
+{
+ var_t *var_data;
+ args_t *arg_data;
+ int len, send_type;
+ void *cmd;
+
+ arg_data = data;
+ switch (type) {
+ case arg_var:
+ var_data = data;
+ len = var_data->len;
+ cmd = var_data->value;
+ if (type == arg_byte)
+ send_type = ret_byte;
+ else
+ send_type = ret_string;
+ break;
+
+ case arg_null:
+ send_type = ret_null;
+ len = 0;
+ break;
+
+ default:
+ if ((arg_data->arg_len == 0) && (arg_data->arg_string == NULL))
+ len = -1;
+ else
+ len = arg_data->arg_len;
+ cmd = arg_data->arg_string;
+ if (type == arg_byte)
+ send_type = ret_byte;
+ else
+ send_type = ret_string;
+ }
+
+ if (verbose) {
+ fprintf(stderr, "Writing type %s to command pipe\n",
+ returns_enum_names[send_type]);
+ }
+
+ if (write(cmdpipe[WRITE_PIPE], &send_type, sizeof(int)) < 0)
+ err(1, "command pipe write for type failed");
+
+ if (verbose) {
+ fprintf(stderr, "Writing length %d to command pipe\n", len);
+ }
+
+ if (write(cmdpipe[WRITE_PIPE], &len, sizeof(int)) < 0)
+ err(1, "command pipe write for length failed");
+
+ if (len > 0) {
+ if (verbose) {
+ fprintf(stderr, "Writing data >%s< to command pipe\n",
+ (const char *)cmd);
+ }
+ if (write(cmdpipe[WRITE_PIPE], cmd, len) < 0)
+ err(1, "command pipe write of data failed");
+ }
+}
+
+/*
+ * Read a response from the command pipe, first we will receive the
+ * length of the response then the actual data.
+ */
+static void
+read_cmd_pipe(returns_t *response)
+{
+ int len, type;
+ struct pollfd rfd[2];
+ char *str;
+
+ /*
+ * Check if there is data to read - just in case slave has died, we
+ * don't want to block on the read and just hang. We also check
+ * output from the slave because the slave may be blocked waiting
+ * for a flush on its stdout.
+ */
+ rfd[0].fd = slvpipe[READ_PIPE];
+ rfd[0].events = POLLIN;
+ rfd[1].fd = master;
+ rfd[1].events = POLLIN;
+
+ do {
+ if (poll(rfd, 2, 4000) == 0)
+ errx(2, "%s, %zu: Command pipe read timeout",
+ cur_file, line);
+
+ if ((rfd[1].revents & POLLIN) == POLLIN) {
+ if (verbose) {
+ fprintf(stderr,
+ "draining output from slave\n");
+ }
+ save_slave_output(false);
+ }
+ }
+ while((rfd[1].revents & POLLIN) == POLLIN);
+
+ if (read(slvpipe[READ_PIPE], &type, sizeof(int)) < 0)
+ err(1, "command pipe read for type failed");
+ response->return_type = type;
+
+ if ((type != ret_ok) && (type != ret_err) && (type != ret_count)) {
+ if (read(slvpipe[READ_PIPE], &len, sizeof(int)) < 0)
+ err(1, "command pipe read for length failed");
+ response->return_len = len;
+
+ if (verbose) {
+ fprintf(stderr,
+ "Reading %d bytes from command pipe\n", len);
+ }
+
+ if ((response->return_value = malloc(len + 1)) == NULL)
+ err(1, "Failed to alloc memory for cmd pipe read");
+
+ if (read(slvpipe[READ_PIPE], response->return_value, len) < 0)
+ err(1, "command pipe read of data failed");
+
+ if (response->return_type != ret_byte) {
+ str = response->return_value;
+ str[len] = '\0';
+
+ if (verbose) {
+ fprintf(stderr, "Read data >%s< from pipe\n",
+ (const char *)response->return_value);
+ }
+ }
+ } else {
+ response->return_value = NULL;
+ if (type == ret_count) {
+ if (read(slvpipe[READ_PIPE], &len, sizeof(int)) < 0)
+ err(1, "command pipe read for number of "
+ "returns failed");
+ response->return_len = len;
+ }
+
+ if (verbose) {
+ fprintf(stderr, "Read type %s from pipe\n",
+ returns_enum_names[type]);
+ }
+ }
+}
+
+/*
+ * Check for writes from the slave on the pty, save the output into a
+ * buffer for later checking if discard is false.
+ */
+#define MAX_DRAIN 256
+
+static void
+save_slave_output(bool discard)
+{
+ char *new_data, drain[MAX_DRAIN];
+ size_t to_allocate;
+ ssize_t result;
+ size_t i;
+
+ result = 0;
+ for (;;) {
+ if (result == -1)
+ err(2, "poll of slave pty failed");
+ result = MAX_DRAIN;
+ if ((result = read(master, drain, result)) < 0) {
+ if (errno == EAGAIN)
+ break;
+ else
+ err(2, "draining slave pty failed");
+ }
+ if (result == 0)
+ abort();
+
+ if (!discard) {
+ if ((size_t)result >
+ (saved_output.allocated - saved_output.count)) {
+ to_allocate = 1024 * ((result / 1024) + 1);
+
+ if ((new_data = realloc(saved_output.data,
+ saved_output.allocated + to_allocate))
+ == NULL)
+ err(2, "Realloc of saved_output failed");
+ saved_output.data = new_data;
+ saved_output.allocated += to_allocate;
+ }
+
+ if (verbose) {
+ fprintf(stderr, "count = %zu, "
+ "allocated = %zu\n", saved_output.count,
+ saved_output.allocated);
+ for (i = 0; i < (size_t)result; i++) {
+ fprintf(stderr, "Saving slave output "
+ "at %zu: 0x%x (%c)\n",
+ saved_output.count + i, drain[i],
+ (drain[i] >= ' ')? drain[i] : '-');
+ }
+ }
+
+ memcpy(&saved_output.data[saved_output.count], drain,
+ result);
+ saved_output.count += result;
+
+ if (verbose) {
+ fprintf(stderr, "count = %zu, "
+ "allocated = %zu\n", saved_output.count,
+ saved_output.allocated);
+ }
+ } else {
+ if (verbose) {
+ for (i = 0; i < (size_t)result; i++) {
+ fprintf(stderr, "Discarding slave "
+ "output 0x%x (%c)\n",
+ drain[i],
+ (drain[i] >= ' ')? drain[i] : '-');
+ }
+ }
+ }
+ }
+}
+
+static void
+yyerror(const char *msg)
+{
+ warnx("%s in line %zu of file %s", msg, line, cur_file);
+}
diff --git a/contrib/netbsd-tests/lib/libcurses/slave/command_table.h b/contrib/netbsd-tests/lib/libcurses/slave/command_table.h
new file mode 100644
index 0000000..ef57a00
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/slave/command_table.h
@@ -0,0 +1,397 @@
+/* $NetBSD: command_table.h,v 1.3 2011/09/15 11:46:19 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+
+#ifndef _COMMAND_TABLE_H_
+#define _COMMAND_TABLE_H_
+
+#include "curses_commands.h"
+
+/*
+ * Curses commands
+ */
+struct command_def commands[] = {
+ {"DRAIN", cmd_DRAIN},
+ {"addbytes", cmd_addbytes},
+ {"addch", cmd_addch},
+ {"addchnstr", cmd_addchnstr},
+ {"addchstr", cmd_addchstr},
+ {"addnstr", cmd_addnstr},
+ {"addstr", cmd_addstr},
+ {"attr_get", cmd_attr_get},
+ {"attr_off", cmd_attr_off},
+ {"attr_on", cmd_attr_on},
+ {"attr_set", cmd_attr_set},
+ {"attroff", cmd_attroff},
+ {"attron", cmd_attron},
+ {"attrset", cmd_attrset},
+ {"bkgd", cmd_bkgd},
+ {"bkgdset", cmd_bkgdset},
+ {"border", cmd_border},
+ {"clear", cmd_clear},
+ {"clrtobot", cmd_clrtobot},
+ {"clrtoeol", cmd_clrtoeol},
+ {"color_set", cmd_color_set},
+ {"delch", cmd_delch},
+ {"deleteln", cmd_deleteln},
+ {"echochar", cmd_echochar},
+ {"erase", cmd_erase},
+ {"getch", cmd_getch},
+ {"getnstr", cmd_getnstr},
+ {"getstr", cmd_getstr},
+ {"inch", cmd_inch},
+ {"inchnstr", cmd_inchnstr},
+ {"inchstr", cmd_inchstr},
+ {"innstr", cmd_innstr},
+ {"insch", cmd_insch},
+ {"insdelln", cmd_insdelln},
+ {"insertln", cmd_insertln},
+ {"instr", cmd_instr},
+ {"move", cmd_move},
+ {"refresh", cmd_refresh},
+ {"scrl", cmd_scrl},
+ {"setscrreg", cmd_setscrreg},
+ {"standend", cmd_standend},
+ {"standout", cmd_standout},
+ {"timeout", cmd_timeout},
+ {"underscore", cmd_underscore},
+ {"underend", cmd_underend},
+ {"waddbytes", cmd_waddbytes},
+ {"waddstr", cmd_waddstr},
+ {"mvaddbytes", cmd_mvaddbytes},
+ {"mvaddch", cmd_mvaddch},
+ {"mvaddchnstr", cmd_mvaddchnstr},
+ {"mvaddchstr", cmd_mvaddchstr},
+ {"mvaddnstr", cmd_mvaddnstr},
+ {"mvaddstr", cmd_mvaddstr},
+ {"mvdelch", cmd_mvdelch},
+ {"mvgetch", cmd_mvgetch},
+ {"mvgetnstr", cmd_mvgetnstr},
+ {"mvgetstr", cmd_mvgetstr},
+ {"mvinch", cmd_mvinch},
+ {"mvinchnstr", cmd_mvinchnstr},
+ {"mvinchstr", cmd_mvinchstr},
+ {"mvinnstr", cmd_mvinnstr},
+ {"mvinsch", cmd_mvinsch},
+ {"mvinstr", cmd_mvinstr},
+ {"mvwaddbytes", cmd_mvwaddbytes},
+ {"mvwaddch", cmd_mvwaddch},
+ {"mvwaddchnstr", cmd_mvwaddchnstr},
+ {"mvwaddchstr", cmd_mvwaddchstr},
+ {"mvwaddnstr", cmd_mvwaddnstr},
+ {"mvwaddstr", cmd_mvwaddstr},
+ {"mvwdelch", cmd_mvwdelch},
+ {"mvwgetch", cmd_mvwgetch},
+ {"mvwgetnstr", cmd_mvwgetnstr},
+ {"mvwgetstr", cmd_mvwgetstr},
+ {"mvwinch", cmd_mvwinch},
+ {"mvwinsch", cmd_mvwinsch},
+ {"assume_default_colors", cmd_assume_default_colors},
+ {"baudrate", cmd_baudrate},
+ {"beep", cmd_beep},
+ {"box", cmd_box},
+ {"can_change_color", cmd_can_change_color},
+ {"cbreak", cmd_cbreak},
+ {"clearok", cmd_clearok},
+ {"color_content", cmd_color_content},
+ {"copywin", cmd_copywin},
+ {"curs_set", cmd_curs_set},
+ {"def_prog_mode", cmd_def_prog_mode},
+ {"def_shell_mode", cmd_def_shell_mode},
+ {"define_key", cmd_define_key},
+ {"delay_output", cmd_delay_output},
+ {"delscreen", cmd_delscreen},
+ {"delwin", cmd_delwin},
+ {"derwin", cmd_derwin},
+ {"dupwin", cmd_dupwin},
+ {"doupdate", cmd_doupdate},
+ {"echo", cmd_echo},
+ {"endwin", cmd_endwin},
+ {"erasechar", cmd_erasechar},
+ {"flash", cmd_flash},
+ {"flushinp", cmd_flushinp},
+ {"flushok", cmd_flushok},
+ {"fullname", cmd_fullname},
+ {"getattrs", cmd_getattrs},
+ {"getbkgd", cmd_getbkgd},
+ {"getcury", cmd_getcury},
+ {"getcurx", cmd_getcurx},
+ {"getyx", cmd_getyx},
+ {"getbegy", cmd_getbegy},
+ {"getbegx", cmd_getbegx},
+ {"getmaxy", cmd_getmaxy},
+ {"getmaxx", cmd_getmaxx},
+ {"getpary", cmd_getpary},
+ {"getparx", cmd_getparx},
+ {"getparyx", cmd_getparyx},
+ {"gettmode", cmd_gettmode},
+ {"getwin", cmd_getwin},
+ {"halfdelay", cmd_halfdelay},
+ {"has_colors", cmd_has_colors},
+ {"has_ic", cmd_has_ic},
+ {"has_il", cmd_has_il},
+ {"hline", cmd_hline},
+ {"idcok", cmd_idcok},
+ {"idlok", cmd_idlok},
+ {"init_color", cmd_init_color},
+ {"init_pair", cmd_init_pair},
+ {"initscr", cmd_initscr},
+ {"intrflush", cmd_intrflush},
+ {"isendwin", cmd_isendwin},
+ {"is_linetouched", cmd_is_linetouched},
+ {"is_wintouched", cmd_is_wintouched},
+ {"keyok", cmd_keyok},
+ {"keypad", cmd_keypad},
+ {"keyname", cmd_keyname},
+ {"killchar", cmd_killchar},
+ {"leaveok", cmd_leaveok},
+ {"meta", cmd_meta},
+ {"mvcur", cmd_mvcur},
+ {"mvderwin", cmd_mvderwin},
+ {"mvhline", cmd_mvhline},
+ {"mvprintw", cmd_mvprintw},
+ {"mvscanw", cmd_mvscanw},
+ {"mvvline", cmd_mvvline},
+ {"mvwhline", cmd_mvwhline},
+ {"mvwvline", cmd_mvwvline},
+ {"mvwin", cmd_mvwin},
+ {"mvwinchnstr", cmd_mvwinchnstr},
+ {"mvwinchstr", cmd_mvwinchstr},
+ {"mvwinnstr", cmd_mvwinnstr},
+ {"mvwinstr", cmd_mvwinstr},
+ {"mvwprintw", cmd_mvwprintw},
+ {"mvwscanw", cmd_mvwscanw},
+ {"napms", cmd_napms},
+ {"newpad", cmd_newpad},
+ {"newterm", cmd_newterm},
+ {"newwin", cmd_newwin},
+ {"nl", cmd_nl},
+ {"no_color_attributes", cmd_no_color_attributes},
+ {"nocbreak", cmd_nocbreak},
+ {"nodelay", cmd_nodelay},
+ {"noecho", cmd_noecho},
+ {"nonl", cmd_nonl},
+ {"noqiflush", cmd_noqiflush},
+ {"noraw", cmd_noraw},
+ {"notimeout", cmd_notimeout},
+ {"overlay", cmd_overlay},
+ {"overwrite", cmd_overwrite},
+ {"pair_content", cmd_pair_content},
+ {"pechochar", cmd_pechochar},
+ {"pnoutrefresh", cmd_pnoutrefresh},
+ {"prefresh", cmd_prefresh},
+ {"printw", cmd_printw},
+ {"putwin", cmd_putwin},
+ {"qiflush", cmd_qiflush},
+ {"raw", cmd_raw},
+ {"redrawwin", cmd_redrawwin},
+ {"reset_prog_mode", cmd_reset_prog_mode},
+ {"reset_shell_mode", cmd_reset_shell_mode},
+ {"resetty", cmd_resetty},
+ {"resizeterm", cmd_resizeterm},
+ {"savetty", cmd_savetty},
+ {"scanw", cmd_scanw},
+ {"scroll", cmd_scroll},
+ {"scrollok", cmd_scrollok},
+ {"setterm", cmd_setterm},
+ {"set_term", cmd_set_term},
+ {"start_color", cmd_start_color},
+ {"subpad", cmd_subpad},
+ {"subwin", cmd_subwin},
+ {"termattrs", cmd_termattrs},
+ {"term_attrs", cmd_term_attrs},
+ {"touchline", cmd_touchline},
+ {"touchoverlap", cmd_touchoverlap},
+ {"touchwin", cmd_touchwin},
+ {"ungetch", cmd_ungetch},
+ {"untouchwin", cmd_untouchwin},
+ {"use_default_colors", cmd_use_default_colors},
+ {"vline", cmd_vline},
+ {"vw_printw", cmd_vw_printw},
+ {"vw_scanw", cmd_vw_scanw},
+ {"vwprintw", cmd_vwprintw},
+ {"vwscanw", cmd_vwscanw},
+ {"waddch", cmd_waddch},
+ {"waddchnstr", cmd_waddchnstr},
+ {"waddchstr", cmd_waddchstr},
+ {"waddnstr", cmd_waddnstr},
+ {"wattr_get", cmd_wattr_get},
+ {"wattr_off", cmd_wattr_off},
+ {"wattr_on", cmd_wattr_on},
+ {"wattr_set", cmd_wattr_set},
+ {"wattroff", cmd_wattroff},
+ {"wattron", cmd_wattron},
+ {"wattrset", cmd_wattrset},
+ {"wbkgd", cmd_wbkgd},
+ {"wbkgdset", cmd_wbkgdset},
+ {"wborder", cmd_wborder},
+ {"wclear", cmd_wclear},
+ {"wclrtobot", cmd_wclrtobot},
+ {"wclrtoeol", cmd_wclrtoeol},
+ {"wcolor_set", cmd_wcolor_set},
+ {"wdelch", cmd_wdelch},
+ {"wdeleteln", cmd_wdeleteln},
+ {"wechochar", cmd_wechochar},
+ {"werase", cmd_werase},
+ {"wgetch", cmd_wgetch},
+ {"wgetnstr", cmd_wgetnstr},
+ {"wgetstr", cmd_wgetstr},
+ {"whline", cmd_whline},
+ {"winch", cmd_winch},
+ {"winchnstr", cmd_winchnstr},
+ {"winchstr", cmd_winchstr},
+ {"winnstr", cmd_winnstr},
+ {"winsch", cmd_winsch},
+ {"winsdelln", cmd_winsdelln},
+ {"winsertln", cmd_winsertln},
+ {"winstr", cmd_winstr},
+ {"wmove", cmd_wmove},
+ {"wnoutrefresh", cmd_wnoutrefresh},
+ {"wprintw", cmd_wprintw},
+ {"wredrawln", cmd_wredrawln},
+ {"wrefresh", cmd_wrefresh},
+ {"wresize", cmd_wresize},
+ {"wscanw", cmd_wscanw},
+ {"wscrl", cmd_wscrl},
+ {"wsetscrreg", cmd_wsetscrreg},
+ {"wstandend", cmd_wstandend},
+ {"wstandout", cmd_wstandout},
+ {"wtimeout", cmd_wtimeout},
+ {"wtouchln", cmd_wtouchln},
+ {"wunderend", cmd_wunderend},
+ {"wunderscore", cmd_wunderscore},
+ {"wvline", cmd_wvline},
+ {"insnstr", cmd_insnstr},
+ {"insstr", cmd_insstr},
+ {"mvinsnstr", cmd_mvinsnstr},
+ {"mvinsstr", cmd_mvinsstr},
+ {"mvwinsnstr", cmd_mvwinsnstr},
+ {"mvwinsstr", cmd_mvwinsstr},
+ {"winsnstr", cmd_winsnstr},
+ {"winsstr", cmd_winsstr},
+ {"chgat", cmd_chgat},
+ {"wchgat", cmd_wchgat},
+ {"mvchgat", cmd_mvchgat},
+ {"mvwchgat", cmd_mvwchgat},
+ {"add_wch", cmd_add_wch},
+ {"wadd_wch", cmd_wadd_wch},
+ {"mvadd_wch", cmd_mvadd_wch},
+ {"mvwadd_wch", cmd_mvwadd_wch},
+ {"add_wchnstr", cmd_add_wchnstr},
+ {"add_wchstr", cmd_add_wchstr},
+ {"wadd_wchnstr", cmd_wadd_wchnstr},
+ {"wadd_wchstr", cmd_wadd_wchstr},
+ {"mvadd_wchnstr", cmd_mvadd_wchnstr},
+ {"mvadd_wchstr", cmd_mvadd_wchstr},
+ {"mvwadd_wchnstr", cmd_mvwadd_wchnstr},
+ {"mvwadd_wchstr", cmd_mvwadd_wchstr},
+ {"addnwstr", cmd_addnwstr},
+ {"addwstr", cmd_addwstr},
+ {"mvaddnwstr", cmd_mvaddnwstr},
+ {"mvaddwstr", cmd_mvaddwstr},
+ {"mvwaddnwstr", cmd_mvwaddnwstr},
+ {"mvwaddwstr", cmd_mvwaddwstr},
+ {"waddnwstr", cmd_waddnwstr},
+ {"waddwstr", cmd_waddwstr},
+ {"echo_wchar", cmd_echo_wchar},
+ {"wecho_wchar", cmd_wecho_wchar},
+ {"pecho_wchar", cmd_pecho_wchar},
+ {"ins_wch", cmd_ins_wch},
+ {"wins_wch", cmd_wins_wch},
+ {"mvins_wch", cmd_mvins_wch},
+ {"mvwins_wch", cmd_mvwins_wch},
+ {"ins_nwstr", cmd_ins_nwstr},
+ {"ins_wstr", cmd_ins_wstr},
+ {"mvins_nwstr", cmd_mvins_nwstr},
+ {"mvins_wstr", cmd_mvins_wstr},
+ {"mvwins_nwstr", cmd_mvwins_nwstr},
+ {"mvwins_wstr", cmd_mvwins_wstr},
+ {"wins_nwstr", cmd_wins_nwstr},
+ {"wins_wstr", cmd_wins_wstr},
+ {"get_wch", cmd_get_wch},
+ {"unget_wch", cmd_unget_wch},
+ {"mvget_wch", cmd_mvget_wch},
+ {"mvwget_wch", cmd_mvwget_wch},
+ {"wget_wch", cmd_wget_wch},
+ {"getn_wstr", cmd_getn_wstr},
+ {"get_wstr", cmd_get_wstr},
+ {"mvgetn_wstr", cmd_mvgetn_wstr},
+ {"mvget_wstr", cmd_mvget_wstr},
+ {"mvwgetn_wstr", cmd_mvwgetn_wstr},
+ {"mvwget_wstr", cmd_mvwget_wstr},
+ {"wgetn_wstr", cmd_wgetn_wstr},
+ {"wget_wstr", cmd_wget_wstr},
+ {"in_wch", cmd_in_wch},
+ {"mvin_wch", cmd_mvin_wch},
+ {"mvwin_wch", cmd_mvwin_wch},
+ {"win_wch", cmd_win_wch},
+ {"in_wchnstr", cmd_in_wchnstr},
+ {"in_wchstr", cmd_in_wchstr},
+ {"mvin_wchnstr", cmd_mvin_wchnstr},
+ {"mvin_wchstr", cmd_mvin_wchstr},
+ {"mvwin_wchnstr", cmd_mvwin_wchnstr},
+ {"mvwin_wchstr", cmd_mvwin_wchstr},
+ {"win_wchnstr", cmd_win_wchnstr},
+ {"win_wchstr", cmd_win_wchstr},
+ {"innwstr", cmd_innwstr},
+ {"inwstr", cmd_inwstr},
+ {"mvinnwstr", cmd_mvinnwstr},
+ {"mvinwstr", cmd_mvinwstr},
+ {"mvwinnwstr", cmd_mvwinnwstr},
+ {"mvwinwstr", cmd_mvwinwstr},
+ {"winnwstr", cmd_winnwstr},
+ {"winwstr", cmd_winwstr},
+ {"setcchar", cmd_setcchar},
+ {"getcchar", cmd_getcchar},
+ {"key_name", cmd_key_name},
+ {"border_set", cmd_border_set},
+ {"wborder_set", cmd_wborder_set},
+ {"box_set", cmd_box_set},
+ {"erasewchar", cmd_erasewchar},
+ {"killwchar", cmd_killwchar},
+ {"hline_set", cmd_hline_set},
+ {"mvhline_set", cmd_mvhline_set},
+ {"mvvline_set", cmd_mvvline_set},
+ {"mvwhline_set", cmd_mvwhline_set},
+ {"mvwvline_set", cmd_mvwvline_set},
+ {"vline_set", cmd_vline_set},
+ {"whline_set", cmd_whline_set},
+ {"wvline_set", cmd_wvline_set},
+ {"bkgrnd", cmd_bkgrnd},
+ {"bkgrndset", cmd_bkgrndset},
+ {"getbkgrnd", cmd_getbkgrnd},
+ {"wbkgrnd", cmd_wbkgrnd},
+ {"wbkgrndset", cmd_wbkgrndset},
+ {"wgetbkgrnd", cmd_wgetbkgrnd},
+};
+
+size_t ncmds = sizeof(commands) / sizeof(struct command_def);
+
+#endif /* _COMMAND_TABLE_H */
diff --git a/contrib/netbsd-tests/lib/libcurses/slave/commands.c b/contrib/netbsd-tests/lib/libcurses/slave/commands.c
new file mode 100644
index 0000000..2f26024
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/slave/commands.c
@@ -0,0 +1,243 @@
+/* $NetBSD: commands.c,v 1.4 2011/09/15 11:46:19 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+
+#include <curses.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <err.h>
+#include <sys/types.h>
+#include "returns.h"
+#include "slave.h"
+#include "command_table.h"
+
+extern int cmdpipe[2];
+extern int slvpipe[2];
+
+static void report_type(returns_enum_t);
+static void report_message(int, const char *);
+
+/*
+ * Match the passed command string and execute the associated test
+ * function.
+ */
+void
+command_execute(char *func, int nargs, char **args)
+{
+ size_t i;
+
+ i = 0;
+ while (i < ncmds) {
+ if (strcasecmp(func, commands[i].name) == 0) {
+ /* matched function */
+ commands[i].func(nargs, args);
+ return;
+ }
+ i++;
+ }
+
+ report_status("UNKNOWN_FUNCTION");
+}
+
+/*
+ * Report an pointer value back to the director
+ */
+void
+report_ptr(void *ptr)
+{
+ char *string;
+
+ if (ptr == NULL)
+ asprintf(&string, "NULL");
+ else
+ asprintf(&string, "%p", ptr);
+ report_status(string);
+ free(string);
+}
+
+/*
+ * Report an integer value back to the director
+ */
+void
+report_int(int value)
+{
+ char *string;
+
+ asprintf(&string, "%d", value);
+ report_status(string);
+ free(string);
+}
+
+/*
+ * Report either an ERR or OK back to the director
+ */
+void
+report_return(int status)
+{
+ if (status == ERR)
+ report_type(ret_err);
+ else if (status == OK)
+ report_type(ret_ok);
+ else
+ report_status("INVALID_RETURN");
+}
+
+/*
+ * Report the type back to the director via the command pipe
+ */
+static void
+report_type(returns_enum_t return_type)
+{
+ int type;
+
+ type = return_type;
+ if (write(slvpipe[WRITE_PIPE], &type, sizeof(int)) < 0)
+ err(1, "command pipe write for status type failed");
+
+}
+
+/*
+ * Report the number of returns back to the director via the command pipe
+ */
+void
+report_count(int count)
+{
+ int type;
+
+ type = ret_count;
+ if (write(slvpipe[WRITE_PIPE], &type, sizeof(int)) < 0)
+ err(1, "command pipe write for count type failed");
+
+ if (write(slvpipe[WRITE_PIPE], &count, sizeof(int)) < 0)
+ err(1, "command pipe write for count");
+}
+
+/*
+ * Report the status back to the director via the command pipe
+ */
+void
+report_status(const char *status)
+{
+ report_message(ret_string, status);
+}
+
+/*
+ * Report an error message back to the director via the command pipe.
+ */
+void
+report_error(const char *status)
+{
+ report_message(ret_slave_error, status);
+}
+
+/*
+ * Report the message with the given type back to the director via the
+ * command pipe.
+ */
+static void
+report_message(int type, const char *status)
+{
+ int len;
+
+ len = strlen(status);
+
+ if (write(slvpipe[WRITE_PIPE], &type, sizeof(int)) < 0)
+ err(1, "command pipe write for message type failed");
+
+ if (write(slvpipe[WRITE_PIPE], &len, sizeof(int)) < 0)
+ err(1, "command pipe write for message length failed");
+
+ if (write(slvpipe[WRITE_PIPE], status, len) < 0)
+ err(1, "command pipe write of message data failed");
+}
+
+/*
+ * Report a string of chtype back to the director via the command pipe.
+ */
+void
+report_byte(chtype c)
+{
+ chtype string[2];
+
+ string[0] = c;
+ string[1] = A_NORMAL | '\0';
+ report_nstr(string);
+}
+
+/*
+ * Report a string of chtype back to the director via the command pipe.
+ */
+void
+report_nstr(chtype *string)
+{
+ int len, type;
+ chtype *p;
+
+ len = 0;
+ p = string;
+
+ while ((*p++ & __CHARTEXT) != 0) {
+ len++;
+ }
+
+ len++; /* add in the termination chtype */
+ len *= sizeof(chtype);
+
+ type = ret_byte;
+ if (write(slvpipe[WRITE_PIPE], &type, sizeof(int)) < 0)
+ err(1, "%s: command pipe write for status type failed",
+ __func__);
+
+ if (write(slvpipe[WRITE_PIPE], &len, sizeof(int)) < 0)
+ err(1, "%s: command pipe write for status length failed",
+ __func__);
+
+ if (write(slvpipe[WRITE_PIPE], string, len) < 0)
+ err(1, "%s: command pipe write of status data failed",
+ __func__);
+}
+
+/*
+ * Check the number of args we received are what we expect. Return an
+ * error if they do not match.
+ */
+int
+check_arg_count(int nargs, int expected)
+{
+ if (nargs != expected) {
+ report_count(1);
+ report_error("INCORRECT_ARGUMENT_NUMBER");
+ return(1);
+ }
+
+ return(0);
+}
diff --git a/contrib/netbsd-tests/lib/libcurses/slave/curses_commands.c b/contrib/netbsd-tests/lib/libcurses/slave/curses_commands.c
new file mode 100644
index 0000000..9a6679a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/slave/curses_commands.c
@@ -0,0 +1,7165 @@
+/* $NetBSD: curses_commands.c,v 1.7 2012/09/19 11:51:08 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+
+#include <curses.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <stdarg.h>
+
+#include "slave.h"
+#include "curses_commands.h"
+
+void
+cmd_DRAIN(int nargs, char **args)
+{
+ while (getch() != ERR);
+ report_count(1);
+ report_return(OK);
+}
+
+void
+cmd_addbytes(int nargs, char **args)
+{
+ int count;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(addbytes(args[0], count));
+}
+
+
+void
+cmd_addch(int nargs, char **args)
+{
+ chtype *ch;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ ch = (chtype *) args[0];
+ report_count(1);
+ report_return(addch(ch[0]));
+}
+
+
+void
+cmd_addchnstr(int nargs, char **args)
+{
+ int count;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(addchnstr((chtype *) args[0], count));
+}
+
+
+void
+cmd_addchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_return(addchstr((chtype *) args[0]));
+}
+
+
+void
+cmd_addnstr(int nargs, char **args)
+{
+ int count;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(addnstr(args[0], count));
+}
+
+
+void
+cmd_addstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_return(addstr(args[0]));
+}
+
+
+void
+cmd_attr_get(int nargs, char **args)
+{
+ attr_t attrs;
+ short colours;
+ int retval;
+
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ retval = attr_get(&attrs, &colours, NULL);
+
+ /* XXXX - call3 */
+ report_count(3);
+ report_return(retval);
+ report_int(attrs);
+ report_int(colours);
+}
+
+
+void
+cmd_attr_off(int nargs, char **args)
+{
+ int attrib;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &attrib) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(attr_off(attrib, NULL));
+}
+
+
+void
+cmd_attr_on(int nargs, char **args)
+{
+ int attrib;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &attrib) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(attr_on(attrib, NULL));
+}
+
+
+void
+cmd_attr_set(int nargs, char **args)
+{
+ int attrib;
+ short pair;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &attrib) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%hd", &pair) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(attr_set(attrib, pair, NULL));
+}
+
+
+void
+cmd_attroff(int nargs, char **args)
+{
+ int attrib;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &attrib) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(attroff(attrib));
+}
+
+
+void
+cmd_attron(int nargs, char **args)
+{
+ int attrib;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &attrib) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(attron(attrib));
+}
+
+
+void
+cmd_attrset(int nargs, char **args)
+{
+ int attrib;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &attrib) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(attrset(attrib));
+}
+
+
+void
+cmd_bkgd(int nargs, char **args)
+{
+ chtype *ch;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ ch = (chtype *) args[0];
+ report_count(1);
+ report_return(bkgd(ch[0]));
+}
+
+
+void
+cmd_bkgdset(int nargs, char **args)
+{
+ chtype *ch;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ ch = (chtype *) args[0];
+ bkgdset(ch[0]); /* returns void */
+ report_count(1);
+ report_return(OK);
+}
+
+
+void
+cmd_border(int nargs, char **args)
+{
+ int ls, rs, ts, bs, tl, tr, bl, br;
+
+ if (check_arg_count(nargs, 8) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &ls) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+ if (sscanf(args[1], "%d", &rs) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+ if (sscanf(args[2], "%d", &ts) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+ if (sscanf(args[3], "%d", &bs) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+ if (sscanf(args[4], "%d", &tl) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+ if (sscanf(args[5], "%d", &tr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+ if (sscanf(args[6], "%d", &bl) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+ if (sscanf(args[7], "%d", &br) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(border(ls, rs, ts, bs, tl, tr, bl, br));
+}
+
+
+void
+cmd_clear(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(clear());
+}
+
+
+void
+cmd_clrtobot(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(clrtobot());
+}
+
+
+void
+cmd_clrtoeol(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(clrtoeol());
+}
+
+
+void
+cmd_color_set(int nargs, char **args)
+{
+ short colour_pair;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%hd", &colour_pair) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(color_set(colour_pair, NULL));
+}
+
+
+void
+cmd_delch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(delch());
+}
+
+
+void
+cmd_deleteln(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(deleteln());
+}
+
+
+void
+cmd_echochar(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ /* XXX causes refresh */
+ report_count(1);
+ report_return(echochar(args[0][0]));
+}
+
+
+void
+cmd_erase(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(erase());
+}
+
+
+void
+cmd_getch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ /* XXX causes refresh */
+ report_count(1);
+ report_int(getch());
+}
+
+
+void
+cmd_getnstr(int nargs, char **args)
+{
+ int limit;
+ char *string;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &limit) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc(limit + 1)) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(getnstr(string, limit));
+ report_status(string);
+ free(string);
+}
+
+
+void
+cmd_getstr(int nargs, char **args)
+{
+ char string[256];
+
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(getstr(string));
+ report_status(string);
+}
+
+
+void
+cmd_inch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+
+ report_count(1);
+ report_byte(inch());
+}
+
+
+void
+cmd_inchnstr(int nargs, char **args)
+{
+ int limit;
+ chtype *string;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &limit) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc((limit + 1) * sizeof(chtype))) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(inchnstr(string, limit));
+ report_nstr(string);
+ free(string);
+}
+
+
+void
+cmd_inchstr(int nargs, char **args)
+{
+ chtype string[256];
+
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(inchstr(string));
+ report_nstr(string);
+}
+
+
+void
+cmd_innstr(int nargs, char **args)
+{
+ int limit;
+ char *string;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &limit) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc(limit + 1)) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_int(innstr(string, limit));
+ report_status(string);
+ free(string);
+}
+
+
+void
+cmd_insch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_return(insch(args[0][0]));
+}
+
+
+void
+cmd_insdelln(int nargs, char **args)
+{
+ int nlines;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &nlines) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(insdelln(nlines));
+}
+
+
+void
+cmd_insertln(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(insertln());
+}
+
+
+void
+cmd_instr(int nargs, char **args)
+{
+ char string[256];
+
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(instr(string));
+ report_status(string);
+}
+
+
+void
+cmd_move(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(move(y, x));
+}
+
+
+void
+cmd_refresh(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(refresh());
+}
+
+
+void
+cmd_scrl(int nargs, char **args)
+{
+ int nlines;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &nlines) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(scrl(nlines));
+}
+
+
+void
+cmd_setscrreg(int nargs, char **args)
+{
+ int top, bottom;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &top) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &bottom) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(setscrreg(top, bottom));
+}
+
+
+void
+cmd_standend(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(standend());
+}
+
+
+void
+cmd_standout(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(standout());
+}
+
+
+void
+cmd_timeout(int nargs, char **args)
+{
+ int tval;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &tval) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ timeout(tval); /* void return */
+ report_count(1);
+ report_return(OK);
+}
+
+
+void
+cmd_underscore(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(underscore());
+}
+
+
+void
+cmd_underend(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(underend());
+}
+
+
+void
+cmd_waddbytes(int nargs, char **args)
+{
+ WINDOW *win;
+ int count;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(waddbytes(win, args[1], count));
+}
+
+
+void
+cmd_waddstr(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(waddstr(win, args[1]));
+}
+
+
+void
+cmd_mvaddbytes(int nargs, char **args)
+{
+ int y, x, count;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvaddbytes(y, x, args[2], count));
+}
+
+
+void
+cmd_mvaddch(int nargs, char **args)
+{
+ int y, x;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ ch = (chtype *) args[2];
+ report_count(1);
+ report_return(mvaddch(y, x, ch[0]));
+}
+
+
+void
+cmd_mvaddchnstr(int nargs, char **args)
+{
+ int y, x, count;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvaddchnstr(y, x, (chtype *) args[2], count));
+}
+
+
+void
+cmd_mvaddchstr(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvaddchstr(y, x, (chtype *) args[2]));
+}
+
+
+void
+cmd_mvaddnstr(int nargs, char **args)
+{
+ int y, x, count;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvaddnstr(y, x, args[2], count));
+}
+
+
+void
+cmd_mvaddstr(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvaddstr(y, x, args[2]));
+}
+
+
+void
+cmd_mvdelch(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvdelch(y, x));
+}
+
+
+void
+cmd_mvgetch(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(mvgetch(y, x));
+}
+
+
+void
+cmd_mvgetnstr(int nargs, char **args)
+{
+ int y, x, count;
+ char *string;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc(count + 1)) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvgetnstr(y, x, string, count));
+ report_status(string);
+ free(string);
+}
+
+
+void
+cmd_mvgetstr(int nargs, char **args)
+{
+ int y, x;
+ char string[256];
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvgetstr(y, x, string));
+ report_status(string);
+}
+
+
+void
+cmd_mvinch(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(mvinch(y, x));
+}
+
+
+void
+cmd_mvinchnstr(int nargs, char **args)
+{
+ int y, x, count;
+ chtype *string;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvinchnstr(y, x, string, count));
+ report_nstr(string);
+ free(string);
+}
+
+
+void
+cmd_mvinchstr(int nargs, char **args)
+{
+ int y, x;
+ chtype string[256];
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvinchstr(y, x, string));
+ report_nstr(string);
+}
+
+
+void
+cmd_mvinnstr(int nargs, char **args)
+{
+ int y, x, count;
+ char *string;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc(count + 1)) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvinnstr(y, x, string, count));
+ report_status(string);
+ free(string);
+}
+
+
+void
+cmd_mvinsch(int nargs, char **args)
+{
+ int y, x, ch;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &ch) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvinsch(y, x, ch));
+}
+
+
+void
+cmd_mvinstr(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvinstr(y, x, args[2]));
+}
+
+
+
+void
+cmd_mvwaddbytes(int nargs, char **args)
+{
+ int y, x, count;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwaddbytes(win, y, x, args[3], count));
+}
+
+
+void
+cmd_mvwaddch(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwaddch(win, y, x, args[3][0]));
+}
+
+
+void
+cmd_mvwaddchnstr(int nargs, char **args)
+{
+ int y, x, count;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwaddchnstr(win, y, x, (chtype *) args[3], count));
+}
+
+
+void
+cmd_mvwaddchstr(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwaddchstr(win, y, x, (chtype *) args[3]));
+}
+
+
+void
+cmd_mvwaddnstr(int nargs, char **args)
+{
+ int y, x, count;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwaddnstr(win, y, x, args[3], count));
+}
+
+
+void
+cmd_mvwaddstr(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwaddstr(win, y, x, args[3]));
+}
+
+
+void
+cmd_mvwdelch(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwdelch(win, y, x));
+}
+
+
+void
+cmd_mvwgetch(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - implicit refresh */
+ report_count(1);
+ report_int(mvwgetch(win, y, x));
+}
+
+
+void
+cmd_mvwgetnstr(int nargs, char **args)
+{
+ int y, x, count;
+ char *string;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc(count + 1)) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvwgetnstr(win, y, x, string, count));
+ report_status(string);
+ free(string);
+}
+
+
+void
+cmd_mvwgetstr(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+ char string[256];
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(mvwgetstr(win, y, x, string));
+ report_status(string);
+}
+
+
+void
+cmd_mvwinch(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(mvwinch(win, y, x));
+}
+
+
+void
+cmd_mvwinsch(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(mvwinsch(win, y, x, args[3][0]));
+}
+
+
+void
+cmd_assume_default_colors(int nargs, char **args)
+{
+ short fore, back;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%hd", &fore) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%hd", &back) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(assume_default_colors(fore, back));
+}
+
+
+void
+cmd_baudrate(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(baudrate());
+}
+
+
+void
+cmd_beep(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(beep());
+}
+
+
+void
+cmd_box(int nargs, char **args)
+{
+ WINDOW *win;
+ chtype *vertical, *horizontal;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ vertical = (chtype *) args[1];
+ horizontal = (chtype *) args[2];
+ report_count(1);
+ report_return(box(win, vertical[0], horizontal[0]));
+}
+
+
+void
+cmd_can_change_color(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(can_change_color());
+}
+
+
+void
+cmd_cbreak(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(cbreak());
+}
+
+
+void
+cmd_clearok(int nargs, char **args)
+{
+ WINDOW *win;
+ int flag;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(clearok(win, flag));
+}
+
+
+void
+cmd_color_content(int nargs, char **args)
+{
+ short colour, red, green, blue;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%hd", &colour) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call4 */
+ report_count(4);
+ report_return(color_content(colour, &red, &green, &blue));
+ report_int(red);
+ report_int(green);
+ report_int(blue);
+}
+
+
+void
+cmd_copywin(int nargs, char **args)
+{
+ int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, ovlay;
+ WINDOW *source, *destination;
+
+ if (check_arg_count(nargs, 9) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &source) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%p", &destination) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &sminrow) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &smincol) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &dminrow) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[5], "%d", &dmincol) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[6], "%d", &dmaxrow) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[7], "%d", &dmaxcol) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[8], "%d", &ovlay) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(copywin(source, destination, sminrow, smincol, dminrow,
+ dmincol, dmaxrow, dmaxcol, ovlay));
+}
+
+
+void
+cmd_curs_set(int nargs, char **args)
+{
+ int vis;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &vis) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(curs_set(vis));
+}
+
+
+void
+cmd_def_prog_mode(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(def_prog_mode());
+}
+
+
+void
+cmd_def_shell_mode(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(def_shell_mode());
+}
+
+
+void
+cmd_define_key(int nargs, char **args)
+{
+ int symbol;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[1], "%d", &symbol) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(define_key(args[0], symbol));
+}
+
+
+void
+cmd_delay_output(int nargs, char **args)
+{
+ int dtime;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &dtime) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(delay_output(dtime));
+}
+
+
+void
+cmd_delscreen(int nargs, char **args)
+{
+ SCREEN *scrn;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &scrn) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ delscreen(scrn); /* void return */
+ report_count(1);
+ report_return(OK);
+}
+
+
+void
+cmd_delwin(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(delwin(win));
+}
+
+
+void
+cmd_derwin(int nargs, char **args)
+{
+ int lines, cols, y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &lines) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &cols) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(derwin(win, lines, cols, y, x));
+}
+
+
+void
+cmd_dupwin(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(dupwin(win));
+}
+
+
+void
+cmd_doupdate(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ /* XXX - implicit refresh */
+ report_count(1);
+ report_return(doupdate());
+}
+
+
+void
+cmd_echo(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(echo());
+}
+
+
+void
+cmd_endwin(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(endwin());
+}
+
+
+void
+cmd_erasechar(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(erasechar());
+}
+
+
+void
+cmd_flash(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(flash());
+}
+
+
+void
+cmd_flushinp(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(flushinp());
+}
+
+
+void
+cmd_flushok(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(flushok(win, flag));
+}
+
+
+void
+cmd_fullname(int nargs, char **args)
+{
+ char string[256];
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ /* XXX - call2 */
+ report_count(2);
+ report_status(fullname(args[0], string));
+ report_status(string);
+}
+
+
+void
+cmd_getattrs(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getattrs(win));
+}
+
+
+void
+cmd_getbkgd(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_byte(getbkgd(win));
+}
+
+
+void
+cmd_getcury(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getcury(win));
+}
+
+
+void
+cmd_getcurx(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getcurx(win));
+}
+
+
+void
+cmd_getyx(int nargs, char **args)
+{
+ WINDOW *win;
+ int y, x;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ getyx(win, y, x);
+ report_count(2);
+ report_int(y);
+ report_int(x);
+}
+
+
+void
+cmd_getbegy(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getbegy(win));
+}
+
+
+void
+cmd_getbegx(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getbegx(win));
+}
+
+
+void
+cmd_getmaxy(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getmaxy(win));
+}
+
+
+void
+cmd_getmaxx(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getmaxx(win));
+}
+
+
+void
+cmd_getpary(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getpary(win));
+}
+
+
+void
+cmd_getparx(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(getparx(win));
+}
+
+
+void
+cmd_getparyx(int nargs, char **args)
+{
+ WINDOW *win;
+ int y, x;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(2);
+ getparyx(win, y, x);
+ report_int(y);
+ report_int(x);
+}
+
+
+void
+cmd_gettmode(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(gettmode());
+}
+
+
+void
+cmd_getwin(int nargs, char **args)
+{
+ FILE *fp;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if ((fp = fopen(args[0], "r")) == NULL) {
+ report_count(1);
+ report_error("BAD FILE_ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(getwin(fp));
+ fclose(fp);
+}
+
+
+void
+cmd_halfdelay(int nargs, char **args)
+{
+ int ms;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &ms) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(halfdelay(ms));
+}
+
+
+void
+cmd_has_colors(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(has_colors());
+}
+
+
+void
+cmd_has_ic(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(has_ic());
+}
+
+
+void
+cmd_has_il(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(has_il());
+}
+
+
+void
+cmd_hline(int nargs, char **args)
+{
+ int count;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ ch = (chtype *) args[0];
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(hline(ch[0], count));
+}
+
+
+void
+cmd_idcok(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(idcok(win, flag));
+}
+
+
+void
+cmd_idlok(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(idlok(win, flag));
+}
+
+
+void
+cmd_init_color(int nargs, char **args)
+{
+ short colour, red, green, blue;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%hd", &colour) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%hd", &red) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%hd", &green) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%hd", &blue) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(init_color(colour, red, green, blue));
+}
+
+
+void
+cmd_init_pair(int nargs, char **args)
+{
+ short pair, fore, back;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%hd", &pair) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%hd", &fore) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%hd", &back) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(init_pair(pair, fore, back));
+}
+
+
+void
+cmd_initscr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_ptr(initscr());
+}
+
+
+void
+cmd_intrflush(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(intrflush(win, flag));
+}
+
+
+void
+cmd_isendwin(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(isendwin());
+}
+
+
+void
+cmd_is_linetouched(int nargs, char **args)
+{
+ int line;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &line) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(is_linetouched(win, line));
+}
+
+
+void
+cmd_is_wintouched(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(is_wintouched(win));
+}
+
+
+void
+cmd_keyok(int nargs, char **args)
+{
+ int keysym, flag;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &keysym) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(keyok(keysym, flag));
+}
+
+
+void
+cmd_keypad(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(keypad(win, flag));
+}
+
+
+void
+cmd_keyname(int nargs, char **args)
+{
+ unsigned int key;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &key) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_status(keyname(key));
+}
+
+
+void
+cmd_killchar(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(killchar());
+}
+
+
+void
+cmd_leaveok(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(leaveok(win, flag));
+}
+
+
+void
+cmd_meta(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(meta(win, flag));
+}
+
+
+void
+cmd_mvcur(int nargs, char **args)
+{
+ int oldy, oldx, y, x;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &oldy) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &oldx) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvcur(oldy, oldx, y, x));
+}
+
+
+void
+cmd_mvderwin(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvderwin(win, y, x));
+}
+
+
+void
+cmd_mvhline(int nargs, char **args)
+{
+ int y, x, n;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ ch = (chtype *) args[2];
+
+ if (sscanf(args[3], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvhline(y, x, ch[0], n));
+}
+
+
+void
+cmd_mvprintw(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvprintw(y, x, args[2], args[3]));
+}
+
+
+void
+cmd_mvscanw(int nargs, char **args)
+{
+ int y, x;
+ char string[256];
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(mvscanw(y, x, args[2], &string));
+ report_status(string);
+}
+
+
+void
+cmd_mvvline(int nargs, char **args)
+{
+ int y, x, n;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ ch = (chtype *) args[2];
+
+ if (sscanf(args[3], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvvline(y, x, ch[0], n));
+}
+
+
+void
+cmd_mvwhline(int nargs, char **args)
+{
+ int y, x, ch, n;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &ch) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwhline(win, y, x, ch, n));
+}
+
+
+void
+cmd_mvwvline(int nargs, char **args)
+{
+ int y, x, n;
+ WINDOW *win;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ ch = (chtype *) args[3];
+
+ if (sscanf(args[4], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwvline(win, y, x, ch[0], n));
+}
+
+
+void
+cmd_mvwin(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwin(win, y, x));
+}
+
+
+void
+cmd_mvwinchnstr(int nargs, char **args)
+{
+ int y, x, count;
+ chtype *string;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvwinchnstr(win, y, x, string, count));
+ report_nstr(string);
+ free(string);
+}
+
+
+void
+cmd_mvwinchstr(int nargs, char **args)
+{
+ int y, x;
+ chtype string[256];
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvwinchstr(win, y, x, string));
+ report_nstr(string);
+}
+
+
+void
+cmd_mvwinnstr(int nargs, char **args)
+{
+ int y, x, count;
+ char *string;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((string = malloc(count + 1)) == NULL) {
+ report_count(1);
+ report_error("MALLOC_FAILED");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvwinnstr(win, y, x, string, count));
+ report_status(string);
+ free(string);
+}
+
+
+void
+cmd_mvwinstr(int nargs, char **args)
+{
+ int y, x;
+ char string[256];
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(mvwinstr(win, y, x, string));
+ report_status(string);
+}
+
+
+void
+cmd_mvwprintw(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwprintw(win, y, x, args[3], args[4]));
+}
+
+
+void
+cmd_mvwscanw(int nargs, char **args)
+{
+ int y, x;
+ WINDOW *win;
+ char string[256];
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_int(mvwscanw(win, y, x, args[3], &string));
+ report_status(string);
+}
+
+
+void
+cmd_napms(int nargs, char **args)
+{
+ int naptime;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &naptime) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(napms(naptime));
+}
+
+
+void
+cmd_newpad(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(newpad(y, x));
+}
+
+
+void
+cmd_newterm(int nargs, char **args)
+{
+ FILE *in, *out;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if ((in = fopen(args[1], "rw")) == NULL) {
+ report_count(1);
+ report_error("BAD FILE_ARGUMENT");
+ return;
+ }
+
+
+ if ((out = fopen(args[2], "rw")) == NULL) {
+ report_count(1);
+ report_error("BAD FILE_ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(newterm(args[0], out, in));
+}
+
+
+void
+cmd_newwin(int nargs, char **args)
+{
+ int lines, cols, begin_y, begin_x;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &lines) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &cols) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &begin_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &begin_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(newwin(lines, cols, begin_y, begin_x));
+}
+
+
+void
+cmd_nl(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(nl());
+}
+
+
+void
+cmd_no_color_attributes(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(no_color_attributes());
+}
+
+
+void
+cmd_nocbreak(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(nocbreak());
+}
+
+
+void
+cmd_nodelay(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(nodelay(win, flag));
+}
+
+
+void
+cmd_noecho(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(noecho());
+}
+
+
+void
+cmd_nonl(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(nonl());
+}
+
+
+void
+cmd_noqiflush(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ noqiflush();
+ report_count(1);
+ report_return(OK); /* fake a return, the call returns void */
+}
+
+
+void
+cmd_noraw(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(noraw());
+}
+
+
+void
+cmd_notimeout(int nargs, char **args)
+{
+ int flag;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(notimeout(win, flag));
+}
+
+
+void
+cmd_overlay(int nargs, char **args)
+{
+ WINDOW *source, *dest;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &source) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%p", &dest) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(overlay(source, dest));
+}
+
+
+void
+cmd_overwrite(int nargs, char **args)
+{
+ WINDOW *source, *dest;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &source) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%p", &dest) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(overwrite(source, dest));
+}
+
+
+void
+cmd_pair_content(int nargs, char **args)
+{
+ short pair, fore, back;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%hd", &pair) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call3 */
+ report_count(3);
+ report_return(pair_content(pair, &fore, &back));
+ report_int(fore);
+ report_int(back);
+}
+
+
+void
+cmd_pechochar(int nargs, char **args)
+{
+ int ch;
+ WINDOW *pad;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &pad) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &ch) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(pechochar(pad, ch));
+}
+
+
+void
+cmd_pnoutrefresh(int nargs, char **args)
+{
+ int pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y, smax_x;
+ WINDOW *pad;
+
+ if (check_arg_count(nargs, 7) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &pad) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &pbeg_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &pbeg_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &sbeg_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &sbeg_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[5], "%d", &smax_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[6], "%d", &smax_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(pnoutrefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
+ smax_x));
+}
+
+
+void
+cmd_prefresh(int nargs, char **args)
+{
+ int pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y, smax_x;
+ WINDOW *pad;
+
+ if (check_arg_count(nargs, 7) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &pad) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &pbeg_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &pbeg_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &sbeg_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &sbeg_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[5], "%d", &smax_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[6], "%d", &smax_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX causes refresh */
+ report_count(1);
+ report_return(prefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
+ smax_x));
+
+}
+
+
+void
+cmd_printw(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+
+ report_count(1);
+ report_return(printw(args[0], args[1]));
+}
+
+
+void
+cmd_putwin(int nargs, char **args)
+{
+ FILE *fp;
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if ((fp = fopen(args[1], "rw")) == NULL) {
+ report_count(1);
+ report_error("BAD FILE_ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(putwin(win, fp));
+}
+
+
+void
+cmd_qiflush(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ qiflush();
+ report_count(1);
+ report_return(OK); /* fake a return because call returns void */
+}
+
+
+void
+cmd_raw(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(raw());
+}
+
+
+void
+cmd_redrawwin(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(redrawwin(win));
+}
+
+
+void
+cmd_reset_prog_mode(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(reset_prog_mode());
+}
+
+
+void
+cmd_reset_shell_mode(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(reset_shell_mode());
+}
+
+
+void
+cmd_resetty(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(resetty());
+}
+
+
+void
+cmd_resizeterm(int nargs, char **args)
+{
+ int rows, cols;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &rows) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &cols) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(resizeterm(rows, cols));
+}
+
+
+void
+cmd_savetty(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(savetty());
+}
+
+
+void
+cmd_scanw(int nargs, char **args)
+{
+ char string[256];
+
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ /* XXX call2 */
+ report_count(2);
+ report_return(scanw("%s", string));
+ report_status(string);
+}
+
+
+void
+cmd_scroll(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(scroll(win));
+}
+
+
+void
+cmd_scrollok(int nargs, char **args)
+{
+ WINDOW *win;
+ int flag;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &flag) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(scrollok(win, flag));
+}
+
+
+void
+cmd_setterm(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_return(setterm(args[0]));
+}
+
+
+void
+cmd_set_term(int nargs, char **args)
+{
+ SCREEN *scrn;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &scrn) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(set_term(scrn));
+}
+
+
+void
+cmd_start_color(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(start_color());
+}
+
+
+void
+cmd_subpad(int nargs, char **args)
+{
+ WINDOW *pad;
+ int lines, cols, begin_y, begin_x;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &pad) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &lines) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &cols) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &begin_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &begin_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(subpad(pad, lines, cols, begin_y, begin_x));
+}
+
+
+void
+cmd_subwin(int nargs, char **args)
+{
+ WINDOW *win;
+ int lines, cols, begin_y, begin_x;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &lines) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &cols) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &begin_y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &begin_x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_ptr(subwin(win, lines, cols, begin_y, begin_x));
+}
+
+
+void
+cmd_termattrs(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(termattrs());
+}
+
+
+void
+cmd_term_attrs(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_int(term_attrs());
+}
+
+
+void
+cmd_touchline(int nargs, char **args)
+{
+ WINDOW *win;
+ int start, count;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &start) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(touchline(win, start, count));
+}
+
+
+void
+cmd_touchoverlap(int nargs, char **args)
+{
+ WINDOW *win1, *win2;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win1) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%p", &win2) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(touchoverlap(win1, win2));
+}
+
+
+void
+cmd_touchwin(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(touchwin(win));
+}
+
+
+void
+cmd_ungetch(int nargs, char **args)
+{
+ int ch;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &ch) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(ungetch(ch));
+}
+
+
+void
+cmd_untouchwin(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(untouchwin(win));
+}
+
+
+void
+cmd_use_default_colors(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ report_count(1);
+ report_return(use_default_colors());
+}
+
+
+void
+cmd_vline(int nargs, char **args)
+{
+ int count;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ ch = (chtype *) args[0];
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(vline(ch[0], count));
+}
+
+
+static int
+internal_vw_printw(WINDOW *win, char *arg1, ...)
+{
+ va_list va;
+ int rv;
+
+ va_start(va, arg1);
+ rv = vw_printw(win, arg1, va);
+ va_end(va);
+
+ return rv;
+}
+
+void
+cmd_vw_printw(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(internal_vw_printw(win, args[1], args[2]));
+}
+
+
+static int
+internal_vw_scanw(WINDOW *win, char *arg1, ...)
+{
+ va_list va;
+ int rv;
+
+ va_start(va, arg1);
+ rv = vw_scanw(win, arg1, va);
+ va_end(va);
+
+ return rv;
+}
+
+void
+cmd_vw_scanw(int nargs, char **args)
+{
+ WINDOW *win;
+ char string[256];
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_int(internal_vw_scanw(win, args[1], string));
+ report_status(string);
+}
+
+
+void
+cmd_vwprintw(int nargs, char **args)
+{
+ cmd_vw_printw(nargs, args);
+}
+
+
+void
+cmd_vwscanw(int nargs, char **args)
+{
+ cmd_vw_scanw(nargs, args);
+}
+
+
+void
+cmd_waddch(int nargs, char **args)
+{
+ WINDOW *win;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ ch = (chtype *) args[1];
+
+ report_count(1);
+ report_return(waddch(win, ch[0]));
+}
+
+
+void
+cmd_waddchnstr(int nargs, char **args)
+{
+ WINDOW *win;
+ int count;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(waddchnstr(win, (chtype *) args[1], count));
+}
+
+
+void
+cmd_waddchstr(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(waddchstr(win, (chtype *) args[1]));
+}
+
+
+void
+cmd_waddnstr(int nargs, char **args)
+{
+ WINDOW *win;
+ int count;
+
+ if (check_arg_count(nargs, 1) == 3)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(waddnstr(win, args[1], count));
+
+}
+
+
+void
+cmd_wattr_get(int nargs, char **args)
+{
+ WINDOW *win;
+ int attr;
+ short pair;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call3 */
+ report_count(3);
+ report_return(wattr_get(win, &attr, &pair, NULL));
+ report_int(attr);
+ report_int(pair);
+}
+
+
+void
+cmd_wattr_off(int nargs, char **args)
+{
+ WINDOW *win;
+ int attr;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wattr_off(win, attr, NULL));
+}
+
+
+void
+cmd_wattr_on(int nargs, char **args)
+{
+ WINDOW *win;
+ int attr;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wattr_on(win, attr, NULL));
+}
+
+
+void
+cmd_wattr_set(int nargs, char **args)
+{
+ WINDOW *win;
+ int attr;
+ short pair;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%hd", &pair) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wattr_set(win, attr, pair, NULL));
+}
+
+
+void
+cmd_wattroff(int nargs, char **args)
+{
+ WINDOW *win;
+ int attr;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wattroff(win, attr));
+}
+
+
+void
+cmd_wattron(int nargs, char **args)
+{
+ WINDOW *win;
+ int attr;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wattron(win, attr));
+}
+
+
+void
+cmd_wattrset(int nargs, char **args)
+{
+ WINDOW *win;
+ int attr;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wattrset(win, attr));
+}
+
+
+void
+cmd_wbkgd(int nargs, char **args)
+{
+ WINDOW *win;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ ch = (chtype *) args[1];
+ report_count(1);
+ report_return(wbkgd(win, ch[0]));
+}
+
+
+void
+cmd_wbkgdset(int nargs, char **args)
+{
+ WINDOW *win;
+ int ch;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &ch) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ wbkgdset(win, ch); /* void return */
+ report_count(1);
+ report_return(OK);
+}
+
+
+void
+cmd_wborder(int nargs, char **args)
+{
+ WINDOW *win;
+ int ls, rs, ts, bs, tl, tr, bl, br;
+
+ if (check_arg_count(nargs, 9) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &ls) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &rs) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &ts) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &bs) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[5], "%d", &tl) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[6], "%d", &tr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[7], "%d", &bl) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[8], "%d", &br) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wborder(win, ls, rs, ts, bs, tl, tr, bl, br));
+}
+
+
+void
+cmd_wclear(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wclear(win));
+}
+
+
+void
+cmd_wclrtobot(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wclrtobot(win));
+}
+
+
+void
+cmd_wclrtoeol(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wclrtoeol(win));
+
+}
+
+
+void
+cmd_wcolor_set(int nargs, char **args)
+{
+ WINDOW *win;
+ short pair;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%hd", &pair) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wcolor_set(win, pair, NULL));
+}
+
+
+void
+cmd_wdelch(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wdelch(win));
+}
+
+
+void
+cmd_wdeleteln(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wdeleteln(win));
+
+}
+
+
+void
+cmd_wechochar(int nargs, char **args)
+{
+ WINDOW *win;
+ int ch;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &ch) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wechochar(win, ch));
+}
+
+
+void
+cmd_werase(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(werase(win));
+}
+
+
+void
+cmd_wgetch(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(wgetch(win));
+}
+
+
+void
+cmd_wgetnstr(int nargs, char **args)
+{
+ WINDOW *win;
+ int count;
+ char string[256];
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(wgetnstr(win, string, count));
+ report_status(string);
+}
+
+
+void
+cmd_wgetstr(int nargs, char **args)
+{
+ WINDOW *win;
+ char string[256];
+
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ string[0] = '\0';
+
+ report_count(2);
+ report_return(wgetstr(win, string));
+ report_status(string);
+}
+
+
+void
+cmd_whline(int nargs, char **args)
+{
+ WINDOW *win;
+ int ch, count;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &ch) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(whline(win, ch, count));
+}
+
+
+void
+cmd_winch(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_int(winch(win));
+}
+
+
+void
+cmd_winchnstr(int nargs, char **args)
+{
+ WINDOW *win;
+ chtype string[256];
+ int count;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(winchnstr(win, string, count));
+ report_nstr(string);
+}
+
+
+void
+cmd_winchstr(int nargs, char **args)
+{
+ WINDOW *win;
+ chtype string[256];
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(winchstr(win, string));
+ report_nstr(string);
+}
+
+
+void
+cmd_winnstr(int nargs, char **args)
+{
+ WINDOW *win;
+ char string[256];
+ int count;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(winnstr(win, string, count));
+ report_status(string);
+}
+
+
+void
+cmd_winsch(int nargs, char **args)
+{
+ WINDOW *win;
+ int ch;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &ch) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(winsch(win, ch));
+}
+
+
+void
+cmd_winsdelln(int nargs, char **args)
+{
+ WINDOW *win;
+ int count;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &count) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(winsdelln(win, count));
+}
+
+
+void
+cmd_winsertln(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(winsertln(win));
+}
+
+
+void
+cmd_winstr(int nargs, char **args)
+{
+ WINDOW *win;
+ char string[256];
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(winstr(win, string));
+ report_status(string);
+}
+
+
+void
+cmd_wmove(int nargs, char **args)
+{
+ WINDOW *win;
+ int y, x;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wmove(win, y, x));
+}
+
+
+void
+cmd_wnoutrefresh(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wnoutrefresh(win));
+}
+
+
+void
+cmd_wprintw(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wprintw(win, args[1], args[2]));
+}
+
+
+void
+cmd_wredrawln(int nargs, char **args)
+{
+ WINDOW *win;
+ int beg_line, num_lines;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &beg_line) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &num_lines) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wredrawln(win, beg_line, num_lines));
+}
+
+
+void
+cmd_wrefresh(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* XXX - generates output */
+ report_count(1);
+ report_return(wrefresh(win));
+}
+
+
+void
+cmd_wresize(int nargs, char **args)
+{
+ WINDOW *win;
+ int lines, cols;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &lines) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &cols) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wresize(win, lines, cols));
+}
+
+
+void
+cmd_wscanw(int nargs, char **args)
+{
+ WINDOW *win;
+ char string[256];
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wscanw(win, args[1], &string));
+}
+
+
+void
+cmd_wscrl(int nargs, char **args)
+{
+ WINDOW *win;
+ int n;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wscrl(win, n));
+}
+
+
+void
+cmd_wsetscrreg(int nargs, char **args)
+{
+ WINDOW *win;
+ int top, bottom;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &top) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &bottom) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wsetscrreg(win, top, bottom));
+}
+
+
+void
+cmd_wstandend(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wstandend(win));
+}
+
+
+void
+cmd_wstandout(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wstandout(win));
+}
+
+
+void
+cmd_wtimeout(int nargs, char **args)
+{
+ WINDOW *win;
+ int tval;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &tval) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ wtimeout(win, tval); /* void return */
+ report_count(1);
+ report_return(OK);
+}
+
+
+void
+cmd_wtouchln(int nargs, char **args)
+{
+ WINDOW *win;
+ int line, n, changed;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &line) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &changed) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wtouchln(win, line, n, changed));
+}
+
+
+void
+cmd_wunderend(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wunderend(win));
+}
+
+
+void
+cmd_wunderscore(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wunderscore(win));
+}
+
+
+void
+cmd_wvline(int nargs, char **args)
+{
+ WINDOW *win;
+ int n;
+ chtype *ch;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ ch = (chtype *) args[1];
+
+ if (sscanf(args[2], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wvline(win, ch[0], n));
+}
+
+
+void
+cmd_insnstr(int nargs, char **args)
+{
+ int n;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[1], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(insnstr(args[0], n));
+}
+
+
+void
+cmd_insstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_return(insstr(args[0]));
+}
+
+
+void
+cmd_mvinsnstr(int nargs, char **args)
+{
+ int y, x, n;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvinsnstr(y, x, args[2], n));
+}
+
+
+void
+cmd_mvinsstr(int nargs, char **args)
+{
+ int y, x;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvinsstr(y, x, args[2]));
+}
+
+
+void
+cmd_mvwinsnstr(int nargs, char **args)
+{
+ WINDOW *win;
+ int y, x, n;
+
+ if (check_arg_count(nargs, 5) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwinsnstr(win, y, x, args[3], n));
+
+}
+
+
+void
+cmd_mvwinsstr(int nargs, char **args)
+{
+ WINDOW *win;
+ int y, x;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwinsstr(win, y, x, args[3]));
+}
+
+
+void
+cmd_winsnstr(int nargs, char **args)
+{
+ WINDOW *win;
+ int n;
+
+ if (check_arg_count(nargs, 3) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(winsnstr(win, args[1], n));
+}
+
+
+void
+cmd_winsstr(int nargs, char **args)
+{
+ WINDOW *win;
+
+ if (check_arg_count(nargs, 2) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(winsstr(win, args[1]));
+}
+
+
+
+void
+cmd_chgat(int nargs, char **args)
+{
+ int n, attr, colour;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &colour) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ /* Note: 4th argument unused in current curses implementation */
+ report_count(1);
+ report_return(chgat(n, attr, colour, NULL));
+}
+
+
+void
+cmd_wchgat(int nargs, char **args)
+{
+ WINDOW *win;
+ int n, attr;
+ short colour;
+
+ if (check_arg_count(nargs, 4) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%hd", &colour) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(wchgat(win, n, attr, colour, NULL));
+}
+
+
+void
+cmd_mvchgat(int nargs, char **args)
+{
+ int y, x, n, attr;
+ short colour;
+
+ if (check_arg_count(nargs, 6) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%hd", &colour) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvchgat(y, x, n, attr, colour, NULL));
+}
+
+
+void
+cmd_mvwchgat(int nargs, char **args)
+{
+ WINDOW *win;
+ int y, x, n, attr, colour;
+
+ if (check_arg_count(nargs, 6) == 1)
+ return;
+
+ if (sscanf(args[0], "%p", &win) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[1], "%d", &y) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[2], "%d", &x) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[3], "%d", &n) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[4], "%d", &attr) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ if (sscanf(args[5], "%d", &colour) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_return(mvwchgat(win, y, x, n, attr, colour, NULL));
+}
+
+
+void
+cmd_add_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wadd_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvadd_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwadd_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+void
+cmd_add_wchnstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_add_wchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wadd_wchnstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wadd_wchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvadd_wchnstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvadd_wchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwadd_wchnstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwadd_wchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+void
+cmd_addnwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_addwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvaddnwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvaddwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwaddnwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwaddwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_waddnwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_waddwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+void
+cmd_echo_wchar(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wecho_wchar(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_pecho_wchar(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+/* insert */
+void
+cmd_ins_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wins_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvins_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwins_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+void
+cmd_ins_nwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_ins_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvins_nwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvins_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwins_nwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwins_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wins_nwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wins_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+/* input */
+void
+cmd_get_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_unget_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvget_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwget_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wget_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+void
+cmd_getn_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_get_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvgetn_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvget_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwgetn_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwget_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wgetn_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wget_wstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+void
+cmd_in_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvin_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwin_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_win_wch(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+void
+cmd_in_wchnstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_in_wchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvin_wchnstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvin_wchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwin_wchnstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwin_wchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_win_wchnstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_win_wchstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+void
+cmd_innwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_inwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvinnwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvinwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwinnwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwinwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_winnwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_winwstr(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+/* cchar handlgin */
+void
+cmd_setcchar(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_getcchar(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+
+/* misc */
+void
+cmd_key_name(int nargs, char **args)
+{
+ int w;
+
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ if (sscanf(args[0], "%d", &w) == 0) {
+ report_count(1);
+ report_error("BAD ARGUMENT");
+ return;
+ }
+
+ report_count(1);
+ report_status(key_name(w));
+}
+
+
+void
+cmd_border_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wborder_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_box_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_erasewchar(int nargs, char **args)
+{
+ wchar_t ch;
+
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(erasewchar(&ch));
+ report_int(ch);
+}
+
+
+void
+cmd_killwchar(int nargs, char **args)
+{
+ wchar_t ch;
+
+ if (check_arg_count(nargs, 0) == 1)
+ return;
+
+ /* XXX - call2 */
+ report_count(2);
+ report_return(erasewchar(&ch));
+ report_int(ch);
+}
+
+
+void
+cmd_hline_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvhline_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvvline_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwhline_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_mvwvline_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_vline_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_whline_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wvline_set(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_bkgrnd(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_bkgrndset(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_getbkgrnd(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wbkgrnd(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wbkgrndset(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
+
+
+void
+cmd_wgetbkgrnd(int nargs, char **args)
+{
+ if (check_arg_count(nargs, 1) == 1)
+ return;
+
+ report_count(1);
+ report_error("UNSUPPORTED");
+}
diff --git a/contrib/netbsd-tests/lib/libcurses/slave/curses_commands.h b/contrib/netbsd-tests/lib/libcurses/slave/curses_commands.h
new file mode 100644
index 0000000..d7f2ad7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/slave/curses_commands.h
@@ -0,0 +1,422 @@
+/* $NetBSD: curses_commands.h,v 1.3 2011/09/15 11:46:19 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+
+#ifndef _CURSES_COMMANDS_H_
+#define _CURSES_COMMANDS_H_
+
+struct command_def {
+ const char *name;
+ void (*func)(int, char **);
+};
+
+/*
+ * prototypes for test commands
+ */
+void cmd_DRAIN(int, char **); /* not a curses function */
+
+void cmd_addbytes(int, char **);
+void cmd_addch(int, char **);
+void cmd_addchnstr(int, char **);
+void cmd_addchstr(int, char **);
+void cmd_addnstr(int, char **);
+void cmd_addstr(int, char **);
+void cmd_attr_get(int, char **);
+void cmd_attr_off(int, char **);
+void cmd_attr_on(int, char **);
+void cmd_attr_set(int, char **);
+void cmd_attroff(int, char **);
+void cmd_attron(int, char **);
+void cmd_attrset(int, char **);
+void cmd_bkgd(int, char **);
+void cmd_bkgdset(int, char **);
+void cmd_border(int, char **);
+void cmd_clear(int, char **);
+void cmd_clrtobot(int, char **);
+void cmd_clrtoeol(int, char **);
+void cmd_color_set(int, char **);
+void cmd_delch(int, char **);
+void cmd_deleteln(int, char **);
+void cmd_echochar(int, char **);
+void cmd_erase(int, char **);
+void cmd_getch(int, char **);
+void cmd_getnstr(int, char **);
+void cmd_getstr(int, char **);
+void cmd_inch(int, char **);
+void cmd_inchnstr(int, char **);
+void cmd_inchstr(int, char **);
+void cmd_innstr(int, char **);
+void cmd_insch(int, char **);
+void cmd_insdelln(int, char **);
+void cmd_insertln(int, char **);
+void cmd_instr(int, char **);
+void cmd_move(int, char **);
+void cmd_refresh(int, char **);
+void cmd_scrl(int, char **);
+void cmd_setscrreg(int, char **);
+void cmd_standend(int, char **);
+void cmd_standout(int, char **);
+void cmd_timeout(int, char **);
+void cmd_underscore(int, char **);
+void cmd_underend(int, char **);
+void cmd_waddbytes(int, char **);
+void cmd_waddstr(int, char **);
+void cmd_mvaddbytes(int, char **);
+void cmd_mvaddch(int, char **);
+void cmd_mvaddchnstr(int, char **);
+void cmd_mvaddchstr(int, char **);
+void cmd_mvaddnstr(int, char **);
+void cmd_mvaddstr(int, char **);
+void cmd_mvdelch(int, char **);
+void cmd_mvgetch(int, char **);
+void cmd_mvgetnstr(int, char **);
+void cmd_mvgetstr(int, char **);
+void cmd_mvinch(int, char **);
+void cmd_mvinchnstr(int, char **);
+void cmd_mvinchstr(int, char **);
+void cmd_mvinnstr(int, char **);
+void cmd_mvinsch(int, char **);
+void cmd_mvinstr(int, char **);
+
+void cmd_mvwaddbytes(int, char **);
+void cmd_mvwaddch(int, char **);
+void cmd_mvwaddchnstr(int, char **);
+void cmd_mvwaddchstr(int, char **);
+void cmd_mvwaddnstr(int, char **);
+void cmd_mvwaddstr(int, char **);
+void cmd_mvwdelch(int, char **);
+void cmd_mvwgetch(int, char **);
+void cmd_mvwgetnstr(int, char **);
+void cmd_mvwgetstr(int, char **);
+void cmd_mvwinch(int, char **);
+void cmd_mvwinsch(int, char **);
+void cmd_assume_default_colors(int, char **);
+void cmd_baudrate(int, char **);
+void cmd_beep(int, char **);
+void cmd_box(int, char **);
+void cmd_can_change_color(int, char **);
+void cmd_cbreak(int, char **);
+void cmd_chgat(int, char **);
+void cmd_clearok(int, char **);
+void cmd_color_content(int, char **);
+void cmd_copywin(int, char **);
+void cmd_curs_set(int, char **);
+void cmd_def_prog_mode(int, char **);
+void cmd_def_shell_mode(int, char **);
+void cmd_define_key(int, char **);
+void cmd_delay_output(int, char **);
+void cmd_delscreen(int, char **);
+void cmd_delwin(int, char **);
+void cmd_derwin(int, char **);
+void cmd_dupwin(int, char **);
+void cmd_doupdate(int, char **);
+void cmd_echo(int, char **);
+void cmd_endwin(int, char **);
+void cmd_erasechar(int, char **);
+void cmd_flash(int, char **);
+void cmd_flushinp(int, char **);
+void cmd_flushok(int, char **);
+void cmd_fullname(int, char **);
+void cmd_getattrs(int, char **);
+void cmd_getbkgd(int, char **);
+void cmd_getcury(int, char **);
+void cmd_getcurx(int, char **);
+void cmd_getyx(int, char **);
+void cmd_getbegy(int, char **);
+void cmd_getbegx(int, char **);
+void cmd_getmaxy(int, char **);
+void cmd_getmaxx(int, char **);
+void cmd_getpary(int, char **);
+void cmd_getparx(int, char **);
+void cmd_getparyx(int, char **);
+void cmd_gettmode(int, char **);
+void cmd_getwin(int, char **);
+void cmd_halfdelay(int, char **);
+void cmd_has_colors(int, char **);
+void cmd_has_ic(int, char **);
+void cmd_has_il(int, char **);
+void cmd_hline(int, char **);
+void cmd_idcok(int, char **);
+void cmd_idlok(int, char **);
+void cmd_init_color(int, char **);
+void cmd_init_pair(int, char **);
+void cmd_initscr(int, char **);
+void cmd_intrflush(int, char **);
+void cmd_isendwin(int, char **);
+void cmd_is_linetouched(int, char **);
+void cmd_is_wintouched(int, char **);
+void cmd_keyok(int, char **);
+void cmd_keypad(int, char **);
+void cmd_keyname(int, char **);
+void cmd_killchar(int, char **);
+void cmd_leaveok(int, char **);
+void cmd_meta(int, char **);
+void cmd_mvchgat(int, char **);
+void cmd_mvcur(int, char **);
+void cmd_mvderwin(int, char **);
+void cmd_mvhline(int, char **);
+void cmd_mvprintw(int, char **);
+void cmd_mvscanw(int, char **);
+void cmd_mvvline(int, char **);
+void cmd_mvwchgat(int, char **);
+void cmd_mvwhline(int, char **);
+void cmd_mvwvline(int, char **);
+void cmd_mvwin(int, char **);
+void cmd_mvwinchnstr(int, char **);
+void cmd_mvwinchstr(int, char **);
+void cmd_mvwinnstr(int, char **);
+void cmd_mvwinstr(int, char **);
+void cmd_mvwprintw(int, char **);
+void cmd_mvwscanw(int, char **);
+void cmd_napms(int, char **);
+void cmd_newpad(int, char **);
+void cmd_newterm(int, char **);
+void cmd_newwin(int, char **);
+void cmd_nl(int, char **);
+void cmd_no_color_attributes(int, char **);
+void cmd_nocbreak(int, char **);
+void cmd_nodelay(int, char **);
+void cmd_noecho(int, char **);
+void cmd_nonl(int, char **);
+void cmd_noqiflush(int, char **);
+void cmd_noraw(int, char **);
+void cmd_notimeout(int, char **);
+void cmd_overlay(int, char **);
+void cmd_overwrite(int, char **);
+void cmd_pair_content(int, char **);
+void cmd_pechochar(int, char **);
+void cmd_pnoutrefresh(int, char **);
+void cmd_prefresh(int, char **);
+void cmd_printw(int, char **);
+void cmd_putwin(int, char **);
+void cmd_qiflush(int, char **);
+void cmd_raw(int, char **);
+void cmd_redrawwin(int, char **);
+void cmd_reset_prog_mode(int, char **);
+void cmd_reset_shell_mode(int, char **);
+void cmd_resetty(int, char **);
+void cmd_resizeterm(int, char **);
+void cmd_savetty(int, char **);
+void cmd_scanw(int, char **);
+void cmd_scroll(int, char **);
+void cmd_scrollok(int, char **);
+void cmd_setterm(int, char **);
+void cmd_set_term(int, char **);
+void cmd_start_color(int, char **);
+void cmd_subpad(int, char **);
+void cmd_subwin(int, char **);
+void cmd_termattrs(int, char **);
+void cmd_term_attrs(int, char **);
+void cmd_touchline(int, char **);
+void cmd_touchoverlap(int, char **);
+void cmd_touchwin(int, char **);
+void cmd_ungetch(int, char **);
+void cmd_untouchwin(int, char **);
+void cmd_use_default_colors(int, char **);
+void cmd_vline(int, char **);
+void cmd_vw_printw(int, char **);
+void cmd_vw_scanw(int, char **);
+void cmd_vwprintw(int, char **);
+void cmd_vwscanw(int, char **);
+void cmd_waddch(int, char **);
+void cmd_waddchnstr(int, char **);
+void cmd_waddchstr(int, char **);
+void cmd_waddnstr(int, char **);
+void cmd_wattr_get(int, char **);
+void cmd_wattr_off(int, char **);
+void cmd_wattr_on(int, char **);
+void cmd_wattr_set(int, char **);
+void cmd_wattroff(int, char **);
+void cmd_wattron(int, char **);
+void cmd_wattrset(int, char **);
+void cmd_wbkgd(int, char **);
+void cmd_wbkgdset(int, char **);
+void cmd_wborder(int, char **);
+void cmd_wchgat(int, char **);
+void cmd_wclear(int, char **);
+void cmd_wclrtobot(int, char **);
+void cmd_wclrtoeol(int, char **);
+void cmd_wcolor_set(int, char **);
+void cmd_wdelch(int, char **);
+void cmd_wdeleteln(int, char **);
+void cmd_wechochar(int, char **);
+void cmd_werase(int, char **);
+void cmd_wgetch(int, char **);
+void cmd_wgetnstr(int, char **);
+void cmd_wgetstr(int, char **);
+void cmd_whline(int, char **);
+void cmd_winch(int, char **);
+void cmd_winchnstr(int, char **);
+void cmd_winchstr(int, char **);
+void cmd_winnstr(int, char **);
+void cmd_winsch(int, char **);
+void cmd_winsdelln(int, char **);
+void cmd_winsertln(int, char **);
+void cmd_winstr(int, char **);
+void cmd_wmove(int, char **);
+void cmd_wnoutrefresh(int, char **);
+void cmd_wprintw(int, char **);
+void cmd_wredrawln(int, char **);
+void cmd_wrefresh(int, char **);
+void cmd_wresize(int, char **);
+void cmd_wscanw(int, char **);
+void cmd_wscrl(int, char **);
+void cmd_wsetscrreg(int, char **);
+void cmd_wstandend(int, char **);
+void cmd_wstandout(int, char **);
+void cmd_wtimeout(int, char **);
+void cmd_wtouchln(int, char **);
+void cmd_wunderend(int, char **);
+void cmd_wunderscore(int, char **);
+void cmd_wvline(int, char **);
+void cmd_insnstr(int, char **);
+void cmd_insstr(int, char **);
+void cmd_mvinsnstr(int, char **);
+void cmd_mvinsstr(int, char **);
+void cmd_mvwinsnstr(int, char **);
+void cmd_mvwinsstr(int, char **);
+void cmd_winsnstr(int, char **);
+void cmd_winsstr(int, char **);
+
+void cmd_chgat(int, char **);
+void cmd_wchgat(int, char **);
+void cmd_mvchgat(int, char **);
+void cmd_mvwchgat(int, char **);
+void cmd_add_wch(int, char **);
+void cmd_wadd_wch(int, char **);
+void cmd_mvadd_wch(int, char **);
+void cmd_mvwadd_wch(int, char **);
+
+void cmd_add_wchnstr(int, char **);
+void cmd_add_wchstr(int, char **);
+void cmd_wadd_wchnstr(int, char **);
+void cmd_wadd_wchstr(int, char **);
+void cmd_mvadd_wchnstr(int, char **);
+void cmd_mvadd_wchstr(int, char **);
+void cmd_mvwadd_wchnstr(int, char **);
+void cmd_mvwadd_wchstr(int, char **);
+
+void cmd_addnwstr(int, char **);
+void cmd_addwstr(int, char **);
+void cmd_mvaddnwstr(int, char **);
+void cmd_mvaddwstr(int, char **);
+void cmd_mvwaddnwstr(int, char **);
+void cmd_mvwaddwstr(int, char **);
+void cmd_waddnwstr(int, char **);
+void cmd_waddwstr(int, char **);
+
+void cmd_echo_wchar(int, char **);
+void cmd_wecho_wchar(int, char **);
+void cmd_pecho_wchar(int, char **);
+
+/* insert */
+void cmd_ins_wch(int, char **);
+void cmd_wins_wch(int, char **);
+void cmd_mvins_wch(int, char **);
+void cmd_mvwins_wch(int, char **);
+
+void cmd_ins_nwstr(int, char **);
+void cmd_ins_wstr(int, char **);
+void cmd_mvins_nwstr(int, char **);
+void cmd_mvins_wstr(int, char **);
+void cmd_mvwins_nwstr(int, char **);
+void cmd_mvwins_wstr(int, char **);
+void cmd_wins_nwstr(int, char **);
+void cmd_wins_wstr(int, char **);
+
+/* input */
+void cmd_get_wch(int, char **);
+void cmd_unget_wch(int, char **);
+void cmd_mvget_wch(int, char **);
+void cmd_mvwget_wch(int, char **);
+void cmd_wget_wch(int, char **);
+
+void cmd_getn_wstr(int, char **);
+void cmd_get_wstr(int, char **);
+void cmd_mvgetn_wstr(int, char **);
+void cmd_mvget_wstr(int, char **);
+void cmd_mvwgetn_wstr(int, char **);
+void cmd_mvwget_wstr(int, char **);
+void cmd_wgetn_wstr(int, char **);
+void cmd_wget_wstr(int, char **);
+
+void cmd_in_wch(int, char **);
+void cmd_mvin_wch(int, char **);
+void cmd_mvwin_wch(int, char **);
+void cmd_win_wch(int, char **);
+
+void cmd_in_wchnstr(int, char **);
+void cmd_in_wchstr(int, char **);
+void cmd_mvin_wchnstr(int, char **);
+void cmd_mvin_wchstr(int, char **);
+void cmd_mvwin_wchnstr(int, char **);
+void cmd_mvwin_wchstr(int, char **);
+void cmd_win_wchnstr(int, char **);
+void cmd_win_wchstr(int, char **);
+
+void cmd_innwstr(int, char **);
+void cmd_inwstr(int, char **);
+void cmd_mvinnwstr(int, char **);
+void cmd_mvinwstr(int, char **);
+void cmd_mvwinnwstr(int, char **);
+void cmd_mvwinwstr(int, char **);
+void cmd_winnwstr(int, char **);
+void cmd_winwstr(int, char **);
+
+/* cchar handlgin */
+void cmd_setcchar(int, char **);
+void cmd_getcchar(int, char **);
+
+/* misc */
+void cmd_key_name(int, char **);
+void cmd_border_set(int, char **);
+void cmd_wborder_set(int, char **);
+void cmd_box_set(int, char **);
+void cmd_erasewchar(int, char **);
+void cmd_killwchar(int, char **);
+void cmd_hline_set(int, char **);
+void cmd_mvhline_set(int, char **);
+void cmd_mvvline_set(int, char **);
+void cmd_mvwhline_set(int, char **);
+void cmd_mvwvline_set(int, char **);
+void cmd_vline_set(int, char **);
+void cmd_whline_set(int, char **);
+void cmd_wvline_set(int, char **);
+void cmd_bkgrnd(int, char **);
+void cmd_bkgrndset(int, char **);
+void cmd_getbkgrnd(int, char **);
+void cmd_wbkgrnd(int, char **);
+void cmd_wbkgrndset(int, char **);
+void cmd_wgetbkgrnd(int, char **);
+
+
+
+
+#endif /* !_CURSES_COMMAND_H_ */
diff --git a/contrib/netbsd-tests/lib/libcurses/slave/slave.c b/contrib/netbsd-tests/lib/libcurses/slave/slave.c
new file mode 100644
index 0000000..b05a1da
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/slave/slave.c
@@ -0,0 +1,177 @@
+/* $NetBSD: slave.c,v 1.6 2011/09/15 11:46:19 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <curses.h>
+#include "returns.h"
+#include "slave.h"
+
+int cmdpipe[2];
+int slvpipe[2];
+
+#if 0
+static const char *returns_enum_names[] = {
+ "unused", "numeric", "string", "byte", "ERR", "OK", "NULL", "not NULL",
+ "variable"
+};
+#endif
+
+/*
+ * Read the command pipe for the function to execute, gather the args
+ * and then process the command.
+ */
+static void
+process_commands(WINDOW *mainscr)
+{
+ int len, maxlen, argslen, i, ret, type;
+ char *cmdbuf, *tmpbuf, **args, **tmpargs;
+
+ len = maxlen = 30;
+ if ((cmdbuf = malloc(maxlen)) == NULL)
+ err(1, "slave cmdbuf malloc failed");
+
+ while(1) {
+ if (read(cmdpipe[READ_PIPE], &type, sizeof(int)) < 0)
+ err(1, "slave command type read failed");
+
+ if (type != ret_string)
+ errx(1, "Unexpected type for command, got %d", type);
+
+ if (read(cmdpipe[READ_PIPE], &len, sizeof(int)) < 0)
+ err(1, "slave command len read failed");
+
+ if ((len + 1) > maxlen) {
+ maxlen = len + 1;
+ if ((tmpbuf = realloc(cmdbuf, maxlen)) == NULL)
+ err(1, "slave cmdbuf realloc to %d "
+ "bytes failed", maxlen);
+ cmdbuf = tmpbuf;
+ }
+
+ if (read(cmdpipe[READ_PIPE], cmdbuf, len) < 0)
+ err(1, "slave command read failed");
+ cmdbuf[len] = '\0';
+ argslen = 0;
+ args = NULL;
+
+ do {
+ if (read(cmdpipe[READ_PIPE], &type, sizeof(int)) < 0)
+ err(1, "slave arg type read failed");
+
+ if (read(cmdpipe[READ_PIPE], &len, sizeof(int)) < 0)
+ err(1, "slave arg len read failed");
+
+ if (len >= 0) {
+ tmpargs = realloc(args,
+ (argslen + 1) * sizeof(char *));
+ if (tmpargs == NULL)
+ err(1, "slave realloc of args array "
+ "failed");
+
+ args = tmpargs;
+ if (type != ret_null) {
+ args[argslen] = malloc(len + 1);
+
+ if (args[argslen] == NULL)
+ err(1, "slave alloc of %d bytes"
+ " for args failed", len);
+ }
+
+ if (len == 0) {
+ if (type == ret_null)
+ args[argslen] = NULL;
+ else
+ args[argslen][0] = '\0';
+ } else {
+ read(cmdpipe[READ_PIPE], args[argslen],
+ len);
+ if (type != ret_byte)
+ args[argslen][len] = '\0';
+
+ if (len == 6) {
+ if (strcmp(args[argslen],
+ "STDSCR") == 0) {
+ ret = asprintf(&tmpbuf,
+ "%p",
+ stdscr);
+ if (ret < 0)
+ err(2,
+ "asprintf of stdscr failed");
+ free(args[argslen]);
+ args[argslen] = tmpbuf;
+ }
+ }
+ }
+
+ argslen++;
+ }
+ }
+ while(len >= 0);
+
+ command_execute(cmdbuf, argslen, args);
+
+ if (args != NULL) {
+ for (i = 0; i < argslen; i++)
+ free(args[i]);
+
+ free(args);
+ }
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ WINDOW *mainscr;
+
+ if (argc != 5) {
+ fprintf(stderr, "Usage: %s <cmdin> <cmdout> <slvin> slvout>\n",
+ getprogname());
+ return 0;
+ }
+ sscanf(argv[1], "%d", &cmdpipe[0]);
+ sscanf(argv[2], "%d", &cmdpipe[1]);
+ sscanf(argv[3], "%d", &slvpipe[0]);
+ sscanf(argv[4], "%d", &slvpipe[1]);
+
+ mainscr = initscr();
+ if (mainscr == NULL)
+ err(1, "initscr failed");
+
+ process_commands(mainscr);
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libcurses/slave/slave.h b/contrib/netbsd-tests/lib/libcurses/slave/slave.h
new file mode 100644
index 0000000..98e9971
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/slave/slave.h
@@ -0,0 +1,50 @@
+/* $NetBSD: slave.h,v 1.3 2011/09/15 11:46:19 blymn Exp $ */
+
+/*-
+ * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
+ *
+ * All rights reserved.
+ *
+ * This code has been donated to The NetBSD Foundation by the Author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the 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.
+ *
+ *
+ */
+#ifndef CURTEST_SLAVE_H
+#define CURTEST_SLAVE_H
+
+#include <curses.h>
+
+#define READ_PIPE 0
+#define WRITE_PIPE 1
+
+void command_execute(char *, int, char **);
+void report_count(int);
+void report_error(const char *);
+void report_int(int);
+void report_byte(chtype);
+void report_return(int);
+void report_nstr(chtype *);
+void report_status(const char *);
+void report_ptr(void *);
+int check_arg_count(int, int);
+
+#endif
diff --git a/contrib/netbsd-tests/lib/libcurses/t_curses.sh b/contrib/netbsd-tests/lib/libcurses/t_curses.sh
new file mode 100755
index 0000000..5ff9474
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/t_curses.sh
@@ -0,0 +1,294 @@
+
+h_run()
+{
+ file="$(atf_get_srcdir)/tests/${1}"
+
+ export COLUMNS=80
+ export LINES=24
+ $(atf_get_srcdir)/director \
+ -T $(atf_get_srcdir) \
+ -t atf \
+ -I $(atf_get_srcdir)/tests \
+ -C $(atf_get_srcdir)/check_files \
+ -s $(atf_get_srcdir)/slave $file || atf_fail "test ${file} failed"
+}
+
+atf_test_case startup
+startup_head()
+{
+ atf_set "descr" "Checks curses initialisation sequence"
+}
+startup_body()
+{
+ h_run start
+}
+
+atf_test_case addch
+addch_head()
+{
+ atf_set "descr" "Tests adding a chtype to stdscr"
+}
+addch_body()
+{
+ h_run addch
+}
+
+atf_test_case addchstr
+addchstr_head()
+{
+ atf_set "descr" "Tests adding a chtype string to stdscr"
+}
+addchstr_body()
+{
+ h_run addchstr
+}
+
+atf_test_case addchnstr
+addchnstr_head()
+{
+ atf_set "descr" "Tests adding bytes from a chtype string to stdscr"
+}
+addchnstr_body()
+{
+ h_run addchnstr
+}
+
+atf_test_case addstr
+addstr_head()
+{
+ atf_set "descr" "Tests adding bytes from a string to stdscr"
+}
+addstr_body()
+{
+ h_run addstr
+}
+
+atf_test_case addnstr
+addnstr_head()
+{
+ atf_set "descr" "Tests adding bytes from a string to stdscr"
+}
+addnstr_body()
+{
+ h_run addnstr
+}
+
+atf_test_case getch
+getch_head()
+{
+ atf_set "descr" "Checks reading a character input"
+}
+getch_body()
+{
+ h_run getch
+}
+
+atf_test_case timeout
+timeout_head()
+{
+ atf_set "descr" "Checks timeout when reading a character"
+}
+timeout_body()
+{
+ h_run timeout
+}
+
+atf_test_case window
+window_head()
+{
+ atf_set "descr" "Checks window creation"
+}
+window_body()
+{
+ h_run window
+}
+
+atf_test_case wborder
+wborder_head()
+{
+ atf_set "descr" "Checks drawing a border around a window"
+}
+wborder_body()
+{
+ h_run wborder
+}
+
+atf_test_case box
+box_head()
+{
+ atf_set "descr" "Checks drawing a box around a window"
+}
+box_body()
+{
+ h_run box
+}
+
+atf_test_case wprintw
+wprintw_head()
+{
+ atf_set "descr" "Checks printing to a window"
+}
+wprintw_body()
+{
+ h_run wprintw
+}
+
+atf_test_case wscrl
+wscrl_head()
+{
+ atf_set "descr" "Check window scrolling"
+}
+wscrl_body()
+{
+ h_run wscrl
+}
+
+atf_test_case mvwin
+mvwin_head()
+{
+ atf_set "descr" "Check moving a window"
+}
+mvwin_body()
+{
+ h_run mvwin
+}
+
+atf_test_case getstr
+getstr_head()
+{
+ atf_set "descr" "Check getting a string from input"
+}
+getstr_body()
+{
+ h_run getstr
+}
+
+atf_test_case termattrs
+termattrs_head()
+{
+ atf_set "descr" "Check the terminal attributes"
+}
+termattrs_body()
+{
+ h_run termattrs
+}
+
+atf_test_case assume_default_colors
+assume_default_colors_head()
+{
+ atf_set "descr" "Check setting the default color pair"
+}
+assume_default_colors_body()
+{
+ h_run assume_default_colors
+}
+
+atf_test_case attributes
+attributes_head()
+{
+ atf_set "descr" "Check setting, clearing and getting of attributes"
+}
+attributes_body()
+{
+ h_run attributes
+}
+
+atf_test_case beep
+beep_head()
+{
+ atf_set "descr" "Check sending a beep"
+}
+beep_body()
+{
+ h_run beep
+}
+
+atf_test_case background
+background_head()
+{
+ atf_set "descr" "Check setting background character and attributes for both stdscr and a window."
+}
+background_body()
+{
+ h_run background
+}
+
+atf_test_case can_change_color
+can_change_color_head()
+{
+ atf_set "descr" "Check if the terminal can change colours"
+}
+can_change_color_body()
+{
+ h_run can_change_color
+}
+
+atf_test_case cbreak
+cbreak_head()
+{
+ atf_set "descr" "Check cbreak mode works"
+}
+cbreak_body()
+{
+ h_run cbreak
+}
+
+atf_test_case clear
+clear_head()
+{
+ atf_set "descr" "Check clear and erase work"
+}
+clear_body()
+{
+ h_run clear
+}
+
+atf_test_case copywin
+copywin_head()
+{
+ atf_set "descr" "Check all the modes of copying a window work"
+}
+copywin_body()
+{
+ h_run copywin
+}
+
+atf_test_case curs_set
+curs_set_head()
+{
+ atf_set "descr" "Check setting the cursor visibility works"
+}
+curs_set_body()
+{
+ h_run curs_set
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case startup
+ atf_add_test_case addch
+ atf_add_test_case addchstr
+ atf_add_test_case addchnstr
+ atf_add_test_case addstr
+ atf_add_test_case addnstr
+ atf_add_test_case getch
+ atf_add_test_case timeout
+ atf_add_test_case window
+ atf_add_test_case wborder
+ atf_add_test_case box
+ atf_add_test_case wprintw
+ atf_add_test_case wscrl
+ atf_add_test_case mvwin
+ atf_add_test_case getstr
+ atf_add_test_case termattrs
+ atf_add_test_case can_change_color
+ atf_add_test_case assume_default_colors
+ atf_add_test_case attributes
+# atf_add_test_case beep # comment out for now - return is wrong
+ atf_add_test_case background
+ atf_add_test_case cbreak
+ atf_add_test_case clear
+ atf_add_test_case copywin
+ atf_add_test_case curs_set
+}
+
diff --git a/contrib/netbsd-tests/lib/libcurses/testframe.txt b/contrib/netbsd-tests/lib/libcurses/testframe.txt
new file mode 100644
index 0000000..19884d7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/testframe.txt
@@ -0,0 +1,241 @@
+
+CURSES TESTFRAME
+----------------
+
+1. Introduction
+
+The curses library is a complex piece of software and, often, changes
+made to the library may introduce subtle bugs that are hidden by other
+actions so a visual check of the curses output may look correct in
+some circumstances and the bug only show itself after a certain
+sequence of actions. To assist with validating that changes made to
+the curses library have no undesired effects an automated test is
+needed to detect and highlight any changes in the curses application
+output stream. The programmer can then analyse the output changes and
+either correct a bug or update the automated test to accept the new
+output as valid.
+
+2. Architecture
+
+The curses testframe consists of two separate programs connected by a
+number of pipes and a pseudo-tty (pty). The programs are called the
+director and the slave. The director reads a configuration file of
+tests to perform, passes these commands to the slave over a pipe and
+reads the pty for any output from the slave. Data from the slave is
+compared against expected output held in a file and any differences
+are highlighted to the tester. The slave is a curses application that
+is forked by the director on start up. It reads commands from the
+director over a pipe, these commands are calls to curses routines
+along with the parameters required for the call. The slave takes the
+parameters and uses them as arguments for the requested curses routine
+call. The return value from the curses routine is passed back to the
+director over another pipe, if the curses routine updates any passed
+by reference arguments then these are also passed back to the director
+for analysis.
+
+3. Director
+
+The director has the following optional command line options:
+
+ -v enables verbose output to assist debugging
+ -s slave_path the director will execute slave_path as the slave
+ process. The default is ./slave
+ -t term Sets the TERM environment variable to term when
+ executing the slave. The default is atf
+
+There is one mandatory command line parameter, that is a file name
+that contains the test command file. The test command file holds the
+calls required to exercise a particular curses routine and validate
+both the return codes from the routines and the output from the
+slave. The test language has a small number of commands, they are:
+
+assign:
+ Assign a value to a variable. The syntax is:
+
+ assign var_name value
+
+ Where var_name is the name of the variable. Variable names are
+ an arbitrary sequence of alphanumeric characters, the variable
+ name must start with an alphabetic character. Value is the value
+ to be assigned. The value can either be a numeric or a string
+ type. Variables are created on first use and will be
+ overwritten on each subsequent use.
+
+call, call2, call3, call4:
+ All these are used to call curses routines, the only difference
+ between then is the number of expected return values. Call
+ expects one return value, call2 expects 2, call3 expects 3 and
+ call4 expects four. Any parameters that are passed by reference
+ and updated by the call are treated like returns. So, for
+ example, calling the function getyx() which has three
+ parameters, the window, a pointer to storage for y and a pointer
+ to storage for x would be called like this:
+
+ call3 OK 4 5 getyx $win1
+
+ Which calls getyx, the first (and possibly only) return is the
+ return status of the function call, in this case we expect "OK"
+ indicating that the call succeeded. The next two returns are
+ the values of y and x respectively, the parameter $win1 is a
+ variable that was assigned by a previous call. Any return can
+ be assigned to a variable by including the variable name in a
+ call return list. Variables are referenced in a call parameter
+ list by prefixing the name with a $ character. All returns are
+ validated against the expected values and an error raised if
+ there is a mismatch. The only exception to this is when the
+ return is assigned to a variable. Valid values for the returns
+ list are:
+
+ variable - assign the return to the given variable
+ name.
+ numeric - the value of the return must match the
+ number given.
+ string - an arbitrary sequence of characters
+ enclosed in double quotes.
+ ERR - expect an ERR return
+ OK - expect an OK return
+ NULL - expect a NULL pointer return
+ NON_NULL - expect a pointer that is not NULL valued
+
+ There is one special parameter that can be passed to a call,
+ that is the label STDSCR. This parameter will be substituted by
+ the value of stdscr when the function call is made.
+
+check:
+ Validate the value of a variable. This allows a variable to be
+ checked for an expected return after it has been assigned in a
+ previous call. The syntax is:
+
+ check var_name expected_result
+
+ Where var_name is a variable previously assigned and
+ expected_result is one of the valid return values listed in the
+ above call section.
+
+compare:
+ Compares the output stream from the slave against the contents
+ of a file that contains the expected
+ output. The syntax is:
+
+ compare filename
+
+ Where filename is the name of the file containing the expected
+ output. The file can either be an absolute path or relative
+ path. In the latter case the value of the environment variable
+ CHECK_PATH will be prepended to the argument to provide the path
+ to the file. The contents of this file will be compared byte by
+ byte against the output from the slave, any differences in the
+ output will be flagged. If the director is not in verbose mode
+ then the first mismatch in the byte stream will cause the
+ director to exit.
+
+comparend:
+ Performs the same function as the above compare except that
+ excess output from the slave is not discarded if there is more
+ data from the slave than there is in the check file. This
+ allows chaining of multiple check files.
+
+delay:
+ Defines an inter-character delay to be inserted between
+ characters being fed into the input of the slave. The syntax
+ is:
+
+ delay time
+
+ Where time is the amount of time to delay in milliseconds.
+
+include:
+ Include the contents of another test file, the parser will
+ suspend reading the current file and read commands from the
+ include file until the end of file of the include file is
+ reached at which point it will continue reading the original
+ file. Include files may be nested. The syntax is:
+
+ include filename
+
+ Where filename is the name of the file to include. If the
+ filename is not an absolute path then the contents of the
+ environment variable INCLUDE_PATH are prepended to the file
+ name.
+
+input:
+ Defines a string of characters that will be fed to the slave
+ when a call requires input. Any unused input will be discarded
+ after the call that required the input is called. The syntax
+ is:
+
+ input "string to pass"
+
+noinput:
+ Normally the director will error if an input function is called
+ without input being previously defined, this is to prevent input
+ functions causing the test to hang waiting for input that never
+ comes. If it is known that there is pending input for the slave
+ then the noinput keyword can be used to flag that the input
+ function has data available for it to read. The noinput command
+ only applies to the next function call then behaviour reverts to
+ the default.
+
+The testframe can define different types of strings, the type of string
+depends on the type of enclosing quotes. A null terminated string is
+indicated by enclosing double (") quotes. A byte string, one that is
+not null terminated and may contain the nul character within it is
+indicated by enclosing single (') quotes. A string of chtype
+character which are a combined attribute and character value is
+indicated by enclosing backticks (`), for this type of string pairs of
+bytes between the backticks are converted to an array of chtype, the
+first byte is the attribute and the second is the character.
+
+All strings defined will have a simple set of character substitutions
+performed on them when they are parsed. This allows the tester to
+embed some control characters into the string. Valid substitutions
+are:
+
+ \e escape
+ \n new line
+ \r carriage return
+ \t tab
+ \\ \ character
+ \nnn Where nnn is three octal digits, the character
+ represented by the octal number will be inserted into
+ the string.
+
+Any other invalid conversions will have the \ stripped and the
+subsequent characters inserted into the string.
+
+Integers may be specified by either a plain numeric (e.g. 12345) or by
+hexadecimal notation by prefixing the number with 0x (e.g. 0x3039).
+Internally, no distinction is made between the two formats and they
+can be freely intermixed.
+
+Integers and variables containing integers can have operations
+performed on them. Currently only bitwise ORing numbers together is
+supported. This can be done by separating a list of integers and
+variables with the pipe (|) symbol and enclosing the entire list in
+round brackets "()" like this:
+
+ ( $var1 | 0x0100 | $var2 | 512 )
+
+Variables and integer constants may be freely intermixed. The result
+of the operation can either be used as an argument for a call or can
+be used as an expected result for a call.
+
+In addition to all the curses calls being supported by the slave,
+there is one more special call called "drain". This call repeatedly
+called getch() until there are no more characters in stdin. The call
+assumes that the curses input is either in no delay or timed input
+mode otherwise the test will time out and fail. This call can be used
+to clear any pending input when testing testing a timed read to
+prevent the input being used in a later test.
+
+4. Slave
+
+The user has no direct interaction with the slave process. The slave
+is forked off by the director communicates to the director over a set
+of pipes and a pseudo-tty connected to its standard i/o file
+descriptors. The slave executes the passed curses calls and passes
+back return values to the director. The slave automatically calls
+initscr() on start up.
+
+
+
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addch b/contrib/netbsd-tests/lib/libcurses/tests/addch
new file mode 100644
index 0000000..a67e385
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/addch
@@ -0,0 +1,4 @@
+include start
+call OK addch `\001t`
+call OK refresh
+compare addch.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addchnstr b/contrib/netbsd-tests/lib/libcurses/tests/addchnstr
new file mode 100644
index 0000000..661bf74
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/addchnstr
@@ -0,0 +1,5 @@
+include start
+# note that there are more characters in the array, check we only get 5 out
+call OK addchnstr `\004a\004b\004c\004d\004e\004f\004g` 5
+call OK refresh
+compare addchstr.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addchstr b/contrib/netbsd-tests/lib/libcurses/tests/addchstr
new file mode 100644
index 0000000..4ccf7b8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/addchstr
@@ -0,0 +1,4 @@
+include start
+call OK addchstr `\004a\004b\004c\004d\004e`
+call OK refresh
+compare addchstr.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addnstr b/contrib/netbsd-tests/lib/libcurses/tests/addnstr
new file mode 100644
index 0000000..9c40801
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/addnstr
@@ -0,0 +1,5 @@
+include start
+call OK addnstr "abcdefg" 5
+call OK refresh
+# should be the same as addstr
+compare addstr.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addstr b/contrib/netbsd-tests/lib/libcurses/tests/addstr
new file mode 100644
index 0000000..8c1d24f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/addstr
@@ -0,0 +1,4 @@
+include start
+call OK addstr "abcde"
+call OK refresh
+compare addstr.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/assume_default_colors b/contrib/netbsd-tests/lib/libcurses/tests/assume_default_colors
new file mode 100644
index 0000000..b6ccb09
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/assume_default_colors
@@ -0,0 +1,19 @@
+include start
+call OK start_color
+call OK assume_default_colors -1 -1
+call OK refresh
+compare color_start.chk
+# This should be the same as the default
+compare color_default.chk
+# default foreground, blue background
+call OK assume_default_colors -1 $COLOR_BLUE
+call OK refresh
+compare color_blue_back.chk
+# red foreground, default background
+call OK assume_default_colors $COLOR_RED -1
+call OK refresh
+compare color_red_fore.chk
+# back to default
+call OK assume_default_colors -1 -1
+call OK refresh
+compare color_default.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/attributes b/contrib/netbsd-tests/lib/libcurses/tests/attributes
new file mode 100644
index 0000000..b75d7d1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/attributes
@@ -0,0 +1,23 @@
+include start
+# no attributes, no color
+call3 OK 0 0 attr_get
+# set reverse and bold
+call OK attr_set ($BOLD | $REVERSE) 2
+# returned attributes includes color information
+call3 OK ($ACS_IS_WACS | $BOLD | $REVERSE) 2 attr_get
+# turn off reverse
+call OK attr_off $REVERSE
+call3 OK ($ACS_IS_WACS | $BOLD) 2 attr_get
+# turn on standout
+call OK attr_on $STANDOUT
+call3 OK ($ACS_IS_WACS | $BOLD | $STANDOUT) 2 attr_get
+# turn on blink
+call OK attron $BLINK
+call3 OK ($ACS_IS_WACS | $BOLD | $STANDOUT | $BLINK) 2 attr_get
+# turn off bold
+call OK attroff $BOLD
+call3 OK ($ACS_IS_WACS | $STANDOUT | $BLINK) 2 attr_get
+# print out something to check our attributes are there, standout and blink
+call OK printw "%s" "hello"
+call OK refresh
+compare attributes.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/background b/contrib/netbsd-tests/lib/libcurses/tests/background
new file mode 100644
index 0000000..2c4a575
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/background
@@ -0,0 +1,23 @@
+include start
+call OK bkgd `\002A`
+call OK refresh
+# looks like a bug - bottom right char not filled
+compare background1.chk
+call OK printw "%s" "a test string"
+call OK refresh
+compare background2.chk
+call win1 newwin 6 6 2 5
+check win1 NON_NULL
+call OK wprintw $win1 "%s" "window 1"
+# call OK refresh
+call OK wrefresh $win1
+compare background3.chk
+call OK wbkgd $win1 `\004B`
+call OK refresh
+call OK wrefresh $win1
+compare background4.chk
+call OK wprintw $win1 "%s" "hello world"
+call OK refresh
+call OK wrefresh $win1
+compare background5.chk
+
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/beep b/contrib/netbsd-tests/lib/libcurses/tests/beep
new file mode 100644
index 0000000..832e87f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/beep
@@ -0,0 +1,5 @@
+include start
+# SUSv2 says this should return OK but we return 1
+call 1 beep
+call OK refresh
+compare bell.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/box b/contrib/netbsd-tests/lib/libcurses/tests/box
new file mode 100644
index 0000000..bfd2e12
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/box
@@ -0,0 +1,8 @@
+include window
+call OK box $win1 `\000` `\000`
+call OK wrefresh $win1
+# default settings of box will output same as wborder
+compare wborder.chk
+call OK box $win1 `\001\000` `\004\000`
+call OK wrefresh $win1
+compare box_standout.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/can_change_color b/contrib/netbsd-tests/lib/libcurses/tests/can_change_color
new file mode 100644
index 0000000..aed622a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/can_change_color
@@ -0,0 +1,3 @@
+include start
+# our test terminal can change colors so expect true.
+call 1 can_change_color
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/cbreak b/contrib/netbsd-tests/lib/libcurses/tests/cbreak
new file mode 100644
index 0000000..b8bf60e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/cbreak
@@ -0,0 +1,18 @@
+include start
+# setting noecho stops getch setting cbreak itself so we should need
+# a newline before getch returns, check this works first.
+call OK noecho
+input "abcd\n"
+call 0x61 getch
+noinput
+call 0x62 getch
+noinput
+call 0x63 getch
+noinput
+call 0x64 getch
+noinput
+call 0x0a getch
+# set cbreak, getch should return without needing a newline
+input "ef"
+call OK cbreak
+call 0x65 getch
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/chgat b/contrib/netbsd-tests/lib/libcurses/tests/chgat
new file mode 100644
index 0000000..863ab11
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/chgat
@@ -0,0 +1,15 @@
+include start_color
+call OK init_pair 3 $COLOR_YELLOW $COLOR_CYAN
+call OK addch `\000d`
+call OK chgat 5 $REVERSE 3 0
+call OK refresh
+compare chgat1.chk
+call OK addch `\000e`
+call OK refresh
+compare chgat2.chk
+call OK move 0 0
+# The following should apply the attribute and colour to the whole line
+call OK chgat -1 $UNDERSCORE 3 0
+call OK refresh
+compare chgat3.chk
+
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/clear b/contrib/netbsd-tests/lib/libcurses/tests/clear
new file mode 100644
index 0000000..5aad934
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/clear
@@ -0,0 +1,57 @@
+include addstr
+call OK clear
+call OK refresh
+compare clear1.chk
+call OK move 5 5
+call OK addstr "abcde"
+call OK move 20 5
+call OK addstr "fghij"
+call OK move 10 5
+call OK refresh
+compare clear2.chk
+call OK clrtobot
+call OK refresh
+compare clear3.chk
+call OK erase
+call OK refresh
+compare clear4.chk
+include fill_screen
+compare fill.chk
+call OK erase
+call OK refresh
+compare clear5.chk
+# create a window to play with, defines win1 var
+include window_create
+call OK waddstr $win1 "abc"
+call OK mvwaddstr $win1 4 1 "efg"
+call OK wmove $win1 1 0
+call OK wrefresh $win1
+compare clear6.chk
+call OK wclrtobot $win1
+call OK wrefresh $win1
+compare clear7.chk
+include fill_screen
+comparend home.chk
+compare fill.chk
+call OK wrefresh $win1
+call OK wclear $win1
+call OK wrefresh $win1
+compare clear8.chk
+call OK clear
+call OK refresh
+compare clear1.chk
+include fill_screen
+compare fill.chk
+call OK werase $win1
+call OK wrefresh $win1
+compare clear9.chk
+call OK waddstr $win1 "abc"
+call OK mvwaddstr $win1 4 1 "efg"
+call OK wmove $win1 1 0
+call OK wrefresh $win1
+compare clear6.chk
+call OK wmove $win1 4 0
+call OK wclrtoeol $win1
+call OK wrefresh $win1
+compare clear10.chk
+
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/color_content b/contrib/netbsd-tests/lib/libcurses/tests/color_content
new file mode 100644
index 0000000..0db66e5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/color_content
@@ -0,0 +1,12 @@
+include start
+call OK start_color
+call4 OK 0 0 0 color_content $COLOR_BLACK
+call4 OK 1000 0 0 color_content $COLOR_RED
+call4 OK 0 1000 0 color_content $COLOR_GREEN
+call4 OK 1000 1000 0 color_content $COLOR_YELLOW
+call4 OK 0 0 1000 color_content $COLOR_BLUE
+call4 OK 1000 0 1000 color_content $COLOR_MAGENTA
+call4 OK 0 1000 1000 color_content $COLOR_CYAN
+call4 OK 1000 1000 1000 color_content $COLOR_WHITE
+
+
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/color_set b/contrib/netbsd-tests/lib/libcurses/tests/color_set
new file mode 100644
index 0000000..07cd1c5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/color_set
@@ -0,0 +1,11 @@
+include start
+call OK start_color
+call OK refresh
+comparend color_start.chk
+compare color_blank_draw.chk
+call OK init_pair 4 $COLOR_RED $COLOR_GREEN
+call OK color_set 4 0
+call OK printw "%s" "testing"
+call OK refresh
+compare color_set.chk
+
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/copywin b/contrib/netbsd-tests/lib/libcurses/tests/copywin
new file mode 100644
index 0000000..2dbec40
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/copywin
@@ -0,0 +1,81 @@
+include start
+include window_create
+call win2 newwin 7 9 10 14
+check win2 NON_NULL
+call OK wrefresh $win2
+compare copywin1.chk
+call OK mvwprintw $win1 0 0 "%s" "testin"
+call OK mvwprintw $win1 1 0 "%s" "gtesti"
+call OK mvwprintw $win1 2 0 "%s" "ngtest"
+call OK mvwprintw $win1 3 0 "%s" "ingtes"
+call OK mvwprintw $win1 4 0 "%s" "tingte"
+call OK mvwprintw $win1 5 0 "%s" "stingt"
+call OK wrefresh $win1
+compare copywin2.chk
+call OK copywin $win1 $win2 0 0 1 1 7 7 0
+call OK wrefresh $win2
+compare copywin3.chk
+call OK wclear $win1
+call OK wclear $win2
+call OK wrefresh $win1
+call OK wrefresh $win2
+compare copywin4.chk
+call OK mvwprintw $win2 0 0 "%s" "testingte"
+call OK mvwprintw $win2 1 0 "%s" "stingtest"
+call OK mvwprintw $win2 2 0 "%s" "ingtestin"
+call OK mvwprintw $win2 3 0 "%s" "gtestingt"
+call OK mvwprintw $win2 4 0 "%s" "estingtes"
+call OK mvwprintw $win2 5 0 "%s" "tingtesti"
+call OK wrefresh $win2
+compare copywin5.chk
+call OK copywin $win2 $win1 0 0 0 0 7 9 0
+call OK wrefresh $win1
+compare copywin6.chk
+call OK wclear $win1
+call OK wclear $win2
+call OK wrefresh $win1
+call OK wrefresh $win2
+compare copywin7.chk
+call OK mvwprintw $win1 0 0 "%s" "t s i "
+call OK mvwprintw $win1 1 0 "%s" "g e t "
+call OK mvwprintw $win1 2 0 "%s" "n t s "
+call OK mvwprintw $win1 3 0 "%s" " n t s"
+call OK mvwprintw $win1 4 0 "%s" "t n t "
+call OK mvwprintw $win1 5 0 "%s" " t n t"
+call OK wrefresh $win1
+compare copywin8.chk
+call OK mvwprintw $win2 0 0 "%s" " e t n"
+call OK mvwprintw $win2 1 0 "%s" " t s i"
+call OK mvwprintw $win2 2 0 "%s" " g e t"
+call OK mvwprintw $win2 3 0 "%s" "i g e "
+call OK mvwprintw $win2 4 0 "%s" " i g e"
+call OK mvwprintw $win2 5 0 "%s" "s i g "
+call OK wrefresh $win2
+compare copywin9.chk
+call OK copywin $win1 $win2 0 0 0 0 6 6 0
+call OK wrefresh $win2
+compare copywin10.chk
+call OK wclear $win1
+call OK wclear $win2
+call OK wrefresh $win1
+call OK wrefresh $win2
+compare copywin11.chk
+call OK mvwprintw $win1 0 0 "%s" "t s i "
+call OK mvwprintw $win1 1 0 "%s" "g e t "
+call OK mvwprintw $win1 2 0 "%s" "n t s "
+call OK mvwprintw $win1 3 0 "%s" " n t s"
+call OK mvwprintw $win1 4 0 "%s" "t n t "
+call OK mvwprintw $win1 5 0 "%s" " t n t"
+call OK wrefresh $win1
+compare copywin12.chk
+call OK mvwprintw $win2 0 0 "%s" " e t n"
+call OK mvwprintw $win2 1 0 "%s" " t s i"
+call OK mvwprintw $win2 2 0 "%s" " g e t"
+call OK mvwprintw $win2 3 0 "%s" "i g e "
+call OK mvwprintw $win2 4 0 "%s" " i g e"
+call OK mvwprintw $win2 5 0 "%s" "s i g "
+call OK wrefresh $win2
+compare copywin13.chk
+call OK copywin $win1 $win2 0 0 0 0 6 6 1
+call OK wrefresh $win2
+compare copywin14.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/curs_set b/contrib/netbsd-tests/lib/libcurses/tests/curs_set
new file mode 100644
index 0000000..5d7cb54
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/curs_set
@@ -0,0 +1,7 @@
+include start
+call 2 curs_set 0
+compare curs_set1.chk
+call 0 curs_set 1
+compare curs_set2.chk
+call 1 curs_set 2
+compare curs_set3.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/fill_screen b/contrib/netbsd-tests/lib/libcurses/tests/fill_screen
new file mode 100644
index 0000000..b9e2942
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/fill_screen
@@ -0,0 +1,29 @@
+#
+# Fill the screen with characters. We don't do a compare in here because
+# this is meant to be included from other tests which could result in random
+# cursor motions before the fill is done.
+#
+call OK mvaddstr 0 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 1 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 2 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 3 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 4 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 5 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr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EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 18 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 19 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 20 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 21 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK mvaddstr 22 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+call OK refresh
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/getch b/contrib/netbsd-tests/lib/libcurses/tests/getch
new file mode 100644
index 0000000..9f437f5
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/getch
@@ -0,0 +1,3 @@
+include start
+input "i"
+call 105 getch
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/getstr b/contrib/netbsd-tests/lib/libcurses/tests/getstr
new file mode 100644
index 0000000..320325f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/getstr
@@ -0,0 +1,6 @@
+include window
+input "input\n"
+call2 OK "input" wgetstr $win1
+compare wgetstr.chk
+call OK wrefresh $win1
+compare wgetstr_refresh.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/mvwin b/contrib/netbsd-tests/lib/libcurses/tests/mvwin
new file mode 100644
index 0000000..86d9bd6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/mvwin
@@ -0,0 +1,12 @@
+include window
+call OK wmove $win1 1 1
+call OK wprintw $win1 "%s" "xxxx"
+call OK wrefresh $win1
+compare /dev/zero
+call OK refresh
+compare /dev/zero
+call OK mvwin $win1 4 7
+call OK wrefresh $win1
+compare /dev/zero
+call OK refresh
+compare /dev/zero
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/start b/contrib/netbsd-tests/lib/libcurses/tests/start
new file mode 100644
index 0000000..963f2f4
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/start
@@ -0,0 +1,3 @@
+include std_defines
+call OK refresh
+compare curses_start.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/start_color b/contrib/netbsd-tests/lib/libcurses/tests/start_color
new file mode 100644
index 0000000..6d3f133
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/start_color
@@ -0,0 +1,5 @@
+include start
+call OK start_color
+call OK refresh
+comparend color_start.chk
+compare color_blank_draw.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/std_defines b/contrib/netbsd-tests/lib/libcurses/tests/std_defines
new file mode 100644
index 0000000..9c986df
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/std_defines
@@ -0,0 +1,138 @@
+#
+# Define some standard symbols for curses so tests can reference things
+# symbolically instead of using magic numbers.
+#
+#
+# boolean
+#
+assign TRUE 0x01
+assign FALSE 0x00
+#
+# colours
+#
+assign COLOR_BLACK 0x00
+assign COLOR_RED 0x01
+assign COLOR_GREEN 0x02
+assign COLOR_YELLOW 0x03
+assign COLOR_BLUE 0x04
+assign COLOR_MAGENTA 0x05
+assign COLOR_CYAN 0x06
+assign COLOR_WHITE 0x07
+#
+# Attributes
+#
+assign NORMAL 0x00000000
+assign STANDOUT 0x00000100
+assign UNDERSCORE 0x00000200
+assign REVERSE 0x00000400
+assign BLINK 0x00000800
+assign DIM 0x00001000
+assign BOLD 0x00002000
+assign BLANK 0x00004000
+assign PROTECT 0x00008000
+assign ALTCHARSET 0x00010000
+assign ACS_IS_WACS 0x00040000
+#
+# Keys
+#
+assign KEY_BREAK 0x101
+assign KEY_DOWN 0x102
+assign KEY_UP 0x103
+assign KEY_LEFT 0x104
+assign KEY_RIGHT 0x105
+assign KEY_HOME 0x106
+assign KEY_BACKSPACE 0x107
+assign KEY_F0 0x108
+assign KEY_F1 0x109
+assign KEY_F2 0x10a
+assign KEY_F3 0x10b
+assign KEY_F4 0x10c
+assign KEY_F5 0x10d
+assign KEY_F6 0x10e
+assign KEY_F7 0x10f
+assign KEY_F8 0x110
+assign KEY_F9 0x111
+assign KEY_DL 0x148
+assign KEY_IL 0x149
+assign KEY_DC 0x14A
+assign KEY_IC 0x14B
+assign KEY_EIC 0x14C
+assign KEY_CLEAR 0x14D
+assign KEY_EOS 0x14E
+assign KEY_EOL 0x14F
+assign KEY_SF 0x150
+assign KEY_SR 0x151
+assign KEY_NPAGE 0x152
+assign KEY_PPAGE 0x153
+assign KEY_STAB 0x154
+assign KEY_CTAB 0x155
+assign KEY_CATAB 0x156
+assign KEY_ENTER 0x157
+assign KEY_SRESET 0x158
+assign KEY_RESET 0x159
+assign KEY_PRINT 0x15A
+assign KEY_LL 0x15B
+assign KEY_A1 0x15C
+assign KEY_A3 0x15D
+assign KEY_B2 0x15E
+assign KEY_C1 0x15F
+assign KEY_C3 0x160
+assign KEY_BTAB 0x161
+assign KEY_BEG 0x162
+assign KEY_CANCEL 0x163
+assign KEY_CLOSE 0x164
+assign KEY_COMMAND 0x165
+assign KEY_COPY 0x166
+assign KEY_CREATE 0x167
+assign KEY_END 0x168
+assign KEY_EXIT 0x169
+assign KEY_FIND 0x16A
+assign KEY_HELP 0x16B
+assign KEY_MARK 0x16C
+assign KEY_MESSAGE 0x16D
+assign KEY_MOVE 0x16E
+assign KEY_NEXT 0x16F
+assign KEY_OPEN 0x170
+assign KEY_OPTIONS 0x171
+assign KEY_PREVIOUS 0x172
+assign KEY_REDO 0x173
+assign KEY_REFERENCE 0x174
+assign KEY_REFRESH 0x175
+assign KEY_REPLACE 0x176
+assign KEY_RESTART 0x177
+assign KEY_RESUME 0x178
+assign KEY_SAVE 0x179
+assign KEY_SBEG 0x17A
+assign KEY_SCANCEL 0x17B
+assign KEY_SCOMMAND 0x17C
+assign KEY_SCOPY 0x17D
+assign KEY_SCREATE 0x17E
+assign KEY_SDC 0x17F
+assign KEY_SDL 0x180
+assign KEY_SELECT 0x181
+assign KEY_SEND 0x182
+assign KEY_SEOL 0x183
+assign KEY_SEXIT 0x184
+assign KEY_SFIND 0x185
+assign KEY_SHELP 0x186
+assign KEY_SHOME 0x187
+assign KEY_SIC 0x188
+assign KEY_SLEFT 0x189
+assign KEY_SMESSAGE 0x18A
+assign KEY_SMOVE 0x18B
+assign KEY_SNEXT 0x18C
+assign KEY_SOPTIONS 0x18D
+assign KEY_SPREVIOUS 0x18E
+assign KEY_SPRINT 0x18F
+assign KEY_SREDO 0x190
+assign KEY_SREPLACE 0x191
+assign KEY_SRIGHT 0x192
+assign KEY_SRSUME 0x193
+assign KEY_SSAVE 0x194
+assign KEY_SSUSPEND 0x195
+assign KEY_SUNDO 0x196
+assign KEY_SUSPEND 0x197
+assign KEY_UNDO 0x198
+assign KEY_MOUSE 0x199
+assign KEY_RESIZE 0x200
+
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/termattrs b/contrib/netbsd-tests/lib/libcurses/tests/termattrs
new file mode 100644
index 0000000..1025301
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/termattrs
@@ -0,0 +1,3 @@
+include start
+# the atf terminal can do all attributes except PROTECT
+call 0x17f00 termattrs
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/timeout b/contrib/netbsd-tests/lib/libcurses/tests/timeout
new file mode 100644
index 0000000..1adf057
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/timeout
@@ -0,0 +1,21 @@
+#
+# Validate the timeout works.
+#
+include start
+delay 2000
+input "a"
+call 97 getch
+call OK timeout 100
+input "b"
+# since delay is in effect and we set timeout the following getch should
+# return ERR not the character b.
+call -1 getch
+# drain input....
+call OK drain
+call OK timeout -1
+call OK keypad STDSCR 1
+delay 0
+input "\eOA"
+call $KEY_UP getch
+call OK refresh
+compare timeout.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/wborder b/contrib/netbsd-tests/lib/libcurses/tests/wborder
new file mode 100644
index 0000000..7a8e78f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/wborder
@@ -0,0 +1,6 @@
+include window
+call OK wborder $win1 0 0 0 0 0 0 0 0
+call OK wrefresh $win1
+compare wborder.chk
+call OK refresh
+compare wborder_refresh.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/window b/contrib/netbsd-tests/lib/libcurses/tests/window
new file mode 100644
index 0000000..52b2d0a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/window
@@ -0,0 +1,2 @@
+include start
+include window_create
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/window_create b/contrib/netbsd-tests/lib/libcurses/tests/window_create
new file mode 100644
index 0000000..8c96134
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/window_create
@@ -0,0 +1,4 @@
+call win1 newwin 6 6 2 5
+check win1 NON_NULL
+call OK wrefresh $win1
+compare window.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/wprintw b/contrib/netbsd-tests/lib/libcurses/tests/wprintw
new file mode 100644
index 0000000..a30fcc0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/wprintw
@@ -0,0 +1,6 @@
+include start
+call win1 newwin 2 5 2 5
+check win1 NON_NULL
+call OK wprintw $win1 "%s" "hello"
+call OK wrefresh $win1
+compare wprintw_refresh.chk
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/wscrl b/contrib/netbsd-tests/lib/libcurses/tests/wscrl
new file mode 100644
index 0000000..51be531
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libcurses/tests/wscrl
@@ -0,0 +1,11 @@
+include window
+call OK wmove $win1 1 1
+call OK wprintw $win1 "%s" "xxxx"
+call OK wrefresh $win1
+call OK refresh
+compare wscrl1.chk
+call OK scrollok $win1 1
+call OK wscrl $win1 -2
+call OK wrefresh $win1
+call OK refresh
+compare wscrl2.chk
diff --git a/contrib/netbsd-tests/lib/libdes/t_des.c b/contrib/netbsd-tests/lib/libdes/t_des.c
new file mode 100644
index 0000000..abf2e54
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libdes/t_des.c
@@ -0,0 +1,989 @@
+/* $NetBSD: t_des.c,v 1.1 2010/08/25 16:46:36 jmmv Exp $ */
+
+/*
+ * Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights
+ * reserved.
+ *
+ * This package is an SSL implementation written by Eric Young
+ * (eay@cryptsoft.com). The implementation was written so as to conform with
+ * Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as the
+ * following conditions are aheared to. The following conditions apply to
+ * all code found in this distribution, be it the RC4, RSA, lhash, DES, etc.,
+ * code; not just the SSL code. The SSL documentation included with this
+ * distribution is covered by the same copyright terms except that the holder
+ * is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in the code
+ * are not to be removed. If this package is used in a product, Eric Young
+ * should be given attribution as the author of the parts of the library
+ * used. This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: 1. Redistributions of source code must retain the copyright notice,
+ * this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce 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 cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)" The word 'cryptographic' can be left out
+ * if the rouines from the library being used are not cryptographic related
+ * :-). 4. If you include any Windows specific code (or a derivative thereof)
+ * from the apps directory (application code) you must include an
+ * acknowledgement: "This product includes software written by Tim Hudson
+ * (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply
+ * be copied and put under another distribution licence [including the GNU
+ * Public Licence.]
+ */
+
+#include <atf-c.h>
+#include <des.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define crypt(c,s) (des_crypt((c),(s)))
+
+/* tisk tisk - the test keys don't all have odd parity :-( */
+/* test data */
+#define NUM_TESTS 34
+static unsigned char key_data[NUM_TESTS][8] = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
+ {0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},
+ {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
+ {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10},
+ {0x7C, 0xA1, 0x10, 0x45, 0x4A, 0x1A, 0x6E, 0x57},
+ {0x01, 0x31, 0xD9, 0x61, 0x9D, 0xC1, 0x37, 0x6E},
+ {0x07, 0xA1, 0x13, 0x3E, 0x4A, 0x0B, 0x26, 0x86},
+ {0x38, 0x49, 0x67, 0x4C, 0x26, 0x02, 0x31, 0x9E},
+ {0x04, 0xB9, 0x15, 0xBA, 0x43, 0xFE, 0xB5, 0xB6},
+ {0x01, 0x13, 0xB9, 0x70, 0xFD, 0x34, 0xF2, 0xCE},
+ {0x01, 0x70, 0xF1, 0x75, 0x46, 0x8F, 0xB5, 0xE6},
+ {0x43, 0x29, 0x7F, 0xAD, 0x38, 0xE3, 0x73, 0xFE},
+ {0x07, 0xA7, 0x13, 0x70, 0x45, 0xDA, 0x2A, 0x16},
+ {0x04, 0x68, 0x91, 0x04, 0xC2, 0xFD, 0x3B, 0x2F},
+ {0x37, 0xD0, 0x6B, 0xB5, 0x16, 0xCB, 0x75, 0x46},
+ {0x1F, 0x08, 0x26, 0x0D, 0x1A, 0xC2, 0x46, 0x5E},
+ {0x58, 0x40, 0x23, 0x64, 0x1A, 0xBA, 0x61, 0x76},
+ {0x02, 0x58, 0x16, 0x16, 0x46, 0x29, 0xB0, 0x07},
+ {0x49, 0x79, 0x3E, 0xBC, 0x79, 0xB3, 0x25, 0x8F},
+ {0x4F, 0xB0, 0x5E, 0x15, 0x15, 0xAB, 0x73, 0xA7},
+ {0x49, 0xE9, 0x5D, 0x6D, 0x4C, 0xA2, 0x29, 0xBF},
+ {0x01, 0x83, 0x10, 0xDC, 0x40, 0x9B, 0x26, 0xD6},
+ {0x1C, 0x58, 0x7F, 0x1C, 0x13, 0x92, 0x4F, 0xEF},
+ {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01},
+ {0x1F, 0x1F, 0x1F, 0x1F, 0x0E, 0x0E, 0x0E, 0x0E},
+ {0xE0, 0xFE, 0xE0, 0xFE, 0xF1, 0xFE, 0xF1, 0xFE},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
+ {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
+ {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10}
+};
+
+static unsigned char plain_data[NUM_TESTS][8] = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
+ {0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+ {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},
+ {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},
+ {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
+ {0x01, 0xA1, 0xD6, 0xD0, 0x39, 0x77, 0x67, 0x42},
+ {0x5C, 0xD5, 0x4C, 0xA8, 0x3D, 0xEF, 0x57, 0xDA},
+ {0x02, 0x48, 0xD4, 0x38, 0x06, 0xF6, 0x71, 0x72},
+ {0x51, 0x45, 0x4B, 0x58, 0x2D, 0xDF, 0x44, 0x0A},
+ {0x42, 0xFD, 0x44, 0x30, 0x59, 0x57, 0x7F, 0xA2},
+ {0x05, 0x9B, 0x5E, 0x08, 0x51, 0xCF, 0x14, 0x3A},
+ {0x07, 0x56, 0xD8, 0xE0, 0x77, 0x47, 0x61, 0xD2},
+ {0x76, 0x25, 0x14, 0xB8, 0x29, 0xBF, 0x48, 0x6A},
+ {0x3B, 0xDD, 0x11, 0x90, 0x49, 0x37, 0x28, 0x02},
+ {0x26, 0x95, 0x5F, 0x68, 0x35, 0xAF, 0x60, 0x9A},
+ {0x16, 0x4D, 0x5E, 0x40, 0x4F, 0x27, 0x52, 0x32},
+ {0x6B, 0x05, 0x6E, 0x18, 0x75, 0x9F, 0x5C, 0xCA},
+ {0x00, 0x4B, 0xD6, 0xEF, 0x09, 0x17, 0x60, 0x62},
+ {0x48, 0x0D, 0x39, 0x00, 0x6E, 0xE7, 0x62, 0xF2},
+ {0x43, 0x75, 0x40, 0xC8, 0x69, 0x8F, 0x3C, 0xFA},
+ {0x07, 0x2D, 0x43, 0xA0, 0x77, 0x07, 0x52, 0x92},
+ {0x02, 0xFE, 0x55, 0x77, 0x81, 0x17, 0xF1, 0x2A},
+ {0x1D, 0x9D, 0x5C, 0x50, 0x18, 0xF7, 0x28, 0xC2},
+ {0x30, 0x55, 0x32, 0x28, 0x6D, 0x6F, 0x29, 0x5A},
+ {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
+ {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
+ {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
+};
+
+static unsigned char cipher_data[NUM_TESTS][8] = {
+ {0x8C, 0xA6, 0x4D, 0xE9, 0xC1, 0xB1, 0x23, 0xA7},
+ {0x73, 0x59, 0xB2, 0x16, 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F5, 0x58, 0x74, 0x8A, 0x20, 0xE7},
+ {0x43, 0x34, 0xCF, 0xDA, 0x22, 0xC4, 0x86, 0xC8},
+ {0x08, 0xD7, 0xB4, 0xFB, 0x62, 0x9D, 0x08, 0x85}
+};
+
+static unsigned char cbc_key[8] = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+};
+static unsigned char cbc2_key[8] = {
+ 0xf1, 0xe0, 0xd3, 0xc2, 0xb5, 0xa4, 0x97, 0x86,
+};
+static unsigned char cbc3_key[8] = {
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
+};
+static unsigned char cbc_iv[8] = {
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
+};
+/*
+ * Changed the following text constant to binary so it will work on ebcdic
+ * machines :-)
+ */
+/* static char cbc_data[40]="7654321 Now is the time for \0001"; */
+static unsigned char cbc_data[40] = {
+ 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
+ 0x4E, 0x6F, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
+ 0x68, 0x65, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x20,
+ 0x66, 0x6F, 0x72, 0x20, 0x00, 0x31, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+static unsigned char cbc_ok[32] = {
+ 0xcc, 0xd1, 0x73, 0xff, 0xab, 0x20, 0x39, 0xf4,
+ 0xac, 0xd8, 0xae, 0xfd, 0xdf, 0xd8, 0xa1, 0xeb,
+ 0x46, 0x8e, 0x91, 0x15, 0x78, 0x88, 0xba, 0x68,
+ 0x1d, 0x26, 0x93, 0x97, 0xf7, 0xfe, 0x62, 0xb4,
+};
+
+#ifdef SCREW_THE_PARITY
+#error "SCREW_THE_PARITY is not ment to be defined."
+#error "Original vectors are preserved for reference only."
+static unsigned char cbc2_key[8] = {
+ 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
+};
+static unsigned char xcbc_ok[32] = {
+ 0x86, 0x74, 0x81, 0x0D, 0x61, 0xA4, 0xA5, 0x48,
+ 0xB9, 0x93, 0x03, 0xE1, 0xB8, 0xBB, 0xBD, 0xBD,
+ 0x64, 0x30, 0x0B, 0xB9, 0x06, 0x65, 0x81, 0x76,
+ 0x04, 0x1D, 0x77, 0x62, 0x17, 0xCA, 0x2B, 0xD2,
+};
+#else
+static unsigned char xcbc_ok[32] = {
+ 0x84, 0x6B, 0x29, 0x14, 0x85, 0x1E, 0x9A, 0x29,
+ 0x54, 0x73, 0x2F, 0x8A, 0xA0, 0xA6, 0x11, 0xC1,
+ 0x15, 0xCD, 0xC2, 0xD7, 0x95, 0x1B, 0x10, 0x53,
+ 0xA6, 0x3C, 0x5E, 0x03, 0xB2, 0x1A, 0xA3, 0xC4,
+};
+#endif
+
+static unsigned char cbc3_ok[32] = {
+ 0x3F, 0xE3, 0x01, 0xC9, 0x62, 0xAC, 0x01, 0xD0,
+ 0x22, 0x13, 0x76, 0x3C, 0x1C, 0xBD, 0x4C, 0xDC,
+ 0x79, 0x96, 0x57, 0xC0, 0x64, 0xEC, 0xF5, 0xD4,
+ 0x1C, 0x67, 0x38, 0x12, 0xCF, 0xDE, 0x96, 0x75
+};
+
+static unsigned char pcbc_ok[32] = {
+ 0xcc, 0xd1, 0x73, 0xff, 0xab, 0x20, 0x39, 0xf4,
+ 0x6d, 0xec, 0xb4, 0x70, 0xa0, 0xe5, 0x6b, 0x15,
+ 0xae, 0xa6, 0xbf, 0x61, 0xed, 0x7d, 0x9c, 0x9f,
+ 0xf7, 0x17, 0x46, 0x3b, 0x8a, 0xb3, 0xcc, 0x88
+};
+
+static unsigned char cfb_key[8] = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+};
+static unsigned char cfb_iv[8] = {
+ 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef,
+};
+static unsigned char cfb_buf1[40], cfb_buf2[40], cfb_tmp[8];
+static unsigned char plain[24] =
+{
+ 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73,
+ 0x20, 0x74, 0x68, 0x65, 0x20, 0x74,
+ 0x69, 0x6d, 0x65, 0x20, 0x66, 0x6f,
+ 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20,
+};
+static unsigned char cfb_cipher8[24] = {
+ 0xf3, 0x1f, 0xda, 0x07, 0x01, 0x14,
+ 0x62, 0xee, 0x18, 0x7f, 0x43, 0xd8,
+ 0x0a, 0x7c, 0xd9, 0xb5, 0xb0, 0xd2,
+ 0x90, 0xda, 0x6e, 0x5b, 0x9a, 0x87,
+};
+static unsigned char cfb_cipher16[24] = {
+ 0xF3, 0x09, 0x87, 0x87, 0x7F, 0x57,
+ 0xF7, 0x3C, 0x36, 0xB6, 0xDB, 0x70,
+ 0xD8, 0xD5, 0x34, 0x19, 0xD3, 0x86,
+ 0xB2, 0x23, 0xB7, 0xB2, 0xAD, 0x1B,
+};
+static unsigned char cfb_cipher32[24] = {
+ 0xF3, 0x09, 0x62, 0x49, 0xA4, 0xDF,
+ 0xA4, 0x9F, 0x33, 0xDC, 0x7B, 0xAD,
+ 0x4C, 0xC8, 0x9F, 0x64, 0xE4, 0x53,
+ 0xE5, 0xEC, 0x67, 0x20, 0xDA, 0xB6,
+};
+static unsigned char cfb_cipher48[24] = {
+ 0xF3, 0x09, 0x62, 0x49, 0xC7, 0xF4,
+ 0x30, 0xB5, 0x15, 0xEC, 0xBB, 0x85,
+ 0x97, 0x5A, 0x13, 0x8C, 0x68, 0x60,
+ 0xE2, 0x38, 0x34, 0x3C, 0xDC, 0x1F,
+};
+static unsigned char cfb_cipher64[24] = {
+ 0xF3, 0x09, 0x62, 0x49, 0xC7, 0xF4,
+ 0x6E, 0x51, 0xA6, 0x9E, 0x83, 0x9B,
+ 0x1A, 0x92, 0xF7, 0x84, 0x03, 0x46,
+ 0x71, 0x33, 0x89, 0x8E, 0xA6, 0x22,
+};
+
+static unsigned char ofb_key[8] = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+};
+static unsigned char ofb_iv[8] = {
+ 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef,
+};
+static unsigned char ofb_buf1[24], ofb_buf2[24], ofb_tmp[8];
+static unsigned char ofb_cipher[24] =
+{
+ 0xf3, 0x09, 0x62, 0x49, 0xc7, 0xf4, 0x6e, 0x51,
+ 0x35, 0xf2, 0x4a, 0x24, 0x2e, 0xeb, 0x3d, 0x3f,
+ 0x3d, 0x6d, 0x5b, 0xe3, 0x25, 0x5a, 0xf8, 0xc3
+};
+
+static DES_LONG cbc_cksum_ret = 0xB462FEF7L;
+static unsigned char cbc_cksum_data[8] = {
+ 0x1D, 0x26, 0x93, 0x97, 0xf7, 0xfe, 0x62, 0xb4,
+};
+
+static char *
+pt(unsigned char *p)
+{
+ static char bufs[10][20];
+ static int bnum = 0;
+ char *ret;
+ int i;
+ static const char *f = "0123456789ABCDEF";
+
+ ret = &(bufs[bnum++][0]);
+ bnum %= 10;
+ for (i = 0; i < 8; i++) {
+ ret[i * 2] = f[(p[i] >> 4) & 0xf];
+ ret[i * 2 + 1] = f[p[i] & 0xf];
+ }
+ ret[16] = '\0';
+ return (ret);
+}
+
+static void
+fail_cfb_buf(const char *msg, unsigned char *ptr)
+{
+ char buf[1024];
+ int i;
+
+ *buf = '\0';
+ for (i = 0; i < 24; i += 8) {
+ char buf2[128];
+ snprintf(buf2, sizeof(buf2), "%s /", pt(&(cfb_buf1[i])));
+ strlcat(buf, buf2, sizeof(buf));
+ }
+
+ atf_tc_fail_nonfatal("%s: %s", msg, buf);
+}
+
+#if !defined(LIBDES_LIT)
+static void
+cfb_test(int bits, unsigned char *cfb_cipher)
+{
+ des_key_schedule ks;
+
+ des_set_key_checked(&cfb_key, ks);
+ memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
+ des_cfb_encrypt(plain, cfb_buf1, bits, sizeof(plain), ks, &cfb_tmp,
+ DES_ENCRYPT);
+ if (memcmp(cfb_cipher, cfb_buf1, sizeof(plain)) != 0)
+ fail_cfb_buf("cfb_encrypt encrypt error", cfb_buf1);
+ memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
+ des_cfb_encrypt(cfb_buf1, cfb_buf2, bits, sizeof(plain), ks, &cfb_tmp,
+ DES_DECRYPT);
+ if (memcmp(plain, cfb_buf2, sizeof(plain)) != 0)
+ fail_cfb_buf("cfb_encrypt decrypt error", cfb_buf2);
+}
+#endif /* !defined(LIBDES_LIT) */
+
+#if !defined(LIBDES_LIT)
+static void
+cfb64_test(unsigned char *cfb_cipher)
+{
+ int n;
+ des_key_schedule ks;
+
+ des_set_key_checked(&cfb_key, ks);
+ memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
+ n = 0;
+ des_cfb64_encrypt(plain, cfb_buf1, 12, ks, &cfb_tmp, &n, DES_ENCRYPT);
+ des_cfb64_encrypt(&(plain[12]), &(cfb_buf1[12]), sizeof(plain) - 12, ks,
+ &cfb_tmp, &n, DES_ENCRYPT);
+ if (memcmp(cfb_cipher, cfb_buf1, sizeof(plain)) != 0)
+ fail_cfb_buf("cfb_encrypt encrypt error", cfb_buf1);
+ memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
+ n = 0;
+ des_cfb64_encrypt(cfb_buf1, cfb_buf2, 17, ks, &cfb_tmp, &n, DES_DECRYPT);
+ des_cfb64_encrypt(&(cfb_buf1[17]), &(cfb_buf2[17]),
+ sizeof(plain) - 17, ks, &cfb_tmp, &n, DES_DECRYPT);
+ if (memcmp(plain, cfb_buf2, sizeof(plain)) != 0)
+ fail_cfb_buf("cfb_encrypt decrypt error", cfb_buf2);
+}
+#endif /* !defined(LIBDES_LIT) */
+
+#if !defined(LIBDES_LIT)
+static void
+ede_cfb64_test(unsigned char *cfb_cipher)
+{
+ int n;
+ des_key_schedule ks;
+
+ des_set_key_checked(&cfb_key, ks);
+ memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
+ n = 0;
+ des_ede3_cfb64_encrypt(plain, cfb_buf1, 12, ks, ks, ks, &cfb_tmp, &n,
+ DES_ENCRYPT);
+ des_ede3_cfb64_encrypt(&(plain[12]), &(cfb_buf1[12]),
+ sizeof(plain) - 12, ks, ks, ks,
+ &cfb_tmp, &n, DES_ENCRYPT);
+ if (memcmp(cfb_cipher, cfb_buf1, sizeof(plain)) != 0)
+ fail_cfb_buf("ede_cfb_encrypt encrypt error", cfb_buf1);
+ memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
+ n = 0;
+ des_ede3_cfb64_encrypt(cfb_buf1, cfb_buf2, (long) 17, ks, ks, ks,
+ &cfb_tmp, &n, DES_DECRYPT);
+ des_ede3_cfb64_encrypt(&(cfb_buf1[17]), &(cfb_buf2[17]),
+ sizeof(plain) - 17, ks, ks, ks,
+ &cfb_tmp, &n, DES_DECRYPT);
+ if (memcmp(plain, cfb_buf2, sizeof(plain)) != 0)
+ fail_cfb_buf("ede_cfb_encrypt decrypt error", cfb_buf2);
+}
+#endif /* !defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(cbcm);
+#if defined(NO_DESCBCM)
+ATF_TC_BODY(cbcm, tc)
+{
+ atf_tc_skip("Test program built with NO_DESCBCM");
+}
+#else /* defined(NO_DESCBM) */
+ATF_TC_BODY(cbcm, tc)
+{
+ int i, j;
+ des_cblock iv3, iv2;
+ unsigned char cbc_in[40], cbc_out[40];
+ des_key_schedule ks, ks2, ks3;
+
+ if ((j = des_set_key_checked(&cbc_key, ks)) != 0) {
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ }
+ if ((j = des_set_key_checked(&cbc2_key, ks2)) != 0) {
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ }
+ if ((j = des_set_key_checked(&cbc3_key, ks3)) != 0) {
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ }
+ memset(cbc_out, 0, 40);
+ memset(cbc_in, 0, 40);
+ i = strlen((char *) cbc_data) + 1;
+ /* i=((i+7)/8)*8; */
+ memcpy(iv3, cbc_iv, sizeof(cbc_iv));
+ memset(iv2, '\0', sizeof iv2);
+
+ des_ede3_cbcm_encrypt(cbc_data, cbc_out, 16L, ks, ks2, ks3, &iv3, &iv2,
+ DES_ENCRYPT);
+ des_ede3_cbcm_encrypt(&cbc_data[16], &cbc_out[16], i - 16, ks, ks2, ks3,
+ &iv3, &iv2, DES_ENCRYPT);
+ /*
+ * if (memcmp(cbc_out,cbc3_ok, (unsigned int)(strlen((char
+ * *)cbc_data)+1+7)/8*8) != 0) { printf("des_ede3_cbc_encrypt encrypt
+ * error\n"); err=1; }
+ */
+ memcpy(iv3, cbc_iv, sizeof(cbc_iv));
+ memset(iv2, '\0', sizeof iv2);
+ des_ede3_cbcm_encrypt(cbc_out, cbc_in, i, ks, ks2, ks3, &iv3, &iv2,
+ DES_DECRYPT);
+ if (memcmp(cbc_in, cbc_data, strlen((char *) cbc_data) + 1) != 0) {
+ char buf[1024];
+ int n;
+
+ *buf = '\0';
+ for (n = 0; n < i; ++n) {
+ char buf2[16];
+ snprintf(buf2, sizeof(buf2), " %02x", cbc_data[n]);
+ strlcat(buf, buf2, sizeof(buf));
+ }
+ strlcat(buf, ", ", sizeof(buf));
+ for (n = 0; n < i; ++n) {
+ char buf2[16];
+ snprintf(buf2, sizeof(buf2), " %02x", cbc_in[n]);
+ strlcat(buf, buf2, sizeof(buf));
+ }
+
+ atf_tc_fail_nonfatal("des_ede3_cbcm_encrypt decrypt error: %s",
+ buf);
+ }
+}
+#endif /* defined(NO_DESCBM) */
+
+ATF_TC_WITHOUT_HEAD(ecb);
+ATF_TC_BODY(ecb, tc)
+{
+ int i;
+ des_cblock in, out, outin;
+ des_key_schedule ks;
+
+ for (i = 0; i < NUM_TESTS; i++) {
+ des_set_key_unchecked(&key_data[i], ks);
+ memcpy(in, plain_data[i], 8);
+ memset(out, 0, 8);
+ memset(outin, 0, 8);
+ des_ecb_encrypt(&in, &out, ks, DES_ENCRYPT);
+ des_ecb_encrypt(&out, &outin, ks, DES_DECRYPT);
+
+ if (memcmp(out, cipher_data[i], 8) != 0) {
+ atf_tc_fail_nonfatal("Encryption error %2d\nk=%s p=%s "
+ "o=%s act=%s\n", i + 1,
+ pt(key_data[i]), pt(in),
+ pt(cipher_data[i]), pt(out));
+ }
+ if (memcmp(in, outin, 8) != 0) {
+ atf_tc_fail_nonfatal("Decryption error %2d\nk=%s p=%s "
+ "o=%s act=%s\n", i + 1,
+ pt(key_data[i]), pt(out), pt(in),
+ pt(outin));
+ }
+ }
+}
+
+ATF_TC_WITHOUT_HEAD(ede_ecb);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(ede_ecb, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(ede_ecb, tc)
+{
+ int i;
+ des_cblock in, out, outin;
+ des_key_schedule ks, ks2, ks3;
+
+ for (i = 0; i < (NUM_TESTS - 1); i++) {
+ des_set_key_unchecked(&key_data[i], ks);
+ des_set_key_unchecked(&key_data[i + 1], ks2);
+ des_set_key_unchecked(&key_data[i + 2], ks3);
+ memcpy(in, plain_data[i], 8);
+ memset(out, 0, 8);
+ memset(outin, 0, 8);
+ des_ecb2_encrypt(&in, &out, ks, ks2, DES_ENCRYPT);
+ des_ecb2_encrypt(&out, &outin, ks, ks2, DES_DECRYPT);
+
+ if (memcmp(out, cipher_ecb2[i], 8) != 0) {
+ atf_tc_fail_nonfatal("Encryption error %2d\nk=%s p=%s o=%s act=%s\n",
+ i + 1, pt(key_data[i]), pt(in), pt(cipher_ecb2[i]),
+ pt(out));
+ }
+ if (memcmp(in, outin, 8) != 0) {
+ atf_tc_fail_nonfatal("Decryption error %2d\nk=%s p=%s o=%s act=%s\n",
+ i + 1, pt(key_data[i]), pt(out), pt(in), pt(outin));
+ }
+ }
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(cbc);
+ATF_TC_BODY(cbc, tc)
+{
+ int j;
+ des_cblock iv3;
+ des_key_schedule ks;
+ unsigned char cbc_in[40], cbc_out[40];
+
+ if ((j = des_set_key_checked(&cbc_key, ks)) != 0)
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ memset(cbc_out, 0, 40);
+ memset(cbc_in, 0, 40);
+ memcpy(iv3, cbc_iv, sizeof(cbc_iv));
+ des_ncbc_encrypt(cbc_data, cbc_out, strlen((char *) cbc_data) + 1, ks,
+ &iv3, DES_ENCRYPT);
+ if (memcmp(cbc_out, cbc_ok, 32) != 0)
+ atf_tc_fail_nonfatal("cbc_encrypt encrypt error\n");
+ memcpy(iv3, cbc_iv, sizeof(cbc_iv));
+ des_ncbc_encrypt(cbc_out, cbc_in, strlen((char *) cbc_data) + 1, ks,
+ &iv3, DES_DECRYPT);
+ if (memcmp(cbc_in, cbc_data, strlen((char *) cbc_data)) != 0)
+ atf_tc_fail_nonfatal("cbc_encrypt decrypt error\n");
+}
+
+ATF_TC_WITHOUT_HEAD(desx_cbc);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(desx_cbc, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(desx_cbc, tc)
+{
+ int j;
+ des_cblock iv3;
+ des_key_schedule ks;
+ unsigned char cbc_in[40], cbc_out[40];
+
+ if ((j = des_set_key_checked(&cbc_key, ks)) != 0) {
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ }
+ memset(cbc_out, 0, 40);
+ memset(cbc_in, 0, 40);
+ memcpy(iv3, cbc_iv, sizeof(cbc_iv));
+ des_xcbc_encrypt(cbc_data, cbc_out, strlen((char *) cbc_data) + 1, ks,
+ &iv3, &cbc2_key, &cbc3_key, DES_ENCRYPT);
+ if (memcmp(cbc_out, xcbc_ok, 32) != 0) {
+ atf_tc_fail_nonfatal("des_xcbc_encrypt encrypt error\n");
+ }
+ memcpy(iv3, cbc_iv, sizeof(cbc_iv));
+ des_xcbc_encrypt(cbc_out, cbc_in, strlen((char *) cbc_data) + 1, ks,
+ &iv3, &cbc2_key, &cbc3_key, DES_DECRYPT);
+ if (memcmp(cbc_in, cbc_data, strlen((char *) cbc_data) + 1) != 0) {
+ atf_tc_fail_nonfatal("des_xcbc_encrypt decrypt error\n");
+ }
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(ede_cbc);
+ATF_TC_BODY(ede_cbc, tc)
+{
+ int i, j;
+ des_cblock iv3;
+ des_key_schedule ks, ks2, ks3;
+ unsigned char cbc_in[40], cbc_out[40];
+
+ if ((j = des_set_key_checked(&cbc_key, ks)) != 0)
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ if ((j = des_set_key_checked(&cbc2_key, ks2)) != 0)
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ if ((j = des_set_key_checked(&cbc3_key, ks3)) != 0)
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ memset(cbc_out, 0, 40);
+ memset(cbc_in, 0, 40);
+ i = strlen((char *) cbc_data) + 1;
+ /* i=((i+7)/8)*8; */
+ memcpy(iv3, cbc_iv, sizeof(cbc_iv));
+
+ des_ede3_cbc_encrypt(cbc_data, cbc_out, 16L, ks, ks2, ks3, &iv3,
+ DES_ENCRYPT);
+ des_ede3_cbc_encrypt(&(cbc_data[16]), &(cbc_out[16]), i - 16, ks, ks2,
+ ks3, &iv3, DES_ENCRYPT);
+ if (memcmp(cbc_out, cbc3_ok, (unsigned int)
+ (strlen((char *) cbc_data) + 1 + 7) / 8 * 8) != 0)
+ atf_tc_fail_nonfatal("des_ede3_cbc_encrypt encrypt error\n");
+ memcpy(iv3, cbc_iv, sizeof(cbc_iv));
+ des_ede3_cbc_encrypt(cbc_out, cbc_in, i, ks, ks2, ks3, &iv3,
+ DES_DECRYPT);
+ if (memcmp(cbc_in, cbc_data, strlen((char *) cbc_data) + 1) != 0)
+ atf_tc_fail_nonfatal("des_ede3_cbc_encrypt decrypt error\n");
+}
+
+ATF_TC_WITHOUT_HEAD(pcbc);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(pcbc, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(pcbc, tc)
+{
+ int j;
+ unsigned char cbc_in[40], cbc_out[40];
+ des_key_schedule ks;
+
+ if ((j = des_set_key_checked(&cbc_key, ks)) != 0) {
+ atf_tc_fail_nonfatal("Key error %d\n", j);
+ }
+ memset(cbc_out, 0, 40);
+ memset(cbc_in, 0, 40);
+ des_pcbc_encrypt(cbc_data, cbc_out, strlen((char *) cbc_data) + 1, ks,
+ &cbc_iv, DES_ENCRYPT);
+ if (memcmp(cbc_out, pcbc_ok, 32) != 0) {
+ atf_tc_fail_nonfatal("pcbc_encrypt encrypt error\n");
+ }
+ des_pcbc_encrypt(cbc_out, cbc_in, strlen((char *) cbc_data) + 1, ks, &cbc_iv,
+ DES_DECRYPT);
+ if (memcmp(cbc_in, cbc_data, strlen((char *) cbc_data) + 1) != 0) {
+ atf_tc_fail_nonfatal("pcbc_encrypt decrypt error\n");
+ }
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(cfb);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(cfb, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(cfb, tc)
+{
+ size_t i;
+ des_key_schedule ks;
+
+ printf("cfb8\n");
+ cfb_test(8, cfb_cipher8);
+ printf("cfb16\n");
+ cfb_test(16, cfb_cipher16);
+ printf("cfb32\n");
+ cfb_test(32, cfb_cipher32);
+ printf("cfb48\n");
+ cfb_test(48, cfb_cipher48);
+ printf("cfb64\n");
+ cfb_test(64, cfb_cipher64);
+
+ printf("cfb64()\n");
+ cfb64_test(cfb_cipher64);
+
+ des_set_key_checked(&cfb_key, ks);
+ memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
+ for (i = 0; i < sizeof(plain); i++)
+ des_cfb_encrypt(&(plain[i]), &(cfb_buf1[i]),
+ 8, 1, ks, &cfb_tmp, DES_ENCRYPT);
+ if (memcmp(cfb_cipher8, cfb_buf1, sizeof(plain)) != 0)
+ atf_tc_fail_nonfatal("cfb_encrypt small encrypt error\n");
+ memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
+ for (i = 0; i < sizeof(plain); i++)
+ des_cfb_encrypt(&(cfb_buf1[i]), &(cfb_buf2[i]),
+ 8, 1, ks, &cfb_tmp, DES_DECRYPT);
+ if (memcmp(plain, cfb_buf2, sizeof(plain)) != 0)
+ atf_tc_fail_nonfatal("cfb_encrypt small decrypt error\n");
+ printf("ede_cfb64()\n");
+ ede_cfb64_test(cfb_cipher64);
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(ofb);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(ofb, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(ofb, tc)
+{
+ des_key_schedule ks;
+
+ des_set_key_checked(&ofb_key, ks);
+ memcpy(ofb_tmp, ofb_iv, sizeof(ofb_iv));
+ des_ofb_encrypt(plain, ofb_buf1, 64, sizeof(plain) / 8, ks, &ofb_tmp);
+ if (memcmp(ofb_cipher, ofb_buf1, sizeof(ofb_buf1)) != 0) {
+ atf_tc_fail_nonfatal("ofb_encrypt encrypt error: "
+ "%02X %02X %02X %02X %02X %02X %02X %02X, "
+ "%02X %02X %02X %02X %02X %02X %02X %02X",
+ ofb_buf1[8 + 0], ofb_buf1[8 + 1],
+ ofb_buf1[8 + 2], ofb_buf1[8 + 3],
+ ofb_buf1[8 + 4], ofb_buf1[8 + 5],
+ ofb_buf1[8 + 6], ofb_buf1[8 + 7],
+ ofb_buf1[8 + 0], ofb_cipher[8 + 1],
+ ofb_cipher[8 + 2], ofb_cipher[8 + 3],
+ ofb_buf1[8 + 4], ofb_cipher[8 + 5],
+ ofb_cipher[8 + 6], ofb_cipher[8 + 7]);
+ }
+ memcpy(ofb_tmp, ofb_iv, sizeof(ofb_iv));
+ des_ofb_encrypt(ofb_buf1, ofb_buf2, 64, sizeof(ofb_buf1) / 8, ks,
+ &ofb_tmp);
+ if (memcmp(plain, ofb_buf2, sizeof(ofb_buf2)) != 0) {
+ atf_tc_fail_nonfatal("ofb_encrypt decrypt error: "
+ "%02X %02X %02X %02X %02X %02X %02X %02X, "
+ "%02X %02X %02X %02X %02X %02X %02X %02X",
+ ofb_buf2[8 + 0], ofb_buf2[8 + 1],
+ ofb_buf2[8 + 2], ofb_buf2[8 + 3],
+ ofb_buf2[8 + 4], ofb_buf2[8 + 5],
+ ofb_buf2[8 + 6], ofb_buf2[8 + 7],
+ plain[8 + 0], plain[8 + 1],
+ plain[8 + 2], plain[8 + 3],
+ plain[8 + 4], plain[8 + 5],
+ plain[8 + 6], plain[8 + 7]);
+ }
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(ofb64);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(ofb64, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(ofb64, tc)
+{
+ int num;
+ size_t i;
+ des_key_schedule ks;
+
+ des_set_key_checked(&ofb_key, ks);
+ memcpy(ofb_tmp, ofb_iv, sizeof(ofb_iv));
+ memset(ofb_buf1, 0, sizeof(ofb_buf1));
+ memset(ofb_buf2, 0, sizeof(ofb_buf1));
+ num = 0;
+ for (i = 0; i < sizeof(plain); i++) {
+ des_ofb64_encrypt(&(plain[i]), &(ofb_buf1[i]), 1, ks, &ofb_tmp,
+ &num);
+ }
+ if (memcmp(ofb_cipher, ofb_buf1, sizeof(ofb_buf1)) != 0) {
+ atf_tc_fail_nonfatal("ofb64_encrypt encrypt error\n");
+ }
+ memcpy(ofb_tmp, ofb_iv, sizeof(ofb_iv));
+ num = 0;
+ des_ofb64_encrypt(ofb_buf1, ofb_buf2, sizeof(ofb_buf1), ks, &ofb_tmp, &num);
+ if (memcmp(plain, ofb_buf2, sizeof(ofb_buf2)) != 0) {
+ atf_tc_fail_nonfatal("ofb64_encrypt decrypt error\n");
+ }
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(ede_ofb64);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(ede_ofb64, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(ede_ofb64, tc)
+{
+ int num;
+ size_t i;
+ des_key_schedule ks;
+
+ des_set_key_checked(&ofb_key, ks);
+ memcpy(ofb_tmp, ofb_iv, sizeof(ofb_iv));
+ memset(ofb_buf1, 0, sizeof(ofb_buf1));
+ memset(ofb_buf2, 0, sizeof(ofb_buf1));
+ num = 0;
+ for (i = 0; i < sizeof(plain); i++) {
+ des_ede3_ofb64_encrypt(&(plain[i]), &(ofb_buf1[i]), 1, ks, ks, ks,
+ &ofb_tmp, &num);
+ }
+ if (memcmp(ofb_cipher, ofb_buf1, sizeof(ofb_buf1)) != 0) {
+ atf_tc_fail_nonfatal("ede_ofb64_encrypt encrypt error\n");
+ }
+ memcpy(ofb_tmp, ofb_iv, sizeof(ofb_iv));
+ num = 0;
+ des_ede3_ofb64_encrypt(ofb_buf1, ofb_buf2, sizeof(ofb_buf1), ks,
+ ks, ks, &ofb_tmp, &num);
+ if (memcmp(plain, ofb_buf2, sizeof(ofb_buf2)) != 0) {
+ atf_tc_fail_nonfatal("ede_ofb64_encrypt decrypt error\n");
+ }
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(cbc_cksum);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(cbc_cksum, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(cbc_cksum, tc)
+{
+ unsigned char cret[8];
+ des_key_schedule ks;
+ DES_LONG cs;
+
+ des_set_key_checked(&cbc_key, ks);
+ cs = des_cbc_cksum(cbc_data, &cret, strlen((char *) cbc_data), ks, &cbc_iv);
+ if (cs != cbc_cksum_ret) {
+ atf_tc_fail_nonfatal("bad return value (%08lX), should be %08lX\n",
+ (unsigned long) cs, (unsigned long) cbc_cksum_ret);
+ }
+ if (memcmp(cret, cbc_cksum_data, 8) != 0) {
+ atf_tc_fail_nonfatal("bad cbc_cksum block returned\n");
+ }
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(quad_cksum);
+#if defined(LIBDES_LIT)
+ATF_TC_BODY(quad_cksum, tc)
+{
+ atf_tc_skip("Test program built with LIBDES_LIT");
+}
+#else /* defined(LIBDES_LIT) */
+ATF_TC_BODY(quad_cksum, tc)
+{
+ DES_LONG cs, lqret[4];
+
+ cs = quad_cksum(cbc_data, (des_cblock *) lqret,
+ (long) strlen((char *) cbc_data), 2, (des_cblock *) cbc_iv);
+ if (cs != 0x70d7a63aL) {
+ atf_tc_fail_nonfatal("quad_cksum error, ret %08lx should be 70d7a63a\n",
+ (unsigned long) cs);
+ }
+ if (lqret[0] != 0x327eba8dL) {
+ atf_tc_fail_nonfatal("quad_cksum error, out[0] %08lx is not %08lx\n",
+ (unsigned long) lqret[0], 0x327eba8dUL);
+ }
+ if (lqret[1] != 0x201a49ccL) {
+ atf_tc_fail_nonfatal("quad_cksum error, out[1] %08lx is not %08lx\n",
+ (unsigned long) lqret[1], 0x201a49ccUL);
+ }
+ if (lqret[2] != 0x70d7a63aL) {
+ atf_tc_fail_nonfatal("quad_cksum error, out[2] %08lx is not %08lx\n",
+ (unsigned long) lqret[2], 0x70d7a63aUL);
+ }
+ if (lqret[3] != 0x501c2c26L) {
+ atf_tc_fail_nonfatal("quad_cksum error, out[3] %08lx is not %08lx\n",
+ (unsigned long) lqret[3], 0x501c2c26UL);
+ }
+}
+#endif /* defined(LIBDES_LIT) */
+
+ATF_TC_WITHOUT_HEAD(align);
+ATF_TC_BODY(align, tc)
+{
+ int i;
+ unsigned char cbc_in[40], cbc_out[40];
+ des_key_schedule ks;
+
+ printf("input word alignment test");
+ for (i = 0; i < 4; i++) {
+ printf(" %d", i);
+ des_ncbc_encrypt(&(cbc_out[i]), cbc_in,
+ strlen((char *) cbc_data) + 1, ks,
+ &cbc_iv, DES_ENCRYPT);
+ }
+
+ printf("\noutput word alignment test");
+ for (i = 0; i < 4; i++) {
+ printf(" %d", i);
+ des_ncbc_encrypt(cbc_out, &(cbc_in[i]),
+ strlen((char *) cbc_data) + 1, ks,
+ &cbc_iv, DES_ENCRYPT);
+ }
+}
+
+ATF_TC_WITHOUT_HEAD(fast_crypt);
+ATF_TC_BODY(fast_crypt, tc)
+{
+ char *str;
+
+ str = crypt("testing", "ef");
+ if (strcmp("efGnQx2725bI2", str) != 0)
+ atf_tc_fail_nonfatal("fast crypt error, %s should be efGnQx2725bI2\n", str);
+ str = crypt("bca76;23", "yA");
+ if (strcmp("yA1Rp/1hZXIJk", str) != 0)
+ atf_tc_fail_nonfatal("fast crypt error, %s should be yA1Rp/1hZXIJk\n", str);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, cbcm);
+ ATF_TP_ADD_TC(tp, ecb);
+ ATF_TP_ADD_TC(tp, ede_ecb);
+ ATF_TP_ADD_TC(tp, cbc);
+ ATF_TP_ADD_TC(tp, desx_cbc);
+ ATF_TP_ADD_TC(tp, ede_cbc);
+ ATF_TP_ADD_TC(tp, pcbc);
+ ATF_TP_ADD_TC(tp, cfb);
+ ATF_TP_ADD_TC(tp, ofb);
+ ATF_TP_ADD_TC(tp, ofb64);
+ ATF_TP_ADD_TC(tp, ede_ofb64);
+ ATF_TP_ADD_TC(tp, cbc_cksum);
+ ATF_TP_ADD_TC(tp, quad_cksum);
+ ATF_TP_ADD_TC(tp, align);
+ ATF_TP_ADD_TC(tp, fast_crypt);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libevent/t_event.sh b/contrib/netbsd-tests/lib/libevent/t_event.sh
new file mode 100755
index 0000000..1e4c9bc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libevent/t_event.sh
@@ -0,0 +1,67 @@
+# $NetBSD: t_event.sh,v 1.3 2010/11/29 18:21:15 pgoyette Exp $
+#
+# Copyright (c) 2009 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# This is not great but rather than reimplementing the libevent
+# provided regression tests, we use an ATF wrapper around the test
+# program which carries out all the tests and prints an extensive
+# report.
+#
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Test libevent with kqueue backend"
+}
+kqueue_body() {
+ EVENT_NOPOLL=1 EVENT_NOSELECT=1 \
+ $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report"
+}
+
+atf_test_case poll
+poll_head() {
+ atf_set "descr" "Test libevent with poll backend"
+}
+poll_body() {
+ EVENT_NOKQUEUE=1 EVENT_NOSELECT=1 \
+ $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report"
+}
+
+atf_test_case select
+select_head() {
+ atf_set "descr" "Test libevent with select backend"
+}
+select_body() {
+ EVENT_NOKQUEUE=1 EVENT_NOPOLL=1 \
+ $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case kqueue
+ atf_add_test_case poll
+ atf_add_test_case select
+}
diff --git a/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c b/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c
new file mode 100644
index 0000000..b5b5739
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c
@@ -0,0 +1,168 @@
+/* $NetBSD: t_backtrace.c,v 1.15 2014/05/01 03:46:11 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_backtrace.c,v 1.15 2014/05/01 03:46:11 joerg Exp $");
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <execinfo.h>
+#include <unistd.h>
+
+#ifndef __arraycount
+#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
+void myfunc3(size_t ncalls);
+void myfunc2(size_t ncalls);
+void myfunc1(size_t origcalls, volatile size_t ncalls);
+void myfunc(size_t ncalls);
+
+volatile int prevent_inline;
+
+void
+myfunc3(size_t ncalls)
+{
+ static const struct {
+ const char *name;
+ bool is_optional;
+ } frames[] = {
+ { "myfunc", false },
+ { "atfu_backtrace_fmt_basic_body", false },
+ { "atf_tc_run", false },
+ { "atf_tp_run", true },
+ { "run_tc", true },
+ { "controlled_main", true },
+ { "atf_tp_main", false },
+ { "main", true },
+ { "___start", true },
+ };
+ size_t j, nptrs, min_frames, max_frames;
+ void *buffer[ncalls + 10];
+ char **strings;
+
+ min_frames = 0;
+ max_frames = 0;
+ for (j = 0; j < __arraycount(frames); ++j) {
+ if (!frames[j].is_optional)
+ ++min_frames;
+ ++max_frames;
+ }
+ nptrs = backtrace(buffer, __arraycount(buffer));
+ ATF_REQUIRE(nptrs != (size_t)-1);
+ strings = backtrace_symbols_fmt(buffer, nptrs, "%n");
+
+ ATF_CHECK(strings != NULL);
+
+ printf("got nptrs=%zu ncalls=%zu (min_frames: %zu, max_frames: %zu)\n",
+ nptrs, ncalls, min_frames, max_frames);
+ printf("backtrace is:\n");
+ for (j = 0; j < nptrs; j++) {
+ printf("#%zu: %s\n", j, strings[j]);
+ }
+
+ ATF_REQUIRE(nptrs >= ncalls + 2 + min_frames);
+ ATF_REQUIRE(nptrs <= ncalls + 2 + max_frames);
+ ATF_CHECK_STREQ(strings[0], "myfunc3");
+ ATF_CHECK_STREQ(strings[1], "myfunc2");
+
+ for (j = 2; j < ncalls + 2; j++)
+ ATF_CHECK_STREQ(strings[j], "myfunc1");
+
+ for (size_t i = 0; j < nptrs; i++, j++) {
+ if (frames[i].is_optional &&
+ strcmp(strings[j], frames[i].name)) {
+ --i;
+ continue;
+ }
+ ATF_CHECK_STREQ(strings[j], frames[i].name);
+ }
+
+ free(strings);
+
+ if (prevent_inline)
+ vfork();
+}
+
+void
+myfunc2(size_t ncalls)
+{
+ myfunc3(ncalls);
+
+ if (prevent_inline)
+ vfork();
+}
+
+void
+myfunc1(size_t origcalls, volatile size_t ncalls)
+{
+ if (ncalls > 1)
+ myfunc1(origcalls, ncalls - 1);
+ else
+ myfunc2(origcalls);
+
+ if (prevent_inline)
+ vfork();
+}
+
+void
+myfunc(size_t ncalls)
+{
+ myfunc1(ncalls, ncalls);
+
+ if (prevent_inline)
+ vfork();
+}
+
+ATF_TC(backtrace_fmt_basic);
+ATF_TC_HEAD(backtrace_fmt_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test backtrace_fmt(3)");
+ atf_tc_set_md_var(tc, "require.files", "/proc/self");
+}
+
+ATF_TC_BODY(backtrace_fmt_basic, tc)
+{
+ myfunc(12);
+
+ if (prevent_inline)
+ vfork();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, backtrace_fmt_basic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_acos.c b/contrib/netbsd-tests/lib/libm/t_acos.c
new file mode 100644
index 0000000..f051fb6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_acos.c
@@ -0,0 +1,105 @@
+/* $NetBSD: t_acos.c,v 1.10 2014/03/05 20:14:46 dsl Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <math.h>
+#include "t_libm.h"
+
+/*
+ * acos(3) and acosf(3)
+ */
+
+ATF_LIBM_TEST(acos_is_nan, "Test acos/acosf(x) == NaN, x = NaN, +/-Inf, ![-1..1]")
+{
+ static const double x[] = {
+ -1.000000001, 1.000000001,
+ -1.0000001, 1.0000001,
+ -1.1, 1.1,
+#ifndef __vax__
+ T_LIBM_NAN,
+ T_LIBM_MINUS_INF, T_LIBM_PLUS_INF,
+#endif
+ };
+ unsigned int i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+ T_LIBM_CHECK_NAN(i, acos, x[i]);
+ if (i < 2)
+ /* Values are too small for float */
+ continue;
+ T_LIBM_CHECK_NAN(i, acosf, x[i]);
+ }
+}
+
+ATF_LIBM_TEST(acos_inrange, "Test acos/acosf(x) for some valid values")
+{
+ static const struct {
+ double x;
+ double y;
+ } values[] = {
+ { -1, M_PI, },
+ { -0.99, 3.000053180265366, },
+ { -0.5, 2.094395102393195, },
+ { -0.1, 1.670963747956456, },
+ { 0, M_PI / 2, },
+ { 0.1, 1.470628905633337, },
+ { 0.5, 1.047197551196598, },
+ { 0.99, 0.141539473324427, },
+ };
+ unsigned int i;
+
+ /*
+ * Note that acos(x) might be calculated as atan2(sqrt(1-x*x),x).
+ * This means that acos(-1) is atan2(+0,-1), if the sign is wrong
+ * the value will be -M_PI (atan2(-0,-1)) not M_PI.
+ */
+
+ for (i = 0; i < __arraycount(values); i++) {
+ T_LIBM_CHECK(i, acos, values[i].x, values[i].y, 1.0e-15);
+ T_LIBM_CHECK(i, acosf, values[i].x, values[i].y, 1.0e-5);
+ }
+}
+
+ATF_LIBM_TEST(acos_is_plus_zero, "Test acosf(1.0) == +0.0")
+{
+ T_LIBM_CHECK_PLUS_ZERO(0, acos, 1.0);
+ T_LIBM_CHECK_PLUS_ZERO(0, acosf, 1.0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, acos_inrange);
+ ATF_TP_ADD_TC(tp, acos_is_nan);
+ ATF_TP_ADD_TC(tp, acos_is_plus_zero);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_asin.c b/contrib/netbsd-tests/lib/libm/t_asin.c
new file mode 100644
index 0000000..06de852
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_asin.c
@@ -0,0 +1,296 @@
+/* $NetBSD: t_asin.c,v 1.3 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <math.h>
+
+static const struct {
+ double x;
+ double y;
+} values[] = {
+ { -1.0, -M_PI / 2, },
+ { -0.9, -1.119769514998634, },
+ { -0.5, -M_PI / 6, },
+ { -0.1, -0.1001674211615598, },
+ { 0.1, 0.1001674211615598, },
+ { 0.5, M_PI / 6, },
+ { 0.9, 1.119769514998634, },
+ { 1.0, M_PI / 2, },
+};
+
+/*
+ * asin(3)
+ */
+ATF_TC(asin_nan);
+ATF_TC_HEAD(asin_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asin(NaN) == NaN");
+}
+
+ATF_TC_BODY(asin_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ if (isnan(asin(x)) == 0)
+ atf_tc_fail_nonfatal("asin(NaN) != NaN");
+}
+
+ATF_TC(asin_inf_neg);
+ATF_TC_HEAD(asin_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asin(-Inf) == NaN");
+}
+
+ATF_TC_BODY(asin_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+
+ if (isnan(asin(x)) == 0)
+ atf_tc_fail_nonfatal("asin(-Inf) != NaN");
+}
+
+ATF_TC(asin_inf_pos);
+ATF_TC_HEAD(asin_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asin(+Inf) == NaN");
+}
+
+ATF_TC_BODY(asin_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ if (isnan(asin(x)) == 0)
+ atf_tc_fail_nonfatal("asin(+Inf) != NaN");
+}
+
+ATF_TC(asin_range);
+ATF_TC_HEAD(asin_range, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asin(x) == NaN, x < -1, x > 1");
+}
+
+ATF_TC_BODY(asin_range, tc)
+{
+ const double x[] = { -1.1, -1.000000001, 1.1, 1.000000001 };
+ size_t i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ if (isnan(asin(x[i])) == 0)
+ atf_tc_fail_nonfatal("asin(%f) != NaN", x[i]);
+ }
+}
+
+ATF_TC(asin_inrange);
+ATF_TC_HEAD(asin_inrange, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asin(x) for some values");
+}
+
+ATF_TC_BODY(asin_inrange, tc)
+{
+ const double eps = 1.0e-15;
+ double y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(values); i++) {
+ y = asin(values[i].x);
+ if (fabs(y - values[i].y) > eps)
+ atf_tc_fail_nonfatal("asin(%g) != %g",
+ values[i].x, values[i].y);
+ }
+}
+
+ATF_TC(asin_zero_neg);
+ATF_TC_HEAD(asin_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asin(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(asin_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = asin(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("asin(-0.0) != -0.0");
+}
+
+ATF_TC(asin_zero_pos);
+ATF_TC_HEAD(asin_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asin(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(asin_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = asin(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("asin(+0.0) != +0.0");
+}
+
+/*
+ * asinf(3)
+ */
+ATF_TC(asinf_nan);
+ATF_TC_HEAD(asinf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asinf(NaN) == NaN");
+}
+
+ATF_TC_BODY(asinf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ if (isnan(asinf(x)) == 0)
+ atf_tc_fail_nonfatal("asinf(NaN) != NaN");
+}
+
+ATF_TC(asinf_inf_neg);
+ATF_TC_HEAD(asinf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asinf(-Inf) == NaN");
+}
+
+ATF_TC_BODY(asinf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+
+ if (isnan(asinf(x)) == 0)
+ atf_tc_fail_nonfatal("asinf(-Inf) != NaN");
+}
+
+ATF_TC(asinf_inf_pos);
+ATF_TC_HEAD(asinf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asinf(+Inf) == NaN");
+}
+
+ATF_TC_BODY(asinf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+ if (isnan(asinf(x)) == 0)
+ atf_tc_fail_nonfatal("asinf(+Inf) != NaN");
+}
+
+ATF_TC(asinf_range);
+ATF_TC_HEAD(asinf_range, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asinf(x) == NaN, x < -1, x > 1");
+}
+
+ATF_TC_BODY(asinf_range, tc)
+{
+ const float x[] = { -1.1, -1.0000001, 1.1, 1.0000001 };
+ size_t i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ if (isnan(asinf(x[i])) == 0)
+ atf_tc_fail_nonfatal("asinf(%f) != NaN", x[i]);
+ }
+}
+
+ATF_TC(asinf_inrange);
+ATF_TC_HEAD(asinf_inrange, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asinf(x) for some values");
+}
+
+ATF_TC_BODY(asinf_inrange, tc)
+{
+ const float eps = 1.0e-6;
+ float x;
+ float y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(values); i++) {
+ x = values[i].x;
+ y = values[i].y;
+ if (fabs(asinf(x) - y) > eps)
+ atf_tc_fail_nonfatal("asinf(%g) != %g", x, y);
+ }
+}
+
+ATF_TC(asinf_zero_neg);
+ATF_TC_HEAD(asinf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asinf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(asinf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = asinf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("asinf(-0.0) != -0.0");
+}
+
+ATF_TC(asinf_zero_pos);
+ATF_TC_HEAD(asinf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test asinf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(asinf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = asinf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("asinf(+0.0) != +0.0");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, asin_nan);
+ ATF_TP_ADD_TC(tp, asin_inf_neg);
+ ATF_TP_ADD_TC(tp, asin_inf_pos);
+ ATF_TP_ADD_TC(tp, asin_range);
+ ATF_TP_ADD_TC(tp, asin_inrange);
+ ATF_TP_ADD_TC(tp, asin_zero_neg);
+ ATF_TP_ADD_TC(tp, asin_zero_pos);
+
+ ATF_TP_ADD_TC(tp, asinf_nan);
+ ATF_TP_ADD_TC(tp, asinf_inf_neg);
+ ATF_TP_ADD_TC(tp, asinf_inf_pos);
+ ATF_TP_ADD_TC(tp, asinf_range);
+ ATF_TP_ADD_TC(tp, asinf_inrange);
+ ATF_TP_ADD_TC(tp, asinf_zero_neg);
+ ATF_TP_ADD_TC(tp, asinf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_atan.c b/contrib/netbsd-tests/lib/libm/t_atan.c
new file mode 100644
index 0000000..c3aa15f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_atan.c
@@ -0,0 +1,101 @@
+/* $NetBSD: t_atan.c,v 1.15 2014/03/17 11:08:11 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <math.h>
+#include "t_libm.h"
+
+static const struct {
+ double x;
+ double y;
+} values[] = {
+#ifndef __vax__
+ /* vax has no +/- INF */
+ { T_LIBM_MINUS_INF, -M_PI / 2 },
+ { T_LIBM_PLUS_INF, M_PI / 2 },
+#endif
+ { -100, -1.560796660108231, },
+ { -10, -1.471127674303735, },
+ { -1, -M_PI / 4, },
+ { -0.1, -0.09966865249116204, },
+ { 0.1, 0.09966865249116204, },
+ { 1, M_PI / 4, },
+ { 10, 1.471127674303735, },
+ { 100, 1.560796660108231, },
+};
+
+/*
+ * atan(3)
+ */
+ATF_LIBM_TEST(atan_nan, "Test atan/atanf(NaN) == NaN")
+{
+#ifdef T_LIBM_NAN
+ T_LIBM_CHECK_NAN(0, atan, T_LIBM_NAN);
+ T_LIBM_CHECK_NAN(0, atanf, T_LIBM_NAN);
+#else
+ atf_tc_skip("no NaN on this machine");
+#endif
+}
+
+ATF_LIBM_TEST(atan_inrange, "Test atan/atanf(x) for some values")
+{
+ unsigned int i;
+
+ for (i = 0; i < __arraycount(values); i++) {
+ T_LIBM_CHECK(i, atan, values[i].x, values[i].y, 1.0e-15);
+ T_LIBM_CHECK(i, atanf, values[i].x, values[i].y, 1.0e-7);
+ }
+}
+
+ATF_LIBM_TEST(atan_zero_neg, "Test atan/atanf(-0.0) == -0.0")
+{
+
+ T_LIBM_CHECK_MINUS_ZERO(0, atan, -0.0);
+ T_LIBM_CHECK_MINUS_ZERO(0, atanf, -0.0);
+}
+
+ATF_LIBM_TEST(atan_zero_pos, "Test atan/atanf(+0.0) == +0.0")
+{
+
+ T_LIBM_CHECK_PLUS_ZERO(0, atan, +0.0);
+ T_LIBM_CHECK_PLUS_ZERO(0, atanf, +0.0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, atan_nan);
+ ATF_TP_ADD_TC(tp, atan_inrange);
+ ATF_TP_ADD_TC(tp, atan_zero_neg);
+ ATF_TP_ADD_TC(tp, atan_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_cbrt.c b/contrib/netbsd-tests/lib/libm/t_cbrt.c
new file mode 100644
index 0000000..a7de9f6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_cbrt.c
@@ -0,0 +1,366 @@
+/* $NetBSD: t_cbrt.c,v 1.3 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_cbrt.c,v 1.3 2014/03/03 10:39:08 martin Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+#include <stdio.h>
+
+/*
+ * cbrt(3)
+ */
+ATF_TC(cbrt_nan);
+ATF_TC_HEAD(cbrt_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrt(NaN) == NaN");
+}
+
+ATF_TC_BODY(cbrt_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(cbrt(x)) != 0);
+}
+
+ATF_TC(cbrt_pow);
+ATF_TC_HEAD(cbrt_pow, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrt(3) vs. pow(3)");
+}
+
+ATF_TC_BODY(cbrt_pow, tc)
+{
+ const double x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 };
+ const double eps = 1.0e-14;
+ double y, z;
+ size_t i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ y = cbrt(x[i]);
+ z = pow(x[i], 1.0 / 3.0);
+
+ if (fabs(y - z) > eps)
+ atf_tc_fail_nonfatal("cbrt(%0.03f) != "
+ "pow(%0.03f, 1/3)\n", x[i], x[i]);
+ }
+}
+
+ATF_TC(cbrt_inf_neg);
+ATF_TC_HEAD(cbrt_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrt(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(cbrt_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double y = cbrt(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) != 0);
+}
+
+ATF_TC(cbrt_inf_pos);
+ATF_TC_HEAD(cbrt_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrt(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(cbrt_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = cbrt(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(cbrt_zero_neg);
+ATF_TC_HEAD(cbrt_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrt(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(cbrt_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = cbrt(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("cbrt(-0.0) != -0.0");
+}
+
+ATF_TC(cbrt_zero_pos);
+ATF_TC_HEAD(cbrt_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrt(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(cbrt_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = cbrt(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("cbrt(+0.0) != +0.0");
+}
+
+/*
+ * cbrtf(3)
+ */
+ATF_TC(cbrtf_nan);
+ATF_TC_HEAD(cbrtf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtf(NaN) == NaN");
+}
+
+ATF_TC_BODY(cbrtf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(cbrtf(x)) != 0);
+}
+
+ATF_TC(cbrtf_powf);
+ATF_TC_HEAD(cbrtf_powf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtf(3) vs. powf(3)");
+}
+
+ATF_TC_BODY(cbrtf_powf, tc)
+{
+ const float x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 };
+ const float eps = 1.0e-5;
+ float y, z;
+ size_t i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ y = cbrtf(x[i]);
+ z = powf(x[i], 1.0 / 3.0);
+
+ if (fabsf(y - z) > eps)
+ atf_tc_fail_nonfatal("cbrtf(%0.03f) != "
+ "powf(%0.03f, 1/3)\n", x[i], x[i]);
+ }
+}
+
+ATF_TC(cbrtf_inf_neg);
+ATF_TC_HEAD(cbrtf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtf(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(cbrtf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float y = cbrtf(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) != 0);
+}
+
+ATF_TC(cbrtf_inf_pos);
+ATF_TC_HEAD(cbrtf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(cbrtf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = cbrtf(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(cbrtf_zero_neg);
+ATF_TC_HEAD(cbrtf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(cbrtf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = cbrtf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("cbrtf(-0.0) != -0.0");
+}
+
+ATF_TC(cbrtf_zero_pos);
+ATF_TC_HEAD(cbrtf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(cbrtf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = cbrtf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("cbrtf(+0.0) != +0.0");
+}
+
+/*
+ * cbrtl(3)
+ */
+ATF_TC(cbrtl_nan);
+ATF_TC_HEAD(cbrtl_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtl(NaN) == NaN");
+}
+
+ATF_TC_BODY(cbrtl_nan, tc)
+{
+ const long double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(cbrtl(x)) != 0);
+}
+
+ATF_TC(cbrtl_powl);
+ATF_TC_HEAD(cbrtl_powl, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtl(3) vs. powl(3)");
+}
+
+ATF_TC_BODY(cbrtl_powl, tc)
+{
+ const long double x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 };
+ const long double eps = 1.0e-15;
+ long double y, z;
+ size_t i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ y = cbrtl(x[i]);
+ z = powl(x[i], 1.0 / 3.0);
+
+ if (fabsl(y - z) > eps * fabsl(1 + x[i]))
+ atf_tc_fail_nonfatal("cbrtl(%0.03Lf) != "
+ "powl(%0.03Lf, 1/3)\n", x[i], x[i]);
+ }
+}
+
+ATF_TC(cbrtl_inf_neg);
+ATF_TC_HEAD(cbrtl_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtl(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(cbrtl_inf_neg, tc)
+{
+ const long double x = -1.0L / 0.0L;
+ long double y = cbrtl(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) != 0);
+}
+
+ATF_TC(cbrtl_inf_pos);
+ATF_TC_HEAD(cbrtl_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtl(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(cbrtl_inf_pos, tc)
+{
+ const long double x = 1.0L / 0.0L;
+ long double y = cbrtl(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(cbrtl_zero_neg);
+ATF_TC_HEAD(cbrtl_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtl(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(cbrtl_zero_neg, tc)
+{
+ const long double x = -0.0L;
+ long double y = cbrtl(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("cbrtl(-0.0) != -0.0");
+}
+
+ATF_TC(cbrtl_zero_pos);
+ATF_TC_HEAD(cbrtl_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cbrtl(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(cbrtl_zero_pos, tc)
+{
+ const long double x = 0.0L;
+ long double y = cbrtl(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("cbrtl(+0.0) != +0.0");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, cbrt_nan);
+ ATF_TP_ADD_TC(tp, cbrt_pow);
+ ATF_TP_ADD_TC(tp, cbrt_inf_neg);
+ ATF_TP_ADD_TC(tp, cbrt_inf_pos);
+ ATF_TP_ADD_TC(tp, cbrt_zero_neg);
+ ATF_TP_ADD_TC(tp, cbrt_zero_pos);
+
+ ATF_TP_ADD_TC(tp, cbrtf_nan);
+ ATF_TP_ADD_TC(tp, cbrtf_powf);
+ ATF_TP_ADD_TC(tp, cbrtf_inf_neg);
+ ATF_TP_ADD_TC(tp, cbrtf_inf_pos);
+ ATF_TP_ADD_TC(tp, cbrtf_zero_neg);
+ ATF_TP_ADD_TC(tp, cbrtf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, cbrtl_nan);
+ ATF_TP_ADD_TC(tp, cbrtl_powl);
+ ATF_TP_ADD_TC(tp, cbrtl_inf_neg);
+ ATF_TP_ADD_TC(tp, cbrtl_inf_pos);
+ ATF_TP_ADD_TC(tp, cbrtl_zero_neg);
+ ATF_TP_ADD_TC(tp, cbrtl_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_ceil.c b/contrib/netbsd-tests/lib/libm/t_ceil.c
new file mode 100644
index 0000000..b57f30e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_ceil.c
@@ -0,0 +1,931 @@
+/* $NetBSD: t_ceil.c,v 1.10 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_ceil.c,v 1.10 2014/03/03 10:39:08 martin Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+#include <limits.h>
+#include <stdio.h>
+
+#ifdef __vax__
+#define SMALL_NUM 1.0e-38
+#else
+#define SMALL_NUM 1.0e-40
+#endif
+
+/*
+ * ceil(3)
+ */
+ATF_TC(ceil_basic);
+ATF_TC_HEAD(ceil_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of ceil(3)");
+}
+
+ATF_TC_BODY(ceil_basic, tc)
+{
+ const double x = 0.999999999999999;
+ const double y = 0.000000000000001;
+
+ ATF_CHECK(fabs(ceil(x) - 1) < SMALL_NUM);
+ ATF_CHECK(fabs(ceil(y) - 1) < SMALL_NUM);
+}
+
+ATF_TC(ceil_nan);
+ATF_TC_HEAD(ceil_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceil(NaN) == NaN");
+}
+
+ATF_TC_BODY(ceil_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(ceil(x)) != 0);
+}
+
+ATF_TC(ceil_inf_neg);
+ATF_TC_HEAD(ceil_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceil(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(ceil_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double y = ceil(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("ceil(-Inf) != -Inf");
+}
+
+ATF_TC(ceil_inf_pos);
+ATF_TC_HEAD(ceil_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceil(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(ceil_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = ceil(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("ceil(+Inf) != +Inf");
+}
+
+ATF_TC(ceil_zero_neg);
+ATF_TC_HEAD(ceil_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceil(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(ceil_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = ceil(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("ceil(-0.0) != -0.0");
+}
+
+ATF_TC(ceil_zero_pos);
+ATF_TC_HEAD(ceil_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceil(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(ceil_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = ceil(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("ceil(+0.0) != +0.0");
+}
+
+/*
+ * ceilf(3)
+ */
+ATF_TC(ceilf_basic);
+ATF_TC_HEAD(ceilf_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of ceilf(3)");
+}
+
+ATF_TC_BODY(ceilf_basic, tc)
+{
+ const float x = 0.9999999;
+ const float y = 0.0000001;
+
+ ATF_CHECK(fabsf(ceilf(x) - 1) < SMALL_NUM);
+ ATF_CHECK(fabsf(ceilf(y) - 1) < SMALL_NUM);
+}
+
+ATF_TC(ceilf_nan);
+ATF_TC_HEAD(ceilf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceilf(NaN) == NaN");
+}
+
+ATF_TC_BODY(ceilf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(ceilf(x)) != 0);
+}
+
+ATF_TC(ceilf_inf_neg);
+ATF_TC_HEAD(ceilf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceilf(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(ceilf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float y = ceilf(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("ceilf(-Inf) != -Inf");
+}
+
+ATF_TC(ceilf_inf_pos);
+ATF_TC_HEAD(ceilf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceilf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(ceilf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = ceilf(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("ceilf(+Inf) != +Inf");
+}
+
+ATF_TC(ceilf_zero_neg);
+ATF_TC_HEAD(ceilf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceilf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(ceilf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = ceilf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("ceilf(-0.0) != -0.0");
+}
+
+ATF_TC(ceilf_zero_pos);
+ATF_TC_HEAD(ceilf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceilf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(ceilf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = ceilf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("ceilf(+0.0) != +0.0");
+}
+
+/*
+ * ceill(3)
+ */
+ATF_TC(ceill_basic);
+ATF_TC_HEAD(ceill_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of ceill(3)");
+}
+
+ATF_TC_BODY(ceill_basic, tc)
+{
+ const long double x = 0.9999999;
+ const long double y = 0.0000001;
+
+ ATF_CHECK(fabsl(ceill(x) - 1) < SMALL_NUM);
+ ATF_CHECK(fabsl(ceill(y) - 1) < SMALL_NUM);
+}
+
+ATF_TC(ceill_nan);
+ATF_TC_HEAD(ceill_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceill(NaN) == NaN");
+}
+
+ATF_TC_BODY(ceill_nan, tc)
+{
+ const long double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(ceill(x)) != 0);
+}
+
+ATF_TC(ceill_inf_neg);
+ATF_TC_HEAD(ceill_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceill(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(ceill_inf_neg, tc)
+{
+ const long double x = -1.0L / 0.0L;
+ long double y = ceill(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("ceill(-Inf) != -Inf");
+}
+
+ATF_TC(ceill_inf_pos);
+ATF_TC_HEAD(ceill_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceill(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(ceill_inf_pos, tc)
+{
+ const long double x = 1.0L / 0.0L;
+ long double y = ceill(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("ceill(+Inf) != +Inf");
+}
+
+ATF_TC(ceill_zero_neg);
+ATF_TC_HEAD(ceill_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceill(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(ceill_zero_neg, tc)
+{
+ const long double x = -0.0L;
+ long double y = ceill(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("ceill(-0.0) != -0.0");
+}
+
+ATF_TC(ceill_zero_pos);
+ATF_TC_HEAD(ceill_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ceill(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(ceill_zero_pos, tc)
+{
+ const long double x = 0.0L;
+ long double y = ceill(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("ceill(+0.0) != +0.0");
+}
+
+/*
+ * floor(3)
+ */
+ATF_TC(floor_basic);
+ATF_TC_HEAD(floor_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of floor(3)");
+}
+
+ATF_TC_BODY(floor_basic, tc)
+{
+ const double x = 0.999999999999999;
+ const double y = 0.000000000000001;
+
+ ATF_CHECK(floor(x) < SMALL_NUM);
+ ATF_CHECK(floor(y) < SMALL_NUM);
+}
+
+ATF_TC(floor_nan);
+ATF_TC_HEAD(floor_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floor(NaN) == NaN");
+}
+
+ATF_TC_BODY(floor_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(floor(x)) != 0);
+}
+
+ATF_TC(floor_inf_neg);
+ATF_TC_HEAD(floor_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floor(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(floor_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double y = floor(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("floor(-Inf) != -Inf");
+}
+
+ATF_TC(floor_inf_pos);
+ATF_TC_HEAD(floor_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floor(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(floor_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = floor(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("floor(+Inf) != +Inf");
+}
+
+ATF_TC(floor_zero_neg);
+ATF_TC_HEAD(floor_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floor(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(floor_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = floor(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("floor(-0.0) != -0.0");
+}
+
+ATF_TC(floor_zero_pos);
+ATF_TC_HEAD(floor_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floor(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(floor_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = floor(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("floor(+0.0) != +0.0");
+}
+
+/*
+ * floorf(3)
+ */
+ATF_TC(floorf_basic);
+ATF_TC_HEAD(floorf_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of floorf(3)");
+}
+
+ATF_TC_BODY(floorf_basic, tc)
+{
+ const float x = 0.9999999;
+ const float y = 0.0000001;
+
+ ATF_CHECK(floorf(x) < SMALL_NUM);
+ ATF_CHECK(floorf(y) < SMALL_NUM);
+}
+
+ATF_TC(floorf_nan);
+ATF_TC_HEAD(floorf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorf(NaN) == NaN");
+}
+
+ATF_TC_BODY(floorf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(floorf(x)) != 0);
+}
+
+ATF_TC(floorf_inf_neg);
+ATF_TC_HEAD(floorf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorf(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(floorf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float y = floorf(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("floorf(-Inf) != -Inf");
+}
+
+ATF_TC(floorf_inf_pos);
+ATF_TC_HEAD(floorf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(floorf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = floorf(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("floorf(+Inf) != +Inf");
+}
+
+ATF_TC(floorf_zero_neg);
+ATF_TC_HEAD(floorf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(floorf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = floorf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("floorf(-0.0) != -0.0");
+}
+
+ATF_TC(floorf_zero_pos);
+ATF_TC_HEAD(floorf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(floorf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = floorf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("floorf(+0.0) != +0.0");
+}
+
+/*
+ * floorl(3)
+ */
+ATF_TC(floorl_basic);
+ATF_TC_HEAD(floorl_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of floorl(3)");
+}
+
+ATF_TC_BODY(floorl_basic, tc)
+{
+ const long double x = 0.9999999;
+ const long double y = 0.0000001;
+
+ ATF_CHECK(floorl(x) < SMALL_NUM);
+ ATF_CHECK(floorl(y) < SMALL_NUM);
+}
+
+ATF_TC(floorl_nan);
+ATF_TC_HEAD(floorl_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorl(NaN) == NaN");
+}
+
+ATF_TC_BODY(floorl_nan, tc)
+{
+ const long double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(floorl(x)) != 0);
+}
+
+ATF_TC(floorl_inf_neg);
+ATF_TC_HEAD(floorl_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorl(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(floorl_inf_neg, tc)
+{
+ const long double x = -1.0L / 0.0L;
+ long double y = floorl(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("floorl(-Inf) != -Inf");
+}
+
+ATF_TC(floorl_inf_pos);
+ATF_TC_HEAD(floorl_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorl(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(floorl_inf_pos, tc)
+{
+ const long double x = 1.0L / 0.0L;
+ long double y = floorl(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("floorl(+Inf) != +Inf");
+}
+
+ATF_TC(floorl_zero_neg);
+ATF_TC_HEAD(floorl_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorl(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(floorl_zero_neg, tc)
+{
+ const long double x = -0.0L;
+ long double y = floorl(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("floorl(-0.0) != -0.0");
+}
+
+ATF_TC(floorl_zero_pos);
+ATF_TC_HEAD(floorl_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test floorl(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(floorl_zero_pos, tc)
+{
+ const long double x = 0.0L;
+ long double y = floorl(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("floorl(+0.0) != +0.0");
+}
+
+/*
+ * trunc(3)
+ */
+ATF_TC(trunc_basic);
+ATF_TC_HEAD(trunc_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of trunc(3)");
+}
+
+ATF_TC_BODY(trunc_basic, tc)
+{
+ const double x = 0.999999999999999;
+ const double y = 0.000000000000001;
+
+ ATF_CHECK(trunc(x) < SMALL_NUM);
+ ATF_CHECK(trunc(y) < SMALL_NUM);
+}
+
+ATF_TC(trunc_nan);
+ATF_TC_HEAD(trunc_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test trunc(NaN) == NaN");
+}
+
+ATF_TC_BODY(trunc_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(trunc(x)) != 0);
+}
+
+ATF_TC(trunc_inf_neg);
+ATF_TC_HEAD(trunc_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test trunc(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(trunc_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double y = trunc(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("trunc(-Inf) != -Inf");
+}
+
+ATF_TC(trunc_inf_pos);
+ATF_TC_HEAD(trunc_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test trunc(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(trunc_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = trunc(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("trunc(+Inf) != +Inf");
+}
+
+ATF_TC(trunc_zero_neg);
+ATF_TC_HEAD(trunc_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test trunc(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(trunc_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = trunc(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("trunc(-0.0) != -0.0");
+}
+
+ATF_TC(trunc_zero_pos);
+ATF_TC_HEAD(trunc_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test trunc(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(trunc_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = trunc(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("trunc(+0.0) != +0.0");
+}
+
+/*
+ * truncf(3)
+ */
+ATF_TC(truncf_basic);
+ATF_TC_HEAD(truncf_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of truncf(3)");
+}
+
+ATF_TC_BODY(truncf_basic, tc)
+{
+ const float x = 0.9999999;
+ const float y = 0.0000001;
+
+ ATF_CHECK(truncf(x) < SMALL_NUM);
+ ATF_CHECK(truncf(y) < SMALL_NUM);
+}
+
+ATF_TC(truncf_nan);
+ATF_TC_HEAD(truncf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncf(NaN) == NaN");
+}
+
+ATF_TC_BODY(truncf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(truncf(x)) != 0);
+}
+
+ATF_TC(truncf_inf_neg);
+ATF_TC_HEAD(truncf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncf(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(truncf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float y = truncf(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("truncf(-Inf) != -Inf");
+}
+
+ATF_TC(truncf_inf_pos);
+ATF_TC_HEAD(truncf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(truncf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = truncf(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("truncf(+Inf) != +Inf");
+}
+
+ATF_TC(truncf_zero_neg);
+ATF_TC_HEAD(truncf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(truncf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = truncf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("truncf(-0.0) != -0.0");
+}
+
+ATF_TC(truncf_zero_pos);
+ATF_TC_HEAD(truncf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(truncf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = truncf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("truncf(+0.0) != +0.0");
+}
+
+/*
+ * truncl(3)
+ */
+ATF_TC(truncl_basic);
+ATF_TC_HEAD(truncl_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of truncl(3)");
+}
+
+ATF_TC_BODY(truncl_basic, tc)
+{
+ const long double x = 0.9999999;
+ const long double y = 0.0000001;
+
+ ATF_CHECK(truncl(x) < SMALL_NUM);
+ ATF_CHECK(truncl(y) < SMALL_NUM);
+}
+
+ATF_TC(truncl_nan);
+ATF_TC_HEAD(truncl_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncl(NaN) == NaN");
+}
+
+ATF_TC_BODY(truncl_nan, tc)
+{
+ const long double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(truncl(x)) != 0);
+}
+
+ATF_TC(truncl_inf_neg);
+ATF_TC_HEAD(truncl_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncl(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(truncl_inf_neg, tc)
+{
+ const long double x = -1.0L / 0.0L;
+ long double y = truncl(x);
+
+ if (isinf(y) == 0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("truncl(-Inf) != -Inf");
+}
+
+ATF_TC(truncl_inf_pos);
+ATF_TC_HEAD(truncl_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncl(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(truncl_inf_pos, tc)
+{
+ const long double x = 1.0L / 0.0L;
+ long double y = truncl(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("truncl(+Inf) != +Inf");
+}
+
+ATF_TC(truncl_zero_neg);
+ATF_TC_HEAD(truncl_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncl(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(truncl_zero_neg, tc)
+{
+ const long double x = -0.0L;
+ long double y = truncl(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("truncl(-0.0) != -0.0");
+}
+
+ATF_TC(truncl_zero_pos);
+ATF_TC_HEAD(truncl_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test truncl(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(truncl_zero_pos, tc)
+{
+ const long double x = 0.0L;
+ long double y = truncl(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("truncl(+0.0) != +0.0");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, ceil_basic);
+ ATF_TP_ADD_TC(tp, ceil_nan);
+ ATF_TP_ADD_TC(tp, ceil_inf_neg);
+ ATF_TP_ADD_TC(tp, ceil_inf_pos);
+ ATF_TP_ADD_TC(tp, ceil_zero_neg);
+ ATF_TP_ADD_TC(tp, ceil_zero_pos);
+
+ ATF_TP_ADD_TC(tp, ceilf_basic);
+ ATF_TP_ADD_TC(tp, ceilf_nan);
+ ATF_TP_ADD_TC(tp, ceilf_inf_neg);
+ ATF_TP_ADD_TC(tp, ceilf_inf_pos);
+ ATF_TP_ADD_TC(tp, ceilf_zero_neg);
+ ATF_TP_ADD_TC(tp, ceilf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, ceill_basic);
+ ATF_TP_ADD_TC(tp, ceill_nan);
+ ATF_TP_ADD_TC(tp, ceill_inf_neg);
+ ATF_TP_ADD_TC(tp, ceill_inf_pos);
+ ATF_TP_ADD_TC(tp, ceill_zero_neg);
+ ATF_TP_ADD_TC(tp, ceill_zero_pos);
+
+ ATF_TP_ADD_TC(tp, floor_basic);
+ ATF_TP_ADD_TC(tp, floor_nan);
+ ATF_TP_ADD_TC(tp, floor_inf_neg);
+ ATF_TP_ADD_TC(tp, floor_inf_pos);
+ ATF_TP_ADD_TC(tp, floor_zero_neg);
+ ATF_TP_ADD_TC(tp, floor_zero_pos);
+
+ ATF_TP_ADD_TC(tp, floorf_basic);
+ ATF_TP_ADD_TC(tp, floorf_nan);
+ ATF_TP_ADD_TC(tp, floorf_inf_neg);
+ ATF_TP_ADD_TC(tp, floorf_inf_pos);
+ ATF_TP_ADD_TC(tp, floorf_zero_neg);
+ ATF_TP_ADD_TC(tp, floorf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, floorl_basic);
+ ATF_TP_ADD_TC(tp, floorl_nan);
+ ATF_TP_ADD_TC(tp, floorl_inf_neg);
+ ATF_TP_ADD_TC(tp, floorl_inf_pos);
+ ATF_TP_ADD_TC(tp, floorl_zero_neg);
+ ATF_TP_ADD_TC(tp, floorl_zero_pos);
+
+ ATF_TP_ADD_TC(tp, trunc_basic);
+ ATF_TP_ADD_TC(tp, trunc_nan);
+ ATF_TP_ADD_TC(tp, trunc_inf_neg);
+ ATF_TP_ADD_TC(tp, trunc_inf_pos);
+ ATF_TP_ADD_TC(tp, trunc_zero_neg);
+ ATF_TP_ADD_TC(tp, trunc_zero_pos);
+
+ ATF_TP_ADD_TC(tp, truncf_basic);
+ ATF_TP_ADD_TC(tp, truncf_nan);
+ ATF_TP_ADD_TC(tp, truncf_inf_neg);
+ ATF_TP_ADD_TC(tp, truncf_inf_pos);
+ ATF_TP_ADD_TC(tp, truncf_zero_neg);
+ ATF_TP_ADD_TC(tp, truncf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, truncl_basic);
+ ATF_TP_ADD_TC(tp, truncl_nan);
+ ATF_TP_ADD_TC(tp, truncl_inf_neg);
+ ATF_TP_ADD_TC(tp, truncl_inf_pos);
+ ATF_TP_ADD_TC(tp, truncl_zero_neg);
+ ATF_TP_ADD_TC(tp, truncl_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_cos.c b/contrib/netbsd-tests/lib/libm/t_cos.c
new file mode 100644
index 0000000..d99d608
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_cos.c
@@ -0,0 +1,263 @@
+/* $NetBSD: t_cos.c,v 1.4 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <math.h>
+
+static const struct {
+ int angle;
+ double x;
+ double y;
+} angles[] = {
+ { -180, -3.141592653589793, -1.0000000000000000 },
+ { -135, -2.356194490192345, -0.7071067811865476 },
+ { -90, -1.570796326794897, 0.0000000000000000 },
+ { -45, -0.785398163397448, 0.7071067811865476 },
+ { 0, 0.000000000000000, 1.0000000000000000 },
+ { 30, 0.523598775598299, 0.8660254037844386 },
+ { 45, 0.785398163397448, 0.7071067811865476 },
+ { 60, 1.047197551196598, 0.5000000000000000 },
+ { 90, 1.570796326794897, 0.0000000000000000 },
+ { 120, 2.094395102393195, -0.5000000000000000 },
+ { 135, 2.356194490192345, -0.7071067811865476 },
+ { 150, 2.617993877991494, -0.8660254037844386 },
+ { 180, 3.141592653589793, -1.0000000000000000 },
+ { 270, 4.712388980384690, 0.0000000000000000 },
+ { 360, 6.283185307179586, 1.0000000000000000 }
+};
+
+/*
+ * cos(3)
+ */
+ATF_TC(cos_angles);
+ATF_TC_HEAD(cos_angles, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test some selected angles");
+}
+
+ATF_TC_BODY(cos_angles, tc)
+{
+ const double eps = 1.0e-15;
+ size_t i;
+
+ for (i = 0; i < __arraycount(angles); i++) {
+
+ if (fabs(cos(angles[i].x) - angles[i].y) > eps)
+ atf_tc_fail_nonfatal("cos(%d deg) != %0.01f",
+ angles[i].angle, angles[i].y);
+ }
+}
+
+ATF_TC(cos_nan);
+ATF_TC_HEAD(cos_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cos(NaN) == NaN");
+}
+
+ATF_TC_BODY(cos_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(cos(x)) != 0);
+}
+
+ATF_TC(cos_inf_neg);
+ATF_TC_HEAD(cos_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cos(-Inf) == NaN");
+}
+
+ATF_TC_BODY(cos_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+
+ ATF_CHECK(isnan(cos(x)) != 0);
+}
+
+ATF_TC(cos_inf_pos);
+ATF_TC_HEAD(cos_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cos(+Inf) == NaN");
+}
+
+ATF_TC_BODY(cos_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ ATF_CHECK(isnan(cos(x)) != 0);
+}
+
+
+ATF_TC(cos_zero_neg);
+ATF_TC_HEAD(cos_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cos(-0.0) == 1.0");
+}
+
+ATF_TC_BODY(cos_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ ATF_CHECK(cos(x) == 1.0);
+}
+
+ATF_TC(cos_zero_pos);
+ATF_TC_HEAD(cos_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cos(+0.0) == 1.0");
+}
+
+ATF_TC_BODY(cos_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ ATF_CHECK(cos(x) == 1.0);
+}
+
+/*
+ * cosf(3)
+ */
+ATF_TC(cosf_angles);
+ATF_TC_HEAD(cosf_angles, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test some selected angles");
+}
+
+ATF_TC_BODY(cosf_angles, tc)
+{
+ const float eps = 1.0e-7;
+ float x, y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(angles); i++) {
+
+ x = angles[i].x;
+ y = angles[i].y;
+
+ if (fabsf(cosf(x) - y) > eps)
+ atf_tc_fail_nonfatal("cosf(%d deg) != %0.01f",
+ angles[i].angle, angles[i].y);
+ }
+}
+
+ATF_TC(cosf_nan);
+ATF_TC_HEAD(cosf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosf(NaN) == NaN");
+}
+
+ATF_TC_BODY(cosf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(cosf(x)) != 0);
+}
+
+ATF_TC(cosf_inf_neg);
+ATF_TC_HEAD(cosf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosf(-Inf) == NaN");
+}
+
+ATF_TC_BODY(cosf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+
+ if (isnan(cosf(x)) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("cosf(-Inf) != NaN");
+ }
+}
+
+ATF_TC(cosf_inf_pos);
+ATF_TC_HEAD(cosf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosf(+Inf) == NaN");
+}
+
+ATF_TC_BODY(cosf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+ if (isnan(cosf(x)) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("cosf(+Inf) != NaN");
+ }
+}
+
+
+ATF_TC(cosf_zero_neg);
+ATF_TC_HEAD(cosf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosf(-0.0) == 1.0");
+}
+
+ATF_TC_BODY(cosf_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ ATF_CHECK(cosf(x) == 1.0);
+}
+
+ATF_TC(cosf_zero_pos);
+ATF_TC_HEAD(cosf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosf(+0.0) == 1.0");
+}
+
+ATF_TC_BODY(cosf_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ ATF_CHECK(cosf(x) == 1.0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, cos_angles);
+ ATF_TP_ADD_TC(tp, cos_nan);
+ ATF_TP_ADD_TC(tp, cos_inf_neg);
+ ATF_TP_ADD_TC(tp, cos_inf_pos);
+ ATF_TP_ADD_TC(tp, cos_zero_neg);
+ ATF_TP_ADD_TC(tp, cos_zero_pos);
+
+ ATF_TP_ADD_TC(tp, cosf_angles);
+ ATF_TP_ADD_TC(tp, cosf_nan);
+ ATF_TP_ADD_TC(tp, cosf_inf_neg);
+ ATF_TP_ADD_TC(tp, cosf_inf_pos);
+ ATF_TP_ADD_TC(tp, cosf_zero_neg);
+ ATF_TP_ADD_TC(tp, cosf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_cosh.c b/contrib/netbsd-tests/lib/libm/t_cosh.c
new file mode 100644
index 0000000..3f998de
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_cosh.c
@@ -0,0 +1,270 @@
+/* $NetBSD: t_cosh.c,v 1.6 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_cosh.c,v 1.6 2014/03/03 10:39:08 martin Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+#include <stdio.h>
+
+static const struct {
+ double x;
+ double y;
+ double e;
+} values[] = {
+ { -10, 11013.23292010332, 1e4, },
+ { -2, 3.762195691083631, 1, },
+ { -1, 1.543080634815244, 1, },
+ { -0.05, 1.001250260438369, 1, },
+ { -0.001, 1.000000500000042, 1, },
+ { 0, 1, 1, },
+ { 0.001, 1.000000500000042, 1, },
+ { 0.05, 1.001250260438369, 1, },
+ { 1, 1.543080634815244, 1, },
+ { 2, 3.762195691083631, 1, },
+ { 10, 11013.23292010332, 1e4, },
+};
+
+/*
+ * cosh(3)
+ */
+ATF_TC(cosh_inrange);
+ATF_TC_HEAD(cosh_inrange, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "cosh(x) for some values");
+}
+
+ATF_TC_BODY(cosh_inrange, tc)
+{
+ double eps;
+ double x;
+ double y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(values); i++) {
+ x = values[i].x;
+ y = values[i].y;
+ eps = 1e-15 * values[i].e;
+
+ if (fabs(cosh(x) - y) > eps)
+ atf_tc_fail_nonfatal("cosh(%g) != %g\n", x, y);
+ }
+}
+
+ATF_TC(cosh_nan);
+ATF_TC_HEAD(cosh_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosh(NaN) == NaN");
+}
+
+ATF_TC_BODY(cosh_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(cosh(x)) != 0);
+}
+
+ATF_TC(cosh_inf_neg);
+ATF_TC_HEAD(cosh_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosh(-Inf) == +Inf");
+}
+
+ATF_TC_BODY(cosh_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double y = cosh(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(cosh_inf_pos);
+ATF_TC_HEAD(cosh_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosh(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(cosh_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = cosh(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(cosh_zero_neg);
+ATF_TC_HEAD(cosh_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosh(-0.0) == 1.0");
+}
+
+ATF_TC_BODY(cosh_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ if (cosh(x) != 1.0)
+ atf_tc_fail_nonfatal("cosh(-0.0) != 1.0");
+}
+
+ATF_TC(cosh_zero_pos);
+ATF_TC_HEAD(cosh_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test cosh(+0.0) == 1.0");
+}
+
+ATF_TC_BODY(cosh_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ if (cosh(x) != 1.0)
+ atf_tc_fail_nonfatal("cosh(+0.0) != 1.0");
+}
+
+/*
+ * coshf(3)
+ */
+ATF_TC(coshf_inrange);
+ATF_TC_HEAD(coshf_inrange, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "coshf(x) for some values");
+}
+
+ATF_TC_BODY(coshf_inrange, tc)
+{
+ float eps;
+ float x;
+ float y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(values); i++) {
+ x = values[i].x;
+ y = values[i].y;
+ eps = 1e-6 * values[i].e;
+
+ if (fabsf(coshf(x) - y) > eps)
+ atf_tc_fail_nonfatal("coshf(%g) != %g\n", x, y);
+ }
+}
+
+ATF_TC(coshf_nan);
+ATF_TC_HEAD(coshf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coshf(NaN) == NaN");
+}
+
+ATF_TC_BODY(coshf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(coshf(x)) != 0);
+}
+
+ATF_TC(coshf_inf_neg);
+ATF_TC_HEAD(coshf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coshf(-Inf) == +Inf");
+}
+
+ATF_TC_BODY(coshf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float y = coshf(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(coshf_inf_pos);
+ATF_TC_HEAD(coshf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coshf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(coshf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = coshf(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(coshf_zero_neg);
+ATF_TC_HEAD(coshf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coshf(-0.0) == 1.0");
+}
+
+ATF_TC_BODY(coshf_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ if (coshf(x) != 1.0)
+ atf_tc_fail_nonfatal("coshf(-0.0) != 1.0");
+}
+
+ATF_TC(coshf_zero_pos);
+ATF_TC_HEAD(coshf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coshf(+0.0) == 1.0");
+}
+
+ATF_TC_BODY(coshf_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ if (coshf(x) != 1.0)
+ atf_tc_fail_nonfatal("coshf(+0.0) != 1.0");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, cosh_inrange);
+ ATF_TP_ADD_TC(tp, cosh_nan);
+ ATF_TP_ADD_TC(tp, cosh_inf_neg);
+ ATF_TP_ADD_TC(tp, cosh_inf_pos);
+ ATF_TP_ADD_TC(tp, cosh_zero_neg);
+ ATF_TP_ADD_TC(tp, cosh_zero_pos);
+
+ ATF_TP_ADD_TC(tp, coshf_inrange);
+ ATF_TP_ADD_TC(tp, coshf_nan);
+ ATF_TP_ADD_TC(tp, coshf_inf_neg);
+ ATF_TP_ADD_TC(tp, coshf_inf_pos);
+ ATF_TP_ADD_TC(tp, coshf_zero_neg);
+ ATF_TP_ADD_TC(tp, coshf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_erf.c b/contrib/netbsd-tests/lib/libm/t_erf.c
new file mode 100644
index 0000000..25bbae7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_erf.c
@@ -0,0 +1,299 @@
+/* $NetBSD: t_erf.c,v 1.2 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_erf.c,v 1.2 2014/03/03 10:39:08 martin Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+
+/*
+ * erf(3)
+ */
+ATF_TC(erf_nan);
+ATF_TC_HEAD(erf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erf(NaN) == NaN");
+}
+
+ATF_TC_BODY(erf_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(erf(x)) != 0);
+}
+
+ATF_TC(erf_inf_neg);
+ATF_TC_HEAD(erf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erf(-Inf) == -1.0");
+}
+
+ATF_TC_BODY(erf_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+
+ if (erf(x) != -1.0)
+ atf_tc_fail_nonfatal("erf(-Inf) != -1.0");
+}
+
+ATF_TC(erf_inf_pos);
+ATF_TC_HEAD(erf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erf(+Inf) == 1.0");
+}
+
+ATF_TC_BODY(erf_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ if (erf(x) != 1.0)
+ atf_tc_fail_nonfatal("erf(+Inf) != 1.0");
+}
+
+ATF_TC(erf_zero_neg);
+ATF_TC_HEAD(erf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(erf_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = erf(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("erf(-0.0) != -0.0");
+}
+
+ATF_TC(erf_zero_pos);
+ATF_TC_HEAD(erf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(erf_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = erf(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("erf(+0.0) != +0.0");
+}
+
+/*
+ * erff(3)
+ */
+ATF_TC(erff_nan);
+ATF_TC_HEAD(erff_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erff(NaN) == NaN");
+}
+
+ATF_TC_BODY(erff_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(erff(x)) != 0);
+}
+
+ATF_TC(erff_inf_neg);
+ATF_TC_HEAD(erff_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erff(-Inf) == -1.0");
+}
+
+ATF_TC_BODY(erff_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+
+ if (erff(x) != -1.0)
+ atf_tc_fail_nonfatal("erff(-Inf) != -1.0");
+}
+
+ATF_TC(erff_inf_pos);
+ATF_TC_HEAD(erff_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erff(+Inf) == 1.0");
+}
+
+ATF_TC_BODY(erff_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+ if (erff(x) != 1.0)
+ atf_tc_fail_nonfatal("erff(+Inf) != 1.0");
+}
+
+ATF_TC(erff_zero_neg);
+ATF_TC_HEAD(erff_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erff(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(erff_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = erff(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("erff(-0.0) != -0.0");
+}
+
+ATF_TC(erff_zero_pos);
+ATF_TC_HEAD(erff_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erff(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(erff_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = erff(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("erff(+0.0) != +0.0");
+}
+
+/*
+ * erfc(3)
+ */
+ATF_TC(erfc_nan);
+ATF_TC_HEAD(erfc_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erfc(NaN) == NaN");
+}
+
+ATF_TC_BODY(erfc_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(erfc(x)) != 0);
+}
+
+ATF_TC(erfc_inf_neg);
+ATF_TC_HEAD(erfc_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erfc(-Inf) == 2.0");
+}
+
+ATF_TC_BODY(erfc_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+
+ if (erfc(x) != 2.0)
+ atf_tc_fail_nonfatal("erfc(-Inf) != 2.0");
+}
+
+ATF_TC(erfc_inf_pos);
+ATF_TC_HEAD(erfc_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erfc(+Inf) == +0.0");
+}
+
+ATF_TC_BODY(erfc_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = erfc(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("erfc(+Inf) != +0.0");
+}
+
+/*
+ * erfcf(3)
+ */
+ATF_TC(erfcf_nan);
+ATF_TC_HEAD(erfcf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erfcf(NaN) == NaN");
+}
+
+ATF_TC_BODY(erfcf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(erfcf(x)) != 0);
+}
+
+ATF_TC(erfcf_inf_neg);
+ATF_TC_HEAD(erfcf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erfcf(-Inf) == 2.0");
+}
+
+ATF_TC_BODY(erfcf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+
+ if (erfcf(x) != 2.0)
+ atf_tc_fail_nonfatal("erfcf(-Inf) != 2.0");
+}
+
+ATF_TC(erfcf_inf_pos);
+ATF_TC_HEAD(erfcf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test erfcf(+Inf) == +0.0");
+}
+
+ATF_TC_BODY(erfcf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = erfcf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("erfcf(+Inf) != +0.0");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, erf_nan);
+ ATF_TP_ADD_TC(tp, erf_inf_neg);
+ ATF_TP_ADD_TC(tp, erf_inf_pos);
+ ATF_TP_ADD_TC(tp, erf_zero_neg);
+ ATF_TP_ADD_TC(tp, erf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, erff_nan);
+ ATF_TP_ADD_TC(tp, erff_inf_neg);
+ ATF_TP_ADD_TC(tp, erff_inf_pos);
+ ATF_TP_ADD_TC(tp, erff_zero_neg);
+ ATF_TP_ADD_TC(tp, erff_zero_pos);
+
+ ATF_TP_ADD_TC(tp, erfc_nan);
+ ATF_TP_ADD_TC(tp, erfc_inf_neg);
+ ATF_TP_ADD_TC(tp, erfc_inf_pos);
+
+ ATF_TP_ADD_TC(tp, erfcf_nan);
+ ATF_TP_ADD_TC(tp, erfcf_inf_neg);
+ ATF_TP_ADD_TC(tp, erfcf_inf_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_exp.c b/contrib/netbsd-tests/lib/libm/t_exp.c
new file mode 100644
index 0000000..6d41097
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_exp.c
@@ -0,0 +1,567 @@
+/* $NetBSD: t_exp.c,v 1.7 2014/03/17 11:08:11 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <math.h>
+#include "t_libm.h"
+
+/* y = exp(x) */
+static const struct {
+ double x;
+ double y;
+ double e;
+} exp_values[] = {
+ { -10, 0.4539992976248485e-4, 1e-4, },
+ { -5, 0.6737946999085467e-2, 1e-2, },
+ { -1, 0.3678794411714423, 1e-1, },
+ { -0.1, 0.9048374180359595, 1e-1, },
+ { 0, 1.0000000000000000, 1, },
+ { 0.1, 1.1051709180756477, 1, },
+ { 1, 2.7182818284590452, 1, },
+ { 5, 148.41315910257660, 1e2, },
+ { 10, 22026.465794806718, 1e4, },
+};
+
+/*
+ * exp2/exp2f(3)
+ */
+ATF_LIBM_TEST(exp2_is_nan, "Test exp2(x) == NaN")
+{
+#ifdef T_LIBM_NAN
+ T_LIBM_CHECK_NAN(0, exp2, T_LIBM_NAN);
+ T_LIBM_CHECK_NAN(0, exp2f, T_LIBM_NAN);
+#else
+ atf_tc_skip("no NaN on this machine");
+#endif
+}
+
+ATF_LIBM_TEST(exp2_is_plus_zero, "Test exp2(x) == +0.0")
+{
+#ifdef T_LIBM_MINUS_INF
+ T_LIBM_CHECK_PLUS_ZERO(0, exp2, T_LIBM_MINUS_INF);
+ T_LIBM_CHECK_PLUS_ZERO(0, exp2f, T_LIBM_MINUS_INF);
+#else
+ atf_tc_skip("no +/-Inf on this machine");
+#endif
+}
+
+ATF_LIBM_TEST(exp2_powers, "Test exp2(x) is correct for some integer x")
+{
+ static const struct {
+ double x;
+ double d_y;
+ double f_y;
+ } v[] = {
+ { +0.0, 1.0, 1.0 },
+ { -0.0, 1.0, 1.0 },
+ { 1, 0x1p1, 0x1p1 },
+ { 2, 0x1p2, 0x1p2 },
+ { 100, 0x1p100, 0x1p100 },
+ { 125, 0x1p125, 0x1p125 },
+ { 126, 0x1p126, 0x1p126 },
+#if __DBL_MAX_EXP__ > 129
+ { 127, 0x1p127, 0x1p127 },
+#endif
+#ifdef T_LIBM_PLUS_INF
+ { 128, 0x1p128, T_LIBM_PLUS_INF },
+ { 129, 0x1p129, T_LIBM_PLUS_INF },
+ { 1000, 0x1p1000, T_LIBM_PLUS_INF },
+ { 1020, 0x1p1020, T_LIBM_PLUS_INF },
+ { 1023, 0x1p1023, T_LIBM_PLUS_INF },
+ { 1024, T_LIBM_PLUS_INF, T_LIBM_PLUS_INF },
+ { 1030, T_LIBM_PLUS_INF, T_LIBM_PLUS_INF },
+ { 1050, T_LIBM_PLUS_INF, T_LIBM_PLUS_INF },
+ { 2000, T_LIBM_PLUS_INF, T_LIBM_PLUS_INF },
+ { 16383, T_LIBM_PLUS_INF, T_LIBM_PLUS_INF },
+ { 16384, T_LIBM_PLUS_INF, T_LIBM_PLUS_INF },
+ { 16385, T_LIBM_PLUS_INF, T_LIBM_PLUS_INF },
+#endif
+ { -1, 0x1p-1, 0x1p-1 },
+ { -2, 0x1p-2, 0x1p-2 },
+ { -100, 0x1p-100, 0x1p-100 },
+ { -127, 0x1p-127, 0x1p-127 },
+ { -128, 0x1p-128, 0x1p-128 },
+#if __LDBL_MIN_EXP__ < -129
+ { -300, 0x1p-300, 0.0},
+ { -400, 0x1p-400, 0.0},
+ {-1000, 0x1p-1000, 0.0},
+ {-1022, 0x1p-1022, 0.0},
+ /* These should be denormal numbers */
+ {-1023, 0x1p-1023, 0.0},
+ {-1024, 0x1p-1024, 0.0},
+ {-1040, 0x1p-1040, 0.0},
+ {-1060, 0x1p-1060, 0.0},
+ /* This is the smallest result gcc will allow */
+ {-1074, 0x1p-1074, 0.0},
+#endif
+ {-1075, 0x0, 0.0},
+ {-1080, 0x0, 0.0},
+ {-2000, 0x0, 0.0},
+ {-16382, 0x0, 0.0},
+ {-16383, 0x0, 0.0},
+ {-16384, 0x0, 0.0},
+ };
+ unsigned int i;
+
+ for (i = 0; i < __arraycount(v); i++) {
+ T_LIBM_CHECK(i, exp2, v[i].x, v[i].d_y, 0.0);
+ T_LIBM_CHECK(i, exp2f, v[i].x, v[i].f_y, 0.0);
+ }
+}
+
+ATF_LIBM_TEST(exp2_values, "Test exp2(x) is correct for some x")
+{
+ static const struct {
+ double x;
+ double y;
+ double d_eps;
+ double f_eps;
+ } v[] = {
+#if __DBL_MAX_EXP__ > 128
+ /* The largest double constant */
+ { 0x1.fffffffffffffp9, 0x1.ffffffffffd3ap1023,
+ 0x1p969, 0.0 },
+ /* The largest float constant */
+ { 0x1.fffffep6, 0x1.ffff4ep+127, 6e30, 0.0 },
+#endif
+#ifdef T_LIBM_PLUS_INF
+ { T_LIBM_PLUS_INF, T_LIBM_PLUS_INF, 0.0, 0.0 },
+#endif
+
+ /* The few values from the old tests */
+ /* Results from i386/amd64, d_eps needed on i386 */
+ { 1.1, 0x1.125fbee250664p+1, 0x1p-52, 0x1.8p-22 },
+ { 2.2, 0x1.2611186bae675p+2, 0x1p-51, 0x1.8p-21 },
+ { 3.3, 0x1.3b2c47bff8328p+3, 0x1p-50, 0x1.8p-20 },
+ { 4.4, 0x1.51cb453b9536ep+4, 0x1p-49, 0x1.8p-19 },
+ { 5.5, 0x1.6a09e667f3bcdp+5, 0x1p-48, 0x1.8p-18 },
+ { 6.6, 0x1.8406003b2ae5bp+6, 0x1p-47, 0x1.8p-17 },
+ /*
+ * These two currently fail for 'float'.
+ * 8.8 is definitely out by more than it should be.
+ */
+ { 7.7, 0x1.9fdf8bcce533ep+7, 0x1p-46, 0x1.8p-16 },
+ { 8.8, 0x1.bdb8cdadbe124p+8, 0x1p-45, 0x1.8p-15 },
+ };
+ unsigned int i;
+
+ for (i = 0; i < __arraycount(v); i++) {
+ T_LIBM_CHECK(i, exp2, v[i].x, v[i].y, v[i].d_eps);
+ if (i > 1)
+ T_LIBM_CHECK(i, exp2f, v[i].x, v[i].y, v[i].f_eps);
+ }
+}
+
+
+/*
+ * exp(3)
+ */
+ATF_TC(exp_nan);
+ATF_TC_HEAD(exp_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test exp(NaN) == NaN");
+}
+
+ATF_TC_BODY(exp_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ if (isnan(exp(x)) == 0)
+ atf_tc_fail_nonfatal("exp(NaN) != NaN");
+}
+
+ATF_TC(exp_inf_neg);
+ATF_TC_HEAD(exp_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test exp(-Inf) == +0.0");
+}
+
+ATF_TC_BODY(exp_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double y = exp(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("exp(-Inf) != +0.0");
+}
+
+ATF_TC(exp_inf_pos);
+ATF_TC_HEAD(exp_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test exp(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(exp_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = exp(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("exp(+Inf) != +Inf");
+}
+
+ATF_TC(exp_product);
+ATF_TC_HEAD(exp_product, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test some selected exp(x)");
+}
+
+ATF_TC_BODY(exp_product, tc)
+{
+ double eps;
+ double x;
+ double y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exp_values); i++) {
+ x = exp_values[i].x;
+ y = exp_values[i].y;
+ eps = 1e-15 * exp_values[i].e;
+
+ if (fabs(exp(x) - y) > eps)
+ atf_tc_fail_nonfatal("exp(%0.01f) != %18.18e", x, y);
+ }
+}
+
+ATF_TC(exp_zero_neg);
+ATF_TC_HEAD(exp_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test exp(-0.0) == 1.0");
+}
+
+ATF_TC_BODY(exp_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ if (fabs(exp(x) - 1.0) > 0.0)
+ atf_tc_fail_nonfatal("exp(-0.0) != 1.0");
+}
+
+ATF_TC(exp_zero_pos);
+ATF_TC_HEAD(exp_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test exp(+0.0) == 1.0");
+}
+
+ATF_TC_BODY(exp_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ if (fabs(exp(x) - 1.0) > 0.0)
+ atf_tc_fail_nonfatal("exp(+0.0) != 1.0");
+}
+
+/*
+ * expf(3)
+ */
+ATF_TC(expf_nan);
+ATF_TC_HEAD(expf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expf(NaN) == NaN");
+}
+
+ATF_TC_BODY(expf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ if (isnan(expf(x)) == 0)
+ atf_tc_fail_nonfatal("expf(NaN) != NaN");
+}
+
+ATF_TC(expf_inf_neg);
+ATF_TC_HEAD(expf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expf(-Inf) == +0.0");
+}
+
+ATF_TC_BODY(expf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float y = expf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("expf(-Inf) != +0.0");
+}
+
+ATF_TC(expf_inf_pos);
+ATF_TC_HEAD(expf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(expf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = expf(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("expf(+Inf) != +Inf");
+}
+
+ATF_TC(expf_product);
+ATF_TC_HEAD(expf_product, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test some selected expf(x)");
+}
+
+ATF_TC_BODY(expf_product, tc)
+{
+ float eps;
+ float x;
+ float y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exp_values); i++) {
+ x = exp_values[i].x;
+ y = exp_values[i].y;
+ eps = 1e-6 * exp_values[i].e;
+
+ if (fabsf(expf(x) - y) > eps)
+ atf_tc_fail_nonfatal("expf(%0.01f) != %18.18e", x, y);
+ }
+}
+
+ATF_TC(expf_zero_neg);
+ATF_TC_HEAD(expf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expf(-0.0) == 1.0");
+}
+
+ATF_TC_BODY(expf_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ if (fabsf(expf(x) - 1.0f) > 0.0)
+ atf_tc_fail_nonfatal("expf(-0.0) != 1.0");
+}
+
+ATF_TC(expf_zero_pos);
+ATF_TC_HEAD(expf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expf(+0.0) == 1.0");
+}
+
+ATF_TC_BODY(expf_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ if (fabsf(expf(x) - 1.0f) > 0.0)
+ atf_tc_fail_nonfatal("expf(+0.0) != 1.0");
+}
+
+/*
+ * expm1(3)
+ */
+ATF_TC(expm1_nan);
+ATF_TC_HEAD(expm1_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1(NaN) == NaN");
+}
+
+ATF_TC_BODY(expm1_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ if (isnan(expm1(x)) == 0)
+ atf_tc_fail_nonfatal("expm1(NaN) != NaN");
+}
+
+ATF_TC(expm1_inf_neg);
+ATF_TC_HEAD(expm1_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1(-Inf) == -1");
+}
+
+ATF_TC_BODY(expm1_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+
+ if (expm1(x) != -1.0)
+ atf_tc_fail_nonfatal("expm1(-Inf) != -1.0");
+}
+
+ATF_TC(expm1_inf_pos);
+ATF_TC_HEAD(expm1_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(expm1_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = expm1(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("expm1(+Inf) != +Inf");
+}
+
+ATF_TC(expm1_zero_neg);
+ATF_TC_HEAD(expm1_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(expm1_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = expm1(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("expm1(-0.0) != -0.0");
+}
+
+ATF_TC(expm1_zero_pos);
+ATF_TC_HEAD(expm1_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1(+0.0) == 1.0");
+}
+
+ATF_TC_BODY(expm1_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = expm1(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("expm1(+0.0) != +0.0");
+}
+
+/*
+ * expm1f(3)
+ */
+ATF_TC(expm1f_nan);
+ATF_TC_HEAD(expm1f_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1f(NaN) == NaN");
+}
+
+ATF_TC_BODY(expm1f_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ if (isnan(expm1f(x)) == 0)
+ atf_tc_fail_nonfatal("expm1f(NaN) != NaN");
+}
+
+ATF_TC(expm1f_inf_neg);
+ATF_TC_HEAD(expm1f_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1f(-Inf) == -1");
+}
+
+ATF_TC_BODY(expm1f_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+
+ if (expm1f(x) != -1.0)
+ atf_tc_fail_nonfatal("expm1f(-Inf) != -1.0");
+}
+
+ATF_TC(expm1f_inf_pos);
+ATF_TC_HEAD(expm1f_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1f(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(expm1f_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = expm1f(x);
+
+ if (isinf(y) == 0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("expm1f(+Inf) != +Inf");
+}
+
+ATF_TC(expm1f_zero_neg);
+ATF_TC_HEAD(expm1f_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1f(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(expm1f_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = expm1f(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("expm1f(-0.0) != -0.0");
+}
+
+ATF_TC(expm1f_zero_pos);
+ATF_TC_HEAD(expm1f_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test expm1f(+0.0) == 1.0");
+}
+
+ATF_TC_BODY(expm1f_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = expm1f(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("expm1f(+0.0) != +0.0");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, exp2_is_nan);
+ ATF_TP_ADD_TC(tp, exp2_is_plus_zero);
+ ATF_TP_ADD_TC(tp, exp2_values);
+ ATF_TP_ADD_TC(tp, exp2_powers);
+
+ ATF_TP_ADD_TC(tp, exp_nan);
+ ATF_TP_ADD_TC(tp, exp_inf_neg);
+ ATF_TP_ADD_TC(tp, exp_inf_pos);
+ ATF_TP_ADD_TC(tp, exp_product);
+ ATF_TP_ADD_TC(tp, exp_zero_neg);
+ ATF_TP_ADD_TC(tp, exp_zero_pos);
+
+ ATF_TP_ADD_TC(tp, expf_nan);
+ ATF_TP_ADD_TC(tp, expf_inf_neg);
+ ATF_TP_ADD_TC(tp, expf_inf_pos);
+ ATF_TP_ADD_TC(tp, expf_product);
+ ATF_TP_ADD_TC(tp, expf_zero_neg);
+ ATF_TP_ADD_TC(tp, expf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, expm1_nan);
+ ATF_TP_ADD_TC(tp, expm1_inf_neg);
+ ATF_TP_ADD_TC(tp, expm1_inf_pos);
+ ATF_TP_ADD_TC(tp, expm1_zero_neg);
+ ATF_TP_ADD_TC(tp, expm1_zero_pos);
+
+ ATF_TP_ADD_TC(tp, expm1f_nan);
+ ATF_TP_ADD_TC(tp, expm1f_inf_neg);
+ ATF_TP_ADD_TC(tp, expm1f_inf_pos);
+ ATF_TP_ADD_TC(tp, expm1f_zero_neg);
+ ATF_TP_ADD_TC(tp, expm1f_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_fmod.c b/contrib/netbsd-tests/lib/libm/t_fmod.c
new file mode 100644
index 0000000..7dac93d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_fmod.c
@@ -0,0 +1,63 @@
+/* $NetBSD: t_fmod.c,v 1.2 2014/02/27 17:26:02 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <float.h>
+#include <math.h>
+
+ATF_TC(fmod);
+ATF_TC_HEAD(fmod, tc)
+{
+ atf_tc_set_md_var(tc, "descr","Check fmod family");
+}
+
+ATF_TC_BODY(fmod, tc)
+{
+ ATF_CHECK(fmodf(2.0, 1.0) == 0);
+ ATF_CHECK(fmod(2.0, 1.0) == 0);
+ ATF_CHECK(fmodl(2.0, 1.0) == 0);
+
+ ATF_CHECK(fmodf(2.0, 0.5) == 0);
+ ATF_CHECK(fmod(2.0, 0.5) == 0);
+ ATF_CHECK(fmodl(2.0, 0.5) == 0);
+
+ ATF_CHECK(fabsf(fmodf(1.0, 0.1) - 0.1f) <= 55 * FLT_EPSILON);
+ ATF_CHECK(fabs(fmod(1.0, 0.1) - 0.1) <= 55 * DBL_EPSILON);
+ ATF_CHECK(fabsl(fmodl(1.0, 0.1L) - 0.1L) <= 55 * LDBL_EPSILON);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, fmod);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_infinity.c b/contrib/netbsd-tests/lib/libm/t_infinity.c
new file mode 100644
index 0000000..7ac1737
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_infinity.c
@@ -0,0 +1,119 @@
+/* $NetBSD: t_infinity.c,v 1.6 2012/09/26 07:24:38 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Martin Husemann <martin@NetBSD.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_infinity.c,v 1.6 2012/09/26 07:24:38 jruoho Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+#include <float.h>
+#include <stdlib.h>
+
+ATF_TC(infinity_float);
+ATF_TC_HEAD(infinity_float, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "check FPU generated infinite float values");
+}
+
+ATF_TC_BODY(infinity_float, tc)
+{
+ float v;
+
+ v = FLT_MAX;
+ v *= v;
+ ATF_REQUIRE(isinf(v));
+ ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
+
+ v = -FLT_MAX;
+ v *= v;
+ ATF_REQUIRE(isinf(v));
+ ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
+}
+
+ATF_TC(infinity_double);
+ATF_TC_HEAD(infinity_double, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "check FPU generated infinite double values");
+}
+
+ATF_TC_BODY(infinity_double, tc)
+{
+ double v;
+
+ v = DBL_MAX;
+ v *= v;
+ ATF_REQUIRE(isinf(v));
+ ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
+
+ v = -DBL_MAX;
+ v *= v;
+ ATF_REQUIRE(isinf(v));
+ ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
+}
+
+ATF_TC(infinity_long_double);
+ATF_TC_HEAD(infinity_long_double, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "check FPU generated infinite long double values");
+}
+
+ATF_TC_BODY(infinity_long_double, tc)
+{
+
+#ifndef LDBL_MAX
+ atf_tc_skip("no long double support on this architecture");
+ return;
+#else
+ long double v;
+
+ v = LDBL_MAX;
+ v *= v;
+ ATF_REQUIRE(isinf(v));
+ ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
+
+ v = -LDBL_MAX;
+ v *= v;
+ ATF_REQUIRE(isinf(v));
+ ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
+#endif
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, infinity_float);
+ ATF_TP_ADD_TC(tp, infinity_double);
+ ATF_TP_ADD_TC(tp, infinity_long_double);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_ldexp.c b/contrib/netbsd-tests/lib/libm/t_ldexp.c
new file mode 100644
index 0000000..9dd001d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_ldexp.c
@@ -0,0 +1,481 @@
+/* $NetBSD: t_ldexp.c,v 1.13 2014/03/12 21:40:07 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_ldexp.c,v 1.13 2014/03/12 21:40:07 martin Exp $");
+
+#include <sys/param.h>
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#include <math.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+
+#define SKIP 9999
+#define FORMAT "%23.23lg"
+
+static const int exps[] = { 0, 1, -1, 100, -100 };
+
+struct ldexp_test {
+ double x;
+ int exp1;
+ int exp2;
+ const char *result;
+};
+
+struct ldexp_test ldexp_basic[] = {
+ { 1.0, 5, SKIP, " 32" },
+ { 1.0, 1022, SKIP, "4.4942328371557897693233e+307" },
+ { 1.0, 1023, -1, "4.4942328371557897693233e+307" },
+ { 1.0, 1023, SKIP, "8.9884656743115795386465e+307" },
+ { 1.0, 1022, 1, "8.9884656743115795386465e+307" },
+ { 1.0, -1022, 2045, "8.9884656743115795386465e+307" },
+ { 1.0, -5, SKIP, " 0.03125" },
+ { 1.0, -1021, SKIP, "4.4501477170144027661805e-308" },
+ { 1.0, -1022, 1, "4.4501477170144027661805e-308" },
+ { 1.0, -1022, SKIP, "2.2250738585072013830902e-308" },
+ { 1.0, -1021, -1, "2.2250738585072013830902e-308" },
+ { 1.0, 1023, -2045, "2.2250738585072013830902e-308" },
+ { 1.0, 1023, -1023, " 1" },
+ { 1.0, -1022, 1022, " 1" },
+ { 0, 0, 0, NULL }
+};
+
+struct ldexp_test ldexp_zero[] = {
+ { 0.0, -1, SKIP, " 0" },
+ { 0.0, 0, SKIP, " 0" },
+ { 0.0, 1, SKIP, " 0" },
+ { 0.0, 1024, SKIP, " 0" },
+ { 0.0, 1025, SKIP, " 0" },
+ { 0.0, -1023, SKIP, " 0" },
+ { 0.0, -1024, SKIP, " 0" },
+ { 0, 0, 0, NULL }
+};
+
+struct ldexp_test ldexp_infinity[] = {
+ { 1.0, 1024, -1, " inf" },
+ { 1.0, 1024, 0, " inf" },
+ { 1.0, 1024, 1, " inf" },
+ { -1.0, 1024, -1, " -inf" },
+ { -1.0, 1024, 0, " -inf" },
+ { -1.0, 1024, 1, " -inf" },
+ { 0, 0, 0, NULL }
+};
+
+struct ldexp_test ldexp_overflow[] = {
+ { 1.0, 1024, SKIP, " inf" },
+ { 1.0, 1023, 1, " inf" },
+ { 1.0, -1022, 2046, " inf" },
+ { 1.0, 1025, SKIP, " inf" },
+ { -1.0, 1024, SKIP, " -inf" },
+ { -1.0, 1023, 1, " -inf" },
+ { -1.0, -1022, 2046, " -inf" },
+ { -1.0, 1025, SKIP, " -inf" },
+ { 0, 0, 0, NULL }
+};
+
+struct ldexp_test ldexp_denormal[] = {
+ { 1.0, -1023, SKIP, "1.1125369292536006915451e-308" },
+ { 1.0, -1022, -1, "1.1125369292536006915451e-308" },
+ { 1.0, 1023, -2046, "1.1125369292536006915451e-308" },
+ { 1.0, -1024, SKIP, "5.5626846462680034577256e-309" },
+ { 1.0, -1074, SKIP, "4.9406564584124654417657e-324" },
+ { -1.0, -1023, SKIP, "-1.1125369292536006915451e-308" },
+ { -1.0, -1022, -1, "-1.1125369292536006915451e-308" },
+ { -1.0, 1023, -2046, "-1.1125369292536006915451e-308" },
+ { -1.0, -1024, SKIP, "-5.5626846462680034577256e-309" },
+ { -1.0, -1074, SKIP, "-4.9406564584124654417657e-324" },
+ { 0, 0, 0, NULL }
+};
+
+struct ldexp_test ldexp_underflow[] = {
+ { 1.0, -1075, SKIP, " 0" },
+ { 1.0, -1074, -1, " 0" },
+ { 1.0, 1023, -2098, " 0" },
+ { 1.0, -1076, SKIP, " 0" },
+ { -1.0, -1075, SKIP, " -0" },
+ { -1.0, -1074, -1, " -0" },
+ { -1.0, 1023, -2098, " -0" },
+ { -1.0, -1076, SKIP, " -0" },
+ { 0, 0, 0, NULL }
+};
+
+struct ldexp_test ldexp_denormal_large[] = {
+ { 1.0, -1028, 1024, " 0.0625" },
+ { 1.0, -1028, 1025, " 0.125" },
+ { 1.0, -1028, 1026, " 0.25" },
+ { 1.0, -1028, 1027, " 0.5" },
+ { 1.0, -1028, 1028, " 1" },
+ { 1.0, -1028, 1029, " 2" },
+ { 1.0, -1028, 1030, " 4" },
+ { 1.0, -1028, 1040, " 4096" },
+ { 1.0, -1028, 1050, " 4194304" },
+ { 1.0, -1028, 1060, " 4294967296" },
+ { 1.0, -1028, 1100, " 4722366482869645213696" },
+ { 1.0, -1028, 1200, "5.9863107065073783529623e+51" },
+ { 1.0, -1028, 1300, "7.5885503602567541832791e+81" },
+ { 1.0, -1028, 1400, "9.6196304190416209014353e+111" },
+ { 1.0, -1028, 1500, "1.2194330274671844653834e+142" },
+ { 1.0, -1028, 1600, "1.5458150092069033378781e+172" },
+ { 1.0, -1028, 1700, "1.9595533242629369747791e+202" },
+ { 1.0, -1028, 1800, "2.4840289476811342962384e+232" },
+ { 1.0, -1028, 1900, "3.1488807865122869393369e+262" },
+ { 1.0, -1028, 2000, "3.9916806190694396233127e+292" },
+ { 1.0, -1028, 2046, "2.808895523222368605827e+306" },
+ { 1.0, -1028, 2047, "5.6177910464447372116541e+306" },
+ { 1.0, -1028, 2048, "1.1235582092889474423308e+307" },
+ { 1.0, -1028, 2049, "2.2471164185778948846616e+307" },
+ { 1.0, -1028, 2050, "4.4942328371557897693233e+307" },
+ { 1.0, -1028, 2051, "8.9884656743115795386465e+307" },
+ { 0, 0, 0, NULL }
+};
+
+static void
+run_test(struct ldexp_test *table)
+{
+ char outbuf[64];
+ size_t i;
+ double v;
+
+ for (i = 0; table->result != NULL; table++, i++) {
+
+ v = ldexp(table->x, table->exp1);
+
+ if (table->exp2 == SKIP)
+ continue;
+
+ v = ldexp(v, table->exp2);
+
+ (void)snprintf(outbuf, sizeof(outbuf), FORMAT, v);
+
+ ATF_CHECK_STREQ_MSG(table->result, outbuf,
+ "Entry %zu:\n\tExp: \"%s\"\n\tAct: \"%s\"",
+ i, table->result, outbuf);
+ }
+}
+
+/*
+ * ldexp(3)
+ */
+ATF_TC(ldexp_exp2);
+ATF_TC_HEAD(ldexp_exp2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexp(x, n) == x * exp2(n)");
+}
+
+ATF_TC_BODY(ldexp_exp2, tc)
+{
+ const double n[] = { 1, 2, 3, 10, 50, 100 };
+#if __DBL_MIN_10_EXP__ <= -40
+ const double eps = 1.0e-40;
+#else
+ const double eps = __DBL_MIN__*4.0;
+#endif
+ const double x = 12.0;
+ double y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(n); i++) {
+
+ y = ldexp(x, n[i]);
+
+ if (fabs(y - (x * exp2(n[i]))) > eps) {
+ atf_tc_fail_nonfatal("ldexp(%0.01f, %0.01f) "
+ "!= %0.01f * exp2(%0.01f)", x, n[i], x, n[i]);
+ }
+ }
+}
+
+ATF_TC(ldexp_nan);
+ATF_TC_HEAD(ldexp_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexp(NaN) == NaN");
+}
+
+ATF_TC_BODY(ldexp_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+ double y;
+ size_t i;
+
+ ATF_REQUIRE(isnan(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = ldexp(x, exps[i]);
+ ATF_CHECK(isnan(y) != 0);
+ }
+}
+
+ATF_TC(ldexp_inf_neg);
+ATF_TC_HEAD(ldexp_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexp(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(ldexp_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(ldexp(x, exps[i]) == x);
+}
+
+ATF_TC(ldexp_inf_pos);
+ATF_TC_HEAD(ldexp_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexp(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(ldexp_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(ldexp(x, exps[i]) == x);
+}
+
+ATF_TC(ldexp_zero_neg);
+ATF_TC_HEAD(ldexp_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexp(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(ldexp_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = ldexp(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) != 0);
+ }
+}
+
+ATF_TC(ldexp_zero_pos);
+ATF_TC_HEAD(ldexp_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexp(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(ldexp_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) == 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = ldexp(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) == 0);
+ }
+}
+
+/*
+ * ldexpf(3)
+ */
+
+ATF_TC(ldexpf_exp2f);
+ATF_TC_HEAD(ldexpf_exp2f, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexpf(x, n) == x * exp2f(n)");
+}
+
+ATF_TC_BODY(ldexpf_exp2f, tc)
+{
+ const float n[] = { 1, 2, 3, 10, 50, 100 };
+ const float eps = 1.0e-9;
+ const float x = 12.0;
+ float y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(n); i++) {
+
+ y = ldexpf(x, n[i]);
+
+ if (fabsf(y - (x * exp2f(n[i]))) > eps) {
+ atf_tc_fail_nonfatal("ldexpf(%0.01f, %0.01f) "
+ "!= %0.01f * exp2f(%0.01f)", x, n[i], x, n[i]);
+ }
+ }
+}
+
+ATF_TC(ldexpf_nan);
+ATF_TC_HEAD(ldexpf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexpf(NaN) == NaN");
+}
+
+ATF_TC_BODY(ldexpf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+ float y;
+ size_t i;
+
+ ATF_REQUIRE(isnan(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = ldexpf(x, exps[i]);
+ ATF_CHECK(isnan(y) != 0);
+ }
+}
+
+ATF_TC(ldexpf_inf_neg);
+ATF_TC_HEAD(ldexpf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexpf(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(ldexpf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(ldexpf(x, exps[i]) == x);
+}
+
+ATF_TC(ldexpf_inf_pos);
+ATF_TC_HEAD(ldexpf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexpf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(ldexpf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(ldexpf(x, exps[i]) == x);
+}
+
+ATF_TC(ldexpf_zero_neg);
+ATF_TC_HEAD(ldexpf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexpf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(ldexpf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = ldexpf(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) != 0);
+ }
+}
+
+ATF_TC(ldexpf_zero_pos);
+ATF_TC_HEAD(ldexpf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ldexpf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(ldexpf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) == 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = ldexpf(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) == 0);
+ }
+}
+
+#define TEST(name, desc) \
+ ATF_TC(name); \
+ ATF_TC_HEAD(name, tc) \
+ { \
+ \
+ atf_tc_set_md_var(tc, "descr", \
+ "Test ldexp(3) for " ___STRING(desc)); \
+ } \
+ ATF_TC_BODY(name, tc) \
+ { \
+ if (strcmp("vax", MACHINE_ARCH) == 0) \
+ atf_tc_skip("Test not valid for " MACHINE_ARCH); \
+ run_test(name); \
+ }
+
+TEST(ldexp_basic, basics)
+TEST(ldexp_zero, zero)
+TEST(ldexp_infinity, infinity)
+TEST(ldexp_overflow, overflow)
+TEST(ldexp_denormal, denormal)
+TEST(ldexp_denormal_large, large)
+TEST(ldexp_underflow, underflow)
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, ldexp_basic);
+ ATF_TP_ADD_TC(tp, ldexp_zero);
+ ATF_TP_ADD_TC(tp, ldexp_infinity);
+ ATF_TP_ADD_TC(tp, ldexp_overflow);
+ ATF_TP_ADD_TC(tp, ldexp_denormal);
+ ATF_TP_ADD_TC(tp, ldexp_underflow);
+ ATF_TP_ADD_TC(tp, ldexp_denormal_large);
+
+ ATF_TP_ADD_TC(tp, ldexp_exp2);
+ ATF_TP_ADD_TC(tp, ldexp_nan);
+ ATF_TP_ADD_TC(tp, ldexp_inf_neg);
+ ATF_TP_ADD_TC(tp, ldexp_inf_pos);
+ ATF_TP_ADD_TC(tp, ldexp_zero_neg);
+ ATF_TP_ADD_TC(tp, ldexp_zero_pos);
+
+ ATF_TP_ADD_TC(tp, ldexpf_exp2f);
+ ATF_TP_ADD_TC(tp, ldexpf_nan);
+ ATF_TP_ADD_TC(tp, ldexpf_inf_neg);
+ ATF_TP_ADD_TC(tp, ldexpf_inf_pos);
+ ATF_TP_ADD_TC(tp, ldexpf_zero_neg);
+ ATF_TP_ADD_TC(tp, ldexpf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_libm.h b/contrib/netbsd-tests/lib/libm/t_libm.h
new file mode 100644
index 0000000..34e3cb2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_libm.h
@@ -0,0 +1,62 @@
+/* $NetBSD: t_libm.h,v 1.6 2014/03/25 17:30:14 joerg Exp $ */
+
+/*
+ * Check result of fn(arg) is correct within the bounds.
+ * Should be ok to do the checks using 'double' for 'float' functions.
+ * On i386 float and double values are returned on the x87 stack and might
+ * be out of range for the function - so save and print as 'long double'.
+ * (otherwise you can get 'inf != inf' reported!)
+ */
+#define T_LIBM_CHECK(subtest, fn, arg, expect_, epsilon_) do { \
+ long double epsilon = epsilon_; \
+ long double expect = expect_; \
+ long double r = fn(arg); \
+ long double e = fabsl(r - expect); \
+ if (r != expect && e > epsilon) \
+ atf_tc_fail_nonfatal( \
+ "subtest %u: " #fn "(%g) is %Lg (%.14La) " \
+ "not %Lg (%.13La), error %Lg (%.6La) > %Lg", \
+ subtest, arg, r, r, expect, expect, e, e, epsilon); \
+ } while (0)
+
+/* Check that the result of fn(arg) is NaN */
+#ifndef __vax__
+#define T_LIBM_CHECK_NAN(subtest, fn, arg) do { \
+ double r = fn(arg); \
+ if (!isnan(r)) \
+ atf_tc_fail_nonfatal("subtest %u: " #fn "(%g) is %g not NaN", \
+ subtest, arg, r); \
+ } while (0)
+#else
+/* vax doesn't support NaN */
+#define T_LIBM_CHECK_NAN(subtest, fn, arg) (void)(arg)
+#endif
+
+/* Check that the result of fn(arg) is +0.0 */
+#define T_LIBM_CHECK_PLUS_ZERO(subtest, fn, arg) do { \
+ double r = fn(arg); \
+ if (fabs(r) > 0.0 || signbit(r) != 0) \
+ atf_tc_fail_nonfatal("subtest %u: " #fn "(%g) is %g not +0.0", \
+ subtest, arg, r); \
+ } while (0)
+
+/* Check that the result of fn(arg) is -0.0 */
+#define T_LIBM_CHECK_MINUS_ZERO(subtest, fn, arg) do { \
+ double r = fn(arg); \
+ if (fabs(r) > 0.0 || signbit(r) == 0) \
+ atf_tc_fail_nonfatal("subtest %u: " #fn "(%g) is %g not -0.0", \
+ subtest, arg, r); \
+ } while (0)
+
+/* Some useful constants (for test vectors) */
+#ifndef __vax__ /* no NAN nor +/- INF on vax */
+#define T_LIBM_NAN (0.0 / 0.0)
+#define T_LIBM_PLUS_INF (+1.0 / 0.0)
+#define T_LIBM_MINUS_INF (-1.0 / 0.0)
+#endif
+
+/* One line definition of a simple test */
+#define ATF_LIBM_TEST(name, description) \
+ATF_TC(name); \
+ATF_TC_HEAD(name, tc) { atf_tc_set_md_var(tc, "descr", description); } \
+ATF_TC_BODY(name, tc)
diff --git a/contrib/netbsd-tests/lib/libm/t_log.c b/contrib/netbsd-tests/lib/libm/t_log.c
new file mode 100644
index 0000000..de5a1c6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_log.c
@@ -0,0 +1,885 @@
+/* $NetBSD: t_log.c,v 1.11 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_log.c,v 1.11 2014/03/03 10:39:08 martin Exp $");
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+/*
+ * log10(3)
+ */
+ATF_TC(log10_base);
+ATF_TC_HEAD(log10_base, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10(10) == 1");
+}
+
+ATF_TC_BODY(log10_base, tc)
+{
+ ATF_CHECK(log10(10.0) == 1.0);
+}
+
+ATF_TC(log10_nan);
+ATF_TC_HEAD(log10_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10(NaN) == NaN");
+}
+
+ATF_TC_BODY(log10_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(log10(x)) != 0);
+}
+
+ATF_TC(log10_inf_neg);
+ATF_TC_HEAD(log10_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10(-Inf) == NaN");
+}
+
+ATF_TC_BODY(log10_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ const double y = log10(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(log10_inf_pos);
+ATF_TC_HEAD(log10_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(log10_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ ATF_CHECK(log10(x) == x);
+}
+
+ATF_TC(log10_one_pos);
+ATF_TC_HEAD(log10_one_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10(1.0) == +0.0");
+}
+
+ATF_TC_BODY(log10_one_pos, tc)
+{
+ const double x = log10(1.0);
+ const double y = 0.0L;
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) == 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(log10_zero_neg);
+ATF_TC_HEAD(log10_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10(-0.0) == -HUGE_VAL");
+}
+
+ATF_TC_BODY(log10_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ ATF_CHECK(log10(x) == -HUGE_VAL);
+}
+
+ATF_TC(log10_zero_pos);
+ATF_TC_HEAD(log10_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10(+0.0) == -HUGE_VAL");
+}
+
+ATF_TC_BODY(log10_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ ATF_CHECK(log10(x) == -HUGE_VAL);
+}
+
+/*
+ * log10f(3)
+ */
+ATF_TC(log10f_base);
+ATF_TC_HEAD(log10f_base, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10f(10) == 1");
+}
+
+ATF_TC_BODY(log10f_base, tc)
+{
+ ATF_CHECK(log10f(10.0) == 1.0);
+}
+
+ATF_TC(log10f_nan);
+ATF_TC_HEAD(log10f_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10f(NaN) == NaN");
+}
+
+ATF_TC_BODY(log10f_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(log10f(x)) != 0);
+}
+
+ATF_TC(log10f_inf_neg);
+ATF_TC_HEAD(log10f_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10f(-Inf) == NaN");
+}
+
+ATF_TC_BODY(log10f_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ const float y = log10f(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(log10f_inf_pos);
+ATF_TC_HEAD(log10f_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10f(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(log10f_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+#if defined(__alpha__)
+ atf_tc_expect_fail("PR port-alpha/46301");
+#endif
+
+ ATF_CHECK(log10f(x) == x);
+}
+
+ATF_TC(log10f_one_pos);
+ATF_TC_HEAD(log10f_one_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10f(1.0) == +0.0");
+}
+
+ATF_TC_BODY(log10f_one_pos, tc)
+{
+ const float x = log10f(1.0);
+ const float y = 0.0L;
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) == 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(log10f_zero_neg);
+ATF_TC_HEAD(log10f_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10f(-0.0) == -HUGE_VALF");
+}
+
+ATF_TC_BODY(log10f_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ ATF_CHECK(log10f(x) == -HUGE_VALF);
+}
+
+ATF_TC(log10f_zero_pos);
+ATF_TC_HEAD(log10f_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log10f(+0.0) == -HUGE_VALF");
+}
+
+ATF_TC_BODY(log10f_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ ATF_CHECK(log10f(x) == -HUGE_VALF);
+}
+
+/*
+ * log1p(3)
+ */
+ATF_TC(log1p_nan);
+ATF_TC_HEAD(log1p_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1p(NaN) == NaN");
+}
+
+ATF_TC_BODY(log1p_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(log1p(x)) != 0);
+}
+
+ATF_TC(log1p_inf_neg);
+ATF_TC_HEAD(log1p_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1p(-Inf) == NaN");
+}
+
+ATF_TC_BODY(log1p_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ const double y = log1p(x);
+
+ if (isnan(y) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("log1p(-Inf) != NaN");
+ }
+}
+
+ATF_TC(log1p_inf_pos);
+ATF_TC_HEAD(log1p_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1p(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(log1p_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ ATF_CHECK(log1p(x) == x);
+}
+
+ATF_TC(log1p_one_neg);
+ATF_TC_HEAD(log1p_one_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1p(-1.0) == -HUGE_VAL");
+}
+
+ATF_TC_BODY(log1p_one_neg, tc)
+{
+ const double x = log1p(-1.0);
+
+ if (x != -HUGE_VAL) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("log1p(-1.0) != -HUGE_VAL");
+ }
+}
+
+ATF_TC(log1p_zero_neg);
+ATF_TC_HEAD(log1p_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1p(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(log1p_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ ATF_CHECK(log1p(x) == x);
+}
+
+ATF_TC(log1p_zero_pos);
+ATF_TC_HEAD(log1p_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1p(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(log1p_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ ATF_CHECK(log1p(x) == x);
+}
+
+/*
+ * log1pf(3)
+ */
+ATF_TC(log1pf_nan);
+ATF_TC_HEAD(log1pf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1pf(NaN) == NaN");
+}
+
+ATF_TC_BODY(log1pf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(log1pf(x)) != 0);
+}
+
+ATF_TC(log1pf_inf_neg);
+ATF_TC_HEAD(log1pf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1pf(-Inf) == NaN");
+}
+
+ATF_TC_BODY(log1pf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ const float y = log1pf(x);
+
+ if (isnan(y) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("log1pf(-Inf) != NaN");
+ }
+}
+
+ATF_TC(log1pf_inf_pos);
+ATF_TC_HEAD(log1pf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1pf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(log1pf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+ ATF_CHECK(log1pf(x) == x);
+}
+
+ATF_TC(log1pf_one_neg);
+ATF_TC_HEAD(log1pf_one_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1pf(-1.0) == -HUGE_VALF");
+}
+
+ATF_TC_BODY(log1pf_one_neg, tc)
+{
+ const float x = log1pf(-1.0);
+
+ if (x != -HUGE_VALF) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("log1pf(-1.0) != -HUGE_VALF");
+ }
+}
+
+ATF_TC(log1pf_zero_neg);
+ATF_TC_HEAD(log1pf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1pf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(log1pf_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ ATF_CHECK(log1pf(x) == x);
+}
+
+ATF_TC(log1pf_zero_pos);
+ATF_TC_HEAD(log1pf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log1pf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(log1pf_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ ATF_CHECK(log1pf(x) == x);
+}
+
+/*
+ * log2(3)
+ */
+ATF_TC(log2_base);
+ATF_TC_HEAD(log2_base, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2(2) == 1");
+}
+
+ATF_TC_BODY(log2_base, tc)
+{
+ ATF_CHECK(log2(2.0) == 1.0);
+}
+
+ATF_TC(log2_nan);
+ATF_TC_HEAD(log2_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2(NaN) == NaN");
+}
+
+ATF_TC_BODY(log2_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(log2(x)) != 0);
+}
+
+ATF_TC(log2_inf_neg);
+ATF_TC_HEAD(log2_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2(-Inf) == NaN");
+}
+
+ATF_TC_BODY(log2_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ const double y = log2(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(log2_inf_pos);
+ATF_TC_HEAD(log2_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(log2_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ ATF_CHECK(log2(x) == x);
+}
+
+ATF_TC(log2_one_pos);
+ATF_TC_HEAD(log2_one_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2(1.0) == +0.0");
+}
+
+ATF_TC_BODY(log2_one_pos, tc)
+{
+ const double x = log2(1.0);
+ const double y = 0.0L;
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) == 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(log2_zero_neg);
+ATF_TC_HEAD(log2_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2(-0.0) == -HUGE_VAL");
+}
+
+ATF_TC_BODY(log2_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ ATF_CHECK(log2(x) == -HUGE_VAL);
+}
+
+ATF_TC(log2_zero_pos);
+ATF_TC_HEAD(log2_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2(+0.0) == -HUGE_VAL");
+}
+
+ATF_TC_BODY(log2_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ ATF_CHECK(log2(x) == -HUGE_VAL);
+}
+
+/*
+ * log2f(3)
+ */
+ATF_TC(log2f_base);
+ATF_TC_HEAD(log2f_base, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2f(2) == 1");
+}
+
+ATF_TC_BODY(log2f_base, tc)
+{
+ ATF_CHECK(log2f(2.0) == 1.0);
+}
+
+ATF_TC(log2f_nan);
+ATF_TC_HEAD(log2f_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2f(NaN) == NaN");
+}
+
+ATF_TC_BODY(log2f_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(log2f(x)) != 0);
+}
+
+ATF_TC(log2f_inf_neg);
+ATF_TC_HEAD(log2f_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2f(-Inf) == NaN");
+}
+
+ATF_TC_BODY(log2f_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ const float y = log2f(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(log2f_inf_pos);
+ATF_TC_HEAD(log2f_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2f(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(log2f_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+#if defined(__alpha__)
+ atf_tc_expect_fail("PR port-alpha/46301");
+#endif
+
+ ATF_CHECK(log2f(x) == x);
+}
+
+ATF_TC(log2f_one_pos);
+ATF_TC_HEAD(log2f_one_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2f(1.0) == +0.0");
+}
+
+ATF_TC_BODY(log2f_one_pos, tc)
+{
+ const float x = log2f(1.0);
+ const float y = 0.0L;
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) == 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(log2f_zero_neg);
+ATF_TC_HEAD(log2f_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2f(-0.0) == -HUGE_VALF");
+}
+
+ATF_TC_BODY(log2f_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ ATF_CHECK(log2f(x) == -HUGE_VALF);
+}
+
+ATF_TC(log2f_zero_pos);
+ATF_TC_HEAD(log2f_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log2f(+0.0) == -HUGE_VALF");
+}
+
+ATF_TC_BODY(log2f_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ ATF_CHECK(log2f(x) == -HUGE_VALF);
+}
+
+/*
+ * log(3)
+ */
+ATF_TC(log_base);
+ATF_TC_HEAD(log_base, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log(e) == 1");
+}
+
+ATF_TC_BODY(log_base, tc)
+{
+ const double eps = 1.0e-38;
+
+ if (fabs(log(M_E) - 1.0) > eps)
+ atf_tc_fail_nonfatal("log(e) != 1");
+}
+
+ATF_TC(log_nan);
+ATF_TC_HEAD(log_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log(NaN) == NaN");
+}
+
+ATF_TC_BODY(log_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(log(x)) != 0);
+}
+
+ATF_TC(log_inf_neg);
+ATF_TC_HEAD(log_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log(-Inf) == NaN");
+}
+
+ATF_TC_BODY(log_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ const double y = log(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(log_inf_pos);
+ATF_TC_HEAD(log_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(log_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ ATF_CHECK(log(x) == x);
+}
+
+ATF_TC(log_one_pos);
+ATF_TC_HEAD(log_one_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log(1.0) == +0.0");
+}
+
+ATF_TC_BODY(log_one_pos, tc)
+{
+ const double x = log(1.0);
+ const double y = 0.0L;
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) == 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(log_zero_neg);
+ATF_TC_HEAD(log_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log(-0.0) == -HUGE_VAL");
+}
+
+ATF_TC_BODY(log_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ ATF_CHECK(log(x) == -HUGE_VAL);
+}
+
+ATF_TC(log_zero_pos);
+ATF_TC_HEAD(log_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test log(+0.0) == -HUGE_VAL");
+}
+
+ATF_TC_BODY(log_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ ATF_CHECK(log(x) == -HUGE_VAL);
+}
+
+/*
+ * logf(3)
+ */
+ATF_TC(logf_base);
+ATF_TC_HEAD(logf_base, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test logf(e) == 1");
+}
+
+ATF_TC_BODY(logf_base, tc)
+{
+ const float eps = 1.0e-7;
+
+ if (fabsf(logf(M_E) - 1.0f) > eps)
+ atf_tc_fail_nonfatal("logf(e) != 1");
+}
+
+ATF_TC(logf_nan);
+ATF_TC_HEAD(logf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test logf(NaN) == NaN");
+}
+
+ATF_TC_BODY(logf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(logf(x)) != 0);
+}
+
+ATF_TC(logf_inf_neg);
+ATF_TC_HEAD(logf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test logf(-Inf) == NaN");
+}
+
+ATF_TC_BODY(logf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ const float y = logf(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(logf_inf_pos);
+ATF_TC_HEAD(logf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test logf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(logf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+#if defined(__alpha__)
+ atf_tc_expect_fail("PR port-alpha/46301");
+#endif
+
+ ATF_CHECK(logf(x) == x);
+}
+
+ATF_TC(logf_one_pos);
+ATF_TC_HEAD(logf_one_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test logf(1.0) == +0.0");
+}
+
+ATF_TC_BODY(logf_one_pos, tc)
+{
+ const float x = logf(1.0);
+ const float y = 0.0L;
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) == 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(logf_zero_neg);
+ATF_TC_HEAD(logf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test logf(-0.0) == -HUGE_VALF");
+}
+
+ATF_TC_BODY(logf_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ ATF_CHECK(logf(x) == -HUGE_VALF);
+}
+
+ATF_TC(logf_zero_pos);
+ATF_TC_HEAD(logf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test logf(+0.0) == -HUGE_VALF");
+}
+
+ATF_TC_BODY(logf_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ ATF_CHECK(logf(x) == -HUGE_VALF);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, log10_base);
+ ATF_TP_ADD_TC(tp, log10_nan);
+ ATF_TP_ADD_TC(tp, log10_inf_neg);
+ ATF_TP_ADD_TC(tp, log10_inf_pos);
+ ATF_TP_ADD_TC(tp, log10_one_pos);
+ ATF_TP_ADD_TC(tp, log10_zero_neg);
+ ATF_TP_ADD_TC(tp, log10_zero_pos);
+
+ ATF_TP_ADD_TC(tp, log10f_base);
+ ATF_TP_ADD_TC(tp, log10f_nan);
+ ATF_TP_ADD_TC(tp, log10f_inf_neg);
+ ATF_TP_ADD_TC(tp, log10f_inf_pos);
+ ATF_TP_ADD_TC(tp, log10f_one_pos);
+ ATF_TP_ADD_TC(tp, log10f_zero_neg);
+ ATF_TP_ADD_TC(tp, log10f_zero_pos);
+
+ ATF_TP_ADD_TC(tp, log1p_nan);
+ ATF_TP_ADD_TC(tp, log1p_inf_neg);
+ ATF_TP_ADD_TC(tp, log1p_inf_pos);
+ ATF_TP_ADD_TC(tp, log1p_one_neg);
+ ATF_TP_ADD_TC(tp, log1p_zero_neg);
+ ATF_TP_ADD_TC(tp, log1p_zero_pos);
+
+ ATF_TP_ADD_TC(tp, log1pf_nan);
+ ATF_TP_ADD_TC(tp, log1pf_inf_neg);
+ ATF_TP_ADD_TC(tp, log1pf_inf_pos);
+ ATF_TP_ADD_TC(tp, log1pf_one_neg);
+ ATF_TP_ADD_TC(tp, log1pf_zero_neg);
+ ATF_TP_ADD_TC(tp, log1pf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, log2_base);
+ ATF_TP_ADD_TC(tp, log2_nan);
+ ATF_TP_ADD_TC(tp, log2_inf_neg);
+ ATF_TP_ADD_TC(tp, log2_inf_pos);
+ ATF_TP_ADD_TC(tp, log2_one_pos);
+ ATF_TP_ADD_TC(tp, log2_zero_neg);
+ ATF_TP_ADD_TC(tp, log2_zero_pos);
+
+ ATF_TP_ADD_TC(tp, log2f_base);
+ ATF_TP_ADD_TC(tp, log2f_nan);
+ ATF_TP_ADD_TC(tp, log2f_inf_neg);
+ ATF_TP_ADD_TC(tp, log2f_inf_pos);
+ ATF_TP_ADD_TC(tp, log2f_one_pos);
+ ATF_TP_ADD_TC(tp, log2f_zero_neg);
+ ATF_TP_ADD_TC(tp, log2f_zero_pos);
+
+ ATF_TP_ADD_TC(tp, log_base);
+ ATF_TP_ADD_TC(tp, log_nan);
+ ATF_TP_ADD_TC(tp, log_inf_neg);
+ ATF_TP_ADD_TC(tp, log_inf_pos);
+ ATF_TP_ADD_TC(tp, log_one_pos);
+ ATF_TP_ADD_TC(tp, log_zero_neg);
+ ATF_TP_ADD_TC(tp, log_zero_pos);
+
+ ATF_TP_ADD_TC(tp, logf_base);
+ ATF_TP_ADD_TC(tp, logf_nan);
+ ATF_TP_ADD_TC(tp, logf_inf_neg);
+ ATF_TP_ADD_TC(tp, logf_inf_pos);
+ ATF_TP_ADD_TC(tp, logf_one_pos);
+ ATF_TP_ADD_TC(tp, logf_zero_neg);
+ ATF_TP_ADD_TC(tp, logf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_modf.c b/contrib/netbsd-tests/lib/libm/t_modf.c
new file mode 100644
index 0000000..a856b15
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_modf.c
@@ -0,0 +1,68 @@
+/* $NetBSD: t_modf.c,v 1.1 2014/06/16 12:54:43 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <float.h>
+#include <math.h>
+
+ATF_TC(modf);
+ATF_TC_HEAD(modf, tc)
+{
+ atf_tc_set_md_var(tc, "descr","Check modf family");
+}
+
+ATF_TC_BODY(modf, tc)
+{
+ float basef;
+ double base;
+ long double basel;
+ ATF_CHECK(modff(1.0, &basef) == 0.0);
+ ATF_CHECK(basef == 1.0);
+ ATF_CHECK(modf(1.0, &base) == 0.0);
+ ATF_CHECK(base == 1.0);
+ ATF_CHECK(modfl(1.0, &basel) == 0.0);
+ ATF_CHECK(basel == 1.0);
+
+ ATF_CHECK(modff(-1 - FLT_EPSILON, &basef) == -FLT_EPSILON);
+ ATF_CHECK(basef == -1.0);
+ ATF_CHECK(modf(-1 - DBL_EPSILON, &base) == -DBL_EPSILON);
+ ATF_CHECK(base == -1.0);
+ ATF_CHECK(modfl(-1 - LDBL_EPSILON, &basel) == -LDBL_EPSILON);
+ ATF_CHECK(basel == -1.0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, modf);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_pow.c b/contrib/netbsd-tests/lib/libm/t_pow.c
new file mode 100644
index 0000000..62b7235
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_pow.c
@@ -0,0 +1,669 @@
+/* $NetBSD: t_pow.c,v 1.3 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_pow.c,v 1.3 2014/03/03 10:39:08 martin Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+
+/*
+ * pow(3)
+ */
+ATF_TC(pow_nan_x);
+ATF_TC_HEAD(pow_nan_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(NaN, y) == NaN");
+}
+
+ATF_TC_BODY(pow_nan_x, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(pow(x, 2.0)) != 0);
+}
+
+ATF_TC(pow_nan_y);
+ATF_TC_HEAD(pow_nan_y, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(x, NaN) == NaN");
+}
+
+ATF_TC_BODY(pow_nan_y, tc)
+{
+ const double y = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(pow(2.0, y)) != 0);
+}
+
+ATF_TC(pow_inf_neg_x);
+ATF_TC_HEAD(pow_inf_neg_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(-Inf, y) == +-Inf || +-0.0");
+}
+
+ATF_TC_BODY(pow_inf_neg_x, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double z;
+
+ /*
+ * If y is odd, y > 0, and x is -Inf, -Inf is returned.
+ * If y is even, y > 0, and x is -Inf, +Inf is returned.
+ */
+ z = pow(x, 3.0);
+
+ if (isinf(z) == 0 || signbit(z) == 0)
+ atf_tc_fail_nonfatal("pow(-Inf, 3.0) != -Inf");
+
+ z = pow(x, 4.0);
+
+ if (isinf(z) == 0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(-Inf, 4.0) != +Inf");
+
+ /*
+ * If y is odd, y < 0, and x is -Inf, -0.0 is returned.
+ * If y is even, y < 0, and x is -Inf, +0.0 is returned.
+ */
+ z = pow(x, -3.0);
+
+ if (fabs(z) > 0.0 || signbit(z) == 0)
+ atf_tc_fail_nonfatal("pow(-Inf, -3.0) != -0.0");
+
+ z = pow(x, -4.0);
+
+ if (fabs(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(-Inf -4.0) != +0.0");
+}
+
+ATF_TC(pow_inf_neg_y);
+ATF_TC_HEAD(pow_inf_neg_y, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(x, -Inf) == +Inf || +0.0");
+}
+
+ATF_TC_BODY(pow_inf_neg_y, tc)
+{
+ const double y = -1.0L / 0.0L;
+ double z;
+
+ /*
+ * If |x| < 1 and y is -Inf, +Inf is returned.
+ * If |x| > 1 and y is -Inf, +0.0 is returned.
+ */
+ z = pow(0.1, y);
+
+ if (isinf(z) == 0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(0.1, -Inf) != +Inf");
+
+ z = pow(1.1, y);
+
+ if (fabs(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(1.1, -Inf) != +0.0");
+}
+
+ATF_TC(pow_inf_pos_x);
+ATF_TC_HEAD(pow_inf_pos_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(+Inf, y) == +Inf || +0.0");
+}
+
+ATF_TC_BODY(pow_inf_pos_x, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double z;
+
+ /*
+ * For y < 0, if x is +Inf, +0.0 is returned.
+ * For y > 0, if x is +Inf, +Inf is returned.
+ */
+ z = pow(x, -2.0);
+
+ if (fabs(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(+Inf, -2.0) != +0.0");
+
+ z = pow(x, 2.0);
+
+ if (isinf(z) == 0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(+Inf, 2.0) != +Inf");
+}
+
+ATF_TC(pow_inf_pos_y);
+ATF_TC_HEAD(pow_inf_pos_y, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(x, +Inf) == +Inf || +0.0");
+}
+
+ATF_TC_BODY(pow_inf_pos_y, tc)
+{
+ const double y = 1.0L / 0.0L;
+ double z;
+
+ /*
+ * If |x| < 1 and y is +Inf, +0.0 is returned.
+ * If |x| > 1 and y is +Inf, +Inf is returned.
+ */
+ z = pow(0.1, y);
+
+ if (fabs(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(0.1, +Inf) != +0.0");
+
+ z = pow(1.1, y);
+
+ if (isinf(z) == 0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(1.1, +Inf) != +Inf");
+}
+
+ATF_TC(pow_one_neg_x);
+ATF_TC_HEAD(pow_one_neg_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(-1.0, +-Inf) == 1.0");
+}
+
+ATF_TC_BODY(pow_one_neg_x, tc)
+{
+ const double infp = 1.0L / 0.0L;
+ const double infn = -1.0L / 0.0L;
+
+ /*
+ * If x is -1.0, and y is +-Inf, 1.0 shall be returned.
+ */
+ ATF_REQUIRE(isinf(infp) != 0);
+ ATF_REQUIRE(isinf(infn) != 0);
+
+ if (pow(-1.0, infp) != 1.0) {
+ atf_tc_expect_fail("PR lib/45372");
+ atf_tc_fail_nonfatal("pow(-1.0, +Inf) != 1.0");
+ }
+
+ if (pow(-1.0, infn) != 1.0) {
+ atf_tc_expect_fail("PR lib/45372");
+ atf_tc_fail_nonfatal("pow(-1.0, -Inf) != 1.0");
+ }
+}
+
+ATF_TC(pow_one_pos_x);
+ATF_TC_HEAD(pow_one_pos_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(1.0, y) == 1.0");
+}
+
+ATF_TC_BODY(pow_one_pos_x, tc)
+{
+ const double y[] = { 0.0, 0.1, 2.0, -3.0, 99.0, 99.99, 9999999.9 };
+ const double z = 0.0L / 0.0L;
+ size_t i;
+
+ /*
+ * For any value of y (including NaN),
+ * if x is 1.0, 1.0 shall be returned.
+ */
+ if (pow(1.0, z) != 1.0)
+ atf_tc_fail_nonfatal("pow(1.0, NaN) != 1.0");
+
+ for (i = 0; i < __arraycount(y); i++) {
+
+ if (pow(1.0, y[i]) != 1.0)
+ atf_tc_fail_nonfatal("pow(1.0, %0.01f) != 1.0", y[i]);
+ }
+}
+
+ATF_TC(pow_zero_x);
+ATF_TC_HEAD(pow_zero_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(+-0.0, y) == +-0.0 || HUGE");
+}
+
+ATF_TC_BODY(pow_zero_x, tc)
+{
+ double z;
+
+ /*
+ * If x is +0.0 or -0.0, y > 0, and y
+ * is an odd integer, x is returned.
+ */
+ z = pow(+0.0, 3.0);
+
+ if (fabs(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(+0.0, 3.0) != +0.0");
+
+ z = pow(-0.0, 3.0);
+
+ if (fabs(z) > 0.0 || signbit(z) == 0)
+ atf_tc_fail_nonfatal("pow(-0.0, 3.0) != -0.0");
+
+ /*
+ * If y > 0 and not an odd integer,
+ * if x is +0.0 or -0.0, +0.0 is returned.
+ */
+ z = pow(+0.0, 4.0);
+
+ if (fabs(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(+0.0, 4.0) != +0.0");
+
+ z = pow(-0.0, 4.0);
+
+ if (fabs(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("pow(-0.0, 4.0) != +0.0");
+
+ /*
+ * If y < 0 and x is +0.0 or -0.0, either +-HUGE_VAL,
+ * +-HUGE_VALF, or +-HUGE_VALL shall be returned.
+ */
+ z = pow(+0.0, -4.0);
+
+ if (z != HUGE_VAL) {
+ atf_tc_expect_fail("PR port-amd64/45391");
+ atf_tc_fail_nonfatal("pow(+0.0, -4.0) != HUGE_VAL");
+ }
+
+ z = pow(-0.0, -4.0);
+
+ if (z != HUGE_VAL) {
+ atf_tc_expect_fail("PR port-amd64/45391");
+ atf_tc_fail_nonfatal("pow(-0.0, -4.0) != HUGE_VAL");
+ }
+
+ z = pow(+0.0, -5.0);
+
+ if (z != HUGE_VAL) {
+ atf_tc_expect_fail("PR port-amd64/45391");
+ atf_tc_fail_nonfatal("pow(+0.0, -5.0) != HUGE_VAL");
+ }
+
+ z = pow(-0.0, -5.0);
+
+ if (z != -HUGE_VAL)
+ atf_tc_fail_nonfatal("pow(-0.0, -5.0) != -HUGE_VAL");
+}
+
+ATF_TC(pow_zero_y);
+ATF_TC_HEAD(pow_zero_y, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pow(x, +-0.0) == 1.0");
+}
+
+ATF_TC_BODY(pow_zero_y, tc)
+{
+ const double x[] = { 0.1, -3.0, 77.0, 99.99, 101.0000001 };
+ const double z = 0.0L / 0.0L;
+ size_t i;
+
+ /*
+ * For any value of x (including NaN),
+ * if y is +0.0 or -0.0, 1.0 is returned.
+ */
+ if (pow(z, +0.0) != 1.0)
+ atf_tc_fail_nonfatal("pow(NaN, +0.0) != 1.0");
+
+ if (pow(z, -0.0) != 1.0)
+ atf_tc_fail_nonfatal("pow(NaN, -0.0) != 1.0");
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ if (pow(x[i], +0.0) != 1.0)
+ atf_tc_fail_nonfatal("pow(%0.01f, +0.0) != 1.0", x[i]);
+
+ if (pow(x[i], -0.0) != 1.0)
+ atf_tc_fail_nonfatal("pow(%0.01f, -0.0) != 1.0", x[i]);
+ }
+}
+
+/*
+ * powf(3)
+ */
+ATF_TC(powf_nan_x);
+ATF_TC_HEAD(powf_nan_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(NaN, y) == NaN");
+}
+
+ATF_TC_BODY(powf_nan_x, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnanf(powf(x, 2.0)) != 0);
+}
+
+ATF_TC(powf_nan_y);
+ATF_TC_HEAD(powf_nan_y, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(x, NaN) == NaN");
+}
+
+ATF_TC_BODY(powf_nan_y, tc)
+{
+ const float y = 0.0L / 0.0L;
+
+ ATF_CHECK(isnanf(powf(2.0, y)) != 0);
+}
+
+ATF_TC(powf_inf_neg_x);
+ATF_TC_HEAD(powf_inf_neg_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(-Inf, y) == +-Inf || +-0.0");
+}
+
+ATF_TC_BODY(powf_inf_neg_x, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float z;
+
+ /*
+ * If y is odd, y > 0, and x is -Inf, -Inf is returned.
+ * If y is even, y > 0, and x is -Inf, +Inf is returned.
+ */
+ z = powf(x, 3.0);
+
+ if (isinff(z) == 0 || signbit(z) == 0)
+ atf_tc_fail_nonfatal("powf(-Inf, 3.0) != -Inf");
+
+ z = powf(x, 4.0);
+
+ if (isinff(z) == 0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(-Inf, 4.0) != +Inf");
+
+ /*
+ * If y is odd, y < 0, and x is -Inf, -0.0 is returned.
+ * If y is even, y < 0, and x is -Inf, +0.0 is returned.
+ */
+ z = powf(x, -3.0);
+
+ if (fabsf(z) > 0.0 || signbit(z) == 0) {
+ atf_tc_expect_fail("PR lib/45372");
+ atf_tc_fail_nonfatal("powf(-Inf, -3.0) != -0.0");
+ }
+
+ z = powf(x, -4.0);
+
+ if (fabsf(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(-Inf -4.0) != +0.0");
+}
+
+ATF_TC(powf_inf_neg_y);
+ATF_TC_HEAD(powf_inf_neg_y, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(x, -Inf) == +Inf || +0.0");
+}
+
+ATF_TC_BODY(powf_inf_neg_y, tc)
+{
+ const float y = -1.0L / 0.0L;
+ float z;
+
+ /*
+ * If |x| < 1 and y is -Inf, +Inf is returned.
+ * If |x| > 1 and y is -Inf, +0.0 is returned.
+ */
+ z = powf(0.1, y);
+
+ if (isinff(z) == 0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(0.1, -Inf) != +Inf");
+
+ z = powf(1.1, y);
+
+ if (fabsf(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(1.1, -Inf) != +0.0");
+}
+
+ATF_TC(powf_inf_pos_x);
+ATF_TC_HEAD(powf_inf_pos_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(+Inf, y) == +Inf || +0.0");
+}
+
+ATF_TC_BODY(powf_inf_pos_x, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float z;
+
+ /*
+ * For y < 0, if x is +Inf, +0.0 is returned.
+ * For y > 0, if x is +Inf, +Inf is returned.
+ */
+ z = powf(x, -2.0);
+
+ if (fabsf(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(+Inf, -2.0) != +0.0");
+
+ z = powf(x, 2.0);
+
+ if (isinff(z) == 0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(+Inf, 2.0) != +Inf");
+}
+
+ATF_TC(powf_inf_pos_y);
+ATF_TC_HEAD(powf_inf_pos_y, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(x, +Inf) == +Inf || +0.0");
+}
+
+ATF_TC_BODY(powf_inf_pos_y, tc)
+{
+ const float y = 1.0L / 0.0L;
+ float z;
+
+ /*
+ * If |x| < 1 and y is +Inf, +0.0 is returned.
+ * If |x| > 1 and y is +Inf, +Inf is returned.
+ */
+ z = powf(0.1, y);
+
+ if (fabsf(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(0.1, +Inf) != +0.0");
+
+ z = powf(1.1, y);
+
+ if (isinff(z) == 0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(1.1, +Inf) != +Inf");
+}
+
+ATF_TC(powf_one_neg_x);
+ATF_TC_HEAD(powf_one_neg_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(-1.0, +-Inf) == 1.0");
+}
+
+ATF_TC_BODY(powf_one_neg_x, tc)
+{
+ const float infp = 1.0L / 0.0L;
+ const float infn = -1.0L / 0.0L;
+
+ /*
+ * If x is -1.0, and y is +-Inf, 1.0 shall be returned.
+ */
+ ATF_REQUIRE(isinff(infp) != 0);
+ ATF_REQUIRE(isinff(infn) != 0);
+
+ if (powf(-1.0, infp) != 1.0) {
+ atf_tc_expect_fail("PR lib/45372");
+ atf_tc_fail_nonfatal("powf(-1.0, +Inf) != 1.0");
+ }
+
+ if (powf(-1.0, infn) != 1.0) {
+ atf_tc_expect_fail("PR lib/45372");
+ atf_tc_fail_nonfatal("powf(-1.0, -Inf) != 1.0");
+ }
+}
+
+ATF_TC(powf_one_pos_x);
+ATF_TC_HEAD(powf_one_pos_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(1.0, y) == 1.0");
+}
+
+ATF_TC_BODY(powf_one_pos_x, tc)
+{
+ const float y[] = { 0.0, 0.1, 2.0, -3.0, 99.0, 99.99, 9999999.9 };
+ const float z = 0.0L / 0.0L;
+ size_t i;
+
+ /*
+ * For any value of y (including NaN),
+ * if x is 1.0, 1.0 shall be returned.
+ */
+ if (powf(1.0, z) != 1.0)
+ atf_tc_fail_nonfatal("powf(1.0, NaN) != 1.0");
+
+ for (i = 0; i < __arraycount(y); i++) {
+
+ if (powf(1.0, y[i]) != 1.0)
+ atf_tc_fail_nonfatal("powf(1.0, %0.01f) != 1.0", y[i]);
+ }
+}
+
+ATF_TC(powf_zero_x);
+ATF_TC_HEAD(powf_zero_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(+-0.0, y) == +-0.0 || HUGE");
+}
+
+ATF_TC_BODY(powf_zero_x, tc)
+{
+ float z;
+
+ /*
+ * If x is +0.0 or -0.0, y > 0, and y
+ * is an odd integer, x is returned.
+ */
+ z = powf(+0.0, 3.0);
+
+ if (fabsf(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(+0.0, 3.0) != +0.0");
+
+ z = powf(-0.0, 3.0);
+
+ if (fabsf(z) > 0.0 || signbit(z) == 0)
+ atf_tc_fail_nonfatal("powf(-0.0, 3.0) != -0.0");
+
+ /*
+ * If y > 0 and not an odd integer,
+ * if x is +0.0 or -0.0, +0.0 is returned.
+ */
+ z = powf(+0.0, 4.0);
+
+ if (fabsf(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(+0.0, 4.0) != +0.0");
+
+ z = powf(-0.0, 4.0);
+
+ if (fabsf(z) > 0.0 || signbit(z) != 0)
+ atf_tc_fail_nonfatal("powf(-0.0, 4.0) != +0.0");
+
+ /*
+ * If y < 0 and x is +0.0 or -0.0, either +-HUGE_VAL,
+ * +-HUGE_VALF, or +-HUGE_VALL shall be returned.
+ */
+ z = powf(+0.0, -4.0);
+
+ if (z != HUGE_VALF) {
+ atf_tc_expect_fail("PR port-amd64/45391");
+ atf_tc_fail_nonfatal("powf(+0.0, -4.0) != HUGE_VALF");
+ }
+
+ z = powf(-0.0, -4.0);
+
+ if (z != HUGE_VALF) {
+ atf_tc_expect_fail("PR port-amd64/45391");
+ atf_tc_fail_nonfatal("powf(-0.0, -4.0) != HUGE_VALF");
+ }
+
+ z = powf(+0.0, -5.0);
+
+ if (z != HUGE_VALF) {
+ atf_tc_expect_fail("PR port-amd64/45391");
+ atf_tc_fail_nonfatal("powf(+0.0, -5.0) != HUGE_VALF");
+ }
+
+ z = powf(-0.0, -5.0);
+
+ if (z != -HUGE_VALF)
+ atf_tc_fail_nonfatal("powf(-0.0, -5.0) != -HUGE_VALF");
+}
+
+ATF_TC(powf_zero_y);
+ATF_TC_HEAD(powf_zero_y, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test powf(x, +-0.0) == 1.0");
+}
+
+ATF_TC_BODY(powf_zero_y, tc)
+{
+ const float x[] = { 0.1, -3.0, 77.0, 99.99, 101.0000001 };
+ const float z = 0.0L / 0.0L;
+ size_t i;
+
+ /*
+ * For any value of x (including NaN),
+ * if y is +0.0 or -0.0, 1.0 is returned.
+ */
+ if (powf(z, +0.0) != 1.0)
+ atf_tc_fail_nonfatal("powf(NaN, +0.0) != 1.0");
+
+ if (powf(z, -0.0) != 1.0)
+ atf_tc_fail_nonfatal("powf(NaN, -0.0) != 1.0");
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ if (powf(x[i], +0.0) != 1.0)
+ atf_tc_fail_nonfatal("powf(%0.01f, +0.0) != 1.0",x[i]);
+
+ if (powf(x[i], -0.0) != 1.0)
+ atf_tc_fail_nonfatal("powf(%0.01f, -0.0) != 1.0",x[i]);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, pow_nan_x);
+ ATF_TP_ADD_TC(tp, pow_nan_y);
+ ATF_TP_ADD_TC(tp, pow_inf_neg_x);
+ ATF_TP_ADD_TC(tp, pow_inf_neg_y);
+ ATF_TP_ADD_TC(tp, pow_inf_pos_x);
+ ATF_TP_ADD_TC(tp, pow_inf_pos_y);
+ ATF_TP_ADD_TC(tp, pow_one_neg_x);
+ ATF_TP_ADD_TC(tp, pow_one_pos_x);
+ ATF_TP_ADD_TC(tp, pow_zero_x);
+ ATF_TP_ADD_TC(tp, pow_zero_y);
+
+ ATF_TP_ADD_TC(tp, powf_nan_x);
+ ATF_TP_ADD_TC(tp, powf_nan_y);
+ ATF_TP_ADD_TC(tp, powf_inf_neg_x);
+ ATF_TP_ADD_TC(tp, powf_inf_neg_y);
+ ATF_TP_ADD_TC(tp, powf_inf_pos_x);
+ ATF_TP_ADD_TC(tp, powf_inf_pos_y);
+ ATF_TP_ADD_TC(tp, powf_one_neg_x);
+ ATF_TP_ADD_TC(tp, powf_one_pos_x);
+ ATF_TP_ADD_TC(tp, powf_zero_x);
+ ATF_TP_ADD_TC(tp, powf_zero_y);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_precision.c b/contrib/netbsd-tests/lib/libm/t_precision.c
new file mode 100644
index 0000000..390be9d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_precision.c
@@ -0,0 +1,76 @@
+/* $NetBSD: t_precision.c,v 1.1 2013/11/11 11:10:45 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_precision.c,v 1.1 2013/11/11 11:10:45 joerg Exp $");
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#include <float.h>
+#include <stdlib.h>
+
+ATF_TC(t_precision);
+
+ATF_TC_HEAD(t_precision, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Basic precision test for double and long double");
+}
+
+volatile double x = 1;
+volatile long double y = 1;
+
+ATF_TC_BODY(t_precision, tc)
+{
+ x += DBL_EPSILON;
+ ATF_CHECK(x != 1.0);
+ x -= 1;
+ ATF_CHECK(x == DBL_EPSILON);
+
+ x = 2;
+ x += DBL_EPSILON;
+ ATF_CHECK(x == 2.0);
+
+ y += LDBL_EPSILON;
+ ATF_CHECK(y != 1.0L);
+ y -= 1;
+ ATF_CHECK(y == LDBL_EPSILON);
+ y = 2;
+ y += LDBL_EPSILON;
+ ATF_CHECK(y == 2.0L);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_precision);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_round.c b/contrib/netbsd-tests/lib/libm/t_round.c
new file mode 100644
index 0000000..f47e1a0
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_round.c
@@ -0,0 +1,85 @@
+/* $NetBSD: t_round.c,v 1.4 2013/11/11 23:57:34 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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 <atf-c.h>
+#include <float.h>
+#include <math.h>
+
+/*
+ * This tests for a bug in the initial implementation where
+ * precision was lost in an internal substraction, leading to
+ * rounding into the wrong direction.
+ */
+
+/* 0.5 - EPSILON */
+#define VAL 0x0.7ffffffffffffcp0
+#define VALF 0x0.7fffff8p0
+#define VALL (0.5 - LDBL_EPSILON)
+
+#ifdef __vax__
+#define SMALL_NUM 1.0e-38
+#else
+#define SMALL_NUM 1.0e-40
+#endif
+
+ATF_TC(round_dir);
+ATF_TC_HEAD(round_dir, tc)
+{
+ atf_tc_set_md_var(tc, "descr","Check for rounding in wrong direction");
+}
+
+ATF_TC_BODY(round_dir, tc)
+{
+ double a = VAL, b, c;
+ float af = VALF, bf, cf;
+ long double al = VALL, bl, cl;
+
+ b = round(a);
+ bf = roundf(af);
+ bl = roundl(al);
+
+ ATF_CHECK(fabs(b) < SMALL_NUM);
+ ATF_CHECK(fabsf(bf) < SMALL_NUM);
+ ATF_CHECK(fabsl(bl) < SMALL_NUM);
+
+ c = round(-a);
+ cf = roundf(-af);
+ cl = roundl(-al);
+
+ ATF_CHECK(fabs(c) < SMALL_NUM);
+ ATF_CHECK(fabsf(cf) < SMALL_NUM);
+ ATF_CHECK(fabsl(cl) < SMALL_NUM);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, round_dir);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_scalbn.c b/contrib/netbsd-tests/lib/libm/t_scalbn.c
new file mode 100644
index 0000000..586c2c3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_scalbn.c
@@ -0,0 +1,523 @@
+/* $NetBSD: t_scalbn.c,v 1.11 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_scalbn.c,v 1.11 2014/03/03 10:39:08 martin Exp $");
+
+#include <math.h>
+#include <limits.h>
+#include <float.h>
+#include <errno.h>
+
+#include <atf-c.h>
+
+static const int exps[] = { 0, 1, -1, 100, -100 };
+
+/* tests here do not require specific precision, so we just use double */
+struct testcase {
+ int exp;
+ double inval;
+ double result;
+ int error;
+};
+struct testcase test_vals[] = {
+ { 0, 1.00085, 1.00085, 0 },
+ { 0, 0.99755, 0.99755, 0 },
+ { 0, -1.00085, -1.00085, 0 },
+ { 0, -0.99755, -0.99755, 0 },
+ { 1, 1.00085, 2.0* 1.00085, 0 },
+ { 1, 0.99755, 2.0* 0.99755, 0 },
+ { 1, -1.00085, 2.0* -1.00085, 0 },
+ { 1, -0.99755, 2.0* -0.99755, 0 },
+
+ /*
+ * We could add more corner test cases here, but we would have to
+ * add some ifdefs for the exact format and use a reliable
+ * generator program - bail for now and only do trivial stuff above.
+ */
+};
+
+/*
+ * scalbn(3)
+ */
+ATF_TC(scalbn_val);
+ATF_TC_HEAD(scalbn_val, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbn() for a few values");
+}
+
+ATF_TC_BODY(scalbn_val, tc)
+{
+ const struct testcase *tests = test_vals;
+ const size_t tcnt = __arraycount(test_vals);
+ size_t i;
+ double rv;
+
+ for (i = 0; i < tcnt; i++) {
+ rv = scalbn(tests[i].inval, tests[i].exp);
+ ATF_CHECK_EQ_MSG(errno, tests[i].error,
+ "test %zu: errno %d instead of %d", i, errno,
+ tests[i].error);
+ ATF_CHECK_MSG(fabs(rv-tests[i].result)<2.0*DBL_EPSILON,
+ "test %zu: return value %g instead of %g (difference %g)",
+ i, rv, tests[i].result, tests[i].result-rv);
+ }
+}
+
+ATF_TC(scalbn_nan);
+ATF_TC_HEAD(scalbn_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbn(NaN, n) == NaN");
+}
+
+ATF_TC_BODY(scalbn_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+ double y;
+ size_t i;
+
+ ATF_REQUIRE(isnan(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbn(x, exps[i]);
+ ATF_CHECK(isnan(y) != 0);
+ }
+}
+
+ATF_TC(scalbn_inf_neg);
+ATF_TC_HEAD(scalbn_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbn(-Inf, n) == -Inf");
+}
+
+ATF_TC_BODY(scalbn_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(scalbn(x, exps[i]) == x);
+}
+
+ATF_TC(scalbn_inf_pos);
+ATF_TC_HEAD(scalbn_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbn(+Inf, n) == +Inf");
+}
+
+ATF_TC_BODY(scalbn_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(scalbn(x, exps[i]) == x);
+}
+
+ATF_TC(scalbn_ldexp);
+ATF_TC_HEAD(scalbn_ldexp, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbn(x, n) == ldexp(x, n)");
+}
+
+ATF_TC_BODY(scalbn_ldexp, tc)
+{
+#if FLT_RADIX == 2
+ const double x = 2.91288191221812821;
+ double y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbn(x, exps[i]);
+ ATF_CHECK_MSG(y == ldexp(x, exps[i]), "test %zu: exponent=%d, "
+ "y=%g, expected %g (diff: %g)", i, exps[i], y,
+ ldexp(x, exps[i]), y - ldexp(x, exps[i]));
+ }
+#endif
+}
+
+ATF_TC(scalbn_zero_neg);
+ATF_TC_HEAD(scalbn_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbn(-0.0, n) == -0.0");
+}
+
+ATF_TC_BODY(scalbn_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbn(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) != 0);
+ }
+}
+
+ATF_TC(scalbn_zero_pos);
+ATF_TC_HEAD(scalbn_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbn(+0.0, n) == +0.0");
+}
+
+ATF_TC_BODY(scalbn_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) == 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbn(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) == 0);
+ }
+}
+
+/*
+ * scalbnf(3)
+ */
+ATF_TC(scalbnf_val);
+ATF_TC_HEAD(scalbnf_val, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnf() for a few values");
+}
+
+ATF_TC_BODY(scalbnf_val, tc)
+{
+ const struct testcase *tests = test_vals;
+ const size_t tcnt = __arraycount(test_vals);
+ size_t i;
+ double rv;
+
+ for (i = 0; i < tcnt; i++) {
+ rv = scalbnf(tests[i].inval, tests[i].exp);
+ ATF_CHECK_EQ_MSG(errno, tests[i].error,
+ "test %zu: errno %d instead of %d", i, errno,
+ tests[i].error);
+ ATF_CHECK_MSG(fabs(rv-tests[i].result)<2.0*FLT_EPSILON,
+ "test %zu: return value %g instead of %g (difference %g)",
+ i, rv, tests[i].result, tests[i].result-rv);
+ }
+}
+
+ATF_TC(scalbnf_nan);
+ATF_TC_HEAD(scalbnf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnf(NaN, n) == NaN");
+}
+
+ATF_TC_BODY(scalbnf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+ float y;
+ size_t i;
+
+ ATF_REQUIRE(isnan(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbnf(x, exps[i]);
+ ATF_CHECK(isnan(y) != 0);
+ }
+}
+
+ATF_TC(scalbnf_inf_neg);
+ATF_TC_HEAD(scalbnf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnf(-Inf, n) == -Inf");
+}
+
+ATF_TC_BODY(scalbnf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(scalbnf(x, exps[i]) == x);
+}
+
+ATF_TC(scalbnf_inf_pos);
+ATF_TC_HEAD(scalbnf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnf(+Inf, n) == +Inf");
+}
+
+ATF_TC_BODY(scalbnf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(scalbnf(x, exps[i]) == x);
+}
+
+ATF_TC(scalbnf_ldexpf);
+ATF_TC_HEAD(scalbnf_ldexpf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnf(x, n) == ldexpf(x, n)");
+}
+
+ATF_TC_BODY(scalbnf_ldexpf, tc)
+{
+#if FLT_RADIX == 2
+ const float x = 2.91288191221812821;
+ float y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbnf(x, exps[i]);
+ ATF_CHECK_MSG(y == ldexpf(x, exps[i]),
+ "test %zu: exponent=%d, y=%g ldexpf returns %g (diff: %g)",
+ i, exps[i], y, ldexpf(x, exps[i]), y-ldexpf(x, exps[i]));
+ }
+#endif
+}
+
+ATF_TC(scalbnf_zero_neg);
+ATF_TC_HEAD(scalbnf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnf(-0.0, n) == -0.0");
+}
+
+ATF_TC_BODY(scalbnf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbnf(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) != 0);
+ }
+}
+
+ATF_TC(scalbnf_zero_pos);
+ATF_TC_HEAD(scalbnf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnf(+0.0, n) == +0.0");
+}
+
+ATF_TC_BODY(scalbnf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) == 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbnf(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) == 0);
+ }
+}
+
+/*
+ * scalbnl(3)
+ */
+ATF_TC(scalbnl_val);
+ATF_TC_HEAD(scalbnl_val, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnl() for a few values");
+}
+
+ATF_TC_BODY(scalbnl_val, tc)
+{
+#ifndef __HAVE_LONG_DOUBLE
+ atf_tc_skip("Requires long double support");
+#else
+ const struct testcase *tests = test_vals;
+ const size_t tcnt = __arraycount(test_vals);
+ size_t i;
+ long double rv;
+
+ for (i = 0; i < tcnt; i++) {
+ rv = scalbnl(tests[i].inval, tests[i].exp);
+ ATF_CHECK_EQ_MSG(errno, tests[i].error,
+ "test %zu: errno %d instead of %d", i, errno,
+ tests[i].error);
+ ATF_CHECK_MSG(fabsl(rv-(long double)tests[i].result)<2.0*LDBL_EPSILON,
+ "test %zu: return value %Lg instead of %Lg (difference %Lg)",
+ i, rv, (long double)tests[i].result, (long double)tests[i].result-rv);
+ }
+#endif
+}
+
+ATF_TC(scalbnl_nan);
+ATF_TC_HEAD(scalbnl_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnl(NaN, n) == NaN");
+}
+
+ATF_TC_BODY(scalbnl_nan, tc)
+{
+#ifndef __HAVE_LONG_DOUBLE
+ atf_tc_skip("Requires long double support");
+#else
+ const long double x = 0.0L / 0.0L;
+ long double y;
+ size_t i;
+
+ if (isnan(x) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("(0.0L / 0.0L) != NaN");
+ }
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbnl(x, exps[i]);
+ ATF_CHECK(isnan(y) != 0);
+ }
+#endif
+}
+
+ATF_TC(scalbnl_inf_neg);
+ATF_TC_HEAD(scalbnl_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnl(-Inf, n) == -Inf");
+}
+
+ATF_TC_BODY(scalbnl_inf_neg, tc)
+{
+#ifndef __HAVE_LONG_DOUBLE
+ atf_tc_skip("Requires long double support");
+#else
+ const long double x = -1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(scalbnl(x, exps[i]) == x);
+#endif
+}
+
+ATF_TC(scalbnl_inf_pos);
+ATF_TC_HEAD(scalbnl_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnl(+Inf, n) == +Inf");
+}
+
+ATF_TC_BODY(scalbnl_inf_pos, tc)
+{
+#ifndef __HAVE_LONG_DOUBLE
+ atf_tc_skip("Requires long double support");
+#else
+ const long double x = 1.0L / 0.0L;
+ size_t i;
+
+ for (i = 0; i < __arraycount(exps); i++)
+ ATF_CHECK(scalbnl(x, exps[i]) == x);
+#endif
+}
+
+ATF_TC(scalbnl_zero_neg);
+ATF_TC_HEAD(scalbnl_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnl(-0.0, n) == -0.0");
+}
+
+ATF_TC_BODY(scalbnl_zero_neg, tc)
+{
+#ifndef __HAVE_LONG_DOUBLE
+ atf_tc_skip("Requires long double support");
+#else
+ const long double x = -0.0L;
+ long double y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) != 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbnl(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) != 0);
+ }
+#endif
+}
+
+ATF_TC(scalbnl_zero_pos);
+ATF_TC_HEAD(scalbnl_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test scalbnl(+0.0, n) == +0.0");
+}
+
+ATF_TC_BODY(scalbnl_zero_pos, tc)
+{
+#ifndef __HAVE_LONG_DOUBLE
+ atf_tc_skip("Requires long double support");
+#else
+ const long double x = 0.0L;
+ long double y;
+ size_t i;
+
+ ATF_REQUIRE(signbit(x) == 0);
+
+ for (i = 0; i < __arraycount(exps); i++) {
+ y = scalbnl(x, exps[i]);
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(y) == 0);
+ }
+#endif
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, scalbn_val);
+ ATF_TP_ADD_TC(tp, scalbn_nan);
+ ATF_TP_ADD_TC(tp, scalbn_inf_neg);
+ ATF_TP_ADD_TC(tp, scalbn_inf_pos);
+ ATF_TP_ADD_TC(tp, scalbn_ldexp);
+ ATF_TP_ADD_TC(tp, scalbn_zero_neg);
+ ATF_TP_ADD_TC(tp, scalbn_zero_pos);
+
+ ATF_TP_ADD_TC(tp, scalbnf_val);
+ ATF_TP_ADD_TC(tp, scalbnf_nan);
+ ATF_TP_ADD_TC(tp, scalbnf_inf_neg);
+ ATF_TP_ADD_TC(tp, scalbnf_inf_pos);
+ ATF_TP_ADD_TC(tp, scalbnf_ldexpf);
+ ATF_TP_ADD_TC(tp, scalbnf_zero_neg);
+ ATF_TP_ADD_TC(tp, scalbnf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, scalbnl_val);
+ ATF_TP_ADD_TC(tp, scalbnl_nan);
+ ATF_TP_ADD_TC(tp, scalbnl_inf_neg);
+ ATF_TP_ADD_TC(tp, scalbnl_inf_pos);
+/* ATF_TP_ADD_TC(tp, scalbnl_ldexp); */
+ ATF_TP_ADD_TC(tp, scalbnl_zero_neg);
+ ATF_TP_ADD_TC(tp, scalbnl_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_sin.c b/contrib/netbsd-tests/lib/libm/t_sin.c
new file mode 100644
index 0000000..a82f49d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_sin.c
@@ -0,0 +1,263 @@
+/* $NetBSD: t_sin.c,v 1.4 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <math.h>
+
+static const struct {
+ int angle;
+ double x;
+ double y;
+} angles[] = {
+ { -180, -3.141592653589793, 0.0000000000000000 },
+ { -135, -2.356194490192345, -0.7071067811865476 },
+ { -90, -1.570796326794897, -1.0000000000000000 },
+ { -45, -0.785398163397448, -0.7071067811865476 },
+ { 0, 0.000000000000000, 0.0000000000000000 },
+ { 30, 0.523598775598299, 0.5000000000000000 },
+ { 45, 0.785398163397448, 0.7071067811865476 },
+ { 60, 1.047197551196598, 0.8660254037844386 },
+ { 90, 1.570796326794897, 1.0000000000000000 },
+ { 120, 2.094395102393195, 0.8660254037844386 },
+ { 135, 2.356194490192345, 0.7071067811865476 },
+ { 150, 2.617993877991494, 0.5000000000000000 },
+ { 180, 3.141592653589793, 0.0000000000000000 },
+ { 270, 4.712388980384690, -1.0000000000000000 },
+ { 360, 6.283185307179586, 0.0000000000000000 }
+};
+
+/*
+ * sin(3)
+ */
+ATF_TC(sin_angles);
+ATF_TC_HEAD(sin_angles, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test some selected angles");
+}
+
+ATF_TC_BODY(sin_angles, tc)
+{
+ const double eps = 1.0e-15;
+ size_t i;
+
+ for (i = 0; i < __arraycount(angles); i++) {
+
+ if (fabs(sin(angles[i].x) - angles[i].y) > eps)
+ atf_tc_fail_nonfatal("sin(%d deg) != %0.01f",
+ angles[i].angle, angles[i].y);
+ }
+}
+
+ATF_TC(sin_nan);
+ATF_TC_HEAD(sin_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sin(NaN) == NaN");
+}
+
+ATF_TC_BODY(sin_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(sin(x)) != 0);
+}
+
+ATF_TC(sin_inf_neg);
+ATF_TC_HEAD(sin_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sin(-Inf) == NaN");
+}
+
+ATF_TC_BODY(sin_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+
+ ATF_CHECK(isnan(sin(x)) != 0);
+}
+
+ATF_TC(sin_inf_pos);
+ATF_TC_HEAD(sin_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sin(+Inf) == NaN");
+}
+
+ATF_TC_BODY(sin_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ ATF_CHECK(isnan(sin(x)) != 0);
+}
+
+
+ATF_TC(sin_zero_neg);
+ATF_TC_HEAD(sin_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sin(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(sin_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ ATF_CHECK(sin(x) == x);
+}
+
+ATF_TC(sin_zero_pos);
+ATF_TC_HEAD(sin_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sin(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(sin_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ ATF_CHECK(sin(x) == x);
+}
+
+/*
+ * sinf(3)
+ */
+ATF_TC(sinf_angles);
+ATF_TC_HEAD(sinf_angles, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test some selected angles");
+}
+
+ATF_TC_BODY(sinf_angles, tc)
+{
+ const float eps = 1.0e-6;
+ float x, y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(angles); i++) {
+
+ x = angles[i].x;
+ y = angles[i].y;
+
+ if (fabsf(sinf(x) - y) > eps)
+ atf_tc_fail_nonfatal("sinf(%d deg) != %0.01f",
+ angles[i].angle, angles[i].y);
+ }
+}
+
+ATF_TC(sinf_nan);
+ATF_TC_HEAD(sinf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinf(NaN) == NaN");
+}
+
+ATF_TC_BODY(sinf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(sinf(x)) != 0);
+}
+
+ATF_TC(sinf_inf_neg);
+ATF_TC_HEAD(sinf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinf(-Inf) == NaN");
+}
+
+ATF_TC_BODY(sinf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+
+ if (isnan(sinf(x)) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("sinf(-Inf) != NaN");
+ }
+}
+
+ATF_TC(sinf_inf_pos);
+ATF_TC_HEAD(sinf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinf(+Inf) == NaN");
+}
+
+ATF_TC_BODY(sinf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+ if (isnan(sinf(x)) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("sinf(+Inf) != NaN");
+ }
+}
+
+
+ATF_TC(sinf_zero_neg);
+ATF_TC_HEAD(sinf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(sinf_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ ATF_CHECK(sinf(x) == x);
+}
+
+ATF_TC(sinf_zero_pos);
+ATF_TC_HEAD(sinf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(sinf_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ ATF_CHECK(sinf(x) == x);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sin_angles);
+ ATF_TP_ADD_TC(tp, sin_nan);
+ ATF_TP_ADD_TC(tp, sin_inf_neg);
+ ATF_TP_ADD_TC(tp, sin_inf_pos);
+ ATF_TP_ADD_TC(tp, sin_zero_neg);
+ ATF_TP_ADD_TC(tp, sin_zero_pos);
+
+ ATF_TP_ADD_TC(tp, sinf_angles);
+ ATF_TP_ADD_TC(tp, sinf_nan);
+ ATF_TP_ADD_TC(tp, sinf_inf_neg);
+ ATF_TP_ADD_TC(tp, sinf_inf_pos);
+ ATF_TP_ADD_TC(tp, sinf_zero_neg);
+ ATF_TP_ADD_TC(tp, sinf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_sinh.c b/contrib/netbsd-tests/lib/libm/t_sinh.c
new file mode 100644
index 0000000..d935f0e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_sinh.c
@@ -0,0 +1,273 @@
+/* $NetBSD: t_sinh.c,v 1.6 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_sinh.c,v 1.6 2014/03/03 10:39:08 martin Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+#include <stdio.h>
+
+static const struct {
+ double x;
+ double y;
+ double e;
+} values[] = {
+ { -10, -11013.23287470339, 1e4, },
+ { -2, -3.626860407847019, 1, },
+ { -1, -1.175201193643801, 1, },
+ { -0.05, -0.050020835937655, 1, },
+ { -0.001,-0.001000000166667, 1, },
+ { 0.001, 0.001000000166667, 1, },
+ { 0.05, 0.050020835937655, 1, },
+ { 1, 1.175201193643801, 1, },
+ { 2, 3.626860407847019, 1, },
+ { 10, 11013.23287470339, 1e4, },
+};
+
+/*
+ * sinh(3)
+ */
+ATF_TC(sinh_inrange);
+ATF_TC_HEAD(sinh_inrange, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "sinh(x) for some values");
+}
+
+ATF_TC_BODY(sinh_inrange, tc)
+{
+ double eps;
+ double x;
+ double y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(values); i++) {
+ x = values[i].x;
+ y = values[i].y;
+ eps = 1e-15 * values[i].e;
+
+ if (fabs(sinh(x) - y) > eps)
+ atf_tc_fail_nonfatal("sinh(%g) != %g\n", x, y);
+ }
+}
+
+ATF_TC(sinh_nan);
+ATF_TC_HEAD(sinh_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinh(NaN) == NaN");
+}
+
+ATF_TC_BODY(sinh_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(sinh(x)) != 0);
+}
+
+ATF_TC(sinh_inf_neg);
+ATF_TC_HEAD(sinh_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinh(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(sinh_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double y = sinh(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) != 0);
+}
+
+ATF_TC(sinh_inf_pos);
+ATF_TC_HEAD(sinh_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinh(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(sinh_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = sinh(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(sinh_zero_neg);
+ATF_TC_HEAD(sinh_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinh(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(sinh_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = sinh(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("sinh(-0.0) != -0.0");
+}
+
+ATF_TC(sinh_zero_pos);
+ATF_TC_HEAD(sinh_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinh(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(sinh_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = sinh(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("sinh(+0.0) != +0.0");
+}
+
+/*
+ * sinhf(3)
+ */
+ATF_TC(sinhf_inrange);
+ATF_TC_HEAD(sinhf_inrange, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "sinhf(x) for some values");
+}
+
+ATF_TC_BODY(sinhf_inrange, tc)
+{
+ float eps;
+ float x;
+ float y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(values); i++) {
+ x = values[i].x;
+ y = values[i].y;
+ eps = 1e-6 * values[i].e;
+
+ if (fabsf(sinhf(x) - y) > eps)
+ atf_tc_fail_nonfatal("sinhf(%g) != %g\n", x, y);
+ }
+}
+
+ATF_TC(sinhf_nan);
+ATF_TC_HEAD(sinhf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinhf(NaN) == NaN");
+}
+
+ATF_TC_BODY(sinhf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(sinhf(x)) != 0);
+}
+
+ATF_TC(sinhf_inf_neg);
+ATF_TC_HEAD(sinhf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinhf(-Inf) == -Inf");
+}
+
+ATF_TC_BODY(sinhf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float y = sinhf(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) != 0);
+}
+
+ATF_TC(sinhf_inf_pos);
+ATF_TC_HEAD(sinhf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinhf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(sinhf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = sinhf(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(sinhf_zero_neg);
+ATF_TC_HEAD(sinhf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinhf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(sinhf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = sinhf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("sinhf(-0.0) != -0.0");
+}
+
+ATF_TC(sinhf_zero_pos);
+ATF_TC_HEAD(sinhf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sinhf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(sinhf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = sinhf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("sinhf(+0.0) != +0.0");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sinh_inrange);
+ ATF_TP_ADD_TC(tp, sinh_nan);
+ ATF_TP_ADD_TC(tp, sinh_inf_neg);
+ ATF_TP_ADD_TC(tp, sinh_inf_pos);
+ ATF_TP_ADD_TC(tp, sinh_zero_neg);
+ ATF_TP_ADD_TC(tp, sinh_zero_pos);
+
+ ATF_TP_ADD_TC(tp, sinhf_inrange);
+ ATF_TP_ADD_TC(tp, sinhf_nan);
+ ATF_TP_ADD_TC(tp, sinhf_inf_neg);
+ ATF_TP_ADD_TC(tp, sinhf_inf_pos);
+ ATF_TP_ADD_TC(tp, sinhf_zero_neg);
+ ATF_TP_ADD_TC(tp, sinhf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_sqrt.c b/contrib/netbsd-tests/lib/libm/t_sqrt.c
new file mode 100644
index 0000000..1d551ec
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_sqrt.c
@@ -0,0 +1,368 @@
+/* $NetBSD: t_sqrt.c,v 1.7 2014/03/12 21:40:07 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_sqrt.c,v 1.7 2014/03/12 21:40:07 martin Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+#include <float.h>
+#include <stdio.h>
+
+/*
+ * sqrt(3)
+ */
+ATF_TC(sqrt_nan);
+ATF_TC_HEAD(sqrt_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrt(NaN) == NaN");
+}
+
+ATF_TC_BODY(sqrt_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(sqrt(x)) != 0);
+}
+
+ATF_TC(sqrt_pow);
+ATF_TC_HEAD(sqrt_pow, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrt(3) vs. pow(3)");
+}
+
+ATF_TC_BODY(sqrt_pow, tc)
+{
+ const double x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.9999 };
+#if __DBL_MIN_10_EXP__ <= -40
+ const double eps = 1.0e-40;
+#else
+ const double eps = __DBL_MIN__*4.0;
+#endif
+ double y, z;
+ size_t i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ y = sqrt(x[i]);
+ z = pow(x[i], 1.0 / 2.0);
+
+ if (fabs(y - z) > eps)
+ atf_tc_fail_nonfatal("sqrt(%0.03f) != "
+ "pow(%0.03f, 1/2)\n", x[i], x[i]);
+ }
+}
+
+ATF_TC(sqrt_inf_neg);
+ATF_TC_HEAD(sqrt_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrt(-Inf) == NaN");
+}
+
+ATF_TC_BODY(sqrt_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+ double y = sqrt(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(sqrt_inf_pos);
+ATF_TC_HEAD(sqrt_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrt(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(sqrt_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+ double y = sqrt(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(sqrt_zero_neg);
+ATF_TC_HEAD(sqrt_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrt(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(sqrt_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = sqrt(x);
+
+ if (fabs(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("sqrt(-0.0) != -0.0");
+}
+
+ATF_TC(sqrt_zero_pos);
+ATF_TC_HEAD(sqrt_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrt(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(sqrt_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = sqrt(x);
+
+ if (fabs(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("sqrt(+0.0) != +0.0");
+}
+
+/*
+ * sqrtf(3)
+ */
+ATF_TC(sqrtf_nan);
+ATF_TC_HEAD(sqrtf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtf(NaN) == NaN");
+}
+
+ATF_TC_BODY(sqrtf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(sqrtf(x)) != 0);
+}
+
+ATF_TC(sqrtf_powf);
+ATF_TC_HEAD(sqrtf_powf, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtf(3) vs. powf(3)");
+}
+
+ATF_TC_BODY(sqrtf_powf, tc)
+{
+ const float x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.9999 };
+ const float eps = 1.0e-30;
+ volatile float y, z;
+ size_t i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ y = sqrtf(x[i]);
+ z = powf(x[i], 1.0 / 2.0);
+
+ if (fabsf(y - z) > eps)
+ atf_tc_fail_nonfatal("sqrtf(%0.03f) != "
+ "powf(%0.03f, 1/2)\n", x[i], x[i]);
+ }
+}
+
+ATF_TC(sqrtf_inf_neg);
+ATF_TC_HEAD(sqrtf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtf(-Inf) == NaN");
+}
+
+ATF_TC_BODY(sqrtf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+ float y = sqrtf(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(sqrtf_inf_pos);
+ATF_TC_HEAD(sqrtf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtf(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(sqrtf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+ float y = sqrtf(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(sqrtf_zero_neg);
+ATF_TC_HEAD(sqrtf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(sqrtf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = sqrtf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("sqrtf(-0.0) != -0.0");
+}
+
+ATF_TC(sqrtf_zero_pos);
+ATF_TC_HEAD(sqrtf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(sqrtf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = sqrtf(x);
+
+ if (fabsf(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("sqrtf(+0.0) != +0.0");
+}
+
+/*
+ * sqrtl(3)
+ */
+ATF_TC(sqrtl_nan);
+ATF_TC_HEAD(sqrtl_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtl(NaN) == NaN");
+}
+
+ATF_TC_BODY(sqrtl_nan, tc)
+{
+ const long double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(sqrtl(x)) != 0);
+}
+
+ATF_TC(sqrtl_powl);
+ATF_TC_HEAD(sqrtl_powl, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtl(3) vs. powl(3)");
+}
+
+ATF_TC_BODY(sqrtl_powl, tc)
+{
+ const long double x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.9999 };
+ const long double eps = 5.0*DBL_EPSILON; /* XXX powl == pow for now */
+ volatile long double y, z;
+ size_t i;
+
+ for (i = 0; i < __arraycount(x); i++) {
+
+ y = sqrtl(x[i]);
+ z = powl(x[i], 1.0 / 2.0);
+
+ if (fabsl(y - z) > eps)
+ atf_tc_fail_nonfatal("sqrtl(%0.03Lf) != "
+ "powl(%0.03Lf, 1/2)\n", x[i], x[i]);
+ }
+}
+
+ATF_TC(sqrtl_inf_neg);
+ATF_TC_HEAD(sqrtl_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtl(-Inf) == NaN");
+}
+
+ATF_TC_BODY(sqrtl_inf_neg, tc)
+{
+ const long double x = -1.0L / 0.0L;
+ long double y = sqrtl(x);
+
+ ATF_CHECK(isnan(y) != 0);
+}
+
+ATF_TC(sqrtl_inf_pos);
+ATF_TC_HEAD(sqrtl_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtl(+Inf) == +Inf");
+}
+
+ATF_TC_BODY(sqrtl_inf_pos, tc)
+{
+ const long double x = 1.0L / 0.0L;
+ long double y = sqrtl(x);
+
+ ATF_CHECK(isinf(y) != 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TC(sqrtl_zero_neg);
+ATF_TC_HEAD(sqrtl_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtl(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(sqrtl_zero_neg, tc)
+{
+ const long double x = -0.0L;
+ long double y = sqrtl(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) == 0)
+ atf_tc_fail_nonfatal("sqrtl(-0.0) != -0.0");
+}
+
+ATF_TC(sqrtl_zero_pos);
+ATF_TC_HEAD(sqrtl_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sqrtl(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(sqrtl_zero_pos, tc)
+{
+ const long double x = 0.0L;
+ long double y = sqrtl(x);
+
+ if (fabsl(y) > 0.0 || signbit(y) != 0)
+ atf_tc_fail_nonfatal("sqrtl(+0.0) != +0.0");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sqrt_nan);
+ ATF_TP_ADD_TC(tp, sqrt_pow);
+ ATF_TP_ADD_TC(tp, sqrt_inf_neg);
+ ATF_TP_ADD_TC(tp, sqrt_inf_pos);
+ ATF_TP_ADD_TC(tp, sqrt_zero_neg);
+ ATF_TP_ADD_TC(tp, sqrt_zero_pos);
+
+ ATF_TP_ADD_TC(tp, sqrtf_nan);
+ ATF_TP_ADD_TC(tp, sqrtf_powf);
+ ATF_TP_ADD_TC(tp, sqrtf_inf_neg);
+ ATF_TP_ADD_TC(tp, sqrtf_inf_pos);
+ ATF_TP_ADD_TC(tp, sqrtf_zero_neg);
+ ATF_TP_ADD_TC(tp, sqrtf_zero_pos);
+
+ ATF_TP_ADD_TC(tp, sqrtl_nan);
+ ATF_TP_ADD_TC(tp, sqrtl_powl);
+ ATF_TP_ADD_TC(tp, sqrtl_inf_neg);
+ ATF_TP_ADD_TC(tp, sqrtl_inf_pos);
+ ATF_TP_ADD_TC(tp, sqrtl_zero_neg);
+ ATF_TP_ADD_TC(tp, sqrtl_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_tan.c b/contrib/netbsd-tests/lib/libm/t_tan.c
new file mode 100644
index 0000000..807e3d1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_tan.c
@@ -0,0 +1,260 @@
+/* $NetBSD: t_tan.c,v 1.5 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <atf-c.h>
+#include <math.h>
+
+static const struct {
+ int angle;
+ double x;
+ double y;
+} angles[] = {
+ { -180, -3.141592653589793, 0.0000000000000000 },
+ { -135, -2.356194490192345, 1.0000000000000000 },
+ { -45, -0.785398163397448, -1.0000000000000000 },
+ { 0, 0.000000000000000, 0.0000000000000000 },
+ { 30, 0.523598775598299, 0.5773502691896258 },
+ { 45, 0.785398163397448, 1.0000000000000000 },
+ { 60, 1.047197551196598, 1.7320508075688773 },
+ { 120, 2.094395102393195, -1.7320508075688773 },
+ { 135, 2.356194490192345, -1.0000000000000000 },
+ { 150, 2.617993877991494, -0.5773502691896258 },
+ { 180, 3.141592653589793, 0.0000000000000000 },
+ { 360, 6.283185307179586, 0.0000000000000000 }
+};
+
+/*
+ * tan(3)
+ */
+ATF_TC(tan_angles);
+ATF_TC_HEAD(tan_angles, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test some selected angles");
+}
+
+ATF_TC_BODY(tan_angles, tc)
+{
+ const double eps = 1.0e-14;
+ size_t i;
+
+ for (i = 0; i < __arraycount(angles); i++) {
+
+ if (fabs(tan(angles[i].x) - angles[i].y) > eps)
+ atf_tc_fail_nonfatal("tan(%d deg) != %0.01f",
+ angles[i].angle, angles[i].y);
+ }
+}
+
+ATF_TC(tan_nan);
+ATF_TC_HEAD(tan_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tan(NaN) == NaN");
+}
+
+ATF_TC_BODY(tan_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(tan(x)) != 0);
+}
+
+ATF_TC(tan_inf_neg);
+ATF_TC_HEAD(tan_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tan(-Inf) == NaN");
+}
+
+ATF_TC_BODY(tan_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+
+ ATF_CHECK(isnan(tan(x)) != 0);
+}
+
+ATF_TC(tan_inf_pos);
+ATF_TC_HEAD(tan_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tan(+Inf) == NaN");
+}
+
+ATF_TC_BODY(tan_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ ATF_CHECK(isnan(tan(x)) != 0);
+}
+
+
+ATF_TC(tan_zero_neg);
+ATF_TC_HEAD(tan_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tan(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(tan_zero_neg, tc)
+{
+ const double x = -0.0L;
+
+ ATF_CHECK(tan(x) == x);
+}
+
+ATF_TC(tan_zero_pos);
+ATF_TC_HEAD(tan_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tan(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(tan_zero_pos, tc)
+{
+ const double x = 0.0L;
+
+ ATF_CHECK(tan(x) == x);
+}
+
+/*
+ * tanf(3)
+ */
+ATF_TC(tanf_angles);
+ATF_TC_HEAD(tanf_angles, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test some selected angles");
+}
+
+ATF_TC_BODY(tanf_angles, tc)
+{
+ const float eps = 1.0e-6;
+ float x, y;
+ size_t i;
+
+ for (i = 0; i < __arraycount(angles); i++) {
+
+ x = angles[i].x;
+ y = angles[i].y;
+
+ if (fabsf(tanf(x) - y) > eps)
+ atf_tc_fail_nonfatal("tanf(%d deg) != %0.01f",
+ angles[i].angle, angles[i].y);
+ }
+}
+
+ATF_TC(tanf_nan);
+ATF_TC_HEAD(tanf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanf(NaN) == NaN");
+}
+
+ATF_TC_BODY(tanf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(tanf(x)) != 0);
+}
+
+ATF_TC(tanf_inf_neg);
+ATF_TC_HEAD(tanf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanf(-Inf) == NaN");
+}
+
+ATF_TC_BODY(tanf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+
+ if (isnan(tanf(x)) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("tanf(-Inf) != NaN");
+ }
+}
+
+ATF_TC(tanf_inf_pos);
+ATF_TC_HEAD(tanf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanf(+Inf) == NaN");
+}
+
+ATF_TC_BODY(tanf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+ if (isnan(tanf(x)) == 0) {
+ atf_tc_expect_fail("PR lib/45362");
+ atf_tc_fail("tanf(+Inf) != NaN");
+ }
+}
+
+
+ATF_TC(tanf_zero_neg);
+ATF_TC_HEAD(tanf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(tanf_zero_neg, tc)
+{
+ const float x = -0.0L;
+
+ ATF_CHECK(tanf(x) == x);
+}
+
+ATF_TC(tanf_zero_pos);
+ATF_TC_HEAD(tanf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(tanf_zero_pos, tc)
+{
+ const float x = 0.0L;
+
+ ATF_CHECK(tanf(x) == x);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, tan_angles);
+ ATF_TP_ADD_TC(tp, tan_nan);
+ ATF_TP_ADD_TC(tp, tan_inf_neg);
+ ATF_TP_ADD_TC(tp, tan_inf_pos);
+ ATF_TP_ADD_TC(tp, tan_zero_neg);
+ ATF_TP_ADD_TC(tp, tan_zero_pos);
+
+ ATF_TP_ADD_TC(tp, tanf_angles);
+ ATF_TP_ADD_TC(tp, tanf_nan);
+ ATF_TP_ADD_TC(tp, tanf_inf_neg);
+ ATF_TP_ADD_TC(tp, tanf_inf_pos);
+ ATF_TP_ADD_TC(tp, tanf_zero_neg);
+ ATF_TP_ADD_TC(tp, tanf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libm/t_tanh.c b/contrib/netbsd-tests/lib/libm/t_tanh.c
new file mode 100644
index 0000000..4cc4551
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libm/t_tanh.c
@@ -0,0 +1,207 @@
+/* $NetBSD: t_tanh.c,v 1.7 2014/03/03 10:39:08 martin Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_tanh.c,v 1.7 2014/03/03 10:39:08 martin Exp $");
+
+#include <atf-c.h>
+#include <math.h>
+
+/*
+ * tanh(3)
+ */
+ATF_TC(tanh_nan);
+ATF_TC_HEAD(tanh_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanh(NaN) == NaN");
+}
+
+ATF_TC_BODY(tanh_nan, tc)
+{
+ const double x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(tanh(x)) != 0);
+}
+
+ATF_TC(tanh_inf_neg);
+ATF_TC_HEAD(tanh_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanh(-Inf) == -1.0");
+}
+
+ATF_TC_BODY(tanh_inf_neg, tc)
+{
+ const double x = -1.0L / 0.0L;
+
+ ATF_CHECK(tanh(x) == -1.0);
+}
+
+ATF_TC(tanh_inf_pos);
+ATF_TC_HEAD(tanh_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanh(+Inf) == +1.0");
+}
+
+ATF_TC_BODY(tanh_inf_pos, tc)
+{
+ const double x = 1.0L / 0.0L;
+
+ ATF_CHECK(tanh(x) == 1.0);
+}
+
+ATF_TC(tanh_zero_neg);
+ATF_TC_HEAD(tanh_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanh(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(tanh_zero_neg, tc)
+{
+ const double x = -0.0L;
+ double y = tanh(x);
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) != 0);
+
+ ATF_REQUIRE_MSG(signbit(y) != 0,
+ "compiler bug, waiting for newer gcc import, see PR lib/44057");
+}
+
+ATF_TC(tanh_zero_pos);
+ATF_TC_HEAD(tanh_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanh(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(tanh_zero_pos, tc)
+{
+ const double x = 0.0L;
+ double y = tanh(x);
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) == 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+/*
+ * tanhf(3)
+ */
+ATF_TC(tanhf_nan);
+ATF_TC_HEAD(tanhf_nan, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanhf(NaN) == NaN");
+}
+
+ATF_TC_BODY(tanhf_nan, tc)
+{
+ const float x = 0.0L / 0.0L;
+
+ ATF_CHECK(isnan(x) != 0);
+ ATF_CHECK(isnan(tanhf(x)) != 0);
+}
+
+ATF_TC(tanhf_inf_neg);
+ATF_TC_HEAD(tanhf_inf_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanhf(-Inf) == -1.0");
+}
+
+ATF_TC_BODY(tanhf_inf_neg, tc)
+{
+ const float x = -1.0L / 0.0L;
+
+ ATF_CHECK(tanhf(x) == -1.0);
+}
+
+ATF_TC(tanhf_inf_pos);
+ATF_TC_HEAD(tanhf_inf_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanhf(+Inf) == +1.0");
+}
+
+ATF_TC_BODY(tanhf_inf_pos, tc)
+{
+ const float x = 1.0L / 0.0L;
+
+ ATF_CHECK(tanhf(x) == 1.0);
+}
+
+ATF_TC(tanhf_zero_neg);
+ATF_TC_HEAD(tanhf_zero_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanhf(-0.0) == -0.0");
+}
+
+ATF_TC_BODY(tanhf_zero_neg, tc)
+{
+ const float x = -0.0L;
+ float y = tanh(x);
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) != 0);
+
+ ATF_REQUIRE_MSG(signbit(y) != 0,
+ "compiler bug, waiting for newer gcc import, see PR lib/44057");
+}
+
+ATF_TC(tanhf_zero_pos);
+ATF_TC_HEAD(tanhf_zero_pos, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test tanhf(+0.0) == +0.0");
+}
+
+ATF_TC_BODY(tanhf_zero_pos, tc)
+{
+ const float x = 0.0L;
+ float y = tanhf(x);
+
+ ATF_CHECK(x == y);
+ ATF_CHECK(signbit(x) == 0);
+ ATF_CHECK(signbit(y) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, tanh_nan);
+ ATF_TP_ADD_TC(tp, tanh_inf_neg);
+ ATF_TP_ADD_TC(tp, tanh_inf_pos);
+ ATF_TP_ADD_TC(tp, tanh_zero_neg);
+ ATF_TP_ADD_TC(tp, tanh_zero_pos);
+
+ ATF_TP_ADD_TC(tp, tanhf_nan);
+ ATF_TP_ADD_TC(tp, tanhf_inf_neg);
+ ATF_TP_ADD_TC(tp, tanhf_inf_pos);
+ ATF_TP_ADD_TC(tp, tanhf_zero_neg);
+ ATF_TP_ADD_TC(tp, tanhf_zero_pos);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libobjc/t_threads.m b/contrib/netbsd-tests/lib/libobjc/t_threads.m
new file mode 100644
index 0000000..a6bd720
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libobjc/t_threads.m
@@ -0,0 +1,136 @@
+/* $NetBSD: t_threads.m,v 1.2 2013/10/31 21:02:11 christos Exp $ */
+
+/*
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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.
+ */
+
+/* Originally written by David Wetzel */
+
+#include <assert.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include <objc/objc.h>
+#include <objc/thr.h>
+#include <objc/Object.h>
+#if __GNUC_PREREQ__(4,8)
+#include <objc/runtime.h>
+#endif
+
+static int IsMultithreaded = 0;
+static objc_mutex_t Mutex;
+static objc_condition_t Condition;
+
+@interface MyClass : Object
+{
+}
+-(void)start;
+#if __GNUC_PREREQ__(4,8)
+-init;
++new;
++alloc;
+-free;
+#endif
+@end
+
+@implementation MyClass
+-(void)start
+{
+ printf("detached thread started!\n");
+
+ objc_condition_signal(Condition);
+}
+#if __GNUC_PREREQ__(4,8)
+-init
+{
+ return self;
+}
+
++new
+{
+ return [[self alloc] init];
+}
+
++alloc
+{
+ return class_createInstance(self, 0);
+}
+
+-free
+{
+ return object_dispose(self);
+}
+#endif
+@end
+
+static void
+becomeMultiThreaded(void)
+{
+ printf("becoming multithreaded!\n");
+ IsMultithreaded++;
+}
+
+ATF_TC(thread_callback);
+ATF_TC_HEAD(thread_callback, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that the thread callback is only"
+ "called once");
+}
+ATF_TC_BODY(thread_callback, tc)
+{
+ id o = [MyClass new];
+ objc_thread_callback cb;
+ objc_thread_t rv;
+
+ cb = objc_set_thread_callback(becomeMultiThreaded);
+ printf("Old Callback: %p\n", cb);
+ ATF_CHECK(cb == 0);
+
+ Mutex = objc_mutex_allocate();
+ Condition = objc_condition_allocate();
+
+ ATF_CHECK_EQ(0, IsMultithreaded);
+
+ rv = objc_thread_detach(@selector(start), o, nil);
+ printf("detach value: %p\n", rv);
+ assert(rv != NULL);
+
+ objc_mutex_lock(Mutex);
+ objc_condition_wait(Condition, Mutex);
+ objc_mutex_unlock(Mutex);
+
+ ATF_CHECK_EQ(1, IsMultithreaded);
+ printf("Shutting down\n");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, thread_callback);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libposix/t_rename.c b/contrib/netbsd-tests/lib/libposix/t_rename.c
new file mode 100644
index 0000000..85b2b95
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libposix/t_rename.c
@@ -0,0 +1,89 @@
+/* $NetBSD: t_rename.c,v 1.2 2011/05/16 00:03:36 christos Exp $ */
+
+/*
+ * Copyright (c) 2001, 2008, 2010 The NetBSD Foundation, 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 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.
+ */
+#define _NETBSD_SOURCE /* strlcat/random */
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_rename.c,v 1.2 2011/05/16 00:03:36 christos Exp $");
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(rename);
+ATF_TC_HEAD(rename, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks rename(2)");
+}
+ATF_TC_BODY(rename, tc)
+{
+ struct stat sb;
+
+ REQUIRE_LIBC(open("t1", O_CREAT | O_TRUNC | O_WRONLY, 0600), -1);
+ REQUIRE_LIBC(link("t1", "t2"), -1);
+
+ /* Check if rename to same name works as expected */
+ REQUIRE_LIBC(rename("t1", "t1"), -1);
+
+ /* Rename removed file? */
+ REQUIRE_LIBC(stat("t1", &sb), -1);
+
+ REQUIRE_LIBC(rename("t1", "t2"), -1);
+
+#if BSD_RENAME
+ /* check if rename of hardlinked file works the BSD way */
+ ATF_REQUIRE_MSG(stat("t1", &sb) != 0, "BSD rename should remove file t1");
+ ATF_REQUIRE_EQ(errno, ENOENT);
+#else
+ /* check if rename of hardlinked file works as the standard says */
+ REQUIRE_LIBC(stat("t1", &sb), -1);
+#endif
+ /* check if we get the expected error */
+ /* this also exercises icky shared libraries goo */
+ ATF_REQUIRE_MSG(rename("no/such/file/or/dir", "no/such/file/or/dir") != 0,
+ "No error renaming nonexistent file");
+ ATF_REQUIRE_EQ(errno, ENOENT);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, rename);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libppath/personnel.plist b/contrib/netbsd-tests/lib/libppath/personnel.plist
new file mode 100644
index 0000000..daec88c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libppath/personnel.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>John Doe</key>
+ <dict>
+ <key>children</key>
+ <array>
+ <string>Jane Doe</string>
+ <string>John Doe, Jr.</string>
+ </array>
+
+ <key>pets</key>
+ <array>
+ <string>Fido</string>
+ <string>Spot</string>
+ </array>
+
+ <key>job title</key>
+ <string>computer programmer</string>
+
+ <key>u.s. citizen</key>
+ <true/>
+ </dict>
+</dict>
+</plist>
diff --git a/contrib/netbsd-tests/lib/libppath/plist_to_c b/contrib/netbsd-tests/lib/libppath/plist_to_c
new file mode 100755
index 0000000..f471b4e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libppath/plist_to_c
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+prog=$(basename $0)
+usage()
+{
+ echo "usage: ${prog} symbol" 1>&2
+ exit 1
+}
+
+if [ $# -ne 1 ]; then
+ usage
+fi
+
+sed 's/\(["\]\)/\\\1/g' | \
+${AWK:-awk} -v sym=$1 '
+BEGIN { printf "const char " sym "[] = \""; }
+ { printf $0 "\\n"; }
+END { print "\";"; }'
+
+exit 0
diff --git a/contrib/netbsd-tests/lib/libppath/t_ppath.c b/contrib/netbsd-tests/lib/libppath/t_ppath.c
new file mode 100644
index 0000000..7330763
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libppath/t_ppath.c
@@ -0,0 +1,1548 @@
+/* $Id: t_ppath.c,v 1.1 2011/08/25 19:09:46 dyoung Exp $ */
+
+/* Copyright (c) 2010 David Young. All rights reserved. */
+
+#include <sys/cdefs.h>
+__RCSID("$Id: t_ppath.c,v 1.1 2011/08/25 19:09:46 dyoung Exp $");
+
+#include <assert.h>
+#include <atf-c.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <ppath/ppath.h>
+#include "personnel.h"
+
+void test_ppath_extant_inc(void);
+void test_ppath_extant_dec(void);
+void test_ppath_component_extant_inc(void);
+void test_ppath_component_extant_dec(void);
+
+__strong_alias(ppath_extant_inc, test_ppath_extant_inc);
+__strong_alias(ppath_extant_dec, test_ppath_extant_dec);
+__strong_alias(ppath_component_extant_inc, test_ppath_component_extant_inc);
+__strong_alias(ppath_component_extant_dec, test_ppath_component_extant_dec);
+
+static uint64_t nppath = 0, nppath_component = 0;
+
+static bool
+dictionary_equals(prop_dictionary_t ld, prop_dictionary_t rd)
+{
+ bool eq;
+ char *lt, *rt;
+
+ lt = prop_dictionary_externalize(ld);
+ rt = prop_dictionary_externalize(rd);
+
+ assert(lt != NULL && rt != NULL);
+
+ eq = (strcmp(lt, rt) == 0);
+
+ free(lt);
+ free(rt);
+
+ return eq;
+}
+
+static void
+assert_no_ppath_extant(void)
+{
+ ATF_CHECK_EQ(nppath, 0);
+}
+
+static void
+assert_no_ppath_component_extant(void)
+{
+ ATF_CHECK_EQ(nppath_component, 0);
+}
+
+void
+test_ppath_extant_inc(void)
+{
+ if (++nppath == 0)
+ atf_tc_fail("count of extant paths overflowed");
+}
+
+void
+test_ppath_extant_dec(void)
+{
+ if (nppath-- == 0)
+ atf_tc_fail("count of extant path underflowed");
+}
+
+void
+test_ppath_component_extant_inc(void)
+{
+ if (++nppath_component == 0)
+ atf_tc_fail("count of extant path components overflowed");
+}
+
+void
+test_ppath_component_extant_dec(void)
+{
+ if (nppath_component-- == 0)
+ atf_tc_fail("count of extant path components underflowed");
+}
+
+ATF_TC(push_until_full);
+
+ATF_TC_HEAD(push_until_full, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_push() returns error "
+ "after ppath_t reaches maximum length");
+}
+
+ATF_TC_BODY(push_until_full, tc)
+{
+ ppath_t *p, *rp;
+ ppath_component_t *pc;
+ int i;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if ((pc = ppath_idx(0)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ rp = ppath_push(p, pc);
+ ATF_CHECK_EQ(rp, p);
+ }
+
+ rp = ppath_push(p, pc);
+ ATF_CHECK_EQ(rp, NULL);
+
+ rp = ppath_push(p, pc);
+ ATF_CHECK_EQ(rp, NULL);
+
+ ppath_component_release(pc);
+ ppath_release(p);
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(pop_until_empty);
+ATF_TC_HEAD(pop_until_empty, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_pop() returns error "
+ "after ppath_t is empty");
+}
+
+ATF_TC_BODY(pop_until_empty, tc)
+{
+ ppath_t *p, *rp;
+ ppath_component_t *pc, *rpc;
+ int i;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if ((pc = ppath_idx(0)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ rp = ppath_push(p, pc);
+ ATF_CHECK_EQ(rp, p);
+ }
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ rp = ppath_pop(p, &rpc);
+ ATF_CHECK_EQ(rp, p);
+ ATF_CHECK_EQ(rpc, pc);
+ ppath_component_release(rpc);
+ }
+
+ rp = ppath_pop(p, &rpc);
+ ATF_CHECK_EQ(rp, NULL);
+ rp = ppath_pop(p, &rpc);
+ ATF_CHECK_EQ(rp, NULL);
+
+ ppath_component_release(pc);
+ ppath_release(p);
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(length);
+
+ATF_TC_HEAD(length, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check that ppath_push() "
+ "and ppath_pop() affect ppath_length() correctly");
+}
+
+ATF_TC_BODY(length, tc)
+{
+ ppath_t *p, *rp;
+ ppath_component_t *pc;
+ unsigned int i, len;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if ((pc = ppath_idx(0)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ len = ppath_length(p);
+ ATF_CHECK_EQ(len, i);
+ rp = ppath_push(p, pc);
+ ATF_CHECK_EQ(rp, p);
+ }
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ len = ppath_length(p);
+ ATF_CHECK_EQ(len, PPATH_MAX_COMPONENTS - i);
+ rp = ppath_pop(p, NULL);
+ ATF_CHECK_EQ(rp, p);
+ }
+ ppath_component_release(pc);
+ ppath_release(p);
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(component_at);
+
+ATF_TC_HEAD(component_at, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check that ppath_component_at() "
+ "returns the expected component");
+}
+
+ATF_TC_BODY(component_at, tc)
+{
+ ppath_t *p, *rp;
+ ppath_component_t *pc;
+ unsigned int i;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ if ((pc = ppath_idx(i)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+ rp = ppath_push(p, pc);
+ ppath_component_release(pc);
+ ATF_CHECK_EQ(rp, p);
+ }
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ pc = ppath_component_at(p, i);
+ ATF_CHECK_EQ(ppath_component_idx(pc), (int)i);
+ ppath_component_release(pc);
+ }
+ ppath_release(p);
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(get_idx_key);
+
+ATF_TC_HEAD(get_idx_key, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check that ppath_component_idx() "
+ "and ppath_component_key() return -1 and NULL, respectively, if "
+ "the component is a key or an index, respectively.");
+}
+
+ATF_TC_BODY(get_idx_key, tc)
+{
+ ppath_component_t *idx, *key;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((idx = ppath_idx(0)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+ if ((key = ppath_key("key")) == NULL)
+ atf_tc_fail("ppath_idx failed");
+
+ ATF_CHECK_EQ(ppath_component_key(idx), NULL);
+ ATF_CHECK_EQ(ppath_component_idx(key), -1);
+
+ ppath_component_release(idx);
+ ppath_component_release(key);
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(ppath_copy);
+
+ATF_TC_HEAD(ppath_copy, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check that ppath_copy() "
+ "creates an exact replica of a path, and that no "
+ "resources are leaked.");
+}
+
+ATF_TC_BODY(ppath_copy, tc)
+{
+ ppath_component_t *pc, *cpc;
+ ppath_t *p, *cp, *rp;
+ unsigned int i;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ if ((pc = ppath_idx(i)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+ rp = ppath_push(p, pc);
+ ppath_component_release(pc);
+ ATF_CHECK_EQ(rp, p);
+ }
+
+ if ((cp = ppath_copy(p)) == NULL)
+ atf_tc_fail("ppath_copy failed");
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ pc = ppath_component_at(p, i);
+ cpc = ppath_component_at(cp, i);
+ ATF_CHECK_EQ(pc, cpc);
+ ppath_component_release(pc);
+ ppath_component_release(cpc);
+ }
+
+ ppath_release(cp);
+ ppath_release(p);
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(replace);
+
+ATF_TC_HEAD(replace, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check that ppath_replace_idx() "
+ "and ppath_replace_key() produce the paths we expect without "
+ "leaking resources.");
+}
+
+ATF_TC_BODY(replace, tc)
+{
+ ppath_component_t *pc;
+ ppath_t *p, *cp, *rp;
+ unsigned int i;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ /* index replacement fails on an empty path */
+ rp = ppath_replace_idx(p, 0);
+ ATF_CHECK_EQ(rp, NULL);
+
+ /* key replacement fails on an empty path */
+ rp = ppath_replace_key(p, "key");
+ ATF_CHECK_EQ(rp, NULL);
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS; i++) {
+ if ((pc = ppath_idx(i)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+ rp = ppath_push(p, pc);
+ ppath_component_release(pc);
+ ATF_CHECK_EQ(rp, p);
+ }
+
+ if ((cp = ppath_copy(p)) == NULL)
+ atf_tc_fail("ppath_copy failed");
+
+ rp = ppath_pop(cp, NULL);
+ ATF_CHECK_EQ(rp, cp);
+ rp = ppath_push_key(cp, "key");
+ ATF_CHECK_EQ(rp, cp);
+
+ ppath_replace_idx(p, 0);
+
+ if ((pc = ppath_component_at(p, PPATH_MAX_COMPONENTS - 1)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+ ATF_CHECK_EQ(ppath_component_idx(pc), 0);
+ ppath_component_release(pc);
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS - 1; i++) {
+ if ((pc = ppath_component_at(p, i)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+ ATF_CHECK_EQ(ppath_component_idx(pc), (int)i);
+ ppath_component_release(pc);
+ }
+
+ for (i = 0; i < PPATH_MAX_COMPONENTS - 1; i++) {
+ if ((pc = ppath_component_at(cp, i)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+ ATF_CHECK_EQ(ppath_component_idx(pc), (int)i);
+ ppath_component_release(pc);
+ }
+
+ if ((pc = ppath_component_at(cp, PPATH_MAX_COMPONENTS - 1)) == NULL)
+ atf_tc_fail("ppath_idx failed");
+ if (ppath_component_key(pc) == NULL ||
+ strcmp(ppath_component_key(pc), "key") != 0)
+ atf_tc_fail("last path component expected to be \"key\"");
+ ppath_component_release(pc);
+ ppath_release(p);
+ ppath_release(cp);
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(copyset_object_twice_success);
+
+ATF_TC_HEAD(copyset_object_twice_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "check that after back-to-back ppath_copyset_object() calls, "
+ "changing the \"u.s. citizen\" property and the first property "
+ "in \"children\" in the \"John Doe\" record in the "
+ "\"personnel\" property list, the properties are changed "
+ "in the new dictionary and unchanged in the old dictionary");
+}
+
+ATF_TC_BODY(copyset_object_twice_success, tc)
+{
+ const char *s;
+ char *oext, *next;
+ int rc;
+ bool v = false;
+ prop_dictionary_t d, od;
+ prop_object_t nd = NULL, ond;
+ prop_object_t r, or;
+ ppath_t *p, *p2, *p3;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+ od = prop_dictionary_copy(d);
+
+ if (!dictionary_equals(od, d)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(d);
+ atf_tc_fail("dictionaries are unequal from the outset, argh! "
+ "original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ if ((p = ppath_create()) == NULL || (p2 = ppath_create()) == NULL ||
+ (p3 = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ if (ppath_push_key(p2, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p2, "children") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_idx(p2, 0) == NULL)
+ atf_tc_fail("ppath_push_idx failed");
+
+ if (ppath_push_key(p3, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ s = "";
+ rc = ppath_get_string(d, p2, &s);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_STREQ(s, "Jane Doe");
+
+ rc = ppath_copyset_bool(d, &nd, p, false);
+ ATF_CHECK_EQ(rc, 0);
+
+ rc = ppath_get_object(nd, p3, &r);
+ ATF_CHECK_EQ(rc, 0);
+
+ ond = nd;
+
+ rc = ppath_copyset_string(d, &nd, p2, "Martha Doe");
+ ATF_CHECK_EQ(rc, 0);
+
+ ATF_CHECK_EQ(nd, ond);
+
+ rc = ppath_get_object(nd, p3, &or);
+ ATF_CHECK_EQ(rc, 0);
+
+ ATF_CHECK_EQ(r, or);
+
+ v = true;
+ rc = ppath_get_bool(nd, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, false);
+
+ s = "";
+ rc = ppath_get_string(nd, p2, &s);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_STREQ(s, "Martha Doe");
+
+ if (!dictionary_equals(od, d)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(d);
+ atf_tc_fail("copydel modified original dictionary, "
+ "original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ if (dictionary_equals(od, nd)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(nd);
+ atf_tc_fail("copydel made no change to the new "
+ "dictionary, original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ rc = ppath_set_bool(od, p, false);
+ ATF_CHECK_EQ(rc, 0);
+
+ rc = ppath_set_string(od, p2, "Martha Doe");
+ ATF_CHECK_EQ(rc, 0);
+
+ if (!dictionary_equals(od, nd)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(nd);
+ atf_tc_fail("copydel made an out-of-bounds change to the new "
+ "dictionary, original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ ppath_release(p);
+ ppath_release(p2);
+ ppath_release(p3);
+ prop_object_release(d);
+ prop_object_release(od);
+ prop_object_release(nd);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(copydel_object_twice_success);
+
+ATF_TC_HEAD(copydel_object_twice_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "check that after back-to-back ppath_copydel_object() calls, "
+ "removing the \"u.s. citizen\" property and the first property "
+ "in \"children\" from the \"John Doe\" record in the "
+ "\"personnel\" property list, the properties are missing "
+ "from the new dictionary and unchanged in the old dictionary");
+}
+
+ATF_TC_BODY(copydel_object_twice_success, tc)
+{
+ const char *s;
+ char *oext, *next;
+ int rc;
+ bool v = false;
+ prop_dictionary_t d, od;
+ prop_object_t nd = NULL, ond;
+ prop_object_t r, or;
+ ppath_t *p, *p2, *p3;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+ od = prop_dictionary_copy(d);
+
+ if (!dictionary_equals(od, d)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(d);
+ atf_tc_fail("dictionaries are unequal from the outset, argh! "
+ "original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ if ((p = ppath_create()) == NULL || (p2 = ppath_create()) == NULL ||
+ (p3 = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ if (ppath_push_key(p2, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p2, "children") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_idx(p2, 0) == NULL)
+ atf_tc_fail("ppath_push_idx failed");
+
+ if (ppath_push_key(p3, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ s = "";
+ rc = ppath_get_string(d, p2, &s);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_STREQ(s, "Jane Doe");
+
+ rc = ppath_copydel_bool(d, &nd, p);
+ ATF_CHECK_EQ(rc, 0);
+
+ ond = nd;
+
+ rc = ppath_get_object(nd, p3, &r);
+ ATF_CHECK_EQ(rc, 0);
+
+ rc = ppath_copydel_string(d, &nd, p2);
+ ATF_CHECK_EQ(rc, 0);
+
+ ATF_CHECK_EQ(nd, ond);
+
+ rc = ppath_get_object(nd, p3, &or);
+ ATF_CHECK_EQ(rc, 0);
+
+ ATF_CHECK_EQ(r, or);
+
+ v = true;
+ rc = ppath_get_bool(nd, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_EQ(v, true);
+
+ if (!dictionary_equals(od, d)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(d);
+ atf_tc_fail("copydel modified original dictionary, "
+ "original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ if (dictionary_equals(od, nd)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(nd);
+ atf_tc_fail("copydel made no change to the new "
+ "dictionary, original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ rc = ppath_delete_bool(od, p);
+ ATF_CHECK_EQ(rc, 0);
+
+ rc = ppath_delete_string(od, p2);
+ ATF_CHECK_EQ(rc, 0);
+
+ if (!dictionary_equals(od, nd)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(nd);
+ atf_tc_fail("copydel made an out-of-bounds change to the new "
+ "dictionary, original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ ppath_release(p);
+ ppath_release(p2);
+ ppath_release(p3);
+ prop_object_release(d);
+ prop_object_release(od);
+ prop_object_release(nd);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(copydel_bool_success);
+
+ATF_TC_HEAD(copydel_bool_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_copydel_bool() deletes "
+ "the \"u.s. citizen\" property in the \"John Doe\" record in the "
+ "\"personnel\" property list and verifies the value is missing "
+ "from the new dictionary and unchanged in the old dictionary");
+}
+
+ATF_TC_BODY(copydel_bool_success, tc)
+{
+ char *oext, *next;
+ int rc;
+ bool v = false;
+ prop_dictionary_t d, od;
+ prop_object_t nd = NULL;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+ od = prop_dictionary_copy(d);
+
+ if (!dictionary_equals(od, d)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(d);
+ atf_tc_fail("dictionaries are unequal from the outset, argh! "
+ "original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ rc = ppath_copydel_bool(d, &nd, p);
+ ATF_CHECK_EQ(rc, 0);
+
+ v = true;
+ rc = ppath_get_bool(nd, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_EQ(v, true);
+
+ if (!dictionary_equals(od, d)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(d);
+ atf_tc_fail("copydel modified original dictionary, "
+ "original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ if (dictionary_equals(od, nd)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(nd);
+ atf_tc_fail("copydel made no change to the new "
+ "dictionary, original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ rc = ppath_delete_bool(od, p);
+ ATF_CHECK_EQ(rc, 0);
+
+ if (!dictionary_equals(od, nd)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(nd);
+ atf_tc_fail("copydel made an out-of-bounds change to the new "
+ "dictionary, original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ ppath_release(p);
+ prop_object_release(d);
+ prop_object_release(od);
+ prop_object_release(nd);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(copyset_bool_success);
+
+ATF_TC_HEAD(copyset_bool_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_copyset_bool() sets "
+ "the \"u.s. citizen\" property in the \"John Doe\" record in the "
+ "\"personnel\" property list to false and verifies the new value "
+ "in the new dictionary and that the old dictionary is unchanged");
+}
+
+ATF_TC_BODY(copyset_bool_success, tc)
+{
+ char *oext, *next;
+ int rc;
+ bool v = false;
+ prop_dictionary_t d, od;
+ prop_object_t nd = NULL;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+ od = prop_dictionary_copy(d);
+
+ if (!dictionary_equals(od, d)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(d);
+ atf_tc_fail("dictionaries are unequal from the outset, argh! "
+ "original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ rc = ppath_copyset_bool(d, &nd, p, false);
+ ATF_CHECK_EQ(rc, 0);
+
+ v = true;
+ rc = ppath_get_bool(nd, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, false);
+
+ if (!dictionary_equals(od, d)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(d);
+ atf_tc_fail("copyset modified original dictionary, "
+ "original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ if (dictionary_equals(od, nd)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(nd);
+ atf_tc_fail("copyset made no change to the new "
+ "dictionary, original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ rc = ppath_set_bool(nd, p, true);
+ ATF_CHECK_EQ(rc, 0);
+
+ if (!dictionary_equals(od, nd)) {
+ oext = prop_dictionary_externalize(od);
+ next = prop_dictionary_externalize(nd);
+ atf_tc_fail("copyset made an out-of-bounds change to the new "
+ "dictionary, original\n%s\nnew\n%s", oext, next);
+ free(oext);
+ free(next);
+ }
+
+ ppath_release(p);
+ prop_object_release(d);
+ prop_object_release(od);
+ prop_object_release(nd);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(set_bool_eftype);
+
+ATF_TC_HEAD(set_bool_eftype, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_set_bool() does not "
+ "overwrite with a bool "
+ "the \"job title\" property in the \"John Doe\" record in "
+ "the "
+ "\"personnel\" property list");
+}
+
+ATF_TC_BODY(set_bool_eftype, tc)
+{
+ int rc;
+ bool v = false;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "job title") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, EFTYPE);
+ ATF_CHECK_EQ(v, false);
+
+ rc = ppath_set_bool(d, p, false);
+ ATF_CHECK_EQ(rc, EFTYPE);
+
+ v = true;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, EFTYPE);
+ ATF_CHECK_EQ(v, true);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(set_bool_enoent);
+
+ATF_TC_HEAD(set_bool_enoent, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_set_bool() does not create "
+ "the \"russian citizen\" property in the \"John Doe\" record in "
+ "the "
+ "\"personnel\" property list");
+}
+
+ATF_TC_BODY(set_bool_enoent, tc)
+{
+ int rc;
+ bool v = false;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "russian citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_EQ(v, false);
+
+ rc = ppath_set_bool(d, p, false);
+ ATF_CHECK_EQ(rc, ENOENT);
+
+ v = true;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_EQ(v, true);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(create_bool_eexist);
+
+ATF_TC_HEAD(create_bool_eexist, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_create_bool() returns "
+ "EEXIST because the \"u.s. citizen\" property in the "
+ "\"John Doe\" record in the \"personnel\" property list "
+ "already exists");
+}
+
+ATF_TC_BODY(create_bool_eexist, tc)
+{
+ int rc;
+ bool v = false;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ rc = ppath_create_bool(d, p, false);
+ ATF_CHECK_EQ(rc, EEXIST);
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(create_bool_success);
+
+ATF_TC_HEAD(create_bool_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_create_bool() creates "
+ "the \"russian citizen\" property in the \"John Doe\" record in "
+ "the \"personnel\" property list and sets it to false");
+}
+
+ATF_TC_BODY(create_bool_success, tc)
+{
+ int rc;
+ bool v = false;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "russian citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_EQ(v, false);
+
+ rc = ppath_create_bool(d, p, false);
+ ATF_CHECK_EQ(rc, 0);
+
+ v = true;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, false);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(set_bool_success);
+
+ATF_TC_HEAD(set_bool_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_set_bool() sets "
+ "the \"u.s. citizen\" property in the \"John Doe\" record in the "
+ "\"personnel\" property list to false and verifies the new value");
+}
+
+ATF_TC_BODY(set_bool_success, tc)
+{
+ int rc;
+ bool v = false;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ rc = ppath_set_bool(d, p, v);
+ ATF_CHECK_EQ(rc, 0);
+
+ v = true;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(get_bool_success);
+
+ATF_TC_HEAD(get_bool_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_get_bool() fetches "
+ "the \"u.s. citizen\" property from the \"John Doe\" record in the "
+ "\"personnel\" property list, and compares it with the expected "
+ "value, true");
+}
+
+ATF_TC_BODY(get_bool_success, tc)
+{
+ int rc;
+ bool v = false;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_EQ(v, true);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(delete_bool_success);
+
+ATF_TC_HEAD(delete_bool_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_delete_bool() succeeds "
+ "for the path (\"John Doe\", \"u.s. citizen\") in the "
+ "\"personnel\" property list");
+}
+
+ATF_TC_BODY(delete_bool_success, tc)
+{
+ int rc;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ rc = ppath_delete_bool(d, p);
+ ATF_CHECK_EQ(rc, 0);
+
+ rc = ppath_get_bool(d, p, NULL);
+ ATF_CHECK_EQ(rc, ENOENT);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(delete_bool_eftype);
+
+ATF_TC_HEAD(delete_bool_eftype, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_delete_bool() returns "
+ "EFTYPE for the path (\"John Doe\", \"job title\") in the "
+ "\"personnel\" property list and does not delete the path");
+}
+
+ATF_TC_BODY(delete_bool_eftype, tc)
+{
+ int rc;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "job title") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ rc = ppath_delete_bool(d, p);
+ ATF_CHECK_EQ(rc, EFTYPE);
+
+ rc = ppath_get_object(d, p, NULL);
+ ATF_CHECK_EQ(rc, 0);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(delete_bool_enoent);
+
+ATF_TC_HEAD(delete_bool_enoent, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_delete_bool() returns "
+ "ENOENT for the path (\"John Doe\", \"citizen\") in the "
+ "\"personnel\" property list");
+}
+
+ATF_TC_BODY(delete_bool_enoent, tc)
+{
+ int rc;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ rc = ppath_delete_bool(d, p);
+ ATF_CHECK_EQ(rc, ENOENT);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(get_bool_enoent);
+
+ATF_TC_HEAD(get_bool_enoent, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_get_bool() returns "
+ "ENOENT for the path (\"John Doe\", \"citizen\") in the "
+ "\"personnel\" property list, and the bool * argument is "
+ "unchanged");
+}
+
+ATF_TC_BODY(get_bool_enoent, tc)
+{
+ int rc;
+ bool v;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = true;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_EQ(v, true);
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_EQ(v, false);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(get_bool_eftype);
+
+ATF_TC_HEAD(get_bool_eftype, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_get_bool() returns "
+ "EFTYPE for the path (\"John Doe\", \"job title\") in the "
+ "\"personnel\" property list, and the bool * argument is "
+ "unchanged");
+}
+
+ATF_TC_BODY(get_bool_eftype, tc)
+{
+ int rc;
+ bool v;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "job title") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = true;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, EFTYPE);
+ ATF_CHECK_EQ(v, true);
+
+ v = false;
+ rc = ppath_get_bool(d, p, &v);
+ ATF_CHECK_EQ(rc, EFTYPE);
+ ATF_CHECK_EQ(v, false);
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(get_string_eftype);
+
+ATF_TC_HEAD(get_string_eftype, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_get_string() returns "
+ "EFTYPE for the path (\"John Doe\", \"u.s. citizen\") in the "
+ "\"personnel\" property list, and the const char ** argument is "
+ "unchanged");
+}
+
+ATF_TC_BODY(get_string_eftype, tc)
+{
+ int rc;
+ const char *v;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "u.s. citizen") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = NULL;
+ rc = ppath_get_string(d, p, &v);
+ ATF_CHECK_EQ(rc, EFTYPE);
+ ATF_CHECK_EQ(v, NULL);
+
+ v = "xyz";
+ rc = ppath_get_string(d, p, &v);
+ ATF_CHECK_EQ(rc, EFTYPE);
+ ATF_CHECK_STREQ(v, "xyz");
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(get_string_enoent);
+
+ATF_TC_HEAD(get_string_enoent, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_get_string() returns "
+ "ENOENT for the path (\"John Doe\", \"title\") in the "
+ "\"personnel\" property list, and the const char ** argument is "
+ "unchanged");
+}
+
+ATF_TC_BODY(get_string_enoent, tc)
+{
+ int rc;
+ const char *v;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "title") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ v = NULL;
+ rc = ppath_get_string(d, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_EQ(v, NULL);
+
+ v = "xyz";
+ rc = ppath_get_string(d, p, &v);
+ ATF_CHECK_EQ(rc, ENOENT);
+ ATF_CHECK_STREQ(v, "xyz");
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TC(get_string_success);
+
+ATF_TC_HEAD(get_string_success, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "check ppath_get_string() fetches "
+ "the \"job title\" property from the \"John Doe\" record in the "
+ "\"personnel\" property list and compares it with the expected "
+ "value, \"computer programmer\"");
+}
+
+ATF_TC_BODY(get_string_success, tc)
+{
+ int rc;
+ const char *v = NULL;;
+ prop_dictionary_t d;
+ ppath_t *p;
+
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+
+ if ((d = prop_dictionary_internalize(personnel)) == NULL)
+ atf_tc_fail("prop_dictionary_internalize failed");
+
+ if ((p = ppath_create()) == NULL)
+ atf_tc_fail("ppath_create failed");
+
+ if (ppath_push_key(p, "John Doe") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+ if (ppath_push_key(p, "job title") == NULL)
+ atf_tc_fail("ppath_push_key failed");
+
+ rc = ppath_get_string(d, p, &v);
+ ATF_CHECK_EQ(rc, 0);
+ ATF_CHECK_STREQ(v, "computer programmer");
+
+ ppath_release(p);
+ prop_object_release(d);
+ assert_no_ppath_extant();
+ assert_no_ppath_component_extant();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, push_until_full);
+ ATF_TP_ADD_TC(tp, pop_until_empty);
+ ATF_TP_ADD_TC(tp, length);
+ ATF_TP_ADD_TC(tp, component_at);
+ ATF_TP_ADD_TC(tp, get_idx_key);
+ ATF_TP_ADD_TC(tp, ppath_copy);
+ ATF_TP_ADD_TC(tp, replace);
+
+ ATF_TP_ADD_TC(tp, delete_bool_eftype);
+ ATF_TP_ADD_TC(tp, delete_bool_enoent);
+ ATF_TP_ADD_TC(tp, delete_bool_success);
+
+ ATF_TP_ADD_TC(tp, get_bool_eftype);
+ ATF_TP_ADD_TC(tp, get_bool_enoent);
+ ATF_TP_ADD_TC(tp, get_bool_success);
+
+ ATF_TP_ADD_TC(tp, copydel_bool_success);
+ ATF_TP_ADD_TC(tp, copydel_object_twice_success);
+ ATF_TP_ADD_TC(tp, copyset_object_twice_success);
+ ATF_TP_ADD_TC(tp, copyset_bool_success);
+ ATF_TP_ADD_TC(tp, create_bool_eexist);
+ ATF_TP_ADD_TC(tp, create_bool_success);
+ ATF_TP_ADD_TC(tp, set_bool_enoent);
+ ATF_TP_ADD_TC(tp, set_bool_eftype);
+ ATF_TP_ADD_TC(tp, set_bool_success);
+
+ ATF_TP_ADD_TC(tp, get_string_eftype);
+ ATF_TP_ADD_TC(tp, get_string_enoent);
+ ATF_TP_ADD_TC(tp, get_string_success);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libprop/t_basic.c b/contrib/netbsd-tests/lib/libprop/t_basic.c
new file mode 100644
index 0000000..febf29d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libprop/t_basic.c
@@ -0,0 +1,203 @@
+/* $NetBSD: t_basic.c,v 1.4 2011/04/20 20:02:58 martin Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Written by Jason Thorpe 5/26/2006.
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_basic.c,v 1.4 2011/04/20 20:02:58 martin Exp $");
+
+#include <stdlib.h>
+#include <string.h>
+#include <prop/proplib.h>
+
+#include <atf-c.h>
+
+static const char compare1[] =
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
+"<plist version=\"1.0\">\n"
+"<dict>\n"
+" <key>false-val</key>\n"
+" <false/>\n"
+" <key>one</key>\n"
+" <integer>1</integer>\n"
+" <key>three</key>\n"
+" <array>\n"
+" <dict>\n"
+" <key>one</key>\n"
+" <integer>1</integer>\n"
+" <key>two</key>\n"
+" <string>number-two</string>\n"
+" </dict>\n"
+" <dict>\n"
+" <key>one</key>\n"
+" <integer>1</integer>\n"
+" <key>two</key>\n"
+" <string>number-two</string>\n"
+" </dict>\n"
+" <dict>\n"
+" <key>one</key>\n"
+" <integer>1</integer>\n"
+" <key>two</key>\n"
+" <string>number-two</string>\n"
+" </dict>\n"
+" </array>\n"
+" <key>true-val</key>\n"
+" <true/>\n"
+" <key>two</key>\n"
+" <string>number-two</string>\n"
+"</dict>\n"
+"</plist>\n";
+
+ATF_TC(prop_basic);
+ATF_TC_HEAD(prop_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of proplib(3)");
+}
+
+ATF_TC_BODY(prop_basic, tc)
+{
+ prop_dictionary_t dict;
+ char *ext1;
+
+ dict = prop_dictionary_create();
+ ATF_REQUIRE(dict != NULL);
+
+ {
+ prop_number_t num = prop_number_create_integer(1);
+ ATF_REQUIRE(num != NULL);
+
+ ATF_REQUIRE_EQ(prop_dictionary_set(dict, "one", num), true);
+ prop_object_release(num);
+ }
+
+ {
+ prop_string_t str = prop_string_create_cstring("number-two");
+ ATF_REQUIRE(str != NULL);
+
+ ATF_REQUIRE_EQ(prop_dictionary_set(dict, "two", str), true);
+ prop_object_release(str);
+ }
+
+ {
+ prop_array_t arr;
+ prop_dictionary_t dict_copy;
+ int i;
+
+ arr = prop_array_create();
+ ATF_REQUIRE(arr != NULL);
+
+ for (i = 0; i < 3; ++i) {
+ dict_copy = prop_dictionary_copy(dict);
+ ATF_REQUIRE(dict_copy != NULL);
+ ATF_REQUIRE_EQ(prop_array_add(arr, dict_copy), true);
+ prop_object_release(dict_copy);
+ }
+
+ ATF_REQUIRE_EQ(prop_dictionary_set(dict, "three", arr), true);
+ prop_object_release(arr);
+ }
+
+ {
+ prop_bool_t val = prop_bool_create(true);
+ ATF_REQUIRE(val != NULL);
+ ATF_REQUIRE_EQ(prop_dictionary_set(dict, "true-val", val), true);
+ prop_object_release(val);
+
+ val = prop_bool_create(false);
+ ATF_REQUIRE(val != NULL);
+ ATF_REQUIRE_EQ(prop_dictionary_set(dict, "false-val", val), true);
+ prop_object_release(val);
+ }
+
+ ext1 = prop_dictionary_externalize(dict);
+ ATF_REQUIRE(ext1 != NULL);
+ ATF_REQUIRE_STREQ(compare1, ext1);
+
+ {
+ prop_dictionary_t dict2;
+ char *ext2;
+
+ dict2 = prop_dictionary_internalize(ext1);
+ ATF_REQUIRE(dict2 != NULL);
+ ext2 = prop_dictionary_externalize(dict2);
+ ATF_REQUIRE(ext2 != NULL);
+ ATF_REQUIRE_STREQ(ext1, ext2);
+ prop_object_release(dict2);
+ free(ext2);
+ }
+
+ prop_object_release(dict);
+ free(ext1);
+}
+
+ATF_TC(prop_dictionary_equals);
+ATF_TC_HEAD(prop_dictionary_equals, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test prop_dictionary_equals(3)");
+}
+
+ATF_TC_BODY(prop_dictionary_equals, tc)
+{
+ prop_dictionary_t c, d;
+
+ /*
+ * Fixed, should not fail any more...
+ *
+ atf_tc_expect_death("PR lib/43964");
+ *
+ */
+
+ d = prop_dictionary_internalize(compare1);
+
+ ATF_REQUIRE(d != NULL);
+
+ c = prop_dictionary_copy(d);
+
+ ATF_REQUIRE(c != NULL);
+
+ if (prop_dictionary_equals(c, d) != true)
+ atf_tc_fail("dictionaries are not equal");
+
+ prop_object_release(c);
+ prop_object_release(d);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, prop_basic);
+ ATF_TP_ADD_TC(tp, prop_dictionary_equals);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/d_mach b/contrib/netbsd-tests/lib/libpthread/d_mach
new file mode 100644
index 0000000..f3c3981
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/d_mach
@@ -0,0 +1,92 @@
+above.warped.net
+anoncvs.cirr.com
+anoncvs.isc.netbsd.org
+anoncvs.leo.org
+anoncvs.netbsd.lt
+anoncvs.netbsd.ro
+anoncvs.netbsd.se
+antioche.antioche.eu.org
+boulder.tele.dk
+centaurus.4web.cz
+chur.math.ntnu.no
+cnftp.bjpu.edu.cn
+console.netbsd.org
+cvs.fi.netbsd.org
+cvs.mikrolahti.fi
+cvs.netbsd.org
+cvsup-netbsd.leo.org
+cvsup.netbsd.se
+cvsup.pasta.cs.uit.no
+ftp.bitcon.no
+ftp.chg.ru
+ftp.duth.gr
+ftp.estpak.ee
+ftp.fsn.hu
+ftp.funet.fi
+ftp.grondar.za
+ftp.leo.org
+ftp.netbsd.lt
+ftp.netbsd.org
+ftp.nluug.nl
+ftp.plig.org
+ftp.uni-erlangen.de
+ftp.xgate.co.kr
+gd.tuwien.ac.at
+gort.ludd.luth.se
+grappa.unix-ag.uni-kl.de
+info.wins.uva.nl
+irc.warped.net
+knug.youn.co.kr
+lala.iri.co.jp
+mail.jp.netbsd.org
+mail.kr.netbsd.org
+mail.netbsd.org
+melanoma.cs.rmit.edu.au
+mirror.aarnet.edu.au
+mirror.netbsd.com.br
+mirror03.inet.tele.dk
+moon.vub.ac.be
+nbwww.sergei.cc
+net.bsd.cz
+netbsd.3miasto.net
+netbsd.4ka.mipt.ru
+netbsd.apk.od.ua
+netbsd.csie.nctu.edu.tw
+netbsd.enderunix.org
+netbsd.ftp.fu-berlin.de
+netbsd.netlead.com.au
+netbsd.nsysu.edu.tw
+netbsd.pair.com
+netbsd.stevens-tech.edu
+netbsd.triada.bg
+netbsd.unix.net.nz
+netbsd.unixtech.be
+netbsd.vejas.lt
+netbsd.wagener-consulting.lu
+netbsd.zarco.org
+netbsdiso.interoute.net.uk
+netbsdwww.bitcon.no
+netbsdwww.cordef.com.pl
+netbsdwww.cs.rmit.edu.au
+netbsdwww.interoute.net.uk
+news.gw.com
+ns.netbsd.org
+pigu.iri.co.jp
+pluto.cdpa.nsysu.edu.tw
+projects.slowass.net
+server6.pasta.cs.uit.no
+skeleton.phys.spbu.ru
+snoopy.allbsd.org
+spike.allbsd.org
+sundry.netbsd.org
+tanya.sergei.cc
+web-a.fi.gw.com
+web-a.us.gw.com
+web.netbsd.mirror.arhea.net
+www.en.netbsd.de
+www.netbsd.cl
+www.netbsd.nl
+www.netbsd.org
+www.netbsd.ro
+zathras.netbsd.org
+zeppo.rediris.es
diff --git a/contrib/netbsd-tests/lib/libpthread/dlopen/dso/h_pthread_dlopen.c b/contrib/netbsd-tests/lib/libpthread/dlopen/dso/h_pthread_dlopen.c
new file mode 100644
index 0000000..63bf6a3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/dlopen/dso/h_pthread_dlopen.c
@@ -0,0 +1,86 @@
+/* $NetBSD: h_pthread_dlopen.c,v 1.1 2013/03/21 16:50:22 christos Exp $ */
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: h_pthread_dlopen.c,v 1.1 2013/03/21 16:50:22 christos Exp $");
+
+#if 0
+#include <atf-c.h>
+#else
+#include <assert.h>
+#define ATF_REQUIRE(a) assert(a)
+#endif
+#include <unistd.h>
+#include <pthread.h>
+
+int testf_dso_null(void);
+int testf_dso_mutex_lock(pthread_mutex_t *);
+int testf_dso_mutex_unlock(pthread_mutex_t *);
+int testf_dso_pthread_create(pthread_t *, const pthread_attr_t *,
+ void *(*)(void *), void *);
+
+int
+testf_dso_null(void)
+{
+ return 0xcafe;
+}
+
+int
+testf_dso_mutex_lock(pthread_mutex_t *mtx)
+{
+ ATF_REQUIRE(mtx != NULL);
+ ATF_REQUIRE(pthread_mutex_lock(mtx) == 0);
+
+ return 0xcafe;
+}
+
+int
+testf_dso_mutex_unlock(pthread_mutex_t *mtx)
+{
+ ATF_REQUIRE(mtx != NULL);
+ ATF_REQUIRE(pthread_mutex_unlock(mtx) == 0);
+
+ return 0xcafe;
+}
+
+int
+testf_dso_pthread_create(pthread_t *thread, const pthread_attr_t *attr,
+ void *(*routine)(void *), void *arg)
+{
+ int ret;
+
+ ret = pthread_create(thread, attr, routine, arg);
+ ATF_REQUIRE(ret == 0);
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/dlopen/t_dlopen.c b/contrib/netbsd-tests/lib/libpthread/dlopen/t_dlopen.c
new file mode 100644
index 0000000..68e9835
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/dlopen/t_dlopen.c
@@ -0,0 +1,171 @@
+/* $NetBSD: t_dlopen.c,v 1.1 2013/03/21 16:50:21 christos Exp $ */
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_dlopen.c,v 1.1 2013/03/21 16:50:21 christos Exp $");
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <pthread.h>
+#include <unistd.h>
+
+ATF_TC(dlopen);
+
+ATF_TC_HEAD(dlopen, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test if dlopen can load -lpthread DSO");
+}
+
+#define DSO TESTDIR "/h_pthread_dlopen.so"
+
+ATF_TC_BODY(dlopen, tc)
+{
+ void *handle;
+ int (*testf_dso_null)(void);
+ handle = dlopen(DSO, RTLD_NOW | RTLD_LOCAL);
+ ATF_REQUIRE_MSG(handle != NULL, "dlopen fails: %s", dlerror());
+
+ testf_dso_null = dlsym(handle, "testf_dso_null");
+ ATF_REQUIRE_MSG(testf_dso_null != NULL, "dlsym fails: %s", dlerror());
+
+ ATF_REQUIRE(testf_dso_null() == 0xcafe);
+
+ ATF_REQUIRE(dlclose(handle) == 0);
+}
+
+ATF_TC(dlopen_mutex);
+
+ATF_TC_HEAD(dlopen_mutex, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test if dlopen can load -lpthread DSO without breaking mutex");
+}
+
+ATF_TC_BODY(dlopen_mutex, tc)
+{
+ pthread_mutex_t mtx;
+ void *handle;
+ int (*testf_dso_null)(void);
+
+ ATF_REQUIRE(pthread_mutex_init(&mtx, NULL) == 0);
+ ATF_REQUIRE(pthread_mutex_lock(&mtx) == 0);
+
+ handle = dlopen(DSO, RTLD_NOW | RTLD_LOCAL);
+ ATF_REQUIRE_MSG(handle != NULL, "dlopen fails: %s", dlerror());
+
+ testf_dso_null = dlsym(handle, "testf_dso_null");
+ ATF_REQUIRE_MSG(testf_dso_null != NULL, "dlsym fails: %s", dlerror());
+
+ ATF_REQUIRE(testf_dso_null() == 0xcafe);
+
+ ATF_REQUIRE(pthread_mutex_unlock(&mtx) == 0);
+
+ ATF_REQUIRE(dlclose(handle) == 0);
+
+ pthread_mutex_destroy(&mtx);
+}
+
+ATF_TC(dlopen_mutex_libc);
+
+ATF_TC_HEAD(dlopen_mutex_libc, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test if dlopen can load -lpthread DSO and use libc locked mutex");
+}
+
+ATF_TC_BODY(dlopen_mutex_libc, tc)
+{
+ pthread_mutex_t mtx;
+ void *handle;
+ int (*testf_dso_mutex_unlock)(pthread_mutex_t *);
+
+ ATF_REQUIRE(pthread_mutex_init(&mtx, NULL) == 0);
+ ATF_REQUIRE(pthread_mutex_lock(&mtx) == 0);
+
+ handle = dlopen(DSO, RTLD_NOW | RTLD_LOCAL);
+ ATF_REQUIRE_MSG(handle != NULL, "dlopen fails: %s", dlerror());
+
+ testf_dso_mutex_unlock = dlsym(handle, "testf_dso_mutex_unlock");
+ ATF_REQUIRE_MSG(testf_dso_mutex_unlock != NULL,
+ "dlsym fails: %s", dlerror());
+
+ ATF_REQUIRE(testf_dso_mutex_unlock(&mtx) == 0xcafe);
+
+ dlclose(handle);
+
+ pthread_mutex_destroy(&mtx);
+}
+
+ATF_TC(dlopen_mutex_libpthread);
+
+ATF_TC_HEAD(dlopen_mutex_libpthread, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test if dlopen can load -lpthread DSO and use "
+ "libpthread locked mutex");
+}
+
+ATF_TC_BODY(dlopen_mutex_libpthread, tc)
+{
+ pthread_mutex_t mtx;
+ void *handle;
+ int (*testf_dso_mutex_lock)(pthread_mutex_t *);
+
+ ATF_REQUIRE(pthread_mutex_init(&mtx, NULL) == 0);
+
+ handle = dlopen(DSO, RTLD_NOW | RTLD_LOCAL);
+ ATF_REQUIRE_MSG(handle != NULL, "dlopen fails: %s", dlerror());
+
+ testf_dso_mutex_lock = dlsym(handle, "testf_dso_mutex_lock");
+ ATF_REQUIRE_MSG(testf_dso_mutex_lock != NULL,
+ "dlsym fails: %s", dlerror());
+
+ ATF_REQUIRE(testf_dso_mutex_lock(&mtx) == 0xcafe);
+
+ ATF_REQUIRE(pthread_mutex_unlock(&mtx) == 0);
+
+ dlclose(handle);
+
+ pthread_mutex_destroy(&mtx);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, dlopen);
+ ATF_TP_ADD_TC(tp, dlopen_mutex);
+ ATF_TP_ADD_TC(tp, dlopen_mutex_libc);
+ ATF_TP_ADD_TC(tp, dlopen_mutex_libpthread);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/dlopen/t_dso_pthread_create.c b/contrib/netbsd-tests/lib/libpthread/dlopen/t_dso_pthread_create.c
new file mode 100644
index 0000000..ab8bec3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/dlopen/t_dso_pthread_create.c
@@ -0,0 +1,96 @@
+/* $NetBSD: t_dso_pthread_create.c,v 1.1 2013/03/21 16:50:21 christos Exp $ */
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_dso_pthread_create.c,v 1.1 2013/03/21 16:50:21 christos Exp $");
+
+#include <sys/resource.h>
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#define DSO TESTDIR "/h_pthread_dlopen.so"
+
+void *
+routine(void *arg)
+{
+ ATF_REQUIRE((intptr_t)arg == 0xcafe);
+ return NULL;
+}
+
+ATF_TC(dso_pthread_create_dso);
+
+ATF_TC_HEAD(dso_pthread_create_dso, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test if non -lpthread main can call pthread_create() "
+ "in -lpthread DSO");
+}
+
+ATF_TC_BODY(dso_pthread_create_dso, tc)
+{
+ int ret;
+ pthread_t thread;
+ void *arg = (void *)0xcafe;
+ void *handle;
+ int (*testf_dso_pthread_create)(pthread_t *, pthread_attr_t *,
+ void *(*)(void *), void *);
+ struct rlimit rl;
+
+ atf_tc_expect_signal(6,
+ "calling pthread_create() requires -lpthread main");
+
+ rl.rlim_max = rl.rlim_cur = 0;
+ ATF_REQUIRE_EQ(setrlimit(RLIMIT_CORE, &rl), 0);
+
+ handle = dlopen(DSO, RTLD_NOW | RTLD_LOCAL);
+ ATF_REQUIRE_MSG(handle != NULL, "dlopen fails: %s", dlerror());
+
+ testf_dso_pthread_create = dlsym(handle, "testf_dso_pthread_create");
+ ATF_REQUIRE_MSG(testf_dso_pthread_create != NULL,
+ "dlsym fails: %s", dlerror());
+
+ ret = testf_dso_pthread_create(&thread, NULL, routine, arg);
+ ATF_REQUIRE(ret == 0);
+
+ ATF_REQUIRE(dlclose(handle) == 0);
+
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, dso_pthread_create_dso);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/dlopen/t_main_pthread_create.c b/contrib/netbsd-tests/lib/libpthread/dlopen/t_main_pthread_create.c
new file mode 100644
index 0000000..7ba89b3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/dlopen/t_main_pthread_create.c
@@ -0,0 +1,106 @@
+/* $NetBSD: t_main_pthread_create.c,v 1.1 2013/03/21 16:50:21 christos Exp $ */
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_main_pthread_create.c,v 1.1 2013/03/21 16:50:21 christos Exp $");
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#define DSO TESTDIR "/h_pthread_dlopen.so"
+
+void *
+routine(void *arg)
+{
+ ATF_REQUIRE((intptr_t)arg == 0xcafe);
+ return NULL;
+}
+
+ATF_TC(main_pthread_create_main);
+
+ATF_TC_HEAD(main_pthread_create_main, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test if -lpthread main can call pthread_create() in main()");
+}
+
+ATF_TC_BODY(main_pthread_create_main, tc)
+{
+ int ret;
+ pthread_t thread;
+ void *arg = (void *)0xcafe;
+
+ ret = pthread_create(&thread, NULL, routine, arg);
+ ATF_REQUIRE(ret == 0);
+}
+
+ATF_TC(main_pthread_create_dso);
+
+ATF_TC_HEAD(main_pthread_create_dso, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test if -lpthread main can call pthread_create() in DSO");
+}
+
+ATF_TC_BODY(main_pthread_create_dso, tc)
+{
+ int ret;
+ pthread_t thread;
+ void *arg = (void *)0xcafe;
+ void *handle;
+ int (*testf_dso_pthread_create)(pthread_t *, pthread_attr_t *,
+ void *(*)(void *), void *);
+
+ handle = dlopen(DSO, RTLD_NOW | RTLD_LOCAL);
+ ATF_REQUIRE_MSG(handle != NULL, "dlopen fails: %s", dlerror());
+
+ testf_dso_pthread_create = dlsym(handle, "testf_dso_pthread_create");
+ ATF_REQUIRE_MSG(testf_dso_pthread_create != NULL,
+ "dlsym fails: %s", dlerror());
+
+ ret = testf_dso_pthread_create(&thread, NULL, routine, arg);
+ ATF_REQUIRE(ret == 0);
+
+ ATF_REQUIRE(dlclose(handle) == 0);
+
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, main_pthread_create_main);
+ ATF_TP_ADD_TC(tp, main_pthread_create_dso);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/h_atexit.c b/contrib/netbsd-tests/lib/libpthread/h_atexit.c
new file mode 100644
index 0000000..2d4c91c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/h_atexit.c
@@ -0,0 +1,183 @@
+/* $NetBSD: h_atexit.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Program to test atexit(3) and __cxa_atexit()/__cxa_finalize().
+ *
+ * Written by Jason R. Thorpe, February 2003.
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_atexit.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+
+extern int __cxa_atexit(void (*func)(void *), void *, void *);
+extern void __cxa_finalize(void *);
+
+static int dso_handle_1;
+static int dso_handle_2;
+static int dso_handle_3;
+
+static int arg_1;
+static int arg_2;
+static int arg_3;
+
+static int exiting_state;
+
+#define ASSERT(expr) \
+do { \
+ if ((expr) == 0) { \
+ write(STDERR_FILENO, __func__, strlen(__func__)); \
+ write(STDERR_FILENO, ": ", 2); \
+ write(STDERR_FILENO, __STRING(expr), \
+ strlen(__STRING(expr))); \
+ write(STDERR_FILENO, "\n", 1); \
+ my_abort(); \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SUCCESS() \
+do { \
+ write(STDOUT_FILENO, __func__, strlen(__func__)); \
+ write(STDOUT_FILENO, "\n", 1); \
+} while (/*CONSTCOND*/0)
+
+static void
+my_abort(void)
+{
+
+ kill(getpid(), SIGABRT);
+ /* NOTREACHED */
+}
+
+static void
+cxa_handler_5(void *arg)
+{
+ static int cxa_handler_5_called;
+
+ ASSERT(arg == (void *)&arg_1);
+ ASSERT(cxa_handler_5_called == 0);
+ ASSERT(exiting_state == 5);
+
+ exiting_state--;
+ cxa_handler_5_called = 1;
+ SUCCESS();
+}
+
+static void
+cxa_handler_4(void *arg)
+{
+ static int cxa_handler_4_called;
+
+ ASSERT(arg == (void *)&arg_1);
+ ASSERT(cxa_handler_4_called == 0);
+ ASSERT(exiting_state == 4);
+
+ exiting_state--;
+ cxa_handler_4_called = 1;
+ SUCCESS();
+}
+
+static void
+cxa_handler_3(void *arg)
+{
+ static int cxa_handler_3_called;
+
+ ASSERT(arg == (void *)&arg_2);
+ ASSERT(cxa_handler_3_called == 0);
+ ASSERT(exiting_state == 3);
+
+ exiting_state--;
+ cxa_handler_3_called = 1;
+ SUCCESS();
+}
+
+static void
+cxa_handler_2(void *arg)
+{
+ static int cxa_handler_2_called;
+
+ ASSERT(arg == (void *)&arg_3);
+ ASSERT(cxa_handler_2_called == 0);
+ ASSERT(exiting_state == 2);
+
+ exiting_state--;
+ cxa_handler_2_called = 1;
+ SUCCESS();
+}
+
+static void
+normal_handler_1(void)
+{
+ static int normal_handler_1_called;
+
+ ASSERT(normal_handler_1_called == 0);
+ ASSERT(exiting_state == 1);
+
+ exiting_state--;
+ normal_handler_1_called = 1;
+ SUCCESS();
+}
+
+static void
+normal_handler_0(void)
+{
+ static int normal_handler_0_called;
+
+ ASSERT(normal_handler_0_called == 0);
+ ASSERT(exiting_state == 0);
+
+ normal_handler_0_called = 1;
+ SUCCESS();
+}
+
+int
+main(int argc, char *argv[])
+{
+
+ exiting_state = 5;
+
+ ASSERT(0 == atexit(normal_handler_0));
+ ASSERT(0 == atexit(normal_handler_1));
+ ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, &dso_handle_1));
+ ASSERT(0 == __cxa_atexit(cxa_handler_5, &arg_1, &dso_handle_1));
+ ASSERT(0 == __cxa_atexit(cxa_handler_3, &arg_2, &dso_handle_2));
+ ASSERT(0 == __cxa_atexit(cxa_handler_2, &arg_3, &dso_handle_3));
+
+ __cxa_finalize(&dso_handle_1);
+ __cxa_finalize(&dso_handle_2);
+ exit(0);
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/h_cancel.c b/contrib/netbsd-tests/lib/libpthread/h_cancel.c
new file mode 100644
index 0000000..1077806
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/h_cancel.c
@@ -0,0 +1,58 @@
+/* $NetBSD: h_cancel.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_cancel.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+ char str1[] = "You should see this.\n";
+ char str2[] = "You should not see this.\n";
+
+ printf("Cancellation test: Self-cancellation and disabling.\n");
+
+ pthread_cancel(pthread_self());
+
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+
+ write(STDOUT_FILENO, str1, sizeof(str1)-1);
+
+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+
+ write(STDOUT_FILENO, str2, sizeof(str2)-1);
+
+ exit(1);
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/h_common.h b/contrib/netbsd-tests/lib/libpthread/h_common.h
new file mode 100644
index 0000000..f4d03bc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/h_common.h
@@ -0,0 +1,12 @@
+#ifndef H_COMMON_H
+#define H_COMMON_H
+
+#include <string.h>
+
+#define PTHREAD_REQUIRE(x) \
+ do { \
+ int ret = (x); \
+ ATF_REQUIRE_MSG(ret == 0, "%s: %s", #x, strerror(ret)); \
+ } while (0)
+
+#endif // H_COMMON_H
diff --git a/contrib/netbsd-tests/lib/libpthread/h_exit.c b/contrib/netbsd-tests/lib/libpthread/h_exit.c
new file mode 100644
index 0000000..a37f88f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/h_exit.c
@@ -0,0 +1,47 @@
+/* $NetBSD: h_exit.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_exit.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+int
+main(void)
+{
+ printf("Test of pthread_exit() in main thread only.\n");
+
+ pthread_exit(NULL);
+
+ printf("You shouldn't see this.");
+ exit(1);
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/h_resolv.c b/contrib/netbsd-tests/lib/libpthread/h_resolv.c
new file mode 100644
index 0000000..9c5fedc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/h_resolv.c
@@ -0,0 +1,208 @@
+/* $NetBSD: h_resolv.c,v 1.2 2010/11/03 16:10:22 christos Exp $ */
+
+/*-
+ * Copyright (c) 2004, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_resolv.c,v 1.2 2010/11/03 16:10:22 christos Exp $");
+
+#include <pthread.h>
+#include <stdio.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <err.h>
+#include <string.h>
+#include <stringlist.h>
+
+#define NTHREADS 10
+#define NHOSTS 100
+#define WS " \t\n\r"
+
+static StringList *hosts = NULL;
+static int debug = 0;
+static int *ask = NULL;
+static int *got = NULL;
+
+static void usage(void) __attribute__((__noreturn__));
+static void load(const char *);
+static void resolvone(int);
+static void *resolvloop(void *);
+static void run(int *);
+
+static pthread_mutex_t stats = PTHREAD_MUTEX_INITIALIZER;
+
+static void
+usage(void)
+{
+ (void)fprintf(stderr,
+ "Usage: %s [-d] [-h <nhosts>] [-n <nthreads>] <file> ...\n",
+ getprogname());
+ exit(1);
+}
+
+static void
+load(const char *fname)
+{
+ FILE *fp;
+ size_t len;
+ char *line;
+
+ if ((fp = fopen(fname, "r")) == NULL)
+ err(1, "Cannot open `%s'", fname);
+ while ((line = fgetln(fp, &len)) != NULL) {
+ char c = line[len];
+ char *ptr;
+ line[len] = '\0';
+ for (ptr = strtok(line, WS); ptr; ptr = strtok(NULL, WS))
+ sl_add(hosts, strdup(ptr));
+ line[len] = c;
+ }
+
+ (void)fclose(fp);
+}
+
+static void
+resolvone(int n)
+{
+ char buf[1024];
+ pthread_t self = pthread_self();
+ size_t i = (random() & 0x0fffffff) % hosts->sl_cur;
+ char *host = hosts->sl_str[i];
+ struct addrinfo *res;
+ int error, len;
+ if (debug) {
+ len = snprintf(buf, sizeof(buf), "%p: %d resolving %s %d\n",
+ self, n, host, (int)i);
+ (void)write(STDOUT_FILENO, buf, len);
+ }
+ error = getaddrinfo(host, NULL, NULL, &res);
+ if (debug) {
+ len = snprintf(buf, sizeof(buf), "%p: host %s %s\n",
+ self, host, error ? "not found" : "ok");
+ (void)write(STDOUT_FILENO, buf, len);
+ }
+ pthread_mutex_lock(&stats);
+ ask[i]++;
+ got[i] += error == 0;
+ pthread_mutex_unlock(&stats);
+ if (error == 0)
+ freeaddrinfo(res);
+}
+
+static void *
+resolvloop(void *p)
+{
+ int *nhosts = (int *)p;
+ if (*nhosts == 0)
+ return NULL;
+ do
+ resolvone(*nhosts);
+ while (--(*nhosts));
+ return NULL;
+}
+
+static void
+run(int *nhosts)
+{
+ pthread_t self = pthread_self();
+ if (pthread_create(&self, NULL, resolvloop, nhosts) != 0)
+ err(1, "pthread_create");
+}
+
+int
+main(int argc, char *argv[])
+{
+ int nthreads = NTHREADS;
+ int nhosts = NHOSTS;
+ int i, c, done, *nleft;
+ hosts = sl_init();
+
+ srandom(1234);
+
+ while ((c = getopt(argc, argv, "dh:n:")) != -1)
+ switch (c) {
+ case 'd':
+ debug++;
+ break;
+ case 'h':
+ nhosts = atoi(optarg);
+ break;
+ case 'n':
+ nthreads = atoi(optarg);
+ break;
+ default:
+ usage();
+ }
+
+ for (i = optind; i < argc; i++)
+ load(argv[i]);
+
+ if (hosts->sl_cur == 0)
+ usage();
+
+ if ((nleft = malloc(nthreads * sizeof(int))) == NULL)
+ err(1, "malloc");
+ if ((ask = calloc(hosts->sl_cur, sizeof(int))) == NULL)
+ err(1, "calloc");
+ if ((got = calloc(hosts->sl_cur, sizeof(int))) == NULL)
+ err(1, "calloc");
+
+
+ for (i = 0; i < nthreads; i++) {
+ nleft[i] = nhosts;
+ run(&nleft[i]);
+ }
+
+ for (done = 0; !done;) {
+ done = 1;
+ for (i = 0; i < nthreads; i++) {
+ if (nleft[i] != 0) {
+ done = 0;
+ break;
+ }
+ }
+ sleep(1);
+ }
+ c = 0;
+ for (i = 0; i < (int)hosts->sl_cur; i++) {
+ if (ask[i] != got[i] && got[i] != 0) {
+ warnx("Error: host %s ask %d got %d\n",
+ hosts->sl_str[i], ask[i], got[i]);
+ c++;
+ }
+ }
+ free(nleft);
+ free(ask);
+ free(got);
+ sl_free(hosts, 1);
+ return c;
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_atexit.sh b/contrib/netbsd-tests/lib/libpthread/t_atexit.sh
new file mode 100755
index 0000000..7b99618
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_atexit.sh
@@ -0,0 +1,49 @@
+# $NetBSD: t_atexit.sh,v 1.2 2010/11/07 17:51:20 jmmv Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case atexit
+atexit_head()
+{
+ atf_set "descr" "Checks atexit functionality"
+}
+atexit_body()
+{
+ cat >expout <<EOF
+cxa_handler_5
+cxa_handler_4
+cxa_handler_3
+cxa_handler_2
+normal_handler_1
+normal_handler_0
+EOF
+ atf_check -o file:expout "$(atf_get_srcdir)/h_atexit"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case atexit
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_barrier.c b/contrib/netbsd-tests/lib/libpthread/t_barrier.c
new file mode 100644
index 0000000..a06cfd9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_barrier.c
@@ -0,0 +1,110 @@
+/* $NetBSD: t_barrier.c,v 1.2 2010/11/03 16:10:22 christos Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_barrier.c,v 1.2 2010/11/03 16:10:22 christos Exp $");
+
+#include <pthread.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+#define COUNT 5
+
+pthread_barrier_t barrier;
+pthread_mutex_t mutex;
+int serial_count;
+int after_barrier_count;
+
+static void *
+threadfunc(void *arg)
+{
+ int which = (int)(long)arg;
+ int rv;
+
+ printf("thread %d entering barrier\n", which);
+ rv = pthread_barrier_wait(&barrier);
+ printf("thread %d leaving barrier -> %d\n", which, rv);
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ after_barrier_count++;
+ if (rv == PTHREAD_BARRIER_SERIAL_THREAD)
+ serial_count++;
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+
+ return NULL;
+}
+
+ATF_TC(barrier);
+ATF_TC_HEAD(barrier, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks barriers");
+}
+ATF_TC_BODY(barrier, tc)
+{
+ int i;
+ pthread_t new[COUNT];
+ void *joinval;
+
+ PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
+ PTHREAD_REQUIRE(pthread_barrier_init(&barrier, NULL, COUNT));
+
+ for (i = 0; i < COUNT; i++) {
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ ATF_REQUIRE_EQ(after_barrier_count, 0);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ PTHREAD_REQUIRE(pthread_create(&new[i], NULL, threadfunc,
+ (void *)(long)i));
+ sleep(2);
+ }
+
+ for (i = 0; i < COUNT; i++) {
+ PTHREAD_REQUIRE(pthread_join(new[i], &joinval));
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ ATF_REQUIRE(after_barrier_count > i);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ printf("main joined with thread %d\n", i);
+ }
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ ATF_REQUIRE_EQ(after_barrier_count, COUNT);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ ATF_REQUIRE_EQ(serial_count, 1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, barrier);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_cancel.sh b/contrib/netbsd-tests/lib/libpthread/t_cancel.sh
new file mode 100755
index 0000000..4a0701e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_cancel.sh
@@ -0,0 +1,44 @@
+# $NetBSD: t_cancel.sh,v 1.1 2010/07/16 15:42:53 jmmv Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case register_while_disabled
+register_while_disabled_head()
+{
+ atf_set "descr" "Checks that a cancellation registered while" \
+ "cancellation is enabled is not honored while cancellation is" \
+ "disabled"
+}
+register_while_disabled_body()
+{
+ atf_check -o inline:"You should see this.\n" \
+ "$(atf_get_srcdir)/h_cancel"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case register_while_disabled
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_cond.c b/contrib/netbsd-tests/lib/libpthread/t_cond.c
new file mode 100644
index 0000000..9f33c9e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_cond.c
@@ -0,0 +1,563 @@
+/* $NetBSD: t_cond.c,v 1.6 2014/09/03 16:23:24 gson Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_cond.c,v 1.6 2014/09/03 16:23:24 gson Exp $");
+
+#include <sys/time.h>
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+static pthread_mutex_t mutex;
+static pthread_cond_t cond;
+static pthread_mutex_t static_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t static_cond = PTHREAD_COND_INITIALIZER;
+static int count, share, toggle, total;
+
+static void *
+signal_delay_wait_threadfunc(void *arg)
+{
+ int *shared = (int *) arg;
+
+ printf("2: Second thread.\n");
+
+ printf("2: Locking mutex\n");
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ printf("2: Got mutex.\n");
+ printf("Shared value: %d. Changing to 0.\n", *shared);
+ *shared = 0;
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ PTHREAD_REQUIRE(pthread_cond_signal(&cond));
+
+ return NULL;
+}
+
+ATF_TC(signal_delay_wait);
+ATF_TC_HEAD(signal_delay_wait, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks condition variables");
+}
+ATF_TC_BODY(signal_delay_wait, tc)
+{
+ pthread_t new;
+ void *joinval;
+ int sharedval;
+
+ printf("1: condition variable test 1\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
+ PTHREAD_REQUIRE(pthread_cond_init(&cond, NULL));
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+
+ sharedval = 1;
+
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, signal_delay_wait_threadfunc,
+ &sharedval));
+
+ printf("1: Before waiting.\n");
+ do {
+ sleep(2);
+ PTHREAD_REQUIRE(pthread_cond_wait(&cond, &mutex));
+ printf("1: After waiting, in loop.\n");
+ } while (sharedval != 0);
+
+ printf("1: After the loop.\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+
+ printf("1: After releasing the mutex.\n");
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ printf("1: Thread joined.\n");
+}
+
+static void *
+signal_before_unlock_threadfunc(void *arg)
+{
+ int *shared = (int *) arg;
+
+ printf("2: Second thread.\n");
+
+ printf("2: Locking mutex\n");
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ printf("2: Got mutex.\n");
+ printf("Shared value: %d. Changing to 0.\n", *shared);
+ *shared = 0;
+
+ /* Signal first, then unlock, for a different test than #1. */
+ PTHREAD_REQUIRE(pthread_cond_signal(&cond));
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+
+ return NULL;
+}
+
+ATF_TC(signal_before_unlock);
+ATF_TC_HEAD(signal_before_unlock, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks condition variables: signal before unlocking mutex");
+}
+ATF_TC_BODY(signal_before_unlock, tc)
+{
+ pthread_t new;
+ void *joinval;
+ int sharedval;
+
+ printf("1: condition variable test 2\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
+ PTHREAD_REQUIRE(pthread_cond_init(&cond, NULL));
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+
+ sharedval = 1;
+
+ PTHREAD_REQUIRE(pthread_create(&new, NULL,
+ signal_before_unlock_threadfunc, &sharedval));
+
+ printf("1: Before waiting.\n");
+ do {
+ sleep(2);
+ PTHREAD_REQUIRE(pthread_cond_wait(&cond, &mutex));
+ printf("1: After waiting, in loop.\n");
+ } while (sharedval != 0);
+
+ printf("1: After the loop.\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+
+ printf("1: After releasing the mutex.\n");
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ printf("1: Thread joined.\n");
+}
+
+static void *
+signal_before_unlock_static_init_threadfunc(void *arg)
+{
+ int *shared = (int *) arg;
+
+ printf("2: Second thread.\n");
+
+ printf("2: Locking mutex\n");
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+ printf("2: Got mutex.\n");
+ printf("Shared value: %d. Changing to 0.\n", *shared);
+ *shared = 0;
+
+ /* Signal first, then unlock, for a different test than #1. */
+ PTHREAD_REQUIRE(pthread_cond_signal(&static_cond));
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+
+ return NULL;
+}
+
+ATF_TC(signal_before_unlock_static_init);
+ATF_TC_HEAD(signal_before_unlock_static_init, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks condition variables: signal before unlocking "
+ "mutex, use static initializers");
+}
+ATF_TC_BODY(signal_before_unlock_static_init, tc)
+{
+ pthread_t new;
+ void *joinval;
+ int sharedval;
+
+ printf("1: condition variable test 3\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+
+ sharedval = 1;
+
+ PTHREAD_REQUIRE(pthread_create(&new, NULL,
+ signal_before_unlock_static_init_threadfunc, &sharedval));
+
+ printf("1: Before waiting.\n");
+ do {
+ sleep(2);
+ PTHREAD_REQUIRE(pthread_cond_wait(&static_cond, &static_mutex));
+ printf("1: After waiting, in loop.\n");
+ } while (sharedval != 0);
+
+ printf("1: After the loop.\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+
+ printf("1: After releasing the mutex.\n");
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ printf("1: Thread joined.\n");
+}
+
+static void *
+signal_wait_race_threadfunc(void *arg)
+{
+ printf("2: Second thread.\n");
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+ printf("2: Before the loop.\n");
+ while (count>0) {
+ count--;
+ total++;
+ toggle = 0;
+ /* printf("2: Before signal %d.\n", count); */
+ PTHREAD_REQUIRE(pthread_cond_signal(&static_cond));
+ do {
+ PTHREAD_REQUIRE(pthread_cond_wait(&static_cond,
+ &static_mutex));
+ } while (toggle != 1);
+ }
+ printf("2: After the loop.\n");
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+
+ return NULL;
+}
+
+ATF_TC(signal_wait_race);
+ATF_TC_HEAD(signal_wait_race, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks condition variables");
+}
+ATF_TC_BODY(signal_wait_race, tc)
+{
+ pthread_t new;
+ void *joinval;
+ int sharedval;
+
+ printf("1: condition variable test 4\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+
+ count = 50000;
+ toggle = 0;
+
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, signal_wait_race_threadfunc,
+ &sharedval));
+
+ printf("1: Before waiting.\n");
+ while (count>0) {
+ count--;
+ total++;
+ toggle = 1;
+ /* printf("1: Before signal %d.\n", count); */
+ PTHREAD_REQUIRE(pthread_cond_signal(&static_cond));
+ do {
+ PTHREAD_REQUIRE(pthread_cond_wait(&static_cond,
+ &static_mutex));
+ } while (toggle != 0);
+ }
+ printf("1: After the loop.\n");
+
+ toggle = 1;
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+ PTHREAD_REQUIRE(pthread_cond_signal(&static_cond));
+
+ printf("1: After releasing the mutex.\n");
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ printf("1: Thread joined. Final count = %d, total = %d\n",
+ count, total);
+
+ ATF_REQUIRE_EQ(count, 0);
+ ATF_REQUIRE_EQ(total, 50000);
+}
+
+static void *
+pthread_cond_timedwait_func(void *arg)
+{
+ struct timespec ts;
+ size_t i = 0;
+ int rv;
+
+ for (;;) {
+
+ if (i++ >= 10000)
+ pthread_exit(NULL);
+
+ (void)memset(&ts, 0, sizeof(struct timespec));
+
+ ATF_REQUIRE(clock_gettime(CLOCK_REALTIME, &ts) == 0);
+
+ /*
+ * Set to one second in the past:
+ * pthread_cond_timedwait(3) should
+ * return ETIMEDOUT immediately.
+ */
+ ts.tv_sec = ts.tv_sec - 1;
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+ rv = pthread_cond_timedwait(&static_cond, &static_mutex, &ts);
+
+ /*
+ * Sometimes we catch ESRCH.
+ * This should never happen.
+ */
+ ATF_REQUIRE(rv == ETIMEDOUT);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+ }
+}
+
+ATF_TC(cond_timedwait_race);
+ATF_TC_HEAD(cond_timedwait_race, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test pthread_cond_timedwait(3)");
+
+}
+ATF_TC_BODY(cond_timedwait_race, tc)
+{
+ pthread_t tid[64];
+ size_t i;
+
+ for (i = 0; i < __arraycount(tid); i++) {
+
+ PTHREAD_REQUIRE(pthread_create(&tid[i], NULL,
+ pthread_cond_timedwait_func, NULL));
+ }
+
+ for (i = 0; i < __arraycount(tid); i++) {
+
+ PTHREAD_REQUIRE(pthread_join(tid[i], NULL));
+ }
+}
+
+static void *
+broadcast_threadfunc(void *arg)
+{
+ printf("2: Second thread.\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+ while (count>0) {
+ count--;
+ total++;
+ toggle = 0;
+ PTHREAD_REQUIRE(pthread_cond_signal(&static_cond));
+ do {
+ PTHREAD_REQUIRE(pthread_cond_wait(&static_cond,
+ &static_mutex));
+ } while (toggle != 1);
+ }
+ printf("2: After the loop.\n");
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+
+ return NULL;
+}
+
+
+ATF_TC(broadcast);
+ATF_TC_HEAD(broadcast, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks condition variables: use pthread_cond_broadcast()");
+}
+ATF_TC_BODY(broadcast, tc)
+{
+ pthread_t new;
+ void *joinval;
+ int sharedval;
+
+ printf("1: condition variable test 5\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+
+ count = 50000;
+ toggle = 0;
+
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, broadcast_threadfunc,
+ &sharedval));
+
+ printf("1: Before waiting.\n");
+ while (count>0) {
+ count--;
+ total++;
+ toggle = 1;
+ PTHREAD_REQUIRE(pthread_cond_broadcast(&static_cond));
+ do {
+ PTHREAD_REQUIRE(pthread_cond_wait(&static_cond,
+ &static_mutex));
+ } while (toggle != 0);
+ }
+ printf("1: After the loop.\n");
+
+ toggle = 1;
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+ PTHREAD_REQUIRE(pthread_cond_signal(&static_cond));
+
+ printf("1: After releasing the mutex.\n");
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ printf("1: Thread joined. Final count = %d, total = %d\n", count,
+ total);
+
+ ATF_REQUIRE_EQ(count, 0);
+ ATF_REQUIRE_EQ(total, 50000);
+}
+
+static void *
+bogus_timedwaits_threadfunc(void *arg)
+{
+ return NULL;
+}
+
+ATF_TC(bogus_timedwaits);
+ATF_TC_HEAD(bogus_timedwaits, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks condition variables: bogus timedwaits");
+}
+ATF_TC_BODY(bogus_timedwaits, tc)
+{
+ pthread_t new;
+ struct timespec ts;
+ struct timeval tv;
+
+ printf("condition variable test 6: bogus timedwaits\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+
+ printf("unthreaded test (past)\n");
+ gettimeofday(&tv, NULL);
+ tv.tv_sec -= 2; /* Place the time in the past */
+ TIMEVAL_TO_TIMESPEC(&tv, &ts);
+
+ ATF_REQUIRE_EQ_MSG(pthread_cond_timedwait(&static_cond, &static_mutex,
+ &ts), ETIMEDOUT, "pthread_cond_timedwait() (unthreaded) in the "
+ "past");
+
+ printf("unthreaded test (zero time)\n");
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ TIMEVAL_TO_TIMESPEC(&tv, &ts);
+
+ ATF_REQUIRE_EQ_MSG(pthread_cond_timedwait(&static_cond, &static_mutex,
+ &ts), ETIMEDOUT, "pthread_cond_timedwait() (unthreaded) with zero "
+ "time");
+
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, bogus_timedwaits_threadfunc,
+ NULL));
+ PTHREAD_REQUIRE(pthread_join(new, NULL));
+
+ printf("threaded test\n");
+ gettimeofday(&tv, NULL);
+ tv.tv_sec -= 2; /* Place the time in the past */
+ TIMEVAL_TO_TIMESPEC(&tv, &ts);
+
+ ATF_REQUIRE_EQ_MSG(pthread_cond_timedwait(&static_cond, &static_mutex,
+ &ts), ETIMEDOUT, "pthread_cond_timedwait() (threaded) in the past");
+
+ printf("threaded test (zero time)\n");
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ TIMEVAL_TO_TIMESPEC(&tv, &ts);
+
+ ATF_REQUIRE_EQ_MSG(pthread_cond_timedwait(&static_cond, &static_mutex,
+ &ts), ETIMEDOUT, "pthread_cond_timedwait() (threaded) with zero "
+ "time");
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+}
+
+static void
+unlock(void *arg)
+{
+ pthread_mutex_unlock((pthread_mutex_t *)arg);
+}
+
+static void *
+destroy_after_cancel_threadfunc(void *arg)
+{
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+
+ pthread_cleanup_push(unlock, &mutex);
+
+ while (1) {
+ share = 1;
+ PTHREAD_REQUIRE(pthread_cond_broadcast(&cond));
+ PTHREAD_REQUIRE(pthread_cond_wait(&cond, &mutex));
+ }
+
+ pthread_cleanup_pop(0);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+
+ return NULL;
+}
+
+ATF_TC(destroy_after_cancel);
+ATF_TC_HEAD(destroy_after_cancel, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks destroying a condition variable "
+ "after cancelling a wait");
+}
+ATF_TC_BODY(destroy_after_cancel, tc)
+{
+ pthread_t thread;
+
+ PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
+ PTHREAD_REQUIRE(pthread_cond_init(&cond, NULL));
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ PTHREAD_REQUIRE(pthread_create(&thread, NULL,
+ destroy_after_cancel_threadfunc, NULL));
+
+ while (share == 0) {
+ PTHREAD_REQUIRE(pthread_cond_wait(&cond, &mutex));
+ }
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ PTHREAD_REQUIRE(pthread_cancel(thread));
+
+ PTHREAD_REQUIRE(pthread_join(thread, NULL));
+ PTHREAD_REQUIRE(pthread_cond_destroy(&cond));
+
+ PTHREAD_REQUIRE(pthread_mutex_destroy(&mutex));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, signal_delay_wait);
+ ATF_TP_ADD_TC(tp, signal_before_unlock);
+ ATF_TP_ADD_TC(tp, signal_before_unlock_static_init);
+ ATF_TP_ADD_TC(tp, signal_wait_race);
+ ATF_TP_ADD_TC(tp, cond_timedwait_race);
+ ATF_TP_ADD_TC(tp, broadcast);
+ ATF_TP_ADD_TC(tp, bogus_timedwaits);
+ ATF_TP_ADD_TC(tp, destroy_after_cancel);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_condwait.c b/contrib/netbsd-tests/lib/libpthread/t_condwait.c
new file mode 100644
index 0000000..9b79587
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_condwait.c
@@ -0,0 +1,142 @@
+/* $NetBSD: t_condwait.c,v 1.4 2013/04/12 17:18:11 christos Exp $ */
+
+/*
+ * Copyright (c) 2013 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_condwait.c,v 1.4 2013/04/12 17:18:11 christos Exp $");
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "isqemu.h"
+
+#define WAITTIME 2 /* Timeout wait secound */
+
+static const int debug = 1;
+
+static void *
+run(void *param)
+{
+ struct timespec ts, to, te;
+ clockid_t clck;
+ pthread_condattr_t attr;
+ pthread_cond_t cond;
+ pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
+ int ret = 0;
+
+
+ clck = *(clockid_t *)param;
+ pthread_condattr_init(&attr);
+ pthread_condattr_setclock(&attr, clck); /* MONOTONIC or MONOTONIC */
+ pthread_cond_init(&cond, &attr);
+
+ ATF_REQUIRE_EQ((ret = pthread_mutex_lock(&m)), 0);
+
+ ATF_REQUIRE_EQ(clock_gettime(clck, &ts), 0);
+ to = ts;
+
+ if (debug)
+ printf("started: %lld.%09ld sec\n", (long long)to.tv_sec,
+ to.tv_nsec);
+
+ ts.tv_sec += WAITTIME; /* Timeout wait */
+
+ switch (ret = pthread_cond_timedwait(&cond, &m, &ts)) {
+ case ETIMEDOUT:
+ /* Timeout */
+ ATF_REQUIRE_EQ(clock_gettime(clck, &te), 0);
+ timespecsub(&te, &to, &to);
+ if (debug) {
+ printf("timeout: %lld.%09ld sec\n",
+ (long long)te.tv_sec, te.tv_nsec);
+ printf("elapsed: %lld.%09ld sec\n",
+ (long long)to.tv_sec, to.tv_nsec);
+ }
+ if (isQEMU()) {
+ double to_seconds = to.tv_sec + 1e-9 * to.tv_nsec;
+ ATF_REQUIRE(to_seconds >= WAITTIME * 0.9);
+ /* Loose upper limit because of qemu timing bugs */
+ ATF_REQUIRE(to_seconds < WAITTIME * 2.5);
+ } else {
+ ATF_REQUIRE_EQ(to.tv_sec, WAITTIME);
+ }
+ break;
+ default:
+ ATF_REQUIRE_MSG(0, "pthread_cond_timedwait: %s", strerror(ret));
+ }
+
+ ATF_REQUIRE_MSG(!(ret = pthread_mutex_unlock(&m)),
+ "pthread_mutex_unlock: %s", strerror(ret));
+ pthread_exit(&ret);
+}
+
+static void
+cond_wait(clockid_t clck, const char *msg) {
+ pthread_t child;
+
+ if (debug)
+ printf( "**** %s clock wait starting\n", msg);
+ ATF_REQUIRE_EQ(pthread_create(&child, NULL, run, &clck), 0);
+ ATF_REQUIRE_EQ(pthread_join(child, NULL), 0); /* wait for terminate */
+ if (debug)
+ printf( "**** %s clock wait ended\n", msg);
+}
+
+ATF_TC(cond_wait_real);
+ATF_TC_HEAD(cond_wait_real, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks pthread_cond_timedwait "
+ "with CLOCK_REALTIME");
+}
+
+ATF_TC_BODY(cond_wait_real, tc) {
+ cond_wait(CLOCK_REALTIME, "CLOCK_REALTIME");
+}
+
+ATF_TC(cond_wait_mono);
+ATF_TC_HEAD(cond_wait_mono, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks pthread_cond_timedwait "
+ "with CLOCK_MONOTONIC");
+}
+
+ATF_TC_BODY(cond_wait_mono, tc) {
+ cond_wait(CLOCK_MONOTONIC, "CLOCK_MONOTONIC");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, cond_wait_real);
+ ATF_TP_ADD_TC(tp, cond_wait_mono);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_detach.c b/contrib/netbsd-tests/lib/libpthread/t_detach.c
new file mode 100644
index 0000000..21db871
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_detach.c
@@ -0,0 +1,91 @@
+/* $NetBSD: t_detach.c,v 1.1 2011/03/24 13:52:04 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_detach.c,v 1.1 2011/03/24 13:52:04 jruoho Exp $");
+
+#include <pthread.h>
+#include <errno.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+static void *func(void *);
+
+static void *
+func(void *arg)
+{
+ return NULL;
+}
+
+ATF_TC(pthread_detach);
+ATF_TC_HEAD(pthread_detach, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A test of pthread_detach(3)");
+}
+
+ATF_TC_BODY(pthread_detach, tc)
+{
+ const int state = PTHREAD_CREATE_JOINABLE;
+ pthread_attr_t attr;
+ pthread_t t;
+ int rv;
+
+ /*
+ * Create a joinable thread.
+ */
+ PTHREAD_REQUIRE(pthread_attr_init(&attr));
+ PTHREAD_REQUIRE(pthread_attr_setdetachstate(&attr, state));
+ PTHREAD_REQUIRE(pthread_create(&t, &attr, func, NULL));
+
+ /*
+ * Detach the thread and try to
+ * join it; EINVAL should follow.
+ */
+ PTHREAD_REQUIRE(pthread_detach(t));
+
+ rv = pthread_join(t, NULL);
+ ATF_REQUIRE(rv == EINVAL);
+
+ /*
+ * As usual, ESRCH should follow if
+ * we try to detach an invalid thread.
+ */
+ rv = pthread_cancel(NULL);
+ ATF_REQUIRE(rv == ESRCH);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, pthread_detach);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_equal.c b/contrib/netbsd-tests/lib/libpthread/t_equal.c
new file mode 100644
index 0000000..bcda996
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_equal.c
@@ -0,0 +1,74 @@
+/* $NetBSD: t_equal.c,v 1.1 2011/03/24 12:40:59 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_equal.c,v 1.1 2011/03/24 12:40:59 jruoho Exp $");
+
+#include <pthread.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+static void *func(void *);
+
+static void *
+func(void *arg)
+{
+ return NULL;
+}
+
+ATF_TC(pthread_equal);
+ATF_TC_HEAD(pthread_equal, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A test of pthread_equal(3)");
+}
+
+ATF_TC_BODY(pthread_equal, tc)
+{
+ pthread_t t1, t2;
+
+ ATF_REQUIRE(pthread_create(&t1, NULL, func, NULL) == 0);
+ ATF_REQUIRE(pthread_create(&t2, NULL, func, NULL) == 0);
+
+ ATF_REQUIRE(pthread_equal(t1, t1) != 0);
+ ATF_REQUIRE(pthread_equal(t2, t2) != 0);
+ ATF_REQUIRE(pthread_equal(t1, t2) == 0);
+
+ ATF_REQUIRE(pthread_join(t1, NULL) == 0);
+ ATF_REQUIRE(pthread_join(t2, NULL) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, pthread_equal);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_exit.sh b/contrib/netbsd-tests/lib/libpthread/t_exit.sh
new file mode 100755
index 0000000..7fbd689
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_exit.sh
@@ -0,0 +1,41 @@
+# $NetBSD: t_exit.sh,v 1.1 2010/07/16 15:42:53 jmmv Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case main_thread
+main_thread_head()
+{
+ atf_set "descr" "Checks calling pthread_exit() in the main thread"
+}
+main_thread_body()
+{
+ atf_check -o ignore "$(atf_get_srcdir)/h_exit"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case main_thread
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_fork.c b/contrib/netbsd-tests/lib/libpthread/t_fork.c
new file mode 100644
index 0000000..ab8806d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_fork.c
@@ -0,0 +1,107 @@
+/* $NetBSD: t_fork.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_fork.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+/*
+ * Written by Love Hörnquist Åstrand <lha@NetBSD.org>, March 2003.
+ * Public domain.
+ */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+static pid_t parent;
+static int thread_survived = 0;
+
+static void *
+print_pid(void *arg)
+{
+ sleep(3);
+
+ thread_survived = 1;
+ if (parent != getpid()) {
+ exit(1);
+ }
+ return NULL;
+}
+
+ATF_TC(fork);
+ATF_TC_HEAD(fork, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that child process doesn't get threads");
+}
+ATF_TC_BODY(fork, tc)
+{
+ pthread_t p;
+ pid_t fork_pid;
+
+ parent = getpid();
+
+ PTHREAD_REQUIRE(pthread_create(&p, NULL, print_pid, NULL));
+
+ fork_pid = fork();
+ ATF_REQUIRE(fork_pid != -1);
+
+ if (fork_pid) {
+ int status;
+
+ PTHREAD_REQUIRE(pthread_join(p, NULL));
+ ATF_REQUIRE_MSG(thread_survived, "thread did not survive in parent");
+
+ waitpid(fork_pid, &status, 0);
+ ATF_REQUIRE_MSG(WIFEXITED(status), "child died wrongly");
+ ATF_REQUIRE_EQ_MSG(WEXITSTATUS(status), 0, "thread survived in child");
+ } else {
+ sleep(5);
+ exit(thread_survived ? 1 : 0);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, fork);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_fpu.c b/contrib/netbsd-tests/lib/libpthread/t_fpu.c
new file mode 100644
index 0000000..4047b1f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_fpu.c
@@ -0,0 +1,148 @@
+/* $NetBSD: t_fpu.c,v 1.2 2013/01/27 14:47:37 mbalmer Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_fpu.c,v 1.2 2013/01/27 14:47:37 mbalmer Exp $");
+
+/*
+ * This is adapted from part of csw/cstest of the MPD implementation by
+ * the University of Arizona CS department (http://www.cs.arizona.edu/sr/)
+ * which is in the public domain:
+ *
+ * "The MPD system is in the public domain and you may use and distribute it
+ * as you wish. We ask that you retain credits referencing the University
+ * of Arizona and that you identify any changes you make.
+ *
+ * We can't provide a warranty with MPD; it's up to you to determine its
+ * suitability and reliability for your needs. We would like to hear of
+ * any problems you encounter but we cannot promise a timely correction."
+ *
+ * It was changed to use pthread_create() and sched_yield() instead of
+ * the internal MPD context switching primitives by Ignatios Souvatzis
+ * <is@netbsd.org>.
+ */
+
+#include <math.h>
+#include <pthread.h>
+#include <sched.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+#define N_RECURSE 10
+
+static void recurse(void);
+
+int recursion_depth = 0;
+pthread_mutex_t recursion_depth_lock;
+
+static void *
+stir(void *p)
+{
+ double *q = (double *)p;
+ double x = *q++;
+ double y = *q++;
+ double z = *q++;
+
+ for (;;) {
+ x = sin ((y = cos (x + y + .4)) - (z = cos (x + z + .6)));
+ PTHREAD_REQUIRE(sched_yield());
+ }
+}
+
+static double
+mul3(double x, double y, double z)
+{
+ PTHREAD_REQUIRE(sched_yield());
+
+ return x * y * z;
+}
+
+static void *
+bar(void *p)
+{
+ double d;
+ int rc;
+
+ d = mul3(mul3(2., 3., 5.), mul3(7., 11., 13.), mul3(17., 19., 23.));
+ ATF_REQUIRE_EQ(d, 223092870.);
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&recursion_depth_lock));
+ rc = recursion_depth++;
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&recursion_depth_lock));
+
+ if (rc < N_RECURSE)
+ recurse();
+ else
+ atf_tc_pass();
+
+ /* NOTREACHED */
+ return NULL;
+}
+
+static void
+recurse(void) {
+ pthread_t s2;
+ pthread_create(&s2, 0, bar, 0);
+ sleep(20); /* XXX must be long enough for our slowest machine */
+}
+
+ATF_TC(fpu);
+ATF_TC_HEAD(fpu, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that thread context switches will leave the "
+ "floating point computations unharmed");
+}
+ATF_TC_BODY(fpu, tc)
+{
+ double stirseed[] = { 1.7, 3.2, 2.4 };
+ pthread_t s5;
+
+ printf("Testing threaded floating point computations...\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_init(&recursion_depth_lock, 0));
+
+ pthread_create(&s5, 0, stir, stirseed);
+ recurse();
+
+ atf_tc_fail("exiting from main");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, fpu);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_join.c b/contrib/netbsd-tests/lib/libpthread/t_join.c
new file mode 100644
index 0000000..7f6f834
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_join.c
@@ -0,0 +1,174 @@
+/* $NetBSD: t_join.c,v 1.8 2012/03/12 20:17:16 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_join.c,v 1.8 2012/03/12 20:17:16 joerg Exp $");
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdint.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+#ifdef CHECK_STACK_ALIGNMENT
+extern int check_stack_alignment(void);
+#endif
+
+#define STACKSIZE 65536
+
+static bool error;
+
+static void *threadfunc1(void *);
+static void *threadfunc2(void *);
+
+ATF_TC(pthread_join);
+ATF_TC_HEAD(pthread_join, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "Checks basic error conditions in pthread_join(3)");
+}
+
+ATF_TC_BODY(pthread_join, tc)
+{
+ pthread_t thread;
+
+ PTHREAD_REQUIRE(pthread_create(&thread, NULL, threadfunc1, NULL));
+ PTHREAD_REQUIRE(pthread_join(thread, NULL));
+}
+
+static void *
+threadfunc1(void *arg)
+{
+ pthread_t thread[25];
+ pthread_t caller;
+ void *val = NULL;
+ uintptr_t i;
+ int rv;
+ pthread_attr_t attr;
+
+ caller = pthread_self();
+
+#ifdef CHECK_STACK_ALIGNMENT
+ /*
+ * Check alignment of thread stack, if supported.
+ */
+ ATF_REQUIRE(check_stack_alignment());
+#endif
+
+ /*
+ * The behavior is undefined, but should error
+ * out, if we try to join the calling thread.
+ */
+ rv = pthread_join(caller, NULL);
+
+ /*
+ * The specification recommends EDEADLK.
+ */
+ ATF_REQUIRE(rv != 0);
+ ATF_REQUIRE_EQ(rv, EDEADLK);
+
+ ATF_REQUIRE(pthread_attr_init(&attr) == 0);
+
+ for (i = 0; i < __arraycount(thread); i++) {
+
+ error = true;
+
+ ATF_REQUIRE(pthread_attr_setstacksize(&attr, STACKSIZE * (i + 1)) == 0);
+
+ rv = pthread_create(&thread[i], &attr, threadfunc2, (void *)i);
+
+ ATF_REQUIRE_EQ(rv, 0);
+
+ /*
+ * Check join and exit condition.
+ */
+ PTHREAD_REQUIRE(pthread_join(thread[i], &val));
+
+ ATF_REQUIRE_EQ(error, false);
+
+ ATF_REQUIRE(val != NULL);
+ ATF_REQUIRE(val == (void *)(i + 1));
+
+ /*
+ * Once the thread has returned, ESRCH should
+ * again follow if we try to join it again.
+ */
+ rv = pthread_join(thread[i], NULL);
+
+ ATF_REQUIRE_EQ(rv, ESRCH);
+
+ /*
+ * Try to detach the exited thread.
+ */
+ rv = pthread_detach(thread[i]);
+
+ ATF_REQUIRE(rv != 0);
+ }
+
+ ATF_REQUIRE(pthread_attr_destroy(&attr) == 0);
+
+ pthread_exit(NULL);
+
+ return NULL;
+}
+
+static void *
+threadfunc2(void *arg)
+{
+ static uintptr_t i = 0;
+ uintptr_t j;
+ pthread_attr_t attr;
+ size_t stacksize;
+
+ j = (uintptr_t)arg;
+
+ ATF_REQUIRE(pthread_attr_get_np(pthread_self(), &attr) == 0);
+ ATF_REQUIRE(pthread_attr_getstacksize(&attr, &stacksize) == 0);
+ ATF_REQUIRE(stacksize == STACKSIZE * (j + 1));
+ ATF_REQUIRE(pthread_attr_destroy(&attr) == 0);
+
+ if (i++ == j)
+ error = false;
+
+ pthread_exit((void *)i);
+
+ return NULL;
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, pthread_join);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_kill.c b/contrib/netbsd-tests/lib/libpthread/t_kill.c
new file mode 100644
index 0000000..2fcdd99
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_kill.c
@@ -0,0 +1,147 @@
+/* $NetBSD: t_kill.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 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.
+ */
+
+/*-
+ * Copyright (c)2004 YAMAMOTO Takashi,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_kill.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <pthread.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+#define NTHREAD 2
+
+struct threadinfo {
+ pthread_t id;
+ sig_atomic_t gotsignal;
+} th[NTHREAD];
+
+pthread_t mainthread;
+
+static void
+sighandler(int signo)
+{
+ pthread_t self;
+ int i;
+
+ self = pthread_self();
+ ATF_REQUIRE_MSG((self != mainthread) && (signo == SIGUSR1),
+ "unexpected signal");
+
+ for (i = 0; i < NTHREAD; i++)
+ if (self == th[i].id)
+ break;
+
+ ATF_REQUIRE_MSG(i != NTHREAD, "unknown thread");
+
+ th[i].gotsignal++;
+}
+
+static void *
+f(void *arg)
+{
+ struct threadinfo volatile *t = arg;
+
+ while (t->gotsignal < 1) {
+ /* busy loop */
+ }
+
+ return NULL;
+}
+
+ATF_TC(simple);
+ATF_TC_HEAD(simple, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks pthread_kill()");
+}
+ATF_TC_BODY(simple, tc)
+{
+ int i;
+ pthread_t self;
+
+ mainthread = pthread_self();
+
+ ATF_REQUIRE(signal(SIGUSR1, sighandler) != SIG_ERR);
+
+ for (i = 0; i < NTHREAD; i++) {
+ PTHREAD_REQUIRE(pthread_create(&th[i].id, NULL, f, &th[i]));
+ }
+
+ sched_yield();
+
+ self = pthread_self();
+ ATF_REQUIRE_EQ_MSG(self, mainthread, "thread id changed");
+
+ for (i = 0; i < NTHREAD; i++) {
+ PTHREAD_REQUIRE(pthread_kill(th[i].id, SIGUSR1));
+ }
+
+ for (i = 0; i < NTHREAD; i++) {
+ PTHREAD_REQUIRE(pthread_join(th[i].id, NULL));
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, simple);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_mutex.c b/contrib/netbsd-tests/lib/libpthread/t_mutex.c
new file mode 100644
index 0000000..1b435c2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_mutex.c
@@ -0,0 +1,316 @@
+/* $NetBSD: t_mutex.c,v 1.6 2014/02/09 21:26:07 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_mutex.c,v 1.6 2014/02/09 21:26:07 jmmv Exp $");
+
+#include <pthread.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#include "h_common.h"
+
+static pthread_mutex_t mutex;
+static pthread_mutex_t static_mutex = PTHREAD_MUTEX_INITIALIZER;
+static int global_x;
+
+static void *
+mutex1_threadfunc(void *arg)
+{
+ int *param;
+
+ printf("2: Second thread.\n");
+
+ param = arg;
+ printf("2: Locking mutex\n");
+ pthread_mutex_lock(&mutex);
+ printf("2: Got mutex. *param = %d\n", *param);
+ ATF_REQUIRE_EQ(*param, 20);
+ (*param)++;
+
+ pthread_mutex_unlock(&mutex);
+
+ return param;
+}
+
+ATF_TC(mutex1);
+ATF_TC_HEAD(mutex1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks mutexes");
+}
+ATF_TC_BODY(mutex1, tc)
+{
+ int x;
+ pthread_t new;
+ void *joinval;
+
+ printf("1: Mutex-test 1\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
+ x = 1;
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex1_threadfunc, &x));
+ printf("1: Before changing the value.\n");
+ sleep(2);
+ x = 20;
+ printf("1: Before releasing the mutex.\n");
+ sleep(2);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ printf("1: After releasing the mutex.\n");
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ printf("1: Thread joined. X was %d. Return value (int) was %d\n",
+ x, *(int *)joinval);
+ ATF_REQUIRE_EQ(x, 21);
+ ATF_REQUIRE_EQ(*(int *)joinval, 21);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+}
+
+static void *
+mutex2_threadfunc(void *arg)
+{
+ long count = *(int *)arg;
+
+ printf("2: Second thread (%p). Count is %ld\n", pthread_self(), count);
+
+ while (count--) {
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ global_x++;
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ }
+
+ return (void *)count;
+}
+
+ATF_TC(mutex2);
+ATF_TC_HEAD(mutex2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks mutexes");
+#if defined(__powerpc__)
+ atf_tc_set_md_var(tc, "timeout", "40");
+#endif
+}
+ATF_TC_BODY(mutex2, tc)
+{
+ int count, count2;
+ pthread_t new;
+ void *joinval;
+
+ printf("1: Mutex-test 2\n");
+
+#if defined(__powerpc__)
+ atf_tc_expect_timeout("PR port-powerpc/44387");
+#endif
+
+ PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
+
+ global_x = 0;
+ count = count2 = 10000000;
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex2_threadfunc, &count2));
+
+ printf("1: Thread %p\n", pthread_self());
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+
+ while (count--) {
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ global_x++;
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ }
+
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ printf("1: Thread joined. X was %d. Return value (long) was %ld\n",
+ global_x, (long)joinval);
+ ATF_REQUIRE_EQ(global_x, 20000000);
+
+#if defined(__powerpc__)
+ /* XXX force a timeout in ppc case since an un-triggered race
+ otherwise looks like a "failure" */
+ /* We sleep for longer than the timeout to make ATF not
+ complain about unexpected success */
+ sleep(41);
+#endif
+}
+
+static void *
+mutex3_threadfunc(void *arg)
+{
+ long count = *(int *)arg;
+
+ printf("2: Second thread (%p). Count is %ld\n", pthread_self(), count);
+
+ while (count--) {
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+ global_x++;
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+ }
+
+ return (void *)count;
+}
+
+ATF_TC(mutex3);
+ATF_TC_HEAD(mutex3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks mutexes using a static "
+ "initializer");
+#if defined(__powerpc__)
+ atf_tc_set_md_var(tc, "timeout", "40");
+#endif
+}
+ATF_TC_BODY(mutex3, tc)
+{
+ int count, count2;
+ pthread_t new;
+ void *joinval;
+
+ printf("1: Mutex-test 3\n");
+
+#if defined(__powerpc__)
+ atf_tc_expect_timeout("PR port-powerpc/44387");
+#endif
+
+ global_x = 0;
+ count = count2 = 10000000;
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex3_threadfunc, &count2));
+
+ printf("1: Thread %p\n", pthread_self());
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+
+ while (count--) {
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+ global_x++;
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+ }
+
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+ printf("1: Thread joined. X was %d. Return value (long) was %ld\n",
+ global_x, (long)joinval);
+ ATF_REQUIRE_EQ(global_x, 20000000);
+
+#if defined(__powerpc__)
+ /* XXX force a timeout in ppc case since an un-triggered race
+ otherwise looks like a "failure" */
+ /* We sleep for longer than the timeout to make ATF not
+ complain about unexpected success */
+ sleep(41);
+#endif
+}
+
+static void *
+mutex4_threadfunc(void *arg)
+{
+ int *param;
+
+ printf("2: Second thread.\n");
+
+ param = arg;
+ printf("2: Locking mutex\n");
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ printf("2: Got mutex. *param = %d\n", *param);
+ (*param)++;
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+
+ return param;
+}
+
+ATF_TC(mutex4);
+ATF_TC_HEAD(mutex4, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks mutexes");
+}
+ATF_TC_BODY(mutex4, tc)
+{
+ int x;
+ pthread_t new;
+ pthread_mutexattr_t mattr;
+ void *joinval;
+
+ printf("1: Mutex-test 4\n");
+
+ PTHREAD_REQUIRE(pthread_mutexattr_init(&mattr));
+ PTHREAD_REQUIRE(pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE));
+
+ PTHREAD_REQUIRE(pthread_mutex_init(&mutex, &mattr));
+
+ PTHREAD_REQUIRE(pthread_mutexattr_destroy(&mattr));
+
+ x = 1;
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex4_threadfunc, &x));
+
+ printf("1: Before recursively acquiring the mutex.\n");
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+
+ printf("1: Before releasing the mutex once.\n");
+ sleep(2);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ printf("1: After releasing the mutex once.\n");
+
+ x = 20;
+
+ printf("1: Before releasing the mutex twice.\n");
+ sleep(2);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ printf("1: After releasing the mutex twice.\n");
+
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ printf("1: Thread joined. X was %d. Return value (int) was %d\n",
+ x, *(int *)joinval);
+ ATF_REQUIRE_EQ(x, 21);
+ ATF_REQUIRE_EQ(*(int *)joinval, 21);
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, mutex1);
+ ATF_TP_ADD_TC(tp, mutex2);
+ ATF_TP_ADD_TC(tp, mutex3);
+ ATF_TP_ADD_TC(tp, mutex4);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_name.c b/contrib/netbsd-tests/lib/libpthread/t_name.c
new file mode 100644
index 0000000..d17895e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_name.c
@@ -0,0 +1,103 @@
+/* $NetBSD: t_name.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_name.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+#define NAME_TOO_LONG "12345678901234567890123456789012" /* 32 chars */
+#define NAME_JUST_RIGHT "1234567890123456789012345678901" /* 31 chars */
+
+#define CONST_NAME "xyzzy"
+char non_const_name[] = CONST_NAME;
+
+static void *
+threadfunc(void *arg)
+{
+ pthread_t self = pthread_self();
+ char retname[32];
+
+ PTHREAD_REQUIRE(pthread_getname_np(self, retname, sizeof(retname)));
+ ATF_REQUIRE_STREQ(retname, NAME_JUST_RIGHT);
+
+ PTHREAD_REQUIRE(pthread_setname_np(self, non_const_name, NULL));
+ (void) memset(non_const_name, 0, sizeof(non_const_name));
+ PTHREAD_REQUIRE(pthread_getname_np(self, retname, sizeof(retname)));
+ ATF_REQUIRE_STREQ(retname, CONST_NAME);
+
+ return NULL;
+}
+
+ATF_TC(name);
+ATF_TC_HEAD(name, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks pthread_{,attr}_{get,set}name_np() API");
+}
+ATF_TC_BODY(name, tc)
+{
+ pthread_t thr, self = pthread_self();
+ pthread_attr_t attr;
+ char retname[32];
+
+ PTHREAD_REQUIRE(pthread_attr_init(&attr));
+ PTHREAD_REQUIRE(pthread_attr_getname_np(&attr, retname,
+ sizeof(retname), NULL));
+ ATF_REQUIRE_EQ(retname[0], '\0');
+ ATF_REQUIRE_EQ(pthread_attr_setname_np(&attr, NAME_TOO_LONG, NULL), EINVAL);
+ PTHREAD_REQUIRE(pthread_attr_setname_np(&attr, "%s",
+ __UNCONST(NAME_JUST_RIGHT)));
+
+ (void) strcpy(retname, "foo");
+ PTHREAD_REQUIRE(pthread_getname_np(self, retname, sizeof(retname)));
+ ATF_REQUIRE_EQ(retname[0], '\0');
+
+ PTHREAD_REQUIRE(pthread_create(&thr, &attr, threadfunc, NULL));
+ PTHREAD_REQUIRE(pthread_join(thr, NULL));
+
+ ATF_REQUIRE_EQ(pthread_getname_np(thr, retname, sizeof(retname)), ESRCH);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, name);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_once.c b/contrib/netbsd-tests/lib/libpthread/t_once.c
new file mode 100644
index 0000000..575d5d7
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_once.c
@@ -0,0 +1,196 @@
+/* $NetBSD: t_once.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_once.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+static pthread_once_t once = PTHREAD_ONCE_INIT;
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+static int x;
+
+#define NTHREADS 25
+
+static void
+ofunc(void)
+{
+ printf("Variable x has value %d\n", x);
+ x++;
+}
+
+ATF_TC(once1);
+ATF_TC_HEAD(once1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks pthread_once()");
+}
+ATF_TC_BODY(once1, tc)
+{
+
+ printf("1: Test 1 of pthread_once()\n");
+
+ PTHREAD_REQUIRE(pthread_once(&once, ofunc));
+ PTHREAD_REQUIRE(pthread_once(&once, ofunc));
+
+ printf("1: X has value %d\n",x );
+ ATF_REQUIRE_EQ(x, 1);
+}
+
+static void
+once2_ofunc(void)
+{
+ x++;
+ printf("ofunc: Variable x has value %d\n", x);
+ x++;
+}
+
+static void *
+once2_threadfunc(void *arg)
+{
+ int num;
+
+ PTHREAD_REQUIRE(pthread_once(&once, once2_ofunc));
+
+ num = *(int *)arg;
+ printf("Thread %d sees x with value %d\n", num, x);
+ ATF_REQUIRE_EQ(x, 2);
+
+ return NULL;
+}
+
+ATF_TC(once2);
+ATF_TC_HEAD(once2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks pthread_once()");
+}
+ATF_TC_BODY(once2, tc)
+{
+ pthread_t threads[NTHREADS];
+ int id[NTHREADS];
+ int i;
+
+ printf("1: Test 2 of pthread_once()\n");
+
+ for (i=0; i < NTHREADS; i++) {
+ id[i] = i;
+ PTHREAD_REQUIRE(pthread_create(&threads[i], NULL, once2_threadfunc, &id[i]));
+ }
+
+ for (i=0; i < NTHREADS; i++)
+ PTHREAD_REQUIRE(pthread_join(threads[i], NULL));
+
+ printf("1: X has value %d\n",x );
+ ATF_REQUIRE_EQ(x, 2);
+}
+
+static void
+once3_cleanup(void *m)
+{
+ pthread_mutex_t *mu = m;
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(mu));
+}
+
+static void
+once3_ofunc(void)
+{
+ pthread_testcancel();
+}
+
+static void *
+once3_threadfunc(void *arg)
+{
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ pthread_cleanup_push(once3_cleanup, &mutex);
+ PTHREAD_REQUIRE(pthread_once(&once, once3_ofunc));
+ pthread_cleanup_pop(1);
+
+ return NULL;
+}
+
+static void
+handler(int sig, siginfo_t *info, void *ctx)
+{
+ atf_tc_fail("Signal handler was called; "
+ "main thread deadlocked in pthread_once()");
+}
+
+ATF_TC(once3);
+ATF_TC_HEAD(once3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks pthread_once()");
+}
+ATF_TC_BODY(once3, tc)
+{
+ pthread_t thread;
+ struct sigaction act;
+ struct itimerval it;
+ printf("Test 3 of pthread_once() (test versus cancellation)\n");
+
+ act.sa_sigaction = handler;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_SIGINFO;
+ sigaction(SIGALRM, &act, NULL);
+
+ timerclear(&it.it_value);
+ it.it_value.tv_usec = 500000;
+ timerclear(&it.it_interval);
+ setitimer(ITIMER_REAL, &it, NULL);
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ PTHREAD_REQUIRE(pthread_create(&thread, NULL, once3_threadfunc, NULL));
+ PTHREAD_REQUIRE(pthread_cancel(thread));
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ PTHREAD_REQUIRE(pthread_join(thread, NULL));
+
+ PTHREAD_REQUIRE(pthread_once(&once, ofunc));
+
+ /* Cancel timer */
+ timerclear(&it.it_value);
+ setitimer(ITIMER_REAL, &it, NULL);
+
+ printf("Test succeeded\n");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, once1);
+ ATF_TP_ADD_TC(tp, once2);
+ ATF_TP_ADD_TC(tp, once3);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_preempt.c b/contrib/netbsd-tests/lib/libpthread/t_preempt.c
new file mode 100644
index 0000000..7ec43b6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_preempt.c
@@ -0,0 +1,128 @@
+/* $NetBSD: t_preempt.c,v 1.2 2010/11/03 16:10:22 christos Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_preempt.c,v 1.2 2010/11/03 16:10:22 christos Exp $");
+
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+pthread_mutex_t mutex;
+pthread_cond_t cond;
+int started;
+
+#define HUGE_BUFFER 1<<20
+#define NTHREADS 1
+
+static void *
+threadfunc(void *arg)
+{
+ printf("2: Second thread.\n");
+
+ printf("2: Locking mutex\n");
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+ printf("2: Got mutex.\n");
+ started++;
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ PTHREAD_REQUIRE(pthread_cond_signal(&cond));
+ sleep(1);
+
+ return NULL;
+}
+
+ATF_TC(preempt1);
+ATF_TC_HEAD(preempt1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks kernel preemption during a large uiomove");
+}
+ATF_TC_BODY(preempt1, tc)
+{
+ int i;
+ ssize_t rv;
+ pthread_t new;
+ void *joinval;
+
+ char *mem;
+ int fd;
+
+ mem = malloc(HUGE_BUFFER);
+ ATF_REQUIRE_MSG(mem != NULL, "%s", strerror(errno));
+
+ fd = open("/dev/urandom", O_RDONLY, 0);
+ ATF_REQUIRE_MSG(fd != -1, "%s", strerror(errno));
+
+ printf("1: preempt test\n");
+
+ PTHREAD_REQUIRE(pthread_cond_init(&cond, NULL));
+ PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL));
+
+ PTHREAD_REQUIRE(pthread_mutex_lock(&mutex));
+
+ started = 0;
+
+ for (i = 0; i < NTHREADS; i++) {
+ PTHREAD_REQUIRE(pthread_create(&new, NULL, threadfunc, NULL));
+ }
+
+ while (started < NTHREADS) {
+ PTHREAD_REQUIRE(pthread_cond_wait(&cond, &mutex));
+ }
+
+ printf("1: Thread has started.\n");
+
+ PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
+ printf("1: After releasing the mutex.\n");
+
+ rv = read(fd, mem, HUGE_BUFFER);
+ close(fd);
+ ATF_REQUIRE_EQ(rv, HUGE_BUFFER);
+
+ PTHREAD_REQUIRE(pthread_join(new, &joinval));
+
+ printf("1: Thread joined.\n");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, preempt1);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_resolv.sh b/contrib/netbsd-tests/lib/libpthread/t_resolv.sh
new file mode 100755
index 0000000..847eadc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_resolv.sh
@@ -0,0 +1,42 @@
+# $NetBSD: t_resolv.sh,v 1.1 2010/07/16 15:42:53 jmmv Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case resolv
+resolv_head()
+{
+ atf_set "descr" "Checks parallel name resolution"
+}
+resolv_body()
+{
+ "$(atf_get_srcdir)"/h_resolv -d -n 5 -h 5 \
+ "$(atf_get_srcdir)"/d_mach || atf_fail "test failed"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case resolv
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_rwlock.c b/contrib/netbsd-tests/lib/libpthread/t_rwlock.c
new file mode 100644
index 0000000..b2a3d6f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_rwlock.c
@@ -0,0 +1,125 @@
+/* $NetBSD: t_rwlock.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 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.
+ */
+
+/*-
+ * Copyright (c)2004 YAMAMOTO Takashi,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_rwlock.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+pthread_rwlock_t lk;
+
+struct timespec to;
+
+/* ARGSUSED */
+static void *
+do_nothing(void *dummy)
+{
+ return NULL;
+}
+
+ATF_TC(rwlock1);
+ATF_TC_HEAD(rwlock1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks read/write locks");
+}
+ATF_TC_BODY(rwlock1, tc)
+{
+ int error;
+ pthread_t t;
+
+ PTHREAD_REQUIRE(pthread_create(&t, NULL, do_nothing, NULL));
+ PTHREAD_REQUIRE(pthread_rwlock_init(&lk, NULL));
+ PTHREAD_REQUIRE(pthread_rwlock_rdlock(&lk));
+ PTHREAD_REQUIRE(pthread_rwlock_rdlock(&lk));
+ PTHREAD_REQUIRE(pthread_rwlock_unlock(&lk));
+
+ ATF_REQUIRE_EQ(pthread_rwlock_trywrlock(&lk), EBUSY);
+
+ ATF_REQUIRE_EQ_MSG(clock_gettime(CLOCK_REALTIME, &to), 0,
+ "%s", strerror(errno));
+ to.tv_sec++;
+ error = pthread_rwlock_timedwrlock(&lk, &to);
+ ATF_REQUIRE_MSG(error == ETIMEDOUT || error == EDEADLK,
+ "%s", strerror(error));
+
+ PTHREAD_REQUIRE(pthread_rwlock_unlock(&lk));
+
+ ATF_REQUIRE_EQ_MSG(clock_gettime(CLOCK_REALTIME, &to), 0,
+ "%s", strerror(errno));
+ to.tv_sec++;
+ PTHREAD_REQUIRE(pthread_rwlock_timedwrlock(&lk, &to));
+
+ ATF_REQUIRE_EQ_MSG(clock_gettime(CLOCK_REALTIME, &to), 0,
+ "%s", strerror(errno));
+ to.tv_sec++;
+ error = pthread_rwlock_timedwrlock(&lk, &to);
+ ATF_REQUIRE_MSG(error == ETIMEDOUT || error == EDEADLK,
+ "%s", strerror(error));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, rwlock1);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_sem.c b/contrib/netbsd-tests/lib/libpthread/t_sem.c
new file mode 100644
index 0000000..467d182
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_sem.c
@@ -0,0 +1,307 @@
+/* $NetBSD: t_sem.c,v 1.7 2012/03/09 19:46:37 joerg Exp $ */
+
+/*
+ * Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+ */
+
+/*-
+ * Copyright (c)2004 YAMAMOTO Takashi,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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) 2000 Jason Evans <jasone@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(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(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 COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sem.c,v 1.7 2012/03/09 19:46:37 joerg Exp $");
+
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+#include <atf-c/config.h>
+
+#include "h_common.h"
+
+#define NTHREADS 10
+
+#define _LIBC_R_
+
+#define SEM_REQUIRE(x) \
+ ATF_REQUIRE_EQ_MSG(x, 0, "%s", strerror(errno))
+
+static sem_t sem;
+
+ATF_TC(named);
+ATF_TC_HEAD(named, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks named semaphores");
+}
+ATF_TC_BODY(named, tc)
+{
+ sem_t *semp;
+
+ ATF_REQUIRE_MSG(-1 != sysconf(_SC_SEMAPHORES), "%s", strerror(errno));
+
+ printf("Test begin\n");
+
+ (void) sem_unlink("/foo");
+ semp = sem_open("/foo", O_CREAT | O_EXCL, 0644, 0);
+ ATF_REQUIRE_MSG(semp != SEM_FAILED, "%s", strerror(errno));
+ SEM_REQUIRE(sem_close(semp));
+ SEM_REQUIRE(sem_unlink("/foo"));
+
+ printf("Test end\n");
+}
+
+ATF_TC(unnamed);
+ATF_TC_HEAD(unnamed, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks unnamed semaphores");
+}
+
+static void *
+entry(void * a_arg)
+{
+ pthread_t self = pthread_self();
+ sem_t *semp = (sem_t *) a_arg;
+
+ printf("Thread %p waiting for semaphore...\n", self);
+ sem_wait(semp);
+ printf("Thread %p got semaphore\n", self);
+
+ return NULL;
+}
+
+ATF_TC_BODY(unnamed, tc)
+{
+ sem_t sem_a, sem_b;
+ pthread_t threads[NTHREADS];
+ unsigned i, j;
+ int val;
+
+ ATF_REQUIRE_MSG(-1 != sysconf(_SC_SEMAPHORES), "%s", strerror(errno));
+
+ printf("Test begin\n");
+
+ SEM_REQUIRE(sem_init(&sem_b, 0, 0));
+ SEM_REQUIRE(sem_getvalue(&sem_b, &val));
+ ATF_REQUIRE_EQ(0, val);
+
+ SEM_REQUIRE(sem_post(&sem_b));
+ SEM_REQUIRE(sem_getvalue(&sem_b, &val));
+ ATF_REQUIRE_EQ(1, val);
+
+ SEM_REQUIRE(sem_wait(&sem_b));
+ ATF_REQUIRE_EQ(sem_trywait(&sem_b), -1);
+ ATF_REQUIRE_EQ(errno, EAGAIN);
+ SEM_REQUIRE(sem_post(&sem_b));
+ SEM_REQUIRE(sem_trywait(&sem_b));
+ SEM_REQUIRE(sem_post(&sem_b));
+ SEM_REQUIRE(sem_wait(&sem_b));
+ SEM_REQUIRE(sem_post(&sem_b));
+
+ SEM_REQUIRE(sem_destroy(&sem_b));
+
+ SEM_REQUIRE(sem_init(&sem_a, 0, 0));
+
+ for (j = 0; j < 2; j++) {
+ for (i = 0; i < NTHREADS; i++) {
+ PTHREAD_REQUIRE(pthread_create(&threads[i], NULL,
+ entry, (void *) &sem_a));
+ }
+
+ for (i = 0; i < NTHREADS; i++) {
+ usleep(10000);
+ printf("main loop %u: posting...\n", j+1);
+ SEM_REQUIRE(sem_post(&sem_a));
+ }
+
+ for (i = 0; i < NTHREADS; i++) {
+ PTHREAD_REQUIRE(pthread_join(threads[i], NULL));
+ }
+ }
+
+ SEM_REQUIRE(sem_destroy(&sem_a));
+
+ printf("Test end\n");
+}
+
+static void
+sighandler(int signo)
+{
+ /* printf("signal %d\n", signo); */
+
+ ATF_REQUIRE_EQ_MSG(signo, SIGALRM, "unexpected signal");
+ SEM_REQUIRE(sem_post(&sem));
+}
+
+static void
+alarm_ms(const int ms)
+{
+ struct itimerval timer;
+ timer.it_interval.tv_sec = 0;
+ timer.it_interval.tv_usec = 0;
+ timer.it_value.tv_sec = 0;
+ timer.it_value.tv_usec = ms * 1000;
+ ATF_REQUIRE(setitimer(ITIMER_REAL, &timer, NULL) == 0);
+}
+
+static void *
+threadfunc(void *arg)
+{
+ int i, ret;
+
+ printf("Entering loop\n");
+ for (i = 0; i < 500; ) {
+ if ((i & 1) != 0) {
+ do {
+ ret = sem_wait(&sem);
+ } while (ret == -1 && errno == EINTR);
+ ATF_REQUIRE(ret == 0);
+ } else {
+ ret = sem_trywait(&sem);
+ if (ret == -1) {
+ ATF_REQUIRE(errno == EAGAIN);
+ continue;
+ }
+ }
+ printf("%s: %d\n", __func__, i);
+ alarm_ms(5);
+ i++;
+ }
+
+ return NULL;
+}
+
+static void
+before_start_test(const bool use_pthread)
+{
+ pthread_t t;
+
+ SEM_REQUIRE(sem_init(&sem, 0, 0));
+ ATF_REQUIRE(SIG_ERR != signal(SIGALRM, sighandler));
+
+ alarm_ms(5);
+
+ if (use_pthread) {
+ PTHREAD_REQUIRE(pthread_create(&t, NULL, threadfunc, NULL));
+ PTHREAD_REQUIRE(pthread_join(t, NULL));
+ } else {
+ threadfunc(NULL);
+ }
+}
+
+ATF_TC(before_start_no_threads);
+ATF_TC_HEAD(before_start_no_threads, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks using semaphores without any "
+ "thread running");
+ atf_tc_set_md_var(tc, "timeout", "40");
+}
+ATF_TC_BODY(before_start_no_threads, tc)
+{
+ before_start_test(false);
+}
+
+ATF_TC(before_start_one_thread);
+ATF_TC_HEAD(before_start_one_thread, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks using semaphores before "
+ "starting one thread");
+ atf_tc_set_md_var(tc, "timeout", "40");
+}
+ATF_TC_BODY(before_start_one_thread, tc)
+{
+ before_start_test(true);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, named);
+ ATF_TP_ADD_TC(tp, unnamed);
+ ATF_TP_ADD_TC(tp, before_start_no_threads);
+ ATF_TP_ADD_TC(tp, before_start_one_thread);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_sigalarm.c b/contrib/netbsd-tests/lib/libpthread/t_sigalarm.c
new file mode 100644
index 0000000..0a58c4e
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_sigalarm.c
@@ -0,0 +1,107 @@
+/* $NetBSD: t_sigalarm.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sigalarm.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <stdio.h>
+#include <signal.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+int alarm_set;
+
+#ifdef SA_SIGINFO
+static void
+alarm_handler(int signo, siginfo_t *si, void *ctx)
+{
+ ATF_REQUIRE_EQ_MSG(si->si_signo, signo, "Received unexpected signal");
+ alarm_set = 1;
+}
+#else
+static void
+alarm_handler(int signo)
+{
+ ATF_REQUIRE_EQ_MSG(SIGALRM, signo, "Received unexpected signal");
+ alarm_set = 1;
+}
+#endif
+
+static void *
+setup(void *dummy)
+{
+ struct sigaction sa;
+ sigset_t ss;
+#ifdef SA_SIGINFO
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = alarm_handler;
+#else
+ sa.sa_flags = 0;
+ sa.sa_handler = alarm_handler;
+#endif
+ sigfillset(&ss);
+ sigprocmask(SIG_SETMASK, &ss, NULL);
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGALRM, &sa, NULL);
+ alarm(1);
+
+ return NULL;
+}
+
+ATF_TC(sigalarm);
+ATF_TC_HEAD(sigalarm, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks sigsuspend in libpthread when pthread lib is initialized");
+}
+ATF_TC_BODY(sigalarm, tc)
+{
+ sigset_t set;
+ pthread_t self = pthread_self();
+
+ PTHREAD_REQUIRE(pthread_create(&self, NULL, setup, NULL));
+
+ sigemptyset(&set);
+ sigsuspend(&set);
+ alarm(0);
+
+ ATF_REQUIRE(alarm_set);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, sigalarm);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_siglongjmp.c b/contrib/netbsd-tests/lib/libpthread/t_siglongjmp.c
new file mode 100644
index 0000000..298879c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_siglongjmp.c
@@ -0,0 +1,109 @@
+/* $NetBSD: t_siglongjmp.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_siglongjmp.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+/*
+ * Regression test for siglongjmp out of a signal handler back into
+ * its thread.
+ *
+ * Written by Christian Limpach <cl@NetBSD.org>, December 2003.
+ * Public domain.
+ */
+
+#include <sys/resource.h>
+
+#include <pthread.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+static sigjmp_buf env;
+
+static void *
+thread(void *arg)
+{
+ return NULL;
+}
+
+static void
+handler(int sig, siginfo_t *info, void *ctx)
+{
+ siglongjmp(env, 1);
+}
+
+ATF_TC(siglongjmp1);
+ATF_TC_HEAD(siglongjmp1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks siglongjmp() out of a signal handler back into its thread");
+}
+ATF_TC_BODY(siglongjmp1, tc)
+{
+ pthread_t t;
+ sigset_t nset;
+ struct rlimit rlim;
+ struct sigaction act;
+
+ rlim.rlim_cur = rlim.rlim_max = 0;
+ (void)setrlimit(RLIMIT_CORE, &rlim);
+
+ PTHREAD_REQUIRE(pthread_create(&t, NULL, thread, NULL));
+
+ sigemptyset(&nset);
+ sigaddset(&nset, SIGUSR1);
+ PTHREAD_REQUIRE(pthread_sigmask(SIG_SETMASK, &nset, NULL));
+
+ act.sa_sigaction = handler;
+ sigemptyset(&act.sa_mask);
+ sigaddset(&act.sa_mask, SIGUSR2);
+ act.sa_flags = 0;
+ sigaction(SIGSEGV, &act, NULL);
+
+ ATF_REQUIRE_EQ(sigsetjmp(env, 1), 0);
+
+ PTHREAD_REQUIRE(pthread_sigmask(0, NULL, &nset));
+
+ ATF_REQUIRE_EQ_MSG(sigismember(&nset, SIGSEGV), 0, "SIGSEGV set");
+ ATF_REQUIRE_EQ_MSG(sigismember(&nset, SIGUSR2), 0, "SIGUSR2 set");
+ ATF_REQUIRE_MSG(sigismember(&nset, SIGUSR1), "SIGUSR1 not set");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, siglongjmp1);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_sigmask.c b/contrib/netbsd-tests/lib/libpthread/t_sigmask.c
new file mode 100644
index 0000000..69e0577
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_sigmask.c
@@ -0,0 +1,261 @@
+/* $NetBSD: t_sigmask.c,v 1.3 2013/10/19 17:45:01 christos Exp $ */
+
+/*
+ * Copyright (c) 2008, 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sigmask.c,v 1.3 2013/10/19 17:45:01 christos Exp $");
+
+/*
+ * Regression test for pthread_sigmask when SA upcalls aren't started yet.
+ *
+ * Written by Christian Limpach <cl@NetBSD.org>, December 2003.
+ * Public domain.
+ */
+
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <sys/resource.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+static volatile sig_atomic_t flag;
+static volatile sig_atomic_t flag2;
+
+static volatile pthread_t thr_usr1;
+static volatile pthread_t thr_usr2;
+
+static sig_atomic_t count = 0;
+
+ATF_TC(upcalls_not_started);
+ATF_TC_HEAD(upcalls_not_started, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks pthread_sigmask when SA upcalls "
+ "aren't started yet");
+}
+ATF_TC_BODY(upcalls_not_started, tc)
+{
+ sigset_t nset;
+ struct rlimit rlim;
+
+ rlim.rlim_cur = rlim.rlim_max = 0;
+ (void) setrlimit(RLIMIT_CORE, &rlim);
+
+ sigemptyset(&nset);
+ sigaddset(&nset, SIGFPE);
+ pthread_sigmask(SIG_BLOCK, &nset, NULL);
+
+ kill(getpid(), SIGFPE);
+}
+
+static void
+upcalls_not_started_handler1(int sig, siginfo_t *info, void *ctx)
+{
+
+ kill(getpid(), SIGUSR2);
+ /*
+ * If the mask is properly set, SIGUSR2 will not be handled
+ * until this handler returns.
+ */
+ flag = 1;
+}
+
+static void
+upcalls_not_started_handler2(int sig, siginfo_t *info, void *ctx)
+{
+ if (flag == 1)
+ flag = 2;
+}
+
+ATF_TC(before_threads);
+ATF_TC_HEAD(before_threads, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that signal masks are respected "
+ "before threads are started");
+}
+ATF_TC_BODY(before_threads, tc)
+{
+ struct sigaction act;
+
+ act.sa_sigaction = upcalls_not_started_handler1;
+ sigemptyset(&act.sa_mask);
+ sigaddset(&act.sa_mask, SIGUSR2);
+ act.sa_flags = SA_SIGINFO;
+
+ ATF_REQUIRE_EQ(sigaction(SIGUSR1, &act, NULL), 0);
+
+ act.sa_sigaction = upcalls_not_started_handler2;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_SIGINFO;
+ (void)sigaction(SIGUSR2, &act, NULL);
+
+ kill(getpid(), SIGUSR1);
+
+ ATF_REQUIRE_EQ(flag, 2);
+ printf("Success: Both handlers ran in order\n");
+}
+
+static void
+respected_while_running_handler1(int sig, siginfo_t *info, void *ctx)
+{
+
+ kill(getpid(), SIGUSR2);
+ /*
+ * If the mask is properly set, SIGUSR2 will not be handled
+ * by the current thread until this handler returns.
+ */
+ flag = 1;
+ thr_usr1 = pthread_self();
+}
+
+static void
+respected_while_running_handler2(int sig, siginfo_t *info, void *ctx)
+{
+ if (flag == 1)
+ flag = 2;
+ flag2 = 1;
+ thr_usr2 = pthread_self();
+}
+
+static void *
+respected_while_running_threadroutine(void *arg)
+{
+
+ kill(getpid(), SIGUSR1);
+ sleep(1);
+
+ if (flag == 2)
+ printf("Success: Both handlers ran in order\n");
+ else if (flag == 1 && flag2 == 1 && thr_usr1 != thr_usr2)
+ printf("Success: Handlers were invoked by different threads\n");
+ else {
+ printf("Failure: flag=%d, flag2=%d, thr1=%p, thr2=%p\n",
+ (int)flag, (int)flag2, (void *)thr_usr1, (void *)thr_usr2);
+ atf_tc_fail("failure");
+ }
+
+ return NULL;
+}
+
+ATF_TC(respected_while_running);
+ATF_TC_HEAD(respected_while_running, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that signal masks are respected "
+ "while threads are running");
+}
+ATF_TC_BODY(respected_while_running, tc)
+{
+ struct sigaction act;
+ pthread_t thread;
+
+ act.sa_sigaction = respected_while_running_handler1;
+ sigemptyset(&act.sa_mask);
+ sigaddset(&act.sa_mask, SIGUSR2);
+ act.sa_flags = SA_SIGINFO;
+
+ ATF_REQUIRE_EQ(sigaction(SIGUSR1, &act, NULL), 0);
+
+ act.sa_sigaction = respected_while_running_handler2;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_SIGINFO;
+ (void)sigaction(SIGUSR2, &act, NULL);
+
+ PTHREAD_REQUIRE(pthread_create(&thread, NULL,
+ respected_while_running_threadroutine, NULL));
+ PTHREAD_REQUIRE(pthread_join(thread, NULL));
+}
+
+static void
+incorrect_mask_bug_handler(int sig)
+{
+ count++;
+}
+
+static void *
+incorrect_mask_bug_sleeper(void* arg)
+{
+ int i;
+ for (i = 0; i < 10; i++)
+ sleep(1);
+
+ atf_tc_fail("sleeper");
+}
+
+ATF_TC(incorrect_mask_bug);
+ATF_TC_HEAD(incorrect_mask_bug, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks for bug in libpthread where "
+ "incorrect signal mask was used");
+}
+ATF_TC_BODY(incorrect_mask_bug, tc)
+{
+ pthread_t id;
+ struct sigaction act;
+
+ act.sa_sigaction = NULL;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ act.sa_handler = incorrect_mask_bug_handler;
+
+ ATF_REQUIRE_EQ_MSG(sigaction(SIGALRM, &act, NULL), 0, "%s",
+ strerror(errno));
+
+ sigaddset(&act.sa_mask, SIGALRM);
+ PTHREAD_REQUIRE(pthread_sigmask(SIG_SETMASK, &act.sa_mask, NULL));
+
+ PTHREAD_REQUIRE(pthread_create(&id, NULL, incorrect_mask_bug_sleeper,
+ NULL));
+ sleep(1);
+
+ sigemptyset(&act.sa_mask);
+ PTHREAD_REQUIRE(pthread_sigmask(SIG_SETMASK, &act.sa_mask, NULL));
+
+ for (;;) {
+ alarm(1);
+ if (select(1, NULL, NULL, NULL, NULL) == -1 && errno == EINTR)
+ if (count == 2)
+ return;
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, upcalls_not_started);
+ ATF_TP_ADD_TC(tp, before_threads);
+ ATF_TP_ADD_TC(tp, respected_while_running);
+ ATF_TP_ADD_TC(tp, incorrect_mask_bug);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_sigsuspend.c b/contrib/netbsd-tests/lib/libpthread/t_sigsuspend.c
new file mode 100644
index 0000000..1179657
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_sigsuspend.c
@@ -0,0 +1,90 @@
+/* $NetBSD: t_sigsuspend.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sigsuspend.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+/*
+ * Regression test for sigsuspend in libpthread when pthread lib isn't
+ * initialized.
+ *
+ * Written by Love FIXME strand <lha@NetBSD.org>, March 2003.
+ * Public domain.
+ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+int alarm_set;
+
+static void
+alarm_handler(int signo)
+{
+ alarm_set = 1;
+}
+
+ATF_TC(sigsuspend);
+ATF_TC_HEAD(sigsuspend, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks sigsuspend in libpthread when pthread lib isn't initialized");
+}
+ATF_TC_BODY(sigsuspend, tc)
+{
+ struct sigaction sa;
+ sigset_t set;
+
+ sa.sa_flags = 0;
+ sa.sa_handler = alarm_handler;
+ sigemptyset(&sa.sa_mask);
+
+ sigaction(SIGALRM, &sa, NULL);
+
+ alarm(1);
+
+ sigemptyset(&set);
+ sigaddset(&set, SIGUSR1);
+
+ sigsuspend(&set);
+
+ alarm(0);
+
+ ATF_REQUIRE(alarm_set);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, sigsuspend);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_sleep.c b/contrib/netbsd-tests/lib/libpthread/t_sleep.c
new file mode 100644
index 0000000..93a30e3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_sleep.c
@@ -0,0 +1,104 @@
+/* $NetBSD: t_sleep.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sleep.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+
+#include <sys/time.h>
+
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+#define LONGTIME 2000000000
+
+static void *
+threadfunc(void *arg)
+{
+ sleep(LONGTIME);
+
+ return NULL;
+}
+
+static void
+handler(int sig)
+{
+ /*
+ * Nothing to do; invoking the handler is enough to interrupt
+ * the sleep.
+ */
+}
+
+ATF_TC(sleep1);
+ATF_TC_HEAD(sleep1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks sleeping past the time when "
+ "time_t wraps");
+}
+ATF_TC_BODY(sleep1, tc)
+{
+ pthread_t thread;
+ struct itimerval it;
+ struct sigaction act;
+ sigset_t mtsm;
+
+ printf("Testing sleeps unreasonably far into the future.\n");
+
+ act.sa_handler = handler;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ sigaction(SIGALRM, &act, NULL);
+
+ PTHREAD_REQUIRE(pthread_create(&thread, NULL, threadfunc, NULL));
+
+ /* make sure the signal is delivered to the child thread */
+ sigemptyset(&mtsm);
+ sigaddset(&mtsm, SIGALRM);
+ PTHREAD_REQUIRE(pthread_sigmask(SIG_BLOCK, &mtsm, 0));
+
+ timerclear(&it.it_interval);
+ timerclear(&it.it_value);
+ it.it_value.tv_sec = 1;
+ setitimer(ITIMER_REAL, &it, NULL);
+
+ PTHREAD_REQUIRE(pthread_join(thread, NULL));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, sleep1);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c b/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c
new file mode 100644
index 0000000..8fd2314
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c
@@ -0,0 +1,112 @@
+/* $NetBSD: t_swapcontext.c,v 1.2 2014/08/25 16:31:15 bouyer Exp $ */
+
+/*
+ * Copyright (c) 2012 Emmanuel Dreyfus. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD");
+
+#include <pthread.h>
+#include <ucontext.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <atf-c.h>
+
+#include "h_common.h"
+
+#define STACKSIZE 65536
+
+char stack[STACKSIZE];
+ucontext_t nctx;
+ucontext_t octx;
+void *oself;
+void *nself;
+int val1, val2;
+
+/* ARGSUSED0 */
+static void
+swapfunc(void *arg)
+{
+ /*
+ * If the test fails, we are very likely to crash
+ * without the opportunity to report
+ */
+ nself = (void *)pthread_self();
+ printf("after swapcontext self = %p\n", nself);
+
+ ATF_REQUIRE_EQ(oself, nself);
+ printf("Test succeeded\n");
+ /* Go back in main */
+ ATF_REQUIRE(swapcontext(&nctx, &octx));
+
+ /* NOTREACHED */
+ return;
+}
+
+/* ARGSUSED0 */
+static void *
+threadfunc(void *arg)
+{
+ nctx.uc_stack.ss_sp = stack;
+ nctx.uc_stack.ss_size = sizeof(stack);
+
+ makecontext(&nctx, (void *)*swapfunc, 0);
+
+ oself = (void *)pthread_self();
+ printf("before swapcontext self = %p\n", oself);
+ PTHREAD_REQUIRE(swapcontext(&octx, &nctx));
+
+ /* NOTREACHED */
+ return NULL;
+}
+
+
+ATF_TC(swapcontext1);
+ATF_TC_HEAD(swapcontext1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Testing if swapcontext() "
+ "alters pthread_self()");
+}
+ATF_TC_BODY(swapcontext1, tc)
+{
+ pthread_t thread;
+
+ oself = (void *)&val1;
+ nself = (void *)&val2;
+
+ printf("Testing if swapcontext() alters pthread_self()\n");
+
+ PTHREAD_REQUIRE(getcontext(&nctx));
+ PTHREAD_REQUIRE(pthread_create(&thread, NULL, threadfunc, NULL));
+ PTHREAD_REQUIRE(pthread_join(thread, NULL));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, swapcontext1);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/librt/t_sched.c b/contrib/netbsd-tests/lib/librt/t_sched.c
new file mode 100644
index 0000000..8796043
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librt/t_sched.c
@@ -0,0 +1,256 @@
+/* $NetBSD: t_sched.c,v 1.5 2012/03/25 04:11:42 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_sched.c,v 1.5 2012/03/25 04:11:42 christos Exp $");
+
+#include <sched.h>
+#include <limits.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+static void sched_priority_set(int, int);
+
+ATF_TC(sched_getparam);
+ATF_TC_HEAD(sched_getparam, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of sched_getparam(3)");
+}
+
+ATF_TC_BODY(sched_getparam, tc)
+{
+ struct sched_param s1, s2;
+ pid_t p = getpid();
+
+ /*
+ * IEEE Std 1003.1-2008: if the supplied pid is zero,
+ * the parameters for the calling process are returned.
+ */
+ ATF_REQUIRE(sched_getparam(0, &s1) == 0);
+ ATF_REQUIRE(sched_getparam(p, &s2) == 0);
+
+ ATF_CHECK_EQ(s1.sched_priority, s2.sched_priority);
+
+ /*
+ * The behavior is undefined but should error
+ * out in case the supplied PID is negative.
+ */
+ ATF_REQUIRE(sched_getparam(-1, &s1) != 0);
+}
+
+ATF_TC(sched_priority);
+ATF_TC_HEAD(sched_priority, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sched(3) priority ranges");
+}
+
+ATF_TC_BODY(sched_priority, tc)
+{
+ static const int pol[3] = { SCHED_OTHER, SCHED_FIFO, SCHED_RR };
+ int pmax, pmin;
+ size_t i;
+
+ /*
+ * Test that bogus values error out.
+ */
+ if (INT_MAX > SCHED_RR)
+ ATF_REQUIRE(sched_get_priority_max(INT_MAX) != 0);
+
+ if (-INT_MAX < SCHED_OTHER)
+ ATF_REQUIRE(sched_get_priority_max(-INT_MAX) != 0);
+
+ /*
+ * Test that we have a valid range.
+ */
+ for (i = 0; i < __arraycount(pol); i++) {
+
+ pmax = sched_get_priority_max(pol[i]);
+ pmin = sched_get_priority_min(pol[i]);
+
+ ATF_REQUIRE(pmax != -1);
+ ATF_REQUIRE(pmin != -1);
+ ATF_REQUIRE(pmax > pmin);
+ }
+}
+
+static void
+sched_priority_set(int pri, int pol)
+{
+ struct sched_param sched;
+
+ sched.sched_priority = pri;
+
+ ATF_REQUIRE(pri >= 0);
+ ATF_REQUIRE(sched_setscheduler(0, pol, &sched) == 0);
+
+ /*
+ * Test that the policy was changed.
+ */
+ ATF_CHECK_EQ(sched_getscheduler(0), pol);
+
+ /*
+ * And that sched_getparam(3) returns the new priority.
+ */
+ sched.sched_priority = -1;
+
+ ATF_REQUIRE(sched_getparam(0, &sched) == 0);
+ ATF_CHECK_EQ(sched.sched_priority, pri);
+}
+
+ATF_TC(sched_setscheduler_1);
+ATF_TC_HEAD(sched_setscheduler_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "sched_setscheduler(3), max, RR");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(sched_setscheduler_1, tc)
+{
+ int pri;
+
+ pri = sched_get_priority_max(SCHED_RR);
+ sched_priority_set(pri, SCHED_RR);
+}
+
+ATF_TC(sched_setscheduler_2);
+ATF_TC_HEAD(sched_setscheduler_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "sched_setscheduler(3), min, RR");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(sched_setscheduler_2, tc)
+{
+ int pri;
+
+ pri = sched_get_priority_min(SCHED_RR);
+ sched_priority_set(pri, SCHED_RR);
+}
+
+ATF_TC(sched_setscheduler_3);
+ATF_TC_HEAD(sched_setscheduler_3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "sched_setscheduler(3), max, FIFO");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(sched_setscheduler_3, tc)
+{
+ int pri;
+
+ pri = sched_get_priority_max(SCHED_FIFO);
+ sched_priority_set(pri, SCHED_FIFO);
+}
+
+ATF_TC(sched_setscheduler_4);
+ATF_TC_HEAD(sched_setscheduler_4, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "sched_setscheduler(3), min, FIFO");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(sched_setscheduler_4, tc)
+{
+ int pri;
+
+ pri = sched_get_priority_min(SCHED_FIFO);
+ sched_priority_set(pri, SCHED_FIFO);
+}
+
+ATF_TC(sched_rr_get_interval_1);
+ATF_TC_HEAD(sched_rr_get_interval_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sched_rr_get_interval(3), #1"
+ " (PR lib/44768)");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(sched_rr_get_interval_1, tc)
+{
+ struct timespec tv;
+ int pri;
+
+ pri = sched_get_priority_min(SCHED_RR);
+ sched_priority_set(pri, SCHED_RR);
+
+ /*
+ * This should fail with ESRCH for invalid PID.
+ */
+ ATF_REQUIRE(sched_rr_get_interval(-INT_MAX, &tv) != 0);
+}
+
+ATF_TC(sched_rr_get_interval_2);
+ATF_TC_HEAD(sched_rr_get_interval_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test sched_rr_get_interval(3), #2");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(sched_rr_get_interval_2, tc)
+{
+ struct timespec tv1, tv2;
+ int pri;
+
+ pri = sched_get_priority_min(SCHED_RR);
+ sched_priority_set(pri, SCHED_RR);
+
+ tv1.tv_sec = tv2.tv_sec = -1;
+ tv1.tv_nsec = tv2.tv_nsec = -1;
+
+ ATF_REQUIRE(sched_rr_get_interval(0, &tv1) == 0);
+ ATF_REQUIRE(sched_rr_get_interval(getpid(), &tv2) == 0);
+
+ ATF_REQUIRE(tv1.tv_sec != -1);
+ ATF_REQUIRE(tv2.tv_sec != -1);
+
+ ATF_REQUIRE(tv1.tv_nsec != -1);
+ ATF_REQUIRE(tv2.tv_nsec != -1);
+
+ ATF_REQUIRE(tv1.tv_sec == tv2.tv_sec);
+ ATF_REQUIRE(tv1.tv_nsec == tv2.tv_nsec);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sched_getparam);
+ ATF_TP_ADD_TC(tp, sched_priority);
+
+ ATF_TP_ADD_TC(tp, sched_setscheduler_1);
+ ATF_TP_ADD_TC(tp, sched_setscheduler_2);
+ ATF_TP_ADD_TC(tp, sched_setscheduler_3);
+ ATF_TP_ADD_TC(tp, sched_setscheduler_4);
+
+ ATF_TP_ADD_TC(tp, sched_rr_get_interval_1);
+ ATF_TP_ADD_TC(tp, sched_rr_get_interval_2);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/librt/t_sem.c b/contrib/netbsd-tests/lib/librt/t_sem.c
new file mode 100644
index 0000000..b6fc4db
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librt/t_sem.c
@@ -0,0 +1,175 @@
+/* $NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $ */
+
+/*
+ * Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+ */
+
+/*
+ * Copyright (C) 2000 Jason Evans <jasone@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(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(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 COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $");
+
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+#define NCHILDREN 10
+
+ATF_TC(basic);
+ATF_TC_HEAD(basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks basic functionality of POSIX "
+ "semaphores");
+}
+ATF_TC_BODY(basic, tc)
+{
+ int val;
+ sem_t *sem_b;
+
+ if (sysconf(_SC_SEMAPHORES) == -1)
+ atf_tc_skip("POSIX semaphores not supported");
+
+ sem_b = sem_open("/sem_b", O_CREAT | O_EXCL, 0644, 0);
+ ATF_REQUIRE(sem_b != SEM_FAILED);
+
+ ATF_REQUIRE_EQ(sem_getvalue(sem_b, &val), 0);
+ ATF_REQUIRE_EQ(val, 0);
+
+ ATF_REQUIRE_EQ(sem_post(sem_b), 0);
+ ATF_REQUIRE_EQ(sem_getvalue(sem_b, &val), 0);
+ ATF_REQUIRE_EQ(val, 1);
+
+ ATF_REQUIRE_EQ(sem_wait(sem_b), 0);
+ ATF_REQUIRE_EQ(sem_trywait(sem_b), -1);
+ ATF_REQUIRE_EQ(errno, EAGAIN);
+ ATF_REQUIRE_EQ(sem_post(sem_b), 0);
+ ATF_REQUIRE_EQ(sem_trywait(sem_b), 0);
+ ATF_REQUIRE_EQ(sem_post(sem_b), 0);
+ ATF_REQUIRE_EQ(sem_wait(sem_b), 0);
+ ATF_REQUIRE_EQ(sem_post(sem_b), 0);
+
+ ATF_REQUIRE_EQ(sem_close(sem_b), 0);
+ ATF_REQUIRE_EQ(sem_unlink("/sem_b"), 0);
+}
+
+ATF_TC(child);
+ATF_TC_HEAD(child, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks using semaphores to synchronize "
+ "parent with multiple child processes");
+}
+ATF_TC_BODY(child, tc)
+{
+ pid_t children[NCHILDREN];
+ unsigned i, j;
+ sem_t *sem_a;
+ int status;
+
+ pid_t pid;
+
+ if (sysconf(_SC_SEMAPHORES) == -1)
+ atf_tc_skip("POSIX semaphores not supported");
+
+ sem_a = sem_open("/sem_a", O_CREAT | O_EXCL, 0644, 0);
+ ATF_REQUIRE(sem_a != SEM_FAILED);
+
+ for (j = 1; j <= 2; j++) {
+ for (i = 0; i < NCHILDREN; i++) {
+ switch ((pid = fork())) {
+ case -1:
+ atf_tc_fail("fork() returned -1");
+ case 0:
+ printf("PID %d waiting for semaphore...\n",
+ getpid());
+ ATF_REQUIRE_MSG(sem_wait(sem_a) == 0,
+ "sem_wait failed; iteration %d", j);
+ printf("PID %d got semaphore\n", getpid());
+ _exit(0);
+ default:
+ children[i] = pid;
+ break;
+ }
+ }
+
+ for (i = 0; i < NCHILDREN; i++) {
+ sleep(1);
+ printf("main loop %d: posting...\n", j);
+ ATF_REQUIRE_EQ(sem_post(sem_a), 0);
+ }
+
+ for (i = 0; i < NCHILDREN; i++) {
+ ATF_REQUIRE_EQ(waitpid(children[i], &status, 0), children[i]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE_EQ(WEXITSTATUS(status), 0);
+ }
+ }
+
+ ATF_REQUIRE_EQ(sem_close(sem_a), 0);
+ ATF_REQUIRE_EQ(sem_unlink("/sem_a"), 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, basic);
+ ATF_TP_ADD_TC(tp, child);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/librumpclient/h_exec.c b/contrib/netbsd-tests/lib/librumpclient/h_exec.c
new file mode 100644
index 0000000..cf2526c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumpclient/h_exec.c
@@ -0,0 +1,132 @@
+/* $NetBSD: h_exec.c,v 1.6 2011/02/16 17:57:44 pooka Exp $ */
+
+/*
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rumpclient.h>
+#include <rump/rump_syscalls.h>
+
+int
+main(int argc, char *argv[])
+{
+ struct sockaddr_in sin;
+ socklen_t slen;
+ int s1, s2;
+ char buf[12];
+ char *eargv[4];
+ char *ename;
+ extern char **environ;
+
+ if (rumpclient_init() == -1)
+ err(1, "init");
+
+ if (argc > 1) {
+ if (strcmp(argv[1], "_didexec") == 0) {
+ rumpclient_daemon(0, 0); /* detach-me-notnot */
+ s2 = atoi(argv[2]);
+ slen = sizeof(sin);
+ /* see below */
+ rump_sys_accept(s2, (struct sockaddr *)&sin, &slen);
+ }
+ }
+
+ /* open and listenize two TCP4 suckets */
+ if ((s1 = rump_sys_socket(PF_INET, SOCK_STREAM, 0)) == -1)
+ err(1, "socket 1");
+ if ((s2 = rump_sys_socket(PF_INET, SOCK_STREAM, 0)) == -1)
+ err(1, "socket 2");
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(1234);
+
+ if (rump_sys_bind(s1, (struct sockaddr *)&sin, sizeof(sin)) == -1)
+ err(1, "bind1");
+ sin.sin_port = htons(2345);
+ if (rump_sys_bind(s2, (struct sockaddr *)&sin, sizeof(sin)) == -1)
+ err(1, "bind2");
+
+ if (rump_sys_listen(s1, 1) == -1)
+ err(1, "listen1");
+ if (rump_sys_listen(s2, 1) == -1)
+ err(1, "listen2");
+
+ if (argc == 1) {
+ rumpclient_daemon(0, 0);
+ slen = sizeof(sin);
+ /*
+ * "pause()", but conveniently gets rid of this helper
+ * since we were called with RUMPCLIENT_RETRYCONN_DIE set
+ */
+ rump_sys_accept(s2, (struct sockaddr *)&sin, &slen);
+ }
+
+ if (argc == 3 && strcmp(argv[2], "cloexec1") == 0) {
+ if (rump_sys_fcntl(s1, F_SETFD, FD_CLOEXEC) == -1) {
+ err(1, "cloexec failed");
+ }
+ }
+
+ sprintf(buf, "%d", s2);
+
+ if (argc == 3 && strcmp(argv[2], "vfork_please") == 0) {
+ switch (rumpclient_vfork()) {
+ case 0:
+ ename = __UNCONST("fourchette");
+ break;
+ case -1:
+ err(1, "vfork");
+ default:
+ ename = __UNCONST("h_ution");
+ break;
+ }
+ } else {
+ ename = __UNCONST("h_ution");
+ }
+
+ /* omstart! */
+ eargv[0] = ename;
+ eargv[1] = __UNCONST("_didexec");
+ eargv[2] = buf;
+ eargv[3] = NULL;
+ if (rumpclient_exec(argv[1], __UNCONST(eargv), environ) == -1)
+ err(1, "exec");
+}
diff --git a/contrib/netbsd-tests/lib/librumpclient/h_execthr.c b/contrib/netbsd-tests/lib/librumpclient/h_execthr.c
new file mode 100644
index 0000000..f653fe6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumpclient/h_execthr.c
@@ -0,0 +1,187 @@
+/* $NetBSD: h_execthr.c,v 1.3 2014/08/13 00:03:00 pooka Exp $ */
+
+/*
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/types.h>
+#include <sys/sysctl.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rumpclient.h>
+#include <rump/rump_syscalls.h>
+
+static int canreturn = 0;
+
+/*
+ * Use a fairly large number of threads so that we have
+ * a better chance catching races. XXX: this is rumpuser's
+ * MAXWORKER-1.
+ */
+#define NTHR 63
+
+#define P1_0 3
+#define P1_1 4
+#define P2_0 5
+#define P2_1 6
+
+static void *
+wrk(void *arg)
+{
+ int fd = (uintptr_t)arg;
+
+ rump_sys_read(fd, &fd, sizeof(fd));
+ if (!canreturn)
+ errx(1, "should not have returned");
+ if (fd != 37)
+ errx(1, "got invalid magic");
+
+ return NULL;
+}
+
+static int
+getproc(pid_t mypid, struct kinfo_proc2 *p)
+{
+ int name[6];
+ size_t len = sizeof(*p);
+
+ name[0] = CTL_KERN;
+ name[1] = KERN_PROC2;
+ name[2] = KERN_PROC_PID;
+ name[3] = mypid;
+ name[4] = len;
+ name[5] = 1;
+
+ return rump_sys___sysctl(name, __arraycount(name), p, &len, NULL, 0);
+}
+
+int
+main(int argc, char *argv[], char *envp[])
+{
+ struct kinfo_proc2 p;
+ char *execarg[3];
+ int p1[2], p2[2];
+ pid_t mypid;
+ pthread_t pt;
+ ssize_t n;
+ int i, execd;
+ char nexec[16];
+
+ if (argc > 1)
+ execd = atoi(argv[1]);
+ else
+ execd = 0;
+ sprintf(nexec, "%d", execd+1);
+
+ if (rumpclient_init() == -1) {
+ if (execd)
+ err(1, "init execd");
+ else
+ err(1, "init");
+ }
+ mypid = rump_sys_getpid();
+
+ if (execd) {
+ canreturn = 1;
+ if (pthread_create(&pt, NULL,
+ wrk, (void *)(uintptr_t)P2_0) != 0)
+ errx(1, "exec pthread_create");
+
+ i = 37;
+ rump_sys_write(P2_1, &i, sizeof(i));
+ pthread_join(pt, NULL);
+
+ n = rump_sys_read(P1_0, &i, sizeof(i));
+ if (n != -1 || errno != EBADF)
+ errx(1, "post-exec cloexec works");
+
+ getproc(mypid, &p);
+ if (p.p_nlwps != 2)
+ errx(1, "invalid nlwps: %lld", (long long)p.p_nlwps);
+
+ /* we passed? */
+ if (execd > 10)
+ exit(0);
+
+ rump_sys_close(P2_0);
+ rump_sys_close(P2_1);
+ }
+
+ if (rump_sys_pipe(p1) == -1)
+ err(1, "pipe1");
+ if (p1[0] != P1_0 || p1[1] != P1_1)
+ errx(1, "p1 assumptions failed %d %d", p1[0], p1[1]);
+ if (rump_sys_pipe(p2) == -1)
+ err(1, "pipe1");
+ if (p2[0] != P2_0 || p2[1] != P2_1)
+ errx(1, "p2 assumptions failed");
+ if (rump_sys_fcntl(p1[0], F_SETFD, FD_CLOEXEC) == -1)
+ err(1, "cloexec");
+ if (rump_sys_fcntl(p1[1], F_SETFD, FD_CLOEXEC) == -1)
+ err(1, "cloexec");
+
+ for (i = 0; i < NTHR; i++)
+ if (pthread_create(&pt, NULL,
+ wrk, (void *)(uintptr_t)p1[0]) != 0)
+ errx(1, "pthread_create 1 %d", i);
+
+ for (i = 0; i < NTHR; i++)
+ if (pthread_create(&pt, NULL,
+ wrk, (void *)(uintptr_t)p2[0]) != 0)
+ errx(1, "pthread_create 2 %d", i);
+
+ /* wait for all the threads to be enjoying themselves */
+ for (;;) {
+ getproc(mypid, &p);
+ if (p.p_nlwps == 2*NTHR + 2)
+ break;
+ usleep(10000);
+ }
+
+ /*
+ * load up one more (big) set. these won't start executing, though,
+ * but we're interested in if they create blockage
+ */
+ for (i = 0; i < 3*NTHR; i++)
+ if (pthread_create(&pt, NULL,
+ wrk, (void *)(uintptr_t)p1[0]) != 0)
+ errx(1, "pthread_create 1 %d", i);
+
+ /* then, we exec! */
+ execarg[0] = argv[0];
+ execarg[1] = nexec;
+ execarg[2] = NULL;
+ if (rumpclient_exec(argv[0], execarg, envp) == -1)
+ err(1, "exec");
+}
diff --git a/contrib/netbsd-tests/lib/librumpclient/t_exec.sh b/contrib/netbsd-tests/lib/librumpclient/t_exec.sh
new file mode 100755
index 0000000..661a3b9
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumpclient/t_exec.sh
@@ -0,0 +1,154 @@
+# $NetBSD: t_exec.sh,v 1.8 2011/03/08 12:40:25 pooka Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+rumpsrv='rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet'
+export RUMP_SERVER=unix://csock
+export RUMPHIJACK_RETRYCONNECT='die'
+
+atf_test_case noexec cleanup
+noexec_head()
+{
+ atf_set "descr" "check that we see what we expect without exec"
+}
+
+noexec_body()
+{
+
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+ atf_check -s exit:0 env $(atf_get_srcdir)/h_exec
+ atf_check -s exit:0 -o save:sstat.out rump.sockstat -n
+ atf_check -s exit:0 -o match:'^root.*h_exec.*tcp.*\*\.1234' \
+ sed -n 2p sstat.out
+ atf_check -s exit:0 -o match:'^root.*h_exec.*tcp.*\*\.2345' \
+ sed -n 3p sstat.out
+}
+
+noexec_cleanup()
+{
+ rump.halt
+}
+
+atf_test_case exec cleanup
+exec_head()
+{
+ atf_set "descr" "check that client names changes after exec"
+}
+
+exec_body()
+{
+
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+ atf_check -s exit:0 $(atf_get_srcdir)/h_exec $(atf_get_srcdir)/h_exec
+ atf_check -s exit:0 -o save:sstat.out rump.sockstat -n
+ atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.1234' \
+ sed -n 2p sstat.out
+ atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.2345' \
+ sed -n 3p sstat.out
+}
+
+exec_cleanup()
+{
+ rump.halt
+}
+
+atf_test_case cloexec cleanup
+cloexec_head()
+{
+ atf_set "descr" "check that FD_CLOEXEC works"
+}
+
+cloexec_body()
+{
+
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+ atf_check -s exit:0 \
+ $(atf_get_srcdir)/h_exec $(atf_get_srcdir)/h_exec cloexec1
+ atf_check -s exit:0 -o save:sstat.out rump.sockstat -n
+ atf_check -s exit:0 -o inline:'2\n' sed -n '$=' sstat.out
+ atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.2345' \
+ sed -n 2p sstat.out
+}
+
+cloexec_cleanup()
+{
+ rump.halt
+}
+
+atf_test_case vfork cleanup
+vfork_head()
+{
+ atf_set "descr" "test rumpclient_vfork()"
+}
+
+vfork_body()
+{
+
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+ atf_check -s exit:0 \
+ $(atf_get_srcdir)/h_exec $(atf_get_srcdir)/h_exec vfork_please
+ atf_check -s exit:0 -o save:sstat.out rump.sockstat -n
+ atf_check -s exit:0 -o inline:'5\n' sed -n '$=' sstat.out
+ atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.1234' \
+ cat sstat.out
+ atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.2345' \
+ cat sstat.out
+ atf_check -s exit:0 -o match:'^root.*fourchette.*tcp.*\*\.1234' \
+ cat sstat.out
+ atf_check -s exit:0 -o match:'^root.*fourchette.*tcp.*\*\.2345' \
+ cat sstat.out
+}
+
+vfork_cleanup()
+{
+ rump.halt
+}
+
+atf_test_case threxec cleanup
+threxec_head()
+{
+ atf_set "descr" "check that threads are killed before exec continues"
+}
+
+threxec_body()
+{
+ atf_check -s exit:0 rump_server ${RUMP_SERVER}
+ atf_check -s exit:0 $(atf_get_srcdir)/h_execthr
+}
+
+threxec_cleanup()
+{
+ rump.halt
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case noexec
+ atf_add_test_case exec
+ atf_add_test_case cloexec
+ atf_add_test_case vfork
+ atf_add_test_case threxec
+}
diff --git a/contrib/netbsd-tests/lib/librumpclient/t_fd.c b/contrib/netbsd-tests/lib/librumpclient/t_fd.c
new file mode 100644
index 0000000..aa0d1cc
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumpclient/t_fd.c
@@ -0,0 +1,146 @@
+/* $NetBSD: t_fd.c,v 1.4 2011/08/25 18:46:01 hannken Exp $ */
+
+/*
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <rump/rumpclient.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+
+ATF_TC_WITH_CLEANUP(bigenough);
+ATF_TC_HEAD(bigenough, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check that rumpclient uses "
+ "fd > 2");
+}
+ATF_TC_WITH_CLEANUP(sigio);
+ATF_TC_HEAD(sigio, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check that rump client receives "
+ "SIGIO");
+}
+
+#define RUMPSERV "unix://sucket"
+
+ATF_TC_CLEANUP(bigenough, tc){system("env RUMP_SERVER=" RUMPSERV " rump.halt");}
+ATF_TC_CLEANUP(sigio, tc) { system("env RUMP_SERVER=" RUMPSERV " rump.halt"); }
+
+ATF_TC_BODY(bigenough, tc)
+{
+ struct stat sb;
+
+ RZ(system("rump_server " RUMPSERV));
+ RL(setenv("RUMP_SERVER", RUMPSERV, 1));
+
+ RL(dup2(0, 10));
+ RL(dup2(1, 11));
+ RL(dup2(2, 12));
+
+ RL(close(0));
+ RL(close(1));
+ RL(close(2));
+
+ RL(rumpclient_init());
+ RL(rump_sys_getpid());
+
+ ATF_REQUIRE_ERRNO(EBADF, fstat(0, &sb) == -1);
+ ATF_REQUIRE_ERRNO(EBADF, fstat(1, &sb) == -1);
+ ATF_REQUIRE_ERRNO(EBADF, fstat(2, &sb) == -1);
+
+ RL(rump_sys_getpid());
+
+ /* restore these. does it help? */
+ dup2(10, 0);
+ dup2(11, 1);
+ dup2(12, 2);
+}
+
+static volatile sig_atomic_t sigcnt;
+static void
+gotsig(int sig)
+{
+
+ sigcnt++;
+}
+
+ATF_TC_BODY(sigio, tc)
+{
+ struct sockaddr_in sin;
+ int ls;
+ int cs;
+ int fl;
+ int sc;
+
+ signal(SIGIO, gotsig);
+ RZ(system("rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet "
+ RUMPSERV));
+ RL(setenv("RUMP_SERVER", RUMPSERV, 1));
+
+ RL(rumpclient_init());
+ RL(ls = rump_sys_socket(PF_INET, SOCK_STREAM, 0));
+
+ RL(rump_sys_fcntl(ls, F_SETOWN, rump_sys_getpid()));
+ RL(fl = rump_sys_fcntl(ls, F_GETFL));
+ RL(rump_sys_fcntl(ls, F_SETFL, fl | O_ASYNC));
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(12345);
+ RL(rump_sys_bind(ls, (struct sockaddr *)&sin, sizeof(sin)));
+ RL(rump_sys_listen(ls, 5));
+
+ RL(cs = rump_sys_socket(PF_INET, SOCK_STREAM, 0));
+ sin.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+ ATF_REQUIRE_EQ(sigcnt, 0);
+ RL(rump_sys_connect(cs, (struct sockaddr *)&sin, sizeof(sin)));
+ sc = sigcnt;
+ printf("sigcnt after connect: %d\n", sc);
+ ATF_REQUIRE(sc >= 1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, bigenough);
+ ATF_TP_ADD_TC(tp, sigio);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/h_client.c b/contrib/netbsd-tests/lib/librumphijack/h_client.c
new file mode 100644
index 0000000..20add73
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/h_client.c
@@ -0,0 +1,138 @@
+/* $NetBSD: h_client.c,v 1.8 2012/04/20 05:15:11 jruoho Exp $ */
+
+/*
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/types.h>
+#include <sys/poll.h>
+#include <sys/select.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+int
+main(int argc, char *argv[])
+{
+
+ if (argc != 2) {
+ errx(1, "need testname as param");
+ }
+
+ if (strcmp(argv[1], "select_timeout") == 0) {
+ fd_set rfds;
+ struct timeval tv;
+ int pipefd[2];
+ int rv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 1;
+
+ if (pipe(pipefd) == -1)
+ err(EXIT_FAILURE, "pipe");
+ FD_ZERO(&rfds);
+ FD_SET(pipefd[0], &rfds);
+
+ rv = select(pipefd[0]+1, &rfds, NULL, NULL, &tv);
+ if (rv == -1)
+ err(EXIT_FAILURE, "select");
+ if (rv != 0)
+ errx(EXIT_FAILURE, "select succesful");
+
+ if (FD_ISSET(pipefd[0], &rfds))
+ errx(EXIT_FAILURE, "stdin fileno is still set");
+ return EXIT_SUCCESS;
+ } else if (strcmp(argv[1], "select_allunset") == 0) {
+ fd_set fds;
+ struct timeval tv;
+ int rv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 1;
+
+ FD_ZERO(&fds);
+
+ rv = select(100, &fds, &fds, &fds, &tv);
+ if (rv == -1)
+ err(EXIT_FAILURE, "select");
+ if (rv != 0)
+ errx(EXIT_FAILURE, "select succesful");
+
+ rv = select(0, NULL, NULL, NULL, &tv);
+ if (rv == -1)
+ err(EXIT_FAILURE, "select2");
+ if (rv != 0)
+ errx(EXIT_FAILURE, "select2 succesful");
+
+ return EXIT_SUCCESS;
+ } else if (strcmp(argv[1], "invafd") == 0) {
+ struct pollfd pfd[2];
+ int fd, rv;
+
+ fd = open("/rump/dev/null", O_RDWR);
+ if (fd == -1)
+ err(EXIT_FAILURE, "open");
+ close(fd);
+
+ pfd[0].fd = STDIN_FILENO;
+ pfd[0].events = POLLIN;
+ pfd[1].fd = fd;
+ pfd[1].events = POLLIN;
+
+ if ((rv = poll(pfd, 2, INFTIM)) != 1)
+ errx(EXIT_FAILURE, "poll unexpected rv %d (%d)",
+ rv, errno);
+ if (pfd[1].revents != POLLNVAL || pfd[0].revents != 0)
+ errx(EXIT_FAILURE, "poll unexpected revents");
+
+ return EXIT_SUCCESS;
+ } else if (strcmp(argv[1], "fdoff8") == 0) {
+
+ (void)closefrom(0);
+
+ int fd;
+
+ do {
+ if ((fd = open("/dev/null", O_RDWR)) == -1)
+ err(EXIT_FAILURE, "open1");
+ } while (fd < 7);
+ fd = open("/dev/null", O_RDWR);
+ if (fd != -1 || errno != ENFILE)
+ errx(EXIT_FAILURE, "unexpected fd8 %d %d", fd, errno);
+ if (fcntl(0, F_MAXFD) != 7)
+ errx(EXIT_FAILURE, "fd leak?");
+ if ((fd = open("/rump/dev/null", O_RDWR)) != 8)
+ errx(EXIT_FAILURE, "rump open %d %d", fd, errno);
+ return EXIT_SUCCESS;
+ } else {
+ return ENOTSUP;
+ }
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/h_cwd.c b/contrib/netbsd-tests/lib/librumphijack/h_cwd.c
new file mode 100644
index 0000000..dfc509d
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/h_cwd.c
@@ -0,0 +1,168 @@
+/* $NetBSD: h_cwd.c,v 1.3 2012/04/17 09:23:21 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/types.h>
+#include <sys/stat.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char *prefix;
+static size_t prefixlen;
+static char buf[1024];
+static char pwd[1024];
+
+static const char *
+makepath(const char *tail)
+{
+
+ strcpy(buf, prefix);
+ if (prefix[prefixlen-1] != '/')
+ strcat(buf, "/");
+ strcat(buf, tail);
+
+ return buf;
+}
+
+static void
+dochdir(const char *path, const char *errmsg)
+{
+
+ if (chdir(path) == -1)
+ err(EXIT_FAILURE, "%s", errmsg);
+}
+
+static void
+dofchdir(const char *path, const char *errmsg)
+{
+ int fd;
+
+ fd = open(path, O_RDONLY);
+ if (fd == -1)
+ err(EXIT_FAILURE, "open %s", errmsg);
+ if (fchdir(fd) == -1)
+ err(EXIT_FAILURE, "fchdir %s", errmsg);
+ close(fd);
+}
+static void (*thechdir)(const char *, const char *);
+
+static void
+simple(void)
+{
+
+ thechdir(prefix, "chdir1");
+ if (getcwd(pwd, sizeof(pwd)) == NULL)
+ err(EXIT_FAILURE, "getcwd1");
+ if (strcmp(pwd, prefix) != 0)
+ errx(EXIT_FAILURE, "strcmp1");
+
+ if (mkdir("dir", 0777) == -1)
+ err(EXIT_FAILURE, "mkdir2");
+ thechdir("dir", "chdir2");
+ if (getcwd(pwd, sizeof(pwd)) == NULL)
+ err(EXIT_FAILURE, "getcwd2");
+ if (strcmp(pwd, makepath("dir")) != 0)
+ errx(EXIT_FAILURE, "strcmp2");
+
+ if (mkdir("dir", 0777) == -1)
+ err(EXIT_FAILURE, "mkdir3");
+ thechdir("dir", "chdir3");
+ if (getcwd(pwd, sizeof(pwd)) == NULL)
+ err(EXIT_FAILURE, "getcwd3");
+ if (strcmp(pwd, makepath("dir/dir")) != 0)
+ errx(EXIT_FAILURE, "strcmp3");
+
+ thechdir("..", "chdir4");
+ if (getcwd(pwd, sizeof(pwd)) == NULL)
+ err(EXIT_FAILURE, "getcwd4");
+ if (strcmp(pwd, makepath("dir")) != 0)
+ errx(EXIT_FAILURE, "strcmp4");
+
+
+ thechdir("../../../../../../..", "chdir5");
+ if (getcwd(pwd, sizeof(pwd)) == NULL)
+ err(EXIT_FAILURE, "getcwd5");
+ if (strcmp(pwd, prefix) != 0)
+ errx(EXIT_FAILURE, "strcmp5");
+
+ thechdir("/", "chdir6");
+ if (getcwd(pwd, sizeof(pwd)) == NULL)
+ err(EXIT_FAILURE, "getcwd6");
+ if (strcmp(pwd, "/") != 0)
+ errx(EXIT_FAILURE, "strcmp6");
+}
+
+static void
+symlinktest(void)
+{
+
+ thechdir(prefix, "chdir1");
+ if (mkdir("adir", 0777) == -1)
+ err(EXIT_FAILURE, "mkdir1");
+ if (mkdir("anotherdir", 0777) == -1)
+ err(EXIT_FAILURE, "mkdir2");
+
+ if (symlink("/adir", "anotherdir/lincthesink") == -1)
+ err(EXIT_FAILURE, "symlink");
+
+ thechdir("anotherdir/lincthesink", "chdir2");
+ if (getcwd(pwd, sizeof(pwd)) == NULL)
+ err(EXIT_FAILURE, "getcwd");
+ if (strcmp(pwd, makepath("adir")) != 0)
+ errx(EXIT_FAILURE, "strcmp");
+}
+
+int
+main(int argc, char *argv[])
+{
+
+ if (argc != 4)
+ errx(1, "usage");
+
+ prefix = argv[1];
+ prefixlen = strlen(argv[1]);
+
+ if (strcmp(argv[3], "chdir") == 0)
+ thechdir = dochdir;
+ else if (strcmp(argv[3], "fchdir") == 0)
+ thechdir = dofchdir;
+ else
+ errx(EXIT_FAILURE, "invalid chdir type");
+
+ if (strcmp(argv[2], "simple") == 0)
+ simple();
+ if (strcmp(argv[2], "symlink") == 0)
+ symlinktest();
+
+ return EXIT_SUCCESS;
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/h_netget.c b/contrib/netbsd-tests/lib/librumphijack/h_netget.c
new file mode 100644
index 0000000..4d8b408
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/h_netget.c
@@ -0,0 +1,101 @@
+/* $NetBSD: h_netget.c,v 1.2 2012/04/17 09:23:21 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * simple utility to fetch a webpage. we wouldn't need this
+ * if we had something like netcat in base
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: h_netget.c,v 1.2 2012/04/17 09:23:21 jruoho Exp $");
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <arpa/inet.h>
+
+#include <netinet/in.h>
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define GETSTR "GET / HTTP/1.0\n\n"
+
+int
+main(int argc, char *argv[])
+{
+ char buf[8192];
+ struct sockaddr_in sin;
+ ssize_t n;
+ int s, fd;
+
+ setprogname(argv[0]);
+ if (argc != 4) {
+ fprintf(stderr, "usage: %s address port savefile\n",
+ getprogname());
+ return EXIT_FAILURE;
+ }
+
+ s = socket(PF_INET, SOCK_STREAM, 0);
+ if (s == -1)
+ err(EXIT_FAILURE, "socket");
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(atoi(argv[2]));
+ sin.sin_addr.s_addr = inet_addr(argv[1]);
+
+ fd = open(argv[3], O_CREAT | O_RDWR, 0644);
+ if (fd == -1)
+ err(EXIT_FAILURE, "open");
+ if (ftruncate(fd, 0) == -1)
+ err(EXIT_FAILURE, "ftruncate savefile");
+
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) == -1)
+ err(EXIT_FAILURE, "connect");
+
+ if (write(s, GETSTR, strlen(GETSTR)) != strlen(GETSTR))
+ err(EXIT_FAILURE, "socket write");
+
+ for (;;) {
+ n = read(s, buf, sizeof(buf));
+ if (n == 0)
+ break;
+ if (n == -1)
+ err(EXIT_FAILURE, "socket read");
+
+ if (write(fd, buf, n) != n)
+ err(EXIT_FAILURE, "write file");
+ }
+
+ return EXIT_SUCCESS;
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/index.html b/contrib/netbsd-tests/lib/librumphijack/index.html
new file mode 100644
index 0000000..1d8679c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/index.html
@@ -0,0 +1,5 @@
+<html><head>
+<title>test page</title>
+</head><body>
+i am a test, how do you do?
+</body></html>
diff --git a/contrib/netbsd-tests/lib/librumphijack/netstat.expout b/contrib/netbsd-tests/lib/librumphijack/netstat.expout
new file mode 100644
index 0000000..1a9a2a1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/netstat.expout
@@ -0,0 +1,6 @@
+Active Internet connections (including servers)
+Proto Recv-Q Send-Q Local Address Foreign Address State
+tcp 0 0 *.http *.* LISTEN
+Active Internet6 connections (including servers)
+Proto Recv-Q Send-Q Local Address Foreign Address (state)
+tcp6 0 0 *.http *.* LISTEN
diff --git a/contrib/netbsd-tests/lib/librumphijack/ssh_config.in b/contrib/netbsd-tests/lib/librumphijack/ssh_config.in
new file mode 100644
index 0000000..73b83c8
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/ssh_config.in
@@ -0,0 +1,14 @@
+# $NetBSD: ssh_config.in,v 1.1 2011/02/14 15:14:00 pooka Exp $
+
+# Basic settings.
+Port 22
+Protocol 2
+
+# The temporary key used for login.
+IdentityFile @WORKDIR@/ssh_user_key
+
+# Prevent the client from complaining about unknown host keys.
+GlobalKnownHostsFile @WORKDIR@/known_hosts
+
+# Do not attempt password authentication in case keys fail.
+IdentitiesOnly yes
diff --git a/contrib/netbsd-tests/lib/librumphijack/ssh_host_key b/contrib/netbsd-tests/lib/librumphijack/ssh_host_key
new file mode 100644
index 0000000..ebdbc8b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/ssh_host_key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQDJnMpSG1lGmApk8F7ZH7TGtjjP/WUs+vqHyFsyS2lilJzereen
+a/ME6S0d0HTOeCdKldjbtDpfNXbh+XnJMlJMEgEs4Mg1jluuEV0GOJoMt7cGzku2
+gAYGx++2+wqYw6Y+M8Tb1M4AO+PcxD/3BkdUyIKO63v6STl2VQn1BzsTQwIBIwKB
+gAuFTWPHDGpvFols0jhK9GMgWwSSIwnidLdNRwowMehgQ3pwVmFWoCwqlN0h2sn4
+PMJu9nL0WxtiJAzprzARgQuPI25t9LiKTF7scC/cNUiHPplUjvoDXA9ccY1eIf4R
+e6wwZz1jfCWen0eRsvMyoYvFmEH8hILAk1bY9heymOGLAkEA/WhC49n+gtloVMow
+iKQOO6+u3ouxTOTQ3sV2wCaLaO2pEbHP2//5SlUJLp6QrjC7bg9Kr+f56+zT2he9
+f6GCwwJBAMus3XizmZdJyJLnkCJRiT0/3Kf57fhWKRdnFkuRLyjET9MEWavRdJmr
+bx/lxmILi1iKwXiFEDM6MqYfmNImJYECQQCtw9YYlXtSaTGZOi/oqwJyEhGCqO6b
+II85q/moVPHhjQY4BOZNttbT4on0FPV+wlSjPa+OkHDcSp/mAaaDZ2+bAkEAujel
+6rLVkaKLfv+ZuPoXE22WivMityo0Mqdk12ArHfVQS+a4YpOdzlOYzLTSosi56o19
+sAShGOTAl+Jf1hQ/iwJAKpPviX5w292H/m5T0m4l0NRdQ3pRujOLMSVmY+/HFZTW
+GJMYLr1eBKNfLsKzJgB88GzuF2O/O8hNi3XSiOP+9w==
+-----END RSA PRIVATE KEY-----
diff --git a/contrib/netbsd-tests/lib/librumphijack/ssh_host_key.pub b/contrib/netbsd-tests/lib/librumphijack/ssh_host_key.pub
new file mode 100644
index 0000000..8d08795
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/ssh_host_key.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAyZzKUhtZRpgKZPBe2R+0xrY4z/1lLPr6h8hbMktpYpSc3q3np2vzBOktHdB0zngnSpXY27Q6XzV24fl5yTJSTBIBLODINY5brhFdBjiaDLe3Bs5LtoAGBsfvtvsKmMOmPjPE29TOADvj3MQ/9wZHVMiCjut7+kk5dlUJ9Qc7E0M= test@test.example.net
diff --git a/contrib/netbsd-tests/lib/librumphijack/sshd_config.in b/contrib/netbsd-tests/lib/librumphijack/sshd_config.in
new file mode 100644
index 0000000..9ffc47f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/sshd_config.in
@@ -0,0 +1,39 @@
+# $NetBSD: sshd_config.in,v 1.1 2011/02/14 15:14:00 pooka Exp $
+
+# Basic settings.
+Port 22
+Protocol 2
+
+# Provide information to the user in case something goes wrong.
+LogLevel DEBUG1
+
+# The host key. It lives in the work directory because we need to set
+# very strict permissions on it and cannot modify the copy on the source
+# directory.
+HostKey @WORKDIR@/ssh_host_key
+
+# The authorized keys file we set up during the test to allow the client
+# to safely log in. We need to disable strict modes because ATF_WORKDIR
+# usually lives in /tmp, which has 1777 permissions and are not liked by
+# sshd.
+AuthorizedKeysFile @WORKDIR@/authorized_keys
+StrictModes no
+
+# Some settings to allow user runs of sshd.
+PidFile @WORKDIR@/sshd.pid
+UsePam no
+UsePrivilegeSeparation no
+
+# The root user should also be able to run the tests.
+PermitRootLogin yes
+
+# Be restrictive about access to the temporary server. Only allow key-based
+# authentication.
+ChallengeResponseAuthentication no
+GSSAPIAuthentication no
+HostbasedAuthentication no
+KerberosAuthentication no
+MaxAuthTries 1
+MaxStartups 1
+PasswordAuthentication no
+PubkeyAuthentication yes
diff --git a/contrib/netbsd-tests/lib/librumphijack/t_asyncio.sh b/contrib/netbsd-tests/lib/librumphijack/t_asyncio.sh
new file mode 100755
index 0000000..d5d703c
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/t_asyncio.sh
@@ -0,0 +1,94 @@
+# $NetBSD: t_asyncio.sh,v 1.4 2014/08/27 13:32:16 gson Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+rumpsrv='rump_server'
+export RUMP_SERVER=unix://csock
+
+atf_test_case select_timeout cleanup
+select_timeout_head()
+{
+ atf_set "descr" "select() with timeout returns no fds set"
+}
+
+select_timeout_body()
+{
+
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+ atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
+ $(atf_get_srcdir)/h_client select_timeout
+}
+
+select_timeout_cleanup()
+{
+ rump.halt
+}
+
+atf_test_case select_allunset cleanup
+select_allunset_head()
+{
+ atf_set "descr" "select() with no set fds in fd_set should not crash"
+}
+
+select_allunset_body()
+{
+
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+ atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
+ $(atf_get_srcdir)/h_client select_allunset
+}
+
+select_allunset_cleanup()
+{
+ rump.halt
+}
+
+atf_test_case invafd cleanup
+invafd_head()
+{
+ atf_set "descr" "poll on invalid rump fd"
+ atf_set "timeout" "10"
+}
+
+invafd_body()
+{
+
+ atf_check -s exit:0 rump_server -lrumpvfs ${RUMP_SERVER}
+ atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
+ $(atf_get_srcdir)/h_client invafd
+}
+
+invafd_cleanup()
+{
+ rump.halt
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case select_timeout
+ atf_add_test_case select_allunset
+ atf_add_test_case invafd
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/t_config.sh b/contrib/netbsd-tests/lib/librumphijack/t_config.sh
new file mode 100755
index 0000000..014bb0f
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/t_config.sh
@@ -0,0 +1,54 @@
+# $NetBSD: t_config.sh,v 1.1 2011/03/14 15:56:40 pooka Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+rumpsrv='rump_server -lrumpvfs'
+export RUMP_SERVER=unix://csock
+
+atf_test_case fdoff cleanup
+fdoff_head()
+{
+ atf_set "descr" "RUMPHIJACK fdoff=8"
+}
+
+fdoff_body()
+{
+
+ atf_check -s exit:0 rump_server -lrumpvfs ${RUMP_SERVER}
+ export RUMPHIJACK=path=/rump,fdoff=8
+ atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
+ $(atf_get_srcdir)/h_client fdoff8
+}
+
+fdoff_cleanup()
+{
+ rump.halt
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case fdoff
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/t_cwd.sh b/contrib/netbsd-tests/lib/librumphijack/t_cwd.sh
new file mode 100755
index 0000000..3f2a50b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/t_cwd.sh
@@ -0,0 +1,72 @@
+# $NetBSD: t_cwd.sh,v 1.2 2011/02/19 19:57:28 pooka Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+rumpsrv='rump_server -lrumpvfs'
+export RUMP_SERVER=unix://csock
+
+test_case()
+{
+ local name="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+ eval "${name}_head() { }"
+ eval "${name}_body() { \
+ export RUMPHIJACK="path=${1}" ; \
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER} ; \
+ testbody " "${@}" "; \
+ }"
+ eval "${name}_cleanup() { \
+ rump.halt
+ }"
+}
+
+test_case basic_chdir /rump simple chdir
+test_case basic_fchdir /rump simple fchdir
+test_case slash_chdir // simple chdir
+test_case slash_fchdir // simple fchdir
+test_case symlink_chdir /rump symlink chdir
+test_case symlink_fchdir /rump symlink fchdir
+test_case symlink_slash_chdir // symlink chdir
+test_case symlink_slash_fchdir // symlink fchdir
+
+testbody()
+{
+ atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
+ $(atf_get_srcdir)/h_cwd $*
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic_chdir
+ atf_add_test_case basic_fchdir
+ atf_add_test_case slash_chdir
+ atf_add_test_case slash_fchdir
+ atf_add_test_case symlink_chdir
+ atf_add_test_case symlink_fchdir
+ atf_add_test_case symlink_slash_chdir
+ atf_add_test_case symlink_slash_fchdir
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/t_sh.sh b/contrib/netbsd-tests/lib/librumphijack/t_sh.sh
new file mode 100755
index 0000000..c01c729
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/t_sh.sh
@@ -0,0 +1,91 @@
+# $NetBSD: t_sh.sh,v 1.1 2011/03/03 11:54:12 pooka Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+#
+# Test various /bin/sh descriptor games.
+#
+# Note that there is an extra level of trickery here, since
+# we need to run an extra level of shell to "catch" LD_PRELOAD.
+#
+
+rumpsrv='rump_server -lrumpvfs'
+export RUMP_SERVER=unix://csock
+exout="this is the output you are looking for"
+
+atf_test_case runscript cleanup
+runscript_head()
+{
+ atf_set "descr" "can run /bin/sh scripts from rumpfs"
+}
+
+runscript_body()
+{
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ echo "echo $exout" > thescript
+ atf_check -s exit:0 mv thescript /rump
+ atf_check -s exit:0 -o inline:"${exout}\n" -x sh /rump/thescript
+}
+
+runscript_cleanup()
+{
+ rump.halt
+}
+
+atf_test_case redirect cleanup
+redirect_head()
+{
+ atf_set "descr" "input/output redirection works with rumphijack"
+}
+
+redirect_body()
+{
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+
+ echo "echo $exout > /rump/thefile" > thescript
+ atf_check -s exit:0 -x sh thescript
+
+ # read it without input redirection
+ atf_check -s exit:0 -o inline:"${exout}\n" cat /rump/thefile
+
+ # read it with input redirection (note, need an exec'd shell again)
+ echo "cat < /rump/thefile" > thescript
+ atf_check -s exit:0 -o inline:"${exout}\n" -x sh thescript
+}
+
+redirect_cleanup()
+{
+ rump.halt
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case runscript
+ atf_add_test_case redirect
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh b/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh
new file mode 100755
index 0000000..d6a16fa
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh
@@ -0,0 +1,268 @@
+# $NetBSD: t_tcpip.sh,v 1.13 2014/01/03 13:18:00 pooka Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+rumpnetsrv='rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet'
+export RUMP_SERVER=unix://csock
+
+atf_test_case http cleanup
+http_head()
+{
+ atf_set "descr" "Start hijacked httpd and get webpage from it"
+}
+
+http_body()
+{
+
+ atf_check -s exit:0 ${rumpnetsrv} -lrumpnet_netinet6 ${RUMP_SERVER}
+
+ # start bozo in daemon mode
+ atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
+ /usr/libexec/httpd -P ./httpd.pid -b -s $(atf_get_srcdir)
+
+ atf_check -s exit:0 -o file:"$(atf_get_srcdir)/netstat.expout" \
+ rump.netstat -a
+
+ # get the webpage
+ atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
+ $(atf_get_srcdir)/h_netget 127.0.0.1 80 webfile
+
+ # check that we got what we wanted
+ atf_check -o match:'HTTP/1.0 200 OK' cat webfile
+ atf_check -o match:'Content-Length: 95' cat webfile
+ atf_check -o file:"$(atf_get_srcdir)/index.html" \
+ sed -n '1,/^$/!p' webfile
+}
+
+http_cleanup()
+{
+ if [ -f httpd.pid ]; then
+ kill -9 "$(cat httpd.pid)"
+ rm -f httpd.pid
+ fi
+
+ rump.halt
+}
+
+#
+# Starts a SSH server and sets up the client to access it.
+# Authentication is allowed and done using an RSA key exclusively, which
+# is generated on the fly as part of the test case.
+# XXX: Ideally, all the tests in this test program should be able to share
+# the generated key, because creating it can be a very slow process on some
+# machines.
+#
+# XXX2: copypasted from jmmv's sshd thingamob in the psshfs test.
+# ideally code (and keys, like jmmv notes above) could be shared
+#
+start_sshd() {
+ echo "Setting up SSH server configuration"
+ sed -e "s,@SRCDIR@,$(atf_get_srcdir),g" -e "s,@WORKDIR@,$(pwd),g" \
+ $(atf_get_srcdir)/sshd_config.in >sshd_config || \
+ atf_fail "Failed to create sshd_config"
+ atf_check -s ignore -o empty -e ignore \
+ cp $(atf_get_srcdir)/ssh_host_key .
+ atf_check -s ignore -o empty -e ignore \
+ cp $(atf_get_srcdir)/ssh_host_key.pub .
+ atf_check -s eq:0 -o empty -e empty chmod 400 ssh_host_key
+ atf_check -s eq:0 -o empty -e empty chmod 444 ssh_host_key.pub
+
+ env LD_PRELOAD=/usr/lib/librumphijack.so \
+ /usr/sbin/sshd -e -f ./sshd_config
+ while [ ! -f sshd.pid ]; do
+ sleep 0.01
+ done
+ echo "SSH server started (pid $(cat sshd.pid))"
+
+ echo "Setting up SSH client configuration"
+ atf_check -s eq:0 -o empty -e empty \
+ ssh-keygen -f ssh_user_key -t rsa -b 1024 -N "" -q
+ atf_check -s eq:0 -o empty -e empty \
+ cp ssh_user_key.pub authorized_keys
+ echo "127.0.0.1,localhost,::1 " \
+ "$(cat $(atf_get_srcdir)/ssh_host_key.pub)" >known_hosts || \
+ atf_fail "Failed to create known_hosts"
+ atf_check -s eq:0 -o empty -e empty chmod 600 authorized_keys
+ sed -e "s,@SRCDIR@,$(atf_get_srcdir),g" -e "s,@WORKDIR@,$(pwd),g" \
+ $(atf_get_srcdir)/ssh_config.in >ssh_config || \
+ atf_fail "Failed to create ssh_config"
+
+ echo "sshd running"
+}
+
+atf_test_case ssh cleanup
+ssh_head()
+{
+ atf_set "descr" "Test that hijacked ssh/sshd works"
+}
+
+ssh_body()
+{
+
+ atf_check -s exit:0 ${rumpnetsrv} ${RUMP_SERVER}
+ # make sure clients die after we nuke the server
+ export RUMPHIJACK_RETRYCONNECT='die'
+
+ start_sshd
+
+ # create some sort of directory for us to "ls"
+ mkdir testdir
+ cd testdir
+ jot 11 | xargs touch
+ jot 11 12 | xargs mkdir
+ cd ..
+
+ atf_check -s exit:0 -o save:ssh.out \
+ env LD_PRELOAD=/usr/lib/librumphijack.so \
+ ssh -T -F ssh_config 127.0.0.1 env BLOCKSIZE=512 \
+ ls -li $(pwd)/testdir
+ atf_check -s exit:0 -o file:ssh.out env BLOCKSIZE=512 \
+ ls -li $(pwd)/testdir
+}
+
+ssh_cleanup()
+{
+ rump.halt
+ # sshd dies due to RUMPHIJACK_RETRYCONNECT=1d6
+}
+
+test_nfs()
+{
+
+ magicstr='wind in my hair'
+ # create ffs file system we'll be serving from
+ atf_check -s exit:0 -o ignore newfs -F -s 10000 ffs.img
+
+ # start nfs kernel server. this is a mouthful
+ export RUMP_SERVER=unix://serversock
+ atf_check -s exit:0 rump_server $* ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+ atf_check -s exit:0 rump.ifconfig shmif0 inet 10.1.1.1
+
+ export RUMPHIJACK_RETRYCONNECT=die
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+
+ atf_check -s exit:0 mkdir -p /rump/var/run
+ atf_check -s exit:0 mkdir -p /rump/var/db
+ atf_check -s exit:0 touch /rump/var/db/mountdtab
+ atf_check -s exit:0 mkdir /rump/etc
+ atf_check -s exit:0 mkdir /rump/export
+
+ atf_check -s exit:0 -x \
+ 'echo "/export -noresvport -noresvmnt 10.1.1.100" | \
+ dd of=/rump/etc/exports 2> /dev/null'
+
+ atf_check -s exit:0 -e ignore mount_ffs /dk /rump/export
+ atf_check -s exit:0 -x "echo ${magicstr} > /rump/export/im_alive"
+
+ # start rpcbind. we want /var/run/rpcbind.sock
+ export RUMPHIJACK='blanket=/var/run,socket=all'
+ atf_check -s exit:0 rpcbind
+
+ # ok, then we want mountd in the similar fashion
+ export RUMPHIJACK='blanket=/var/run:/var/db:/export,socket=all,path=/rump,vfs=all'
+ atf_check -s exit:0 mountd /rump/etc/exports
+
+ # finally, le nfschuck
+ export RUMPHIJACK='blanket=/var/run,socket=all,vfs=all'
+ atf_check -s exit:0 nfsd
+
+ #
+ # now, time for the client server and associated madness.
+ #
+
+ export RUMP_SERVER=unix://clientsock
+ unset RUMPHIJACK
+ unset LD_PRELOAD
+
+ # at least the kernel server is easier
+ atf_check -s exit:0 rump_server -lrumpvfs -lrumpnet \
+ -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpfs_nfs\
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+ atf_check -s exit:0 rump.ifconfig shmif0 inet 10.1.1.100
+
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+
+ atf_check -s exit:0 mkdir /rump/mnt
+ atf_check -s exit:0 mount_nfs 10.1.1.1:/export /rump/mnt
+
+ atf_check -s exit:0 -o inline:"${magicstr}\n" cat /rump/mnt/im_alive
+ atf_check -s exit:0 -o match:'.*im_alive$' ls -l /rump/mnt/im_alive
+}
+
+
+atf_test_case nfs cleanup
+nfs_head()
+{
+ atf_set "descr" "Test hijacked nfsd and mount_nfs"
+}
+
+nfs_body()
+{
+ test_nfs -lrumpvfs -lrumpdev -lrumpnet -lrumpnet_net \
+ -lrumpnet_netinet -lrumpnet_local -lrumpnet_shmif \
+ -lrumpdev_disk -lrumpfs_ffs -lrumpfs_nfs -lrumpfs_nfsserver \
+ -d key=/dk,hostpath=ffs.img,size=host
+}
+
+nfs_cleanup()
+{
+ RUMP_SERVER=unix://serversock rump.halt 2> /dev/null
+ RUMP_SERVER=unix://clientsock rump.halt 2> /dev/null
+ :
+}
+
+atf_test_case nfs_autoload cleanup
+nfs_autoload_head()
+{
+ atf_set "descr" "Test hijacked nfsd with autoload from /stand"
+}
+
+nfs_autoload_body()
+{
+ [ `uname -m` = "i386" ] || atf_skip "test currently valid only on i386"
+ test_nfs -lrumpvfs -lrumpdev -lrumpnet -lrumpnet_net \
+ -lrumpnet_netinet -lrumpnet_local -lrumpnet_shmif \
+ -lrumpdev_disk -d key=/dk,hostpath=ffs.img,size=host
+}
+
+nfs_autoload_cleanup()
+{
+ nfs_cleanup
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case http
+ atf_add_test_case ssh
+ atf_add_test_case nfs
+ atf_add_test_case nfs_autoload
+}
diff --git a/contrib/netbsd-tests/lib/librumphijack/t_vfs.sh b/contrib/netbsd-tests/lib/librumphijack/t_vfs.sh
new file mode 100755
index 0000000..c803e2a
--- /dev/null
+++ b/contrib/netbsd-tests/lib/librumphijack/t_vfs.sh
@@ -0,0 +1,223 @@
+# $NetBSD: t_vfs.sh,v 1.6 2012/08/04 03:56:47 riastradh Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+img=ffs.img
+rumpsrv_ffs=\
+"rump_server -lrumpvfs -lrumpfs_ffs -lrumpdev_disk -d key=/img,hostpath=${img},size=host"
+export RUMP_SERVER=unix://csock
+
+domount()
+{
+
+ mntdir=$1
+ [ $# -eq 0 ] && mntdir=/rump/mnt
+ atf_check -s exit:0 -e ignore mount_ffs /img ${mntdir}
+}
+
+dounmount()
+{
+
+ atf_check -s exit:0 umount -R ${mntdir}
+}
+
+remount()
+{
+
+ dounmount
+ domount /rump/mnt2
+}
+
+simpletest()
+{
+ local name="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+ eval "${name}_head() { }"
+ eval "${name}_body() { \
+ atf_check -s exit:0 rump_server -lrumpvfs ${RUMP_SERVER} ; \
+ export LD_PRELOAD=/usr/lib/librumphijack.so ; \
+ ${name} " "${@}" "; \
+ }"
+ eval "${name}_cleanup() { \
+ rump.halt
+ }"
+}
+
+test_case()
+{
+ local name="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+ eval "${name}_head() { }"
+ eval "${name}_body() { \
+ atf_check -s exit:0 -o ignore newfs -F -s 20000 ${img} ; \
+ atf_check -s exit:0 ${rumpsrv_ffs} ${RUMP_SERVER} ; \
+ export LD_PRELOAD=/usr/lib/librumphijack.so ; \
+ mkdir /rump/mnt /rump/mnt2 ; \
+ domount ; \
+ ${name} " "${@}" "; \
+ dounmount ${mntdir}
+ }"
+ eval "${name}_cleanup() { \
+ rump.halt
+ }"
+}
+
+test_case paxcopy
+test_case cpcopy
+test_case mv_nox
+test_case ln_nox
+
+#
+# use rumphijack to cp/pax stuff onto an image, unmount it, remount it
+# at a different location, and check that we have an identical copy
+# (we make a local copy to avoid the minor possibility that someone
+# modifies the source dir data while the test is running)
+#
+paxcopy()
+{
+ parent=$(dirname $(atf_get_srcdir))
+ thedir=$(basename $(atf_get_srcdir))
+ atf_check -s exit:0 pax -rw -s,${parent},, $(atf_get_srcdir) .
+ atf_check -s exit:0 pax -rw ${thedir} /rump/mnt
+ remount
+ atf_check -s exit:0 diff -ru ${thedir} /rump/mnt2/${thedir}
+}
+
+cpcopy()
+{
+ thedir=$(basename $(atf_get_srcdir))
+ atf_check -s exit:0 cp -Rp $(atf_get_srcdir) .
+ atf_check -s exit:0 cp -Rp ${thedir} /rump/mnt
+ remount
+ atf_check -s exit:0 diff -ru ${thedir} /rump/mnt2/${thedir}
+}
+
+#
+# non-crosskernel mv (non-simple test since this uses rename(2)
+# which is not supported by rumpfs)
+#
+
+mv_nox()
+{
+ # stat default format sans changetime and filename
+ statstr='%d %i %Sp %l %Su %Sg %r %z \"%Sa\" \"%Sm\" \"%SB\" %k %b %#Xf'
+
+ atf_check -s exit:0 touch /rump/mnt/filename
+ atf_check -s exit:0 -o save:stat.out \
+ stat -f "${statstr}" /rump/mnt/filename
+ atf_check -s exit:0 mkdir /rump/mnt/dir
+ atf_check -s exit:0 mv /rump/mnt/filename /rump/mnt/dir/same
+ atf_check -s exit:0 -o file:stat.out \
+ stat -f "${statstr}" /rump/mnt/dir/same
+}
+
+ln_nox()
+{
+ # Omit st_nlink too, since it will increase.
+ statstr='%d %i %Sp %Su %Sg %r %z \"%Sa\" \"%Sm\" \"%SB\" %k %b %#Xf'
+
+ atf_check -s exit:0 touch /rump/mnt/filename
+ atf_check -s exit:0 -o save:stat.out \
+ stat -f "${statstr}" /rump/mnt/filename
+ atf_check -s exit:0 mkdir /rump/mnt/dir
+ atf_check -s exit:0 ln /rump/mnt/filename /rump/mnt/dir/same
+ atf_check -s exit:0 -o file:stat.out \
+ stat -f "${statstr}" /rump/mnt/filename
+ atf_check -s exit:0 -o file:stat.out \
+ stat -f "${statstr}" /rump/mnt/dir/same
+}
+
+simpletest mv_x
+simpletest ln_x
+simpletest runonprefix
+simpletest blanket
+simpletest doubleblanket
+
+#
+# do a cross-kernel mv
+#
+mv_x()
+{
+ thedir=$(basename $(atf_get_srcdir))
+ atf_check -s exit:0 cp -Rp $(atf_get_srcdir) .
+ atf_check -s exit:0 cp -Rp ${thedir} ${thedir}.2
+ atf_check -s exit:0 mv ${thedir} /rump
+ atf_check -s exit:0 diff -ru ${thedir}.2 /rump/${thedir}
+}
+
+#
+# Fail to make a cross-kernel hard link.
+#
+ln_x()
+{
+ atf_check -s exit:0 touch ./loser
+ atf_check -s not-exit:0 -e ignore ln ./loser /rump/.
+}
+
+runonprefix()
+{
+ atf_check -s exit:0 -o ignore stat /rump/dev
+ atf_check -s exit:1 -e ignore stat /rumpdev
+}
+
+blanket()
+{
+ export RUMPHIJACK='blanket=/dev,path=/rump'
+ atf_check -s exit:0 -o save:stat.out \
+ stat -f "${statstr}" /rump/dev/null
+ atf_check -s exit:0 -o file:stat.out \
+ stat -f "${statstr}" /dev/null
+}
+
+doubleblanket()
+{
+ atf_check -s exit:0 mkdir /rump/dir
+ atf_check -s exit:0 ln -s dir /rump/dirtoo
+
+ export RUMPHIJACK='blanket=/dirtoo:/dir'
+ atf_check -s exit:0 touch /dir/file
+
+ atf_check -s exit:0 -o save:stat.out \
+ stat -f "${statstr}" /dir/file
+ atf_check -s exit:0 -o file:stat.out \
+ stat -f "${statstr}" /dirtoo/file
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case paxcopy
+ atf_add_test_case cpcopy
+ atf_add_test_case mv_x
+ atf_add_test_case ln_x
+ atf_add_test_case mv_nox
+ atf_add_test_case ln_nox
+ atf_add_test_case runonprefix
+ atf_add_test_case blanket
+ atf_add_test_case doubleblanket
+}
diff --git a/contrib/netbsd-tests/lib/libskey/t_algorithms.c b/contrib/netbsd-tests/lib/libskey/t_algorithms.c
new file mode 100644
index 0000000..2eec278
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libskey/t_algorithms.c
@@ -0,0 +1,121 @@
+/* $NetBSD: t_algorithms.c,v 1.1 2010/07/16 13:56:32 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2000, 2008, 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_algorithms.c,v 1.1 2010/07/16 13:56:32 jmmv Exp $");
+
+#include <stdio.h>
+#include <strings.h>
+#include <skey.h>
+
+#include <atf-c.h>
+
+#define H_REQUIRE(x, y) \
+ ATF_REQUIRE_MSG(strcasecmp((x), (y)) == 0, "\"%s\" != \"%s\"", (x), (y))
+
+static void
+h_check(const char *pass, const char *seed,
+ const char *algo, const char *zero,
+ const char *one, const char *nine)
+{
+ char prn[64];
+ char data[16];
+ int i;
+
+ skey_set_algorithm(algo);
+
+ keycrunch(data, seed, pass);
+ btoa8(prn, data);
+ H_REQUIRE(prn, zero);
+
+ f(data);
+ btoa8(prn, data);
+ H_REQUIRE(prn, one);
+
+ for(i = 1; i < 99; ++i)
+ f(data);
+ btoa8(prn, data);
+ H_REQUIRE(prn, nine);
+}
+
+ATF_TC(md4);
+ATF_TC_HEAD(md4, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks MD4 algorithm");
+}
+ATF_TC_BODY(md4, tc)
+{
+ h_check("This is a test.", "TeSt", "md4", "D1854218EBBB0B51",
+ "63473EF01CD0B444", "C5E612776E6C237A");
+ h_check("AbCdEfGhIjK", "alpha1", "md4", "50076F47EB1ADE4E",
+ "65D20D1949B5F7AB", "D150C82CCE6F62D1");
+ h_check("OTP's are good", "correct", "md4", "849C79D4F6F55388",
+ "8C0992FB250847B1", "3F3BF4B4145FD74B");
+}
+
+ATF_TC(md5);
+ATF_TC_HEAD(md5, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks MD5 algorithm");
+}
+ATF_TC_BODY(md5, tc)
+{
+ h_check("This is a test.", "TeSt", "md5", "9E876134D90499DD",
+ "7965E05436F5029F", "50FE1962C4965880");
+ h_check("AbCdEfGhIjK", "alpha1", "md5", "87066DD9644BF206",
+ "7CD34C1040ADD14B", "5AA37A81F212146C");
+ h_check("OTP's are good", "correct", "md5", "F205753943DE4CF9",
+ "DDCDAC956F234937", "B203E28FA525BE47");
+}
+
+ATF_TC(sha1);
+ATF_TC_HEAD(sha1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks SHA1 algorithm");
+}
+ATF_TC_BODY(sha1, tc)
+{
+ h_check("This is a test.", "TeSt", "sha1","BB9E6AE1979D8FF4",
+ "63D936639734385B", "87FEC7768B73CCF9");
+ h_check("AbCdEfGhIjK", "alpha1", "sha1","AD85F658EBE383C9",
+ "D07CE229B5CF119B", "27BC71035AAF3DC6");
+ h_check("OTP's are good", "correct", "sha1","D51F3E99BF8E6F0B",
+ "82AEB52D943774E4", "4F296A74FE1567EC");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, md4);
+ ATF_TP_ADD_TC(tp, md5);
+ ATF_TP_ADD_TC(tp, sha1);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libsljit/t_sljit.sh b/contrib/netbsd-tests/lib/libsljit/t_sljit.sh
new file mode 100755
index 0000000..50fb860
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libsljit/t_sljit.sh
@@ -0,0 +1,45 @@
+# $NetBSD: t_sljit.sh,v 1.1 2012/11/05 00:34:28 alnsn Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Alexander Nasonov.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case sljit
+sljit_head() {
+
+ atf_set "descr" "Run sljit unit tests."
+}
+
+sljit_body() {
+
+ $(atf_get_srcdir)/h_sljit 2>&1 || atf_fail "check report"
+}
+
+atf_init_test_cases() {
+
+ atf_add_test_case sljit
+}
diff --git a/contrib/netbsd-tests/lib/libutil/t_efun.c b/contrib/netbsd-tests/lib/libutil/t_efun.c
new file mode 100644
index 0000000..f5187f2
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libutil/t_efun.c
@@ -0,0 +1,135 @@
+/* $NetBSD: t_efun.c,v 1.3 2012/11/04 23:37:02 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_efun.c,v 1.3 2012/11/04 23:37:02 christos Exp $");
+
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <util.h>
+
+static bool fail;
+static void handler(int, const char *, ...);
+
+static void
+handler(int ef, const char *fmt, ...)
+{
+ fail = false;
+}
+
+ATF_TC(ecalloc);
+ATF_TC_HEAD(ecalloc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of ecalloc(3)");
+}
+
+ATF_TC_BODY(ecalloc, tc)
+{
+ char *x;
+
+ fail = true;
+ x = ecalloc(-1, 1);
+
+ ATF_REQUIRE(x == NULL);
+ ATF_REQUIRE(fail != true);
+
+ fail = true;
+ x = ecalloc(SIZE_MAX, 2);
+
+ ATF_REQUIRE(x == NULL);
+ ATF_REQUIRE(fail != true);
+}
+
+ATF_TC(efopen);
+ATF_TC_HEAD(efopen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of efopen(3)");
+}
+
+ATF_TC_BODY(efopen, tc)
+{
+ FILE *f;
+
+ fail = true;
+ f = efopen("XXX", "XXX");
+
+ ATF_REQUIRE(f == NULL);
+ ATF_REQUIRE(fail != true);
+}
+
+ATF_TC(emalloc);
+ATF_TC_HEAD(emalloc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of emalloc(3)");
+}
+
+ATF_TC_BODY(emalloc, tc)
+{
+ char *x;
+
+ fail = true;
+ x = emalloc(-1);
+
+ ATF_REQUIRE(x == NULL);
+ ATF_REQUIRE(fail != true);
+}
+
+ATF_TC(erealloc);
+ATF_TC_HEAD(erealloc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of erealloc(3)");
+}
+
+ATF_TC_BODY(erealloc, tc)
+{
+ char *x;
+
+ fail = true;
+ x = erealloc(NULL, -1);
+
+ ATF_REQUIRE(x == NULL);
+ ATF_REQUIRE(fail != true);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_REQUIRE(esetfunc(handler) != NULL);
+
+ ATF_TP_ADD_TC(tp, ecalloc);
+ ATF_TP_ADD_TC(tp, efopen);
+ ATF_TP_ADD_TC(tp, emalloc);
+ ATF_TP_ADD_TC(tp, erealloc);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libutil/t_parsedate.c b/contrib/netbsd-tests/lib/libutil/t_parsedate.c
new file mode 100644
index 0000000..ec035a6
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libutil/t_parsedate.c
@@ -0,0 +1,142 @@
+/* $NetBSD: t_parsedate.c,v 1.7 2013/01/19 15:21:43 apb Exp $ */
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_parsedate.c,v 1.7 2013/01/19 15:21:43 apb Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <time.h>
+#include <util.h>
+
+ATF_TC(dates);
+
+ATF_TC_HEAD(dates, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test unambiguous dates"
+ " (PR lib/44255)");
+}
+
+ATF_TC_BODY(dates, tc)
+{
+
+ ATF_CHECK(parsedate("69-09-10", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("2006-11-17", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("10/1/2000", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("20 Jun 1994", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("23jun2001", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("1-sep-06", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("1/11", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("1500-01-02", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("9999-12-21", NULL, NULL) != -1);
+}
+
+ATF_TC(times);
+
+ATF_TC_HEAD(times, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test times"
+ " (PR lib/44255)");
+}
+
+ATF_TC_BODY(times, tc)
+{
+
+ ATF_CHECK(parsedate("10:01", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("10:12pm", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("12:11:01.000012", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("12:21-0500", NULL, NULL) != -1);
+}
+
+ATF_TC(relative);
+
+ATF_TC_HEAD(relative, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test relative items"
+ " (PR lib/44255)");
+}
+
+ATF_TC_BODY(relative, tc)
+{
+
+ ATF_CHECK(parsedate("-1 month", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("last friday", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("one week ago", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("this thursday", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("next sunday", NULL, NULL) != -1);
+ ATF_CHECK(parsedate("+2 years", NULL, NULL) != -1);
+}
+
+ATF_TC(atsecs);
+
+ATF_TC_HEAD(atsecs, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test seconds past the epoch");
+}
+
+ATF_TC_BODY(atsecs, tc)
+{
+ int tzoff;
+
+ /* "@0" -> (time_t)0, regardless of timezone */
+ ATF_CHECK(parsedate("@0", NULL, NULL) == (time_t)0);
+ putenv(__UNCONST("TZ=Europe/Berlin"));
+ tzset();
+ ATF_CHECK(parsedate("@0", NULL, NULL) == (time_t)0);
+ putenv(__UNCONST("TZ=America/New_York"));
+ tzset();
+ ATF_CHECK(parsedate("@0", NULL, NULL) == (time_t)0);
+ tzoff = 0;
+ ATF_CHECK(parsedate("@0", NULL, &tzoff) == (time_t)0);
+ tzoff = 3600;
+ ATF_CHECK(parsedate("@0", NULL, &tzoff) == (time_t)0);
+ tzoff = -3600;
+ ATF_CHECK(parsedate("@0", NULL, &tzoff) == (time_t)0);
+
+ /* -1 or other negative numbers are not errors */
+ errno = 0;
+ ATF_CHECK(parsedate("@-1", NULL, &tzoff) == (time_t)-1 && errno == 0);
+ ATF_CHECK(parsedate("@-2", NULL, &tzoff) == (time_t)-2 && errno == 0);
+
+ /* junk is an error */
+ errno = 0;
+ ATF_CHECK(parsedate("@junk", NULL, NULL) == (time_t)-1 && errno != 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, dates);
+ ATF_TP_ADD_TC(tp, times);
+ ATF_TP_ADD_TC(tp, relative);
+ ATF_TP_ADD_TC(tp, atsecs);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libutil/t_pidfile.c b/contrib/netbsd-tests/lib/libutil/t_pidfile.c
new file mode 100644
index 0000000..a2aff83
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libutil/t_pidfile.c
@@ -0,0 +1,363 @@
+/* $NetBSD: t_pidfile.c,v 1.3 2011/03/29 13:55:37 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2011 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file implements tests for the pidfile(3) functions.
+ *
+ * The tests here are tricky because we need to validate that the atexit(3)
+ * handler registered by pidfile(3) correctly deletes the generated pidfile.
+ * To do so:
+ * 1) We spawn a subprocess in every test case,
+ * 2) Run our test code in such subprocesses. We cannot call any of the ATF
+ * primitives from inside these.
+ * 3) Wait for the subprocess to terminate and ensure it exited successfully.
+ * 4) Check that the pidfile(s) created in the subprocess are gone.
+ *
+ * Additionally, pidfile(3) hardcodes a path to a directory writable only by
+ * root (/var/run). This makes us require root privileges to execute these
+ * tests.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2011\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_pidfile.c,v 1.3 2011/03/29 13:55:37 jmmv Exp $");
+
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#include <assert.h>
+#include <err.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <paths.h>
+#include <unistd.h>
+#include <util.h>
+
+#include <atf-c.h>
+
+/* Used by routines that can be called both from the parent and the child
+ * code to implement proper error reporting. */
+static bool in_child = false;
+
+/* Callable from the test case child code. */
+static void
+check_pidfile(const char *path)
+{
+ FILE *file;
+ int pid;
+
+ printf("Validating contents of pidfile '%s'\n", path);
+
+ if ((file = fopen(path, "r")) == NULL)
+ errx(EXIT_FAILURE, "Cannot open expected pidfile '%s'", path);
+
+ if (fscanf(file, "%d", &pid) == -1)
+ errx(EXIT_FAILURE, "Failed to read pid from pidfile '%s'",
+ path);
+
+ printf("Read pid %d, current pid %d\n", pid, getpid());
+ if (pid != getpid())
+ errx(EXIT_FAILURE, "Pid in pidfile (%d) does not match "
+ "current pid (%d)", pid, getpid());
+}
+
+/* Callable from the test case parent/child code. */
+static void
+ensure_deleted(const char *path)
+{
+ printf("Ensuring pidfile %s does not exist any more\n", path);
+ if (access(path, R_OK) != -1) {
+ unlink(path);
+ if (in_child)
+ errx(EXIT_FAILURE, "The pidfile %s was not deleted",
+ path);
+ else
+ atf_tc_fail("The pidfile %s was not deleted", path);
+ }
+}
+
+/* Callable from the test case parent code. */
+static void
+run_child(void (*child)(const char *), const char *cookie)
+{
+ pid_t pid;
+
+ pid = fork();
+ ATF_REQUIRE(pid != -1);
+ if (pid == 0) {
+ in_child = true;
+ child(cookie);
+ assert(false);
+ /* UNREACHABLE */
+ } else {
+ int status;
+
+ ATF_REQUIRE(waitpid(pid, &status, 0) != -1);
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS)
+ atf_tc_fail("See stderr for details");
+ }
+}
+
+/* Callable from the test case parent/child code. */
+static char *
+generate_varrun_pidfile(const char *basename)
+{
+ char *path;
+
+ if (asprintf(&path, "%s%s.pid", _PATH_VARRUN,
+ basename == NULL ? getprogname() : basename) == -1) {
+ if (in_child)
+ errx(EXIT_FAILURE, "Cannot allocate memory for path");
+ else
+ atf_tc_fail("Cannot allocate memory for path");
+ }
+
+ return path;
+}
+
+static void
+helper_default_path(const char *path)
+{
+
+ if (pidfile(NULL) == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile with default "
+ "basename");
+
+ check_pidfile(path);
+ exit(EXIT_SUCCESS);
+}
+
+ATF_TC(default_path);
+ATF_TC_HEAD(default_path, tc)
+{
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(default_path, tc)
+{
+ char *path;
+
+ path = generate_varrun_pidfile(NULL);
+ run_child(helper_default_path, path);
+ ensure_deleted(path);
+ free(path);
+}
+
+static void
+helper_custom_basename(const char *path)
+{
+
+ if (pidfile("custom-basename") == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile with custom "
+ "basename");
+
+ check_pidfile(path);
+ exit(EXIT_SUCCESS);
+}
+
+ATF_TC(custom_basename);
+ATF_TC_HEAD(custom_basename, tc)
+{
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(custom_basename, tc)
+{
+ char *path;
+
+ path = generate_varrun_pidfile("custom-basename");
+ run_child(helper_custom_basename, path);
+ ensure_deleted(path);
+ free(path);
+}
+
+static void
+helper_custom_path(const char *path)
+{
+
+ if (pidfile(path) == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile '%s'", path);
+ check_pidfile(path);
+ exit(EXIT_SUCCESS);
+}
+
+ATF_TC_WITHOUT_HEAD(custom_path);
+ATF_TC_BODY(custom_path, tc)
+{
+
+ ATF_REQUIRE(mkdir("var", 0777) != -1);
+ ATF_REQUIRE(mkdir("var/run", 0777) != -1);
+
+ run_child(helper_custom_path, "./var/run/my-pidfile.pid");
+
+ ensure_deleted("./var/run/my-pidfile.pid");
+}
+
+static void
+helper_change_basenames(const char *unused_cookie)
+{
+ char *default_path;
+ char *custom_path;
+
+ default_path = generate_varrun_pidfile(NULL);
+ if (pidfile(NULL) == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile with default "
+ "basename");
+ check_pidfile(default_path);
+ if (pidfile(NULL) == -1)
+ errx(EXIT_FAILURE, "Failed to recreate pidfile with default "
+ "basename");
+ check_pidfile(default_path);
+
+ custom_path = generate_varrun_pidfile("custom-basename");
+ if (pidfile("custom-basename") == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile with custom "
+ "basename");
+ ensure_deleted(default_path);
+ check_pidfile(custom_path);
+ if (pidfile("custom-basename") == -1)
+ errx(EXIT_FAILURE, "Failed to recreate pidfile with custom "
+ "basename");
+ check_pidfile(custom_path);
+
+ free(custom_path);
+ free(default_path);
+ exit(EXIT_SUCCESS);
+}
+
+ATF_TC(change_basenames);
+ATF_TC_HEAD(change_basenames, tc)
+{
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(change_basenames, tc)
+{
+ char *default_path;
+ char *custom_path;
+
+ run_child(helper_change_basenames, NULL);
+
+ default_path = generate_varrun_pidfile(NULL);
+ custom_path = generate_varrun_pidfile("custom-basename");
+
+ ensure_deleted(default_path);
+ ensure_deleted(custom_path);
+
+ free(custom_path);
+ free(default_path);
+}
+
+static void
+helper_change_paths(const char *unused_cookie)
+{
+
+ if (pidfile("./var/run/first.pid") == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile "
+ "'./var/run/first.pid'");
+ check_pidfile("./var/run/first.pid");
+
+ if (pidfile("./second.pid") == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile 'second.pid'");
+ ensure_deleted("./var/run/first.pid");
+ check_pidfile("./second.pid");
+
+ exit(EXIT_SUCCESS);
+}
+
+ATF_TC_WITHOUT_HEAD(change_paths);
+ATF_TC_BODY(change_paths, tc)
+{
+
+ ATF_REQUIRE(mkdir("var", 0777) != -1);
+ ATF_REQUIRE(mkdir("var/run", 0777) != -1);
+
+ run_child(helper_change_paths, NULL);
+
+ ensure_deleted("./var/run/my-pidfile.pid");
+ ensure_deleted("second.pid");
+}
+
+static void
+helper_mix(const char *unused_cookie)
+{
+ char *default_path;
+ char *custom_path;
+
+ default_path = generate_varrun_pidfile(NULL);
+ custom_path = generate_varrun_pidfile("custom-basename");
+
+ if (pidfile(NULL) == -1)
+ errx(EXIT_FAILURE, "Failed to create default pidfile");
+ check_pidfile(default_path);
+
+ if (pidfile("./second.pid") == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile 'second.pid'");
+ ensure_deleted(default_path);
+ check_pidfile("./second.pid");
+
+ if (pidfile("custom-basename") == -1)
+ errx(EXIT_FAILURE, "Failed to create pidfile 'second.pid'");
+ ensure_deleted(default_path);
+ ensure_deleted("./second.pid");
+ ensure_deleted("./custom-basename");
+ check_pidfile(custom_path);
+
+ free(custom_path);
+ free(default_path);
+ exit(EXIT_SUCCESS);
+}
+
+ATF_TC(change_mix);
+ATF_TC_HEAD(change_mix, tc)
+{
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(change_mix, tc)
+{
+ char *default_path;
+
+ run_child(helper_mix, NULL);
+
+ default_path = generate_varrun_pidfile(NULL);
+ ensure_deleted(default_path);
+ ensure_deleted("second.pid");
+ free(default_path);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, default_path);
+ ATF_TP_ADD_TC(tp, custom_basename);
+ ATF_TP_ADD_TC(tp, custom_path);
+ ATF_TP_ADD_TC(tp, change_basenames);
+ ATF_TP_ADD_TC(tp, change_paths);
+ ATF_TP_ADD_TC(tp, change_mix);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libutil/t_snprintb.c b/contrib/netbsd-tests/lib/libutil/t_snprintb.c
new file mode 100644
index 0000000..8863e8b
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libutil/t_snprintb.c
@@ -0,0 +1,117 @@
+/* $NetBSD: t_snprintb.c,v 1.4 2014/06/06 06:59:21 shm Exp $ */
+
+/*
+ * Copyright (c) 2002, 2004, 2008, 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code was contributed to The NetBSD Foundation by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_snprintb.c,v 1.4 2014/06/06 06:59:21 shm Exp $");
+
+#include <string.h>
+#include <util.h>
+
+#include <atf-c.h>
+
+static void
+h_snprintb(const char *fmt, uint64_t val, const char *res)
+{
+ char buf[1024];
+ int len, slen;
+
+ len = snprintb(buf, sizeof(buf), fmt, val);
+ slen = (int) strlen(res);
+
+ ATF_REQUIRE_STREQ(res, buf);
+ ATF_REQUIRE_EQ(len, slen);
+}
+
+ATF_TC(snprintb);
+ATF_TC_HEAD(snprintb, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks snprintb(3)");
+}
+ATF_TC_BODY(snprintb, tc)
+{
+ h_snprintb("\10\2BITTWO\1BITONE", 3, "03<BITTWO,BITONE>");
+ h_snprintb("\177\20b\0A\0\0", 0, "0x0");
+
+ h_snprintb("\177\20b\05NOTBOOT\0b\06FPP\0b\013SDVMA\0b\015VIDEO\0"
+ "b\020LORES\0b\021FPA\0b\022DIAG\0b\016CACHE\0"
+ "b\017IOCACHE\0b\022LOOPBACK\0b\04DBGCACHE\0",
+ 0xe860, "0xe860<NOTBOOT,FPP,SDVMA,VIDEO,CACHE,IOCACHE>");
+}
+
+static void
+h_snprintb_m(const char *fmt, uint64_t val, int line_max, const char *res,
+ int res_len)
+{
+ char buf[1024];
+ int len;
+
+ len = snprintb_m(buf, sizeof(buf), fmt, val, line_max);
+
+ ATF_REQUIRE_EQ(len, res_len);
+ ATF_REQUIRE_EQ(0, memcmp(res, buf, res_len + 1));
+}
+
+ATF_TC(snprintb_m);
+ATF_TC_HEAD(snprintb_m, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks snprintb_m(3)");
+}
+ATF_TC_BODY(snprintb_m, tc)
+{
+ h_snprintb_m("\177\020b\0LSB\0b\1_BITONE\0f\4\4NIBBLE2\0"
+ "f\x10\4BURST\0=\4FOUR\0=\xfSIXTEEN\0"
+ "b\x1fMSB\0\0",
+ 0x800f0701,
+ 33,
+ "0x800f0701<LSB,NIBBLE2=0x0>\0"
+ "0x800f0701<BURST=0xf=SIXTEEN,MSB>\0\0",
+ 62);
+
+ h_snprintb_m("\177\020b\0LSB\0b\1_BITONE\0f\4\4NIBBLE2\0"
+ "f\x10\4BURST\0=\4FOUR\0=\xfSIXTEEN\0"
+ "b\x1fMSB\0\0",
+ 0x800f0701,
+ 32,
+ "0x800f0701<LSB,NIBBLE2=0x0>\0"
+ "0x800f0701<BURST=0xf=SIXTEEN>\0"
+ "0x800f0701<MSB>\0\0",
+ 74);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, snprintb);
+ ATF_TP_ADD_TC(tp, snprintb_m);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libutil/t_sockaddr_snprintf.c b/contrib/netbsd-tests/lib/libutil/t_sockaddr_snprintf.c
new file mode 100644
index 0000000..b4e8cb3
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libutil/t_sockaddr_snprintf.c
@@ -0,0 +1,185 @@
+/* $NetBSD: t_sockaddr_snprintf.c,v 1.1 2010/07/16 13:56:32 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2002, 2004, 2008, 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code was contributed to The NetBSD Foundation by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008, 2010\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_sockaddr_snprintf.c,v 1.1 2010/07/16 13:56:32 jmmv Exp $");
+
+#include <sys/socket.h> /* AF_ */
+#include <sys/un.h> /* sun */
+
+#include <net/if_dl.h> /* sdl */
+#include <netatalk/at.h> /* sat */
+#include <netinet/in.h> /* sin/sin6 */
+
+#include <string.h>
+#include <util.h>
+
+#include <atf-c.h>
+
+ATF_TC(sockaddr_snprintf_in);
+ATF_TC_HEAD(sockaddr_snprintf_in, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks sockaddr_snprintf(3) with sockaddr_in");
+}
+ATF_TC_BODY(sockaddr_snprintf_in, tc)
+{
+ char buf[1024];
+ struct sockaddr_in sin4;
+ int i;
+
+ memset(&sin4, 0, sizeof(sin4));
+ sin4.sin_len = sizeof(sin4);
+ sin4.sin_family = AF_INET;
+ sin4.sin_port = ntohs(80);
+ sin4.sin_addr.s_addr = ntohl(INADDR_LOOPBACK);
+ i = sockaddr_snprintf(buf, sizeof(buf), "%f %l %p %a",
+ (struct sockaddr *)&sin4);
+
+ ATF_REQUIRE_EQ_MSG(i, 17, "bad length for sin4");
+ ATF_REQUIRE_STREQ(buf, "2 16 80 127.0.0.1");
+}
+
+ATF_TC(sockaddr_snprintf_in6);
+ATF_TC_HEAD(sockaddr_snprintf_in6, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks sockaddr_snprintf(3) with sockaddr_in6");
+}
+ATF_TC_BODY(sockaddr_snprintf_in6, tc)
+{
+#ifdef INET6
+ char buf[1024];
+ struct sockaddr_in6 sin6;
+ int i;
+
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_len = sizeof(sin6);
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = ntohs(80);
+ sin6.sin6_addr = in6addr_nodelocal_allnodes;
+ i = sockaddr_snprintf(buf, sizeof(buf), "%f %l %p %a",
+ (struct sockaddr *)&sin6);
+
+ ATF_REQUIRE_EQ_MSG(i, 16, "bad length for sin6");
+ ATF_REQUIRE_STREQ(buf, "24 28 80 ff01::1");
+#else
+ atf_tc_skip("Tests built with USE_INET6=no");
+#endif /* INET6 */
+}
+
+ATF_TC(sockaddr_snprintf_un);
+ATF_TC_HEAD(sockaddr_snprintf_un, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks sockaddr_snprintf(3) with sockaddr_un");
+}
+ATF_TC_BODY(sockaddr_snprintf_un, tc)
+{
+ char buf[1024];
+ struct sockaddr_un sun;
+ int i;
+
+ memset(&sun, 0, sizeof(sun));
+ sun.sun_len = sizeof(sun);
+ sun.sun_family = AF_UNIX;
+ strncpy(sun.sun_path, "/tmp/sock", sizeof(sun.sun_path));
+ i = sockaddr_snprintf(buf, sizeof(buf), "%f %l %a",
+ (struct sockaddr *)&sun);
+
+ ATF_REQUIRE_EQ_MSG(i, 15, "bad length for sun");
+ ATF_REQUIRE_STREQ(buf, "1 106 /tmp/sock");
+}
+
+ATF_TC(sockaddr_snprintf_at);
+ATF_TC_HEAD(sockaddr_snprintf_at, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks sockaddr_snprintf(3) with sockaddr_at");
+}
+ATF_TC_BODY(sockaddr_snprintf_at, tc)
+{
+ char buf[1024];
+ struct sockaddr_at sat;
+ int i;
+
+ memset(&sat, 0, sizeof(sat));
+ sat.sat_len = sizeof(sat);
+ sat.sat_family = AF_APPLETALK;
+ sat.sat_addr.s_net = ntohs(101);
+ sat.sat_addr.s_node = 3;
+ i = sockaddr_snprintf(buf, sizeof(buf), "%f %l %a",
+ (struct sockaddr *)&sat);
+
+ ATF_REQUIRE_EQ_MSG(i, 11, "bad length for sat");
+ ATF_REQUIRE_STREQ(buf, "16 16 101.3");
+}
+
+ATF_TC(sockaddr_snprintf_dl);
+ATF_TC_HEAD(sockaddr_snprintf_dl, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Checks sockaddr_snprintf(3) with sockaddr_dl");
+}
+ATF_TC_BODY(sockaddr_snprintf_dl, tc)
+{
+ char buf[1024];
+ struct sockaddr_dl sdl;
+ int i;
+
+ memset(&sdl, 0, sizeof(sdl));
+ sdl.sdl_len = sizeof(sdl);
+ sdl.sdl_family = AF_LINK;
+ sdl.sdl_index = 0;
+ sdl.sdl_type = 0;
+ sdl.sdl_nlen = 0;
+ sdl.sdl_alen = 6;
+ sdl.sdl_slen = 0;
+ memcpy(sdl.sdl_data, "\01\02\03\04\05\06", 6);
+ i = sockaddr_snprintf(buf, sizeof(buf), "%f %l %a",
+ (struct sockaddr *)&sdl);
+
+ ATF_REQUIRE_EQ_MSG(i, 17, "bad length for sdl");
+ ATF_REQUIRE_STREQ(buf, "18 20 1.2.3.4.5.6");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sockaddr_snprintf_in);
+ ATF_TP_ADD_TC(tp, sockaddr_snprintf_in6);
+ ATF_TP_ADD_TC(tp, sockaddr_snprintf_un);
+ ATF_TP_ADD_TC(tp, sockaddr_snprintf_at);
+ ATF_TP_ADD_TC(tp, sockaddr_snprintf_dl);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/semaphore/pthread/t_sem_pth.c b/contrib/netbsd-tests/lib/semaphore/pthread/t_sem_pth.c
new file mode 100644
index 0000000..b32d954
--- /dev/null
+++ b/contrib/netbsd-tests/lib/semaphore/pthread/t_sem_pth.c
@@ -0,0 +1,17 @@
+#define LIBNAME "pthread"
+#include "sem.c"
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, postwait);
+ ATF_TP_ADD_TC(tp, initvalue);
+ ATF_TP_ADD_TC(tp, destroy);
+ ATF_TP_ADD_TC(tp, busydestroy);
+ ATF_TP_ADD_TC(tp, blockwait);
+ ATF_TP_ADD_TC(tp, blocktimedwait);
+ ATF_TP_ADD_TC(tp, named);
+ ATF_TP_ADD_TC(tp, unlink);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/semaphore/sem.c b/contrib/netbsd-tests/lib/semaphore/sem.c
new file mode 100644
index 0000000..5967b88
--- /dev/null
+++ b/contrib/netbsd-tests/lib/semaphore/sem.c
@@ -0,0 +1,332 @@
+/* $NetBSD: sem.c,v 1.10 2012/03/09 14:25:34 joerg Exp $ */
+
+/*
+ * Common code for semaphore tests. This can be included both into
+ * programs using librt and libpthread.
+ */
+
+#include <sys/types.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <sched.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(postwait);
+ATF_TC_HEAD(postwait, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests post and wait from a "
+ "single thread (%s)", LIBNAME);
+}
+
+ATF_TC_BODY(postwait, tc)
+{
+ sem_t sem;
+ int rv;
+
+ rump_init();
+
+ ATF_REQUIRE_EQ(sem_init(&sem, 1, 0), 0);
+
+ sem_post(&sem);
+ sem_post(&sem);
+
+ sem_wait(&sem);
+ sem_wait(&sem);
+ rv = sem_trywait(&sem);
+ ATF_REQUIRE(errno == EAGAIN);
+ ATF_REQUIRE(rv == -1);
+}
+
+ATF_TC(initvalue);
+ATF_TC_HEAD(initvalue, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests initialization with a non-zero "
+ "value (%s)", LIBNAME);
+}
+
+ATF_TC_BODY(initvalue, tc)
+{
+ sem_t sem;
+
+ rump_init();
+ sem_init(&sem, 1, 4);
+
+ ATF_REQUIRE_EQ(sem_trywait(&sem), 0);
+ ATF_REQUIRE_EQ(sem_trywait(&sem), 0);
+ ATF_REQUIRE_EQ(sem_trywait(&sem), 0);
+ ATF_REQUIRE_EQ(sem_trywait(&sem), 0);
+ ATF_REQUIRE_EQ(sem_trywait(&sem), -1);
+}
+
+ATF_TC(destroy);
+ATF_TC_HEAD(destroy, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests sem_destroy works (%s)", LIBNAME);
+}
+
+ATF_TC_BODY(destroy, tc)
+{
+ sem_t sem;
+ int rv, i;
+
+ rump_init();
+ for (i = 0; i < 2; i++) {
+ sem_init(&sem, 1, 1);
+
+ ATF_REQUIRE_EQ(sem_trywait(&sem), 0);
+ ATF_REQUIRE_EQ(sem_trywait(&sem), -1);
+ ATF_REQUIRE_EQ(sem_destroy(&sem), 0);
+ rv = sem_trywait(&sem);
+ ATF_REQUIRE_EQ(errno, EINVAL);
+ ATF_REQUIRE_EQ(rv, -1);
+ }
+}
+
+ATF_TC(busydestroy);
+ATF_TC_HEAD(busydestroy, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests sem_destroy report EBUSY for "
+ "a busy semaphore (%s)", LIBNAME);
+}
+
+static void *
+hthread(void *arg)
+{
+ sem_t *semmarit = arg;
+
+ for (;;) {
+ sem_post(&semmarit[2]);
+ sem_wait(&semmarit[1]);
+ sem_wait(&semmarit[0]);
+ }
+
+ return NULL;
+}
+
+ATF_TC_BODY(busydestroy, tc)
+{
+ sem_t semmarit[3];
+ pthread_t pt;
+ int i;
+
+ /* use a unicpu rump kernel. this means less chance for race */
+ setenv("RUMP_NCPU", "1", 1);
+
+ rump_init();
+ sem_init(&semmarit[0], 1, 0);
+ sem_init(&semmarit[1], 1, 0);
+ sem_init(&semmarit[2], 1, 0);
+
+ pthread_create(&pt, NULL, hthread, semmarit);
+
+ /*
+ * Make a best-effort to catch the other thread with its pants down.
+ * We can't do this for sure, can we? Although, we could reach
+ * inside the rump kernel and inquire about the thread's sleep
+ * status.
+ */
+ for (i = 0; i < 1000; i++) {
+ sem_wait(&semmarit[2]);
+ usleep(1);
+ if (sem_destroy(&semmarit[1]) == -1)
+ if (errno == EBUSY)
+ break;
+
+ /*
+ * Didn't catch it? ok, recreate and post to make the
+ * other thread run
+ */
+ sem_init(&semmarit[1], 1, 0);
+ sem_post(&semmarit[0]);
+ sem_post(&semmarit[1]);
+
+ }
+ if (i == 1000)
+ atf_tc_fail("sem destroy not reporting EBUSY");
+
+ pthread_cancel(pt);
+ pthread_join(pt, NULL);
+}
+
+ATF_TC(blockwait);
+ATF_TC_HEAD(blockwait, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests sem_wait can handle blocking "
+ "(%s)", LIBNAME);
+ atf_tc_set_md_var(tc, "timeout", "2");
+}
+
+ATF_TC_BODY(blockwait, tc)
+{
+ sem_t semmarit[3];
+ pthread_t pt;
+ int i;
+
+ rump_init();
+ sem_init(&semmarit[0], 1, 0);
+ sem_init(&semmarit[1], 1, 0);
+ sem_init(&semmarit[2], 1, 0);
+
+ pthread_create(&pt, NULL, hthread, semmarit);
+
+ /*
+ * Make a best-effort. Unless we're extremely unlucky, we should
+ * at least one blocking wait.
+ */
+ for (i = 0; i < 10; i++) {
+ sem_wait(&semmarit[2]);
+ usleep(1);
+ sem_post(&semmarit[0]);
+ sem_post(&semmarit[1]);
+
+ }
+
+ pthread_cancel(pt);
+ pthread_join(pt, NULL);
+}
+
+ATF_TC(blocktimedwait);
+ATF_TC_HEAD(blocktimedwait, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests sem_timedwait can handle blocking"
+ " (%s)", LIBNAME);
+ atf_tc_set_md_var(tc, "timeout", "2");
+}
+
+ATF_TC_BODY(blocktimedwait, tc)
+{
+ sem_t semid;
+ struct timespec tp;
+
+ rump_init();
+
+ clock_gettime(CLOCK_REALTIME, &tp);
+ tp.tv_nsec += 50000000;
+ tp.tv_sec += tp.tv_nsec / 1000000000;
+ tp.tv_nsec %= 1000000000;
+
+ ATF_REQUIRE_EQ(sem_init(&semid, 1, 0), 0);
+ ATF_REQUIRE_ERRNO(ETIMEDOUT, sem_timedwait(&semid, &tp) == -1);
+}
+
+ATF_TC(named);
+ATF_TC_HEAD(named, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests named semaphores (%s)", LIBNAME);
+}
+
+/*
+ * Wow, easy naming rules. it's these times i'm really happy i can
+ * single-step into the kernel.
+ */
+#define SEM1 "/precious_sem"
+#define SEM2 "/justsem"
+ATF_TC_BODY(named, tc)
+{
+ sem_t *sem1, *sem2;
+ void *rv;
+
+ rump_init();
+ sem1 = sem_open(SEM1, 0);
+ ATF_REQUIRE_EQ(errno, ENOENT);
+ ATF_REQUIRE_EQ(sem1, NULL);
+
+ sem1 = sem_open(SEM1, O_CREAT, 0444, 1);
+ if (sem1 == NULL)
+ atf_tc_fail_errno("sem_open O_CREAT");
+
+ rv = sem_open(SEM1, O_CREAT | O_EXCL);
+ ATF_REQUIRE_EQ(errno, EEXIST);
+ ATF_REQUIRE_EQ(rv, NULL);
+
+ sem2 = sem_open(SEM2, O_CREAT, 0444, 0);
+ if (sem2 == NULL)
+ atf_tc_fail_errno("sem_open O_CREAT");
+
+ /* check that semaphores are independent */
+ ATF_REQUIRE_EQ(sem_trywait(sem2), -1);
+ ATF_REQUIRE_EQ(sem_trywait(sem1), 0);
+ ATF_REQUIRE_EQ(sem_trywait(sem1), -1);
+
+ /* check that unlinked remains valid */
+ sem_unlink(SEM2);
+ ATF_REQUIRE_EQ(sem_post(sem2), 0);
+ ATF_REQUIRE_EQ(sem_trywait(sem2), 0);
+ ATF_REQUIRE_EQ(sem_trywait(sem2), -1);
+ ATF_REQUIRE_EQ(errno, EAGAIN);
+
+#if 0 /* see unlink */
+ /* close it and check that it's gone */
+ if (sem_close(sem2) != 0)
+ atf_tc_fail_errno("sem close");
+ ATF_REQUIRE_EQ(sem_trywait(sem2), -1);
+ ATF_REQUIRE_EQ(errno, EINVAL);
+#endif
+
+ /* check that we still have sem1 */
+ sem_post(sem1);
+ ATF_REQUIRE_EQ(sem_trywait(sem1), 0);
+ ATF_REQUIRE_EQ(sem_trywait(sem1), -1);
+ ATF_REQUIRE_EQ(errno, EAGAIN);
+}
+
+ATF_TC(unlink);
+ATF_TC_HEAD(unlink, tc)
+{
+
+ /* this is currently broken. i'll append the PR number soon */
+ atf_tc_set_md_var(tc, "descr", "tests unlinked semaphores can be "
+ "closed (%s)", LIBNAME);
+}
+
+#define SEM "/thesem"
+ATF_TC_BODY(unlink, tc)
+{
+ sem_t *sem;
+
+ rump_init();
+ sem = sem_open(SEM, O_CREAT, 0444, 0);
+ ATF_REQUIRE(sem);
+
+ if (sem_unlink(SEM) == -1)
+ atf_tc_fail_errno("unlink");
+ if (sem_close(sem) == -1)
+ atf_tc_fail_errno("close unlinked semaphore");
+}
+
+/* use rump calls for libpthread _ksem_foo() calls */
+#define F1(name, a) int _ksem_##name(a); \
+int _ksem_##name(a v1) {return rump_sys__ksem_##name(v1);}
+#define F2(name, a, b) int _ksem_##name(a, b); \
+int _ksem_##name(a v1, b v2) {return rump_sys__ksem_##name(v1, v2);}
+F2(init, unsigned int, intptr_t *);
+F1(close, intptr_t);
+F1(destroy, intptr_t);
+F1(post, intptr_t);
+F1(unlink, const char *);
+F1(trywait, intptr_t);
+F1(wait, intptr_t);
+F2(getvalue, intptr_t, unsigned int *);
+F2(timedwait, intptr_t, const struct timespec *);
+int _ksem_open(const char *, int, mode_t, unsigned int, intptr_t *);
+int _ksem_open(const char *a, int b, mode_t c, unsigned int d, intptr_t *e)
+ {return rump_sys__ksem_open(a,b,c,d,e);}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v0 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v0
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v0
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v1 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v1
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v2 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v0-v2
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v0 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v0
new file mode 100644
index 0000000..8cfcf27
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v0
@@ -0,0 +1 @@
+/usr/tests/libexec/ld.elf_so/h_helper_symver_dso0/libh_helper_symver_dso.so.1: version V_1 required by /usr/tests/libexec/ld.elf_so/h_dl_symver_v1 not defined
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v1 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v1
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v2 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v1-v2
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v0 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v0
new file mode 100644
index 0000000..e43fc56
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v0
@@ -0,0 +1 @@
+/usr/tests/libexec/ld.elf_so/h_helper_symver_dso0/libh_helper_symver_dso.so.1: version V_3 required by /usr/tests/libexec/ld.elf_so/h_dl_symver_v2 not defined
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v1 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v1
new file mode 100644
index 0000000..494c321
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v1
@@ -0,0 +1 @@
+/usr/tests/libexec/ld.elf_so/h_helper_symver_dso1/libh_helper_symver_dso.so.1: version V_3 required by /usr/tests/libexec/ld.elf_so/h_dl_symver_v2 not found
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v2 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stderr.v2-v2
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v0 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v0
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v0
@@ -0,0 +1 @@
+0
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v1 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v1
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v1
@@ -0,0 +1 @@
+1
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v2 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v2
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v0-v2
@@ -0,0 +1 @@
+1
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v0 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v0
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v0
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v1 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v1
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v1
@@ -0,0 +1 @@
+1
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v2 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v2
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v1-v2
@@ -0,0 +1 @@
+1
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v0 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v0
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v0
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v1 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v1
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v2 b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v2
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/data/symver-output-ref-stdout.v2-v2
@@ -0,0 +1 @@
+3
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/h_df_1_noopen.c b/contrib/netbsd-tests/libexec/ld.elf_so/h_df_1_noopen.c
new file mode 100644
index 0000000..518f39b
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/h_df_1_noopen.c
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <dlfcn.h>
+#include <err.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+ void *handle;
+
+ handle = dlopen("libpthread.so", RTLD_NOLOAD);
+ if (handle == NULL)
+ errx(1, "%s", dlerror());
+
+ printf("libpthread loaded successfully\n");
+ return 0;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/h_dl_symver.c b/contrib/netbsd-tests/libexec/ld.elf_so/h_dl_symver.c
new file mode 100644
index 0000000..71e4dc1
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/h_dl_symver.c
@@ -0,0 +1,42 @@
+/* $NetBSD: h_dl_symver.c,v 1.1 2011/06/25 05:45:13 nonaka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by NONAKA Kimihiro.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+
+extern int testfunc(void);
+
+int
+main(void)
+{
+
+ printf("%d\n", testfunc());
+ return 0;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/h_ifunc.c b/contrib/netbsd-tests/libexec/ld.elf_so/h_ifunc.c
new file mode 100644
index 0000000..ac446fa
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/h_ifunc.c
@@ -0,0 +1,43 @@
+/* $NetBSD: h_ifunc.c,v 1.1 2014/08/25 20:40:53 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+
+extern int ifunc(void);
+
+int
+main(int argc, char **argv)
+{
+
+ if (argc != 2)
+ return 1;
+ return ifunc() != atoi(argv[1]);
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/h_locking.c b/contrib/netbsd-tests/libexec/ld.elf_so/h_locking.c
new file mode 100644
index 0000000..4ff3fc4
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/h_locking.c
@@ -0,0 +1,149 @@
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <dlfcn.h>
+#include <link_elf.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+int sleep_init;
+int sleep_fini;
+int dlopen_cookie;
+int dlclose_cookie;
+
+void (*tls_callback_sym)(void);
+
+static int
+dl_iterate_phdr_cb(struct dl_phdr_info *info, size_t size, void *data)
+{
+ (*tls_callback_sym)();
+ return 0;
+}
+
+static void *
+test_dl_iterate_phdr_helper(void *dummy)
+{
+ sleep(10);
+ _exit(1);
+}
+
+static void
+test_dl_iterate_phdr(void)
+{
+ pthread_t t;
+ void *dso;
+ sleep_init = 0;
+ sleep_fini = 0;
+ if ((dso = dlopen("libh_helper_dso2.so", RTLD_LAZY)) == NULL) {
+ fprintf(stderr, "opening helper failed\n");
+ _exit(1);
+ }
+ tls_callback_sym = dlsym(dso, "tls_callback");
+ if (tls_callback_sym == NULL) {
+ fprintf(stderr, "bad helper\n");
+ _exit(1);
+ }
+ pthread_create(&t, NULL, test_dl_iterate_phdr_helper, NULL);
+ if (dl_iterate_phdr(dl_iterate_phdr_cb, NULL))
+ _exit(1);
+ _exit(0);
+}
+
+static void *
+init_fini_helper(void *arg)
+{
+ void *dso;
+ if ((dso = dlopen(arg, RTLD_LAZY)) == NULL) {
+ fprintf(stderr, "opening %s failed\n", (char *)arg);
+ exit(1);
+ }
+ dlclose(dso);
+ return NULL;
+}
+
+static void
+test_dlopen(void)
+{
+ pthread_t t1, t2;
+ sleep_init = 1;
+ sleep_fini = 0;
+ printf("%d\n", dlopen_cookie);
+ pthread_create(&t1, NULL, init_fini_helper,
+ __UNCONST("libh_helper_dso2.so"));
+ sleep(1);
+ printf("%d\n", dlopen_cookie);
+ if (dlopen_cookie != 1)
+ _exit(1);
+ sleep(1);
+ pthread_create(&t2, NULL, init_fini_helper,
+ __UNCONST("libutil.so"));
+ printf("%d\n", dlopen_cookie);
+ if (dlopen_cookie != 1)
+ _exit(1);
+ _exit(0);
+}
+
+static void
+test_dlclose(void)
+{
+ pthread_t t1, t2;
+ sleep_init = 0;
+ sleep_fini = 1;
+ printf("%d\n", dlclose_cookie);
+ pthread_create(&t1, NULL, init_fini_helper,
+ __UNCONST("libh_helper_dso2.so"));
+ sleep(1);
+ printf("%d\n", dlclose_cookie);
+ if (dlclose_cookie != 2)
+ _exit(1);
+ pthread_create(&t2, NULL, init_fini_helper,
+ __UNCONST("libutil.so"));
+ sleep(1);
+ printf("%d\n", dlclose_cookie);
+ if (dlclose_cookie != 2)
+ _exit(1);
+ _exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ if (argc != 2)
+ return 1;
+ if (strcmp(argv[1], "dl_iterate_phdr") == 0)
+ test_dl_iterate_phdr();
+ if (strcmp(argv[1], "dlopen") == 0)
+ test_dlopen();
+ if (strcmp(argv[1], "dlclose") == 0)
+ test_dlclose();
+ return 1;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c b/contrib/netbsd-tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c
new file mode 100644
index 0000000..e89e3ff
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <poll.h>
+#include <stddef.h>
+#include <sys/tls.h>
+
+#ifdef __HAVE_NO___THREAD
+#define __thread
+#endif
+
+extern int sleep_init;
+extern int sleep_fini;
+extern int dlopen_cookie;
+
+static void __attribute__((__constructor__))
+init1(void)
+{
+ dlopen_cookie = 1;
+ if (!sleep_init)
+ return;
+ for (;;)
+ poll(NULL, 0, -1);
+}
+
+extern int dlclose_cookie;
+
+static void __attribute__((__destructor__))
+fini1(void)
+{
+ dlclose_cookie = 1;
+ if (!sleep_fini)
+ return;
+ for (;;)
+ poll(NULL, 0, -1);
+}
+
+static __thread int tls_callback_var;
+
+static void __attribute__((__used__))
+tls_callback(void)
+{
+ tls_callback_var = 1;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/helper_dso2/h_helper_dso2.c b/contrib/netbsd-tests/libexec/ld.elf_so/helper_dso2/h_helper_dso2.c
new file mode 100644
index 0000000..adeef6b
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/helper_dso2/h_helper_dso2.c
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <poll.h>
+#include <stddef.h>
+
+extern int sleep_init;
+extern int sleep_fini;
+extern int dlopen_cookie;
+
+static void __attribute__((__constructor__))
+init2(void)
+{
+ dlopen_cookie = 2;
+ if (!sleep_init)
+ return;
+ for (;;)
+ poll(NULL, 0, -1);
+}
+
+extern int dlclose_cookie;
+
+static void __attribute__((__destructor__))
+fini2(void)
+{
+ dlclose_cookie = 2;
+ if (!sleep_fini)
+ return;
+ for (;;)
+ poll(NULL, 0, -1);
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c b/contrib/netbsd-tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c
new file mode 100644
index 0000000..c04f775
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+static int
+ifunc1(void)
+{
+ return 0xdeadbeef;
+}
+
+static int
+ifunc2(void)
+{
+ return 0xbeefdead;
+}
+
+static __attribute__((used))
+int (*resolve_ifunc(void))(void)
+{
+ const char *e = getenv("USE_IFUNC2");
+ return e && strcmp(e, "1") == 0 ? ifunc2 : ifunc1;
+}
+
+__ifunc(ifunc, resolve_ifunc);
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso0/h_helper_symver_dso0.c b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso0/h_helper_symver_dso0.c
new file mode 100644
index 0000000..a34bf31
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso0/h_helper_symver_dso0.c
@@ -0,0 +1,39 @@
+/* $NetBSD: h_helper_symver_dso0.c,v 1.1 2011/06/25 05:45:13 nonaka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by NONAKA Kimihiro.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+int testfunc(void);
+
+int
+testfunc(void)
+{
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/h_helper_symver_dso1.c b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/h_helper_symver_dso1.c
new file mode 100644
index 0000000..615816b
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/h_helper_symver_dso1.c
@@ -0,0 +1,41 @@
+/* $NetBSD: h_helper_symver_dso1.c,v 1.1 2011/06/25 05:45:13 nonaka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by NONAKA Kimihiro.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+__asm(".symver testfunc_new, testfunc@@V_1");
+
+int testfunc_new(void);
+
+int
+testfunc_new(void)
+{
+
+ return 1;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/h_helper_symver_dso1.map b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/h_helper_symver_dso1.map
new file mode 100644
index 0000000..c813f5d
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/h_helper_symver_dso1.map
@@ -0,0 +1,5 @@
+# $NetBSD: h_helper_symver_dso1.map,v 1.1 2011/06/25 05:45:13 nonaka Exp $
+
+V_1 {
+ testfunc;
+};
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/h_helper_symver_dso2.c b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/h_helper_symver_dso2.c
new file mode 100644
index 0000000..f5ae4c8
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/h_helper_symver_dso2.c
@@ -0,0 +1,59 @@
+/* $NetBSD: h_helper_symver_dso2.c,v 1.1 2011/06/25 05:45:13 nonaka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by NONAKA Kimihiro.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+__asm(".symver testfunc_new, testfunc@@V_3");
+__asm(".symver testfunc_compat1, testfunc@V_1");
+__asm(".symver testfunc_compat2, testfunc@V_2");
+
+int testfunc_new(void);
+int testfunc_compat1(void);
+int testfunc_compat2(void);
+
+int
+testfunc_new(void)
+{
+
+ return 3;
+}
+
+int
+testfunc_compat1(void)
+{
+
+ return 1;
+}
+
+int
+testfunc_compat2(void)
+{
+
+ return 2;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/h_helper_symver_dso2.map b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/h_helper_symver_dso2.map
new file mode 100644
index 0000000..518c76b
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/h_helper_symver_dso2.map
@@ -0,0 +1,13 @@
+# $NetBSD: h_helper_symver_dso2.map,v 1.1 2011/06/25 05:45:13 nonaka Exp $
+
+V_1 {
+ testfunc;
+};
+
+V_2 {
+ testfunc;
+};
+
+V_3 {
+ testfunc;
+};
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_df_1_noopen.sh b/contrib/netbsd-tests/libexec/ld.elf_so/t_df_1_noopen.sh
new file mode 100755
index 0000000..31851f4
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/t_df_1_noopen.sh
@@ -0,0 +1,63 @@
+# $NetBSD: t_df_1_noopen.sh,v 1.3 2011/03/17 15:59:32 skrll Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Nick Hudson.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case df_1_noopen1
+df_1_noopen1_head()
+{
+ atf_set "descr" "Checks DF_1_NOOPEN prevents dlopening of library"
+}
+df_1_noopen1_body()
+{
+ cat >expout <<EOF
+h_df_1_noopen1: Cannot dlopen non-loadable /usr/lib/libpthread.so
+EOF
+
+ atf_check -s exit:1 -e file:expout "$(atf_get_srcdir)/h_df_1_noopen1"
+}
+
+atf_test_case df_1_noopen2
+df_1_noopen2_head()
+{
+ atf_set "descr" "Checks DF_1_NOOPEN is allowed on already loaded library"
+}
+df_1_noopen2_body()
+{
+ cat >expout <<EOF
+libpthread loaded successfully
+EOF
+
+ atf_check -o file:expout "$(atf_get_srcdir)/h_df_1_noopen2"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case df_1_noopen1
+ atf_add_test_case df_1_noopen2
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_dl_symver.sh b/contrib/netbsd-tests/libexec/ld.elf_so/t_dl_symver.sh
new file mode 100755
index 0000000..afca0f6
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/t_dl_symver.sh
@@ -0,0 +1,55 @@
+# $NetBSD: t_dl_symver.sh,v 1.1 2011/06/25 05:45:13 nonaka Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by NONAKA Kimihiro.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+datadir() {
+ echo "$(atf_get_srcdir)/data"
+}
+
+atf_test_case dl_symver
+dl_symver_head()
+{
+ atf_set "descr" "Checks ELF symbol versioning functions"
+}
+dl_symver_body()
+{
+ for tv in 0 1 2; do
+ for lv in 0 1 2; do
+ atf_check -s ignore \
+ -o file:$(datadir)/symver-output-ref-stdout.v$tv-v$lv \
+ -e file:$(datadir)/symver-output-ref-stderr.v$tv-v$lv \
+ -x "LD_LIBRARY_PATH=$(atf_get_srcdir)/h_helper_symver_dso$lv $(atf_get_srcdir)/h_dl_symver_v$tv"
+ done
+ done
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case dl_symver
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_dlerror-cleared.c b/contrib/netbsd-tests/libexec/ld.elf_so/t_dlerror-cleared.c
new file mode 100644
index 0000000..03940c2
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/t_dlerror-cleared.c
@@ -0,0 +1,67 @@
+/* $NetBSD: t_dlerror-cleared.c,v 1.1 2010/12/14 05:57:32 skrll Exp $ */
+
+/*
+ * Copyright (c) 2009 The NetBSD Foundation, 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 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/types.h>
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <link_elf.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(rtld_dlerror_cleared);
+ATF_TC_HEAD(rtld_dlerror_cleared, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "error set by dlopen persists past a successful dlopen call");
+}
+
+ATF_TC_BODY(rtld_dlerror_cleared, tc)
+{
+ void *handle;
+ char *error;
+
+ /*
+ * Test that an error set by dlopen() persists past a successful
+ * dlopen() call.
+ */
+ handle = dlopen("libnonexistent.so", RTLD_LAZY);
+ ATF_CHECK(handle == NULL);
+ handle = dlopen("libm.so", RTLD_NOW);
+ ATF_CHECK(handle);
+ error = dlerror();
+ ATF_CHECK(error);
+
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, rtld_dlerror_cleared);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_dlerror-false.c b/contrib/netbsd-tests/libexec/ld.elf_so/t_dlerror-false.c
new file mode 100644
index 0000000..8b80c26
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/t_dlerror-false.c
@@ -0,0 +1,79 @@
+/* $NetBSD: t_dlerror-false.c,v 1.1 2010/12/14 05:57:32 skrll Exp $ */
+
+/*
+ * Copyright (c) 2009 The NetBSD Foundation, 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 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/types.h>
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <link_elf.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(rtld_dlerror_false);
+ATF_TC_HEAD(rtld_dlerror_false, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "error set by dlopen persists past a successful dlopen call");
+}
+
+ATF_TC_BODY(rtld_dlerror_false, tc)
+{
+ void *handle, *sym;
+ char *error;
+
+ /*
+ *
+ * Test for dlerror() being set by a successful library open.
+ * Requires that the rpath be set to something that does not
+ * include libm.so.
+ */
+
+ handle = dlopen("libm.so", RTLD_LAZY);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+ ATF_CHECK(handle != NULL);
+
+ sym = dlsym(handle, "sin");
+ error = dlerror();
+ ATF_CHECK(sym != NULL);
+ ATF_CHECK(error == NULL);
+
+ dlclose(handle);
+ error = dlerror();
+
+ ATF_CHECK(error == NULL);
+
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, rtld_dlerror_false);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_dlinfo.c b/contrib/netbsd-tests/libexec/ld.elf_so/t_dlinfo.c
new file mode 100644
index 0000000..a15ba5d
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/t_dlinfo.c
@@ -0,0 +1,120 @@
+/* $NetBSD: t_dlinfo.c,v 1.4 2011/03/25 14:47:31 pooka Exp $ */
+
+/*
+ * Copyright (c) 2009 The NetBSD Foundation, 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 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/types.h>
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <link_elf.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(rtld_dlinfo_linkmap_self);
+ATF_TC_HEAD(rtld_dlinfo_linkmap_self, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "dlinfo with RTLD_SELF handle works");
+}
+ATF_TC_BODY(rtld_dlinfo_linkmap_self, tc)
+{
+ struct link_map *map;
+ int rv;
+
+ rv = dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &map);
+ ATF_CHECK_EQ(rv, 0);
+ ATF_CHECK((strstr(map->l_name, "t_dlinfo") != NULL));
+}
+
+ATF_TC(rtld_dlinfo_linkmap_inval);
+ATF_TC_HEAD(rtld_dlinfo_linkmap_inval, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "dlinfo with invalid handle fails");
+}
+ATF_TC_BODY(rtld_dlinfo_linkmap_inval, tc)
+{
+ void *v;
+ int rv;
+
+ rv = dlinfo(NULL, RTLD_DI_LINKMAP, &v);
+ ATF_CHECK_EQ(rv, -1);
+}
+
+ATF_TC(rtld_dlinfo_linkmap_dlopen);
+ATF_TC_HEAD(rtld_dlinfo_linkmap_dlopen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "dlinfo dlopen'd handle works");
+}
+ATF_TC_BODY(rtld_dlinfo_linkmap_dlopen, tc)
+{
+ struct link_map *map;
+ void *handle;
+ int rv;
+
+ handle = dlopen("libutil.so", RTLD_LAZY);
+ ATF_CHECK(handle);
+
+ rv = dlinfo(handle, RTLD_DI_LINKMAP, &map);
+ ATF_CHECK_EQ(rv, 0);
+ ATF_CHECK((strstr(map->l_name, "libutil.so") != NULL));
+ dlclose(handle);
+}
+
+ATF_TC(rtld_dlinfo_linkmap_dlopen_iter);
+ATF_TC_HEAD(rtld_dlinfo_linkmap_dlopen_iter, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "dlopen'd dso's show up in the list");
+}
+ATF_TC_BODY(rtld_dlinfo_linkmap_dlopen_iter, tc)
+{
+ struct link_map *map;
+ void *handle;
+
+ handle = dlopen("libutil.so", RTLD_LAZY);
+ ATF_CHECK(handle);
+
+ RZ(dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &map));
+
+ for (; map->l_next; map = map->l_next)
+ continue;
+ for (; map; map = map->l_prev)
+ if (strstr(map->l_name, "libutil.so") != NULL)
+ break;
+
+ ATF_REQUIRE_MSG(map, "dlopen()d object not found from linkmap");
+ ATF_REQUIRE_MSG(dlopen(map->l_name, RTLD_LAZY) != NULL,
+ "could not dlopen() name in linkmap");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, rtld_dlinfo_linkmap_self);
+ ATF_TP_ADD_TC(tp, rtld_dlinfo_linkmap_inval);
+ ATF_TP_ADD_TC(tp, rtld_dlinfo_linkmap_dlopen);
+ ATF_TP_ADD_TC(tp, rtld_dlinfo_linkmap_dlopen_iter);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_dlvsym.c b/contrib/netbsd-tests/libexec/ld.elf_so/t_dlvsym.c
new file mode 100644
index 0000000..ce437d4
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/t_dlvsym.c
@@ -0,0 +1,203 @@
+/* $NetBSD: t_dlvsym.c,v 1.1 2011/06/25 05:45:13 nonaka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by NONAKA Kimihiro.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+
+#include <atf-c.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+ATF_TC(rtld_dlvsym_v1);
+ATF_TC_HEAD(rtld_dlvsym_v1, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check dlvsym() function (V_1)");
+}
+ATF_TC_BODY(rtld_dlvsym_v1, tc)
+{
+ void *handle;
+ char *error;
+ int (*sym)(void);
+ int result;
+
+ /* Clear previous error */
+ (void) dlerror();
+
+ handle = dlopen("libh_helper_symver_dso.so", RTLD_LAZY);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+ ATF_CHECK(handle != NULL);
+
+ sym = dlvsym(handle, "testfunc", "V_1");
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+
+ result = (*sym)();
+ ATF_CHECK(result == 1);
+
+ dlclose(handle);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+}
+
+ATF_TC(rtld_dlvsym_v3);
+ATF_TC_HEAD(rtld_dlvsym_v3, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check dlvsym() function (V_3)");
+}
+ATF_TC_BODY(rtld_dlvsym_v3, tc)
+{
+ void *handle;
+ char *error;
+ int (*sym)(void);
+ int result;
+
+ /* Clear previous error */
+ (void) dlerror();
+
+ handle = dlopen("libh_helper_symver_dso.so", RTLD_LAZY);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+ ATF_CHECK(handle != NULL);
+
+ sym = dlvsym(handle, "testfunc", "V_3");
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+
+ result = (*sym)();
+ ATF_CHECK(result == 3);
+
+ dlclose(handle);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+}
+
+ATF_TC(rtld_dlvsym_symbol_nonexistent);
+ATF_TC_HEAD(rtld_dlvsym_symbol_nonexistent, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Check dlvsym() function (symbol is nonexistent)");
+}
+ATF_TC_BODY(rtld_dlvsym_symbol_nonexistent, tc)
+{
+ void *handle;
+ char *error;
+ int (*sym)(void);
+
+ /* Clear previous error */
+ (void) dlerror();
+
+ handle = dlopen("libh_helper_symver_dso.so", RTLD_LAZY);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+ ATF_CHECK(handle != NULL);
+
+ sym = dlvsym(handle, "symbol_nonexistent", "V_3");
+ error = dlerror();
+ ATF_CHECK(sym == NULL);
+ ATF_CHECK(error != NULL);
+
+ dlclose(handle);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+}
+
+ATF_TC(rtld_dlvsym_version_nonexistent);
+ATF_TC_HEAD(rtld_dlvsym_version_nonexistent, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Check dlvsym() function (version is nonexistent)");
+}
+ATF_TC_BODY(rtld_dlvsym_version_nonexistent, tc)
+{
+ void *handle;
+ char *error;
+ int (*sym)(void);
+
+ /* Clear previous error */
+ (void) dlerror();
+
+ handle = dlopen("libh_helper_symver_dso.so", RTLD_LAZY);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+ ATF_CHECK(handle != NULL);
+
+ sym = dlvsym(handle, "testfunc", "");
+ error = dlerror();
+ ATF_CHECK(sym == NULL);
+ ATF_CHECK(error != NULL);
+
+ dlclose(handle);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+}
+
+ATF_TC(rtld_dlvsym_version_null);
+ATF_TC_HEAD(rtld_dlvsym_version_null, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Check dlvsym() function (version is NULL)");
+}
+ATF_TC_BODY(rtld_dlvsym_version_null, tc)
+{
+ void *handle;
+ char *error;
+ int (*sym)(void);
+ int result;
+
+ /* Clear previous error */
+ (void) dlerror();
+
+ handle = dlopen("libh_helper_symver_dso.so", RTLD_LAZY);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+ ATF_CHECK(handle != NULL);
+
+ sym = dlvsym(handle, "testfunc", NULL);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+
+ result = (*sym)();
+ ATF_CHECK(result == 3);
+
+ dlclose(handle);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, rtld_dlvsym_v1);
+ ATF_TP_ADD_TC(tp, rtld_dlvsym_v3);
+ ATF_TP_ADD_TC(tp, rtld_dlvsym_symbol_nonexistent);
+ ATF_TP_ADD_TC(tp, rtld_dlvsym_version_nonexistent);
+ ATF_TP_ADD_TC(tp, rtld_dlvsym_version_null);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_ifunc.c b/contrib/netbsd-tests/libexec/ld.elf_so/t_ifunc.c
new file mode 100644
index 0000000..1c85672
--- /dev/null
+++ b/contrib/netbsd-tests/libexec/ld.elf_so/t_ifunc.c
@@ -0,0 +1,92 @@
+/* $NetBSD: t_ifunc.c,v 1.1 2014/08/25 20:40:53 joerg Exp $ */
+
+/*
+ * Copyright (c) 2014 The NetBSD Foundation, 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 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/types.h>
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <util.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(rtld_ifunc);
+
+ATF_TC_HEAD(rtld_ifunc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "ifunc functions are resolved");
+}
+
+ATF_TC_BODY(rtld_ifunc, tc)
+{
+ const char *envstr[] = {
+ "0", "1"
+ };
+ int expected_result[] = {
+ 0xdeadbeef, 0xbeefdead
+ };
+ void *handle;
+ int (*sym)(void);
+ int result;
+ const char *error;
+ size_t i;
+
+ for (i = 0; i < __arraycount(envstr); ++i) {
+ setenv("USE_IFUNC2", envstr[i], 1);
+
+ handle = dlopen("libh_helper_ifunc_dso.so", RTLD_LAZY);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+ ATF_CHECK(handle != NULL);
+
+ sym = dlsym(handle, "ifunc");
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+ ATF_CHECK(sym != NULL);
+
+ result = (*sym)();
+ ATF_CHECK(result == expected_result[i]);
+
+ dlclose(handle);
+ error = dlerror();
+ ATF_CHECK(error == NULL);
+
+ char *command;
+ easprintf(&command, "%s/h_ifunc %d",
+ atf_tc_get_config_var(tc, "srcdir"), expected_result[i]);
+ if (system(command) != EXIT_SUCCESS)
+ atf_tc_fail("Test failed; see output for details");
+ free(command);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, rtld_ifunc);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/modules/k_helper/k_helper.c b/contrib/netbsd-tests/modules/k_helper/k_helper.c
new file mode 100644
index 0000000..6a54ccd
--- /dev/null
+++ b/contrib/netbsd-tests/modules/k_helper/k_helper.c
@@ -0,0 +1,202 @@
+/* $NetBSD: k_helper.c,v 1.6 2012/06/03 10:59:44 dsl Exp $ */
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: k_helper.c,v 1.6 2012/06/03 10:59:44 dsl Exp $");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <prop/proplib.h>
+
+MODULE(MODULE_CLASS_MISC, k_helper, NULL);
+
+/* --------------------------------------------------------------------- */
+/* Sysctl interface to query information about the module. */
+/* --------------------------------------------------------------------- */
+
+/* TODO: Change the integer variables below that represent booleans to
+ * bools, once sysctl(8) supports CTLTYPE_BOOL nodes. */
+
+static struct sysctllog *clogp;
+static int present = 1;
+static int prop_str_ok;
+static char prop_str_val[128];
+static int prop_int_ok;
+static int64_t prop_int_val;
+static int prop_int_load;
+
+#define K_HELPER 0x12345678
+#define K_HELPER_PRESENT 0
+#define K_HELPER_PROP_STR_OK 1
+#define K_HELPER_PROP_STR_VAL 2
+#define K_HELPER_PROP_INT_OK 3
+#define K_HELPER_PROP_INT_VAL 4
+#define K_HELPER_PROP_INT_LOAD 5
+
+SYSCTL_SETUP(sysctl_k_helper_setup, "sysctl k_helper subtree setup")
+{
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_NODE, "k_helper", NULL,
+ NULL, 0, NULL, 0,
+ CTL_VENDOR, K_HELPER, CTL_EOL);
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "present",
+ SYSCTL_DESCR("Whether the module was loaded or not"),
+ NULL, 0, &present, 0,
+ CTL_VENDOR, K_HELPER, K_HELPER_PRESENT, CTL_EOL);
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "prop_str_ok",
+ SYSCTL_DESCR("String property's validity"),
+ NULL, 0, &prop_str_ok, 0,
+ CTL_VENDOR, K_HELPER, K_HELPER_PROP_STR_OK, CTL_EOL);
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_STRING, "prop_str_val",
+ SYSCTL_DESCR("String property's value"),
+ NULL, 0, prop_str_val, 0,
+ CTL_VENDOR, K_HELPER, K_HELPER_PROP_STR_VAL, CTL_EOL);
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "prop_int_ok",
+ SYSCTL_DESCR("String property's validity"),
+ NULL, 0, &prop_int_ok, 0,
+ CTL_VENDOR, K_HELPER, K_HELPER_PROP_INT_OK, CTL_EOL);
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_QUAD, "prop_int_val",
+ SYSCTL_DESCR("String property's value"),
+ NULL, 0, &prop_int_val, 0,
+ CTL_VENDOR, K_HELPER, K_HELPER_PROP_INT_VAL, CTL_EOL);
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "prop_int_load",
+ SYSCTL_DESCR("Status of recursive modload"),
+ NULL, 0, &prop_int_load, 0,
+ CTL_VENDOR, K_HELPER, K_HELPER_PROP_INT_LOAD, CTL_EOL);
+}
+
+/* --------------------------------------------------------------------- */
+/* Module management. */
+/* --------------------------------------------------------------------- */
+
+static
+int
+k_helper_init(prop_dictionary_t props)
+{
+ prop_object_t p;
+
+ p = prop_dictionary_get(props, "prop_str");
+ if (p == NULL)
+ prop_str_ok = 0;
+ else if (prop_object_type(p) != PROP_TYPE_STRING)
+ prop_str_ok = 0;
+ else {
+ const char *msg = prop_string_cstring_nocopy(p);
+ if (msg == NULL)
+ prop_str_ok = 0;
+ else {
+ strlcpy(prop_str_val, msg, sizeof(prop_str_val));
+ prop_str_ok = 1;
+ }
+ }
+ if (!prop_str_ok)
+ strlcpy(prop_str_val, "", sizeof(prop_str_val));
+
+ p = prop_dictionary_get(props, "prop_int");
+ if (p == NULL)
+ prop_int_ok = 0;
+ else if (prop_object_type(p) != PROP_TYPE_NUMBER)
+ prop_int_ok = 0;
+ else {
+ prop_int_val = prop_number_integer_value(p);
+ prop_int_ok = 1;
+ }
+ if (!prop_int_ok)
+ prop_int_val = -1;
+
+ p = prop_dictionary_get(props, "prop_recurse");
+ if (p != NULL && prop_object_type(p) == PROP_TYPE_STRING) {
+ const char *recurse_name = prop_string_cstring_nocopy(p);
+ if (recurse_name != NULL)
+ prop_int_load = module_load(recurse_name,
+ MODCTL_NO_PROP, NULL, MODULE_CLASS_ANY);
+ else
+ prop_int_load = -1;
+ } else
+ prop_int_load = -2;
+
+ sysctl_k_helper_setup(&clogp);
+
+ return 0;
+}
+
+static
+int
+k_helper_fini(void *arg)
+{
+
+ sysctl_teardown(&clogp);
+
+ return 0;
+}
+
+static
+int
+k_helper_modcmd(modcmd_t cmd, void *arg)
+{
+ int ret;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ ret = k_helper_init(arg);
+ break;
+
+ case MODULE_CMD_FINI:
+ ret = k_helper_fini(arg);
+ break;
+
+ case MODULE_CMD_STAT:
+ default:
+ ret = ENOTTY;
+ }
+
+ return ret;
+}
diff --git a/contrib/netbsd-tests/modules/k_helper2/k_helper2.c b/contrib/netbsd-tests/modules/k_helper2/k_helper2.c
new file mode 100644
index 0000000..286b25a
--- /dev/null
+++ b/contrib/netbsd-tests/modules/k_helper2/k_helper2.c
@@ -0,0 +1,115 @@
+/* $NetBSD: k_helper2.c,v 1.2 2010/11/03 16:10:23 christos Exp $ */
+/*
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: k_helper2.c,v 1.2 2010/11/03 16:10:23 christos Exp $");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <prop/proplib.h>
+
+MODULE(MODULE_CLASS_MISC, k_helper2, NULL);
+
+/* --------------------------------------------------------------------- */
+/* Sysctl interface to query information about the module. */
+/* --------------------------------------------------------------------- */
+
+/* TODO: Change the integer variables below that represent booleans to
+ * bools, once sysctl(8) supports CTLTYPE_BOOL nodes. */
+
+static struct sysctllog *clogp;
+static int present = 1;
+
+#define K_HELPER2 0x23456781
+#define K_HELPER_PRESENT 0
+
+SYSCTL_SETUP(sysctl_k_helper2_setup, "sysctl k_helper subtree setup")
+{
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_NODE, "k_helper2", NULL,
+ NULL, 0, NULL, 0,
+ CTL_VENDOR, K_HELPER2, CTL_EOL);
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "present",
+ SYSCTL_DESCR("Whether the module was loaded or not"),
+ NULL, 0, &present, 0,
+ CTL_VENDOR, K_HELPER2, K_HELPER_PRESENT, CTL_EOL);
+}
+
+/* --------------------------------------------------------------------- */
+/* Module management. */
+/* --------------------------------------------------------------------- */
+
+static
+int
+k_helper2_init(prop_dictionary_t props)
+{
+ sysctl_k_helper2_setup(&clogp);
+
+ return 0;
+}
+
+static
+int
+k_helper2_fini(void *arg)
+{
+
+ sysctl_teardown(&clogp);
+
+ return 0;
+}
+
+static
+int
+k_helper2_modcmd(modcmd_t cmd, void *arg)
+{
+ int ret;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ ret = k_helper2_init(arg);
+ break;
+
+ case MODULE_CMD_FINI:
+ ret = k_helper2_fini(arg);
+ break;
+
+ case MODULE_CMD_STAT:
+ default:
+ ret = ENOTTY;
+ }
+
+ return ret;
+}
diff --git a/contrib/netbsd-tests/modules/k_helper3/k_helper3.c b/contrib/netbsd-tests/modules/k_helper3/k_helper3.c
new file mode 100644
index 0000000..4e0984d
--- /dev/null
+++ b/contrib/netbsd-tests/modules/k_helper3/k_helper3.c
@@ -0,0 +1,102 @@
+/* $NetBSD: k_helper3.c,v 1.3 2012/04/17 21:39:19 martin Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: k_helper3.c,v 1.3 2012/04/17 21:39:19 martin Exp $");
+
+#include <sys/module.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <prop/proplib.h>
+
+static int load(const char *, ...);
+
+/*
+ * A program that loads a module and returns the errno(2) from modctl(8).
+ */
+int
+main(int argc, char *argv[])
+{
+ assert(argc == 3);
+
+ return load(argv[1], argv[2]);
+}
+
+static __printflike(1, 2) int
+load(const char *fmt, ...)
+{
+ char filename[MAXPATHLEN], *propsstr, *shortname, *dot;
+ prop_dictionary_t props;
+ modctl_load_t ml;
+ int serrno, rv;
+ va_list ap;
+
+ props = prop_dictionary_create();
+ propsstr = prop_dictionary_externalize(props);
+ assert(propsstr != NULL);
+ prop_object_release(props);
+
+ va_start(ap, fmt);
+ (void)vsnprintf(filename, sizeof(filename), fmt, ap);
+ va_end(ap);
+
+ ml.ml_filename = filename;
+ ml.ml_flags = 0;
+ ml.ml_props = propsstr;
+ ml.ml_propslen = strlen(propsstr);
+
+ printf("Loading module %s\n", filename);
+ errno = serrno = 0;
+
+ rv = modctl(MODCTL_LOAD, &ml);
+
+ if (rv != 0)
+ serrno = errno;
+
+ shortname = strrchr(filename, '/');
+ if (shortname != NULL)
+ shortname++;
+ else
+ shortname = filename;
+ dot = strrchr(shortname, '.');
+ if (dot)
+ *dot = 0;
+ (void)modctl(MODCTL_UNLOAD, shortname);
+
+ free(propsstr);
+
+ return serrno;
+}
diff --git a/contrib/netbsd-tests/modules/k_uvm/k_uvm.c b/contrib/netbsd-tests/modules/k_uvm/k_uvm.c
new file mode 100644
index 0000000..7f8d3b0
--- /dev/null
+++ b/contrib/netbsd-tests/modules/k_uvm/k_uvm.c
@@ -0,0 +1,113 @@
+/* $NetBSD: k_uvm.c,v 1.1 2012/02/17 22:36:50 jmmv Exp $ */
+/*
+ * Copyright (c) 2012 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: k_uvm.c,v 1.1 2012/02/17 22:36:50 jmmv Exp $");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+MODULE(MODULE_CLASS_MISC, k_uvm, NULL);
+
+/* --------------------------------------------------------------------- */
+/* Sysctl interface to query information about the module. */
+/* --------------------------------------------------------------------- */
+
+static struct sysctllog *clogp;
+static int page_size;
+
+#define K_UVM 0x12345678
+#define K_UVM_VALUE 0
+
+SYSCTL_SETUP(sysctl_k_uvm_setup, "sysctl k_uvm subtree setup")
+{
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_NODE, "k_uvm", NULL,
+ NULL, 0, NULL, 0,
+ CTL_VENDOR, K_UVM, CTL_EOL);
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "page_size",
+ SYSCTL_DESCR("Value of PAGE_SIZE"),
+ NULL, 0, &page_size, 0,
+ CTL_VENDOR, K_UVM, K_UVM_VALUE, CTL_EOL);
+}
+
+/* --------------------------------------------------------------------- */
+/* Module management. */
+/* --------------------------------------------------------------------- */
+
+static
+int
+k_uvm_init(prop_dictionary_t props)
+{
+
+ page_size = PAGE_SIZE;
+
+ sysctl_k_uvm_setup(&clogp);
+
+ return 0;
+}
+
+static
+int
+k_uvm_fini(void *arg)
+{
+
+ sysctl_teardown(&clogp);
+
+ return 0;
+}
+
+static
+int
+k_uvm_modcmd(modcmd_t cmd, void *arg)
+{
+ int ret;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ ret = k_uvm_init(arg);
+ break;
+
+ case MODULE_CMD_FINI:
+ ret = k_uvm_fini(arg);
+ break;
+
+ case MODULE_CMD_STAT:
+ default:
+ ret = ENOTTY;
+ }
+
+ return ret;
+}
diff --git a/contrib/netbsd-tests/modules/t_abi_uvm.sh b/contrib/netbsd-tests/modules/t_abi_uvm.sh
new file mode 100755
index 0000000..b855bc8
--- /dev/null
+++ b/contrib/netbsd-tests/modules/t_abi_uvm.sh
@@ -0,0 +1,70 @@
+# $NetBSD: t_abi_uvm.sh,v 1.3 2012/04/20 05:41:25 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case PAGE_SIZE cleanup
+PAGE_SIZE_head() {
+ atf_set "descr" "Ensures that modules have access to PAGE_SIZE"
+ atf_set "require.user" "root"
+}
+PAGE_SIZE_body() {
+
+ # XXX: Adjust when modctl(8) fails consistently.
+ #
+ $(atf_get_srcdir)/k_helper3 \
+ "%s/k_helper/k_helper.kmod" $(atf_get_srcdir)
+
+ if [ $? -eq 1 ] || [ $? -eq 78 ]; then
+ atf_skip "host does not support modules"
+ fi
+
+ if modload $(atf_get_srcdir)/k_uvm/k_uvm.kmod; then
+ :
+ else
+ case "$(uname -m)" in
+ macppc)
+ atf_expect_fail "PR port-macppc/46041"
+ ;;
+ esac
+ atf_fail "Failed to load k_uvm; missing uvmexp_pagesize?"
+ fi
+
+ kernel_pagesize="$(sysctl -n hw.pagesize || echo fail1)"
+ module_pagesize="$(sysctl -n vendor.k_uvm.page_size || echo fail2)"
+ echo "Kernel PAGE_SIZE: ${kernel_pagesize}"
+ echo "Module PAGE_SIZE: ${module_pagesize}"
+ atf_check_equal "${kernel_pagesize}" "${module_pagesize}"
+
+ atf_check -s eq:0 -o empty -e empty modunload k_uvm
+}
+PAGE_SIZE_cleanup() {
+ modunload k_uvm >/dev/null 2>&1 || true
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case PAGE_SIZE
+}
diff --git a/contrib/netbsd-tests/modules/t_builtin.c b/contrib/netbsd-tests/modules/t_builtin.c
new file mode 100644
index 0000000..0d9a3f0
--- /dev/null
+++ b/contrib/netbsd-tests/modules/t_builtin.c
@@ -0,0 +1,194 @@
+/* $NetBSD: t_builtin.c,v 1.2 2010/11/03 16:10:23 christos Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+#include <sys/module.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdbool.h>
+
+#include <miscfs/kernfs/kernfs.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../h_macros.h"
+
+#define MYMP "/mnt"
+#define HZFILE MYMP "/hz"
+
+static char kernfs[] = "kernfs";
+
+static bool
+check_kernfs(void)
+{
+ char buf[16];
+ bool rv = true;
+ int fd;
+
+ fd = rump_sys_open(HZFILE, O_RDONLY);
+ if (fd == -1)
+ return false;
+ if (rump_sys_read(fd, buf, sizeof(buf)) < 1)
+ rv = false;
+ RL(rump_sys_close(fd));
+
+ return rv;
+}
+
+ATF_TC(disable);
+ATF_TC_HEAD(disable, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests that builtin modules can "
+ "be disabled");
+}
+
+ATF_TC_BODY(disable, tc)
+{
+
+ rump_init();
+ RL(rump_sys_mkdir(MYMP, 0777));
+ RL(rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0));
+ ATF_REQUIRE(check_kernfs());
+ RL(rump_sys_unmount(MYMP, 0));
+ RL(rump_sys_modctl(MODCTL_UNLOAD, kernfs));
+}
+
+ATF_TC(noauto);
+ATF_TC_HEAD(noauto, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests that disabled builtin modules "
+ "will not autoload");
+}
+
+ATF_TC_BODY(noauto, tc)
+{
+
+ rump_init();
+ RL(rump_sys_mkdir(MYMP, 0777));
+
+ RL(rump_sys_modctl(MODCTL_UNLOAD, kernfs));
+
+ ATF_REQUIRE_ERRNO(ENODEV,
+ rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0) == -1);
+}
+
+ATF_TC(forcereload);
+ATF_TC_HEAD(forcereload, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests that disabled builtin modules "
+ "can be force-reloaded");
+}
+
+ATF_TC_BODY(forcereload, tc)
+{
+ struct modctl_load mod;
+
+ rump_init();
+ RL(rump_sys_mkdir(MYMP, 0777));
+
+ RL(rump_sys_modctl(MODCTL_UNLOAD, kernfs));
+ ATF_REQUIRE_ERRNO(ENODEV,
+ rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0) == -1);
+
+ memset(&mod, 0, sizeof(mod));
+ mod.ml_filename = kernfs;
+ mod.ml_flags = MODCTL_LOAD_FORCE;
+
+ RL(rump_sys_modctl(MODCTL_LOAD, &mod));
+
+ RL(rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0));
+ ATF_REQUIRE(check_kernfs());
+ RL(rump_sys_unmount(MYMP, 0));
+}
+
+ATF_TC(disabledstat);
+ATF_TC_HEAD(disabledstat, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests that disabled builtin modules "
+ "show up in modstat with refcount -1");
+}
+
+ATF_TC_BODY(disabledstat, tc)
+{
+ struct modstat ms[128];
+ struct iovec iov;
+ size_t i;
+ bool found = false;
+
+ rump_init();
+ RL(rump_sys_mkdir(MYMP, 0777));
+
+ RL(rump_sys_modctl(MODCTL_UNLOAD, kernfs));
+
+ iov.iov_base = ms;
+ iov.iov_len = sizeof(ms);
+ RL(rump_sys_modctl(MODCTL_STAT, &iov));
+
+ for (i = 0; i < __arraycount(ms); i++) {
+ if (strcmp(ms[i].ms_name, kernfs) == 0) {
+ ATF_REQUIRE_EQ(ms[i].ms_refcnt, (u_int)-1);
+ found = 1;
+ break;
+ }
+ }
+ ATF_REQUIRE(found);
+}
+
+ATF_TC(busydisable);
+ATF_TC_HEAD(busydisable, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests that busy builtin modules "
+ "cannot be disabled");
+}
+
+ATF_TC_BODY(busydisable, tc)
+{
+
+ rump_init();
+ RL(rump_sys_mkdir(MYMP, 0777));
+ RL(rump_sys_mount(MOUNT_KERNFS, MYMP, 0, NULL, 0));
+ ATF_REQUIRE(check_kernfs());
+ ATF_REQUIRE_ERRNO(EBUSY,
+ rump_sys_modctl(MODCTL_UNLOAD, kernfs) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, disable);
+ ATF_TP_ADD_TC(tp, noauto);
+ ATF_TP_ADD_TC(tp, forcereload);
+ ATF_TP_ADD_TC(tp, disabledstat);
+ ATF_TP_ADD_TC(tp, busydisable);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/modules/t_modctl.c b/contrib/netbsd-tests/modules/t_modctl.c
new file mode 100644
index 0000000..50cd907
--- /dev/null
+++ b/contrib/netbsd-tests/modules/t_modctl.c
@@ -0,0 +1,493 @@
+/* $NetBSD: t_modctl.c,v 1.12 2012/08/20 08:07:52 martin Exp $ */
+/*
+ * Copyright (c) 2008 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: t_modctl.c,v 1.12 2012/08/20 08:07:52 martin Exp $");
+
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <prop/proplib.h>
+
+#include <atf-c.h>
+
+enum presence_check { both_checks, stat_check, sysctl_check };
+
+static void check_permission(void);
+static bool get_modstat_info(const char *, modstat_t *);
+static bool get_sysctl(const char *, void *buf, const size_t);
+static bool k_helper_is_present_stat(void);
+static bool k_helper_is_present_sysctl(void);
+static bool k_helper_is_present(enum presence_check);
+static int load(prop_dictionary_t, bool, const char *, ...);
+static int unload(const char *, bool);
+static void unload_cleanup(const char *);
+
+/* --------------------------------------------------------------------- */
+/* Auxiliary functions */
+/* --------------------------------------------------------------------- */
+
+/*
+ * A function checking wether we are allowed to load modules currently
+ * (either the kernel is not modular, or securelevel may prevent it)
+ */
+static void
+check_permission(void)
+{
+ int err;
+
+ err = modctl(MODCTL_EXISTS, 0);
+ if (err == 0) return;
+ if (errno == ENOSYS)
+ atf_tc_skip("Kernel does not have 'options MODULAR'.");
+ else if (errno == EPERM)
+ atf_tc_skip("Module loading administratively forbidden");
+ ATF_REQUIRE_EQ_MSG(errno, 0, "unexpected error %d from "
+ "modctl(MODCTL_EXISTS, 0)", errno);
+}
+
+static bool
+get_modstat_info(const char *name, modstat_t *msdest)
+{
+ bool found;
+ size_t len;
+ struct iovec iov;
+ modstat_t *ms;
+
+ check_permission();
+ for (len = 4096; ;) {
+ iov.iov_base = malloc(len);
+ iov.iov_len = len;
+
+ errno = 0;
+
+ if (modctl(MODCTL_STAT, &iov) != 0) {
+ int err = errno;
+ fprintf(stderr, "modctl(MODCTL_STAT) failed: %s\n",
+ strerror(err));
+ atf_tc_fail("Failed to query module status");
+ }
+ if (len >= iov.iov_len)
+ break;
+ free(iov.iov_base);
+ len = iov.iov_len;
+ }
+
+ found = false;
+ len = iov.iov_len / sizeof(modstat_t);
+ for (ms = (modstat_t *)iov.iov_base; len != 0 && !found;
+ ms++, len--) {
+ if (strcmp(ms->ms_name, name) == 0) {
+ if (msdest != NULL)
+ *msdest = *ms;
+ found = true;
+ }
+ }
+
+ free(iov.iov_base);
+
+ return found;
+}
+
+/*
+ * Queries a sysctl property.
+ */
+static bool
+get_sysctl(const char *name, void *buf, const size_t len)
+{
+ size_t len2 = len;
+ printf("Querying sysctl variable: %s\n", name);
+ int ret = sysctlbyname(name, buf, &len2, NULL, 0);
+ if (ret == -1 && errno != ENOENT) {
+ fprintf(stderr, "sysctlbyname(2) failed: %s\n",
+ strerror(errno));
+ atf_tc_fail("Failed to query %s", name);
+ }
+ return ret != -1;
+}
+
+/*
+ * Returns a boolean indicating if the k_helper module was loaded
+ * successfully. This implementation uses modctl(2)'s MODCTL_STAT
+ * subcommand to do the check.
+ */
+static bool
+k_helper_is_present_stat(void)
+{
+
+ return get_modstat_info("k_helper", NULL);
+}
+
+/*
+ * Returns a boolean indicating if the k_helper module was loaded
+ * successfully. This implementation uses the module's sysctl
+ * installed node to do the check.
+ */
+static bool
+k_helper_is_present_sysctl(void)
+{
+ size_t present;
+
+ return get_sysctl("vendor.k_helper.present", &present,
+ sizeof(present));
+}
+
+/*
+ * Returns a boolean indicating if the k_helper module was loaded
+ * successfully. The 'how' parameter specifies the implementation to
+ * use to do the check.
+ */
+static bool
+k_helper_is_present(enum presence_check how)
+{
+ bool found;
+
+ switch (how) {
+ case both_checks:
+ found = k_helper_is_present_stat();
+ ATF_CHECK(k_helper_is_present_sysctl() == found);
+ break;
+
+ case stat_check:
+ found = k_helper_is_present_stat();
+ break;
+
+ case sysctl_check:
+ found = k_helper_is_present_sysctl();
+ break;
+
+ default:
+ found = false;
+ assert(found);
+ }
+
+ return found;
+}
+
+/*
+ * Loads the specified module from a file. If fatal is set and an error
+ * occurs when loading the module, an error message is printed and the
+ * test case is aborted.
+ */
+static __printflike(3, 4) int
+load(prop_dictionary_t props, bool fatal, const char *fmt, ...)
+{
+ int err;
+ va_list ap;
+ char filename[MAXPATHLEN], *propsstr;
+ modctl_load_t ml;
+
+ check_permission();
+ if (props == NULL) {
+ props = prop_dictionary_create();
+ propsstr = prop_dictionary_externalize(props);
+ ATF_CHECK(propsstr != NULL);
+ prop_object_release(props);
+ } else {
+ propsstr = prop_dictionary_externalize(props);
+ ATF_CHECK(propsstr != NULL);
+ }
+
+ va_start(ap, fmt);
+ vsnprintf(filename, sizeof(filename), fmt, ap);
+ va_end(ap);
+
+ ml.ml_filename = filename;
+ ml.ml_flags = 0;
+ ml.ml_props = propsstr;
+ ml.ml_propslen = strlen(propsstr);
+
+ printf("Loading module %s\n", filename);
+ errno = err = 0;
+
+ if (modctl(MODCTL_LOAD, &ml) == -1) {
+ err = errno;
+ fprintf(stderr, "modctl(MODCTL_LOAD, %s), failed: %s\n",
+ filename, strerror(err));
+ if (fatal)
+ atf_tc_fail("Module load failed");
+ }
+
+ free(propsstr);
+
+ return err;
+}
+
+/*
+ * Unloads the specified module. If silent is true, nothing will be
+ * printed and no errors will be raised if the unload was unsuccessful.
+ */
+static int
+unload(const char *name, bool fatal)
+{
+ int err;
+
+ check_permission();
+ printf("Unloading module %s\n", name);
+ errno = err = 0;
+
+ if (modctl(MODCTL_UNLOAD, __UNCONST(name)) == -1) {
+ err = errno;
+ fprintf(stderr, "modctl(MODCTL_UNLOAD, %s) failed: %s\n",
+ name, strerror(err));
+ if (fatal)
+ atf_tc_fail("Module unload failed");
+ }
+ return err;
+}
+
+/*
+ * A silent version of unload, to be called as part of the cleanup
+ * process only.
+ */
+static void
+unload_cleanup(const char *name)
+{
+
+ (void)modctl(MODCTL_UNLOAD, __UNCONST(name));
+}
+
+/* --------------------------------------------------------------------- */
+/* Test cases */
+/* --------------------------------------------------------------------- */
+
+ATF_TC_WITH_CLEANUP(cmd_load);
+ATF_TC_HEAD(cmd_load, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests for the MODCTL_LOAD command");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(cmd_load, tc)
+{
+ char longname[MAXPATHLEN];
+ size_t i;
+
+ ATF_CHECK(load(NULL, false, " ") == ENOENT);
+ ATF_CHECK(load(NULL, false, "non-existent.o") == ENOENT);
+
+ for (i = 0; i < MAXPATHLEN - 1; i++)
+ longname[i] = 'a';
+ longname[MAXPATHLEN - 1] = '\0';
+ ATF_CHECK(load(NULL, false, "%s", longname) == ENAMETOOLONG);
+
+ ATF_CHECK(!k_helper_is_present(stat_check));
+ load(NULL, true, "%s/k_helper/k_helper.kmod",
+ atf_tc_get_config_var(tc, "srcdir"));
+ printf("Checking if load was successful\n");
+ ATF_CHECK(k_helper_is_present(stat_check));
+}
+ATF_TC_CLEANUP(cmd_load, tc)
+{
+ unload_cleanup("k_helper");
+}
+
+ATF_TC_WITH_CLEANUP(cmd_load_props);
+ATF_TC_HEAD(cmd_load_props, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests for the MODCTL_LOAD command, "
+ "providing extra load-time properties");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(cmd_load_props, tc)
+{
+ prop_dictionary_t props;
+
+ printf("Loading module without properties\n");
+ props = prop_dictionary_create();
+ load(props, true, "%s/k_helper/k_helper.kmod",
+ atf_tc_get_config_var(tc, "srcdir"));
+ prop_object_release(props);
+ {
+ int ok;
+ ATF_CHECK(get_sysctl("vendor.k_helper.prop_str_ok",
+ &ok, sizeof(ok)));
+ ATF_CHECK(!ok);
+ }
+ unload("k_helper", true);
+
+ printf("Loading module with a string property\n");
+ props = prop_dictionary_create();
+ prop_dictionary_set(props, "prop_str",
+ prop_string_create_cstring("1st string"));
+ load(props, true, "%s/k_helper/k_helper.kmod",
+ atf_tc_get_config_var(tc, "srcdir"));
+ prop_object_release(props);
+ {
+ int ok;
+ ATF_CHECK(get_sysctl("vendor.k_helper.prop_str_ok",
+ &ok, sizeof(ok)));
+ ATF_CHECK(ok);
+
+ char val[128];
+ ATF_CHECK(get_sysctl("vendor.k_helper.prop_str_val",
+ &val, sizeof(val)));
+ ATF_CHECK(strcmp(val, "1st string") == 0);
+ }
+ unload("k_helper", true);
+
+ printf("Loading module with a different string property\n");
+ props = prop_dictionary_create();
+ prop_dictionary_set(props, "prop_str",
+ prop_string_create_cstring("2nd string"));
+ load(props, true, "%s/k_helper/k_helper.kmod",
+ atf_tc_get_config_var(tc, "srcdir"));
+ prop_object_release(props);
+ {
+ int ok;
+ ATF_CHECK(get_sysctl("vendor.k_helper.prop_str_ok",
+ &ok, sizeof(ok)));
+ ATF_CHECK(ok);
+
+ char val[128];
+ ATF_CHECK(get_sysctl("vendor.k_helper.prop_str_val",
+ &val, sizeof(val)));
+ ATF_CHECK(strcmp(val, "2nd string") == 0);
+ }
+ unload("k_helper", true);
+}
+ATF_TC_CLEANUP(cmd_load_props, tc)
+{
+ unload_cleanup("k_helper");
+}
+
+ATF_TC_WITH_CLEANUP(cmd_load_recurse);
+ATF_TC_HEAD(cmd_load_recurse, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests for the MODCTL_LOAD command, "
+ "with recursive module_load()");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(cmd_load_recurse, tc)
+{
+ prop_dictionary_t props;
+ char filename[MAXPATHLEN];
+
+ printf("Loading module with request to load another module\n");
+ props = prop_dictionary_create();
+ snprintf(filename, sizeof(filename), "%s/k_helper2/k_helper2.kmod",
+ atf_tc_get_config_var(tc, "srcdir"));
+ prop_dictionary_set(props, "prop_recurse",
+ prop_string_create_cstring(filename));
+ load(props, true, "%s/k_helper/k_helper.kmod",
+ atf_tc_get_config_var(tc, "srcdir"));
+ {
+ int ok;
+ ATF_CHECK(get_sysctl("vendor.k_helper.prop_int_load",
+ &ok, sizeof(ok)));
+ ATF_CHECK(ok == 0);
+ ATF_CHECK(get_sysctl("vendor.k_helper2.present",
+ &ok, sizeof(ok)));
+ ATF_CHECK(ok);
+ }
+ unload("k_helper", true);
+ unload("k_helper2", true);
+}
+ATF_TC_CLEANUP(cmd_load_recurse, tc)
+{
+ unload_cleanup("k_helper");
+ unload_cleanup("k_helper2");
+}
+
+ATF_TC_WITH_CLEANUP(cmd_stat);
+ATF_TC_HEAD(cmd_stat, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests for the MODCTL_STAT command");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(cmd_stat, tc)
+{
+ ATF_CHECK(!k_helper_is_present(both_checks));
+
+ load(NULL, true, "%s/k_helper/k_helper.kmod",
+ atf_tc_get_config_var(tc, "srcdir"));
+ ATF_CHECK(k_helper_is_present(both_checks));
+ {
+ modstat_t ms;
+ ATF_CHECK(get_modstat_info("k_helper", &ms));
+
+ ATF_CHECK(ms.ms_class == MODULE_CLASS_MISC);
+ ATF_CHECK(ms.ms_source == MODULE_SOURCE_FILESYS);
+ ATF_CHECK(ms.ms_refcnt == 0);
+ }
+ unload("k_helper", true);
+
+ ATF_CHECK(!k_helper_is_present(both_checks));
+}
+ATF_TC_CLEANUP(cmd_stat, tc)
+{
+ unload_cleanup("k_helper");
+}
+
+ATF_TC_WITH_CLEANUP(cmd_unload);
+ATF_TC_HEAD(cmd_unload, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Tests for the MODCTL_UNLOAD command");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(cmd_unload, tc)
+{
+ load(NULL, true, "%s/k_helper/k_helper.kmod",
+ atf_tc_get_config_var(tc, "srcdir"));
+
+ ATF_CHECK(unload("", false) == ENOENT);
+ ATF_CHECK(unload("non-existent.kmod", false) == ENOENT);
+ ATF_CHECK(unload("k_helper.kmod", false) == ENOENT);
+
+ ATF_CHECK(k_helper_is_present(stat_check));
+ unload("k_helper", true);
+ printf("Checking if unload was successful\n");
+ ATF_CHECK(!k_helper_is_present(stat_check));
+}
+ATF_TC_CLEANUP(cmd_unload, tc)
+{
+ unload_cleanup("k_helper");
+}
+
+/* --------------------------------------------------------------------- */
+/* Main */
+/* --------------------------------------------------------------------- */
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, cmd_load);
+ ATF_TP_ADD_TC(tp, cmd_load_props);
+ ATF_TP_ADD_TC(tp, cmd_stat);
+ ATF_TP_ADD_TC(tp, cmd_load_recurse);
+ ATF_TP_ADD_TC(tp, cmd_unload);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/modules/t_modload.sh b/contrib/netbsd-tests/modules/t_modload.sh
new file mode 100755
index 0000000..561bb6f
--- /dev/null
+++ b/contrib/netbsd-tests/modules/t_modload.sh
@@ -0,0 +1,205 @@
+# $NetBSD: t_modload.sh,v 1.13 2012/04/20 05:41:25 jruoho Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+check_sysctl() {
+ echo "${1} = ${2}" >expout
+ atf_check -s eq:0 -o file:expout -e empty sysctl ${1}
+}
+
+atf_test_case plain cleanup
+plain_head() {
+ atf_set "descr" "Test load without arguments"
+ atf_set "require.user" "root"
+}
+plain_body() {
+
+ # XXX: Adjust when modctl(8) fails consistently.
+ #
+ $(atf_get_srcdir)/k_helper3 \
+ "%s/k_helper/k_helper.kmod" $(atf_get_srcdir)
+
+ if [ $? -eq 1 ] || [ $? -eq 78 ]; then
+ atf_skip "host does not support modules"
+ fi
+
+ cat >experr <<EOF
+modload: No such file or directory
+EOF
+ atf_check -s eq:1 -o empty -e ignore modload non-existent.o
+
+ atf_check -s eq:0 -o empty -e empty \
+ modload $(atf_get_srcdir)/k_helper/k_helper.kmod
+ check_sysctl vendor.k_helper.present 1
+ check_sysctl vendor.k_helper.prop_int_ok 0
+ check_sysctl vendor.k_helper.prop_str_ok 0
+ atf_check -s eq:0 -o empty -e empty modunload k_helper
+ touch done
+}
+plain_cleanup() {
+ test -f done || modunload k_helper >/dev/null 2>&1
+}
+
+atf_test_case bflag cleanup
+bflag_head() {
+ atf_set "descr" "Test the -b flag"
+ atf_set "require.user" "root"
+}
+bflag_body() {
+ echo "Checking error conditions"
+
+ atf_check -s eq:1 -o empty -e save:stderr \
+ modload -b foo k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid parameter.*foo' stderr
+
+ atf_check -s eq:1 -o empty -e save:stderr \
+ modload -b foo= k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid boolean value' stderr
+
+ atf_check -s eq:1 -o empty -e save:stderr \
+ modload -b foo=bar k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid boolean value.*bar' stderr
+
+ atf_check -s eq:1 -o empty -e save:stderr \
+ modload -b foo=falsea k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid boolean value.*falsea' stderr
+
+ atf_check -s eq:1 -o empty -e save:stderr \
+ modload -b foo=truea k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid boolean value.*truea' stderr
+
+ # TODO Once sysctl(8) supports CTLTYPE_BOOL nodes.
+ #echo "Checking valid values"
+}
+bflag_cleanup() {
+ modunload k_helper >/dev/null 2>&1 || true
+}
+
+atf_test_case iflag cleanup
+iflag_head() {
+ atf_set "descr" "Test the -i flag"
+ atf_set "require.user" "root"
+}
+iflag_body() {
+
+ # XXX: Adjust when modctl(8) fails consistently.
+ #
+ $(atf_get_srcdir)/k_helper3 \
+ "%s/k_helper/k_helper.kmod" $(atf_get_srcdir)
+
+ if [ $? -eq 1 ] || [ $? -eq 78 ]; then
+ atf_skip "host does not support modules"
+ fi
+
+ echo "Checking error conditions"
+
+ atf_check -s eq:1 -o empty -e save:stderr modload -i foo \
+ k_helper/k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid parameter.*foo' stderr
+
+ atf_check -s eq:1 -o empty -e save:stderr modload -i foo= \
+ k_helper/k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid integer value' stderr
+
+ atf_check -s eq:1 -o empty -e save:stderr \
+ modload -i foo=bar k_helper/k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid integer value.*bar' stderr
+
+ atf_check -s eq:1 -o empty -e save:stderr \
+ modload -i foo=123a k_helper/k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid integer value.*123a' stderr
+
+ echo "Checking valid values"
+
+ for v in 5 10; do
+ atf_check -s eq:0 -o empty -e empty \
+ modload -i prop_int="${v}" \
+ $(atf_get_srcdir)/k_helper/k_helper.kmod
+ check_sysctl vendor.k_helper.prop_int_ok 1
+ check_sysctl vendor.k_helper.prop_int_val "${v}"
+ atf_check -s eq:0 -o empty -e empty modunload k_helper
+ done
+ touch done
+}
+iflag_cleanup() {
+ test -f done || modunload k_helper >/dev/null 2>&1
+}
+
+atf_test_case sflag cleanup
+sflag_head() {
+ atf_set "descr" "Test the -s flag"
+ atf_set "require.user" "root"
+}
+sflag_body() {
+
+ # XXX: Adjust when modctl(8) fails consistently.
+ #
+ $(atf_get_srcdir)/k_helper3 \
+ "%s/k_helper/k_helper.kmod" $(atf_get_srcdir)
+
+ if [ $? -eq 1 ] || [ $? -eq 78 ]; then
+ atf_skip "host does not support modules"
+ fi
+
+ echo "Checking error conditions"
+
+ atf_check -s eq:1 -o empty -e save:stderr modload -s foo \
+ k_helper/k_helper.kmod
+ atf_check -s eq:0 -o ignore -e empty \
+ grep 'Invalid parameter.*foo' stderr
+
+ echo "Checking valid values"
+
+ for v in '1st string' '2nd string'; do
+ atf_check -s eq:0 -o empty -e empty \
+ modload -s prop_str="${v}" \
+ $(atf_get_srcdir)/k_helper/k_helper.kmod
+ check_sysctl vendor.k_helper.prop_str_ok 1
+ check_sysctl vendor.k_helper.prop_str_val "${v}"
+ atf_check -s eq:0 -o empty -e empty modunload k_helper
+ done
+ touch done
+}
+sflag_cleanup() {
+ test -f done || modunload k_helper >/dev/null 2>&1
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case plain
+ atf_add_test_case bflag
+ atf_add_test_case iflag
+ atf_add_test_case sflag
+}
diff --git a/contrib/netbsd-tests/net/bpf/h_bpf.h b/contrib/netbsd-tests/net/bpf/h_bpf.h
new file mode 100644
index 0000000..307bc50
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpf/h_bpf.h
@@ -0,0 +1,171 @@
+/* $NetBSD: h_bpf.h,v 1.2 2014/07/08 21:44:26 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 _TESTS_NET_BPF_H_BPF_H_
+#define _TESTS_NET_BPF_H_BPF_H_
+
+#include <sys/param.h>
+#include <sys/mbuf.h>
+
+#include <net/bpf.h>
+#include <net/bpfjit.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <stdint.h>
+#include <string.h>
+
+/* XXX These declarations don't look kosher. */
+int rumpns_bpf_validate(const struct bpf_insn *, int);
+unsigned int rumpns_bpf_filter_ext(const bpf_ctx_t *,
+ const struct bpf_insn *, bpf_args_t *);
+bpfjit_func_t rumpns_bpfjit_generate_code(const bpf_ctx_t *,
+ const struct bpf_insn *, size_t);
+void rumpns_bpfjit_free_code(bpfjit_func_t);
+
+/*
+ * Init mbuf chain with one or two chunks. The first chunk holds
+ * [pkt, pkt + split] bytes, the second chunk (if it's not empty)
+ * holds (pkt + split, pkt + pktsize) bytes.
+ * The function returns (const uint8_t *)mb1.
+ */
+static inline const uint8_t *
+init_mchain2(struct mbuf *mb1, struct mbuf *mb2,
+ unsigned char pkt[], size_t pktsize, size_t split)
+{
+
+ (void)memset(mb1, 0, sizeof(*mb1));
+ mb1->m_data = (char *)pkt;
+ mb1->m_next = (split < pktsize) ? mb2 : NULL;
+ mb1->m_len = (split < pktsize) ? split : pktsize;
+
+ if (split < pktsize) {
+ (void)memset(mb2, 0, sizeof(*mb2));
+ mb2->m_next = NULL;
+ mb2->m_data = (char *)&pkt[split];
+ mb2->m_len = pktsize - split;
+ }
+
+ return (const uint8_t*)mb1;
+}
+
+/*
+ * Compile and run a filter program.
+ */
+static inline unsigned int
+exec_prog(struct bpf_insn *insns, size_t insn_count,
+ unsigned char pkt[], size_t pktsize)
+{
+ bpfjit_func_t fn;
+ bpf_args_t args;
+ unsigned int res;
+
+ args.pkt = (const uint8_t *)pkt;
+ args.buflen = pktsize;
+ args.wirelen = pktsize;
+
+ rump_schedule();
+ fn = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+
+ res = fn(NULL, &args);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(fn);
+ rump_unschedule();
+
+ return res;
+}
+
+/*
+ * Interpret a filter program with mbuf chain passed to bpf_filter_ext().
+ */
+static inline unsigned int
+interp_prog_mchain2(struct bpf_insn *insns,
+ unsigned char pkt[], size_t pktsize, size_t split)
+{
+ uint32_t mem[BPF_MEMWORDS];
+ struct mbuf mb1, mb2;
+ bpf_args_t args;
+ unsigned int res;
+
+ args.pkt = init_mchain2(&mb1, &mb2, pkt, pktsize, split);
+ args.buflen = 0;
+ args.wirelen = pktsize;
+ args.mem = mem;
+
+ rump_schedule();
+ res = rumpns_bpf_filter_ext(NULL, insns, &args);
+ rump_unschedule();
+
+ return res;
+}
+
+/*
+ * Compile and run a filter program with mbuf chain passed to compiled function.
+ */
+static inline unsigned int
+exec_prog_mchain2(struct bpf_insn *insns, size_t insn_count,
+ unsigned char pkt[], size_t pktsize, size_t split)
+{
+ bpfjit_func_t fn;
+ struct mbuf mb1, mb2;
+ bpf_args_t args;
+ unsigned int res;
+
+ args.pkt = init_mchain2(&mb1, &mb2, pkt, pktsize, split);
+ args.buflen = 0;
+ args.wirelen = pktsize;
+
+ rump_schedule();
+ fn = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+
+ res = fn(NULL, &args);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(fn);
+ rump_unschedule();
+
+ return res;
+}
+
+static inline bool
+prog_validate(struct bpf_insn *insns, size_t insn_count)
+{
+ bool res;
+
+ rump_schedule();
+ res = rumpns_bpf_validate(insns, insn_count);
+ rump_unschedule();
+
+ return res;
+}
+
+#endif /* _TESTS_NET_BPF_H_BPF_H_ */
diff --git a/contrib/netbsd-tests/net/bpf/t_bpf.c b/contrib/netbsd-tests/net/bpf/t_bpf.c
new file mode 100644
index 0000000..95ca2fc
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpf/t_bpf.c
@@ -0,0 +1,177 @@
+/* $NetBSD: t_bpf.c,v 1.5 2012/08/14 19:40:30 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_bpf.c,v 1.5 2012/08/14 19:40:30 alnsn Exp $");
+
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/mbuf.h>
+#include <sys/sysctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#include <net/if.h>
+#include <net/bpf.h>
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+/* XXX: atf-c.h has collisions with mbuf */
+#undef m_type
+#undef m_data
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+#include "../config/netconfig.c"
+
+ATF_TC(bpfwriteleak);
+ATF_TC_HEAD(bpfwriteleak, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that writing to /dev/bpf "
+ "does not leak mbufs");
+}
+
+static int
+getmtdata(void)
+{
+ struct mbstat mbstat;
+ size_t mbstatlen = sizeof(mbstat);
+ const int mbstat_mib[] = { CTL_KERN, KERN_MBUF, MBUF_STATS };
+
+ RL(rump_sys___sysctl(mbstat_mib, __arraycount(mbstat_mib),
+ &mbstat, &mbstatlen, NULL, 0));
+ return mbstat.m_mtypes[MT_DATA];
+}
+
+ATF_TC_BODY(bpfwriteleak, tc)
+{
+ char buf[28]; /* sizeof(garbage) > etherhdrlen */
+ struct ifreq ifr;
+ int ifnum, bpfd;
+
+ RZ(rump_init());
+ RZ(rump_pub_shmif_create(NULL, &ifnum));
+ sprintf(ifr.ifr_name, "shmif%d", ifnum);
+
+ RL(bpfd = rump_sys_open("/dev/bpf", O_RDWR));
+ RL(rump_sys_ioctl(bpfd, BIOCSETIF, &ifr));
+ RL(rump_sys_ioctl(bpfd, BIOCSFEEDBACK, &ifr));
+
+ if (getmtdata() != 0)
+ atf_tc_fail("test precondition failed: MT_DATA mbufs != 0");
+
+ ATF_REQUIRE_ERRNO(ENETDOWN, rump_sys_write(bpfd, buf, sizeof(buf))==-1);
+
+ ATF_REQUIRE_EQ(getmtdata(), 0);
+}
+
+#if (SIZE_MAX > UINT_MAX)
+ATF_TC(bpfwritetrunc);
+ATF_TC_HEAD(bpfwritetrunc, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that write to /dev/bpf "
+ "does not truncate size_t to int");
+}
+
+ATF_TC_BODY(bpfwritetrunc, tc)
+{
+ int bpfd;
+ struct ifreq ifr;
+ struct iovec *iov;
+ size_t iovlen, sz;
+ const size_t extra_bytes = 28;
+ const size_t total = extra_bytes + UINT_MAX + 1;
+ long iov_max, vm_page_size; /* round_page wants vm_page_size variable */
+
+ memset(&ifr, 0, sizeof(ifr));
+
+ iov_max = sysconf(_SC_IOV_MAX);
+ vm_page_size = sysconf(_SC_PAGE_SIZE);
+ ATF_REQUIRE(iov_max > 1 && vm_page_size > 1);
+
+ /*
+ * Minimize memory consumption by using many iovecs
+ * all pointing to one memory region.
+ */
+ iov = calloc(iov_max, sizeof(struct iovec));
+ ATF_REQUIRE(iov != NULL);
+
+ sz = round_page((total + (iov_max - 1)) / iov_max);
+
+ iov[0].iov_len = sz;
+ iov[0].iov_base = mmap(NULL, sz, PROT_READ, MAP_ANON, -1, 0);
+ ATF_REQUIRE(iov[0].iov_base != MAP_FAILED);
+
+ iovlen = 1;
+ while (sz + iov[0].iov_len <= total)
+ {
+ iov[iovlen].iov_len = iov[0].iov_len;
+ iov[iovlen].iov_base = iov[0].iov_base;
+ sz += iov[0].iov_len;
+ iovlen++;
+ }
+
+ if (sz < total)
+ {
+ iov[iovlen].iov_len = total - sz;
+ iov[iovlen].iov_base = iov[0].iov_base;
+ iovlen++;
+ }
+
+ /* Sanity checks */
+ ATF_REQUIRE(iovlen >= 1 && iovlen <= (size_t)iov_max);
+ ATF_REQUIRE_EQ(iov[iovlen-1].iov_len, total % iov[0].iov_len);
+
+ RZ(rump_init());
+ netcfg_rump_makeshmif("bpfwritetrunc", ifr.ifr_name);
+ netcfg_rump_if(ifr.ifr_name, "10.1.1.1", "255.0.0.0");
+
+ RL(bpfd = rump_sys_open("/dev/bpf", O_RDWR));
+ RL(rump_sys_ioctl(bpfd, BIOCSETIF, &ifr));
+
+ ATF_CHECK_ERRNO(EMSGSIZE, rump_sys_writev(bpfd, iov, iovlen) == -1);
+
+ munmap(iov[0].iov_base, iov[0].iov_len);
+ free(iov);
+}
+#endif /* #if (SIZE_MAX > UINT_MAX) */
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, bpfwriteleak);
+#if (SIZE_MAX > UINT_MAX)
+ ATF_TP_ADD_TC(tp, bpfwritetrunc);
+#endif
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/bpf/t_div-by-zero.c b/contrib/netbsd-tests/net/bpf/t_div-by-zero.c
new file mode 100644
index 0000000..542d08a
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpf/t_div-by-zero.c
@@ -0,0 +1,52 @@
+#include <sys/types.h>
+#include <sys/ioctl.h>
+
+#include <net/bpf.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+ATF_TC(div_by_zero);
+ATF_TC_HEAD(div_by_zero, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF rejects a filter "
+ "which divides by 0");
+}
+
+ATF_TC_BODY(div_by_zero, tc)
+{
+ struct bpf_program bp;
+ int fd;
+
+ /*
+ * Source code for following program:
+ * link[0:4]/0 = 2
+ */
+ struct bpf_insn bins[] = {
+ { 0x20, 0, 0, 0x00000000 },
+ { 0x34, 0, 0, 0x00000000 },
+ { 0x15, 0, 1, 0x00000002 },
+ { 0x6, 0, 0, 0x00000060 },
+ { 0x6, 0, 0, 0x00000000 },
+ };
+
+ bp.bf_len = __arraycount(bins);
+ bp.bf_insns = bins;
+
+ rump_init();
+ fd = rump_sys_open("/dev/bpf", O_RDWR);
+ ATF_CHECK(fd != -1);
+ ATF_REQUIRE_EQ_MSG(rump_sys_ioctl(fd, BIOCSETF, &bp), -1,
+ "bpf accepted program with division by zero");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, div_by_zero);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/bpf/t_mbuf.c b/contrib/netbsd-tests/net/bpf/t_mbuf.c
new file mode 100644
index 0000000..965dd02
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpf/t_mbuf.c
@@ -0,0 +1,961 @@
+/* $NetBSD: t_mbuf.c,v 1.2 2014/07/08 21:44:26 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mbuf.c,v 1.2 2014/07/08 21:44:26 alnsn Exp $");
+
+#include <sys/param.h>
+#include <sys/mbuf.h>
+
+#include <net/bpf.h>
+
+#include <stdint.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../net/bpf/h_bpf.h"
+
+/* XXX: atf-c.h has collisions with mbuf */
+#undef m_type
+#undef m_data
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+static bool
+test_ldb_abs(size_t split)
+{
+ /* Return a product of all packet bytes. */
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0), /* A <- P[0] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 1), /* A <- P[1] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 2), /* A <- P[2] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 3), /* A <- P[3] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 4), /* A <- P[4] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 120;
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldh_abs(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 0), /* A <- P[0:2] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 1), /* A <- P[1:2] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 2), /* A <- P[2:2] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 3), /* A <- P[3:2] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 0x0a0e; /* 10 14 */
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldw_abs(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), /* A <- P[0:4] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), /* A <- P[1:4] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 0x03050709;
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldb_ind(size_t split)
+{
+ /* Return a sum of all packet bytes. */
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0), /* A <- P[0+X] */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1), /* A <- P[1+X] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1), /* A <- P[1+X] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 2), /* A <- P[2+X] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 3), /* A <- P[3+X] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 15;
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldw_ind(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 0), /* A <- P[X+0:4] */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 0), /* A <- P[X+0:4] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0), /* X <- 0 */
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 1), /* A <- P[X+1:4] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 0x05080b0e;
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldh_ind(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 0), /* A <- P[X+0:2] */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1), /* A <- P[X+1:2] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1), /* A <- P[X+1:2] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 2), /* A <- P[X+2:2] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 0x0a0e; /* 10 14 */
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == res;
+}
+
+static bool
+test_msh(size_t split)
+{
+ /* Return a product of all packet bytes. */
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1), /* A <- 1 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 0), /* X <- 4*(P[0]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 1), /* X <- 4*(P[1]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 2), /* X <- 4*(P[2]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 3), /* X <- 4*(P[3]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 4), /* X <- 4*(P[4]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 120;
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldb_abs_overflow(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldh_abs_overflow(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 4),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldw_abs_overflow(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 2),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldb_ind_overflow1(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldb_ind_overflow2(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 4),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldb_ind_overflow3(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldh_ind_overflow1(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 4),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldh_ind_overflow2(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldh_ind_overflow3(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldw_ind_overflow1(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 2),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldw_ind_overflow2(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldw_ind_overflow3(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_msh_overflow(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 5),
+ BPF_STMT(BPF_MISC+BPF_TXA, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+
+ if (!prog_validate(insns, sizeof(insns) / sizeof(insns[0])))
+ return false;
+
+ return interp_prog_mchain2(insns, P, sizeof(P), split) == 0;
+}
+
+ATF_TC(bpf_mbuf_ldb_abs);
+ATF_TC_HEAD(bpf_mbuf_ldb_abs, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_ABS "
+ "loads bytes from mbuf correctly");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldb_abs, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_abs(0));
+ ATF_CHECK(test_ldb_abs(1));
+ ATF_CHECK(test_ldb_abs(2));
+ ATF_CHECK(test_ldb_abs(3));
+ ATF_CHECK(test_ldb_abs(4));
+ ATF_CHECK(test_ldb_abs(5));
+}
+
+ATF_TC(bpf_mbuf_ldh_abs);
+ATF_TC_HEAD(bpf_mbuf_ldh_abs, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_ABS "
+ "loads halfwords from mbuf correctly");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldh_abs, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_abs(0));
+ ATF_CHECK(test_ldh_abs(1));
+ ATF_CHECK(test_ldh_abs(2));
+ ATF_CHECK(test_ldh_abs(3));
+ ATF_CHECK(test_ldh_abs(4));
+ ATF_CHECK(test_ldh_abs(5));
+}
+
+ATF_TC(bpf_mbuf_ldw_abs);
+ATF_TC_HEAD(bpf_mbuf_ldw_abs, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_ABS "
+ "loads words from mbuf correctly");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldw_abs, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_abs(0));
+ ATF_CHECK(test_ldw_abs(1));
+ ATF_CHECK(test_ldw_abs(2));
+ ATF_CHECK(test_ldw_abs(3));
+ ATF_CHECK(test_ldw_abs(4));
+ ATF_CHECK(test_ldw_abs(5));
+}
+
+ATF_TC(bpf_mbuf_ldb_ind);
+ATF_TC_HEAD(bpf_mbuf_ldb_ind, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_IND "
+ "loads bytes from mbuf correctly");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldb_ind, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_ind(0));
+ ATF_CHECK(test_ldb_ind(1));
+ ATF_CHECK(test_ldb_ind(2));
+ ATF_CHECK(test_ldb_ind(3));
+ ATF_CHECK(test_ldb_ind(4));
+ ATF_CHECK(test_ldb_ind(5));
+}
+
+ATF_TC(bpf_mbuf_ldh_ind);
+ATF_TC_HEAD(bpf_mbuf_ldh_ind, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_IND "
+ "loads halfwords from mbuf correctly");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldh_ind, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_ind(0));
+ ATF_CHECK(test_ldh_ind(1));
+ ATF_CHECK(test_ldh_ind(2));
+ ATF_CHECK(test_ldh_ind(3));
+ ATF_CHECK(test_ldh_ind(4));
+ ATF_CHECK(test_ldh_ind(5));
+}
+
+ATF_TC(bpf_mbuf_ldw_ind);
+ATF_TC_HEAD(bpf_mbuf_ldw_ind, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_IND "
+ "loads words from mbuf correctly");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldw_ind, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_ind(0));
+ ATF_CHECK(test_ldw_ind(1));
+ ATF_CHECK(test_ldw_ind(2));
+ ATF_CHECK(test_ldw_ind(3));
+ ATF_CHECK(test_ldw_ind(4));
+ ATF_CHECK(test_ldw_ind(5));
+}
+
+ATF_TC(bpf_mbuf_msh);
+ATF_TC_HEAD(bpf_mbuf_msh, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LDX+BPF_B+BPF_MSH "
+ "loads bytes from mbuf correctly");
+}
+
+ATF_TC_BODY(bpf_mbuf_msh, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_msh(0));
+ ATF_CHECK(test_msh(1));
+ ATF_CHECK(test_msh(2));
+ ATF_CHECK(test_msh(3));
+ ATF_CHECK(test_msh(4));
+ ATF_CHECK(test_msh(5));
+}
+
+ATF_TC(bpf_mbuf_ldb_abs_overflow);
+ATF_TC_HEAD(bpf_mbuf_ldb_abs_overflow, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_ABS "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldb_abs_overflow, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_abs_overflow(0));
+ ATF_CHECK(test_ldb_abs_overflow(1));
+ ATF_CHECK(test_ldb_abs_overflow(2));
+ ATF_CHECK(test_ldb_abs_overflow(3));
+ ATF_CHECK(test_ldb_abs_overflow(4));
+ ATF_CHECK(test_ldb_abs_overflow(5));
+}
+
+ATF_TC(bpf_mbuf_ldh_abs_overflow);
+ATF_TC_HEAD(bpf_mbuf_ldh_abs_overflow, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_ABS "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldh_abs_overflow, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_abs_overflow(0));
+ ATF_CHECK(test_ldh_abs_overflow(1));
+ ATF_CHECK(test_ldh_abs_overflow(2));
+ ATF_CHECK(test_ldh_abs_overflow(3));
+ ATF_CHECK(test_ldh_abs_overflow(4));
+ ATF_CHECK(test_ldh_abs_overflow(5));
+}
+
+ATF_TC(bpf_mbuf_ldw_abs_overflow);
+ATF_TC_HEAD(bpf_mbuf_ldw_abs_overflow, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_ABS "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldw_abs_overflow, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_abs_overflow(0));
+ ATF_CHECK(test_ldw_abs_overflow(1));
+ ATF_CHECK(test_ldw_abs_overflow(2));
+ ATF_CHECK(test_ldw_abs_overflow(3));
+ ATF_CHECK(test_ldw_abs_overflow(4));
+ ATF_CHECK(test_ldw_abs_overflow(5));
+}
+
+ATF_TC(bpf_mbuf_ldb_ind_overflow1);
+ATF_TC_HEAD(bpf_mbuf_ldb_ind_overflow1, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldb_ind_overflow1, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_ind_overflow1(0));
+ ATF_CHECK(test_ldb_ind_overflow1(1));
+ ATF_CHECK(test_ldb_ind_overflow1(2));
+ ATF_CHECK(test_ldb_ind_overflow1(3));
+ ATF_CHECK(test_ldb_ind_overflow1(4));
+ ATF_CHECK(test_ldb_ind_overflow1(5));
+}
+
+ATF_TC(bpf_mbuf_ldb_ind_overflow2);
+ATF_TC_HEAD(bpf_mbuf_ldb_ind_overflow2, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldb_ind_overflow2, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_ind_overflow2(0));
+ ATF_CHECK(test_ldb_ind_overflow2(1));
+ ATF_CHECK(test_ldb_ind_overflow2(2));
+ ATF_CHECK(test_ldb_ind_overflow2(3));
+ ATF_CHECK(test_ldb_ind_overflow2(4));
+ ATF_CHECK(test_ldb_ind_overflow2(5));
+}
+
+ATF_TC(bpf_mbuf_ldb_ind_overflow3);
+ATF_TC_HEAD(bpf_mbuf_ldb_ind_overflow3, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldb_ind_overflow3, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_ind_overflow3(0));
+ ATF_CHECK(test_ldb_ind_overflow3(1));
+ ATF_CHECK(test_ldb_ind_overflow3(2));
+ ATF_CHECK(test_ldb_ind_overflow3(3));
+ ATF_CHECK(test_ldb_ind_overflow3(4));
+ ATF_CHECK(test_ldb_ind_overflow3(5));
+}
+
+ATF_TC(bpf_mbuf_ldh_ind_overflow1);
+ATF_TC_HEAD(bpf_mbuf_ldh_ind_overflow1, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldh_ind_overflow1, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_ind_overflow1(0));
+ ATF_CHECK(test_ldh_ind_overflow1(1));
+ ATF_CHECK(test_ldh_ind_overflow1(2));
+ ATF_CHECK(test_ldh_ind_overflow1(3));
+ ATF_CHECK(test_ldh_ind_overflow1(4));
+ ATF_CHECK(test_ldh_ind_overflow1(5));
+}
+
+ATF_TC(bpf_mbuf_ldh_ind_overflow2);
+ATF_TC_HEAD(bpf_mbuf_ldh_ind_overflow2, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldh_ind_overflow2, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_ind_overflow2(0));
+ ATF_CHECK(test_ldh_ind_overflow2(1));
+ ATF_CHECK(test_ldh_ind_overflow2(2));
+ ATF_CHECK(test_ldh_ind_overflow2(3));
+ ATF_CHECK(test_ldh_ind_overflow2(4));
+ ATF_CHECK(test_ldh_ind_overflow2(5));
+}
+
+ATF_TC(bpf_mbuf_ldh_ind_overflow3);
+ATF_TC_HEAD(bpf_mbuf_ldh_ind_overflow3, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldh_ind_overflow3, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_ind_overflow3(0));
+ ATF_CHECK(test_ldh_ind_overflow3(1));
+ ATF_CHECK(test_ldh_ind_overflow3(2));
+ ATF_CHECK(test_ldh_ind_overflow3(3));
+ ATF_CHECK(test_ldh_ind_overflow3(4));
+ ATF_CHECK(test_ldh_ind_overflow3(5));
+}
+
+ATF_TC(bpf_mbuf_ldw_ind_overflow1);
+ATF_TC_HEAD(bpf_mbuf_ldw_ind_overflow1, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldw_ind_overflow1, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_ind_overflow1(0));
+ ATF_CHECK(test_ldw_ind_overflow1(1));
+ ATF_CHECK(test_ldw_ind_overflow1(2));
+ ATF_CHECK(test_ldw_ind_overflow1(3));
+ ATF_CHECK(test_ldw_ind_overflow1(4));
+ ATF_CHECK(test_ldw_ind_overflow1(5));
+}
+
+ATF_TC(bpf_mbuf_ldw_ind_overflow2);
+ATF_TC_HEAD(bpf_mbuf_ldw_ind_overflow2, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldw_ind_overflow2, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_ind_overflow2(0));
+ ATF_CHECK(test_ldw_ind_overflow2(1));
+ ATF_CHECK(test_ldw_ind_overflow2(2));
+ ATF_CHECK(test_ldw_ind_overflow2(3));
+ ATF_CHECK(test_ldw_ind_overflow2(4));
+ ATF_CHECK(test_ldw_ind_overflow2(5));
+}
+
+ATF_TC(bpf_mbuf_ldw_ind_overflow3);
+ATF_TC_HEAD(bpf_mbuf_ldw_ind_overflow3, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_ldw_ind_overflow3, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_ind_overflow3(0));
+ ATF_CHECK(test_ldw_ind_overflow3(1));
+ ATF_CHECK(test_ldw_ind_overflow3(2));
+ ATF_CHECK(test_ldw_ind_overflow3(3));
+ ATF_CHECK(test_ldw_ind_overflow3(4));
+ ATF_CHECK(test_ldw_ind_overflow3(5));
+}
+
+ATF_TC(bpf_mbuf_msh_overflow);
+ATF_TC_HEAD(bpf_mbuf_msh_overflow, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LDX+BPF_B+BPF_MSH "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpf_mbuf_msh_overflow, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_msh_overflow(0));
+ ATF_CHECK(test_msh_overflow(1));
+ ATF_CHECK(test_msh_overflow(2));
+ ATF_CHECK(test_msh_overflow(3));
+ ATF_CHECK(test_msh_overflow(4));
+ ATF_CHECK(test_msh_overflow(5));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * For every new test please also add a similar test
+ * to ../../net/bpfjit/t_mbuf.c
+ */
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldb_abs);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldh_abs);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldw_abs);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldb_ind);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldh_ind);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldw_ind);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_msh);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldb_abs_overflow);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldh_abs_overflow);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldw_abs_overflow);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldb_ind_overflow1);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldb_ind_overflow2);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldb_ind_overflow3);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldh_ind_overflow1);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldh_ind_overflow2);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldh_ind_overflow3);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldw_ind_overflow1);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldw_ind_overflow2);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_ldw_ind_overflow3);
+ ATF_TP_ADD_TC(tp, bpf_mbuf_msh_overflow);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/bpfilter/t_bpfilter.c b/contrib/netbsd-tests/net/bpfilter/t_bpfilter.c
new file mode 100644
index 0000000..9d8d56f
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpfilter/t_bpfilter.c
@@ -0,0 +1,400 @@
+/* $NetBSD: t_bpfilter.c,v 1.8 2014/06/24 11:32:36 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_bpfilter.c,v 1.8 2014/06/24 11:32:36 alnsn Exp $");
+
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/mbuf.h>
+#include <sys/sysctl.h>
+#include <sys/mman.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include <net/if.h>
+#include <net/if_ether.h>
+#include <net/bpf.h>
+
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+/* XXX: atf-c.h has collisions with mbuf */
+#undef m_type
+#undef m_data
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+#include "../config/netconfig.c"
+
+
+#define SNAPLEN UINT32_MAX
+
+#define BMAGIC UINT32_C(0x37)
+#define HMAGIC UINT32_C(0xc2c2)
+#define WMAGIC UINT32_C(0x7d7d7d7d)
+
+static const char magic_echo_reply_tail[7] = {
+ BMAGIC,
+ HMAGIC & 0xff,
+ HMAGIC & 0xff,
+ WMAGIC & 0xff,
+ WMAGIC & 0xff,
+ WMAGIC & 0xff,
+ WMAGIC & 0xff
+};
+
+/*
+ * Match ICMP_ECHOREPLY packet with 7 magic bytes at the end.
+ */
+static struct bpf_insn magic_echo_reply_prog[] = {
+ BPF_STMT(BPF_LD+BPF_ABS+BPF_B,
+ sizeof(struct ip) + offsetof(struct icmp, icmp_type)),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ICMP_ECHOREPLY, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0), /* A <- len */
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_K, 7), /* A <- A - 7 */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_IND+BPF_B, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, BMAGIC, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+
+ BPF_STMT(BPF_LD+BPF_IND+BPF_H, 1),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, HMAGIC, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+
+ BPF_STMT(BPF_LD+BPF_IND+BPF_W, 3),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, WMAGIC, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+
+ BPF_STMT(BPF_RET+BPF_K, SNAPLEN)
+};
+
+static struct bpf_insn badmem_prog[] = {
+ BPF_STMT(BPF_LD+BPF_MEM, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+};
+
+static struct bpf_insn noinitA_prog[] = {
+ BPF_STMT(BPF_RET+BPF_A, 0),
+};
+
+static struct bpf_insn noinitX_prog[] = {
+ BPF_STMT(BPF_MISC+BPF_TXA, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+};
+
+static uint16_t
+in_cksum(void *data, size_t len)
+{
+ uint16_t *buf = data;
+ unsigned sum;
+
+ for (sum = 0; len > 1; len -= 2)
+ sum += *buf++;
+ if (len)
+ sum += *(uint8_t *)buf;
+
+ sum = (sum >> 16) + (sum & 0xffff);
+ sum += (sum >> 16);
+
+ return ~sum;
+}
+
+/*
+ * Based on netcfg_rump_pingtest().
+ */
+static bool __unused
+pingtest(const char *dst, unsigned int wirelen, const char tail[7])
+{
+ struct timeval tv;
+ struct sockaddr_in sin;
+ struct icmp *icmp;
+ char *pkt;
+ unsigned int pktsize;
+ socklen_t slen;
+ int s;
+ bool rv = false;
+
+ if (wirelen < ETHER_HDR_LEN + sizeof(struct ip))
+ return false;
+
+ pktsize = wirelen - ETHER_HDR_LEN - sizeof(struct ip);
+ if (pktsize < sizeof(struct icmp) + 7)
+ return false;
+
+ s = rump_sys_socket(PF_INET, SOCK_RAW, IPPROTO_ICMP);
+ if (s == -1)
+ return false;
+
+ pkt = NULL;
+
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ if (rump_sys_setsockopt(s, SOL_SOCKET, SO_RCVTIMEO,
+ &tv, sizeof(tv)) == -1)
+ goto out;
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = inet_addr(dst);
+
+ pkt = calloc(1, pktsize);
+ icmp = (struct icmp *)pkt;
+ if (pkt == NULL)
+ goto out;
+
+ memcpy(pkt + pktsize - 7, tail, 7);
+ icmp->icmp_type = ICMP_ECHO;
+ icmp->icmp_id = htons(37);
+ icmp->icmp_seq = htons(1);
+ icmp->icmp_cksum = in_cksum(pkt, pktsize);
+
+ slen = sizeof(sin);
+ if (rump_sys_sendto(s, pkt, pktsize, 0,
+ (struct sockaddr *)&sin, slen) == -1) {
+ goto out;
+ }
+
+ if (rump_sys_recvfrom(s, pkt, pktsize, 0,
+ (struct sockaddr *)&sin, &slen) == -1)
+ goto out;
+
+ rv = true;
+ out:
+ if (pkt != NULL)
+ free(pkt);
+ rump_sys_close(s);
+ return rv;
+}
+
+static void
+magic_ping_test(const char *name, unsigned int wirelen)
+{
+ struct bpf_program prog;
+ struct bpf_stat bstat;
+ struct ifreq ifr;
+ struct timeval tv;
+ unsigned int bufsize;
+ bool pinged;
+ ssize_t n;
+ char *buf;
+ pid_t child;
+ int bpfd;
+ char token;
+ int channel[2];
+
+ struct bpf_hdr *hdr;
+
+ RL(pipe(channel));
+
+ prog.bf_len = __arraycount(magic_echo_reply_prog);
+ prog.bf_insns = magic_echo_reply_prog;
+
+ child = fork();
+ RZ(rump_init());
+ netcfg_rump_makeshmif(name, ifr.ifr_name);
+
+ switch (child) {
+ case -1:
+ atf_tc_fail_errno("fork failed");
+ case 0:
+ netcfg_rump_if(ifr.ifr_name, "10.1.1.10", "255.0.0.0");
+ close(channel[0]);
+ ATF_CHECK(write(channel[1], "U", 1) == 1);
+ close(channel[1]);
+ pause();
+ return;
+ default:
+ break;
+ }
+
+ netcfg_rump_if(ifr.ifr_name, "10.1.1.20", "255.0.0.0");
+
+ RL(bpfd = rump_sys_open("/dev/bpf", O_RDONLY));
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 500;
+ RL(rump_sys_ioctl(bpfd, BIOCSRTIMEOUT, &tv));
+
+ RL(rump_sys_ioctl(bpfd, BIOCGBLEN, &bufsize));
+ RL(rump_sys_ioctl(bpfd, BIOCSETF, &prog));
+ RL(rump_sys_ioctl(bpfd, BIOCSETIF, &ifr));
+
+ close(channel[1]);
+ ATF_CHECK(read(channel[0], &token, 1) == 1 && token == 'U');
+
+ pinged = pingtest("10.1.1.10", wirelen, magic_echo_reply_tail);
+ ATF_CHECK(pinged);
+
+ buf = malloc(bufsize);
+ hdr = (struct bpf_hdr *)buf;
+ ATF_REQUIRE(buf != NULL);
+ ATF_REQUIRE(bufsize > sizeof(struct bpf_hdr));
+
+ n = rump_sys_read(bpfd, buf, bufsize);
+
+ ATF_CHECK(n > (int)sizeof(struct bpf_hdr));
+ ATF_CHECK(hdr->bh_caplen == MIN(SNAPLEN, wirelen));
+
+ RL(rump_sys_ioctl(bpfd, BIOCGSTATS, &bstat));
+ ATF_CHECK(bstat.bs_capt >= 1); /* XXX == 1 */
+
+ rump_sys_close(bpfd);
+ free(buf);
+
+ close(channel[0]);
+
+ kill(child, SIGKILL);
+}
+
+static int
+send_bpf_prog(const char *ifname, struct bpf_program *prog)
+{
+ struct ifreq ifr;
+ int bpfd, e, rv;
+
+ RZ(rump_init());
+ netcfg_rump_makeshmif(ifname, ifr.ifr_name);
+ netcfg_rump_if(ifr.ifr_name, "10.1.1.20", "255.0.0.0");
+
+ RL(bpfd = rump_sys_open("/dev/bpf", O_RDONLY));
+
+ rv = rump_sys_ioctl(bpfd, BIOCSETF, prog);
+ e = errno;
+
+ rump_sys_close(bpfd);
+ errno = e;
+
+ return rv;
+}
+
+ATF_TC(bpfiltercontig);
+ATF_TC_HEAD(bpfiltercontig, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that bpf program "
+ "can read bytes from contiguous buffer.");
+ atf_tc_set_md_var(tc, "timeout", "30");
+}
+
+ATF_TC_BODY(bpfiltercontig, tc)
+{
+
+ magic_ping_test("bpfiltercontig", 128);
+}
+
+
+ATF_TC(bpfiltermchain);
+ATF_TC_HEAD(bpfiltermchain, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that bpf program "
+ "can read bytes from mbuf chain.");
+ atf_tc_set_md_var(tc, "timeout", "30");
+}
+
+ATF_TC_BODY(bpfiltermchain, tc)
+{
+
+ magic_ping_test("bpfiltermchain", MINCLSIZE + 1);
+}
+
+
+ATF_TC(bpfilterbadmem);
+ATF_TC_HEAD(bpfilterbadmem, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that bpf program that "
+ "doesn't initialize memomy store is rejected by the kernel");
+ atf_tc_set_md_var(tc, "timeout", "30");
+}
+
+ATF_TC_BODY(bpfilterbadmem, tc)
+{
+ struct bpf_program prog;
+
+ prog.bf_len = __arraycount(badmem_prog);
+ prog.bf_insns = badmem_prog;
+ ATF_CHECK_ERRNO(EINVAL, send_bpf_prog("bpfilterbadmem", &prog) == -1);
+}
+
+ATF_TC(bpfilternoinitA);
+ATF_TC_HEAD(bpfilternoinitA, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that bpf program that "
+ "doesn't initialize the A register is accepted by the kernel");
+ atf_tc_set_md_var(tc, "timeout", "30");
+}
+
+ATF_TC_BODY(bpfilternoinitA, tc)
+{
+ struct bpf_program prog;
+
+ prog.bf_len = __arraycount(noinitA_prog);
+ prog.bf_insns = noinitA_prog;
+ RL(send_bpf_prog("bpfilternoinitA", &prog));
+}
+
+ATF_TC(bpfilternoinitX);
+ATF_TC_HEAD(bpfilternoinitX, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that bpf program that "
+ "doesn't initialize the X register is accepted by the kernel");
+ atf_tc_set_md_var(tc, "timeout", "30");
+}
+
+ATF_TC_BODY(bpfilternoinitX, tc)
+{
+ struct bpf_program prog;
+
+ prog.bf_len = __arraycount(noinitX_prog);
+ prog.bf_insns = noinitX_prog;
+ RL(send_bpf_prog("bpfilternoinitX", &prog));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, bpfiltercontig);
+ ATF_TP_ADD_TC(tp, bpfiltermchain);
+ ATF_TP_ADD_TC(tp, bpfilterbadmem);
+ ATF_TP_ADD_TC(tp, bpfilternoinitA);
+ ATF_TP_ADD_TC(tp, bpfilternoinitX);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/bpfjit/t_bpfjit.c b/contrib/netbsd-tests/net/bpfjit/t_bpfjit.c
new file mode 100644
index 0000000..a9f8f41
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpfjit/t_bpfjit.c
@@ -0,0 +1,3979 @@
+/* $NetBSD: t_bpfjit.c,v 1.2 2014/07/08 21:44:26 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2011-2012, 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_bpfjit.c,v 1.2 2014/07/08 21:44:26 alnsn Exp $");
+
+#include <sys/param.h>
+#include <sys/mbuf.h>
+#include <unistd.h>
+
+#include <net/bpf.h>
+#include <net/bpfjit.h>
+
+#include <stdint.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../net/bpf/h_bpf.h"
+
+/* XXX: atf-c.h has collisions with mbuf */
+#undef m_type
+#undef m_data
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+
+static uint8_t deadbeef_at_5[16] = {
+ 0, 0xf1, 2, 0xf3, 4, 0xde, 0xad, 0xbe, 0xef, 0xff
+};
+
+static inline
+unsigned int jitcall(bpfjit_func_t fn,
+ const uint8_t *pkt, unsigned int wirelen, unsigned int buflen)
+{
+ bpf_args_t args;
+
+ args.pkt = pkt;
+ args.wirelen = wirelen;
+ args.buflen = buflen;
+
+ return fn(NULL, &args);
+}
+
+ATF_TC(bpfjit_empty);
+ATF_TC_HEAD(bpfjit_empty, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that JIT compilation of an empty bpf program fails");
+}
+
+ATF_TC_BODY(bpfjit_empty, tc)
+{
+ struct bpf_insn dummy;
+ bpfjit_func_t fn;
+
+ RZ(rump_init());
+
+ rump_schedule();
+ fn = rumpns_bpfjit_generate_code(NULL, &dummy, 0);
+ rump_unschedule();
+
+ ATF_CHECK(fn == NULL);
+}
+
+ATF_TC(bpfjit_alu_add_k);
+ATF_TC_HEAD(bpfjit_alu_add_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_ADD+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_alu_add_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 3),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 5);
+}
+
+ATF_TC(bpfjit_alu_sub_k);
+ATF_TC_HEAD(bpfjit_alu_sub_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_SUB+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_alu_sub_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1),
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_K, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX);
+}
+
+ATF_TC(bpfjit_alu_mul_k);
+ATF_TC_HEAD(bpfjit_alu_mul_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_MUL+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_alu_mul_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xfffffffd);
+}
+
+ATF_TC(bpfjit_alu_div0_k);
+ATF_TC_HEAD(bpfjit_alu_div0_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=0");
+}
+
+ATF_TC_BODY(bpfjit_alu_div0_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ //ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0);
+}
+
+ATF_TC(bpfjit_alu_div1_k);
+ATF_TC_HEAD(bpfjit_alu_div1_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=1");
+}
+
+ATF_TC_BODY(bpfjit_alu_div1_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 7),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 7);
+}
+
+ATF_TC(bpfjit_alu_div2_k);
+ATF_TC_HEAD(bpfjit_alu_div2_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=2");
+}
+
+ATF_TC_BODY(bpfjit_alu_div2_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 7),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 3);
+}
+
+ATF_TC(bpfjit_alu_div4_k);
+ATF_TC_HEAD(bpfjit_alu_div4_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=4");
+}
+
+ATF_TC_BODY(bpfjit_alu_div4_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0x3fffffff);
+}
+
+ATF_TC(bpfjit_alu_div10_k);
+ATF_TC_HEAD(bpfjit_alu_div10_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=10");
+}
+
+ATF_TC_BODY(bpfjit_alu_div10_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 10),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 429484384);
+}
+
+ATF_TC(bpfjit_alu_div10000_k);
+ATF_TC_HEAD(bpfjit_alu_div10000_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=10000");
+}
+
+ATF_TC_BODY(bpfjit_alu_div10000_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 10000),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 429484);
+}
+
+ATF_TC(bpfjit_alu_div7609801_k);
+ATF_TC_HEAD(bpfjit_alu_div7609801_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=7609801");
+}
+
+ATF_TC_BODY(bpfjit_alu_div7609801_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294967295)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, UINT32_C(7609801)),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 564);
+}
+
+ATF_TC(bpfjit_alu_div80000000_k);
+ATF_TC_HEAD(bpfjit_alu_div80000000_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=0x80000000");
+}
+
+ATF_TC_BODY(bpfjit_alu_div80000000_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffde)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, UINT32_C(0x80000000)),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 1);
+}
+
+ATF_TC(bpfjit_alu_and_k);
+ATF_TC_HEAD(bpfjit_alu_and_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_AND+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_alu_and_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdead),
+ BPF_STMT(BPF_ALU+BPF_AND+BPF_K, 0xbeef),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == (0xdead&0xbeef));
+}
+
+ATF_TC(bpfjit_alu_or_k);
+ATF_TC_HEAD(bpfjit_alu_or_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_OR+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_alu_or_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdead0000),
+ BPF_STMT(BPF_ALU+BPF_OR+BPF_K, 0x0000beef),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xdeadbeef);
+}
+
+ATF_TC(bpfjit_alu_lsh_k);
+ATF_TC_HEAD(bpfjit_alu_lsh_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_LSH+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_alu_lsh_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 16),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xbeef0000);
+}
+
+ATF_TC(bpfjit_alu_lsh0_k);
+ATF_TC_HEAD(bpfjit_alu_lsh0_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_LSH+BPF_K with k=0");
+}
+
+ATF_TC_BODY(bpfjit_alu_lsh0_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xdeadbeef);
+}
+
+ATF_TC(bpfjit_alu_rsh_k);
+ATF_TC_HEAD(bpfjit_alu_rsh_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_RSH+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_alu_rsh_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_K, 16),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0x0000dead);
+}
+
+ATF_TC(bpfjit_alu_rsh0_k);
+ATF_TC_HEAD(bpfjit_alu_rsh0_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_RSH+BPF_K with k=0");
+}
+
+ATF_TC_BODY(bpfjit_alu_rsh0_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xdeadbeef);
+}
+
+ATF_TC(bpfjit_alu_modulo_k);
+ATF_TC_HEAD(bpfjit_alu_modulo_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of modulo logic of BPF_ALU+BPF_K operations");
+}
+
+ATF_TC_BODY(bpfjit_alu_modulo_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0x7fffff77)),
+
+ /* (7FFFFF77 * 0FFFFF77) = 07FFFFB2,F0004951 */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_K, UINT32_C(0x0fffff77)),
+
+ /* 07FFFFB2,F0004951 << 1 = 0FFFFF65,E00092A2 */
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 1),
+
+ /* 0FFFFF65,E00092A2 + DDDDDDDD = 0FFFFF66,BDDE707F */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xdddddddd)),
+
+ /* 0FFFFF66,BDDE707F - FFFFFFFF = 0FFFFF65,BDDE7080 */
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_K, UINT32_C(0xffffffff)),
+
+ /* 0FFFFF65,BDDE7080 | 0000030C = 0FFFFF65,BDDE738C */
+ BPF_STMT(BPF_ALU+BPF_OR+BPF_K, UINT32_C(0x0000030c)),
+
+ /* -0FFFFF65,BDDE738C mod(2^64) = F000009A,42218C74 */
+ BPF_STMT(BPF_ALU+BPF_NEG, 0),
+
+ /* F000009A,42218C74 & FFFFFF0F = F000009A,42218C04 */
+ BPF_STMT(BPF_ALU+BPF_AND+BPF_K, UINT32_C(0xffffff0f)),
+
+ /* F000009A,42218C74 >> 3 = 1E000013,48443180 */
+ /* 00000000,42218C74 >> 3 = 00000000,08443180 */
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_K, 3),
+
+ /* 00000000,08443180 * 7FFFFF77 = 042218BB,93818280 */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_K, UINT32_C(0x7fffff77)),
+
+ /* 042218BB,93818280 / DEAD = 000004C0,71CBBBC3 */
+ /* 00000000,93818280 / DEAD = 00000000,0000A994 */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, UINT32_C(0xdead)),
+
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) != UINT32_C(0x71cbbbc3));
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(0x0000a994));
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_alu_add_x);
+ATF_TC_HEAD(bpfjit_alu_add_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_ADD+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_alu_add_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 3),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 5);
+}
+
+ATF_TC(bpfjit_alu_sub_x);
+ATF_TC_HEAD(bpfjit_alu_sub_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_SUB+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_alu_sub_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX);
+}
+
+ATF_TC(bpfjit_alu_mul_x);
+ATF_TC_HEAD(bpfjit_alu_mul_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_MUL+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_alu_mul_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xfffffffd);
+}
+
+ATF_TC(bpfjit_alu_div0_x);
+ATF_TC_HEAD(bpfjit_alu_div0_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=0");
+}
+
+ATF_TC_BODY(bpfjit_alu_div0_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0);
+}
+
+ATF_TC(bpfjit_alu_div1_x);
+ATF_TC_HEAD(bpfjit_alu_div1_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=1");
+}
+
+ATF_TC_BODY(bpfjit_alu_div1_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 7),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 7);
+}
+
+ATF_TC(bpfjit_alu_div2_x);
+ATF_TC_HEAD(bpfjit_alu_div2_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=2");
+}
+
+ATF_TC_BODY(bpfjit_alu_div2_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 7),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 3);
+}
+
+ATF_TC(bpfjit_alu_div4_x);
+ATF_TC_HEAD(bpfjit_alu_div4_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=4");
+}
+
+ATF_TC_BODY(bpfjit_alu_div4_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 4),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0x3fffffff);
+}
+
+ATF_TC(bpfjit_alu_div10_x);
+ATF_TC_HEAD(bpfjit_alu_div10_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=10");
+}
+
+ATF_TC_BODY(bpfjit_alu_div10_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 10),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 429484384);
+}
+
+ATF_TC(bpfjit_alu_div10000_x);
+ATF_TC_HEAD(bpfjit_alu_div10000_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=10000");
+}
+
+ATF_TC_BODY(bpfjit_alu_div10000_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 10000),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 429484);
+}
+
+ATF_TC(bpfjit_alu_div7609801_x);
+ATF_TC_HEAD(bpfjit_alu_div7609801_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=7609801");
+}
+
+ATF_TC_BODY(bpfjit_alu_div7609801_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294967295)),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(7609801)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 564);
+}
+
+ATF_TC(bpfjit_alu_div80000000_x);
+ATF_TC_HEAD(bpfjit_alu_div80000000_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_DIV+BPF_X with X=0x80000000");
+}
+
+ATF_TC_BODY(bpfjit_alu_div80000000_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_MAX - 33),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0x80000000)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 1);
+}
+
+ATF_TC(bpfjit_alu_and_x);
+ATF_TC_HEAD(bpfjit_alu_and_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_AND+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_alu_and_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdead),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0xbeef),
+ BPF_STMT(BPF_ALU+BPF_AND+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == (0xdead&0xbeef));
+}
+
+ATF_TC(bpfjit_alu_or_x);
+ATF_TC_HEAD(bpfjit_alu_or_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_OR+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_alu_or_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdead0000),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0x0000beef),
+ BPF_STMT(BPF_ALU+BPF_OR+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xdeadbeef);
+}
+
+ATF_TC(bpfjit_alu_lsh_x);
+ATF_TC_HEAD(bpfjit_alu_lsh_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_LSH+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_alu_lsh_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 16),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xbeef0000);
+}
+
+ATF_TC(bpfjit_alu_lsh0_x);
+ATF_TC_HEAD(bpfjit_alu_lsh0_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_LSH+BPF_X with k=0");
+}
+
+ATF_TC_BODY(bpfjit_alu_lsh0_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xdeadbeef);
+}
+
+ATF_TC(bpfjit_alu_rsh_x);
+ATF_TC_HEAD(bpfjit_alu_rsh_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_RSH+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_alu_rsh_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 16),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0x0000dead);
+}
+
+ATF_TC(bpfjit_alu_rsh0_x);
+ATF_TC_HEAD(bpfjit_alu_rsh0_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_RSH+BPF_X with k=0");
+}
+
+ATF_TC_BODY(bpfjit_alu_rsh0_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0xdeadbeef);
+}
+
+ATF_TC(bpfjit_alu_modulo_x);
+ATF_TC_HEAD(bpfjit_alu_modulo_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of modulo logic of BPF_ALU+BPF_X operations");
+}
+
+ATF_TC_BODY(bpfjit_alu_modulo_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0x7fffff77)),
+
+ /* (7FFFFF77 * 0FFFFF77) = 07FFFFB2,F0004951 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0x0fffff77)),
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0),
+
+ /* 07FFFFB2,F0004951 << 1 = 0FFFFF65,E00092A2 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, 1),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_X, 0),
+
+ /* 0FFFFF65,E00092A2 + DDDDDDDD = 0FFFFF66,BDDE707F */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0xdddddddd)),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+
+ /* 0FFFFF66,BDDE707F - FFFFFFFF = 0FFFFF65,BDDE7080 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_ALU+BPF_SUB+BPF_X, 0),
+
+ /* 0FFFFF65,BDDE7080 | 0000030C = 0FFFFF65,BDDE738C */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0x0000030c)),
+ BPF_STMT(BPF_ALU+BPF_OR+BPF_X, 0),
+
+ /* -0FFFFF65,BDDE738C mod(2^64) = F000009A,42218C74 */
+ BPF_STMT(BPF_ALU+BPF_NEG, 0),
+
+ /* F000009A,42218C74 & FFFFFF0F = F000009A,42218C04 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0xffffff0f)),
+ BPF_STMT(BPF_ALU+BPF_AND+BPF_X, 0),
+
+ /* F000009A,42218C74 >> 3 = 1E000013,48443180 */
+ /* 00000000,42218C74 >> 3 = 00000000,08443180 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, 3),
+ BPF_STMT(BPF_ALU+BPF_RSH+BPF_X, 0),
+
+ /* 00000000,08443180 * 7FFFFF77 = 042218BB,93818280 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0x7fffff77)),
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0),
+
+ /* 042218BB,93818280 / DEAD = 000004C0,71CBBBC3 */
+ /* 00000000,93818280 / DEAD = 00000000,0000A994 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_K, UINT32_C(0xdead)),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_X, 0),
+
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) != UINT32_C(0x71cbbbc3));
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == UINT32_C(0x0000a994));
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_alu_neg);
+ATF_TC_HEAD(bpfjit_alu_neg, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ALU+BPF_NEG");
+}
+
+ATF_TC_BODY(bpfjit_alu_neg, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 777),
+ BPF_STMT(BPF_ALU+BPF_NEG, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0u-777u);
+}
+
+ATF_TC(bpfjit_jmp_ja);
+ATF_TC_HEAD(bpfjit_jmp_ja, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JA");
+}
+
+ATF_TC_BODY(bpfjit_jmp_ja, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_JMP+BPF_JA, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX);
+}
+
+ATF_TC(bpfjit_jmp_jgt_k);
+ATF_TC_HEAD(bpfjit_jmp_jgt_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JGT+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jgt_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 7, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 2, 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 9, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 4, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 6, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 5, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 7);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_jmp_jge_k);
+ATF_TC_HEAD(bpfjit_jmp_jge_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JGE+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jge_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 8, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 3, 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 9, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 5, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 7, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 6, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 1, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 7);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_jmp_jeq_k);
+ATF_TC_HEAD(bpfjit_jmp_jeq_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JEQ+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jeq_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 8, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 3, 1, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 9, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 5, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 7, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 6, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 1, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 7);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 7);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 1);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_jmp_jset_k);
+ATF_TC_HEAD(bpfjit_jmp_jset_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JSET+BPF_K");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jset_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 8, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 4, 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 3, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 2, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 1, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 2, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 7, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 1);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 5);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_jmp_modulo_k);
+ATF_TC_HEAD(bpfjit_jmp_modulo_k, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of modulo logic of BPF_JMP+BPF_K operations");
+}
+
+ATF_TC_BODY(bpfjit_jmp_modulo_k, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0x7fffff77)),
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 4),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, UINT32_C(0xfffff770), 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, UINT32_C(0xfffff770), 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, UINT32_C(0xfffff771), 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, UINT32_C(0xfffff770), 0, 3),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, UINT32_C(0xfffff770), 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, UINT32_C(0xfffff771), 1, 0),
+ BPF_STMT(BPF_JMP+BPF_JA, 1),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+
+ /* FFFFF770+FFFFF770 = 00000001,FFFFEEE0 */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xfffff770)),
+
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, UINT32_C(0xffffeee0), 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, UINT32_C(0xffffeee0), 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, UINT32_C(0xffffeee1), 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, UINT32_C(0xffffeee0), 0, 3),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, UINT32_C(0xffffeee0), 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, UINT32_C(0xffffeee1), 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX);
+}
+
+ATF_TC(bpfjit_jmp_jgt_x);
+ATF_TC_HEAD(bpfjit_jmp_jgt_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JGT+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jgt_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 7),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 3, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 9),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 4),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 6),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 4, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 7);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_jmp_jge_x);
+ATF_TC_HEAD(bpfjit_jmp_jge_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JGE+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jge_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 8),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 3, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 9),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 7),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 6),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 4, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 7);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_jmp_jeq_x);
+ATF_TC_HEAD(bpfjit_jmp_jeq_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JEQ+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jeq_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 8),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 2, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 9),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 7),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 3, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 1, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 7);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 7);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 1);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 7);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_jmp_jset_x);
+ATF_TC_HEAD(bpfjit_jmp_jset_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_JMP+BPF_JSET+BPF_X");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jset_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 8),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 4),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 2, 0),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 3, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 1, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 2, 3),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 4, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 7),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_X, 0, 0, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, 8)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[8]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 1);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 1);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 7);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 5);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 8);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 5);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_jmp_modulo_x);
+ATF_TC_HEAD(bpfjit_jmp_modulo_x, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of modulo logic of BPF_JMP+BPF_X operations");
+}
+
+ATF_TC_BODY(bpfjit_jmp_modulo_x, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0x7fffff77)),
+ /* FFFFF770 << 4 = FFFFF770 */
+ BPF_STMT(BPF_ALU+BPF_LSH+BPF_K, 4),
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xfffff770)),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xfffff771)),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xfffff770)),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 0, 4),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 3, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xfffff771)),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_JMP+BPF_JA, 1),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+
+ /* FFFFF770+FFFFF770 = 00000001,FFFFEEE0 */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xfffff770)),
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xffffeee0)),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 4),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 5),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xffffeee1)),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 6),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xffffeee0)),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 0, 4),
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_X, 0, 3, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_C(0xffffeee1)),
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX);
+}
+
+ATF_TC(bpfjit_ld_abs);
+ATF_TC_HEAD(bpfjit_ld_abs, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_ABS");
+}
+
+ATF_TC_BODY(bpfjit_ld_abs, tc)
+{
+ static struct bpf_insn insns[3][2] = {
+ {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ }
+ };
+
+ static size_t lengths[3] = { 1, 2, 4 };
+ static unsigned int expected[3] = { 0xde, 0xdead, 0xdeadbeef };
+
+ size_t i, l;
+ uint8_t *pkt = deadbeef_at_5;
+ size_t pktsize = sizeof(deadbeef_at_5);
+
+ size_t insn_count = sizeof(insns[0]) / sizeof(insns[0][0]);
+
+ RZ(rump_init());
+
+ for (i = 0; i < 3; i++) {
+ bpfjit_func_t code;
+
+ ATF_CHECK(prog_validate(insns[i], insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns[i], insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (l = 1; l < 5 + lengths[i]; l++) {
+ ATF_CHECK(jitcall(code, pkt, l, l) == 0);
+ ATF_CHECK(jitcall(code, pkt, pktsize, l) == 0);
+ }
+
+ l = 5 + lengths[i];
+ ATF_CHECK(jitcall(code, pkt, l, l) == expected[i]);
+ ATF_CHECK(jitcall(code, pkt, pktsize, l) == expected[i]);
+
+ l = pktsize;
+ ATF_CHECK(jitcall(code, pkt, l, l) == expected[i]);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+ }
+}
+
+ATF_TC(bpfjit_ld_abs_k_overflow);
+ATF_TC_HEAD(bpfjit_ld_abs_k_overflow, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_ABS with overflow in k+4");
+}
+
+ATF_TC_BODY(bpfjit_ld_abs_k_overflow, tc)
+{
+ static struct bpf_insn insns[12][3] = {
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, UINT32_MAX - 1),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, UINT32_MAX),
+ BPF_STMT(B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PF_ABS, UINT32_MAX - 3),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ }
+ };
+
+ int i;
+ uint8_t pkt[8] = { 0 };
+
+ size_t insn_count = sizeof(insns[0]) / sizeof(insns[0][0]);
+
+ RZ(rump_init());
+
+ for (i = 0; i < 3; i++) {
+ ATF_CHECK(prog_validate(insns[i], insn_count));
+ ATF_CHECK(exec_prog(insns[i], insn_count, pkt, 8) == 0);
+ }
+}
+
+ATF_TC(bpfjit_ld_ind);
+ATF_TC_HEAD(bpfjit_ld_ind, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(bpfjit_ld_ind, tc)
+{
+ static struct bpf_insn insns[6][3] = {
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ },
+ {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ }
+ };
+
+ static size_t lengths[6] = { 1, 2, 4, 1, 2, 4 };
+
+ static unsigned int expected[6] = {
+ 0xde, 0xdead, 0xdeadbeef,
+ 0xde, 0xdead, 0xdeadbeef
+ };
+
+ size_t i, l;
+ uint8_t *pkt = deadbeef_at_5;
+ size_t pktsize = sizeof(deadbeef_at_5);
+
+ size_t insn_count = sizeof(insns[0]) / sizeof(insns[0][0]);
+
+ RZ(rump_init());
+
+ for (i = 0; i < 3; i++) {
+ bpfjit_func_t code;
+
+ ATF_CHECK(prog_validate(insns[i], insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns[i], insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (l = 1; l < 5 + lengths[i]; l++) {
+ ATF_CHECK(jitcall(code, pkt, l, l) == 0);
+ ATF_CHECK(jitcall(code, pkt, pktsize, l) == 0);
+ }
+
+ l = 5 + lengths[i];
+ ATF_CHECK(jitcall(code, pkt, l, l) == expected[i]);
+ ATF_CHECK(jitcall(code, pkt, pktsize, l) == expected[i]);
+
+ l = pktsize;
+ ATF_CHECK(jitcall(code, pkt, l, l) == expected[i]);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+ }
+}
+
+ATF_TC(bpfjit_ld_ind_k_overflow);
+ATF_TC_HEAD(bpfjit_ld_ind_k_overflow, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IND with overflow in k+4");
+}
+
+ATF_TC_BODY(bpfjit_ld_ind_k_overflow, tc)
+{
+ static struct bpf_insn insns[12][3] = {
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, UINT32_MAX - 1),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 1),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 2),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, UINT32_MAX - 1),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 1),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 2),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ },
+ {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 7),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, UINT32_MAX - 3),
+ BPF_STMT(BPF_RET+BPF_K, 1)
+ }
+ };
+
+ int i;
+ uint8_t pkt[8] = { 0 };
+
+ size_t insn_count = sizeof(insns[0]) / sizeof(insns[0][0]);
+
+ RZ(rump_init());
+
+ for (i = 0; i < 3; i++) {
+
+ ATF_CHECK(prog_validate(insns[i], insn_count));
+ ATF_CHECK(exec_prog(insns[i], insn_count, pkt, 8) == 0);
+ }
+}
+
+ATF_TC(bpfjit_ld_ind_x_overflow1);
+ATF_TC_HEAD(bpfjit_ld_ind_x_overflow1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IND with overflow in X+4");
+}
+
+ATF_TC_BODY(bpfjit_ld_ind_x_overflow1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_LEN, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_MISC+BPF_TAX, 0),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[8] = { 10, 20, 30, 40, 50, 60, 70, 80 };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++) {
+ //ATF_CHECK(bpf_filter(insns, pkt, i, i) == 10 * i);
+ ATF_CHECK(jitcall(code, pkt, i, i) == 10 * i);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_ld_ind_x_overflow2);
+ATF_TC_HEAD(bpfjit_ld_ind_x_overflow2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IND with overflow in X+4");
+}
+
+ATF_TC_BODY(bpfjit_ld_ind_x_overflow2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_LEN, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, UINT32_C(0xffffffff)),
+ BPF_STMT(BPF_ST, 3),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 3),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[8] = { 10, 20, 30, 40, 50, 60, 70, 80 };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++) {
+ //ATF_CHECK(bpf_filter(insns, pkt, i, i) == 10 * i);
+ ATF_CHECK(jitcall(code, pkt, i, i) == 10 * i);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_ld_len);
+ATF_TC_HEAD(bpfjit_ld_len, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_W+BPF_LEN");
+}
+
+ATF_TC_BODY(bpfjit_ld_len, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[32]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < sizeof(pkt); i++)
+ ATF_CHECK(jitcall(code, pkt, i, 1) == i);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_ld_imm);
+ATF_TC_HEAD(bpfjit_ld_imm, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LD+BPF_IMM");
+}
+
+ATF_TC_BODY(bpfjit_ld_imm, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX);
+}
+
+ATF_TC(bpfjit_ldx_imm1);
+ATF_TC_HEAD(bpfjit_ldx_imm1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_IMM");
+}
+
+ATF_TC_BODY(bpfjit_ldx_imm1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_MAX - 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX - 5);
+}
+
+ATF_TC(bpfjit_ldx_imm2);
+ATF_TC_HEAD(bpfjit_ldx_imm2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_IMM");
+}
+
+ATF_TC_BODY(bpfjit_ldx_imm2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 5),
+ BPF_STMT(BPF_LD+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX);
+}
+
+ATF_TC(bpfjit_ldx_len1);
+ATF_TC_HEAD(bpfjit_ldx_len1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_LEN");
+}
+
+ATF_TC_BODY(bpfjit_ldx_len1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[5]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i < sizeof(pkt); i++) {
+ ATF_CHECK(jitcall(code, pkt, i, 1) == i);
+ ATF_CHECK(jitcall(code, pkt, i + 1, i) == i + 1);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_ldx_len2);
+ATF_TC_HEAD(bpfjit_ldx_len2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_LEN");
+}
+
+ATF_TC_BODY(bpfjit_ldx_len2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_LD+BPF_IMM, 5),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 1, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[5]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 5, 1) == UINT32_MAX);
+ ATF_CHECK(jitcall(code, pkt, 6, 5) == 7);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_ldx_msh);
+ATF_TC_HEAD(bpfjit_ldx_msh, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_LDX+BPF_MSH");
+}
+
+ATF_TC_BODY(bpfjit_ldx_msh, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[2] = { 0, 0x7a };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 2) == 40);
+}
+
+ATF_TC(bpfjit_misc_tax);
+ATF_TC_HEAD(bpfjit_misc_tax, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_MISC+BPF_TAX");
+}
+
+ATF_TC_BODY(bpfjit_misc_tax, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 3),
+ BPF_STMT(BPF_MISC+BPF_TAX, 0),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 2),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[6] = { 0, 11, 22, 33, 44, 55 };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 6) == 55);
+}
+
+ATF_TC(bpfjit_misc_txa);
+ATF_TC_HEAD(bpfjit_misc_txa, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_MISC+BPF_TXA");
+}
+
+ATF_TC_BODY(bpfjit_misc_txa, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 391),
+ BPF_STMT(BPF_MISC+BPF_TXA, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 391);
+}
+
+ATF_TC(bpfjit_st1);
+ATF_TC_HEAD(bpfjit_st1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(bpfjit_st1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ST, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_LD+BPF_MEM, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[16]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++)
+ ATF_CHECK(jitcall(code, pkt, i, sizeof(pkt)) == i);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_st2);
+ATF_TC_HEAD(bpfjit_st2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(bpfjit_st2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_ST, 0),
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ST, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_LD+BPF_MEM, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0);
+}
+
+ATF_TC(bpfjit_st3);
+ATF_TC_HEAD(bpfjit_st3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(bpfjit_st3, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ST, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 100),
+ BPF_STMT(BPF_ST, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 200),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 301, 2, 0),
+ BPF_STMT(BPF_LD+BPF_MEM, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ BPF_STMT(BPF_LD+BPF_MEM, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[2]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_REQUIRE(BPF_MEMWORDS > 1);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 102);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_st4);
+ATF_TC_HEAD(bpfjit_st4, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(bpfjit_st4, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_ST, 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 100),
+ BPF_STMT(BPF_ST, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 200),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 301, 2, 0),
+ BPF_STMT(BPF_LD+BPF_MEM, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ BPF_STMT(BPF_LD+BPF_MEM, 5),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[2]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ ATF_REQUIRE(BPF_MEMWORDS > 6);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 1);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 102);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_st5);
+ATF_TC_HEAD(bpfjit_st5, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_ST");
+}
+
+ATF_TC_BODY(bpfjit_st5, tc)
+{
+ struct bpf_insn insns[5*BPF_MEMWORDS+2];
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ size_t k;
+ bpfjit_func_t code;
+ uint8_t pkt[BPF_MEMWORDS]; /* the program doesn't read any data */
+
+ memset(insns, 0, sizeof(insns));
+
+ /* for each k do M[k] = k */
+ for (k = 0; k < BPF_MEMWORDS; k++) {
+ insns[2*k].code = BPF_LD+BPF_IMM;
+ insns[2*k].k = 3*k;
+ insns[2*k+1].code = BPF_ST;
+ insns[2*k+1].k = k;
+ }
+
+ /* load wirelen into A */
+ insns[2*BPF_MEMWORDS].code = BPF_LD+BPF_W+BPF_LEN;
+
+ /* for each k, if (A == k + 1) return M[k] */
+ for (k = 0; k < BPF_MEMWORDS; k++) {
+ insns[2*BPF_MEMWORDS+3*k+1].code = BPF_JMP+BPF_JEQ+BPF_K;
+ insns[2*BPF_MEMWORDS+3*k+1].k = k+1;
+ insns[2*BPF_MEMWORDS+3*k+1].jt = 0;
+ insns[2*BPF_MEMWORDS+3*k+1].jf = 2;
+ insns[2*BPF_MEMWORDS+3*k+2].code = BPF_LD+BPF_MEM;
+ insns[2*BPF_MEMWORDS+3*k+2].k = k;
+ insns[2*BPF_MEMWORDS+3*k+3].code = BPF_RET+BPF_A;
+ insns[2*BPF_MEMWORDS+3*k+3].k = 0;
+ }
+
+ insns[5*BPF_MEMWORDS+1].code = BPF_RET+BPF_K;
+ insns[5*BPF_MEMWORDS+1].k = UINT32_MAX;
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (k = 1; k <= sizeof(pkt); k++)
+ ATF_CHECK(jitcall(code, pkt, k, k) == 3*(k-1));
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_stx1);
+ATF_TC_HEAD(bpfjit_stx1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_STX");
+}
+
+ATF_TC_BODY(bpfjit_stx1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_STX, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[16]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++)
+ ATF_CHECK(jitcall(code, pkt, i, sizeof(pkt)) == i);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_stx2);
+ATF_TC_HEAD(bpfjit_stx2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_STX");
+}
+
+ATF_TC_BODY(bpfjit_stx2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_ST, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_STX, BPF_MEMWORDS-1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0),
+ BPF_STMT(BPF_MISC+BPF_TXA, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 0);
+}
+
+ATF_TC(bpfjit_stx3);
+ATF_TC_HEAD(bpfjit_stx3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_STX");
+}
+
+ATF_TC_BODY(bpfjit_stx3, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_STX, 6),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_LEN, 0),
+ BPF_STMT(BPF_STX, 5),
+ BPF_STMT(BPF_STX, 2),
+ BPF_STMT(BPF_STX, 3),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 2),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 3),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 6),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ size_t i;
+ bpfjit_func_t code;
+ uint8_t pkt[16]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 1; i <= sizeof(pkt); i++)
+ ATF_CHECK(jitcall(code, pkt, i, sizeof(pkt)) == 3 * i);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_stx4);
+ATF_TC_HEAD(bpfjit_stx4, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation of BPF_STX");
+}
+
+ATF_TC_BODY(bpfjit_stx4, tc)
+{
+ struct bpf_insn insns[5*BPF_MEMWORDS+2];
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ size_t k;
+ bpfjit_func_t code;
+ uint8_t pkt[BPF_MEMWORDS]; /* the program doesn't read any data */
+
+ memset(insns, 0, sizeof(insns));
+
+ /* for each k do M[k] = k */
+ for (k = 0; k < BPF_MEMWORDS; k++) {
+ insns[2*k].code = BPF_LDX+BPF_W+BPF_IMM;
+ insns[2*k].k = 3*k;
+ insns[2*k+1].code = BPF_STX;
+ insns[2*k+1].k = k;
+ }
+
+ /* load wirelen into A */
+ insns[2*BPF_MEMWORDS].code = BPF_LD+BPF_W+BPF_LEN;
+
+ /* for each k, if (A == k + 1) return M[k] */
+ for (k = 0; k < BPF_MEMWORDS; k++) {
+ insns[2*BPF_MEMWORDS+3*k+1].code = BPF_JMP+BPF_JEQ+BPF_K;
+ insns[2*BPF_MEMWORDS+3*k+1].k = k+1;
+ insns[2*BPF_MEMWORDS+3*k+1].jt = 0;
+ insns[2*BPF_MEMWORDS+3*k+1].jf = 2;
+ insns[2*BPF_MEMWORDS+3*k+2].code = BPF_LD+BPF_MEM;
+ insns[2*BPF_MEMWORDS+3*k+2].k = k;
+ insns[2*BPF_MEMWORDS+3*k+3].code = BPF_RET+BPF_A;
+ insns[2*BPF_MEMWORDS+3*k+3].k = 0;
+ }
+
+ insns[5*BPF_MEMWORDS+1].code = BPF_RET+BPF_K;
+ insns[5*BPF_MEMWORDS+1].k = UINT32_MAX;
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (k = 1; k <= sizeof(pkt); k++)
+ ATF_CHECK(jitcall(code, pkt, k, k) == 3*(k-1));
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_opt_ld_abs_1);
+ATF_TC_HEAD(bpfjit_opt_ld_abs_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_ABS");
+}
+
+ATF_TC_BODY(bpfjit_opt_ld_abs_1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 8),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 4),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_opt_ld_abs_2);
+ATF_TC_HEAD(bpfjit_opt_ld_abs_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_ABS");
+}
+
+ATF_TC_BODY(bpfjit_opt_ld_abs_2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 5),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_opt_ld_abs_3);
+ATF_TC_HEAD(bpfjit_opt_ld_abs_3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_ABS");
+}
+
+ATF_TC_BODY(bpfjit_opt_ld_abs_3, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 3, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 5),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_opt_ld_ind_1);
+ATF_TC_HEAD(bpfjit_opt_ld_ind_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(bpfjit_opt_ld_ind_1, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 12),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 0),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 8),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 14),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 18),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 4),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 18),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_opt_ld_ind_2);
+ATF_TC_HEAD(bpfjit_opt_ld_ind_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(bpfjit_opt_ld_ind_2, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 6),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 5),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_opt_ld_ind_3);
+ATF_TC_HEAD(bpfjit_opt_ld_ind_3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(bpfjit_opt_ld_ind_3, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 15),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 15),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 11),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 3, 7),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 6),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 11),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 4),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_opt_ld_ind_4);
+ATF_TC_HEAD(bpfjit_opt_ld_ind_4, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test JIT compilation with length optimization "
+ "applied to BPF_LD+BPF_IND");
+}
+
+ATF_TC_BODY(bpfjit_opt_ld_ind_4, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 11),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 19),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 15),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 3, 7),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 6),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 15),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 4),
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x800, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ size_t i, j;
+ bpfjit_func_t code;
+ uint8_t pkt[2][34] = {
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x0f,
+ 0x80, 0x03, 0x70, 0x23
+ },
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x08, 0x00,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 0x80, 0x03, 0x70, 0x23,
+ 0x80, 0x03, 0x70, 0x0f
+ }
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ for (i = 0; i < 2; i++) {
+ for (j = 1; j < sizeof(pkt[i]); j++)
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == 0);
+ ATF_CHECK(jitcall(code, pkt[i], j, j) == UINT32_MAX);
+ }
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_abc_ja);
+ATF_TC_HEAD(bpfjit_abc_ja, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test ABC optimization with a single BPF_JMP+BPF_JA");
+}
+
+ATF_TC_BODY(bpfjit_abc_ja, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 3), /* min. length 4 */
+ BPF_STMT(BPF_JMP+BPF_JA, 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, UINT32_MAX - 1),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 2), /* min. length 6 */
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 6),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 7),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[6] = {0, 0, /* UINT32_MAX: */ 255, 255, 255, 255};
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == UINT32_MAX);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_abc_ja_over);
+ATF_TC_HEAD(bpfjit_abc_ja_over, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test ABC optimization when BPF_JMP+BPF_JA jumps over all loads");
+}
+
+ATF_TC_BODY(bpfjit_abc_ja_over, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_JMP+BPF_JA, 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 3),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 4),
+ BPF_STMT(BPF_RET+BPF_K, 1),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 5),
+ BPF_STMT(BPF_RET+BPF_K, 2),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 6),
+ BPF_STMT(BPF_RET+BPF_K, 3),
+ };
+
+ uint8_t pkt[1]; /* the program doesn't read any data */
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+ ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX);
+}
+
+ATF_TC(bpfjit_abc_ld_chain);
+ATF_TC_HEAD(bpfjit_abc_ld_chain, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test ABC optimization of a chain of BPF_LD instructions "
+ "with exits leading to a single BPF_RET");
+}
+
+ATF_TC_BODY(bpfjit_abc_ld_chain, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 3), /* min. length 4 */
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 8, 0, 4),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 4), /* min. length 6 */
+ BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 7, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 6), /* min. length 10 */
+ BPF_JUMP(BPF_JMP+BPF_JGT+BPF_K, 6, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 123456789),
+ BPF_STMT(BPF_RET+BPF_K, 987654321),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[10] = {};
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+
+ /* !(pkt[3] == 8) => return 123456789 */
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 123456789);
+
+ /* !(pkt[4:2] >= 7) => too short or return 123456789 */
+ pkt[3] = 8;
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 123456789);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 123456789);
+
+ /* !(pkt[6:4] > 6) => too short or return 987654321 */
+ pkt[4] = pkt[5] = 1;
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 987654321);
+
+ /* (pkt[6:4] > 6) => too short or return 123456789 */
+ pkt[6] = pkt[7] = pkt[8] = pkt[9] = 1;
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 123456789);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_examples_1);
+ATF_TC_HEAD(bpfjit_examples_1, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test the first example from bpf(4) - "
+ "accept Reverse ARP requests");
+}
+
+ATF_TC_BODY(bpfjit_examples_1, tc)
+{
+ /*
+ * The following filter is taken from the Reverse ARP
+ * Daemon. It accepts only Reverse ARP requests.
+ */
+ struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8035, 0, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 20),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 3, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 42),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[22] = {};
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+
+ /* The packet doesn't match. */
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+
+ /* Still no match after setting the protocol field. */
+ pkt[12] = 0x80; pkt[13] = 0x35;
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+
+ /* Set RARP message type. */
+ pkt[21] = 3;
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 42);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+
+ /* Change RARP message type. */
+ pkt[20] = 3;
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_examples_2);
+ATF_TC_HEAD(bpfjit_examples_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test the second example from bpf(4) - "
+ "accept IP packets between two specified hosts");
+}
+
+ATF_TC_BODY(bpfjit_examples_2, tc)
+{
+ /*
+ * This filter accepts only IP packets between host 128.3.112.15
+ * and 128.3.112.35.
+ */
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x0800, 0, 8),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 26),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 2),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 3, 4),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x80037023, 0, 3),
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 30),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x8003700f, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[34] = {};
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+ ATF_CHECK(jitcall(code, pkt, 23, 23) == 0);
+ ATF_CHECK(jitcall(code, pkt, 24, 24) == 0);
+ ATF_CHECK(jitcall(code, pkt, 25, 25) == 0);
+ ATF_CHECK(jitcall(code, pkt, 26, 26) == 0);
+ ATF_CHECK(jitcall(code, pkt, 27, 27) == 0);
+ ATF_CHECK(jitcall(code, pkt, 28, 28) == 0);
+ ATF_CHECK(jitcall(code, pkt, 29, 29) == 0);
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+ ATF_CHECK(jitcall(code, pkt, 31, 31) == 0);
+ ATF_CHECK(jitcall(code, pkt, 32, 32) == 0);
+ ATF_CHECK(jitcall(code, pkt, 33, 33) == 0);
+
+ /* The packet doesn't match. */
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ /* Still no match after setting the protocol field. */
+ pkt[12] = 8;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ pkt[26] = 128; pkt[27] = 3; pkt[28] = 112; pkt[29] = 15;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ pkt[30] = 128; pkt[31] = 3; pkt[32] = 112; pkt[33] = 35;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == UINT32_MAX);
+
+ /* Swap the ip addresses. */
+ pkt[26] = 128; pkt[27] = 3; pkt[28] = 112; pkt[29] = 35;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ pkt[30] = 128; pkt[31] = 3; pkt[32] = 112; pkt[33] = 15;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == UINT32_MAX);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+ ATF_CHECK(jitcall(code, pkt, 23, 23) == 0);
+ ATF_CHECK(jitcall(code, pkt, 24, 24) == 0);
+ ATF_CHECK(jitcall(code, pkt, 25, 25) == 0);
+ ATF_CHECK(jitcall(code, pkt, 26, 26) == 0);
+ ATF_CHECK(jitcall(code, pkt, 27, 27) == 0);
+ ATF_CHECK(jitcall(code, pkt, 28, 28) == 0);
+ ATF_CHECK(jitcall(code, pkt, 29, 29) == 0);
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+ ATF_CHECK(jitcall(code, pkt, 31, 31) == 0);
+ ATF_CHECK(jitcall(code, pkt, 32, 32) == 0);
+ ATF_CHECK(jitcall(code, pkt, 33, 33) == 0);
+
+ /* Change the protocol field. */
+ pkt[13] = 8;
+ ATF_CHECK(jitcall(code, pkt, 34, 34) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_examples_3);
+ATF_TC_HEAD(bpfjit_examples_3, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test the third example from bpf(4) - "
+ "accept TCP finger packets");
+}
+
+ATF_TC_BODY(bpfjit_examples_3, tc)
+{
+ /*
+ * This filter returns only TCP finger packets.
+ */
+ struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x0800, 0, 10),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 23),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 6, 0, 8),
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 20),
+ BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x1fff, 6, 0),
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 14),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 14),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 79, 2, 0),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 16),
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 79, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, UINT32_MAX),
+ BPF_STMT(BPF_RET+BPF_K, 0),
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[30] = {};
+
+ /* Set IP fragment offset to non-zero. */
+ pkt[20] = 1; pkt[21] = 1;
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+ ATF_CHECK(jitcall(code, pkt, 23, 23) == 0);
+ ATF_CHECK(jitcall(code, pkt, 24, 24) == 0);
+ ATF_CHECK(jitcall(code, pkt, 25, 25) == 0);
+ ATF_CHECK(jitcall(code, pkt, 26, 26) == 0);
+ ATF_CHECK(jitcall(code, pkt, 27, 27) == 0);
+ ATF_CHECK(jitcall(code, pkt, 28, 28) == 0);
+ ATF_CHECK(jitcall(code, pkt, 29, 29) == 0);
+
+ /* The packet doesn't match. */
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Still no match after setting the protocol field. */
+ pkt[12] = 8;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Get one step closer to the match. */
+ pkt[23] = 6;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Set IP fragment offset to zero. */
+ pkt[20] = 0x20; pkt[21] = 0;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Set IP header length to 12. */
+ pkt[14] = 0xd3;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ /* Match one branch of the program. */
+ pkt[27] = 79;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == UINT32_MAX);
+
+ /* Match the other branch of the program. */
+ pkt[29] = 79; pkt[27] = 0;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == UINT32_MAX);
+
+ /* Packet is too short. */
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 2, 2) == 0);
+ ATF_CHECK(jitcall(code, pkt, 3, 3) == 0);
+ ATF_CHECK(jitcall(code, pkt, 4, 4) == 0);
+ ATF_CHECK(jitcall(code, pkt, 5, 5) == 0);
+ ATF_CHECK(jitcall(code, pkt, 6, 6) == 0);
+ ATF_CHECK(jitcall(code, pkt, 7, 7) == 0);
+ ATF_CHECK(jitcall(code, pkt, 8, 8) == 0);
+ ATF_CHECK(jitcall(code, pkt, 9, 9) == 0);
+ ATF_CHECK(jitcall(code, pkt, 10, 10) == 0);
+ ATF_CHECK(jitcall(code, pkt, 11, 11) == 0);
+ ATF_CHECK(jitcall(code, pkt, 12, 12) == 0);
+ ATF_CHECK(jitcall(code, pkt, 13, 13) == 0);
+ ATF_CHECK(jitcall(code, pkt, 14, 14) == 0);
+ ATF_CHECK(jitcall(code, pkt, 15, 15) == 0);
+ ATF_CHECK(jitcall(code, pkt, 16, 16) == 0);
+ ATF_CHECK(jitcall(code, pkt, 17, 17) == 0);
+ ATF_CHECK(jitcall(code, pkt, 18, 18) == 0);
+ ATF_CHECK(jitcall(code, pkt, 19, 19) == 0);
+ ATF_CHECK(jitcall(code, pkt, 20, 20) == 0);
+ ATF_CHECK(jitcall(code, pkt, 21, 21) == 0);
+ ATF_CHECK(jitcall(code, pkt, 22, 22) == 0);
+ ATF_CHECK(jitcall(code, pkt, 23, 23) == 0);
+ ATF_CHECK(jitcall(code, pkt, 24, 24) == 0);
+ ATF_CHECK(jitcall(code, pkt, 25, 25) == 0);
+ ATF_CHECK(jitcall(code, pkt, 26, 26) == 0);
+ ATF_CHECK(jitcall(code, pkt, 27, 27) == 0);
+ ATF_CHECK(jitcall(code, pkt, 28, 28) == 0);
+ ATF_CHECK(jitcall(code, pkt, 29, 29) == 0);
+
+ /* Set IP header length to 16. Packet is too short. */
+ pkt[14] = 4;
+ ATF_CHECK(jitcall(code, pkt, 30, 30) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_cop_no_ctx);
+ATF_TC_HEAD(bpfjit_cop_no_ctx, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that BPF_MISC|BPF_COP "
+ "instruction can't be accepted without a context");
+}
+
+ATF_TC_BODY(bpfjit_cop_no_ctx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_MISC+BPF_COP, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ bpfjit_func_t code;
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(!prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TC(bpfjit_copx_no_ctx);
+ATF_TC_HEAD(bpfjit_copx_no_ctx, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that BPF_MISC|BPF_COPX "
+ "instruction can't be accepted without a context");
+}
+
+ATF_TC_BODY(bpfjit_copx_no_ctx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ bpfjit_func_t code;
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(!prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * For every new test please also add a similar test
+ * to ../../lib/libbpfjit/t_bpfjit.c
+ */
+ ATF_TP_ADD_TC(tp, bpfjit_empty);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_add_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_sub_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_mul_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div0_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div1_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div2_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div4_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div10_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div10000_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div7609801_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div80000000_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_and_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_or_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_lsh_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_lsh0_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_rsh_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_rsh0_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_modulo_k);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_add_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_sub_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_mul_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div0_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div1_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div2_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div4_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div10_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div10000_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div7609801_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_div80000000_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_and_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_or_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_lsh_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_lsh0_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_rsh_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_rsh0_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_modulo_x);
+ ATF_TP_ADD_TC(tp, bpfjit_alu_neg);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_ja);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jgt_k);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jge_k);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jeq_k);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jset_k);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_modulo_k);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jgt_x);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jge_x);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jeq_x);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jset_x);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_modulo_x);
+ ATF_TP_ADD_TC(tp, bpfjit_ld_abs);
+ ATF_TP_ADD_TC(tp, bpfjit_ld_abs_k_overflow);
+ ATF_TP_ADD_TC(tp, bpfjit_ld_ind);
+ ATF_TP_ADD_TC(tp, bpfjit_ld_ind_k_overflow);
+ ATF_TP_ADD_TC(tp, bpfjit_ld_ind_x_overflow1);
+ ATF_TP_ADD_TC(tp, bpfjit_ld_ind_x_overflow2);
+ ATF_TP_ADD_TC(tp, bpfjit_ld_len);
+ ATF_TP_ADD_TC(tp, bpfjit_ld_imm);
+ ATF_TP_ADD_TC(tp, bpfjit_ldx_imm1);
+ ATF_TP_ADD_TC(tp, bpfjit_ldx_imm2);
+ ATF_TP_ADD_TC(tp, bpfjit_ldx_len1);
+ ATF_TP_ADD_TC(tp, bpfjit_ldx_len2);
+ ATF_TP_ADD_TC(tp, bpfjit_ldx_msh);
+ ATF_TP_ADD_TC(tp, bpfjit_misc_tax);
+ ATF_TP_ADD_TC(tp, bpfjit_misc_txa);
+ ATF_TP_ADD_TC(tp, bpfjit_st1);
+ ATF_TP_ADD_TC(tp, bpfjit_st2);
+ ATF_TP_ADD_TC(tp, bpfjit_st3);
+ ATF_TP_ADD_TC(tp, bpfjit_st4);
+ ATF_TP_ADD_TC(tp, bpfjit_st5);
+ ATF_TP_ADD_TC(tp, bpfjit_stx1);
+ ATF_TP_ADD_TC(tp, bpfjit_stx2);
+ ATF_TP_ADD_TC(tp, bpfjit_stx3);
+ ATF_TP_ADD_TC(tp, bpfjit_stx4);
+ ATF_TP_ADD_TC(tp, bpfjit_opt_ld_abs_1);
+ ATF_TP_ADD_TC(tp, bpfjit_opt_ld_abs_2);
+ ATF_TP_ADD_TC(tp, bpfjit_opt_ld_abs_3);
+ ATF_TP_ADD_TC(tp, bpfjit_opt_ld_ind_1);
+ ATF_TP_ADD_TC(tp, bpfjit_opt_ld_ind_2);
+ ATF_TP_ADD_TC(tp, bpfjit_opt_ld_ind_3);
+ ATF_TP_ADD_TC(tp, bpfjit_opt_ld_ind_4);
+ ATF_TP_ADD_TC(tp, bpfjit_abc_ja);
+ ATF_TP_ADD_TC(tp, bpfjit_abc_ja_over);
+ ATF_TP_ADD_TC(tp, bpfjit_abc_ld_chain);
+ ATF_TP_ADD_TC(tp, bpfjit_examples_1);
+ ATF_TP_ADD_TC(tp, bpfjit_examples_2);
+ ATF_TP_ADD_TC(tp, bpfjit_examples_3);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_no_ctx);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_no_ctx);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/bpfjit/t_cop.c b/contrib/netbsd-tests/net/bpfjit/t_cop.c
new file mode 100644
index 0000000..5a007e6
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpfjit/t_cop.c
@@ -0,0 +1,757 @@
+/* $NetBSD: t_cop.c,v 1.3 2014/07/13 21:35:33 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_cop.c,v 1.3 2014/07/13 21:35:33 alnsn Exp $");
+
+#include <stdint.h>
+#include <string.h>
+
+#define __BPF_PRIVATE
+#include <net/bpf.h>
+#include <net/bpfjit.h>
+
+#include "../../net/bpf/h_bpf.h"
+
+/* XXX: atf-c.h has collisions with mbuf */
+#undef m_type
+#undef m_data
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+static uint32_t retA(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+static uint32_t retBL(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+static uint32_t retWL(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+static uint32_t retNF(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+static uint32_t setARG(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+
+static const bpf_copfunc_t copfuncs[] = {
+ &retA,
+ &retBL,
+ &retWL,
+ &retNF,
+ &setARG
+};
+
+static const bpf_ctx_t ctx = {
+ .copfuncs = copfuncs,
+ .nfuncs = sizeof(copfuncs) / sizeof(copfuncs[0]),
+ .extwords = 0
+};
+
+static uint32_t
+retA(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return A;
+}
+
+static uint32_t
+retBL(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return args->buflen;
+}
+
+static uint32_t
+retWL(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return args->wirelen;
+}
+
+static uint32_t
+retNF(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return bc->nfuncs;
+}
+
+/*
+ * COP function with a side effect.
+ */
+static uint32_t
+setARG(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+ bool *arg = (bool *)args->arg;
+ bool old = *arg;
+
+ *arg = true;
+ return old;
+}
+
+ATF_TC(bpfjit_cop_no_ctx);
+ATF_TC_HEAD(bpfjit_cop_no_ctx, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that bpf program with BPF_COP "
+ "instruction isn't valid without a context");
+}
+
+ATF_TC_BODY(bpfjit_cop_no_ctx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_MISC+BPF_COP, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ bpfjit_func_t code;
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(!prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TC(bpfjit_cop_ret_A);
+ATF_TC_HEAD(bpfjit_cop_ret_A, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns a content of the A register");
+}
+
+ATF_TC_BODY(bpfjit_cop_ret_A, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 0), // retA
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 13);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_cop_ret_buflen);
+ATF_TC_HEAD(bpfjit_cop_ret_buflen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns the buflen argument");
+}
+
+ATF_TC_BODY(bpfjit_cop_ret_buflen, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 1), // retBL
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == sizeof(pkt));
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_cop_ret_wirelen);
+ATF_TC_HEAD(bpfjit_cop_ret_wirelen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns the wirelen argument");
+}
+
+ATF_TC_BODY(bpfjit_cop_ret_wirelen, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 2), // retWL
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == sizeof(pkt));
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_cop_ret_nfuncs);
+ATF_TC_HEAD(bpfjit_cop_ret_nfuncs, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns nfuncs member of the context argument");
+}
+
+ATF_TC_BODY(bpfjit_cop_ret_nfuncs, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 3), // retNF
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == ctx.nfuncs);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_cop_side_effect);
+ATF_TC_HEAD(bpfjit_cop_side_effect, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that ABC optimization doesn't skip BPF_COP call");
+}
+
+ATF_TC_BODY(bpfjit_cop_side_effect, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0),
+ BPF_STMT(BPF_MISC+BPF_COP, 4), // setARG
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 99999),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ bool arg = false;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = NULL,
+ .arg = &arg
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+ ATF_CHECK(arg == true);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_cop_copx);
+ATF_TC_HEAD(bpfjit_cop_copx, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test BPF_COP call followed by BPF_COPX call");
+}
+
+ATF_TC_BODY(bpfjit_cop_copx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1), /* A <- 1 */
+ BPF_STMT(BPF_MISC+BPF_COP, 0), /* retA */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0), /* A = P[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+ BPF_STMT(BPF_MISC+BPF_COPX, 0), /* retNF */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 2 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3 + ctx.nfuncs);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_cop_invalid_index);
+ATF_TC_HEAD(bpfjit_cop_invalid_index, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that out-of-range coprocessor function fails validation");
+}
+
+ATF_TC_BODY(bpfjit_cop_invalid_index, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COP, 6), // invalid index
+ BPF_STMT(BPF_RET+BPF_K, 27)
+ };
+
+ bpfjit_func_t code;
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TC(bpfjit_copx_no_ctx);
+ATF_TC_HEAD(bpfjit_copx_no_ctx, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that bpf program with BPF_COPX "
+ "instruction isn't valid without a context");
+}
+
+ATF_TC_BODY(bpfjit_copx_no_ctx, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_MISC+BPF_COP, 0),
+ BPF_STMT(BPF_RET+BPF_K, 7)
+ };
+
+ bpfjit_func_t code;
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ ATF_CHECK(!prog_validate(insns, insn_count));
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
+ rump_unschedule();
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TC(bpfjit_copx_ret_A);
+ATF_TC_HEAD(bpfjit_copx_ret_A, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns a content of the A register");
+}
+
+ATF_TC_BODY(bpfjit_copx_ret_A, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LDX+BPF_IMM, 0), // retA
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 13);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_copx_ret_buflen);
+ATF_TC_HEAD(bpfjit_copx_ret_buflen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns the buflen argument");
+}
+
+ATF_TC_BODY(bpfjit_copx_ret_buflen, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LDX+BPF_IMM, 1), // retBL
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == sizeof(pkt));
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_copx_ret_wirelen);
+ATF_TC_HEAD(bpfjit_copx_ret_wirelen, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns the wirelen argument");
+}
+
+ATF_TC_BODY(bpfjit_copx_ret_wirelen, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_IMM, 2), // retWL
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == sizeof(pkt));
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_copx_ret_nfuncs);
+ATF_TC_HEAD(bpfjit_copx_ret_nfuncs, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns nfuncs member of the context argument");
+}
+
+ATF_TC_BODY(bpfjit_copx_ret_nfuncs, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LDX+BPF_IMM, 3), // retNF
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == ctx.nfuncs);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_copx_side_effect);
+ATF_TC_HEAD(bpfjit_copx_side_effect, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that ABC optimization doesn't skip BPF_COPX call");
+}
+
+ATF_TC_BODY(bpfjit_copx_side_effect, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0),
+ BPF_STMT(BPF_LDX+BPF_IMM, 4), // setARG
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 99999),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ bool arg = false;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = NULL,
+ .arg = &arg
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+ ATF_CHECK(arg == true);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_copx_cop);
+ATF_TC_HEAD(bpfjit_copx_cop, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test BPF_COPX call followed by BPF_COP call");
+}
+
+ATF_TC_BODY(bpfjit_copx_cop, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_IMM, 2), /* X <- 2 */
+ BPF_STMT(BPF_MISC+BPF_COPX, 0), /* retWL */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0), /* A = P[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+ BPF_STMT(BPF_MISC+BPF_COP, 3), /* retNF */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 1), /* A = A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 2 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 5 + ctx.nfuncs);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_copx_invalid_index);
+ATF_TC_HEAD(bpfjit_copx_invalid_index, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Test that out-of-range BPF_COPX call fails at runtime");
+}
+
+ATF_TC_BODY(bpfjit_copx_invalid_index, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_IMM, 5), // invalid index
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_K, 27)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt)
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * For every new test please also add a similar test
+ * to ../../lib/libbpfjit/t_cop.c
+ */
+ ATF_TP_ADD_TC(tp, bpfjit_cop_no_ctx);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_ret_A);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_ret_buflen);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_ret_wirelen);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_ret_nfuncs);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_side_effect);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_copx);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_invalid_index);
+
+ ATF_TP_ADD_TC(tp, bpfjit_copx_no_ctx);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_ret_A);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_ret_buflen);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_ret_wirelen);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_ret_nfuncs);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_side_effect);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_cop);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_invalid_index);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/bpfjit/t_extmem.c b/contrib/netbsd-tests/net/bpfjit/t_extmem.c
new file mode 100644
index 0000000..915c436
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpfjit/t_extmem.c
@@ -0,0 +1,506 @@
+/* $NetBSD: t_extmem.c,v 1.1 2014/07/09 13:49:49 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_extmem.c,v 1.1 2014/07/09 13:49:49 alnsn Exp $");
+
+#include <stdint.h>
+#include <string.h>
+
+#define __BPF_PRIVATE
+#include <net/bpf.h>
+#include <net/bpfjit.h>
+
+#include "../../net/bpf/h_bpf.h"
+
+/* XXX: atf-c.h has collisions with mbuf */
+#undef m_type
+#undef m_data
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+static uint32_t retM(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A);
+
+static const bpf_copfunc_t copfuncs[] = {
+ &retM
+};
+
+static const bpf_ctx_t ctx = {
+ .copfuncs = copfuncs,
+ .nfuncs = sizeof(copfuncs) / sizeof(copfuncs[0]),
+ .extwords = 4,
+ .preinited = BPF_MEMWORD_INIT(0) | BPF_MEMWORD_INIT(3),
+};
+
+static uint32_t
+retM(const bpf_ctx_t *bc, bpf_args_t *args, uint32_t A)
+{
+
+ return args->mem[(uintptr_t)args->arg];
+}
+
+
+ATF_TC(bpfjit_extmem_load_preinited);
+ATF_TC_HEAD(bpfjit_extmem_load_preinited, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test a load of external "
+ "pre-initialized memory");
+}
+
+ATF_TC_BODY(bpfjit_extmem_load_preinited, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_MEM, 3),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_extmem_invalid_load);
+ATF_TC_HEAD(bpfjit_extmem_invalid_load, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that out-of-range load "
+ "fails validation");
+}
+
+ATF_TC_BODY(bpfjit_extmem_invalid_load, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_MEM, 4),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TC(bpfjit_extmem_store);
+ATF_TC_HEAD(bpfjit_extmem_store, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test stores to external memory");
+}
+
+ATF_TC_BODY(bpfjit_extmem_store, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1), /* A <- 1 */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2), /* X <- 2 */
+ BPF_STMT(BPF_ST, 1), /* M[1] <- A */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_STX, 2), /* M[2] <- X */
+ BPF_STMT(BPF_ST, 3), /* M[3] <- A */
+ BPF_STMT(BPF_RET+BPF_A, 0) /* ret A */
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 7;
+
+ mem[1] = mem[2] = 0xdeadbeef;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+
+ ATF_CHECK(mem[0] == 0);
+ ATF_CHECK(mem[1] == 1);
+ ATF_CHECK(mem[2] == 2);
+ ATF_CHECK(mem[3] == 3);
+}
+
+ATF_TC(bpfjit_extmem_side_effect);
+ATF_TC_HEAD(bpfjit_extmem_side_effect, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that ABC optimization doesn\'t "
+ "skip stores to external memory");
+}
+
+ATF_TC_BODY(bpfjit_extmem_side_effect, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0), /* A <- P[0] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 2), /* X <- 2 */
+ BPF_STMT(BPF_ST, 1), /* M[1] <- A */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_STX, 2), /* M[2] <- X */
+ BPF_STMT(BPF_ST, 3), /* M[3] <- A */
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 99), /* A <- P[99] */
+ BPF_STMT(BPF_RET+BPF_A, 0) /* ret A */
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 1 };
+ uint32_t mem[ctx.extwords];
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 7;
+
+ mem[1] = mem[2] = 0xdeadbeef;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 0);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+
+ ATF_CHECK(mem[0] == 0);
+ ATF_CHECK(mem[1] == 1);
+ ATF_CHECK(mem[2] == 2);
+ ATF_CHECK(mem[3] == 3);
+}
+
+ATF_TC(bpfjit_extmem_invalid_store);
+ATF_TC_HEAD(bpfjit_extmem_invalid_store, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test that out-of-range store "
+ "fails validation");
+}
+
+ATF_TC_BODY(bpfjit_extmem_invalid_store, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_ST, 4),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_CHECK(code == NULL);
+}
+
+ATF_TC(bpfjit_cop_ret_mem);
+ATF_TC_HEAD(bpfjit_cop_ret_mem, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns a content of external memory word");
+}
+
+ATF_TC_BODY(bpfjit_cop_ret_mem, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_ST, 2),
+ BPF_STMT(BPF_LD+BPF_IMM, 137),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_MISC+BPF_COP, 0), // retM
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+ void *arg = (void*)(uintptr_t)2;
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .arg = arg,
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 13);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_cop_ret_preinited_mem);
+ATF_TC_HEAD(bpfjit_cop_ret_preinited_mem, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function that "
+ "returns a content of external pre-initialized memory word");
+}
+
+ATF_TC_BODY(bpfjit_cop_ret_preinited_mem, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_ST, 2),
+ BPF_STMT(BPF_LD+BPF_IMM, 137),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_MISC+BPF_COP, 0), // retM
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+ void *arg = (void*)(uintptr_t)3;
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .arg = arg,
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_copx_ret_mem);
+ATF_TC_HEAD(bpfjit_copx_ret_mem, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function "
+ "that returns a content of external memory word");
+}
+
+ATF_TC_BODY(bpfjit_copx_ret_mem, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_ST, 2),
+ BPF_STMT(BPF_LD+BPF_IMM, 137),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_LDX+BPF_IMM, 0), // retM
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+ void *arg = (void*)(uintptr_t)2;
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .arg = arg,
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 13);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TC(bpfjit_copx_ret_preinited_mem);
+ATF_TC_HEAD(bpfjit_copx_ret_preinited_mem, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test coprocessor function that "
+ "returns a content of external pre-initialized memory word");
+}
+
+ATF_TC_BODY(bpfjit_copx_ret_preinited_mem, tc)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 13),
+ BPF_STMT(BPF_ST, 2),
+ BPF_STMT(BPF_LD+BPF_IMM, 137),
+ BPF_STMT(BPF_ST, 1),
+ BPF_STMT(BPF_LDX+BPF_IMM, 0), // retM
+ BPF_STMT(BPF_MISC+BPF_COPX, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0)
+ };
+
+ bpfjit_func_t code;
+ uint8_t pkt[1] = { 0 };
+ uint32_t mem[ctx.extwords];
+ void *arg = (void*)(uintptr_t)3;
+
+ /* Pre-inited words. */
+ mem[0] = 0;
+ mem[3] = 3;
+
+ bpf_args_t args = {
+ .pkt = pkt,
+ .buflen = sizeof(pkt),
+ .wirelen = sizeof(pkt),
+ .arg = arg,
+ .mem = mem,
+ };
+
+ size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ RZ(rump_init());
+
+ rump_schedule();
+ code = rumpns_bpfjit_generate_code(&ctx, insns, insn_count);
+ rump_unschedule();
+ ATF_REQUIRE(code != NULL);
+
+ ATF_CHECK(code(&ctx, &args) == 3);
+
+ rump_schedule();
+ rumpns_bpfjit_free_code(code);
+ rump_unschedule();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * For every new test please also add a similar test
+ * to ../../lib/libbpfjit/t_extmem.c
+ */
+ //ATF_TP_ADD_TC(tp, bpfjit_extmem_load_default);
+ ATF_TP_ADD_TC(tp, bpfjit_extmem_load_preinited);
+ ATF_TP_ADD_TC(tp, bpfjit_extmem_invalid_load);
+ ATF_TP_ADD_TC(tp, bpfjit_extmem_store);
+ ATF_TP_ADD_TC(tp, bpfjit_extmem_side_effect);
+ ATF_TP_ADD_TC(tp, bpfjit_extmem_invalid_store);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_ret_mem);
+ ATF_TP_ADD_TC(tp, bpfjit_cop_ret_preinited_mem);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_ret_mem);
+ ATF_TP_ADD_TC(tp, bpfjit_copx_ret_preinited_mem);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/bpfjit/t_mbuf.c b/contrib/netbsd-tests/net/bpfjit/t_mbuf.c
new file mode 100644
index 0000000..489ef80
--- /dev/null
+++ b/contrib/netbsd-tests/net/bpfjit/t_mbuf.c
@@ -0,0 +1,982 @@
+/* $NetBSD: t_mbuf.c,v 1.1 2014/07/08 21:45:55 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list 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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_mbuf.c,v 1.1 2014/07/08 21:45:55 alnsn Exp $");
+
+#include <sys/param.h>
+#include <sys/mbuf.h>
+
+#include <net/bpf.h>
+#include <net/bpfjit.h>
+
+#include <stdint.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../net/bpf/h_bpf.h"
+
+/* XXX: atf-c.h has collisions with mbuf */
+#undef m_type
+#undef m_data
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+static bool
+test_ldb_abs(size_t split)
+{
+ /* Return a product of all packet bytes. */
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 0), /* A <- P[0] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 1), /* A <- P[1] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 2), /* A <- P[2] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 3), /* A <- P[3] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 4), /* A <- P[4] */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 120;
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldh_abs(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 0), /* A <- P[0:2] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 1), /* A <- P[1:2] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 2), /* A <- P[2:2] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 3), /* A <- P[3:2] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 0x0a0e; /* 10 14 */
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldw_abs(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0), /* A <- P[0:4] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_MISC+BPF_TAX, 0), /* X <- A */
+
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 1), /* A <- P[1:4] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 0x03050709;
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldb_ind(size_t split)
+{
+ /* Return a sum of all packet bytes. */
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0), /* A <- P[0+X] */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1), /* A <- P[1+X] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1), /* A <- P[1+X] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 2), /* A <- P[2+X] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 3), /* A <- P[3+X] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 15;
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldw_ind(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 0), /* A <- P[X+0:4] */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 0), /* A <- P[X+0:4] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 0), /* X <- 0 */
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 1), /* A <- P[X+1:4] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 0x05080b0e;
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldh_ind(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 0), /* A <- P[X+0:2] */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1), /* A <- P[X+1:2] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1), /* A <- P[X+1:2] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_ST, 0), /* M[0] <- A */
+
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1), /* X <- 1 */
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 2), /* A <- P[X+2:2] */
+ BPF_STMT(BPF_LDX+BPF_W+BPF_MEM, 0), /* X <- M[0] */
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0), /* A <- A + X */
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 0x0a0e; /* 10 14 */
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == res;
+}
+
+static bool
+test_msh(size_t split)
+{
+ /* Return a product of all packet bytes. */
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 1), /* A <- 1 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 0), /* X <- 4*(P[0]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 1), /* X <- 4*(P[1]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 2), /* X <- 4*(P[2]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 3), /* X <- 4*(P[3]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 4), /* X <- 4*(P[4]&0xf) */
+ BPF_STMT(BPF_ALU+BPF_MUL+BPF_X, 0), /* A <- A * X */
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 4), /* A <- A / 4 */
+
+ BPF_STMT(BPF_RET+BPF_A, 0), /* ret A */
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const unsigned int res = 120;
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == res;
+}
+
+static bool
+test_ldb_abs_overflow(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldh_abs_overflow(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 4),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldw_abs_overflow(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 2),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldb_ind_overflow1(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 5),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldb_ind_overflow2(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 4),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldb_ind_overflow3(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_B+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldh_ind_overflow1(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 4),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldh_ind_overflow2(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 3),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldh_ind_overflow3(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_H+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldw_ind_overflow1(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 2),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldw_ind_overflow2(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, 1),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_ldw_ind_overflow3(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_W+BPF_IMM, UINT32_MAX),
+ BPF_STMT(BPF_LD+BPF_W+BPF_IND, 1),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+static bool
+test_msh_overflow(size_t split)
+{
+ static struct bpf_insn insns[] = {
+ BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 5),
+ BPF_STMT(BPF_MISC+BPF_TXA, 0),
+ BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, 1),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+ };
+
+ static unsigned char P[] = { 1, 2, 3, 4, 5 };
+ const size_t insn_count = sizeof(insns) / sizeof(insns[0]);
+
+ if (!prog_validate(insns, insn_count))
+ return false;
+
+ return exec_prog_mchain2(insns, insn_count, P, sizeof(P), split) == 0;
+}
+
+ATF_TC(bpfjit_mbuf_ldb_abs);
+ATF_TC_HEAD(bpfjit_mbuf_ldb_abs, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_ABS "
+ "loads bytes from mbuf correctly");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldb_abs, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_abs(0));
+ ATF_CHECK(test_ldb_abs(1));
+ ATF_CHECK(test_ldb_abs(2));
+ ATF_CHECK(test_ldb_abs(3));
+ ATF_CHECK(test_ldb_abs(4));
+ ATF_CHECK(test_ldb_abs(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldh_abs);
+ATF_TC_HEAD(bpfjit_mbuf_ldh_abs, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_ABS "
+ "loads halfwords from mbuf correctly");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldh_abs, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_abs(0));
+ ATF_CHECK(test_ldh_abs(1));
+ ATF_CHECK(test_ldh_abs(2));
+ ATF_CHECK(test_ldh_abs(3));
+ ATF_CHECK(test_ldh_abs(4));
+ ATF_CHECK(test_ldh_abs(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldw_abs);
+ATF_TC_HEAD(bpfjit_mbuf_ldw_abs, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_ABS "
+ "loads words from mbuf correctly");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldw_abs, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_abs(0));
+ ATF_CHECK(test_ldw_abs(1));
+ ATF_CHECK(test_ldw_abs(2));
+ ATF_CHECK(test_ldw_abs(3));
+ ATF_CHECK(test_ldw_abs(4));
+ ATF_CHECK(test_ldw_abs(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldb_ind);
+ATF_TC_HEAD(bpfjit_mbuf_ldb_ind, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_IND "
+ "loads bytes from mbuf correctly");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldb_ind, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_ind(0));
+ ATF_CHECK(test_ldb_ind(1));
+ ATF_CHECK(test_ldb_ind(2));
+ ATF_CHECK(test_ldb_ind(3));
+ ATF_CHECK(test_ldb_ind(4));
+ ATF_CHECK(test_ldb_ind(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldh_ind);
+ATF_TC_HEAD(bpfjit_mbuf_ldh_ind, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_IND "
+ "loads halfwords from mbuf correctly");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldh_ind, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_ind(0));
+ ATF_CHECK(test_ldh_ind(1));
+ ATF_CHECK(test_ldh_ind(2));
+ ATF_CHECK(test_ldh_ind(3));
+ ATF_CHECK(test_ldh_ind(4));
+ ATF_CHECK(test_ldh_ind(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldw_ind);
+ATF_TC_HEAD(bpfjit_mbuf_ldw_ind, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_IND "
+ "loads words from mbuf correctly");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldw_ind, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_ind(0));
+ ATF_CHECK(test_ldw_ind(1));
+ ATF_CHECK(test_ldw_ind(2));
+ ATF_CHECK(test_ldw_ind(3));
+ ATF_CHECK(test_ldw_ind(4));
+ ATF_CHECK(test_ldw_ind(5));
+}
+
+ATF_TC(bpfjit_mbuf_msh);
+ATF_TC_HEAD(bpfjit_mbuf_msh, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LDX+BPF_B+BPF_MSH "
+ "loads bytes from mbuf correctly");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_msh, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_msh(0));
+ ATF_CHECK(test_msh(1));
+ ATF_CHECK(test_msh(2));
+ ATF_CHECK(test_msh(3));
+ ATF_CHECK(test_msh(4));
+ ATF_CHECK(test_msh(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldb_abs_overflow);
+ATF_TC_HEAD(bpfjit_mbuf_ldb_abs_overflow, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_ABS "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldb_abs_overflow, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_abs_overflow(0));
+ ATF_CHECK(test_ldb_abs_overflow(1));
+ ATF_CHECK(test_ldb_abs_overflow(2));
+ ATF_CHECK(test_ldb_abs_overflow(3));
+ ATF_CHECK(test_ldb_abs_overflow(4));
+ ATF_CHECK(test_ldb_abs_overflow(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldh_abs_overflow);
+ATF_TC_HEAD(bpfjit_mbuf_ldh_abs_overflow, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_ABS "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldh_abs_overflow, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_abs_overflow(0));
+ ATF_CHECK(test_ldh_abs_overflow(1));
+ ATF_CHECK(test_ldh_abs_overflow(2));
+ ATF_CHECK(test_ldh_abs_overflow(3));
+ ATF_CHECK(test_ldh_abs_overflow(4));
+ ATF_CHECK(test_ldh_abs_overflow(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldw_abs_overflow);
+ATF_TC_HEAD(bpfjit_mbuf_ldw_abs_overflow, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_ABS "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldw_abs_overflow, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_abs_overflow(0));
+ ATF_CHECK(test_ldw_abs_overflow(1));
+ ATF_CHECK(test_ldw_abs_overflow(2));
+ ATF_CHECK(test_ldw_abs_overflow(3));
+ ATF_CHECK(test_ldw_abs_overflow(4));
+ ATF_CHECK(test_ldw_abs_overflow(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldb_ind_overflow1);
+ATF_TC_HEAD(bpfjit_mbuf_ldb_ind_overflow1, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldb_ind_overflow1, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_ind_overflow1(0));
+ ATF_CHECK(test_ldb_ind_overflow1(1));
+ ATF_CHECK(test_ldb_ind_overflow1(2));
+ ATF_CHECK(test_ldb_ind_overflow1(3));
+ ATF_CHECK(test_ldb_ind_overflow1(4));
+ ATF_CHECK(test_ldb_ind_overflow1(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldb_ind_overflow2);
+ATF_TC_HEAD(bpfjit_mbuf_ldb_ind_overflow2, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldb_ind_overflow2, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_ind_overflow2(0));
+ ATF_CHECK(test_ldb_ind_overflow2(1));
+ ATF_CHECK(test_ldb_ind_overflow2(2));
+ ATF_CHECK(test_ldb_ind_overflow2(3));
+ ATF_CHECK(test_ldb_ind_overflow2(4));
+ ATF_CHECK(test_ldb_ind_overflow2(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldb_ind_overflow3);
+ATF_TC_HEAD(bpfjit_mbuf_ldb_ind_overflow3, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_B+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldb_ind_overflow3, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldb_ind_overflow3(0));
+ ATF_CHECK(test_ldb_ind_overflow3(1));
+ ATF_CHECK(test_ldb_ind_overflow3(2));
+ ATF_CHECK(test_ldb_ind_overflow3(3));
+ ATF_CHECK(test_ldb_ind_overflow3(4));
+ ATF_CHECK(test_ldb_ind_overflow3(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldh_ind_overflow1);
+ATF_TC_HEAD(bpfjit_mbuf_ldh_ind_overflow1, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldh_ind_overflow1, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_ind_overflow1(0));
+ ATF_CHECK(test_ldh_ind_overflow1(1));
+ ATF_CHECK(test_ldh_ind_overflow1(2));
+ ATF_CHECK(test_ldh_ind_overflow1(3));
+ ATF_CHECK(test_ldh_ind_overflow1(4));
+ ATF_CHECK(test_ldh_ind_overflow1(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldh_ind_overflow2);
+ATF_TC_HEAD(bpfjit_mbuf_ldh_ind_overflow2, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldh_ind_overflow2, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_ind_overflow2(0));
+ ATF_CHECK(test_ldh_ind_overflow2(1));
+ ATF_CHECK(test_ldh_ind_overflow2(2));
+ ATF_CHECK(test_ldh_ind_overflow2(3));
+ ATF_CHECK(test_ldh_ind_overflow2(4));
+ ATF_CHECK(test_ldh_ind_overflow2(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldh_ind_overflow3);
+ATF_TC_HEAD(bpfjit_mbuf_ldh_ind_overflow3, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_H+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldh_ind_overflow3, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldh_ind_overflow3(0));
+ ATF_CHECK(test_ldh_ind_overflow3(1));
+ ATF_CHECK(test_ldh_ind_overflow3(2));
+ ATF_CHECK(test_ldh_ind_overflow3(3));
+ ATF_CHECK(test_ldh_ind_overflow3(4));
+ ATF_CHECK(test_ldh_ind_overflow3(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldw_ind_overflow1);
+ATF_TC_HEAD(bpfjit_mbuf_ldw_ind_overflow1, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldw_ind_overflow1, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_ind_overflow1(0));
+ ATF_CHECK(test_ldw_ind_overflow1(1));
+ ATF_CHECK(test_ldw_ind_overflow1(2));
+ ATF_CHECK(test_ldw_ind_overflow1(3));
+ ATF_CHECK(test_ldw_ind_overflow1(4));
+ ATF_CHECK(test_ldw_ind_overflow1(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldw_ind_overflow2);
+ATF_TC_HEAD(bpfjit_mbuf_ldw_ind_overflow2, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldw_ind_overflow2, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_ind_overflow2(0));
+ ATF_CHECK(test_ldw_ind_overflow2(1));
+ ATF_CHECK(test_ldw_ind_overflow2(2));
+ ATF_CHECK(test_ldw_ind_overflow2(3));
+ ATF_CHECK(test_ldw_ind_overflow2(4));
+ ATF_CHECK(test_ldw_ind_overflow2(5));
+}
+
+ATF_TC(bpfjit_mbuf_ldw_ind_overflow3);
+ATF_TC_HEAD(bpfjit_mbuf_ldw_ind_overflow3, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LD+BPF_W+BPF_IND "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_ldw_ind_overflow3, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_ldw_ind_overflow3(0));
+ ATF_CHECK(test_ldw_ind_overflow3(1));
+ ATF_CHECK(test_ldw_ind_overflow3(2));
+ ATF_CHECK(test_ldw_ind_overflow3(3));
+ ATF_CHECK(test_ldw_ind_overflow3(4));
+ ATF_CHECK(test_ldw_ind_overflow3(5));
+}
+
+ATF_TC(bpfjit_mbuf_msh_overflow);
+ATF_TC_HEAD(bpfjit_mbuf_msh_overflow, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that BPF_LDX+BPF_B+BPF_MSH "
+ "with out-of-bounds index aborts a filter program");
+}
+
+ATF_TC_BODY(bpfjit_mbuf_msh_overflow, tc)
+{
+
+ RZ(rump_init());
+
+ ATF_CHECK(test_msh_overflow(0));
+ ATF_CHECK(test_msh_overflow(1));
+ ATF_CHECK(test_msh_overflow(2));
+ ATF_CHECK(test_msh_overflow(3));
+ ATF_CHECK(test_msh_overflow(4));
+ ATF_CHECK(test_msh_overflow(5));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ /*
+ * For every new test please also add a similar test
+ * to ../../net/bpf/t_mbuf.c
+ */
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldb_abs);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldh_abs);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldw_abs);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldb_ind);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldh_ind);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldw_ind);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_msh);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldb_abs_overflow);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldh_abs_overflow);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldw_abs_overflow);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldb_ind_overflow1);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldb_ind_overflow2);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldb_ind_overflow3);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldh_ind_overflow1);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldh_ind_overflow2);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldh_ind_overflow3);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldw_ind_overflow1);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldw_ind_overflow2);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_ldw_ind_overflow3);
+ ATF_TP_ADD_TC(tp, bpfjit_mbuf_msh_overflow);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/carp/t_basic.c b/contrib/netbsd-tests/net/carp/t_basic.c
new file mode 100644
index 0000000..fe2e6b5
--- /dev/null
+++ b/contrib/netbsd-tests/net/carp/t_basic.c
@@ -0,0 +1,221 @@
+/* $NetBSD: t_basic.c,v 1.5 2011/06/26 13:13:31 christos Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: t_basic.c,v 1.5 2011/06/26 13:13:31 christos Exp $");
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip_carp.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include "../config/netconfig.c"
+#include "../../h_macros.h"
+
+static bool oknow = false;
+
+static void
+sighnd(int sig)
+{
+
+ ATF_REQUIRE_EQ(sig, SIGCHLD);
+ if (oknow)
+ return;
+
+ atf_tc_fail("child died unexpectedly");
+}
+
+ATF_TC(handover);
+ATF_TC_HEAD(handover, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check that carp handover works if "
+ "the master dies");
+}
+
+#define THEBUS "buuuuuuus,etherbus"
+
+static void
+child(bool master)
+{
+ char ifname[IFNAMSIZ];
+ struct carpreq cr;
+ struct ifreq ifr;
+ const char *carpif;
+ int s;
+
+ /* helps reading carp debug output */
+ if (master)
+ carpif = "carp0";
+ else
+ carpif = "carp1";
+
+ /*
+ * Should use sysctl, bug debug is dabug.
+ */
+ {
+ //extern int rumpns_carp_opts[]; /* XXX */
+ //rumpns_carp_opts[CARPCTL_LOG] = 1;
+ }
+
+
+ rump_init();
+
+ memset(&ifr, 0, sizeof(ifr));
+ strlcpy(ifr.ifr_name, carpif, sizeof(ifr.ifr_name));
+
+ RL(s = rump_sys_socket(PF_INET, SOCK_DGRAM, 0));
+ RL(rump_sys_ioctl(s, SIOCIFCREATE, &ifr));
+
+ netcfg_rump_makeshmif(THEBUS, ifname);
+
+ if (master)
+ netcfg_rump_if(ifname, "10.1.1.1", "255.255.255.0");
+ else
+ netcfg_rump_if(ifname, "10.1.1.2", "255.255.255.0");
+
+ /* configure the carp interface */
+ ifr.ifr_data = &cr;
+ RL(rump_sys_ioctl(s, SIOCGVH, &ifr));
+
+ strlcpy(cr.carpr_carpdev, ifname, sizeof(cr.carpr_carpdev));
+ cr.carpr_vhid = 175;
+ if (master)
+ cr.carpr_advskew = 0;
+ else
+ cr.carpr_advskew = 200;
+ cr.carpr_advbase = 1;
+ strcpy((char *)cr.carpr_key, "s3cret");
+
+ RL(rump_sys_ioctl(s, SIOCSVH, &ifr));
+ netcfg_rump_if(carpif, "10.1.1.100", "255.255.255.0");
+
+ /* tassa pause()en enka muuta voi */
+ pause();
+}
+
+ATF_TC_BODY(handover, tc)
+{
+ char ifname[IFNAMSIZ];
+ pid_t mpid, cpid;
+ int i, status;
+
+ signal(SIGCHLD, sighnd);
+
+ /* fork master */
+ switch (mpid = fork()) {
+ case -1:
+ atf_tc_fail_errno("fork failed");
+ /*NOTREACHED*/
+ case 0:
+ child(true);
+ /*NOTREACHED*/
+ default:
+ break;
+ }
+
+ usleep(500000);
+
+ /* fork backup */
+ switch (cpid = fork()) {
+ case -1:
+ kill(mpid, SIGKILL);
+ atf_tc_fail_errno("fork failed");
+ /*NOTREACHED*/
+ case 0:
+ child(false);
+ /*NOTREACHED*/
+ default:
+ break;
+ }
+
+ usleep(500000);
+
+ rump_init();
+ netcfg_rump_makeshmif(THEBUS, ifname);
+ netcfg_rump_if(ifname, "10.1.1.240", "255.255.255.0");
+
+ /* check that the primary addresses are up */
+ ATF_REQUIRE_EQ(netcfg_rump_pingtest("10.1.1.1", 1000), true);
+ ATF_REQUIRE_EQ(netcfg_rump_pingtest("10.1.1.2", 1000), true);
+
+ /* give carp a while to croak */
+ sleep(4);
+
+ /* check that the shared IP works */
+ ATF_REQUIRE_EQ(netcfg_rump_pingtest("10.1.1.100", 500), true);
+
+ /* KILLING SPREE */
+ oknow = true;
+ kill(mpid, SIGKILL);
+ wait(&status);
+ usleep(10000); /* just in case */
+ oknow = false;
+
+ /* check that primary is now dead */
+ ATF_REQUIRE_EQ(netcfg_rump_pingtest("10.1.1.1", 100), false);
+
+ /* do it in installments. carp will cluck meanwhile */
+ for (i = 0; i < 5; i++) {
+ if (netcfg_rump_pingtest("10.1.1.100", 1000) == true)
+ break;
+ }
+ if (i == 5)
+ atf_tc_fail("failed to failover");
+
+ /* to kill the child */
+ oknow = true;
+ kill(cpid, SIGKILL);
+
+ /* clean & done */
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, handover);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/config/netconfig.c b/contrib/netbsd-tests/net/config/netconfig.c
new file mode 100644
index 0000000..c2f9dd4
--- /dev/null
+++ b/contrib/netbsd-tests/net/config/netconfig.c
@@ -0,0 +1,231 @@
+/* $NetBSD: netconfig.c,v 1.8 2013/07/03 19:13:33 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: netconfig.c,v 1.8 2013/07/03 19:13:33 pooka Exp $");
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+
+#include <arpa/inet.h>
+
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+
+int noatf;
+
+static void __unused
+netcfg_rump_makeshmif(const char *busname, char *ifname)
+{
+ int rv, ifnum;
+
+ if ((rv = rump_pub_shmif_create(busname, &ifnum)) != 0) {
+ if (noatf)
+ err(1, "makeshmif: rump_pub_shmif_create %d", rv);
+ else
+ atf_tc_fail("makeshmif: rump_pub_shmif_create %d", rv);
+ }
+ sprintf(ifname, "shmif%d", ifnum);
+}
+
+static void __unused
+netcfg_rump_if(const char *ifname, const char *addr, const char *mask)
+{
+ struct ifaliasreq ia;
+ struct sockaddr_in *sin;
+ in_addr_t inaddr, inmask;
+ int s, rv;
+
+ s = -1;
+ if ((s = rump_sys_socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
+ if (noatf)
+ err(1, "if config socket");
+ else
+ atf_tc_fail_errno("if config socket");
+ }
+
+ inaddr = inet_addr(addr);
+ inmask = inet_addr(mask);
+
+ /* Address */
+ memset(&ia, 0, sizeof(ia));
+ strcpy(ia.ifra_name, ifname);
+ sin = (struct sockaddr_in *)&ia.ifra_addr;
+ sin->sin_family = AF_INET;
+ sin->sin_len = sizeof(struct sockaddr_in);
+ sin->sin_addr.s_addr = inaddr;
+
+ /* Netmask */
+ sin = (struct sockaddr_in *)&ia.ifra_mask;
+ sin->sin_family = AF_INET;
+ sin->sin_len = sizeof(struct sockaddr_in);
+ sin->sin_addr.s_addr = inmask;
+
+ /* Broadcast address */
+ sin = (struct sockaddr_in *)&ia.ifra_broadaddr;
+ sin->sin_family = AF_INET;
+ sin->sin_len = sizeof(struct sockaddr_in);
+ sin->sin_addr.s_addr = inaddr | ~inmask;
+
+ rv = rump_sys_ioctl(s, SIOCAIFADDR, &ia);
+ if (rv == -1) {
+ if (noatf)
+ err(1, "SIOCAIFADDR");
+ else
+ atf_tc_fail_errno("SIOCAIFADDR");
+ }
+ rump_sys_close(s);
+}
+
+static void __unused
+netcfg_rump_route(const char *dst, const char *mask, const char *gw)
+{
+ size_t len;
+ struct {
+ struct rt_msghdr m_rtm;
+ uint8_t m_space[512];
+ } m_rtmsg;
+#define rtm m_rtmsg.m_rtm
+ uint8_t *bp = m_rtmsg.m_space;
+ struct sockaddr_in sinstore;
+ int s, rv;
+
+ s = rump_sys_socket(PF_ROUTE, SOCK_RAW, 0);
+ if (s == -1) {
+ if (noatf)
+ err(1, "routing socket");
+ else
+ atf_tc_fail_errno("routing socket");
+ }
+
+ memset(&m_rtmsg, 0, sizeof(m_rtmsg));
+ rtm.rtm_type = RTM_ADD;
+ rtm.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
+ rtm.rtm_version = RTM_VERSION;
+ rtm.rtm_seq = 2;
+ rtm.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;
+
+ /* dst */
+ memset(&sinstore, 0, sizeof(sinstore));
+ sinstore.sin_family = AF_INET;
+ sinstore.sin_len = sizeof(sinstore);
+ sinstore.sin_addr.s_addr = inet_addr(dst);
+ memcpy(bp, &sinstore, sizeof(sinstore));
+ bp += sizeof(sinstore);
+
+ /* gw */
+ memset(&sinstore, 0, sizeof(sinstore));
+ sinstore.sin_family = AF_INET;
+ sinstore.sin_len = sizeof(sinstore);
+ sinstore.sin_addr.s_addr = inet_addr(gw);
+ memcpy(bp, &sinstore, sizeof(sinstore));
+ bp += sizeof(sinstore);
+
+ /* netmask */
+ memset(&sinstore, 0, sizeof(sinstore));
+ sinstore.sin_family = AF_INET;
+ sinstore.sin_len = sizeof(sinstore);
+ sinstore.sin_addr.s_addr = inet_addr(mask);
+ memcpy(bp, &sinstore, sizeof(sinstore));
+ bp += sizeof(sinstore);
+
+ len = bp - (uint8_t *)&m_rtmsg;
+ rtm.rtm_msglen = len;
+
+ rv = rump_sys_write(s, &m_rtmsg, len);
+ if (rv != (int)len) {
+ if (noatf)
+ err(1, "write routing message");
+ else
+ atf_tc_fail_errno("write routing message");
+ }
+ rump_sys_close(s);
+}
+
+static bool __unused
+netcfg_rump_pingtest(const char *dst, int ms_timo)
+{
+ struct timeval tv;
+ struct sockaddr_in sin;
+ struct icmp icmp;
+ socklen_t slen;
+ int s;
+ bool rv = false;
+
+ s = rump_sys_socket(PF_INET, SOCK_RAW, IPPROTO_ICMP);
+ if (s == -1)
+ return false;
+ tv.tv_sec = ms_timo / 1000;
+ tv.tv_usec = 1000 * (ms_timo % 1000);
+ if (rump_sys_setsockopt(s, SOL_SOCKET, SO_RCVTIMEO,
+ &tv, sizeof(tv)) == -1)
+ goto out;
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = inet_addr(dst);
+
+ memset(&icmp, 0, sizeof(icmp));
+ icmp.icmp_type = ICMP_ECHO;
+ icmp.icmp_id = htons(37);
+ icmp.icmp_cksum = htons(0xf7da); /* precalc */
+
+ slen = sizeof(sin);
+ if (rump_sys_sendto(s, &icmp, sizeof(icmp), 0,
+ (struct sockaddr *)&sin, slen) == -1) {
+ goto out;
+ }
+
+ if (rump_sys_recvfrom(s, &icmp, sizeof(icmp), 0,
+ (struct sockaddr *)&sin, &slen) == -1)
+ goto out;
+
+ rv = true;
+ out:
+ rump_sys_close(s);
+ return rv;
+}
diff --git a/contrib/netbsd-tests/net/fdpass/fdpass.c b/contrib/netbsd-tests/net/fdpass/fdpass.c
new file mode 100644
index 0000000..17b0a1d
--- /dev/null
+++ b/contrib/netbsd-tests/net/fdpass/fdpass.c
@@ -0,0 +1,231 @@
+/* $NetBSD: fdpass.c,v 1.1 2012/08/13 11:15:05 christos Exp $ */
+/* $OpenBSD: monitor_fdpass.c,v 1.19 2010/01/12 00:58:25 djm Exp $ */
+/*
+ * Copyright 2001 Niels Provos <provos@citi.umich.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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: fdpass.c,v 1.1 2012/08/13 11:15:05 christos Exp $");
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <sys/wait.h>
+
+#include <stdio.h>
+#include <errno.h>
+#include <err.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <poll.h>
+#include <string.h>
+
+static int debug;
+
+static int
+send_fd(int sock, int fd)
+{
+ struct msghdr msg;
+ union {
+ struct cmsghdr hdr;
+ char buf[1024];
+ } cmsgbuf;
+ struct cmsghdr *cmsg;
+ struct iovec vec;
+ char ch = '\0';
+ ssize_t n;
+ struct pollfd pfd;
+
+ if (sizeof(cmsgbuf.buf) < CMSG_SPACE(sizeof(int)))
+ errx(1, "%s: %zu < %zu, recompile", __func__,
+ sizeof(cmsgbuf.buf), CMSG_SPACE(sizeof(int)));
+
+ memset(&msg, 0, sizeof(msg));
+ msg.msg_control = &cmsgbuf.buf;
+ msg.msg_controllen = CMSG_SPACE(sizeof(int));
+ cmsg = CMSG_FIRSTHDR(&msg);
+ cmsg->cmsg_len = CMSG_LEN(sizeof(int));
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_RIGHTS;
+ *(int *)CMSG_DATA(cmsg) = fd;
+ msg.msg_controllen = cmsg->cmsg_len;
+
+ vec.iov_base = &ch;
+ vec.iov_len = 1;
+ msg.msg_iov = &vec;
+ msg.msg_iovlen = 1;
+
+ pfd.fd = sock;
+ pfd.events = POLLOUT;
+ while ((n = sendmsg(sock, &msg, 0)) == -1 &&
+ (errno == EAGAIN || errno == EINTR)) {
+ (void)poll(&pfd, 1, -1);
+ }
+ switch (n) {
+ case -1:
+ err(1, "%s: sendmsg(%d)", __func__, fd);
+ case 1:
+ if (debug)
+ fprintf(stderr, "%d: send fd %d\n", getpid(), fd);
+ return 0;
+ default:
+ errx(1, "%s: sendmsg: expected sent 1 got %ld",
+ __func__, (long)n);
+ }
+}
+
+static int
+recv_fd(int sock)
+{
+ struct msghdr msg;
+ union {
+ struct cmsghdr hdr;
+ char buf[1024];
+ } cmsgbuf;
+ struct cmsghdr *cmsg;
+ struct iovec vec;
+ ssize_t n;
+ char ch;
+ int fd;
+ struct pollfd pfd;
+
+ if (sizeof(cmsgbuf.buf) < CMSG_SPACE(sizeof(int)))
+ errx(1, "%s: %zu < %zu, recompile", __func__,
+ sizeof(cmsgbuf.buf), CMSG_SPACE(sizeof(int)));
+
+ memset(&msg, 0, sizeof(msg));
+ vec.iov_base = &ch;
+ vec.iov_len = 1;
+ msg.msg_iov = &vec;
+ msg.msg_iovlen = 1;
+ msg.msg_control = &cmsgbuf.buf;
+ msg.msg_controllen = CMSG_SPACE(sizeof(int));
+
+ pfd.fd = sock;
+ pfd.events = POLLIN;
+ while ((n = recvmsg(sock, &msg, 0)) == -1 &&
+ (errno == EAGAIN || errno == EINTR)) {
+ (void)poll(&pfd, 1, -1);
+ }
+ switch (n) {
+ case -1:
+ err(1, "%s: recvmsg", __func__);
+ case 1:
+ break;
+ default:
+ errx(1, "%s: recvmsg: expected received 1 got %ld",
+ __func__, (long)n);
+ }
+
+ cmsg = CMSG_FIRSTHDR(&msg);
+ if (cmsg == NULL)
+ errx(1, "%s: no message header", __func__);
+
+ if (cmsg->cmsg_type != SCM_RIGHTS)
+ err(1, "%s: expected type %d got %d", __func__,
+ SCM_RIGHTS, cmsg->cmsg_type);
+ fd = (*(int *)CMSG_DATA(cmsg));
+ if (debug)
+ fprintf(stderr, "%d: recv fd %d\n", getpid(), fd);
+ return fd;
+}
+
+static void usage(void) __attribute__((__noreturn__));
+
+static void
+usage(void)
+{
+ fprintf(stderr, "Usage: %s [-vd] -i <input> -o <output>\n"
+ "\t %s [-v] -p <progname>\n", getprogname(), getprogname());
+ exit(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int s[2], fd, status, c, verbose;
+ char buf[1024], *prog;
+
+ prog = NULL;
+ s[0] = s[1] = -1;
+ verbose = 0;
+
+ while ((c = getopt(argc, argv, "di:o:p:")) != -1)
+ switch (c) {
+ case 'd':
+ debug++;
+ break;
+ case 'i':
+ s[0] = atoi(optarg);
+ break;
+ case 'o':
+ s[1] = atoi(optarg);
+ break;
+ case 'p':
+ prog = optarg;
+ break;
+ default:
+ usage();
+ }
+
+ if ((s[0] == -1 && s[1] != -1) || (s[0] != -1 && s[1] == -1))
+ usage();
+
+ if (s[0] == -1) {
+ if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, s) == -1)
+ err(1, "socketpair");
+ } else
+ goto recv;
+
+ switch (fork()) {
+ case -1:
+ err(1, "fork");
+ default:
+ fd = open("foo", O_RDWR|O_CREAT|O_TRUNC, 0666);
+ if (fd == -1)
+ err(1, "open");
+ send_fd(s[0], fd);
+ wait(&status);
+ return 0;
+ case 0:
+ if (prog != NULL) {
+ char i[64], o[64];
+ snprintf(i, sizeof(i), "%d", s[0]);
+ snprintf(o, sizeof(o), "%d", s[1]);
+ execlp(prog, prog, "-i", i, "-o", o, NULL);
+ err(1, "execlp");
+ }
+ recv:
+ fd = recv_fd(s[1]);
+ if (verbose) {
+ snprintf(buf, sizeof(buf), "ls -l /proc/%d/fd",
+ getpid());
+ system(buf);
+ }
+ if (write(fd, "foo\n", 4) == -1)
+ err(1, "write");
+ close(fd);
+ return 0;
+ }
+}
diff --git a/contrib/netbsd-tests/net/fdpass/t_fdpass.sh b/contrib/netbsd-tests/net/fdpass/t_fdpass.sh
new file mode 100755
index 0000000..4e4ac04
--- /dev/null
+++ b/contrib/netbsd-tests/net/fdpass/t_fdpass.sh
@@ -0,0 +1,99 @@
+# $NetBSD: t_fdpass.sh,v 1.2 2012/08/16 08:39:43 martin Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Christos Zoulas
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+have32() {
+ local src="$(atf_get_srcdir)"
+ if cmp "${src}/fdpass64" "${src}/fdpass32" > /dev/null
+ then
+ # echo "no -m32 support"
+ return 1
+ else
+ return 0
+ fi
+}
+
+atf_test_case fdpass_normal
+
+fdpass_normal_head() {
+ atf_set "descr" "Test file descriptor passing (default)"
+}
+
+fdpass_normal_body() {
+ local src="$(atf_get_srcdir)"
+ atf_check "${src}/fdpass64"
+}
+
+
+atf_test_case fdpass_compat
+
+fdpass_compat_head() {
+ atf_set "descr" "Test file descriptor passing (compat)"
+}
+
+fdpass_compat_body() {
+ local src="$(atf_get_srcdir)"
+ have32 && atf_check "${src}/fdpass32"
+}
+
+
+atf_test_case fdpass_normal_compat
+
+fdpass_normal_compat_head() {
+ atf_set "descr" "Test file descriptor passing (normal->compat)"
+}
+
+fdpass_normal_compat_body() {
+ local src="$(atf_get_srcdir)"
+ have32 && atf_check "${src}/fdpass64" -p "${src}/fdpass32"
+}
+
+
+atf_test_case fdpass_compat_normal
+
+fdpass_compat_normal_head() {
+ atf_set "descr" "Test file descriptor passing (normal->compat)"
+}
+
+fdpass_compat_normal_body() {
+ local src="$(atf_get_srcdir)"
+ have32 && atf_check "${src}/fdpass32" -p "${src}/fdpass64"
+}
+
+
+atf_init_test_cases()
+{
+ atf_add_test_case fdpass_normal
+ if have32
+ then
+ atf_add_test_case fdpass_compat
+ atf_add_test_case fdpass_compat_normal
+ atf_add_test_case fdpass_normal_compat
+ fi
+}
diff --git a/contrib/netbsd-tests/net/icmp/t_forward.c b/contrib/netbsd-tests/net/icmp/t_forward.c
new file mode 100644
index 0000000..d0c23cc
--- /dev/null
+++ b/contrib/netbsd-tests/net/icmp/t_forward.c
@@ -0,0 +1,169 @@
+/* $NetBSD: t_forward.c,v 1.8 2012/03/18 09:46:50 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: t_forward.c,v 1.8 2012/03/18 09:46:50 jruoho Exp $");
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <arpa/inet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/icmp_var.h>
+#include <net/route.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+#include "../config/netconfig.c"
+
+/*
+ * Since our maxttl is in our private namespace, we don't need raw packet
+ * construction like traceroute(8) -- we can just use the global maxttl.
+ */
+static void
+sendttl(void)
+{
+ struct sockaddr_in sin;
+ char payload[1024];
+ char ifname[IFNAMSIZ];
+ int mib[4] = { CTL_NET, PF_INET, IPPROTO_IP, IPCTL_DEFTTL };
+ int nv;
+ int s;
+
+ netcfg_rump_makeshmif("bus1", ifname);
+ netcfg_rump_if(ifname, "1.0.0.1", "255.255.255.0");
+ netcfg_rump_route("0.0.0.0", "0.0.0.0", "1.0.0.2"); /* default router */
+
+ /* set global ttl to 1 */
+ nv = 1;
+ if (rump_sys___sysctl(mib, 4, NULL, NULL, &nv, sizeof(nv)) == -1)
+ atf_tc_fail_errno("set ttl");
+
+ s = rump_sys_socket(PF_INET, SOCK_DGRAM, 0);
+ if (s == -1)
+ atf_tc_fail_errno("create send socket");
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(33434);
+ sin.sin_addr.s_addr = inet_addr("9.9.9.9");
+
+ /* send udp datagram with ttl == 1 */
+ if (rump_sys_sendto(s, payload, sizeof(payload), 0,
+ (struct sockaddr *)&sin, sizeof(sin)) == -1)
+ atf_tc_fail_errno("sendto");
+}
+
+static void
+router(void)
+{
+ int mib[4] = { CTL_NET, PF_INET, IPPROTO_ICMP,
+ ICMPCTL_RETURNDATABYTES };
+ char ifname[IFNAMSIZ];
+ int nv;
+
+ /* set returndatabytes to 200 */
+ nv = 200;
+ if (rump_sys___sysctl(mib, 4, NULL, NULL, &nv, sizeof(nv)) == -1)
+ atf_tc_fail_errno("sysctl returndatabytes");
+
+ netcfg_rump_makeshmif("bus1", ifname);
+ netcfg_rump_if(ifname, "1.0.0.2", "255.255.255.0");
+
+ /*
+ * Wait for parent to send us the data and for us to have
+ * a chance to process it.
+ */
+ sleep(1);
+ exit(0);
+}
+
+ATF_TC(returndatabytes);
+ATF_TC_HEAD(returndatabytes, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "icmp.returndatabytes with certain "
+ "packets can cause kernel panic (PR kern/43548)");
+ atf_tc_set_md_var(tc, "timeout", "4"); /* just in case */
+}
+
+ATF_TC_BODY(returndatabytes, tc)
+{
+ pid_t cpid;
+ int status;
+
+ cpid = fork();
+ rump_init();
+
+ switch (cpid) {
+ case -1:
+ atf_tc_fail_errno("fork failed");
+ case 0:
+ router();
+ break;
+ default:
+ sendttl();
+ if (wait(&status) == -1)
+ atf_tc_fail_errno("wait");
+ if (WIFEXITED(status)) {
+ if (WEXITSTATUS(status))
+ atf_tc_fail("child exited with status %d",
+ WEXITSTATUS(status));
+ } else {
+ atf_tc_fail("child died");
+ }
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, returndatabytes);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/icmp/t_ping.c b/contrib/netbsd-tests/net/icmp/t_ping.c
new file mode 100644
index 0000000..fd8067c
--- /dev/null
+++ b/contrib/netbsd-tests/net/icmp/t_ping.c
@@ -0,0 +1,438 @@
+/* $NetBSD: t_ping.c,v 1.15 2012/09/04 22:31:58 alnsn Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: t_ping.c,v 1.15 2012/09/04 22:31:58 alnsn Exp $");
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <assert.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <netinet/in.h>
+#include <netinet/ip_var.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+#include "../config/netconfig.c"
+
+ATF_TC(simpleping);
+ATF_TC_HEAD(simpleping, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check that kernel responds to ping");
+ atf_tc_set_md_var(tc, "timeout", "2");
+}
+
+ATF_TC_BODY(simpleping, tc)
+{
+ char ifname[IFNAMSIZ];
+ pid_t cpid;
+ bool win, win2;
+ char token;
+ int channel[2];
+
+ RL(pipe(channel));
+
+ cpid = fork();
+ rump_init();
+ netcfg_rump_makeshmif("but-can-i-buy-your-ether-bus", ifname);
+
+ switch (cpid) {
+ case -1:
+ atf_tc_fail_errno("fork failed");
+ case 0:
+ netcfg_rump_if(ifname, "1.1.1.10", "255.255.255.0");
+ close(channel[0]);
+ ATF_CHECK(write(channel[1], "U", 1) == 1);
+ close(channel[1]);
+ pause();
+ break;
+ default:
+ break;
+ }
+
+ close(channel[1]);
+ ATF_CHECK(read(channel[0], &token, 1) == 1 && token == 'U');
+ close(channel[0]);
+
+ netcfg_rump_if(ifname, "1.1.1.20", "255.255.255.0");
+
+ /*
+ * The beauty of shmif is that we don't have races here.
+ */
+ win = netcfg_rump_pingtest("1.1.1.10", 500);
+ win2 = netcfg_rump_pingtest("1.1.1.30", 500);
+
+ kill(cpid, SIGKILL);
+
+ if (!win)
+ atf_tc_fail("ping failed");
+ if (win2)
+ atf_tc_fail("non-existent host responded");
+}
+
+ATF_TC(floodping);
+ATF_TC_HEAD(floodping, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "see how kernel responds to floodping");
+}
+
+/* why the hell isn't this available in userspace??? */
+static uint16_t
+in_cksum(void *data, size_t len)
+{
+ uint16_t *buf = data;
+ unsigned sum;
+
+ for (sum = 0; len > 1; len -= 2)
+ sum += *buf++;
+ if (len)
+ sum += *(uint8_t *)buf;
+
+ sum = (sum >> 16) + (sum & 0xffff);
+ sum += (sum >> 16);
+
+ return ~sum;
+}
+
+static int
+doping(const char *target, int loops, u_int pktsize)
+{
+ union {
+ char buf[IP_MAXPACKET - sizeof(struct ip)];
+ struct icmp i; /* ensure proper alignment */
+ } sndbuf;
+ char recvbuf[IP_MAXPACKET];
+ struct sockaddr_in dst, pingee;
+ struct icmp *icmp;
+ socklen_t slen;
+ ssize_t n;
+ int loop, succ;
+ int x, xnon, s;
+
+ RL(s = rump_sys_socket(PF_INET, SOCK_RAW, IPPROTO_ICMP));
+ RL(x = rump_sys_fcntl(s, F_GETFL, 0));
+ xnon = x | O_NONBLOCK;
+
+ memset(&dst, 0, sizeof(dst));
+ dst.sin_len = sizeof(dst);
+ dst.sin_family = AF_INET;
+ dst.sin_addr.s_addr = inet_addr(target);
+
+ icmp = (struct icmp *)&sndbuf;
+ memset(icmp, 0, sizeof(*icmp));
+ icmp->icmp_type = ICMP_ECHO;
+ icmp->icmp_id = htons(37);
+
+ if (pktsize < sizeof(*icmp))
+ pktsize = sizeof(*icmp);
+ if (pktsize > sizeof(sndbuf.buf))
+ pktsize = sizeof(sndbuf.buf);
+
+ RL(rump_sys_setsockopt(s, SOL_SOCKET, SO_SNDBUF,
+ &pktsize, sizeof(pktsize)));
+ RL(rump_sys_setsockopt(s, SOL_SOCKET, SO_RCVBUF,
+ &pktsize, sizeof(pktsize)));
+
+ slen = sizeof(pingee);
+ succ = 0;
+ for (loop = 0; loop < loops; loop++) {
+ RL(rump_sys_fcntl(s, F_SETFL, x));
+ icmp->icmp_seq = htons(loop);
+ icmp->icmp_cksum = 0;
+ icmp->icmp_cksum = in_cksum(icmp, pktsize);
+ RL(rump_sys_sendto(s, icmp, pktsize, 0,
+ (struct sockaddr *)&dst, sizeof(dst)));
+
+ RL(rump_sys_fcntl(s, F_SETFL, xnon));
+ while ((n = rump_sys_recvfrom(s, recvbuf, sizeof(recvbuf), 0,
+ (struct sockaddr *)&pingee, &slen)) > 0) {
+ succ++;
+ }
+ if (n == -1 && errno == EAGAIN)
+ continue;
+ atf_tc_fail_errno("recv failed");
+ }
+
+ rump_sys_close(s);
+ return succ;
+}
+
+#define LOOPS 10000
+
+ATF_TC_BODY(floodping, tc)
+{
+ char ifname[IFNAMSIZ];
+ pid_t cpid;
+ int succ;
+
+ cpid = fork();
+ rump_init();
+ netcfg_rump_makeshmif("thank-you-driver-for-getting-me-here", ifname);
+
+ switch (cpid) {
+ case -1:
+ atf_tc_fail_errno("fork failed");
+ case 0:
+ netcfg_rump_if(ifname, "1.1.1.10", "255.255.255.0");
+ pause();
+ break;
+ default:
+ break;
+ }
+
+ netcfg_rump_if(ifname, "1.1.1.20", "255.255.255.0");
+
+ succ = doping("1.1.1.10", LOOPS, 56);
+ printf("got %d/%d\n", succ, LOOPS);
+
+ kill(cpid, SIGKILL);
+}
+
+ATF_TC(floodping2);
+ATF_TC_HEAD(floodping2, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "two hosts floodpinging each other");
+}
+
+ATF_TC_BODY(floodping2, tc)
+{
+ char ifname[IFNAMSIZ];
+ pid_t cpid;
+ int succ;
+
+ cpid = fork();
+ rump_init();
+ netcfg_rump_makeshmif("floodping2", ifname);
+
+ switch (cpid) {
+ case -1:
+ atf_tc_fail_errno("fork failed");
+ case 0:
+ netcfg_rump_if(ifname, "1.1.1.10", "255.255.255.0");
+ succ = doping("1.1.1.20", LOOPS, 56);
+ break;
+ default:
+ netcfg_rump_if(ifname, "1.1.1.20", "255.255.255.0");
+ succ = doping("1.1.1.10", LOOPS, 56);
+ break;
+ }
+
+ printf("got %d/%d\n", succ, LOOPS);
+}
+
+ATF_TC(pingsize);
+ATF_TC_HEAD(pingsize, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "ping with packets min <= size <= max");
+}
+
+ATF_TC_BODY(pingsize, tc)
+{
+ char ifname[IFNAMSIZ];
+ pid_t cpid;
+ int succ, i;
+
+ cpid = fork();
+ rump_init();
+ netcfg_rump_makeshmif("jippikaiee", ifname);
+
+ switch (cpid) {
+ case -1:
+ atf_tc_fail_errno("fork failed");
+ case 0:
+ netcfg_rump_if(ifname, "1.1.1.10", "255.255.255.0");
+ pause();
+ break;
+ default:
+ break;
+ }
+
+ netcfg_rump_if(ifname, "1.1.1.20", "255.255.255.0");
+
+ succ = 0;
+
+ /* small sizes */
+ for (i = 0 ; i < IP_MAXPACKET - 60000; i++)
+ succ += doping("1.1.1.10", 1, i);
+
+ /* medium sizes */
+ for (i = IP_MAXPACKET - 60000; i < IP_MAXPACKET - 100; i += 1000)
+ succ += doping("1.1.1.10", 1, i);
+
+ /* big sizes */
+ for (i = IP_MAXPACKET - 100; i < IP_MAXPACKET; i += 10)
+ succ += doping("1.1.1.10", 1, i);
+
+ printf("got %d/%d\n", succ, IP_MAXPACKET);
+ kill(cpid, SIGKILL);
+}
+
+ATF_TC(ping_of_death);
+ATF_TC_HEAD(ping_of_death, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "send a \"ping of death\"");
+ atf_tc_set_md_var(tc, "timeout", "2");
+}
+
+ATF_TC_BODY(ping_of_death, tc)
+{
+ char data[1500];
+ struct sockaddr_in dst;
+ struct ip *ip;
+ struct icmp *icmp;
+ char ifname[IFNAMSIZ];
+ pid_t cpid;
+ size_t tot, frag;
+ int s, x, loop;
+
+ cpid = fork();
+ rump_init();
+ netcfg_rump_makeshmif("jippikaiee", ifname);
+
+ switch (cpid) {
+ case -1:
+ atf_tc_fail_errno("fork failed");
+ case 0:
+ /* wait until we receive a too long IP packet */
+ for (loop = 0;; loop++) {
+ uint64_t ipstat[IP_NSTATS];
+ size_t arglen;
+ int mib[4];
+
+ if (loop == 1)
+ netcfg_rump_if(ifname,
+ "1.1.1.10", "255.255.255.0");
+
+ mib[0] = CTL_NET;
+ mib[1] = PF_INET;
+ mib[2] = IPPROTO_IP;
+ mib[3] = IPCTL_STATS;
+
+ arglen = sizeof(ipstat);
+ RL(rump_sys___sysctl(mib, 4, &ipstat, &arglen,
+ NULL, 0));
+ if (loop == 0 && ipstat[IP_STAT_TOOLONG] != 0)
+ _exit(1);
+ if (ipstat[IP_STAT_TOOLONG])
+ break;
+ usleep(10000);
+ }
+
+ _exit(0);
+ break;
+ default:
+ break;
+ }
+
+ netcfg_rump_if(ifname, "1.1.1.20", "255.255.255.0");
+
+ RL(s = rump_sys_socket(PF_INET, SOCK_RAW, 0));
+ x = 1;
+ RL(rump_sys_setsockopt(s, IPPROTO_IP, IP_HDRINCL, &x, sizeof(x)));
+
+ memset(&dst, 0, sizeof(dst));
+ dst.sin_len = sizeof(dst);
+ dst.sin_family = AF_INET;
+ dst.sin_addr.s_addr = inet_addr("1.1.1.10");
+
+ /* construct packet */
+ memset(data, 0, sizeof(data));
+ ip = (struct ip *)data;
+ ip->ip_v = 4;
+ ip->ip_hl = sizeof(*ip) >> 2;
+ ip->ip_p = IPPROTO_ICMP;
+ ip->ip_ttl = IPDEFTTL;
+ ip->ip_dst = dst.sin_addr;
+ ip->ip_id = 1234;
+
+ icmp = (struct icmp *)(ip + 1);
+ icmp->icmp_type = ICMP_ECHO;
+ icmp->icmp_cksum = in_cksum(icmp, sizeof(*icmp));
+
+ for (;;) {
+ int status;
+
+ /* resolve arp before sending raw stuff */
+ netcfg_rump_pingtest("1.1.1.10", 1);
+
+ for (tot = 0;
+ tot < 65538 - sizeof(*ip);
+ tot += (frag - sizeof(*ip))) {
+ frag = MIN(65538 - tot, sizeof(data));
+ ip->ip_off = tot >> 3;
+ assert((size_t)ip->ip_off << 3 == tot);
+ ip->ip_len = frag;
+
+ if (frag == sizeof(data)) {
+ ip->ip_off |= IP_MF;
+ }
+
+ RL(rump_sys_sendto(s, data, frag, 0,
+ (struct sockaddr *)&dst, sizeof(dst)));
+ }
+ if (waitpid(-1, &status, WNOHANG) > 0) {
+ if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
+ break;
+ atf_tc_fail("child did not exit clean");
+ }
+
+ usleep(10000);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, simpleping);
+ ATF_TP_ADD_TC(tp, floodping);
+ ATF_TP_ADD_TC(tp, floodping2);
+ ATF_TP_ADD_TC(tp, pingsize);
+ ATF_TP_ADD_TC(tp, ping_of_death);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/icmp/t_ping2.sh b/contrib/netbsd-tests/net/icmp/t_ping2.sh
new file mode 100755
index 0000000..30ff73b
--- /dev/null
+++ b/contrib/netbsd-tests/net/icmp/t_ping2.sh
@@ -0,0 +1,78 @@
+# $NetBSD: t_ping2.sh,v 1.4 2010/12/30 16:58:07 pooka Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, 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 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.
+#
+
+netserver=\
+"rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif"
+
+atf_test_case basic cleanup
+basic_head()
+{
+
+ atf_set "descr" "Checks that a simple ping works"
+}
+
+docfg ()
+{
+
+ sock=${1}
+ addr=${2}
+
+ atf_check -s exit:0 \
+ env RUMP_SERVER=${sock} rump.ifconfig shmif0 create
+ atf_check -s exit:0 \
+ env RUMP_SERVER=${sock} rump.ifconfig shmif0 linkstr bus
+ atf_check -s exit:0 \
+ env RUMP_SERVER=${sock} rump.ifconfig shmif0 inet ${addr}
+}
+
+basic_body()
+{
+
+ atf_check -s exit:0 ${netserver} unix://commsock1
+ atf_check -s exit:0 ${netserver} unix://commsock2
+
+ docfg unix://commsock1 1.2.3.4
+ docfg unix://commsock2 1.2.3.5
+
+ atf_check -s exit:0 -o ignore \
+ env RUMP_SERVER=unix://commsock1 rump.ping -n -c 1 1.2.3.5
+ atf_check -s exit:0 -o ignore \
+ env RUMP_SERVER=unix://commsock2 rump.ping -n -c 1 1.2.3.5
+}
+
+basic_cleanup()
+{
+
+ env RUMP_SERVER=unix://commsock1 rump.halt
+ env RUMP_SERVER=unix://commsock2 rump.halt
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/net/if/t_compat.c b/contrib/netbsd-tests/net/if/t_compat.c
new file mode 100644
index 0000000..4798034
--- /dev/null
+++ b/contrib/netbsd-tests/net/if/t_compat.c
@@ -0,0 +1,83 @@
+/* $NetBSD: t_compat.c,v 1.1 2010/11/07 19:53:42 pooka Exp $ */
+
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <netinet/in.h>
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../config/netconfig.c"
+
+/*
+ * Test for stack smashing in compat ioctl handling. Adapted as an
+ * atf test from code provided by Onno van der Linden in PR kern/44054
+ */
+
+struct oifreq {
+ char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ short ifru_flags;
+ int ifru_metric;
+ int ifru_mtu;
+ int ifru_dlt;
+ u_int ifru_value;
+ void * ifru_data;
+ struct {
+ uint32_t b_buflen;
+ void *b_buf;
+ } ifru_b;
+ } ifr_ifru;
+};
+#define OOSIOCGIFBRDADDR _IOWR('i', 18, struct oifreq)
+
+ATF_TC(OOSIOCGIFBRDADDR);
+ATF_TC_HEAD(OOSIOCGIFBRDADDR, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks that OOSIOCGIFBRDADDR works "
+ "(PR kern/44054)");
+}
+
+ATF_TC_BODY(OOSIOCGIFBRDADDR, tc)
+{
+ int fd, ifnum;
+ struct oifreq ifreq;
+ struct sockaddr_in *sin;
+ int rv;
+
+ memset(&ifreq,'\0',sizeof ifreq);
+
+ rump_init();
+
+ /* create an interface and give it netmask 0xffff0000 */
+ rv = rump_pub_shmif_create("bus", &ifnum);
+ if (rv)
+ atf_tc_fail("failed to create shmif: %s", strerror(rv));
+ sprintf(ifreq.ifr_name, "shmif%d", ifnum);
+ netcfg_rump_if(ifreq.ifr_name, "1.7.64.10", "255.255.0.0");
+
+ /* query kernel for iface bcast */
+ RL(fd = rump_sys_socket(AF_INET, SOCK_DGRAM, 0));
+ RL(rump_sys_ioctl(fd, OOSIOCGIFBRDADDR, &ifreq));
+
+ /* make sure we got what we deserve */
+ sin = (struct sockaddr_in *)&ifreq.ifr_broadaddr;
+ ATF_REQUIRE_EQ(sin->sin_addr.s_addr, htonl(0x0107ffff));
+ rump_sys_close(fd);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, OOSIOCGIFBRDADDR);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/if_bridge/t_bridge.sh b/contrib/netbsd-tests/net/if_bridge/t_bridge.sh
new file mode 100755
index 0000000..5fbafc7
--- /dev/null
+++ b/contrib/netbsd-tests/net/if_bridge/t_bridge.sh
@@ -0,0 +1,312 @@
+#! /usr/bin/atf-sh
+# $NetBSD: t_bridge.sh,v 1.1 2014/09/18 15:13:27 ozaki-r Exp $
+#
+# Copyright (c) 2014 The NetBSD Foundation, 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 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.
+#
+
+inetserver="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_bridge -lrumpnet_shmif"
+inet6server="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_bridge -lrumpnet_shmif"
+
+SOCK1=unix://commsock1
+SOCK2=unix://commsock2
+SOCK3=unix://commsock3
+IP1=10.0.0.1
+IP2=10.0.0.2
+IP61=fc00::1
+IP62=fc00::2
+
+atf_test_case basic cleanup
+atf_test_case basic6 cleanup
+
+basic_head()
+{
+ atf_set "descr" "Does simple if_bridge tests"
+ atf_set "require.progs" "rump_server"
+}
+
+basic6_head()
+{
+ atf_set "descr" "Does simple if_bridge tests (IPv6)"
+ atf_set "require.progs" "rump_server"
+}
+
+setup_endpoint()
+{
+ sock=${1}
+ addr=${2}
+ bus=${3}
+ mode=${4}
+
+ export RUMP_SERVER=${sock}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${bus}
+ if [ $mode = "ipv6" ]; then
+ atf_check -s exit:0 rump.ifconfig shmif0 inet6 ${addr}
+ else
+ atf_check -s exit:0 rump.ifconfig shmif0 inet ${addr} netmask 0xffffff00
+ fi
+
+ atf_check -s exit:0 rump.ifconfig shmif0 up
+ rump.ifconfig shmif0
+}
+
+test_endpoint()
+{
+ sock=${1}
+ addr=${2}
+ bus=${3}
+ mode=${4}
+
+ export RUMP_SERVER=${sock}
+ atf_check -s exit:0 -o match:shmif0 rump.ifconfig
+ if [ $mode = "ipv6" ]; then
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ atf_check -s exit:0 -o ignore ping6 -n -c 1 ${addr}
+ unset LD_PRELOAD
+ else
+ atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 ${addr}
+ fi
+}
+
+show_endpoint()
+{
+ sock=${1}
+
+ export RUMP_SERVER=${sock}
+ rump.ifconfig -v shmif0
+}
+
+test_setup()
+{
+ test_endpoint $SOCK1 $IP1 bus1 ipv4
+ test_endpoint $SOCK3 $IP2 bus2 ipv4
+
+ export RUMP_SERVER=$SOCK2
+ atf_check -s exit:0 -o match:shmif0 rump.ifconfig
+ atf_check -s exit:0 -o match:shmif1 rump.ifconfig
+}
+
+test_setup6()
+{
+ test_endpoint $SOCK1 $IP61 bus1 ipv6
+ test_endpoint $SOCK3 $IP62 bus2 ipv6
+
+ export RUMP_SERVER=$SOCK2
+ atf_check -s exit:0 -o match:shmif0 rump.ifconfig
+ atf_check -s exit:0 -o match:shmif1 rump.ifconfig
+}
+
+setup_bridge_server()
+{
+ export RUMP_SERVER=$SOCK2
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
+ atf_check -s exit:0 rump.ifconfig shmif0 up
+
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr bus2
+ atf_check -s exit:0 rump.ifconfig shmif1 up
+}
+
+setup()
+{
+ atf_check -s exit:0 ${inetserver} $SOCK1
+ atf_check -s exit:0 ${inetserver} $SOCK2
+ atf_check -s exit:0 ${inetserver} $SOCK3
+
+ setup_endpoint $SOCK1 $IP1 bus1 ipv4
+ setup_endpoint $SOCK3 $IP2 bus2 ipv4
+ setup_bridge_server
+}
+
+setup6()
+{
+ atf_check -s exit:0 ${inet6server} $SOCK1
+ atf_check -s exit:0 ${inet6server} $SOCK2
+ atf_check -s exit:0 ${inet6server} $SOCK3
+
+ setup_endpoint $SOCK1 $IP61 bus1 ipv6
+ setup_endpoint $SOCK3 $IP62 bus2 ipv6
+ setup_bridge_server
+}
+
+setup_bridge()
+{
+ export RUMP_SERVER=$SOCK2
+ atf_check -s exit:0 rump.ifconfig bridge0 create
+ atf_check -s exit:0 rump.ifconfig bridge0 up
+
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ atf_check -s exit:0 /sbin/brconfig bridge0 add shmif0
+ atf_check -s exit:0 /sbin/brconfig bridge0 add shmif1
+ /sbin/brconfig bridge0
+ unset LD_PRELOAD
+ rump.ifconfig shmif0
+ rump.ifconfig shmif1
+}
+
+teardown_bridge()
+{
+ export RUMP_SERVER=$SOCK2
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ /sbin/brconfig bridge0
+ atf_check -s exit:0 /sbin/brconfig bridge0 delete shmif0
+ atf_check -s exit:0 /sbin/brconfig bridge0 delete shmif1
+ /sbin/brconfig bridge0
+ unset LD_PRELOAD
+ rump.ifconfig shmif0
+ rump.ifconfig shmif1
+}
+
+test_setup_bridge()
+{
+ export RUMP_SERVER=$SOCK2
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ atf_check -s exit:0 -o match:shmif0 /sbin/brconfig bridge0
+ atf_check -s exit:0 -o match:shmif1 /sbin/brconfig bridge0
+ /sbin/brconfig bridge0
+ unset LD_PRELOAD
+}
+
+cleanup()
+{
+ env RUMP_SERVER=$SOCK1 rump.halt
+ env RUMP_SERVER=$SOCK2 rump.halt
+ env RUMP_SERVER=$SOCK3 rump.halt
+}
+
+dump_bus()
+{
+ /usr/bin/shmif_dumpbus -p - bus1 2>/dev/null| /usr/sbin/tcpdump -n -e -r -
+ /usr/bin/shmif_dumpbus -p - bus2 2>/dev/null| /usr/sbin/tcpdump -n -e -r -
+}
+
+down_up_interfaces()
+{
+ export RUMP_SERVER=$SOCK1
+ rump.ifconfig shmif0 down
+ rump.ifconfig shmif0 up
+ export RUMP_SERVER=$SOCK3
+ rump.ifconfig shmif0 down
+ rump.ifconfig shmif0 up
+}
+
+test_ping_failure()
+{
+ export RUMP_SERVER=$SOCK1
+ atf_check -s not-exit:0 -o ignore rump.ping -q -n -w 1 -c 1 $IP2
+ export RUMP_SERVER=$SOCK3
+ atf_check -s not-exit:0 -o ignore rump.ping -q -n -w 1 -c 1 $IP1
+}
+
+test_ping_success()
+{
+ export RUMP_SERVER=$SOCK1
+ rump.ifconfig -v shmif0
+ atf_check -s exit:0 -o ignore rump.ping -q -n -w 1 -c 1 $IP2
+ rump.ifconfig -v shmif0
+
+ export RUMP_SERVER=$SOCK3
+ rump.ifconfig -v shmif0
+ atf_check -s exit:0 -o ignore rump.ping -q -n -w 1 -c 1 $IP1
+ rump.ifconfig -v shmif0
+}
+
+test_ping6_failure()
+{
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ export RUMP_SERVER=$SOCK1
+ atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 $IP62
+ export RUMP_SERVER=$SOCK3
+ atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 $IP61
+ unset LD_PRELOAD
+}
+
+test_ping6_success()
+{
+ export RUMP_SERVER=$SOCK1
+ rump.ifconfig -v shmif0
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ atf_check -s exit:0 -o ignore ping6 -q -n -c 1 $IP62
+ unset LD_PRELOAD
+ rump.ifconfig -v shmif0
+
+ export RUMP_SERVER=$SOCK3
+ rump.ifconfig -v shmif0
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+ atf_check -s exit:0 -o ignore ping6 -q -n -c 1 $IP61
+ unset LD_PRELOAD
+ rump.ifconfig -v shmif0
+}
+
+basic_body()
+{
+ setup
+ test_setup
+
+ setup_bridge
+ test_setup_bridge
+
+ test_ping_success
+
+ teardown_bridge
+ test_ping_failure
+}
+
+basic6_body()
+{
+ setup6
+ test_setup6
+
+ # TODO: enable once ping6 implements timeout feature
+ #test_ping6_failure
+
+ setup_bridge
+ test_setup_bridge
+
+ test_ping6_success
+
+ teardown_bridge
+ # TODO: enable once ping6 implements timeout feature
+ #test_ping6_failure
+}
+
+basic_cleanup()
+{
+ dump_bus
+ cleanup
+}
+
+basic6_cleanup()
+{
+ dump_bus
+ cleanup
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+ atf_add_test_case basic6
+}
diff --git a/contrib/netbsd-tests/net/if_loop/t_pr.c b/contrib/netbsd-tests/net/if_loop/t_pr.c
new file mode 100644
index 0000000..a22953f
--- /dev/null
+++ b/contrib/netbsd-tests/net/if_loop/t_pr.c
@@ -0,0 +1,229 @@
+/* $NetBSD: t_pr.c,v 1.7 2012/03/18 09:46:50 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: t_pr.c,v 1.7 2012/03/18 09:46:50 jruoho Exp $");
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+
+#include <netinet/in.h>
+#include <net/route.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "../config/netconfig.c"
+#include "../../h_macros.h"
+
+/*
+ * Prepare rump, configure interface and route to cause fragmentation
+ */
+static void
+setup(void)
+{
+ char ifname[IFNAMSIZ];
+ struct {
+ struct rt_msghdr m_rtm;
+ struct sockaddr_in m_sin;
+ } m_rtmsg;
+#define rtm m_rtmsg.m_rtm
+#define rsin m_rtmsg.m_sin
+ struct ifreq ifr;
+ int s;
+
+ rump_init();
+
+ /* first, config lo0 & route */
+ strcpy(ifname, "lo0");
+ netcfg_rump_if(ifname, "127.0.0.1", "255.0.0.0");
+ netcfg_rump_route("127.0.0.1", "255.0.0.0", "127.0.0.1");
+
+ if ((s = rump_sys_socket(PF_ROUTE, SOCK_RAW, 0)) == -1)
+ atf_tc_fail_errno("routing socket");
+
+ /*
+ * set MTU for interface so that route MTU doesn't
+ * get overridden by it.
+ */
+ memset(&ifr, 0, sizeof(ifr));
+ strcpy(ifr.ifr_name, "lo0");
+ ifr.ifr_mtu = 1300;
+ if (rump_sys_ioctl(s, SIOCSIFMTU, &ifr) == -1)
+ atf_tc_fail_errno("set mtu");
+
+ /* change route MTU to 100 */
+ memset(&m_rtmsg, 0, sizeof(m_rtmsg));
+ rtm.rtm_type = RTM_CHANGE;
+ rtm.rtm_flags = RTF_STATIC;
+ rtm.rtm_version = RTM_VERSION;
+ rtm.rtm_seq = 3;
+ rtm.rtm_inits = RTV_MTU;
+ rtm.rtm_addrs = RTA_DST;
+ rtm.rtm_rmx.rmx_mtu = 100;
+ rtm.rtm_msglen = sizeof(m_rtmsg);
+
+ memset(&rsin, 0, sizeof(rsin));
+ rsin.sin_family = AF_INET;
+ rsin.sin_len = sizeof(rsin);
+ rsin.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+ if (rump_sys_write(s, &m_rtmsg, sizeof(m_rtmsg)) != sizeof(m_rtmsg))
+ atf_tc_fail_errno("set route mtu");
+ rump_sys_close(s);
+}
+
+/*
+ * Turn on checksums on loopback interfaces
+ */
+static int
+enable_locsums(void)
+{
+ struct sysctlnode q, ans[256];
+ int mib[5], enable;
+ size_t alen;
+ unsigned i;
+
+ mib[0] = CTL_NET;
+ mib[1] = PF_INET;
+ mib[2] = IPPROTO_IP;
+ mib[3] = CTL_QUERY;
+ alen = sizeof(ans);
+
+ memset(&q, 0, sizeof(q));
+ q.sysctl_flags = SYSCTL_VERSION;
+
+ if (rump_sys___sysctl(mib, 4, ans, &alen, &q, sizeof(q)) == -1)
+ return -1;
+
+ for (i = 0; i < __arraycount(ans); i++)
+ if (strcmp("do_loopback_cksum", ans[i].sysctl_name) == 0)
+ break;
+ if (i == __arraycount(ans)) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ mib[3] = ans[i].sysctl_num;
+
+ enable = 1;
+ if (rump_sys___sysctl(mib, 4, NULL, NULL, &enable,
+ sizeof(enable)) == -1)
+ return errno;
+
+ return 0;
+}
+
+ATF_TC(loopmtu);
+ATF_TC_HEAD(loopmtu, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "test lo0 fragmentation (PR kern/43664)");
+}
+
+ATF_TC_BODY(loopmtu, tc)
+{
+ struct sockaddr_in sin;
+ char data[2000];
+ int s;
+
+ setup();
+
+ /* open raw socket */
+ s = rump_sys_socket(PF_INET, SOCK_RAW, 0);
+ if (s == -1)
+ atf_tc_fail_errno("raw socket");
+
+ /* then, send data */
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ sin.sin_port = htons(12345);
+ sin.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+ if (rump_sys_sendto(s, data, sizeof(data), 0,
+ (struct sockaddr *)&sin, sizeof(sin)) == -1)
+ atf_tc_fail_errno("sendto failed");
+}
+
+ATF_TC(loopmtu_csum);
+ATF_TC_HEAD(loopmtu_csum, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr",
+ "test lo0 fragmentation with checksums (PR kern/43664)");
+}
+
+ATF_TC_BODY(loopmtu_csum, tc)
+{
+ struct sockaddr_in sin;
+ char data[2000];
+ int s;
+
+ setup();
+
+ ATF_CHECK(enable_locsums() == 0);
+
+ /* open raw socket */
+ s = rump_sys_socket(PF_INET, SOCK_RAW, 0);
+ if (s == -1)
+ atf_tc_fail_errno("raw socket");
+
+ /* then, send data */
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ sin.sin_port = htons(12345);
+ sin.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+ if (rump_sys_sendto(s, data, sizeof(data), 0,
+ (struct sockaddr *)&sin, sizeof(sin)) == -1)
+ atf_tc_fail_errno("sendto failed");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, loopmtu);
+ ATF_TP_ADD_TC(tp, loopmtu_csum);
+
+ return atf_no_error();
+}
+
diff --git a/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh b/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh
new file mode 100755
index 0000000..65fc29f
--- /dev/null
+++ b/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh
@@ -0,0 +1,178 @@
+# $NetBSD: t_ldp_regen.sh,v 1.4 2014/09/01 06:38:35 gson Exp $
+#
+# Copyright (c) 2013 The NetBSD Foundation, 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 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.
+#
+
+# IP/MPLS & LDP label reallocation test
+# Create 4 routers connected like this: R1--R2--R3--R4--
+# The goal is to push packets from R1 to the R4 shmif1 (the right one) interface
+# Enable MPLS forwarding on R2
+# Disable IP forwarding and enable MPLS forwarding on R3
+# Start ldpd and wait for adjancencies to come up
+# Add an alias on shmif1 on R4 for which we already have a route on R3
+# Now: * R4 should install label IMPLNULL for that prefix
+# * R3 should realloc the target label from IMPLNULL to something else
+
+
+RUMP_SERVER1=unix://./r1
+RUMP_SERVER2=unix://./r2
+RUMP_SERVER3=unix://./r3
+RUMP_SERVER4=unix://./r4
+
+RUMP_LIBS="-lrumpnet -lrumpnet_net -lrumpnet_netmpls -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_shmif"
+LDP_FLAGS=""
+
+atf_test_case ldp_regen cleanup
+ldp_regen_head() {
+
+ atf_set "descr" "IP/MPLS and LDP label regeneration test"
+ atf_set "require.progs" "rump_server"
+ atf_set "use.fs" "true"
+}
+
+newaddr_and_ping() {
+
+ # Add new address on R4
+ RUMP_SERVER=${RUMP_SERVER4} atf_check -s exit:0 \
+ rump.ifconfig shmif1 10.0.5.1/24 alias
+
+ # Now ldpd on R5 should take notice of the new route and announce it
+ # to R4's ldpd. ldpd on R4 should verify that the next hop
+ # corresponds to its routing table and change its tag entry
+ RUMP_SERVER=${RUMP_SERVER1} atf_check -s exit:0 -o ignore -e ignore \
+ rump.ping -n -o -w 5 10.0.5.1
+}
+
+create_servers() {
+
+ # allows us to run as normal user
+ ulimit -r 400
+
+ atf_check -s exit:0 rump_server ${RUMP_LIBS} ${RUMP_SERVER1}
+ atf_check -s exit:0 rump_server ${RUMP_LIBS} ${RUMP_SERVER2}
+ atf_check -s exit:0 rump_server ${RUMP_LIBS} ${RUMP_SERVER3}
+ atf_check -s exit:0 rump_server ${RUMP_LIBS} ${RUMP_SERVER4}
+
+ # LDP HIJACK
+ export RUMPHIJACK=path=/rump,socket=all,sysctl=yes
+ export LD_PRELOAD=/usr/lib/librumphijack.so
+
+ # Setup first server
+ export RUMP_SERVER=${RUMP_SERVER1}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom1
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.1.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add 10.0.4.0/24 10.0.1.2
+ atf_check -s exit:0 rump.route -q add 10.0.5.0/24 10.0.1.2
+ atf_check -s exit:0 /usr/sbin/ldpd ${LDP_FLAGS}
+
+ # Setup second server
+ export RUMP_SERVER=${RUMP_SERVER2}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom1
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.1.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom2
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.2.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.forwarding=1
+ # This one should still do ip forwarding because it announces IMPLNULL
+ # for the 10.0.1.0/24 subnet
+ atf_check -s exit:0 rump.route -q add 10.0.4.0/24 10.0.2.2
+ atf_check -s exit:0 rump.route -q add 10.0.5.0/24 10.0.2.2
+ atf_check -s exit:0 /usr/sbin/ldpd ${LDP_FLAGS}
+
+ # Setup third server
+ export RUMP_SERVER=${RUMP_SERVER3}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom2
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.2.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom3
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.3.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.forwarding=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add 10.0.1.0/24 10.0.2.1
+ atf_check -s exit:0 rump.route -q add 10.0.4.0/24 10.0.3.2
+ atf_check -s exit:0 rump.route -q add 10.0.5.0/24 10.0.3.2
+ atf_check -s exit:0 /usr/sbin/ldpd ${LDP_FLAGS}
+
+ # Setup fourth server
+ export RUMP_SERVER=${RUMP_SERVER4}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom3
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.3.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom4
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.4.1/24
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.route -q add 10.0.1.0/24 10.0.3.1
+ atf_check -s exit:0 /usr/sbin/ldpd ${LDP_FLAGS}
+
+ unset RUMP_SERVER
+ unset LD_PRELOAD
+ unset RUMPHIJACK
+}
+
+wait_ldp_ok() {
+
+ RUMP_SERVER=${RUMP_SERVER1} atf_check -s exit:0 -o ignore -e ignore \
+ rump.ping -o -w 60 10.0.4.1
+}
+
+docleanup() {
+
+ RUMP_SERVER=${RUMP_SERVER1} rump.halt
+ RUMP_SERVER=${RUMP_SERVER2} rump.halt
+ RUMP_SERVER=${RUMP_SERVER3} rump.halt
+ RUMP_SERVER=${RUMP_SERVER4} rump.halt
+}
+
+ldp_regen_body() {
+
+ if sysctl machdep.cpu_brand | grep QEMU >/dev/null 2>&1
+ then
+ atf_skip "unreliable under qemu, skip until PR kern/43997 fixed"
+ fi
+ create_servers
+ wait_ldp_ok
+ newaddr_and_ping
+}
+
+ldp_regen_cleanup() {
+
+ docleanup
+}
+
+atf_init_test_cases() {
+
+ atf_add_test_case ldp_regen
+}
diff --git a/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh b/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh
new file mode 100755
index 0000000..ddd42df
--- /dev/null
+++ b/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh
@@ -0,0 +1,188 @@
+# $NetBSD: t_mpls_fw.sh,v 1.4 2014/03/18 18:20:44 riastradh Exp $
+#
+# Copyright (c) 2013 The NetBSD Foundation, 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 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.
+#
+
+# TEST MPLS encap/decap and forwarding using INET as encapsulated protocol
+# Setup four routers connected like this: R1---R2---R3---R4--
+# Goal is to be able to ping from R1 the outermost interface of R4
+# Disable net.inet.ip.forwarding, enable net.mpls.forwarding
+# Add route on R1 in order to encapsulate into MPLS the IP packets with
+# destination equal to R4 right hand side interface
+# Add MPLS routes on R2 in order to forward frames belonging to that FEC to R3
+# Add MPLS "POP" route on R3 for that FEC, pointing to R4
+# Do the same for the reverse direction (R4 to R1)
+# ping from R1 to R4 right hand side interface
+
+
+RUMP_SERVER1=unix://./r1
+RUMP_SERVER2=unix://./r2
+RUMP_SERVER3=unix://./r3
+RUMP_SERVER4=unix://./r4
+
+RUMP_FLAGS=\
+"-lrumpnet -lrumpnet_net -lrumpnet_netmpls -lrumpnet_netinet -lrumpnet_shmif"
+
+atf_test_case mplsfw4 cleanup
+mplsfw4_head()
+{
+
+ atf_set "descr" "IP/MPLS forwarding test using PHP"
+ atf_set "require.progs" "rump_server"
+}
+
+startservers()
+{
+
+ ulimit -r 300
+ atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
+ atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER2}
+ atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER3}
+ atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER4}
+}
+
+configservers()
+{
+
+ # Setup the first server
+ export RUMP_SERVER=${RUMP_SERVER1}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom1
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.1.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add 10.0.4.0/24 -ifa 10.0.1.1 \
+ -ifp mpls0 -tag 25 -inet 10.0.1.2
+
+ # Setup the second server
+ export RUMP_SERVER=${RUMP_SERVER2}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom1
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.1.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom2
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.2.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.forwarding=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add -mpls 25 -tag 30 -inet 10.0.2.2
+ atf_check -s exit:0 rump.route -q add -mpls 27 -tag ${1} -inet 10.0.1.1
+
+ # Setup the third server
+ export RUMP_SERVER=${RUMP_SERVER3}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom2
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.2.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom3
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.3.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.forwarding=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add -mpls 30 -tag ${1} -inet 10.0.3.2
+ atf_check -s exit:0 rump.route -q add -mpls 26 -tag 27 -inet 10.0.2.1
+
+ # Setup the fourth server
+ export RUMP_SERVER=${RUMP_SERVER4}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom3
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.3.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom4
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.4.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add 10.0.1.0/24 -ifa 10.0.3.2 \
+ -ifp mpls0 -tag 26 -inet 10.0.3.1
+
+ unset RUMP_SERVER
+}
+
+doping()
+{
+
+ export RUMP_SERVER=${RUMP_SERVER1}
+ atf_check -s exit:0 -o match:"64 bytes from 10.0.4.1: icmp_seq=" \
+ rump.ping -n -o -w 5 10.0.4.1
+ unset RUMP_SERVER
+}
+
+docleanup()
+{
+
+ RUMP_SERVER=${RUMP_SERVER1} rump.halt
+ RUMP_SERVER=${RUMP_SERVER2} rump.halt
+ RUMP_SERVER=${RUMP_SERVER3} rump.halt
+ RUMP_SERVER=${RUMP_SERVER4} rump.halt
+}
+
+mplsfw4_body()
+{
+
+ startservers
+ configservers 3
+ doping
+}
+
+mplsfw4_cleanup()
+{
+
+ docleanup
+}
+
+
+atf_test_case mplsfw4_expl cleanup
+mplsfw4_expl_head()
+{
+
+ atf_set "descr" "IP/MPLS forwarding test using explicit NULL labels"
+ atf_set "require.progs" "rump_server"
+}
+
+mplsfw4_expl_body()
+{
+
+ startservers
+ configservers 0
+ doping
+}
+
+mplsfw4_expl_cleanup()
+{
+
+ docleanup
+}
+
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case mplsfw4
+ atf_add_test_case mplsfw4_expl
+}
diff --git a/contrib/netbsd-tests/net/mpls/t_rfc4182.sh b/contrib/netbsd-tests/net/mpls/t_rfc4182.sh
new file mode 100755
index 0000000..8c166f9
--- /dev/null
+++ b/contrib/netbsd-tests/net/mpls/t_rfc4182.sh
@@ -0,0 +1,165 @@
+# $NetBSD: t_rfc4182.sh,v 1.3 2014/03/18 18:20:44 riastradh Exp $
+#
+# Copyright (c) 2013 The NetBSD Foundation, 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 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.
+#
+
+# TEST RFC 4182
+# Setup four routers connected like this: R1---R2---R3---R4--
+# Goal is to be able to ping from R1 the outermost interface of R4
+# Disable net.inet.ip.forwarding, enable net.mpls.forwarding
+# Add route on R1 in order to encapsulate into MPLS the IP packets with
+# destination equal to R4 right hand side interface. Use two labels here:
+# 25 and IPv6 Explicit NULL
+# Add a double tagged MPLS route on R2 in order to forward frames belonging to
+# that FEC to R3, with IPv4 NULL being the most outermost one
+# Add MPLS "POP" route on R3 for that FEC, pointing to R4
+# Do the same for the reverse direction (R4 to R1)
+# ping from R1 to R4 right hand side interface
+
+
+RUMP_SERVER1=unix://./r1
+RUMP_SERVER2=unix://./r2
+RUMP_SERVER3=unix://./r3
+RUMP_SERVER4=unix://./r4
+
+RUMP_FLAGS=\
+"-lrumpnet -lrumpnet_net -lrumpnet_netmpls -lrumpnet_netinet -lrumpnet_shmif"
+
+atf_test_case rfc4182 cleanup
+rfc4182_head()
+{
+
+ atf_set "descr" "RFC 4182 conformance test"
+ atf_set "require.progs" "rump_server"
+}
+
+startservers()
+{
+
+ ulimit -r 300
+ atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
+ atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER2}
+ atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER3}
+ atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER4}
+}
+
+configservers()
+{
+
+ # Setup the first server
+ export RUMP_SERVER=${RUMP_SERVER1}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom1
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.1.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add 10.0.4.0/24 -ifa 10.0.1.1 \
+ -ifp mpls0 -tag 25,2 -inet 10.0.1.2
+
+ # Setup the second server
+ export RUMP_SERVER=${RUMP_SERVER2}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom1
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.1.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom2
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.2.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.forwarding=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add -mpls 25 -tag 30,0 -inet 10.0.2.2
+ atf_check -s exit:0 rump.route -q add -mpls 27 -tag 3 -inet 10.0.1.1
+
+ # Setup the third server
+ export RUMP_SERVER=${RUMP_SERVER3}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom2
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.2.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom3
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.3.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.forwarding=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add -mpls 30 -tag 3 -inet 10.0.3.2
+ atf_check -s exit:0 rump.route -q add -mpls 26 -tag 27,0 -inet 10.0.2.1
+
+ # Setup the fourth server
+ export RUMP_SERVER=${RUMP_SERVER4}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ./shdom3
+ atf_check -s exit:0 rump.ifconfig shmif0 10.0.3.2/24
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr ./shdom4
+ atf_check -s exit:0 rump.ifconfig shmif1 10.0.4.1/24
+ atf_check -s exit:0 rump.ifconfig mpls0 create up
+ atf_check -s exit:0 rump.sysctl -q -w net.mpls.accept=1
+ atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwarding=0
+ atf_check -s exit:0 rump.route -q add 10.0.1.0/24 -ifa 10.0.3.2 \
+ -ifp mpls0 -tag 26 -inet 10.0.3.1
+
+ unset RUMP_SERVER
+}
+
+doping()
+{
+
+ export RUMP_SERVER=${RUMP_SERVER1}
+ atf_check -s exit:0 -o match:"64 bytes from 10.0.4.1: icmp_seq=" \
+ rump.ping -n -o -w 5 10.0.4.1
+ unset RUMP_SERVER
+}
+
+docleanup()
+{
+
+ RUMP_SERVER=${RUMP_SERVER1} rump.halt
+ RUMP_SERVER=${RUMP_SERVER2} rump.halt
+ RUMP_SERVER=${RUMP_SERVER3} rump.halt
+ RUMP_SERVER=${RUMP_SERVER4} rump.halt
+}
+
+rfc4182_body()
+{
+
+ startservers
+ configservers
+ doping
+}
+
+rfc4182_cleanup()
+{
+
+ docleanup
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case rfc4182
+}
diff --git a/contrib/netbsd-tests/net/net/t_pktinfo.c b/contrib/netbsd-tests/net/net/t_pktinfo.c
new file mode 100644
index 0000000..326f9f6
--- /dev/null
+++ b/contrib/netbsd-tests/net/net/t_pktinfo.c
@@ -0,0 +1,194 @@
+/* $NetBSD: t_pktinfo.c,v 1.2 2013/10/19 17:45:01 christos Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_pktinfo.c,v 1.2 2013/10/19 17:45:01 christos Exp $");
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+static const char traffic[] = "foo";
+
+#ifdef TEST
+#include <err.h>
+#define ERR(msg) err(EXIT_FAILURE, msg)
+#define ERRX(msg, a) errx(EXIT_FAILURE, msg, a)
+#define ERRX2(msg, a1, a2) errx(EXIT_FAILURE, msg, a1, a2)
+#else
+#include <atf-c.h>
+#define ERR(msg) ATF_REQUIRE_MSG(0, "%s: %s", msg, strerror(errno))
+#define ERRX(msg, a) ATF_REQUIRE_MSG(0, msg, a)
+#define ERRX2(msg, a1, a2) ATF_REQUIRE_MSG(0, msg, a1, a2)
+#endif
+
+static int
+server(struct sockaddr_in *sin) {
+ int s, one;
+ socklen_t len = sizeof(*sin);
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
+ ERR("socket");
+
+ memset(sin, 0, len);
+ sin->sin_family = AF_INET;
+ sin->sin_len = len;
+ sin->sin_port = 0;
+ sin->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ if (bind(s, (const struct sockaddr *)sin, len) == -1)
+ ERR("bind");
+
+ if (getsockname(s, (struct sockaddr *)sin, &len) == -1)
+ ERR("getsockname");
+
+ one = 1;
+ if (setsockopt(s, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one)) == -1)
+ ERR("setsockopt");
+ if (setsockopt(s, IPPROTO_IP, IP_RECVPKTINFO, &one, sizeof(one)) == -1)
+ ERR("setsockopt");
+
+ return s;
+}
+
+static int
+client(struct sockaddr_in *sin) {
+ int s;
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
+ ERR("socket");
+ if (sendto(s, traffic, sizeof(traffic), 0,
+ (const struct sockaddr *)sin, sizeof(*sin)) == -1)
+ ERR("sendto");
+ return s;
+}
+
+static void
+receive(int s) {
+ struct msghdr msg;
+ struct cmsghdr *cmsg;
+ struct iovec iov;
+ char buf[sizeof(traffic)];
+ struct in_pktinfo *ipi;
+ char control[CMSG_SPACE(sizeof(*ipi)) * 2];
+
+ memset(&msg, 0, sizeof(msg));
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+ msg.msg_iov = &iov;
+ memset(&iov, 0, sizeof(iov));
+ iov.iov_base = buf;
+ iov.iov_len = sizeof(buf);
+ msg.msg_iovlen = 1;
+ msg.msg_control = control;
+ msg.msg_controllen = sizeof(control);
+ msg.msg_flags = 0;
+
+ if (recvmsg(s, &msg, 0) == -1)
+ ERR("recvmsg");
+
+ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL;
+ cmsg = CMSG_NXTHDR(&msg, cmsg)) {
+ if (cmsg->cmsg_level != IPPROTO_IP)
+ ERRX("bad level %d", cmsg->cmsg_level);
+ const char *m;
+ switch (cmsg->cmsg_type) {
+ case IP_PKTINFO:
+ m = "pktinfo";
+ break;
+ case IP_RECVPKTINFO:
+ m = "recvpktinfo";
+ break;
+ default:
+ m = NULL;
+ ERRX("bad type %d", cmsg->cmsg_type);
+ }
+ ipi = (void *)CMSG_DATA(cmsg);
+#ifdef TEST
+ printf("%s message received on address %s at interface %d\n",
+ m, inet_ntoa(ipi->ipi_addr), ipi->ipi_ifindex);
+#else
+ __USE(m);
+ ATF_REQUIRE_MSG(ipi->ipi_addr.s_addr == htonl(INADDR_LOOPBACK),
+ "address 0x%x != 0x%x", ipi->ipi_addr.s_addr,
+ htonl(INADDR_LOOPBACK));
+#endif
+ }
+
+ if (strcmp(traffic, buf) != 0)
+ ERRX2("Bad message '%s' != '%s'", buf, traffic);
+}
+
+static void
+doit(void)
+{
+ struct sockaddr_in sin;
+ int s, c;
+ s = server(&sin);
+ c = client(&sin);
+ receive(s);
+ close(s);
+ close(c);
+}
+
+#ifndef TEST
+ATF_TC(pktinfo);
+ATF_TC_HEAD(pktinfo, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that IP_PKTINFO and "
+ "IP_RECVPKTINFO work");
+}
+
+ATF_TC_BODY(pktinfo, tc)
+{
+ doit();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, pktinfo);
+ return atf_no_error();
+}
+#else
+
+int
+main(int argc, char *argv[]) {
+ doit();
+ return 0;
+}
+#endif
diff --git a/contrib/netbsd-tests/net/net/t_raw.c b/contrib/netbsd-tests/net/net/t_raw.c
new file mode 100644
index 0000000..ef3262d
--- /dev/null
+++ b/contrib/netbsd-tests/net/net/t_raw.c
@@ -0,0 +1,41 @@
+/* $NetBSD: t_raw.c,v 1.1 2011/01/11 10:51:45 pooka Exp $ */
+
+#include <sys/socket.h>
+#include <sys/stat.h>
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(PRU_SENSE);
+ATF_TC_HEAD(PRU_SENSE, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Biglock leak with PRU_SENSE on "
+ "raw sockets (PR kern/44369)");
+}
+
+ATF_TC_BODY(PRU_SENSE, tc)
+{
+ struct stat sb;
+ int s;
+
+ rump_init();
+ RL(s = rump_sys_socket(PF_ROUTE, SOCK_RAW, 0));
+ /* call PRU_SENSE. unfixed bug causes panic in rump_unschedule() */
+ RL(rump_sys_fstat(s, &sb));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, PRU_SENSE);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/net/t_tcp.c b/contrib/netbsd-tests/net/net/t_tcp.c
new file mode 100644
index 0000000..8972a0f
--- /dev/null
+++ b/contrib/netbsd-tests/net/net/t_tcp.c
@@ -0,0 +1,220 @@
+/* $NetBSD: t_tcp.c,v 1.3 2013/10/17 12:53:28 christos Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifdef __RCSID
+__RCSID("$Id: t_tcp.c,v 1.3 2013/10/17 12:53:28 christos Exp $");
+#endif
+
+/* Example code. Should block; does with accept not paccept. */
+/* Original by: Justin Cormack <justin@specialbusrvrervice.com> */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <err.h>
+#include <stdlib.h>
+#include <signal.h>
+
+#ifdef TEST
+#define FAIL(msg, ...) err(EXIT_FAILURE, msg, ## __VA_ARGS__)
+#else
+#include <atf-c.h>
+#define FAIL(msg, ...) ATF_CHECK_MSG(0, msg, ## __VA_ARGS__); goto fail
+#endif
+
+static void
+ding(int al)
+{
+}
+
+static void
+paccept_block(bool pacceptblock, bool fcntlblock)
+{
+ int srvr = -1, clnt = -1, as = -1;
+ int ok, fl, n;
+ char buf[10];
+ struct sockaddr_in sin, ba;
+ struct sigaction sa;
+
+ srvr = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
+ if (srvr == -1)
+ FAIL("socket");
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+#ifdef BSD4_4
+ sin.sin_len = sizeof(sin);
+#endif
+ sin.sin_port = htons(0);
+ sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ ok = bind(srvr, (const struct sockaddr *)&sin, (socklen_t)sizeof(sin));
+ if (ok == -1)
+ FAIL("bind");
+
+ socklen_t addrlen = sizeof(struct sockaddr_in);
+ ok = getsockname(srvr, (struct sockaddr *)&ba, &addrlen);
+ if (ok == -1)
+ FAIL("getsockname");
+
+ ok = listen(srvr, SOMAXCONN);
+ if (ok == -1)
+ FAIL("listen");
+
+ clnt = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
+ if (clnt == -1)
+ FAIL("socket");
+
+ /* may not connect first time */
+ ok = connect(clnt, (struct sockaddr *) &ba, addrlen);
+ as = paccept(srvr, NULL, NULL, NULL, pacceptblock ? 0 : SOCK_NONBLOCK);
+ ok = connect(clnt, (struct sockaddr *) &ba, addrlen);
+ if (ok == -1 && errno != EISCONN)
+ FAIL("both connects failed");
+
+#if 0
+ fl = fcntl(srvr, F_GETFL, 0);
+ if (fl == -1)
+ FAIL("fnctl getfl");
+
+ ok = fcntl(srvr, F_SETFL, fl & ~O_NONBLOCK);
+ if (ok == -1)
+ FAIL("fnctl setfl");
+#endif
+
+ if (as == -1) { /* not true under NetBSD */
+ as = paccept(srvr, NULL, NULL, NULL, pacceptblock ? 0 : SOCK_NONBLOCK);
+ if (as == -1)
+ FAIL("paccept");
+ }
+ if (fcntlblock) {
+ fl = fcntl(as, F_GETFL, 0);
+ if (fl == -1)
+ FAIL("fnctl");
+ if (fl != (O_RDWR|O_NONBLOCK))
+ FAIL("fl 0x%x != 0x%x\n", fl, O_RDWR|O_NONBLOCK);
+ ok = fcntl(as, F_SETFL, fl & ~O_NONBLOCK);
+ if (ok == -1)
+ FAIL("fnctl setfl");
+
+ fl = fcntl(as, F_GETFL, 0);
+ if (fl & O_NONBLOCK)
+ FAIL("fl non blocking after reset");
+ }
+ sa.sa_handler = ding;
+ sa.sa_flags = 0;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGALRM, &sa, NULL);
+ alarm(1);
+ n = read(as, buf, 10);
+
+ if (pacceptblock || fcntlblock) {
+ if (n == -1 && errno != EINTR)
+ FAIL("read");
+ } else {
+ if (n != -1 || errno != EWOULDBLOCK)
+ FAIL("read");
+ }
+ return;
+fail:
+ close(srvr);
+ close(clnt);
+ close(as);
+}
+
+#ifndef TEST
+
+ATF_TC(paccept_reset_nonblock);
+ATF_TC_HEAD(paccept_reset_nonblock, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that paccept(2) resets "
+ "the non-blocking flag on non-blocking sockets");
+}
+
+ATF_TC_BODY(paccept_reset_nonblock, tc)
+{
+ paccept_block(true, false);
+}
+
+ATF_TC(fcntl_reset_nonblock);
+ATF_TC_HEAD(fcntl_reset_nonblock, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that fcntl(2) resets "
+ "the non-blocking flag on non-blocking sockets");
+}
+
+ATF_TC_BODY(fcntl_reset_nonblock, tc)
+{
+ paccept_block(false, true);
+}
+
+ATF_TC(paccept_nonblock);
+ATF_TC_HEAD(paccept_nonblock, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that fcntl(2) resets "
+ "the non-blocking flag on non-blocking sockets");
+}
+
+ATF_TC_BODY(paccept_nonblock, tc)
+{
+ paccept_block(false, false);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, paccept_reset_nonblock);
+ ATF_TP_ADD_TC(tp, fcntl_reset_nonblock);
+ ATF_TP_ADD_TC(tp, paccept_nonblock);
+ return atf_no_error();
+}
+#else
+int
+main(int argc, char *argv[])
+{
+ paccept_block(false);
+ paccept_block(true);
+ return 0;
+}
+#endif
diff --git a/contrib/netbsd-tests/net/net/t_udp.c b/contrib/netbsd-tests/net/net/t_udp.c
new file mode 100644
index 0000000..db59342
--- /dev/null
+++ b/contrib/netbsd-tests/net/net/t_udp.c
@@ -0,0 +1,110 @@
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_udp.c,v 1.2 2013/01/06 02:22:50 christos Exp $");
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include <netdb.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+static const char msg[] = "sendto test";
+
+static void
+sendit(int family)
+{
+ struct addrinfo hints;
+ struct addrinfo *res;
+ int S, s;
+ int e;
+
+ /* lookup localhost addr, depending on argv[1] */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = family;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+ hints.ai_flags = 0;
+
+ e = getaddrinfo("localhost", "9999", &hints, &res);
+ ATF_REQUIRE_MSG(e == 0, "getaddrinfo AF=%d: %s", family,
+ gai_strerror(e));
+
+ /* server socket */
+ S = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ ATF_REQUIRE_MSG(S >= 0, "server-socket AF=%d: %s", family,
+ strerror(errno));
+
+ e = bind(S, res->ai_addr, res->ai_addrlen);
+ ATF_REQUIRE_MSG(e == 0, "bind AF=%d: %s", family,
+ strerror(errno));
+
+ /* client socket */
+ s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ ATF_REQUIRE_MSG(s >= 0, "client-socket AF=%d: %s", family,
+ strerror(errno));
+
+ /* sendto */
+ e = sendto(s, msg, sizeof(msg), 0, res->ai_addr, res->ai_addrlen);
+ ATF_REQUIRE_MSG(e == sizeof(msg), "sendto(1) AF=%d: %s", family,
+ strerror(errno));
+
+ e = sendto(s, msg, sizeof(msg), 0, res->ai_addr, res->ai_addrlen);
+ ATF_REQUIRE_MSG(e == sizeof(msg), "sendto(2) AF=%d: %s", family,
+ strerror(errno));
+
+ /* connect + send */
+ e = connect(s, res->ai_addr, res->ai_addrlen);
+ ATF_REQUIRE_MSG(e == 0, "connect(1) AF=%d: %s", family,
+ strerror(errno));
+
+ e = send(s, msg, sizeof(msg), 0);
+ ATF_REQUIRE_MSG(e == sizeof(msg), "send(1) AF=%d: %s", family,
+ strerror(errno));
+
+ e = connect(s, res->ai_addr, res->ai_addrlen);
+ ATF_REQUIRE_MSG(e == 0, "connect(2) AF=%d: %s", family,
+ strerror(errno));
+
+ e = send(s, msg, sizeof(msg), 0);
+ ATF_REQUIRE_MSG(e == sizeof(msg), "send(2) AF=%d: %s", family,
+ strerror(errno));
+
+ close(s);
+}
+
+ATF_TC(udp4_send);
+ATF_TC_HEAD(udp4_send, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that inet4 udp send works both"
+ " for connected and unconnected sockets");
+}
+
+ATF_TC_BODY(udp4_send, tc)
+{
+ sendit(AF_INET);
+}
+
+ATF_TC(udp6_send);
+ATF_TC_HEAD(udp6_send, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that inet6 udp send works both"
+ " for connected and unconnected sockets");
+}
+
+ATF_TC_BODY(udp6_send, tc)
+{
+ sendit(AF_INET6);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, udp4_send);
+ ATF_TP_ADD_TC(tp, udp6_send);
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/net/net/t_unix.c b/contrib/netbsd-tests/net/net/t_unix.c
new file mode 100644
index 0000000..30759f1
--- /dev/null
+++ b/contrib/netbsd-tests/net/net/t_unix.c
@@ -0,0 +1,328 @@
+/* $NetBSD: t_unix.c,v 1.11 2013/11/13 21:41:23 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifdef __RCSID
+__RCSID("$Id: t_unix.c,v 1.11 2013/11/13 21:41:23 christos Exp $");
+#else
+#define getprogname() argv[0]
+#endif
+
+#ifdef __linux__
+#define LX -1
+#else
+#define LX
+#endif
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <stdio.h>
+#include <err.h>
+#include <errno.h>
+#include <string.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#ifdef TEST
+#define FAIL(msg, ...) err(EXIT_FAILURE, msg, ## __VA_ARGS__)
+#else
+
+#include <atf-c.h>
+#define FAIL(msg, ...) \
+ do { \
+ ATF_CHECK_MSG(0, msg, ## __VA_ARGS__); \
+ goto fail; \
+ } while (/*CONSTCOND*/0)
+
+#endif
+
+#define OF offsetof(struct sockaddr_un, sun_path)
+
+static void
+print(const char *msg, struct sockaddr_un *addr, socklen_t len)
+{
+ size_t i;
+
+ printf("%s: client socket length: %zu\n", msg, (size_t)len);
+ printf("%s: client family %d\n", msg, addr->sun_family);
+#ifdef BSD4_4
+ printf("%s: client len %d\n", msg, addr->sun_len);
+#endif
+ printf("%s: socket name: ", msg);
+ for (i = 0; i < len - OF; i++) {
+ int ch = addr->sun_path[i];
+ if (ch < ' ' || '~' < ch)
+ printf("\\x%02x", ch);
+ else
+ printf("%c", ch);
+ }
+ printf("\n");
+}
+
+static int
+acc(int s)
+{
+ char guard1;
+ struct sockaddr_un sun;
+ char guard2;
+ socklen_t len;
+
+ guard1 = guard2 = 's';
+
+ memset(&sun, 0, sizeof(sun));
+ len = sizeof(sun);
+ if ((s = accept(s, (struct sockaddr *)&sun, &len)) == -1)
+ FAIL("accept");
+ if (guard1 != 's')
+ FAIL("guard1 = '%c'", guard1);
+ if (guard2 != 's')
+ FAIL("guard2 = '%c'", guard2);
+#ifdef DEBUG
+ print("accept", &sun, len);
+#endif
+ if (len != 2)
+ FAIL("len %d != 2", len);
+ if (sun.sun_family != AF_UNIX)
+ FAIL("sun->sun_family %d != AF_UNIX", sun.sun_family);
+#ifdef BSD4_4
+ if (sun.sun_len != 2)
+ FAIL("sun->sun_len %d != 2", sun.sun_len);
+#endif
+ for (size_t i = 0; i < sizeof(sun.sun_path); i++)
+ if (sun.sun_path[i])
+ FAIL("sun.sun_path[%zu] %d != NULL", i,
+ sun.sun_path[i]);
+ return s;
+fail:
+ if (s != -1)
+ close(s);
+ return -1;
+}
+
+static int
+test(bool closeit, size_t len)
+{
+ size_t slen;
+ socklen_t sl;
+ int srvr = -1, clnt = -1, acpt = -1;
+ struct sockaddr_un *sock_addr = NULL, *sun = NULL;
+ socklen_t sock_addrlen;
+
+ srvr = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (srvr == -1)
+ FAIL("socket(srvrer)");
+
+ slen = len + OF + 1;
+
+ if ((sun = calloc(1, slen)) == NULL)
+ FAIL("calloc");
+
+ srvr = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (srvr == -1)
+ FAIL("socket");
+
+ memset(sun->sun_path, 'a', len);
+ sun->sun_path[len] = '\0';
+ (void)unlink(sun->sun_path);
+
+ sl = SUN_LEN(sun);
+#ifdef BSD4_4
+ sun->sun_len = sl;
+#endif
+ sun->sun_family = AF_UNIX;
+
+ if (bind(srvr, (struct sockaddr *)sun, sl) == -1) {
+ if (errno == EINVAL && sl >= 256) {
+ close(srvr);
+ return -1;
+ }
+ FAIL("bind");
+ }
+
+ if (listen(srvr, SOMAXCONN) == -1)
+ FAIL("listen");
+
+ clnt = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (clnt == -1)
+ FAIL("socket(client)");
+
+ if (connect(clnt, (const struct sockaddr *)sun, sl) == -1)
+ FAIL("connect");
+
+ if (closeit) {
+ if (close(clnt) == -1)
+ FAIL("close");
+ clnt = -1;
+ }
+
+ acpt = acc(srvr);
+#if 0
+ /*
+ * Both linux and NetBSD return ENOTCONN, why?
+ */
+ if (!closeit) {
+ socklen_t peer_addrlen;
+ sockaddr_un peer_addr;
+
+ peer_addrlen = sizeof(peer_addr);
+ memset(&peer_addr, 0, sizeof(peer_addr));
+ if (getpeername(srvr, (struct sockaddr *)&peer_addr,
+ &peer_addrlen) == -1)
+ FAIL("getpeername");
+ print("peer", &peer_addr, peer_addrlen);
+ }
+#endif
+
+ if ((sock_addr = calloc(1, slen)) == NULL)
+ FAIL("calloc");
+ sock_addrlen = slen;
+ if (getsockname(srvr, (struct sockaddr *)sock_addr, &sock_addrlen)
+ == -1)
+ FAIL("getsockname");
+ print("sock", sock_addr, sock_addrlen);
+
+ if (sock_addr->sun_family != AF_UNIX)
+ FAIL("sock_addr->sun_family %d != AF_UNIX",
+ sock_addr->sun_family);
+
+ len += OF;
+ if (sock_addrlen LX != len)
+ FAIL("sock_addr_len %zu != %zu", (size_t)sock_addrlen, len);
+#ifdef BSD4_4
+ if (sock_addr->sun_len != sl)
+ FAIL("sock_addr.sun_len %d != %zu", sock_addr->sun_len,
+ (size_t)sl);
+#endif
+ for (size_t i = 0; i < slen - OF; i++)
+ if (sock_addr->sun_path[i] != sun->sun_path[i])
+ FAIL("sock_addr.sun_path[%zu] %d != "
+ "sun->sun_path[%zu] %d\n", i,
+ sock_addr->sun_path[i], i, sun->sun_path[i]);
+
+ if (acpt != -1)
+ (void)close(acpt);
+ if (srvr != -1)
+ (void)close(srvr);
+ if (clnt != -1 && !closeit)
+ (void)close(clnt);
+
+ free(sock_addr);
+ free(sun);
+ return 0;
+fail:
+ if (acpt != -1)
+ (void)close(acpt);
+ if (srvr != -1)
+ (void)close(srvr);
+ if (clnt != -1 && !closeit)
+ (void)close(clnt);
+ free(sock_addr);
+ free(sun);
+ return -1;
+}
+
+#ifndef TEST
+
+ATF_TC(sockaddr_un_len_exceed);
+ATF_TC_HEAD(sockaddr_un_len_exceed, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that exceeding the size of "
+ "unix domain sockets does not trash memory or kernel when "
+ "exceeding the size of the fixed sun_path");
+}
+
+ATF_TC_BODY(sockaddr_un_len_exceed, tc)
+{
+ ATF_REQUIRE_MSG(test(false, 254) == -1, "test(false, 254): %s",
+ strerror(errno));
+}
+
+ATF_TC(sockaddr_un_len_max);
+ATF_TC_HEAD(sockaddr_un_len_max, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that we can use the maximum "
+ "unix domain socket pathlen (253): 255 - sizeof(sun_len) - "
+ "sizeof(sun_family)");
+}
+
+ATF_TC_BODY(sockaddr_un_len_max, tc)
+{
+ ATF_REQUIRE_MSG(test(false, 253) == 0, "test(false, 253): %s",
+ strerror(errno));
+}
+
+ATF_TC(sockaddr_un_closed);
+ATF_TC_HEAD(sockaddr_un_closed, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check that we can use the accepted "
+ "address of unix domain socket when closed");
+}
+
+ATF_TC_BODY(sockaddr_un_closed, tc)
+{
+ ATF_REQUIRE_MSG(test(true, 100) == 0, "test(true, 100): %s",
+ strerror(errno));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sockaddr_un_len_exceed);
+ ATF_TP_ADD_TC(tp, sockaddr_un_len_max);
+ ATF_TP_ADD_TC(tp, sockaddr_un_closed);
+ return atf_no_error();
+}
+#else
+int
+main(int argc, char *argv[])
+{
+ size_t len;
+
+ if (argc == 1) {
+ fprintf(stderr, "Usage: %s <len>\n", getprogname());
+ return EXIT_FAILURE;
+ }
+ test(false, atoi(argv[1]));
+ test(true, atoi(argv[1]));
+}
+#endif
diff --git a/contrib/netbsd-tests/net/npf/t_npf.sh b/contrib/netbsd-tests/net/npf/t_npf.sh
new file mode 100755
index 0000000..bf247fc
--- /dev/null
+++ b/contrib/netbsd-tests/net/npf/t_npf.sh
@@ -0,0 +1,63 @@
+# $NetBSD: t_npf.sh,v 1.2 2012/09/18 08:28:15 martin Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+
+run_test()
+{
+ local name="${1}"
+
+ atf_check -o ignore -e ignore npfctl debug "$(atf_get_srcdir)/npftest.conf" ./npf.plist
+ atf_check -o ignore npftest -c npf.plist -T "${name}"
+}
+
+add_test()
+{
+ local name="${1}"; shift
+ local desc="${*}";
+
+ atf_test_case "npf_${name}"
+ eval "npf_${name}_head() { \
+ atf_set \"descr\" \"${desc}\"; \
+ atf_set \"require.progs\" \"npfctl npftest\"; \
+ }; \
+ npf_${name}_body() { \
+ run_test \"${name}\"; \
+ }"
+ atf_add_test_case "npf_${name}"
+}
+
+atf_init_test_cases()
+{
+ LIST=/tmp/t_npf.$$
+ trap "rm -f $LIST" EXIT
+
+ sh -ec 'npftest -L || printf "dummy\tnone\n"' > $LIST 2>/dev/null
+
+ while read tag desc
+ do
+ add_test "${tag}" "${desc}"
+ done < $LIST
+}
diff --git a/contrib/netbsd-tests/net/route/t_change.sh b/contrib/netbsd-tests/net/route/t_change.sh
new file mode 100755
index 0000000..3618aee
--- /dev/null
+++ b/contrib/netbsd-tests/net/route/t_change.sh
@@ -0,0 +1,65 @@
+# $NetBSD: t_change.sh,v 1.4 2013/02/19 21:08:25 joerg Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+netserver=\
+"rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet"
+export RUMP_SERVER=unix://commsock
+
+atf_test_case reject2blackhole cleanup
+reject2blackhole_head()
+{
+
+ atf_set "descr" "Change a reject route to blackhole"
+ atf_set "require.progs" "rump_server"
+}
+
+reject2blackhole_body()
+{
+
+ atf_check -s exit:0 ${netserver} ${RUMP_SERVER}
+
+ atf_check -s exit:0 -o ignore \
+ rump.route add 207.46.197.32 127.0.0.1 -reject
+ atf_check -s exit:0 -o match:UGHR -x \
+ "rump.route -n show -inet | grep ^207.46"
+ atf_check -s exit:0 -o ignore \
+ rump.route change 207.46.197.32 127.0.0.1 -blackhole
+ atf_check -s exit:0 -o match:' UGHBS ' -e ignore -x \
+ "rump.netstat -rn -f inet | grep ^207.46| grep ^207.46"
+}
+
+reject2blackhole_cleanup()
+{
+
+ env RUMP_SERVER=unix://commsock rump.halt
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case reject2blackhole
+}
diff --git a/contrib/netbsd-tests/net/sys/t_rfc6056.c b/contrib/netbsd-tests/net/sys/t_rfc6056.c
new file mode 100644
index 0000000..944521b
--- /dev/null
+++ b/contrib/netbsd-tests/net/sys/t_rfc6056.c
@@ -0,0 +1,152 @@
+/* $NetBSD: t_rfc6056.c,v 1.3 2012/06/22 14:54:35 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_rfc6056.c,v 1.3 2012/06/22 14:54:35 christos Exp $");
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/udp.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <strings.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <netdb.h>
+#include <err.h>
+
+#include <atf-c.h>
+
+static void
+test(const char *hostname, const char *service, int family, int al)
+{
+ static const char hello[] = "hello\n";
+ int s, error, proto, option;
+ struct sockaddr_storage ss;
+ struct addrinfo hints, *res;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = family;
+ hints.ai_socktype = SOCK_DGRAM;
+
+ switch (family) {
+ case AF_INET:
+ proto = IPPROTO_IP;
+ option = IP_PORTALGO;
+ break;
+ case AF_INET6:
+ proto = IPPROTO_IPV6;
+ option = IPV6_PORTALGO;
+ break;
+ default:
+ abort();
+ }
+
+ error = getaddrinfo(hostname, service, &hints, &res);
+ if (error)
+ errx(EXIT_FAILURE, "Cannot get address for %s (%s)",
+ hostname, gai_strerror(error));
+
+ s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ if (s == -1)
+ err(EXIT_FAILURE, "socket");
+
+ if (setsockopt(s, proto, option, &al, sizeof(al)) == -1)
+ err(EXIT_FAILURE, "setsockopt");
+
+ memset(&ss, 0, sizeof(ss));
+ ss.ss_len = res->ai_addrlen;
+ ss.ss_family = res->ai_family;
+
+ if (bind(s, (struct sockaddr *)&ss, ss.ss_len) == -1)
+ err(EXIT_FAILURE, "bind");
+
+ if (sendto(s, hello, sizeof(hello) - 1, 0,
+ res->ai_addr, res->ai_addrlen) == -1)
+ err(EXIT_FAILURE, "sendto");
+
+ if (close(s) == -1)
+ err(EXIT_FAILURE, "close");
+
+ s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ if (s == -1)
+ err(EXIT_FAILURE, "socket");
+
+ if (setsockopt(s, proto, option, &al, sizeof(al)) == -1)
+ err(EXIT_FAILURE, "setsockopt");
+
+ if (connect(s, res->ai_addr, res->ai_addrlen) == -1)
+ err(EXIT_FAILURE, "connect");
+
+ if (send(s, hello, sizeof(hello) - 1, 0) == -1)
+ err(EXIT_FAILURE, "send");
+
+ if (close(s) == -1)
+ err(EXIT_FAILURE, "close");
+
+ freeaddrinfo(res);
+}
+
+ATF_TC(inet4);
+ATF_TC_HEAD(inet4, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks random port allocation "
+ "for ipv4");
+}
+
+ATF_TC_BODY(inet4, tc)
+{
+ for (int i = 0; i < 6; i++)
+ test("localhost", "http", AF_INET, i);
+}
+
+ATF_TC(inet6);
+ATF_TC_HEAD(inet6, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks random port allocation "
+ "for ipv6");
+}
+
+ATF_TC_BODY(inet6, tc)
+{
+ for (int i = 0; i < 6; i++)
+ test("localhost", "http", AF_INET6, i);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, inet4);
+ ATF_TP_ADD_TC(tp, inet6);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/kernspace/alloc.c b/contrib/netbsd-tests/rump/kernspace/alloc.c
new file mode 100644
index 0000000..5cbcfb6
--- /dev/null
+++ b/contrib/netbsd-tests/rump/kernspace/alloc.c
@@ -0,0 +1,122 @@
+/* $NetBSD: alloc.c,v 1.1 2010/06/14 21:06:09 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if !defined(lint)
+__RCSID("$NetBSD: alloc.c,v 1.1 2010/06/14 21:06:09 pooka Exp $");
+#endif /* !lint */
+
+#include <sys/param.h>
+#include <sys/condvar.h>
+#include <sys/kmem.h>
+#include <sys/kthread.h>
+#include <sys/mutex.h>
+#include <sys/pool.h>
+#include <sys/proc.h>
+
+#include <uvm/uvm.h>
+
+#include <rump/rumpuser.h>
+#include "kernspace.h"
+
+static void *store[32];
+static struct pool pp1, pp2;
+
+static kmutex_t mtx;
+static kcondvar_t kcv;
+static int curstat;
+
+static void
+hthr(void *arg)
+{
+ int i;
+
+ mutex_enter(&mtx);
+ curstat++;
+ cv_signal(&kcv);
+
+ while (curstat < 2)
+ cv_wait(&kcv, &mtx);
+ mutex_exit(&mtx);
+
+ /* try to guarantee that the sleep is triggered in PR_WAITOK */
+ while ((kernel_map->flags & VM_MAP_WANTVA) == 0)
+ kpause("take5", false, 1, NULL);
+
+ for (i = 0; i < __arraycount(store); i++) {
+ pool_put(&pp1, store[i]);
+ }
+
+ kthread_exit(0);
+}
+
+void
+rumptest_alloc(size_t thelimit)
+{
+ char *c;
+ int succ, i;
+
+ mutex_init(&mtx, MUTEX_DEFAULT, IPL_NONE);
+ cv_init(&kcv, "venailu");
+
+ kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL, hthr, NULL, NULL, "h");
+
+ pool_init(&pp1, 1024, 0, 0, 0, "vara-allas",
+ &pool_allocator_nointr, IPL_NONE);
+ pool_init(&pp2, 1024, 0, 0, 0, "allas",
+ &pool_allocator_nointr, IPL_NONE);
+
+ for (i = 0; i < __arraycount(store); i++) {
+ store[i] = pool_get(&pp1, PR_NOWAIT);
+ if (store[i] == NULL) {
+ panic("pool_get store failed");
+ }
+ }
+
+ /* wait until other thread runs */
+ mutex_enter(&mtx);
+ while (curstat == 0)
+ cv_wait(&kcv, &mtx);
+ mutex_exit(&mtx);
+
+ for (succ = 0;; succ++) {
+ if (succ * 1024 > thelimit)
+ panic("managed to allocate over limit");
+ if ((c = pool_get(&pp2, PR_NOWAIT)) == NULL) {
+ mutex_enter(&mtx);
+ curstat++;
+ cv_signal(&kcv);
+ mutex_exit(&mtx);
+ if (pool_get(&pp2, PR_WAITOK) == NULL)
+ panic("pool get PR_WAITOK failed");
+ break;
+ }
+ *c = 'a';
+ }
+}
diff --git a/contrib/netbsd-tests/rump/kernspace/busypage.c b/contrib/netbsd-tests/rump/kernspace/busypage.c
new file mode 100644
index 0000000..e0142b7
--- /dev/null
+++ b/contrib/netbsd-tests/rump/kernspace/busypage.c
@@ -0,0 +1,94 @@
+/* $NetBSD: busypage.c,v 1.5 2011/08/07 14:03:15 rmind Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if !defined(lint)
+__RCSID("$NetBSD: busypage.c,v 1.5 2011/08/07 14:03:15 rmind Exp $");
+#endif /* !lint */
+
+#include <sys/param.h>
+#include <sys/condvar.h>
+#include <sys/kthread.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+
+#include <uvm/uvm.h>
+
+#include "kernspace.h"
+
+static struct uvm_object *uobj;
+static struct vm_page *testpg;
+static kcondvar_t tcv;
+
+static bool threadrun = false;
+
+static void
+thread(void *arg)
+{
+
+ mutex_enter(uobj->vmobjlock);
+ threadrun = true;
+ cv_signal(&tcv);
+ testpg->flags |= PG_WANTED;
+ UVM_UNLOCK_AND_WAIT(testpg, uobj->vmobjlock, false, "tw", 0);
+ kthread_exit(0);
+}
+
+void
+rumptest_busypage()
+{
+ struct lwp *newl;
+ int rv;
+
+ cv_init(&tcv, "napina");
+
+ uobj = uao_create(1, 0);
+ mutex_enter(uobj->vmobjlock);
+ testpg = uvm_pagealloc(uobj, 0, NULL, 0);
+ mutex_exit(uobj->vmobjlock);
+ if (testpg == NULL)
+ panic("couldn't create vm page");
+
+ rv = kthread_create(PRI_NONE, KTHREAD_MUSTJOIN | KTHREAD_MPSAFE, NULL,
+ thread, NULL, &newl, "jointest");
+ if (rv)
+ panic("thread creation failed: %d", rv);
+
+ mutex_enter(uobj->vmobjlock);
+ while (!threadrun)
+ cv_wait(&tcv, uobj->vmobjlock);
+
+ uvm_page_unbusy(&testpg, 1);
+ mutex_exit(uobj->vmobjlock);
+
+ rv = kthread_join(newl);
+ if (rv)
+ panic("thread join failed: %d", rv);
+
+}
diff --git a/contrib/netbsd-tests/rump/kernspace/kernspace.h b/contrib/netbsd-tests/rump/kernspace/kernspace.h
new file mode 100644
index 0000000..248f62f
--- /dev/null
+++ b/contrib/netbsd-tests/rump/kernspace/kernspace.h
@@ -0,0 +1,47 @@
+/* $NetBSD: kernspace.h,v 1.4 2011/01/14 13:08:00 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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 _TESTS_RUMP_KERNSPACE_KERNSPACE_H_
+#define _TESTS_RUMP_KERNSPACE_KERNSPACE_H_
+
+enum locktest { LOCKME_MTX, LOCKME_RWDOUBLEX, LOCKME_RWRX, LOCKME_RWXR,
+ LOCKME_DESTROYHELD, LOCKME_DOUBLEINIT, LOCKME_DOUBLEFREE,
+ LOCKME_MEMFREE };
+
+void rumptest_busypage(void);
+void rumptest_threadjoin(void);
+void rumptest_thread(void);
+void rumptest_tsleep(void);
+void rumptest_alloc(size_t);
+void rumptest_lockme(enum locktest);
+
+void rumptest_sendsig(char *);
+void rumptest_localsig(int);
+
+#endif /* _TESTS_RUMP_KERNSPACE_KERNSPACE_H_ */
diff --git a/contrib/netbsd-tests/rump/kernspace/lockme.c b/contrib/netbsd-tests/rump/kernspace/lockme.c
new file mode 100644
index 0000000..6f9bd58
--- /dev/null
+++ b/contrib/netbsd-tests/rump/kernspace/lockme.c
@@ -0,0 +1,92 @@
+/* $NetBSD: lockme.c,v 1.1 2011/01/06 13:12:52 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if !defined(lint)
+__RCSID("$NetBSD: lockme.c,v 1.1 2011/01/06 13:12:52 pooka Exp $");
+#endif /* !lint */
+
+#include <sys/param.h>
+#include <sys/kmem.h>
+#include <sys/mutex.h>
+#include <sys/rwlock.h>
+
+#include "kernspace.h"
+
+struct somemem {
+ char foo;
+ kmutex_t mutexetum;
+ char oof;
+};
+
+void
+rumptest_lockme(enum locktest what)
+{
+ struct somemem *some;
+ kmutex_t mtx;
+ krwlock_t rw;
+
+ rw_init(&rw);
+ mutex_init(&mtx, MUTEX_DEFAULT, IPL_NONE);
+
+ switch (what) {
+ case LOCKME_MTX:
+ mutex_enter(&mtx);
+ mutex_enter(&mtx);
+ break;
+ case LOCKME_RWDOUBLEX:
+ rw_enter(&rw, RW_WRITER);
+ rw_enter(&rw, RW_WRITER);
+ break;
+ case LOCKME_RWRX:
+ rw_enter(&rw, RW_READER);
+ rw_enter(&rw, RW_WRITER);
+ break;
+ case LOCKME_RWXR:
+ rw_enter(&rw, RW_WRITER);
+ rw_enter(&rw, RW_READER);
+ break;
+ case LOCKME_DOUBLEINIT:
+ mutex_init(&mtx, MUTEX_DEFAULT, IPL_NONE);
+ break;
+ case LOCKME_DOUBLEFREE:
+ mutex_destroy(&mtx);
+ mutex_destroy(&mtx);
+ break;
+ case LOCKME_DESTROYHELD:
+ mutex_enter(&mtx);
+ mutex_destroy(&mtx);
+ break;
+ case LOCKME_MEMFREE:
+ some = kmem_alloc(sizeof(*some), KM_SLEEP);
+ mutex_init(&some->mutexetum, MUTEX_DEFAULT, IPL_NONE);
+ kmem_free(some, sizeof(*some));
+ break;
+ }
+}
diff --git a/contrib/netbsd-tests/rump/kernspace/sendsig.c b/contrib/netbsd-tests/rump/kernspace/sendsig.c
new file mode 100644
index 0000000..f0b17a8
--- /dev/null
+++ b/contrib/netbsd-tests/rump/kernspace/sendsig.c
@@ -0,0 +1,82 @@
+/* $NetBSD: sendsig.c,v 1.1 2011/01/14 13:08:00 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if !defined(lint)
+__RCSID("$NetBSD: sendsig.c,v 1.1 2011/01/14 13:08:00 pooka Exp $");
+#endif /* !lint */
+
+#include <sys/param.h>
+#include <sys/proc.h>
+
+#include <rump/rump.h>
+
+#include "kernspace.h"
+
+/*
+ * loop until a non-system process appears and we can send it a signal
+ */
+void
+rumptest_sendsig(char *signo)
+{
+ struct proc *p;
+ bool sent = false;
+ int sig;
+
+ sig = strtoull(signo, NULL, 10);
+ rump_boot_setsigmodel(RUMP_SIGMODEL_RAISE);
+
+ mutex_enter(proc_lock);
+ while (!sent) {
+ PROCLIST_FOREACH(p, &allproc) {
+ if (p->p_pid > 1) {
+ mutex_enter(p->p_lock);
+ psignal(p, sig);
+ mutex_exit(p->p_lock);
+ sent = true;
+ break;
+ }
+ }
+ kpause("w8", false, 1, proc_lock);
+ }
+ mutex_exit(proc_lock);
+
+ /* restore default */
+ rump_boot_setsigmodel(RUMP_SIGMODEL_PANIC);
+}
+
+void
+rumptest_localsig(int signo)
+{
+ struct proc *p = curproc;
+
+ mutex_enter(p->p_lock);
+ psignal(p, signo);
+ mutex_exit(p->p_lock);
+}
diff --git a/contrib/netbsd-tests/rump/kernspace/thread.c b/contrib/netbsd-tests/rump/kernspace/thread.c
new file mode 100644
index 0000000..5c24f12
--- /dev/null
+++ b/contrib/netbsd-tests/rump/kernspace/thread.c
@@ -0,0 +1,108 @@
+/* $NetBSD: thread.c,v 1.2 2011/08/07 14:03:15 rmind Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if !defined(lint)
+__RCSID("$NetBSD: thread.c,v 1.2 2011/08/07 14:03:15 rmind Exp $");
+#endif /* !lint */
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+
+#include "kernspace.h"
+
+static volatile int testit;
+
+static void
+jointhread(void *arg)
+{
+
+ kpause("take5", false, 1, NULL);
+ testit = 1;
+ kthread_exit(0);
+}
+
+void
+rumptest_threadjoin()
+{
+ struct lwp *newl;
+ int rv;
+
+ rv = kthread_create(PRI_NONE, KTHREAD_MUSTJOIN | KTHREAD_MPSAFE, NULL,
+ jointhread, NULL, &newl, "jointest");
+ if (rv)
+ panic("thread creation failed: %d", rv);
+ rv = kthread_join(newl);
+ if (rv)
+ panic("thread join failed: %d", rv);
+
+ if (testit != 1)
+ panic("new thread did not run");
+}
+
+static kmutex_t mtx;
+static kcondvar_t cv;
+static int value;
+
+static void
+thethread(void *arg)
+{
+
+ mutex_enter(&mtx);
+ value = 1;
+ cv_signal(&cv);
+ mutex_exit(&mtx);
+
+ kthread_exit(0);
+}
+
+void
+rumptest_thread()
+{
+ struct lwp *newl;
+ int rv;
+
+ mutex_init(&mtx, MUTEX_DEFAULT, IPL_NONE);
+ cv_init(&cv, "jooei");
+ rv = kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL,
+ thethread, NULL, &newl, "ktest");
+ if (rv)
+ panic("thread creation failed: %d", rv);
+
+ mutex_enter(&mtx);
+ while (value == 0)
+ cv_wait(&cv, &mtx);
+ mutex_exit(&mtx);
+
+ /* try to verify thread really exists and we don't crash */
+ kpause("take1", false, 1, NULL);
+}
diff --git a/contrib/netbsd-tests/rump/kernspace/tsleep.c b/contrib/netbsd-tests/rump/kernspace/tsleep.c
new file mode 100644
index 0000000..4d08e0a
--- /dev/null
+++ b/contrib/netbsd-tests/rump/kernspace/tsleep.c
@@ -0,0 +1,100 @@
+/* $NetBSD: tsleep.c,v 1.4 2014/03/21 22:18:57 dholland Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if !defined(lint)
+__RCSID("$NetBSD: tsleep.c,v 1.4 2014/03/21 22:18:57 dholland Exp $");
+#endif /* !lint */
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/proc.h>
+
+#include "kernspace.h"
+
+#define NTHREADS 10
+
+/*
+ * mpsafe thread. need dedicated interlock
+ */
+static kmutex_t mymtx;
+
+static void
+tinythread(void *arg)
+{
+ static int wakeups;
+ int i, rv;
+ bool relock = ((uintptr_t)arg % 2) == 0;
+
+ for (i = 0; i < 1000; i++) {
+ mutex_enter(&mymtx);
+ wakeup(tinythread);
+ if (wakeups >= NTHREADS-1) {
+ mutex_exit(&mymtx);
+ break;
+ }
+ rv = mtsleep(tinythread, relock ? 0 : PNORELOCK,
+ "haa", 0, &mymtx);
+ if (relock)
+ mutex_exit(&mymtx);
+ if (rv != 0)
+ panic("mtsleep failed");
+ }
+
+ mutex_enter(&mymtx);
+ wakeups++;
+ wakeup(tinythread);
+
+ rv = mtsleep(rumptest_tsleep, PNORELOCK, "kepuli", 1, &mymtx);
+ if (rv != EWOULDBLOCK)
+ panic("mtsleep unexpected return value %d", rv);
+
+ kthread_exit(0);
+}
+
+void
+rumptest_tsleep()
+{
+ struct lwp *notbigl[NTHREADS];
+ int rv, i;
+
+ mutex_init(&mymtx, MUTEX_DEFAULT, IPL_NONE);
+
+ for (i = 0; i < NTHREADS; i++) {
+ rv = kthread_create(PRI_NONE, KTHREAD_MUSTJOIN| KTHREAD_MPSAFE,
+ NULL, tinythread, (void *)(uintptr_t)i, &notbigl[i], "nb");
+ if (rv)
+ panic("thread create failed: %d", rv);
+ }
+
+ for (i = 0; i < NTHREADS; i++) {
+ kthread_join(notbigl[i]);
+ }
+}
diff --git a/contrib/netbsd-tests/rump/modautoload/t_modautoload.c b/contrib/netbsd-tests/rump/modautoload/t_modautoload.c
new file mode 100644
index 0000000..f28ad55
--- /dev/null
+++ b/contrib/netbsd-tests/rump/modautoload/t_modautoload.c
@@ -0,0 +1,75 @@
+/* $NetBSD: t_modautoload.c,v 1.2 2014/03/10 22:38:53 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/module.h>
+#include <sys/dirent.h>
+#include <sys/sysctl.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <miscfs/kernfs/kernfs.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(modautoload);
+ATF_TC_HEAD(modautoload, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests that kernel module "
+ "autoload works in rump");
+}
+
+static void
+mountkernfs(void)
+{
+
+ if (!rump_nativeabi_p())
+ atf_tc_skip("host kernel modules not supported");
+
+ rump_init();
+
+ if (rump_sys_mkdir("/kern", 0777) == -1)
+ atf_tc_fail_errno("mkdir /kern");
+ if (rump_sys_mount(MOUNT_KERNFS, "/kern", 0, NULL, 0) == -1)
+ atf_tc_fail_errno("could not mount kernfs");
+}
+
+/*
+ * Why use kernfs here? It talks to plenty of other parts with the
+ * kernel (e.g. vfs_attach() in modcmd), but is still easy to verify
+ * it's working correctly.
+ */
+
+#define MAGICNUM 1323
+ATF_TC_BODY(modautoload, tc)
+{
+ extern int rumpns_hz;
+ char buf[64];
+ int fd;
+
+ mountkernfs();
+ rumpns_hz = MAGICNUM;
+ if ((fd = rump_sys_open("/kern/hz", O_RDONLY)) == -1)
+ atf_tc_fail_errno("open /kern/hz");
+ if (rump_sys_read(fd, buf, sizeof(buf)) <= 0)
+ atf_tc_fail_errno("read");
+ ATF_REQUIRE(atoi(buf) == MAGICNUM);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, modautoload);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/h_client/h_forkcli.c b/contrib/netbsd-tests/rump/rumpkern/h_client/h_forkcli.c
new file mode 100644
index 0000000..3b89727
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/h_client/h_forkcli.c
@@ -0,0 +1,169 @@
+/* $NetBSD: h_forkcli.c,v 1.1 2011/01/05 17:19:09 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rumpclient.h>
+
+static void
+simple(void)
+{
+ struct rumpclient_fork *rf;
+ pid_t pid1, pid2;
+ int fd, status;
+
+ if ((pid1 = rump_sys_getpid()) < 2)
+ errx(1, "unexpected pid %d", pid1);
+
+ fd = rump_sys_open("/dev/null", O_CREAT | O_RDWR);
+ if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
+ errx(1, "write newlyopened /dev/null");
+
+ if ((rf = rumpclient_prefork()) == NULL)
+ err(1, "prefork");
+
+ switch (fork()) {
+ case -1:
+ err(1, "fork");
+ break;
+ case 0:
+ if (rumpclient_fork_init(rf) == -1)
+ err(1, "postfork init failed");
+
+ if ((pid2 = rump_sys_getpid()) < 2)
+ errx(1, "unexpected pid %d", pid2);
+ if (pid1 == pid2)
+ errx(1, "child and parent pids are equal");
+
+ /* check that we can access the fd, the close it and exit */
+ if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
+ errx(1, "write child /dev/null");
+ rump_sys_close(fd);
+ break;
+ default:
+ /*
+ * check that we can access the fd, wait for the child, and
+ * check we can still access the fd
+ */
+ if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
+ errx(1, "write parent /dev/null");
+ if (wait(&status) == -1)
+ err(1, "wait failed");
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
+ errx(1, "child exited with status %d", status);
+ if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
+ errx(1, "write parent /dev/null");
+ break;
+ }
+}
+
+static void
+cancel(void)
+{
+
+ /* XXX: not implemented in client / server !!! */
+}
+
+#define TESTSTR "i am your fatherrrrrrr"
+#define TESTSLEN (sizeof(TESTSTR)-1)
+static void
+pipecomm(void)
+{
+ struct rumpclient_fork *rf;
+ char buf[TESTSLEN+1];
+ int pipetti[2];
+ int status;
+
+ if (rump_sys_pipe(pipetti) == -1)
+ errx(1, "pipe");
+
+ if ((rf = rumpclient_prefork()) == NULL)
+ err(1, "prefork");
+
+ switch (fork()) {
+ case -1:
+ err(1, "fork");
+ break;
+ case 0:
+ if (rumpclient_fork_init(rf) == -1)
+ err(1, "postfork init failed");
+
+ memset(buf, 0, sizeof(buf));
+ if (rump_sys_read(pipetti[0], buf, TESTSLEN) != TESTSLEN)
+ err(1, "pipe read");
+ if (strcmp(TESTSTR, buf) != 0)
+ errx(1, "teststring doesn't match, got %s", buf);
+ break;
+ default:
+ if (rump_sys_write(pipetti[1], TESTSTR, TESTSLEN) != TESTSLEN)
+ err(1, "pipe write");
+ if (wait(&status) == -1)
+ err(1, "wait failed");
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
+ errx(1, "child exited with status %d", status);
+ break;
+ }
+}
+
+static void
+fakeauth(void)
+{
+ struct rumpclient_fork *rf;
+ uint32_t *auth;
+ int rv;
+
+ if ((rf = rumpclient_prefork()) == NULL)
+ err(1, "prefork");
+
+ /* XXX: we know the internal structure of rf */
+ auth = (void *)rf;
+ *(auth+3) = *(auth+3) ^ 0x1;
+
+ rv = rumpclient_fork_init(rf);
+ if (!(rv == -1 && errno == ESRCH))
+ exit(1);
+}
+
+struct parsa {
+ const char *arg; /* sp arg, el */
+ void (*spring)(void); /* spring into action */
+} paragus[] = {
+ { "simple", simple },
+ { "cancel", cancel },
+ { "pipecomm", pipecomm },
+ { "fakeauth", fakeauth },
+};
+
+int
+main(int argc, char *argv[])
+{
+ unsigned i;
+
+ if (argc != 2)
+ errx(1, "invalid usage");
+
+ if (rumpclient_init() == -1)
+ err(1, "rumpclient init");
+
+ for (i = 0; i < __arraycount(paragus); i++) {
+ if (strcmp(argv[1], paragus[i].arg) == 0) {
+ paragus[i].spring();
+ break;
+ }
+ }
+ if (i == __arraycount(paragus)) {
+ printf("invalid test %s\n", argv[1]);
+ exit(1);
+ }
+
+ exit(0);
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/h_client/h_reconcli.c b/contrib/netbsd-tests/rump/rumpkern/h_client/h_reconcli.c
new file mode 100644
index 0000000..c594bbf
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/h_client/h_reconcli.c
@@ -0,0 +1,121 @@
+/* $NetBSD: h_reconcli.c,v 1.2 2011/02/19 09:56:45 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+#include <rump/rumpclient.h>
+#include <rump/rump_syscalls.h>
+
+#include <err.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static volatile int quit, riseandwhine;
+
+static pthread_mutex_t closermtx;
+static pthread_cond_t closercv;
+
+static void *
+closer(void *arg)
+{
+
+ pthread_mutex_lock(&closermtx);
+ while (!quit) {
+ while (!riseandwhine)
+ pthread_cond_wait(&closercv, &closermtx);
+ riseandwhine = 0;
+ pthread_mutex_unlock(&closermtx);
+
+ /* try to catch a random slot */
+ usleep(random() % 100000);
+
+ /*
+ * wide-angle disintegration beam, but takes care
+ * of the client rumpkernel communication socket.
+ */
+ closefrom(3);
+
+ pthread_mutex_lock(&closermtx);
+ }
+ pthread_mutex_unlock(&closermtx);
+
+ return NULL;
+}
+
+static const int hostnamemib[] = { CTL_KERN, KERN_HOSTNAME };
+static char goodhostname[128];
+
+static void *
+worker(void *arg)
+{
+ char hostnamebuf[128];
+ size_t blen;
+
+ pthread_mutex_lock(&closermtx);
+ while (!quit) {
+ pthread_mutex_unlock(&closermtx);
+ if (rump_sys_getpid() == -1)
+ err(1, "getpid");
+
+ blen = sizeof(hostnamebuf);
+ memset(hostnamebuf, 0, sizeof(hostnamebuf));
+ if (rump_sys___sysctl(hostnamemib, __arraycount(hostnamemib),
+ hostnamebuf, &blen, NULL, 0) == -1)
+ err(1, "sysctl");
+ if (strcmp(hostnamebuf, goodhostname) != 0)
+ exit(1);
+ pthread_mutex_lock(&closermtx);
+ riseandwhine = 1;
+ pthread_cond_signal(&closercv);
+ }
+ riseandwhine = 1;
+ pthread_cond_signal(&closercv);
+ pthread_mutex_unlock(&closermtx);
+
+ return NULL;
+}
+
+int
+main(int argc, char *argv[])
+{
+ pthread_t pt, w1, w2, w3, w4;
+ size_t blen;
+ int timecount;
+
+ if (argc != 2)
+ errx(1, "need timecount");
+ timecount = atoi(argv[1]);
+ if (timecount <= 0)
+ errx(1, "invalid timecount %d\n", timecount);
+
+ srandom(time(NULL));
+
+ rumpclient_setconnretry(RUMPCLIENT_RETRYCONN_INFTIME);
+ if (rumpclient_init() == -1)
+ err(1, "init");
+
+ blen = sizeof(goodhostname);
+ if (rump_sys___sysctl(hostnamemib, __arraycount(hostnamemib),
+ goodhostname, &blen, NULL, 0) == -1)
+ err(1, "sysctl");
+
+ pthread_create(&pt, NULL, closer, NULL);
+ pthread_create(&w1, NULL, worker, NULL);
+ pthread_create(&w2, NULL, worker, NULL);
+ pthread_create(&w3, NULL, worker, NULL);
+ pthread_create(&w4, NULL, worker, NULL);
+
+ sleep(timecount);
+ quit = 1;
+
+ pthread_join(pt, NULL);
+ pthread_join(w1, NULL);
+ pthread_join(w2, NULL);
+ pthread_join(w3, NULL);
+ pthread_join(w4, NULL);
+
+ exit(0);
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/h_client/h_sigcli.c b/contrib/netbsd-tests/rump/rumpkern/h_client/h_sigcli.c
new file mode 100644
index 0000000..9134f98
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/h_client/h_sigcli.c
@@ -0,0 +1,84 @@
+/* $NetBSD: h_sigcli.c,v 1.3 2011/02/07 20:05:09 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+#include <err.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rumpclient.h>
+
+static const int hostnamemib[] = { CTL_KERN, KERN_HOSTNAME };
+static char hostnamebuf[128];
+
+static volatile sig_atomic_t sigexecs;
+
+static void
+sighand(int sig)
+{
+ char buf[128];
+ size_t blen = sizeof(buf);
+
+ if (rump_sys___sysctl(hostnamemib, __arraycount(hostnamemib),
+ buf, &blen, NULL, 0) == -1)
+ err(1, "sighand sysctl");
+ if (strcmp(buf, hostnamebuf) != 0)
+ errx(1, "sighandler hostname");
+ sigexecs++;
+}
+
+int
+main(void)
+{
+ char buf[128];
+ time_t tstart;
+ struct itimerval itv;
+ size_t hnbsize;
+ int i;
+ size_t blen;
+
+ if (rumpclient_init() == -1)
+ err(1, "rumpclient init");
+
+ hnbsize = sizeof(hostnamebuf);
+ if (rump_sys___sysctl(hostnamemib, __arraycount(hostnamemib),
+ hostnamebuf, &hnbsize, NULL, 0) == -1)
+ err(1, "sysctl");
+
+ if (signal(SIGALRM, sighand) == SIG_ERR)
+ err(1, "signal");
+
+ itv.it_interval.tv_sec = itv.it_value.tv_sec = 0;
+ itv.it_interval.tv_usec = itv.it_value.tv_usec = 10000; /* 10ms */
+
+ if (setitimer(ITIMER_REAL, &itv, NULL) == -1)
+ err(1, "itimer");
+
+ tstart = time(NULL);
+ for (i = 0;; i++) {
+ blen = sizeof(buf);
+ if (rump_sys___sysctl(hostnamemib, __arraycount(hostnamemib),
+ buf, &blen, NULL, 0) == -1)
+ err(1, "sysctl");
+ if (strcmp(buf, hostnamebuf) != 0)
+ errx(1, "main hostname");
+
+ /*
+ * check every 100 cycles to avoid doing
+ * nothing but gettimeofday()
+ */
+ if (i == 100) {
+ if (time(NULL) - tstart > 5)
+ break;
+ i = 0;
+ }
+ }
+
+ if (!sigexecs) {
+ printf("no signal handlers run. test busted?\n");
+ }
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/h_client/h_simplecli.c b/contrib/netbsd-tests/rump/rumpkern/h_client/h_simplecli.c
new file mode 100644
index 0000000..11f432c
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/h_client/h_simplecli.c
@@ -0,0 +1,30 @@
+/* $NetBSD: h_simplecli.c,v 1.2 2011/01/14 13:23:15 pooka Exp $ */
+
+#include <sys/types.h>
+
+#include <err.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rumpclient.h>
+
+int
+main(int argc, char *argv[])
+{
+
+ if (rumpclient_init() == -1)
+ err(1, "rumpclient init");
+
+ if (argc > 1) {
+ for (;;) {
+ rump_sys_getpid();
+ usleep(10000);
+ }
+ } else {
+ if (rump_sys_getpid() > 0)
+ exit(0);
+ err(1, "getpid");
+ }
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/h_client/h_stresscli.c b/contrib/netbsd-tests/rump/rumpkern/h_client/h_stresscli.c
new file mode 100644
index 0000000..d49edeb
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/h_client/h_stresscli.c
@@ -0,0 +1,219 @@
+/* $NetBSD: h_stresscli.c,v 1.9 2011/06/26 13:17:36 christos Exp $ */
+
+#include <sys/types.h>
+#include <sys/atomic.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+
+#include <err.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <rump/rump_syscalls.h>
+#include <rump/rumpclient.h>
+
+static unsigned int syscalls, bindcalls;
+static pid_t mypid;
+static volatile sig_atomic_t doquit;
+
+static void
+signaali(int sig)
+{
+
+ doquit = 1;
+}
+
+static const int hostnamemib[] = { CTL_KERN, KERN_HOSTNAME };
+static char hostnamebuf[128];
+#define HOSTNAMEBASE "rumpclient"
+
+static int iskiller;
+
+static void *
+client(void *arg)
+{
+ char buf[256];
+ struct sockaddr_in sin;
+ size_t blen;
+ int port = (int)(uintptr_t)arg;
+ int s, fd, x;
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ sin.sin_port = htons(port);
+
+ while (!doquit) {
+ pid_t pidi;
+ blen = sizeof(buf);
+ s = rump_sys_socket(PF_INET, SOCK_STREAM, 0);
+ if (s == -1)
+ err(1, "socket");
+ atomic_inc_uint(&syscalls);
+
+ fd = rump_sys_open("/dev/null", O_RDWR);
+ atomic_inc_uint(&syscalls);
+
+ if (doquit)
+ goto out;
+
+ x = 1;
+ if (rump_sys_setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
+ &x, sizeof(x)) == -1)
+ err(1, "reuseaddr");
+
+ /*
+ * we don't really know when the kernel handles our disconnect,
+ * so be soft about about the failure in case of a killer client
+ */
+ if (rump_sys_bind(s, (struct sockaddr*)&sin, sizeof(sin))==-1) {
+ if (!iskiller)
+ err(1, "bind to port %d failed",
+ ntohs(sin.sin_port));
+ } else {
+ atomic_inc_uint(&bindcalls);
+ }
+ atomic_inc_uint(&syscalls);
+
+ if (doquit)
+ goto out;
+
+ if (rump_sys___sysctl(hostnamemib, __arraycount(hostnamemib),
+ buf, &blen, NULL, 0) == -1)
+ err(1, "sysctl");
+ if (strncmp(buf, hostnamebuf, sizeof(HOSTNAMEBASE)-1) != 0)
+ errx(1, "hostname (%s/%s) mismatch", buf, hostnamebuf);
+ atomic_inc_uint(&syscalls);
+
+ if (doquit)
+ goto out;
+
+ pidi = rump_sys_getpid();
+ if (pidi == -1)
+ err(1, "getpid");
+ if (pidi != mypid)
+ errx(1, "mypid mismatch");
+ atomic_inc_uint(&syscalls);
+
+ if (doquit)
+ goto out;
+
+ if (rump_sys_write(fd, buf, 16) != 16)
+ err(1, "write /dev/null");
+ atomic_inc_uint(&syscalls);
+
+ out:
+ rump_sys_close(fd);
+ atomic_inc_uint(&syscalls);
+ rump_sys_close(s);
+ atomic_inc_uint(&syscalls);
+ }
+
+ return NULL;
+}
+
+/* Stress with max 32 clients, 8 threads each (256 concurrent threads) */
+#define NCLI 32
+#define NTHR 8
+
+int
+main(int argc, char *argv[])
+{
+ pthread_t pt[NTHR-1];
+ pid_t clis[NCLI];
+ pid_t apid;
+ int ncli = 0;
+ int i = 0, j;
+ int status, thesig;
+ int rounds, myport;
+
+ if (argc != 2 && argc != 3)
+ errx(1, "need roundcount");
+
+ if (argc == 3) {
+ if (strcmp(argv[2], "kill") != 0)
+ errx(1, "optional 3rd param must be kill");
+ thesig = SIGKILL;
+ iskiller = 1;
+ } else {
+ thesig = SIGUSR1;
+ }
+
+ signal(SIGUSR1, signaali);
+
+ memset(clis, 0, sizeof(clis));
+ for (rounds = 1; rounds < atoi(argv[1])*10; rounds++) {
+ while (ncli < NCLI) {
+ switch ((apid = fork())) {
+ case -1:
+ err(1, "fork failed");
+ case 0:
+ if (rumpclient_init() == -1)
+ err(1, "rumpclient init");
+
+ mypid = rump_sys_getpid();
+ sprintf(hostnamebuf, HOSTNAMEBASE "%d", mypid);
+ if (rump_sys___sysctl(hostnamemib,
+ __arraycount(hostnamemib), NULL, NULL,
+ hostnamebuf, strlen(hostnamebuf)+1) == -1)
+ err(1, "sethostname");
+
+ for (j = 0; j < NTHR-1; j++) {
+ myport = i*NCLI + j+2;
+ if (pthread_create(&pt[j], NULL,
+ client,
+ (void*)(uintptr_t)myport) !=0 )
+ err(1, "pthread create");
+ }
+ myport = i*NCLI+1;
+ client((void *)(uintptr_t)myport);
+ for (j = 0; j < NTHR-1; j++)
+ pthread_join(pt[j], NULL);
+ membar_consumer();
+ fprintf(stderr, "done %d\n", syscalls);
+ exit(0);
+ /* NOTREACHED */
+ default:
+ ncli++;
+ clis[i] = apid;
+ break;
+ }
+
+ i = (i + 1) % NCLI;
+ }
+
+ usleep(100000);
+ kill(clis[i], thesig);
+
+ apid = wait(&status);
+ if (apid != clis[i])
+ errx(1, "wanted pid %d, got %d\n", clis[i], apid);
+ clis[i] = 0;
+ ncli--;
+ if (thesig == SIGUSR1) {
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+ fprintf(stderr, "child died with 0x%x\n",
+ status);
+ exit(1);
+ }
+ } else {
+ if (!WIFSIGNALED(status) || WTERMSIG(status) != thesig){
+ fprintf(stderr, "child died with 0x%x\n",
+ status);
+ exit(1);
+ }
+ }
+ }
+
+ for (i = 0; i < NCLI; i++)
+ if (clis[i])
+ kill(clis[i], SIGKILL);
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c b/contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c
new file mode 100644
index 0000000..4e04c22
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c
@@ -0,0 +1,63 @@
+/* $NetBSD: h_simpleserver.c,v 1.3 2011/01/14 13:23:15 pooka Exp $ */
+
+#include <sys/types.h>
+
+#include <rump/rump.h>
+
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "../../kernspace/kernspace.h"
+
+#define NOFAIL(e) do { int rv = e; if (rv) err(1, #e); } while (/*CONSTCOND*/0)
+
+struct {
+ const char *str;
+ void (*dofun)(char *);
+} actions[] = {
+ { "sendsig", rumptest_sendsig },
+};
+
+int
+main(int argc, char *argv[])
+{
+ unsigned i;
+ bool match;
+
+ if (argc < 2)
+ exit(1);
+
+ NOFAIL(rump_daemonize_begin());
+ NOFAIL(rump_init());
+ NOFAIL(rump_init_server(argv[1]));
+ NOFAIL(rump_daemonize_done(RUMP_DAEMONIZE_SUCCESS));
+
+ if (argc > 2) {
+ char *arg = NULL;
+
+ if (argc == 4)
+ arg = argv[3];
+
+ for (i = 0; i < __arraycount(actions); i++) {
+ if (strcmp(actions[i].str, argv[2]) == 0) {
+ rump_schedule();
+ actions[i].dofun(arg);
+ rump_unschedule();
+ match = true;
+ }
+ }
+
+ if (!match) {
+ exit(1);
+ }
+ pause();
+ } else {
+ for (;;)
+ pause();
+ }
+
+ return 0;
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_copy.c b/contrib/netbsd-tests/rump/rumpkern/t_copy.c
new file mode 100644
index 0000000..a31e58c
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_copy.c
@@ -0,0 +1,139 @@
+/* $NetBSD: t_copy.c,v 1.2 2013/07/26 16:09:48 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <string.h>
+
+#include <rump/rump.h>
+
+ATF_TC(copystr);
+ATF_TC_HEAD(copystr, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests copystr()");
+}
+
+ATF_TC(copyinstr);
+ATF_TC_HEAD(copyinstr, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests copyinstr()");
+}
+
+ATF_TC(copyoutstr);
+ATF_TC_HEAD(copyoutstr, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests copyoutstr()");
+}
+
+typedef int (copystr_fn)(const void *, void *, size_t, size_t *);
+typedef int (copy_fn)(const void *, void *, size_t);
+
+extern copystr_fn rumpns_copystr, rumpns_copyinstr, rumpns_copyoutstr;
+extern copy_fn rumpns_copyin, rumpns_copyout;
+
+#define TESTSTR "jippii, lisaa puuroa"
+
+static void
+dotest(copystr_fn *thefun)
+{
+ char buf[sizeof(TESTSTR)+1];
+ size_t len;
+
+ rump_init();
+ rump_schedule();
+
+ /* larger buffer */
+ memset(buf, 0xaa, sizeof(buf));
+ ATF_REQUIRE_EQ(thefun(TESTSTR, buf, sizeof(buf), &len), 0);
+ ATF_REQUIRE_EQ(len, sizeof(TESTSTR));
+ ATF_REQUIRE_STREQ(TESTSTR, buf);
+
+ /* just large enough */
+ memset(buf, 0xaa, sizeof(buf));
+ ATF_REQUIRE_EQ(thefun(TESTSTR, buf, sizeof(buf)-1, &len), 0);
+ ATF_REQUIRE_EQ(len, sizeof(TESTSTR));
+ ATF_REQUIRE_STREQ(TESTSTR, buf);
+
+ /* one too small */
+ memset(buf, 0xaa, sizeof(buf));
+ ATF_REQUIRE_EQ(thefun(TESTSTR, buf, sizeof(buf)-2, NULL), ENAMETOOLONG);
+
+ rump_unschedule();
+}
+
+ATF_TC_BODY(copystr, tc)
+{
+
+ dotest(rumpns_copystr);
+}
+
+ATF_TC_BODY(copyinstr, tc)
+{
+
+ dotest(rumpns_copyinstr);
+}
+
+ATF_TC_BODY(copyoutstr, tc)
+{
+
+ dotest(rumpns_copyoutstr);
+}
+
+ATF_TC(copy_efault);
+ATF_TC_HEAD(copy_efault, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests that copy(9) functions can return EFAULT");
+}
+ATF_TC_BODY(copy_efault, tc)
+{
+ char buf[1024];
+
+ ATF_REQUIRE_EQ(rumpns_copyin(NULL, buf, sizeof(buf)), EFAULT);
+ ATF_REQUIRE_EQ(rumpns_copyout(buf, NULL, sizeof(buf)), EFAULT);
+
+ ATF_REQUIRE_EQ(rumpns_copyinstr(NULL, buf, sizeof(buf), NULL), EFAULT);
+ ATF_REQUIRE_EQ(rumpns_copyoutstr(buf, NULL, sizeof(buf), NULL), EFAULT);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, copystr);
+ ATF_TP_ADD_TC(tp, copyinstr);
+ ATF_TP_ADD_TC(tp, copyoutstr);
+ ATF_TP_ADD_TC(tp, copy_efault);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_kern.c b/contrib/netbsd-tests/rump/rumpkern/t_kern.c
new file mode 100644
index 0000000..fcaf1f8
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_kern.c
@@ -0,0 +1,119 @@
+/* $NetBSD: t_kern.c,v 1.3 2012/01/30 13:05:52 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/types.h>
+#include <sys/signal.h>
+#include <sys/wait.h>
+
+#include <rump/rump.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+#include "../kernspace/kernspace.h"
+
+#define LOCKFUN(_name_, _descr_,_needld_, _expect_) \
+ ATF_TC(lockme_##_name_); \
+ ATF_TC_HEAD(lockme_##_name_, tc) { \
+ atf_tc_set_md_var(tc, "descr", _descr_); \
+ } \
+ ATF_TC_BODY(lockme_##_name_, tc) { \
+ locktest(tc, LOCKME_##_name_, _needld_, _expect_); \
+ }
+
+static void
+locktest(const atf_tc_t *tc, enum locktest lt, int needld, const char *expect)
+{
+ extern const int rump_lockdebug;
+ int pipetti[2];
+ int status;
+
+ if (needld && !rump_lockdebug)
+ atf_tc_skip("test requires LOCKDEBUG kernel");
+ RL(pipe(pipetti));
+
+ switch (fork()) {
+ case 0:
+ RL(dup2(pipetti[1], STDOUT_FILENO));
+ RL(dup2(pipetti[1], STDOUT_FILENO));
+ rump_init();
+ rump_schedule();
+ rumptest_lockme(lt);
+ rump_unschedule();
+ break;
+ default:
+ RL(wait(&status));
+ ATF_REQUIRE(WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT);
+ if (rump_lockdebug) {
+ char buf[8192];
+
+ ATF_REQUIRE(read(pipetti[0], buf, sizeof(buf)) > 0);
+ if (strncmp(buf, expect, strlen(expect)) != 0)
+ atf_tc_fail("unexpected output");
+ }
+ break;
+ case -1:
+ atf_tc_fail("fork");
+ }
+}
+
+LOCKFUN(DESTROYHELD, "destroy lock while held", 0,
+ "mutex error: lockdebug_free: is locked or in use");
+LOCKFUN(DOUBLEFREE, "free lock twice", 0,
+ "panic: lockdebug_lookup: uninitialized lock");
+LOCKFUN(DOUBLEINIT, "init lock twice", 1,
+ "mutex error: lockdebug_alloc: already initialized");
+LOCKFUN(MEMFREE, "free memory active lock is in", 1,
+ "mutex error: kmem_intr_free: allocation contains active lock");
+LOCKFUN(MTX, "locking-against-self mutex", 0,
+ "mutex error: lockdebug_wantlock: locking against myself");
+LOCKFUN(RWDOUBLEX, "locking-against-self exclusive rwlock", 0,
+ "rwlock error: lockdebug_wantlock: locking against myself");
+LOCKFUN(RWRX, "rw: first shared, then exclusive", 1,
+ "rwlock error: lockdebug_wantlock: locking against myself");
+LOCKFUN(RWXR, "rw: first execusive, then shared", 0,
+ "rwlock error: lockdebug_wantlock: locking against myself");
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, lockme_MTX);
+ ATF_TP_ADD_TC(tp, lockme_RWDOUBLEX);
+ ATF_TP_ADD_TC(tp, lockme_RWRX);
+ ATF_TP_ADD_TC(tp, lockme_RWXR);
+ ATF_TP_ADD_TC(tp, lockme_DOUBLEINIT);
+ ATF_TP_ADD_TC(tp, lockme_DOUBLEFREE);
+ ATF_TP_ADD_TC(tp, lockme_DESTROYHELD);
+ ATF_TP_ADD_TC(tp, lockme_MEMFREE);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c b/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c
new file mode 100644
index 0000000..dcdfdb6
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c
@@ -0,0 +1,316 @@
+/* $NetBSD: t_lwproc.c,v 1.5 2011/01/02 12:58:17 pooka Exp $ */
+
+/*
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+#include <sys/wait.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <util.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(makelwp);
+ATF_TC_HEAD(makelwp, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests that lwps can be attached to "
+ "processes");
+}
+
+ATF_TC_BODY(makelwp, tc)
+{
+ struct lwp *l;
+ pid_t pid;
+
+ rump_init();
+ RZ(rump_pub_lwproc_newlwp(0));
+ ATF_REQUIRE_EQ(rump_pub_lwproc_newlwp(37), ESRCH);
+ l = rump_pub_lwproc_curlwp();
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ ATF_REQUIRE(rump_pub_lwproc_curlwp() != l);
+ l = rump_pub_lwproc_curlwp();
+
+ RZ(rump_pub_lwproc_newlwp(rump_sys_getpid()));
+ ATF_REQUIRE(rump_pub_lwproc_curlwp() != l);
+
+ pid = rump_sys_getpid();
+ ATF_REQUIRE(pid != -1 && pid != 0);
+}
+
+ATF_TC(proccreds);
+ATF_TC_HEAD(proccreds, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check that procs have different creds");
+}
+
+ATF_TC_BODY(proccreds, tc)
+{
+ struct lwp *l1, *l2;
+
+ rump_init();
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ l1 = rump_pub_lwproc_curlwp();
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ l2 = rump_pub_lwproc_curlwp();
+
+ RL(rump_sys_setuid(22));
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 22);
+
+ rump_pub_lwproc_switch(l1);
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 0); /* from parent, proc0 */
+ RL(rump_sys_setuid(11));
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 11);
+
+ rump_pub_lwproc_switch(l2);
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 22);
+ rump_pub_lwproc_newlwp(rump_sys_getpid());
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 22);
+}
+
+
+ATF_TC(inherit);
+ATF_TC_HEAD(inherit, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "new processes inherit creds from "
+ "parents");
+}
+
+ATF_TC_BODY(inherit, tc)
+{
+
+ rump_init();
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ RL(rump_sys_setuid(66));
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 66);
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 66);
+
+ /* release lwp and proc */
+ rump_pub_lwproc_releaselwp();
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 0);
+}
+
+ATF_TC(lwps);
+ATF_TC_HEAD(lwps, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "proc can hold many lwps and is "
+ "automatically g/c'd when the last one exits");
+}
+
+#define LOOPS 128
+ATF_TC_BODY(lwps, tc)
+{
+ struct lwp *l[LOOPS];
+ pid_t mypid;
+ struct lwp *l_orig;
+ int i;
+
+ rump_init();
+
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ mypid = rump_sys_getpid();
+ RL(rump_sys_setuid(375));
+
+ l_orig = rump_pub_lwproc_curlwp();
+ for (i = 0; i < LOOPS; i++) {
+ mypid = rump_sys_getpid();
+ ATF_REQUIRE(mypid != -1 && mypid != 0);
+ RZ(rump_pub_lwproc_newlwp(mypid));
+ l[i] = rump_pub_lwproc_curlwp();
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 375);
+ }
+
+ rump_pub_lwproc_switch(l_orig);
+ rump_pub_lwproc_releaselwp();
+ for (i = 0; i < LOOPS; i++) {
+ rump_pub_lwproc_switch(l[i]);
+ ATF_REQUIRE_EQ(rump_sys_getpid(), mypid);
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 375);
+ rump_pub_lwproc_releaselwp();
+ ATF_REQUIRE_EQ(rump_sys_getpid(), 1);
+ ATF_REQUIRE_EQ(rump_sys_getuid(), 0);
+ }
+
+ ATF_REQUIRE_EQ(rump_pub_lwproc_newlwp(mypid), ESRCH);
+}
+
+ATF_TC(nolwprelease);
+ATF_TC_HEAD(nolwprelease, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check that lwp context is required "
+ "for lwproc_releaselwp()");
+}
+
+ATF_TC_BODY(nolwprelease, tc)
+{
+ int status;
+
+ switch (fork()) {
+ case 0:
+ rump_init();
+ rump_pub_lwproc_releaselwp();
+ atf_tc_fail("survived");
+ break;
+ case -1:
+ atf_tc_fail_errno("fork");
+ break;
+ default:
+ wait(&status);
+ ATF_REQUIRE(WIFSIGNALED(status));
+ ATF_REQUIRE_EQ(WTERMSIG(status), SIGABRT);
+
+ }
+}
+
+ATF_TC(nolwp);
+ATF_TC_HEAD(nolwp, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check that curlwp for an implicit "
+ "context is NULL");
+}
+
+ATF_TC_BODY(nolwp, tc)
+{
+
+ rump_init();
+ ATF_REQUIRE_EQ(rump_pub_lwproc_curlwp(), NULL);
+}
+
+ATF_TC(nullswitch);
+ATF_TC_HEAD(nullswitch, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check that switching to NULL marks "
+ "current lwp as not running");
+}
+
+ATF_TC_BODY(nullswitch, tc)
+{
+ struct lwp *l;
+
+ rump_init();
+ RZ(rump_pub_lwproc_newlwp(0));
+ l = rump_pub_lwproc_curlwp();
+ rump_pub_lwproc_switch(NULL);
+ /* if remains LP_RUNNING, next call will panic */
+ rump_pub_lwproc_switch(l);
+}
+
+ATF_TC(rfork);
+ATF_TC_HEAD(rfork, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "check that fork shares fd's");
+}
+
+ATF_TC_BODY(rfork, tc)
+{
+ struct stat sb;
+ struct lwp *l, *l2;
+ int fd;
+
+ RZ(rump_init());
+
+ ATF_REQUIRE_EQ(rump_pub_lwproc_rfork(RUMP_RFFDG|RUMP_RFCFDG), EINVAL);
+
+ RZ(rump_pub_lwproc_rfork(0));
+ l = rump_pub_lwproc_curlwp();
+
+ RL(fd = rump_sys_open("/file", O_RDWR | O_CREAT, 0777));
+
+ /* ok, first check rfork(RUMP_RFCFDG) does *not* preserve fd's */
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+ ATF_REQUIRE_ERRNO(EBADF, rump_sys_write(fd, &fd, sizeof(fd)) == -1);
+
+ /* then check that rfork(0) does */
+ rump_pub_lwproc_switch(l);
+ RZ(rump_pub_lwproc_rfork(0));
+ ATF_REQUIRE_EQ(rump_sys_write(fd, &fd, sizeof(fd)), sizeof(fd));
+ RL(rump_sys_fstat(fd, &sb));
+ l2 = rump_pub_lwproc_curlwp();
+
+ /*
+ * check that the shared fd table is really shared by
+ * closing fd in parent
+ */
+ rump_pub_lwproc_switch(l);
+ RL(rump_sys_close(fd));
+ rump_pub_lwproc_switch(l2);
+ ATF_REQUIRE_ERRNO(EBADF, rump_sys_fstat(fd, &sb) == -1);
+
+ /* redo, this time copying the fd table instead of sharing it */
+ rump_pub_lwproc_releaselwp();
+ rump_pub_lwproc_switch(l);
+ RL(fd = rump_sys_open("/file", O_RDWR, 0777));
+ RZ(rump_pub_lwproc_rfork(RUMP_RFFDG));
+ ATF_REQUIRE_EQ(rump_sys_write(fd, &fd, sizeof(fd)), sizeof(fd));
+ RL(rump_sys_fstat(fd, &sb));
+ l2 = rump_pub_lwproc_curlwp();
+
+ /* check that the fd table is copied */
+ rump_pub_lwproc_switch(l);
+ RL(rump_sys_close(fd));
+ rump_pub_lwproc_switch(l2);
+ RL(rump_sys_fstat(fd, &sb));
+ ATF_REQUIRE_EQ(sb.st_size, sizeof(fd));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, makelwp);
+ ATF_TP_ADD_TC(tp, proccreds);
+ ATF_TP_ADD_TC(tp, inherit);
+ ATF_TP_ADD_TC(tp, lwps);
+ ATF_TP_ADD_TC(tp, nolwprelease);
+ ATF_TP_ADD_TC(tp, nolwp);
+ ATF_TP_ADD_TC(tp, nullswitch);
+ ATF_TP_ADD_TC(tp, rfork);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_modcmd.c b/contrib/netbsd-tests/rump/rumpkern/t_modcmd.c
new file mode 100644
index 0000000..032e312
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_modcmd.c
@@ -0,0 +1,182 @@
+/* $NetBSD: t_modcmd.c,v 1.9 2010/05/31 23:51:28 pooka Exp $ */
+
+/*
+ * Copyright (c) 2009 The NetBSD Foundation, 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 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/types.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <fs/tmpfs/tmpfs_args.h>
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <err.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <util.h>
+
+#include "../../h_macros.h"
+/*
+ * We verify that modules can be loaded and unloaded.
+ * tmpfs was chosen because it does not depend on an image.
+ */
+
+ATF_TC(cmsg_modcmd);
+ATF_TC_HEAD(cmsg_modcmd, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks that loading and unloading "
+ "a module (vfs/tmpfs) is possible");
+}
+
+static int
+disable_autoload(void)
+{
+ struct sysctlnode q, ans[256];
+ int mib[3];
+ size_t alen;
+ unsigned i;
+ bool no;
+
+ mib[0] = CTL_KERN;
+ mib[1] = CTL_QUERY;
+ alen = sizeof(ans);
+
+ memset(&q, 0, sizeof(q));
+ q.sysctl_flags = SYSCTL_VERSION;
+
+ if (rump_sys___sysctl(mib, 2, ans, &alen, &q, sizeof(q)) == -1)
+ return -1;
+
+ for (i = 0; i < __arraycount(ans); i++)
+ if (strcmp("module", ans[i].sysctl_name) == 0)
+ break;
+ if (i == __arraycount(ans)) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ mib[1] = ans[i].sysctl_num;
+ mib[2] = CTL_QUERY;
+
+ if (rump_sys___sysctl(mib, 3, ans, &alen, &q, sizeof(q)) == -1)
+ return errno;
+
+ for (i = 0; i < __arraycount(ans); i++)
+ if (strcmp("autoload", ans[i].sysctl_name) == 0)
+ break;
+ if (i == __arraycount(ans)) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ mib[2] = ans[i].sysctl_num;
+
+ no = false;
+ alen = 0;
+ if (rump_sys___sysctl(mib, 3, NULL, &alen, &no, sizeof(no)) == -1)
+ return errno;
+
+ return 0;
+
+}
+
+#define TMPFSMODULE "librumpfs_tmpfs.so"
+ATF_TC_BODY(cmsg_modcmd, tc)
+{
+ struct tmpfs_args args;
+ const struct modinfo *const *mi_start, *const *mi_end;
+ void *handle;
+ int i, rv, loop = 0;
+
+ rump_init();
+
+ if (disable_autoload() == -1)
+ atf_tc_fail_errno("count not disable module autoload");
+
+ memset(&args, 0, sizeof(args));
+ args.ta_version = TMPFS_ARGS_VERSION;
+ args.ta_root_mode = 0777;
+
+ if (rump_sys_mkdir("/mp", 0777) == -1)
+ atf_tc_fail_errno("mkdir mountpoint");
+ if (rump_sys_mount(MOUNT_TMPFS, "/mp", 0, &args, sizeof(args)) != -1)
+ atf_tc_fail("mount unexpectedly succeeded");
+
+ handle = dlopen(TMPFSMODULE, RTLD_GLOBAL);
+ if (handle == NULL) {
+ const char *dlmsg = dlerror();
+ atf_tc_fail("cannot open %s: %s", TMPFSMODULE, dlmsg);
+ }
+
+ again:
+ mi_start = dlsym(handle, "__start_link_set_modules");
+ mi_end = dlsym(handle, "__stop_link_set_modules");
+ if (mi_start == NULL || mi_end == NULL)
+ atf_tc_fail("cannot find module info");
+ if ((rv = rump_pub_module_init(mi_start, (size_t)(mi_end-mi_start)))!=0)
+ atf_tc_fail("module init failed: %d (%s)", rv, strerror(rv));
+ if ((rv = rump_pub_module_init(mi_start, (size_t)(mi_end-mi_start)))==0)
+ atf_tc_fail("module double init succeeded");
+
+ if (rump_sys_mount(MOUNT_TMPFS, "/mp", 0, &args, sizeof(args)) == -1)
+ atf_tc_fail_errno("still cannot mount");
+ if (rump_sys_unmount("/mp", 0) == -1)
+ atf_tc_fail("cannot unmount");
+ for (i = 0; i < (int)(mi_end-mi_start); i++) {
+ if ((rv = rump_pub_module_fini(mi_start[i])) != 0)
+ atf_tc_fail("module fini failed: %d (%s)",
+ rv, strerror(rv));
+ }
+ for (i = 0; i < (int)(mi_end-mi_start); i++) {
+ if ((rv = rump_pub_module_fini(mi_start[i])) == 0)
+ atf_tc_fail("module double fini succeeded");
+ }
+ if (loop++ == 0)
+ goto again;
+
+ if (dlclose(handle)) {
+ const char *dlmsg = dlerror();
+ atf_tc_fail("cannot close %s: %s", TMPFSMODULE, dlmsg);
+ }
+
+ if (rump_sys_mount(MOUNT_TMPFS, "/mp", 0, &args, sizeof(args)) != -1)
+ atf_tc_fail("mount unexpectedly succeeded");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, cmsg_modcmd);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_modlinkset.c b/contrib/netbsd-tests/rump/rumpkern/t_modlinkset.c
new file mode 100644
index 0000000..a4d34bb
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_modlinkset.c
@@ -0,0 +1,73 @@
+/* $NetBSD: t_modlinkset.c,v 1.2 2009/11/06 15:26:54 pooka Exp $ */
+
+/*
+ * Copyright (c) 2009 The NetBSD Foundation, 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 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/types.h>
+#include <sys/mount.h>
+
+#include <rump/rump.h>
+#include <rump/ukfs.h>
+
+#include <atf-c.h>
+#include <dlfcn.h>
+#include <err.h>
+#include <errno.h>
+#include <string.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(modlinkset);
+ATF_TC_HEAD(modlinkset, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Check that module linkset bootstrap "
+ "works");
+}
+
+/*
+ * We link against cd9660 and msdosfs (both chosed because the names
+ * are unlikely to ever be a substring of a another file system).
+ * Without proper linkset handling at most one will be reported.
+ */
+ATF_TC_BODY(modlinkset, tc)
+{
+ char buf[1024];
+
+ rump_init();
+ if (ukfs_vfstypes(buf, sizeof(buf)) == -1)
+ atf_tc_fail_errno("ukfs_vfstypes");
+
+ ATF_CHECK((strstr(buf, "msdos") != NULL));
+ ATF_CHECK((strstr(buf, "cd9660") != NULL));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, modlinkset);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_signals.c b/contrib/netbsd-tests/rump/rumpkern/t_signals.c
new file mode 100644
index 0000000..e113af2
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_signals.c
@@ -0,0 +1,127 @@
+/* $NetBSD: t_signals.c,v 1.2 2011/02/20 19:45:45 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/types.h>
+#include <sys/wait.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <string.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include <rump/rump.h>
+
+#include "../kernspace/kernspace.h"
+#include "../../h_macros.h"
+
+ATF_TC(sigraise);
+ATF_TC_HEAD(sigraise, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "RUMP_SIGMODEL_RAISE");
+}
+
+ATF_TC(sigignore);
+ATF_TC_HEAD(sigignore, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "RUMP_SIGMODEL_IGNORE");
+}
+
+ATF_TC(sigpanic);
+ATF_TC_HEAD(sigpanic, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "RUMP_SIGMODEL_PANIC");
+}
+
+static volatile sig_atomic_t sigcnt;
+static void
+thehand(int sig)
+{
+
+ sigcnt++;
+}
+
+ATF_TC_BODY(sigraise, tc)
+{
+
+ signal(SIGUSR2, thehand);
+ rump_boot_setsigmodel(RUMP_SIGMODEL_RAISE);
+
+ rump_init();
+ rump_schedule();
+ rumptest_localsig(SIGUSR2);
+ rump_unschedule();
+ ATF_REQUIRE_EQ(sigcnt, 1);
+}
+
+ATF_TC_BODY(sigignore, tc)
+{
+
+ rump_boot_setsigmodel(RUMP_SIGMODEL_IGNORE);
+
+ rump_init();
+ rump_schedule();
+ rumptest_localsig(SIGKILL);
+ rump_unschedule();
+}
+
+ATF_TC_BODY(sigpanic, tc)
+{
+ int status;
+
+ rump_boot_setsigmodel(RUMP_SIGMODEL_PANIC);
+
+ switch (fork()) {
+ case 0:
+ rump_init();
+ rump_schedule();
+ rumptest_localsig(SIGCONT);
+ /* NOTREACHED */
+ exit(1);
+ default:
+ wait(&status);
+ ATF_REQUIRE(WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT);
+ break;
+ case -1:
+ atf_tc_fail_errno("fork");
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, sigraise);
+ ATF_TP_ADD_TC(tp, sigignore);
+ ATF_TP_ADD_TC(tp, sigpanic);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_sp.sh b/contrib/netbsd-tests/rump/rumpkern/t_sp.sh
new file mode 100755
index 0000000..9d11d2a
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_sp.sh
@@ -0,0 +1,128 @@
+# $NetBSD: t_sp.sh,v 1.12 2014/08/30 12:14:17 gson Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, 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 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.
+#
+
+test_case()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+ eval "${name}_head() { }"
+ eval "${name}_body() { \
+ ${check_function} " "${@}" "; \
+ }"
+ eval "${name}_cleanup() { \
+ RUMP_SERVER=unix://commsock rump.halt
+ }"
+}
+
+test_case basic basic
+test_case stress_short stress 1
+test_case stress_long stress 2
+test_case stress_killer stress 5 kill
+test_case fork_simple fork simple
+test_case fork_pipecomm fork pipecomm
+test_case fork_fakeauth fork fakeauth
+test_case sigsafe sigsafe sigsafe
+test_case signal signal
+test_case reconnect reconnect
+
+basic()
+{
+ export RUMP_SERVER=unix://commsock
+ atf_check -s exit:0 rump_server ${RUMP_SERVER}
+ atf_check -s exit:0 $(atf_get_srcdir)/h_client/h_simplecli
+}
+
+stress_short_head()
+{
+ atf_set "require.memory" "64M"
+}
+
+stress_long_head()
+{
+ atf_set "require.memory" "64M"
+}
+
+stress()
+{
+
+ export RUMP_SERVER=unix://commsock
+ atf_check -s exit:0 rump_server \
+ -lrumpvfs -lrumpnet -lrumpnet_net -lrumpnet_netinet ${RUMP_SERVER}
+ atf_check -s exit:0 -e ignore $(atf_get_srcdir)/h_client/h_stresscli $@
+}
+
+fork()
+{
+
+ export RUMP_SERVER=unix://commsock
+ atf_check -s exit:0 rump_server -lrumpvfs ${RUMP_SERVER}
+ atf_check -s exit:0 $(atf_get_srcdir)/h_client/h_forkcli ${1}
+}
+
+sigsafe()
+{
+
+ export RUMP_SERVER=unix://commsock
+ atf_check -s exit:0 rump_server ${RUMP_SERVER}
+ atf_check -s exit:0 $(atf_get_srcdir)/h_client/h_sigcli
+
+}
+
+signal()
+{
+
+ export RUMP_SERVER=unix://commsock
+ atf_check -s exit:0 $(atf_get_srcdir)/h_server/h_simpleserver \
+ ${RUMP_SERVER} sendsig 27
+ atf_check -s signal:27 $(atf_get_srcdir)/h_client/h_simplecli block
+}
+
+reconnect()
+{
+
+
+ export RUMP_SERVER=unix://commsock
+ atf_check -s exit:0 rump_server ${RUMP_SERVER}
+ atf_check -s exit:0 -e ignore $(atf_get_srcdir)/h_client/h_reconcli 2
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case basic
+ atf_add_test_case stress_short
+ atf_add_test_case stress_long
+ atf_add_test_case stress_killer
+ atf_add_test_case fork_simple
+ atf_add_test_case fork_pipecomm
+ atf_add_test_case fork_fakeauth
+ atf_add_test_case sigsafe
+ atf_add_test_case signal
+ atf_add_test_case reconnect
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_threads.c b/contrib/netbsd-tests/rump/rumpkern/t_threads.c
new file mode 100644
index 0000000..24155ec
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_threads.c
@@ -0,0 +1,81 @@
+/* $NetBSD: t_threads.c,v 1.1 2010/05/31 23:36:12 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+
+#include <rump/rump.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+#include "../kernspace/kernspace.h"
+
+ATF_TC(threadjoin);
+ATF_TC_HEAD(threadjoin, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks joinable threads work");
+}
+
+ATF_TC_BODY(threadjoin, tc)
+{
+
+ rump_init();
+
+ rump_schedule();
+ rumptest_threadjoin(); /* panics if fails */
+ rump_unschedule();
+}
+
+ATF_TC(kthread);
+ATF_TC_HEAD(kthread, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks kthread_create/exit works");
+}
+
+ATF_TC_BODY(kthread, tc)
+{
+
+ rump_init();
+
+ rump_schedule();
+ rumptest_threadjoin(); /* panics if fails */
+ rump_unschedule();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, threadjoin);
+ ATF_TP_ADD_TC(tp, kthread);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_tsleep.c b/contrib/netbsd-tests/rump/rumpkern/t_tsleep.c
new file mode 100644
index 0000000..efd9f4c
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_tsleep.c
@@ -0,0 +1,63 @@
+/* $NetBSD: t_tsleep.c,v 1.1 2010/05/31 23:36:12 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+
+#include <rump/rump.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+#include "../kernspace/kernspace.h"
+
+ATF_TC(tsleep);
+ATF_TC_HEAD(tsleep, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check tsleep variants");
+}
+
+ATF_TC_BODY(tsleep, tc)
+{
+
+ rump_init();
+
+ rump_schedule();
+ rumptest_tsleep(); /* panics if fails */
+ rump_unschedule();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, tsleep);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpkern/t_vm.c b/contrib/netbsd-tests/rump/rumpkern/t_vm.c
new file mode 100644
index 0000000..4445983
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpkern/t_vm.c
@@ -0,0 +1,91 @@
+/* $NetBSD: t_vm.c,v 1.3 2012/03/17 18:00:28 hannken Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+
+#include <rump/rump.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "../../h_macros.h"
+#include "../kernspace/kernspace.h"
+
+ATF_TC(busypage);
+ATF_TC_HEAD(busypage, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks VM pagewaits work");
+}
+
+ATF_TC_BODY(busypage, tc)
+{
+
+ rump_init();
+
+ rump_schedule();
+ rumptest_busypage();
+ rump_unschedule();
+}
+
+ATF_TC(uvmwait);
+ATF_TC_HEAD(uvmwait, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests that uvm_wait works");
+ atf_tc_set_md_var(tc, "timeout", "30");
+}
+
+#define UVMWAIT_LIMIT 1024*1024
+ATF_TC_BODY(uvmwait, tc)
+{
+ char buf[64];
+
+ /* limit rump kernel memory */
+ snprintf(buf, sizeof(buf), "%d", UVMWAIT_LIMIT);
+ setenv("RUMP_MEMLIMIT", buf, 1);
+
+ rump_init();
+
+ rump_schedule();
+ rumptest_alloc(UVMWAIT_LIMIT);
+ rump_unschedule();
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, busypage);
+ ATF_TP_ADD_TC(tp, uvmwait);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh b/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh
new file mode 100755
index 0000000..dc463f2
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh
@@ -0,0 +1,80 @@
+# $NetBSD: t_shmif.sh,v 1.2 2013/09/09 19:27:49 pooka Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case crossping cleanup
+
+NKERN=8
+
+crossping_head()
+{
+ atf_set "descr" "run $NKERN rump kernels on one shmif bus and crossping"
+}
+
+startserver()
+{
+
+ export RUMP_SERVER=unix://sock${1}
+ atf_check -s exit:0 rump_server -lrumpnet -lrumpnet_net \
+ -lrumpnet_netinet -lrumpnet_shmif ${RUMP_SERVER}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+ atf_check -s exit:0 rump.ifconfig shmif0 inet 1.1.1.${1}
+}
+
+pingothers()
+{
+
+}
+
+crossping_body()
+{
+
+ for x in `jot ${NKERN}` ; do startserver $x ; done
+ for x in `jot ${NKERN}`
+ do
+ export RUMP_SERVER=unix://sock${x}
+ for y in `jot ${NKERN}`
+ do
+ [ ${y} -eq ${x} ] && continue
+ atf_check -s exit:0 -o ignore -e ignore \
+ rump.ping -c 1 1.1.1.${y}
+ done
+ done
+}
+
+crossping_cleanup()
+{
+
+ for x in `jot ${NKERN}` ; do RUMP_SERVER=unix://sock${x} rump.halt ;done
+ :
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case crossping
+}
diff --git a/contrib/netbsd-tests/rump/rumpvfs/t_basic.c b/contrib/netbsd-tests/rump/rumpvfs/t_basic.c
new file mode 100644
index 0000000..c136558
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpvfs/t_basic.c
@@ -0,0 +1,81 @@
+/* $NetBSD: t_basic.c,v 1.2 2011/02/22 13:25:18 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, 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 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/types.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(lseekrv);
+ATF_TC_HEAD(lseekrv, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Test lseek return values");
+}
+
+#define TESTFILE "testi"
+
+#define FIVE_MEGS (5*1024*1024)
+#define FIVE_GIGS (5*1024*1024*1024LL)
+
+ATF_TC_BODY(lseekrv, tc)
+{
+ off_t rv;
+ int fd;
+
+ RZ(rump_init());
+ RL(fd = rump_sys_open(TESTFILE, O_RDWR | O_CREAT, 0777));
+
+ rv = rump_sys_lseek(37, FIVE_MEGS, SEEK_SET);
+ ATF_REQUIRE_ERRNO(EBADF, rv == -1);
+
+ rv = rump_sys_lseek(fd, FIVE_MEGS, SEEK_SET);
+ ATF_REQUIRE_EQ(rv, FIVE_MEGS);
+
+ rv = rump_sys_lseek(fd, FIVE_GIGS, SEEK_SET);
+ ATF_REQUIRE_EQ(rv, FIVE_GIGS);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, lseekrv);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpvfs/t_etfs.c b/contrib/netbsd-tests/rump/rumpvfs/t_etfs.c
new file mode 100644
index 0000000..787f5e6
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpvfs/t_etfs.c
@@ -0,0 +1,302 @@
+/* $NetBSD: t_etfs.c,v 1.10 2014/05/12 15:33:12 christos Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(reregister_reg);
+ATF_TC_HEAD(reregister_reg, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests register/unregister/register "
+ "for a regular file");
+}
+
+#define TESTSTR1 "hi, it's me again!"
+#define TESTSTR1SZ (sizeof(TESTSTR1)-1)
+
+#define TESTSTR2 "what about the old vulcan proverb?"
+#define TESTSTR2SZ (sizeof(TESTSTR2)-1)
+
+#define TESTPATH1 "/trip/to/the/moon"
+#define TESTPATH2 "/but/not/the/dark/size"
+ATF_TC_BODY(reregister_reg, tc)
+{
+ char buf[1024];
+ int localfd, etcfd;
+ ssize_t n;
+ int tfd;
+
+ etcfd = open("/etc/passwd", O_RDONLY);
+ ATF_REQUIRE(etcfd != -1);
+
+ localfd = open("./testfile", O_RDWR | O_CREAT, 0666);
+ ATF_REQUIRE(localfd != -1);
+
+ ATF_REQUIRE_EQ(write(localfd, TESTSTR1, TESTSTR1SZ), TESTSTR1SZ);
+ /* testfile now contains test string */
+
+ rump_init();
+
+ ATF_REQUIRE_EQ(rump_pub_etfs_register(TESTPATH1, "/etc/passwd",
+ RUMP_ETFS_REG), 0);
+ tfd = rump_sys_open(TESTPATH1, O_RDONLY);
+ ATF_REQUIRE(tfd != -1);
+ ATF_REQUIRE(rump_sys_read(tfd, buf, sizeof(buf)) > 0);
+ rump_sys_close(tfd);
+ rump_pub_etfs_remove(TESTPATH1);
+
+ ATF_REQUIRE_EQ(rump_pub_etfs_register(TESTPATH2, "./testfile",
+ RUMP_ETFS_REG), 0);
+ tfd = rump_sys_open(TESTPATH2, O_RDWR);
+ ATF_REQUIRE(tfd != -1);
+ memset(buf, 0, sizeof(buf));
+ ATF_REQUIRE((n = rump_sys_read(tfd, buf, sizeof(buf))) > 0);
+
+ /* check that we have what we expected */
+ ATF_REQUIRE_STREQ(buf, TESTSTR1);
+
+ /* ... while here, check that writing works too */
+ ATF_REQUIRE_EQ(rump_sys_lseek(tfd, 0, SEEK_SET), 0);
+ ATF_REQUIRE(TESTSTR1SZ <= TESTSTR2SZ);
+ ATF_REQUIRE_EQ(rump_sys_write(tfd, TESTSTR2, TESTSTR2SZ), TESTSTR2SZ);
+
+ memset(buf, 0, sizeof(buf));
+ ATF_REQUIRE_EQ(lseek(localfd, 0, SEEK_SET), 0);
+ ATF_REQUIRE(read(localfd, buf, sizeof(buf)) > 0);
+ ATF_REQUIRE_STREQ(buf, TESTSTR2);
+ close(etcfd);
+ close(localfd);
+}
+
+ATF_TC(reregister_blk);
+ATF_TC_HEAD(reregister_blk, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests register/unregister/register "
+ "for a block device");
+}
+
+ATF_TC_BODY(reregister_blk, tc)
+{
+ char buf[512 * 128];
+ char cmpbuf[512 * 128];
+ int rv, tfd;
+
+ /* first, create some image files */
+ rv = system("dd if=/dev/zero bs=512 count=64 "
+ "| tr '\\0' '\\1' > disk1.img");
+ ATF_REQUIRE_EQ(rv, 0);
+
+ rv = system("dd if=/dev/zero bs=512 count=128 "
+ "| tr '\\0' '\\2' > disk2.img");
+ ATF_REQUIRE_EQ(rv, 0);
+
+ rump_init();
+
+ ATF_REQUIRE_EQ(rump_pub_etfs_register(TESTPATH1, "./disk1.img",
+ RUMP_ETFS_BLK), 0);
+ tfd = rump_sys_open(TESTPATH1, O_RDONLY);
+ ATF_REQUIRE(tfd != -1);
+ ATF_REQUIRE_EQ(rump_sys_read(tfd, buf, sizeof(buf)), 64*512);
+ memset(cmpbuf, 1, sizeof(cmpbuf));
+ ATF_REQUIRE_EQ(memcmp(buf, cmpbuf, 64*512), 0);
+ ATF_REQUIRE_EQ(rump_sys_close(tfd), 0);
+ ATF_REQUIRE_EQ(rump_pub_etfs_remove(TESTPATH1), 0);
+
+ ATF_REQUIRE_EQ(rump_pub_etfs_register(TESTPATH2, "./disk2.img",
+ RUMP_ETFS_BLK), 0);
+ tfd = rump_sys_open(TESTPATH2, O_RDONLY);
+ ATF_REQUIRE(tfd != -1);
+ ATF_REQUIRE_EQ(rump_sys_read(tfd, buf, sizeof(buf)), 128*512);
+ memset(cmpbuf, 2, sizeof(cmpbuf));
+ ATF_REQUIRE_EQ(memcmp(buf, cmpbuf, 128*512), 0);
+ ATF_REQUIRE_EQ(rump_sys_close(tfd), 0);
+ ATF_REQUIRE_EQ(rump_pub_etfs_remove(TESTPATH2), 0);
+}
+
+ATF_TC_WITH_CLEANUP(large_blk);
+ATF_TC_HEAD(large_blk, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Check etfs block devices work for "
+ ">2TB images");
+}
+
+#define IMG_ON_MFS "mfsdir/disk.img"
+ATF_TC_BODY(large_blk, tc)
+{
+ char buf[128];
+ char cmpbuf[128];
+ ssize_t n;
+ int rv, tfd;
+
+ /*
+ * mount mfs. it would be nice if this would not be required,
+ * but a) tmpfs doesn't "support" sparse files b) we don't really
+ * know what fs atf workdir is on anyway.
+ */
+ if (mkdir("mfsdir", 0777) == -1)
+ atf_tc_fail_errno("mkdir failed");
+ if (system("mount_mfs -s 64m -o nosuid,nodev mfs mfsdir") != 0)
+ atf_tc_skip("could not mount mfs");
+
+ /* create a 8TB sparse file */
+ rv = system("dd if=/dev/zero of=" IMG_ON_MFS " bs=1 count=1 seek=8t");
+ ATF_REQUIRE_EQ(rv, 0);
+
+ /*
+ * map it and issue write at 6TB, then unmap+remap and check
+ * we get the same stuff back
+ */
+
+ rump_init();
+ ATF_REQUIRE_EQ(rump_pub_etfs_register(TESTPATH1, IMG_ON_MFS,
+ RUMP_ETFS_BLK), 0);
+ tfd = rump_sys_open(TESTPATH1, O_RDWR);
+ ATF_REQUIRE(tfd != -1);
+ memset(buf, 12, sizeof(buf));
+ n = rump_sys_pwrite(tfd, buf, sizeof(buf), 6*1024*1024*1024ULL*1024ULL);
+ ATF_REQUIRE_EQ(n, sizeof(buf));
+ ATF_REQUIRE_EQ(rump_sys_close(tfd), 0);
+ ATF_REQUIRE_EQ(rump_pub_etfs_remove(TESTPATH1), 0);
+
+ ATF_REQUIRE_EQ(rump_pub_etfs_register(TESTPATH2, IMG_ON_MFS,
+ RUMP_ETFS_BLK), 0);
+ tfd = rump_sys_open(TESTPATH2, O_RDWR);
+ ATF_REQUIRE(tfd != -1);
+ memset(buf, 0, sizeof(buf));
+ n = rump_sys_pread(tfd, buf, sizeof(buf), 6*1024*1024*1024ULL*1024ULL);
+ ATF_REQUIRE_EQ(n, sizeof(buf));
+
+ memset(cmpbuf, 12, sizeof(cmpbuf));
+ ATF_REQUIRE_EQ(memcmp(cmpbuf, buf, 128), 0);
+}
+
+ATF_TC_CLEANUP(large_blk, tc)
+{
+
+ system("umount mfsdir");
+}
+
+ATF_TC(range_blk);
+ATF_TC_HEAD(range_blk, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks ranged (offset,size) mappings");
+}
+
+ATF_TC_BODY(range_blk, tc)
+{
+ char buf[32000];
+ char cmpbuf[32000];
+ ssize_t n;
+ int rv, tfd;
+
+ /* create a 64000 byte file with 16 1's at offset = 32000 */
+ rv = system("dd if=/dev/zero of=disk.img bs=1000 count=64");
+ ATF_REQUIRE_EQ(rv, 0);
+ rv = system("yes | tr '\\ny' '\\1' "
+ "| dd of=disk.img conv=notrunc bs=1 count=16 seek=32000");
+ ATF_REQUIRE_EQ(rv, 0);
+
+ /* map the file at [16000,48000]. this puts our 1's at offset 16000 */
+ rump_init();
+ ATF_REQUIRE_EQ(rump_pub_etfs_register_withsize(TESTPATH1, "disk.img",
+ RUMP_ETFS_BLK, 16000, 32000), 0);
+ tfd = rump_sys_open(TESTPATH1, O_RDWR);
+ ATF_REQUIRE(tfd != -1);
+ n = rump_sys_read(tfd, buf, sizeof(buf));
+ ATF_REQUIRE_EQ(n, sizeof(buf));
+ ATF_REQUIRE_EQ(rump_sys_close(tfd), 0);
+ ATF_REQUIRE_EQ(rump_pub_etfs_remove(TESTPATH1), 0);
+
+ /* check that we got what is expected */
+ memset(cmpbuf, 0, sizeof(cmpbuf));
+ memset(cmpbuf+16000, 1, 16);
+ ATF_REQUIRE_EQ(memcmp(buf, cmpbuf, sizeof(buf)), 0);
+}
+
+ATF_TC(key);
+ATF_TC_HEAD(key, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Checks key format");
+}
+
+ATF_TC_BODY(key, tc)
+{
+
+ RZ(rump_init());
+
+ RL(open("hostfile", O_RDWR | O_CREAT, 0777));
+
+ RZ(rump_pub_etfs_register("/key", "hostfile", RUMP_ETFS_REG));
+ ATF_REQUIRE_EQ(rump_pub_etfs_register("key", "hostfile", RUMP_ETFS_REG),
+ EINVAL);
+
+ RL(rump_sys_open("/key", O_RDONLY));
+ RL(rump_sys_open("////////key", O_RDONLY));
+
+ RZ(rump_pub_etfs_register("////key//with/slashes", "hostfile",
+ RUMP_ETFS_REG));
+
+ RL(rump_sys_open("/key//with/slashes", O_RDONLY));
+ RL(rump_sys_open("key//with/slashes", O_RDONLY));
+ ATF_REQUIRE_ERRNO(ENOENT,
+ rump_sys_open("/key/with/slashes", O_RDONLY) == -1);
+
+ RL(rump_sys_mkdir("/a", 0777));
+ ATF_REQUIRE_ERRNO(ENOENT,
+ rump_sys_open("/a/key//with/slashes", O_RDONLY) == -1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, reregister_reg);
+ ATF_TP_ADD_TC(tp, reregister_blk);
+ ATF_TP_ADD_TC(tp, large_blk);
+ ATF_TP_ADD_TC(tp, range_blk);
+ ATF_TP_ADD_TC(tp, key);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c b/contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c
new file mode 100644
index 0000000..735c607
--- /dev/null
+++ b/contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c
@@ -0,0 +1,92 @@
+/* $NetBSD: t_p2kifs.c,v 1.4 2014/02/07 15:29:23 hannken Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, 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 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/types.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(makecn);
+ATF_TC_HEAD(makecn, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "Tests makecn/LOOKUP/freecn");
+}
+
+#define TESTFILE "testi"
+
+ATF_TC_BODY(makecn, tc)
+{
+ struct componentname *cn;
+ char pathstr[MAXPATHLEN] = TESTFILE;
+ struct vnode *vp;
+ extern struct vnode *rumpns_rootvnode;
+
+ rump_init();
+
+ /*
+ * Strategy is to create a componentname, edit the passed
+ * string, and then do a lookup with the componentname.
+ */
+ RL(rump_sys_mkdir("/" TESTFILE, 0777));
+
+ /* need stable lwp for componentname */
+ RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
+
+ /* try it once with the right path */
+ cn = rump_pub_makecn(RUMP_NAMEI_LOOKUP, 0, pathstr, strlen(pathstr),
+ rump_pub_cred_create(0, 0, 0, NULL), rump_pub_lwproc_curlwp());
+ RZ(RUMP_VOP_LOOKUP(rumpns_rootvnode, &vp, cn));
+ rump_pub_freecn(cn, RUMPCN_FREECRED);
+
+ /* and then with modification-in-the-middle */
+ cn = rump_pub_makecn(RUMP_NAMEI_LOOKUP, 0, pathstr, strlen(pathstr),
+ rump_pub_cred_create(0, 0, 0, NULL), rump_pub_lwproc_curlwp());
+ strcpy(pathstr, "/muuta");
+ RZ(RUMP_VOP_LOOKUP(rumpns_rootvnode, &vp, cn));
+ rump_pub_freecn(cn, RUMPCN_FREECRED);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, makecn);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/sbin/fsck_ffs/quotas_common.sh b/contrib/netbsd-tests/sbin/fsck_ffs/quotas_common.sh
new file mode 100755
index 0000000..7d4ab58
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/fsck_ffs/quotas_common.sh
@@ -0,0 +1,44 @@
+# $NetBSD: quotas_common.sh,v 1.2 2011/03/06 17:08:41 bouyer Exp $
+
+create_with_quotas()
+{
+ local endian=$1; shift
+ local vers=$1; shift
+ local uid=$(id -u)
+ local gid=$(id -g)
+
+ atf_check -o ignore -e ignore newfs -B ${endian} -O ${vers} \
+ -s 4000 -F ${IMG}
+ atf_check -o ignore -e ignore tunefs -q user -q group -F ${IMG}
+ atf_check -s exit:0 -o 'match:NO USER QUOTA INODE \(CREATED\)' \
+ -o 'match:USER QUOTA MISMATCH FOR ID '${uid}': 0/0 SHOULD BE 1/1' \
+ -o 'match:GROUP QUOTA MISMATCH FOR ID '${gid}': 0/0 SHOULD BE 1/1' \
+ fsck_ffs -p -F ${IMG}
+}
+
+# from tests/ipf/h_common.sh via tests/sbin/resize_ffs
+test_case()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+ local descr="${1}"; shift
+
+ atf_test_case "${name}"
+
+ eval "${name}_head() { \
+ atf_set "descr" "Checks ${descr} quotas inodes"
+ }"
+ eval "${name}_body() { \
+ ${check_function} " "${@}" "; \
+ }"
+ tests="${tests} ${name}"
+}
+
+atf_init_test_cases()
+{
+ IMG=fsimage
+ DIR=target
+ for i in ${tests}; do
+ atf_add_test_case $i
+ done
+}
diff --git a/contrib/netbsd-tests/sbin/fsck_ffs/t_check_quotas.sh b/contrib/netbsd-tests/sbin/fsck_ffs/t_check_quotas.sh
new file mode 100755
index 0000000..804c5b5
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/fsck_ffs/t_check_quotas.sh
@@ -0,0 +1,73 @@
+# $NetBSD: t_check_quotas.sh,v 1.2 2011/03/06 17:08:41 bouyer Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+for e in le be; do
+ for v in 1 2; do
+ test_case corrupt_list_${e}_${v} corrupt_list \
+ "recovery of corrupted free list in" ${e} ${v}
+ test_case expand1_list_${e}_${v} expand_list \
+ "allocation of direct block in" 40 ${e} ${v}
+ test_case expand2_list_${e}_${v} expand_list \
+ "allocation of indirect block in" 1000 ${e} ${v}
+ done
+done
+
+corrupt_list()
+{
+ create_with_quotas $*
+ local blkno=$(printf "inode 3\nblks\n" | /sbin/fsdb -nF -f ${IMG} | awk '$1 == "0:" {print $2}')
+ blkno=$(($blkno * 512 + 104))
+ #clear the free list
+ atf_check -o ignore -e ignore dd if=/dev/zero of=${IMG} bs=1 \
+ count=8 seek=${blkno} conv=notrunc
+ atf_check -s exit:0 \
+ -o "match:QUOTA ENTRY NOT IN LIST \(FIXED\)" \
+ fsck_ffs -fp -F ${IMG}
+ atf_check -s exit:0 -o "match:3 files" fsck_ffs -nf -F ${IMG}
+}
+
+expand_list()
+{
+ local nuid=$1; shift
+ local expected_files=$((nuid + 2))
+ echo "/set uid=0 gid=0" > spec
+ echo ". type=dir mode=0755" >> spec
+ mkdir ${DIR}
+ for i in $(seq ${nuid}); do
+ touch ${DIR}/f${i}
+ echo "./f$i type=file mode=0600 uid=$i gid=$i" >> spec
+ done
+
+ atf_check -o ignore -e ignore makefs -B $1 -o version=$2 \
+ -F spec -s 4000b ${IMG} ${DIR}
+ atf_check -o ignore -e ignore tunefs -q user -F ${IMG}
+ atf_check -s exit:0 -o 'match:NO USER QUOTA INODE \(CREATED\)' \
+ -o 'match:USER QUOTA MISMATCH FOR ID 10: 0/0 SHOULD BE 0/1' \
+ fsck_ffs -p -F ${IMG}
+ atf_check -s exit:0 -o "match:${expected_files} files" \
+ fsck_ffs -nf -F ${IMG}
+}
diff --git a/contrib/netbsd-tests/sbin/fsck_ffs/t_enable_quotas.sh b/contrib/netbsd-tests/sbin/fsck_ffs/t_enable_quotas.sh
new file mode 100755
index 0000000..3148911
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/fsck_ffs/t_enable_quotas.sh
@@ -0,0 +1,105 @@
+# $NetBSD: t_enable_quotas.sh,v 1.2 2011/03/06 17:08:41 bouyer Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+for e in le be; do
+ for v in 1 2; do
+ test_case disable_${e}_${v} disable_quotas "creation/removal of" ${e} ${v}
+ test_case corrupt_${e}_${v} corrupt_quotas "repair of corrupted" ${e} ${v}
+ test_case unallocated_${e}_${v} unallocated_quotas \
+ "recovery of unallocated" ${e} ${v}
+ test_case dir1_${e}_${v} dir1_quotas \
+ "successfull clear of wrong type of" ${e} ${v}
+ test_case notreg_${e}_${v} notreg_quotas \
+ "successfull clear of wrong type of" ${e} ${v}
+ done
+done
+
+disable_quotas()
+{
+ create_with_quotas $*
+
+# check that the quota inode creation didn't corrupt the filesystem
+ atf_check -s exit:0 -o "match:already clean" -o "match:3 files" \
+ fsck_ffs -nf -F ${IMG}
+#now check fsck can properly clear the quota inode when quota flags are
+# cleared
+ atf_check -o ignore -e ignore tunefs -q nouser -q nogroup -F ${IMG}
+ atf_check -s exit:0 -o "match:SUPERBLOCK QUOTA FLAG CLEARED" \
+ fsck_ffs -fp -F ${IMG}
+ atf_check -s exit:0 -o "match:1 files, 1 used" fsck_ffs -nf -F ${IMG}
+}
+
+corrupt_quotas()
+{
+ create_with_quotas $*
+
+ local blkno=$(printf "inode 3\nblks\n" | /sbin/fsdb -nF -f ${IMG} | awk '$1 == "0:" {print $2}')
+ atf_check -o ignore -e ignore dd if=/dev/zero of=${IMG} bs=512 \
+ count=1 seek=${blkno} conv=notrunc
+ atf_check -s exit:0 \
+ -o "match:CORRUPTED USER QUOTA INODE 3 \(CLEARED\)" \
+ -o "match:NO USER QUOTA INODE \(CREATED\)" \
+ fsck_ffs -fp -F ${IMG}
+ atf_check -s exit:0 -o "match:3 files" fsck_ffs -nf -F ${IMG}
+}
+
+unallocated_quotas()
+{
+ create_with_quotas $*
+
+ atf_check -o ignore -e ignore clri ${IMG} 3
+ atf_check -s exit:0 \
+ -o "match:UNALLOCATED USER QUOTA INODE 3 \(CLEARED\)" \
+ -o "match:NO USER QUOTA INODE \(CREATED\)" \
+ fsck_ffs -fp -F ${IMG}
+ atf_check -s exit:0 -o "match:3 files" fsck_ffs -nf -F ${IMG}
+}
+
+dir1_quotas()
+{
+ create_with_quotas $*
+
+ atf_check -s exit:255 -o ignore -e ignore -x \
+ "printf 'inode 3\nchtype dir\nexit\n' | fsdb -F -f ${IMG}"
+ atf_check -s exit:0 \
+ -o "match:DIR I=3 CONNECTED. PARENT WAS I=0" \
+ -o "match:USER QUOTA INODE 3 IS A DIRECTORY" \
+ fsck_ffs -y -F ${IMG}
+}
+
+notreg_quotas()
+{
+ create_with_quotas $*
+
+ atf_check -s exit:255 -o ignore -e ignore -x \
+ "printf 'inode 3\nchtype fifo\nexit\n' | fsdb -F -f ${IMG}"
+ atf_check -s exit:0 \
+ -o "match:WRONG TYPE 4096 for USER QUOTA INODE 3 \(CLEARED\)" \
+ -o "match:NO USER QUOTA INODE \(CREATED\)" \
+ fsck_ffs -p -F ${IMG}
+ atf_check -s exit:0 -o "match:3 files" fsck_ffs -nf -F ${IMG}
+}
diff --git a/contrib/netbsd-tests/sbin/ifconfig/t_nonexistent.sh b/contrib/netbsd-tests/sbin/ifconfig/t_nonexistent.sh
new file mode 100755
index 0000000..8670323
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/ifconfig/t_nonexistent.sh
@@ -0,0 +1,45 @@
+# $NetBSD: t_nonexistent.sh,v 1.4 2012/03/18 09:46:50 jruoho Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case nonexistent
+nonexistent_head() {
+ atf_set "descr" "Check ifconfig(8) with " \
+ "a nonexistent interface (PR bin/43141)"
+}
+
+nonexistent_body() {
+
+ atf_check -s not-exit:0 -e ignore \
+ ifconfig nonexistent0 1.2.3.4/24
+}
+
+atf_init_test_cases() {
+ atf_add_test_case nonexistent
+}
diff --git a/contrib/netbsd-tests/sbin/newfs/quotas_common.sh b/contrib/netbsd-tests/sbin/newfs/quotas_common.sh
new file mode 100755
index 0000000..3ea89a2
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/newfs/quotas_common.sh
@@ -0,0 +1,68 @@
+# $NetBSD: quotas_common.sh,v 1.3 2012/03/18 09:31:50 jruoho Exp $
+
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+create_with_quotas()
+{
+ local endian=$1; shift
+ local vers=$1; shift
+ local type=$1; shift
+ local op;
+ if [ ${type} = "both" ]; then
+ op="-q user -q group"
+ else
+ op="-q ${type}"
+ fi
+ atf_check -o ignore -e ignore newfs ${op} \
+ -B ${endian} -O ${vers} -s 4000 -F ${IMG}
+}
+
+# from tests/ipf/h_common.sh via tests/sbin/resize_ffs
+test_case()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+ local descr="${1}"; shift
+
+ atf_test_case "${name}"
+
+ eval "${name}_head() { \
+ atf_set "descr" "Checks ${descr} quotas inodes"
+ }"
+ eval "${name}_body() { \
+ ${check_function} " "${@}" "; \
+ }"
+ tests="${tests} ${name}"
+}
+
+atf_init_test_cases()
+{
+ IMG=fsimage
+ DIR=target
+ for i in ${tests}; do
+ atf_add_test_case $i
+ done
+}
diff --git a/contrib/netbsd-tests/sbin/newfs/t_enable_quotas.sh b/contrib/netbsd-tests/sbin/newfs/t_enable_quotas.sh
new file mode 100755
index 0000000..62218e9
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/newfs/t_enable_quotas.sh
@@ -0,0 +1,57 @@
+# $NetBSD: t_enable_quotas.sh,v 1.3 2012/03/18 09:31:50 jruoho Exp $
+#
+# Copyright (c) 2011 Manuel Bouyer
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+for e in le be; do
+ for v in 1 2; do
+ for q in "user" "group"; do
+ test_case enabled_${e}_${v}_${q} quota_enabled_single \
+ "creation of" ${e} ${v} ${q}
+ done
+ test_case enabled_${e}_${v}_"both" quota_enabled_both \
+ "creation of" ${e} ${v} "both"
+ done
+done
+
+quota_enabled_single()
+{
+ create_with_quotas $*
+
+# check that the quota inode creation didn't corrupt the filesystem
+ atf_check -s exit:0 -o "match:already clean" -o "match:2 files" \
+ -o "match:Phase 6 - Check Quotas" \
+ fsck_ffs -nf -F ${IMG}
+}
+
+quota_enabled_both()
+{
+ create_with_quotas $*
+
+# check that the quota inode creation didn't corrupt the filesystem
+ atf_check -s exit:0 -o "match:already clean" -o "match:3 files" \
+ -o "match:Phase 6 - Check Quotas" \
+ fsck_ffs -nf -F ${IMG}
+}
diff --git a/contrib/netbsd-tests/sbin/newfs_msdos/t_create.sh b/contrib/netbsd-tests/sbin/newfs_msdos/t_create.sh
new file mode 100755
index 0000000..dc43116
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/newfs_msdos/t_create.sh
@@ -0,0 +1,45 @@
+# $NetBSD: t_create.sh,v 1.3 2014/01/05 12:59:03 martin Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case validfat32
+validfat32_head() {
+ atf_set "descr" "Verifies that fat32 created filesystems are valid"
+}
+validfat32_body() {
+
+ atf_check -s eq:0 -o ignore -e ignore \
+ newfs_msdos -b 512 -C 33m -F 32 msdos.img
+# fsck_msdos/newfs_msdos have been fixed
+# atf_expect_fail "PR bin/46743"
+ atf_check -s eq:0 -o not-match:FIXED -e empty fsck_msdos -p msdos.img
+ atf_expect_pass
+}
+
+
+atf_init_test_cases() {
+ atf_add_test_case validfat32
+}
diff --git a/contrib/netbsd-tests/sbin/resize_ffs/common.sh b/contrib/netbsd-tests/sbin/resize_ffs/common.sh
new file mode 100755
index 0000000..1b1d5da
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/resize_ffs/common.sh
@@ -0,0 +1,159 @@
+
+# Common settings and functions for the various resize_ffs tests.
+#
+
+# called from atf_init_test_cases
+setupvars()
+{
+ IMG=fsimage
+ TDBASE64=$(atf_get_srcdir)/testdata.tar.gz.base64
+ GOODMD5=$(atf_get_srcdir)/testdata.md5
+ # set BYTESWAP to opposite-endian.
+ if [ $(sysctl -n hw.byteorder) = "1234" ]; then
+ BYTESWAP=be
+ else
+ BYTESWAP=le
+ fi
+}
+
+# test_case() taken from the tests/ipf/h_common.sh
+# Used to declare the atf goop for a test.
+test_case()
+{
+ local name="${1}"; shift
+ local check_function="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+ eval "${name}_head() { \
+ atf_set "require.user" "root" ; \
+ atf_set "require.progs" "rump_ffs" ; \
+ }"
+ eval "${name}_body() { \
+ ${check_function} " "${@}" "; \
+ }"
+ eval "${name}_cleanup() { \
+ umount -f mnt ; \
+ : reset error ; \
+ }"
+}
+
+# Used to declare the atf goop for a test expected to fail.
+test_case_xfail()
+{
+ local name="${1}"; shift
+ local reason="${1}"; shift
+ local check_function="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+ eval "${name}_head() { \
+ atf_set "require.user" "root" ; \
+ }"
+ eval "${name}_body() { \
+ atf_expect_fail "${reason}" ; \
+ ${check_function} " "${@}" "; \
+ }"
+ eval "${name}_cleanup() { \
+ umount -f mnt ; \
+ : reset error ; \
+ }"
+}
+
+# copy_data requires the mount already done; makes one copy of the test data
+copy_data ()
+{
+ uudecode -p ${TDBASE64} | (cd mnt; tar xzf - -s/testdata/TD$1/)
+}
+
+copy_multiple ()
+{
+ local i
+ for i in $(seq $1); do
+ copy_data $i
+ done
+}
+
+# remove_data removes one directory worth of test data; the purpose
+# is to ensure data exists near the end of the fs under test.
+remove_data ()
+{
+ rm -rf mnt/TD$1
+}
+
+remove_multiple ()
+{
+ local i
+ for i in $(seq $1); do
+ remove_data $i
+ done
+}
+
+# verify that the data in a particular directory is still OK
+# generated md5 file doesn't need explicit cleanup thanks to ATF
+check_data ()
+{
+ (cd mnt/TD$1 && md5 *) > TD$1.md5
+ atf_check diff -u ${GOODMD5} TD$1.md5
+}
+
+# supply begin and end arguments
+check_data_range ()
+{
+ local i
+ for i in $(seq $1 $2); do
+ check_data $i
+ done
+}
+
+
+resize_ffs()
+{
+ echo "in resize_ffs:" ${@}
+ local bs=$1
+ local fragsz=$2
+ local osize=$3
+ local nsize=$4
+ local fslevel=$5
+ local numdata=$6
+ local swap=$7
+ mkdir -p mnt
+ echo "bs is ${bs} numdata is ${numdata}"
+ echo "****resizing fs with blocksize ${bs}"
+
+ # we want no more than 16K/inode to allow test files to copy.
+ local fpi=$((fragsz * 4))
+ local i
+ if [ $fpi -gt 16384 ]; then
+ i="-i 16384"
+ fi
+ if [ x$swap != x ]; then
+ newfs -B ${BYTESWAP} -O${fslevel} -b ${bs} -f ${fragsz} \
+ -s ${osize} ${i} -F ${IMG}
+ else
+ newfs -O${fslevel} -b ${bs} -f ${fragsz} -s ${osize} ${i} \
+ -F ${IMG}
+ fi
+
+ # we're specifying relative paths, so rump_ffs warns - ignore.
+ atf_check -s exit:0 -e ignore rump_ffs ${IMG} mnt
+ copy_multiple ${numdata}
+
+ if [ ${nsize} -lt ${osize} ]; then
+ # how much data to remove so fs can be shrunk
+ local remove=$((numdata-numdata*nsize/osize))
+ local dataleft=$((numdata-remove))
+ echo remove is $remove dataleft is $dataleft
+ remove_multiple ${remove}
+ fi
+
+ umount mnt
+ atf_check -s exit:0 -o ignore resize_ffs -y -s ${nsize} ${IMG}
+ atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
+ atf_check -s exit:0 -e ignore rump_ffs ${IMG} mnt
+ if [ ${nsize} -lt ${osize} ]; then
+ check_data_range $((remove + 1)) ${numdata}
+ else
+ # checking everything because we don't delete on grow
+ check_data_range 1 ${numdata}
+ fi
+ umount mnt
+}
diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh
new file mode 100755
index 0000000..31d117b
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh
@@ -0,0 +1,221 @@
+# $NetBSD: t_grow.sh,v 1.8 2011/01/11 00:50:02 riz Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jeffrey C. Rizzo.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+
+# resize_ffs params as follows:
+# resize_ffs blocksize fragsize fssize newfssize level numdata swap
+# where 'numdata' is the number of data directories to copy - this is
+# determined manually based on the maximum number that will fit in the
+# created fs. 'level' is the fs-level (-O 0,1,2) passed to newfs.
+# If 'swap' is included, byteswap the fs
+
+# v0 == newfs -O0 (4.3BSD layout, ffsv1 superblock)
+test_case grow_16M_v0_4096 resize_ffs 4096 512 32768 131072 0 28
+test_case grow_16M_v0_8192 resize_ffs 8192 1024 32768 131072 0 28
+test_case grow_16M_v0_16384 resize_ffs 16384 2048 32768 131072 0 29
+test_case grow_16M_v0_32768 resize_ffs 32768 4096 32768 131072 0 28
+test_case grow_16M_v0_65536 resize_ffs 65536 8192 32768 131072 0 26
+# these grow_24M grow a smaller amount; sometimes there's different issues
+test_case grow_24M_v0_4096 resize_ffs 4096 512 49152 65536 0 41
+test_case grow_24M_v0_8192 resize_ffs 8192 1024 49152 65536 0 42
+test_case grow_24M_v0_16384 resize_ffs 16384 2048 49152 65536 0 43
+test_case grow_24M_v0_32768 resize_ffs 32768 4096 49152 65536 0 42
+test_case grow_24M_v0_65536 resize_ffs 65536 8192 49152 65536 0 38
+test_case grow_32M_v0_4096 resize_ffs 4096 512 65536 131072 0 55
+test_case grow_32M_v0_8192 resize_ffs 8192 1024 65536 131072 0 56
+test_case grow_32M_v0_16384 resize_ffs 16384 2048 65536 131072 0 58
+test_case grow_32M_v0_32768 resize_ffs 32768 4096 65536 131072 0 56
+test_case grow_32M_v0_65536 resize_ffs 65536 8192 65536 131072 0 51
+test_case grow_48M_v0_4096 resize_ffs 4096 512 98304 131072 0 82
+test_case grow_48M_v0_8192 resize_ffs 8192 1024 98304 131072 0 84
+test_case grow_48M_v0_16384 resize_ffs 16384 2048 98304 131072 0 87
+test_case grow_48M_v0_32768 resize_ffs 32768 4096 98304 131072 0 83
+test_case grow_48M_v0_65536 resize_ffs 65536 8192 98304 131072 0 76
+test_case grow_64M_v0_4096 resize_ffs 4096 512 131072 262144 0 109
+test_case grow_64M_v0_8192 resize_ffs 8192 1024 131072 262144 0 111
+test_case grow_64M_v0_16384 resize_ffs 16384 2048 131072 262144 0 115
+test_case grow_64M_v0_32768 resize_ffs 32768 4096 131072 262144 0 111
+test_case grow_64M_v0_65536 resize_ffs 65536 8192 131072 262144 0 101
+
+# v1 == newfs -O1 (FFSv1, v2 superblock layout)
+test_case grow_16M_v1_4096 resize_ffs 4096 512 32768 131072 1 28
+test_case grow_16M_v1_8192 resize_ffs 8192 1024 32768 131072 1 28
+test_case grow_16M_v1_16384 resize_ffs 16384 2048 32768 131072 1 29
+test_case grow_16M_v1_32768 resize_ffs 32768 4096 32768 131072 1 28
+test_case grow_16M_v1_65536 resize_ffs 65536 8192 32768 131072 1 26
+# these grow_24M grow a smaller amount; sometimes there's different issues
+test_case grow_24M_v1_4096 resize_ffs 4096 512 49152 65536 1 41
+test_case grow_24M_v1_8192 resize_ffs 8192 1024 49152 65536 1 42
+test_case grow_24M_v1_16384 resize_ffs 16384 2048 49152 65536 1 43
+test_case grow_24M_v1_32768 resize_ffs 32768 4096 49152 65536 1 42
+test_case grow_24M_v1_65536 resize_ffs 65536 8192 49152 65536 1 38
+test_case grow_32M_v1_4096 resize_ffs 4096 512 65536 131072 1 55
+test_case grow_32M_v1_8192 resize_ffs 8192 1024 65536 131072 1 56
+test_case grow_32M_v1_16384 resize_ffs 16384 2048 65536 131072 1 58
+test_case grow_32M_v1_32768 resize_ffs 32768 4096 65536 131072 1 56
+test_case grow_32M_v1_65536 resize_ffs 65536 8192 65536 131072 1 51
+test_case grow_48M_v1_4096 resize_ffs 4096 512 98304 131072 1 82
+test_case grow_48M_v1_8192 resize_ffs 8192 1024 98304 131072 1 84
+test_case grow_48M_v1_16384 resize_ffs 16384 2048 98304 131072 1 87
+test_case grow_48M_v1_32768 resize_ffs 32768 4096 98304 131072 1 83
+test_case grow_48M_v1_65536 resize_ffs 65536 8192 98304 131072 1 76
+test_case grow_64M_v1_4096 resize_ffs 4096 512 131072 262144 1 109
+test_case grow_64M_v1_8192 resize_ffs 8192 1024 131072 262144 1 111
+test_case grow_64M_v1_16384 resize_ffs 16384 2048 131072 262144 1 115
+test_case grow_64M_v1_32768 resize_ffs 32768 4096 131072 262144 1 111
+test_case grow_64M_v1_65536 resize_ffs 65536 8192 131072 262144 1 101
+test_case grow_16M_v2_4096 resize_ffs 4096 512 32768 131072 2 26
+test_case grow_16M_v2_8192 resize_ffs 8192 1024 32768 131072 2 28
+test_case grow_16M_v2_16384 resize_ffs 16384 2048 32768 131072 2 29
+test_case grow_16M_v2_32768 resize_ffs 32768 4096 32768 131072 2 28
+test_case grow_16M_v2_65536 resize_ffs 65536 8192 32768 131072 2 25
+test_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 40
+test_case grow_24M_v2_8192 resize_ffs 8192 1024 49152 65536 2 42
+test_case grow_24M_v2_16384 resize_ffs 16384 2048 49152 65536 2 43
+test_case grow_24M_v2_32768 resize_ffs 32768 4096 49152 65536 2 42
+test_case grow_24M_v2_65536 resize_ffs 65536 8192 49152 65536 2 38
+test_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 53
+test_case grow_32M_v2_8192 resize_ffs 8192 1024 65536 131072 2 56
+test_case grow_32M_v2_16384 resize_ffs 16384 2048 65536 131072 2 58
+test_case grow_32M_v2_32768 resize_ffs 32768 4096 65536 131072 2 56
+test_case grow_32M_v2_65536 resize_ffs 65536 8192 65536 131072 2 51
+test_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 80
+test_case grow_48M_v2_8192 resize_ffs 8192 1024 98304 131072 2 84
+test_case grow_48M_v2_16384 resize_ffs 16384 2048 98304 131072 2 87
+test_case grow_48M_v2_32768 resize_ffs 32768 4096 98304 131072 2 83
+test_case grow_48M_v2_65536 resize_ffs 65536 8192 98304 131072 2 76
+test_case grow_64M_v2_4096 resize_ffs 4096 512 131072 262144 2 107
+test_case grow_64M_v2_8192 resize_ffs 8192 1024 131072 262144 2 111
+test_case grow_64M_v2_16384 resize_ffs 16384 2048 131072 262144 2 115
+test_case grow_64M_v2_32768 resize_ffs 32768 4096 131072 262144 2 111
+test_case grow_64M_v2_65536 resize_ffs 65536 8192 131072 262144 2 101
+
+atf_test_case grow_ffsv1_partial_cg
+grow_ffsv1_partial_cg_head()
+{
+ atf_set "descr" "Checks successful ffsv1 growth by less" \
+ "than a cylinder group"
+}
+grow_ffsv1_partial_cg_body()
+{
+ echo "***resize_ffs grow test"
+
+ # resize_ffs only supports ffsv1 at the moment
+ atf_check -o ignore -e ignore newfs -V1 -s 4000 -F ${IMG}
+
+ # size to grow to is chosen to cause partial cg
+ atf_check -s exit:0 -o ignore resize_ffs -y -s 5760 ${IMG}
+ atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
+}
+
+atf_init_test_cases()
+{
+ setupvars
+ atf_add_test_case grow_16M_v0_8192
+ atf_add_test_case grow_16M_v1_16384
+ atf_add_test_case grow_16M_v2_32768
+if [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then
+ atf_add_test_case grow_16M_v0_4096
+ atf_add_test_case grow_16M_v0_16384
+ atf_add_test_case grow_16M_v0_32768
+ atf_add_test_case grow_16M_v0_65536
+ atf_add_test_case grow_16M_v1_4096
+ atf_add_test_case grow_16M_v1_8192
+ atf_add_test_case grow_16M_v1_32768
+ atf_add_test_case grow_16M_v1_65536
+ atf_add_test_case grow_16M_v2_4096
+ atf_add_test_case grow_16M_v2_8192
+ atf_add_test_case grow_16M_v2_16384
+ atf_add_test_case grow_16M_v2_65536
+ atf_add_test_case grow_24M_v0_4096
+ atf_add_test_case grow_24M_v0_8192
+ atf_add_test_case grow_24M_v0_16384
+ atf_add_test_case grow_24M_v0_32768
+ atf_add_test_case grow_24M_v0_65536
+ atf_add_test_case grow_32M_v0_4096
+ atf_add_test_case grow_32M_v0_8192
+ atf_add_test_case grow_32M_v0_16384
+ atf_add_test_case grow_32M_v0_32768
+ atf_add_test_case grow_32M_v0_65536
+ atf_add_test_case grow_48M_v0_4096
+ atf_add_test_case grow_48M_v0_8192
+ atf_add_test_case grow_48M_v0_16384
+ atf_add_test_case grow_48M_v0_32768
+ atf_add_test_case grow_48M_v0_65536
+ atf_add_test_case grow_64M_v0_4096
+ atf_add_test_case grow_64M_v0_8192
+ atf_add_test_case grow_64M_v0_16384
+ atf_add_test_case grow_64M_v0_32768
+ atf_add_test_case grow_64M_v0_65536
+
+ atf_add_test_case grow_24M_v1_4096
+ atf_add_test_case grow_24M_v1_8192
+ atf_add_test_case grow_24M_v1_16384
+ atf_add_test_case grow_24M_v1_32768
+ atf_add_test_case grow_24M_v1_65536
+ atf_add_test_case grow_32M_v1_4096
+ atf_add_test_case grow_32M_v1_8192
+ atf_add_test_case grow_32M_v1_16384
+ atf_add_test_case grow_32M_v1_32768
+ atf_add_test_case grow_32M_v1_65536
+ atf_add_test_case grow_48M_v1_4096
+ atf_add_test_case grow_48M_v1_8192
+ atf_add_test_case grow_48M_v1_16384
+ atf_add_test_case grow_48M_v1_32768
+ atf_add_test_case grow_48M_v1_65536
+ atf_add_test_case grow_64M_v1_4096
+ atf_add_test_case grow_64M_v1_8192
+ atf_add_test_case grow_64M_v1_16384
+ atf_add_test_case grow_64M_v1_32768
+ atf_add_test_case grow_64M_v1_65536
+
+ atf_add_test_case grow_24M_v2_4096
+ atf_add_test_case grow_24M_v2_8192
+ atf_add_test_case grow_24M_v2_16384
+ atf_add_test_case grow_24M_v2_32768
+ atf_add_test_case grow_24M_v2_65536
+ atf_add_test_case grow_32M_v2_4096
+ atf_add_test_case grow_32M_v2_8192
+ atf_add_test_case grow_32M_v2_16384
+ atf_add_test_case grow_32M_v2_32768
+ atf_add_test_case grow_32M_v2_65536
+ atf_add_test_case grow_48M_v2_4096
+ atf_add_test_case grow_48M_v2_8192
+ atf_add_test_case grow_48M_v2_16384
+ atf_add_test_case grow_48M_v2_32768
+ atf_add_test_case grow_48M_v2_65536
+ atf_add_test_case grow_64M_v2_4096
+ atf_add_test_case grow_64M_v2_8192
+ atf_add_test_case grow_64M_v2_16384
+ atf_add_test_case grow_64M_v2_32768
+ atf_add_test_case grow_64M_v2_65536
+fi
+ atf_add_test_case grow_ffsv1_partial_cg
+}
diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh
new file mode 100755
index 0000000..07dc514
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh
@@ -0,0 +1,220 @@
+# $NetBSD: t_grow_swapped.sh,v 1.2 2011/01/11 00:50:02 riz Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jeffrey C. Rizzo.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+
+# resize_ffs params as follows:
+# resize_ffs blocksize fragsize fssize newfssize level numdata swap
+# where 'numdata' is the number of data directories to copy - this is
+# determined manually based on the maximum number that will fit in the
+# created fs. 'level' is the fs-level (-O 0,1,2) passed to newfs.
+# If 'swap' is included, byteswap the fs
+
+# v0 == newfs -O0 (4.3BSD layout, ffsv1 superblock)
+test_case grow_16M_v0_4096 resize_ffs 4096 512 32768 131072 0 28 swap
+test_case grow_16M_v0_8192 resize_ffs 8192 1024 32768 131072 0 28 swap
+test_case grow_16M_v0_16384 resize_ffs 16384 2048 32768 131072 0 29 swap
+test_case grow_16M_v0_32768 resize_ffs 32768 4096 32768 131072 0 28 swap
+test_case grow_16M_v0_65536 resize_ffs 65536 8192 32768 131072 0 26 swap
+# these grow_24M grow a smaller amount; sometimes there's different issues
+test_case grow_24M_v0_4096 resize_ffs 4096 512 49152 65536 0 41 swap
+test_case grow_24M_v0_8192 resize_ffs 8192 1024 49152 65536 0 42 swap
+test_case grow_24M_v0_16384 resize_ffs 16384 2048 49152 65536 0 43 swap
+test_case grow_24M_v0_32768 resize_ffs 32768 4096 49152 65536 0 42 swap
+test_case grow_24M_v0_65536 resize_ffs 65536 8192 49152 65536 0 38 swap
+test_case grow_32M_v0_4096 resize_ffs 4096 512 65536 131072 0 55 swap
+test_case grow_32M_v0_8192 resize_ffs 8192 1024 65536 131072 0 56 swap
+test_case grow_32M_v0_16384 resize_ffs 16384 2048 65536 131072 0 58 swap
+test_case grow_32M_v0_32768 resize_ffs 32768 4096 65536 131072 0 56 swap
+test_case grow_32M_v0_65536 resize_ffs 65536 8192 65536 131072 0 51 swap
+test_case grow_48M_v0_4096 resize_ffs 4096 512 98304 131072 0 82 swap
+test_case grow_48M_v0_8192 resize_ffs 8192 1024 98304 131072 0 84 swap
+test_case grow_48M_v0_16384 resize_ffs 16384 2048 98304 131072 0 87 swap
+test_case grow_48M_v0_32768 resize_ffs 32768 4096 98304 131072 0 83 swap
+test_case grow_48M_v0_65536 resize_ffs 65536 8192 98304 131072 0 76 swap
+test_case grow_64M_v0_4096 resize_ffs 4096 512 131072 262144 0 109 swap
+test_case grow_64M_v0_8192 resize_ffs 8192 1024 131072 262144 0 111 swap
+test_case grow_64M_v0_16384 resize_ffs 16384 2048 131072 262144 0 115 swap
+test_case grow_64M_v0_32768 resize_ffs 32768 4096 131072 262144 0 111 swap
+test_case grow_64M_v0_65536 resize_ffs 65536 8192 131072 262144 0 101 swap
+
+# v1 == newfs -O1 (FFSv1, v2 superblock layout)
+test_case grow_16M_v1_4096 resize_ffs 4096 512 32768 131072 1 28 swap
+test_case grow_16M_v1_8192 resize_ffs 8192 1024 32768 131072 1 28 swap
+test_case grow_16M_v1_16384 resize_ffs 16384 2048 32768 131072 1 29 swap
+test_case grow_16M_v1_32768 resize_ffs 32768 4096 32768 131072 1 28 swap
+test_case grow_16M_v1_65536 resize_ffs 65536 8192 32768 131072 1 26 swap
+# these grow_24M grow a smaller amount; sometimes there's different issues
+test_case grow_24M_v1_4096 resize_ffs 4096 512 49152 65536 1 41 swap
+test_case grow_24M_v1_8192 resize_ffs 8192 1024 49152 65536 1 42 swap
+test_case grow_24M_v1_16384 resize_ffs 16384 2048 49152 65536 1 43 swap
+test_case grow_24M_v1_32768 resize_ffs 32768 4096 49152 65536 1 42 swap
+test_case grow_24M_v1_65536 resize_ffs 65536 8192 49152 65536 1 38 swap
+test_case grow_32M_v1_4096 resize_ffs 4096 512 65536 131072 1 55 swap
+test_case grow_32M_v1_8192 resize_ffs 8192 1024 65536 131072 1 56 swap
+test_case grow_32M_v1_16384 resize_ffs 16384 2048 65536 131072 1 58 swap
+test_case grow_32M_v1_32768 resize_ffs 32768 4096 65536 131072 1 56 swap
+test_case grow_32M_v1_65536 resize_ffs 65536 8192 65536 131072 1 51 swap
+test_case grow_48M_v1_4096 resize_ffs 4096 512 98304 131072 1 82 swap
+test_case grow_48M_v1_8192 resize_ffs 8192 1024 98304 131072 1 84 swap
+test_case grow_48M_v1_16384 resize_ffs 16384 2048 98304 131072 1 87 swap
+test_case grow_48M_v1_32768 resize_ffs 32768 4096 98304 131072 1 83 swap
+test_case grow_48M_v1_65536 resize_ffs 65536 8192 98304 131072 1 76 swap
+test_case grow_64M_v1_4096 resize_ffs 4096 512 131072 262144 1 109 swap
+test_case grow_64M_v1_8192 resize_ffs 8192 1024 131072 262144 1 111 swap
+test_case grow_64M_v1_16384 resize_ffs 16384 2048 131072 262144 1 115 swap
+test_case grow_64M_v1_32768 resize_ffs 32768 4096 131072 262144 1 111 swap
+test_case grow_64M_v1_65536 resize_ffs 65536 8192 131072 262144 1 101 swap
+test_case grow_16M_v2_4096 resize_ffs 4096 512 32768 131072 2 26 swap
+test_case grow_16M_v2_8192 resize_ffs 8192 1024 32768 131072 2 28 swap
+test_case grow_16M_v2_16384 resize_ffs 16384 2048 32768 131072 2 29 swap
+test_case grow_16M_v2_32768 resize_ffs 32768 4096 32768 131072 2 28 swap
+test_case grow_16M_v2_65536 resize_ffs 65536 8192 32768 131072 2 25 swap
+test_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 40 swap
+test_case grow_24M_v2_8192 resize_ffs 8192 1024 49152 65536 2 42 swap
+test_case grow_24M_v2_16384 resize_ffs 16384 2048 49152 65536 2 43 swap
+test_case grow_24M_v2_32768 resize_ffs 32768 4096 49152 65536 2 42 swap
+test_case grow_24M_v2_65536 resize_ffs 65536 8192 49152 65536 2 38 swap
+test_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 53 swap
+test_case grow_32M_v2_8192 resize_ffs 8192 1024 65536 131072 2 56 swap
+test_case grow_32M_v2_16384 resize_ffs 16384 2048 65536 131072 2 58 swap
+test_case grow_32M_v2_32768 resize_ffs 32768 4096 65536 131072 2 56 swap
+test_case grow_32M_v2_65536 resize_ffs 65536 8192 65536 131072 2 51 swap
+test_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 80 swap
+test_case grow_48M_v2_8192 resize_ffs 8192 1024 98304 131072 2 84 swap
+test_case grow_48M_v2_16384 resize_ffs 16384 2048 98304 131072 2 87 swap
+test_case grow_48M_v2_32768 resize_ffs 32768 4096 98304 131072 2 83 swap
+test_case grow_48M_v2_65536 resize_ffs 65536 8192 98304 131072 2 76 swap
+test_case grow_64M_v2_4096 resize_ffs 4096 512 131072 262144 2 107 swap
+test_case grow_64M_v2_8192 resize_ffs 8192 1024 131072 262144 2 111 swap
+test_case grow_64M_v2_16384 resize_ffs 16384 2048 131072 262144 2 115 swap
+test_case grow_64M_v2_32768 resize_ffs 32768 4096 131072 262144 2 111 swap
+test_case grow_64M_v2_65536 resize_ffs 65536 8192 131072 262144 2 101 swap
+
+atf_test_case grow_ffsv1_partial_cg
+grow_ffsv1_partial_cg_head()
+{
+ atf_set "descr" "Checks successful ffsv1 growth by less" \
+ "than a cylinder group"
+}
+grow_ffsv1_partial_cg_body()
+{
+ echo "***resize_ffs grow test"
+
+ atf_check -o ignore -e ignore newfs -B be -V1 -s 4000 -F ${IMG}
+
+ # size to grow to is chosen to cause partial cg
+ atf_check -s exit:0 -o ignore resize_ffs -y -s 5760 ${IMG}
+ atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
+}
+
+atf_init_test_cases()
+{
+ setupvars
+ atf_add_test_case grow_16M_v0_65536
+ atf_add_test_case grow_16M_v1_4096
+ atf_add_test_case grow_16M_v2_8192
+if [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then
+ atf_add_test_case grow_16M_v0_4096
+ atf_add_test_case grow_16M_v0_8192
+ atf_add_test_case grow_16M_v0_16384
+ atf_add_test_case grow_16M_v0_32768
+ atf_add_test_case grow_16M_v1_8192
+ atf_add_test_case grow_16M_v1_16384
+ atf_add_test_case grow_16M_v1_32768
+ atf_add_test_case grow_16M_v1_65536
+ atf_add_test_case grow_16M_v2_4096
+ atf_add_test_case grow_16M_v2_16384
+ atf_add_test_case grow_16M_v2_32768
+ atf_add_test_case grow_16M_v2_65536
+ atf_add_test_case grow_24M_v0_4096
+ atf_add_test_case grow_24M_v0_8192
+ atf_add_test_case grow_24M_v0_16384
+ atf_add_test_case grow_24M_v0_32768
+ atf_add_test_case grow_24M_v0_65536
+ atf_add_test_case grow_32M_v0_4096
+ atf_add_test_case grow_32M_v0_8192
+ atf_add_test_case grow_32M_v0_16384
+ atf_add_test_case grow_32M_v0_32768
+ atf_add_test_case grow_32M_v0_65536
+ atf_add_test_case grow_48M_v0_4096
+ atf_add_test_case grow_48M_v0_8192
+ atf_add_test_case grow_48M_v0_16384
+ atf_add_test_case grow_48M_v0_32768
+ atf_add_test_case grow_48M_v0_65536
+ atf_add_test_case grow_64M_v0_4096
+ atf_add_test_case grow_64M_v0_8192
+ atf_add_test_case grow_64M_v0_16384
+ atf_add_test_case grow_64M_v0_32768
+ atf_add_test_case grow_64M_v0_65536
+
+ atf_add_test_case grow_24M_v1_4096
+ atf_add_test_case grow_24M_v1_8192
+ atf_add_test_case grow_24M_v1_16384
+ atf_add_test_case grow_24M_v1_32768
+ atf_add_test_case grow_24M_v1_65536
+ atf_add_test_case grow_32M_v1_4096
+ atf_add_test_case grow_32M_v1_8192
+ atf_add_test_case grow_32M_v1_16384
+ atf_add_test_case grow_32M_v1_32768
+ atf_add_test_case grow_32M_v1_65536
+ atf_add_test_case grow_48M_v1_4096
+ atf_add_test_case grow_48M_v1_8192
+ atf_add_test_case grow_48M_v1_16384
+ atf_add_test_case grow_48M_v1_32768
+ atf_add_test_case grow_48M_v1_65536
+ atf_add_test_case grow_64M_v1_4096
+ atf_add_test_case grow_64M_v1_8192
+ atf_add_test_case grow_64M_v1_16384
+ atf_add_test_case grow_64M_v1_32768
+ atf_add_test_case grow_64M_v1_65536
+
+ atf_add_test_case grow_24M_v2_4096
+ atf_add_test_case grow_24M_v2_8192
+ atf_add_test_case grow_24M_v2_16384
+ atf_add_test_case grow_24M_v2_32768
+ atf_add_test_case grow_24M_v2_65536
+ atf_add_test_case grow_32M_v2_4096
+ atf_add_test_case grow_32M_v2_8192
+ atf_add_test_case grow_32M_v2_16384
+ atf_add_test_case grow_32M_v2_32768
+ atf_add_test_case grow_32M_v2_65536
+ atf_add_test_case grow_48M_v2_4096
+ atf_add_test_case grow_48M_v2_8192
+ atf_add_test_case grow_48M_v2_16384
+ atf_add_test_case grow_48M_v2_32768
+ atf_add_test_case grow_48M_v2_65536
+ atf_add_test_case grow_64M_v2_4096
+ atf_add_test_case grow_64M_v2_8192
+ atf_add_test_case grow_64M_v2_16384
+ atf_add_test_case grow_64M_v2_32768
+ atf_add_test_case grow_64M_v2_65536
+fi
+ atf_add_test_case grow_ffsv1_partial_cg
+}
diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh
new file mode 100755
index 0000000..1b66759
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh
@@ -0,0 +1,185 @@
+# $NetBSD: t_shrink.sh,v 1.7 2011/01/05 02:25:27 riz Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jeffrey C. Rizzo.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+
+# resize_ffs params as follows:
+# resize_ffs blocksize fragsize fssize newfssize level numdata swap
+# where 'numdata' is the number of data directories to copy - this is
+# determined manually based on the maximum number that will fit in the
+# created fs. 'level' is the fs-level (-O 0,1,2) passed to newfs.
+# If 'swap' is included, byteswap the fs
+test_case shrink_24M_16M_v0_4096 resize_ffs 4096 512 49152 32768 0 41
+test_case shrink_24M_16M_v0_8192 resize_ffs 8192 1024 49152 32768 0 42
+test_case shrink_24M_16M_v0_16384 resize_ffs 16384 2048 49152 32768 0 43
+test_case shrink_24M_16M_v0_32768 resize_ffs 32768 4096 49152 32768 0 42
+test_case shrink_24M_16M_v0_65536 resize_ffs 65536 8192 49152 32768 0 38
+test_case shrink_32M_24M_v0_4096 resize_ffs 4096 512 65536 49152 0 55
+test_case shrink_32M_24M_v0_8192 resize_ffs 8192 1024 65536 49152 0 56
+test_case shrink_32M_24M_v0_16384 resize_ffs 16384 2048 65536 49152 0 58
+test_case shrink_32M_24M_v0_32768 resize_ffs 32768 4096 65536 49152 0 56
+test_case_xfail shrink_32M_24M_v0_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 0 51
+test_case shrink_48M_16M_v0_4096 resize_ffs 4096 512 98304 32768 0 82
+test_case shrink_48M_16M_v0_8192 resize_ffs 8192 1024 98304 32768 0 84
+test_case shrink_48M_16M_v0_16384 resize_ffs 16384 2048 98304 32768 0 87
+test_case shrink_48M_16M_v0_32768 resize_ffs 32768 4096 98304 32768 0 83
+test_case shrink_48M_16M_v0_65536 resize_ffs 65536 8192 98304 32768 0 76
+test_case shrink_64M_48M_v0_4096 resize_ffs 4096 512 131072 98304 0 109
+test_case shrink_64M_48M_v0_8192 resize_ffs 8192 1024 131072 98304 0 111
+test_case shrink_64M_48M_v0_16384 resize_ffs 16384 2048 131072 98304 0 115
+test_case shrink_64M_48M_v0_32768 resize_ffs 32768 4096 131072 98304 0 111
+test_case shrink_64M_48M_v0_65536 resize_ffs 65536 8192 131072 98304 0 101
+
+test_case shrink_24M_16M_v1_4096 resize_ffs 4096 512 49152 32768 1 41
+test_case shrink_24M_16M_v1_8192 resize_ffs 8192 1024 49152 32768 1 42
+test_case shrink_24M_16M_v1_16384 resize_ffs 16384 2048 49152 32768 1 43
+test_case shrink_24M_16M_v1_32768 resize_ffs 32768 4096 49152 32768 1 42
+test_case shrink_24M_16M_v1_65536 resize_ffs 65536 8192 49152 32768 1 38
+test_case shrink_32M_24M_v1_4096 resize_ffs 4096 512 65536 49152 1 55
+test_case shrink_32M_24M_v1_8192 resize_ffs 8192 1024 65536 49152 1 56
+test_case shrink_32M_24M_v1_16384 resize_ffs 16384 2048 65536 49152 1 58
+test_case shrink_32M_24M_v1_32768 resize_ffs 32768 4096 65536 49152 1 56
+test_case_xfail shrink_32M_24M_v1_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 1 51
+test_case shrink_48M_16M_v1_4096 resize_ffs 4096 512 98304 32768 1 82
+test_case shrink_48M_16M_v1_8192 resize_ffs 8192 1024 98304 32768 1 84
+test_case shrink_48M_16M_v1_16384 resize_ffs 16384 2048 98304 32768 1 87
+test_case shrink_48M_16M_v1_32768 resize_ffs 32768 4096 98304 32768 1 83
+test_case shrink_48M_16M_v1_65536 resize_ffs 65536 8192 98304 32768 1 76
+test_case shrink_64M_48M_v1_4096 resize_ffs 4096 512 131072 98304 1 109
+test_case shrink_64M_48M_v1_8192 resize_ffs 8192 1024 131072 98304 1 111
+test_case shrink_64M_48M_v1_16384 resize_ffs 16384 2048 131072 98304 1 115
+test_case shrink_64M_48M_v1_32768 resize_ffs 32768 4096 131072 98304 1 111
+test_case shrink_64M_48M_v1_65536 resize_ffs 65536 8192 131072 98304 1 101
+
+test_case_xfail shrink_24M_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 49152 32768 2 41
+test_case_xfail shrink_24M_16M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 49152 32768 2 42
+test_case_xfail shrink_24M_16M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 49152 32768 2 43
+test_case_xfail shrink_24M_16M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 49152 32768 2 42
+test_case_xfail shrink_24M_16M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 49152 32768 2 38
+test_case_xfail shrink_32M_24M_v2_4096 "PR bin/44205" resize_ffs 4096 512 65536 49152 2 55
+test_case_xfail shrink_32M_24M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 65536 49152 2 56
+test_case_xfail shrink_32M_24M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 65536 49152 2 58
+test_case_xfail shrink_32M_24M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 65536 49152 2 56
+test_case_xfail shrink_32M_24M_v2_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 2 51
+test_case_xfail shrink_48M_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 98304 32768 2 82
+test_case_xfail shrink_48M_16M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 98304 32768 2 84
+test_case_xfail shrink_48M_16M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 98304 32768 2 87
+test_case_xfail shrink_48M_16M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 98304 32768 2 83
+test_case_xfail shrink_48M_16M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 98304 32768 2 76
+test_case_xfail shrink_64M_48M_v2_4096 "PR bin/44205" resize_ffs 4096 512 131072 98304 2 109
+test_case_xfail shrink_64M_48M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 131072 98304 2 111
+test_case_xfail shrink_64M_48M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 131072 98304 2 115
+test_case_xfail shrink_64M_48M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 131072 98304 2 111
+test_case_xfail shrink_64M_48M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 131072 98304 2 101
+
+
+atf_test_case shrink_ffsv1_partial_cg
+shrink_ffsv1_partial_cg_head()
+{
+ atf_set "descr" "Checks successful shrinkage of ffsv1 by" \
+ "less than a cylinder group"
+}
+shrink_ffsv1_partial_cg_body()
+{
+ echo "*** resize_ffs shrinkage partial cg test"
+
+ atf_check -o ignore -e ignore newfs -V1 -F -s 5760 ${IMG}
+
+ # shrink so there's a partial cg at the end
+ atf_check -s exit:0 resize_ffs -s 4000 -y ${IMG}
+ atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
+}
+
+atf_init_test_cases()
+{
+ setupvars
+ atf_add_test_case shrink_24M_16M_v0_32768
+ atf_add_test_case shrink_24M_16M_v1_65536
+ atf_add_test_case shrink_24M_16M_v2_4096
+if [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then
+ atf_add_test_case shrink_24M_16M_v0_4096
+ atf_add_test_case shrink_24M_16M_v0_8192
+ atf_add_test_case shrink_24M_16M_v0_16384
+ atf_add_test_case shrink_24M_16M_v0_65536
+ atf_add_test_case shrink_24M_16M_v1_4096
+ atf_add_test_case shrink_24M_16M_v1_8192
+ atf_add_test_case shrink_24M_16M_v1_16384
+ atf_add_test_case shrink_24M_16M_v1_32768
+ atf_add_test_case shrink_24M_16M_v2_8192
+ atf_add_test_case shrink_24M_16M_v2_16384
+ atf_add_test_case shrink_24M_16M_v2_32768
+ atf_add_test_case shrink_24M_16M_v2_65536
+ atf_add_test_case shrink_32M_24M_v0_4096
+ atf_add_test_case shrink_32M_24M_v0_8192
+ atf_add_test_case shrink_32M_24M_v0_16384
+ atf_add_test_case shrink_32M_24M_v0_32768
+ atf_add_test_case shrink_32M_24M_v0_65536
+ atf_add_test_case shrink_48M_16M_v0_4096
+ atf_add_test_case shrink_48M_16M_v0_8192
+ atf_add_test_case shrink_48M_16M_v0_16384
+ atf_add_test_case shrink_48M_16M_v0_32768
+ atf_add_test_case shrink_48M_16M_v0_65536
+ atf_add_test_case shrink_64M_48M_v0_4096
+ atf_add_test_case shrink_64M_48M_v0_8192
+ atf_add_test_case shrink_64M_48M_v0_16384
+ atf_add_test_case shrink_64M_48M_v0_32768
+ atf_add_test_case shrink_64M_48M_v0_65536
+ atf_add_test_case shrink_32M_24M_v1_4096
+ atf_add_test_case shrink_32M_24M_v1_8192
+ atf_add_test_case shrink_32M_24M_v1_16384
+ atf_add_test_case shrink_32M_24M_v1_32768
+ atf_add_test_case shrink_32M_24M_v1_65536
+ atf_add_test_case shrink_48M_16M_v1_4096
+ atf_add_test_case shrink_48M_16M_v1_8192
+ atf_add_test_case shrink_48M_16M_v1_16384
+ atf_add_test_case shrink_48M_16M_v1_32768
+ atf_add_test_case shrink_48M_16M_v1_65536
+ atf_add_test_case shrink_64M_48M_v1_4096
+ atf_add_test_case shrink_64M_48M_v1_8192
+ atf_add_test_case shrink_64M_48M_v1_16384
+ atf_add_test_case shrink_64M_48M_v1_32768
+ atf_add_test_case shrink_64M_48M_v1_65536
+ atf_add_test_case shrink_32M_24M_v2_4096
+ atf_add_test_case shrink_32M_24M_v2_8192
+ atf_add_test_case shrink_32M_24M_v2_16384
+ atf_add_test_case shrink_32M_24M_v2_32768
+ atf_add_test_case shrink_32M_24M_v2_65536
+ atf_add_test_case shrink_48M_16M_v2_4096
+ atf_add_test_case shrink_48M_16M_v2_8192
+ atf_add_test_case shrink_48M_16M_v2_16384
+ atf_add_test_case shrink_48M_16M_v2_32768
+ atf_add_test_case shrink_48M_16M_v2_65536
+ atf_add_test_case shrink_64M_48M_v2_4096
+ atf_add_test_case shrink_64M_48M_v2_8192
+ atf_add_test_case shrink_64M_48M_v2_16384
+ atf_add_test_case shrink_64M_48M_v2_32768
+ atf_add_test_case shrink_64M_48M_v2_65536
+fi
+ atf_add_test_case shrink_ffsv1_partial_cg
+}
diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh
new file mode 100755
index 0000000..30e4add
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh
@@ -0,0 +1,185 @@
+# $NetBSD: t_shrink_swapped.sh,v 1.1 2011/01/05 02:25:27 riz Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jeffrey C. Rizzo.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+
+# resize_ffs params as follows:
+# resize_ffs blocksize fragsize fssize newfssize level numdata swap
+# where 'numdata' is the number of data directories to copy - this is
+# determined manually based on the maximum number that will fit in the
+# created fs. 'level' is the fs-level (-O 0,1,2) passed to newfs.
+# If 'swap' is included, byteswap the fs
+test_case shrink_24M_16M_v0_4096 resize_ffs 4096 512 49152 32768 0 41 swap
+test_case shrink_24M_16M_v0_8192 resize_ffs 8192 1024 49152 32768 0 42 swap
+test_case shrink_24M_16M_v0_16384 resize_ffs 16384 2048 49152 32768 0 43 swap
+test_case shrink_24M_16M_v0_32768 resize_ffs 32768 4096 49152 32768 0 42 swap
+test_case shrink_24M_16M_v0_65536 resize_ffs 65536 8192 49152 32768 0 38 swap
+test_case shrink_32M_24M_v0_4096 resize_ffs 4096 512 65536 49152 0 55 swap
+test_case shrink_32M_24M_v0_8192 resize_ffs 8192 1024 65536 49152 0 56 swap
+test_case shrink_32M_24M_v0_16384 resize_ffs 16384 2048 65536 49152 0 58 swap
+test_case shrink_32M_24M_v0_32768 resize_ffs 32768 4096 65536 49152 0 56 swap
+test_case_xfail shrink_32M_24M_v0_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 0 51 swap
+test_case shrink_48M_16M_v0_4096 resize_ffs 4096 512 98304 32768 0 82 swap
+test_case shrink_48M_16M_v0_8192 resize_ffs 8192 1024 98304 32768 0 84 swap
+test_case shrink_48M_16M_v0_16384 resize_ffs 16384 2048 98304 32768 0 87 swap
+test_case shrink_48M_16M_v0_32768 resize_ffs 32768 4096 98304 32768 0 83 swap
+test_case shrink_48M_16M_v0_65536 resize_ffs 65536 8192 98304 32768 0 76 swap
+test_case shrink_64M_48M_v0_4096 resize_ffs 4096 512 131072 98304 0 109 swap
+test_case shrink_64M_48M_v0_8192 resize_ffs 8192 1024 131072 98304 0 111 swap
+test_case shrink_64M_48M_v0_16384 resize_ffs 16384 2048 131072 98304 0 115 swap
+test_case shrink_64M_48M_v0_32768 resize_ffs 32768 4096 131072 98304 0 111 swap
+test_case shrink_64M_48M_v0_65536 resize_ffs 65536 8192 131072 98304 0 101 swap
+
+test_case shrink_24M_16M_v1_4096 resize_ffs 4096 512 49152 32768 1 41 swap
+test_case shrink_24M_16M_v1_8192 resize_ffs 8192 1024 49152 32768 1 42 swap
+test_case shrink_24M_16M_v1_16384 resize_ffs 16384 2048 49152 32768 1 43 swap
+test_case shrink_24M_16M_v1_32768 resize_ffs 32768 4096 49152 32768 1 42 swap
+test_case shrink_24M_16M_v1_65536 resize_ffs 65536 8192 49152 32768 1 38 swap
+test_case shrink_32M_24M_v1_4096 resize_ffs 4096 512 65536 49152 1 55 swap
+test_case shrink_32M_24M_v1_8192 resize_ffs 8192 1024 65536 49152 1 56 swap
+test_case shrink_32M_24M_v1_16384 resize_ffs 16384 2048 65536 49152 1 58 swap
+test_case shrink_32M_24M_v1_32768 resize_ffs 32768 4096 65536 49152 1 56 swap
+test_case_xfail shrink_32M_24M_v1_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 1 51 swap
+test_case shrink_48M_16M_v1_4096 resize_ffs 4096 512 98304 32768 1 82 swap
+test_case shrink_48M_16M_v1_8192 resize_ffs 8192 1024 98304 32768 1 84 swap
+test_case shrink_48M_16M_v1_16384 resize_ffs 16384 2048 98304 32768 1 87 swap
+test_case shrink_48M_16M_v1_32768 resize_ffs 32768 4096 98304 32768 1 83 swap
+test_case shrink_48M_16M_v1_65536 resize_ffs 65536 8192 98304 32768 1 76 swap
+test_case shrink_64M_48M_v1_4096 resize_ffs 4096 512 131072 98304 1 109 swap
+test_case shrink_64M_48M_v1_8192 resize_ffs 8192 1024 131072 98304 1 111 swap
+test_case shrink_64M_48M_v1_16384 resize_ffs 16384 2048 131072 98304 1 115 swap
+test_case shrink_64M_48M_v1_32768 resize_ffs 32768 4096 131072 98304 1 111 swap
+test_case shrink_64M_48M_v1_65536 resize_ffs 65536 8192 131072 98304 1 101 swap
+
+test_case_xfail shrink_24M_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 49152 32768 2 41 swap
+test_case_xfail shrink_24M_16M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 49152 32768 2 42 swap
+test_case_xfail shrink_24M_16M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 49152 32768 2 43 swap
+test_case_xfail shrink_24M_16M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 49152 32768 2 42 swap
+test_case_xfail shrink_24M_16M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 49152 32768 2 38 swap
+test_case_xfail shrink_32M_24M_v2_4096 "PR bin/44205" resize_ffs 4096 512 65536 49152 2 55 swap
+test_case_xfail shrink_32M_24M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 65536 49152 2 56 swap
+test_case_xfail shrink_32M_24M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 65536 49152 2 58 swap
+test_case_xfail shrink_32M_24M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 65536 49152 2 56 swap
+test_case_xfail shrink_32M_24M_v2_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 2 51 swap
+test_case_xfail shrink_48M_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 98304 32768 2 82 swap
+test_case_xfail shrink_48M_16M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 98304 32768 2 84 swap
+test_case_xfail shrink_48M_16M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 98304 32768 2 87 swap
+test_case_xfail shrink_48M_16M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 98304 32768 2 83 swap
+test_case_xfail shrink_48M_16M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 98304 32768 2 76 swap
+test_case_xfail shrink_64M_48M_v2_4096 "PR bin/44205" resize_ffs 4096 512 131072 98304 2 109 swap
+test_case_xfail shrink_64M_48M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 131072 98304 2 111 swap
+test_case_xfail shrink_64M_48M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 131072 98304 2 115 swap
+test_case_xfail shrink_64M_48M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 131072 98304 2 111 swap
+test_case_xfail shrink_64M_48M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 131072 98304 2 101 swap
+
+
+atf_test_case shrink_ffsv1_partial_cg
+shrink_ffsv1_partial_cg_head()
+{
+ atf_set "descr" "Checks successful shrinkage of ffsv1 by" \
+ "less than a cylinder group"
+}
+shrink_ffsv1_partial_cg_body()
+{
+ echo "*** resize_ffs shrinkage partial cg test"
+
+ atf_check -o ignore -e ignore newfs -V1 -F -s 5760 ${IMG}
+
+ # shrink so there's a partial cg at the end
+ atf_check -s exit:0 resize_ffs -s 4000 -y ${IMG}
+ atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
+}
+
+atf_init_test_cases()
+{
+ setupvars
+ atf_add_test_case shrink_24M_16M_v0_4096
+ atf_add_test_case shrink_24M_16M_v1_8192
+ atf_add_test_case shrink_24M_16M_v2_16384
+if [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then
+ atf_add_test_case shrink_24M_16M_v0_8192
+ atf_add_test_case shrink_24M_16M_v0_16384
+ atf_add_test_case shrink_24M_16M_v0_32768
+ atf_add_test_case shrink_24M_16M_v0_65536
+ atf_add_test_case shrink_24M_16M_v1_4096
+ atf_add_test_case shrink_24M_16M_v1_16384
+ atf_add_test_case shrink_24M_16M_v1_32768
+ atf_add_test_case shrink_24M_16M_v1_65536
+ atf_add_test_case shrink_24M_16M_v2_4096
+ atf_add_test_case shrink_24M_16M_v2_8192
+ atf_add_test_case shrink_24M_16M_v2_32768
+ atf_add_test_case shrink_24M_16M_v2_65536
+ atf_add_test_case shrink_32M_24M_v0_4096
+ atf_add_test_case shrink_32M_24M_v0_8192
+ atf_add_test_case shrink_32M_24M_v0_16384
+ atf_add_test_case shrink_32M_24M_v0_32768
+ atf_add_test_case shrink_32M_24M_v0_65536
+ atf_add_test_case shrink_48M_16M_v0_4096
+ atf_add_test_case shrink_48M_16M_v0_8192
+ atf_add_test_case shrink_48M_16M_v0_16384
+ atf_add_test_case shrink_48M_16M_v0_32768
+ atf_add_test_case shrink_48M_16M_v0_65536
+ atf_add_test_case shrink_64M_48M_v0_4096
+ atf_add_test_case shrink_64M_48M_v0_8192
+ atf_add_test_case shrink_64M_48M_v0_16384
+ atf_add_test_case shrink_64M_48M_v0_32768
+ atf_add_test_case shrink_64M_48M_v0_65536
+ atf_add_test_case shrink_32M_24M_v1_4096
+ atf_add_test_case shrink_32M_24M_v1_8192
+ atf_add_test_case shrink_32M_24M_v1_16384
+ atf_add_test_case shrink_32M_24M_v1_32768
+ atf_add_test_case shrink_32M_24M_v1_65536
+ atf_add_test_case shrink_48M_16M_v1_4096
+ atf_add_test_case shrink_48M_16M_v1_8192
+ atf_add_test_case shrink_48M_16M_v1_16384
+ atf_add_test_case shrink_48M_16M_v1_32768
+ atf_add_test_case shrink_48M_16M_v1_65536
+ atf_add_test_case shrink_64M_48M_v1_4096
+ atf_add_test_case shrink_64M_48M_v1_8192
+ atf_add_test_case shrink_64M_48M_v1_16384
+ atf_add_test_case shrink_64M_48M_v1_32768
+ atf_add_test_case shrink_64M_48M_v1_65536
+ atf_add_test_case shrink_32M_24M_v2_4096
+ atf_add_test_case shrink_32M_24M_v2_8192
+ atf_add_test_case shrink_32M_24M_v2_16384
+ atf_add_test_case shrink_32M_24M_v2_32768
+ atf_add_test_case shrink_32M_24M_v2_65536
+ atf_add_test_case shrink_48M_16M_v2_4096
+ atf_add_test_case shrink_48M_16M_v2_8192
+ atf_add_test_case shrink_48M_16M_v2_16384
+ atf_add_test_case shrink_48M_16M_v2_32768
+ atf_add_test_case shrink_48M_16M_v2_65536
+ atf_add_test_case shrink_64M_48M_v2_4096
+ atf_add_test_case shrink_64M_48M_v2_8192
+ atf_add_test_case shrink_64M_48M_v2_16384
+ atf_add_test_case shrink_64M_48M_v2_32768
+ atf_add_test_case shrink_64M_48M_v2_65536
+fi
+ atf_add_test_case shrink_ffsv1_partial_cg
+}
diff --git a/contrib/netbsd-tests/sbin/resize_ffs/testdata.md5 b/contrib/netbsd-tests/sbin/resize_ffs/testdata.md5
new file mode 100644
index 0000000..9a3f76f
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/resize_ffs/testdata.md5
@@ -0,0 +1,18 @@
+MD5 (1024) = eadce85bc513cc7b9b46c027ce07ccdb
+MD5 (1025) = 3cf2a95b3af7377ca81ff08265534334
+MD5 (131072) = 3bf5f82ad5e1f8878caa699548cc0955
+MD5 (131073) = 3423d2f10e3abb20e1ceae4b055f5071
+MD5 (16384) = 933f03c66d4e2da32089ed994c9b34bd
+MD5 (16385) = d0b296920f44ef298880a2d963066026
+MD5 (2048) = fb03fb8916dd57f9648f89a06bb46f06
+MD5 (2049) = f2e489640fc3af5f09352d27717d832e
+MD5 (32768) = d940d6ccf83aeb00e71b9bbeaf860962
+MD5 (32769) = 760e060cefd844c082a10b3bef1408f7
+MD5 (4096) = a04926ee9302f93a322e784a6b044577
+MD5 (4097) = bf13de3963f43a0ffaadb1c782b71372
+MD5 (512) = 991ad794ac386e8ba71d9bb64ab4c979
+MD5 (513) = ede1dc964fe2460dd74c3c87942162ad
+MD5 (65536) = 1ee304df7275d8f88c5c0650536c842c
+MD5 (65537) = 964632a8f1a323e31af6cf1297f88041
+MD5 (8192) = 51ce7789ae9662b2c13195573a447206
+MD5 (8193) = 35d478bc5fba0d96ffb318748d1035c7
diff --git a/contrib/netbsd-tests/sbin/resize_ffs/testdata.tar.gz.base64 b/contrib/netbsd-tests/sbin/resize_ffs/testdata.tar.gz.base64
new file mode 100644
index 0000000..d8fe840
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/resize_ffs/testdata.tar.gz.base64
@@ -0,0 +1,10938 @@
+begin-base64 644 testdata.tar.gz
+H4sICIEy/UwCA3Rlc3Rk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sGfLiEWz9LzoKeEJb52cLzmSzcw6USClwLYbb
+FZMEvri3cOyC9ATBvmB9/QVxMKao/IAEnb90gjufLRIMZ2PXyw86LldkXCWFXkwf
+c6m6U9lDVeMIy64A9ErKRhKBVkoQA0aFf5c6qE8zx82lgcntzA2XEgStaQ+EOsZM
+xn+9l5+fM3dIickgVY38/QF57PiSE23rU8SSAhzINTU+mEyJqn++y/jGJ+C6trRx
+2lwhjF6/+WnMa0kzgH0Izr0xAXVfYiwDs1SG0B6PJ/s8hVNEGPF+c5iyZKIf+woB
+S1ymPORa3m8MB2Varf6rJew1BMN4m0+itIBXpEj5tuSj6KOqws7fymywoApCeLF1
+gRwoPCwwS7dlZOnp5yacfvFxjys3Kha4Nxeyf7Lsz5qA3thYYe5XR7O1wImK3zDM
+En8xlJHRKlElTyo4R3JvSDdQUWo8pOjA4cEMJ6uDyD5RJz9nRUA+a4McuSdmUX6S
+Oj9mSdb6Ke7MtQunuvwLvUw30bzflOxgDZEmeP+9QPnPf/7zn//85z//+c9//vOf
+//znP//5z3/+85//L/0vxuXHSABICAA=
+====
diff --git a/contrib/netbsd-tests/sbin/route/t_missing.sh b/contrib/netbsd-tests/sbin/route/t_missing.sh
new file mode 100755
index 0000000..cd9387e
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/route/t_missing.sh
@@ -0,0 +1,45 @@
+# $NetBSD: t_missing.sh,v 1.3 2012/03/17 08:34:55 jruoho Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case missing
+missing_head() {
+ atf_set "descr" "Check route(8) with a missing argument (PR bin/42179)"
+}
+
+missing_body() {
+
+ atf_check -s exit:1 \
+ -e not-inline:"route: writing to routing socket: Invalid argument\n" \
+ route -n get
+}
+
+atf_init_test_cases() {
+ atf_add_test_case missing
+}
diff --git a/contrib/netbsd-tests/sbin/sysctl/t_perm.sh b/contrib/netbsd-tests/sbin/sysctl/t_perm.sh
new file mode 100755
index 0000000..6acfd19
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/sysctl/t_perm.sh
@@ -0,0 +1,209 @@
+# $NetBSD: t_perm.sh,v 1.6 2012/03/18 09:46:50 jruoho Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+file="/tmp/d_sysctl.out"
+
+clean() {
+
+ if [ -f $file ]; then
+ rm $file
+ fi
+}
+
+sysctl_write() {
+
+ deadbeef="3735928559"
+
+ sysctl $1 | cut -d= -f1 > $file
+
+ if [ ! -f $file ]; then
+ atf_fail "sysctl failed"
+ fi
+
+ while read line; do
+
+ node=$(echo $line)
+
+ case $node in
+
+ "$1."*)
+ atf_check -s not-exit:0 -e ignore \
+ -x sysctl -w $node=$deadbeef
+ ;;
+ esac
+
+ done < $file
+
+ # A functional verification that $deadbeef
+ # was not actually written to the node.
+ #
+ if [ ! -z $(sysctl $1 | grep $deadbeef) ]; then
+ atf_fail "value was written"
+ fi
+}
+
+# ddb.
+#
+atf_test_case sysctl_ddb cleanup
+sysctl_ddb_head() {
+ atf_set "require.user" "unprivileged"
+ atf_set "descr" "Test writing to 'ddb' sysctl node as an user"
+}
+
+sysctl_ddb_body() {
+ sysctl_write "ddb"
+}
+
+sysctl_ddb_cleanup() {
+ clean
+}
+
+# hw.
+#
+atf_test_case sysctl_hw cleanup
+sysctl_hw_head() {
+ atf_set "require.user" "unprivileged"
+ atf_set "descr" "Test writing to 'hw' sysctl node as an user"
+}
+
+sysctl_hw_body() {
+ sysctl_write "hw"
+}
+
+sysctl_hw_cleanup() {
+ clean
+}
+
+# kern.
+#
+atf_test_case sysctl_kern cleanup
+sysctl_kern_head() {
+ atf_set "require.user" "unprivileged"
+ atf_set "descr" "Test writing to 'kern' " \
+ "sysctl node as an user (PR kern/44946)"
+}
+
+sysctl_kern_body() {
+ sysctl_write "kern"
+}
+
+sysctl_kern_cleanup() {
+ clean
+}
+
+# machdep.
+#
+atf_test_case sysctl_machdep cleanup
+sysctl_machdep_head() {
+ atf_set "require.user" "unprivileged"
+ atf_set "descr" "Test writing to 'machdep' sysctl node as an user"
+}
+
+sysctl_machdep_body() {
+ sysctl_write "machdep"
+}
+
+sysctl_machdep_cleanup() {
+ clean
+}
+
+# net.
+#
+atf_test_case sysctl_net cleanup
+sysctl_net_head() {
+ atf_set "require.user" "unprivileged"
+ atf_set "descr" "Test writing to 'net' sysctl node as an user"
+}
+
+sysctl_net_body() {
+ sysctl_write "net"
+}
+
+sysctl_net_cleanup() {
+ clean
+}
+
+# security.
+#
+atf_test_case sysctl_security cleanup
+sysctl_security_head() {
+ atf_set "require.user" "unprivileged"
+ atf_set "descr" "Test writing to 'security' sysctl node as an user"
+}
+
+sysctl_security_body() {
+ sysctl_write "security"
+}
+
+sysctl_security_cleanup() {
+ clean
+}
+
+# vfs.
+#
+atf_test_case sysctl_vfs cleanup
+sysctl_vfs_head() {
+ atf_set "require.user" "unprivileged"
+ atf_set "descr" "Test writing to 'vfs' sysctl node as an user"
+}
+
+sysctl_vfs_body() {
+ sysctl_write "vfs"
+}
+
+sysctl_vfs_cleanup() {
+ clean
+}
+
+# vm.
+#
+atf_test_case sysctl_vm cleanup
+sysctl_vm_head() {
+ atf_set "require.user" "unprivileged"
+ atf_set "descr" "Test writing to 'vm' sysctl node as an user"
+}
+
+sysctl_vm_body() {
+ sysctl_write "vm"
+}
+
+sysctl_vm_cleanup() {
+ clean
+}
+
+atf_init_test_cases() {
+ atf_add_test_case sysctl_ddb
+ atf_add_test_case sysctl_hw
+ atf_add_test_case sysctl_kern
+ atf_add_test_case sysctl_machdep
+ atf_add_test_case sysctl_net
+ atf_add_test_case sysctl_security
+ atf_add_test_case sysctl_vfs
+ atf_add_test_case sysctl_vm
+}
diff --git a/contrib/netbsd-tests/sbin/sysctl/t_sysctl.sh b/contrib/netbsd-tests/sbin/sysctl/t_sysctl.sh
new file mode 100755
index 0000000..6573d8d
--- /dev/null
+++ b/contrib/netbsd-tests/sbin/sysctl/t_sysctl.sh
@@ -0,0 +1,45 @@
+# $NetBSD: t_sysctl.sh,v 1.2 2014/05/16 18:50:28 palle Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Test that sysctl(8) works"
+}
+
+basic_body() {
+
+ atf_check -s exit:0 -o ignore -e empty -x "sysctl -a"
+ atf_check -s exit:0 -o ignore -e empty -x "sysctl -d"
+}
+
+atf_init_test_cases() {
+
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/share/examples/t_asm.sh b/contrib/netbsd-tests/share/examples/t_asm.sh
new file mode 100755
index 0000000..f615935
--- /dev/null
+++ b/contrib/netbsd-tests/share/examples/t_asm.sh
@@ -0,0 +1,74 @@
+# $NetBSD: t_asm.sh,v 1.1 2013/02/16 12:44:26 jmmv Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+# check_implemented <example_name>
+#
+# Verifies if a particular asm example is implemented for the current
+# platform. The example_name argument is the name of the subdirectory
+# of the examples/asm/ subtree that includes the code for the example
+# under test.
+#
+# If the example is not implemented, the calling test is skipped. If the
+# check for implementation fails, the calling test is failed.
+check_implemented() {
+ local name="${1}"; shift
+
+ local implemented=$(cd /usr/share/examples/asm/${name}/ && \
+ make check-implemented)
+ [ $? -eq 0 ] || atf_fail "Failed to determine if the sample" \
+ "program is supported"
+ [ "${implemented}" = yes ] || atf_skip "Example program not" \
+ "implemented on this platform"
+}
+
+# copy_example <example_name>
+#
+# Copies the example code and supporting Makefiles into the current
+# directory.
+copy_example() {
+ local name="${1}"; shift
+
+ cp /usr/share/examples/asm/${name}/* .
+}
+
+atf_test_case hello
+hello_head() {
+ atf_set "descr" "Builds, runs and validates the 'hello' asm example"
+ atf_set "require.files" "/usr/share/examples/asm/hello/"
+ atf_set "require.progs" "make"
+}
+hello_body() {
+ check_implemented hello
+ copy_example hello
+ atf_check -s exit:0 -o ignore -e ignore make
+ atf_check -s exit:0 -o inline:'Hello, world!\n' -e empty ./hello
+}
+
+atf_init_test_cases() {
+ atf_add_test_case hello
+}
diff --git a/contrib/netbsd-tests/share/mk/common.subr b/contrib/netbsd-tests/share/mk/common.subr
new file mode 100644
index 0000000..0b542fe
--- /dev/null
+++ b/contrib/netbsd-tests/share/mk/common.subr
@@ -0,0 +1,132 @@
+# Copyright 2012 Google 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Dumps a file to the test's stdout for debugging purposes.
+dump_file() {
+ local file="${1}"; shift
+
+ echo "==== BEGIN ${file}"
+ cat "${file}"
+ echo "==== END ${file}"
+}
+
+# Creates a C source file with a single symbol in it.
+#
+# The file parameter specifies the path to the file to create, WITHOUT the
+# C extension. Both a source file and a header file are created. Any
+# intermediate directories are created too.
+#
+# The symbol parameter specifies the name of the symbol to place in the
+# module, which is defined as a string holding the name of the module.
+create_c_module() {
+ local file="${1}"; shift
+ local symbol="${1}"; shift
+
+ mkdir -p "$(dirname ${file})"
+ echo "extern const char *${symbol};" >"${file}.h"
+ echo "const char *${symbol} = \"${file}\";" >"${file}.c"
+
+ dump_file "${file}.h"
+ dump_file "${file}.c"
+}
+
+# Creates a main C source file that references a set of modules.
+#
+# The modules to be referenced should have been created with
+# create_c_module. The generated source file ensures that all the modules
+# are referenced in some way, which helps in testing that the generated
+# binary holds all the necessary objects.
+#
+# The file parameter specifies the name of the file to create.
+#
+# The rest of the parameters are module:symbol pairs that specify the
+# module to include and the symbol within them to reference.
+create_main_using_modules() {
+ local file="${1}"; shift
+
+ local modules=
+ local symbols=
+ for spec in "${@}"; do
+ modules="${modules} $(echo ${spec} | cut -d : -f 1)"
+ symbols="${symbols} $(echo ${spec} | cut -d : -f 2)"
+ done
+
+ echo '#include <stdio.h>' >"${file}"
+ for module in ${modules}; do
+ echo "#include \"${module}\"" >>"${file}"
+ done
+ echo 'int main(void) {' >>"${file}"
+ for symbol in ${symbols}; do
+ echo "printf(\"%s\n\", ${symbol});" >>"${file}"
+ done
+ echo 'return 0; }' >>"${file}"
+
+ dump_file "${file}"
+}
+
+# Creates a mk.conf file and points MAKECONF to it.
+#
+# The first argument specifies the name of the configuration file to
+# create.
+#
+# The rest of the arguments include a collection of modifiers for the
+# generated configuration file and/or a collection of explicit variable
+# names and their values to set.
+#
+# The qualifiers can be one of:
+# - owngrp: Override the *OWN and *GRP variables to point to the current
+# user.
+create_make_conf() {
+ local file="${1}"; shift
+
+ echo "# Test configuration file" >"${file}"
+ for arg in "${@}"; do
+ case "${arg}" in
+ *=*)
+ echo "${arg}" >>"${file}"
+ ;;
+ owngrp)
+ for class in BIN DOC LIB LINKS MAN; do
+ echo "${class}OWN=$(id -un)" >>"${file}"
+ echo "${class}GRP=$(id -gn)" >>"${file}"
+ done
+ ;;
+ esac
+ done
+
+ case "${file}" in
+ /*)
+ MAKECONF="${file}"; export MAKECONF
+ ;;
+ *)
+ MAKECONF="$(pwd)/${file}"; export MAKECONF
+ ;;
+ esac
+
+ dump_file "${file}"
+}
diff --git a/contrib/netbsd-tests/share/mk/t_lib.sh b/contrib/netbsd-tests/share/mk/t_lib.sh
new file mode 100755
index 0000000..5f18e14
--- /dev/null
+++ b/contrib/netbsd-tests/share/mk/t_lib.sh
@@ -0,0 +1,54 @@
+# Copyright 2012 Google 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+atf_test_case defaults__build_and_install
+defaults__build_and_install_body() {
+ create_c_module module1 first
+ create_c_module module2 second
+
+ cat >Makefile <<EOF
+LIB = two-modules
+SRCS = module1.c module2.c
+.include <bsd.lib.mk>
+EOF
+
+ atf_check -o ignore make
+ mkdir -p root/usr/lib
+ mkdir -p root/usr/libdata/lint
+ create_make_conf mk.conf owngrp DESTDIR="$(pwd)/root"
+ atf_check -o ignore make install
+
+ create_main_using_modules main.c module1.h:first module2.h:second
+ atf_check -o ignore gcc -I. -Lroot/usr/lib -o main main.c -ltwo-modules
+
+ atf_check -o inline:'module1\nmodule2\n' ./main
+}
+
+atf_init_test_cases() {
+ atf_add_test_case defaults__build_and_install
+}
diff --git a/contrib/netbsd-tests/share/mk/t_own.sh b/contrib/netbsd-tests/share/mk/t_own.sh
new file mode 100755
index 0000000..7372dd2
--- /dev/null
+++ b/contrib/netbsd-tests/share/mk/t_own.sh
@@ -0,0 +1,72 @@
+# Copyright 2012 Google 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+atf_test_case makeconf__ok
+makeconf__ok_body() {
+ cat >Makefile <<EOF
+A_TEST_CONFIG_VARIABLE = not overriden
+
+.PHONY: show-config-var
+show-config-var:
+ @echo \${A_TEST_CONFIG_VARIABLE}
+
+.include <bsd.own.mk>
+EOF
+
+ echo >empty.conf
+ cat >custom.conf <<EOF
+A_TEST_CONFIG_VARIABLE = 'a value'
+EOF
+ atf_check -o inline:'not overriden\n' \
+ make MAKECONF="$(pwd)/empty.conf" show-config-var
+ atf_check -o inline:'a value\n' \
+ make MAKECONF="$(pwd)/custom.conf" show-config-var
+}
+
+atf_test_case makeconf__missing
+makeconf__missing_body() {
+ cat >Makefile <<EOF
+.PHONY: hello
+hello:
+ @echo 'Did not error out on a missing file!'
+
+.include <bsd.own.mk>
+EOF
+
+ echo >empty.conf
+ cat >custom.conf <<EOF
+A_TEST_CONFIG_VARIABLE = 'a value'
+EOF
+ atf_check -o inline:'Did not error out on a missing file!\n' \
+ make MAKECONF="$(pwd)/non-existent.conf" hello
+}
+
+atf_init_test_cases() {
+ atf_add_test_case makeconf__ok
+ atf_add_test_case makeconf__missing
+}
diff --git a/contrib/netbsd-tests/share/mk/t_prog.sh b/contrib/netbsd-tests/share/mk/t_prog.sh
new file mode 100755
index 0000000..d004070
--- /dev/null
+++ b/contrib/netbsd-tests/share/mk/t_prog.sh
@@ -0,0 +1,87 @@
+# Copyright 2012 Google 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+atf_test_case defaults__build_and_install
+defaults__build_and_install_head() {
+ atf_set "require.progs" "/usr/bin/mandoc"
+}
+defaults__build_and_install_body() {
+ cat >hello.c <<EOF
+#include <stdio.h>
+int main(void) { printf("Hello, test!\n"); return 0; }
+EOF
+ cat >hello.1 <<EOF
+Manpage of hello(1).
+EOF
+
+ cat >Makefile <<EOF
+BINDIR = /the/bin/dir
+PROG = hello
+.include <bsd.prog.mk>
+EOF
+
+ atf_check -o ignore make
+ mkdir -p root/the/bin/dir
+ mkdir -p root/usr/share/man/man1
+ mkdir -p root/usr/share/man/html1
+ create_make_conf mk.conf owngrp DESTDIR="$(pwd)/root"
+ atf_check -o ignore make install
+
+ atf_check -o inline:'Hello, test!\n' ./root/the/bin/dir/hello
+ atf_check -o inline:'Manpage of hello(1).\n' \
+ cat root/usr/share/man/man1/hello.1
+ atf_check -o match:'Manpage of hello' \
+ cat root/usr/share/man/html1/hello.html
+}
+
+atf_test_case without_man__build_and_install
+without_man__build_and_install_body() {
+ cat >hello.c <<EOF
+#include <stdio.h>
+int main(void) { printf("Hello, test!\n"); return 0; }
+EOF
+
+ cat >Makefile <<EOF
+BINDIR = /the/bin/dir
+PROG = hello
+MAN =
+.include <bsd.prog.mk>
+EOF
+
+ atf_check -o ignore make
+ mkdir -p root/the/bin/dir
+ create_make_conf mk.conf owngrp DESTDIR="$(pwd)/root"
+ atf_check -o ignore make install
+
+ atf_check -o inline:'Hello, test!\n' ./root/the/bin/dir/hello
+}
+
+atf_init_test_cases() {
+ atf_add_test_case defaults__build_and_install
+ atf_add_test_case without_man__build_and_install
+}
diff --git a/contrib/netbsd-tests/share/mk/t_test.sh b/contrib/netbsd-tests/share/mk/t_test.sh
new file mode 100755
index 0000000..c8bb1f3
--- /dev/null
+++ b/contrib/netbsd-tests/share/mk/t_test.sh
@@ -0,0 +1,111 @@
+# Copyright 2012 Google 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Helper function for the various one_* test cases.
+#
+# The first argument must be one of C, CXX or SH, and this indicates the
+# language of the test program.
+#
+# The second argument is the name of the test program, without an extension.
+# The corresponding source file must exist in the current directory.
+one_test() {
+ local lang="${1}"; shift
+ local name="${1}"; shift
+
+ cat >Makefile <<EOF
+.include <bsd.own.mk>
+TESTSDIR = \${TESTSBASE}/fake
+TESTS_${lang} = ${name}
+.include <bsd.test.mk>
+EOF
+
+ atf_check -o ignore make
+ mkdir -p root/usr/tests/fake
+ create_make_conf mk.conf owngrp DESTDIR="$(pwd)/root"
+ atf_check -o ignore make install
+
+ atf_check -o match:'ident: one_tc' "./root/usr/tests/fake/${name}" -l
+}
+
+atf_test_case one_c
+one_c_body() {
+ cat >t_fake.c <<EOF
+#include <atf-c.h>
+ATF_TC_WITHOUT_HEAD(one_tc);
+ATF_TC_BODY(one_tc, tc)
+{
+ atf_tc_fail("Failing explicitly");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, one_tc);
+ return atf_no_error();
+}
+EOF
+ one_test C t_fake
+}
+
+atf_test_case one_cxx
+one_cxx_body() {
+ cat >t_fake.cpp <<EOF
+#include <atf-c++.hpp>
+ATF_TEST_CASE_WITHOUT_HEAD(one_tc);
+ATF_TEST_CASE_BODY(one_tc)
+{
+ fail("Failing explicitly");
+}
+
+ATF_INIT_TEST_CASES(tcs)
+{
+ ATF_ADD_TEST_CASE(tcs, one_tc);
+}
+EOF
+ one_test CXX t_fake
+}
+
+atf_test_case one_sh
+one_sh_body() {
+ cat >t_fake.sh <<EOF
+atf_test_case one_tc
+one_tc_body() {
+ atf_fail "Failing explicitly"
+}
+
+atf_init_test_cases() {
+ atf_add_test_case one_tc
+}
+EOF
+ one_test SH t_fake
+}
+
+atf_init_test_cases() {
+ atf_add_test_case one_c
+ atf_add_test_case one_cxx
+ atf_add_test_case one_sh
+}
diff --git a/contrib/netbsd-tests/sys/rc/h_args.sh b/contrib/netbsd-tests/sys/rc/h_args.sh
new file mode 100755
index 0000000..2b03f29
--- /dev/null
+++ b/contrib/netbsd-tests/sys/rc/h_args.sh
@@ -0,0 +1,64 @@
+#! /bin/sh
+#
+# $NetBSD: h_args.sh,v 1.1 2010/03/15 19:03:08 jmmv Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Julio Merino.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# An rc.d script that overrides all standard comands and adds a non-standard
+# command. All of them print the set of arguments passed to them and take no
+# further action.
+#
+
+${_rc_subr_loaded} . /etc/rc.subr
+
+name="h_args"
+rcvar="${name}"
+command="/usr/bin/true"
+extra_commands="custom"
+
+for command in start stop restart custom; do
+ eval ${command}_precmd=\'print_args pre${command}\'
+ eval ${command}_cmd=\'print_args ${command}\'
+ eval ${command}_postcmd=\'print_args post${command}\'
+done
+
+print_args() {
+ local command="${1}"; shift
+
+ printf "${command}:"
+ while [ ${#} -gt 0 ]; do
+ printf " >%s<" "${1}"
+ shift
+ done
+ printf ".\n"
+}
+
+load_rc_config "${name}"
+run_rc_command "${@}"
diff --git a/contrib/netbsd-tests/sys/rc/h_simple.sh b/contrib/netbsd-tests/sys/rc/h_simple.sh
new file mode 100755
index 0000000..4ed62a7
--- /dev/null
+++ b/contrib/netbsd-tests/sys/rc/h_simple.sh
@@ -0,0 +1,45 @@
+#! /bin/sh
+#
+# $NetBSD: h_simple.sh,v 1.1 2010/03/15 19:03:08 jmmv Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Julio Merino.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# A very simple rc.d script that defines the minimum variables to be functional.
+#
+
+${_rc_subr_loaded} . /etc/rc.subr
+
+name="h_simple"
+rcvar="${name}"
+command="/bin/sleep"
+command_args="300 &"
+
+load_rc_config "${name}"
+run_rc_command "${@}"
diff --git a/contrib/netbsd-tests/sys/rc/t_rc_d_cli.sh b/contrib/netbsd-tests/sys/rc/t_rc_d_cli.sh
new file mode 100755
index 0000000..d97f8cc
--- /dev/null
+++ b/contrib/netbsd-tests/sys/rc/t_rc_d_cli.sh
@@ -0,0 +1,250 @@
+# $NetBSD: t_rc_d_cli.sh,v 1.4 2010/11/07 17:51:21 jmmv Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Julio Merino.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case no_command
+no_command_head() {
+ atf_set "descr" "Tests that the lack of a command errors out"
+}
+no_command_body() {
+ export h_simple=YES
+ rc_helper=$(atf_get_srcdir)/h_simple
+
+ atf_check -s eq:1 -o empty -e ignore ${rc_helper}
+}
+
+atf_test_case default_start_no_args
+default_start_no_args_head() {
+ atf_set "descr" "Tests that running the default 'start' without" \
+ "arguments does not error out"
+}
+default_start_no_args_body() {
+ export h_simple=YES
+ rc_helper=$(atf_get_srcdir)/h_simple
+
+ atf_check -s eq:0 -o ignore -e empty ${rc_helper} start
+ ${rc_helper} forcestop
+}
+
+atf_test_case default_start_with_args
+default_start_with_args_head() {
+ atf_set "descr" "Tests that running the default 'start' with" \
+ "arguments errors out"
+}
+default_start_with_args_body() {
+ export h_simple=YES
+ rc_helper=$(atf_get_srcdir)/h_simple
+
+ atf_check -s eq:1 -o ignore -e ignore ${rc_helper} start foo
+ if ${rc_helper} status >/dev/null; then
+ ${rc_helper} forcestop
+ atf_fail 'extra argument to start did not error out'
+ fi
+}
+
+atf_test_case default_stop_no_args
+default_stop_no_args_head() {
+ atf_set "descr" "Tests that running the default 'stop' without" \
+ "arguments does not error out"
+}
+default_stop_no_args_body() {
+ export h_simple=YES
+ rc_helper=$(atf_get_srcdir)/h_simple
+
+ ${rc_helper} start
+ atf_check -s eq:0 -o ignore -e empty ${rc_helper} stop
+}
+
+atf_test_case default_stop_with_args
+default_stop_with_args_head() {
+ atf_set "descr" "Tests that running the default 'stop' with" \
+ "arguments errors out"
+}
+default_stop_with_args_body() {
+ export h_simple=YES
+ rc_helper=$(atf_get_srcdir)/h_simple
+
+ ${rc_helper} start
+ atf_check -s eq:1 -o ignore -e ignore ${rc_helper} stop foo
+ if ${rc_helper} status >/dev/null; then
+ ${rc_helper} forcestop
+ else
+ atf_fail 'extra argument to stop did not error out'
+ fi
+}
+
+atf_test_case default_restart_no_args
+default_restart_no_args_head() {
+ atf_set "descr" "Tests that running the default 'restart' without" \
+ "arguments does not error out"
+}
+default_restart_no_args_body() {
+ export h_simple=YES
+ rc_helper=$(atf_get_srcdir)/h_simple
+
+ ${rc_helper} start
+ atf_check -s eq:0 -o ignore -e empty ${rc_helper} restart
+ ${rc_helper} forcestop
+}
+
+atf_test_case default_restart_with_args
+default_restart_with_args_head() {
+ atf_set "descr" "Tests that running the default 'restart' with" \
+ "arguments errors out"
+}
+default_restart_with_args_body() {
+ export h_simple=YES
+ rc_helper=$(atf_get_srcdir)/h_simple
+
+ ${rc_helper} start
+ atf_check -s eq:1 -o ignore -e ignore ${rc_helper} restart foo
+ ${rc_helper} forcestop
+}
+
+do_overriden_no_args() {
+ local command="${1}"; shift
+
+ export h_args=YES
+ rc_helper=$(atf_get_srcdir)/h_args
+
+ cat >expout <<EOF
+pre${command}:.
+${command}:.
+post${command}:.
+EOF
+ atf_check -s eq:0 -o file:expout -e empty ${rc_helper} ${command}
+}
+
+do_overriden_with_args() {
+ local command="${1}"; shift
+
+ export h_args=YES
+ rc_helper=$(atf_get_srcdir)/h_args
+
+ cat >expout <<EOF
+pre${command}:.
+${command}: >arg1< > arg 2 < >arg3< >*<.
+post${command}:.
+EOF
+ atf_check -s eq:0 -o file:expout -e empty ${rc_helper} ${command} \
+ 'arg1' ' arg 2 ' 'arg3' '*'
+}
+
+atf_test_case overriden_start_no_args
+overriden_start_no_args_head() {
+ atf_set "descr" "Tests that running a custom 'start' without" \
+ "arguments does not pass any parameters to the command"
+}
+overriden_start_no_args_body() {
+ do_overriden_no_args start
+}
+
+atf_test_case overriden_start_with_args
+overriden_start_with_args_head() {
+ atf_set "descr" "Tests that running a custom 'start' with" \
+ "arguments passes those arguments as parameters to the command"
+}
+overriden_start_with_args_body() {
+ do_overriden_with_args start
+}
+
+atf_test_case overriden_stop_no_args
+overriden_stop_no_args_head() {
+ atf_set "descr" "Tests that running a custom 'stop' without" \
+ "arguments does not pass any parameters to the command"
+}
+overriden_stop_no_args_body() {
+ do_overriden_no_args stop
+}
+
+atf_test_case overriden_stop_with_args
+overriden_stop_with_args_head() {
+ atf_set "descr" "Tests that running a custom 'stop' with" \
+ "arguments passes those arguments as parameters to the command"
+}
+overriden_stop_with_args_body() {
+ do_overriden_with_args stop
+}
+
+atf_test_case overriden_restart_no_args
+overriden_restart_no_args_head() {
+ atf_set "descr" "Tests that running a custom 'restart' without" \
+ "arguments does not pass any parameters to the command"
+}
+overriden_restart_no_args_body() {
+ do_overriden_no_args restart
+}
+
+atf_test_case overriden_restart_with_args
+overriden_restart_with_args_head() {
+ atf_set "descr" "Tests that running a custom 'restart' with" \
+ "arguments passes those arguments as parameters to the command"
+}
+overriden_restart_with_args_body() {
+ do_overriden_with_args restart
+}
+
+atf_test_case overriden_custom_no_args
+overriden_custom_no_args_head() {
+ atf_set "descr" "Tests that running a custom command without" \
+ "arguments does not pass any parameters to the command"
+}
+overriden_custom_no_args_body() {
+ do_overriden_no_args custom
+}
+
+atf_test_case overriden_custom_with_args
+overriden_custom_with_args_head() {
+ atf_set "descr" "Tests that running a custom command with" \
+ "arguments passes those arguments as parameters to the command"
+}
+overriden_custom_with_args_body() {
+ do_overriden_with_args custom
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case no_command
+
+ atf_add_test_case default_start_no_args
+ atf_add_test_case default_start_with_args
+ atf_add_test_case default_stop_no_args
+ atf_add_test_case default_stop_with_args
+ atf_add_test_case default_restart_no_args
+ atf_add_test_case default_restart_with_args
+
+ atf_add_test_case overriden_start_no_args
+ atf_add_test_case overriden_start_with_args
+ atf_add_test_case overriden_stop_no_args
+ atf_add_test_case overriden_stop_with_args
+ atf_add_test_case overriden_restart_no_args
+ atf_add_test_case overriden_restart_with_args
+ atf_add_test_case overriden_custom_no_args
+ atf_add_test_case overriden_custom_with_args
+}
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.awk b/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.awk
new file mode 100644
index 0000000..52c3912
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.awk
@@ -0,0 +1,16 @@
+# $NetBSD: d_assign_NF.awk,v 1.1 2012/03/11 18:35:59 jruoho Exp $
+
+{
+ NF = 2
+ print "$0=`" $0 "`"
+ print "$3=`" $3 "`"
+ print "$4=`" $4 "`"
+ NF = 3
+ print "$0=`" $0 "`"
+ print "$3=`" $3 "`"
+ print "$4=`" $4 "`"
+ NF = 4
+ print "$0=`" $0 "`"
+ print "$3=`" $3 "`"
+ print "$4=`" $4 "`"
+}
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.in b/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.in
new file mode 100644
index 0000000..1245b92
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.in
@@ -0,0 +1 @@
+ 1 2 3
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.out b/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.out
new file mode 100644
index 0000000..2631a7a
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_assign_NF.out
@@ -0,0 +1,9 @@
+$0=`1 2`
+$3=``
+$4=``
+$0=`1 2 `
+$3=``
+$4=``
+$0=`1 2 `
+$3=``
+$4=``
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.awk b/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.awk
new file mode 100644
index 0000000..1502b5e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.awk
@@ -0,0 +1,3 @@
+# $NetBSD: d_big_regexp.awk,v 1.1 2012/03/11 18:36:00 jruoho Exp $
+
+/^[^_][^ ]*_NNIFO([ ]+[^_]+[^ ]*_(CC|INR|JJFO|JJMA|JJPG|NNIFG|NNIFO|NNIMPG|NNIMR|NNING|PP3FD|PQINO|PQMO|PSFR|RQ|TC|VIIR3|VPIPN|VPLIPF|NOTAG|RQR))*$/
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.in b/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.in
new file mode 100644
index 0000000..ad82078
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.in
@@ -0,0 +1 @@
+1_NNIFO 1_PSFR 1_JJFO 1_NNIFO 1_INR 1_NNIMR 1_CC 1_NNING 1_RQ 1_VPLIPF 1_NNIFG 1_JJPG 1_NNIMPG 1_PQINO 1_VPIPN 1_PP3FD 1_JJMA 1_PQMO 1_TC 1_VIIR3
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.out b/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.out
new file mode 100644
index 0000000..ad82078
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_big_regexp.out
@@ -0,0 +1 @@
+1_NNIFO 1_PSFR 1_JJFO 1_NNIFO 1_INR 1_NNIMR 1_CC 1_NNING 1_RQ 1_VPLIPF 1_NNIFG 1_JJPG 1_NNIMPG 1_PQINO 1_VPIPN 1_PP3FD 1_JJMA 1_PQMO 1_TC 1_VIIR3
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_end1.awk b/contrib/netbsd-tests/usr.bin/awk/d_end1.awk
new file mode 100644
index 0000000..cb8b0d0
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_end1.awk
@@ -0,0 +1,5 @@
+# $NetBSD: d_end1.awk,v 1.1 2012/03/11 18:36:00 jruoho Exp $
+
+END {
+ print NF;
+}
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_end1.in b/contrib/netbsd-tests/usr.bin/awk/d_end1.in
new file mode 100644
index 0000000..8e13e46
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_end1.in
@@ -0,0 +1 @@
+a b c d
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_end1.out b/contrib/netbsd-tests/usr.bin/awk/d_end1.out
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_end1.out
@@ -0,0 +1 @@
+4
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_end2.awk b/contrib/netbsd-tests/usr.bin/awk/d_end2.awk
new file mode 100644
index 0000000..8b10b82
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_end2.awk
@@ -0,0 +1,5 @@
+# $NetBSD: d_end2.awk,v 1.1 2012/03/11 18:36:00 jruoho Exp $
+
+END {
+ print $0;
+}
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_end2.in b/contrib/netbsd-tests/usr.bin/awk/d_end2.in
new file mode 100644
index 0000000..8e13e46
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_end2.in
@@ -0,0 +1 @@
+a b c d
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_end2.out b/contrib/netbsd-tests/usr.bin/awk/d_end2.out
new file mode 100644
index 0000000..8e13e46
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_end2.out
@@ -0,0 +1 @@
+a b c d
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_period.awk b/contrib/netbsd-tests/usr.bin/awk/d_period.awk
new file mode 100644
index 0000000..d1dabf7
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_period.awk
@@ -0,0 +1 @@
+{print x + $1 + 0.125}
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_period.in b/contrib/netbsd-tests/usr.bin/awk/d_period.in
new file mode 100644
index 0000000..d10c0e2
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_period.in
@@ -0,0 +1 @@
+0,25
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_period.out b/contrib/netbsd-tests/usr.bin/awk/d_period.out
new file mode 100644
index 0000000..3382aa6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_period.out
@@ -0,0 +1 @@
+0.625
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_string1.awk b/contrib/netbsd-tests/usr.bin/awk/d_string1.awk
new file mode 100644
index 0000000..d690240
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_string1.awk
@@ -0,0 +1,7 @@
+# $NetBSD: d_string1.awk,v 1.1 2012/03/11 18:36:00 jruoho Exp $
+
+BEGIN {
+ print "A\
+B";
+ print "CD"
+}
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_string1.out b/contrib/netbsd-tests/usr.bin/awk/d_string1.out
new file mode 100644
index 0000000..96c017b
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_string1.out
@@ -0,0 +1,2 @@
+AB
+CD
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_tolower.awk b/contrib/netbsd-tests/usr.bin/awk/d_tolower.awk
new file mode 100644
index 0000000..258d181
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_tolower.awk
@@ -0,0 +1,5 @@
+# $NetBSD: d_tolower.awk,v 1.1 2012/03/11 18:36:00 jruoho Exp $
+
+END {
+ print tolower($0);
+}
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_tolower.in b/contrib/netbsd-tests/usr.bin/awk/d_tolower.in
new file mode 100644
index 0000000..66ed03c
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_tolower.in
@@ -0,0 +1 @@
+ABCÆØÅ
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_tolower.out b/contrib/netbsd-tests/usr.bin/awk/d_tolower.out
new file mode 100644
index 0000000..83b2bf5
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_tolower.out
@@ -0,0 +1 @@
+abcæøå
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_toupper.awk b/contrib/netbsd-tests/usr.bin/awk/d_toupper.awk
new file mode 100644
index 0000000..0719aa9
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_toupper.awk
@@ -0,0 +1,5 @@
+# $NetBSD: d_toupper.awk,v 1.1 2012/03/11 18:36:01 jruoho Exp $
+
+END {
+ print toupper($0);
+}
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_toupper.in b/contrib/netbsd-tests/usr.bin/awk/d_toupper.in
new file mode 100644
index 0000000..83b2bf5
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_toupper.in
@@ -0,0 +1 @@
+abcæøå
diff --git a/contrib/netbsd-tests/usr.bin/awk/d_toupper.out b/contrib/netbsd-tests/usr.bin/awk/d_toupper.out
new file mode 100644
index 0000000..66ed03c
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/d_toupper.out
@@ -0,0 +1 @@
+ABCÆØÅ
diff --git a/contrib/netbsd-tests/usr.bin/awk/t_awk.sh b/contrib/netbsd-tests/usr.bin/awk/t_awk.sh
new file mode 100755
index 0000000..77cb5f8
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/awk/t_awk.sh
@@ -0,0 +1,378 @@
+# $NetBSD: t_awk.sh,v 1.5 2012/12/10 20:30:06 christos Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Christos Zoulas
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+awk=awk
+
+h_check()
+{
+ local fname=d_$1
+ for sfx in in out awk; do
+ cp -r $(atf_get_srcdir)/$fname.$sfx .
+ done
+ shift 1
+ atf_check -o file:$fname.out -x "awk $@ -f $fname.awk < $fname.in"
+}
+
+atf_test_case big_regexp
+
+big_regexp_head() {
+ atf_set "descr" "Checks matching long regular expressions (PR/33392)"
+}
+
+big_regexp_body() {
+ h_check big_regexp
+}
+
+atf_test_case end
+
+end_head() {
+ atf_set "descr" "Checks that the last line of the input" \
+ "is available under END pattern (PR/29659)"
+}
+
+end_body() {
+ h_check end1
+ h_check end2
+}
+
+atf_test_case string1
+
+string1_head() {
+ atf_set "descr" "Checks escaping newlines in string literals"
+}
+
+string1_body() {
+ for sfx in out awk; do
+ cp -r $(atf_get_srcdir)/d_string1.$sfx .
+ done
+ atf_check -o file:d_string1.out awk -f d_string1.awk
+}
+
+atf_test_case multibyte
+
+multibyte_head() {
+ atf_set "descr" "Checks multibyte charsets support" \
+ "in tolower and toupper (PR/36394)"
+}
+
+multibyte_body() {
+ export LANG=en_US.UTF-8
+
+ h_check tolower
+ h_check toupper
+}
+
+atf_test_case period
+
+period_head() {
+ atf_set "descr" "Checks that the period character is recognised" \
+ "in awk program regardless of locale (bin/42320)"
+}
+
+period_body() {
+ export LANG=ru_RU.KOI8-R
+
+ h_check period -v x=0.5
+}
+
+atf_test_case assign_NF
+
+assign_NF_head() {
+ atf_set "descr" 'Checks that assign to NF changes $0 and $n (PR/44063)'
+}
+
+assign_NF_body() {
+ h_check assign_NF
+}
+
+atf_test_case single_char_rs
+
+single_char_rs_head() {
+ atf_set "descr" "Test awk(1) with single character RS"
+}
+
+single_char_rs_body() {
+ atf_check \
+ -o "inline:1\n2\n\n3\n\n\n4\n\n" \
+ -x "echo 1a2aa3aaa4 | $awk 1 RS=a"
+}
+
+atf_test_case two_char_rs
+
+two_char_rs_head() {
+ atf_set "descr" "Test awk(1) with two characters RS"
+}
+
+two_char_rs_body() {
+ atf_check \
+ -o "inline:1\n2\n3\n4\n\n" \
+ -x "echo 1ab2ab3ab4 | $awk 1 RS=ab"
+}
+
+atf_test_case single_char_regex_group_rs
+
+single_char_regex_group_rs_head() {
+ atf_set "descr" "Test awk(1) with single character regex group RS"
+}
+
+single_char_regex_group_rs_body() {
+ atf_check \
+ -o "inline:1\n2\n\n3\n\n\n4\n\n" \
+ -x "echo 1a2aa3aaa4 | $awk 1 RS='[a]'"
+}
+
+atf_test_case two_char_regex_group_rs
+
+two_char_regex_group_rs_head() {
+ atf_set "descr" "Test awk(1) with two characters regex group RS"
+}
+
+two_char_regex_group_rs_body() {
+ atf_check \
+ -o "inline:1\n2\n\n3\n\n\n4\n\n" \
+ -x "echo 1a2ab3aba4 | $awk 1 RS='[ab]'"
+}
+
+atf_test_case single_char_regex_star_rs
+
+single_char_regex_star_rs_head() {
+ atf_set "descr" "Test awk(1) with single character regex star RS"
+}
+
+single_char_regex_star_rs_body() {
+ atf_check \
+ -o "inline:1\n2\n3\n4\n\n" \
+ -x "echo 1a2aa3aaa4 | $awk 1 RS='a*'"
+}
+
+atf_test_case two_char_regex_star_rs
+
+two_char_regex_star_rs_head() {
+ atf_set "descr" "Test awk(1) with two characters regex star RS"
+}
+
+two_char_regex_star_rs_body() {
+ atf_check \
+ -o "inline:1\n2\n3\n4\n\n" \
+ -x "echo 1a2aa3aaa4 | $awk 1 RS='aa*'"
+}
+
+atf_test_case regex_two_star_rs
+
+regex_two_star_rs_head() {
+ atf_set "descr" "Test awk(1) with regex two star RS"
+}
+
+regex_two_star_rs_body() {
+ atf_check \
+ -o "inline:1\n2\n3\n4\n\n" \
+ -x "echo 1a2ab3aab4 | $awk 1 RS='aa*b*'"
+}
+
+atf_test_case regex_or_1_rs
+
+regex_or_1_rs_head() {
+ atf_set "descr" "Test awk(1) with regex | case 1 RS"
+}
+
+regex_or_1_rs_body() {
+ atf_check \
+ -o "inline:1a\nc\n\n" \
+ -x "echo 1abc | $awk 1 RS='abcde|b'"
+}
+
+atf_test_case regex_or_2_rs
+
+regex_or_2_rs_head() {
+ atf_set "descr" "Test awk(1) with regex | case 2 RS"
+}
+
+regex_or_2_rs_body() {
+ atf_check \
+ -o "inline:1a\ncdf2\n\n" \
+ -x "echo 1abcdf2 | $awk 1 RS='abcde|b'"
+}
+
+atf_test_case regex_or_3_rs
+
+regex_or_3_rs_head() {
+ atf_set "descr" "Test awk(1) with regex | case 3 RS"
+}
+
+regex_or_3_rs_body() {
+ atf_check \
+ -o "inline:1\n\nf2\n\n" \
+ -x "echo 1abcdebf2 | $awk 1 RS='abcde|b'"
+}
+
+atf_test_case regex_or_4_rs
+
+regex_or_4_rs_head() {
+ atf_set "descr" "Test awk(1) with regex | case 4 RS"
+}
+
+regex_or_4_rs_body() {
+ atf_check \
+ -o "inline:1\nbcdf2\n\n" \
+ -x "echo 1abcdf2 | $awk 1 RS='abcde|a'"
+
+}
+
+atf_test_case regex_caret_1_rs
+
+regex_caret_1_rs_head() {
+ atf_set "descr" "Test awk(1) with regex ^ case 1 RS"
+}
+
+regex_caret_1_rs_body() {
+ atf_check \
+ -o "inline:\n1a2a3a\n\n" \
+ -x "echo a1a2a3a | $awk 1 RS='^a'"
+
+}
+
+atf_test_case regex_caret_2_rs
+
+regex_caret_2_rs_head() {
+ atf_set "descr" "Test awk(1) with regex ^ case 2 RS"
+}
+
+regex_caret_2_rs_body() {
+ atf_check \
+ -o "inline:\naa1a2a\n\n" \
+ -x "echo aaa1a2a | $awk 1 RS='^a'"
+
+}
+
+atf_test_case regex_dollar_1_rs
+
+regex_dollar_1_rs_head() {
+ atf_set "descr" "Test awk(1) with regex $ case 1 RS"
+}
+
+regex_dollar_1_rs_body() {
+ atf_check \
+ -o "inline:a1a2a3a\n\n" \
+ -x "echo a1a2a3a | $awk 1 RS='a$'"
+
+}
+
+atf_test_case regex_dollar_2_rs
+
+regex_dollar_2_rs_head() {
+ atf_set "descr" "Test awk(1) with regex $ case 2 RS"
+}
+
+regex_dollar_2_rs_body() {
+ atf_check \
+ -o "inline:a1a2aaa\n\n" \
+ -x "echo a1a2aaa | $awk 1 RS='a$'"
+
+}
+
+atf_test_case regex_reallocation_rs
+
+regex_reallocation_rs_head() {
+ atf_set "descr" "Test awk(1) with regex reallocation RS"
+}
+
+regex_reallocation_rs_body() {
+ atf_check \
+ -o "inline:a\na\na\na\na\na\na\na\na\na10000\n\n" \
+ -x "jot -s a 10000 | $awk 'NR>1' RS='999[0-9]'"
+
+}
+
+atf_test_case empty_rs
+
+empty_rs_head() {
+ atf_set "descr" "Test awk(1) with empty RS"
+}
+
+empty_rs_body() {
+ atf_check \
+ -o "inline:foo\n" \
+ -x "echo foo | $awk 1 RS=''"
+
+}
+
+atf_test_case newline_rs
+
+newline_rs_head() {
+ atf_set "descr" "Test awk(1) with newline RS"
+}
+
+newline_rs_body() {
+ atf_check \
+ -o "inline:r1f1:r1f2\nr2f1:r2f2\n" \
+ -x "printf '\n\n\nr1f1\nr1f2\n\nr2f1\nr2f2\n\n\n' | $awk '{\$1=\$1}1' RS= OFS=:"
+}
+
+atf_test_case modify_subsep
+
+modify_subsep_head() {
+ atf_set "descr" "Test awk(1) SUPSEP modification (PR/47306)"
+}
+
+modify_subsep_body() {
+ atf_check \
+ -o "inline:1\n1\n1\n" \
+ -x "printf '1\n1 2\n' | \
+ $awk '1{ arr[\$1 SUBSEP \$2 SUBSEP ++cnt[\$1]]=1} {for (f in arr) print arr[f];}'"
+}
+
+atf_init_test_cases() {
+
+ atf_add_test_case big_regexp
+ atf_add_test_case end
+ atf_add_test_case string1
+ atf_add_test_case multibyte
+ atf_add_test_case period
+ atf_add_test_case assign_NF
+
+ atf_add_test_case single_char_rs
+ atf_add_test_case two_char_rs
+ atf_add_test_case single_char_regex_group_rs
+ atf_add_test_case two_char_regex_group_rs
+ atf_add_test_case two_char_regex_star_rs
+ atf_add_test_case single_char_regex_star_rs
+ atf_add_test_case regex_two_star_rs
+ atf_add_test_case regex_or_1_rs
+ atf_add_test_case regex_or_2_rs
+ atf_add_test_case regex_or_3_rs
+ atf_add_test_case regex_caret_1_rs
+ atf_add_test_case regex_caret_2_rs
+ atf_add_test_case regex_dollar_1_rs
+ atf_add_test_case regex_dollar_2_rs
+ atf_add_test_case regex_reallocation_rs
+ atf_add_test_case empty_rs
+ atf_add_test_case newline_rs
+ atf_add_test_case modify_subsep
+}
diff --git a/contrib/netbsd-tests/usr.bin/basename/t_basename.sh b/contrib/netbsd-tests/usr.bin/basename/t_basename.sh
new file mode 100755
index 0000000..d22b7a9
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/basename/t_basename.sh
@@ -0,0 +1,62 @@
+# $NetBSD: t_basename.sh,v 1.1 2012/03/17 16:33:12 jruoho Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head()
+{
+ atf_set "descr" "Checks basic functionality"
+}
+basic_body()
+{
+ atf_check -o inline:"bin\n" basename /usr/bin
+ atf_check -o inline:"usr\n" basename /usr
+ atf_check -o inline:"/\n" basename /
+ atf_check -o inline:"/\n" basename ///
+ atf_check -o inline:"usr\n" basename /usr//
+ atf_check -o inline:"bin\n" basename //usr//bin
+ atf_check -o inline:"usr\n" basename usr
+ atf_check -o inline:"bin\n" basename usr/bin
+}
+
+atf_test_case suffix
+suffix_head()
+{
+ atf_set "descr" "Checks removing of provided suffix"
+}
+suffix_body()
+{
+ atf_check -o inline:"bi\n" basename /usr/bin n
+ atf_check -o inline:"bin\n" basename /usr/bin bin
+ atf_check -o inline:"/\n" basename / /
+ atf_check -o inline:"g\n" basename /usr/bin/gcc cc
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+ atf_add_test_case suffix
+}
diff --git a/contrib/netbsd-tests/usr.bin/bzip2/t_bzip2.sh b/contrib/netbsd-tests/usr.bin/bzip2/t_bzip2.sh
new file mode 100755
index 0000000..447fea9
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/bzip2/t_bzip2.sh
@@ -0,0 +1,52 @@
+# $NetBSD: t_bzip2.sh,v 1.1 2012/03/17 16:33:12 jruoho Exp $
+#
+# Copyright (c) 2008, 2009 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head()
+{
+ atf_set "descr" "Checks basic functionality"
+}
+basic_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/d_sample1.bz2 \
+ bzip2 -1c $(atf_get_srcdir)/d_sample1.ref
+ atf_check -o file:$(atf_get_srcdir)/d_sample2.bz2 \
+ bzip2 -2c $(atf_get_srcdir)/d_sample2.ref
+ atf_check -o file:$(atf_get_srcdir)/d_sample3.bz2 \
+ bzip2 -3c $(atf_get_srcdir)/d_sample3.ref
+ atf_check -o file:$(atf_get_srcdir)/d_sample1.ref \
+ bzip2 -dc $(atf_get_srcdir)/d_sample1.bz2
+ atf_check -o file:$(atf_get_srcdir)/d_sample2.ref \
+ bzip2 -dc $(atf_get_srcdir)/d_sample2.bz2
+ atf_check -o file:$(atf_get_srcdir)/d_sample3.ref \
+ bzip2 -dsc $(atf_get_srcdir)/d_sample3.bz2
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/usr.bin/cc/t_hello.sh b/contrib/netbsd-tests/usr.bin/cc/t_hello.sh
new file mode 100755
index 0000000..9fa1352
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cc/t_hello.sh
@@ -0,0 +1,144 @@
+# $NetBSD: t_hello.sh,v 1.2 2012/07/21 12:30:55 martin Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case hello
+hello_head() {
+ atf_set "descr" "compile and run \"hello world\""
+ atf_set "require.progs" "cc"
+}
+
+atf_test_case hello_pic
+hello_pic_head() {
+ atf_set "descr" "compile and run PIC \"hello world\""
+ atf_set "require.progs" "cc"
+}
+
+atf_test_case hello_pie
+hello_pie_head() {
+ atf_set "descr" "compile and run position independend (PIE) \"hello world\""
+ atf_set "require.progs" "cc"
+}
+
+atf_test_case hello32
+hello32_head() {
+ atf_set "descr" "compile and run \"hello world\" for/in netbsd32 emulation"
+ atf_set "require.progs" "cc file diff cat"
+}
+
+hello_body() {
+ cat > test.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+int main(void) {printf("hello world\n");exit(0);}
+EOF
+ atf_check -s exit:0 -o ignore -e ignore cc -o hello test.c
+ atf_check -s exit:0 -o inline:"hello world\n" ./hello
+}
+
+hello_pic_body() {
+ cat > test.c << EOF
+#include <stdlib.h>
+int main(void) {callpic();exit(0);}
+EOF
+ cat > pic.c << EOF
+#include <stdio.h>
+int callpic(void) {printf("hello world\n");}
+EOF
+
+ atf_check -s exit:0 -o ignore -e ignore \
+ cc -fPIC -dPIC -shared -o libtest.so pic.c
+ atf_check -s exit:0 -o ignore -e ignore \
+ cc -o hello test.c -L. -ltest
+
+ export LD_LIBRARY_PATH=.
+ atf_check -s exit:0 -o inline:"hello world\n" ./hello
+}
+
+hello_pie_body() {
+ # check whether this arch supports -pie
+ if ! cc -pie -dM -E - < /dev/null 2>/dev/null >/dev/null; then
+ atf_skip "cc -pie not supported on this architecture"
+ fi
+ cat > test.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+int main(void) {printf("hello world\n");exit(0);}
+EOF
+ atf_check -s exit:0 -o ignore -e ignore cc -fpie -pie -o hello test.c
+ atf_check -s exit:0 -o inline:"hello world\n" ./hello
+}
+
+hello32_body() {
+ # check whether this arch is 64bit
+ if ! cc -dM -E - < /dev/null | fgrep -q _LP64; then
+ atf_skip "this is not a 64 bit architecture"
+ fi
+ if ! cc -m32 -dM -E - < /dev/null 2>/dev/null > ./def32; then
+ atf_skip "cc -m32 not supported on this architecture"
+ else
+ if fgrep -q _LP64 ./def32; then
+ atf_fail "cc -m32 does not generate netbsd32 binaries"
+ fi
+ fi
+
+ cat > test.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+int main(void) {printf("hello world\n");exit(0);}
+EOF
+ atf_check -s exit:0 -o ignore -e ignore cc -o hello32 -m32 test.c
+ atf_check -s exit:0 -o ignore -e ignore cc -o hello64 test.c
+ file -b ./hello32 > ./ftype32
+ file -b ./hello64 > ./ftype64
+ if diff ./ftype32 ./ftype64 >/dev/null; then
+ atf_fail "generated binaries do not differ"
+ fi
+ echo "32bit binaries on this platform are:"
+ cat ./ftype32
+ echo "While native (64bit) binaries are:"
+ cat ./ftype64
+ atf_check -s exit:0 -o inline:"hello world\n" ./hello32
+
+ # do another test with static 32bit binaries
+ cat > test.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+int main(void) {printf("hello static world\n");exit(0);}
+EOF
+ atf_check -s exit:0 -o ignore -e ignore cc -o hello -m32 \
+ -static test.c
+ atf_check -s exit:0 -o inline:"hello static world\n" ./hello
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case hello
+ atf_add_test_case hello_pic
+ atf_add_test_case hello_pie
+ atf_add_test_case hello32
+}
diff --git a/contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh b/contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh
new file mode 100755
index 0000000..341047f
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh
@@ -0,0 +1,67 @@
+# $NetBSD: t_cmp.sh,v 1.1 2012/03/19 07:05:18 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case missing
+missing_head() {
+ atf_set "descr" "Test that cmp(1) with '-s' is silent " \
+ "when files are missing (PR bin/2642)"
+}
+
+missing_body() {
+
+ echo a > a
+
+ atf_check -s not-exit:0 -o empty -e empty -x "cmp -s a x"
+ atf_check -s not-exit:0 -o empty -e empty -x "cmp -s x a"
+ atf_check -s not-exit:0 -o empty -e empty -x "cmp -s x y"
+ atf_check -s not-exit:0 -o empty -e empty -x "cmp -s y x"
+}
+
+atf_test_case skip
+skip_head() {
+ atf_set "descr" "Test that cmp(1) handles skip " \
+ "parameters correctly (PR bin/23836)"
+}
+
+skip_body() {
+
+ echo 0123456789abcdef > a
+ echo abcdef > b
+
+ atf_check -s exit:0 -o empty -e empty -x "cmp a b '10'"
+ atf_check -s exit:0 -o empty -e empty -x "cmp a b '0xa'"
+ atf_check -s exit:1 -o not-empty -e empty -x "cmp a b '9'"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case missing
+ atf_add_test_case skip
+}
diff --git a/contrib/netbsd-tests/usr.bin/config/d_deffs_redef b/contrib/netbsd-tests/usr.bin/config/d_deffs_redef
new file mode 100644
index 0000000..d84d1f7
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/d_deffs_redef
@@ -0,0 +1,10 @@
+include "arch/regress/conf/std.regress"
+maxusers 4
+file-system REGRESSFS
+
+master0 at root
+
+defflag NOT_A_FS
+deffs NOT_A_FS
+
+config regress root on ?
diff --git a/contrib/netbsd-tests/usr.bin/config/d_loop b/contrib/netbsd-tests/usr.bin/config/d_loop
new file mode 100644
index 0000000..674a209
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/d_loop
@@ -0,0 +1,23 @@
+include "arch/regress/conf/std.regress"
+maxusers 4
+file-system REGRESSFS
+
+master0 at root
+
+# The following definitions build a loop of 'looper' devices.
+# This tests how well the code that look for orphans handle loops.
+#
+# In that case, while the loopchild devices will always be seen in
+# time, the code has to make sure it reaches all the loopbaby
+# devices.
+
+looper0 at master0
+looper1 at looper0
+
+loopchild0 at looper0
+loopchild1 at looper1
+
+loopbaby0 at loopchild0
+loopbaby1 at loopchild1
+
+config regress root on ?
diff --git a/contrib/netbsd-tests/usr.bin/config/d_loop2 b/contrib/netbsd-tests/usr.bin/config/d_loop2
new file mode 100644
index 0000000..8e7238d
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/d_loop2
@@ -0,0 +1,16 @@
+include "arch/regress/conf/std.regress"
+maxusers 4
+file-system REGRESSFS
+
+master0 at root
+
+# Devices that are their own parent must be handled properly
+# when the instance is negated.
+
+looper* at master0
+looper* at looper?
+looper1 at looper0
+
+no looper* at looper?
+
+config regress root on ?
diff --git a/contrib/netbsd-tests/usr.bin/config/d_no_pseudo b/contrib/netbsd-tests/usr.bin/config/d_no_pseudo
new file mode 100644
index 0000000..9ee8564
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/d_no_pseudo
@@ -0,0 +1,14 @@
+include "arch/regress/conf/std.regress"
+
+maxusers 4
+
+file-system REGRESSFS
+
+master0 at root
+
+# Simply negating a pseudo-device should yield an error.
+
+pseudo-device pseudodev
+no pseudodev
+
+config regress root on ?
diff --git a/contrib/netbsd-tests/usr.bin/config/d_postponed_orphan b/contrib/netbsd-tests/usr.bin/config/d_postponed_orphan
new file mode 100644
index 0000000..bb5ec04
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/d_postponed_orphan
@@ -0,0 +1,21 @@
+include "arch/regress/conf/std.regress"
+
+maxusers 4
+
+file-system REGRESSFS
+
+master0 at root
+
+parenti* at master?
+
+# Here, parenti is negated before the child* instance is declared. That
+# means the child* instance does not qualify as an explicit orphan and
+# therefore should _not_ be ignored.
+#
+# config(1) should error out on that config file.
+
+no parenti
+
+child* at parenti?
+
+config regress root on ?
diff --git a/contrib/netbsd-tests/usr.bin/config/d_pseudo_parent b/contrib/netbsd-tests/usr.bin/config/d_pseudo_parent
new file mode 100644
index 0000000..aebad8b
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/d_pseudo_parent
@@ -0,0 +1,13 @@
+include "arch/regress/conf/std.regress"
+maxusers 4
+file-system REGRESSFS
+
+# Pseudo-devices can have children on interface attributes,
+# which means they don't necessarily have to explicitly
+# define locators (see pseudodev definition).
+
+pseudo-device pseudodev
+
+child* at pseudodev?
+
+config regress root on ?
diff --git a/contrib/netbsd-tests/usr.bin/config/d_shadow_instance b/contrib/netbsd-tests/usr.bin/config/d_shadow_instance
new file mode 100644
index 0000000..6022821
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/d_shadow_instance
@@ -0,0 +1,25 @@
+include "arch/regress/conf/std.regress"
+
+maxusers 4
+
+file-system REGRESSFS
+
+master0 at root
+
+parenti* at master?
+parentii* at master?
+
+# The second child* instance (attaching at parentii) is useless: it will be
+# shadowed by the first one, which is semantically the same, from a parentii
+# device's point of view.
+#
+# The two child* instances are aliases, and at some point the orphan-checking
+# code skipped some aliases, in the shadowing situation and some others.
+#
+# This test should pass, the lines are valid, even though the second one is
+# useless.
+
+child* at hook?
+child* at parentii?
+
+config regress root on ?
diff --git a/contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/files.regress b/contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/files.regress
new file mode 100644
index 0000000..e9488d6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/files.regress
@@ -0,0 +1,2 @@
+maxpartitions 8
+maxusers 2 4 8
diff --git a/contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/std.regress b/contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/std.regress
new file mode 100644
index 0000000..f92baaf
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/std.regress
@@ -0,0 +1 @@
+machine regress
diff --git a/contrib/netbsd-tests/usr.bin/config/support/conf/files b/contrib/netbsd-tests/usr.bin/config/support/conf/files
new file mode 100644
index 0000000..d525782
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/support/conf/files
@@ -0,0 +1,26 @@
+deffs REGRESSFS
+
+device master { }
+attach master at root
+
+define hook { }
+
+device parentii: hook
+attach parentii at master
+device parenti: hook
+attach parenti at master
+
+device child
+attach child at hook
+
+device looper { }
+attach looper at master with looper_master
+attach looper at looper with looper_looper
+
+device loopchild { }
+attach loopchild at looper
+
+device loopbaby
+attach loopbaby at loopchild
+
+defpseudo pseudodev: hook
diff --git a/contrib/netbsd-tests/usr.bin/config/t_config.sh b/contrib/netbsd-tests/usr.bin/config/t_config.sh
new file mode 100755
index 0000000..9f97b5e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/config/t_config.sh
@@ -0,0 +1,91 @@
+# $NetBSD: t_config.sh,v 1.1 2012/03/17 16:33:12 jruoho Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+
+run_and_check_pass()
+{
+ local name="${1}"; shift
+
+ mkdir compile
+ supportdir="$(atf_get_srcdir)/support"
+ config="$(atf_get_srcdir)/d_${name}"
+
+ atf_check -o ignore \
+ config -s "${supportdir}" -b "compile/${name}" "${config}"
+}
+
+run_and_check_fail()
+{
+ local name="${1}"; shift
+
+ mkdir compile
+ supportdir="$(atf_get_srcdir)/support"
+ config="$(atf_get_srcdir)/d_${name}"
+
+ atf_check -o ignore -e ignore -s ne:0 \
+ config -s "${supportdir}" -b "compile/${name}" "${config}"
+}
+
+# Defines a test case for config(1).
+test_case()
+{
+ local name="${1}"; shift
+ local type="${1}"; shift
+ local descr="${*}"
+
+ atf_test_case "${name}"
+ eval "${name}_head() { \
+ atf_set descr \"${descr}\"; \
+ atf_set require.progs \"config\"; \
+ }"
+ eval "${name}_body() { \
+ run_and_check_${type} '${name}'; \
+ }"
+}
+
+test_case shadow_instance pass "Checks correct handling of shadowed instances"
+test_case loop pass "Checks correct handling of loops"
+test_case loop2 pass "Checks correct handling of devices that can be their" \
+ "own parents"
+test_case pseudo_parent pass "Checks correct handling of children of pseudo" \
+ "devices (PR/32329)"
+test_case postponed_orphan fail "Checks that config catches adding an" \
+ "instance of a child of a negated instance as error"
+test_case no_pseudo fail "Checks that config catches ommited 'pseudo-device'" \
+ "as error (PR/34111)"
+test_case deffs_redef fail "Checks that config doesn't allow a deffs to use" \
+ "the same name as a previous defflag/defparam"
+
+atf_init_test_cases()
+{
+ atf_add_test_case shadow_instance
+ atf_add_test_case loop
+ atf_add_test_case loop2
+ atf_add_test_case pseudo_parent
+ atf_add_test_case postponed_orphan
+ atf_add_test_case no_pseudo
+ atf_add_test_case deffs_redef
+}
diff --git a/contrib/netbsd-tests/usr.bin/cut/d_basic.out b/contrib/netbsd-tests/usr.bin/cut/d_basic.out
new file mode 100644
index 0000000..f704cdf
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cut/d_basic.out
@@ -0,0 +1,88 @@
+----- test: cut -f 1 d_cut.in -----
+1
+
+12
+
+qwe
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
+----- test: cut -f 2 d_cut.in -----
+1
+
+34
+12
+
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
+----- test: cut -f 3 d_cut.in -----
+1
+
+56
+
+rty
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
+----- test: cut -f 1-2 d_cut.in -----
+1
+
+12 34
+ 12
+qwe
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
+----- test: cut -f 2,3 d_cut.in -----
+1
+
+34 56
+12
+ rty
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
+----- test: cut -f 4 d_cut.in -----
+1
+
+
+34
+uio
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
+----- test: cut -f 1-3,4-7 d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
+----- test: cut -f 1,2-7 d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
diff --git a/contrib/netbsd-tests/usr.bin/cut/d_cut.in b/contrib/netbsd-tests/usr.bin/cut/d_cut.in
new file mode 100644
index 0000000..85b4184
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cut/d_cut.in
@@ -0,0 +1,10 @@
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl:zxc:vbn:nm
+:qwe:::rty:uio::p[]:asd:fgh:jkl:zxc:vbn:nm
diff --git a/contrib/netbsd-tests/usr.bin/cut/d_dflag.out b/contrib/netbsd-tests/usr.bin/cut/d_dflag.out
new file mode 100644
index 0000000..63b814f
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cut/d_dflag.out
@@ -0,0 +1,88 @@
+----- test: cut -f 1 -d : d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+12
+qwe
+
+----- test: cut -f 2 -d : d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+34
+rty
+qwe
+----- test: cut -f 3 -d : d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+56
+uio
+
+----- test: cut -f 1-2 -d : d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+12:34
+qwe:rty
+:qwe
+----- test: cut -f 2,3 -d : d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+34:56
+rty:uio
+qwe:
+----- test: cut -f 4 -d : d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+
+p[]
+
+----- test: cut -f 1-3,4-7 -d : d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl
+:qwe:::rty:uio:
+----- test: cut -f 1,2-7 -d : d_cut.in -----
+1
+
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd fgh jkl zxc vbn nm
+1
+
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl
+:qwe:::rty:uio:
diff --git a/contrib/netbsd-tests/usr.bin/cut/d_dsflag.out b/contrib/netbsd-tests/usr.bin/cut/d_dsflag.out
new file mode 100644
index 0000000..e3d1beb
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cut/d_dsflag.out
@@ -0,0 +1,32 @@
+----- test: cut -f 1 -d : -s d_cut.in -----
+12
+qwe
+
+----- test: cut -f 2 -d : -s d_cut.in -----
+34
+rty
+qwe
+----- test: cut -f 3 -d : -s d_cut.in -----
+56
+uio
+
+----- test: cut -f 1-2 -d : -s d_cut.in -----
+12:34
+qwe:rty
+:qwe
+----- test: cut -f 2,3 -d : -s d_cut.in -----
+34:56
+rty:uio
+qwe:
+----- test: cut -f 4 -d : -s d_cut.in -----
+
+p[]
+
+----- test: cut -f 1-3,4-7 -d : -s d_cut.in -----
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl
+:qwe:::rty:uio:
+----- test: cut -f 1,2-7 -d : -s d_cut.in -----
+12:34:56
+qwe:rty:uio:p[]:asd:fgh:jkl
+:qwe:::rty:uio:
diff --git a/contrib/netbsd-tests/usr.bin/cut/d_latin1.in b/contrib/netbsd-tests/usr.bin/cut/d_latin1.in
new file mode 100644
index 0000000..00255b1
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cut/d_latin1.in
@@ -0,0 +1,4 @@
+fooÄ:bar:Äbaz
+FooÄ:Bar:ÄBaz
+FOoÄ:BAr:ÄBAz
+FOOÄ:BAR:ÄBAZ
diff --git a/contrib/netbsd-tests/usr.bin/cut/d_sflag.out b/contrib/netbsd-tests/usr.bin/cut/d_sflag.out
new file mode 100644
index 0000000..88c2b3e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cut/d_sflag.out
@@ -0,0 +1,32 @@
+----- test: cut -f 1 -s d_cut.in -----
+12
+
+qwe
+----- test: cut -f 2 -s d_cut.in -----
+34
+12
+
+----- test: cut -f 3 -s d_cut.in -----
+56
+
+rty
+----- test: cut -f 1-2 -s d_cut.in -----
+12 34
+ 12
+qwe
+----- test: cut -f 2,3 -s d_cut.in -----
+34 56
+12
+ rty
+----- test: cut -f 4 -s d_cut.in -----
+
+34
+uio
+----- test: cut -f 1-3,4-7 -s d_cut.in -----
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd
+----- test: cut -f 1,2-7 -s d_cut.in -----
+12 34 56
+ 12 34 56
+qwe rty uio p[] asd
diff --git a/contrib/netbsd-tests/usr.bin/cut/d_utf8.in b/contrib/netbsd-tests/usr.bin/cut/d_utf8.in
new file mode 100644
index 0000000..320a063
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cut/d_utf8.in
@@ -0,0 +1,4 @@
+fooÄ:bar:Äbaz
+FooÄ:Bar:ÄBaz
+FOoÄ:BAr:ÄBAz
+FOOÄ:BAR:ÄBAZ
diff --git a/contrib/netbsd-tests/usr.bin/cut/t_cut.sh b/contrib/netbsd-tests/usr.bin/cut/t_cut.sh
new file mode 100755
index 0000000..3c3793f
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/cut/t_cut.sh
@@ -0,0 +1,130 @@
+# $NetBSD: t_cut.sh,v 1.1 2012/03/17 16:33:13 jruoho Exp $
+#
+# Copyright (c) 2008, 2009 The NetBSD Foundation, 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 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.
+#
+
+h_run()
+{
+ file="${1}"; shift
+ opts="${*}"
+
+ for fields in 1 2 3 1-2 2,3 4 1-3,4-7 1,2-7
+ do
+ opts="-f ${fields} $@"
+ echo "----- test: cut ${opts} $(basename $file) -----"
+ cut $opts "$file" || atf_fail "command failed: cut ${opts} $file"
+ done
+}
+
+h_check()
+{
+ diff -Nru "$1" "$2" || atf_fail "files $1 and $2 differ"
+}
+
+atf_test_case basic
+basic_head()
+{
+ atf_set "descr" "Checks basic functionality"
+}
+basic_body()
+{
+ h_run "$(atf_get_srcdir)/d_cut.in" > out
+ h_check out "$(atf_get_srcdir)/d_basic.out"
+}
+
+atf_test_case sflag
+sflag_head()
+{
+ atf_set "descr" "Checks -s flag"
+}
+sflag_body()
+{
+ h_run "$(atf_get_srcdir)/d_cut.in" -s > out
+ h_check out "$(atf_get_srcdir)/d_sflag.out"
+}
+
+atf_test_case dflag
+dflag_head()
+{
+ atf_set "descr" "Checks -d flag"
+}
+dflag_body()
+{
+ h_run "$(atf_get_srcdir)/d_cut.in" -d ":" > out
+ h_check out "$(atf_get_srcdir)/d_dflag.out"
+}
+
+atf_test_case dsflag
+dsflag_head()
+{
+ atf_set "descr" "Checks -s and -d flags combined"
+}
+dsflag_body()
+{
+ h_run "$(atf_get_srcdir)/d_cut.in" -d ":" -s > out
+ h_check out "$(atf_get_srcdir)/d_dsflag.out"
+}
+
+atf_test_case latin1
+latin1_head()
+{
+ atf_set "descr" "Checks support for non-ascii characters"
+}
+latin1_body()
+{
+ export LC_ALL=C
+
+ atf_check -o inline:"bar\nBar\nBAr\nBAR\n" \
+ cut -b 6,7,8 "$(atf_get_srcdir)/d_latin1.in"
+
+ atf_check -o inline:"bar\nBar\nBAr\nBAR\n" \
+ cut -c 6,7,8 "$(atf_get_srcdir)/d_latin1.in"
+}
+
+atf_test_case utf8
+utf8_head()
+{
+ atf_set "descr" "Checks support for multibyte characters"
+}
+utf8_body()
+{
+ export LC_ALL=en_US.UTF-8
+
+ atf_check -o inline:":ba\n:Ba\n:BA\n:BA\n" \
+ cut -b 6,7,8 "$(atf_get_srcdir)/d_utf8.in"
+
+ atf_check -o inline:"bar\nBar\nBAr\nBAR\n" \
+ cut -c 6,7,8 "$(atf_get_srcdir)/d_utf8.in"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+ atf_add_test_case sflag
+ atf_add_test_case dflag
+ atf_add_test_case dsflag
+ atf_add_test_case latin1
+ atf_add_test_case utf8
+}
diff --git a/contrib/netbsd-tests/usr.bin/diff/d_mallocv1.in b/contrib/netbsd-tests/usr.bin/diff/d_mallocv1.in
new file mode 100644
index 0000000..27ab503
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/diff/d_mallocv1.in
@@ -0,0 +1,5 @@
+18086b1e91f730facb2d6e1b
+c562653b24814eb3651b1e68301a3c14b96302bb
+6d017f7aef74662ed8dd51eef14281eaad223298db370bfaca
+30c04231cb3de404e4b8a5359a74066fd963291d7986be835834ab07870c097682a953bfff38784780eef844de47fb36c34f8e034c96cfa64d9cb5decee472138236e9fb79e9fe1fba6b7757b970f22477d167832206900473f09f3e8c822db6d9a8273340ed6743d99638d6cf192d821b6f33d23278b1a929f303a80865c426d01add11b2f2416babd13e70b44d8eeb731c09c7163af9d1a23cbe20ddb08b0f67ecaa2eed511263a67e9c12e59ef113f0b9e4e4e140b43896078a7571c61826ba099b3dd8c4b096a9785b4434e97ea99e662ba6fdb60a41547ccae4c67d3e1f3ef515198e91f009c75c9e80fda90d13ee29d8aad5d87cc2437ce60e6ce55700837fb0815bfd2495f8aa1a33fe67c1ae28a885506a78ca6257f5a5f2a8042e28680acc83b1aecb3a9cb51911126f2f0deaf14fcfa5f165e9a5c3f8f2d1c3f4683b2d75927a7bc802d63b680a5e22768cc0439854ccd49e58a002794f541bddd6ef6fbd4f9869843a72d0ae9d438c90353a46c0c9863a16b1de206c717ab7ce6ea6f648a38efa12b70bbe3388b35adec7a789ea98de217520d7d6ce699841e17e5946bf5a8b3c7a2c3e2d6767422baf3159ff08d913ec78011ab7d34bc24af26c24a8d46f7261c7705a7b270e27590c29583c659a0df8dada4e7a0532f115040165d18f74a55a4f39bb1dcfd865e94a
+ 488ca910cc447e121b2a19450239e75d24
diff --git a/contrib/netbsd-tests/usr.bin/diff/d_mallocv2.in b/contrib/netbsd-tests/usr.bin/diff/d_mallocv2.in
new file mode 100644
index 0000000..27ab503
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/diff/d_mallocv2.in
@@ -0,0 +1,5 @@
+18086b1e91f730facb2d6e1b
+c562653b24814eb3651b1e68301a3c14b96302bb
+6d017f7aef74662ed8dd51eef14281eaad223298db370bfaca
+30c04231cb3de404e4b8a5359a74066fd963291d7986be835834ab07870c097682a953bfff38784780eef844de47fb36c34f8e034c96cfa64d9cb5decee472138236e9fb79e9fe1fba6b7757b970f22477d167832206900473f09f3e8c822db6d9a8273340ed6743d99638d6cf192d821b6f33d23278b1a929f303a80865c426d01add11b2f2416babd13e70b44d8eeb731c09c7163af9d1a23cbe20ddb08b0f67ecaa2eed511263a67e9c12e59ef113f0b9e4e4e140b43896078a7571c61826ba099b3dd8c4b096a9785b4434e97ea99e662ba6fdb60a41547ccae4c67d3e1f3ef515198e91f009c75c9e80fda90d13ee29d8aad5d87cc2437ce60e6ce55700837fb0815bfd2495f8aa1a33fe67c1ae28a885506a78ca6257f5a5f2a8042e28680acc83b1aecb3a9cb51911126f2f0deaf14fcfa5f165e9a5c3f8f2d1c3f4683b2d75927a7bc802d63b680a5e22768cc0439854ccd49e58a002794f541bddd6ef6fbd4f9869843a72d0ae9d438c90353a46c0c9863a16b1de206c717ab7ce6ea6f648a38efa12b70bbe3388b35adec7a789ea98de217520d7d6ce699841e17e5946bf5a8b3c7a2c3e2d6767422baf3159ff08d913ec78011ab7d34bc24af26c24a8d46f7261c7705a7b270e27590c29583c659a0df8dada4e7a0532f115040165d18f74a55a4f39bb1dcfd865e94a
+ 488ca910cc447e121b2a19450239e75d24
diff --git a/contrib/netbsd-tests/usr.bin/diff/t_diff.sh b/contrib/netbsd-tests/usr.bin/diff/t_diff.sh
new file mode 100755
index 0000000..e33edee
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/diff/t_diff.sh
@@ -0,0 +1,75 @@
+# $NetBSD: t_diff.sh,v 1.3 2012/03/13 05:40:00 jruoho Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case mallocv
+mallocv_head() {
+ atf_set "descr" "Test diff(1) with MALLOC_OPTIONS=V (cf. PR bin/26453)"
+}
+
+mallocv_body() {
+
+ atf_check -s ignore \
+ -e not-inline:"diff: memory exhausted\n" \
+ -x "env MALLOC_OPTIONS=V diff " \
+ "$(atf_get_srcdir)/d_mallocv1.in" \
+ "$(atf_get_srcdir)/d_mallocv2.in"
+}
+
+atf_test_case nomallocv
+nomallocv_head() {
+ atf_set "descr" "Test diff(1) with no MALLOC_OPTIONS=V"
+}
+
+nomallocv_body() {
+
+ atf_check -s exit:0 \
+ -e inline:"" \
+ -x "diff " \
+ "$(atf_get_srcdir)/d_mallocv1.in" \
+ "$(atf_get_srcdir)/d_mallocv2.in"
+}
+
+atf_test_case same
+same_head() {
+ atf_set "descr" "Test diff(1) with identical files"
+}
+
+same_body() {
+
+ atf_check -s exit:0 \
+ -e inline:"" \
+ -x "diff $(atf_get_srcdir)/t_diff $(atf_get_srcdir)/t_diff"
+}
+
+atf_init_test_cases() {
+ atf_add_test_case mallocv
+ atf_add_test_case nomallocv
+ atf_add_test_case same
+}
diff --git a/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh b/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh
new file mode 100755
index 0000000..a393524
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh
@@ -0,0 +1,49 @@
+# $NetBSD: t_dirname.sh,v 1.1 2012/03/17 16:33:13 jruoho Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head()
+{
+ atf_set "descr" "Checks basic functionality"
+}
+basic_body()
+{
+ atf_check -o inline:"/\n" dirname /
+ atf_check -o inline:"/\n" dirname //
+ atf_check -o inline:"/usr\n" dirname /usr/bin/
+ atf_check -o inline:"//usr\n" dirname //usr//bin//
+ atf_check -o inline:".\n" dirname usr
+ atf_check -o inline:".\n" dirname ""
+ atf_check -o inline:"/\n" dirname /usr
+ atf_check -o inline:"/usr\n" dirname /usr/bin
+ atf_check -o inline:"usr\n" dirname usr/bin
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/usr.bin/find/t_find.sh b/contrib/netbsd-tests/usr.bin/find/t_find.sh
new file mode 100755
index 0000000..b30de5e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/find/t_find.sh
@@ -0,0 +1,73 @@
+# $NetBSD: t_find.sh,v 1.6 2012/03/19 12:58:41 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case emptyperm
+emptyperm_head() {
+ atf_set "descr" "Test that 'find -empty' does not error out " \
+ "when directory access is denied (PR bin/44179)"
+ atf_set "require.user" "unprivileged"
+}
+
+emptyperm_body() {
+
+ # The case assumes that at least some directories
+ # in /var are unavailable for the user '_tests'.
+ #
+ # TODO: Parse the output.file for actual verification.
+ #
+ atf_check -s exit:1 -o save:output.file \
+ -e not-empty -x "find /var -empty -type d"
+}
+
+atf_test_case exit
+exit_head() {
+ atf_set "descr" "Test that find(1) with -exit works (PR bin/44973)"
+}
+
+exit_body() {
+ atf_check -o ignore \
+ -s exit:0 -x "find /etc -type f -exit"
+}
+
+atf_test_case exit_status
+exit_status_head() {
+ atf_set "descr" "Test exit status from 'find -exit'"
+}
+
+exit_status_body() {
+ num=$(jot -r 1 0 99)
+ atf_check -o ignore -e ignore -s exit:$num -x "find / -exit $num"
+}
+
+atf_init_test_cases() {
+ atf_add_test_case emptyperm
+ atf_add_test_case exit
+ atf_add_test_case exit_status
+}
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_basic.out b/contrib/netbsd-tests/usr.bin/grep/d_basic.out
new file mode 100644
index 0000000..ccefccb
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_basic.out
@@ -0,0 +1,20 @@
+123
+1123
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+2123
+3123
+4123
+5123
+6123
+7123
+8123
+9123
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_begin_end_a.out b/contrib/netbsd-tests/usr.bin/grep/d_begin_end_a.out
new file mode 100644
index 0000000..3288aec
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_begin_end_a.out
@@ -0,0 +1 @@
+Front of the line
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_begin_end_b.out b/contrib/netbsd-tests/usr.bin/grep/d_begin_end_b.out
new file mode 100644
index 0000000..dd09e02
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_begin_end_b.out
@@ -0,0 +1 @@
+This is a another line with a Front and an ending
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_binary.out b/contrib/netbsd-tests/usr.bin/grep/d_binary.out
new file mode 100644
index 0000000..ce03056
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_binary.out
@@ -0,0 +1 @@
+Binary file /bin/sh matches
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context2_a.out b/contrib/netbsd-tests/usr.bin/grep/d_context2_a.out
new file mode 100644
index 0000000..384d280
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context2_a.out
Binary files differ
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context2_b.out b/contrib/netbsd-tests/usr.bin/grep/d_context2_b.out
new file mode 100644
index 0000000..c1d1222
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context2_b.out
Binary files differ
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context2_c.out b/contrib/netbsd-tests/usr.bin/grep/d_context2_c.out
new file mode 100644
index 0000000..1692c2a
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context2_c.out
Binary files differ
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context_a.in b/contrib/netbsd-tests/usr.bin/grep/d_context_a.in
new file mode 100644
index 0000000..670e4ce
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context_a.in
@@ -0,0 +1,10 @@
+A pig is a jolly companion,
+Boar, sow, barrow, or gilt --
+A pig is a pal, who'll boost your morale,
+Though mountains may topple and tilt.
+When they've blackballed, bamboozled, and burned you,
+When they've turned on you, Tory and Whig,
+Though you may be thrown over by Tabby and Rover,
+You'll never go wrong with a pig, a pig,
+You'll never go wrong with a pig!
+ -- Thomas Pynchon, "Gravity's Rainbow"
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context_a.out b/contrib/netbsd-tests/usr.bin/grep/d_context_a.out
new file mode 100644
index 0000000..5788aa5
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context_a.out
@@ -0,0 +1,5 @@
+A pig is a pal, who'll boost your morale,
+Though mountains may topple and tilt.
+When they've blackballed, bamboozled, and burned you,
+When they've turned on you, Tory and Whig,
+Though you may be thrown over by Tabby and Rover,
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context_b.in b/contrib/netbsd-tests/usr.bin/grep/d_context_b.in
new file mode 100644
index 0000000..663c992
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context_b.in
@@ -0,0 +1,3 @@
+This is to test output of context from multiple files.
+Dave was a happy pig who wandered around the orchard eating
+apples all day long.
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context_b.out b/contrib/netbsd-tests/usr.bin/grep/d_context_b.out
new file mode 100644
index 0000000..aa18352
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context_b.out
@@ -0,0 +1,4 @@
+Though mountains may topple and tilt.
+When they've blackballed, bamboozled, and burned you,
+When they've turned on you, Tory and Whig,
+Though you may be thrown over by Tabby and Rover,
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context_c.out b/contrib/netbsd-tests/usr.bin/grep/d_context_c.out
new file mode 100644
index 0000000..f91b712
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context_c.out
@@ -0,0 +1,5 @@
+Boar, sow, barrow, or gilt --
+A pig is a pal, who'll boost your morale,
+Though mountains may topple and tilt.
+When they've blackballed, bamboozled, and burned you,
+When they've turned on you, Tory and Whig,
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_context_d.out b/contrib/netbsd-tests/usr.bin/grep/d_context_d.out
new file mode 100644
index 0000000..225df69
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_context_d.out
@@ -0,0 +1,13 @@
+d_context_a.in:A pig is a jolly companion,
+d_context_a.in-Boar, sow, barrow, or gilt --
+d_context_a.in:A pig is a pal, who'll boost your morale,
+d_context_a.in-Though mountains may topple and tilt.
+--
+d_context_a.in-Though you may be thrown over by Tabby and Rover,
+d_context_a.in:You'll never go wrong with a pig, a pig,
+d_context_a.in:You'll never go wrong with a pig!
+d_context_a.in- -- Thomas Pynchon, "Gravity's Rainbow"
+--
+d_context_b.in-This is to test output of context from multiple files.
+d_context_b.in:Dave was a happy pig who wandered around the orchard eating
+d_context_b.in-apples all day long.
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_egrep.out b/contrib/netbsd-tests/usr.bin/grep/d_egrep.out
new file mode 100644
index 0000000..2cc0277
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_egrep.out
@@ -0,0 +1 @@
+Special characters [, $, ^, *
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_file_exp.in b/contrib/netbsd-tests/usr.bin/grep/d_file_exp.in
new file mode 100644
index 0000000..9faee93
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_file_exp.in
@@ -0,0 +1,2 @@
+-0.[24]0
+0.[35]0
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_file_exp.out b/contrib/netbsd-tests/usr.bin/grep/d_file_exp.out
new file mode 100644
index 0000000..7d97522
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_file_exp.out
@@ -0,0 +1,6 @@
+-0.50
+-0.40
+-0.30
+-0.20
+0.30
+0.50
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_ignore_case.out b/contrib/netbsd-tests/usr.bin/grep/d_ignore_case.out
new file mode 100644
index 0000000..c14d8dd
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_ignore_case.out
@@ -0,0 +1,2 @@
+Mostly I prefer lower case to upper case,
+but UpPeR cAsE has its merits too.
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_input b/contrib/netbsd-tests/usr.bin/grep/d_input
new file mode 100644
index 0000000..5e38c39
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_input
@@ -0,0 +1,12 @@
+dot.separated@words
+kkseparatedkk
+Front of the line
+This is a another line with a Front and an ending
+Special characters [, $, ^, *
+Here is another ending.
+
+Mostly I prefer lower case to upper case,
+but UpPeR cAsE has its merits too.
+
+matchme
+
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_invert.in b/contrib/netbsd-tests/usr.bin/grep/d_invert.in
new file mode 100644
index 0000000..631cf83
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_invert.in
@@ -0,0 +1,10 @@
+
+fish
+fish
+dog
+cat
+fish
+fish
+
+poodle
+fish
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_invert.out b/contrib/netbsd-tests/usr.bin/grep/d_invert.out
new file mode 100644
index 0000000..7d7c54a
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_invert.out
@@ -0,0 +1,5 @@
+
+dog
+cat
+
+poodle
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_recurse.out b/contrib/netbsd-tests/usr.bin/grep/d_recurse.out
new file mode 100644
index 0000000..0ba61c8
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_recurse.out
@@ -0,0 +1,2 @@
+recurse/a/f/favourite-fish:haddock
+recurse/d/fish:haddock
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_recurse_symlink.err b/contrib/netbsd-tests/usr.bin/grep/d_recurse_symlink.err
new file mode 100644
index 0000000..b4bff98
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_recurse_symlink.err
@@ -0,0 +1 @@
+grep: warning: test/c/d/d: recursive directory loop
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_recurse_symlink.out b/contrib/netbsd-tests/usr.bin/grep/d_recurse_symlink.out
new file mode 100644
index 0000000..2849239
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_recurse_symlink.out
@@ -0,0 +1 @@
+test/c/match:Test string
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_whole_line.out b/contrib/netbsd-tests/usr.bin/grep/d_whole_line.out
new file mode 100644
index 0000000..16febeb
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_whole_line.out
@@ -0,0 +1 @@
+matchme
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_word_regexps.out b/contrib/netbsd-tests/usr.bin/grep/d_word_regexps.out
new file mode 100644
index 0000000..e6c4af4
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_word_regexps.out
@@ -0,0 +1 @@
+dot.separated@words
diff --git a/contrib/netbsd-tests/usr.bin/grep/d_zgrep.out b/contrib/netbsd-tests/usr.bin/grep/d_zgrep.out
new file mode 100644
index 0000000..c5fe9b8
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/d_zgrep.out
@@ -0,0 +1,2 @@
+Front of the line
+This is a another line with a Front and an ending
diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
new file mode 100755
index 0000000..f2d70f0
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
@@ -0,0 +1,246 @@
+# $NetBSD: t_grep.sh,v 1.2 2013/05/17 15:39:17 christos Exp $
+#
+# Copyright (c) 2008, 2009 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head()
+{
+ atf_set "descr" "Checks basic functionality"
+}
+basic_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_basic.out" -x \
+ 'jot 10000 | grep 123'
+}
+
+atf_test_case binary
+binary_head()
+{
+ atf_set "descr" "Checks handling of binary files"
+}
+binary_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh
+}
+
+atf_test_case recurse
+recurse_head()
+{
+ atf_set "descr" "Checks recursive searching"
+}
+recurse_body()
+{
+ mkdir -p recurse/a/f recurse/d
+ echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish
+ echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish
+
+ atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse
+}
+
+atf_test_case recurse_symlink
+recurse_symlink_head()
+{
+ atf_set "descr" "Checks symbolic link recursion"
+}
+recurse_symlink_body()
+{
+ mkdir -p test/c/d
+ (cd test/c/d && ln -s ../d .)
+ echo "Test string" > test/c/match
+
+ atf_check -o file:"$(atf_get_srcdir)/d_recurse_symlink.out" \
+ -e file:"$(atf_get_srcdir)/d_recurse_symlink.err" \
+ grep -r string test
+}
+
+atf_test_case word_regexps
+word_regexps_head()
+{
+ atf_set "descr" "Checks word-regexps"
+}
+word_regexps_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_word_regexps.out" \
+ grep -w separated $(atf_get_srcdir)/d_input
+}
+
+atf_test_case begin_end
+begin_end_head()
+{
+ atf_set "descr" "Checks handling of line beginnings and ends"
+}
+begin_end_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_begin_end_a.out" \
+ grep ^Front "$(atf_get_srcdir)/d_input"
+
+ atf_check -o file:"$(atf_get_srcdir)/d_begin_end_b.out" \
+ grep ending$ "$(atf_get_srcdir)/d_input"
+}
+
+atf_test_case ignore_case
+ignore_case_head()
+{
+ atf_set "descr" "Checks ignore-case option"
+}
+ignore_case_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_ignore_case.out" \
+ grep -i Upper "$(atf_get_srcdir)/d_input"
+}
+
+atf_test_case invert
+invert_head()
+{
+ atf_set "descr" "Checks selecting non-matching lines with -v option"
+}
+invert_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_invert.out" \
+ grep -v fish "$(atf_get_srcdir)/d_invert.in"
+}
+
+atf_test_case whole_line
+whole_line_head()
+{
+ atf_set "descr" "Checks whole-line matching with -x flag"
+}
+whole_line_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_whole_line.out" \
+ grep -x matchme "$(atf_get_srcdir)/d_input"
+}
+
+atf_test_case negative
+negative_head()
+{
+ atf_set "descr" "Checks handling of files with no matches"
+}
+negative_body()
+{
+ atf_check -s ne:0 grep "not a hope in hell" "$(atf_get_srcdir)/d_input"
+}
+
+atf_test_case context
+context_head()
+{
+ atf_set "descr" "Checks displaying context with -A, -B and -C flags"
+}
+context_body()
+{
+ cp $(atf_get_srcdir)/d_context_*.* .
+
+ atf_check -o file:d_context_a.out grep -C2 bamboo d_context_a.in
+ atf_check -o file:d_context_b.out grep -A3 tilt d_context_a.in
+ atf_check -o file:d_context_c.out grep -B4 Whig d_context_a.in
+ atf_check -o file:d_context_d.out grep -C1 pig d_context_a.in d_context_b.in
+}
+
+atf_test_case file_exp
+file_exp_head()
+{
+ atf_set "descr" "Checks reading expressions from file"
+}
+file_exp_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_file_exp.out" -x \
+ 'jot 21 -1 1.00 | grep -f '"$(atf_get_srcdir)"'/d_file_exp.in'
+}
+
+atf_test_case egrep
+egrep_head()
+{
+ atf_set "descr" "Checks matching special characters with egrep"
+}
+egrep_body()
+{
+ atf_check -o file:"$(atf_get_srcdir)/d_egrep.out" \
+ egrep '\?|\*$$' "$(atf_get_srcdir)/d_input"
+}
+
+atf_test_case zgrep
+zgrep_head()
+{
+ atf_set "descr" "Checks handling of gzipped files with zgrep"
+}
+zgrep_body()
+{
+ cp "$(atf_get_srcdir)/d_input" .
+ gzip d_input || atf_fail "gzip failed"
+
+ atf_check -o file:"$(atf_get_srcdir)/d_zgrep.out" zgrep -h line d_input.gz
+}
+
+atf_test_case nonexistent
+nonexistent_head()
+{
+ atf_set "descr" "Checks that -s flag suppresses error" \
+ "messages about nonexistent files"
+}
+nonexistent_body()
+{
+ atf_check -s ne:0 grep -s foobar nonexistent
+}
+
+atf_test_case context2
+context2_head()
+{
+ atf_set "descr" "Checks displaying context with -z flag"
+}
+context2_body()
+{
+ printf "haddock\000cod\000plaice\000" > test1
+ printf "mackeral\000cod\000crab\000" > test2
+
+ atf_check -o file:"$(atf_get_srcdir)/d_context2_a.out" \
+ grep -z -A1 cod test1 test2
+
+ atf_check -o file:"$(atf_get_srcdir)/d_context2_b.out" \
+ grep -z -B1 cod test1 test2
+
+ atf_check -o file:"$(atf_get_srcdir)/d_context2_c.out" \
+ grep -z -C1 cod test1 test2
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+ atf_add_test_case binary
+ atf_add_test_case recurse
+ atf_add_test_case recurse_symlink
+ atf_add_test_case word_regexps
+ atf_add_test_case begin_end
+ atf_add_test_case ignore_case
+ atf_add_test_case invert
+ atf_add_test_case whole_line
+ atf_add_test_case negative
+ atf_add_test_case context
+ atf_add_test_case file_exp
+ atf_add_test_case egrep
+ atf_add_test_case zgrep
+ atf_add_test_case nonexistent
+ atf_add_test_case context2
+}
diff --git a/contrib/netbsd-tests/usr.bin/gzip/t_gzip.sh b/contrib/netbsd-tests/usr.bin/gzip/t_gzip.sh
new file mode 100755
index 0000000..bee6655
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/gzip/t_gzip.sh
@@ -0,0 +1,110 @@
+# $NetBSD: t_gzip.sh,v 1.1 2012/03/17 16:33:13 jruoho Exp $
+#
+# Copyright (c) 2008 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case concatenated
+concatenated_head()
+{
+ atf_set "descr" "Checks concatenated gzipped data"
+}
+concatenated_body()
+{
+ echo -n "aaaa" | gzip > tmp.gz
+ echo -n "bbbb" | gzip >> tmp.gz
+
+ atf_check -o inline:"aaaabbbb" gzip -d tmp.gz -c
+}
+
+atf_test_case pipe
+pipe_head()
+{
+ atf_set "descr" "Checks input from pipe"
+}
+pipe_body()
+{
+ atf_check -x "dd if=/dev/zero count=102400 2>/dev/null \
+| gzip -c | dd bs=1 2>/dev/null | gzip -tc"
+}
+
+atf_test_case truncated
+truncated_head()
+{
+ atf_set "descr" "Checks that gzip fails on truncated data"
+}
+truncated_body()
+{
+ cat >truncated.gz.uue <<EOF
+begin-base64 644 truncated.gz
+H4sIAAAAAAAAA0tMSk7hAgCspIpYCg==
+====
+EOF
+ uudecode -m truncated.gz.uue
+
+ atf_check -s ne:0 -e ignore gzip -d truncated.gz
+}
+
+atf_test_case crcerror
+crcerror_head()
+{
+ atf_set "descr" "Checks that gzip fails on crc error"
+}
+crcerror_body()
+{
+ cat >crcerror.gz.uue <<EOF
+begin-base64 644 crcerror.gz
+H4sIAAAAAAAAA0tMSk7hAgCspFhYBQAAAA==
+====
+EOF
+ uudecode -m crcerror.gz.uue
+
+ atf_check -s ne:0 -e ignore gzip -d crcerror.gz
+}
+
+atf_test_case good
+good_head()
+{
+ atf_set "descr" "Checks decompressing correct file"
+}
+good_body()
+{
+ cat >good.gz.uue <<EOF
+begin-base64 644 good.gz
+H4sICC8G8UAAA2FiY2QAS0xKTuECAKykilgFAAAA
+====
+EOF
+ uudecode -m good.gz.uue
+
+ atf_check gzip -d good.gz
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case concatenated
+ atf_add_test_case pipe
+ atf_add_test_case truncated
+ atf_add_test_case crcerror
+ atf_add_test_case good
+}
diff --git a/contrib/netbsd-tests/usr.bin/id/pwgr.c b/contrib/netbsd-tests/usr.bin/id/pwgr.c
new file mode 100644
index 0000000..364f642
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/id/pwgr.c
@@ -0,0 +1,187 @@
+/* $NetBSD: pwgr.c,v 1.1 2012/03/17 16:33:14 jruoho Exp $ */
+/*
+ * Copyright (c) 2007 The NetBSD Foundation, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file implements replacements for all user/group-related functions
+ * called by id(1). It provides fake but deterministic user and group
+ * information. The details are as such:
+ * User root, uid 0, primary group 0 (wheel).
+ * User test, uid 100, primary group 100 (users), secondary group 0 (wheel).
+ */
+
+#include <sys/types.h>
+
+#include <errno.h>
+#include <grp.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+char Login[16];
+struct group GrEntry;
+struct passwd PwEntry;
+
+gid_t
+getgid(void)
+{
+ return 100;
+}
+
+gid_t
+getegid(void)
+{
+ if (getenv("LIBFAKE_EGID_ROOT") != NULL)
+ return 0;
+ else
+ return 100;
+}
+
+uid_t
+getuid(void)
+{
+ return 100;
+}
+
+uid_t
+geteuid(void)
+{
+ if (getenv("LIBFAKE_EUID_ROOT") != NULL)
+ return 0;
+ else
+ return 100;
+}
+
+char *
+getlogin(void)
+{
+ strcpy(Login, "test");
+ return Login;
+}
+
+struct group *
+getgrgid(gid_t gid)
+{
+ struct group *g = &GrEntry;
+
+ memset(g, 0, sizeof(*g));
+ if (gid == 0) {
+ g->gr_name = __UNCONST("wheel");
+ g->gr_gid = 0;
+ } else if (gid == 100) {
+ g->gr_name = __UNCONST("users");
+ g->gr_gid = 100;
+ } else
+ g = NULL;
+
+ return g;
+}
+
+int
+getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroups)
+{
+ int cnt, ret;
+
+ if (strcmp(name, "root") == 0) {
+ if (*ngroups >= 1) {
+ groups[0] = basegid;
+ cnt = 1;
+ }
+
+ ret = (*ngroups >= cnt) ? 0 : -1;
+ *ngroups = cnt;
+ } else if (strcmp(name, "test") == 0) {
+ if (*ngroups >= 1) {
+ groups[0] = basegid;
+ cnt = 1;
+ }
+
+ if (*ngroups >= 2) {
+ groups[1] = 0;
+ cnt = 2;
+ }
+
+ ret = (*ngroups >= cnt) ? 0 : -1;
+ *ngroups = cnt;
+ } else
+ ret = -1;
+
+ return ret;
+}
+
+int
+getgroups(int gidsetlen, gid_t *gidset)
+{
+ if (gidsetlen < 2) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ gidset[0] = 100;
+ gidset[1] = 0;
+ return 2;
+}
+
+struct passwd *
+getpwnam(const char *login)
+{
+ struct passwd *p = &PwEntry;
+
+ memset(p, 0, sizeof(*p));
+ if (strcmp(login, "root") == 0) {
+ p->pw_name = __UNCONST("root");
+ p->pw_uid = 0;
+ p->pw_gid = 0;
+ } else if (strcmp(login, "test") == 0) {
+ p->pw_name = __UNCONST("test");
+ p->pw_uid = 100;
+ p->pw_gid = 100;
+ } else
+ p = NULL;
+
+ return p;
+}
+
+struct passwd *
+getpwuid(uid_t uid)
+{
+ struct passwd *p = &PwEntry;
+
+ memset(p, 0, sizeof(*p));
+ if (uid == 0) {
+ p->pw_name = __UNCONST("root");
+ p->pw_uid = 0;
+ p->pw_gid = 0;
+ } else if (uid == 100) {
+ p->pw_name = __UNCONST("test");
+ p->pw_uid = 100;
+ p->pw_gid = 100;
+ } else
+ p = NULL;
+
+ return p;
+}
diff --git a/contrib/netbsd-tests/usr.bin/id/t_groups.sh b/contrib/netbsd-tests/usr.bin/id/t_groups.sh
new file mode 100755
index 0000000..71121ab
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/id/t_groups.sh
@@ -0,0 +1,71 @@
+# $NetBSD: t_groups.sh,v 1.1 2012/03/17 16:33:14 jruoho Exp $
+#
+# Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+create_run_groups() {
+ cat >run_groups.sh <<EOF
+#! /bin/sh
+[ -f ./groups ] || ln -s $(atf_get_srcdir)/h_id ./groups
+./groups "\${@}"
+EOF
+ chmod +x run_groups.sh
+}
+
+atf_test_case correct
+correct_head() {
+ atf_set "descr" "Checks that correct queries work"
+}
+correct_body() {
+ create_run_groups
+
+ echo "users wheel" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh
+ atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh test
+
+ echo "wheel" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh root
+}
+
+atf_test_case syntax
+syntax_head() {
+ atf_set "descr" "Checks the command's syntax"
+}
+syntax_body() {
+ create_run_groups
+
+ # Give an invalid flag but which is allowed by id (with which
+ # groups shares code) when using the -Gn options.
+ atf_check -s eq:1 -o empty -e save:stderr ./run_groups.sh -r
+ atf_check -s eq:0 -o ignore -e empty grep '^usage:' stderr
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case correct
+ atf_add_test_case syntax
+}
diff --git a/contrib/netbsd-tests/usr.bin/id/t_id.sh b/contrib/netbsd-tests/usr.bin/id/t_id.sh
new file mode 100755
index 0000000..9c877a6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/id/t_id.sh
@@ -0,0 +1,305 @@
+# $NetBSD: t_id.sh,v 1.1 2012/03/17 16:33:14 jruoho Exp $
+#
+# Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+create_run_id() {
+ cat >run_id.sh <<EOF
+#! /bin/sh
+[ -f ./id ] || ln -s $(atf_get_srcdir)/h_id ./id
+./id "\${@}"
+EOF
+ chmod +x run_id.sh
+}
+
+atf_test_case default
+default_head() {
+ atf_set "descr" "Checks that the output without options is correct"
+}
+default_body() {
+ create_run_id
+
+ echo "uid=100(test) gid=100(users) groups=100(users),0(wheel)" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh test
+
+ echo "uid=0(root) gid=0(wheel) groups=0(wheel)" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh root
+
+ export LIBFAKE_EGID_ROOT=1 LIBFAKE_EUID_ROOT=1
+ echo "uid=100(test) gid=100(users) euid=0(root) egid=0(wheel) groups=100(users),0(wheel)" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh
+ unset LIBFAKE_EGID_ROOT LIBFAKE_EUID_ROOT
+
+ echo 'id: nonexistent: No such user' >experr
+ atf_check -s eq:1 -o empty -e file:experr ./run_id.sh nonexistent
+
+ atf_check -s eq:1 -o empty -e save:stderr ./run_id.sh root nonexistent
+ atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
+}
+
+atf_test_case primaries
+primaries_head() {
+ atf_set "descr" "Checks that giving multiple primaries" \
+ "simultaneously provides an error"
+}
+primaries_body() {
+ create_run_id
+
+ for p1 in -G -g -p -u; do
+ for p2 in -G -g -p -u; do
+ if [ ${p1} != ${p2} ]; then
+ atf_check -s eq:1 -o empty -e save:stderr \
+ ./run_id.sh ${p1} ${p2}
+ atf_check -s eq:0 -o ignore -e empty \
+ grep ^usage: stderr
+ fi
+ done
+ done
+}
+
+atf_test_case Gflag
+Gflag_head() {
+ atf_set "descr" "Checks that the -G primary flag works"
+}
+Gflag_body() {
+ create_run_id
+
+ echo "100 0" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G test
+
+ echo "users wheel" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n test
+
+ echo "0" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G root
+
+ echo "wheel" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n root
+
+ echo 'id: nonexistent: No such user' >experr
+ atf_check -s eq:1 -o empty -e file:experr ./run_id.sh -G nonexistent
+
+ atf_check -s eq:1 -o empty -e save:stderr ./run_id.sh -G root nonexistent
+ atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
+}
+
+atf_test_case gflag
+gflag_head() {
+ atf_set "descr" "Checks that the -g primary flag works"
+}
+gflag_body() {
+ create_run_id
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g test
+
+ echo "users" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n test
+
+ echo "0" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g root
+
+ echo "wheel" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n root
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r
+
+ echo "users" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r test
+
+ echo "users" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n test
+
+ export LIBFAKE_EGID_ROOT=1 LIBFAKE_EUID_ROOT=1
+
+ echo "0" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g
+
+ echo "wheel" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r
+
+ echo "users" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r test
+
+ echo "users" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n test
+
+ unset LIBFAKE_EGID_ROOT LIBFAKE_EUID_ROOT
+
+ echo 'id: nonexistent: No such user' >experr
+ atf_check -s eq:1 -o empty -e file:experr ./run_id.sh -g nonexistent
+
+ atf_check -s eq:1 -o empty -e save:stderr ./run_id.sh -g root nonexistent
+ atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
+}
+
+atf_test_case pflag
+pflag_head() {
+ atf_set "descr" "Checks that the -p primary flag works"
+}
+pflag_body() {
+ create_run_id
+
+ cat >expout <<EOF
+uid test
+groups users wheel
+EOF
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p test
+
+ cat >expout <<EOF
+uid root
+groups wheel
+EOF
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p root
+
+ export LIBFAKE_EGID_ROOT=1 LIBFAKE_EUID_ROOT=1
+ cat >expout <<EOF
+uid test
+euid root
+rgid users
+groups users wheel
+EOF
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p
+ unset LIBFAKE_EGID_ROOT LIBFAKE_EUID_ROOT
+
+ echo 'id: nonexistent: No such user' >experr
+ atf_check -s eq:1 -o empty -e file:experr ./run_id.sh -p nonexistent
+
+ atf_check -s eq:1 -o empty -e save:stderr ./run_id.sh -p root nonexistent
+ atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
+}
+
+atf_test_case uflag
+uflag_head() {
+ atf_set "descr" "Checks that the -u primary flag works"
+}
+uflag_body() {
+ create_run_id
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u test
+
+ echo "test" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n test
+
+ echo "0" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u root
+
+ echo "root" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n 0
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n root
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r
+
+ echo "test" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r test
+
+ echo "test" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n test
+
+ export LIBFAKE_EGID_ROOT=1 LIBFAKE_EUID_ROOT=1
+
+ echo "0" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u
+
+ echo "root" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r
+
+ echo "test" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n
+
+ echo "100" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r test
+
+ echo "test" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n 100
+ atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n test
+
+ unset LIBFAKE_EGID_ROOT LIBFAKE_EUID_ROOT
+
+ echo 'id: nonexistent: No such user' >experr
+ atf_check -s eq:1 -o empty -e file:experr ./run_id.sh -u nonexistent
+
+ atf_check -s eq:1 -o empty -e save:stderr \
+ ./run_id.sh -u root nonexistent
+ atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case default
+ atf_add_test_case primaries
+ atf_add_test_case Gflag
+ atf_add_test_case gflag
+ atf_add_test_case pflag
+ atf_add_test_case uflag
+}
diff --git a/contrib/netbsd-tests/usr.bin/id/t_whoami.sh b/contrib/netbsd-tests/usr.bin/id/t_whoami.sh
new file mode 100755
index 0000000..c8df745
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/id/t_whoami.sh
@@ -0,0 +1,75 @@
+# $NetBSD: t_whoami.sh,v 1.1 2012/03/17 16:33:14 jruoho Exp $
+#
+# Copyright (c) 2007, 2008 The NetBSD Foundation, 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 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.
+#
+
+create_run_whoami() {
+ cat >run_whoami.sh <<EOF
+#! /bin/sh
+[ -f ./whoami ] || ln -s $(atf_get_srcdir)/h_id ./whoami
+./whoami "\${@}"
+EOF
+ chmod +x run_whoami.sh
+}
+
+atf_test_case correct
+correct_head() {
+ atf_set "descr" "Checks that correct queries work"
+}
+correct_body() {
+ create_run_whoami
+
+ echo "Checking with EUID=100"
+ echo "test" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_whoami.sh
+
+ echo "Checking with EUID=0"
+ export LIBFAKE_EUID_ROOT=1
+ echo "root" >expout
+ atf_check -s eq:0 -o file:expout -e empty ./run_whoami.sh
+}
+
+atf_test_case syntax
+syntax_head() {
+ atf_set "descr" "Checks the command's syntax"
+}
+syntax_body() {
+ create_run_whoami
+
+ # Give a user to the command.
+ echo 'usage: whoami' >experr
+ atf_check -s eq:1 -o empty -e file:experr ./run_whoami.sh root
+
+ # Give an invalid flag but which is allowed by id (with which
+ # whoami shares code) when using the -un options.
+ echo 'usage: whoami' >experr
+ atf_check -s eq:1 -o empty -e file:experr ./run_whoami.sh -r
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case correct
+ atf_add_test_case syntax
+}
diff --git a/contrib/netbsd-tests/usr.bin/infocmp/t_terminfo.sh b/contrib/netbsd-tests/usr.bin/infocmp/t_terminfo.sh
new file mode 100755
index 0000000..8ede240
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/infocmp/t_terminfo.sh
@@ -0,0 +1,62 @@
+# $NetBSD: t_terminfo.sh,v 1.1 2012/06/06 21:23:10 martin Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "infocmp can decode one of some existing term types"
+ atf_set "require.progs" "infocmp env"
+}
+
+basic_body() {
+ for term in ansi vt100 wsvt25 sun-ss5 ibcs2 vt52 386at h19k h19kermit
+ do
+ atf_check -s exit:0 -e empty -o not-empty \
+ env TERM="${term}" infocmp
+ done
+}
+
+atf_test_case missing
+missing_head() {
+ atf_set "descr" "infocmp fails to decode non existent entries"
+ atf_set "require.progs" "infocmp env"
+}
+
+missing_body() {
+ for term in this-is-no-term nonexistent
+ do
+ atf_check -s not-exit:0 -e not-empty -o empty \
+ env TERM="${term}" infocmp
+ done
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case basic
+ atf_add_test_case missing
+}
+
diff --git a/contrib/netbsd-tests/usr.bin/jot/d_basic.out b/contrib/netbsd-tests/usr.bin/jot/d_basic.out
new file mode 100644
index 0000000..89b0879
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/jot/d_basic.out
@@ -0,0 +1,21 @@
+-1.00
+-0.90
+-0.80
+-0.70
+-0.60
+-0.50
+-0.40
+-0.30
+-0.20
+-0.10
+-0.00
+0.10
+0.20
+0.30
+0.40
+0.50
+0.60
+0.70
+0.80
+0.90
+1.00
diff --git a/contrib/netbsd-tests/usr.bin/jot/t_jot.sh b/contrib/netbsd-tests/usr.bin/jot/t_jot.sh
new file mode 100755
index 0000000..bcdae32
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/jot/t_jot.sh
@@ -0,0 +1,56 @@
+# $NetBSD: t_jot.sh,v 1.1 2012/03/20 06:18:34 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Test that jot(1)'s output is sane (PR bin/12424)"
+}
+
+basic_body() {
+ atf_check -o file:"$(atf_get_srcdir)/d_basic.out" jot 21 -1 1.00
+}
+
+atf_test_case format
+format_head() {
+ atf_set "descr" "Test that jot(1) handles format strings " \
+ "correctly (PR bin/12316, PR bin/14253)"
+}
+
+format_body() {
+ atf_check -s exit:0 -o ignore jot -w xa%c 26 a
+ atf_check -s not-exit:0 -e not-empty jot -w %2 12
+ atf_check -s not-exit:0 -e not-empty jot -w %0 10 1 10
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+ atf_add_test_case format
+}
diff --git a/contrib/netbsd-tests/usr.bin/m4/d_ff_after_dnl.m4.uue b/contrib/netbsd-tests/usr.bin/m4/d_ff_after_dnl.m4.uue
new file mode 100644
index 0000000..8b90044
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/m4/d_ff_after_dnl.m4.uue
@@ -0,0 +1,9 @@
+$NetBSD: d_ff_after_dnl.m4.uue,v 1.1 2012/03/17 16:33:14 jruoho Exp $
+
+begin 644 d_ff_after_dnl.m4
+M"0E42$E3(%-(3U5,1"!32$]7(%50("A,24Y%(#$I"F1N;`D)5$A)4R!32$]5
+M3$0@3D]4(%-(3U<@55`@*$Q)3D4@,BD*9&YL_PD)5$A)4R!32$]53$0@3D]4
+M(%-(3U<@55`@*$Q)3D4@,RD*9&YL"?\)5$A)4R!32$]53$0@3D]4(%-(3U<@
+K55`@*$Q)3D4@-"D*"0E42$E3(%-(3U5,1"!32$]7(%50("A,24Y%(#4I"E<@
+`
+end
diff --git a/contrib/netbsd-tests/usr.bin/m4/d_ff_after_dnl.out b/contrib/netbsd-tests/usr.bin/m4/d_ff_after_dnl.out
new file mode 100644
index 0000000..8e51f1e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/m4/d_ff_after_dnl.out
@@ -0,0 +1,2 @@
+ THIS SHOULD SHOW UP (LINE 1)
+ THIS SHOULD SHOW UP (LINE 5)
diff --git a/contrib/netbsd-tests/usr.bin/m4/d_m4wrap-P.m4 b/contrib/netbsd-tests/usr.bin/m4/d_m4wrap-P.m4
new file mode 100644
index 0000000..e029858
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/m4/d_m4wrap-P.m4
@@ -0,0 +1,5 @@
+m4_dnl $NetBSD: d_m4wrap-P.m4,v 1.1 2012/03/17 16:33:14 jruoho Exp $
+m4_define(`ateof', `TEXT AT EOF
+')m4_dnl
+m4_m4wrap(`ateof()')m4_dnl
+TEXT IN BODY
diff --git a/contrib/netbsd-tests/usr.bin/m4/d_m4wrap-P.out b/contrib/netbsd-tests/usr.bin/m4/d_m4wrap-P.out
new file mode 100644
index 0000000..a1bc22a
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/m4/d_m4wrap-P.out
@@ -0,0 +1,2 @@
+TEXT IN BODY
+TEXT AT EOF
diff --git a/contrib/netbsd-tests/usr.bin/m4/d_m4wrap.m4 b/contrib/netbsd-tests/usr.bin/m4/d_m4wrap.m4
new file mode 100644
index 0000000..b74db96
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/m4/d_m4wrap.m4
@@ -0,0 +1,5 @@
+dnl $NetBSD: d_m4wrap.m4,v 1.1 2012/03/17 16:33:14 jruoho Exp $
+define(`ateof', `TEXT AT EOF
+')dnl
+m4wrap(`ateof()')dnl
+TEXT IN BODY
diff --git a/contrib/netbsd-tests/usr.bin/m4/d_m4wrap.out b/contrib/netbsd-tests/usr.bin/m4/d_m4wrap.out
new file mode 100644
index 0000000..a1bc22a
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/m4/d_m4wrap.out
@@ -0,0 +1,2 @@
+TEXT IN BODY
+TEXT AT EOF
diff --git a/contrib/netbsd-tests/usr.bin/m4/t_m4.sh b/contrib/netbsd-tests/usr.bin/m4/t_m4.sh
new file mode 100755
index 0000000..a0e1e70
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/m4/t_m4.sh
@@ -0,0 +1,50 @@
+# $NetBSD: t_m4.sh,v 1.1 2012/03/17 16:33:14 jruoho Exp $
+#
+# Copyright (c) 2008, 2009 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case eof
+eof_head()
+{
+ atf_set "descr" "Checks that m4 doesn't confuse 0xFF with EOF"
+}
+eof_body()
+{
+ cp "$(atf_get_srcdir)/d_ff_after_dnl.m4.uue" .
+ uudecode d_ff_after_dnl.m4.uue
+ atf_check -o file:"$(atf_get_srcdir)/d_ff_after_dnl.out" \
+ m4 d_ff_after_dnl.m4
+
+ atf_check -o file:"$(atf_get_srcdir)/d_m4wrap.out" \
+ m4 "$(atf_get_srcdir)/d_m4wrap.m4"
+
+ atf_check -o file:"$(atf_get_srcdir)/d_m4wrap-P.out" \
+ m4 -P "$(atf_get_srcdir)/d_m4wrap-P.m4"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case eof
+}
diff --git a/contrib/netbsd-tests/usr.bin/make/t_make.sh b/contrib/netbsd-tests/usr.bin/make/t_make.sh
new file mode 100755
index 0000000..70c3ead
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/make/t_make.sh
@@ -0,0 +1,74 @@
+# $NetBSD: t_make.sh,v 1.6 2014/08/23 16:26:13 apb Exp $
+#
+# Copyright (c) 2008, 2010, 2014 The NetBSD Foundation, 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 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.
+#
+
+# Executes make and compares the output to a golden file.
+run_and_check()
+{
+ local atfname="${1}"; shift
+ local makename="${1}"; shift
+
+ local srcdir="$(atf_get_srcdir)"
+
+ local testdir="$(atf_get_srcdir)/unit-tests"
+
+ atf_check -s exit:0 -o ignore -e ignore \
+ make -f "${testdir}/Makefile" "${makename}.out"
+ atf_check -o file:"${testdir}/${makename}.exp" cat "${makename}.out"
+}
+
+# Defines a test case for make(1), parsing a given file and comparing the
+# output to prerecorded results.
+test_case()
+{
+ local atfname="${1}"; shift # e.g. foo_bar
+ local makename="${1}"; shift # e.g. foo-bar
+ local descr="${1}"; shift
+
+ atf_test_case "${atfname}"
+ eval "${atfname}_head() { \
+ if [ -n '${descr}' ]; then \
+ atf_set descr '${descr}'; \
+ fi \
+ }"
+ eval "${atfname}_body() { \
+ run_and_check '${atfname}' '${makename}'; \
+ }"
+}
+
+atf_init_test_cases()
+{
+ local filename basename atfname descr
+
+ for filename in "$(atf_get_srcdir)"/unit-tests/*.mk ; do
+ basename="${filename##*/}"
+ basename="${basename%.mk}"
+ atfname="$(echo "${basename}" | tr "x-" "x_")"
+ descr='' # XXX
+ test_case "${atfname}" "${basename}" "${descr}"
+ atf_add_test_case "${atfname}"
+ done
+}
diff --git a/contrib/netbsd-tests/usr.bin/mkdep/t_mkdep.sh b/contrib/netbsd-tests/usr.bin/mkdep/t_mkdep.sh
new file mode 100755
index 0000000..7ad6fd9
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/mkdep/t_mkdep.sh
@@ -0,0 +1,83 @@
+# $NetBSD: t_mkdep.sh,v 1.4 2012/08/26 22:37:19 jmmv Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Nicolas Joly.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case prefix
+prefix_head() {
+ atf_set "descr" "Test adding a prefix to a single target"
+ atf_set "require.progs" "mkdep cc"
+}
+prefix_body() {
+
+ atf_check touch sample.c
+
+ atf_check mkdep -f sample.d -P some/path/ sample.c
+ atf_check -o ignore grep '^some/path/sample.o:' sample.d
+}
+
+atf_test_case suffixes
+suffixes_head() {
+ atf_set "descr" "Test suffixes list"
+ atf_set "require.progs" "mkdep cc"
+}
+suffixes_body() {
+
+ atf_check touch sample.c
+
+ # No list
+ atf_check mkdep -f sample.d sample.c
+ atf_check -o ignore grep '^sample.o:' sample.d
+
+ # Suffix list
+ atf_check mkdep -f sample.d -s '.a .b' sample.c
+ atf_check -o ignore grep '^sample.b sample.a:' sample.d
+
+ # Empty list
+ atf_check mkdep -f sample.d -s '' sample.c
+ atf_check -o ignore grep '^sample:' sample.d
+}
+
+atf_test_case prefix_and_suffixes
+prefix_and_suffixes_head() {
+ atf_set "descr" "Test the combination of a prefix and suffixes"
+ atf_set "require.progs" "mkdep cc"
+}
+prefix_and_suffixes_body() {
+
+ atf_check touch sample.c
+
+ atf_check mkdep -f sample.d -s '.a .b' -P c/d sample.c
+ atf_check -o ignore grep '^c/dsample.b c/dsample.a:' sample.d
+}
+
+atf_init_test_cases() {
+ atf_add_test_case prefix
+ atf_add_test_case suffixes
+ atf_add_test_case prefix_and_suffixes
+}
diff --git a/contrib/netbsd-tests/usr.bin/nbperf/h_nbperf.sh b/contrib/netbsd-tests/usr.bin/nbperf/h_nbperf.sh
new file mode 100755
index 0000000..2587ed0
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/nbperf/h_nbperf.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+# $NetBSD: h_nbperf.sh,v 1.2 2012/09/25 20:53:46 joerg Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, 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 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.
+#
+
+set -e
+head -n $4 $1 | nbperf -m hash.map -o hash.c -a $2 2> /dev/null
+cc -o testprog -I. $5
+head -n $4 $1 | ./testprog | $3
diff --git a/contrib/netbsd-tests/usr.bin/nbperf/hash_driver.c b/contrib/netbsd-tests/usr.bin/nbperf/hash_driver.c
new file mode 100644
index 0000000..e4195d9
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/nbperf/hash_driver.c
@@ -0,0 +1,53 @@
+/* $NetBSD: hash_driver.c,v 1.3 2014/02/06 14:57:16 joerg Exp $ */
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Joerg Sonnenberger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (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 <inttypes.h>
+
+#include "hash.c"
+
+int
+main(void)
+{
+ char *line = NULL;
+ size_t buflen;
+ ssize_t len;
+
+ while ((len = getline(&line, &buflen, stdin)) > 0) {
+ if (len && line[len - 1] == '\n')
+ --len;
+ printf("%" PRId32 "\n", hash(line, len));
+ }
+ free(line);
+ return 0;
+}
diff --git a/contrib/netbsd-tests/usr.bin/nbperf/t_nbperf.sh b/contrib/netbsd-tests/usr.bin/nbperf/t_nbperf.sh
new file mode 100755
index 0000000..37b7d90
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/nbperf/t_nbperf.sh
@@ -0,0 +1,110 @@
+# $NetBSD: t_nbperf.sh,v 1.3 2014/04/30 21:04:21 joerg Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, 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 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.
+#
+
+cleanup()
+{
+ rm -f reference.txt hash.c hash.map testprog
+}
+
+atf_test_case chm
+chm_head()
+{
+ atf_set "descr" "Checks chm algorithm"
+ atf_set "require.files" "/usr/share/dict/web2"
+ atf_set "require.progs" "cc"
+}
+chm_body()
+{
+ for n in 4 32 128 1024 65536; do
+ seq 0 $(($n - 1)) > reference.txt
+ atf_check -o file:reference.txt \
+ $(atf_get_srcdir)/h_nbperf /usr/share/dict/web2 chm cat \
+ $n $(atf_get_srcdir)/hash_driver.c
+ atf_check -o file:hash.map \
+ $(atf_get_srcdir)/h_nbperf /usr/share/dict/web2 chm cat \
+ $n $(atf_get_srcdir)/hash_driver.c
+ done
+}
+chm_clean()
+{
+ cleanup
+}
+
+atf_test_case chm3
+chm3_head()
+{
+ atf_set "descr" "Checks chm3 algorithm"
+ atf_set "require.files" "/usr/share/dict/web2"
+ atf_set "require.progs" "cc"
+}
+chm3_body()
+{
+ for n in 4 32 128 1024 65536; do
+ seq 0 $(($n - 1)) > reference.txt
+ atf_check -o file:reference.txt \
+ $(atf_get_srcdir)/h_nbperf /usr/share/dict/web2 chm3 cat \
+ $n $(atf_get_srcdir)/hash_driver.c
+ atf_check -o file:hash.map \
+ $(atf_get_srcdir)/h_nbperf /usr/share/dict/web2 chm3 cat \
+ $n $(atf_get_srcdir)/hash_driver.c
+ done
+}
+chm3_clean()
+{
+ cleanup
+}
+
+atf_test_case bdz
+bdz_head()
+{
+ atf_set "descr" "Checks bdz algorithm"
+ atf_set "require.files" "/usr/share/dict/web2"
+ atf_set "require.progs" "cc"
+}
+bdz_body()
+{
+ for n in 4 32 128 1024 65536 131072; do
+ seq 0 $(($n - 1)) > reference.txt
+ atf_check -o file:reference.txt \
+ $(atf_get_srcdir)/h_nbperf /usr/share/dict/web2 bdz "sort -n" \
+ $n $(atf_get_srcdir)/hash_driver.c
+ atf_check -o file:hash.map \
+ $(atf_get_srcdir)/h_nbperf /usr/share/dict/web2 bdz cat \
+ $n $(atf_get_srcdir)/hash_driver.c
+ done
+}
+bdz_clean()
+{
+ cleanup
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case chm
+ atf_add_test_case chm3
+ atf_add_test_case bdz
+}
diff --git a/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh b/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh
new file mode 100755
index 0000000..110761c
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh
@@ -0,0 +1,8907 @@
+#! /bin/sh
+
+# $NetBSD: t_netpgpverify.sh,v 1.1 2012/11/20 07:55:54 agc Exp $
+
+# Copyright (c) 2012 Alistair Crooks <agc@NetBSD.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case netpgpverify_case
+
+netpgpverify_rsa_head() {
+ atf_set "descr" "RSA signatures for netpgpverify"
+}
+
+netpgpverify_rsa_body() {
+ uudecode << EOF
+begin-base64 644 b.gpg
+xA0DAAgBG2jc/MBZaCMBy4tiAAAAAABQUk9HPXAKU1JDUz1wYXJzZS5jCldBUk5T
+PTUKTUtNQU49bm8KQ1BQRkxBR1MrPS1nIC1PMApMREZMQUdTKz0tZyAtTzAKCi5p
+bmNsdWRlIDxic2QucHJvZy5taz4KCnQ6ICR7UFJPR30KCS4vJHtQUk9HfSBncGdz
+aWduZWQtYS5ncGcKwsBiBAABCAAWBQJQTZOaBQMAAAAACRAbaNz8wFloIwAABTcH
+/RhxktWLH3Cw6YkC/4Wcm9yq6flgiKQsB0VUaVgmmOfWnLxcowyH5ISENo/J6qhT
+S8Z0B2lAkRzBhXbfSe8GoESc/NsXTuOIvdjZEy7FBkl9Lumuqp1IlmoXh3RgPv5Z
+gcJ+uDCV958uXAxLn017xN/CVKi5yBiNWWk/mOJuI8FCiQCyFVQ3dOXcFU/gf4iZ
+YkH6OMX6eNpLQXp+s1ar6ZqpFE09QEoiFuIiDas+V6g0IG1c+PgP+TOlO5ztaKjx
+XxejP0Thtft0T+AKTANVrtx+aTseVt4CR3jBt0n4CJjTTRQwnIYxGML3ddgMXSPT
+0c4J/4dwyMqdDuhby//52Nw=
+====
+EOF
+ cat >det << EOF
+To Do
+=====
+tests with -k sig
+detached sigs
+DSA
+
+Done
+====
+basics
+localise pgp_read_packets
+fix lint
+WARNS=5
+lib man page
+prog man page
+do we do it statically linked as well?
+multiple files in netpgpverify
+EOF
+ uudecode << EOF
+begin-base64 644 det.sig
+iQEcBAABAgAGBQJQf8gBAAoJEBto3PzAWWgjbLoH/i9MZSv2l9lJ5O+bfGmRSUxe
+rGeAM0dq//xi+AABByDEWNYORq2I6CO6k2eVPv7YbNE2Whn7qXA6U7LotM7Lt61l
+MCLRhuTv9RViV1qzsy+Z8VAQmhERAcG/qA5JSQbzjuVYhg5FexpiVmxgG9L8Z/Oj
+4pU9zIId1vH7CvAcy/mfSyM8Ih8bmsrgs9b1wzMPLQKl0v0jtcrEcnwMtscXa9Mw
+X66bHxCHtRyGcWsHU8Ab2fJCvsCbBBMtg3JjZ7+VgDoZqPqBgIkhmppqC05vU5QR
+leNo8g9OwiJ6fMtdwTMsFkxqjjVKk5//X/6jQd/mf55XcxLOw4UK4ev5ADExnOU=
+====
+EOF
+ cat >jj.asc << EOF
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+1. tag & 0x3f
+2. len
+
+one pass (tag 4)
+========
+b version:3
+b sig type
+b hash alg
+b pubkey alg
+8b keyid
+
+literal data (tag 11)
+=============
+b binary/text
+b length
+c string
+L mtime
+text
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.11 (NetBSD)
+
+iQEcBAEBAgAGBQJQaIZcAAoJEBto3PzAWWgj678IALbDHon3Rm6qUhn7k1TFT6D3
+yi/jzf3piSJGsgUg2wEghs175edC/cJK3lG9Gx/3/uQq06R9g37nVRX8I0sK7yT2
+XgR+RHoGh/b+CQxdRNC+ub5QoNb8LcmCb/MQGq2KK9otSExiy4WMUP4K1DblaK5L
++Hg4VTooMot1NVqyFSoB2aZauXc2F4ZVh5q0fn8w5GEw45P+AUUbmzpgbLwXbl+I
+tMsX54V1dxyDcCYUs0xUH/VxJUQEeIlDbCOXYMbCVtggYRqKksTr+u/riw/Llnql
+jQdq5rBRW1SlD7Ll6z/LF2WBJOWtHzp4qbnBGSq5uB1q37H3mWL28f1tL//TUjM=
+=EX8W
+-----END PGP SIGNATURE-----
+EOF
+ uudecode << EOF
+begin-base64 644 pubring.gpg
+mQGiBD0HbVsRBAD7trxYcytr3MB+cp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E8Hk0GPtqx
+4dk3CFiutioguCb7zO651fCXuJnWETif9MK6qf6gM6594FvSEoThrroE2YzH2diQ
+A7XQ4ulj+EZKW3XkLN0NatcuYQ1OzBtwvcHqdrQhTuIOOodCpzWP7AxyxF19yNUY
+a0smm/aq9Xj0KJgi6WNPGhNU3XfstTtpcKrK8lTU3HreiYtGHCencTMz7ZqDu3xj
+zOy+5TnS+u+bgAi6u2BwLPHiBBc7y01vpkI9GvoVx3HBfxke+r8Eique3dHh57d+
+aght+yis5P8cVp6QKqbkyDP+XAKspcwJAaXXGk4dhDwmG8YbjMp3wImyWm7u3lif
+V5BmPzsnW9vMDsr3Ca0Qissec8FzJnIclP/vcimr1BVEeo1qi2MzQmyanCfW7O1J
+LbOYH26CtE8muWWSijNycRPFpUKJuUsEYaLF+jQMA4Laf5awCkaFklp+6NUnhpfG
+wPdfFNeCvHRAFqc5CaKSwF2w7K2Z66JtJxsS3IKVV8Ac5MQ0GvZXejOEf2CGVubw
+ijaSDfX/EpCVyoua0S63m4xuuOp5bPsgKs0EMOWVlVhKDfxAQNDh9I+Rh3TSDlo9
+StZtC+VbuN66pfHwsAIAAw==
+====
+EOF
+ cat >NetBSD-6.0_hashes.asc << EOF
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+
+
+The following is a complete list of distribution files for NetBSD-6.0
+
+This includes all binary distributions, kernels, install images,
+source tarballs, release notes and related files. Multiple hash
+formats are used for each file.
+
+Signatures will be made available for any additional install media as
+they are published.
+
+UPDATE: the macppc ISO was replaced, the mac68k and source ISOs were added,
+and a new signature was generated for this hashes file on 15 October 2012.
+
+ NetBSD Security-Officer
+ security-officer@NetBSD.org
+
+SHA1 (NetBSD-6.0/CHANGES) = 44ed658e4f8c813d67613497afdc6656470aab00
+SHA512 (NetBSD-6.0/CHANGES) = ababa97f9674bfaa4d941515cff2b98a1c254221394e10f3060f456474f6888f5e79aa6480bebb6f69dc1e682cd8f4c450feee91c0da1a2ed1fc805bd1dec273
+RMD160 (NetBSD-6.0/CHANGES) = 2a0ed7457dfe13229bb72cfde66668ffff4ec7ff
+MD5 (NetBSD-6.0/CHANGES) = 63363144027cac2345030caf2d934d05
+SHA1 (NetBSD-6.0/CHANGES-6.0) = 159eef1002f7e904954fb3bd9490ac2e5391fdbb
+SHA512 (NetBSD-6.0/CHANGES-6.0) = f09bf320629f6db65a469c4220eebd8db668a81fcc1a8d41b9fb06bbadbcdafd76c9d6372d8d9e5258af8424abf648d1114da2eef3ae9b396642b9b3aba434ec
+RMD160 (NetBSD-6.0/CHANGES-6.0) = b03df64c3b4081c56578066c23a24db14ae935e1
+MD5 (NetBSD-6.0/CHANGES-6.0) = 92a82839d67702799f45da9167b0a60e
+SHA1 (NetBSD-6.0/CHANGES.prev) = 25bdfe4a49acc75ee3a59ca04dc3b3c7c71a4563
+SHA512 (NetBSD-6.0/CHANGES.prev) = 73057475c27c98d729dc97f6203f89f39459405c74f7abd7b18d4382f7c5ad6c3f598989cecdd5013ba4b77d66e694c05e3fcd51fd9776fde908513ea70e63d5
+RMD160 (NetBSD-6.0/CHANGES.prev) = 38f959a7c9d0c8da19eeb1740126b04dbb71a90e
+MD5 (NetBSD-6.0/CHANGES.prev) = 0a50635a033237b439f5d7ef4c29b802
+SHA1 (NetBSD-6.0/LAST_MINUTE) = 49f8a218ff6657e0d30449a87b7c4f65ccf6115b
+SHA512 (NetBSD-6.0/LAST_MINUTE) = d6b47cdd24a6be60d68f867c361106da69dea5f9b7f4f9764d1bd0f706e8fc9d604a6b89b95eb2829dba78df936f824be3dec21318da495705796a1882ee9277
+RMD160 (NetBSD-6.0/LAST_MINUTE) = ba07328d66f7955cc9fcb402e461871bfcf2aad3
+MD5 (NetBSD-6.0/LAST_MINUTE) = fb247c08580991ef0cc5f126b62f3b6e
+SHA1 (NetBSD-6.0/README.files) = 183b12bef627768c595ab7df30bc038952166809
+SHA512 (NetBSD-6.0/README.files) = 9aacd7e1042c7579309ed9ec1ee0fb017803f967be04e51f08e78fd56537ceae6ee79ed0bd3250994e4c16dd7de6995c1be3a301aeb95a500bbc77f6915ecb31
+RMD160 (NetBSD-6.0/README.files) = 61301ea3ffe6a3e1c415ce00cfe6d22b2d544365
+MD5 (NetBSD-6.0/README.files) = 7e47e7eb92db7cb8b8ce39ceb5986847
+SHA1 (NetBSD-6.0/acorn26/binary/kernel/netbsd-FOURMEG.gz) = e127c41d5e332c75e79f5ca0e72ba250ef3c739a
+SHA512 (NetBSD-6.0/acorn26/binary/kernel/netbsd-FOURMEG.gz) = 7487273a4289d2f1dd69fb0230c263ac4fd198aac5399de043e1416834ea4b0bb4970129886223b9c5090ea9526dd765e6152f89ccfa58d4c8ba95597a845a34
+RMD160 (NetBSD-6.0/acorn26/binary/kernel/netbsd-FOURMEG.gz) = 09dcd3b8f9be85b99ed094fefc6a88e27be9b91d
+MD5 (NetBSD-6.0/acorn26/binary/kernel/netbsd-FOURMEG.gz) = 5aef629404b3d65f15bc44554b948145
+SHA1 (NetBSD-6.0/acorn26/binary/kernel/netbsd-GENERIC.gz) = c6362b83dbc496509c4e539cca33924b14318804
+SHA512 (NetBSD-6.0/acorn26/binary/kernel/netbsd-GENERIC.gz) = da75edae5fcd456028c5699d3872ac6e9c041aafb37141cfbf6b5f374f5c69d21979d23709f7e82a9198580e6f5c3c50060b9d1cd3dcac74c1e2530131c5e892
+RMD160 (NetBSD-6.0/acorn26/binary/kernel/netbsd-GENERIC.gz) = 6caa2f5e65c871664b1af2dd2a5eceb8b64f2212
+MD5 (NetBSD-6.0/acorn26/binary/kernel/netbsd-GENERIC.gz) = b14bd857ffbe97a3601f91bc0a1b388d
+SHA1 (NetBSD-6.0/acorn26/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/acorn26/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/acorn26/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/acorn26/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/acorn26/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/acorn26/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/acorn26/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/acorn26/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/acorn26/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/acorn26/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/acorn26/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/acorn26/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/acorn26/binary/sets/xbase.tgz) = 875fd641f969ec00f854ca1334d084947450c740
+SHA512 (NetBSD-6.0/acorn26/binary/sets/xbase.tgz) = 75d0c9e9685b6b7bb706df7427c8b52f59c4fc4d0e725b02ee18024f75a546dc41de5f1a5d8552a8d2c84bdf87856e5857b0f12914801ca7b36b69536d617b4e
+RMD160 (NetBSD-6.0/acorn26/binary/sets/xbase.tgz) = 1a4d099d59b2bd882e99f1b2df1c7bf22b890d48
+MD5 (NetBSD-6.0/acorn26/binary/sets/xbase.tgz) = 5eb9c573c5a0c96701f268a3470a58b9
+SHA1 (NetBSD-6.0/acorn26/binary/sets/xcomp.tgz) = 8d7469a85b7433c89690cce74e6b3f4e66cf0647
+SHA512 (NetBSD-6.0/acorn26/binary/sets/xcomp.tgz) = 411304cf66e300a7f162128203099bb4d6eebc4a93ba18ed7caf79f30b31cc7ffcede85c4e1bad02c3f5f8a27d009fb71f3ce5862c1d8aa477f39a25c535fdaa
+RMD160 (NetBSD-6.0/acorn26/binary/sets/xcomp.tgz) = 822d26e0ee08b72ca8b991f0709a8c1bf0399208
+MD5 (NetBSD-6.0/acorn26/binary/sets/xcomp.tgz) = 5af361f0334d28119d703064278b3ed3
+SHA1 (NetBSD-6.0/acorn26/binary/sets/xetc.tgz) = 222d14c205f1018cc5a86eb03214d18cda2abb82
+SHA512 (NetBSD-6.0/acorn26/binary/sets/xetc.tgz) = fb82261996aa772fd8a9022eadebf899ee04ee70229ee4fe07758ca14937bdb34752c8218eb4c5b722b6208f719891493bbc141372fcfa503de83e0a61aa7387
+RMD160 (NetBSD-6.0/acorn26/binary/sets/xetc.tgz) = 511ebfe5076f361b7f7ca03a265d16052a16d259
+MD5 (NetBSD-6.0/acorn26/binary/sets/xetc.tgz) = 165cffbb6d2c79663198d80c82afac1e
+SHA1 (NetBSD-6.0/acorn26/binary/sets/xfont.tgz) = ce0e141beeffeb5b470478e9887e4127da85de3c
+SHA512 (NetBSD-6.0/acorn26/binary/sets/xfont.tgz) = 5d98354ff77103793d56af3192ab5f9afcde62208791976064ac33a149f994e0227dd5dd28ed544eeac5ea504e5212d5fb9e7d05e59e5a48a2fe4062e34e3106
+RMD160 (NetBSD-6.0/acorn26/binary/sets/xfont.tgz) = 4d09f5e82fec875ef0ea328809465e7a98f2ebfc
+MD5 (NetBSD-6.0/acorn26/binary/sets/xfont.tgz) = be26b3890261302420b09976a1d38144
+SHA1 (NetBSD-6.0/acorn26/binary/sets/xserver.tgz) = 4ccfef1d49179603286042088bec0218c6b2031d
+SHA512 (NetBSD-6.0/acorn26/binary/sets/xserver.tgz) = 809fc0a9065c1b9e7cd17aeb0d41cfd3158efd6c585556af01c4a3c93f0df3646a2ff77c6994449a703a408c0988fc1aa68cf34c7e297a3056d73ded57034c12
+RMD160 (NetBSD-6.0/acorn26/binary/sets/xserver.tgz) = 403604404261764c74f10fab774c4653fd20cc9b
+MD5 (NetBSD-6.0/acorn26/binary/sets/xserver.tgz) = 914f909b6878cef16a92765a8cbb52ca
+SHA1 (NetBSD-6.0/acorn26/binary/sets/kern-FOURMEG.tgz) = 3e74d7ca4f0ad181d8f37a28fc179fe4fdc3521f
+SHA512 (NetBSD-6.0/acorn26/binary/sets/kern-FOURMEG.tgz) = 794689c5f293ed453fe424f3e1cd45bdf6127a08da0e6ded9b6f3c8afe0af6f65b1ca1aca96db5b8a4891102f38b2895aca82bba0dce8ee1389f2eb439ce11b7
+RMD160 (NetBSD-6.0/acorn26/binary/sets/kern-FOURMEG.tgz) = 66e7db127f67cf318789d74d7bdf5a57fdb922ed
+MD5 (NetBSD-6.0/acorn26/binary/sets/kern-FOURMEG.tgz) = f26ed42c971ee7ce64682f5fa5a5c2b5
+SHA1 (NetBSD-6.0/acorn26/binary/sets/base.tgz) = 48cf8b5b14a8a61a85bf8bfa1ae739ef599a17e6
+SHA512 (NetBSD-6.0/acorn26/binary/sets/base.tgz) = f68d2d3e80b88fad8ff98a9bfdac7cc039d51e766130d3cade364a83bede6c6984c0cbcc56588f81760e6754ebbb08ad444fe4dd006e8ef91a3bc4e66c777e4a
+RMD160 (NetBSD-6.0/acorn26/binary/sets/base.tgz) = 090a8ef5abfede25635b86e1ed989bd8c7b988e5
+MD5 (NetBSD-6.0/acorn26/binary/sets/base.tgz) = 6ea39b172012faf2bdbcb861d0de443c
+SHA1 (NetBSD-6.0/acorn26/binary/sets/comp.tgz) = 8d6222fb0ba80750737719e3c9eb4d42aef1c92e
+SHA512 (NetBSD-6.0/acorn26/binary/sets/comp.tgz) = eeacb62b5075abfd130a4ee4bcc8b3ada6fe2e3b4ad95cfa65fb45e61956092368c9e7dd90b7fbfefd7d96162890d23872d3bc4ad92488d92a50738d59629f9c
+RMD160 (NetBSD-6.0/acorn26/binary/sets/comp.tgz) = adc77379342aa005884eb58a65a8d57d07e63853
+MD5 (NetBSD-6.0/acorn26/binary/sets/comp.tgz) = a660a76cb874c828690f5a128ff61501
+SHA1 (NetBSD-6.0/acorn26/binary/sets/etc.tgz) = 183e6af0c9ddf7c62218f3616129ed1223e0fd0b
+SHA512 (NetBSD-6.0/acorn26/binary/sets/etc.tgz) = 0c9967126ddf9cdfdf568b6a7183bd9a17a119798f318f511ec9b9351770ffb8a394d57ccf09ce1e38b4e56d836f4ab61c943e81d932007e8726819733b0b108
+RMD160 (NetBSD-6.0/acorn26/binary/sets/etc.tgz) = 92fab0f295c28c53f693444918b12bc026596a3f
+MD5 (NetBSD-6.0/acorn26/binary/sets/etc.tgz) = 1c4124013d68bbf2b85d3025aab1a0a9
+SHA1 (NetBSD-6.0/acorn26/binary/sets/kern-GENERIC.tgz) = 86de3875a3df7b400d86d2f97ea02067dac49288
+SHA512 (NetBSD-6.0/acorn26/binary/sets/kern-GENERIC.tgz) = c3eb9e9e696c7f166c9da1acdbf14b314863f68a5af5786c9d79c5e2ffd9c70ad366a6cec7ff0858ffae2ab8e028c0224b091de5bfcfad6a4ae5327709c7981e
+RMD160 (NetBSD-6.0/acorn26/binary/sets/kern-GENERIC.tgz) = f2b59e92e18402c2e96a4b254fa18f21b339629c
+MD5 (NetBSD-6.0/acorn26/binary/sets/kern-GENERIC.tgz) = 107061f8599c58b8a982c7f6b96e0fd3
+SHA1 (NetBSD-6.0/acorn26/binary/sets/modules.tgz) = 2e72e54d98a0bae829f2fdd53a9a927a4269fe83
+SHA512 (NetBSD-6.0/acorn26/binary/sets/modules.tgz) = 560d27968ab9740b7fec62e5afefddc5d6db9ebb73b79c38c34ab4d609fc4cfebe8bef7e05eb5fdacc17502236ae95675e2db87e5a8c258a3633f93635fe5aae
+RMD160 (NetBSD-6.0/acorn26/binary/sets/modules.tgz) = eee9e83fc9e9936b93f382beb4f619c0d7010cd8
+MD5 (NetBSD-6.0/acorn26/binary/sets/modules.tgz) = 3e0985108f65114c721c3672279d28cb
+SHA1 (NetBSD-6.0/acorn26/binary/sets/tests.tgz) = 72b14d964822d8a2e03c4d3855c33b2d5a02bcf5
+SHA512 (NetBSD-6.0/acorn26/binary/sets/tests.tgz) = 1b87e9174bb22df4c6b894fb731c53df03af87e6dbb8b2488fec832721c3ef3508c7dac35a2f51f144c6e726a8fff61d6f66d6a5c354c11ca2f2c8fe31a7d7a8
+RMD160 (NetBSD-6.0/acorn26/binary/sets/tests.tgz) = aa26cbefa7b2891c0d2e51a5f59c123c223721ff
+MD5 (NetBSD-6.0/acorn26/binary/sets/tests.tgz) = a69e9d96707beccb4149aed72d701bfa
+SHA1 (NetBSD-6.0/acorn26/binary/sets/text.tgz) = b4974a12425354e1d6dbe8e1e7def8ca2c8bea5a
+SHA512 (NetBSD-6.0/acorn26/binary/sets/text.tgz) = 360652de2f694807759927e57beff0e60fae7855d4ab55a574e8c2d9cab25bf76bf1b880dd419c4bef6339dc72a16959f563e964644d64a81029354c87fb1b08
+RMD160 (NetBSD-6.0/acorn26/binary/sets/text.tgz) = e40abdac843b3ac9055fdacff0c74d259609886d
+MD5 (NetBSD-6.0/acorn26/binary/sets/text.tgz) = e1ad13174b20a114fd74863b8a5a0399
+SHA1 (NetBSD-6.0/acorn26/installation/misc/netbsd-INSTALL.gz) = e7fda95700ee86c95cb2135c841840b815319eb5
+SHA512 (NetBSD-6.0/acorn26/installation/misc/netbsd-INSTALL.gz) = 79c810a6e1f7221aacd1e7b7edca4064ec6c3b7b99bbbe7282bdec0354c9387f9170019c7e6df5ec049497d8b0a69c07aaf485dfd286069437c16b7a44dd04ab
+RMD160 (NetBSD-6.0/acorn26/installation/misc/netbsd-INSTALL.gz) = 68c551c4746c765068cc39e81eff40d13065ac19
+MD5 (NetBSD-6.0/acorn26/installation/misc/netbsd-INSTALL.gz) = 2f3714cfea4b8ace15469ca877ddcaf2
+SHA1 (NetBSD-6.0/acorn26/installation/misc/boot26,ffa) = 983591033b4f5301e5c3f9696b3e9037aaa11047
+SHA512 (NetBSD-6.0/acorn26/installation/misc/boot26,ffa) = 16ef2baf8d00639c68dafbf42a563815ca6a0cc51c1083820c47d10c06422abfa8257d25be675024bf674d70def6747cb70a45d2a8451551e0b7ac6915057bfe
+RMD160 (NetBSD-6.0/acorn26/installation/misc/boot26,ffa) = a517e705c94bf87b617648aee6542e8194ad29b4
+MD5 (NetBSD-6.0/acorn26/installation/misc/boot26,ffa) = ed0fd36ea9ed9893250d9f588d5c358c
+SHA1 (NetBSD-6.0/acorn26/installation/misc/netbsd-INSTALL.symbols.gz) = 3eca116cb41df17471b9e24e453c3164bc2f6fee
+SHA512 (NetBSD-6.0/acorn26/installation/misc/netbsd-INSTALL.symbols.gz) = e2fce3e17958cd1865c584fa3a97a061f8fef09a8793f61018144e753d4667026349747ac7d9dfa6ad70afe2c4dbfeaef1f5718430947958f34785858e2424e3
+RMD160 (NetBSD-6.0/acorn26/installation/misc/netbsd-INSTALL.symbols.gz) = 9f25df06373241ff5dfaafa250311a4bc5020197
+MD5 (NetBSD-6.0/acorn26/installation/misc/netbsd-INSTALL.symbols.gz) = 4daa298789745793c9f9f1a03c4ecdb5
+SHA1 (NetBSD-6.0/acorn26/INSTALL.html) = e1896519f52cf8b3574c2ddad19d135e837ff05b
+SHA512 (NetBSD-6.0/acorn26/INSTALL.html) = 9951385e876eed0126a9706c5c075453fd27ef0eb8fc42fa1bdca0e100a04d5f2d269145040eaffcfb683ef63f51a574254ce02cd3d0d3449ef867205e55c49a
+RMD160 (NetBSD-6.0/acorn26/INSTALL.html) = 4e81e718d1526b61a1ebfc3dde631cc1c4f1998d
+MD5 (NetBSD-6.0/acorn26/INSTALL.html) = e77700615f6d71545079d4f98be4fda3
+SHA1 (NetBSD-6.0/acorn26/INSTALL.more) = 31ce17bd0e1a3eb8956f06af4a2635a8cea3693e
+SHA512 (NetBSD-6.0/acorn26/INSTALL.more) = c9693333dbbde859f3f8e1f5cb571e43eeac2a1727ce7e4681b4dacda1e145a54bacbb16346bed669a0f83e3592e7b824b66d0e0a2a0f39ab41891a0bee78ca5
+RMD160 (NetBSD-6.0/acorn26/INSTALL.more) = 12606307f5f4314a84d4401c5297bcf701fc1dcb
+MD5 (NetBSD-6.0/acorn26/INSTALL.more) = 2104dbaa19182d2de7416aa62b7de537
+SHA1 (NetBSD-6.0/acorn26/INSTALL.ps) = 61b3e6838c01429478fd78f84fc380a320f1b2ba
+SHA512 (NetBSD-6.0/acorn26/INSTALL.ps) = d96d21356a59e59ab344d4e4b720e9425b3e7a3f926e8e7d453f33c907eff12c9dfdb8a97133d77bafc30a7fdf5fb63ab529a73facbad6ac8f9a36c63a236db5
+RMD160 (NetBSD-6.0/acorn26/INSTALL.ps) = 50c971d098fc714fb2efe2f3e2cf49351a0f8fc5
+MD5 (NetBSD-6.0/acorn26/INSTALL.ps) = f0d32affe70e695f4bcbe2df304f6a65
+SHA1 (NetBSD-6.0/acorn26/INSTALL.txt) = 00ac475ec70626dc1041211ecd0e5c7e213af948
+SHA512 (NetBSD-6.0/acorn26/INSTALL.txt) = 816c536f0caacbf292b9b54e812dc474299ee6a1084682321039bb1d3fd725523d76666fc14c772951ca45409550a25b5b74cefa0bf3f7539a17995a56df9756
+RMD160 (NetBSD-6.0/acorn26/INSTALL.txt) = c4618e23cd501a7520502285a24dc8813e1a4913
+MD5 (NetBSD-6.0/acorn26/INSTALL.txt) = f02c846c660d531f87f85271e991c77b
+SHA1 (NetBSD-6.0/acorn32/binary/kernel/netbsd-GENERIC.gz) = 8d2b1f19b2ba2231aba8e20c14ab5fd83dde59ae
+SHA512 (NetBSD-6.0/acorn32/binary/kernel/netbsd-GENERIC.gz) = 364ad36c66788c822a3cbfd0ddffafc6d19f9bb82144be988848970b7e0b6d11c2afaf4784f2132affe6ca052c69a4595181b1c37363637bb54f849e5bf4a1dd
+RMD160 (NetBSD-6.0/acorn32/binary/kernel/netbsd-GENERIC.gz) = 02d7f52cc0c15ff1039f3767cfa3840e5551e03a
+MD5 (NetBSD-6.0/acorn32/binary/kernel/netbsd-GENERIC.gz) = 96f504edccc8d4f5657c1837cdfd2aaa
+SHA1 (NetBSD-6.0/acorn32/binary/kernel/netbsd-NC.gz) = fc98fecc5548fde9220873e791d4d4846cefe4b3
+SHA512 (NetBSD-6.0/acorn32/binary/kernel/netbsd-NC.gz) = ff106589ca7b58c2ef3146a93be72b73987c221694400f3a2256728e618a7b486f32020f031e68edade5d13b3b9584a18ca88ce3fed71f06f9b494b3cb6eb844
+RMD160 (NetBSD-6.0/acorn32/binary/kernel/netbsd-NC.gz) = 4ff74a916d3283eb80e77739fd31dcda4890658b
+MD5 (NetBSD-6.0/acorn32/binary/kernel/netbsd-NC.gz) = f3a826b7eea3f009868a5ad419b69c3c
+SHA1 (NetBSD-6.0/acorn32/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/acorn32/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/acorn32/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/acorn32/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/acorn32/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/acorn32/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/acorn32/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/acorn32/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/acorn32/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/acorn32/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/acorn32/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/acorn32/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/acorn32/binary/sets/kern-GENERIC.tgz) = 0ec8993d446ad847bf7a6154a19c638d944bd24b
+SHA512 (NetBSD-6.0/acorn32/binary/sets/kern-GENERIC.tgz) = bed0345f83d42ee18b1cb1fab95e6780a217edda00c0c548aeb99323327493d1720b615d746a4e364a5217f963f24ae55142fc943a0d95aec65d8ddff2d36045
+RMD160 (NetBSD-6.0/acorn32/binary/sets/kern-GENERIC.tgz) = 2f27e6f036ad4fb08171f93e21324b9f901b781a
+MD5 (NetBSD-6.0/acorn32/binary/sets/kern-GENERIC.tgz) = 5eed762a46bf55d66491dab47bd40f23
+SHA1 (NetBSD-6.0/acorn32/binary/sets/base.tgz) = 519435bdcdffa41f24c56796558ad43ba6c89f31
+SHA512 (NetBSD-6.0/acorn32/binary/sets/base.tgz) = b7a3f4a5627790133104674c25e434d16a0e706006352f0032a4672f624c7fbf37b0678f72f593c5e17dea469afc03e09ac914eb4a02acb47b9a5673bd7e9777
+RMD160 (NetBSD-6.0/acorn32/binary/sets/base.tgz) = caf168bcd8c374896c8a0408e3d34e9c7e6f2c7b
+MD5 (NetBSD-6.0/acorn32/binary/sets/base.tgz) = b221228a61e59d66f1b457f5dcb1b5cc
+SHA1 (NetBSD-6.0/acorn32/binary/sets/comp.tgz) = 54b3cdd58c6db224ec42033f1f40842e55625e9f
+SHA512 (NetBSD-6.0/acorn32/binary/sets/comp.tgz) = a32e6f39ea01c783e1ff603c8774130698db0056923ef4c029f29f0df20f6b63885f33a50586774bc7c12b392f278344afd3aca42112bed8a3cd14d6ef72ff7e
+RMD160 (NetBSD-6.0/acorn32/binary/sets/comp.tgz) = cde7f725c376e8c0633d821357033e742358bb28
+MD5 (NetBSD-6.0/acorn32/binary/sets/comp.tgz) = c3866ce0cbc35fc4ffc58b14cc72ed31
+SHA1 (NetBSD-6.0/acorn32/binary/sets/etc.tgz) = e7c005ca92edbf1b8225f951b95b5938a94ee651
+SHA512 (NetBSD-6.0/acorn32/binary/sets/etc.tgz) = 01b47e91a0969eb2c3d7fd7f73563e98201ab401b9069b6d5e64e878757761410b8a181fcd04b141168c851d466e6d4e1b48b540e654d1831195deecbe5c23f7
+RMD160 (NetBSD-6.0/acorn32/binary/sets/etc.tgz) = f654da0c3fa14a8d8dc3a0cdb977d98b07b0d4ac
+MD5 (NetBSD-6.0/acorn32/binary/sets/etc.tgz) = 295b42a630082e4db876d35a7e5a204c
+SHA1 (NetBSD-6.0/acorn32/binary/sets/kern-NC.tgz) = e0744de8e7bc2a5808e603563cd8201de0601323
+SHA512 (NetBSD-6.0/acorn32/binary/sets/kern-NC.tgz) = 93c2fda5dd5a16eab210f74c0cf749fd013ec3488d6424fea84d404b2db5555a449a6a0ce9d936d7e18ec93216b1fa7a914e951dba3f223ac6b4de27d1f8cd32
+RMD160 (NetBSD-6.0/acorn32/binary/sets/kern-NC.tgz) = b0be18f3134075df50daec32dc87e30f370f7531
+MD5 (NetBSD-6.0/acorn32/binary/sets/kern-NC.tgz) = 5b8eb4b95fa6151bfbcaf0f72a6f6abb
+SHA1 (NetBSD-6.0/acorn32/binary/sets/modules.tgz) = 7df712c3742771ef53b42065426e7761020cf439
+SHA512 (NetBSD-6.0/acorn32/binary/sets/modules.tgz) = 3c682c61bca3059470ea6ceaf5e40314cc1876b9b183910692a1664a975aacae619c2214695a92f68463142940640042ba48f9acb39488fddfa757ffb74eb6e4
+RMD160 (NetBSD-6.0/acorn32/binary/sets/modules.tgz) = 35fc06c8194cb14f2258ce805c1e4fb8097669d0
+MD5 (NetBSD-6.0/acorn32/binary/sets/modules.tgz) = ffbd55bff72382bbc82342bacf6840ba
+SHA1 (NetBSD-6.0/acorn32/binary/sets/tests.tgz) = 68dae6dac916379bb48be79e8b2fe49898c4cfe5
+SHA512 (NetBSD-6.0/acorn32/binary/sets/tests.tgz) = b06a5ac96d76e0521e2d6666518a1549975a4d11767264c7d3b0d3dd8afe8aaa8e4f3113095d18d74146ee7e4c17a8d8a180bb4367c9aff6359b60ec06107970
+RMD160 (NetBSD-6.0/acorn32/binary/sets/tests.tgz) = 5a4c05ecc975a7ee61eda422a7dc7a5b1084424f
+MD5 (NetBSD-6.0/acorn32/binary/sets/tests.tgz) = ef0313ce1e3aec16c96660fc0b8e691b
+SHA1 (NetBSD-6.0/acorn32/binary/sets/text.tgz) = bb5835aee28d492add5e601c1323c4c1f0ac09e0
+SHA512 (NetBSD-6.0/acorn32/binary/sets/text.tgz) = ac45662324b717ccc775d4f4adfaf6623e8383fea5c5d4177fe21f8799a2a7534faff515c979f85cac6de86f166a0fcbc1021a8b8ff2a2c787fd341a4e6a6c91
+RMD160 (NetBSD-6.0/acorn32/binary/sets/text.tgz) = 96fbbe37b32d596fad17af067c28acf08eaaaa57
+MD5 (NetBSD-6.0/acorn32/binary/sets/text.tgz) = 1ff71742549a26794970d5aaef2c5f09
+SHA1 (NetBSD-6.0/acorn32/binary/sets/xbase.tgz) = 150aad78ea2477c5c1b395bda15bae8f0f72d36c
+SHA512 (NetBSD-6.0/acorn32/binary/sets/xbase.tgz) = 7ff70ee14b5943899517b4a7b2422ba1c62468399f55905e595d50de15fcfa2e89281a917c96d6d36e2dec519162227f7e6809c9a1da475c68982216d9acb242
+RMD160 (NetBSD-6.0/acorn32/binary/sets/xbase.tgz) = 0411d8686275c3d1146e42ddb69a0080bc82d950
+MD5 (NetBSD-6.0/acorn32/binary/sets/xbase.tgz) = 97aec1ef3a6ef744c85a7eaa6c403c1a
+SHA1 (NetBSD-6.0/acorn32/binary/sets/xcomp.tgz) = 9847900750d33556792e7b62e3e0ffc3f3ea625f
+SHA512 (NetBSD-6.0/acorn32/binary/sets/xcomp.tgz) = 010fc75bcd0355d1ea09cd8ddba94b16fab7224bec4aba26d07bf43f259b47b564fe008e6c477ce4a41161ae76dbd26d89f894ec5bf2ea7193cab2965d96de50
+RMD160 (NetBSD-6.0/acorn32/binary/sets/xcomp.tgz) = 975dbb1ec0a8f32cee4bfe55b4adb9f617d917be
+MD5 (NetBSD-6.0/acorn32/binary/sets/xcomp.tgz) = 7e761d7288845752bf05af5ac943d158
+SHA1 (NetBSD-6.0/acorn32/binary/sets/xetc.tgz) = 6b7815869c1c48a2efb0dfcdaae373700d5da8d9
+SHA512 (NetBSD-6.0/acorn32/binary/sets/xetc.tgz) = 42cbbc48a006498d46221eff6403acceeaf20ee5cb4a4f368b74e5b4599cccbd54f3d83b4a55359622599184f376f6bea2f2ad0feb364ce7d0293c3fb9d5b32d
+RMD160 (NetBSD-6.0/acorn32/binary/sets/xetc.tgz) = a60ea2e898741a2d009ca8c6c621fbcae1f1efce
+MD5 (NetBSD-6.0/acorn32/binary/sets/xetc.tgz) = 16cc8b76db930a1eb7b009e7776e2881
+SHA1 (NetBSD-6.0/acorn32/binary/sets/xfont.tgz) = 558af1104a11439ab8c868728c55027dd5862ce8
+SHA512 (NetBSD-6.0/acorn32/binary/sets/xfont.tgz) = fb28abf27b6cadadc9c0ca82df3025e22d4e0661dcc0488083c7339c5372acf0adea8edc848b7cea50980d971aa24f81bbda068b4b4bed6ac4cf26cc4f5b35bf
+RMD160 (NetBSD-6.0/acorn32/binary/sets/xfont.tgz) = f6df63aefaa5c459b2c86ae79fc7b07253424c97
+MD5 (NetBSD-6.0/acorn32/binary/sets/xfont.tgz) = 498abc855e6717ab51d5d0be8fa5662d
+SHA1 (NetBSD-6.0/acorn32/binary/sets/xserver.tgz) = 292d81e44c40c73e8341d59175695b649f839baa
+SHA512 (NetBSD-6.0/acorn32/binary/sets/xserver.tgz) = 3593eeeda7a9f55ff29622c2a95672c746f9235e007b3d8e81e33829fa655d0f6bc8ba90f6ef53baad1b25789fd656d5d8ea14152a9b41abf1a1bfbd2b11937f
+RMD160 (NetBSD-6.0/acorn32/binary/sets/xserver.tgz) = e0e2425da086891061ddae334fd8e98d77c519c9
+MD5 (NetBSD-6.0/acorn32/binary/sets/xserver.tgz) = bd36f768d1488956ea90a9f13ac8929c
+SHA1 (NetBSD-6.0/acorn32/installation/kernel/netbsd-INSTALL.symbols.gz) = b155be9bb81a3c15abe2b6732d48e8bfe53abc53
+SHA512 (NetBSD-6.0/acorn32/installation/kernel/netbsd-INSTALL.symbols.gz) = a3a1c068acbe2d634da3442aac4de7107dfcaf3634be291f9c3285aeb9fa680e59acb9273774e6317f71d6f9be2e1851a0e0f60b3cc83972f3e185f3e8237522
+RMD160 (NetBSD-6.0/acorn32/installation/kernel/netbsd-INSTALL.symbols.gz) = 3ac12cb07a5e8b9810946c489b9a4c3b9aecdcbc
+MD5 (NetBSD-6.0/acorn32/installation/kernel/netbsd-INSTALL.symbols.gz) = 1fe3c151480781a09a6f642ab87b9495
+SHA1 (NetBSD-6.0/acorn32/installation/kernel/netbsd-INSTALL.gz) = dc38de07bef2736068ee9cd3103f87ea6938fd6d
+SHA512 (NetBSD-6.0/acorn32/installation/kernel/netbsd-INSTALL.gz) = 11b29549b4b8232380eb6db4bf89a979e9b2a2726a3c7ff51ab059fd4f8b6a979d2cb7fe6d0c1802e345c445989655339a9a8b8d4a10f728ac7a24bae9f1830f
+RMD160 (NetBSD-6.0/acorn32/installation/kernel/netbsd-INSTALL.gz) = 605df2071d2e590be8a4d0f83c9a55a140066bc5
+MD5 (NetBSD-6.0/acorn32/installation/kernel/netbsd-INSTALL.gz) = dbc61ce2c5adf5f8e18441138aa4ae5a
+SHA1 (NetBSD-6.0/acorn32/installation/misc/BtNetBSD.spk) = 12dac3d0059f8eef736a378bb6e026166694c1a5
+SHA512 (NetBSD-6.0/acorn32/installation/misc/BtNetBSD.spk) = f54991c3e27613ac735b1a10d5ffcc102799417a68415b74c9557657c0e714fd7faa381a3945991bd80b49cefa2ec01395d88d0e935d063ff91174a8e12887ee
+RMD160 (NetBSD-6.0/acorn32/installation/misc/BtNetBSD.spk) = 02e5c2a9d751d8236ebbd0d4151f687fdd896735
+MD5 (NetBSD-6.0/acorn32/installation/misc/BtNetBSD.spk) = 4b3907f57b03d49765f92ffff178ef40
+SHA1 (NetBSD-6.0/acorn32/installation/misc/ramdisk.fs.gz) = 73ae7358fb27f8d227e253b6f43e5fcbdd7cb5f3
+SHA512 (NetBSD-6.0/acorn32/installation/misc/ramdisk.fs.gz) = 3c68e80766ae3603b289f11469c2c80ba1ffb5eb30f323fee016d992d7d226bf1984f487ee486cb3d0b1739bf45ae3ad52ddeb5f90ff2d0abd08cafc1a181ccf
+RMD160 (NetBSD-6.0/acorn32/installation/misc/ramdisk.fs.gz) = 3320c3a2a2d0e60d55b4612811d1870a4e8b9ec1
+MD5 (NetBSD-6.0/acorn32/installation/misc/ramdisk.fs.gz) = 70f0aee2f9cfc56744c50b3bed23b5a5
+SHA1 (NetBSD-6.0/acorn32/installation/misc/boot32,ffa) = 1a8c3e3a8950e68d6fd3d22ccf985814f67e00c1
+SHA512 (NetBSD-6.0/acorn32/installation/misc/boot32,ffa) = 2f7091d17fc4c910846f5cdc8cd267eb7d4056e281175c00407ab958548c62af4936394a04bde6549223fc874df72c5c46b0d11ae32ea6970c17326b0cedc6af
+RMD160 (NetBSD-6.0/acorn32/installation/misc/boot32,ffa) = 5821041d9dff2485cba9ab49e289a0bd479fc63d
+MD5 (NetBSD-6.0/acorn32/installation/misc/boot32,ffa) = 0f03b946d6479db2aaf8088dba4632ed
+SHA1 (NetBSD-6.0/acorn32/installation/misc/splug.bas) = 19015ba8a9efd73fea65fe180596271640893d1b
+SHA512 (NetBSD-6.0/acorn32/installation/misc/splug.bas) = ef38a1da79c93ff798c858f02d3d13e88d24bd0b56808ddb71b3dd577203195a60f601aa52e37892ab164ef7dd0cd490995ac9cd689fe33282fb49435f4c4d56
+RMD160 (NetBSD-6.0/acorn32/installation/misc/splug.bas) = 3080fc8d5ff946754a33bc41e7ad83cbe1eaa0b5
+MD5 (NetBSD-6.0/acorn32/installation/misc/splug.bas) = 5596dc5df580ceb656d040393e778087
+SHA1 (NetBSD-6.0/acorn32/INSTALL.html) = d16bd043227b34d9a9c3c69f380c6c42b50d080c
+SHA512 (NetBSD-6.0/acorn32/INSTALL.html) = 629401693cb91992f46b839a34bf4c4ac704194fd8aa6be3aa51e405920b697fe961fa7320eef7a4cf804dad96891b38ca57c61ef3c0c6096bb6bc71f58e55a9
+RMD160 (NetBSD-6.0/acorn32/INSTALL.html) = 222b9b590667b0a6dfe2717bb6dc94e95a485174
+MD5 (NetBSD-6.0/acorn32/INSTALL.html) = 07466bc8646d08bee6c7030d00cc9173
+SHA1 (NetBSD-6.0/acorn32/INSTALL.more) = 011db6fc8ab7b724dc66eafb3b712e9202bb2174
+SHA512 (NetBSD-6.0/acorn32/INSTALL.more) = d13335bfe65882608362fda44f89091113e3bffb53893f15bb747aaa72eefbb24ca3fd3d72017cfc446ba49ad7c00f34436e859f71727f9e6a182766a1810a13
+RMD160 (NetBSD-6.0/acorn32/INSTALL.more) = aaa800047583e64496187a80e54d0ac3bf4c851c
+MD5 (NetBSD-6.0/acorn32/INSTALL.more) = c45c7b7fd7522e41a977ffa6a58b5a4d
+SHA1 (NetBSD-6.0/acorn32/INSTALL.ps) = 78d2daf3255e7bc61b5682d5fcfd853d7dd25883
+SHA512 (NetBSD-6.0/acorn32/INSTALL.ps) = 4aec0769a5827735e13ab61dd80b5c7254561786afe0c95ff76796a8b29ae2284c064a1a1c523120366e37197bcbfd3d588985dbaae62c9848a4669d8c797714
+RMD160 (NetBSD-6.0/acorn32/INSTALL.ps) = 764dc8cc82d5623174886f98f77d808650ef90d1
+MD5 (NetBSD-6.0/acorn32/INSTALL.ps) = fc4371f1451a03c4ea429fe029e46d9c
+SHA1 (NetBSD-6.0/acorn32/INSTALL.txt) = 9d1ed61f6916645ffa30e66b23da2d0d24e18582
+SHA512 (NetBSD-6.0/acorn32/INSTALL.txt) = 10763c9164aeb2d4070f1677b0f97ca8263ec1b9d9c017fbcf348ce302d7d846fa669b741031eef4b12c27a7d077f6af9073f7668244b1b4daa39ab426d79ec7
+RMD160 (NetBSD-6.0/acorn32/INSTALL.txt) = 755fbe335d76c9b549fae4d01120cbe00290e8ca
+MD5 (NetBSD-6.0/acorn32/INSTALL.txt) = 1a6f36bd9f77e0773aeae95de9ceed8f
+SHA1 (NetBSD-6.0/acorn32/prep.RISCOS) = 269ee721985cbc44a8056ca4804f8b2d70d52a3e
+SHA512 (NetBSD-6.0/acorn32/prep.RISCOS) = 54923d8dc59e6a3852ceab25adbced3e545de19458c412552ef0cb47534303d812e8860662025b1aa9ddf9a99bb139f4be75656ef109546a328ba57985ec2cfa
+RMD160 (NetBSD-6.0/acorn32/prep.RISCOS) = 8e3acd93d35d85062996b061cff5d7293f46ee1f
+MD5 (NetBSD-6.0/acorn32/prep.RISCOS) = 3c0e290b44f735728abd3bda8bd96a0f
+SHA1 (NetBSD-6.0/algor/binary/kernel/netbsd-P4032.gz) = e9df71ffe487dd98c1aae0c6e79fbf8e4780340a
+SHA512 (NetBSD-6.0/algor/binary/kernel/netbsd-P4032.gz) = 48673b13075fc7694dccb1a31b6121281c5c0e85c5d7107a4f9414e9888c19f07133a07e43400495dd9e11757acc2fa2269458ae4b091900772c49a944624465
+RMD160 (NetBSD-6.0/algor/binary/kernel/netbsd-P4032.gz) = 85b0c6fde5bd0f4a02f71c30ccaf35d9bc29ac19
+MD5 (NetBSD-6.0/algor/binary/kernel/netbsd-P4032.gz) = 2f041466a193e263576e80bfca3ce8ef
+SHA1 (NetBSD-6.0/algor/binary/kernel/netbsd-P5064.gz) = f230eefee689dff40a0aca1983191c2e21c7dbde
+SHA512 (NetBSD-6.0/algor/binary/kernel/netbsd-P5064.gz) = eb7fea73f29d2141f508743785ee865bd5f7ce23477fc1bf256e40a0f47de76a7cdb22bfac0cb9dce94c0e1694b1c84b1760db13ab1b34248a6e04367817214d
+RMD160 (NetBSD-6.0/algor/binary/kernel/netbsd-P5064.gz) = 355d23c8cbde9c1a92bf5f1eb4e1f1890603e7f7
+MD5 (NetBSD-6.0/algor/binary/kernel/netbsd-P5064.gz) = 5ebc249debbe1797d915529f1d469f8b
+SHA1 (NetBSD-6.0/algor/binary/sets/games.tgz) = 27d9f98fecb3495e51939df9f107e81e527af26f
+SHA512 (NetBSD-6.0/algor/binary/sets/games.tgz) = 46bb4e10313cfffaaf4f7fa2157474ef940f94bcc9f84b46f829c7615bbf45e4e01edee7b7efb84bc28561e0712c37cfc737f9c2a0d9a73b67c80c8aa0f3a9af
+RMD160 (NetBSD-6.0/algor/binary/sets/games.tgz) = 947feea90ec2698a65d555cb78a29a001b086589
+MD5 (NetBSD-6.0/algor/binary/sets/games.tgz) = 355f00978fed8e8da6a251e591be5387
+SHA1 (NetBSD-6.0/algor/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/algor/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/algor/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/algor/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/algor/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/algor/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/algor/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/algor/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/algor/binary/sets/xbase.tgz) = 76468fcada5a9e26652aa9f0f9f3c94829a317e9
+SHA512 (NetBSD-6.0/algor/binary/sets/xbase.tgz) = b2adcfc2dedef30b21b885c8fc757d0479541744a280a9997fbeaa9c881009ab4b0019e0001a540a8eb6db5f84db87b365e420bb2d4270af209821bdb080369c
+RMD160 (NetBSD-6.0/algor/binary/sets/xbase.tgz) = 1e0074d03d9fbb3373e0a427b25cc7097bf6d3c8
+MD5 (NetBSD-6.0/algor/binary/sets/xbase.tgz) = a8f29ec2e3768405942f97af3dd08ee7
+SHA1 (NetBSD-6.0/algor/binary/sets/xcomp.tgz) = d8ac89f3f6ff20abb0adabc49227afdb74aa2040
+SHA512 (NetBSD-6.0/algor/binary/sets/xcomp.tgz) = 4f03213fb061dae9421747209628d06ede6bbb71a7560a9e1a54796b907f1620146a33fdce52974227a21acedcc210b99e15c4fdd36432eba60c1041a92d8cee
+RMD160 (NetBSD-6.0/algor/binary/sets/xcomp.tgz) = 6be5e72b9b57c9bdf8ed8ea127e2a73830feeecb
+MD5 (NetBSD-6.0/algor/binary/sets/xcomp.tgz) = 59a7ea141587417be38ab1f6056cc780
+SHA1 (NetBSD-6.0/algor/binary/sets/xetc.tgz) = b9f6b1a54ffab37b11f4c6e717b481cd087fb609
+SHA512 (NetBSD-6.0/algor/binary/sets/xetc.tgz) = 72f35e65f3a90967e250a2006d500619b3824f7f5c3d7494554f153ec5cda5b28c445f28c34a1e4463f40da5855e8d4257726411796967fe37763d90cf7fe461
+RMD160 (NetBSD-6.0/algor/binary/sets/xetc.tgz) = 1169c246f91189fd0c4ae86ac27a92f5c2edda3e
+MD5 (NetBSD-6.0/algor/binary/sets/xetc.tgz) = 8f3c52cc5af1cafaf7b0d0f884a5b537
+SHA1 (NetBSD-6.0/algor/binary/sets/xfont.tgz) = d06848571034f3b7fc975082f1de37b912acb18c
+SHA512 (NetBSD-6.0/algor/binary/sets/xfont.tgz) = 66a1013c935bee5e7e5d24325a527522306bcded7ced63790f2e58831b3ed91176a1b9510b2159be63504d5167d48d534919927ffc6e225ae2bb2487f90a9ede
+RMD160 (NetBSD-6.0/algor/binary/sets/xfont.tgz) = c9502843a5d4dd7e996e8d158c519cf7f8575cbd
+MD5 (NetBSD-6.0/algor/binary/sets/xfont.tgz) = e812899176eac2bf65a6d949ac3f3424
+SHA1 (NetBSD-6.0/algor/binary/sets/xserver.tgz) = ff805022f409202f3346c45475c7ec0f8187218e
+SHA512 (NetBSD-6.0/algor/binary/sets/xserver.tgz) = f2bb3810a5572b519980126a3d934f63b5ab5c2fcf9fb8166c556bd3cc14cfaa151d582086bb1506ac9ac7e21d4e70a5cd5c3faed96212d8a14a0b5bafdcc4c1
+RMD160 (NetBSD-6.0/algor/binary/sets/xserver.tgz) = d5ae336337cc77f7f55f542b3457918d6fc0efe8
+MD5 (NetBSD-6.0/algor/binary/sets/xserver.tgz) = 92447a1560887d337d22e2deed0670a6
+SHA1 (NetBSD-6.0/algor/binary/sets/kern-P4032.tgz) = 810ebe688c1817dcfd7cab153a6d9997900555b8
+SHA512 (NetBSD-6.0/algor/binary/sets/kern-P4032.tgz) = 8846047a1a93d3ba853e235b2169286e09f5955d3116bd2bdb18f0d252c8b0ae0d310f3ccf6d30244d089f7b077579e8246ddb27f32ddcee26e6b7b7b2266aaa
+RMD160 (NetBSD-6.0/algor/binary/sets/kern-P4032.tgz) = 039bc25b47bc29648ebb86fad5fb52852badc0fc
+MD5 (NetBSD-6.0/algor/binary/sets/kern-P4032.tgz) = f8011c18eab0acde582df5ddda0d3a57
+SHA1 (NetBSD-6.0/algor/binary/sets/base.tgz) = 1cacc62a3d246592b148a70bef11a751b63a4810
+SHA512 (NetBSD-6.0/algor/binary/sets/base.tgz) = cd448e4f0533c50daf74ed21467409013d512e128b177c9b9ab47771d3d2cffcbe403ba207309af77eb6712d316d9db2923205765be8d9045e2b2216f94774d4
+RMD160 (NetBSD-6.0/algor/binary/sets/base.tgz) = c78efd1403b1cb3af77f5a0cbddbd095505d4f65
+MD5 (NetBSD-6.0/algor/binary/sets/base.tgz) = 33b467da96b628c9b68cd57209d353b7
+SHA1 (NetBSD-6.0/algor/binary/sets/comp.tgz) = 3e955d4a87fe115e37da729b9d2474a775614d30
+SHA512 (NetBSD-6.0/algor/binary/sets/comp.tgz) = 12ce5ac677ba9f44944f57859218d668d3d2bc3323ac5793545ca7de849480dc093f03226fed4dac42bf7a4ee69fc998b4a5e2c62607d754e0b58a3cc73d3d9d
+RMD160 (NetBSD-6.0/algor/binary/sets/comp.tgz) = 106fbdfddd7c9bd13d1b5d2111b39d4338bd8c10
+MD5 (NetBSD-6.0/algor/binary/sets/comp.tgz) = 8d493a09f9e5580f830f15a3c0b12d84
+SHA1 (NetBSD-6.0/algor/binary/sets/etc.tgz) = c0511cfd28c1b22e71166507a0f564c24015f025
+SHA512 (NetBSD-6.0/algor/binary/sets/etc.tgz) = d47fee208d0d59cf0edbbf2c75bbe404a176f66f0058db93ba553fffdc31d5b5ed6c2ba2df505f7b1576cd06cc27de5da3dfda1230927c2ac603a326aff688b2
+RMD160 (NetBSD-6.0/algor/binary/sets/etc.tgz) = 09d069cea8b5a133736d483097bcf24649f0d52a
+MD5 (NetBSD-6.0/algor/binary/sets/etc.tgz) = 4ce17fdd45c77f0d8632a836463db036
+SHA1 (NetBSD-6.0/algor/binary/sets/kern-P5064.tgz) = 1fa8786b3038a1bc218f5e8280ae3871f5687e4c
+SHA512 (NetBSD-6.0/algor/binary/sets/kern-P5064.tgz) = 0977b6911d05ee98e53841af3acff6b5f751c93841c96f3869cfad0e978596204cb22d3a1608842c36d24a50f16a35d0ec00288d56fd69e6cd33d8b2b1dc37c6
+RMD160 (NetBSD-6.0/algor/binary/sets/kern-P5064.tgz) = 8fd50961f224a94e272a15df2061f226d0d2456a
+MD5 (NetBSD-6.0/algor/binary/sets/kern-P5064.tgz) = 7932f7ce7a89995425a3e97319de27b7
+SHA1 (NetBSD-6.0/algor/binary/sets/modules.tgz) = 3627b369e3392221946d517d950da8bb6c3b6170
+SHA512 (NetBSD-6.0/algor/binary/sets/modules.tgz) = bbdaa688d423fce2ba3513727b4fd0758cb3c6b6db3147b09319990270380b4cf8feede38a2b57757095627356d6955a30d647d770d67a2bf97e66f0673e4770
+RMD160 (NetBSD-6.0/algor/binary/sets/modules.tgz) = 5040267ebae4a2069ad1b9168b31d568d2f81fca
+MD5 (NetBSD-6.0/algor/binary/sets/modules.tgz) = d3e9a884b3cef9a6ee2dd6b8c715901a
+SHA1 (NetBSD-6.0/algor/binary/sets/tests.tgz) = 76544bff809ab691a739a3ffebc3988b1473fdc2
+SHA512 (NetBSD-6.0/algor/binary/sets/tests.tgz) = 5e5709ec49a4e20f253ed5686f9fc62300b3c0aa70bc2cf036a41130803c578cc692b89fc234334723bc39f74cb0a8bd9e9be88cfa692213554713766c9a3b7b
+RMD160 (NetBSD-6.0/algor/binary/sets/tests.tgz) = 66eb344c33b3c463c3a6c3af96af263d8cb6dfe0
+MD5 (NetBSD-6.0/algor/binary/sets/tests.tgz) = 3ae196d57949ee2cb682ab871c9ef316
+SHA1 (NetBSD-6.0/algor/binary/sets/text.tgz) = fe2e0c01c5af66987eab5bb59b06fba32c006be2
+SHA512 (NetBSD-6.0/algor/binary/sets/text.tgz) = 3fdd84b91bc54bb3f045bf068d01b4b67fe35a62deffdf8b5964f5dc978d55b58b5b592c9fc9a05d40b305914ce7465981b4d55ec95571203c54f240a2bdff4c
+RMD160 (NetBSD-6.0/algor/binary/sets/text.tgz) = 420dc3d206809ea2438b82c912a041637e4d0949
+MD5 (NetBSD-6.0/algor/binary/sets/text.tgz) = b421f4428b8e52bb19e997954cb1d0ca
+SHA1 (NetBSD-6.0/alpha/binary/kernel/netbsd-GENERIC.MP.gz) = 20bd351669d8b8c5e6ed9726567516aa2b20e101
+SHA512 (NetBSD-6.0/alpha/binary/kernel/netbsd-GENERIC.MP.gz) = 16699cd9ff46de1282439235429a63aa38ad6eae8197f037e7f8bd2324ff696a04d4b2008723edb8bdae8e55f139024c55e3858670a3db4f6ff317fef3d39919
+RMD160 (NetBSD-6.0/alpha/binary/kernel/netbsd-GENERIC.MP.gz) = 5897524a8bc830e819894c17803a141c65b4f417
+MD5 (NetBSD-6.0/alpha/binary/kernel/netbsd-GENERIC.MP.gz) = 0ab46adc2ba2d37bfaac5fe5296fe616
+SHA1 (NetBSD-6.0/alpha/binary/kernel/netbsd-GENERIC.gz) = daee92c8428d90796700da80702277f38afd7c78
+SHA512 (NetBSD-6.0/alpha/binary/kernel/netbsd-GENERIC.gz) = 658bcdb3fe7c015e0de0d6fd795e9a9033618eb193c6e81b179b978836c93cd3b6a09f79ff4405f831f81e003bd190e91534112e9a923d10c3fb094478f4421a
+RMD160 (NetBSD-6.0/alpha/binary/kernel/netbsd-GENERIC.gz) = 2bbdd4f11b998dbe08e2076e895785e90f17b192
+MD5 (NetBSD-6.0/alpha/binary/kernel/netbsd-GENERIC.gz) = 12d571967266dbdce4d9c0b02cda4718
+SHA1 (NetBSD-6.0/alpha/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/alpha/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/alpha/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/alpha/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/alpha/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/alpha/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/alpha/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/alpha/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/alpha/binary/sets/kern-GENERIC.MP.tgz) = bef91c02bdb6ebd5e578bae73acbcbc5d9fcb47b
+SHA512 (NetBSD-6.0/alpha/binary/sets/kern-GENERIC.MP.tgz) = 0800ef43e76c838a4f91535fbad30adee37a4be94d01220ce3d0ca898204ef4b9140d753853faa29944ef1f0b7feff2a54551633ed10293751d0fb5c2134c858
+RMD160 (NetBSD-6.0/alpha/binary/sets/kern-GENERIC.MP.tgz) = bbc5e568ee1036473614f45ce443ae6129c2afb1
+MD5 (NetBSD-6.0/alpha/binary/sets/kern-GENERIC.MP.tgz) = 255686b1fa7b97a53599c7759fad4843
+SHA1 (NetBSD-6.0/alpha/binary/sets/base.tgz) = d6a62bc7f515a3cf470fe4298045346f79dbdfb8
+SHA512 (NetBSD-6.0/alpha/binary/sets/base.tgz) = b3eee92239be76b17cf36cf49d845123dd26853ec162d2f340338fff172af3ca20d6c85025e9a5fbc085d8522d331ecec488acc034c757f7a44d885b8f31ec41
+RMD160 (NetBSD-6.0/alpha/binary/sets/base.tgz) = 447c0754e06c36c2844563722dfd727938b7fdb5
+MD5 (NetBSD-6.0/alpha/binary/sets/base.tgz) = e898499ce51685436186e3be5227184a
+SHA1 (NetBSD-6.0/alpha/binary/sets/comp.tgz) = 3cd2356501ebeb4190de3596453b045f694f69de
+SHA512 (NetBSD-6.0/alpha/binary/sets/comp.tgz) = 51a526038f6e9cf7d787b86997abee47e9735a56f02215cd8f3260e50d2d3bd7a17d11b2f80b2010fd52640aab0afe074fa8997c3522ccf1a8463854bab9ee0b
+RMD160 (NetBSD-6.0/alpha/binary/sets/comp.tgz) = 5fd982783cb934f260a96a0f85279b07deb2b505
+MD5 (NetBSD-6.0/alpha/binary/sets/comp.tgz) = c5deb3e315f875050362df56411badcf
+SHA1 (NetBSD-6.0/alpha/binary/sets/etc.tgz) = b525757e8a68fee704bc4845c411c6e9ab06db01
+SHA512 (NetBSD-6.0/alpha/binary/sets/etc.tgz) = 4c881736688636b7376dc7f255266f606678d7fe57a9a787275dc78bbafb8c0f36948bc6b06ea853bd7d1e2dc3de90693fc518c3ffe57aa831777229d910b8c3
+RMD160 (NetBSD-6.0/alpha/binary/sets/etc.tgz) = bbacdc2a3adc49d3772faa1e60227d3f20357220
+MD5 (NetBSD-6.0/alpha/binary/sets/etc.tgz) = 5975a4d5767d0d68fd4371e32f1ebd40
+SHA1 (NetBSD-6.0/alpha/binary/sets/games.tgz) = f3c81c83cd5dd29ff44eeff54a39bc22e1739b43
+SHA512 (NetBSD-6.0/alpha/binary/sets/games.tgz) = f773dfef7f2449a7ea804e756181ea622428becff7cd86e227f8d9c33a343ea097a191c08b73f258e236695ac37df6af80ffcc930ae75a3f6bc4a542a0797673
+RMD160 (NetBSD-6.0/alpha/binary/sets/games.tgz) = 079affe9e062a8f418e15fc69dae6b19722d8e43
+MD5 (NetBSD-6.0/alpha/binary/sets/games.tgz) = 1bdf16fbef7c6ee4bc1e8f6e99cbe649
+SHA1 (NetBSD-6.0/alpha/binary/sets/kern-GENERIC.tgz) = e6e00d7a0d440b435c65b34ba6e5ea156f123f18
+SHA512 (NetBSD-6.0/alpha/binary/sets/kern-GENERIC.tgz) = b5a99efe112a3d00b4108dc632a2413c0edc72c8a4fdd4daba1c974b5f1233d48e21964e4e1f7588430d01b0813767861bc0a700910a1e288493fccf269255f3
+RMD160 (NetBSD-6.0/alpha/binary/sets/kern-GENERIC.tgz) = ccba42305acbf2080751f1b35c23a8bd2464d1c6
+MD5 (NetBSD-6.0/alpha/binary/sets/kern-GENERIC.tgz) = b05f2ce6966e37b9dd3018930753f14c
+SHA1 (NetBSD-6.0/alpha/binary/sets/modules.tgz) = 2ed2d5d8a1054fac920b44123147d1f445a8cd20
+SHA512 (NetBSD-6.0/alpha/binary/sets/modules.tgz) = e85332336dd7091fecb0d48aa772ec0f9890fae90a71bf3e79178cc319a32c7320e7e6357d4355292335809d12499875357583179199f9b0c94dedcce2bffee8
+RMD160 (NetBSD-6.0/alpha/binary/sets/modules.tgz) = 286d34676fdeb368fe4146a636878026b678afad
+MD5 (NetBSD-6.0/alpha/binary/sets/modules.tgz) = 31ddea9a696f752f01db0c8910252dbe
+SHA1 (NetBSD-6.0/alpha/binary/sets/tests.tgz) = 5a71181696e124159891257ed04551ca0fac96ed
+SHA512 (NetBSD-6.0/alpha/binary/sets/tests.tgz) = a62eb137237ed94f16b759f4b836932caf06f4fa4215126db879918e38b993349962b6cd63dc06b2516cccb2604208d12df0b599ae64c4b5bfacd8d51618be0c
+RMD160 (NetBSD-6.0/alpha/binary/sets/tests.tgz) = baaa5152926a07e890f3c6ab2e2ba0123e132d62
+MD5 (NetBSD-6.0/alpha/binary/sets/tests.tgz) = a3bfffe6cbdb12c847a397c474996dbd
+SHA1 (NetBSD-6.0/alpha/binary/sets/text.tgz) = 4087ff757867de3d1e48c7edcd0a1f63879141a2
+SHA512 (NetBSD-6.0/alpha/binary/sets/text.tgz) = 396175d3caa9afb10f69ca6724fe1544b685863edb272a36e46c6164f8a5ce8099d9ce98c988fc691e61cafa0741053b31f46af6d87873e7473ee2c7db05c5e2
+RMD160 (NetBSD-6.0/alpha/binary/sets/text.tgz) = 84877daedd720eaae66d03670b5391586cb5818d
+MD5 (NetBSD-6.0/alpha/binary/sets/text.tgz) = 3ad58e3441e75733d2bd172cc03d96c2
+SHA1 (NetBSD-6.0/alpha/binary/sets/xbase.tgz) = 8cb5878605114e42a100af9f6000da692936b458
+SHA512 (NetBSD-6.0/alpha/binary/sets/xbase.tgz) = 55901d2b29117e70ee9f60bca845a291f73c827b82a6d79d2035e8e861cc6d3553e9b698a2573af458ba7ff7f0d66c1b904e0510aac5391a768a7e85c8dcafa5
+RMD160 (NetBSD-6.0/alpha/binary/sets/xbase.tgz) = 27a6b757c2c136eb48d35e996bebae1154691620
+MD5 (NetBSD-6.0/alpha/binary/sets/xbase.tgz) = 7599e1da98dc669a5915742f46819445
+SHA1 (NetBSD-6.0/alpha/binary/sets/xcomp.tgz) = 0f7cf0e0611671bcc8763c66b6ddb96ba2b84cbc
+SHA512 (NetBSD-6.0/alpha/binary/sets/xcomp.tgz) = cabd0398fbb72d9d2c833a56c5ff77e5fcef535dd4ebb7ecf482fc278c6a05d9bdc4d0e443b2eaa9c1ba2ba6044cb066b9c10de8377bf754c3b2fde1925e90e8
+RMD160 (NetBSD-6.0/alpha/binary/sets/xcomp.tgz) = 0e6f7dfd1b78eed02bfedd4e354017d4ca193d3f
+MD5 (NetBSD-6.0/alpha/binary/sets/xcomp.tgz) = f830daacbaca8ab9bc135239ee1568ec
+SHA1 (NetBSD-6.0/alpha/binary/sets/xetc.tgz) = 392c70eb80215d3165d545e40212a8b5d0e071e1
+SHA512 (NetBSD-6.0/alpha/binary/sets/xetc.tgz) = 54d20a3d9023cb964eac1ea822cab4648ee70d4ddd4e45779077f9ee7bfeb895f06adf2ec5e6f63869c4746d89aaefad17837afe43023631a204b1e536b15447
+RMD160 (NetBSD-6.0/alpha/binary/sets/xetc.tgz) = 6308c2a5326f2e8dc958195e9c98e151c9727b06
+MD5 (NetBSD-6.0/alpha/binary/sets/xetc.tgz) = a591745a497f419dd0d277d43c2e7e1c
+SHA1 (NetBSD-6.0/alpha/binary/sets/xfont.tgz) = da7a98e196e0630e68572a298db959c1ad9e5cac
+SHA512 (NetBSD-6.0/alpha/binary/sets/xfont.tgz) = 6304ec4f69e76faaaea07f0ee720bc90dbbcb620d8980dedb6966767cd58be9ba2c8c4a7f977f4a4b9293f40dc267f7d1a92ced290e704ea6cab7f512a2e21eb
+RMD160 (NetBSD-6.0/alpha/binary/sets/xfont.tgz) = 51c4aeaae821cb352d3249f2894bbd4b90884e5b
+MD5 (NetBSD-6.0/alpha/binary/sets/xfont.tgz) = 18fdd4a9bed7c69c840cd8591c17670a
+SHA1 (NetBSD-6.0/alpha/binary/sets/xserver.tgz) = 32e0112e7e65de8beda18c41e9ddd18db5d586c9
+SHA512 (NetBSD-6.0/alpha/binary/sets/xserver.tgz) = 82587fb8cd0719eb39bc14f0e8bbf8a943d6ac710a9f4bed1ac8ea16443cf84a4f378a5dd8f077d5f8ce9213da74d6444a9da10b872f074ab45da8abc89135a5
+RMD160 (NetBSD-6.0/alpha/binary/sets/xserver.tgz) = 60936683b7027ff514f411e63c1767828afed830
+MD5 (NetBSD-6.0/alpha/binary/sets/xserver.tgz) = d8b3888a02b4e6f2198d67e731296e4a
+SHA1 (NetBSD-6.0/alpha/installation/diskimage/README.files) = 8fef6343776d407c097ffbb0622b509aa3b5d6ed
+SHA512 (NetBSD-6.0/alpha/installation/diskimage/README.files) = 0a37602db16239255dd32a5b6585a23780d9c7568e7bcdcd4f67f4cc5869ce772deda68df2428b6a8ae4e7e2e4e449f7b643d1fc5d929efa0409466a50cfaf74
+RMD160 (NetBSD-6.0/alpha/installation/diskimage/README.files) = ff4ac5a982e0c75bcc3a466b27b003da73573026
+MD5 (NetBSD-6.0/alpha/installation/diskimage/README.files) = 47f2c0383d6fc4ac6c8b25c348fa992c
+SHA1 (NetBSD-6.0/alpha/installation/diskimage/cdhdtape) = 560f896de7f7b1e2f8cb908048b3ebaeb6636263
+SHA512 (NetBSD-6.0/alpha/installation/diskimage/cdhdtape) = 10d6bd96b74b6df96c35533d14237b771d5f3f449120ea7062aff44960e8c0480048d607139ec2358961d93bba17afef407d0e775513c262e44249224ac54834
+RMD160 (NetBSD-6.0/alpha/installation/diskimage/cdhdtape) = 69eadfe52a7b4b3fe412190b7d2fd5fb83f7fe6a
+MD5 (NetBSD-6.0/alpha/installation/diskimage/cdhdtape) = 87f184344a501c90af4f7bcff11622ee
+SHA1 (NetBSD-6.0/alpha/installation/floppy/README.files) = 8fef6343776d407c097ffbb0622b509aa3b5d6ed
+SHA512 (NetBSD-6.0/alpha/installation/floppy/README.files) = 0a37602db16239255dd32a5b6585a23780d9c7568e7bcdcd4f67f4cc5869ce772deda68df2428b6a8ae4e7e2e4e449f7b643d1fc5d929efa0409466a50cfaf74
+RMD160 (NetBSD-6.0/alpha/installation/floppy/README.files) = ff4ac5a982e0c75bcc3a466b27b003da73573026
+MD5 (NetBSD-6.0/alpha/installation/floppy/README.files) = 47f2c0383d6fc4ac6c8b25c348fa992c
+SHA1 (NetBSD-6.0/alpha/installation/floppy/disk1of3) = 4d855acf87e1e1064b06c2232178d75a13c33fd3
+SHA512 (NetBSD-6.0/alpha/installation/floppy/disk1of3) = 9e86017634026e3e90a50c84a8f57badb1b7cf223aca9a643fae2bf186e443dc9eb5380cba764c89d64b7288078ca5b086b5a37b97fc47a4cc0ecfaad755af67
+RMD160 (NetBSD-6.0/alpha/installation/floppy/disk1of3) = 74abd218ad7f0299822e154ac2b420b258c83aad
+MD5 (NetBSD-6.0/alpha/installation/floppy/disk1of3) = 5a2d6e79a6714cf358c9ee8755e0aedf
+SHA1 (NetBSD-6.0/alpha/installation/floppy/disk2of3) = 4c8d4ef59efd9aeaceaef12aba4acb5c80ac3be2
+SHA512 (NetBSD-6.0/alpha/installation/floppy/disk2of3) = 72fcf5173d3b29eca98afcc9dd1c0ca172cf8509c9f449356086fcef28acff3641140745df32db394b43281a1421000959631cf55185673e430a792d026e4eb3
+RMD160 (NetBSD-6.0/alpha/installation/floppy/disk2of3) = 02ff0fdc28cb7ac47eae6869620ec5f801324654
+MD5 (NetBSD-6.0/alpha/installation/floppy/disk2of3) = 4f86d12bbbb50c2c06103f2002c88be9
+SHA1 (NetBSD-6.0/alpha/installation/floppy/disk3of3) = 4f0a721ea8eb063d964c3ec31e035f41febad205
+SHA512 (NetBSD-6.0/alpha/installation/floppy/disk3of3) = f3c66c64760246cde2e99999deac1a4dba5caa47603491de0edd47badafc5f6a08b7108e62a3e2c44d4cca55f17df48e1bc41fee948bca15d7dc0874ed321b18
+RMD160 (NetBSD-6.0/alpha/installation/floppy/disk3of3) = 1ca8581e23cc086d8bf93b39bf1efb34c8964d32
+MD5 (NetBSD-6.0/alpha/installation/floppy/disk3of3) = e558bf919697872fc6f5bfb8ef697f8f
+SHA1 (NetBSD-6.0/alpha/installation/instkernel/netbsd.symbols.gz) = 72358f5496a38794927cca6f55addc09e74983bd
+SHA512 (NetBSD-6.0/alpha/installation/instkernel/netbsd.symbols.gz) = f4fde67472e0cea2069a5d8c1a614429486c275a3ff38fd2f9c216a79749b366c79c898e9e4d58b4a2826c8b724d76b6de6b744d4eba058169ffb88b428b7790
+RMD160 (NetBSD-6.0/alpha/installation/instkernel/netbsd.symbols.gz) = 0b8b2fda5075cf789139581258d33e55e7edc18b
+MD5 (NetBSD-6.0/alpha/installation/instkernel/netbsd.symbols.gz) = 2f1474645c7c61a79af6046b873d0c53
+SHA1 (NetBSD-6.0/alpha/installation/instkernel/README.files) = 8fef6343776d407c097ffbb0622b509aa3b5d6ed
+SHA512 (NetBSD-6.0/alpha/installation/instkernel/README.files) = 0a37602db16239255dd32a5b6585a23780d9c7568e7bcdcd4f67f4cc5869ce772deda68df2428b6a8ae4e7e2e4e449f7b643d1fc5d929efa0409466a50cfaf74
+RMD160 (NetBSD-6.0/alpha/installation/instkernel/README.files) = ff4ac5a982e0c75bcc3a466b27b003da73573026
+MD5 (NetBSD-6.0/alpha/installation/instkernel/README.files) = 47f2c0383d6fc4ac6c8b25c348fa992c
+SHA1 (NetBSD-6.0/alpha/installation/instkernel/netbsd.gz) = 3057e0db687c65ad00bcc9433a8e1e8e8853b0f8
+SHA512 (NetBSD-6.0/alpha/installation/instkernel/netbsd.gz) = 72c72707e34bf282fec601e885eaa9dbfafc34dc44c97d1e100e439620ed5f3751e2b629b2b1ff40b229a29b1b217627f5fb70a198d571c0478d13d2c1f9d5e2
+RMD160 (NetBSD-6.0/alpha/installation/instkernel/netbsd.gz) = bb22d8b6c7113aad71720a489ab71dbe938e1475
+MD5 (NetBSD-6.0/alpha/installation/instkernel/netbsd.gz) = 9fece65592c8b7decdbff32513650306
+SHA1 (NetBSD-6.0/alpha/installation/netboot/netboot) = 17cf3e7f848aa8a853e322e977163547830f7357
+SHA512 (NetBSD-6.0/alpha/installation/netboot/netboot) = eb78138cdb1d289e4f39af61e24a2d0a42b5807c6869e921ffbcaf720902362f0c702ece18e1bbbb599d50b31b09ecebcaf9df5786f337ee511c0900e1bcb9cf
+RMD160 (NetBSD-6.0/alpha/installation/netboot/netboot) = 3228d2be31a224636f15cfa0f5c24cebea1d4b64
+MD5 (NetBSD-6.0/alpha/installation/netboot/netboot) = 2a71b40ce0eebc66564f796f681592b2
+SHA1 (NetBSD-6.0/alpha/INSTALL.html) = 6984fd17504c01e2c1dd83e7dbdf34bdcc7b6b1e
+SHA512 (NetBSD-6.0/alpha/INSTALL.html) = d4b63b33e62764fa6e008f5961599abf0ceb486aee59c55deb0e2f62f5e3efb0a7ec667217f72f553460d1931fff86c209345c6eccb688f67822e19f78f2b35b
+RMD160 (NetBSD-6.0/alpha/INSTALL.html) = 3d6597686d7079ca4857f5afe7fada4ddae2e4db
+MD5 (NetBSD-6.0/alpha/INSTALL.html) = c00f5ce1cc724dddfbe201deb54605d3
+SHA1 (NetBSD-6.0/alpha/INSTALL.more) = b670f381aeda31fa7a1c861aa90c8856a144460c
+SHA512 (NetBSD-6.0/alpha/INSTALL.more) = e8343ca62e59534c74a2cb3404092b71a771390943c5738c10cec908be2b202b4caafa09629b5086c0119f8c867a294fb759a76dc80705583f3db7115ad41b1c
+RMD160 (NetBSD-6.0/alpha/INSTALL.more) = 6236acfbb416a7f45499c9ba097b0ebc7df0ddc0
+MD5 (NetBSD-6.0/alpha/INSTALL.more) = c0f41cb950b8c2133e1c3d6005ed478b
+SHA1 (NetBSD-6.0/alpha/INSTALL.ps) = 902a55dd7d1b3cc6489f730e76fd8a656188ca3c
+SHA512 (NetBSD-6.0/alpha/INSTALL.ps) = 612f6a50dd02a6ef525948faaa4f77c6b60e6ea6b73fbf43fe28891523b0ba715c4c513991bbd99b36a1842c5bea3a4f59c31abcb7141af3ca77419d5ac7a399
+RMD160 (NetBSD-6.0/alpha/INSTALL.ps) = 95af61540f44c6ad5bde6110bb988b30144cac0e
+MD5 (NetBSD-6.0/alpha/INSTALL.ps) = d5cb827162bea74a99a75c4ec658cb13
+SHA1 (NetBSD-6.0/alpha/INSTALL.txt) = 00428f4fee211a107142bd3c673ac0e1bf82f8bb
+SHA512 (NetBSD-6.0/alpha/INSTALL.txt) = acc36a8ca1e2e171db9a482d5b5914cde68c2ba917478c91cbe4c6b1f14f0e46b6fc5393a6597b928b2fe043afe9373e92bc50eddaccad205b1513c9cfa5b89b
+RMD160 (NetBSD-6.0/alpha/INSTALL.txt) = c340c3eafed3235732e7bd6de8bd2e5798279a32
+MD5 (NetBSD-6.0/alpha/INSTALL.txt) = bebe671881b51664213b2b74a352ccea
+SHA1 (NetBSD-6.0/amd64/binary/kernel/netbsd-GENERIC.symbols.gz) = cb8fb452336026da954a431064ac908983c73c56
+SHA512 (NetBSD-6.0/amd64/binary/kernel/netbsd-GENERIC.symbols.gz) = 5ac462c2bbe07c1fc5bb719af9b8a048278c914e25c3e63a5908d04eed9b9ed3b3324af677f5910065c569e7eef9ab92fb7b23dc27a06361065193736170beb9
+RMD160 (NetBSD-6.0/amd64/binary/kernel/netbsd-GENERIC.symbols.gz) = f294d6c837951cc2179aabe993db92be0507b73b
+MD5 (NetBSD-6.0/amd64/binary/kernel/netbsd-GENERIC.symbols.gz) = d5c7cba8ce43359a50bc6b41e1a59ac8
+SHA1 (NetBSD-6.0/amd64/binary/kernel/netbsd-GENERIC.gz) = 0e1a51e79c8ed82328856cb4e9e1ca1f77f96ad6
+SHA512 (NetBSD-6.0/amd64/binary/kernel/netbsd-GENERIC.gz) = 71822434adf5610fc6bf77371f0ea65403cbfac39194435c6fd0dcd62cfd214da5d9bd8c9a06ae300b81425339ecdca1e373e91d38870a56f1910e9e4b2f0dcb
+RMD160 (NetBSD-6.0/amd64/binary/kernel/netbsd-GENERIC.gz) = 2344b490341441b4a08608454269d1bb55db13fa
+MD5 (NetBSD-6.0/amd64/binary/kernel/netbsd-GENERIC.gz) = fdba9cfe2198dbc3403ba5c9b251147e
+SHA1 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL.symbols.gz) = b275c23887a6d7522777f6c70da7191ae2d3b64d
+SHA512 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL.symbols.gz) = 30f57b1aa47d0c8dfae72063810dffda248ad25e03e432221861c4de98088eba502637675cf4d400809c6d2d45a17ee2b3ce87be4007fa8a2b86fb507d13426b
+RMD160 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL.symbols.gz) = c98d06602cce33614079d4ac9049235aa71601f5
+MD5 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL.symbols.gz) = 5d2e2deeac92159eefa0c14bedb999e5
+SHA1 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL.gz) = 22859d8f0aa148474db11e8493c1c1c5ca88a4bf
+SHA512 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL.gz) = 5aad6a3e174330803b12b3c5566f422c96d6755e520b2bda951e7efd73f8f4bfbc0b902d7964688650717630355af96d51fed90fac5bbfe343f3c06d3354f5e6
+RMD160 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL.gz) = 25124d4395c714580bcc3a2f8574df3d9a5e5ef4
+MD5 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL.gz) = 09691319c1029293d76f2b51048cd7d8
+SHA1 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz) = 1ef0dce70ce636d55eb7cb5973f335729d17826a
+SHA512 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz) = 49a644ba39cd11ad2fd3c1aa27b7f2999019613bbb4731ee2098b484eee74d740baf4f67ddb7b4cdaf7f710e507ed719bc6840d704acf5ed80ce419fb8bfae1b
+RMD160 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz) = 459fb44892f496a9c7b445e837d875ddc1a7f056
+MD5 (NetBSD-6.0/amd64/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz) = 5902c6bc85313724e355e95a06e968a0
+SHA1 (NetBSD-6.0/amd64/binary/kernel/netbsd-XEN3_DOM0.gz) = 0f4ec7742c4c53d99cbc4b645931758d0a7ebe2a
+SHA512 (NetBSD-6.0/amd64/binary/kernel/netbsd-XEN3_DOM0.gz) = fa1e39362e515e808831bc81751231062ebe4987eb1790eb87cab7490697372472fac67df5d49fd41b1d6d3fbecc93f64d7c433d357c13a626636feda14f4a7e
+RMD160 (NetBSD-6.0/amd64/binary/kernel/netbsd-XEN3_DOM0.gz) = 2322a8960ba58563ea8507a0073c03934d8f58ad
+MD5 (NetBSD-6.0/amd64/binary/kernel/netbsd-XEN3_DOM0.gz) = 31ea20a739a3e9caad0f4af0da531a0d
+SHA1 (NetBSD-6.0/amd64/binary/kernel/netbsd-XEN3_DOMU.gz) = 30bfc0edb5ec053c327cfab318877bcf633e3d26
+SHA512 (NetBSD-6.0/amd64/binary/kernel/netbsd-XEN3_DOMU.gz) = 7244306522782443df4e807ebf627eab0f6f994c3c1de9cde73781b7b8d16a2b3e7d1ab578c03bd3b2d6df19dc20485146ecb9ff920e2860a0858158509a4229
+RMD160 (NetBSD-6.0/amd64/binary/kernel/netbsd-XEN3_DOMU.gz) = bbae752f9fc5b0a9725e12aef5da652699ba614b
+MD5 (NetBSD-6.0/amd64/binary/kernel/netbsd-XEN3_DOMU.gz) = 72cc8998d1dd79b0471e4924a1ee9cbf
+SHA1 (NetBSD-6.0/amd64/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/amd64/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/amd64/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/amd64/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/amd64/binary/sets/kern-GENERIC.tgz) = 8880ef6795951dbca5379bffb7040b31e75e8217
+SHA512 (NetBSD-6.0/amd64/binary/sets/kern-GENERIC.tgz) = e1a58551a91511f0fa86ab4395a8901154e75bae344045200c1794d759cbd82c2441703123ee0c5d42561f08cb192e2bb39c57f4cb61b8fb970b579525fb1952
+RMD160 (NetBSD-6.0/amd64/binary/sets/kern-GENERIC.tgz) = be4c1cef72f8b3971890c549d908d03cf9ccae74
+MD5 (NetBSD-6.0/amd64/binary/sets/kern-GENERIC.tgz) = 60e67b64337a09d0d00bbe70c0ef43f6
+SHA1 (NetBSD-6.0/amd64/binary/sets/base.tgz) = 41f139d30b18839b0486e238bdcb1a08e084ac0f
+SHA512 (NetBSD-6.0/amd64/binary/sets/base.tgz) = 136fec9ccc141fbf39c4667f09f45ed3a7f07183c315819c391e3c47b67574d4278762e9be6ac7e325e7ebd2929dd59d1d8aa84411fb435baccf5b7d71c1e58b
+RMD160 (NetBSD-6.0/amd64/binary/sets/base.tgz) = 38903209c490bb8094061951fffc5ba7bf2cce24
+MD5 (NetBSD-6.0/amd64/binary/sets/base.tgz) = c4d69c1e245e95ee1ef891a998536f30
+SHA1 (NetBSD-6.0/amd64/binary/sets/comp.tgz) = 5d0d34f4debbf611578852fdc549197357f574c2
+SHA512 (NetBSD-6.0/amd64/binary/sets/comp.tgz) = 96cd27a092b2cbabc0f6f053d651ae94b6ec65b2c9f4812c6efd432c9ea9a321d38f8e88e6dba03ca7e6d3fe8dc2b43c3846880966964d6841d6cacb87f5c4a0
+RMD160 (NetBSD-6.0/amd64/binary/sets/comp.tgz) = 0fc9f9cef2839291204f399014f730a321ff846a
+MD5 (NetBSD-6.0/amd64/binary/sets/comp.tgz) = 1f6de4df6174d0e919b343bb0426ba92
+SHA1 (NetBSD-6.0/amd64/binary/sets/etc.tgz) = 23e42cd803c314f35f61713d7ce3d8ae6f978036
+SHA512 (NetBSD-6.0/amd64/binary/sets/etc.tgz) = 3aa2017bfd9d81b51371b31ae2eb4fa613c3cc90c532aabf1e76df938c312d1894f1b5313869a93fbd4463b903bb390ea5cf485e870d421ff0580240a04505e3
+RMD160 (NetBSD-6.0/amd64/binary/sets/etc.tgz) = d8d98a46df49ec9a28cda63da60c2fd8b2f5440c
+MD5 (NetBSD-6.0/amd64/binary/sets/etc.tgz) = d4d5351a9ee4c89d46d03025363d0af7
+SHA1 (NetBSD-6.0/amd64/binary/sets/games.tgz) = 535c8d580229e63485dbc9215ff8994babd19ba4
+SHA512 (NetBSD-6.0/amd64/binary/sets/games.tgz) = abc07cbb728d3b4148ca824f3d37c0fd789f22548f92c8d03c78cd04969828d6fb3e7396654e4709bfdc82783e5c17e3998372149b76a7bdfb186fd417a4e1cd
+RMD160 (NetBSD-6.0/amd64/binary/sets/games.tgz) = 80ca9419dae0b955ae39ba879b269eb27d34b0f9
+MD5 (NetBSD-6.0/amd64/binary/sets/games.tgz) = 1f7b98cfd037ac9a6b2487b1d3e2397a
+SHA1 (NetBSD-6.0/amd64/binary/sets/kern-XEN3_DOM0.tgz) = 622ca31060c3d803bff339d53321e3b5cbe56fcf
+SHA512 (NetBSD-6.0/amd64/binary/sets/kern-XEN3_DOM0.tgz) = 9943d8752f75569a2cb6611f2eb87a552cf98c92040cf2c0ec699ff0380b3b5395a7b2c951fcdbc6ef74d36073b7b066dc37ee1d60a3463836820fee7f15e5fe
+RMD160 (NetBSD-6.0/amd64/binary/sets/kern-XEN3_DOM0.tgz) = 4627daedf28168da5994ad430aaac7b069785d42
+MD5 (NetBSD-6.0/amd64/binary/sets/kern-XEN3_DOM0.tgz) = 3c473eed7a2c400bc22e743e6f2fad74
+SHA1 (NetBSD-6.0/amd64/binary/sets/kern-XEN3_DOMU.tgz) = d29bb910d1ecf61700d54790c7376f2729dd6a71
+SHA512 (NetBSD-6.0/amd64/binary/sets/kern-XEN3_DOMU.tgz) = e714d759a0635e3375ce56f945fa5df011b5037502ce0602d74db1a9d3ddf86144b13b9a2a503c231c931de998a645b8562b5254bc8e68c9537a7dea366957da
+RMD160 (NetBSD-6.0/amd64/binary/sets/kern-XEN3_DOMU.tgz) = adb7515022b355b9b2f61a318d1fea6734e8859a
+MD5 (NetBSD-6.0/amd64/binary/sets/kern-XEN3_DOMU.tgz) = 3beec0bff32cc7c78bcadb6f90b0455f
+SHA1 (NetBSD-6.0/amd64/binary/sets/man.tgz) = f583717a7705475c144e1b66e93b3c9c6d8e3293
+SHA512 (NetBSD-6.0/amd64/binary/sets/man.tgz) = 92f6dbefacff42d2a6c317158aee801e8d4f3791704a792ce0761faf5425c516166a9769e7f3b81abd282cc9a60e0ff07c4350ac889fe66aec794f359a27452b
+RMD160 (NetBSD-6.0/amd64/binary/sets/man.tgz) = 02ffd712d7b6d265e8c566ccbfcaa34cc9916eda
+MD5 (NetBSD-6.0/amd64/binary/sets/man.tgz) = 59adc1ce49347d61ee6eea024e2ea2a2
+SHA1 (NetBSD-6.0/amd64/binary/sets/modules.tgz) = 46a78ea373e41e73dabc27ae802b395b7348c419
+SHA512 (NetBSD-6.0/amd64/binary/sets/modules.tgz) = 8dc00ff46c87d04b72f2e4fa0b2b290ab326b907f88f4d2667e63aa0390756df4c45ed5b9e36bec6e60e472a8162b9ddc55eea89b6ed65bd2f6cf5d760f611b9
+RMD160 (NetBSD-6.0/amd64/binary/sets/modules.tgz) = b2d93414e9e22b4b55dd73fb347aefe4b6a11d10
+MD5 (NetBSD-6.0/amd64/binary/sets/modules.tgz) = aa84f46e76b3f543ac9d8ea315869092
+SHA1 (NetBSD-6.0/amd64/binary/sets/tests.tgz) = cdcfc53423e8cd984258bc8635490bd815576322
+SHA512 (NetBSD-6.0/amd64/binary/sets/tests.tgz) = d11520f52dd889947a298a2428e4b81b840ef939ee82a63fb39ac30fa59918348a6546598b9b6f28268677f7bebf9e022f8ba568a47e3f9ff801ff08666c1366
+RMD160 (NetBSD-6.0/amd64/binary/sets/tests.tgz) = 7fb2dbecae8a377eca305f74075e9f4c4f326455
+MD5 (NetBSD-6.0/amd64/binary/sets/tests.tgz) = 4c8e0463db9e784b47d92aa43bd7ec82
+SHA1 (NetBSD-6.0/amd64/binary/sets/text.tgz) = 2ad7dfb1cf3e39da165e6d0d356444a3dda315ab
+SHA512 (NetBSD-6.0/amd64/binary/sets/text.tgz) = 77140ca96473762ba22737bdf1dcd74fbe7dea97778c2da7b8b015daa2af47c20a9663e5eee092a8b353cb36caf599efc5975b7572692cb5c8b77bcde7bb8fff
+RMD160 (NetBSD-6.0/amd64/binary/sets/text.tgz) = bdb4eb7e3081ec2bbd4b1eaaacd0cd96dfe92be1
+MD5 (NetBSD-6.0/amd64/binary/sets/text.tgz) = 3c9ac230578345961050fd8adbb15023
+SHA1 (NetBSD-6.0/amd64/binary/sets/xbase.tgz) = c88f6ae63e7acba75831ae5a19cfb8151f961780
+SHA512 (NetBSD-6.0/amd64/binary/sets/xbase.tgz) = be81153fc620a58e00ab7e1069dfa80567e9d641fc4ab6256512074d5cebb7a561fa8596de8f985022ef79ec0330ee317f2a2628a7236882f28a1ea9475d809f
+RMD160 (NetBSD-6.0/amd64/binary/sets/xbase.tgz) = 9e961b920bdc6432e1e0bfcad9adfb8dfc872cfb
+MD5 (NetBSD-6.0/amd64/binary/sets/xbase.tgz) = b98819c3afd401940a578ced15418ab6
+SHA1 (NetBSD-6.0/amd64/binary/sets/xcomp.tgz) = 7f6d2efa3a5e3a5ea2729020a8ad175929353995
+SHA512 (NetBSD-6.0/amd64/binary/sets/xcomp.tgz) = 35652d685c9581d20f198d13de8b34764c9a67e808416f006b98793f6ded279111d2bbeee6ad453a8416ba3259a5d7967d0327aa7e7109b7651d923bde31a8bd
+RMD160 (NetBSD-6.0/amd64/binary/sets/xcomp.tgz) = 0b3a659fdca9ed423aec4e799f739ad6ed3a2b7b
+MD5 (NetBSD-6.0/amd64/binary/sets/xcomp.tgz) = 72711d2c486caca7a8db94316c7704ad
+SHA1 (NetBSD-6.0/amd64/binary/sets/xetc.tgz) = d2a37199497c292f9a780bb5a77a14dd481bc0db
+SHA512 (NetBSD-6.0/amd64/binary/sets/xetc.tgz) = e8fe86ecaa56d0a016ad52024d956d8e77d690b4ccbb24b060d1c824f5e67979b2067ea6635361f25e80160e6abe3d4bce7ac586107fb673c12d65e9d9bbc4bf
+RMD160 (NetBSD-6.0/amd64/binary/sets/xetc.tgz) = e566d0c03e66e9365ad71c0057dd86bcc8663f96
+MD5 (NetBSD-6.0/amd64/binary/sets/xetc.tgz) = 6a1af564a85ba3996757440dfed4df94
+SHA1 (NetBSD-6.0/amd64/binary/sets/xfont.tgz) = 425d64efdeed5bf9f8038b9f0d61cdfd0b8679ba
+SHA512 (NetBSD-6.0/amd64/binary/sets/xfont.tgz) = c6e1b0829edb2e78302cf352880d4ee3cb6f6a5187f8082b0a0df3d49bd32f57cb0df450b850044cc0437da2f0ad75249cbf0777295d90ab38a9e1e13c786e08
+RMD160 (NetBSD-6.0/amd64/binary/sets/xfont.tgz) = d0f3520bdaad4cdbd90b3fe32e663c543153c0d0
+MD5 (NetBSD-6.0/amd64/binary/sets/xfont.tgz) = be05eeb3078d0fbb93b97130d49c5982
+SHA1 (NetBSD-6.0/amd64/binary/sets/xserver.tgz) = bc339a86b1e7d42e667a03561dd66835b0e39828
+SHA512 (NetBSD-6.0/amd64/binary/sets/xserver.tgz) = 00739626f1c78297988d1696e369b7ec933119ee7f76d57c426f83a1efba9414b7a1258258ab86b6b79a1277a327ac3ab0e2177bcaa396332ecc5221c6bf8954
+RMD160 (NetBSD-6.0/amd64/binary/sets/xserver.tgz) = 9adf580fd382fa5edc147da77b23410830e6ef9b
+MD5 (NetBSD-6.0/amd64/binary/sets/xserver.tgz) = b30af2c69ca833f25c0b163fea4496d8
+SHA1 (NetBSD-6.0/amd64/installation/cdrom/boot-com.iso) = 0aeb15a62bfd640903525b517b5cb254fbb8f694
+SHA512 (NetBSD-6.0/amd64/installation/cdrom/boot-com.iso) = c3998bedff5f4320e3b14b3bc07f7e348f45a106a1f78d738934fbce564b209eb9bce72f91bfbd4f95247a2eb4fb69366d3a8a4f7a597be3bfae889858f1badc
+RMD160 (NetBSD-6.0/amd64/installation/cdrom/boot-com.iso) = 90e7d9c68c959a8c3455fca88ac7fdc5af40589d
+MD5 (NetBSD-6.0/amd64/installation/cdrom/boot-com.iso) = 5551d8cd6c5675eda32c80de279860ee
+SHA1 (NetBSD-6.0/amd64/installation/cdrom/boot.iso) = 12323858ce09cfce6d3b294bb6d33a3ecd599400
+SHA512 (NetBSD-6.0/amd64/installation/cdrom/boot.iso) = 536021f6159e5412a9b7be41967e75cdaafb3fcb319ce7c712af6bac22cee2b07f185500fb77505f5a4018a0fa5e619a5e00dc11aee59babfc1dd3c69081a0c0
+RMD160 (NetBSD-6.0/amd64/installation/cdrom/boot.iso) = a66e6ff744cb27ed79f58824945806b4ddc5e743
+MD5 (NetBSD-6.0/amd64/installation/cdrom/boot.iso) = b4ae730ff5fcc86885c266665183dd35
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot-com1.fs) = 7773242845d56dae16e957ba3dcde54db2d44ad9
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot-com1.fs) = 14a0d9a1d7b6d893ee962b6c0e73cd2f44cdef9aa0c8d814465eb9e30bbee00fffd332a962d86430a04e13fb8b111fc857b5790648d27bbbe6eaac3fb0f6a0c5
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot-com1.fs) = 911fbf259c7ede76a08956e0e38ea8dba1522ae6
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot-com1.fs) = 18052eb95118b57ee28cff9cd78a0fab
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot-com2.fs) = 5a1705082aa0fdbe9df2deeb8bfcde27f62e39c9
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot-com2.fs) = 57a01c68902c568a9e061d588b3f96857de3ebe05eab55fffc38a843bb1e25d3c1962aeb78d711a5c70ee2cc7abd5717abc4b4224794803019cd1e81c9afa547
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot-com2.fs) = 03c5214a031d1cee57c50888bad984f59a0ec275
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot-com2.fs) = 9d14a976045f475ae3a96cb7ed04bae6
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot-com3.fs) = 80a4a45120aad34e9cc46b8f2fbba73977e395da
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot-com3.fs) = db431a6d199f53a3f367e759ed4fcb117a7b664dd9d5060677a7b3ef60853d3c6d31f5c4e6c54b33df6e4223a8aa7e27c3cb56f777205b58b7239980da5f58d5
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot-com3.fs) = fd6ca1f2110722e28189179a1e6ae1724c1b0c3d
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot-com3.fs) = cf7c49437a2e74cef7d07e5ecefe26f9
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot-com4.fs) = 611b759a6b95830057cea83517f8065fa131d328
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot-com4.fs) = 8d0229d04d365efe365a1dc84a5d05090290d684fda96cb637fd8989e162a6cd90c9a9409a80740356cdbe39cb81dcf498874db475b4c2aa443ec3087675611c
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot-com4.fs) = f7fda0f8502ab8255fc63de3de54c92d05ce6a17
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot-com4.fs) = 4e1c8e49e8592e5e7a13e4118df3a13c
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot-com5.fs) = 671ad9865cf186c69739279463e408504e89c072
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot-com5.fs) = 1a4329afefd19b3dbf37a12cb287aa771dfabdeeaf6b0302158eae0cde68d970a94a9643b4b18798654473c6eb577c8e555188a7c7776e6cccc05241a7b47c7f
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot-com5.fs) = 9e7000ef7b4a971936e74eb1858b0f74816d42f3
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot-com5.fs) = 52824ec1c65bc87f196fe4fcd1887cb2
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot1.fs) = 8393070ff7b79fb60d3aa6bf9675c5bce42b7340
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot1.fs) = 092f3177383ff4bb4f51fdca19069306f75bb0b86674e2862c34374bdc2da633008805c0cdd2bd352f0da12a2cd529e19086323f0c74d1fed89b2a0d65066bba
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot1.fs) = 9b24c6e8042942c96ad46c65443e48824c2b1fa8
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot1.fs) = ad5246fc6d7ce6840762ce87d281e0fc
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot2.fs) = 5a1705082aa0fdbe9df2deeb8bfcde27f62e39c9
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot2.fs) = 57a01c68902c568a9e061d588b3f96857de3ebe05eab55fffc38a843bb1e25d3c1962aeb78d711a5c70ee2cc7abd5717abc4b4224794803019cd1e81c9afa547
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot2.fs) = 03c5214a031d1cee57c50888bad984f59a0ec275
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot2.fs) = 9d14a976045f475ae3a96cb7ed04bae6
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot3.fs) = 80a4a45120aad34e9cc46b8f2fbba73977e395da
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot3.fs) = db431a6d199f53a3f367e759ed4fcb117a7b664dd9d5060677a7b3ef60853d3c6d31f5c4e6c54b33df6e4223a8aa7e27c3cb56f777205b58b7239980da5f58d5
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot3.fs) = fd6ca1f2110722e28189179a1e6ae1724c1b0c3d
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot3.fs) = cf7c49437a2e74cef7d07e5ecefe26f9
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot4.fs) = 611b759a6b95830057cea83517f8065fa131d328
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot4.fs) = 8d0229d04d365efe365a1dc84a5d05090290d684fda96cb637fd8989e162a6cd90c9a9409a80740356cdbe39cb81dcf498874db475b4c2aa443ec3087675611c
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot4.fs) = f7fda0f8502ab8255fc63de3de54c92d05ce6a17
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot4.fs) = 4e1c8e49e8592e5e7a13e4118df3a13c
+SHA1 (NetBSD-6.0/amd64/installation/floppy/boot5.fs) = 671ad9865cf186c69739279463e408504e89c072
+SHA512 (NetBSD-6.0/amd64/installation/floppy/boot5.fs) = 1a4329afefd19b3dbf37a12cb287aa771dfabdeeaf6b0302158eae0cde68d970a94a9643b4b18798654473c6eb577c8e555188a7c7776e6cccc05241a7b47c7f
+RMD160 (NetBSD-6.0/amd64/installation/floppy/boot5.fs) = 9e7000ef7b4a971936e74eb1858b0f74816d42f3
+MD5 (NetBSD-6.0/amd64/installation/floppy/boot5.fs) = 52824ec1c65bc87f196fe4fcd1887cb2
+SHA1 (NetBSD-6.0/amd64/installation/miniroot/miniroot.kmod) = dabc250e1cead594f5dea847da52d9ba2933b310
+SHA512 (NetBSD-6.0/amd64/installation/miniroot/miniroot.kmod) = a4dd87defdb602de2329e7397c503b075c1c373af8a0547e843040029aaf34595e117f11f9e184a69765386ed66283f3a9c994d2159e473792b4f49d45991cdb
+RMD160 (NetBSD-6.0/amd64/installation/miniroot/miniroot.kmod) = 92d16ace79c31254694e0b401abb19e659f7879f
+MD5 (NetBSD-6.0/amd64/installation/miniroot/miniroot.kmod) = df6ec580ac9753bd17f1e9aaada0be34
+SHA1 (NetBSD-6.0/amd64/installation/misc/pxeboot_ia32.bin) = 96287819b198b35ceaf13400e6852a472b0e86e1
+SHA512 (NetBSD-6.0/amd64/installation/misc/pxeboot_ia32.bin) = cad69e2c71ec9879adbcec03468172aa1c2b7dd2ae4d4b5315a7013a39a24667faa8610ab663d96d5d8229e74f8150a0afda03d3e308a54e67fb555bffba821e
+RMD160 (NetBSD-6.0/amd64/installation/misc/pxeboot_ia32.bin) = e226d78864e488c284063c1eeca1431babd8934e
+MD5 (NetBSD-6.0/amd64/installation/misc/pxeboot_ia32.bin) = a6cf18820ed6a4d823ae117148272279
+SHA1 (NetBSD-6.0/amd64/INSTALL.html) = 2ba66a1c4d70a9376ae64ba56e97acf97cb14064
+SHA512 (NetBSD-6.0/amd64/INSTALL.html) = 6fbece25fed2ab136a77f592975808e919260963a9be83b2d4ddbee6b9b24319fb08c6316f262fe208aba81e50d1156db6ad8e36974fecd6955608d807da4667
+RMD160 (NetBSD-6.0/amd64/INSTALL.html) = e4976765905456206ba0906f3d7aee383e80b5dd
+MD5 (NetBSD-6.0/amd64/INSTALL.html) = 9a1d1f0005ff232d9501ebe159d122b7
+SHA1 (NetBSD-6.0/amd64/INSTALL.more) = d1da705f0adc32b67801928824379ea45ddb70fd
+SHA512 (NetBSD-6.0/amd64/INSTALL.more) = f5e6d604726edc5759dcc63e32c046fc0f952b9e4357e331b3864d1074954db46f0a7295b63f6f3a2c5ecda4ad3fcfc568a6dfc7dc91db5559a768ad2f6fd6dd
+RMD160 (NetBSD-6.0/amd64/INSTALL.more) = 4b06e7cde85cdd8fef618f254e8a9136ff25e766
+MD5 (NetBSD-6.0/amd64/INSTALL.more) = c1d511b8ec407155635d1df1d3698af9
+SHA1 (NetBSD-6.0/amd64/INSTALL.ps) = dc0b32b40a813365cab508de06d4280a4ebe8496
+SHA512 (NetBSD-6.0/amd64/INSTALL.ps) = 62ad1a41b0101222de2a4aea45c32ed7a02a4b06d1fd86b1c4d35f6ac5605a3562ca21b815db8e27d67e4584a5e155bbf8d5dda842e165379f4efd962c19a4a8
+RMD160 (NetBSD-6.0/amd64/INSTALL.ps) = fc6b89c1155481439b4a4a66357b925227720d97
+MD5 (NetBSD-6.0/amd64/INSTALL.ps) = 833ee159c8aeb1456ad514df2b4da716
+SHA1 (NetBSD-6.0/amd64/INSTALL.txt) = fd054d29f49e793dec119508a0466e243d54d05d
+SHA512 (NetBSD-6.0/amd64/INSTALL.txt) = c5e9a67c9bcd990c16a13390db60ff432f4640434234dc69a412d2ebd57fd333ace7ea59dc5b3acc815ceef9077cd76cb26dc5d6fcc5ebaa5fc95a511928bd21
+RMD160 (NetBSD-6.0/amd64/INSTALL.txt) = 271a2919d0ff6fddc1bb771716e67a7319795f7c
+MD5 (NetBSD-6.0/amd64/INSTALL.txt) = 2de264a9a927f1f3513674ec16ac4d45
+SHA1 (NetBSD-6.0/amiga/binary/kernel/netbsd-GENERIC.gz) = ad3ce973bb574d84022cbc071997dca9377e1be7
+SHA512 (NetBSD-6.0/amiga/binary/kernel/netbsd-GENERIC.gz) = 23e227becd8364657d767347b251ca8f47efe9397b9a0cadec90aeb9e90372dc49f143026ca678d933acde69c9be780b50a589ce0cf164f61af8d4eb641f5c64
+RMD160 (NetBSD-6.0/amiga/binary/kernel/netbsd-GENERIC.gz) = 65ccd49cd01c0981f4b4a65914d59731492a9876
+MD5 (NetBSD-6.0/amiga/binary/kernel/netbsd-GENERIC.gz) = acb579f6a97b9a5909bebf16f2742b0a
+SHA1 (NetBSD-6.0/amiga/binary/kernel/netbsd-INSTALL.gz) = c3904eede4df412ea9a7db90f34009cdaee611dc
+SHA512 (NetBSD-6.0/amiga/binary/kernel/netbsd-INSTALL.gz) = 6087a06debbf2f6820f5c450495680b0f5356d2e5036e1a7787b02f9cd5c8c43da24069ac0cb14bf5b09ca5ff122905d0c26c044c361c27202b4aa9a561cfeba
+RMD160 (NetBSD-6.0/amiga/binary/kernel/netbsd-INSTALL.gz) = 8dcb009d9495e2c1f768e7900b28a263cafb1610
+MD5 (NetBSD-6.0/amiga/binary/kernel/netbsd-INSTALL.gz) = 635f24c98bd4bd94f42bf3daa9090b1c
+SHA1 (NetBSD-6.0/amiga/binary/kernel/netbsd-ISDN.gz) = c91b1e76e6f8d7b327728eb7110995968e56cb80
+SHA512 (NetBSD-6.0/amiga/binary/kernel/netbsd-ISDN.gz) = d1ba0cda42d6eaf9815f39a52429767c00769d671faaf7144c830f1d06dc5571c39e0e823a7764fbdfaad10a1f516385ed1d3d54c4053a913e8399e3a1d37084
+RMD160 (NetBSD-6.0/amiga/binary/kernel/netbsd-ISDN.gz) = 32dfb7318589e9e2445f781c1344f7b418b1b9e3
+MD5 (NetBSD-6.0/amiga/binary/kernel/netbsd-ISDN.gz) = efdc155fef394563fed3a0c32d90a291
+SHA1 (NetBSD-6.0/amiga/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/amiga/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/amiga/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/amiga/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/amiga/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/amiga/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/amiga/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/amiga/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/amiga/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/amiga/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/amiga/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/amiga/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/amiga/binary/sets/xcomp.tgz) = e13548b8974f5d55e98caf17b2b4bbbcf2430370
+SHA512 (NetBSD-6.0/amiga/binary/sets/xcomp.tgz) = e4b13c798df04ffef88e72100e2db5af400e5ae255cd7a1ca2907736b8138a59045b6f3bd8531b5753d0b87eadb1b5f801043a929bb25d1611e4be693c1da954
+RMD160 (NetBSD-6.0/amiga/binary/sets/xcomp.tgz) = 3b1f4e26ddd57e69afd9709553c1bf70d6e29ea0
+MD5 (NetBSD-6.0/amiga/binary/sets/xcomp.tgz) = 894bb9aa05b164d9923682165d708335
+SHA1 (NetBSD-6.0/amiga/binary/sets/xetc.tgz) = d2ca34bd668e108cbbfd4b45720823663339f8bd
+SHA512 (NetBSD-6.0/amiga/binary/sets/xetc.tgz) = 431ca465f300e7eb5d4dbd44c43e412a296fb4d3129217e752f86a720e8a8bdf736c9add05a45518a4f3e6cffa32381ef61e9186d360b68a5f8c64d87e385fb5
+RMD160 (NetBSD-6.0/amiga/binary/sets/xetc.tgz) = 4c5d664679856b02b694534cd6afdf20597e6d53
+MD5 (NetBSD-6.0/amiga/binary/sets/xetc.tgz) = 72bd67556ac14ea0ce147374af0ba624
+SHA1 (NetBSD-6.0/amiga/binary/sets/xfont.tgz) = 24ca4cb77a59246b1b05e0a91fed21c63259d12b
+SHA512 (NetBSD-6.0/amiga/binary/sets/xfont.tgz) = 8dc297fb6205a995767e68e77cc21169234dfb66a86bbcd2e1828fd32efeda0a25c9f2a9b1a39b97fe8d7b24f8cd5cf6160859af6be2259876f39ee4e76c405b
+RMD160 (NetBSD-6.0/amiga/binary/sets/xfont.tgz) = d2f134959940e6667aca185f01e388c05dc6bc85
+MD5 (NetBSD-6.0/amiga/binary/sets/xfont.tgz) = 3c96c1f0a13cd7d277ca35622ac9c058
+SHA1 (NetBSD-6.0/amiga/binary/sets/kern-GENERIC.tgz) = 295ba9f28d2b11af8b7ea93c0b4cec03e40002a7
+SHA512 (NetBSD-6.0/amiga/binary/sets/kern-GENERIC.tgz) = b762b6592db8439df6c8d7cfd26f509425c779dcb3d27face8aea6c50dec314c15124b6623152969d5a0998c6991050c5c18a4f547ff5027c8ef56e4d4b5baf3
+RMD160 (NetBSD-6.0/amiga/binary/sets/kern-GENERIC.tgz) = 566f5c6520f253fbd5c7043931b275811853e289
+MD5 (NetBSD-6.0/amiga/binary/sets/kern-GENERIC.tgz) = 3ef7c2157fd42c60a0c1c4c898855219
+SHA1 (NetBSD-6.0/amiga/binary/sets/base.tgz) = 863379dd24489824d8140df08e3f5ca5bb63c35a
+SHA512 (NetBSD-6.0/amiga/binary/sets/base.tgz) = 845fec5935b19d810896af3451bff4f2eb6b3b02b285e8e7651c3be32c60d2abacbbb614e3c11b96cf33497fbe6505458f9a292bb0393c54a764449b9b5dff65
+RMD160 (NetBSD-6.0/amiga/binary/sets/base.tgz) = 5c87d3799986d70963b0e02416ff7648602d31de
+MD5 (NetBSD-6.0/amiga/binary/sets/base.tgz) = c8b7075f670666c9492a46c44e4632de
+SHA1 (NetBSD-6.0/amiga/binary/sets/comp.tgz) = fad62d4d7c47d956a450773b817a838f30497212
+SHA512 (NetBSD-6.0/amiga/binary/sets/comp.tgz) = c8c85b7a59df5930e8cde1715b03c2ae7646d40902e2c402292308f8eba81132a155120215c763a68dd7f37ef489d786ee73911849b69cc9c9e3ba1e86de1bb9
+RMD160 (NetBSD-6.0/amiga/binary/sets/comp.tgz) = 46162e89fb8c66089ccf0523e3b3483834284284
+MD5 (NetBSD-6.0/amiga/binary/sets/comp.tgz) = f107b1d62d1535a4dc1052752837aecd
+SHA1 (NetBSD-6.0/amiga/binary/sets/etc.tgz) = 7a2e1bc8aa53aeea37bb71ae598886da762888c4
+SHA512 (NetBSD-6.0/amiga/binary/sets/etc.tgz) = 80d275882cc7df12a3ba35a9e101e1f4597c3cd16864026013be90f0a8e8ef2ab405b5b29dc39ed3e114fac9986dc05efb661cc4361cf4d05d4e6cb25462ae45
+RMD160 (NetBSD-6.0/amiga/binary/sets/etc.tgz) = 3b71a2cfee1368a862a75f44d249b85059f34bc6
+MD5 (NetBSD-6.0/amiga/binary/sets/etc.tgz) = e8fba82eea6cdabed070234fde1acf2b
+SHA1 (NetBSD-6.0/amiga/binary/sets/modules.tgz) = 412c02a1fe2bc42ffaa13e3b5cfe30ab89ca8066
+SHA512 (NetBSD-6.0/amiga/binary/sets/modules.tgz) = 0fcda39f953bfbeaae0480d14a4e36724296ff88185985aec0863d5730048da38dd37f5f609e4b085a4776fbf139e8ca3acd693e7a5827f5fa7f51b2006b1447
+RMD160 (NetBSD-6.0/amiga/binary/sets/modules.tgz) = 44f4e35271aa128a88c14913b82edc82f93ffb57
+MD5 (NetBSD-6.0/amiga/binary/sets/modules.tgz) = c0a7fed3fc40edbb00bc24975c10c011
+SHA1 (NetBSD-6.0/amiga/binary/sets/tests.tgz) = 3d5677828808ee833c1c65cf5ff5d1cf1f66611f
+SHA512 (NetBSD-6.0/amiga/binary/sets/tests.tgz) = 4d868f712f2e0e3e9b56e6f346934b71eb174d97ff197883f3e3d4923c3dabda651bb3fa3d172fcd32ee5d07b659e7639cff6d9c9450e605174d8a09a6ac730a
+RMD160 (NetBSD-6.0/amiga/binary/sets/tests.tgz) = 662e3dcc455114628676304b277a852a49597104
+MD5 (NetBSD-6.0/amiga/binary/sets/tests.tgz) = 84a17f9c5c7bb88e34f42e3a7cbdc490
+SHA1 (NetBSD-6.0/amiga/binary/sets/text.tgz) = 8153acee4263203531a66cdf71215db94d745bd9
+SHA512 (NetBSD-6.0/amiga/binary/sets/text.tgz) = 3ca801f17e44f701543140841123196e132f920d7ac5859dc2a5133da08b73f4d730cbfc62fee5ba9bac6b0d96cf4985b951aad33cf59d5470d7b99cadaf51dd
+RMD160 (NetBSD-6.0/amiga/binary/sets/text.tgz) = 5820be807d773054a2c25d0c0009141ddf4a3d5c
+MD5 (NetBSD-6.0/amiga/binary/sets/text.tgz) = 6640874a003b751e38fe8ecd14f001d7
+SHA1 (NetBSD-6.0/amiga/binary/sets/xbase.tgz) = c2df6e9a1c3bdae97964577118ae358efe3e3f38
+SHA512 (NetBSD-6.0/amiga/binary/sets/xbase.tgz) = 4751bb14d6a5da31d95ab7e5cef52fcba99b8e13b8379f7fcff8aafe8116c4a036553adf4e6e9bed1642cf39b8e3de6a4e29a37ea48d1363dad853ef3d198604
+RMD160 (NetBSD-6.0/amiga/binary/sets/xbase.tgz) = cbeb269f4126adf0e3e9894888047f70a42f1d6d
+MD5 (NetBSD-6.0/amiga/binary/sets/xbase.tgz) = 03727cb263b9f50dfec22ac09d5d0543
+SHA1 (NetBSD-6.0/amiga/binary/sets/xserver.tgz) = 3e746f532be1a2ea1d5d38894bf0be416021412a
+SHA512 (NetBSD-6.0/amiga/binary/sets/xserver.tgz) = b90fcec5aea23879b3c39aa516e1c658064d35e8dc8172fac9f722b9c08f71a73f3a33d84dc618c88bf368156e9e4bf220f3cbd110f66bd213838fef73af50f3
+RMD160 (NetBSD-6.0/amiga/binary/sets/xserver.tgz) = c50619861d88fbc22413aca3bad38cb33065b590
+MD5 (NetBSD-6.0/amiga/binary/sets/xserver.tgz) = 5ac22d2440ed272bbebec827a0134acc
+SHA1 (NetBSD-6.0/amiga/installation/miniroot/miniroot.fs.gz) = d83dc1458c18c0625f767f00066eff80547ee71f
+SHA512 (NetBSD-6.0/amiga/installation/miniroot/miniroot.fs.gz) = 415b4c824c4efdd1c8fd597c6c8222c26d77e56f6f36bcb65d9e7eb3882c20f3c452f05b4541a0832590e53a67b12423d21196626fcc7c1cad4992648a98e136
+RMD160 (NetBSD-6.0/amiga/installation/miniroot/miniroot.fs.gz) = 4cf219c14c3c367d95ff4aa4cf04dba379ee16c7
+MD5 (NetBSD-6.0/amiga/installation/miniroot/miniroot.fs.gz) = 1bb2a3735737d2af8155407157cb2120
+SHA1 (NetBSD-6.0/amiga/installation/misc/loadbsd-2.14) = 32e902d420c2ba8498854bd26387369b09efabb6
+SHA512 (NetBSD-6.0/amiga/installation/misc/loadbsd-2.14) = 3fe58857d83d88f1fc7f6e29e8ee079be25326abad3a25ba5f64e3429f22f08ef102551e15c4275fe973d5536a5d459edea384fdd2293f68fe6d293801fba85c
+RMD160 (NetBSD-6.0/amiga/installation/misc/loadbsd-2.14) = 17a84971cee95ff8bf1b64d5071bd1fdbdbc5a99
+MD5 (NetBSD-6.0/amiga/installation/misc/loadbsd-2.14) = 1f841716409b236df90d9c5d63332edf
+SHA1 (NetBSD-6.0/amiga/installation/misc/loadbsd) = 2c8e314ee812e159ea479bacf09c47a2a4911e17
+SHA512 (NetBSD-6.0/amiga/installation/misc/loadbsd) = 881d3187366e2736e65e22bae93f24afd0b34b841b733898d3d172d98084f1729b19a6277445601da35471e3583e98b86008262b1a77dbb8bcc37e0c03d07b32
+RMD160 (NetBSD-6.0/amiga/installation/misc/loadbsd) = 00249c76e9a57ed5e58efbdc1001f782595c3918
+MD5 (NetBSD-6.0/amiga/installation/misc/loadbsd) = c1cc983600053a7de29feb09d703754d
+SHA1 (NetBSD-6.0/amiga/installation/misc/device-streams.tar.gz) = 5b96fab4bbb49a985481dc5c1e2830e994bd88ec
+SHA512 (NetBSD-6.0/amiga/installation/misc/device-streams.tar.gz) = 88e35b476d60dd988e8056263fc4f86893c5a7c2c3125934db8d728e3b679554b229b2adc3babf8c2ff21af46530eea1ff30e4b6af550b331ad22bd29e18434f
+RMD160 (NetBSD-6.0/amiga/installation/misc/device-streams.tar.gz) = d0444d1e967a624fde15e4526f9c7f673566492d
+MD5 (NetBSD-6.0/amiga/installation/misc/device-streams.tar.gz) = 6a3eed6278587660ed543c7449ee571e
+SHA1 (NetBSD-6.0/amiga/installation/misc/runbootblock.README) = 2d62005b98533a4fffd7d0445ac8cb7c5ac11c59
+SHA512 (NetBSD-6.0/amiga/installation/misc/runbootblock.README) = 9f071ff7ac0d2eabc77d43faeee48cba3a1883c957b046fad4d7d3237f41d2752a1e010a5d9f5324f90b81bc9968afe425d320e6742ac8f5e081056d5e133baf
+RMD160 (NetBSD-6.0/amiga/installation/misc/runbootblock.README) = 872a2169c248b016d6782a6b9c4208c67a346d12
+MD5 (NetBSD-6.0/amiga/installation/misc/runbootblock.README) = c60fe181cd9b255e294bfeb4be411181
+SHA1 (NetBSD-6.0/amiga/installation/misc/loadbsd-2.16) = eb660b987186a4e3a4eccb740dbb9e061a4b7216
+SHA512 (NetBSD-6.0/amiga/installation/misc/loadbsd-2.16) = 0f4565e2de70eaaf1d973da2b4a988e794b4608b2b0fa9c84dd05c82ade92fc4b75339e94e4a593e051ab3a364611fd7dbc2b48dccd4906f7b42fb665f7d711c
+RMD160 (NetBSD-6.0/amiga/installation/misc/loadbsd-2.16) = a071897afbdd11655a21df5a89c6e49b6e8a3574
+MD5 (NetBSD-6.0/amiga/installation/misc/loadbsd-2.16) = 8e67fb434887e942fe63cf308195b18f
+SHA1 (NetBSD-6.0/amiga/installation/misc/rdbinfo) = e413a8a5631dfedb4b1634c709836d1f92d9b08c
+SHA512 (NetBSD-6.0/amiga/installation/misc/rdbinfo) = 912ddb9bd1ba1af07e1072fee9a09f22124792abfc8f4f178a5df66dad17c39211c52d2a581111338a523f17a0dd58315d798659e901f14084d62a8c890e0a44
+RMD160 (NetBSD-6.0/amiga/installation/misc/rdbinfo) = 8fb8b41e39f6c2d48b6b46be0433dfc45c353621
+MD5 (NetBSD-6.0/amiga/installation/misc/rdbinfo) = 027c4bfce639d3cb88d617b0e85c0c4c
+SHA1 (NetBSD-6.0/amiga/installation/misc/runbootblock) = 598d688badd592a838dc260ce36b84c7835e72c0
+SHA512 (NetBSD-6.0/amiga/installation/misc/runbootblock) = d4cf9fe94244f1a832a6e474ff777ae7b901e86e0aabbbceb356c42f533dadb370686080b8e64993b9e07502310a4140fd393db5ddbdcd7a9e44c86b20f4c0a2
+RMD160 (NetBSD-6.0/amiga/installation/misc/runbootblock) = 2457b64f16ee58d22bacdf407ef35a1e9d244e1f
+MD5 (NetBSD-6.0/amiga/installation/misc/runbootblock) = d4d059566ad067e4d60259b389a5a9c3
+SHA1 (NetBSD-6.0/amiga/installation/misc/xstreamtodev) = eaf846a0d81754fb778b070926c495720cecffac
+SHA512 (NetBSD-6.0/amiga/installation/misc/xstreamtodev) = 873e7ffa5686a69b4a0ad68626f5e32176c03fc6231072531b36af3d0c0c055ced63e6c7f5cb0f3c6568f47720f31b76140aeede3f3dd9ddc8b639c6b3bdd5bf
+RMD160 (NetBSD-6.0/amiga/installation/misc/xstreamtodev) = 16910f7f243ca8ae74b8ff90d89163edbd4c3fbf
+MD5 (NetBSD-6.0/amiga/installation/misc/xstreamtodev) = a9e2e97f7945cf34da63aef17bed0f3f
+SHA1 (NetBSD-6.0/amiga/INSTALL.html) = 42ae087edd4c644275cb6a351bfc0801a23f7b41
+SHA512 (NetBSD-6.0/amiga/INSTALL.html) = e3f4389bff567192811d94c90b1df6d35d379774173ee935b2ebacf6ebc04edee9d270a71cf1e312bb52cfdfdf3ea7fa50f3cc6058bef88051f6da2953faefe0
+RMD160 (NetBSD-6.0/amiga/INSTALL.html) = 941e3e7501290a6a596c10bb9e9dce71fd68f01f
+MD5 (NetBSD-6.0/amiga/INSTALL.html) = ca5a2dcf7c5a927f0f89edabd084d59f
+SHA1 (NetBSD-6.0/amiga/INSTALL.more) = 2ef7c56d3b3789f858d82b96f8b955801feb402a
+SHA512 (NetBSD-6.0/amiga/INSTALL.more) = e1f87c081f267bb5bda5f1f07467e4081b3289cc1b5eead1ce26e954acf6704ad86ac95fb8958130f0a5b198eca80b967c7089cdc35ba4399cc79ab822df2ec2
+RMD160 (NetBSD-6.0/amiga/INSTALL.more) = 55a90159f299abe126ea37f0becea2f692fb1595
+MD5 (NetBSD-6.0/amiga/INSTALL.more) = 1357d2cc09f7d5429c5790dd32592032
+SHA1 (NetBSD-6.0/amiga/INSTALL.ps) = b4a7420ef6502bd98009c6f7b79053a076881f28
+SHA512 (NetBSD-6.0/amiga/INSTALL.ps) = 295f43cd3ba4b64deec0652bab61802cc37a7c3e75cab305cd0e12a682822a137abcd0915115709e1147e952b87bbb128e53251625288ba58068a52e491dd0da
+RMD160 (NetBSD-6.0/amiga/INSTALL.ps) = 07a4ea8478343a0f6a1e935eca5133ab116b5779
+MD5 (NetBSD-6.0/amiga/INSTALL.ps) = f07315266b0fd45fe58f107dda2177f8
+SHA1 (NetBSD-6.0/amiga/INSTALL.txt) = 6f5c90d805c69d5c75efb96b3b579d49bb123a6b
+SHA512 (NetBSD-6.0/amiga/INSTALL.txt) = 2fba02db405672d44df143421547a2291272a56f6d6e37b5da1f0396739ac55c695178c2e115a5af8574d6c323c8adc2747073e799b59d4e886191ce1baeb5cd
+RMD160 (NetBSD-6.0/amiga/INSTALL.txt) = 18db9a1a6e4af5935ed15d37c218b0309309c95c
+MD5 (NetBSD-6.0/amiga/INSTALL.txt) = 23deef4d8fd55d404915f004ba0fde9b
+SHA1 (NetBSD-6.0/amigappc/binary/kernel/netbsd-GENERIC.gz) = 1fb8ac599ecb67083a0505f7767600b5a00e6164
+SHA512 (NetBSD-6.0/amigappc/binary/kernel/netbsd-GENERIC.gz) = a41b53fecaa5077d80a2a6191073785c87ef703a4cd17e45ea1064e64c923fbf9d97edcc1c4e58ed205ea85f070f80a992198943a9384f4af473a11058c56d4f
+RMD160 (NetBSD-6.0/amigappc/binary/kernel/netbsd-GENERIC.gz) = b9f459e21e09ac314b2a02a2ec1a5ef0841af3d0
+MD5 (NetBSD-6.0/amigappc/binary/kernel/netbsd-GENERIC.gz) = 8c59d3085078659f9fd319d69ea1bc0a
+SHA1 (NetBSD-6.0/amigappc/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/amigappc/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/amigappc/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/amigappc/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/amigappc/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/amigappc/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/amigappc/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/amigappc/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/amigappc/binary/sets/kern-GENERIC.tgz) = 8cfda7d67d00c0344fc8b7e15c14367c9dd3c0d0
+SHA512 (NetBSD-6.0/amigappc/binary/sets/kern-GENERIC.tgz) = 00ecdc9511f389035fdd0d5786ec5b16ea52722cf390b75b11c0d0c5504d96bdfbaf6b19237e752aba9d530ed80cdaeadf18a7d0079c22a1560644fa8fb2ffc9
+RMD160 (NetBSD-6.0/amigappc/binary/sets/kern-GENERIC.tgz) = 0508773016c4dcf8b88d238235c66fc61785c0fe
+MD5 (NetBSD-6.0/amigappc/binary/sets/kern-GENERIC.tgz) = ada4ef952407ea1d320765955f626aed
+SHA1 (NetBSD-6.0/amigappc/binary/sets/base.tgz) = 69692adf17c4631804d6e78e96868bf22a0f80e4
+SHA512 (NetBSD-6.0/amigappc/binary/sets/base.tgz) = bc3f89b3201c184f38bed2dcd3e74ce01a8c9b5cdba1065bfe5bc0eadf0ed71fd73bcb9d0add77ab7d2cfc4848f40c482b0e2cbf50771577716f8a344eda5a6b
+RMD160 (NetBSD-6.0/amigappc/binary/sets/base.tgz) = 3cb20928324c3bf484a05a04d47afa4f587d5d52
+MD5 (NetBSD-6.0/amigappc/binary/sets/base.tgz) = 00d35c074b0f69e81494f42cd43ccecd
+SHA1 (NetBSD-6.0/amigappc/binary/sets/comp.tgz) = db98cb19c33216dafdd0ab26cbfa2a4f0cc685e7
+SHA512 (NetBSD-6.0/amigappc/binary/sets/comp.tgz) = 7dc6b1ed24deecd9f29aae5867bd2d89c9df3f443d522315f541eae77fde420d15b63233694043595a0f12491af5e24699598acc45ed05d9622911869f79ceb9
+RMD160 (NetBSD-6.0/amigappc/binary/sets/comp.tgz) = 776b79b7b476cc3b4caee7712070864d35779f66
+MD5 (NetBSD-6.0/amigappc/binary/sets/comp.tgz) = 385fe9939b6bb28a37cdf9cc3958dba8
+SHA1 (NetBSD-6.0/amigappc/binary/sets/etc.tgz) = f424a289be42a94c875757d9f83756d7e9286f20
+SHA512 (NetBSD-6.0/amigappc/binary/sets/etc.tgz) = b736da20bee72bb1962acce7cb8cd51e851f541ec79766d2258f1322ae843b0879208a6f69d6dda9ecc74a4bf7739fed626b8205432dd63f630b04803418307c
+RMD160 (NetBSD-6.0/amigappc/binary/sets/etc.tgz) = 0f163aa3a9450f45b40760786373089e52dae0bd
+MD5 (NetBSD-6.0/amigappc/binary/sets/etc.tgz) = c2cb43cbeb231d24b3864c7882da8edb
+SHA1 (NetBSD-6.0/amigappc/binary/sets/games.tgz) = d10c319a009f9859de37a5d5bb994d29669dce16
+SHA512 (NetBSD-6.0/amigappc/binary/sets/games.tgz) = 59e00cdf1b42e285db9cd29ab195b693f1989cd1480e644787307ea722a1a695e70708ad8fa6d0afbbb51de4ca8a4b81b550e2f1745d0140a47e1b6a7002a236
+RMD160 (NetBSD-6.0/amigappc/binary/sets/games.tgz) = 0baf65f6198b6f1c40960b30424a3ad44c1eca2f
+MD5 (NetBSD-6.0/amigappc/binary/sets/games.tgz) = 304dc86d68c23c7f30c30e4f092b6982
+SHA1 (NetBSD-6.0/amigappc/binary/sets/modules.tgz) = 2a05a8cf525b6b0323f54840bb42e069a36f1988
+SHA512 (NetBSD-6.0/amigappc/binary/sets/modules.tgz) = fc33e9c609d38775e7004d2715158178d08508f8a890831270191b7f32fae8a2d2b56e74e59d4f5d37574827cf85eda28e15f88ac1544a1ceec008105107dcb5
+RMD160 (NetBSD-6.0/amigappc/binary/sets/modules.tgz) = 931d81973e92a161da6468aeeb0b7a486fc96511
+MD5 (NetBSD-6.0/amigappc/binary/sets/modules.tgz) = 13f7ee97c852a71b51c91dd8f659b202
+SHA1 (NetBSD-6.0/amigappc/binary/sets/tests.tgz) = eee320cd38b5396a305b912cd43ad4f40dcb0e98
+SHA512 (NetBSD-6.0/amigappc/binary/sets/tests.tgz) = 3c2377b75fb69924c646904f67e3762bddbd5fe40214df319d205f412e7377e7695d5b648545f22e9b42696cb3fd3ddb9bde4ed7b3ad1d48ea32fbbf13356354
+RMD160 (NetBSD-6.0/amigappc/binary/sets/tests.tgz) = dd0ea2b9c6f23f409ced129c5dc847c582b572fe
+MD5 (NetBSD-6.0/amigappc/binary/sets/tests.tgz) = 2f0dc32c95f23026c06b50c946dce965
+SHA1 (NetBSD-6.0/amigappc/binary/sets/text.tgz) = 7b28a25a69ba9d2870c31c302be38d0c12b11486
+SHA512 (NetBSD-6.0/amigappc/binary/sets/text.tgz) = 77dcaa1c134ac4f346bf782c5c20ea4304b42a15a60a1321e944e59665946d1b3ddfcd9eba919f6ea4ca947dd8df63a9162adfea363e01758ffa5bf8e7f49e12
+RMD160 (NetBSD-6.0/amigappc/binary/sets/text.tgz) = 438d720340cbd19f86ac8449dd705d125958cdbf
+MD5 (NetBSD-6.0/amigappc/binary/sets/text.tgz) = 3fc18e1ff4fc50d561b478b39fe7f855
+SHA1 (NetBSD-6.0/amigappc/binary/sets/xbase.tgz) = 11ec98aff57d5a8f8cabcc0a41eb7e41c2cd750e
+SHA512 (NetBSD-6.0/amigappc/binary/sets/xbase.tgz) = c9c39d05fa60bc2a0e1a4aed89ecfafa47c203652f23b971fa9b3d23df291fbeb4735dd4621a81a46eff276c80410ee36492162e5282bf19bc9df4bf889d4fb8
+RMD160 (NetBSD-6.0/amigappc/binary/sets/xbase.tgz) = 4d1a32acb55c107327f1605a6a7d3379e3e3fbc1
+MD5 (NetBSD-6.0/amigappc/binary/sets/xbase.tgz) = 0a959da0b8e03e2686da275c8311addf
+SHA1 (NetBSD-6.0/amigappc/binary/sets/xcomp.tgz) = 5a450d9cb090214e14b45d59ee87d7786da4afcd
+SHA512 (NetBSD-6.0/amigappc/binary/sets/xcomp.tgz) = 2478cf90ce45e16d8854bfc2aad28d102aafb53f9b2fd39756bff0970c0546f52a3d31be85e581ae78e982b06f17a8de77eea776d7d8e0770e00a0e198c06bbe
+RMD160 (NetBSD-6.0/amigappc/binary/sets/xcomp.tgz) = 82323c0e4b56e79891087934eed15d1472646bec
+MD5 (NetBSD-6.0/amigappc/binary/sets/xcomp.tgz) = 096eaba339adb8b492dc1ce5de1dada0
+SHA1 (NetBSD-6.0/amigappc/binary/sets/xetc.tgz) = 98fd5a6cb8eab73e8453afe8626198945e0cd1e4
+SHA512 (NetBSD-6.0/amigappc/binary/sets/xetc.tgz) = 13b0c70af019c1e2bf14c8df794f497c317cc94e23012f61b88e7386327cd43c6a7b00a04ed4d65975849db9978fa63b401a2d1a49f0d476e17e4d5123d66e8b
+RMD160 (NetBSD-6.0/amigappc/binary/sets/xetc.tgz) = ce7639ef1eebd525f0f6631e4aa80a5d44a9ba5e
+MD5 (NetBSD-6.0/amigappc/binary/sets/xetc.tgz) = 2bdf6c00be2e1b9420a8d6fd6ab9e285
+SHA1 (NetBSD-6.0/amigappc/binary/sets/xfont.tgz) = f87acd8ea1747d825ad1038f8984bfd9cc5ed3c8
+SHA512 (NetBSD-6.0/amigappc/binary/sets/xfont.tgz) = bd4c6c5913572cfaff4c3cdd66d2e745605d4f8c70f46e25951c109700c4a05a4b8d1202beb90b7b0cb5ba7b37bdcb3bc31a5ddba8737b7133fa3c2239312f62
+RMD160 (NetBSD-6.0/amigappc/binary/sets/xfont.tgz) = 6ff6daa8eff23cd8f49f60ac7adf82afaf029a02
+MD5 (NetBSD-6.0/amigappc/binary/sets/xfont.tgz) = e9eb507d880069bb39bca1e12ca61f05
+SHA1 (NetBSD-6.0/amigappc/binary/sets/xserver.tgz) = 5dca2b2f9ebbdd6d659e06bdb69987fe02278968
+SHA512 (NetBSD-6.0/amigappc/binary/sets/xserver.tgz) = e2e87ac352cbadc9e0590b7ddc402de6dc4ee3fb26a504265aa1a706ef53135fb80d0d3e149e94825485fd121add254d68a88ead521949f55da7d9e252192575
+RMD160 (NetBSD-6.0/amigappc/binary/sets/xserver.tgz) = 94ab84cf7ee91393ef0630b7b3110a4846940dfa
+MD5 (NetBSD-6.0/amigappc/binary/sets/xserver.tgz) = 6ca7773bb022c8842ce6a0a4a0f23c80
+SHA1 (NetBSD-6.0/arc/binary/kernel/netbsd-RAMDISK.symbols.gz) = f4e479e3fec7462469600527ae1b9aecd1c86bcd
+SHA512 (NetBSD-6.0/arc/binary/kernel/netbsd-RAMDISK.symbols.gz) = 8cd3e3d089a53b56fdd47ab4cda09b42bf12c92074699a3764f4fdbb23c58425d68f0ee8e862987386d9c8107e0e115daf39bd35058b4e51d93c4dc7d5756d04
+RMD160 (NetBSD-6.0/arc/binary/kernel/netbsd-RAMDISK.symbols.gz) = 79dd220dcba4f30fd629e744993e3d8617d2c3ac
+MD5 (NetBSD-6.0/arc/binary/kernel/netbsd-RAMDISK.symbols.gz) = 2ffba67d5ec969424a75c71e5f04c77f
+SHA1 (NetBSD-6.0/arc/binary/kernel/netbsd-GENERIC.gz) = c34a668c8d951cd778d973a0066223bd4ea98133
+SHA512 (NetBSD-6.0/arc/binary/kernel/netbsd-GENERIC.gz) = 47685372141fd6fae114fcbcc57016c6896f96705be116020802c6e6a7493cbea9ecf62dbbfc89c49f0f90d42aee1f06b9d6ed3eb679b0b1e3e2705c3ff0ec1c
+RMD160 (NetBSD-6.0/arc/binary/kernel/netbsd-GENERIC.gz) = d46270739b1bc29e7e361805d4f23a28ced95975
+MD5 (NetBSD-6.0/arc/binary/kernel/netbsd-GENERIC.gz) = 046973b3c11b35cb476d07db96419743
+SHA1 (NetBSD-6.0/arc/binary/kernel/netbsd-RAMDISK.gz) = 01c3eb7eabe2423ff73da425627b361ff99bbe21
+SHA512 (NetBSD-6.0/arc/binary/kernel/netbsd-RAMDISK.gz) = ae090ee3642160ed2ab38f6cc1487b545cce31320c8561bb4af5501dc757f24997798a7556a2048cd7f7e0da9ad3415e458273245317bcacafa0d9b76f4326a8
+RMD160 (NetBSD-6.0/arc/binary/kernel/netbsd-RAMDISK.gz) = 9bd6a441f8fbbf01f78b536d75bb8cfdaa56f8cd
+MD5 (NetBSD-6.0/arc/binary/kernel/netbsd-RAMDISK.gz) = 6103f4c89298eab52773ed2a6fa59de6
+SHA1 (NetBSD-6.0/arc/binary/sets/games.tgz) = 27d9f98fecb3495e51939df9f107e81e527af26f
+SHA512 (NetBSD-6.0/arc/binary/sets/games.tgz) = 46bb4e10313cfffaaf4f7fa2157474ef940f94bcc9f84b46f829c7615bbf45e4e01edee7b7efb84bc28561e0712c37cfc737f9c2a0d9a73b67c80c8aa0f3a9af
+RMD160 (NetBSD-6.0/arc/binary/sets/games.tgz) = 947feea90ec2698a65d555cb78a29a001b086589
+MD5 (NetBSD-6.0/arc/binary/sets/games.tgz) = 355f00978fed8e8da6a251e591be5387
+SHA1 (NetBSD-6.0/arc/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/arc/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/arc/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/arc/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/arc/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/arc/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/arc/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/arc/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/arc/binary/sets/xbase.tgz) = 76468fcada5a9e26652aa9f0f9f3c94829a317e9
+SHA512 (NetBSD-6.0/arc/binary/sets/xbase.tgz) = b2adcfc2dedef30b21b885c8fc757d0479541744a280a9997fbeaa9c881009ab4b0019e0001a540a8eb6db5f84db87b365e420bb2d4270af209821bdb080369c
+RMD160 (NetBSD-6.0/arc/binary/sets/xbase.tgz) = 1e0074d03d9fbb3373e0a427b25cc7097bf6d3c8
+MD5 (NetBSD-6.0/arc/binary/sets/xbase.tgz) = a8f29ec2e3768405942f97af3dd08ee7
+SHA1 (NetBSD-6.0/arc/binary/sets/xcomp.tgz) = d8ac89f3f6ff20abb0adabc49227afdb74aa2040
+SHA512 (NetBSD-6.0/arc/binary/sets/xcomp.tgz) = 4f03213fb061dae9421747209628d06ede6bbb71a7560a9e1a54796b907f1620146a33fdce52974227a21acedcc210b99e15c4fdd36432eba60c1041a92d8cee
+RMD160 (NetBSD-6.0/arc/binary/sets/xcomp.tgz) = 6be5e72b9b57c9bdf8ed8ea127e2a73830feeecb
+MD5 (NetBSD-6.0/arc/binary/sets/xcomp.tgz) = 59a7ea141587417be38ab1f6056cc780
+SHA1 (NetBSD-6.0/arc/binary/sets/xetc.tgz) = b9f6b1a54ffab37b11f4c6e717b481cd087fb609
+SHA512 (NetBSD-6.0/arc/binary/sets/xetc.tgz) = 72f35e65f3a90967e250a2006d500619b3824f7f5c3d7494554f153ec5cda5b28c445f28c34a1e4463f40da5855e8d4257726411796967fe37763d90cf7fe461
+RMD160 (NetBSD-6.0/arc/binary/sets/xetc.tgz) = 1169c246f91189fd0c4ae86ac27a92f5c2edda3e
+MD5 (NetBSD-6.0/arc/binary/sets/xetc.tgz) = 8f3c52cc5af1cafaf7b0d0f884a5b537
+SHA1 (NetBSD-6.0/arc/binary/sets/xfont.tgz) = d06848571034f3b7fc975082f1de37b912acb18c
+SHA512 (NetBSD-6.0/arc/binary/sets/xfont.tgz) = 66a1013c935bee5e7e5d24325a527522306bcded7ced63790f2e58831b3ed91176a1b9510b2159be63504d5167d48d534919927ffc6e225ae2bb2487f90a9ede
+RMD160 (NetBSD-6.0/arc/binary/sets/xfont.tgz) = c9502843a5d4dd7e996e8d158c519cf7f8575cbd
+MD5 (NetBSD-6.0/arc/binary/sets/xfont.tgz) = e812899176eac2bf65a6d949ac3f3424
+SHA1 (NetBSD-6.0/arc/binary/sets/xserver.tgz) = ff805022f409202f3346c45475c7ec0f8187218e
+SHA512 (NetBSD-6.0/arc/binary/sets/xserver.tgz) = f2bb3810a5572b519980126a3d934f63b5ab5c2fcf9fb8166c556bd3cc14cfaa151d582086bb1506ac9ac7e21d4e70a5cd5c3faed96212d8a14a0b5bafdcc4c1
+RMD160 (NetBSD-6.0/arc/binary/sets/xserver.tgz) = d5ae336337cc77f7f55f542b3457918d6fc0efe8
+MD5 (NetBSD-6.0/arc/binary/sets/xserver.tgz) = 92447a1560887d337d22e2deed0670a6
+SHA1 (NetBSD-6.0/arc/binary/sets/kern-GENERIC.tgz) = a49dc5701671d377df81d0dc82ebca225e8aff4a
+SHA512 (NetBSD-6.0/arc/binary/sets/kern-GENERIC.tgz) = 75bf73c2b22aac1948b5c0fd6ca0a0d240fc398baf7dfe4bbb155f44c8e3bf47d618fb5ee97215728baa471c25dddc285643064acbfed88fcc33f463ec36162a
+RMD160 (NetBSD-6.0/arc/binary/sets/kern-GENERIC.tgz) = 49075dea0d02de7d508afb65fa4c4591f7ab1b0a
+MD5 (NetBSD-6.0/arc/binary/sets/kern-GENERIC.tgz) = 3dd1b55b9d8aaa84ce5630c649d6d17e
+SHA1 (NetBSD-6.0/arc/binary/sets/base.tgz) = 5c25c736260c32dc5e61db84d779f979421417c4
+SHA512 (NetBSD-6.0/arc/binary/sets/base.tgz) = 7bccf72e05a792158f7aa8617b270d860221b935c3c092da8961b35277931500f5e6e8a572536b7371e66dbe7368b17f62512783240dce9aa2990af50c60fc1e
+RMD160 (NetBSD-6.0/arc/binary/sets/base.tgz) = c36e7a0c39a18646de9363196aa56dd0c4a6ea6b
+MD5 (NetBSD-6.0/arc/binary/sets/base.tgz) = 97e2836870812371a84cf44790cf6f16
+SHA1 (NetBSD-6.0/arc/binary/sets/comp.tgz) = 52ac953130a36ae6bba2139c7892d6ccbab0f0cf
+SHA512 (NetBSD-6.0/arc/binary/sets/comp.tgz) = a09590c181019592ffb4341620eeaaae1f25e971ee975ac337c96cdc5dc6ceb2074dcba6a5dcc723c30e5db3d32148146eb6c1eb38390d0162aff4d5071434c6
+RMD160 (NetBSD-6.0/arc/binary/sets/comp.tgz) = e9c5ae0abd43a2ac743f62a498ad8bb0dde61ed2
+MD5 (NetBSD-6.0/arc/binary/sets/comp.tgz) = 2eebbc2b1b8bbe21166a0d860bea9dd5
+SHA1 (NetBSD-6.0/arc/binary/sets/etc.tgz) = cfa766b3b33eeae2aa28312e0ca6e434e2573487
+SHA512 (NetBSD-6.0/arc/binary/sets/etc.tgz) = ef3806802fa813b1bb60674c032f31e5a140b89953aabe715d050e7c820413ae991de791e96d8aecaa1aea8989f6f0268726ad5dc62e42ef06ca6670fb6744ba
+RMD160 (NetBSD-6.0/arc/binary/sets/etc.tgz) = 395630144133efd05b0fbe596773c5ea4218aa8c
+MD5 (NetBSD-6.0/arc/binary/sets/etc.tgz) = af810d6fb839f2953bba9844501cdcab
+SHA1 (NetBSD-6.0/arc/binary/sets/modules.tgz) = cfd582b6f65203d1916ed6655d02f5aa6ad5ba88
+SHA512 (NetBSD-6.0/arc/binary/sets/modules.tgz) = 86be394fe232856d0de502fb1569fd03de91a81ad782389414ed75618d63d97d8abebc14fd44843414d865071f51940c248d076a57524e8ef91c791ee98620c9
+RMD160 (NetBSD-6.0/arc/binary/sets/modules.tgz) = c63e9a0caaf005f8c03275c8faf582d95b3c6700
+MD5 (NetBSD-6.0/arc/binary/sets/modules.tgz) = cd4a56dcabef37fbf7a3fb7ee95ea738
+SHA1 (NetBSD-6.0/arc/binary/sets/tests.tgz) = 25fca6e0ee3c0c05615fb5753d78584e0c3fd5ca
+SHA512 (NetBSD-6.0/arc/binary/sets/tests.tgz) = 54fd09bdf390959e4a795af7efa34cf463f0d41676a87bceae7e8278f97693549bea10d7de099c0f3af34f58ea76820ecd357894d9c7e5bccc65d2fa9736dd40
+RMD160 (NetBSD-6.0/arc/binary/sets/tests.tgz) = baf5b98a820547d80922493f59c48028345306da
+MD5 (NetBSD-6.0/arc/binary/sets/tests.tgz) = 601e2f0d37d00e07a671ed2cb823e68e
+SHA1 (NetBSD-6.0/arc/binary/sets/text.tgz) = fe43613098e27d16d74e9c21e0b18cc5e932e673
+SHA512 (NetBSD-6.0/arc/binary/sets/text.tgz) = 4935e883c8328121eb941726a41487dc9048a9d3265460e9730465a3d1b8283e4bd01ad2c220607848f898f178dac0738c6bb6402243bcc338e5f933a6c99f06
+RMD160 (NetBSD-6.0/arc/binary/sets/text.tgz) = b57da314266be1fdf31856f5ad5a52703016b61e
+MD5 (NetBSD-6.0/arc/binary/sets/text.tgz) = 9236a9d595f3a96234ba9156ed3437e2
+SHA1 (NetBSD-6.0/arc/installation/boot) = 889f35138bde05f74032980aa2ca7c17442c4324
+SHA512 (NetBSD-6.0/arc/installation/boot) = 9a1ccabb379ab44784c481e749f633cf4235c03e22c24f2a837e6fcbe28b23f7bde8a7ed596dde93996bdc5efbf639ed6a073fd848eef2b0d80e932ba360c9e5
+RMD160 (NetBSD-6.0/arc/installation/boot) = 369fb440abfca5f2f4340740265f61a9d2ca8df7
+MD5 (NetBSD-6.0/arc/installation/boot) = 36b7e6f86ddc8aede5c9ea0160939cb2
+SHA1 (NetBSD-6.0/arc/INSTALL.html) = 0cf4b01d7175a1eb6dd2734e412c3bed0fb0967d
+SHA512 (NetBSD-6.0/arc/INSTALL.html) = 68a51695f6fbe96610354b253741efcd7f52bd543351a3f3b734398264f7b75c03e72ee731be917b2e34a0041c621107177efb57ba9abe6158456e19526845db
+RMD160 (NetBSD-6.0/arc/INSTALL.html) = e174f77ca32ded5ae5363e88ca33ec17df6b95ae
+MD5 (NetBSD-6.0/arc/INSTALL.html) = 94eb6340dc1e3d6ae7b539e3ca3744a4
+SHA1 (NetBSD-6.0/arc/INSTALL.more) = 6146391a310edb4727d4b5a61793d535c0983c0d
+SHA512 (NetBSD-6.0/arc/INSTALL.more) = 12e1ebc08bd3fb259caafd6b75e1120daba07fb4ad201f513459e5e36ad96790a26076cf154b34332a54192cbda13bf0b85847478a2443114522225f1adbf95d
+RMD160 (NetBSD-6.0/arc/INSTALL.more) = 52a7433c4a3fbb3fa6ca52117f9f902a96748dee
+MD5 (NetBSD-6.0/arc/INSTALL.more) = 9a6a3c4c52c723151ac81fc40567f625
+SHA1 (NetBSD-6.0/arc/INSTALL.ps) = ed6ce1da53cd979819a5080666fef04c62c3cf60
+SHA512 (NetBSD-6.0/arc/INSTALL.ps) = 8ea3bef19288069a145d6873030895c960811c8dbcff956101f425a9ce0a57701f0f0579c925248b5ecc9f7ac110ddcb18b8041ed74ffd69c22b598ce8d89788
+RMD160 (NetBSD-6.0/arc/INSTALL.ps) = e1c8d2d8ef5b2d170f659f14bf124063d8d34c22
+MD5 (NetBSD-6.0/arc/INSTALL.ps) = f97b10a669be7ec3f9603d5f936fe9fe
+SHA1 (NetBSD-6.0/arc/INSTALL.txt) = 799c2e5d3f8a8d4c93e0ba1e0e738dffbec98504
+SHA512 (NetBSD-6.0/arc/INSTALL.txt) = ed89213d84a4ce5ca43b8b7ed35b6e2e731c77205518b8c48258b18567ecc6e2150e81c2d2a4ca0b3c2bbf8059218d0cf918b168c2f55b305815f89ce3cb45c7
+RMD160 (NetBSD-6.0/arc/INSTALL.txt) = d9be36fb053f75805f95439723d18875e6d0cd5c
+MD5 (NetBSD-6.0/arc/INSTALL.txt) = 56f07f0f3cd11f592b56f5978d23c533
+SHA1 (NetBSD-6.0/atari/binary/kernel/netbsd-MILAN-ISAIDE.gz) = abe68fd4d9212fee55be19e05105bed9ee51687b
+SHA512 (NetBSD-6.0/atari/binary/kernel/netbsd-MILAN-ISAIDE.gz) = 759476c2983250d38267853ca369a432b968e9d8187ae8476d5e2931667518abc63fadef50c6bcf55299866c019d74790e8268b58f433c6413c03cfe1460d8a0
+RMD160 (NetBSD-6.0/atari/binary/kernel/netbsd-MILAN-ISAIDE.gz) = defe3e00a5198a97320f53a1460eb7601f2d5a9d
+MD5 (NetBSD-6.0/atari/binary/kernel/netbsd-MILAN-ISAIDE.gz) = fadc1a2fcec83bae67e6e70f1ee8d4c6
+SHA1 (NetBSD-6.0/atari/binary/kernel/netbsd-ATARITT.gz) = 9d2e04ce73a5a24cfb10801c0ccf659242602dd3
+SHA512 (NetBSD-6.0/atari/binary/kernel/netbsd-ATARITT.gz) = 27b28318b371707290e3b8482dc0e98e32c6d5b7fb4d38e3bddda7bc5e1b953ae0651b680cf7ea9a296018b5a0ac883cb59d4da3c02db1baa67e151da783f6ed
+RMD160 (NetBSD-6.0/atari/binary/kernel/netbsd-ATARITT.gz) = 77d47ef664e710823cef2633c92bde054a970552
+MD5 (NetBSD-6.0/atari/binary/kernel/netbsd-ATARITT.gz) = f99c55c64e84c84de3991fa4f21897c5
+SHA1 (NetBSD-6.0/atari/binary/kernel/netbsd-FALCON.gz) = 9c0e5bc223f81e24108dde3428ee8833e557d891
+SHA512 (NetBSD-6.0/atari/binary/kernel/netbsd-FALCON.gz) = 6147ba07227f85a3ba2ee1e78449aa2c4e0ad708e9cc000f456a74a69f6443f099e200f2dd3602ceb453dffe7b41c90c32f45ff63d44d59cd0ce24ba68f3ffa1
+RMD160 (NetBSD-6.0/atari/binary/kernel/netbsd-FALCON.gz) = b2c8d8f4742da6ccf1e0ec3811160d9ce9606baf
+MD5 (NetBSD-6.0/atari/binary/kernel/netbsd-FALCON.gz) = 2189a16e1ee3e1586f691490fe6bfc9a
+SHA1 (NetBSD-6.0/atari/binary/kernel/netbsd-HADES.gz) = c4f3101449a14e294394b13eacff10053078ad4d
+SHA512 (NetBSD-6.0/atari/binary/kernel/netbsd-HADES.gz) = bef4589fa86a33df94fdb36038e93528984629682c2827ed4dad582ae17cfea37b9841608dacc95fd8a55c57c40a81b8d24d7afd253dd46d7af970e0927518bc
+RMD160 (NetBSD-6.0/atari/binary/kernel/netbsd-HADES.gz) = 821bc772711ece35be32f1fadac8fa31a10041ac
+MD5 (NetBSD-6.0/atari/binary/kernel/netbsd-HADES.gz) = 82b69e45fbf4740774a338f62c987dec
+SHA1 (NetBSD-6.0/atari/binary/kernel/netbsd-MILAN-PCIIDE.gz) = 4e056fe210771d7d97ad303cc4d92fed64d883f2
+SHA512 (NetBSD-6.0/atari/binary/kernel/netbsd-MILAN-PCIIDE.gz) = 2c303e9421be0eae122cf55c2b5205b4c2129e6bf3033372f8fca93ad410f92137db6463ad9b75db53526dccb2b9c8a3da23d04357a6a3663aa58972c39184ad
+RMD160 (NetBSD-6.0/atari/binary/kernel/netbsd-MILAN-PCIIDE.gz) = 878a29fec55b0429c47f0932facf25139721c88d
+MD5 (NetBSD-6.0/atari/binary/kernel/netbsd-MILAN-PCIIDE.gz) = b2e52ec52845325caf8fce89fcf5b034
+SHA1 (NetBSD-6.0/atari/binary/kernel/netbsd-SMALL030.gz) = e6b4dad71f39674e21a0baa6cd5bbc61872786e1
+SHA512 (NetBSD-6.0/atari/binary/kernel/netbsd-SMALL030.gz) = 856e3435c5ae454b145bb16a679da93cc966cd7ee75ab8cce77f216d4070b9e3f1a0d2bf15ae9eda28f48a0eaeeae590559888eef477ab4c72badcaed7b7484e
+RMD160 (NetBSD-6.0/atari/binary/kernel/netbsd-SMALL030.gz) = 449713cd4e5c43656648e76a59b0228cbf51de82
+MD5 (NetBSD-6.0/atari/binary/kernel/netbsd-SMALL030.gz) = d38e0f0b5090a8d0d6552092c241e105
+SHA1 (NetBSD-6.0/atari/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/atari/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/atari/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/atari/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/atari/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/atari/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/atari/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/atari/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/atari/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/atari/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/atari/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/atari/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/atari/binary/sets/xserver.tgz) = 1d20fd039546a66b428b854c659ea5e2ee9f8114
+SHA512 (NetBSD-6.0/atari/binary/sets/xserver.tgz) = 091d09049d0af5555feec02065234e281677aeb3ecbab5a19413d924a8b58dc7f64401ef68e68bc52d8b6eeb73e091d351c45805374b8bf276b0181415968561
+RMD160 (NetBSD-6.0/atari/binary/sets/xserver.tgz) = feef5d52278d23637d7b8ba77639bfd96918e90e
+MD5 (NetBSD-6.0/atari/binary/sets/xserver.tgz) = b2bd6057c374376388766fc8667eb9a9
+SHA1 (NetBSD-6.0/atari/binary/sets/kern-ATARITT.tgz) = 589b0e48516d961e8961847f441bf7dbcbb67700
+SHA512 (NetBSD-6.0/atari/binary/sets/kern-ATARITT.tgz) = 00ad9fefd5c3fb87f45b20612582b818def61c0f08483f923622a19e94090feb7ba1e39dc8d3b4b7d57e70c60aacaaeee966e1a6a788aff9fbbedc6848e52cd4
+RMD160 (NetBSD-6.0/atari/binary/sets/kern-ATARITT.tgz) = 510465a0b2f0e19a4873fa87fa66d7c47ec8226e
+MD5 (NetBSD-6.0/atari/binary/sets/kern-ATARITT.tgz) = cea983b428fc041a9ad553b25e6de431
+SHA1 (NetBSD-6.0/atari/binary/sets/base.tgz) = 948b83244fe16e439af84cee9dd48f555ff2c479
+SHA512 (NetBSD-6.0/atari/binary/sets/base.tgz) = ee2c41fa904f75740c358f85bc97c36537d6a0f252bfb4ca3ec60098109ca07b8be38e8474ea7355e557793fe726160e1f0d10de2769720432a8cb0896bdcf7f
+RMD160 (NetBSD-6.0/atari/binary/sets/base.tgz) = d08e1a2d3eb8629aafe49fe89e9c00c65c97967b
+MD5 (NetBSD-6.0/atari/binary/sets/base.tgz) = 07d14a63f5591f86d0cb7728174ad6b1
+SHA1 (NetBSD-6.0/atari/binary/sets/comp.tgz) = 081806be5308d18e9910a9f3394bb15fec7111bb
+SHA512 (NetBSD-6.0/atari/binary/sets/comp.tgz) = 17e0a84c5ccefcbee5807012b93f413fa90d6fdb55bc91020cc5265528eb4331a4e2d5f951ac457b0fbf24ce2a97f7dde29a2cfda946edc5db2bf7c574289a75
+RMD160 (NetBSD-6.0/atari/binary/sets/comp.tgz) = e2f1fbee6aa542a8b2d80cb2eb4b593fa13a4dae
+MD5 (NetBSD-6.0/atari/binary/sets/comp.tgz) = 46cdf183c47138a86c07a43cc4c365d7
+SHA1 (NetBSD-6.0/atari/binary/sets/etc.tgz) = 7e13a9c53246d90a86a0db1a3e38ade70705402d
+SHA512 (NetBSD-6.0/atari/binary/sets/etc.tgz) = d751e14266428861f1ef067f02c8e4f79047e3c482f9b89ca44e880ea71ef66de3792d03f4b3704fc98bd8c9ff17cbdb42fa4c4cf3dccff9a94e88662a9035bb
+RMD160 (NetBSD-6.0/atari/binary/sets/etc.tgz) = f09fa0ba9766e3cbaf7eb0f59f32dac370d37f14
+MD5 (NetBSD-6.0/atari/binary/sets/etc.tgz) = 42096354bae512677af5f6d5c9a8484c
+SHA1 (NetBSD-6.0/atari/binary/sets/kern-MILAN-ISAIDE.tgz) = c623eff071500b740c875a6984194d2826ab66c1
+SHA512 (NetBSD-6.0/atari/binary/sets/kern-MILAN-ISAIDE.tgz) = 25f68ad0b3a910cad6f8d8a7cc232a3e6e71ea381fa8cefd342ff3c18c869abdcdfa517984c54ffcdf72e7393b79aeff78467137d6729447042233a55297bfe7
+RMD160 (NetBSD-6.0/atari/binary/sets/kern-MILAN-ISAIDE.tgz) = 16cc868818532530f4441eed778a26b98ba06190
+MD5 (NetBSD-6.0/atari/binary/sets/kern-MILAN-ISAIDE.tgz) = cc65ece6a5e66a5c1f0aa67a24bb1726
+SHA1 (NetBSD-6.0/atari/binary/sets/kern-FALCON.tgz) = 4e7e28bad7354a7bb7fdde4f608340c4907b4453
+SHA512 (NetBSD-6.0/atari/binary/sets/kern-FALCON.tgz) = 24d5df6a74be2fa65016ab03eb11bcd6dbab11ebc33b0ab936685345ff54fe518b6b87171c93c4afab54b0374fb9d5ffa29390a34dd218b400e985dfeae8d147
+RMD160 (NetBSD-6.0/atari/binary/sets/kern-FALCON.tgz) = 82c44f12a090c11dd2b7de11b8b9ae95fa74ed08
+MD5 (NetBSD-6.0/atari/binary/sets/kern-FALCON.tgz) = fea878ea06b74eef20f60e192539f033
+SHA1 (NetBSD-6.0/atari/binary/sets/kern-HADES.tgz) = 24a828836e47ffe647f8a16b1fd0469a9ee62f03
+SHA512 (NetBSD-6.0/atari/binary/sets/kern-HADES.tgz) = 8bbc2397d01594b89515abea27fa58e9ce7dbda5d2f9468b5bc46576d858395c11e4e1d6a9c25dd9b7d5ddb7ac2c2fd2208d95274f9ce7519fb470cbf08da2ae
+RMD160 (NetBSD-6.0/atari/binary/sets/kern-HADES.tgz) = ae93fdba82eecea06486ad88927f25fe1013803d
+MD5 (NetBSD-6.0/atari/binary/sets/kern-HADES.tgz) = 244b09181178cc0b51c79ad7568f4d9e
+SHA1 (NetBSD-6.0/atari/binary/sets/kern-MILAN-PCIIDE.tgz) = 0269a5f553ad95565fb5092460fbefb4567afa27
+SHA512 (NetBSD-6.0/atari/binary/sets/kern-MILAN-PCIIDE.tgz) = cd74cbc52c0357b9af3290dd02362e5561202c14d58bad0d65b96c84361be2e774c9c58b5e38ca9523a7e796d778330cf257f8e2482bf8153e7a43c167e7c392
+RMD160 (NetBSD-6.0/atari/binary/sets/kern-MILAN-PCIIDE.tgz) = 87ac890b25b9bacc28ce600476add0d6fd8aba03
+MD5 (NetBSD-6.0/atari/binary/sets/kern-MILAN-PCIIDE.tgz) = f18391129e4495470783e0a1d8467a81
+SHA1 (NetBSD-6.0/atari/binary/sets/kern-SMALL030.tgz) = fff933858b1ef2c086ce99631195c2e89714b540
+SHA512 (NetBSD-6.0/atari/binary/sets/kern-SMALL030.tgz) = 40458f1b8455fcd8fb3d01dc52815294705ab3752a5952ce93de01c5b7fb553d5aa0aaff4d9124d46e43d318ed6289c336e0a73470d7471fe4989877cae347a7
+RMD160 (NetBSD-6.0/atari/binary/sets/kern-SMALL030.tgz) = 08e49adb3414a2c4490b143865dcf2f0ab3ff337
+MD5 (NetBSD-6.0/atari/binary/sets/kern-SMALL030.tgz) = f0aee544f1a3c894e71ff07e1ab135a7
+SHA1 (NetBSD-6.0/atari/binary/sets/modules.tgz) = 8ea8801011d50b52e637ee0cb1b94fdbf79b9de4
+SHA512 (NetBSD-6.0/atari/binary/sets/modules.tgz) = 6f002bf0695f00d06ce7f43f3087d6c06949b5df8e33baf0b8b30ac18e72700445dcfeb74b51c16fab32e63e537c10bf696bfdb31ab8b08d25c9189075cd3673
+RMD160 (NetBSD-6.0/atari/binary/sets/modules.tgz) = 2bf65897ea1432bac2666df1b221821a5a0642a5
+MD5 (NetBSD-6.0/atari/binary/sets/modules.tgz) = 4dda2688a56fa0774342c63c367c8ec6
+SHA1 (NetBSD-6.0/atari/binary/sets/tests.tgz) = 88a32113d4d6d34b29a94e69c0e4510b51e7e059
+SHA512 (NetBSD-6.0/atari/binary/sets/tests.tgz) = 53fa49988eca04a409dad693f26d5445cdafa9ff69ac918583849d9c6726278b9f0d2fd0da23c05e73d23453970eaadb7b233d951b430c1b7b3ca1b05bab5a24
+RMD160 (NetBSD-6.0/atari/binary/sets/tests.tgz) = ab9f0395fd5d0d1a732000d07e71efe3860f9a32
+MD5 (NetBSD-6.0/atari/binary/sets/tests.tgz) = 213a94d65400a854c2260e98f6150df5
+SHA1 (NetBSD-6.0/atari/binary/sets/text.tgz) = de8e33381d0714b33aab422c2aa5841352941712
+SHA512 (NetBSD-6.0/atari/binary/sets/text.tgz) = bf15a081319d8ce62cc14f465bce3b204bc9a5f57f7ed9d163cf71a9422eeec5ff0e84de7c43d0fc503e9422283e2f99e1e48ee5ccb9224effdc2e3ba70f31db
+RMD160 (NetBSD-6.0/atari/binary/sets/text.tgz) = 387ade3ddcc90bd7b6174deeb24bd8cc6a818e46
+MD5 (NetBSD-6.0/atari/binary/sets/text.tgz) = 937c56219d0ec6a96aef98533e10b569
+SHA1 (NetBSD-6.0/atari/binary/sets/xbase.tgz) = 07c1478cf8a0e4b7ee4b5e49841966fe17f3d797
+SHA512 (NetBSD-6.0/atari/binary/sets/xbase.tgz) = 54d845bc341dc68debf004659d2dcd753604de16e896bceabe6587bfa2934bd5b81b19936c3635cb61dbdee4b4d571603659cd6ae8206ccdaa345f3779e4a83c
+RMD160 (NetBSD-6.0/atari/binary/sets/xbase.tgz) = 6a3aba94b4acef9e311f61c1acc96b33c8707ea8
+MD5 (NetBSD-6.0/atari/binary/sets/xbase.tgz) = e02f145dcfd9f7d1c7be166b28559094
+SHA1 (NetBSD-6.0/atari/binary/sets/xcomp.tgz) = cea8de3b7820897ee8270ae3b591fb602e0028d9
+SHA512 (NetBSD-6.0/atari/binary/sets/xcomp.tgz) = 9e6344200d3ba54e29db576b9f7c0c1d2465cbda8b8a05d015596e2b162c207453cfe0ddc7f9d55bd8463bf2c200c2dd43b4ec34c30635fc0923a0d31c2a8ff8
+RMD160 (NetBSD-6.0/atari/binary/sets/xcomp.tgz) = e64e955294f627c722087a4d1e62a6d646028a37
+MD5 (NetBSD-6.0/atari/binary/sets/xcomp.tgz) = 870efcab1ee55d57351c55ac3c412dda
+SHA1 (NetBSD-6.0/atari/binary/sets/xetc.tgz) = 64dca98d1263e3d78ef7e240c9975e9077356ce0
+SHA512 (NetBSD-6.0/atari/binary/sets/xetc.tgz) = 1e76598c460681b43f2c5b19f2f4af9efeed6ce16aa8bb4d34f99083ee46cf6c5c31c0aeab974a723a3338c3a9ab1a50ad273061f9f02870d9741ec8809ce0cb
+RMD160 (NetBSD-6.0/atari/binary/sets/xetc.tgz) = f147db5da2954155dbc754963d02f309ab41e923
+MD5 (NetBSD-6.0/atari/binary/sets/xetc.tgz) = d23248d3d92350124d8e9e869b28a5f7
+SHA1 (NetBSD-6.0/atari/binary/sets/xfont.tgz) = ad9fb5958debad82e953bc2b1e7e53292d70463b
+SHA512 (NetBSD-6.0/atari/binary/sets/xfont.tgz) = 789529bdf38abda3b00e1db3cffc12272af8ec7f7a52855e0ef5af09ac7cea8639b407265ee6082809127b3bd1b673d686d967c987be6ac12be3825f9531933e
+RMD160 (NetBSD-6.0/atari/binary/sets/xfont.tgz) = f060722e795db40bec2c283ecbb5f7bdbb688ce0
+MD5 (NetBSD-6.0/atari/binary/sets/xfont.tgz) = 1b83f33dd3e43db09d0b55502a7b347a
+SHA1 (NetBSD-6.0/atari/installation/miniroot/prepare.fs.gz) = c4e92cdcb08838b9fa5dc32fb1bd923dd2b97291
+SHA512 (NetBSD-6.0/atari/installation/miniroot/prepare.fs.gz) = 4c25bd0fa0c584b09c2b0a2f9a4a67e942d9a16d9646f1364c71b8bf24326902fae74dce17ee60c81261777ac27e69c2ce4988779ac604a6ac6ebbd4636698d6
+RMD160 (NetBSD-6.0/atari/installation/miniroot/prepare.fs.gz) = 247f6e13edeb6272ceeed462d8729d5e27db000b
+MD5 (NetBSD-6.0/atari/installation/miniroot/prepare.fs.gz) = e99c7d5da695d99c717db4585cac009c
+SHA1 (NetBSD-6.0/atari/installation/miniroot/sysinst.fs.gz) = 353039d699408734197b1a5ecc2490310269e23f
+SHA512 (NetBSD-6.0/atari/installation/miniroot/sysinst.fs.gz) = bd8f6ce4115a98b026fc906c1259ce8ea91d51b97ac44190362a03154ad12c05419d848daf27749a17f0e255b9cb01d2ccae81e75f634825865b95032e5e634f
+RMD160 (NetBSD-6.0/atari/installation/miniroot/sysinst.fs.gz) = 3f866900d10efc89f1f22e8ab6099f26d79cb5f4
+MD5 (NetBSD-6.0/atari/installation/miniroot/sysinst.fs.gz) = 4fabfb561929af7e667fdf39a64e58dd
+SHA1 (NetBSD-6.0/atari/installation/misc/file2swp.ttp) = 9aabfba1673d710445ce4a151e070cd00a364795
+SHA512 (NetBSD-6.0/atari/installation/misc/file2swp.ttp) = d522703bab622aad1f125bf076fa58ea8a309c34425d188df8130298f5af0ccf8d0b0980ddbb90bff86e73cf11d082081f5d0cbe5e8dba68fdc87c9fbdbe2da4
+RMD160 (NetBSD-6.0/atari/installation/misc/file2swp.ttp) = 5bc12b2214b90eefc315f50321b072f3359443eb
+MD5 (NetBSD-6.0/atari/installation/misc/file2swp.ttp) = b2e39863389322ab0834a30a58fbe553
+SHA1 (NetBSD-6.0/atari/installation/misc/aptck.ttp) = 9a1b1b99bd6b50281cb1a1416f854b1d1e0909c4
+SHA512 (NetBSD-6.0/atari/installation/misc/aptck.ttp) = 90fedb40ba1ada8a28b228c0ad34ce9e400b3f9985d69b52345df1e29c7b9b2fd0ceafe1ae91cab0095f3f24ec8bbb274e2f514e351b39eeb8591d3c5ec46d03
+RMD160 (NetBSD-6.0/atari/installation/misc/aptck.ttp) = e399308e499e2e859eba1fc190208537421e407a
+MD5 (NetBSD-6.0/atari/installation/misc/aptck.ttp) = 5061a34d4cd283af586c5f382b546a82
+SHA1 (NetBSD-6.0/atari/installation/misc/chg_pid.ttp) = a989a7318087ebccdb92ea9c84e81a8fcb1d2bd3
+SHA512 (NetBSD-6.0/atari/installation/misc/chg_pid.ttp) = 15dca31b0555023ba6e2b04e6bca504adddcc56177f6224a2757d8784ded4a53fd5cf68b3dd5e794b46bcfba69d199dd430aa9379ed565a7aff4c360855cc4cd
+RMD160 (NetBSD-6.0/atari/installation/misc/chg_pid.ttp) = fef62601213fdafa60099375eaed9ea23163e165
+MD5 (NetBSD-6.0/atari/installation/misc/chg_pid.ttp) = c414114be1b45d1b8abcd41091fb0c6d
+SHA1 (NetBSD-6.0/atari/installation/misc/rawwrite.ttp) = 18c663ff37bf90130bc6eeefd3aabfcd632c654c
+SHA512 (NetBSD-6.0/atari/installation/misc/rawwrite.ttp) = 259903e1e3439b3a3d128a18a597ccb6ccec507bc6b1c449445e7e00c4e0d37e436ba2be0cdb71a7a756c30c2a6406cffd3bef0631b2083a2f0402ab322dbf96
+RMD160 (NetBSD-6.0/atari/installation/misc/rawwrite.ttp) = 3b66c3e7f84325e3be39c15e2a597d2bbd233a79
+MD5 (NetBSD-6.0/atari/installation/misc/rawwrite.ttp) = 20458ba9d4f2fae37607648aeb92bf71
+SHA1 (NetBSD-6.0/atari/installation/misc/gzip.ttp) = 2f3c87cac323a1641622ed960d7ca3df6d8e92ce
+SHA512 (NetBSD-6.0/atari/installation/misc/gzip.ttp) = 37be09560542fd55afebe8f3a07a76d4121a49c5d8771107a6065dbe55c3d8e33ca25326ffdecb38ceaba0e5b6af33f78f92ecf2600169779b5d7282f74335a2
+RMD160 (NetBSD-6.0/atari/installation/misc/gzip.ttp) = 8e9dbdb381f2b7ebaf01597bca73ba920e18427f
+MD5 (NetBSD-6.0/atari/installation/misc/gzip.ttp) = e27e5b3c585ad0a96daaaa810b56f5ef
+SHA1 (NetBSD-6.0/atari/installation/misc/loadbsd.ttp) = c7f08ef85b1b3120061b3b651456cd23f8937c16
+SHA512 (NetBSD-6.0/atari/installation/misc/loadbsd.ttp) = 2b645062a84fe5892c3d424d181dd6ad11f134c4a6728b4ca9a67f1912642daabdfaecdf7af985b4d4907d93adc1b72ed86a5cf9b57de42e9213582ec89a8723
+RMD160 (NetBSD-6.0/atari/installation/misc/loadbsd.ttp) = 802c240f7069d79c0432b28dead7884bc4a06d38
+MD5 (NetBSD-6.0/atari/installation/misc/loadbsd.ttp) = e5e92b220890c5ca942d0c878fd090ca
+SHA1 (NetBSD-6.0/atari/INSTALL.html) = f71f76494a6bf37c8aefe74e698838c1a03b14c0
+SHA512 (NetBSD-6.0/atari/INSTALL.html) = a12b9739f7918dd22bb0434c3d1c41c5031454fd6dbcb53df4eca669b9b4bc918c1f8df379bcac46204664dc521a049b5c39b4151f207a4a22b19b436917fd35
+RMD160 (NetBSD-6.0/atari/INSTALL.html) = f634ad4adfaa1002f352d703118aba204cbe4f60
+MD5 (NetBSD-6.0/atari/INSTALL.html) = 7eac9b0603de1d7d718b994c92b7a229
+SHA1 (NetBSD-6.0/atari/INSTALL.more) = 6ba2460611e6f92531b9ae9d28f4c68d302b9dc5
+SHA512 (NetBSD-6.0/atari/INSTALL.more) = 718766711a583a0539790a3fa7046f845a15f53dd1cd1f0ddadea939158256b3fbf5dced1a88ea592ded2685f0fda81984d6cb137f26f7b543aded6c7c1ca6a8
+RMD160 (NetBSD-6.0/atari/INSTALL.more) = 8bdd7c42fa93913bd14d5ab80457394e289f8c03
+MD5 (NetBSD-6.0/atari/INSTALL.more) = 19adcdce47ce4b9070326b433afe5a3a
+SHA1 (NetBSD-6.0/atari/INSTALL.ps) = 2d9874be06bf612885e3f19fc37635b0c421f52e
+SHA512 (NetBSD-6.0/atari/INSTALL.ps) = 0dd3a09f0a91403f412aa3650847c3512db2ac3d36d0133ac924db74d07b59607c9f57df7fd0df4a3652adbba4842f6b6afa01c07cc4a06c36623ad9c60a9ca3
+RMD160 (NetBSD-6.0/atari/INSTALL.ps) = 83f619a939ef01654f3e3bce7f7ddea0b88828bc
+MD5 (NetBSD-6.0/atari/INSTALL.ps) = 73fd3b04168f78f2de31b91190851ba9
+SHA1 (NetBSD-6.0/atari/INSTALL.txt) = 711ce58ce059429925a6e08ad178569c5e00a00d
+SHA512 (NetBSD-6.0/atari/INSTALL.txt) = b837d76a7e0d754c09fff90845906ec6a1dc5ed77832b91442d5a9ec3608f5e6785782ff1debe3b145f23ba382c5472abec75f49055859bc715caf713941cf41
+RMD160 (NetBSD-6.0/atari/INSTALL.txt) = ecd373463a1cfd5b5399cb3ca0204362ddb22be2
+MD5 (NetBSD-6.0/atari/INSTALL.txt) = f6b564115bd3ae1a28f79dd879fe8ce6
+SHA1 (NetBSD-6.0/bebox/binary/kernel/netbsd-INSTALL.symbols.gz) = bdb282bf1fce2a0c48cf661a68b16fb7663859df
+SHA512 (NetBSD-6.0/bebox/binary/kernel/netbsd-INSTALL.symbols.gz) = c476616f879c94a8135889c4691ca927896c74950c16543039a74e4befd918619845f31e519cb452bd215d8ca4fa1acd697f9867810f4961d517f7803f7e2c33
+RMD160 (NetBSD-6.0/bebox/binary/kernel/netbsd-INSTALL.symbols.gz) = dbb18f3fb59483723599306093a562a45f23392b
+MD5 (NetBSD-6.0/bebox/binary/kernel/netbsd-INSTALL.symbols.gz) = 582ae8bf879f7bc42d24bf114a5d6a5a
+SHA1 (NetBSD-6.0/bebox/binary/kernel/netbsd-GENERIC.gz) = ecfa395d442d86acbc8bbd080c04a8137012138c
+SHA512 (NetBSD-6.0/bebox/binary/kernel/netbsd-GENERIC.gz) = b48b213c4ffd06180d1272a65e27ec0ed539e731e07aea29d31f6c939fef99e1a965c42e2fdd99daad1e8ee543c99a02c420fbcf6531d47e961e7b295150fdb9
+RMD160 (NetBSD-6.0/bebox/binary/kernel/netbsd-GENERIC.gz) = 0b01e797fe821429603d9252035e7425f388046e
+MD5 (NetBSD-6.0/bebox/binary/kernel/netbsd-GENERIC.gz) = 22289b3d7d60df27fd0ed86731ab77bf
+SHA1 (NetBSD-6.0/bebox/binary/kernel/netbsd-INSTALL.gz) = 8721973ccd6399bf563bdb266d9e5316e1ef98ed
+SHA512 (NetBSD-6.0/bebox/binary/kernel/netbsd-INSTALL.gz) = 5390ebe49a1d50d2ba42e529c8fb2c23606e4650cd3225783809ee4dee6013f60cf7dbb347fabf48f3d7ce98ededef37cfc8d5de5c07ad7462dacc668243f429
+RMD160 (NetBSD-6.0/bebox/binary/kernel/netbsd-INSTALL.gz) = 8228a5df5239737e7ba039b84303c4cd491e26f6
+MD5 (NetBSD-6.0/bebox/binary/kernel/netbsd-INSTALL.gz) = 9165b1f4313cc543868d7ab7f6eff5ad
+SHA1 (NetBSD-6.0/bebox/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/bebox/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/bebox/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/bebox/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/bebox/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/bebox/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/bebox/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/bebox/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/bebox/binary/sets/kern-GENERIC.tgz) = d4e8dde09eeb9886e1d84573d136ea92db147201
+SHA512 (NetBSD-6.0/bebox/binary/sets/kern-GENERIC.tgz) = bb375fbcd379a02ccb0f770ae22aeb02f90fda95be2864f085bd46ad58c670e5fda2792b9af8acb5972398a4056ef4ca8d95367f20f57e1258401d1b02d29abd
+RMD160 (NetBSD-6.0/bebox/binary/sets/kern-GENERIC.tgz) = 2726cf7d2e1fa0278bb78a1f1d21e3a6846bec27
+MD5 (NetBSD-6.0/bebox/binary/sets/kern-GENERIC.tgz) = 17e1bdb7465cc8aff08f41a81a37913e
+SHA1 (NetBSD-6.0/bebox/binary/sets/base.tgz) = cb3438d686bc37c67ef3506e7b5f14af708d0f69
+SHA512 (NetBSD-6.0/bebox/binary/sets/base.tgz) = caaf5501269c91599fe8a6315a14bd33776549df0d82d34e516b846df3ace79c1b3a77ef745da87fca1bcc822201765366a373c2d9e29195b4f76bc954f6903e
+RMD160 (NetBSD-6.0/bebox/binary/sets/base.tgz) = 9eaed756de31f7ef1f390895400ff57d90b6936f
+MD5 (NetBSD-6.0/bebox/binary/sets/base.tgz) = 844ca078de04b6965afc9d6840712a87
+SHA1 (NetBSD-6.0/bebox/binary/sets/comp.tgz) = fa35a56729cf7a8957a24482e5855629b63da9ca
+SHA512 (NetBSD-6.0/bebox/binary/sets/comp.tgz) = dae46ff9a1b0ec32444bf93501e5ce5a003556ec6e057c1a85ef63d6f18fab00370fb5c8c6dda14da7222032f26aded43ff2ba4619df58f13d773f3c55a3203a
+RMD160 (NetBSD-6.0/bebox/binary/sets/comp.tgz) = e23f0ffdecc624bd584b1bdafcc1919c0a6b4bee
+MD5 (NetBSD-6.0/bebox/binary/sets/comp.tgz) = e24aedf775e35faa7b0be771def8e964
+SHA1 (NetBSD-6.0/bebox/binary/sets/etc.tgz) = 7955187dd8c102acefc90e649d70bf87334b8c15
+SHA512 (NetBSD-6.0/bebox/binary/sets/etc.tgz) = 3dbc921b6f58296fecb96ac7a0497f4de1f84179128afa3fe2f0a9260399934f659c53346ab55dbf387f19e348e4cf441506b2b92a72f0a2de71d59701289e34
+RMD160 (NetBSD-6.0/bebox/binary/sets/etc.tgz) = 7426566e042dd69397282ea85d9999952d57fde4
+MD5 (NetBSD-6.0/bebox/binary/sets/etc.tgz) = 8980eb4fe0883bbcf7d2001bc9d705a4
+SHA1 (NetBSD-6.0/bebox/binary/sets/games.tgz) = 780b002a35471789a68ee7be17362c60e96fa5fd
+SHA512 (NetBSD-6.0/bebox/binary/sets/games.tgz) = 954365033c924762b524f0f1e4732216b4c661697336b0947943f05a1d1e0ecc12c1679c1c5d7572e1a15a7296bd7b14d31749917ef03a2b097b94bfa0f16837
+RMD160 (NetBSD-6.0/bebox/binary/sets/games.tgz) = 9b237eefee5dc43fb3fffca5a2aa390fb2c3031f
+MD5 (NetBSD-6.0/bebox/binary/sets/games.tgz) = 337e6739c192296cac92b610d0ad6945
+SHA1 (NetBSD-6.0/bebox/binary/sets/modules.tgz) = 14ad320114a249b1ed676832524f773dae772798
+SHA512 (NetBSD-6.0/bebox/binary/sets/modules.tgz) = 1aa3a619fdff5824c904495352248fe990130b9ce9d9a3cd443afd2f088acf7048150de54f1cc304ccf08587fd91f7614521a0b9be96fc7768c06e0a80ed72ac
+RMD160 (NetBSD-6.0/bebox/binary/sets/modules.tgz) = d1df79e00026a19f724c6115055c611c07d592cb
+MD5 (NetBSD-6.0/bebox/binary/sets/modules.tgz) = 8dc1d2dbc89e5e6aa3e04b0033cc4a22
+SHA1 (NetBSD-6.0/bebox/binary/sets/tests.tgz) = 979d26c8e2e5283c416a2e4f4b603acdb43756a0
+SHA512 (NetBSD-6.0/bebox/binary/sets/tests.tgz) = e726187887b9429ce3bd39fb51e7703792f288c47eb9c0f20b85e1a2be4f6448bc3e73919c5d28c28f400ada5b0b024b647079a3670f0a2153aff9b7f5738f13
+RMD160 (NetBSD-6.0/bebox/binary/sets/tests.tgz) = 5cd1c8a42ae7a6ef706de0fcae5292db026efa9c
+MD5 (NetBSD-6.0/bebox/binary/sets/tests.tgz) = 122dc0ea7ebc7ca924301e406ef6e002
+SHA1 (NetBSD-6.0/bebox/binary/sets/text.tgz) = 30f7a17a6d9b03c7ce09bce6341895ac27c2f7b4
+SHA512 (NetBSD-6.0/bebox/binary/sets/text.tgz) = e258a9a741918d6bd8de1e10cff771541b1f1191af776101ff38c722fb037d44d51879d45a5a90342c7e2c21d36cbf5a9a6f5f1a047e61bb18609385381fc3ae
+RMD160 (NetBSD-6.0/bebox/binary/sets/text.tgz) = 6dee36ded12f84c00d7c82912da8755b0d04d497
+MD5 (NetBSD-6.0/bebox/binary/sets/text.tgz) = e1e3ed8f872b4dd51b555e9100ed6173
+SHA1 (NetBSD-6.0/bebox/binary/sets/xbase.tgz) = 03f73933d3719ef967af4a003282e1d56453e3f5
+SHA512 (NetBSD-6.0/bebox/binary/sets/xbase.tgz) = d90e373c143773a93e430058628bc65161e6c25c725fcb279ac0765edcee8e9cab4ff55fa1d99ea66ccb6ca06133145eaaa77f2c26a082c27a53e2e10a19cfdb
+RMD160 (NetBSD-6.0/bebox/binary/sets/xbase.tgz) = 0fe0422c310a56e55e2d5e4b85e8d8a41daaaf4e
+MD5 (NetBSD-6.0/bebox/binary/sets/xbase.tgz) = 7120010c15d5f84927963c780c9197e9
+SHA1 (NetBSD-6.0/bebox/binary/sets/xcomp.tgz) = 1c7522ec79f661a84912a5213ed835d400e108f7
+SHA512 (NetBSD-6.0/bebox/binary/sets/xcomp.tgz) = bfc0d388d18e14cfe99e6bcbda22e4b11e5082b0acf5b314c6f0275823138c35d1a16c3ab3e3fc27e5a04228d6380ef3c2f45dc807715db2c1de689e5674a397
+RMD160 (NetBSD-6.0/bebox/binary/sets/xcomp.tgz) = 23c8e8bb0e2f0708d2bd464468196f4d74359302
+MD5 (NetBSD-6.0/bebox/binary/sets/xcomp.tgz) = b6fb09a621ed2138ed674838c72ec64a
+SHA1 (NetBSD-6.0/bebox/binary/sets/xetc.tgz) = a14b23868bf88e59f5a845bd86cf4af61522f482
+SHA512 (NetBSD-6.0/bebox/binary/sets/xetc.tgz) = a2aee6ee11a89b3fe3b5834502dfd1a50aec7bdcc0f424b3e9d19400370b922258d77a979dae0bd87f8e55df8da9b98f8bf88a73792b1ca6a8915e5cd08777aa
+RMD160 (NetBSD-6.0/bebox/binary/sets/xetc.tgz) = bf37bf09d79777922f344d6b52f69d50c708b64c
+MD5 (NetBSD-6.0/bebox/binary/sets/xetc.tgz) = 837bbc31ba2a81d2610adf225551a61a
+SHA1 (NetBSD-6.0/bebox/binary/sets/xfont.tgz) = e44a6f29bfb3a947ca7d916c7556386a900cb3ee
+SHA512 (NetBSD-6.0/bebox/binary/sets/xfont.tgz) = 9ca97fbe1d40c26938f5a84f09bf273f132b40a82f3ef548295901840155ca45c68ce0d0d980f7fe63bd8acb57be487fcc5f81e61ae4f9765151333a84636a43
+RMD160 (NetBSD-6.0/bebox/binary/sets/xfont.tgz) = e9e153af690a96523a3b7af0a314e1104fa694af
+MD5 (NetBSD-6.0/bebox/binary/sets/xfont.tgz) = 1323ead1d7e9f69f6790c1eb836ec117
+SHA1 (NetBSD-6.0/bebox/binary/sets/xserver.tgz) = 05c93b9d2b3774b6cb71b9d829f5d21860f549ae
+SHA512 (NetBSD-6.0/bebox/binary/sets/xserver.tgz) = 28c97ffdd74c9a2d1d060ce356fd6951d377b61b7fa691c01a150472b082dd027b2be909508ee3370ec59d89bd9c5e12914b3f34feccc6c7904a9ce49869d7d8
+RMD160 (NetBSD-6.0/bebox/binary/sets/xserver.tgz) = 52564d70781876abda7f16a678791c8b3753f53b
+MD5 (NetBSD-6.0/bebox/binary/sets/xserver.tgz) = aeca26a6ae798bcf849e7bd4df423614
+SHA1 (NetBSD-6.0/bebox/installation/floppy/boot_com0.fs) = 1fc015fd100d0518a57e3e7a30e336be1000c098
+SHA512 (NetBSD-6.0/bebox/installation/floppy/boot_com0.fs) = 674ae651d28163eae5f02f78e427d7291e4b977fff90036b1d6870f572e63b1963ef83453ff9da1d49ebb707ff918c0f64889bc0f7d17072690aadd65837e14a
+RMD160 (NetBSD-6.0/bebox/installation/floppy/boot_com0.fs) = 1f59e43c9e6b08ccd63506a5179fdd2a365151b8
+MD5 (NetBSD-6.0/bebox/installation/floppy/boot_com0.fs) = 300dd58c4641cf1fda257074b674937c
+SHA1 (NetBSD-6.0/bebox/installation/floppy/boot.fs) = 8a5770fb10efc7d7c453138ca866b93e2287607a
+SHA512 (NetBSD-6.0/bebox/installation/floppy/boot.fs) = ffbb187efcdeaaf5018827b619abe00ee42aedabab188a443b494c3a5ab94d21fea4761409d9eb23b5a37d5daee602baa838b1d052e1f66b5380a09ed446fb89
+RMD160 (NetBSD-6.0/bebox/installation/floppy/boot.fs) = 58430893606678b17f132c3f3559dd4d30a7246d
+MD5 (NetBSD-6.0/bebox/installation/floppy/boot.fs) = f807ed8a7b25aa9fc9c08637a5188dbf
+SHA1 (NetBSD-6.0/bebox/installation/floppy/boot_vga.fs) = a922c42dd39babfb12443b7d122526f207969577
+SHA512 (NetBSD-6.0/bebox/installation/floppy/boot_vga.fs) = 4f547ce92d72d826253aafab92f9df42b5dba05031ab4d8537fcd40291a703b06eb2e972729c8e703f4e4e0f75d2a0ee2e2f69e8f5d66735f2932089bf1ec7fc
+RMD160 (NetBSD-6.0/bebox/installation/floppy/boot_vga.fs) = c999c7705d258c4b294f0905ba519ec86b7f34f3
+MD5 (NetBSD-6.0/bebox/installation/floppy/boot_vga.fs) = 343aba7dd2584f3945d1fb539a72dc82
+SHA1 (NetBSD-6.0/bebox/installation/floppy/kernel1.fs) = 8af8e65d2919686db6121c68347b8541991e373a
+SHA512 (NetBSD-6.0/bebox/installation/floppy/kernel1.fs) = 91e8df83298ea05c0bec3920d491ff2277d2342a803f84b7393a160ae4a108b84b7d21a0fbf2875d9248287bf047d075e4d33c582a6083ad276e974139635172
+RMD160 (NetBSD-6.0/bebox/installation/floppy/kernel1.fs) = 169667f00c760604c7302d9299448769c8e07b9f
+MD5 (NetBSD-6.0/bebox/installation/floppy/kernel1.fs) = 84f875ee3ca1633777ae9db0acd4e8ae
+SHA1 (NetBSD-6.0/bebox/installation/floppy/kernel2.fs) = 12e804736be0c389da64cd888c3ebfeeec2a1078
+SHA512 (NetBSD-6.0/bebox/installation/floppy/kernel2.fs) = 151b541d723ea1c09bc93cd2cc6abc6a04d0adff1b20c24f53c5b0a8b72462614e64912c6b21dfc9bf4676e2a60a03cab40b44fa23f7dd70183116b4b55f6725
+RMD160 (NetBSD-6.0/bebox/installation/floppy/kernel2.fs) = 159915fd391a03f34782322760d31e1966669b50
+MD5 (NetBSD-6.0/bebox/installation/floppy/kernel2.fs) = 229b4ef55392a3b8c25b6b53691b5fbb
+SHA1 (NetBSD-6.0/bebox/INSTALL.html) = 836f306d6806f97de5e27bce454acd5882b63090
+SHA512 (NetBSD-6.0/bebox/INSTALL.html) = f903a8d35baabfc1ecf5107a6b321930a4b6966d25e8064c6a14d19ddcf67906fbfe5f227487e4120a876dfdad3ebf4664d3f22a14bed7d970bf3f29ffd2c7b2
+RMD160 (NetBSD-6.0/bebox/INSTALL.html) = 4ad2f27fa58d87d0a1b22c6282894af983f4e89a
+MD5 (NetBSD-6.0/bebox/INSTALL.html) = 8015ad9791e90ca1c944d1ecaab10a88
+SHA1 (NetBSD-6.0/bebox/INSTALL.more) = f00ff910b68e2f4f98bfe3b08c6713a5d27c308c
+SHA512 (NetBSD-6.0/bebox/INSTALL.more) = 2ab02d1a9d69c28d6b0248fd75c3395b5bc6fdefd099c1c8f199c083fc87383478818a152842f749bab553a6420df0c1427820c2b893a47cce693a65db91d175
+RMD160 (NetBSD-6.0/bebox/INSTALL.more) = 357216417da8c0e9fa268285ae401c9b289f56a0
+MD5 (NetBSD-6.0/bebox/INSTALL.more) = 55e950718919e06393d4eec6eeb33feb
+SHA1 (NetBSD-6.0/bebox/INSTALL.ps) = 76f8926725f4b4b2c67518ba8a08c7804d8455a1
+SHA512 (NetBSD-6.0/bebox/INSTALL.ps) = b730f63d8d471706dfb44484b7adb22374a51ca8e506f9b848ff7936149bf3f7b1b335b3e061b4c89904f53556bdd9bffba99a9275a5c78299705600adad6eee
+RMD160 (NetBSD-6.0/bebox/INSTALL.ps) = 4edf6341d842d3626be2f6e51b9fb1e8e2e2331b
+MD5 (NetBSD-6.0/bebox/INSTALL.ps) = 09cc4abbf4039ab00e41994c0e274550
+SHA1 (NetBSD-6.0/bebox/INSTALL.txt) = f826c7a4f2f3500f258f40bb89fd5d996527e6a6
+SHA512 (NetBSD-6.0/bebox/INSTALL.txt) = c8cc1e6e07c502ec0d6d807a67de6ffc943d260e2538d512d4322199e49e70fdcf01cb389455ea6d48655c4a246fa31dedf6c18ec58ef58c6f9b17de068b3944
+RMD160 (NetBSD-6.0/bebox/INSTALL.txt) = 17fb9bcbdd888e110926df401169d8ead0aa1dca
+MD5 (NetBSD-6.0/bebox/INSTALL.txt) = f256d74bbee88c7bb349992fd11f975d
+SHA1 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.ABLE.symbols.gz) = 6e64a8b0dec1e052750bd03c3e240e2e4678a0d7
+SHA512 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.ABLE.symbols.gz) = bcbaa47e0c29054669a3fccdade1fd64b75934f33cf34ce59675190fd62074920973675f85dc4a6a4973898df0c41b71bab47cde0bd438db97c56a13e3e5fe14
+RMD160 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.ABLE.symbols.gz) = 18c790be97dc94277543ab409b0c46a186fc8ded
+MD5 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.ABLE.symbols.gz) = fd246c1c2231766dfcd5307328d6791f
+SHA1 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.ABLE.gz) = 837fee4fd025b1b6302e59feb9d0996a5a69069d
+SHA512 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.ABLE.gz) = 8a24960901173b604e26992c2dc3b401eb20787952f6b6c0fa070b10c0d3b5a188241b9353c4ef405c4e9864cf200bf97edf692c45e2eede38b858a890fe7b47
+RMD160 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.ABLE.gz) = 68c9d5f9f4278bbcd6431b34d62a4971e953767a
+MD5 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.ABLE.gz) = 2f4ae7ec3badbee7e9739207599e1edf
+SHA1 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.aout.gz) = 572497febedc95796b46a3bc0aecad740db1da14
+SHA512 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.aout.gz) = 549c46b80cec59bc05d9c06f03fea4cfe1789c0ca51f2a95ab6f37df7b2dd6450f056e8bd60499ae8d96547c36f2ddb3367910d52b397d2ed5188e25424fe174
+RMD160 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.aout.gz) = cbd8947668d7cf78e2074436ef9d0a046a919870
+MD5 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.aout.gz) = 82285aa28d3e972d574d369dc25b5f50
+SHA1 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.gz) = 54e76627b1fd3ee4c32046f4105f5809408f881f
+SHA512 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.gz) = ef934d136eccb13da91a086e43c915a52f8206f8fda3237034f9bc03d73fa0147466efd58e231217be5179a8c1e6bc288c55b0c56bc47adb0f7bd45aa89be64d
+RMD160 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.gz) = 39d74bb0008f44f71e73ae7deabaa0795b331564
+MD5 (NetBSD-6.0/cats/binary/kernel/netbsd-GENERIC.gz) = 11fb2ce363dc7e39ca3a62b11d2aa62f
+SHA1 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.ABLE.gz) = c55e66950e096d68620ed1fc3296f1d557ed45eb
+SHA512 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.ABLE.gz) = 32253268b69d201a700dea2a855e966bf9860321e94b99507960b5e6bf870f18f856e4a7e425a236752e48bbf5875ceae38627d2d49e9a63faf0377f75c002c1
+RMD160 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.ABLE.gz) = 7f7bbdcb761251ba78d769e045a53a73e67c2788
+MD5 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.ABLE.gz) = 93e3ff78c78c67a40de296421d949551
+SHA1 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.aout.symbols.gz) = 56742c573641715c2ad92e38a0f3206e4b6b3629
+SHA512 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.aout.symbols.gz) = 41ec7eef2073b8f6fd9e34fbe9670cdaafd65b1712397db855eb44212b17a96addcd31ae62479fac09ff73cb650fa9859aab905c727305f28a6841c30c7df54c
+RMD160 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.aout.symbols.gz) = c52d4eb8b33f9562c241dc296f9d9c06ee685e58
+MD5 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.aout.symbols.gz) = c51c51101225f4f260e1ec92aa64f689
+SHA1 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.aout.gz) = 58e8d3c14ca2714bbb91003f533ae5f967f524b4
+SHA512 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.aout.gz) = e2c5f771f02b6d7896841bf5a25efc16b34830ff375e9be1f3911225313c664b7f3a0ac023e5928c2d5fb7ab584f9bde029480b84ce67bd67ee862673cf45705
+RMD160 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.aout.gz) = 4282d861ac62fa542e4496cbfaca087476d60597
+MD5 (NetBSD-6.0/cats/binary/kernel/netbsd-INSTALL.aout.gz) = e64438671861843fdc0fd4c9f324f04a
+SHA1 (NetBSD-6.0/cats/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/cats/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/cats/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/cats/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/cats/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/cats/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/cats/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/cats/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/cats/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/cats/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/cats/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/cats/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/cats/binary/sets/kern-GENERIC.tgz) = 5ca14afa2e8a62cb54d2ae62e3516ffc10b4568b
+SHA512 (NetBSD-6.0/cats/binary/sets/kern-GENERIC.tgz) = e0189ff9d057ac445ef5ea45155f0a7045b876f7ddbd912b45fb3ee7f2c8bf83a46d167d9a916214d6cc1de9b825dcf91f35384bd3690f885acb44be5356c625
+RMD160 (NetBSD-6.0/cats/binary/sets/kern-GENERIC.tgz) = 5324b2a4cfd27b7aeee8c2bc2cbb6041669e0bff
+MD5 (NetBSD-6.0/cats/binary/sets/kern-GENERIC.tgz) = 6825664fe2f18e25fe7cb307b8f2923f
+SHA1 (NetBSD-6.0/cats/binary/sets/base.tgz) = c458481bd58c1d1dca0329bc28de71409c1e4aba
+SHA512 (NetBSD-6.0/cats/binary/sets/base.tgz) = 52550865b944057be1c4de1f30cb1ef8bf1b126258a0ef2ff7d2108b562b211149cc05b8397fb7c6142a5276e2636192c54cffbf8d424d528c0bce462f155d49
+RMD160 (NetBSD-6.0/cats/binary/sets/base.tgz) = 7977e28aedfcc3e97ad9e748c6d3c7abd4aa831c
+MD5 (NetBSD-6.0/cats/binary/sets/base.tgz) = 2a41824b43d9f6cfee26ea6fe3a04368
+SHA1 (NetBSD-6.0/cats/binary/sets/comp.tgz) = b725c4d09fc5f7ee54c5d800e4c2e12b3af6f669
+SHA512 (NetBSD-6.0/cats/binary/sets/comp.tgz) = e36e73f377ca33d2a76ca25973464ee54c70bafc05fea574fa2edc2060ad93be714a9ee6cb7173b52a75a77b47b49e50dd5b7803fd84afbd6be19b858147d551
+RMD160 (NetBSD-6.0/cats/binary/sets/comp.tgz) = fcc12fec265d939130a40cd2b2d73bc5a97ab1fa
+MD5 (NetBSD-6.0/cats/binary/sets/comp.tgz) = 33321cea969922b1a6ec122d03546470
+SHA1 (NetBSD-6.0/cats/binary/sets/etc.tgz) = 89dc5b13c09b5325742e8e4ca8a22857b29a2bcf
+SHA512 (NetBSD-6.0/cats/binary/sets/etc.tgz) = f18e1f34fd7b909422e431fa16738b047afa451ea9e7e77bbbcf4fc465835ad4b3b5b145efd2a609130d057e5adab868e544806ad7584947dfb82440e976c6f0
+RMD160 (NetBSD-6.0/cats/binary/sets/etc.tgz) = 81e6058380507732dcc4157e10c849d896fc51aa
+MD5 (NetBSD-6.0/cats/binary/sets/etc.tgz) = da8349c012e9f029cef0f909cc466973
+SHA1 (NetBSD-6.0/cats/binary/sets/kern-GENERIC.ABLE.tgz) = c9adc81c86dda4d994d79fd37b7622475310fda5
+SHA512 (NetBSD-6.0/cats/binary/sets/kern-GENERIC.ABLE.tgz) = 5a2c270a700ae0f433afba336f4270c1a9f0646ddc0839318638946f38f23b150775d9f6e2cb91d08ce327f4c2057377e5c27e525277f5c001d1c03fad852ce8
+RMD160 (NetBSD-6.0/cats/binary/sets/kern-GENERIC.ABLE.tgz) = 7c83c750bff69191dc40b6bf34d801cc082f4970
+MD5 (NetBSD-6.0/cats/binary/sets/kern-GENERIC.ABLE.tgz) = 18c1f0b06270fb64a47ffdb95edb7f0e
+SHA1 (NetBSD-6.0/cats/binary/sets/modules.tgz) = fd876e3d182e55ff19b6121b07b8e69fa1d0df29
+SHA512 (NetBSD-6.0/cats/binary/sets/modules.tgz) = a9a55cb34e467094be7e72a443b8a449078efaab3adc8a9b1496e45ea6c9fc7d5b3cc7523b30fade9263cb2f90fe9e18825bc6d5acd415a3fbea1c444ec0ed5d
+RMD160 (NetBSD-6.0/cats/binary/sets/modules.tgz) = 8c6829a3b9d46c091203f11ae7809fe1087e8fbc
+MD5 (NetBSD-6.0/cats/binary/sets/modules.tgz) = fec5cad3f45abd455761405b2b352a1a
+SHA1 (NetBSD-6.0/cats/binary/sets/tests.tgz) = bdfb9591316f5c17b8acfff63b0ab895cb9fe3e8
+SHA512 (NetBSD-6.0/cats/binary/sets/tests.tgz) = aaf8d4b6e428dbd0a162cf09d5bbb3273450b4ddacd6cdcb9ba2175cde5276fc30173466a1e394ca2fadb3e92ee7637d9e8fdfdc7f6e59436b9178efc1806b4c
+RMD160 (NetBSD-6.0/cats/binary/sets/tests.tgz) = cf4cb18da6b8c46c0648d6c33556dca95035b024
+MD5 (NetBSD-6.0/cats/binary/sets/tests.tgz) = 5f83acde92619b5eb23f3b21c3bdfbed
+SHA1 (NetBSD-6.0/cats/binary/sets/text.tgz) = 4434e6febe84969a66d92fdfa147aec4a6f18549
+SHA512 (NetBSD-6.0/cats/binary/sets/text.tgz) = 41206832dff7217dc0f61fa8ed39c7b824bd7f781318317520aaf3b190cf5d8588b5c06a8252fa8318ded7df84a104b9718dbbc4e6d2e3c62c822d79b9be4d3f
+RMD160 (NetBSD-6.0/cats/binary/sets/text.tgz) = d7a3c7498b28f79cb6044f4483f6b4970c2d265d
+MD5 (NetBSD-6.0/cats/binary/sets/text.tgz) = dbd9391020e7272a288c0c30002cad8a
+SHA1 (NetBSD-6.0/cats/binary/sets/xbase.tgz) = ae3b8c01b219ca930ad23427b88601c98fce9ae9
+SHA512 (NetBSD-6.0/cats/binary/sets/xbase.tgz) = a06f8a61a8c61df4aa2f9e0efdaede96e56765552d642ab3f048afeeada1716fbb5a0a5b3f2d511e7a146fa7d173ad0b59d5707a7c9b29216c014ec3911d3d37
+RMD160 (NetBSD-6.0/cats/binary/sets/xbase.tgz) = 032ae59bb4c894f973b3fba09b9c72762f4be5f2
+MD5 (NetBSD-6.0/cats/binary/sets/xbase.tgz) = d021cc89a93acc430e5cad14758b1ef3
+SHA1 (NetBSD-6.0/cats/binary/sets/xcomp.tgz) = 2daa1f374f82e66d62900af2252f72a06f366ebc
+SHA512 (NetBSD-6.0/cats/binary/sets/xcomp.tgz) = 803d5501dfcda968a4f098378989cc8186bda8f9dc28af6b9bc591301edfd0dd194922a0d661c75f3ced1fcdbb700e61eeb7bbf5b95ee6ec1111cb8bb9eec933
+RMD160 (NetBSD-6.0/cats/binary/sets/xcomp.tgz) = 4bf6721bd75641fef50dce9cc5781b6991acd0fa
+MD5 (NetBSD-6.0/cats/binary/sets/xcomp.tgz) = c78fd7987bf26697dcb6447c6818c8f5
+SHA1 (NetBSD-6.0/cats/binary/sets/xetc.tgz) = 081116c5590415004358c063c13f77a32c0fa5ba
+SHA512 (NetBSD-6.0/cats/binary/sets/xetc.tgz) = 129cc55a79bee0d1d821c137fa27ae1fdaa82d71cecbbecd555e7d8ab649dfccbb1c2086575e97ff66bd40a50a34ab5b45233ceb15bc9770044bc776c646d86b
+RMD160 (NetBSD-6.0/cats/binary/sets/xetc.tgz) = eb721c7066e0088a6be10b2214fa7227d2b95043
+MD5 (NetBSD-6.0/cats/binary/sets/xetc.tgz) = 7904920faa3acddfb9b635b88789a440
+SHA1 (NetBSD-6.0/cats/binary/sets/xfont.tgz) = f6547d11ac8302fda8b2b992e99f5d8c03ef9f0b
+SHA512 (NetBSD-6.0/cats/binary/sets/xfont.tgz) = c38be1439bd2a0b9a10978e1833a5ad243f3d3ed557bb05033aa6c76d1320851663e8819987b4a77c8f4f123820d82cfa950e8e486986686030aa9a40b7577ae
+RMD160 (NetBSD-6.0/cats/binary/sets/xfont.tgz) = 401d3e9883c381410c7e45ee3cb1ab72e9fd54a7
+MD5 (NetBSD-6.0/cats/binary/sets/xfont.tgz) = d154b32a82c67ebba30762daad5a37e9
+SHA1 (NetBSD-6.0/cats/binary/sets/xserver.tgz) = 941b1622f43738a9a31860ad6464f2fff35e9f1b
+SHA512 (NetBSD-6.0/cats/binary/sets/xserver.tgz) = dbbd41022a86bfd59958a96f821256bec29793952b4adfff10e3974d437e1317b8312662359a27a961d76f4c0ac7e7af9482603d6ab918668174818f9b1c1008
+RMD160 (NetBSD-6.0/cats/binary/sets/xserver.tgz) = 4fb11053b3a0ad7775efdb502bbf8e1198dc0348
+MD5 (NetBSD-6.0/cats/binary/sets/xserver.tgz) = 20c811752f066b472b1f578431f25d42
+SHA1 (NetBSD-6.0/cats/INSTALL.html) = cbe385200e2572a8325f1559ff0b00914b6892f8
+SHA512 (NetBSD-6.0/cats/INSTALL.html) = a62d6cbd6f300d4287f899e76526282ac04a538aedd201754876f8ea906eb3c486e8580b7d373eb6436ffb6c6b0d47273a3999ebfb852b1cecd7d9714931b7af
+RMD160 (NetBSD-6.0/cats/INSTALL.html) = 8fd593263624ff1e7a45b7102956094a71f16576
+MD5 (NetBSD-6.0/cats/INSTALL.html) = 50947ae742e64480da9f0f3964789ee0
+SHA1 (NetBSD-6.0/cats/INSTALL.more) = 8343db2afce040778ea31ae38be9700674dc5f02
+SHA512 (NetBSD-6.0/cats/INSTALL.more) = d40356dbe2c728dc51d6cd0efe3857a27ec9b39e2a03a01efe67733debda54b58e768218eba79dd20f97614e4a8c1138362c65acdef1aec922e157bb638f2a18
+RMD160 (NetBSD-6.0/cats/INSTALL.more) = 76588eb4c081058584fc7bd3d350f896177bec31
+MD5 (NetBSD-6.0/cats/INSTALL.more) = a912e620c4899d40ffaf15a00b033920
+SHA1 (NetBSD-6.0/cats/INSTALL.ps) = 06fff86ec204f92418e0050417a548da63a2ddad
+SHA512 (NetBSD-6.0/cats/INSTALL.ps) = 31a7ca304e80c80942d5c3b1f055251194981e7e98096fbca7c1d56f6617e5aae082a44702fcbda9cec006823d093973bdf24f1af369c532d72706b5c44243f2
+RMD160 (NetBSD-6.0/cats/INSTALL.ps) = 80c4749fc0e3d9144cae101e3e83709b509eb541
+MD5 (NetBSD-6.0/cats/INSTALL.ps) = aa6a7a310a23fcf771ab49fcec71a77d
+SHA1 (NetBSD-6.0/cats/INSTALL.txt) = 59e12295d3e1819f7ff76701baeb4541e637ef88
+SHA512 (NetBSD-6.0/cats/INSTALL.txt) = a710c598d300605c2d2f373f12f8b9b2366dd28f6cf84ccedc3c6ac3efa410e2c0a3e454489824c4a65467b0947231a6f280a4ea2cb3582bdd3d532ed994e63e
+RMD160 (NetBSD-6.0/cats/INSTALL.txt) = 5f0042bf269b86bb159915585707077a98a5f06d
+MD5 (NetBSD-6.0/cats/INSTALL.txt) = 8cb2eb0a3f5249382607fb963ca82313
+SHA1 (NetBSD-6.0/cesfic/binary/kernel/netbsd-GENERIC.gz) = 5d2bcce895dd7d88e0d5600b6ca55a4b216bd368
+SHA512 (NetBSD-6.0/cesfic/binary/kernel/netbsd-GENERIC.gz) = 85e01da3fe9ebb93fb7ae3f028297972bf4538117430185bf0885b46352f68df08fe025d91569ee0da2e17e8b83a4de99e1f3d56d2c5cb31ede3beb366afa157
+RMD160 (NetBSD-6.0/cesfic/binary/kernel/netbsd-GENERIC.gz) = 7c946881e8b671248896e5e620f8125426911450
+MD5 (NetBSD-6.0/cesfic/binary/kernel/netbsd-GENERIC.gz) = 39a8c5037a6266d0bb6df8fdb5c14c7d
+SHA1 (NetBSD-6.0/cesfic/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/cesfic/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/cesfic/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/cesfic/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/cesfic/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/cesfic/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/cesfic/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/cesfic/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/cesfic/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/cesfic/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/cesfic/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/cesfic/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/cesfic/binary/sets/xserver.tgz) = 1d20fd039546a66b428b854c659ea5e2ee9f8114
+SHA512 (NetBSD-6.0/cesfic/binary/sets/xserver.tgz) = 091d09049d0af5555feec02065234e281677aeb3ecbab5a19413d924a8b58dc7f64401ef68e68bc52d8b6eeb73e091d351c45805374b8bf276b0181415968561
+RMD160 (NetBSD-6.0/cesfic/binary/sets/xserver.tgz) = feef5d52278d23637d7b8ba77639bfd96918e90e
+MD5 (NetBSD-6.0/cesfic/binary/sets/xserver.tgz) = b2bd6057c374376388766fc8667eb9a9
+SHA1 (NetBSD-6.0/cesfic/binary/sets/kern-GENERIC.tgz) = 682508a28054a48a7242a494917ac4889bc67992
+SHA512 (NetBSD-6.0/cesfic/binary/sets/kern-GENERIC.tgz) = 0225b3aa055ad8d4c5b3029cea2459cc27e5670cd4aa50529c3490f93692273fabf6fb1d47336ca82e7b9b97c9cd6eaa6da29f1c71076c36664952cd2e8f92cb
+RMD160 (NetBSD-6.0/cesfic/binary/sets/kern-GENERIC.tgz) = 39e19612b53e389e4da7ab24ad463d19da13f296
+MD5 (NetBSD-6.0/cesfic/binary/sets/kern-GENERIC.tgz) = ae69c0b436f251484d22512f3207263f
+SHA1 (NetBSD-6.0/cesfic/binary/sets/base.tgz) = df22763e9478973636b3651d21f5cc5c5b065515
+SHA512 (NetBSD-6.0/cesfic/binary/sets/base.tgz) = bfdab8e7b9dcbd14d7e6321edbfbf06c45eafc0c85dcace6879ff485d45262706dd29a165c9d89a041618244977763af4c0f0c93d48ac39c96c5a4446122d2b9
+RMD160 (NetBSD-6.0/cesfic/binary/sets/base.tgz) = 1359d35509d93695dd0cfda9adead93875618ddd
+MD5 (NetBSD-6.0/cesfic/binary/sets/base.tgz) = 232f3d5ccd51c66577dc50e25c149476
+SHA1 (NetBSD-6.0/cesfic/binary/sets/comp.tgz) = dbd27c5388fd2ccfa90ceaf819f5fb3b86bac78e
+SHA512 (NetBSD-6.0/cesfic/binary/sets/comp.tgz) = 0657745dfedf6283919628d26665d30374807c78e049cdf5d9ce3d3dca54275ccaa992b5c21ef5c850decd1def118cb14c1e89a2bbdbe55b905e0f8100e259ef
+RMD160 (NetBSD-6.0/cesfic/binary/sets/comp.tgz) = b0bdc0fd2ca77bdadb6d03a465333bd9dca2a016
+MD5 (NetBSD-6.0/cesfic/binary/sets/comp.tgz) = 8ff8a532ccd1d24e93b4ca53a41d1efa
+SHA1 (NetBSD-6.0/cesfic/binary/sets/etc.tgz) = 20b9dc0339ed74a93dc82fc1b60f9b3fbf6b4b8d
+SHA512 (NetBSD-6.0/cesfic/binary/sets/etc.tgz) = 593ef36e7f37c6153b8068a2f8b433a6bbe821a2bfcad7ea6ce4e30bf5611172aa94e82b7aca57c141d84381c597306779e5023cab4ff28fa415b6b6bac69e3d
+RMD160 (NetBSD-6.0/cesfic/binary/sets/etc.tgz) = cd6bcc3d96f38f8e9a00cfedbeb4463a27708d9d
+MD5 (NetBSD-6.0/cesfic/binary/sets/etc.tgz) = 343a0c8c930807f71f37e7116bf8f391
+SHA1 (NetBSD-6.0/cesfic/binary/sets/modules.tgz) = d5191e8899d7345c88bae6f65c1fd249b02a0063
+SHA512 (NetBSD-6.0/cesfic/binary/sets/modules.tgz) = 22e74e63cdc763effdcb58c7d549c0811dedee37953a9669dca09010dde364c6ba7440a29ad1e1e634a7c44b69cbca65afe006b9f564bd10bc4f0852cb55dc75
+RMD160 (NetBSD-6.0/cesfic/binary/sets/modules.tgz) = 5ad1d1c039de7da6dd1183ea6f4e9c319931dc86
+MD5 (NetBSD-6.0/cesfic/binary/sets/modules.tgz) = c0dda9a6803a213f3bca675728056dfd
+SHA1 (NetBSD-6.0/cesfic/binary/sets/tests.tgz) = fdf867451cd371c25672448a1dbc7c204e8534b7
+SHA512 (NetBSD-6.0/cesfic/binary/sets/tests.tgz) = 9f137af1458c138a40dd2cf293e58deaa93a7145457127ddddabad1c23f380e36950d21cc6051bc5a4b101a632b9610a74cc3fc4bf6129e29e57ee8fd9d2da6b
+RMD160 (NetBSD-6.0/cesfic/binary/sets/tests.tgz) = 0c27b80fb02f5ca0dfea6854d0df2818df52b9e1
+MD5 (NetBSD-6.0/cesfic/binary/sets/tests.tgz) = 2cb77946d9b305a0e03a6ac5fed04ff7
+SHA1 (NetBSD-6.0/cesfic/binary/sets/text.tgz) = d9f8aaf67b6ffd9828d447b5a6b208ea5bffcbd3
+SHA512 (NetBSD-6.0/cesfic/binary/sets/text.tgz) = 931dc3aec206ff95df08c36ed09a01caa2b10bdff34affc723e7ea0c6d2cdfc493d02b9875568ec9276c2d35a74cc782ec8c8cee10ad62879831b1d728cd3d62
+RMD160 (NetBSD-6.0/cesfic/binary/sets/text.tgz) = cec72f88379d8c6b30730568eb653de4a07f8c8d
+MD5 (NetBSD-6.0/cesfic/binary/sets/text.tgz) = 1daceefaf9afa99dfb01cde29485cfe2
+SHA1 (NetBSD-6.0/cesfic/binary/sets/xbase.tgz) = d052985aaeadbeaad2aab5aab60ef68f5527a9eb
+SHA512 (NetBSD-6.0/cesfic/binary/sets/xbase.tgz) = 83089a0b043d1413d865ea766cf1c50da9d1c12165e05bfc72f26b4d4513549119cc716ffebda1fd82b20ff1766c579aa000b7c10b4f29fcca49f0ff9f05177b
+RMD160 (NetBSD-6.0/cesfic/binary/sets/xbase.tgz) = 3a8239f2ecb4e13e2352e3b09c3496f51dd12fb4
+MD5 (NetBSD-6.0/cesfic/binary/sets/xbase.tgz) = 61c565148bfbdd631981e7d42845c147
+SHA1 (NetBSD-6.0/cesfic/binary/sets/xcomp.tgz) = f3eda836d68a0b648fec7072373ae0b7267ab7d4
+SHA512 (NetBSD-6.0/cesfic/binary/sets/xcomp.tgz) = c448fa8a9665c6cd19aa05eae8456a06e0301fed427eff4d20f4a337e398c4346b285bea3c46924eada81d2bd1c34bcfa91cfd36d15eeb8ca6e9f7606514f131
+RMD160 (NetBSD-6.0/cesfic/binary/sets/xcomp.tgz) = 68333053bfff6afe3fa5e7555e58039ca42b679e
+MD5 (NetBSD-6.0/cesfic/binary/sets/xcomp.tgz) = c318f3138aabcb6453f77a6dfa4778c7
+SHA1 (NetBSD-6.0/cesfic/binary/sets/xetc.tgz) = 5965357819e9e3e64a9cf0963595a5870699cd82
+SHA512 (NetBSD-6.0/cesfic/binary/sets/xetc.tgz) = da1f214b6de2a4a1ef227c608b741a076a7d4ba491131fadd33ebbf0782fd6c0d1ade406b4aa92c973c9f87ee70b2dff20d3a710df08201aac3c1a9ad339fe31
+RMD160 (NetBSD-6.0/cesfic/binary/sets/xetc.tgz) = 7151d3746cae1d748a566356431ca8ba4a5b51f3
+MD5 (NetBSD-6.0/cesfic/binary/sets/xetc.tgz) = 616f7da77033039c3b6972c33223215f
+SHA1 (NetBSD-6.0/cesfic/binary/sets/xfont.tgz) = 46a06412b08381288aeb30ddc5b5a30d09530fcf
+SHA512 (NetBSD-6.0/cesfic/binary/sets/xfont.tgz) = b5c5c517924de3ae3bc0fd094c0be19501668f4ad25feae8768c5c17065ff90b9b60760afa47ee93909fb92c4c12a818a95f0744e988a04e20be51f0d5dd4d66
+RMD160 (NetBSD-6.0/cesfic/binary/sets/xfont.tgz) = b58231d11d9ea95811dd0a6f548b6bdb18eae61e
+MD5 (NetBSD-6.0/cesfic/binary/sets/xfont.tgz) = e52bf6c25b8e5fcef899329b68856e5e
+SHA1 (NetBSD-6.0/cobalt/binary/kernel/netbsd-GENERIC.gz) = c9618dcb53044599e6397eac6bfd5dbd6f106cf0
+SHA512 (NetBSD-6.0/cobalt/binary/kernel/netbsd-GENERIC.gz) = f46c57b34ffc0f0140094384a10ea7c3d0140f315fceed6b02a1ec4770d6114eb1e995020fd056e03af71185f0448fde86829f5921b961a903bf0c275ff730e3
+RMD160 (NetBSD-6.0/cobalt/binary/kernel/netbsd-GENERIC.gz) = 4f69bb230b7c20fc591af0ff0e788e0f9a6dfff7
+MD5 (NetBSD-6.0/cobalt/binary/kernel/netbsd-GENERIC.gz) = 4ef49f4e446b38c2dcecf61dbca8fa25
+SHA1 (NetBSD-6.0/cobalt/binary/kernel/netbsd-INSTALL.gz) = 8c6edfcb94e9c0bfe670a78e6599dbba4787ef6b
+SHA512 (NetBSD-6.0/cobalt/binary/kernel/netbsd-INSTALL.gz) = aa2dd1067f3fe253b43eb3a1ec0c8119a717c43236f1df4d72a4ac5667de310ac904bbca89588b9438a3aacdee5bb3d569e170dab17487ec5c6d9c148086085f
+RMD160 (NetBSD-6.0/cobalt/binary/kernel/netbsd-INSTALL.gz) = 54a79af6fbce4c15b3415137f67a35e0d5e34daa
+MD5 (NetBSD-6.0/cobalt/binary/kernel/netbsd-INSTALL.gz) = 112e15f9d41a31dbe6eb6864d62633ef
+SHA1 (NetBSD-6.0/cobalt/binary/kernel/netbsd-RAMDISK.gz) = 4075b370e08ffe708669556c584e79073a9280b0
+SHA512 (NetBSD-6.0/cobalt/binary/kernel/netbsd-RAMDISK.gz) = ae5eb10935acf635e7a3abf985b86fbe9a57a071dea8ef7fe08ff5fd887901331d603e61d1bfeba330489534c4accae61e8c63fcc0cbb4a248e8fffa53d59fec
+RMD160 (NetBSD-6.0/cobalt/binary/kernel/netbsd-RAMDISK.gz) = 9537810097f1bfe7c0cb7a4154639c8374a17c63
+MD5 (NetBSD-6.0/cobalt/binary/kernel/netbsd-RAMDISK.gz) = 0a477e1b678ab3c2906eef7d9082d2a5
+SHA1 (NetBSD-6.0/cobalt/binary/sets/games.tgz) = 27d9f98fecb3495e51939df9f107e81e527af26f
+SHA512 (NetBSD-6.0/cobalt/binary/sets/games.tgz) = 46bb4e10313cfffaaf4f7fa2157474ef940f94bcc9f84b46f829c7615bbf45e4e01edee7b7efb84bc28561e0712c37cfc737f9c2a0d9a73b67c80c8aa0f3a9af
+RMD160 (NetBSD-6.0/cobalt/binary/sets/games.tgz) = 947feea90ec2698a65d555cb78a29a001b086589
+MD5 (NetBSD-6.0/cobalt/binary/sets/games.tgz) = 355f00978fed8e8da6a251e591be5387
+SHA1 (NetBSD-6.0/cobalt/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/cobalt/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/cobalt/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/cobalt/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/cobalt/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/cobalt/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/cobalt/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/cobalt/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/cobalt/binary/sets/xbase.tgz) = 76468fcada5a9e26652aa9f0f9f3c94829a317e9
+SHA512 (NetBSD-6.0/cobalt/binary/sets/xbase.tgz) = b2adcfc2dedef30b21b885c8fc757d0479541744a280a9997fbeaa9c881009ab4b0019e0001a540a8eb6db5f84db87b365e420bb2d4270af209821bdb080369c
+RMD160 (NetBSD-6.0/cobalt/binary/sets/xbase.tgz) = 1e0074d03d9fbb3373e0a427b25cc7097bf6d3c8
+MD5 (NetBSD-6.0/cobalt/binary/sets/xbase.tgz) = a8f29ec2e3768405942f97af3dd08ee7
+SHA1 (NetBSD-6.0/cobalt/binary/sets/xcomp.tgz) = d8ac89f3f6ff20abb0adabc49227afdb74aa2040
+SHA512 (NetBSD-6.0/cobalt/binary/sets/xcomp.tgz) = 4f03213fb061dae9421747209628d06ede6bbb71a7560a9e1a54796b907f1620146a33fdce52974227a21acedcc210b99e15c4fdd36432eba60c1041a92d8cee
+RMD160 (NetBSD-6.0/cobalt/binary/sets/xcomp.tgz) = 6be5e72b9b57c9bdf8ed8ea127e2a73830feeecb
+MD5 (NetBSD-6.0/cobalt/binary/sets/xcomp.tgz) = 59a7ea141587417be38ab1f6056cc780
+SHA1 (NetBSD-6.0/cobalt/binary/sets/xetc.tgz) = b9f6b1a54ffab37b11f4c6e717b481cd087fb609
+SHA512 (NetBSD-6.0/cobalt/binary/sets/xetc.tgz) = 72f35e65f3a90967e250a2006d500619b3824f7f5c3d7494554f153ec5cda5b28c445f28c34a1e4463f40da5855e8d4257726411796967fe37763d90cf7fe461
+RMD160 (NetBSD-6.0/cobalt/binary/sets/xetc.tgz) = 1169c246f91189fd0c4ae86ac27a92f5c2edda3e
+MD5 (NetBSD-6.0/cobalt/binary/sets/xetc.tgz) = 8f3c52cc5af1cafaf7b0d0f884a5b537
+SHA1 (NetBSD-6.0/cobalt/binary/sets/xfont.tgz) = d06848571034f3b7fc975082f1de37b912acb18c
+SHA512 (NetBSD-6.0/cobalt/binary/sets/xfont.tgz) = 66a1013c935bee5e7e5d24325a527522306bcded7ced63790f2e58831b3ed91176a1b9510b2159be63504d5167d48d534919927ffc6e225ae2bb2487f90a9ede
+RMD160 (NetBSD-6.0/cobalt/binary/sets/xfont.tgz) = c9502843a5d4dd7e996e8d158c519cf7f8575cbd
+MD5 (NetBSD-6.0/cobalt/binary/sets/xfont.tgz) = e812899176eac2bf65a6d949ac3f3424
+SHA1 (NetBSD-6.0/cobalt/binary/sets/xserver.tgz) = ff805022f409202f3346c45475c7ec0f8187218e
+SHA512 (NetBSD-6.0/cobalt/binary/sets/xserver.tgz) = f2bb3810a5572b519980126a3d934f63b5ab5c2fcf9fb8166c556bd3cc14cfaa151d582086bb1506ac9ac7e21d4e70a5cd5c3faed96212d8a14a0b5bafdcc4c1
+RMD160 (NetBSD-6.0/cobalt/binary/sets/xserver.tgz) = d5ae336337cc77f7f55f542b3457918d6fc0efe8
+MD5 (NetBSD-6.0/cobalt/binary/sets/xserver.tgz) = 92447a1560887d337d22e2deed0670a6
+SHA1 (NetBSD-6.0/cobalt/binary/sets/kern-GENERIC.tgz) = d085ff7c5cd7f260cc1aaca4c2e54c26c948d893
+SHA512 (NetBSD-6.0/cobalt/binary/sets/kern-GENERIC.tgz) = 0c1ad1014af64d059a5ce8261e46534e0eaed8702440b93f5109c19ed9fb0b2dbf37a23cc28f1a688ca45f9e721dd0f4a1ee6771990a835a459cd633ff0f4887
+RMD160 (NetBSD-6.0/cobalt/binary/sets/kern-GENERIC.tgz) = cfecc943b0e501f53558c87be282a948469c57fe
+MD5 (NetBSD-6.0/cobalt/binary/sets/kern-GENERIC.tgz) = 630b91f62d422855f30b33590119e9d7
+SHA1 (NetBSD-6.0/cobalt/binary/sets/base.tgz) = 90870f3189063cb2c4a2aa81d1c68d835e48ee25
+SHA512 (NetBSD-6.0/cobalt/binary/sets/base.tgz) = 9a962443ad380ef6d4dce623bb41e6b1aecd452b0adfc6e51d1c17610829f17a1b02cf5be2e539eeafcc7ff47ae79f8f7a367eebd74ea6cb70e0fc57eebbf27b
+RMD160 (NetBSD-6.0/cobalt/binary/sets/base.tgz) = 12111c0c67c4f8fbb3c54c2c3480e73caee6f33c
+MD5 (NetBSD-6.0/cobalt/binary/sets/base.tgz) = d7aba51f2552fb2e19af9adbd673dff9
+SHA1 (NetBSD-6.0/cobalt/binary/sets/comp.tgz) = f22b026d0b9c1e7725e4db4b9abbda1160a9c80a
+SHA512 (NetBSD-6.0/cobalt/binary/sets/comp.tgz) = a0a6f6185d30e28c4db98189134bcb5e2dc9820c748911e36483b84fb598c5b122c10863ccff82a2f2556734004fab2c9ac59cbc1530ec79ec535e4e426d4e5c
+RMD160 (NetBSD-6.0/cobalt/binary/sets/comp.tgz) = ed9d28519a8cc55a2806d6c1df0953c535075b1d
+MD5 (NetBSD-6.0/cobalt/binary/sets/comp.tgz) = 44112b73f63f4cddda4ac8ab8f5ba1f5
+SHA1 (NetBSD-6.0/cobalt/binary/sets/etc.tgz) = 7109941b0df321286aaf226ee48222fbc7ad692f
+SHA512 (NetBSD-6.0/cobalt/binary/sets/etc.tgz) = 1d18f21beb41dd07c5744b127209b5de8f5fd2fbbd109c3c65dbe73126e2a987e1e1d08a68668f597ecce1d0e9875fe349bf89d74d3add850a3c4554808cda07
+RMD160 (NetBSD-6.0/cobalt/binary/sets/etc.tgz) = 1687c63ca2d75377354754bb425c02bd6907c445
+MD5 (NetBSD-6.0/cobalt/binary/sets/etc.tgz) = 3b36b16b387597ceb2233eaa72d3bea6
+SHA1 (NetBSD-6.0/cobalt/binary/sets/kern-INSTALL.tgz) = cfefd1fef2db13b66730678c9df067ab208158ad
+SHA512 (NetBSD-6.0/cobalt/binary/sets/kern-INSTALL.tgz) = 2a62524f994a5034d60f679b1d30eafe60dafb35216458055ad9e25f3c7053f4556f1edd233754e0e4eb4a79373fb814c28e832b67d9de69035513b819d5080f
+RMD160 (NetBSD-6.0/cobalt/binary/sets/kern-INSTALL.tgz) = 894035c7e551dfee7ae53cd1e7b358876fef240f
+MD5 (NetBSD-6.0/cobalt/binary/sets/kern-INSTALL.tgz) = c6f35e3463064c86be5b3229fdf23ce1
+SHA1 (NetBSD-6.0/cobalt/binary/sets/modules.tgz) = eda182e3418c72ab2d0bb33efa014d77be461b73
+SHA512 (NetBSD-6.0/cobalt/binary/sets/modules.tgz) = 52a988323ace3452cdd3c8db6d03e26f15b3d9570314c8e8efd80169676d36209a8dee6736d4a1aed53beb3ad3ecd6fe8ea9d4b3b0a85417a6540cc4f6ca2154
+RMD160 (NetBSD-6.0/cobalt/binary/sets/modules.tgz) = 0610022e6cce6e576d3bbc6f3bca284d36eff821
+MD5 (NetBSD-6.0/cobalt/binary/sets/modules.tgz) = 2850ca4ea69cbac5274f2307a48394f1
+SHA1 (NetBSD-6.0/cobalt/binary/sets/tests.tgz) = ae62656c92b1883296087eec3534d7542356c79e
+SHA512 (NetBSD-6.0/cobalt/binary/sets/tests.tgz) = 35a22f1ede3db17eaa2c29645c5675fe5a2c4fd6deefc5d372cbdf1ac61c592fe7acf65486a8c576d3ee8651ddb3afa33e39e644de18d2831d25c89aa74c734b
+RMD160 (NetBSD-6.0/cobalt/binary/sets/tests.tgz) = fba7399b23a918470dcd108a422bb4f998a94a42
+MD5 (NetBSD-6.0/cobalt/binary/sets/tests.tgz) = 21dee182d4f02df926ce52688347af72
+SHA1 (NetBSD-6.0/cobalt/binary/sets/text.tgz) = 58049b832c3722ddb05f8eca622f77ff8e4e8a4f
+SHA512 (NetBSD-6.0/cobalt/binary/sets/text.tgz) = 4eb3919068d26f193fcca2a30e27152421be198b313fa9700612a0d9d094d67d329b2e72e70b02c4789c1430378269f35f0758042faf60c26a18e293947c7db9
+RMD160 (NetBSD-6.0/cobalt/binary/sets/text.tgz) = a2eaa36b8c306e0cd6a9e17218aad574d4fc3508
+MD5 (NetBSD-6.0/cobalt/binary/sets/text.tgz) = e0f6aa8df8d17719f265922d2aebc787
+SHA1 (NetBSD-6.0/cobalt/installation/boot.gz) = 59e1785a9e2ea35df01f4726b62f6fbbc74c56df
+SHA512 (NetBSD-6.0/cobalt/installation/boot.gz) = ad2baef23c54d600d49e7777b924c7d79c8e7e3f74107e9fcd939b16811b31979391ce8f3ebeb4b31810fef2cec13df063d31e4b3a5b5c57b550156b796a4410
+RMD160 (NetBSD-6.0/cobalt/installation/boot.gz) = 9ac9dbfb3932a92e2b4e03664bdb8dbed4fc0e71
+MD5 (NetBSD-6.0/cobalt/installation/boot.gz) = f4b10cb6244d765eb7a9a6a3ef1d09ba
+SHA1 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.bin.gz) = 971d8de48c6c6be81f723ada4b7c509dd152b86c
+SHA512 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.bin.gz) = ac63feaca53a1abad181877bec95098e06e89343cd783f309ed3d223a80005d49fd5b3420a36c8e2894389373a9a8d4a023f134e1ff847f240864b8f529adfbd
+RMD160 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.bin.gz) = 5abfe7b82ce9b81c69818cbb533a9d7e69f01081
+MD5 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.bin.gz) = 6ed9526e1fc60db1cdab3dfedb2a4ffe
+SHA1 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC.bin.gz) = 7950c0154a603614e8aaa75da019ffe266fe36de
+SHA512 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC.bin.gz) = 2421894a9dda95a17a30b6a4d87e350f7bd17f467362255eb22c8a56e0ac1e54592136d0b0d218c16a14afb8684bb8eaf11442217af1c217ea4588d6290c761e
+RMD160 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC.bin.gz) = 326f220c689b47fb30e91d483a009246993da43e
+MD5 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC.bin.gz) = acaf2f6174037777dc0dfc175da86403
+SHA1 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC.gz) = 85e46b6fa4ab45b810f6c3f4b3268cba0f895cb4
+SHA512 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC.gz) = d3f2e7306c8b8ea0969bb68e5888ba16436632479a6555a4fffe2479c4cea1dce048c2d18b6653fe1946b9a9bd2d2df1da172d71df45c6eca59a1c91e81f51a9
+RMD160 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC.gz) = 31820c3a9b7305792ca4246aaa0d8e5474c2a8ba
+MD5 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC.gz) = b48de4452de2d94b74d617ba30b529f8
+SHA1 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.symbols.gz) = 83040bbf6395952a68fbfde410db2729c8d814c9
+SHA512 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.symbols.gz) = c48a2bb6dc2bac588b3e9690dbeed3b85361439e40e3410220c0b9fcb70e2e6a2bdffd24ddb428f740895ef34c3e56955f2877509441be0c158e97407656da24
+RMD160 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.symbols.gz) = a6f75d1e098e0bebb9da8f6149114de13416b210
+MD5 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.symbols.gz) = d72d4a1170c9f40c41c951eb2f40dd9c
+SHA1 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.gz) = 98765e3c532799a669420e9b6a89b22033059d66
+SHA512 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.gz) = 34a64fc5eb79bec00adf55f9788139730c5f35bb8e05f0b00899776836aa0dc7c372482ed5cb9341fa7354d5f8c76ed6b879ac516210d89e33794efbccf40127
+RMD160 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.gz) = 5a4349f94c8afe0d7ad4c6ca4b02d766ddfc63b3
+MD5 (NetBSD-6.0/dreamcast/binary/kernel/netbsd-GENERIC_MD.gz) = 7c4659ca64c7f31b205e8d1ce4166597
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/games.tgz) = 2040b4af557a62f2ade5fc9fcfe4cab3df88c7e2
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/games.tgz) = 8b5071337dc844042537c24c75660e61c9709cd10cbbeab059a84da6d482260b73365ff3870f85060c130a291b6f02be174d288127ca62ce4d291a6982192317
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/games.tgz) = 28acfa5a131d52df7c157e2edca1dd0f20e774dc
+MD5 (NetBSD-6.0/dreamcast/binary/sets/games.tgz) = d82c46dbc0021fd4694e464042936052
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/dreamcast/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/dreamcast/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/xcomp.tgz) = 53aa1e2a910e8eed09dc07f8b724804f53fe5e2f
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/xcomp.tgz) = 24645da85419528015cdaefd0c835741fa801392e795b363bdfc39558e75e7f384511c0668d12e2440114b7c543c7532aaec438048f08d35c54c9c7a748f20c0
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/xcomp.tgz) = 60a461ffc1f1562274110d65c72a541ee131cd21
+MD5 (NetBSD-6.0/dreamcast/binary/sets/xcomp.tgz) = f1d2650a8d7a4ecd60fda8e1aaf8c09b
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/xetc.tgz) = 1636a6fe3e01f6d8a07a19cd204a6807c8caa4c7
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/xetc.tgz) = 9cea4ba4af287dd57e591d4269f2f2582010250316f323746ac56b12cefcf2590b93fbb0197c665f61b1df41dcca62d17fb6ad80d4b1feb8ac8265e91e15074f
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/xetc.tgz) = 5f68e3f96f7bb9ae07fccdb1d058e4b1307b4b29
+MD5 (NetBSD-6.0/dreamcast/binary/sets/xetc.tgz) = da84d97230787283e215a4ee1c4053ad
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/xfont.tgz) = 97439ccf6840b18b1e9885f5504a401bf1a93650
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/xfont.tgz) = 3d15541f7d7ae2128f44355bf110415adfa4e5182829259d2c6f7a4217feff99e236d13c5bb7bbeb724ff1a09ac1f58f02bdd6eef528bc416ec3118db6fc7d45
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/xfont.tgz) = cdc9fcdb5fd5032803d5bba18db58f3ea6d62c85
+MD5 (NetBSD-6.0/dreamcast/binary/sets/xfont.tgz) = a8466a0477c6c443eafe99e9d1c61131
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/kern-GENERIC.tgz) = 8f11a046a1e6277a5f90f44142735f39375f949c
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/kern-GENERIC.tgz) = 12786eb317effcd2f7f108a139a95b99c6026e75370853d3761292d431063859dfff26ab4a2bdf5c8bfcfbda4deaed9025583b30367e00074dc875d759f1cf76
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/kern-GENERIC.tgz) = 464ed36bd11cfa0b181632d2b1c54f34a511fd14
+MD5 (NetBSD-6.0/dreamcast/binary/sets/kern-GENERIC.tgz) = 1cd64692f608f13541288f3ff263fa82
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/base.tgz) = ce23182c9b35fcba35fce0e3f12578a988a8ecc7
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/base.tgz) = 20dc7d634449bb7e57ae55458aa0f2d53c5f03f92df3df5a6429c1f3192871ed2fb8ec64700a045591d308a31baa3212c8a7ee6f3bfcccc05974557bc2e1ebad
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/base.tgz) = 7fbdce2370f91ad3aa3abec889333b59755b0f4b
+MD5 (NetBSD-6.0/dreamcast/binary/sets/base.tgz) = 3aee642fc36860e63bf85392888ab2a2
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/comp.tgz) = c288c3890b514eb00673399571a6d22d4abf7608
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/comp.tgz) = cfbe2ddaf47453f9b20a74890e3585fd82a23d25489378b41276848019971f1e740e00203418db16e1832777b96d3b16eeeae1a4fcdf9551b93582395c5a3838
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/comp.tgz) = b79a42001602eb84e650fe34a25ac20e5773703e
+MD5 (NetBSD-6.0/dreamcast/binary/sets/comp.tgz) = 57451cb40d16c7d6dfb960eb4848754e
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/etc.tgz) = df82ad0e59f00bfa96ca079e1dac2b0f772a6b1b
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/etc.tgz) = 87d552690ee356eb3a82c763ddf3f44ed57a5d0d8616974570ba21a2901371e6ee6e54d0b25cb5607466f01cbabca86fe096572f395c74aa6dd98be45e4c7ee8
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/etc.tgz) = bbc9f48831c1483ffe9c9aab353995e162a5a385
+MD5 (NetBSD-6.0/dreamcast/binary/sets/etc.tgz) = f0881f75efa980e58cea0c0d60f55656
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/modules.tgz) = 243ab8d8f5d3375fbd17efb668c1abe45d0d1487
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/modules.tgz) = 193c158f2d2f64c3b571c6e10d97bdbca141faf5ee1a970e3c1e194970e2723e74d8372e0110b52d11e210e860102ebf24012a2267a0f98dedeceb0cc60429f8
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/modules.tgz) = 788e45cc0d8a03191c14f3fe0d429ae331d96895
+MD5 (NetBSD-6.0/dreamcast/binary/sets/modules.tgz) = 83acdebfad50fc820d420b4e74c87762
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/tests.tgz) = 263b82b9d13d080e46cd27e4a6e5df9d43e6f74e
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/tests.tgz) = ffc4a4348c68f8b06f1387d60e1d5b1bcc1b42ec6d255cd267dea08aef4874591dfc95f69ce416333679cdbc124540cb9b92e58ad9f522e6f34eafa2f6dd9ef2
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/tests.tgz) = 2518cdf17a8f82dcf39525e2928ef52e46e32325
+MD5 (NetBSD-6.0/dreamcast/binary/sets/tests.tgz) = 2f0af9ef7e65f9afb0185e305a206183
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/text.tgz) = 577c45d37aefc65d2787bd989002bd3748440b56
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/text.tgz) = f1a7e6beac2f881e8b9d356491e4b09d7b92b0a0ed33462575db59ce8effae6ca2a1989e4fa9b78fc5d012b118b2f99a2e2fcd7505a0ca80eb61684d5bceb096
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/text.tgz) = 2688ae8578acf1b6b8937abf4d05cb09e7e2ce8d
+MD5 (NetBSD-6.0/dreamcast/binary/sets/text.tgz) = 0cc81795b0f4ddd432f3dfa01eb2a530
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/xbase.tgz) = 7305b994f65ffa7d67a9f99d0146e705f81ec723
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/xbase.tgz) = 904f0c21201d51b58c366a984eb20191c620287b77b12b520003d48fb0ce1a3ae10fa871c3514598a74071ce0cc1321ff781b96195a13e81c75d35cdc7958030
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/xbase.tgz) = faa8760bbee9d3b2a21e3b62fddb641faf939ee9
+MD5 (NetBSD-6.0/dreamcast/binary/sets/xbase.tgz) = 655c33ebf6f37bd90b1921b220dff2ac
+SHA1 (NetBSD-6.0/dreamcast/binary/sets/xserver.tgz) = df506c92cf396d2d59ee212c03a10f44129f51a3
+SHA512 (NetBSD-6.0/dreamcast/binary/sets/xserver.tgz) = ee8b15abf9e8115ffc50deeb372e9c7dfe9412f8e94d65b3ed78f78fba63e9282b668c8fc2fb2a22437f950adafd1dedf2e9baf395fa945d04eeb50db0d1f5cd
+RMD160 (NetBSD-6.0/dreamcast/binary/sets/xserver.tgz) = 73bcaffdf98d0a5c4d5c22c97c5476c1b5901eec
+MD5 (NetBSD-6.0/dreamcast/binary/sets/xserver.tgz) = c5e16ae2cf663c0373fbb82f64f4f48b
+SHA1 (NetBSD-6.0/emips/binary/kernel/netbsd-INSTALL.symbols.gz) = 7ffd5f42e92a4ae32ca78766815db12dbfd4c4f6
+SHA512 (NetBSD-6.0/emips/binary/kernel/netbsd-INSTALL.symbols.gz) = f7a50a9ee148ac9566dbc3722b14d904c02a3cbf285ea8efb10a24b8a93db514abbf825dbde48a8c494da6b02f48408b9414a6d8a45ed61f334afd2dd148aa71
+RMD160 (NetBSD-6.0/emips/binary/kernel/netbsd-INSTALL.symbols.gz) = e03b53e71c192a3de6d720b0502e0597f2ab0aee
+MD5 (NetBSD-6.0/emips/binary/kernel/netbsd-INSTALL.symbols.gz) = 014979ca9f7b5feb3664479cd34dd2d3
+SHA1 (NetBSD-6.0/emips/binary/kernel/netbsd-GENERIC.gz) = 663be1ef5f9177715d8a299d3e610b21a942dc16
+SHA512 (NetBSD-6.0/emips/binary/kernel/netbsd-GENERIC.gz) = 006a5189536650946aeddb6763997bab1cafe82b578777674f75df8346d6bd01467d532de7be3c5ed0664d9b85e4da90a90871f6e15fa5166af29f1e87d9d7ea
+RMD160 (NetBSD-6.0/emips/binary/kernel/netbsd-GENERIC.gz) = 15cbdb609c3925081aac2e84ebc104775601fad5
+MD5 (NetBSD-6.0/emips/binary/kernel/netbsd-GENERIC.gz) = 71af44cf65da1b8ecdadbbf037f07ec5
+SHA1 (NetBSD-6.0/emips/binary/kernel/netbsd-INSTALL.gz) = 4f40fd5aa8028bd956dfc51a5e61be77ca742adc
+SHA512 (NetBSD-6.0/emips/binary/kernel/netbsd-INSTALL.gz) = 9fb9cfe8aa5d8ea350b24ad80a207d9439141914bd4e3371297b9971969c96ca6899b45f099e1e02ed4c8ffbea75d421b22af7d09b5b91c2f435df176229b4c8
+RMD160 (NetBSD-6.0/emips/binary/kernel/netbsd-INSTALL.gz) = b269d2a87391b9640988493e3493edd114e7e8b2
+MD5 (NetBSD-6.0/emips/binary/kernel/netbsd-INSTALL.gz) = 59724cb6c92366dc47fa0b4ecf2fe22f
+SHA1 (NetBSD-6.0/emips/binary/kernel/nfsnetbsd-GENERIC.gz) = 5dc90ad559e682bd427b6165f760bb09ba676e7d
+SHA512 (NetBSD-6.0/emips/binary/kernel/nfsnetbsd-GENERIC.gz) = 4992a1e1bd6cc1dc21821a6151aa3561fda5e369ab6057575cd70d63503a98a8d9da257956486f2f58996b0aaabf20266c16033c1f069e3dcc21f582f74006f8
+RMD160 (NetBSD-6.0/emips/binary/kernel/nfsnetbsd-GENERIC.gz) = e7f4efd86d048e9f9857bb3cbf136a3e461b9463
+MD5 (NetBSD-6.0/emips/binary/kernel/nfsnetbsd-GENERIC.gz) = 66abd685dbc87ed5282e1b55a6b7bfbd
+SHA1 (NetBSD-6.0/emips/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/emips/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/emips/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/emips/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/emips/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/emips/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/emips/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/emips/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/emips/binary/sets/kern-GENERIC.tgz) = ed3903192d38367303cf5210725c33ba123c216d
+SHA512 (NetBSD-6.0/emips/binary/sets/kern-GENERIC.tgz) = 62687e8a1af317454e30a65dafd1b54eb444db9a27abf987ba17bfaf4b9796623f279011c2102500563c9a862fa983c5e48a9c94afdedeee15414840dcd328fb
+RMD160 (NetBSD-6.0/emips/binary/sets/kern-GENERIC.tgz) = 070bb8b5cab57c375fad13304165f8825e6647d5
+MD5 (NetBSD-6.0/emips/binary/sets/kern-GENERIC.tgz) = 732ac8530d63fe2f3eea6e2def05ab4b
+SHA1 (NetBSD-6.0/emips/binary/sets/base.tgz) = d058920475032b263b2020af3230894da8ded663
+SHA512 (NetBSD-6.0/emips/binary/sets/base.tgz) = 606b27579e80fca77e82a385dfda2e03bac6d8563186ccc98d993cd532bc79da93883cf71f850380cafb31107efb424585a4aa5946f54bbc36aae5d9d9495a44
+RMD160 (NetBSD-6.0/emips/binary/sets/base.tgz) = 2663d48750530861b5e9514902b9cc44e8a4162a
+MD5 (NetBSD-6.0/emips/binary/sets/base.tgz) = 22ff23e09d0502d77de5fb289ad53427
+SHA1 (NetBSD-6.0/emips/binary/sets/comp.tgz) = 5c25affcdce77ce7a77755c866316a9db89272a1
+SHA512 (NetBSD-6.0/emips/binary/sets/comp.tgz) = d2b09aa5b72624ad3f25fa1438a8feef1e02b8f9ff064dd1d05a621f29a9790b0029baf652ab5c0ae2c3811532208235288c6614f62c378bc6b1b4a5494fd06d
+RMD160 (NetBSD-6.0/emips/binary/sets/comp.tgz) = 2fd5cfc13841a1188580c6584f78bf8262752da9
+MD5 (NetBSD-6.0/emips/binary/sets/comp.tgz) = dc12cdcce6751fd44291a95a06cf97aa
+SHA1 (NetBSD-6.0/emips/binary/sets/etc.tgz) = 6bf20c929df89dfe6764df1f4ab15b6aeb45d4cb
+SHA512 (NetBSD-6.0/emips/binary/sets/etc.tgz) = 4ee6668a884bb4b4c3ccc4370a7ac70ed14f32b7856219fa375f200ad259087400e93fe144bad4650318cbe9af4133e8d8d8f79cd0d91aeb24df117117ac54bd
+RMD160 (NetBSD-6.0/emips/binary/sets/etc.tgz) = 9081112a95ee958fce83e79f687b97ef847587b4
+MD5 (NetBSD-6.0/emips/binary/sets/etc.tgz) = 912ab9bd3949946dc2af9522581118fe
+SHA1 (NetBSD-6.0/emips/binary/sets/games.tgz) = ec034031c6b1ea012c36910f2e901b032b0aaebe
+SHA512 (NetBSD-6.0/emips/binary/sets/games.tgz) = e9bd506e1f6a6c17c0505db90f7da49795dc63905c9962e01a69224a1cf22312d9e4c68d815e9c487f21fd0791bac3a65a5e5f7bce46198694f673522b057d96
+RMD160 (NetBSD-6.0/emips/binary/sets/games.tgz) = 393d511e3432d93932f2b3d2308d6a16b7cce764
+MD5 (NetBSD-6.0/emips/binary/sets/games.tgz) = 71d23c31e025ff3b1eece7b3cb170abe
+SHA1 (NetBSD-6.0/emips/binary/sets/modules.tgz) = f9aef1ecd6e2ee16d7ddfdad51da034bbdcd8aa6
+SHA512 (NetBSD-6.0/emips/binary/sets/modules.tgz) = abaa6c62593d85131f691a3125e055970a8c3fdd7d8103db6e501dc2d2379c9dd16f9a819e14ac20959011d8946c40a8dc59ee0b7ead8a8f25c20a6475696bc6
+RMD160 (NetBSD-6.0/emips/binary/sets/modules.tgz) = bca8a2cdb2ced4804cc2e0543981b1db671732e1
+MD5 (NetBSD-6.0/emips/binary/sets/modules.tgz) = c98d2b8fab6184f74545c6fa54897a35
+SHA1 (NetBSD-6.0/emips/binary/sets/tests.tgz) = 05a68659aec8758adb269e6f898607e1fc3f9089
+SHA512 (NetBSD-6.0/emips/binary/sets/tests.tgz) = 1434cd321d5f37e6482645a11ce4f203ea3406fcea550103e1881bc68b1e8760697e5e6207ad01d4dba2d1b71c2ed0488bbb0c01dec2b28a6a74e3529ab81a8a
+RMD160 (NetBSD-6.0/emips/binary/sets/tests.tgz) = dc76faefeb42e73abb5727e46bdb46ce7a737be3
+MD5 (NetBSD-6.0/emips/binary/sets/tests.tgz) = 1ef426de07b570c1d9affeb44e452225
+SHA1 (NetBSD-6.0/emips/binary/sets/text.tgz) = 96fc1b82a283a2bf4cdd76168ee3cefa73191be8
+SHA512 (NetBSD-6.0/emips/binary/sets/text.tgz) = 7cfdb8107f4d0bfe28bf41c15b2fe7f9c0aa0d075cdb7fdb0b4566ed512da3123eff94410bf563c6a37aa498d83ed9cc7b9e16d54c8bf33605fc60bf1357c4c4
+RMD160 (NetBSD-6.0/emips/binary/sets/text.tgz) = 1e1ad1dd678eb777938e2320522e275a5751475c
+MD5 (NetBSD-6.0/emips/binary/sets/text.tgz) = 11f296781f98a8ae6aac39f40cb45805
+SHA1 (NetBSD-6.0/emips/binary/sets/xbase.tgz) = 535b4c29666ef2de43bb6017102e9181576255ea
+SHA512 (NetBSD-6.0/emips/binary/sets/xbase.tgz) = 31656ac187e0adf03eff3f896876510bb7624bb18789094abf22a59008e9d7b8d848cc1703e15b799fa2b4cd9e108f1d29c5625f1ae9f012edf8cf35912e4590
+RMD160 (NetBSD-6.0/emips/binary/sets/xbase.tgz) = c8b8ebfb26aaecc931b8d8a17625eb91f904fcfb
+MD5 (NetBSD-6.0/emips/binary/sets/xbase.tgz) = 46641b24d37899b78ef7a83559bfc3b0
+SHA1 (NetBSD-6.0/emips/binary/sets/xcomp.tgz) = 6cddeb4f503fb424f9a06645ef46701288799401
+SHA512 (NetBSD-6.0/emips/binary/sets/xcomp.tgz) = 45f779894389850776fdd4785165f6bf07dfcd46d408199eb352492536b254fa229b9d4e99a716657f210c4772feea966814329f3f2aaa729112c9b8f9d4e50a
+RMD160 (NetBSD-6.0/emips/binary/sets/xcomp.tgz) = 9203f95dc810dbbd873aa54234dada2961a6d309
+MD5 (NetBSD-6.0/emips/binary/sets/xcomp.tgz) = cbb4c61d832ebb4aa97c99484e9109b5
+SHA1 (NetBSD-6.0/emips/binary/sets/xetc.tgz) = 7db74837c8e702a831451e4660c1f8670e674003
+SHA512 (NetBSD-6.0/emips/binary/sets/xetc.tgz) = d68c233f0e4dcf5961bfc214fa10188d5fcb954e103ad610b76964c8e832e5758283bb28ef3eba448cde496d610b488f7958fb391371e1230a7b6127c267dcc5
+RMD160 (NetBSD-6.0/emips/binary/sets/xetc.tgz) = 2d5fd67c9ef6ddef6c3f5fdc845ea23f2b0e3b57
+MD5 (NetBSD-6.0/emips/binary/sets/xetc.tgz) = 98767dc7c3a45e641592807be04f1a64
+SHA1 (NetBSD-6.0/emips/binary/sets/xfont.tgz) = 6f8acfd3feb8f6421cfea08d8cfe514ad7bc7acc
+SHA512 (NetBSD-6.0/emips/binary/sets/xfont.tgz) = 2b4d59176fdef5055b0c5d8ef7677d6a1ae823d86d5955a2c33be046ba7bd8bfad85ae21e8acb11a50cba250d21bf0f2bb8c43aaa5d7d0767998dfbbfa54d014
+RMD160 (NetBSD-6.0/emips/binary/sets/xfont.tgz) = 34878c9b7c1380c42f57eadea7369b687d0e45bc
+MD5 (NetBSD-6.0/emips/binary/sets/xfont.tgz) = 540f04b4c6acb6e1b6364303388f82ed
+SHA1 (NetBSD-6.0/emips/binary/sets/xserver.tgz) = a85da9c68ded22e61f2234e696b0bd61739f4a08
+SHA512 (NetBSD-6.0/emips/binary/sets/xserver.tgz) = fd1bf84b2f34befbae2dc34e3fc5af3048c93c185d8cf5e8afe91e324bba7005d14d9cd73db5e09bee783116b9a09b01b650a9097df07a335fc81a2bc569c2b1
+RMD160 (NetBSD-6.0/emips/binary/sets/xserver.tgz) = f066886778a33191aaed1a30ac8494b6deb152c5
+MD5 (NetBSD-6.0/emips/binary/sets/xserver.tgz) = fc4fa9292f46a325f74c4abc922fd215
+SHA1 (NetBSD-6.0/emips/installation/diskimage/diskimage.gz) = 9c4d0f6ee9e3251ef720acdb06e20683c55a3db7
+SHA512 (NetBSD-6.0/emips/installation/diskimage/diskimage.gz) = 5b9c5d72e5e4bfcae27bf51c2ec9fa849b019b475d6677be8c49c31f18eaff6e559d80790ba6d5e606169215e46e04322c4d12ed0386e76635fdebe380cadd28
+RMD160 (NetBSD-6.0/emips/installation/diskimage/diskimage.gz) = e7373c5f20e4728fef9951dfc1beffb70390f651
+MD5 (NetBSD-6.0/emips/installation/diskimage/diskimage.gz) = 4f2e15b3d203006588a75670b4d3e75c
+SHA1 (NetBSD-6.0/emips/installation/miniroot/miniroot.fs.gz) = 4075299a2ef6a4368234ed1e378c2931b0df6376
+SHA512 (NetBSD-6.0/emips/installation/miniroot/miniroot.fs.gz) = cee815c8a985125fd2c1a9a4811542371ade25fa7f35b4cc4da1783186146d4620d1910a24b92beb02d1cf836e9cfc2921ff9d8c81ecb4babf585b1ec3601496
+RMD160 (NetBSD-6.0/emips/installation/miniroot/miniroot.fs.gz) = 1701f681ccb15b5232abc07550de79d3380af96c
+MD5 (NetBSD-6.0/emips/installation/miniroot/miniroot.fs.gz) = 5cb7df17380c5bd1d56b28d6061332f8
+SHA1 (NetBSD-6.0/emips/installation/netboot/diskimage.tgz) = 04f571f04a2227b98df91f97023e860af233d2c8
+SHA512 (NetBSD-6.0/emips/installation/netboot/diskimage.tgz) = e5c7354014f23996e0e5c331103b9936387b9c6402491041727b69353f6af08b57cf429b51ee0c28e76e3f4506479b0559dac18b05a009a3afca76ad2edbd29d
+RMD160 (NetBSD-6.0/emips/installation/netboot/diskimage.tgz) = c57777b29a2c589549a906fd0f425c56366a7075
+MD5 (NetBSD-6.0/emips/installation/netboot/diskimage.tgz) = 9d1bfe38f9ec7d4ed86173bb157abf52
+SHA1 (NetBSD-6.0/emips/INSTALL.html) = bad639d8582318241d268e529e8e024159dc5997
+SHA512 (NetBSD-6.0/emips/INSTALL.html) = 94627da8cf355e0f7b3a597e2e22be0b151a9c4e40301c7c0b67c1877c34abff57476a5c177035c032cfc1d9b8f9d38aa919c27f1f3c15d3edb3403d18e71b44
+RMD160 (NetBSD-6.0/emips/INSTALL.html) = f2b00377e6a6d060e9027d78d2278445ff6b4d75
+MD5 (NetBSD-6.0/emips/INSTALL.html) = 825b11bed2394322021f65e43627a391
+SHA1 (NetBSD-6.0/emips/INSTALL.more) = 9906d8f0c74d8538aa2e7d1361800cbbc2db2d29
+SHA512 (NetBSD-6.0/emips/INSTALL.more) = e8419f85e6beef4bf18f6bc916141ae9bca52eb6f56e2ae7133fc771ca1033cf2172a644e4415be0019868004278605f0e93c42f8f4f60d1e2fecf8c06a51a90
+RMD160 (NetBSD-6.0/emips/INSTALL.more) = 70fa5e023134732afc81b3622480328ae9f5d449
+MD5 (NetBSD-6.0/emips/INSTALL.more) = 0cff06f0f5c3bac3eaf4bf4336494217
+SHA1 (NetBSD-6.0/emips/INSTALL.ps) = 5783005eb38711a9ffb248fb5bdf2987912f26fc
+SHA512 (NetBSD-6.0/emips/INSTALL.ps) = a27d36ced381f22565ac6ee290d4ef43de834977ca8be3d96bf758005a6fe0875aa03f703da08b7dfd5fdbd48c19c77ef5263f8571d0f5f983ff7c1d08088873
+RMD160 (NetBSD-6.0/emips/INSTALL.ps) = b8e28009dd02ff9c1f98d5fadadc6455c262238e
+MD5 (NetBSD-6.0/emips/INSTALL.ps) = c16b7dcef0674aaf0dd240381961eaa5
+SHA1 (NetBSD-6.0/emips/INSTALL.txt) = 0d166d27be7166a76ad58779f1272a1a1542e952
+SHA512 (NetBSD-6.0/emips/INSTALL.txt) = ba74f2486c3bee1b30fc39edae6ad38b0abcd9610afdad172a49590aa0c1fd8a2256d185a699baf6bea9e40d9fec7d1e56c17d77858d9ebde027419cc044b8dd
+RMD160 (NetBSD-6.0/emips/INSTALL.txt) = 729887c61690c966497811da66852780d0d3eec5
+MD5 (NetBSD-6.0/emips/INSTALL.txt) = 8a28948bd5d45a30ca79556be75dbd69
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_TEAMASA_NPWR_sd0_flash_0x00080000.gz) = e8620ef3bbba89642fcce48ed01e16f0783e889e
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_TEAMASA_NPWR_sd0_flash_0x00080000.gz) = 055cdfd0872737d68054fa4c2125d131e6ee3f60135be817da7fe111adb2290c4ad8d968b4cbefc67658c3e9f3dfdf99caaec320f572a00a790604c93fa73408
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_TEAMASA_NPWR_sd0_flash_0x00080000.gz) = db49ed4cceac70d18a8a6b335f20923d07c8ad8f
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_TEAMASA_NPWR_sd0_flash_0x00080000.gz) = 12617c0444b2a570637a45339937c77f
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_ADI_BRH_sd0_flash_0x00140000.gz) = 3160f03e833b96020804361b1d98c0cffd8c5345
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_ADI_BRH_sd0_flash_0x00140000.gz) = e5d7ceae7a4b4446002170c84a44dcd65cdbb2458c889582ff3070a20580ff31d2f497b07c320217b55f75e6b343f689b9312d172dd3880bd82808e6cdb995c9
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_ADI_BRH_sd0_flash_0x00140000.gz) = 41f31d747ec5265903490d300bce1e6c34ef32ca
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_ADI_BRH_sd0_flash_0x00140000.gz) = efec631edb7870b4cc3ab1cec8d98810
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_ADI_BRH_wd0_flash_0x00140000.gz) = e1c927a0718d63609fe15d9dc9c265ab0172ddc5
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_ADI_BRH_wd0_flash_0x00140000.gz) = 5418c2ebffd11c30028d867561e26dc5857167698c88f5d9eb30af3944fdab4950ec2f6953999689c03cf684aaada038d6f7f07494988dba9467a814fcfe1d3f
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_ADI_BRH_wd0_flash_0x00140000.gz) = 05680bce8a448c3fec2149d6c89dced13166f34e
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_ADI_BRH_wd0_flash_0x00140000.gz) = 36d8336012f5603e1b30565061fd8c3a
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_CP3100_sd0_flash_0xf0080000.gz) = 9419b71634e5ff228357a37651061a1c4c2c2ebe
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_CP3100_sd0_flash_0xf0080000.gz) = b17b66b1b62c16d6a0add67d55f82a6943557abbbcb8001b328770dcd2191b1b55881dca2919d7f76381aceb1ed53ae81ff002317e99d02fbfc2817d9b366661
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_CP3100_sd0_flash_0xf0080000.gz) = dcf913149707315fda181d6dd6967b68fe61fd22
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_CP3100_sd0_flash_0xf0080000.gz) = 4f81965829024ad764d293456cd96fbd
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_CP3100_wd0_flash_0xf0080000.gz) = 748d01d1b8796881f853c31ce98e0dbf473bcf8e
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_CP3100_wd0_flash_0xf0080000.gz) = 898de3034e164cbef89c0f09c76decf48c4291c7c0d077134ba1695cf0c9287d658e61c82cb2d3d46dce986014d2e52d84f0600dab0f99db996623eed7ad93ea
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_CP3100_wd0_flash_0xf0080000.gz) = 452633be8258bf3df07d6e9461785a8f3ac09f98
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_CP3100_wd0_flash_0xf0080000.gz) = f6644ec6b9e7cbeb624d57e00e764b5e
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_GEMINI_flash_0x01600000.gz) = 2dece6cc86980856d901df11995ecb0a5524451b
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_GEMINI_flash_0x01600000.gz) = 270b8d528bed206bfee4cfc63ae9a04f69c282d52b2beae8cbc8298872d2ff0e50e00d849c6e435d472845a0f6b8601b94a0fe52e63c61e7b5c534b9d830d252
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_GEMINI_flash_0x01600000.gz) = fbd959fffd37010a92a76026469affec9bbe95da
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_GEMINI_flash_0x01600000.gz) = adaae55226bd3fc806962ae70e9281dd
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80310_sd0_flash_0x00080000.gz) = 97ec6f4a472d0b73f1d3b8d284f57debab190c78
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80310_sd0_flash_0x00080000.gz) = c52a596cd2ffb52c1321b2e8006a590186dddde671f4325067e546338eac4d405c7d5fe559ba6d187a1c26eba4c45d233505a434a98ee11b88b315db0a42d63d
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80310_sd0_flash_0x00080000.gz) = 3305a23227d275c25307ab7b999f5e0c0560195b
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80310_sd0_flash_0x00080000.gz) = fd76ab094a19b1f66c9d21df4cb69700
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80310_wd0_flash_0x00080000.gz) = 0ed362fdba88789a5d26d00e0e8285f75587f5c2
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80310_wd0_flash_0x00080000.gz) = 78110414c2dc51bc378c3a1d44914b4f5dffd6b1d6d0a749576e2d7d5474e7856a2235641fe310fb87b3789bbf495b16459f9c773bdab19161e65af671ae6bec
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80310_wd0_flash_0x00080000.gz) = 4d958d9f772b214efbf9932a00970375a6fa7e57
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80310_wd0_flash_0x00080000.gz) = ec5386e862bee8da4d46a124584e2cee
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80321_sd0_flash_0xf0080000.gz) = 037aa337f876321d75654dfd576dbc0c4c301e0e
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80321_sd0_flash_0xf0080000.gz) = e033668a417f453ca35b2b43633a7eb9160765eb42ba1b86ea61d5fd4cb5136123a69194d58b3bddc51fd7e319bae1d70028e1215a1e8f4e98270bf0b4eabfa2
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80321_sd0_flash_0xf0080000.gz) = a8e8d6ea67cf26c422d638794675626e7261b3ea
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80321_sd0_flash_0xf0080000.gz) = 2b3bb43bdb7fcd4999377eaa3b994c48
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80321_wd0_flash_0xf0080000.gz) = 6d8870ad00ed9f496738dd5cf7f670b5b43d2f34
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80321_wd0_flash_0xf0080000.gz) = 414a11de38ff565307fbe599b87b0f59ddf91db1882b5e246774ac23f6af49411ae33de4145a0d8e10755d6e78d85c930ecd0705804a25ad10e3957765e565c1
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80321_wd0_flash_0xf0080000.gz) = 27959615599b74b946e9e8483c2284aa3f80ffa7
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_IQ80321_wd0_flash_0xf0080000.gz) = cc0f0b0621d6d931f6dec494c7bb2305
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_SMDK2800_flash_0x00000000.gz) = 09617a28f2da331a17efe6cbdd4df7367f8ff98a
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_SMDK2800_flash_0x00000000.gz) = 9324e9fe0d4756cac25b33f8b6592f2a1a25d12b0f3752447cf660c21a3b2e93eaeb3e41a15d91c2edd827e2f5318a241c58129cff998d8f0a0a7a6a6bbc598f
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_SMDK2800_flash_0x00000000.gz) = c2e0b7b74df9090350d1afc52a15465b77eea3b9
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_SMDK2800_flash_0x00000000.gz) = ee28fbd00b44705a33d6ca6e6982507f
+SHA1 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_TS7200_wd0_flash_0x60660000.gz) = 3036d8f2318c69d791b710a06d2e94c5c563fcac
+SHA512 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_TS7200_wd0_flash_0x60660000.gz) = e8f2cab3b75e3f4ecfd2ed85b624c8c643eab3cd32a8d0398148f49923622df598071fbb2fef6b5687c8273762d197992a03b1d8465d96630202b78592199a1f
+RMD160 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_TS7200_wd0_flash_0x60660000.gz) = ead79fd1f78230bd30f851b78dd13b670a791863
+MD5 (NetBSD-6.0/evbarm/binary/gzimg/gzimg_TS7200_wd0_flash_0x60660000.gz) = 1e25872ad616b30406dab15aa8c20b22
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.bin.gz) = e673789f88d60407c85c744a64382c102b91e983
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.bin.gz) = 43aa01312bac8975f2f66cfc47e9cbdcbfe37eb37f2076c221e5c118521e987f18c1b14bf2d94b390942820e5f6218cfa1eba67a1818f8723481d434f9fea00c
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.bin.gz) = 7c45cf94c28c04db6df14decfede69e83bc0cf4c
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.bin.gz) = 49da3170f0fe2fb304e1131bf77d4c3d
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.bin.gz) = 8f057cc764ab0cc64689c2df8652f9db24e20004
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.bin.gz) = 537b67fb3baf1f5363dec0079a7bf64c0ed7d5ec9b2a383362ca04ce3f746011798d12fe10ff6e4a77ccde35aa66e8cb06e689dcd7f19b5233999ffd7a2f817b
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.bin.gz) = 3119fe0017084fdb8a97ba14a7f6258450c6b938
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.bin.gz) = 755aa54a7e8e2091f3f3e7c37f34f45c
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.gz) = f133ab0dedf14635b824f7a0a7d55451933e23be
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.gz) = 56d8d397af893debd28cf4283759213f8c3171647fb4df80b570991792d2addf4473d5ac0ac8a4e4dc4a668035ee37d3331cc3b6d5e029876760d4a6e0aab459
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.gz) = 59b03c3a53d5b54cef8240612a803d1ea61486f9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.gz) = 9e800486bef03915eec15ca90ea163fe
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.srec.gz) = 18f4bd985378baf25a9e28ffeaf95423b4bf85c7
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.srec.gz) = 9a535fc733582c7e8b59784c117f6714a96a1be2e9f65be2074731532511458a97b344359992de681bd7d7980c63dcbe98e7cef4bd58cd4cd3a313cefe822814
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.srec.gz) = 0e3554f0de32a39d19c1e674084e6b42f7ddfde8
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ADI_BRH.srec.gz) = 22db840fa81c95919f08d2cb7ef81450
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.bin.gz) = 5e3cd42ec6e6af1203ea8921eb1979183164c8b4
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.bin.gz) = 21cc95b8e28d50eab2b20e5eda315781ba95c34a4e4f8d1c5907ddd81ed4b236dd100b3bdb957456e3a713211f5de11a0f55cc6516a58dab3d7212b23de95120
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.bin.gz) = 5a1f1e22d7a29bf8205c1a3550fd78d2cdbe1d38
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.bin.gz) = 61edb94110b4be5c9d8bc9ee660dbd41
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.gz) = 19c96d4bf28919a4f30e55838b0859e197d0759f
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.gz) = 823dd6b45920bae6c2817091c106af7d7fd4ffc965f64c68da520fcdd70b8bd341765d33f1adf06574baaa79395a501b58aa64b8b83628209f3a08560b90c0d5
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.gz) = 30566487cbea824734bd4d9061f5a9df30875b07
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.gz) = b35c13395ed69e7931eefff8e42f1198
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.srec.gz) = a7d4841b78d684f17658819d150d7d16b135786c
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.srec.gz) = e196c13406146baa4b8d923b4406d8e3b2a451a7cfb174a4c652b8a702b0d619d30705bc998acbe8a037fca1c8f2fda53aee9ce8d4a52722cb11c40bf1288f75
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.srec.gz) = 78cd23cb694a0062858e5e3bb2959d794176c2db
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-CP3100.srec.gz) = b4e62ffbd5091a667a7fb61c31ff578e
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GEMINI.bin.gz) = 6f6bf5de9d82b058100eb089aca61b9bd59aaf61
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GEMINI.bin.gz) = f91cf6eada8a84ce9c0036a4c0b22e550d71bf20fcb67d6b409d252e7db2c707aa104ae68a998cf87e98e8a47e3cda2cfa67f19c6792d3cf4f32bee59f3e2c48
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GEMINI.bin.gz) = b7ec88f6f6604e897b2450223e791758e1c278d9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GEMINI.bin.gz) = fb61d11fbdd49a4d826896bc45bad653
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GEMINI.gz) = d44a7af68b2dffe73d6a28a742a15a64ad1c7f17
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GEMINI.gz) = 244d5a9e1b36b7a18f77a1689d444375f733e4abe0a13047300b815633fe76af3bf595544078f89b1de302619e10f6d19245adeabd177fafeba93b7889dd34d8
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GEMINI.gz) = cad1e137c7d8bdb92221cb76679bee0ecb78f7a7
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GEMINI.gz) = d5a82888cc0477c064dc3ae9dfb29110
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GUMSTIX.bin.gz) = af321ff02cea6f05295ed48d63145f2557065034
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GUMSTIX.bin.gz) = 103b4e272b4ffd89e2705edcde9ecdff2d1b11bb4e4f6c46a2cfed6ea8bae9386bb357dda1fb04ca558f30d201171f2ec2aaae84b39b792715f142ab83772988
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GUMSTIX.bin.gz) = 69a190021189d71376d88493fbe9bceb5c1bb50a
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GUMSTIX.bin.gz) = cddd2da663644297ba2737081b26fab8
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GUMSTIX.gz) = b7ec166d07220620ec458e776df34ce0f954a861
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GUMSTIX.gz) = 8b38c79a2e2533d85733cc5dd176f808036e3d04f91134fab57110aa2c827f26487cbee563fe85cfb0facd6a463c7069d5d22aafe90c1803a8f0b7df2fe526fe
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GUMSTIX.gz) = d71b9dc8f5d59f8b126ce83dc06df5f97a009195
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-GUMSTIX.gz) = a8fe08eb1fd48f4870f1f736c4a72cb0
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-HDL_G.bin.gz) = 33e9946d8fc4834f9c74647b322a79425d3d6c52
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-HDL_G.bin.gz) = 354db08b656e913a0803051b861cc77d90c3c7e170362488c9940c3d0dae047e7a9d92fec348f92d951ea4093196b9f0b210d9d0cf04b9d842494c45b6feda5f
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-HDL_G.bin.gz) = 393631ffd8b30a1e3dd5ecccbf950bb1a75759a3
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-HDL_G.bin.gz) = e650bd0cf7ad90361db3a5cd788553e9
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-HDL_G.gz) = eeccc5e10b4cc5b8900e9dca97222f0329c5ee67
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-HDL_G.gz) = 3ef842acc43f885398224dfb7c696d2334aecce84aecf7ea11d9464332e62fb796b45b302a097fd3a1ec4fe48ea92a029a8301f9d97899a51cea19c3524e39cb
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-HDL_G.gz) = b402a5e445815908643d27c5b69b7e055f2487ed
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-HDL_G.gz) = a74d0d8c03f2d840e118654bada47b03
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SHEEVAPLUG.gz) = 9380dcaafde1fc16b90858e04d0804b159a18b6a
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SHEEVAPLUG.gz) = 20e027261b82d2188342fc3e10bdf1c2531c9012b4c0a5fea9d480c70bf00f118f0a0487646f541a63422d1acddf4abaabb34ea0a9161bb8f429708fedd18e63
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SHEEVAPLUG.gz) = 23e93e206ce3d710bdb9f4e57c342aaac073ff70
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SHEEVAPLUG.gz) = 2101cfda9d3ee129a2768bab982c7d4d
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-RPI.gz) = 1558752bbd6b362decdd3caef1d05b8c80dcf43b
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-RPI.gz) = 15dedb25bd8759aa736fd0ce444c4c782a65ec6cdd64e3fe424e1665d3e937df88b375dae773dda973a66264b90e10d0aa89e03cc217a8afbf4d79a23cce635e
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-RPI.gz) = e64628b2e9cc699bb0a48172cc4422e9e50a624b
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-RPI.gz) = 2224734e36d6bc4a139efdad6cc86978
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.gz) = 2c4862e6fdd14328dee5191b7e007fd7f2e626e3
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.gz) = 259b9964b3d10a4b49a413ad6355c16960a538b02f19bf4c0e07fcfc51699ba9df0a0b6342e6f67b9366302026bade0bf46a53356dfe42342e06f6fcbaf64dcb
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.gz) = afcc94417f4da4b84269420db2b0952565bbee93
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.gz) = 6010c0404590c4264ff824a9a57c0e04
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.srec.gz) = 0226f405675defd77c9dcdda8916e5b372cd206d
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.srec.gz) = 0213a4b6784f018154bc11a148fcd6eec14ab26bc7b714d087c845db361776a6d37ff11aab7b1c1218e7a143e7fb12a85fff77f93d97832fa12d4ac39764691c
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.srec.gz) = c5132bac29060129efd95b4d9beb4eee87e0b6a8
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-INTEGRATOR.srec.gz) = d176d5afd6c40c0cbfd4f64a19e39a25
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.bin.gz) = d105689d85a45fc834acd60c920d1420782e47ed
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.bin.gz) = bbe9fdeebed0c150622bd216013971c27646a4496f4ba64a8dcb0748e91c402a03441a0ee7b78341107f4d92f81771f41299b52d4142c6fd93e345f46a9319d8
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.bin.gz) = ee05e9b64e9039aaee667dfdd71934a2b029b22a
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.bin.gz) = 993d3e5e2595d0da326ec142a45b2750
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.gz) = 7bacc9ecbca2a680a72fa9d71d0f622302fd94ec
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.gz) = f12ed4db4fae72630b905b3edd5f6eaa87f84db7a13d908559f7c1bab054054440dedf6806b8ae6ce873bb09bf2a4cf69d89529f21abbc476ac50274d9a71741
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.gz) = 360190a9de654cf05c1aa9a6edc908079fa2c237
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.gz) = 73b8043c242bb9739d216f3f8da7d3a5
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.srec.gz) = 2c976175ede9683b8a8ec5b8c3711df84001300b
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.srec.gz) = c683332d8fb46e88dd0dc5d9b56a4fa942fe9cc7cb79a005ce59609caa9d357d7dc5126feae3b181f63009980a9bf1700130d086b7b7103a8ac199c2a25090dc
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.srec.gz) = a1cde3a2841db820d89ffaa32232ce83fd5f44f9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80310.srec.gz) = 811e47b38fb8e8c1c7f228f0bbab9a74
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.bin.gz) = 862eb1a7ee9de8e3b3525e7d7d26d2cc5ba9bc59
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.bin.gz) = 884b2229b6a78748f61fdba23fe88a623a05c974d71e711821d902fea63e258fea523b9d9c1044ce5afd1d941a2e73d09649a6abc6d38ba0c263bbb4700dcfc1
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.bin.gz) = f3c4d5b5ec632c62410643b9e12960a40b2074ab
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.bin.gz) = 31e7f8b3e40c22ade7cc22d01d95b532
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.gz) = a60ac00d16384a828eef8a837fb21e00b53a8a4a
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.gz) = 54bceeae1a8b27e59a3767284017552f717cefafc71e68b6c74a40429131709ecfd79726737d2dbaefc30e70d09fdab893e4651d125c85f10d9017b1c9e1db7d
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.gz) = f5ce2ac5312c8fecbd072965df9bc2eb0c340d5b
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.gz) = dc8d921c26170e31f92bf29b1ce1a183
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.srec.gz) = 6fc69281083cfff4fa9fe78ab260619b92972167
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.srec.gz) = aaacf4b2b3f5ac015eddf58f6e5757c061b94ad57b8dc850cd5285fa4e111aaacfa2dbc0c9cc3b4e7a866a2fe2b55b900a33fed48e8587b50c6dede0dc66cd9f
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.srec.gz) = d63585bed43debdbb05df1eb44130fc50e2edfb9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IQ80321.srec.gz) = db12176962530274584befedc2794d71
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IXM1200.gz) = cbf69533e9704756eed91dc42ab880300452cbf2
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IXM1200.gz) = 104cbab6498100ebf4e91b89055568f8e770f33abf331787d061ad000c506caf54ca9cd9afe2d6c16b6874502e10e3b20c0fdb97607f18d2ffb59718b2df62c8
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IXM1200.gz) = 24af829fe0a4c696a78dc11eeb9a6830c1faded6
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-IXM1200.gz) = e3634e55cff56a10538e3139c4eaf83a
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.bin.gz) = 3921a70d245903a0c95e4944b835f8b05326278d
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.bin.gz) = 49bf1c9de5e10f21603f8eb6a45b7ae29bda1fa9ba8fd4b0c2a07e498af6bfc818be5d59e384ae3afbe6a0aa8000ea494f2a431067d5f32e553d09c4346b488a
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.bin.gz) = 506b209365f4650bf205b3c989504665e6a464da
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.bin.gz) = 4d00574f0fccd038ce96a75e40119f54
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.gz) = ac288980ec3e5615d33d18bbb5b20b863b64d4e5
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.gz) = c96f2aac73d0e62c35d76c6a467f5b3b4ecd8461504a0ebbba456868f5ac1a42b6ff7c80aa2717bdeea242d79b940cd3584184da0fe8a07a79e2ac2f7bdc96bc
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.gz) = 02fd101de84eb4c6aa40bfa7cc477305246a7610
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.gz) = d4f8e1de25f4050d4b357cc9222799a6
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.srec.gz) = 10bb46c7b4e78af1cf9978c76759694a10f5b2b5
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.srec.gz) = 75b010e6766552928518ebda6daca8a979dd9a2168e932621c63271607c48ced148b11ed29cb14a11a1905f4a30a3613a63a41a5743b5857b346501b5516c3b0
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.srec.gz) = c18f791fe071f039783b42800302d62d407245fe
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MINI2440.srec.gz) = a749256c48d3b8ac02d6ddca5fc669bc
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MV2120.bin.gz) = 5f240a5493136d85a3b3ce856856a5781873834a
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MV2120.bin.gz) = 19b95311ee9fe25d64d8eff569a02b68672348a1c7372bb99f9f07421e390ccaa0e1a3c65b6d8a67baae1b34859b5ae2ae0d1471c4c1bce0f249765ee085dd03
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MV2120.bin.gz) = b0536ea2075ddf15ba68cd3597aca512d25404c5
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MV2120.bin.gz) = 0174a07da16cafc0426a75dd4c9affbc
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MV2120.gz) = f59146a75e366ba624eaf77f9582cd7200f56530
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MV2120.gz) = d68a8a5c29cbcab54673232481a17bb901d64d15de7df630c1657494cb70494436a0763a38ab31b12e3f273c8e8404f8515d29f2f290c99d25372d46763ab6ec
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MV2120.gz) = 2cf27b32a9bfd684b5f4013c9d25b8837aab0a08
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-MV2120.gz) = f623986c6286c02be5144d832c0fd3c2
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.bin.gz) = dc5760fca180affcb51da10f190dffbfd1b56cd1
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.bin.gz) = 56d1f1d5cf1faecbd845eb2a4a8fb88ac6d54808c87a6b39c70249231a532c7b7d858d5d89981f5feb726d93bfab384c6e5b8697a020e1c7ab495c13a5580e6f
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.bin.gz) = 9be387154227f881c0ed38529c7a7a6916a59433
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.bin.gz) = 338ce4a5cb70414c375f3ef8cc9385d6
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SHEEVAPLUG.bin.gz) = 9d9cab4789700632fb90b593893a81015b51f619
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SHEEVAPLUG.bin.gz) = b1632b6bf5b3e6ebe3b8f311d8de3218e42e40bfabeabb2ddfd99285b31a0451e4ee4267d0dfbae1618c023b52bbeea5b76aea7162d4bf108f74538b5aa535b3
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SHEEVAPLUG.bin.gz) = b6861bc0a0266cf68f5d91e6e3fb8c7da61690c5
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SHEEVAPLUG.bin.gz) = 9da615e9589e8b82d9a7e30c680d87d1
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.bin.gz) = c7ed735255266257fb135c4abc2187199970ad3c
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.bin.gz) = fac2299142fe0f8b45f7a433b756d1e48e66940155cf5dd53bfd6bd2827d66fbf43c08306a0cf5d69e25ece03253ce5f806498cc925786d55973f95bc6079c7f
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.bin.gz) = c3a03ab1bcd188d70b889c6384417025abe0f459
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.bin.gz) = bc3474cddb53421b463c1172621fd278
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.gz) = 0b08bd196892dff6fc1997afb9110e3f756f3124
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.gz) = 77b0d553364442904b9b08a3db76c70a7306b23b1b9f71a495eac9b294165da023d9ded9f8ee86f6e0ef336b514d83461cefc63885f754d4f6e03ea208842326
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.gz) = c0be26eb32c1d60435e1fea7521fee95660772fb
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.gz) = 79e74c16602e752a034f0d93be2ca62b
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.srec.gz) = ecffff46a8c528208595aa47d6739be05f4be815
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.srec.gz) = 532657ee54b385c79c7ef9768044d4d4012f16f54eb0fba2b743cadd66bc8288b00fac818503faf00db6f28a54f2bf51c7bc7f6ae8d5562e84a60149af119e63
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.srec.gz) = 749c2ad2c37bc095893a6ae9bf2b614af1effeb6
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2410.srec.gz) = bfebb327393531018e6b9f6e66738805
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.bin.gz) = cbc1ebd6e56937148dae2c2d968add4d8b3df600
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.bin.gz) = 463210825ff997e4cb1a7dcb36ed0d0f352ce8ab72ce55fdadfdb03f38d18fd524452fc2129942cf78d2911bf7be4875df238a03f8108ce2708944ed8a9682f9
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.bin.gz) = de526c5e982f7173406cd0b2fffcea1dd4fc9a7e
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.bin.gz) = 9c8cdb5067ff1bee4fe4705cc1cfebad
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.gz) = feeb3ef6e66284fa727a9feb4f3d7c45fedd0ca6
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.gz) = 9ec41f1cbabe0c960134267ec18fe6f1c5d8062489735a85bd3b1b8d9ee2acbbbe5f32c8e8e416ba3bdd55e563dc25c8224500702bbc5038e7bc5f91be5fed05
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.gz) = d03357b46454c1ffef1b1e3524c8b56a61336a06
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.gz) = 39dfa81264cd40fa3e0baf2db3f2fb8f
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.srec.gz) = e7908babcfe4f8e9400a83351028545d87c111d1
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.srec.gz) = 3e13a586fde15f0fff6be7719975eb9f2fb1c4778de5a19b30b208b050e2b8549de137c5820b0c233af3bb32d4b0dcbcb7d50d4012c6418146c78358f11ad194
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.srec.gz) = d8a910ca9c3b14abb626d94cce73ffee1d951258
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-SMDK2800.srec.gz) = 43252ffe4ce1a12b526af0b37aa7a2c2
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.bin.gz) = 1eaa16791cd37e16ece1fd2a3f84a9f1b744de4a
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.bin.gz) = c12fe5137c903af5a4291fa06d95408e1a554ff70834036766a971693edb8164dbfecd8783ced92f548a42eb354da31e658e6ea3b347cb41d7551a85ff14b441
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.bin.gz) = a630baa7e17c1dd8e67f5d925fcfa782301efd09
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.bin.gz) = 8bf004134779adbfd47e710810cd541d
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.gz) = 8f750421edb291b7231b9ebb2df970f5da937ba5
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.gz) = fbd4cc574e78cbbdd68754790777507f8b6b6288e05cb5261423f21545ff0825c9be03bc1ec663bf6a5552ac6686cff980ed1f2e4716a4690132058107a6fcf3
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.gz) = dc315d5e0fb0cadb02954e75fb78670244ad1878
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.gz) = a0a2a1a1e5fa5e566b076fd1925f5a0b
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.srec.gz) = 27a486313bf959dbdc89279b8da39ecb7ebf7e6d
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.srec.gz) = 4dca299d4f9a90a2bffe3ffea6b5262e6cd248b9abae0fbd838e6bd83502fd573428952180f2dbd77284907fd7b1ffd1ef0c7524897dce49ab05c8c3aeec3aa3
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.srec.gz) = e06dcfeb9376bb44f0444e71afd03c51754ad533
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TEAMASA_NPWR.srec.gz) = 0478aad2e41f791604d7d9e33efc16c1
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TISDP2420.bin.gz) = a9c56c83c032a539bf23ac6250412bdd71a996a8
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TISDP2420.bin.gz) = d61d6f3e0a937039f13182d03ef1bbce0ff4f04a0b59e60096fbffd34f810d8e254d8e42b456a2be03bd84ce127cbe40e12c7864c85e4bf963ec9761ae322b9c
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TISDP2420.bin.gz) = fdcb7c9bf1b49107c95e7c0731a6ca97922dfceb
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TISDP2420.bin.gz) = 23acbd88065f394218ead9a00dbc6daa
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TISDP2420.gz) = 2d4f5baf51625ecb75fc4d043d248ea326c13102
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TISDP2420.gz) = 2bb556b33c74bc49b82693a4b66437498f7630709923aa54ae0cfbb0af50f5d28db62d062eb234e6c5b33bfb081490e9cbd687a899fece106756c79abe325a85
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TISDP2420.gz) = 84c7b73fd2c20914727a86e8aeeecba0e3b54ce9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TISDP2420.gz) = c1ef3736981fd98a6f6636a8785066ed
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TS7200.bin.gz) = 80dea7855e77c34fa5a6df8fb657f23b02777a71
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TS7200.bin.gz) = 673533b24668f44c09364ddb22f1fe3e058b5aacb2c544b0fe2c70eba9823e8aefcddcd02f6df8fabd74b5283e585b30ae33501e02b7edb7bc05cadcf8deaf07
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TS7200.bin.gz) = ba834fcc21f7b5210f10388a209172e2a1554944
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TS7200.bin.gz) = 6228219fac300e28fee657b3d640d2cb
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TS7200.gz) = 5d321821199ef390140e42f5de3aadbef178ec7d
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TS7200.gz) = e5c98ca85a4a926860f11a84abbfeadbfdf2ded1f7ba8fe4f852e48188c16878016f66bd79585eef8d8cf1afa28be748ca144cddb742029c27b97051224fd41c
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TS7200.gz) = ce45d65a2eeb0e8b3af0ce02b09a1dfeeea56d3e
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TS7200.gz) = 9b77d5ea8b37b0550d4610e53bcce56b
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TWINTAIL.bin.gz) = cc608ec28ab6439d45fdcaceb2608d00b20f5739
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TWINTAIL.bin.gz) = 18d2c25112a185bf5b7e23a7c30ebd183a29f16cbc79e11327fb086efd8f04faaa1fdee8ecfda8de6e437eea0ef79f788ee89d4388aa37fbc88331ba3a8cfd4b
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TWINTAIL.bin.gz) = 85e82f3918141510d0f3b9741fb10e15616d38c8
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TWINTAIL.bin.gz) = 62e6180d8bc9b2ed8ffd209115083506
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TWINTAIL.gz) = 784f311793c86ea06397c5e35f93833f1711c92e
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TWINTAIL.gz) = 3d481b051578603414849bf1e43bc84cca28049991640d3c41af3bf1f223623e46200c872cb29e3f98ad2bfcad5c377c1b489f074ac390f4ac9a04b4260e8c77
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TWINTAIL.gz) = 17e6e1253799aac23cb810aa24e81c060115d311
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-TWINTAIL.gz) = 823ed2d54f115836527299f9542b1531
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-epe0-TS7200.bin.gz) = 0d27b6fb7baf68c25f5e37005c6864cb82e075e2
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-epe0-TS7200.bin.gz) = 70d04bcb2896f6e27c0278189d57549f9c3a286e43a827a704255487095123fb61b00b155750fd007491e42f5498d4fb207e9ff40d32354d1bb8b4adea67db1b
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-epe0-TS7200.bin.gz) = e2850dff5c5d6a2dcb975ed69d9cdc3dab59304f
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-epe0-TS7200.bin.gz) = 1b5cd32ef196ccff17b3a3bfc3a790f1
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-epe0-TS7200.gz) = 2778315d331ffc62b829685c27668514472f3e19
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-epe0-TS7200.gz) = 1fb7e68c7599c6174abce47d01c5376bd37e966342c5b377e0375e050200737f507c34e76653377a787bd9ea11ce526c0e52fa01009d10ccb4e124b77f59ac33
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-epe0-TS7200.gz) = 08efa696270c86ab0b2ccecec2f65fd0f6ed07e4
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-epe0-TS7200.gz) = 103a3dadd04cf056386a2b7bbd0d666e
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.bin.gz) = 11f132f4c6e60f09f84e8cc536c38d125336373e
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.bin.gz) = 0a6442acb206b96f9450a80a1a02f5420fea62d96464695490a5efdd63b11c30ab38e2ba270fbb4125386a5b3bf452ae44427f75fb5dd675202e862301cf28ca
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.bin.gz) = 14a2ee2c2477084bd47369e3ab5bff9ec5163a2a
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.bin.gz) = 13646782aa47578a9ad12f7c07907633
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.gz) = 41474e92c5c2634a3ea25bba4510dffc8d2e399d
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.gz) = 269cfa9fdab9f28e0931d20e6ff68284ef6e578d11c1c2b23fb272d9e82b12b19fddec101e24032b479c15ce8042efd2265678cf7a3e951e6b2429deb2de2b11
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.gz) = b080ed55c674ec69554713838ef050eba2a195a9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.gz) = 37ec6bc374177e34ac79e774e15cc679
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.srec.gz) = 98d97a466e67c472d2b778cabb6ff6196b379079
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.srec.gz) = 8ea14e0483850adef7d6bc614527739e9f3d1880a03522ca6d7c3df1e38222200983ff4fca413b9aa2c2e6d90efd5170aa7b43be8ea68eb9c8cb8f024c9954f4
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.srec.gz) = b88e4587b48064fc6719bf3e776bc3163efad390
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-ADI_BRH.srec.gz) = 5b59dd3b2796db425638472b47970280
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.srec.gz) = 77140597384a41679467c0cb3814f4524f5a7fbf
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.srec.gz) = 104d1a827d7a622c77139c4a5f6f36a205d708ffa3f3b438ba139981aaca00342288fca6adc82f00603d0210e05e9187fd4fabe3a79b3ab0baa5899a72ce6253
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.srec.gz) = 3c1e9ccfe1c9df8c07976c82348191273a09024e
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.srec.gz) = 4a503d1c30776dc77a7dc3ba3e160f37
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.gz) = f74be1c541128bf2c1bc8992058df64b48d1fb97
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.gz) = cf97c8ab92e45baf4fe64c2d5722391cc35569c035143371cdb746c9a3704954a06fc336c50af51f9f0b198a5e05d6e7e3a3e5b5257ed214489fc124525b8104
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.gz) = fd503fa3df024d8aa2397a060e986074453d8ed4
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-INTEGRATOR.gz) = 240f52b880f6c81b4e67314404fc5a97
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.gz) = 55a7ccaf693a8f72322bd4e898b4ecae4a8e0c80
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.gz) = fd40bcb076b661407034b45baf50731dfcdd9ff9f78b4768b0c300fc6e0187204fba1e9491c8ced8a12e77070a3f599608d7c2c649222a142efd0b799e414499
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.gz) = 6e69674afd923ffa4e320a7c1cdde0224959b3ad
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.gz) = f783d0328ed41dac449058e80fa81dde
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.bin.gz) = cd7ca6c6ba8134af29a1cb3c4db19e80753b5cda
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.bin.gz) = f1b0bcc810fa29ddd4102477ea422457aca2e037964a284f1eab1b2e31c4c408c5d495eb489c7b4b5c2c578998a9643f68e8577670b9b04e177b5147dc6b17dc
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.bin.gz) = 2e7c3d70ad38408b2e24ef3a6e3a5c22c8724706
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.bin.gz) = 693dfec6cb311df0ba890e55c610121e
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.gz) = a5ed3ef72be67e59c81f1701c630e420c19df6c1
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.gz) = b9b4dfb8d4aaabaf3346d5af652fb4d79b15c8ea43eba94bf3ee3b0a9f05bd129a050ede2b4c127f14c3df1149f7a9f965499d09a55640eae83151c42f054dcc
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.gz) = 12ea272d03d51081eee0ab7858e05bd77c21a86d
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.gz) = 114b5ae7efcf519aa2f969e827ef03a8
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.srec.gz) = 01d52551442d858c9e8b9404311a0c3e421083a5
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.srec.gz) = f74951ab8e5b2445643c046bee3d34c67310399a84db9b0c2e1c3fb7f460eb1d863f520c6703f51f270d6cd1bdd8ed0569bd32fda709e6f62a4ec9a8088418be
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.srec.gz) = 9baca8969db5db172716ad6b6e9154c42c0816ec
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-fxp0-IQ80310.srec.gz) = 60528f9ba917f0412d4c9026c58dba5e
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-mvgbe0-MV2120.bin.gz) = 1d0c2b24a143a451f4ea9e11f4580e45ecab2237
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-mvgbe0-MV2120.bin.gz) = 367845db7dac4bb80eab23acb6d40c193ac2c53239deca54acca2adc5c1161240755bc9dbf9ea4082b48b83eea70f4b01909c46f26f4221df8af74cf64524cd5
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-mvgbe0-MV2120.bin.gz) = 5bb353dba0b6a32a0916359fdaa5b06a260de51c
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-mvgbe0-MV2120.bin.gz) = 56c549b0fe6d221922b59b7ae00c6ca6
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-mvgbe0-MV2120.gz) = 72017ac40eb0de30cee8ffc340e9bb7f33cc40bc
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-mvgbe0-MV2120.gz) = 836362bfbeb34fc0040b9a3492012e1dbea1cf8c1b7bc6afa45c59e784caa1d07be1b829d10e807d1701d71d6350a3d1a5e63ff71d85cb3c37fe8b9b4f65c47f
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-mvgbe0-MV2120.gz) = d74682aaee589c7ca089a49bbaa6029175d13c3c
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-mvgbe0-MV2120.gz) = 6712477894ae747784d281b4ea595131
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ne0-TWINTAIL.bin.gz) = 0044ec7b51299209fe8a15443aace1984350d1c3
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ne0-TWINTAIL.bin.gz) = becc7276686635e6b10b03d8374f1a24526066692cdfcc72d556ce07a0a06ac44144ed011451b4542105211d9a9d0b24f408d193a932bf161a52cebcb49a6e06
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ne0-TWINTAIL.bin.gz) = 35e63f0805242303ded144ee50f429ed6b165797
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ne0-TWINTAIL.bin.gz) = 56670b2148acf612495ae5a30662bedb
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ne0-TWINTAIL.gz) = 3e68e8b0d100356489f0a5b027c19139ef9e97ea
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ne0-TWINTAIL.gz) = 6e87c01ae9a15702a15b2d6eb36a7a4ddaccd3ae0ff9188b3aca9f3c48207443829e2b57cbdbbb01b958cec1f8416e326547380928c928d0fe67a66adff9d2d9
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ne0-TWINTAIL.gz) = 50496c450bc32fd7da2e16674eff08df7e3ffbc9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-ne0-TWINTAIL.gz) = 2d40cabe8960a91cb7b995cac28c016c
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.bin.gz) = 4fce330a36c78eb1de452bc0df57a84b5df02ddd
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.bin.gz) = d021074a1083f3cdf55ac1a1ef9a1e93268b418e36c01bc3a401d52d418f8402c19cba1c06a380c86c0b9f5f552cdf7cafeea19b2f03dfd46aad733ac7095479
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.bin.gz) = b573e7bcafe3e1d1fc25aa34177b9c5d845095f9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.bin.gz) = 5035eae6a7bdbf82b39960661bbc1548
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.gz) = 3e5e3eaa9d205254d39746b8cc9c4291fc1a8aae
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.gz) = c454baa740a1e8e7e16c027ca4da512731a8cee8d265bd7ca7110fecb1019cff0e5b0db423aface71e0228639c4a7465108bf3fe69b9d711bd5f5113c4a0a6b3
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.gz) = 1aa0d312767044b044041a1d9431b7d4b4841bef
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.gz) = ccc8b7e6d1627a24e5ee493d3d769681
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.srec.gz) = 9e3be145e73c346fc467de425aa5ae84c8e86dcb
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.srec.gz) = c7f1566fa1665b6f81a36e0c4f7e00f1ccb08af73698d5d938fc26770c65f5485da4c106cde8aa8518fc312208c58182e4a9e6bd92f2cf6c3b7ffd0c822e8fe8
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.srec.gz) = 5446c67277640bac0811d35a413b2c9747d2f1f6
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-ADI_BRH.srec.gz) = 9072dfcce2a2736faeff274a61d6b378
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.bin.gz) = a8aa9bf7afaf2468e38fd8f9f3e2fbf1957c47e6
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.bin.gz) = c40af33b0a32888b18dc3e05cb747269ccdeb38f7fea3457be91688e44ee256754d8b31489b9cb6495af63bdfc6a6ea16a6f800b70f5f567d85130ca50ead974
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.bin.gz) = b0b41be5da00dd6a4c84277bfe39975a4cfe31a0
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.bin.gz) = b63766732a4710924581351a1778f71f
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.gz) = 6a53fe270036359318eb84b30bfd04f089cc6e6e
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.gz) = 8c61a2d1a08ae6c889304a8a1335d0b40d092f4f7a1ebc0a14fb721efe1d56fa7c3c3a43c65249754f0bd1baacae5f16a6ff497c6146c6c1fb805aeb14d07f65
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.gz) = 1de7507b9869a86de2468c9200d728f6a379148d
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.gz) = d878c13f9a7706e55848df3b09563620
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.srec.gz) = 4a762c7e63648a321e727cff47e99a01570ed1ee
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.srec.gz) = 19e1b9284fe2a46a5952c379400bb1d74117b3b8d2aea91e6820c1356f4e6761add87d462ec0a14a545534d1e17f211e505f539ff681f39eafa10b0893b13038
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.srec.gz) = f4b31cb80b5da3de1ab654f7287e544ca9e761cf
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-CP3100.srec.gz) = aa4640c78d3499c1bd1b6ade6b5564df
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.bin.gz) = d297e9f63876e259acadf43d735d26c70648cfea
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.bin.gz) = bba032dbe3a47aa40f45e232a06c38edf352515983e9896b56a28510fc031edb12a3b462ea799bcbe5e3dd2ca7585729c40e8203a02347aaf27f367ebc027cf8
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.bin.gz) = 3c2d8df7cda72b357e291b47454859098d5a71b5
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.bin.gz) = 2cb06ddf778f331df715f39fe0443219
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.gz) = 0ed7595924e6d03491d2bd7d32d42d00f96a3834
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.gz) = 0e33713d7943731f3430b74e4a72cb98ace2878790ad7dc2d185f0e8a825c2a9db9c3194418bf91ebb30c4f87659d1de36706b57349a38d85e584456071d2d84
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.gz) = fef4dbb06bdf1299ffd2719ef5c147f51704ae0d
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.gz) = 142bf1b95c4e72d91063e29379b858a5
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.srec.gz) = 4a12c83305d58e03cd8c49f05cc6b32660939700
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.srec.gz) = c7e132403f37ca9514a8bcd8c8a94de04fb63a2319b1510db5ce9f14d60ff45778228e4c6d9ca5b042bd16ea26396e035a31f948908bbff152a7bf9529b3854a
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.srec.gz) = 306ccfdb478dae1136303199e84f54f1e65a63f9
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-INTEGRATOR.srec.gz) = 4805ccd3adcb1ff438b7c4d900416284
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.bin.gz) = f3f8c21960efb2c67418c29fef978e98b472a813
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.bin.gz) = 7b37f0c129e92372d4f170ab4106c2bcbdce9628c03a22ee1a265ee73263e78e3befbb712ea1f241b2e2b0e0b54bca3a9b3f7628927a18ee28551e867e526bf0
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.bin.gz) = 237204cf97f62dbb37ec28d9a12158f3d7ec01ef
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.bin.gz) = ed5f31fe08e40a01da35e68a8ce24da5
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.gz) = 2aee3ee787581f73d3e667aaa72e5211a316db75
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.gz) = 6a131f56fb801174037294c32a30244a500fa4bcacfccc65b2e1904b63450cd0ef0656dfadb4eaf1db651b8378070b97a93ab2df053641324c345766b4b043ae
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.gz) = f4a9d9ec37f3a9bb98055681735399a914673fb4
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.gz) = 25bbb323800e83e721976fcf4b5d42c1
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.srec.gz) = 766410442e0892a471e2dd4420209f6974ef16ca
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.srec.gz) = ce977a4a9c87431fc57805ee22efe908bb79a344c6a1d2f3c75b974db3b54626908fd25e524a4ed3f55327877c97f78e9496515fd6c4677fd98b3c273ccf1c2e
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.srec.gz) = 093855469bff467f4744c3bf678d55d9eb08b951
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80310.srec.gz) = fead543e57b7c2f2a458d451b6c59f08
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.bin.gz) = 257ee7c14d678bfbe2511fbd47d72f6c8c461752
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.bin.gz) = db6a78dd47b3298d8f66fedb46e00b6c269e3ea389aa276480c947f606690002c95e7cc2306fe7f243117da3894ca7f7ce9b3bbc12e2cbed4d17b0ece02dddec
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.bin.gz) = 542ae9874a3223e014f50d542c9a677d0a0efdf1
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.bin.gz) = a70cbdb6278eab864d1bf3b288c3392b
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.srec.gz) = 697561a2e82361d2d92775821ea4cd03e163c217
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.srec.gz) = c1959211704f091e865ee26560496424974c0dc3ad3085df21fe51b21c95a56d7f024f833728f9748b02f4ef409a24454ae731d071764921b0fe57df38a3ed3d
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.srec.gz) = 7d95cff40a30f44d91013c8bf2e13a540470e5cd
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-IQ80321.srec.gz) = 7cb2d5067df40372c016211fee729a1c
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.bin.gz) = dc0f06b24ab21f8188a4e3f0321246acf541854c
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.bin.gz) = 13a84014dbb366e32bd715279e46c67a00f09cd40eacdc0fa91cd0e8a7e3e4862110161ca56be8024d3a0cd14f2a17c539111b366e91a27c65c5c47a741dc4e2
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.bin.gz) = 79967e4ee6c3b5038007f8deb9b6ec9172bcd4dd
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.bin.gz) = c5caa593ac363dd9dbf8f44de4c06099
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.gz) = 6f5c0d944bdcf0b3dfa76f60e6b5035dedc94c00
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.gz) = cd56585b5fd7a8d4c15453966942d48c538004a142daf8b0f30d26637e82e0483dba20680a303bd561341b0c35aa4a537f6a24764bd96ca8102fb018d57b22c4
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.gz) = f0c30e5955068a64ce24eb6d96793fd4cabebba5
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.gz) = de797d7956e6fd360b2f4028d05e7608
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.srec.gz) = 0689f7b9a0ff0140a28fdcce4d8cd206d566c680
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.srec.gz) = eafe6cf5e618cf43054145f925f154d99acaffc7eff8d4be2bb801de61c27193debb983412b45c4b14b5dc834633452f89c170a895078ccd31f00a5a0685661e
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.srec.gz) = b07d921cd736ac79d88e8f0e041db636c198faad
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sd0-TEAMASA_NPWR.srec.gz) = 146f7101d810d5b401dc3b320a2f89bc
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sm0-GUMSTIX.bin.gz) = 393c30bf2cdc7bd75e749dd8b2537bd77dc91a65
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sm0-GUMSTIX.bin.gz) = 44d1609a6be448f0df6d7f733a9fa544fdc673da11e0b64b66174a9889b4bd6c069c69a312853954c0c631eb036f37ce56beac486e347e600be01de6c9c3a73d
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sm0-GUMSTIX.bin.gz) = b7b4482aa76347a87722d9eb34662af96fe94e00
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sm0-GUMSTIX.bin.gz) = 6bc478629045ffcd392adc0f5c9d133a
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sm0-GUMSTIX.gz) = 1ae50b9a6c3554474481cfe3c37dc88bc29cc436
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sm0-GUMSTIX.gz) = c1827ec89039136799b21418e0df33992f4ee4c166c130c34865f22cab0601fde056078892a76075714bb3ff09dd1edc54f33464c0dd8854f303398b6357b09d
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sm0-GUMSTIX.gz) = 823391035b738182fdee19bfc807eb2f09573f1d
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-sm0-GUMSTIX.gz) = 46159d039abfeb7e9dc00177ba1f9271
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-smsh0-GUMSTIX.bin.gz) = c7bb680f57a438d65351ba2e665b0c98b979fb80
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-smsh0-GUMSTIX.bin.gz) = c8cc5ec9d35ef1c8bb0db010e358f331335fc69db09f67110a92eea46eb275950f2ea5cb4e9f88ea2ed80561a5e31d88ae6f76e5582c448f3df265dc6141be9a
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-smsh0-GUMSTIX.bin.gz) = cfa0506e9de7a97955bf05bb9d89275ae65bd77e
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-smsh0-GUMSTIX.bin.gz) = ed0673b11f604500c60263dd3dca3991
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-smsh0-GUMSTIX.gz) = 6a22b3a0b0baeb17201a15a1e46b6a1bc22345f5
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-smsh0-GUMSTIX.gz) = 1a44e1fc731b0099fc726ba2362c5967f0073ada7d036656d5f60df865217349b5304bf05c7699662f582ac2519f2db64ee774bfe58c1780824ad04c8ddc8390
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-smsh0-GUMSTIX.gz) = e5872e39e97e9a9e1d72da6d35d5a8013e168b59
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-smsh0-GUMSTIX.gz) = 2d76c6a78af5dbc9a1e5200819e53511
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.bin.gz) = 298b05e33ef85a4b937c2a5e84a48022e388d0f7
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.bin.gz) = 3d709cc48eee7fad9cd986542430e23a4b81c84e549d2f0f9210df57a38a9d36eb3abe1bc2ccf2c66d9ec84575bdc9c1b55981f3686de5ff857b55f86d9ab661
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.bin.gz) = c2d4ab46b1b90b55bc40c74d31f287487f781142
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.bin.gz) = 91e2b298632e8fa0ebebad32ef0df715
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.gz) = a63011e3f96507e9585442178de4c0e41338cf87
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.gz) = 76b99b424e4f8cc4f47b0ba7ed8b4679a5d49ea3a022a84d2cd74be396bc497f481fb3fa16e23deac876d5dcbfc9a29f745bb1672d2844fce15252db989c7677
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.gz) = 8cddff412a5b879ce5b17a5a22b09603ae9f9324
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.gz) = 85c7096f583e4f9f3841d7f663de4999
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.srec.gz) = 83cec666fdaa7fd2d5fb6de32461615839932cc6
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.srec.gz) = ec118ec8fba3c15ba1b6725a1b9778d14c4b4fc6f624d7979c281d6195271df3bbcc6668eaf0bb25b6089243c5d7b05e43ca6247e3d72a548abfff0f31f14f10
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.srec.gz) = 6741604d5336591c02e6a9fce7cd093f7e0703fb
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-ADI_BRH.srec.gz) = e98cf8ea7ce8704d98880ca519bde38f
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.bin.gz) = faaa399c0796bde9609425f73ebf4b7436516a09
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.bin.gz) = c61821bf159dca3ef32e69aff1f935a9de0228e5e0568afc74dfaa5e91902fdb0b13589e70af2871b3c7afbe2cc3777be64e9bf52798534addd6338ef6fb2095
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.bin.gz) = 081460e1657d3f542615c9b63d2bd8638d4f64bb
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.bin.gz) = f79d3833d46191e99e7617029c981cf8
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.gz) = e56e0fbbbe556a6741af58398b3d7d116f3ce469
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.gz) = ebdbee8f4ffed5e2ffbb7890a8e693299e441aa70aa5a7249f1b468373970bc29d2284d82bf638cbbc258ee8b500ba5b3244b83fedcff1e1465218d9fc76575c
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.gz) = 881461289bc9ee95132cd5997c19c3838aaa6c39
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.gz) = c5d42e48168ba69e065be3f44d2e2e09
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.srec.gz) = 1fb817599a91b10187301c3f2333dc6484451556
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.srec.gz) = 19f6d85d50d1fdd5fbabe1f60b67992acaa80e0afa44ab7d94f31e095592b7852f2c8f42227bd9d90de9698211085a69aa86d4076100711f96e59bd446317164
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.srec.gz) = bd13c2dec6d22ca3e1d245159b0e765ff03301bb
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-CP3100.srec.gz) = 916df9db9485676f33a5bfd017e4cd2a
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.bin.gz) = 2c81eb3878a53e36a554b1f4e91c5011ce4ba507
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.bin.gz) = 2aa85113e7bf69371c8027929857e4c35623f07a16db83bf1cd3824053776e0daf33ab8ddd2e954b938fc33424ea044101c6f9c6bd500a32b030f28ffe40049e
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.bin.gz) = 1e1187fd6a831f7e9dfc546280681b924c03b36e
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.bin.gz) = a767b383bfbe980c1da78e744144dbd3
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.gz) = e60bf72e33a1948bfdf1d84a209b1ab6e4ec6522
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.gz) = 9459f4a7532ac2d2890c538a3325c217d1ba468db8e8d4c7d2fae8e7a4ba256e0b0453e5757e1e2ecfffa5f1382d843289279d471562911d56215f2f3ee73eac
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.gz) = 95de4a223120d3c34a7862edb781345652904ffc
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.gz) = b7113d5899d418131a2d376711e32379
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.srec.gz) = cc193aac830dabd4793f1fb6722cadc6fed0bdd4
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.srec.gz) = 05a81920bb52518267ce4046aa79824a763dca9643146646bc6746d16dab1854140d28dabb5f7ba1ce9cfa1cea3a2e9d76df3bdcf227da89ea883011c464a579
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.srec.gz) = d458f2b8a4afddecde3bad093576b0b6a17b2f3f
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80310.srec.gz) = 9d205882f4befbe25707f009910f95b2
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.bin.gz) = 78884cf87f77551ec0e47bf3d629b41ca5a4420e
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.bin.gz) = 094252727a03ca3dce207c5c92959ba21a888bddf502d5a9ee9709bfbdf9eba5d60dae5793ca6ab5dacf720d475499710d70b36622b97c1449badc5ba85e82e1
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.bin.gz) = 4d7b190601413c8c89ed39d8dee44abbd388d8ad
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.bin.gz) = 6aed071b41867489457065cc3bddb0bb
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.gz) = 771add734839295eaeb51bb341d43cdeb64733b9
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.gz) = 1ad26279054ef65ab4c4c37ed2443087a04d530641cd005b7d02dba395bad6770270b6f4e5d9ee522fde9ffcf3e4842e704b4fac2896eff2e73db39cd4c7e96d
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.gz) = 578a063f106ea04a6e8133cfa3c0eb94b0decac3
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.gz) = bc6fd4df95278bf2e327a3b85a5528eb
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.srec.gz) = 1b77033ac9b0bba5b829868fc3a826cc2b8bfc3e
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.srec.gz) = f14f41fd0600a3502383ffcedc902975372ee3ac03ff8e5ff156e93230eb8572798b00a6049a1cbe6c09d53002a07d6242064068b030a8e588355c0c67508e4c
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.srec.gz) = 5360066de4b445f57064f767cd41c16d2104da1a
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-IQ80321.srec.gz) = c4197fe93de106e7b927570baa374dbc
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-TS7200.bin.gz) = 70a3d642aa8ea8d1a3e9df143a9e453aa1f6284b
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-TS7200.bin.gz) = 391ac58855b9c24a8dbf8baaab4e9b4efd956eddf343a0bdea8351e1469187798e36ea875d6f4d91b5ba2be0eba5b9b02f33a6eded8fe6d727d3703950d554d8
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-TS7200.bin.gz) = 7f860a8346d99c80a3cd48694244040d976283ef
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-TS7200.bin.gz) = 379072e809792e50b4015b9577360574
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-TS7200.gz) = 0616f7ca1f3ef9c60e4c34aa459b40fb72277025
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-TS7200.gz) = 8530ac25385210421ab23391925fee75ffd81e369c6b9773034e850519577ec69ba74493a22b08835ff847251ed16bbadc5e86c7956ae88c48e5bd2fff61417c
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-TS7200.gz) = 18dd6a88210d336fb61e3dcd0826fe50c8d13f94
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0-TS7200.gz) = 10be5c2ffaf39f29b3948473e78ea1a8
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0e-MV2120.bin.gz) = 3ca17c6882a1519488a77a45207f3ed8ea19fa23
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0e-MV2120.bin.gz) = bd41dc8a2e268be47c2900ee5564bbbcd2ad6635f7ab99ff059efb71c27c277cb9da8ebfc34eff5d17839f345867ab9d478d0d027e7980fff4fc3e7494b1ad4b
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0e-MV2120.bin.gz) = daeda9ae3e3cbbf3f5a7a7c6381d13a30070ccaa
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0e-MV2120.bin.gz) = 6eccdeef46d96a5ed0267484262bdee2
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0e-MV2120.gz) = 219f483fe3afb49cdefa8b1865cbbc69730090de
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0e-MV2120.gz) = 937fb99f921b629c1fbecbd60a4de24fe1c55ea70211b03ac15d2b20ae925122a6e3d3b43e34cc8ca6fa9b1d8a1f500ef29ea55f72b1a80a8f52ad43ed6fe1e1
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0e-MV2120.gz) = 437b6861a5f1288ea6553790feb1de02293ed3b4
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0e-MV2120.gz) = 4d05c9e5325526185f0db4a6a11edc92
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0f-MV2120.bin.gz) = a2d678ea1b57438872bb33f8e3f5ab311680ba55
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0f-MV2120.bin.gz) = adc42e2e13bdef6fc24f27cc4cff4363e0287350ba2afd7681e8f3f027865cd7f58e3e5d4fe59131870b34e8e6a8721a935adfb4930957525a24c02cd4c2ceb3
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0f-MV2120.bin.gz) = bc32af49bdcc8ae9226c97ae03f4306efb1b646e
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0f-MV2120.bin.gz) = 344ed7e1145103dd1f747176fa09a993
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0f-MV2120.gz) = 98a9af8c3b74a45940b587383545587a300274cf
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0f-MV2120.gz) = ef6b06092f0a9ada2774b3b172ed405d82f9fb3ea0c3c53c7da7d493f9c4fdd92124970af972342e3134852d9575a80c05f0ab22fcff70b52dfa4007b31c5a10
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0f-MV2120.gz) = 1558754fb8015e4564b65823fa61d74e7ee2758f
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0f-MV2120.gz) = 4c2d594388f5d5ada250a5e9137a2dd1
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0g-MV2120.bin.gz) = 655147b472960f9a2f0addaec681344d62344d52
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0g-MV2120.bin.gz) = 91448fa3831d263781cc4a54b9103ef3fe99f7f71d1b4d5f25ffdc049ad34e9ab84fd38e7703ec55f1875278dc94e808b984b6d6610a0a310b9cb633205a864b
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0g-MV2120.bin.gz) = d985973ac1155c6506fd2dc36208da2c89c1c010
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0g-MV2120.bin.gz) = def424287a7d6e0c9dc9878cb6af8d9b
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0g-MV2120.gz) = ecd70279e4ba36c40e8aa14b9d2705942e48e0de
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0g-MV2120.gz) = 1f4fad54a9a843e66fca15c0ab3de33388b5c94006a051eea03cb3078fce4a671aae802eeb94b410a47b4ea291c7bdac0100359fdd5405fdcc2b0d8db3aad9df
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0g-MV2120.gz) = 16f2789c94f147c86ee94427a2bb0cee353d91bf
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0g-MV2120.gz) = 9df82b31b91bceb714ebd8a7036eec8f
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0h-MV2120.gz) = 7f65f7ce1167b8b0bea66a821a28f8a328f960bc
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0h-MV2120.gz) = 7d98ecd33f11bfcdc1e89d02df391b5c7fb4d66bd66af2713913b9ad8a6de264fb18f64020f009e21f7fe7fadf6cfeadcf72b195be731c5365745d2119a22c08
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0h-MV2120.gz) = d84424851ce6a0cefd0881650870f5c902a50e37
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0h-MV2120.gz) = 2b7ec0cac876ff4758fdb4cfe7e32d7d
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0h-MV2120.bin.gz) = 92236b446b36023cd70765c10fa61fbe3bd2414f
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0h-MV2120.bin.gz) = 2882f6b905d11bd0019d4657586412e93c566abf48d10702af36ccac9f688886fbad3d8ef62c3342bb7ddbfaf72f2cf7510d6635f9388187bd7932c814aea288
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0h-MV2120.bin.gz) = 7bb29d6cd1f68788fdf3a98d198ca7d98e264c7b
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wd0h-MV2120.bin.gz) = a1d749d80636959956efface64861885
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.bin.gz) = b3937345ad5103a5331f8f3d9217f6c73b7a2e28
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.bin.gz) = 1ddce72f72e631cd8af38d326ff826ac52005cda9974dcf87c33370adf04f90e7a9025177948ef2ddf2f78e259c535bdd5ce2d9da2541f4ca4cc8d57a927afa6
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.bin.gz) = adeb55b34d1468ac0fa1ac03ddeb6d86749a4994
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.bin.gz) = c10dbd3dd8b711e0e431146585d862c8
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.gz) = cf1dad35f06a51619d75518386fb7f0f60330734
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.gz) = 085729350310674f285fe2ca0fb41f63701eb1f8f38da50329483d2dd1e4644a84c20815f94cecadf686d925a808eac57a986338aac762e4fe9080b2ad5adf99
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.gz) = c51e997b08e72d5e9a1a4953dfca874d4d86d4f6
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.gz) = aa4e8b576991e29425d66131a6737800
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.srec.gz) = 6823aedd0b5469af8bdc05b9fde2fa1bd5133e48
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.srec.gz) = 1b372e4d5cc54171ae399d5d55558e8cc99234c08172c7cd2c83185ec2de4a326aac04a800a050be1d1ef42b60dcc4b20ae25b5fd1f08f707a09926268207031
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.srec.gz) = e072eb111fb0bb71c30fc8ad457e1d2711591887
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-CP3100.srec.gz) = db7f9d23f27d533266eda56715e2adfc
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.bin.gz) = fd211bf40ed4f68e9f05bb5f6da85eeeb92e35d3
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.bin.gz) = 1f8dcdc7f7d06a42111745ac2754644cc5796552417f7a0a6d80fb4a7ffa667c6ab577e76f84e2f497d367b244f578b5a1c1d882c558929b12470d02026a3b3b
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.bin.gz) = e853cff382e03161c0354f83f100c67779ecc7bb
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.bin.gz) = 75e9772c889f60ae2baf766aff24f997
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.gz) = 03973311d8dc84c5522524968506a70f3e69e93d
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.gz) = 0582b69eaa266f9874ad02fb21fb7e70fbebe3952d8d2826bc6d58f23cd4d043ff3971775ecd1a12b0a828ff7266677f40c495bf394a2f33c41d372fa1ef7668
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.gz) = 8e8b7d0e5619ca58a50f6ad1f15b2764f9a3570b
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.gz) = ccfc004433b54dc119d556d198e611d6
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.srec.gz) = 72b16c8dea4c9391cb9282e2c1f91e3ba30d9522
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.srec.gz) = 94d123f6a62639d3849b60441d19e49359a922881b8818c11a41cf43ffaccea3e30b5a001e6b96ffea0f6863ca5ed6465d4ae6ea9ec6e91f95c9e498deb44105
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.srec.gz) = 4c94b472797fe5fdfc6bfc8427abe598f7ffbe21
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-IQ80321.srec.gz) = 3c722e71ccd200b5d113f3d5d3b177d0
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.bin.gz) = fc8ab0bc9eb0d8956ade1baa5651d278852ee08a
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.bin.gz) = 00c22223dd564fb484a1a477efca1a4af97bd910a88b722cd3ef05a55f4c56dc90ca0eebb6563ef73106bbe1e3ff1e9c2f51e14ac1ad5277035a1beed8250651
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.bin.gz) = 081ee767155378a6cefb29064e13c46e4de45508
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.bin.gz) = 7c1846c7207b9760e716581a07a5d366
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.gz) = 72d1968438f4d0b4c063d5b85009669416b39892
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.gz) = cfccacff88e457bf30f0336db8882c63e03fa8ac8eb7d2ae87b7a6bd0eb36b5708eaa512aba0df46ebcd0a89cd7732a0ccadeab0776a54eb4e61ed32bec40df8
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.gz) = 3fdc54921cf7a3e81ae3be6854847d0026720467
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.gz) = 74ef3b97327e4591d8a3d6acb59c6c3e
+SHA1 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.srec.gz) = 26020265778b152f20cd35c43dd0a8e8be644f74
+SHA512 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.srec.gz) = 672d1ca404b4dabe7791bbe1506b47e64445c047f92c3eac1810b8deb25e23e6a1e554acc88a307e4f85850df967e521f36c7ffb90da7325f7a3d76aba3494b8
+RMD160 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.srec.gz) = 2e0466a32e150882f148c40d8096b53849a7bfc6
+MD5 (NetBSD-6.0/evbarm/binary/kernel/netbsd-wm0-TEAMASA_NPWR.srec.gz) = 9b35a2416410acc9d4fac08926ffa38c
+SHA1 (NetBSD-6.0/evbarm/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/evbarm/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/evbarm/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/evbarm/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/evbarm/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/evbarm/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/evbarm/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/evbarm/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/evbarm/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/evbarm/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/evbarm/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/evbarm/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/evbarm/binary/sets/xbase.tgz) = 875fd641f969ec00f854ca1334d084947450c740
+SHA512 (NetBSD-6.0/evbarm/binary/sets/xbase.tgz) = 75d0c9e9685b6b7bb706df7427c8b52f59c4fc4d0e725b02ee18024f75a546dc41de5f1a5d8552a8d2c84bdf87856e5857b0f12914801ca7b36b69536d617b4e
+RMD160 (NetBSD-6.0/evbarm/binary/sets/xbase.tgz) = 1a4d099d59b2bd882e99f1b2df1c7bf22b890d48
+MD5 (NetBSD-6.0/evbarm/binary/sets/xbase.tgz) = 5eb9c573c5a0c96701f268a3470a58b9
+SHA1 (NetBSD-6.0/evbarm/binary/sets/xcomp.tgz) = 8d7469a85b7433c89690cce74e6b3f4e66cf0647
+SHA512 (NetBSD-6.0/evbarm/binary/sets/xcomp.tgz) = 411304cf66e300a7f162128203099bb4d6eebc4a93ba18ed7caf79f30b31cc7ffcede85c4e1bad02c3f5f8a27d009fb71f3ce5862c1d8aa477f39a25c535fdaa
+RMD160 (NetBSD-6.0/evbarm/binary/sets/xcomp.tgz) = 822d26e0ee08b72ca8b991f0709a8c1bf0399208
+MD5 (NetBSD-6.0/evbarm/binary/sets/xcomp.tgz) = 5af361f0334d28119d703064278b3ed3
+SHA1 (NetBSD-6.0/evbarm/binary/sets/xetc.tgz) = 222d14c205f1018cc5a86eb03214d18cda2abb82
+SHA512 (NetBSD-6.0/evbarm/binary/sets/xetc.tgz) = fb82261996aa772fd8a9022eadebf899ee04ee70229ee4fe07758ca14937bdb34752c8218eb4c5b722b6208f719891493bbc141372fcfa503de83e0a61aa7387
+RMD160 (NetBSD-6.0/evbarm/binary/sets/xetc.tgz) = 511ebfe5076f361b7f7ca03a265d16052a16d259
+MD5 (NetBSD-6.0/evbarm/binary/sets/xetc.tgz) = 165cffbb6d2c79663198d80c82afac1e
+SHA1 (NetBSD-6.0/evbarm/binary/sets/xfont.tgz) = ce0e141beeffeb5b470478e9887e4127da85de3c
+SHA512 (NetBSD-6.0/evbarm/binary/sets/xfont.tgz) = 5d98354ff77103793d56af3192ab5f9afcde62208791976064ac33a149f994e0227dd5dd28ed544eeac5ea504e5212d5fb9e7d05e59e5a48a2fe4062e34e3106
+RMD160 (NetBSD-6.0/evbarm/binary/sets/xfont.tgz) = 4d09f5e82fec875ef0ea328809465e7a98f2ebfc
+MD5 (NetBSD-6.0/evbarm/binary/sets/xfont.tgz) = be26b3890261302420b09976a1d38144
+SHA1 (NetBSD-6.0/evbarm/binary/sets/xserver.tgz) = 4ccfef1d49179603286042088bec0218c6b2031d
+SHA512 (NetBSD-6.0/evbarm/binary/sets/xserver.tgz) = 809fc0a9065c1b9e7cd17aeb0d41cfd3158efd6c585556af01c4a3c93f0df3646a2ff77c6994449a703a408c0988fc1aa68cf34c7e297a3056d73ded57034c12
+RMD160 (NetBSD-6.0/evbarm/binary/sets/xserver.tgz) = 403604404261764c74f10fab774c4653fd20cc9b
+MD5 (NetBSD-6.0/evbarm/binary/sets/xserver.tgz) = 914f909b6878cef16a92765a8cbb52ca
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-ADI_BRH.tgz) = d9cf46427b7ceed2cbe9e6bb2b62a5d461799474
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-ADI_BRH.tgz) = f2beff9ed4d712db8eb3bf1d9e8f60942e3fab2a834b73fed76ac79bd012fccbbb6698e04edd7ce7dba7802852386bdd2996dadc2c8a04a409fae303dace1104
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-ADI_BRH.tgz) = 443b7c69a5f5abeaa3dedd3b6213486af56eeaef
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-ADI_BRH.tgz) = 6e3e8b794a16eb8a079342ec0b1af212
+SHA1 (NetBSD-6.0/evbarm/binary/sets/base.tgz) = 74a00851a474a252991743274528e6272f50dd57
+SHA512 (NetBSD-6.0/evbarm/binary/sets/base.tgz) = 154a8230676785921f3d6819d25a2900fe860291ebc2e4891fe94b039871e1515199a4c0e6fe3bb5aba4f9ee802a977e985f87206a1688e4d7e0ad24e1069eee
+RMD160 (NetBSD-6.0/evbarm/binary/sets/base.tgz) = c6d3c3b83b8a2a56870929a9d616393e6d19e9fc
+MD5 (NetBSD-6.0/evbarm/binary/sets/base.tgz) = 2e26124352843379db4fcc7ab680ec5f
+SHA1 (NetBSD-6.0/evbarm/binary/sets/comp.tgz) = 4004f24b5f208575da97b542db46731015cb7573
+SHA512 (NetBSD-6.0/evbarm/binary/sets/comp.tgz) = a0950dab5cbb258ee2f29f2d35173e00a5cfd79ef30b27605782b9f22b8564e05d9633ca6886178c1b1b0cdd6a8112d3a9f663211804e554ac63ac691ff3f9f7
+RMD160 (NetBSD-6.0/evbarm/binary/sets/comp.tgz) = e8a618972f78271ba8a957f4f626b632d1b03ae1
+MD5 (NetBSD-6.0/evbarm/binary/sets/comp.tgz) = ae2425114d29b9fd2136342ce730baf0
+SHA1 (NetBSD-6.0/evbarm/binary/sets/etc.tgz) = e3f3386182b99812eb3fe35daec274b0da1aaa1c
+SHA512 (NetBSD-6.0/evbarm/binary/sets/etc.tgz) = 46337fca0954acb3b4e0e6af3b6ecd473002d2f482468ac98c62ee7ff7bd84d90ec9c2bb13d29c5ae608e625f3075471af1da22f8a4254d4e8efc9ab8dcff21d
+RMD160 (NetBSD-6.0/evbarm/binary/sets/etc.tgz) = 098b5563540c880d69e0ba9aa793ec9ba6f33a10
+MD5 (NetBSD-6.0/evbarm/binary/sets/etc.tgz) = d3f4709b5264a9a8bd820648330a9653
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-GUMSTIX.tgz) = 8a21525ca51f643747145c529add5e1de487f0fc
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-GUMSTIX.tgz) = f0f9d6e4d8f34b446e511db5a0df6b3d81b20334169caa79790cbbf34a8eaaae0f9da332559b3cb78a00fa05b807b9e3a118474146c69e75d1519c46420003c1
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-GUMSTIX.tgz) = 47002447a76cd76c4a2687923682dff473ec25dc
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-GUMSTIX.tgz) = 1ad356834d9467703647793950ccd9a5
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-CP3100.tgz) = 4baaacdf8b2ae99e945eabb70c425fd5952eca48
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-CP3100.tgz) = 467818af6caa1068437b691fdbc77e11617808fa44e2b3caf3634f7cc8bec1cca7f3a46325825d9427cbfd113eba01a8d3a4d78da832290ff40aa60964c4b42c
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-CP3100.tgz) = b2a46e69e6b4ce2264eb78a2151274796b224dba
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-CP3100.tgz) = 1528b53a9a8a622972ed1e6891535619
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-GEMINI.tgz) = 38ac63a06193c3ad7814b39a11d911da20db6ca4
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-GEMINI.tgz) = c05553408f0fde7a1a428faac350de7f969396f9e8caef6e83a269875743472e52435d6bcb1ad5531f9622c1289aebd419cdb02ad83c92d4797e1b4b952e7fdf
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-GEMINI.tgz) = 5f8d006417864f9609d691652fc03f37f1d12769
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-GEMINI.tgz) = 0767217ae126cf86a65cb17bdbeb884f
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-INTEGRATOR.tgz) = a18100b11fa96e4cd1eb1e36831f14c3d17da04c
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-INTEGRATOR.tgz) = d8bb0260e9e2b687bce84053cb3c88ef6ca3eaf12b79337746e62be94555233c8a1302dc104359b2aa6eb64eac8d633d0640d533688af4c4971a8ea095b96940
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-INTEGRATOR.tgz) = b8b57516a6d2c5e62d57dd9437fde58485989d09
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-INTEGRATOR.tgz) = 7f80ec30a784dddfe53492ecdf78646d
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-HDL_G.tgz) = 6e95c2e313c04d228a65da51f252791fd1476827
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-HDL_G.tgz) = 380861d0bafe812937f004ed00054b6fbcc1dc581fbddf3f745101ec39a57759dbc0a33f0f1e8429a9630febd7ae69e1fc88c75d39c196234260bda58641edd3
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-HDL_G.tgz) = 5262674ba10ad272c62440d4f61034dad9be072d
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-HDL_G.tgz) = 1af966fc2df6c623f4147d3cc648d22d
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-TEAMASA_NPWR.tgz) = 239e37769ab837541fc445e7a74a9bc02c74f0d3
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-TEAMASA_NPWR.tgz) = c3d61466da0066d0a61d1fa3052e54f10c19f2f20fe8342c64f0dc6365d95602e47c1e1722d242219e698c824cb4c6dd823b54915eb98f9c6af8a6119920fd6c
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-TEAMASA_NPWR.tgz) = a4be2875ed76751028c167d6a0c2efecdf3b79d3
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-TEAMASA_NPWR.tgz) = 72220c0d721aae18cf77bc235bb03cfb
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-IQ80310.tgz) = dda069ed4e7ad7df46bc23e51a6ef2013af45dc4
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-IQ80310.tgz) = 91bd0716398c20a01510a6fe340891d1712da51882e2019bcb7e5852c5b3ac706aa36cc0ebe3f1c1db4b4318624f767118b9ab549a38f253c477b4b25acb84fa
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-IQ80310.tgz) = bf180d150abaedea9aad9265bb4965197a587490
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-IQ80310.tgz) = c00c7a69803c130c2f7d34fb3d91610e
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-IQ80321.tgz) = 2d3162d5072ec3659964ff812b3595ff82830fbb
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-IQ80321.tgz) = 199bd6e9a8ee5547f4b589c2172400dc1d8204ff2c75ac021004aecc816f5840b04f3e8408e43d64722e829acf654069a161750b733af045648ab5647071a113
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-IQ80321.tgz) = 22d77cc3665909c23cbbd57dda56f412c683b75a
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-IQ80321.tgz) = 2bc4f1eb1a0355fdc0dc886c13c895ab
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-IXM1200.tgz) = eaedad32158dd867e95063f5bb56c66ac8a8f3c3
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-IXM1200.tgz) = a8c1730348c3b3aac15b11c2cb598f6a667b9528748e4361baa33ee7a899aadc43366cab3ac0d6a4305e605287952a8ba6db210f4a15fb3158bded3da4071a67
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-IXM1200.tgz) = 206d96f4304bb755159fb72884977e53bd608c34
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-IXM1200.tgz) = 2e6747257e639f5fe31d23d1834ee9c6
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-MINI2440.tgz) = bf2d80624e97f1964673908ef28ded8091568b21
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-MINI2440.tgz) = 1669f39e3caab537018880d4e93d6010860689f37e60f9d17ceb0a7209442053b1f461b683b6ba201dfd1f0c8641b8650d1561985e8fd47fb80aa3c71d2ee938
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-MINI2440.tgz) = be7274304c9c2bb18fe71bbeb9368719ca155cbb
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-MINI2440.tgz) = 1c1547b85d29dae79c76f4d7ee727b31
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-MV2120.tgz) = 363e695b0fd04709143647a1f07b22a8029c24b6
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-MV2120.tgz) = 99cbcf9b5969385787e852546f3e5685e721c7ff5fb2f898e4d9f29e2bb7640bd08e38cf38eba4cfbfc5d2c1ba3fabcc074328b5ec9bcd13faee233e9a5c10f5
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-MV2120.tgz) = 7dcee51999f376d080942e2f46cb936dc32385b9
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-MV2120.tgz) = 82c6e07c9bb44d8c06d4d4ef7228fc1f
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-RPI.tgz) = d01b81e07470d09296ca9e2e07eff84ef739865d
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-RPI.tgz) = df740174545dd2a34f6692b7a15b329c93bf1496b32b70270e339f91cbd6e9c980d92a4da0ea5a8e825eb39cf6b4514ade0d2c78846128ee424fba595e175748
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-RPI.tgz) = fb98d2b03e66057f4e002505e26af67d23da171b
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-RPI.tgz) = a07be9e2696fa18bae91363005cd09b0
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-SHEEVAPLUG.tgz) = 0f11f8084b40c9f41ef77dc6ae2ec257e819f5c4
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-SHEEVAPLUG.tgz) = 8444ff6b4f85c4a8569d51147c83583b37a1dee134c01bb1991666f02d1fd674d80899ac9d11dbe0457a6a1246028a2898444ef0070367edf66dcdde5118d6e8
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-SHEEVAPLUG.tgz) = 0f00bd92326287b2db8c825f6e7a93c34e8d7c63
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-SHEEVAPLUG.tgz) = 3221d316f1518d5bc0680bf7b1179a4f
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-SMDK2410.tgz) = 93da07d5884e0c20544d001c5f9fb49893f5055f
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-SMDK2410.tgz) = 69d65444df4a31c129ac2b2f216d6c0c27e84243f3c1870d0e7f133afe6c95e419f1e907b4a4f0ce05162be24ac149616da16d0f840700b39393bf090e1421f1
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-SMDK2410.tgz) = 0e515ec91a4186de8cae2243fb079348e91acaab
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-SMDK2410.tgz) = 6a86551a8997ef91ea427022568a658a
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-SMDK2800.tgz) = 2cdcb47ec0f5173ef5b2dd3ba319dfe10dad37e9
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-SMDK2800.tgz) = 106b6c4241c7d4d51f77f2dba13c4977fbf09e8c3b2c4762d9b4de224d04c94a94bd192b89bb3e10a5a52c27141518a0429d09fa39023c9bb59569de7bcc897b
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-SMDK2800.tgz) = 84e4387b95d8731489c37d13bfd9eb68f323b19b
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-SMDK2800.tgz) = 00ed7a1a639ecc17b6f627bc5e7b2862
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-TISDP2420.tgz) = 11e7dfd918fa822c19633b2c0d7139fe3e5b4cbc
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-TISDP2420.tgz) = f5e0b25240b828e657de6818580bfb5dd47c3d1da978a44f60cbd0fdd86ac824f09922f4ab8ac8af8eb63c32ceb726ce2835498f649828fdae867fca4991a412
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-TISDP2420.tgz) = defb0cc263198d9ab3f0fc3e2702d6a2405de15e
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-TISDP2420.tgz) = 00fd1b9a1cc66dc3eff9fe90f85aca6b
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-TS7200.tgz) = 6e0547db5e16621220bb45150a22b25123022be1
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-TS7200.tgz) = e507e5475501cf9b96d1a7f88d5fd8783f089c756a36c6975bdfa0a33ecec441d1c15c06b8387ad5a0cda0a7ce2e18ab731365f8efef4fe8d615da1dd8f8cf52
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-TS7200.tgz) = 9b9bc14c01328090ec8b855f30690202a2e3e639
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-TS7200.tgz) = 1086e9efedf641d90a2fdef271d69944
+SHA1 (NetBSD-6.0/evbarm/binary/sets/kern-TWINTAIL.tgz) = 6587a6dbfe1479c459d670942e9abed58c2077b8
+SHA512 (NetBSD-6.0/evbarm/binary/sets/kern-TWINTAIL.tgz) = 4f2978dada20c19a2b2a35dcee406fdbced5caad7c46b6c733c2c24b2952202d872f666d2ac139baf5b0ff98092a5509594eb8fb70627a25a268fdefa36f1162
+RMD160 (NetBSD-6.0/evbarm/binary/sets/kern-TWINTAIL.tgz) = 49bee3aea5f5b88b79344836c779d428fcd0d19f
+MD5 (NetBSD-6.0/evbarm/binary/sets/kern-TWINTAIL.tgz) = c70d7c187e58dd8415522bce16bb12de
+SHA1 (NetBSD-6.0/evbarm/binary/sets/modules.tgz) = f9a8894103100366dbd4343aecc6452a35c2fae0
+SHA512 (NetBSD-6.0/evbarm/binary/sets/modules.tgz) = ac2fdf8cc9bff05a5f66749e4dd96a2f0ed4d143acd490e6f8b3826a9b9538918a8fec0045d40f6f418aab80372b23729410997fd81a05f9d9aad27c2dc3589a
+RMD160 (NetBSD-6.0/evbarm/binary/sets/modules.tgz) = 35204da96f307f853b28c487b0b78c478cbe99c6
+MD5 (NetBSD-6.0/evbarm/binary/sets/modules.tgz) = b6886a6197725ed21d53bae4a089fc1d
+SHA1 (NetBSD-6.0/evbarm/binary/sets/tests.tgz) = 971ffc9e0521617dc678b9e9923371af2e9fca64
+SHA512 (NetBSD-6.0/evbarm/binary/sets/tests.tgz) = 55013634b7d0e607d847ef69ea6a72b7f939830caf8e08dc55c78b04a27897490210377bf1c5b1216778d4ffca44145a0fabddd8ffc449acc93f40877a71daea
+RMD160 (NetBSD-6.0/evbarm/binary/sets/tests.tgz) = c9be008f99e4d72d0260139d3ece0db37454d842
+MD5 (NetBSD-6.0/evbarm/binary/sets/tests.tgz) = e1bbc8e25aabbda881eb290efc4b25e2
+SHA1 (NetBSD-6.0/evbarm/binary/sets/text.tgz) = 08a253fdb7a0118ada516bcfd1293100728240c8
+SHA512 (NetBSD-6.0/evbarm/binary/sets/text.tgz) = 41eb29b2f82b18d916d1fa2e858d45fff23f613120c53256c7f7f3dcf7e31ddede9f954a143d9d8c3ec95cd967f46861a1385382634028d61eb0883bebb294b2
+RMD160 (NetBSD-6.0/evbarm/binary/sets/text.tgz) = b2cd2ecb39f44039e90a2465047b5510d0de2eb2
+MD5 (NetBSD-6.0/evbarm/binary/sets/text.tgz) = b5a8566f96d102342467dde0a2ffeeb7
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.symbols.gz) = ea2b03a807cb44578f36e3f34d58a0435434f421
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.symbols.gz) = f8d97b757b0d0d82f5e4ff14afa6abd1d41ed35e3c97684ade36a0dbb277cfcb55a6f9ef656b1983507247b07f164ecb407d0973d57d1533b2a1e1364ccd51ce
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.symbols.gz) = 33c2edc444787b5477a459d6426d80ec2ac8c9c1
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.symbols.gz) = b06f95b94e9fc3ff03d7c02485d9226e
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.bin.gz) = 72839e1353d343d2ba5e449273aea745a980cb50
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.bin.gz) = 9f8019273ef9b3f46a70e6faa97a580e6ae1d0d820974de24033c55a729fff2d2780d5096964673f97e26b3af86835c5087fd0b09a345e15c29403bc1f467c3d
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.bin.gz) = 81b228fe339897de8d47c2cf5555c39eb891193a
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.bin.gz) = 662f1773c969157b42f70b72bd72c9f8
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.gz) = 257f98f33f8429d27486ea526b045f31cc4b9ab0
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.gz) = b2b2aff23b6be4c84ef07f1c3ac698f9554a13a54c8fd49ee12b0e175d09da2f116799260083e6a87a8b4e761a4a66ad8d3f02fb6fcec9f3f4b928271cea12a2
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.gz) = 0f5a2cdc5951921440a7147912e722a481c1360d
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.gz) = 117ff4be0dd35bb5cfaff3414c27a3f1
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.srec.gz) = 1fa80c74c4b2f44a9db4f1d5e0be62a7fd6f68e3
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.srec.gz) = 9d291a02fc808baaa9ffe3b259239d64758aa394b6fd782b4220ab47eec1106a33e9972d06ac07fbc1632923b12a9dee9574bfacf5a2dcc096490aedebaa7309
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.srec.gz) = cf28c82c673429f391bcfc37493f07489ab8e260
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-ADI_BRH_INSTALL.srec.gz) = 6a743321a49a841146309dd71a2b7782
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.symbols.gz) = 1d15f8fd20b400aac41fda396b615742593f14c2
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.symbols.gz) = 8a2ef21088d568841b740d0c316f513a98ac3f45f1c0d994dc199b4e2529836da832b8409368295b4b326de2f4defdef34f1829e3e4fb7217b39c858ab0eb09b
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.symbols.gz) = 2202821e57d5506b266456b70f18ff6a1506487e
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.symbols.gz) = 026ab51e016618bcc9f1f1bf363492ce
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.bin.gz) = feeb79b4d6334a0f6a87ca2c63d195e7039caae7
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.bin.gz) = f76735623ac3295690df2eabeefeb39c8cd3e5d85fd09833f9e58b8aa1bbec65f462e8a1edd683a75e5ac2188a50e3ef9f574b00dcbe6f7ffb0c02c4aaaafe26
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.bin.gz) = 5344ba62b8815bff63195fb12c5804194c5b74f7
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.bin.gz) = 1bf8ae796a35caa01e0332fb0c193e2c
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.gz) = d1d88ea80333147d4b73f6c20d5f0cf9af362acf
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.gz) = e525b3d43fe6ff0d7ffe83e546b80cdc1892140e3dad8cc409312a544f9ea111869e085fdfb736a1dde3d029d39e84443f06f0175d28a5b21a1a2967c82d904b
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.gz) = bae57fad021b76fc1a9e9c796b9b6df84b3a8814
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.gz) = eb56d7e3dbbfffd56cdd5b995690e1d8
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.srec.gz) = b0b4f43f1f4f8bcd5ca1a9a0d2877fdce3397998
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.srec.gz) = 50c8e9381dfff94d56c7330b217ab079fd3daaa77935dea557d321eca5e5ca59866e59b59b9ac498b0b4a71410dd776c8068f9ee2ee3ed646a39029ba1d6e9da
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.srec.gz) = 9c88faf5c7de521d9fa0be09a4d9b3b9206a2dcf
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-CP3100_INSTALL.srec.gz) = 558c67513391c3825047d26f08d48997
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.bin.gz) = 7e8c3f055b239755fecc8aa462e54b8b89a9e8c9
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.bin.gz) = 6977a4d96f1b1cb16ccfe4b15678b40b6627b01385fe6961487817f7ebf84d470277fad37c53ea7bb48e7c19e7b37dd8be3152a6e0274e6f8d6bee69bbb7feab
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.bin.gz) = 28fee55b727cc25187df3981d6fbe2bfa64b9e4c
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.bin.gz) = ecb5118258da0bdb24ec8ab9ac6faa0c
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.gz) = 0af690fd4f7fa383ddca7ee5f63bdc698d6ec5a3
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.gz) = 7be43506576a17872997db65441e436b51f1fe3bcc9c42eeea4fd19809f8d3f61d2cb9027ad6cc7e2a26fa3261482b9ff1b7e00878b5bc18ba4e7130919e8dc9
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.gz) = 46c65905cec0fc54bacb408d57af312598bf8502
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.gz) = 28ef106d2bffe72fe879c19ef7f25741
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.srec.gz) = f3646a6435283a79f0580692798694d31d8b672b
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.srec.gz) = 4b85ad5c44a4076715d43f51aa94e33ddf7f1e6645c7dbbd490ec8d8b305766f3e6a6facdc5c87a20be3865a827e531810e288eeab2184155d83cbc062a0e14a
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.srec.gz) = 7f87fafe296706dae3a75441b4f6fe26f52cace7
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.srec.gz) = b81ffbbeb626dde373c9c54e4cb15b03
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.symbols.gz) = 0ac81f8038480354e6fafbfba5da86ab333f85e7
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.symbols.gz) = 116b9be7c9e3135d1d1847e084a10e5bb2dc2a95b4810a2e268fee9e6e5b3a5f157b2f34b94a2e03256d959b2bb10d01760347398dc81bda5d6ce64aeac1c2a1
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.symbols.gz) = 4cd6b326352d9398035a2c7eb157c34604da6709
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.symbols.gz) = 938ba4475e1668e7fa02cd727e237339
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.symbols.gz) = 9634080097f581271b2e0aa1bc2f87b10c7c57f1
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.symbols.gz) = fb85279a670488e7e8b83c91188bf075363ab8278335c1d3a06411effe829cd8a47cfd269aed5e9a598414fbeb56165eb0ad27550f6f6838d2c9ae9847525e99
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.symbols.gz) = 81c648d753322e87068041c7bdc30dea925ec2ce
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GEMINI_INSTALL.symbols.gz) = e4b9a0b3e230fb2cb6a6e2ad3162b1f7
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.bin.gz) = 5c60fde2ead5db357827530b6b899e3236fbf814
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.bin.gz) = 953fda76c9d47d8af51e578049e98a5f169cf141a057ff1933bccec43ce89b419182f533fd105462af3c09a0a843e8e766f96d2ebcce4cf404166d80ab6b1f08
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.bin.gz) = 34e148a900e77f07aa63f0fbbf181bcbc79e2026
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.bin.gz) = 60aed2122f98e633e78e0f19a3724881
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.gz) = d94e8dcfc14fd6928b3d2c784cb38f0f55b009c3
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.gz) = 9ef172a0aabcffae7abe5312415da7d407975905484f69ffe73dda2389f0230a39ab2d03e9ca42005db662ca2f6060a4a6ed0db4b5cbf23676a35af38d23a416
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.gz) = bd13d39ee7366ba6ab2a1ee1b6094322a5b894fa
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.gz) = 9c16afcb3ce11d9923247d310c23875b
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.srec.gz) = 380390e6eba24b258a8eed603561f05e2a1cdfd6
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.srec.gz) = 519683b9ee12d3dcce26182bd8a46c27d9f6285debe96df2b88d46d0eff372deb2342a1823216da2dd0c28f90732858e7e8a4d9d6305d5e0b82b5345dce92112
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.srec.gz) = ad5c85bb6d641596e2b0ae7dbdb6f235b758546f
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.srec.gz) = e2612b861cab60aa64008ab686f570bd
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.symbols.gz) = 91f9c530da00c48d4b22b7fd98916ba4528f77a8
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.symbols.gz) = cefcbae785c5fb72ef5548c16a8ae083a5be19fd27f386c1eaa723c7cd296dbf4c4e774150bf3017a5ae52eecff0aef125f7ebce87f73fd930a019759e0ce7a8
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.symbols.gz) = e91be60bcee907ee6259c16e54ce1e3e79f7937b
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-GUMSTIX_INSTALL.symbols.gz) = 088c9eeabf75406c634a15511972829e
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.bin.gz) = 3fb32f0f8c981cf7d0012870d9c5019f06b844b9
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.bin.gz) = 7b7ecc024c36ffe8d57ffb7f53f25e9a3aaa203605ef955c3d94b47627bdf63cb0ac49a8ab230f5f7d5c07c4a56aca94787e861b381af4c84acf48c8b6040b4e
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.bin.gz) = f0faa1b8b1d48e6c736959211a1581221e92de24
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.bin.gz) = 66e3c14d2f927cd248e0b07882892fdf
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.gz) = 90ef61bc7a306fae7f41e20a6c615e37b7d51bb1
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.gz) = 98bcba4e6a5ea6260f42e44b78010bf5b02475a12c198c5898a6e4342bdbfb0207a5b7ee17ebb7cda0859057abe0e5442a41e7fed2c9b78b566e67c7897c21c1
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.gz) = a0fb23b82b04fcd0817a38d5b1b2da620bf23ccf
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.gz) = 546a0231797a48e08fcba615fbb5dc5c
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.srec.gz) = d234b22bf784c64b812dcf9afeba9f106c969e08
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.srec.gz) = f7f78ffeb87a42943c8271cc0bb7d9a3805569fe0cc75f62359ea827cd44ae48f425bdecae341f1a947a10f35df32ce12155105f333b97c765d48db2b1f4c0f7
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.srec.gz) = 218875a0a61876726f5790366ba2748acaf63996
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-INTEGRATOR_INSTALL.srec.gz) = 63e3b095ce7b3512ab0fcdc562cff952
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.bin.gz) = 9b24a0420c1b2b406fd2b6d8fc7f25a3dca984ca
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.bin.gz) = 5a46d91f646c354c5bf39ae4c15cf45b2ea205328f859a3006bfef815a40b71109b748e6efe91b85ce692663db36c2b6f08e6a43b4ee843c5d1dbb2eb095a7ac
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.bin.gz) = 4a6cb6eb7612c34d1b3c68ab7cb56fe32e45b7f4
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.bin.gz) = 86823cc4ac5a09992501014bf88c877b
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.gz) = a4c5e90d5a9fc6c4b127fd2ba479b27228b64f98
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.gz) = 98f9d8a9bb4c6b29be7002dc4aba375b89a7e98d23fe77634c26efcf4bfec3bec46917718f4c245a9ad8a480db0205224bf0946962ad5b748e04f2b170645344
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.gz) = c9756d9b19051c3f34a748eeca4fc283784f205c
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.gz) = edc01ffccbf9a6db1d1b40878927b492
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.srec.gz) = 1d2d7369ea182d3cbe36b6cf0929bd26e48e7799
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.srec.gz) = 2164f0f36fbdf41d2fb37ca8a19beffcfdbcfee8a5629350e28a94a105e9b9707fa44b99cf122c102e073084d09905a75a69a8da2f263882e89e9192d66c232b
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.srec.gz) = 91147de829c8e594800eb713e55330fb2160c062
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.srec.gz) = 1ac108b4534ab6529420b5e6eb4596ee
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.symbols.gz) = a594571814d5fd54f060a324f961c8728207414c
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.symbols.gz) = 6a55dbba559e4675123270036ef2b05d877463c0101628e50d6f84d12035784a76e010e469840b46cf56291e5d27fa5569457cf83fe7d5a5f128ef6777d4b0fa
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.symbols.gz) = 54553929ec55ca2d3e1a34163f79019ce8d21f68
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80310_INSTALL.symbols.gz) = 796f55a92c0f4a29a920251d51a90d9d
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.bin.gz) = 8667913b1247f23e940f945fc1d3c6d7b42e3bc1
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.bin.gz) = 30df01772cc961320c0600225caad50145a9f84b9fa5689ed61c59b136c4489e4f6ce3f1075e53c46335f955ed2dd94e662ba2674c56a0171f33e3ace70af2c8
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.bin.gz) = b6c98b6c38bfb10e36bf119c49749cd5c6be20b0
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.bin.gz) = 9a3b14a1e64592301beaa6c7581e5f3f
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.gz) = e619f80715bb394b1fe67cc05f45cf0e076fc3d5
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.gz) = b131081790eb4e2a82ac2cbd9726b8239f8ec91e25567606411bbcb4c9cb0676f8f15d1daca89623e29d6045fb4e6b6edc40ec7bff4d0646cd06313c8a827672
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.gz) = f791654aa8cf1ee8d9d71aef03ac0f904345465f
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.gz) = 42b4d81e7d76bf98705e97927f1a6fed
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.srec.gz) = 418c6e4fdae62a9dffc0cc52300b3308d4c39726
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.srec.gz) = c6025b5ca7555b4870026cf2a9b23a000bf3f3bdac4a20347593f431062ccfa8b43c29dd1caf17f95787ef685066509e409164c302fcbb40cc18307fec372442
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.srec.gz) = fcaa8176ac524a456a5e75dfcffadbeafc133187
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.srec.gz) = 0674c1b44f421bd847dddac9e87e1221
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.symbols.gz) = 579e6ecfc351e91ba0bcf36918bd3fb781b7c1e7
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.symbols.gz) = 34074f57b8eeca79deb3f2a070ea824be2fddae7e8b5a2d8bedab2b4dd4796f2eb1baab06cdf95b53da4b43cbd8e8fa873dc0986325282dea9902ffe9fe521da
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.symbols.gz) = 139e713201e03fa17e31803834d898d1ef636bb6
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-IQ80321_INSTALL.symbols.gz) = d08f0319e5ccb9d142f20f81a1a4d0f9
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.bin.gz) = eb490e7ec36f92c871934f2cd7c1fcb2339ad2a7
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.bin.gz) = 7be26fc8e01142f873d0e2ca89a414bb4d2dd332dabfec1f7cd126ba2eaf0d803abde4f62c627b583fe2a57b93bd1669fc669666185ce1d5cdbeb47b88690ca6
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.bin.gz) = a93d35c0251e92ac7562cc6138419fefb6fca84b
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.bin.gz) = dc54e455b762156bdfd6a0fb2d14fe2f
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.gz) = 2567dce09ac1764f78ec074e4f5644a87ac83c8c
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.gz) = 6beb220906314c4ac93a058a4994104ec2dccefcca4e8c2a0be6d3399536b4765e49294b275dacfe20e39c7cccd81b88c9521b2b273835001cc6b131237b20d2
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.gz) = bc87bf5b540e6847689016b2301ad48aa637a3eb
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.gz) = c96abcd45f88d52e5826c9419e895e49
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.srec.gz) = 82575c4f3f6344ff9fcd848f30364fd1b65eed82
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.srec.gz) = f1c6e41724db95eefe005e2a4f3defa81b7d8319521ad2897fb976cc8fd31af9f9399bb0df03e8b910d72baf25384112efad9699a111c6a0ebc2e8d79dc63f72
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.srec.gz) = 82c356d5a3916d82b941cfca334f55586b30805b
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.srec.gz) = 16ff2a11bc97e2bddfa4ecda023be897
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.symbols.gz) = a8cf19b83ab6b0aa48e6486a2ef5717c14025933
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.symbols.gz) = 3c9919130d4470ff778d77119b4f17132002de6229a1d0f4f2024e1bbe8e68de7cfe93a4da18835c111dad1de50bbc4e5e0e50a89e71757acc2da888afcf944a
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.symbols.gz) = 53339f2e886137c722353c7e4641fb79fb4160c9
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-MINI2440_INSTALL.symbols.gz) = 2125d332a50f2382dc9ea2fa1c76fff6
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.bin.gz) = 7f7533adb7f744376eda30bed953e0c24925a7ac
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.bin.gz) = 6df01180c26dea9f40e427414375f872d65be05f1541d887fedf8d98f22e3f98354ca15aa058c1cba0d0e4d30974b37787855c1a9ee36f7b702ad42c31ef69ab
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.bin.gz) = 1c6192b2841123a6a7b34f46530a49cf731fe8b0
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.bin.gz) = 7080e515fcdbe3d4d976da0bd0db1356
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.gz) = 009c609c69eb87be8129cb8cca61732493771053
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.gz) = 1aef3bb8e1f66280e2478e207618ef125b02fee796f1d31bc9c8ab5e28f132bd5aa5c6e78cf1dd2e63a72cfe814264db394c74a2c1f04ae139dbd3d592bca8ce
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.gz) = 6b7f00ce3de221960905acde44c93679d12318b0
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.gz) = cb78419cf4b8862517c4cdb83f09edcb
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.srec.gz) = 5405155f29eab526e4b489e156a3a6a84b694c04
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.srec.gz) = e4ddb650bed5716c2a6070a88104ead0119e3e41a6ad61d0a1ab944966fd5e29d3c17b83061940c81788583d833b3b90e2b3fca30a2291bb7e99be7acfc52eb4
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.srec.gz) = d28c777e9f79b74d39d9cebeb55582bf6554bdf4
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.srec.gz) = e33527c137440f91dc481372e55b5153
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.symbols.gz) = 0adc4d2b9af7fed43f2cb2a6d461b0b67dca64ff
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.symbols.gz) = fac69e001c5383808c41901f250e53267cee4df0738cf2fda17675057f397d33fd2be817b4235ba4ff47c3ad4c667388fe94e935372702729e38a39d95932bf1
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.symbols.gz) = 08cb50f087ee2c1edcb6bb8b0a10fd9436ee5291
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TEAMASA_NPWR_INSTALL.symbols.gz) = 303fa88bab1f84ce1e5e7392b63d335f
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.bin.gz) = 6d96ba7627a743040710559958052fe5ad516e07
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.bin.gz) = c8980e5a5fcbf6d16a94b273537d0b7e684d46621d46cb52b1c2672e67c864bc4651a09fed96356e441d209f57c5eba10696d9d82a3aba7bca24781ef6e6d570
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.bin.gz) = 8faf196aecee5eab9fe5a256daf1bdeee5f485e0
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.bin.gz) = fa021fd649cc68d99ed50414c562937e
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.gz) = 7084ab7948465cd7fb832a191991166d460bcbe9
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.gz) = a6e2dd918a3965573e3417e24984ff5d4c546a9bade8d7b68a930e695a76243aa4acb89eaede1ad8ea07280a836fbdc3200b7cade29486e1a1783734ad3164aa
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.gz) = eb9e46f17f5a0d0d296fcf3983fc7cac086d139d
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.gz) = ad30409880e74a4c9aa9be2f0cd67ba4
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.srec.gz) = 5dce945d53df7aa098712e966a08d8c4a11d5615
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.srec.gz) = 13270d86a94b74829fdd691cd97b8afbebf397fd68d9e8ecc8dcce611b3eca79666e5da303d75ad0af56f762b65d3d487ef1317685538b6962ff5b482e57c954
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.srec.gz) = dbb6b76ac38227dc2b5e0dcf35dbbc187a0f9cec
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.srec.gz) = 573eddbddcc0e213758ee25fd7f3d6e0
+SHA1 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.symbols.gz) = 7a5bcaaa2847b816c0568f28647ee07a18650c38
+SHA512 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.symbols.gz) = e7fa9c30cef40ab421ed36421f9c92bac2fb21c88077d4dd176a55b3b82cb94ff1e912b35d6504e5d37ca737378da3eae0f64e7721a023e7af596a037f0970a0
+RMD160 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.symbols.gz) = dbe42d8b278149bae03d553e4d8a2676544b53ba
+MD5 (NetBSD-6.0/evbarm/installation/instkernel/netbsd-TS7200_INSTALL.symbols.gz) = 28d969c46d89d77b04fdc532621a9c5b
+SHA1 (NetBSD-6.0/evbarm/installation/bootmini2440) = 322711938832b81edf3a30de085fe84c118fffdd
+SHA512 (NetBSD-6.0/evbarm/installation/bootmini2440) = f985790660b66ab4843a2e938e67bb7b1856e6acfee877e00bcadaf945cae7f85dd5f5ea2557f331d142c2f79ff129ac505a9f8ac276650ed49ae86b202cdd1f
+RMD160 (NetBSD-6.0/evbarm/installation/bootmini2440) = 6549e1c02eec982d3bfbd42317bc0c49bd7a3fcc
+MD5 (NetBSD-6.0/evbarm/installation/bootmini2440) = ab71c605b7165325bc2efffbf8366e01
+SHA1 (NetBSD-6.0/evbarm/INSTALL.html) = 364e208c39e0aa0c1a873702629363049749555b
+SHA512 (NetBSD-6.0/evbarm/INSTALL.html) = 0d23a02d74624eceee1b8908f49ca677ab4c260725798614faf67cfcf396aa0862aaf5296ab68315b3a1b110a998cd9fc08f36630aa3202ffb18db915e6bc5cf
+RMD160 (NetBSD-6.0/evbarm/INSTALL.html) = 5e46ad234a6311ea55f157da0978fd0ca4543ee1
+MD5 (NetBSD-6.0/evbarm/INSTALL.html) = 4ddc104e853a1b0a9ff34bdeffdb849a
+SHA1 (NetBSD-6.0/evbarm/INSTALL.more) = 49005be72eacdfd5e58240ea40c272362f1794ca
+SHA512 (NetBSD-6.0/evbarm/INSTALL.more) = 29b0240cd5e8b957fd6f0cb26858f856f2ca1e5bc664d7617138519d38788f442bd0e2045f506eb49b6fb07200e3251694679c7e9079e152e022e4c36d69339c
+RMD160 (NetBSD-6.0/evbarm/INSTALL.more) = b2227c9abf8c42edad582429b388b46292b2b642
+MD5 (NetBSD-6.0/evbarm/INSTALL.more) = 8f7edc27634f260c5216ce2ac1c7ab20
+SHA1 (NetBSD-6.0/evbarm/INSTALL.ps) = be244573aa70f6ea8bd6afef50d3129e95ecb232
+SHA512 (NetBSD-6.0/evbarm/INSTALL.ps) = b4dcdf490b1e2fdfb72a21fbd00922eef14da81665f56e69d5fce4458222a3108c27fc793a1507e9f6f3b3555c236899f06863282b3a0dcf061ddd81451e0f82
+RMD160 (NetBSD-6.0/evbarm/INSTALL.ps) = 38340ef793c940f555c637fb63ed603e2813b6b0
+MD5 (NetBSD-6.0/evbarm/INSTALL.ps) = 0702cfb1c18290c2f6b3990ec2b9b838
+SHA1 (NetBSD-6.0/evbarm/INSTALL.txt) = 84d0cf406199e9e160201946ef76c5544f859094
+SHA512 (NetBSD-6.0/evbarm/INSTALL.txt) = 779245d5eac9f6aad487d0ef8c09ad8ed1ccd1ab6b315d5436d681422a1ca23376304d9f5f36e0010d38a26947c2d67b214f7fe06207b52ec4ca1d1abf996280
+RMD160 (NetBSD-6.0/evbarm/INSTALL.txt) = f21886bd1f37f1557a890ce294fc842a4a9322ba
+MD5 (NetBSD-6.0/evbarm/INSTALL.txt) = 4e8f849ebf04f5af7feb401bd8b828ac
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-MALTA32.gz) = 837f5c347644ad20116892b91a170bd9a177cf25
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-MALTA32.gz) = 83ef6ec1fea23841a6a03d5f91d0c00f8dae56d78276b04dc56f3be1121950c8b21cdc3b4f580929f85e0b7dca9f5635cbc248cd9bdf018bd019837953165796
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-MALTA32.gz) = da9f38ccb4f1a09ce9567d148115538eedddfd64
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-MALTA32.gz) = 94e33f6853b4a1d9253b01310a9d31e8
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-MALTA64.gz) = 1194bf50c6a2a1cccfd7017ec100e18840cab60a
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-MALTA64.gz) = 05939d55299eb8c98f89c0cced1f090fc47568c81be3c4aaf32325ce4a087b44b1c6945bb8b9a12384ae588e9dfb1ad0ca1c701e2f0603a672bf3ea1d2bad1d0
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-MALTA64.gz) = ceecace87ff5c72a8bf0551d03e7f24297c8210e
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-MALTA64.gz) = f70db6b8696d6db6538471a0389aba6a
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-XLSATX32.gz) = 50baddbb54cecc95e5aacae73100b35b1a50808a
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-XLSATX32.gz) = 937b7632d22c4e22bdacdad4bb473b1c4537cccb35f97d1bb08b80d64c6228a410f59310ba336d19e62e0bf38f3ccb9c5e1c27aed8d769ef66657de06070b273
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-XLSATX32.gz) = 97d67324ca36d259e51a80f89b3ff8c32aeb0936
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-XLSATX32.gz) = 2c17d4f86050689342b031332bae427b
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-XLSATX64.gz) = 1e1c1a9cd9c7bedace03b3c25a736014d7053adf
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-XLSATX64.gz) = dd0689962b451e442a48a35c35f426d4428aad93a22e6e2d33dd0033125eeb8e763ed31ee13410a6f7b7d337a46c351a736605adf49e301e09df14096fffbf41
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-XLSATX64.gz) = c94021afffc7e21001cd3f045063b725fcbbdb96
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/kernel/netbsd-XLSATX64.gz) = 7ed50990347095eced85286bac3894ad
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-MALTA32.tgz) = 8aef48b2afd3a5c2daaf9298b1377e5fb48a4775
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-MALTA32.tgz) = 769777c570e41cef669cadd1caca734ca55f71382656b3d229bf32811e22fcac10c3258032e79ad190d9e34b4a4168269b0a44352209f9321d3b3d18e1d920ef
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-MALTA32.tgz) = 27fd132ecb4aef492c8194a598641b0d57df788f
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-MALTA32.tgz) = 547ed14fd7607348ac12d50d6e142625
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/base.tgz) = 321d0a48e96415413f6c76fe94cfae0b763c0ab4
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/base.tgz) = e3306d01022a478928ebf33894603aa4788983b58b73beb1cdd1592cc5d545bb3eefcc07ef381f7be24099bf5100914d65f5575c9ccc43279332972d5e84c01c
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/base.tgz) = 822520b0721dbc6ff7402acf65a7078df4ee495b
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/base.tgz) = 838db1b3837f00c46b9b7f8e2ceddee5
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/comp.tgz) = 9e1125bb9734db8e861c085c3f4baeefed5bc5ca
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/comp.tgz) = 405ffdb54d1ad4f0cb56b07ade8ef1cf26235526e143f62622870e9733d9f860405519b355129bfad7ebe659c56358c73dcc941bf0554a89ef210a70e69c2855
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/comp.tgz) = 13b1ab9f477f0d22afd1dc11d7a0ce04ed87e247
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/comp.tgz) = 880a15da9d452aba11a9c3e4b8c32c44
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/etc.tgz) = 793af95b8423250427980e55e1b40e7d2d946dd7
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/etc.tgz) = 9c9dafc30b85ced01a296fa4464bed9c8bbed77b359307a637e236646880d93aa3b17c857423f26c286732686b00855131a359295fbb22c4f4d4271aaf21fd23
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/etc.tgz) = dc21febaa97b3f196ddf788541e93081919ac05d
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/etc.tgz) = affff84911016dc75d8dcc556ed1cd90
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/games.tgz) = 6a9922b70c13cccb7e2c3b2d2b4f63f4d6ba8b83
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/games.tgz) = e17192d20cebcb6583f76e3badf382c2734bdccb596b5a7c7104c28bd6d96419a59a642c4eac1e246d821d8cdf211e8b00aeb7043a439edfa6cf9e5554441007
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/games.tgz) = f93c4992616fc210ae24c58b64f8607ca6f3d1af
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/games.tgz) = 2186988f1072dc9be8a8e1ea77bc1906
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-MALTA64.tgz) = 6cff22a0f2e961617cd4eaf3bb571a7b7f4845a0
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-MALTA64.tgz) = 05b431e02e4e858f79103bc1950c4da7fc87d476d46479a8f0c2a9850b96391d8a55cedc0fa3b47da4857d7f91a9acacc08369e2121a7d47af3bda5712ad333f
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-MALTA64.tgz) = e1048547f5851837f476010b3c5866f527542465
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-MALTA64.tgz) = 3ccf1d8db71de9c182c81d99689aab8d
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-XLSATX32.tgz) = 4400d1601558ff59a7d90028bd91e00c4b67e230
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-XLSATX32.tgz) = a16e8b5d34e07c97fdda6b09e41a67d48fcf56b4276e9e52c2a2d8ce1eac5d21abb542afb67991f7b2bf87261c8134f8e522d59375ccd251f4e853d3ed877b71
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-XLSATX32.tgz) = a7ea06c9ce95d00548c7dc9a3403f873d3f42749
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-XLSATX32.tgz) = a6c542f79813324f5ddaf80a9a12a531
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-XLSATX64.tgz) = 47cc48be2b1edf22d48fb3d45c2ebcf1e6b84655
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-XLSATX64.tgz) = ce9378b66f327c84e004d075e0033e195c1e649acc7f668d154b5608fa71070cfed74b1eedea404cead8c92a9f9f332fb5f2407a14d80175d4f2e7f3115962d7
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-XLSATX64.tgz) = 64602c29c9cad9767bdc771464f766d4c4bc7a14
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/kern-XLSATX64.tgz) = f55ccc413a2546e5db4c66b38095dfb2
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/modules.tgz) = 150d99ebadd4c626bf48d9dd772584df18d0f161
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/modules.tgz) = eb3e15f4dd50d6eb59ffec96245ca440abdc2427f7cd14f6405ce979f9ee13b5d40ed30d0fc544cd92e5c8dd49b2cd033cafa44f32baef8c434734665c7b35d2
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/modules.tgz) = 74a564f4270f8b8df9c0f207512ccbf02cd4436e
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/modules.tgz) = 6f2c6d66540b3994a5400f1b3a7c0e06
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/tests.tgz) = 607a8a23fb7447a1bd6363feb446cdfc7110ac7f
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/tests.tgz) = babcea43b781105dea81af3797bce6f77bbf2766a28104c45aa7f43952d0a0a7e3c981927d4b2745ed46b290ff4db7d43b5a2620b82d7185a55e06156604432f
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/tests.tgz) = 90dc0855b2b85584cc08f07d55645bd98f04b40b
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/tests.tgz) = c0dc4879f5bf2e13462fe11f1afb9755
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/text.tgz) = a38aef75824fe9c86579b8a320ec645e1079224d
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/text.tgz) = 39f42cbd084867ba177e3f3c7eda0ae19040eac2ee4dca991caa172211ba499081f720f16511b967fe6e4529f78e446cf9cf8ab89b595bca41aff3e7017b2028
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/text.tgz) = af58fb15683143196193ee0ad443a9fc94b6f8b7
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/text.tgz) = 8716d1b4d2cb02c015e20e87650021ed
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xbase.tgz) = f22a560c757bc506a118ce9803f68e148fbcf5f8
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xbase.tgz) = 5ee7c1db10aaf6a67fe6e9026057266340e901a2a4042d126862bb3ebc1b26dc824a3d47febaf2c38738b10e563feb903c1020ef98dd34a34ed6ab1811e1dd0a
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xbase.tgz) = 4dd1d30eed29fad5ad00d08f8655850ba2966beb
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xbase.tgz) = 83fe206984459147b084ce31f5712ac5
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xcomp.tgz) = 6a62de4e61ca7fb51120a2d949f0c6a76728c795
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xcomp.tgz) = 1a4d6159f2afb79ea54d7b50515d33585ac70a41da0dce13790d9acc1bc83636eedf83284aa76c4b9be2d51e25000fcb000842d4491edc1f0032e6e68f591359
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xcomp.tgz) = b5d253b8ed963d2aa4542c177199f8bf56a7413f
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xcomp.tgz) = 9ab19bfd18fe8afea9ec8b987eb3f745
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xetc.tgz) = b3ca1c7e85d0832091fc391717c914889f745a13
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xetc.tgz) = e386fa04d66afe2b4817c6e77d6ae351e7a10265099395285e15ff5fb8c41d169de511b3bdc71d9b8fd144a0153262b068b6b837b846310e255bfea1a06ac5e6
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xetc.tgz) = d7cd1c13d547ec0fe4ad59ee92be9499cbeb53ed
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xetc.tgz) = 8165fb3d8f4f335f32f391d6f6ba414c
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xfont.tgz) = c3b40e7a439d60c27022fc1cea5e58fff68f2da3
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xfont.tgz) = 5a7e564dc9cc41d3704722a461ffe7ada8011510e3db08c2a209afc462a69986261ec02d41e792f1e1a305300f4d23216cb07c231c461df5edb2fb54916d2438
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xfont.tgz) = 03066eeaa22fac20cb69be43939f870a313519d2
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xfont.tgz) = 46e16e5288c250f4f2394bf709df039b
+SHA1 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xserver.tgz) = 13d61af721933a9484ea722fcf5a151900b07d55
+SHA512 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xserver.tgz) = 1372c13478ca7da2c5ba2b3d56f2f09f2bd764f2c345a9e4b8c2fa81fd101d557d53b16637b7644676431cc57b481d22d7f702c1a24d7c6456c04b75422f9485
+RMD160 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xserver.tgz) = 3cc8603545553cf13c0e41525d4f71df2f04a243
+MD5 (NetBSD-6.0/evbmips-mips64eb/binary/sets/xserver.tgz) = 599284f9e42a94928802db5b36d6c8db
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.srec.gz) = f94948277528ab8356fbcb1f447ea3f88da0dbff
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.srec.gz) = 37025250657daad79c15d79ade2f1e815b551bb9541d852e0e0b208b6964b2e7bcff4eab477ff9dc8c62b23a061681c6076684f41d50ffac2b9ca1c9b85eb657
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.srec.gz) = e0f5ead94d76d0131e9b6351a1b32066c0e37004
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.srec.gz) = f07bb28b2742e51e8a130a1633813342
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.gz) = ce135463449caf04fe5915edf2689e53f7d34450
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.gz) = e30a6963cdee29fc634232bad314c1093df462a1fc2751908ff1f6118165b1f4cbc7fa3fb780c7483b26dbed2339f562d75618ed355388ca4a7ea8da182f5718
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.gz) = 726d74693693f22e261de851efc11f489af83d5e
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.gz) = cf0519b0dc9ab365ee268ee0cf667cd3
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.symbols.gz) = 7d61c5ea450b2348bbf829f17801d1444142030a
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.symbols.gz) = be8fadc2f971b5ceae719fe76f121a1d394826c0509d0052eb681ec3398e8944a8866c45ed213bc1a07ccc0306ede8ec3c28c1415a26bfc92721fe8a90ec8c86
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.symbols.gz) = 8be481d57e200549bddd24d27e640fc192758aa8
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA32.symbols.gz) = 23dc546c19890b5bfe2981a4be93cf61
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.gz) = 774d5ac21ea9f3b0d356a7de041c89afedd85cb4
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.gz) = 228797b395c498e531f359c59d8a79f336138923e95881c1506c9b1a772865b6a7df96be8a05e62a8f3a3b791e208173e35bc6ac1ad29d8c62b388620d3bb828
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.gz) = d84a8c78f5f81c897066771fabb70dd447d423ab
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.gz) = 9392b5ff6a21a0f043f4ba6e9ff14a00
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.srec.gz) = 028bf1fb8a8e7f1733eecb45b7016b387660558c
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.srec.gz) = c7d3178f2dc591e1d39e8e04aaae780cdd38c190d850d0b71a0c69eca7a8dc29b8adb300e106a236e9fbd7ea9e85dc070bc5ae6baf6bc742aff4dbafca91c00e
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.srec.gz) = b4f76a19a3119f6b35830db195d0db3b40b962d7
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.srec.gz) = 6f1c87fa36192f6cce9fe900576de781
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.symbols.gz) = 05ebd0d64d73f452fbc31f9a7945fc1503bfa23d
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.symbols.gz) = 839eafde2ed98b6be776ad75e591c23a295aae726a2d384fa1c2f9e52333f1d5ba14c21473ad5d7c51098608d04b055cc163e743485556ac30c75a5a913f0422
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.symbols.gz) = 6f1dbafcaf7ca5df8c47a61b5f6d8805a209d7eb
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_MALTA64.symbols.gz) = cebaa3e1af8c79ccb42a92f25140c653
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.gz) = 039e0a1c46bd768a34bd4522d2523018429e6987
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.gz) = 4914b5675a4b3858c3feee1eed653a75f0708b84c12d80a82715502fc9e2761eef8d23735ccdff6c596a93fa3e01ee69dcdc39cd44b5e3876722134ee90ef31b
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.gz) = c0cb5df60249fca57ac322b2cb8fcc6f90645698
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.gz) = ee03b9d28419f05275ee663b8b9d0ac9
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.srec.gz) = e831083d34e0200ed793aee4a890a80f518e1ab1
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.srec.gz) = 7cd35c5f5ed1ee14dbabfa9c7d89a6ed592e37b66676c1a523422d24830a28507afea99d6408dbe436d59233703257684a9cc765370c98dc23de78f3931b50c3
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.srec.gz) = e6de2239f84cf7cacf8ae6b1bb62326483a1c62e
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.srec.gz) = d7de63125741840ff89a6dff9fda38c8
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.symbols.gz) = 5aa1511398191686462abbd5e20ab6e6b56fb325
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.symbols.gz) = bd4c5f4b969c6c5bbb5d424c21430a3c1cbdc1f6d40a60842402ffe2d812393e0556ef6b7fade839a117a0ec601359127fd2957d35bf7468217c9adcaca53e70
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.symbols.gz) = 6a2fd527f96c49423f58f6f8363e0582e2b894e9
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX32.symbols.gz) = d0654f9677e051fc34fed0d81a27e528
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.gz) = 39ea7d6f681981f11fbdd9e63473e4dd69cc2f9c
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.gz) = 41378a129484896d4598dcfd29b1f65cc462c5746d4793e973b7912ad10cf3f1e487701f4d3267ba7615bb6fbe9390a356f1d89146e8f90d7bc8aa57ae575dec
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.gz) = cd77d4e08b77ede06fdcacf53cac8360b115b11d
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.gz) = d736cdad40ba2ae3beba484dd5a5ce05
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.srec.gz) = a2fd46154978cde95b379f110407c52ae0c688e1
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.srec.gz) = c778ee1c88dc9aed20d7113233f43660258d1f7616e611d8e8df413b9db1e73039fe422a9ddc8c02039baea5bf5434f660fed57148f13ee641e339f9277f2c51
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.srec.gz) = e98d08b85f6aae19176ad570f061f4ac14c42629
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.srec.gz) = c2de85181edf54b18fbe495d65faf32a
+SHA1 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.symbols.gz) = 2808091cbd1d32e9f38e7c38e7f2a0aa8c66e617
+SHA512 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.symbols.gz) = 7c4157a809dec6f292fafd1fa21744932e8b0add59d2f3ea62c4536d31e14c6b8a24633354cb4918dd38fc88695d373d356dda7e93dfb77f83c6a6fcf6e70b54
+RMD160 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.symbols.gz) = a31fb2125afada861428f3b416218cef7a641caf
+MD5 (NetBSD-6.0/evbmips-mips64eb/installation/netbsd-INSTALL_XLSATX64.symbols.gz) = d727b2cd38e49bed46bba3a1d33f9b97
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-GDIUM64.gz) = 938493a6f165b0a66e87d0ced332116b3e5fa1e7
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-GDIUM64.gz) = 05906bce297394f48bddff8ea2a92f527ca5a673c1ddad6ee776eaeeb5298c562e01b533288add57bf39239c9cb02e6e8f3569c4430b658bf99b0bac61245aaf
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-GDIUM64.gz) = a2d803c0597759fcaebb669d3f4ccb7d008d2e9b
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-GDIUM64.gz) = e1f26f59ce4ff562a5c8e6f8bd511a0b
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-LOONGSON.gz) = b717b1950f7e2ee2745b74e32c9f6cfc7d7ca15a
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-LOONGSON.gz) = 47916c7dc402df96876307fe31e21de43b5dcd6a57425d2454ba44593c03b0852b6dc1c5822880590a14a91717e7478314e6ac0a099004596f4d256ba3427e4b
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-LOONGSON.gz) = a1c0e2c2ea412fa4a49fce8cc1a366d9d373a5d0
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-LOONGSON.gz) = 7da6b1ffa558b1b211fe3702c5837e54
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-MALTA32.gz) = 7c79ae79c6672c73ac03b88dab24103a01a86658
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-MALTA32.gz) = de76f96e25bb798dfc28c0e186676833392c47a47e9eaa9c0883f9ac43f89946addd61ebfd3c91a9556eee4bb218f483053513190242abe472ddc79131224081
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-MALTA32.gz) = 325db86c0e99e01418f70575d75c3285ad586bad
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-MALTA32.gz) = 67b5fcff9d18ad156d0c028ab16ba081
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-MALTA64.gz) = 8c7904ebdd030a94458f13ac7c11df832929cc86
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-MALTA64.gz) = a51547232434584769c0a8ea108bff1425e5e96f1989224b3420863ebeded4a3cb272b6873e3fe860aef3658982bcde844d86fcb46d79ce647b6969e6758c978
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-MALTA64.gz) = 656bc08ab196ab9e4638804a5ca840327a8a31a4
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-MALTA64.gz) = 8cad946d5e2a395f26d8f18eba137ada
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-P5064-64.gz) = a228a6982bb8c5cf468860e09fd9b17b4307f356
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-P5064-64.gz) = db4187479c550a71c23f9bde6cc8dc50d2eb758293b293c7444a786ab30becbae9e150c12ef3fd55a42df1b88efdb937a7fffc48457c20c5441b082e0c0e2745
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-P5064-64.gz) = 8d9bc3f9d1ea60e3322fac87a3c9ccd43a54055d
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-P5064-64.gz) = c318ae2623b38a290cce71191c6c6afd
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-XLSATX32.gz) = 2ef72f56c819a2bc0fd4d48e463161ebef9551f2
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-XLSATX32.gz) = 4b80ebf478d77d91205ab2d89d2459317c4b61bbae18646c2c201fb4ba1ee2978f5be3a87ad33c83d9b139d3ffa077a4bcb3e315c16fb68f116b802dd2217637
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-XLSATX32.gz) = b5a20d970f5ad8c177c6244b1e527ea04c705cce
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-XLSATX32.gz) = 34ceee3acf4435335a43c594dceff98e
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-XLSATX64.gz) = 5bf585188ba90ab0231e99247967eacfff520cc8
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-XLSATX64.gz) = 20e39f09067084fccb2587a05a3820e50816fb3f097e8e89cb07091c937fe97aa27593948fa3466f9a5d6835a8bd1bfe31268a2414c6c8694fb9fac156e68f98
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-XLSATX64.gz) = 96ebcf3117c2a1f60b50ba1de3852898083393d4
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/kernel/netbsd-XLSATX64.gz) = 335908a4efd612fbc51487db37af3eb0
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-GDIUM64.tgz) = a09a36dad31ab7a766bcddea3fb08807d93819bd
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-GDIUM64.tgz) = e3876e7f4164e117ada834e6769fd3357d144fe36779a197573a8ea735821150fbc6c4b6c2b9ea917b14b23a795e4db7e069cb8e121ac3fe9ae5e0296400d065
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-GDIUM64.tgz) = 945ea08a5fdad4d8ac8504212712b40aa01d1443
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-GDIUM64.tgz) = 2fcaffaee00d469cb7f2756fdcfd2fa6
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/base.tgz) = e7550ddcf5edc7c3c27f53b7e6b4636f744108c7
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/base.tgz) = 0096eb300e8a71093cbe3e84830ff048af73e85cbbad1986390b8838c50ab6bd63cdc201062514aa63529c2043e1a2b2428cb2b50fa2bcb9dfd4ed11e42febdc
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/base.tgz) = a5509e8f5a4e5aadcf057710489fa4105dc4dcbc
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/base.tgz) = 76f45332e5fae1c999dba2da97f92834
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/comp.tgz) = 2475e5bc61cb7084e06f111d6e24e3ef4527ab0e
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/comp.tgz) = 5ca83f2b42cd3145d3fa5c88e72dec3509f52f63bd0e5ac26f752a18065473ea298bc0e88cb0b954a06d3d7eba5a9afdee3087feb06079e9c76cd5a0ae3a6759
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/comp.tgz) = 8bf71a3552e3e9388c85d5426530e58d2ff15f9f
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/comp.tgz) = e8dcb0d4b7b5acbf8f4603be69f4e9b1
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/etc.tgz) = 106b0102ae77486072a61db71016443e4a63af9e
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/etc.tgz) = 386948f2aa4dd140bf17c9aa0a8bd0b41096603497dbb9792454fa3772724312a3a2ddd3e69a7b1a710e6339f799b5174b16f8f91ef123ebde548eb47aee4e90
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/etc.tgz) = c704f1a292af8fbfe37a9a61654f8e8873b6cf49
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/etc.tgz) = ea16b2ab565706b8038b459e0519936e
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/games.tgz) = fbb547d701d95fa7c9fedb8ce1616fa73dc0a962
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/games.tgz) = 9b0c4338c3227f974305624f0ba8756836f156f3d3f9bbb1ec3188ca9ec2de344d5ff3f8b9969180e2c871cc0b09b12b9e6311e33ca548d59f4596a04224f14e
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/games.tgz) = ae8ec9dca5729ee4203ff86e10ebb16379ccf5f5
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/games.tgz) = 18b0244267ae2ea671632562ebf493c2
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-LOONGSON.tgz) = 8da37bef5b86301e6e5741969aaab713752c2866
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-LOONGSON.tgz) = be868f49e960bdee048cc1a717d17563c081afdf2a258007312f306f14470159943877ef29d0c3c783b32682074c299aeb2b48a7623bdc4af2adaf82ee9b52e1
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-LOONGSON.tgz) = 10f65602b7dab9305df83c26e670221efe1b452c
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-LOONGSON.tgz) = caffb25555770c6474b23e6cd028e82e
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-MALTA32.tgz) = 7e5d386cee62920ecd932af45ff4a854234edc8a
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-MALTA32.tgz) = f5e9bb4886260c3eb0b18e29999047b1f39692be5cd5cbeb58638604efae408f167cbccb81d2fc6c601f20515955b48035113cc2cb2e6d30088cd9750fa64465
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-MALTA32.tgz) = e0a36f2148ed78c4eda1c26e5ef0045ff6b97e22
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-MALTA32.tgz) = 3ccd62f53f80b0eabb9baa2a29a691ac
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-MALTA64.tgz) = 225382c44befe15c46b05f2f052718bd80dd9a7d
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-MALTA64.tgz) = 1c1a13c0b73098d14468cf12d7744f79696773698adf94e622afd95e436560fc4934d3b02390187647a9d97effbed9162542149fbe06628cf38aff197faaafd6
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-MALTA64.tgz) = e5ae37af03461f04dc6550141e4c2301dce51ff2
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-MALTA64.tgz) = 672129c4f8f0315c9b374ac5651f82cc
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-P5064-64.tgz) = a41b86f2235180b688882c8eb2959edcb48c81ca
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-P5064-64.tgz) = 9db6c584144a249006a671894e010fa0674e62e6abc60d43441462d1f1478bf4b1f9c6d9b46f14a1e9ffc3f7641bc206f5ed95c90b405e57f3f40e54d74aec92
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-P5064-64.tgz) = a7f59b498f286aeffe614b4ae43461d8a859f758
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-P5064-64.tgz) = 5dc76b6c8b5b49b757dd4a5dfa370420
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-XLSATX32.tgz) = 9cdf4993097b04929dbad4b76c5bbf0cd6796c7d
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-XLSATX32.tgz) = 171bcfbb92a1c1ca96dc14707604998eb4c5760179e9781da9b0ad18ad9695ea44d49c5cdd9ac9250a7a60e08b336daefa9a6efc2f172c9a70d10417e4643b0d
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-XLSATX32.tgz) = a1a517153943866b07fb5850644d1079721fd131
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-XLSATX32.tgz) = f68253bb53367876e463884c2a8eaabf
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-XLSATX64.tgz) = 73dcbbb4ffbd263a8ab68a5144b16cda35e14272
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-XLSATX64.tgz) = bee28f3a052cad0a8624729675f28d42847b7545234f98e141c180e851a3f2052236606c512f1a7515c7ba115417eb8e8a9ceba2224a1c5915ea44f25cd99abb
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-XLSATX64.tgz) = ba17bd15f5e3b131ed77687817b58f8a1730232c
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/kern-XLSATX64.tgz) = 0a2ea3efdd4858019a64cf67994cbc36
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/modules.tgz) = 4ce7dd5ecba275042042fc283bf93453fc57b2fa
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/modules.tgz) = b90e1c87a5ad7981bf51e9fd33b2614d6d092c10c6d67a242ebd814276dd116ac660d9801ad02a5b9b09ce58e3c2aca802322c97ea73c9e270f88d1162e7ae24
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/modules.tgz) = 73d91a2e36f2ec78fc3aa1f2c2af0d2a2d9174a8
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/modules.tgz) = ead882dfd50f9421b51a5fc5deb0151e
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/tests.tgz) = 441100d5b3275b38c206eeb86a9153084f37e613
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/tests.tgz) = e3f33662a577ad2ec975b432424b5d2c2b3b2b742d5e2ce37043cb1820ba225b185638c5c88a34fe05af9fa0083db918074cbb8f091354c35e8f2fd121f93dea
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/tests.tgz) = 64e119a7b1ed5eec0151ebe0ac8c6d2f362e8dc0
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/tests.tgz) = 0d6eedfa2f9aae4c8f0055ca1a358c66
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/text.tgz) = b7f32924a9d2c54824fb19b1bb3158b2996a16d1
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/text.tgz) = 00b6a2831c439c9a5bb07023fecbd7ac99285b2f08a2eb2ba00ace828eaa4cb5fdbd12c339170b9235713d9936683837214389ebfeb52c9bc4be07bcc0df0e15
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/text.tgz) = 6f72bbbef2e15bc63b99ae7419a6a68f3a82b7e5
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/text.tgz) = ec982ff4007c1082127af777e978bc85
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/xbase.tgz) = 2e87de8a350d32c3529222c0195e8b89a03f1192
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/xbase.tgz) = 65ba278254dcef89f1cc464487921995413a5400cf0a3388eb987416486f96f510c91569b6c3145d687e05eedc93be79bf54374c67fb33ffc57eb2b89902d096
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/xbase.tgz) = 7acd24fa398777d99977da6d6080c89ab8a75ef3
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/xbase.tgz) = 5535460ce0de58bbbd1aa49741edc463
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/xcomp.tgz) = 70a07fcea399d1032660b185c2d9ac6486da8fbc
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/xcomp.tgz) = a803322c59fef449066d1d2e42beec42587e40f6134f5c62d475440a01fbf93a91aa9bfae96b89eb6394e2f20d925fb85dc23754bf8600feb40cc98a9beb844e
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/xcomp.tgz) = 12a13cd5fa3a63ddc24e4f4bfc6d35ce99dad31d
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/xcomp.tgz) = 0b455b3722b1429e0a134317b8dbdea2
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/xetc.tgz) = a95c9eb9995be3639417ed3098f7ef36baa0d729
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/xetc.tgz) = be4544652b01b9161ba2f27461ed723378712d0b34058ba5a16de3cc366a5b551f0e8e7b740404eebbee7ae656e7745281b7d329068bb1aedf8f757ed06e9f98
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/xetc.tgz) = b7e1bac15f5d4dda393d5e07e2b26d3c3877a01d
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/xetc.tgz) = ee2771391cc229fb9bea94f455e841e4
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/xfont.tgz) = b985c741b487ae0e65ca36e318c558c147d1eca5
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/xfont.tgz) = 3da2aa9b1cb7906f515d0c02d67a8aa994a0022189dab11428a28040f57f5ae3cfb758cc7676837aca3479bfcc1e1551afe592417b59ad79b80a6392d6f34929
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/xfont.tgz) = bccdaaa5821219a03bd67a57320311b265a19e94
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/xfont.tgz) = 60eaa14a01f682577ab5b1774fefd7b8
+SHA1 (NetBSD-6.0/evbmips-mips64el/binary/sets/xserver.tgz) = 30134e060bc2ad1df81dfb637ec9d7e35bbc4932
+SHA512 (NetBSD-6.0/evbmips-mips64el/binary/sets/xserver.tgz) = 94e7986f96ec8b41653db1b4c05d0237c614678b43f1a52ab3b40c5627ffea2c7e91ae3e154391b964dc36edbd60aaed767427bd50eae5306beb0fead97c0346
+RMD160 (NetBSD-6.0/evbmips-mips64el/binary/sets/xserver.tgz) = 2423334e389526cac76e76fa0fa38fd671e0d3c2
+MD5 (NetBSD-6.0/evbmips-mips64el/binary/sets/xserver.tgz) = 508453785f0150d7115610f4ab1f0ae9
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.srec.gz) = 3d7cbad15200cb0e18ed529e8d65768503bd0a96
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.srec.gz) = c549dc552ae2b10bd3d8b6b716d6a107e5ef6988a49b2ae1292b40608d217cafa8bbb77974c3e8fe9291820bd534b0713c1136a09c173c282384f2805cabad1c
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.srec.gz) = eb53ea3f18593ad0a8d23ab92b8d78e590709cae
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.srec.gz) = 6c0fbfaa9cafb5799820bf14e057a5fe
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.gz) = 5f370ee3290556f0df9346c1c279b4cd239815bd
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.gz) = 8a7770a9dca3bd6bb59525c7f5340c9347d7c315e6f54c719d5f46312e0ff25d1fd6ba0e31d881ee680d904534a71f7258c49c16e706a46cb6ff0ada537630fc
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.gz) = ed1b7878ae50846b27db943ff3f82d0be2e4bd05
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.gz) = d935eea2ed1da5225fd8af96482ecc08
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.symbols.gz) = 0f65b3f9550c07786d711dfa98c426f3601e0f01
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.symbols.gz) = b37c854b5a20cd45da6e1fb4132a0fc8bf1234ff08294168249a3a38e8463a9c52fc9863af80787c10ae62e1bb17be087cab605478f5fb29dd615f8168ea9180
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.symbols.gz) = 1365f99730e4ab317d1d35e73f2eb5592680ece6
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_LOONGSON.symbols.gz) = af18fc0829c787d47e6cdc7e6146413f
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.gz) = 24b04245cb3bb8808c2643f6efa74677e18425c9
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.gz) = 4d76662f4aaa9fbdb3bc3e807eb716804f4ac070e8b0e6def5e9c4c816ed456894bad40a3b51ff8f68a21b05bee08de02e7fb1ee1ece8e625884dbb2bccd9109
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.gz) = cdff1dcb0aecc09f926915055769081acab42201
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.gz) = 06cca864f41f90c5f0bd6d95a57ecc5c
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.srec.gz) = 5a432e451fb73617b8377b4f479a6eaf611bac29
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.srec.gz) = 3f92a16819d8452f7d105e19d803985832f89e1d6c09b067d6ffe4522c7e924707d9411535ccf838cdec3b7fd1fa17cd7cfbb6e2d3bd369690dcd9094f5e10f3
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.srec.gz) = 71a1e5b455df4458e1bb4ec9d45b4043bebc5788
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.srec.gz) = 98534235eaeb7626a485458779a0e6a8
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.symbols.gz) = 2f3ed468ae1a3a4082bfd5412bc11ee8d8cb90f9
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.symbols.gz) = fc3b4ac13b3c951037e30132d9178dd79635cb78adea2b97046ef6d8a8486bf9b12e43d26897f32f7db967fddd048c177acbb5585b573bc2b9c80374b59c133d
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.symbols.gz) = 5e863f2e95a8623056dc32ea5ba0265876f102df
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA32.symbols.gz) = e84090937754b1d91357b759679a2ae4
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.gz) = 3e9f23c9e3f15de38a7e0908f0253d1f23e49a43
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.gz) = 57cf422b28f5442c105e23fae81119e993b543e3eb2c344ab5334e8edb1018c54f3b39245d1bc4091b8de4e28fe78e357dfef31bfa51de174342ba881ef9cf45
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.gz) = 9950fb85a0100463810fee9d0ab79d4297e94401
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.gz) = 571361834195d0048cfb4c2bb13faf10
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.srec.gz) = 03a6a6428275c9f01f514031f5c288739a081850
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.srec.gz) = 4165164e3830c5dd897107c64cd6dcbb27edc31e32bf6cf7305fe74024c467a81e703ed1be94071c62cf467eab89ecd66b3b72876fc1d8fece4792dbb8384255
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.srec.gz) = 68586dd9c3e823a26a5439907f088772a5939b88
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.srec.gz) = 37ec696958709fadbfe7e08fcac3bb57
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.symbols.gz) = bdc6c366da273e056df2ea2bd9d92813b61f5b36
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.symbols.gz) = 574c80f478e5f87eae6602a8e8b6d52df19061199f2e78d05bc6e662daca5f9b6aef26dd4b543d24e557b78aa2d5f0a5e80aa9cdfca5fbcdfc8a4da7a84b95d0
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.symbols.gz) = 4f8ba01f1ba53c8b8230a974d7c8aa45a9667915
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_MALTA64.symbols.gz) = 5e726ecc87a4406b10e5c11cbf745a7e
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.gz) = a21c899aa2389958474b94a057e7356da840589f
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.gz) = d092b4d17356ed34a9a7a79838b76a487c35d99b26671f1ddfadb85db810bda74b3db64f7734e30114429cd8fad87f13c04ca462c6d3bb56dc1f78855d7b9def
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.gz) = ae46da84fdb8a17e60c91ef88049989eed666a96
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.gz) = 1ec7762cd142ac3eacfad76ebd7f018d
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.srec.gz) = b76ec124d80dbda9a425bd14737ff88105d4c053
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.srec.gz) = eb446974d31976ddac9313a0a45ffc084dea1bfff75d18e6544f16cab3333dcaf6e62cff59b0cf88070985c1ab7a4c0285cdd0b54eb75d73f538d45a80be9256
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.srec.gz) = 1eae8b53f9ad020c3a39d67502e74888059125f1
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.srec.gz) = 3c2a22221dab7153f7eb41daec3a4de3
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.symbols.gz) = 0be09076adaccfe13864e71c9f1ed8085a515401
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.symbols.gz) = 7bd72d9d584872ca346e2ee6eeebc8e8fd06a7e655acf621ad1b849b440ff66a33bf71650738a074732845c2bde24acb08e1b457e08abde3234d2972da370773
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.symbols.gz) = cfc81eef00d46e0c1deea04c9364f64e87d637db
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX32.symbols.gz) = 11e04b25355c8c60ba97c142c21ba8f3
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.gz) = a68f5f892312208526869378614a6c38f0ce7ac1
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.gz) = 7b298f7fe80f77e2283c407af4736c643e3b0d0710d43bbe809dda43660344caa948ebb07727ec80cf19065eb1a30ef24c68d0249d2cbc9598833c14f36a04fb
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.gz) = 431a3a8bf7ea9aa86b7c82075a2c6272ea9f4938
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.gz) = d1cfbf1aea636ec7f9b36760eea32d08
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.srec.gz) = e766bb842b698937ab7252c0bf6f325f1ec2c7b6
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.srec.gz) = 832e277c2366f3379f104fe68aa927b3c7358c40df62f393419ae9f2fe30a989a532f4d4cac8dd821ea07c5707246329990e64ded734cad1c4e755a59cb59402
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.srec.gz) = 44af060baa21f3c09fa3e283cde72a7171f6e6f2
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.srec.gz) = 058b4dc450b1e2e5fc14136e4ccf3743
+SHA1 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.symbols.gz) = 5130e72edc460e5bc620f9101c6b260db4417ef3
+SHA512 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.symbols.gz) = 53360173909b40e40ac018fa0f5211a74970d3429c85c182f59a6ee4ce782f54d707f2d6205d9bb5f4fd5b100b074babec12bbaf178f74b867cfba5964aa2ec2
+RMD160 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.symbols.gz) = db94d2cc9bfc2eb2fd44e87d47be4b273aa7533e
+MD5 (NetBSD-6.0/evbmips-mips64el/installation/netbsd-INSTALL_XLSATX64.symbols.gz) = 37e4e9464364847ad2327d6352019047
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-aumac0-ALCHEMY.gz) = c8b43df25bfc2e9171d6ddaa73b436f63a9c7085
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-aumac0-ALCHEMY.gz) = 73d80744cb6154342f5c3d36f8849c2a9686c1318fea913b840eb97e3177f1b225f4cb9178a9e15b4cadae35579c2258b38d180d1aedfb0e9ffa00543b1cd8e6
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-aumac0-ALCHEMY.gz) = c8e8dd4c41e4e88fd7bc0c34420df32a00a941b6
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-aumac0-ALCHEMY.gz) = 53e030127285e17b67640e9fd98af1a6
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-ALCHEMY.gz) = 9f738766737db8cb0f2404c4952bb75cbf407669
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-ALCHEMY.gz) = 1298e944b4d8495905e6649476cb8e1bf49719abf2d2fb3ae55f5e1416a2af3234310047926fc261264bb12b8c40d09159a42cd978297cd6ee4197249a34561e
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-ALCHEMY.gz) = 53f5c1646d7811b99d2a6bade48712647802264e
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-ALCHEMY.gz) = 7315ee909933e50ada51ab5652ad0d2f
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DB120.gz) = ff83b1a41048bcef21a723c356d5e762d1ae697f
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DB120.gz) = 400430bfab26962e450f73640ca169fdf4f748ff34c63dac1edaab893f58a3494a81ecefa807bd80cdf846213d004dcedeeb0b57e785436488c26a66c06ed685
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DB120.gz) = aa36f1124c77777325cf30badccc02f2353e9065
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DB120.gz) = 8e6dfcd4eaa37591d2648cfbead5b650
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DBAU1500.gz) = 5e4747aafb2621b40c0adb250613225090d8f219
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DBAU1500.gz) = a24d3164c5f9eac497b338e99fd04881e9fb3ea1e25844c4d9927383f306b9d0fe16e26f61e33ca7fcc47be9e6b1a04b2cc6b397f51187e49c5683714ee4880f
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DBAU1500.gz) = c90b133fd12b1327cbf8cd0229df26d3b71774dd
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DBAU1500.gz) = b691ce9b6e0e31b0945fb7ff041e336d
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DBAU1550.gz) = 62ac90542124d3b65582b7c5667e545fbd7b1145
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DBAU1550.gz) = 29622cc0d471a80ab095fda13f2d06ac32d4757d2a2ce4c4c7a54b490b6445ee86c702007de54ac9fe81515566d7eca3805f2d1c4d842a49d8c752df4d09099c
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DBAU1550.gz) = b624724146136eaf312d9be3cead0eb8f55445bc
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-DBAU1550.gz) = 0d30e656a06c9c5ab86c9097e08b2ca8
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-MALTA.gz) = 83ac7456a68f04283e651f472160025d9af2b256
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-MALTA.gz) = 1c36d9ef350ae385688a4300af725d1b2ccc94ca3f6eded04d54ca2dcfceb40d5ef8db88610428051598e7a1504340ab86bfda25d96bfc3b454aa74f0f35ece7
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-MALTA.gz) = 59acc8c3c660bf2256966b58cce5df78cc6a4da3
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-MALTA.gz) = a64c723ecc8ff566fc859d155bf288a5
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-RB433UAH.gz) = 8af25f51ed2e87eaa234c4bf43a0c8adefa3c267
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-RB433UAH.gz) = ecfff13379b5e6a657670f69aec3ce471a593505e0f6284f80c0b4f3c4c903bc9bb7d9cf0c9385e0b0f5288cc141bf5c21e56250ae17107f53ca38152fc59a13
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-RB433UAH.gz) = 38d8fcad12171bb0209eaef94e137483d6d3f5e5
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/kernel/netbsd-RB433UAH.gz) = da92ce6119755ebd89fe27c24f452aea
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/games.tgz) = f56d3e5181634f6a3d7908dcb002ebcb1c5aaff0
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/games.tgz) = 0cff50ea13e34fe338edf70da6a28af061580feb4cb0773828adefa631ebd471a96568a3b30ea0f13f3bb116856a1b6aad8a5a52443346f52e4907f4caabc5f1
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/games.tgz) = 1538910578dbb8eee2931200fac0ccda44758e5f
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/games.tgz) = 2bd5bd0ce72df5cf92767b8c3f7cc208
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/xcomp.tgz) = c8f5ff5ea9f9bbe231f92d8b7f3bfcbd2897069f
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/xcomp.tgz) = c7590075195019078b68ec5f87e36479ae2e7b7749c523df4ef21c9d881c343cda9f5c2bba897dd313329a76fe5c18e920d92827878d98ce08a7dc776352cd02
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/xcomp.tgz) = bc60e267cb6e11b4a7305f8b7074084e179e0ff5
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/xcomp.tgz) = 8e58ee51667def3bd015f79769c0d932
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/xfont.tgz) = c551bd13179b9508c2e3a7e19cec323e8ba21844
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/xfont.tgz) = 764527f2f3f4686759fcae3fd093f4e00f34e1249994126221a6f9afe73d4cf8ddfbe8b8311798da2ed38c52466a44bb26ea08ad5aab1c08eebcc9019b4223f7
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/xfont.tgz) = b3a365bedf8b4a20f3920d0e33b9a42fce288953
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/xfont.tgz) = adac8939da213a0195cc1d351f979199
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-ALCHEMY.tgz) = 0adc8f742c596217127185e8f9e4db43896d9299
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-ALCHEMY.tgz) = 35865aa4e39ecbf9c8f4e48ac85b804b571b1488de729cbbc5663deec75bdbf90a229ce99473975ea46715d502442497a596fa35ed89e5d3602c3b1221db6676
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-ALCHEMY.tgz) = 8a4fea3817d615408966528475869669efc69701
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-ALCHEMY.tgz) = 94e9d6a99aa8ad762dfd71d5c2c5a410
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/base.tgz) = 152709728189dfceee8db96c9b793229d80514ca
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/base.tgz) = fab7d3d262ebc5bff7c6edd891b967dc10f4c274b33da21a874ef874ccd1f1917afef30cccc27efce5869296e9bcec95584fd6109a48abd94b958b231a5e2fbe
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/base.tgz) = e52f8333537d524fd1580d0b07c9c63414fe680b
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/base.tgz) = b2dae13bf91a2929948ee84429598111
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/comp.tgz) = b04647e2ea51827ceff965350bff9290cb4e1da7
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/comp.tgz) = 15b6bda11ff6d85a0e1696a2fbd174d1b060e606f52e7447d6c25a48de41f03e99e8601f098c6604608e3a056096c8b17ea6865802db353a018860a3c563d387
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/comp.tgz) = 0ca46bc47c48ba36c8e56b9131abd9d61d5c7ae6
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/comp.tgz) = 5917382e90e63ec66e687546760a8532
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/etc.tgz) = e55b4d17ca25e42c4a0652a40106d64eda9f8096
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/etc.tgz) = e6286e75f5ec6591a53162c332be61b976e4e0386d429aa675cce295ed8fdb90d62287b244eecd0e0341235a637bbd593f50164dc8f589ac4f969991d2a3f0f9
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/etc.tgz) = b45e18e794d732b11dc8eb3ef733c2dfdbd0155a
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/etc.tgz) = 2a4d24ad39ee26ad3bf2a6c9d86381a2
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DBAU1500.tgz) = d6c5b3f1074c70e13e1388d68a1932cc11b6a3ff
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DBAU1500.tgz) = 6ed5b668ff52a75aeadbf11b1096822b97f01af47d8b6b171343feab7e10258cc02b04e151f37995bc85cf6a7c562c4404181c8484a3aa3d593ba9a2c934cd04
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DBAU1500.tgz) = 3f5750e9b576ed3e05624052d5f69103eb32c61d
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DBAU1500.tgz) = a4513305f6d3e69cc52c47047d89de2a
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DB120.tgz) = 2f08fca9d13f265f4d560740a55bebf8b115dc37
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DB120.tgz) = a4a2c6e1711da7562520ee189131e499aa65ec114f713cccd7ccb94f55d9e845a253607ec2219284df1422ba5492a0f24004b8088601dc807aaa2a925e14bcab
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DB120.tgz) = 018c1be32ee04724b86fa2ea173adbe460f63e50
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DB120.tgz) = d89deab24227d2179a680db2c9477357
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DBAU1550.tgz) = efd95e1f98f8ebc28f7621e5696b7ac148091aa4
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DBAU1550.tgz) = c67276ab70bdfef9c8a9b9ace43ae950a686aa630f0bd11fb06c533cc463faf41ad1bb89d5a6f2cd6d4d04914ada697da20ec19924720aeeb4d5d1282393cad6
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DBAU1550.tgz) = d91cfd72640e117cf952ea3978af6ad106fbed88
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-DBAU1550.tgz) = 1e914a5acbbc55fdab0a70d059171d99
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-MALTA.tgz) = a5da116a64f3b9e840cd568391f7f755a1ca3f14
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-MALTA.tgz) = aef284a501e6b2cd16293a5689c5c798dc6bfdc0879fe2cf212b43a4f9d33e9f7dc863f7020c6eda08c8958e713412e5b531e0af799c4695d327c4b66206030e
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-MALTA.tgz) = ed3afb30019e8ac95a9a7348c9099827de561edc
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-MALTA.tgz) = c85bd4c68c3458f9581c45a240f5e1ab
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-RB433UAH.tgz) = 64f38dca64142a0a8426e216cb8edd0884551603
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-RB433UAH.tgz) = b0904e89e80ee6b16f9a97a36974ac5e8a4a7ca8dda9e5f4b27de218fd824d9515ad446574337139aab25fb290c6a93a177f4ddbae7b7a92c8daf5586c87f727
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-RB433UAH.tgz) = b5e20de5b71f3f0880f714b49e0c39a54d19736e
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/kern-RB433UAH.tgz) = 687ac6220a984373b976c5e73cf23240
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/modules.tgz) = f46c0e5db2b77d898161bf6e3ebac55b05413047
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/modules.tgz) = 04dfd0379e10923c47b740c5ceed84f69beecf5a72f581885e5c4dddcf9d241499578e6b7a435a119ef8be74909878620fdb700e6638ae119da59c635883aae7
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/modules.tgz) = 1b674a6cc66d8c1362d66acc69f99f1e0fd70bd9
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/modules.tgz) = a3500877590cea3b09db38130581d10d
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/tests.tgz) = c0a06d6671f0141559bfc80c076fe6f0b2d87003
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/tests.tgz) = 114f7f7e299614296fe2b272a172b9c1d77da42dfe09064c6d9fe9a6450322a38a3c1fc403348aa536d2039884899200591b59d653a3a7d89d22ea22b1750b29
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/tests.tgz) = 4833a7fb848401385159dd129da45d96a9a7b180
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/tests.tgz) = fb54298f8aa3423bcf7bc43b3fea488e
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/text.tgz) = 91921b0be07535e75e97288e49ee2bc0b3c9949b
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/text.tgz) = 336ae450c79b99cf2f2c64a9b378125904c2b7f2d2b6de8eb0f8cd5a2b735cc7a55fe69b599daed3e3e8ef9c51bc6044d994e6dcda85adba659204b92724b814
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/text.tgz) = 3e1e8f989f25749485c0ce9471dedc141cb73726
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/text.tgz) = ff542bf96a0884faa5df5e30d2ac2ff5
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/xbase.tgz) = 6c4272f0ef26a4f32eb393bb479f62b2b7142bc5
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/xbase.tgz) = 568a69f2077f011b98792eb1f71a8b7bf11251f42ca8a082559fd3d836a6afcb7eb05e77331b1cd8b996731c4fddd4ddc8abc6b82cc3c4d9460827e52dde424b
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/xbase.tgz) = 4bcb45e19d2da3ccb065977c5cbdf640144afb8f
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/xbase.tgz) = f7cc64d9cdf50d1c85923eb835bc6dcd
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/xetc.tgz) = 19444f8d1799d782bc72d2684588b1479ee5976b
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/xetc.tgz) = 0075efc99fa5c63bfce8806d5bc083e3e68bb6e9dc885b382353dff0bf55b85a27608318deeeb504833cc5abcedd5bacb45b943bc3beba42e202d08ed368962d
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/xetc.tgz) = 32b296247a2f343a49473e7d54987c6d87229a38
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/xetc.tgz) = 7d63fd2d8fdbb123792d61e4fa3ece2f
+SHA1 (NetBSD-6.0/evbmips-mipseb/binary/sets/xserver.tgz) = 2f38506d78bb7be30d5cd8719f3c137dc28b7f92
+SHA512 (NetBSD-6.0/evbmips-mipseb/binary/sets/xserver.tgz) = 3364dfa7db892eb0c1c92ff50c1e321687300a2cb572da25e55ff501d958201fc3f2d916681778de0879ea20cb31ccf30766038863e0b97e4ca52365b5dcbf51
+RMD160 (NetBSD-6.0/evbmips-mipseb/binary/sets/xserver.tgz) = 9a26ea480f7ff2ce07a648e0004dcabcadb8432e
+MD5 (NetBSD-6.0/evbmips-mipseb/binary/sets/xserver.tgz) = 00b808e0f27ff7924b22f2c74b1f7121
+SHA1 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.srec.gz) = a05b722b902910be1bda3a582d3ebc850048ced1
+SHA512 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.srec.gz) = fcde1c3163e2973f213350595dd38d202524e4f125f14ff48b68f9d569f10788c8796123e051ae72e64b786452f60ac7079ae59390333b63252a8991ee1a1786
+RMD160 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.srec.gz) = 2d4a3c604fec21934e0bf2c4e987c8978aa8bce3
+MD5 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.srec.gz) = ecd58d8ad5bf459ed7022e72580b9942
+SHA1 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.gz) = fde4c37b9543ae150854af55c5c34243e1316c05
+SHA512 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.gz) = b72c9f6516e3ff03e64c6598e153893d6beb5c64997488571bf3aa4547f2f251b78721fb4a23892470c8b352b0ba3a6c95f2e0c8e450918533ed1b9cbebf90ef
+RMD160 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.gz) = c37277dcb3eff20bf03c9319d4a6766d1f869225
+MD5 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.gz) = d6f55d866675b4e51178d7c7daeb7b6c
+SHA1 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.symbols.gz) = baff18cdf467ce42a54eb77e9774c524c9ba347d
+SHA512 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.symbols.gz) = 530df115006eef8bf3f3ea78c1bc1b8a37e90dc460fc8c3cfbeb70422bcb0a9ef52fd116b5b9ae3a9eec83fe60cd3a32fa0933ac0589e2c68c831978e7e988b7
+RMD160 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.symbols.gz) = e4ed20740fecd9b75d635d99567d3b67f5ae5cf6
+MD5 (NetBSD-6.0/evbmips-mipseb/installation/netbsd-INSTALL_MALTA.symbols.gz) = 6c54f00839d4980e95252520ce7a3814
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-aumac0-ALCHEMY.gz) = 134fb77bafabb2f5cdc53713cedd145c6695b5c2
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-aumac0-ALCHEMY.gz) = f21c2b6185b6ddfcca9f1873239ca3855165898d537f4ceb6fec7818ae157ac95b143f559c77be261d4fa3c427e0579d5ecdcdd6047944d0faa94681b8375c16
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-aumac0-ALCHEMY.gz) = 003133387cb76ab3a8afcb59683cd6d117e4dd0a
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-aumac0-ALCHEMY.gz) = c99637f4bab91983011482c5cd8f84e7
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-ALCHEMY.gz) = 87f20bbd047d0c7b793c4ad98ecb01128565e2c6
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-ALCHEMY.gz) = 25a0f40f69c8fa908265a4e757cb64c074f47442b3f9e4d6051e7024042d2685b4e01bf3b0081d603bd633523b8f28c3570b93f5886a4021986b03131175854c
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-ALCHEMY.gz) = 4f0ded0dec635ab37d6e43e5198a3eebb9d5432f
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-ALCHEMY.gz) = 886795f8573d66ada3b5bf8f8443cbc4
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-CPMBR1400.gz) = f90b68d7d1fb37b69896657f4060f0dc1c196951
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-CPMBR1400.gz) = a639799a0431ab22cc468f7168358416ff6095a6015cfd783406b24a6e62f1dc38a978c2c4875cef999654c3f0fa2f8cdadaed5d0283fa05bc56db9ff89d4c68
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-CPMBR1400.gz) = 5265e5e99e360048b07d997d3bf0f73b806f905c
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-CPMBR1400.gz) = 5447c227f2147295b74c3cd9a62efa60
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-DBAU1500.gz) = c298c37feb22bee4f641ede6c29b82f55a15fb43
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-DBAU1500.gz) = 9ac3727e8f9777042fe7aab1613e910da72d07fd5b8277349f2b538f620f6ac34cfe5972fa72a91275cf99ce0e98e062bd559b169eab6cf9700d0065262d2d98
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-DBAU1500.gz) = 45fbbb985b1bd77331e018f10df8d95d17c12af1
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-DBAU1500.gz) = 3391b8ea4799c856e260069f7a4a0761
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-DBAU1550.gz) = 2a32d5bda59467bf957d1dba8f4c716c553436bc
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-DBAU1550.gz) = f5b499dd62317cda4483cc70f65e56d7a8a6be0095dfa1a3836158b6615066237ecc13b3ca66a11545a47a938ec2f2c54c27c8613d16f931ba0b3a8bdbabd2dd
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-DBAU1550.gz) = 52319f5ea1ba91f0e3d762df4580873ae8015f3f
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-DBAU1550.gz) = e55c5185cd7d35ddf3a8aaca93be4598
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-GDIUM.gz) = cd1ba889150b543a42b1abc72bed2da50a4705ee
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-GDIUM.gz) = ba267fc4d44531b95167b3321c4b6f2885902a8a19332c647ea325ba2ab37e7d48a1753d2ebe3991dde1ea286455b1062e56242b0d7804b9db51bd906fc6fa46
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-GDIUM.gz) = c4fc7d36e9e1b9d22f04c85db96894267551ce4a
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-GDIUM.gz) = 53fbc4ff1eabc437ff5546fa12df92df
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-MALTA.gz) = 18cb97fb9b5fa551a4230460d66174bec28a7017
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-MALTA.gz) = 5887e65233675d5584c5f8b9d14ab70b0368ad9c9d6e085470f63f3a37a82d5adfab7306866fa55303cb73668ab8b836082609da77eb5ebb5fb7b05fcf36ad03
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-MALTA.gz) = 326fb5286d584548044d264ce8650cf9b13e3901
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-MALTA.gz) = 06f4d46d9d802dac0954390934246fa3
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-MTX-1.gz) = 95b45facdc9fa0b69709e7e5505e3849eb3c318d
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-MTX-1.gz) = abf3ee530bf7a515fb2f4d93ff50d5ead425232171eaf33ecd9fdc56fb0ee37e976aa918fb3a153b0c8d8b7b51cf288bca1acf7a9a61402d149818e83ff70296
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-MTX-1.gz) = eeb4eac3e382e41631e8f3f8806e2c3f10355a4e
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-MTX-1.gz) = 36da2e3383b17e5bf06844c414dc239a
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-OMSAL400.gz) = 44841ceb6f1af159ff6056ef89884da1f3c7cb3a
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-OMSAL400.gz) = 7ed282421374238ff02c9ca3e413165be0d0b16e1011cdab9d4af9f9b3b868b05d5832a8f24ea396222035ebf46ea3b02b2eb49cf378f93f26d807192a5b6458
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-OMSAL400.gz) = 7b039a86fd581c56153a113366efd278414f9921
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-OMSAL400.gz) = a8bcd078458637f91753faae2c99c8ac
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P4032.gz) = e14fd9558a2cf7405398aec0f3df97f846ccbbdd
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P4032.gz) = 4640b39a386e0223ff255ddb9796820a249e34e25eb2f550cae3ca36d2a3af7eeb2f0133d084323b964b8aa3db93db462db2bd3debdd78388e71eedcce37a48d
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P4032.gz) = 845c8595b29846b3ad87272048e0d5ea18413c2a
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P4032.gz) = c2e071d630599cb393bc13e4db60a187
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P5064.gz) = 11fecb91f2c90740271dcc51a7fe5f78cfd35281
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P5064.gz) = 076c38f8684254a744cb14d592b5f0404d5a7944cbd486b2b6da4c4a1057057029f5f1949f007ad5255d97466ca5ea1b5af047566823526b7e7804280b0206f9
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P5064.gz) = c2e78b4d2da205e8af4b8bffe97e71b78649917c
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P5064.gz) = ae9f3bd2236f924b501fc6d0ae0b42c0
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P6032.gz) = cd8af99e05c16d79b574f176d0229bc363c3f094
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P6032.gz) = f1375dd13b2950afed3a0b3c9217a0630da47ce52fe467140217a2b29706e68354018d2e5c4b0ab7b16a9af119a66b6430cdca1298275dfd1d9b22eb65cd9ea3
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P6032.gz) = 0af7124d320813134c90c509027396730e0bb758
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-P6032.gz) = 277e59364f2ed7160337ec3d20060a9b
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-reth0-CPMBR1400.gz) = 55565c142f55fac5076d21a61b0a5ac8cad002ee
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-reth0-CPMBR1400.gz) = 8db0765cc0d2affa6cf5490d766f577f202c89d6694fb8e57f81c076257242ad47439fa9e3d46c738d2e1dc1bc306f951fff54211f48c4bcf3c27ce672db67bd
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-reth0-CPMBR1400.gz) = 015a00aebbe3f9ff27bbc38e50863794829c34a5
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-reth0-CPMBR1400.gz) = 994571e2665c04bfc5ed50709b09d74e
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-sd0a-CPMBR1400.gz) = 7c23499487a89cd84aa8b4a429b097e8ace4c0bb
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-sd0a-CPMBR1400.gz) = 1a517e528904e379b39f740f0335c93de12e1b9398fa0564ebfd702fa064b75dab85bcbbd44f2f5baca767dcc61cd79bc7415648ed346e2e4d15ff3c2c278bb8
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-sd0a-CPMBR1400.gz) = 95ca7bbed50714a1aa9694362565c4219305a9a8
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/kernel/netbsd-sd0a-CPMBR1400.gz) = df9de39483767ed081aeb4bfe5d87f23
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/games.tgz) = 27d9f98fecb3495e51939df9f107e81e527af26f
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/games.tgz) = 46bb4e10313cfffaaf4f7fa2157474ef940f94bcc9f84b46f829c7615bbf45e4e01edee7b7efb84bc28561e0712c37cfc737f9c2a0d9a73b67c80c8aa0f3a9af
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/games.tgz) = 947feea90ec2698a65d555cb78a29a001b086589
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/games.tgz) = 355f00978fed8e8da6a251e591be5387
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/xcomp.tgz) = d8ac89f3f6ff20abb0adabc49227afdb74aa2040
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/xcomp.tgz) = 4f03213fb061dae9421747209628d06ede6bbb71a7560a9e1a54796b907f1620146a33fdce52974227a21acedcc210b99e15c4fdd36432eba60c1041a92d8cee
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/xcomp.tgz) = 6be5e72b9b57c9bdf8ed8ea127e2a73830feeecb
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/xcomp.tgz) = 59a7ea141587417be38ab1f6056cc780
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/xetc.tgz) = b9f6b1a54ffab37b11f4c6e717b481cd087fb609
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/xetc.tgz) = 72f35e65f3a90967e250a2006d500619b3824f7f5c3d7494554f153ec5cda5b28c445f28c34a1e4463f40da5855e8d4257726411796967fe37763d90cf7fe461
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/xetc.tgz) = 1169c246f91189fd0c4ae86ac27a92f5c2edda3e
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/xetc.tgz) = 8f3c52cc5af1cafaf7b0d0f884a5b537
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/xfont.tgz) = d06848571034f3b7fc975082f1de37b912acb18c
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/xfont.tgz) = 66a1013c935bee5e7e5d24325a527522306bcded7ced63790f2e58831b3ed91176a1b9510b2159be63504d5167d48d534919927ffc6e225ae2bb2487f90a9ede
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/xfont.tgz) = c9502843a5d4dd7e996e8d158c519cf7f8575cbd
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/xfont.tgz) = e812899176eac2bf65a6d949ac3f3424
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-ALCHEMY.tgz) = 5835e5112e44bae1346420ffc0f3e09a2e4f6117
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-ALCHEMY.tgz) = c3b2ad6f9678403cb3a6e0b8dbd05b6717aceac5472eac0c2bad86dbeb30b509f7a8b865daa499279bd524a10b075da08f6fa9736994cdc4633b0f67b0ac22b6
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-ALCHEMY.tgz) = 3b7c2006143846db5c3eab27c2f881dc22ef5e05
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-ALCHEMY.tgz) = da923fa9431ec9e4349f58d50bea5adc
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/base.tgz) = f0e2ba7bc4f19f19c71a28de51c4359ac56a6a44
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/base.tgz) = fbf1b00664f9a8530afad453e1af05ff39741d87187d25e3e5242c06fa013e6f6027d40944ef82fbc12c0ced24e90824a135bdff8ecfd69b04f2ffd03aa8d065
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/base.tgz) = 581b658d659de51923f79c189fb4dc75201aff64
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/base.tgz) = 185928a3ba27f23a06356b0b0df0ff4a
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/comp.tgz) = 66f0609c617456757b6563e94e2feaa2f788d2df
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/comp.tgz) = 83bc3d7127bbf0bb9d86f015d4cded042e1c0cdb75efdab00fd7941a7d96e8b54893b54a36b489d221dcbc17348473ba73287708f031b2ef37e0288074201400
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/comp.tgz) = d8d32c55c767525effee5ea75186373d6c253873
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/comp.tgz) = e56af26f877a19649c558c9d3ced6e6c
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/etc.tgz) = df85d74c9f2767c9be3de45d693f13547ff9e3da
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/etc.tgz) = e06ac6ef086e5951de773f02fe83c16ca1804611dda15b1dfcc0a44e81c3e6e6acf06b94480b0f643ef63e1a90c8eea81b2af4302e82801c033705418201e66a
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/etc.tgz) = 16cb173c32cd73373937f89eab796e5bc987ec96
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/etc.tgz) = 81f8caccfb4f464cf105f293393f6c78
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-CPMBR1400.tgz) = 1da339adf6e178fd648cf87cc4d2b5e1ad0bcc2a
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-CPMBR1400.tgz) = eb2c935de15c5622d5752c949b86965ec587b5c36c5f51ae2b801a9e20482772d1d728563aa70b299ec0316bc71f7754a0c4fb2e9795c01effcafa9123bf2029
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-CPMBR1400.tgz) = 3dd811b1a249023ffa47e31969f4086b9e156a15
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-CPMBR1400.tgz) = bd1349e129ae6367bf0e3532935c2317
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-DBAU1500.tgz) = 3f3199d94860f1a97269132ec110acb983133723
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-DBAU1500.tgz) = 1a1ed387d0902cad78598dba5c0a088e231594d16b4f49ac73c082f5c05f972b1a8e5ab5f28b97b23d696297cc9f334f1c8bff2daeb8a386aebf1930e3587007
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-DBAU1500.tgz) = d7f81fc610d0f09a26d14a082c9a143283d8594f
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-DBAU1500.tgz) = 54e6afe80b72e44b94d994d2465d63f1
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-DBAU1550.tgz) = 22c9cf65d89b9042f2b47316b99368dc0cad4d45
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-DBAU1550.tgz) = 3d2e737026c76a192d4461234be70622682563a14584ba8da5272be018a711dd108fc71f93d8251f8851246f8998c768f4a2f6e81b7985482dccf1fc166b5138
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-DBAU1550.tgz) = bde90234bc61e0105d5b7d1b23c23cae81461f84
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-DBAU1550.tgz) = 2905ebd9467c3a2ca17f776044ac9b80
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-GDIUM.tgz) = d7085296fbaf3357d9b3bdfc107c0632b7855d24
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-GDIUM.tgz) = 8841e72b1c725be15c37489f42254fc84feecfc2bc90050a4360ffc248ec14dce16dfe41ed8950f198c6a13fe78f287ed53d5545a9c0de775161de52994c1c21
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-GDIUM.tgz) = 49552df226923fde73b20818fcc3b88859095252
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-GDIUM.tgz) = e24f2b056cbf42955f24fc45075f2836
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-MALTA.tgz) = bbd9390fc5aee7d91c0fe0651503360f32fa6498
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-MALTA.tgz) = c09a032170d82e55a1c32fc468e6656509c99e9ee2a661255ed92d663c0605e1836afa2a098b40cbb9f6ca16854973733f6aacafafd129ca752c3ef569434f76
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-MALTA.tgz) = ff39a003e6a67114cbf0cac19c38f958cd07cc14
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-MALTA.tgz) = f9b7bf0cc95c4da411d9342dd2ebe8b8
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-MTX-1.tgz) = 5d4fb7abbffb58499873b02451e2d87e3818cd3f
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-MTX-1.tgz) = 2801b511740ce3310fb21ed8d1d1bba46ec2565721bbea394e1e1683c05984a88b2346b6949e90dcc737929e2919fb752661582984b27ea4c726ca6c70fdcff7
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-MTX-1.tgz) = 5b55476b98c8b0610bb7b03b15a457640b03df95
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-MTX-1.tgz) = f185c47ceea774af477cdc675e5da827
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-OMSAL400.tgz) = 854aac9898f3c0552fb0b4491d45dae21dc084b3
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-OMSAL400.tgz) = eb6aa82deeb2fa15ea59198d3ba10275eb73b85a902af353442138df9b66307ac2a595a61824301e56bdcf3fddea03414fd7c312564d039fb8d75fd9159cde58
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-OMSAL400.tgz) = 0fc4d0bf3a667e4fae2f60a504a4032751a5bb84
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-OMSAL400.tgz) = 53a48a5e4731a1160347ad6c655ccf5b
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P4032.tgz) = 9e8cb0ee684033f08ba0b4bda5a4eb16eac71fb6
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P4032.tgz) = 100f84c1ca2763695d90d8b65822c0ce4156c5c51236be33e395dcb7e68c806f979f7afc50c3c76457c82f225df32c44b7cf42c9c8a183469ead0b512a5880f2
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P4032.tgz) = bdda2cb2f34b84c0d46a8dfb7ef72bb6f3562018
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P4032.tgz) = 36f64c61f21f88c7d6067d2e9b1476ab
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P5064.tgz) = 8d6f635c7b19fe4b4ae3f81b8e55782ff929a275
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P5064.tgz) = 4382b4df12950d3ee601efd85e13a0b3aa4e41ec9ab7f1bb5024d1b198ee8c588592c2b50099354f1164aedb585ffd7e9dd123516f32f1f30c32cf78e77fc70f
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P5064.tgz) = b0bccd6abe423b957c452d1d42f40796f42533d4
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P5064.tgz) = b9659cc8f1fba16994a78e42ba17d9ed
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P6032.tgz) = 86427980342dd947c57c838152ae64d15cff5142
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P6032.tgz) = c86734213f246621075f8b35f51997d4abfc722502a4b8a3006d8224b1808871fb9103e539ab7ebf730dbb94377c3f75cd1596a3f7d3fda2505cca879c4608b8
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P6032.tgz) = 75aa0da6324608e7055e923ba1004f5427c88770
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/kern-P6032.tgz) = abcfe72de3e084c79528616c061d70ad
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/modules.tgz) = 66831501dc768e732c9b93cd102bd84f078ea1a6
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/modules.tgz) = 6b50ee54d67e9f57f125ac1eb0f1cf849f566a2ca4055032f708d8bda121b8ba96274c5fca21deec4753a3bbd64e18ffa66fc0548b363f95b5c0d0d4f2690dcd
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/modules.tgz) = 1db5ef74be63618d39d44716face7ca5cbafb86f
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/modules.tgz) = 47d708c50d3fbb3f170883f337a84a3c
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/tests.tgz) = b87c52edef5dae8c13e4982f742d107c6bde617a
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/tests.tgz) = a227c03925059ca58390063e75c934e9bebda7f2944478302ffca4f53a48bf991314c4bf837c4e833aa700424e154cc62526f76c53f23ac7281457606e975c20
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/tests.tgz) = ea25f7257b61f3530435a9dc66123831d59e6c43
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/tests.tgz) = 42da5bef4121a88ef7ba8e89bbd065d6
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/text.tgz) = 38e7f089801576d8a7370546c8f6dfee8938c54d
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/text.tgz) = 4694ab32a63c7a00b2da8921e278d14ac83dd114beec338716a98cfbdbe7c06ed07abe0d6a10b317b50a9deeff4f4049c487458bfa9cef043b92905e9f4828e7
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/text.tgz) = 6b4ed0dc8220b79963b2cbabfcbe1ae449cb4509
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/text.tgz) = bfbab9eee77986403da3513d836616bf
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/xbase.tgz) = 71f5a25bb86649bdbeab0146bb32c76329afa9c6
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/xbase.tgz) = 70afd5fdc176eda270259b113d7f28cc92fe2037d7bc84cc69a2bb32ea05b23bf26c10f834fa9d59be9900a2ef780b55e5e181d6b1a88ff51ccf35488d28fa22
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/xbase.tgz) = 95a5dcc67edbe81dccf5f90e0125e84a6f267cfe
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/xbase.tgz) = b0a603b80fceb0f5f0c02786d87542cc
+SHA1 (NetBSD-6.0/evbmips-mipsel/binary/sets/xserver.tgz) = 9be61698fe883646972e3441d1ea02e16fa351d2
+SHA512 (NetBSD-6.0/evbmips-mipsel/binary/sets/xserver.tgz) = 17d9d25171859208b00a7e64dc74eeaf4a2533cb86d7be138227aa731a09654c007bc4245817177dc2308d693c1792ad247bc0692de79e3b0dd8e5d2257c7246
+RMD160 (NetBSD-6.0/evbmips-mipsel/binary/sets/xserver.tgz) = 168f6c36213258b1f7f3019bc47434a58cf68a54
+MD5 (NetBSD-6.0/evbmips-mipsel/binary/sets/xserver.tgz) = fdf224dd21749c1a2eb06f6ebde96338
+SHA1 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.srec.gz) = 1148ef0c3e4745f529e78b33e048e77a2357b107
+SHA512 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.srec.gz) = 127eac81b94185bea670ef1766abe38506310147c058be948614bb472cd97444402c65eef69375c39d6bad518b617a2fcfae314095c94c9263b322e061ffda0b
+RMD160 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.srec.gz) = 88a878858ddcfbdcc82d30efe6db396e12324245
+MD5 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.srec.gz) = e0fd06b18d51bbed126e558fa66a0124
+SHA1 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.gz) = 388abbcf174f34d8615308f4d9387534d0dd4973
+SHA512 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.gz) = 6aa9bcccacbb410b5f0fc8fc905e78bde3af777913ea3c2035cc6f9a6e4a436fefb7a3afa987403d16a6f1e7151cec117391ba0d146679e7c0c4c9ab1f9727dd
+RMD160 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.gz) = de9ce82a62f7f24c1c78b0bde362f0e4e1d66293
+MD5 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.gz) = b90209535b8a3e40f5d020a99bba9813
+SHA1 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.symbols.gz) = b1199797080df5d8669b35bcde9172d628bee188
+SHA512 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.symbols.gz) = 3b4d915b17ba81bfe9b4f9768841c8a140359ea07121d88b2016f0712f42de965f5cf37dca483ba718d47743da6c300b38499ab5c93ff1978d10622e203f84db
+RMD160 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.symbols.gz) = cdb363ed9995287373ce565c3a6a0a4c0441e9cd
+MD5 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.symbols.gz) = 16a4265a582c47946a7bb8ad40f93856
+SHA1 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.symbols.gz) = 067b86e211cec25f5b7b826139195679a7b13ad8
+SHA512 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.symbols.gz) = 7d4006e0da241ee8b44572a510dcdc33d14cd543d46022faa855b1a554832309d0ca756702a0c7eb551d0d2b77643bf1905153c59cfabd9879e8057d4d9ba89d
+RMD160 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.symbols.gz) = 432610d592a1e11d09d2c6de9bcfa6eb8021e2cf
+MD5 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_MALTA.symbols.gz) = 4c03720d979460cbb6b5311c54214642
+SHA1 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.gz) = bf85a74b3aba2ec80e8aa7b595e34ed729b9beba
+SHA512 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.gz) = efe3a15153df52551b5542dcceb8c41c9ac74a56cb9e5e4fb2d531d0d933d6ea3f8555831e8e9b707d724ae15cc27b79c790232fa9c5ad142f71b6a15ec61e1d
+RMD160 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.gz) = 4299849406f323f0f65a40f74734a1cd34206bb8
+MD5 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.gz) = 54ed1ba8d8009ba512e9019f905c0368
+SHA1 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.srec.gz) = 2f72f6fe9f6a716994fc2dd68ae51c6401c7389e
+SHA512 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.srec.gz) = 4d8d6a4eebdda98b6a8074ea33ee54f729bff3e8e1f8c5c47699819a3cd29d329853bf0083024f9ba3a8893a2255651fe00232408433de8654308d27ba72560d
+RMD160 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.srec.gz) = b05f15e41052f8ab490d7cc00367eb5ce2430bde
+MD5 (NetBSD-6.0/evbmips-mipsel/installation/netbsd-INSTALL_OMSAL400.srec.gz) = 1b2e3da6a2b2dfea79a9669561f04413
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EV64260.img.gz) = 963fb1dfd634ec77183e0e19e63add5d6f515a46
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EV64260.img.gz) = 670195305b6eba8bc6cd2b5a05bcae746dffd3a9bcac873d61bc659893de97f35dca7707d073d9fd2e55058f99f83102364bcaa64d0fa9954aba2bd42eaf297a
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EV64260.img.gz) = 4ff261bfda6f964c67273e2c6cad05577ff39cc8
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EV64260.img.gz) = b3cbc16d9f2d3870fb9c137fa21b7625
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EV64260.gz) = f74b0a7d7afc324d7b463780fc6cbcee71030e28
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EV64260.gz) = 894aa697fd0f0968e534db42528be520c74adec169dcbd2d3603cc262d33e23092253494b072f7239f1542b6237128d8c5069616e28e51422dc69d0bca117d1b
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EV64260.gz) = 7d00ed85fbb611948f16e513072f2a307fa46d83
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EV64260.gz) = fce468eda12d673785cf7b16c7f4355c
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EXPLORA451.img.gz) = 0dcdbfd5853cd5ee3649e1bcdfe16e3133128dce
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EXPLORA451.img.gz) = 0654c6b68a52bdee61715fb8b2b1af775f4c7b4a034d11ad7d4cf9f31cae4b8fb327a78dbabfaefcf6d68352ef8be2b4e71d053c97c0c59a24250358fbf47589
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EXPLORA451.img.gz) = e307e29dbdc57b0843e54caf02092c38dcb11cae
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EXPLORA451.img.gz) = 444e406bfe16f2653bf60273db88dc3a
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EXPLORA451.gz) = 54c5de8e61a39b7114fab8a4a28036ae9d44090e
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EXPLORA451.gz) = 092f45dab2ddc2cfb79b1c1d649f3a86f169a380c01b7016737bff28b4404a47871546c33e89fe43a6db0255556a2a1cfb2bf8cfd725a852af2c19dea35462bb
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EXPLORA451.gz) = 30903e7cf5db4e4f57334f71240da21f6e0fbad2
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-EXPLORA451.gz) = 229f310637a0c65b47a078f2a6f0df82
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.img.gz) = 5046cdf7029475b3c2d6f8fb0eb9ac766d55d568
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.img.gz) = db6f4a419ea019f46205cbb75f76bb8a35bc9d6cee83f9da3b776abb3f83334a60fcad2ef6de4041c0ed3b0689cc259789ca2517dca0e101fd46ede807846d20
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.img.gz) = 42f2c254a99df74b42ae21c1a89d42ca1d8dc105
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.img.gz) = c7b61fa28cd76c1c694fad7becf124c5
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.gz) = caf9b0a77c6adfa8d6cf1effad83b107ea9c5976
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.gz) = 14db94aae558e9e3311e667343468625f309cb71dafc7610f029e6b6e27267ad6169ce21320d6fc512bef2cba49c3f1919d396fbaccbeebe49e8e53dcab865b0
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.gz) = 3a12875aed7924a33df8290b73576ecfbc8dd752
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.gz) = 20580d5bd36fc097ce824bf9915fae05
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-MPC8536DS.gz) = 54b88ef9d752b74a27f85affe9d162bcb43009b2
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-MPC8536DS.gz) = 42903a0d5f74e45d00cb48a4cca92c164e26097791048f2cc1c2b7a1d8b243cebe9f64a3daba9542c12b077017e59c1d0d6c8a8c11ea120855f0f40cc7ff8fb0
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-MPC8536DS.gz) = fd7ac6dae359227cb757ae1eadf39b1fe08e43d3
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-MPC8536DS.gz) = 505ede4a04c4726a1121a17a531a74d4
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.symbols.gz) = 9c6ab2ce83f2ca09cc8789a9431638f7fccdd64a
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.symbols.gz) = 8ffdfde54ed60c89f642b91c6e434fb4ed4de6ed91009df3bd70556e73f6eb5cc28b7bb3090823cd8671e052c5d52bb15eaf8409e779cbbbf4ee6776580b67e7
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.symbols.gz) = d52adf8dfa375abc8e4d0cfd7a414afc7b44aef9
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_OPENBLOCKS266.symbols.gz) = 6bf07ac6f2c54f9b46171b57492b6c4d
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.gz) = c4999c62d6e7c7c8351dba57c34ed0213d2d374e
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.gz) = 2acf7209a186bb3c52c54e49660c76629fdc8e80e73e1b77beb23e6b56c7acd1d985c958f152c8692303c41d3a4bdcb753ba00c232a772919ce106b1c439d697
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.gz) = 9a5d70bdff7b5208eb2f7f6bc2df3b72ce770588
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.gz) = 777ada452ccd51471ab700f4a6f9e652
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.img.gz) = 2a5de49c3e1b5a2f4455ea780f85d185b26845fb
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.img.gz) = f1f740403f47dc84dd3935611f4e1f71d860c202baeb8b53c23c4c4c6543f9b903cfd559465f7a5c3e1e59a8604f0194af556ebbc7000592cd532c7895b25287
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.img.gz) = e974201a8d50e1c9a77bc34a4df289e94a58e966
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.img.gz) = f710c52befd5c32ae49e90b7f74f8e77
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.symbols.gz) = 89c1b110f3a260ae41093f65323a11028f37826b
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.symbols.gz) = 30c988a3a2b647a1c93a95ab3bc7fcf0428f89dcce44152f81c2a58af49f5e6c95817650f5affca8a83ea0318d913a0ba20c28dfb6b7cb3027dce2c5561ece52
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.symbols.gz) = 4838d9d57fdcd79da40dbf3fdbbf09e77118ff2d
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-INSTALL_WALNUT.symbols.gz) = 5b9c0173413ff799fe5140db7ab9c13b
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-MPC8548CDS.gz) = fa0461c820b70c326f5f2867ff081cc88d357aa4
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-MPC8548CDS.gz) = 436d573a0b468d6794a9fc16955bca56a7b726c3e0e306f05e6965bcbd109ebf71fff060b8afcda9782043bd5389e961f1bb191d9b9dd209b385e64e448eb63f
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-MPC8548CDS.gz) = 01ccef4bca33dfd5dbc63d901d9b006a930858ed
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-MPC8548CDS.gz) = 9c552da04cd50465e8451c12ce98ac4c
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS200.gz) = d8431c30e8c1e34eb2b721d51f10e2429b542cf9
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS200.gz) = 1d111341a7439e63ec210bc09c168cd613b114222241cba494f19e6bf582a0085a8894e1a6a8842b7b1c6f8ee5f2c8b39238b9dd714727a053637cbb59a1f77e
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS200.gz) = 47a3f7ebc1980ce1817112520f13396d6efa2d44
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS200.gz) = 4875531aefe44295429c200a8dbbf3d6
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS200.img.gz) = e7e23c8fbe61ca6ef52822a4fb9336be7168abba
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS200.img.gz) = 6c78a517557651386736d048efb9953b4df3350b411291fae3029074ad0dd961f128ebcac4e6f14dd56e53d43465994972ca29572fbcdcd8793f713df74a3e5c
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS200.img.gz) = 04ea401821e981bff21fd61d8503608fde540bb8
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS200.img.gz) = 3e5f6b82afebe7b1ab5de3fca0bd75f0
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS266.gz) = 22aed20110feacb4634479f3080db81e3a511e30
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS266.gz) = e0934031d3b963fe5edbb5944b92a57c8f4ba4b496d8c5ab6aed555012a53f73bfcaba7eebcc1669bd6a308603360804242b7c37e92c022872c524c159c92f54
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS266.gz) = ad1b890f8ef6418a1ed2858dadafc7e99729b6bd
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS266.gz) = e935df1037b38d1a903359f63aca6df4
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS266.img.gz) = a3b023c3bf29f930fc5ff0e0c074e54e23141963
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS266.img.gz) = 3d1c0b86676c2bdd861f7e8e4e20d6a34d1a04079d908b6d2ef5404b1d00ec1f394a8b13fe5d4b4906c996d1912777e0f52ec367ad6e1c9db64cbd22931347c0
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS266.img.gz) = abdf86f9c182d23740543843d59e4dfcb05e59cb
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-OPENBLOCKS266.img.gz) = 84ce6f797d900ad639313c55e64178b2
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-P2020DS.gz) = 8cc216c33fcb3f59904067c3e9294f0369d6f1e9
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-P2020DS.gz) = 6bb4dd7dba52e6a6f4dcb76aa5218ab893deb64d57a87048ed5dbf882c13e92646ca89a037ebcba5211407363a9365d2bc9296397322dac95374e3f03bd88e51
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-P2020DS.gz) = d8f03ff91019223b562ee52da049a4f71facf379
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-P2020DS.gz) = 958385f31a4f6b1a234652faa95c6c95
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-P2020RDB.gz) = 9140563a57548b77f93eee35e2615f4a377612d3
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-P2020RDB.gz) = 1fbddd9a55f6669c1f2f48dd96b7147cae93a2d5642b262a81669fa4a2670d465cd09347a6f9b7751baa338935114bc2ba2e67622e2f524d9793628274f92625
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-P2020RDB.gz) = 3ad3d010c5c0f34a69d7b49c7c1d639f7c5c3618
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-P2020RDB.gz) = 094787fd9d22021a1b63422895976203
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-PMPPC.gz) = 8f72cbe7df21613d6b796b579ced2911efbe66e3
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-PMPPC.gz) = f4f11445454376ec9f83f9e3072421a8ccb7bee9b1aaf01aee70a6c044e0de1156a5fbe28b1243e8efb334adeb70621e8eab875c44f590fd0276114a26d8db15
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-PMPPC.gz) = ff1f745891b1c4a02836982de15575afe78c16eb
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-PMPPC.gz) = 87d0847ec4707e24c58146eb0475d1aa
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-RB800.gz) = 139b9c2b87b112ab2d6498e726360504d0adedd1
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-RB800.gz) = 8ffc6ac565bf37ee69f8736d7c86738dd69ab7873b77ec062a12a442851559e4c94c903f76e649a21984efd4b98ccaa97333177be635807e6dec8a17bd421880
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-RB800.gz) = b6724d690aef60f63c4b1339eb6ce514e0886151
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-RB800.gz) = 2df5233415f6f20f2af441b4b54379b5
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-WALNUT.gz) = d5e489629cc8d1b2903e541b944a123cfc0937bb
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-WALNUT.gz) = 77d3eda4223f4cf9120a7e84e8c61917749462734c5adc70d95e3108a1b151e0ab7518092d37ddceead9e9047297ef47f4712de7eb0dc05f4190ab60e775d313
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-WALNUT.gz) = 15568ccc03d6a06ebdaf407b6d2b4ac07985a0f1
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-WALNUT.gz) = 11d3fcb67c3ec63c5c43ab5bfe06c0b1
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-WALNUT.img.gz) = f001160c675e3d0f73978743c88bf61561a7b10a
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-WALNUT.img.gz) = a85072ff3b1a1d8b9e35b40b1bb49f5065bad003f603add8330de38a71c19028ed54e377534e4e901281ad5eb65dcf73e8657a39bffac9645e6fee6bce7ac391
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-WALNUT.img.gz) = 31480f15986b52f445cefa8aa4e056b6fcb74f1b
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-WALNUT.img.gz) = a0719a86fd17f9ddfa5131e58f77622d
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-esata-P2020DS.gz) = 50b925468b1ace37856fbfbd4fe5363ed187b4e6
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-esata-P2020DS.gz) = f8cde43dbaf1744d7dec3437beb43be1b73178fb95038771a52315b5b54f4ae369c9261c35b710be563b0bc9be07e4801100e012c8313c564f3bf66845082c31
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-esata-P2020DS.gz) = cff81475ea7ebe293bbefc4088d5dcb76906108d
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-esata-P2020DS.gz) = d79a18ae8aa921fbd0df460cd5e550a3
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-sd0a-P2020DS.gz) = 1c75ca32cb0267f982916a5fb2740483e5aa9f7b
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-sd0a-P2020DS.gz) = 99d1b928ee2674f7dd22a10ea6c3cb7b24f5bdd4961a5315ad310e2189cf4508bde00d9b752cf3eb6843c3a461f748deeda4f395206a4973be55165f6f17c9ff
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-sd0a-P2020DS.gz) = 24d2b7dab4018de8de5feb65f23cda0e8b4c1502
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-sd0a-P2020DS.gz) = 6fc3a2ba5e17d4ecef5cb52b482761ff
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/netbsd-sd0a-P2020RDB.gz) = 342dcb5cc506d3272737f3b2c0fd16b7221ef429
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/netbsd-sd0a-P2020RDB.gz) = c74ccc79f91ac3780093676aa88cb544da9cd17abaee1c1d2692acef50c5f13c4ff1e6ea4c334c43242f20460ca6f08406c1514f4b84cb7206900192699b2e09
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/netbsd-sd0a-P2020RDB.gz) = db206fd4eaec146d07e71794320de0e680bed506
+MD5 (NetBSD-6.0/evbppc/binary/kernel/netbsd-sd0a-P2020RDB.gz) = 6a7ec6e8e8a7a2f75e60073154234efa
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-MPC8536DS.gz) = 3c9abf574a3c5dd2c38ef5af3433ce2123a30192
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-MPC8536DS.gz) = e58dd95eadafef8b242ce0894ec809b1d73063f7142cb0d6ce42dd03f5a71032ef3d31ef09e19f9cd6594b5bf65806473f560e17f0d505f5491c3651d6f9e930
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-MPC8536DS.gz) = a419d3af2732cc85c1fe0ca06322e0996a7946cb
+MD5 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-MPC8536DS.gz) = c900656ec6ae14a67385ea265639a500
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-MPC8548CDS.gz) = 14a02ead1d8e5963e96ddd3a5b3b2625202d0011
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-MPC8548CDS.gz) = c51940733928beb1f9beb280ecc642dd867317be5d0ca36ed9e0e01b1c8b2a1d788658bdb822e4b7be358fca34fce4620a9e2afb10a265007824efb965dfeaf6
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-MPC8548CDS.gz) = fbf09f5e31f3b61a3cb4f1cde889a2c91635cfd3
+MD5 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-MPC8548CDS.gz) = a4094ff843bdcfcd143957a0fd15a01e
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-P2020DS.gz) = d5125242574b57126e0a9ed0b2c9e18ba47ba7dd
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-P2020DS.gz) = af9b230b2940352e71cba43854b29418e2d1c6a51cfbac7cfcc801a4c1ecbc0605d055fe673fae7f244a421058073f921f1cbc8ce55b3131017138396f2071ac
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-P2020DS.gz) = 7e25cb6632e7d744f60572c578fe34ea1acecae8
+MD5 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-P2020DS.gz) = 3659db43dbb405a80a675b7f2840c7df
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-P2020RDB.gz) = 9a55d38b7e6f8c5b274ab45f20794feab61a6264
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-P2020RDB.gz) = 15ee2dfc4c476a54f0483facb66aec9b2b743775df471353ca1e443522119af238bebf7a986413d6cfac237aec8242180499b23fa85b85017d20179561025ab8
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-P2020RDB.gz) = dceb778c7ea33542379775b8481122d7e55f9e98
+MD5 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-P2020RDB.gz) = 39f5865216f1e2e37984109a0cf2c708
+SHA1 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-RB800.gz) = ea5d21d649ce2a6c3502b58446cbe747433dcf12
+SHA512 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-RB800.gz) = 8748659a4a7e79a6b4b00dcb90ed2cf8213c138d4df7f93e6e53bee63f0c8f6c9a837f9522c9dba0580226eaa756473640226d1f4edb688a5b04807cb588730c
+RMD160 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-RB800.gz) = 9fe62c16553ca3e5955d12ca7e59cd0336bba55d
+MD5 (NetBSD-6.0/evbppc/binary/kernel/nfsnetbsd-RB800.gz) = b4a5d575b02cf078c5c31542e5b4954f
+SHA1 (NetBSD-6.0/evbppc/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/evbppc/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/evbppc/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/evbppc/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/evbppc/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/evbppc/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/evbppc/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/evbppc/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/evbppc/binary/sets/xbase.tgz) = b7c8146146ebc15191c1bf53f51f8f980fe8c816
+SHA512 (NetBSD-6.0/evbppc/binary/sets/xbase.tgz) = 091f5d00414a9ad478811bfb0e953f2a204869bc5e310790886a59c11953974cf7068cd9a96c8823856ab2687ffa2ac31e97494f47338bfe31d80217382c59f1
+RMD160 (NetBSD-6.0/evbppc/binary/sets/xbase.tgz) = 4bd1bfdc7c1e1619de63fb83276c21039b945357
+MD5 (NetBSD-6.0/evbppc/binary/sets/xbase.tgz) = e621806afa0fcc9cdcef0f9b3c7dfcbd
+SHA1 (NetBSD-6.0/evbppc/binary/sets/xcomp.tgz) = 960dd33b61e19dec92096a54791aca1cdf56ce54
+SHA512 (NetBSD-6.0/evbppc/binary/sets/xcomp.tgz) = 111dd50041e4008aeadb898c3d08f9995c5c13a41ccc20993b4ad51c81d7f6ee3b4dab16158ac7436d085b80e4a643b236a9c97edd3e915125a1466154538420
+RMD160 (NetBSD-6.0/evbppc/binary/sets/xcomp.tgz) = 0cf8b9a8d1489a32ba0b5a277d90e429c40650fb
+MD5 (NetBSD-6.0/evbppc/binary/sets/xcomp.tgz) = 4ba4077ca2c0edf71813165fcf5321fb
+SHA1 (NetBSD-6.0/evbppc/binary/sets/xfont.tgz) = 4711fcbade0238d60b7b89cf0d7873b03d7ed1f7
+SHA512 (NetBSD-6.0/evbppc/binary/sets/xfont.tgz) = c29130f55f536f602253a7f92f073ebf6ba02baea09f8011530bbf7e03ae96594334f0c60b29a8bceaffc3eb8b152db47548e38a3c8a14abc5fe35bc5d1d7d93
+RMD160 (NetBSD-6.0/evbppc/binary/sets/xfont.tgz) = 3b01af0f8e34367988d559fe0fbb0acbbafb0b2b
+MD5 (NetBSD-6.0/evbppc/binary/sets/xfont.tgz) = 6ba15ed12217b726d9129db8e942a048
+SHA1 (NetBSD-6.0/evbppc/binary/sets/xserver.tgz) = 05aac7e617e0cac05a88062fef29bb459da7a1d1
+SHA512 (NetBSD-6.0/evbppc/binary/sets/xserver.tgz) = 19fb5af5d6afd78839a22e5c0694a492047b5200c569cbf58c676ff32ec250b21edcfe2ed00b65092fdac374d1ab9eaaed6113c69bc03009cf458aedc6014913
+RMD160 (NetBSD-6.0/evbppc/binary/sets/xserver.tgz) = 774d2a1072b8d122790ad189a6d2ada2ad99e7cf
+MD5 (NetBSD-6.0/evbppc/binary/sets/xserver.tgz) = 3daf1477cadf3593e9ba45e3703fe8a5
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-EV64260.tgz) = f49583bb3bdb33b9eb3b0b4136668772da20f45b
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-EV64260.tgz) = ba5c1437d9a233dc818880e72de7746dced45081a2fe998ca922c51eaf404bce9f42f7f763a611485bb518e50c1e4da5a6906d0b28d01b9cd3c9f1be4d8c2761
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-EV64260.tgz) = f477b6948cae222002fa140de299929d9d9807c5
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-EV64260.tgz) = 168a599ee54d18f0eab734e5717b2984
+SHA1 (NetBSD-6.0/evbppc/binary/sets/base.tgz) = 660713e719fb1be5824c7b5f573730b9d1408922
+SHA512 (NetBSD-6.0/evbppc/binary/sets/base.tgz) = 366e7065fad6b8e8a7e593fa5790eaaba11a8ad49006730fc01fba2f1d7908a6ac1ebfc88a4cf7731b1d31b3e21dd5d0aa5c5433cd4f01ce95254735da15c772
+RMD160 (NetBSD-6.0/evbppc/binary/sets/base.tgz) = a460662933495846dc34b422fbf2f2f3b7141068
+MD5 (NetBSD-6.0/evbppc/binary/sets/base.tgz) = f527c4156acc659412d01a00756d57f3
+SHA1 (NetBSD-6.0/evbppc/binary/sets/comp.tgz) = c9caa7ece23746ea1423f1cb05924d7aafb69081
+SHA512 (NetBSD-6.0/evbppc/binary/sets/comp.tgz) = d60f9bbefcaa3331646da3e9bd2738cf11e357807ce64619cd48db62cd3c72469f39113b04883771c610c63f74e574941add1d83ee2cce2a7b13e85e844b9eaf
+RMD160 (NetBSD-6.0/evbppc/binary/sets/comp.tgz) = 2db97b320a8befeb352b84a44e32b3844648b85a
+MD5 (NetBSD-6.0/evbppc/binary/sets/comp.tgz) = ab787a55ed8b6765619f75f613914955
+SHA1 (NetBSD-6.0/evbppc/binary/sets/etc.tgz) = 01f15943e5ac9e3d4885c4391f332b3367a96483
+SHA512 (NetBSD-6.0/evbppc/binary/sets/etc.tgz) = 3d69692f01bf9b9dd36e719af4f2e99d7c9aac0b92925e2751b0ff8ff7651e37f948d18765fda1d1841fe8d97a7869674d584423594ad1ca48da8b4c35e0a3ec
+RMD160 (NetBSD-6.0/evbppc/binary/sets/etc.tgz) = 6422793912a3843dafb20baa3c9ecdc10305262a
+MD5 (NetBSD-6.0/evbppc/binary/sets/etc.tgz) = 789c56228f05a0cf67d1917ae04862f5
+SHA1 (NetBSD-6.0/evbppc/binary/sets/games.tgz) = e7bde1f51127db8c3a7d15ec931c915806661f0b
+SHA512 (NetBSD-6.0/evbppc/binary/sets/games.tgz) = f39fcc09a9b81a604a29c968dc74264a42c46ccc122c9ac01030e6ca01c28967fb7e20d8fa182f2ba07ade376a14a802c2abd06154c754f907a9879b7e7ab52e
+RMD160 (NetBSD-6.0/evbppc/binary/sets/games.tgz) = a09ee1c7811eaa0ed3aa1ca0f85e1279b096fc46
+MD5 (NetBSD-6.0/evbppc/binary/sets/games.tgz) = 81e8837aedbfcea8d6957f192e54545f
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-OPENBLOCKS200.tgz) = 561ca3ad31c44deca4b197207d2a2e6a92ed4bd4
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-OPENBLOCKS200.tgz) = b47b23e9b6c3efdc389ce3b47218eea8da190734075985e7ad009a10addcba48e565efabbc3b11c32e220d6059fe5114ae77351bc72549e8b8f37be98dcba27b
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-OPENBLOCKS200.tgz) = b2058d6a4e4fe11ebb19f429347a6ed69a1b014a
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-OPENBLOCKS200.tgz) = b2ea5966c8110677fd107fd4029242f1
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-EXPLORA451.tgz) = 7a6fe1de68c0fffedc5918ffabeb87ee71ad3da1
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-EXPLORA451.tgz) = 2e30f89fc77fd9bcd9310c4d12379245a18aed68b661c037593870c86ea806edb62f32a433f46e4f4c205c2eddfd86c353c3ca970a887a324b4d9eaf952b537d
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-EXPLORA451.tgz) = d68c12c132889e9cb48e003811e9c2de7fe41aa3
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-EXPLORA451.tgz) = b5ba93f49378f17fa86d91832a97d63b
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-MPC8536DS.tgz) = cb9e2b4befa9231d5c6bcf52460189d6ad18fe85
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-MPC8536DS.tgz) = 937bdfd98369d438c25a0839e50cac22602b3766db5f359d31825445c156fbe94de24956584b0668bf5c1b09565733c5dc4e9dec8fb5c034f5764edbf8241bff
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-MPC8536DS.tgz) = 63389f49fc87afc7227318374fa8fbb130c1f076
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-MPC8536DS.tgz) = b4ccb088690ba31893f554c22874c25c
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-MPC8548CDS.tgz) = f17cacf88747cab418fed98c8f2d4341d883c45c
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-MPC8548CDS.tgz) = 13adbfaa5c03713aba913d4bb08f6c8f654b3af210164d111d4c5825bd49ebc7ea8b0b4e5dabecfe685cc9ea9bbdbd0c41cbbe3e3a4bf9d497186c0cc15ed3b7
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-MPC8548CDS.tgz) = 5e2198d8b2c62f629a2e41ff422f50f0d90b2ca2
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-MPC8548CDS.tgz) = efdf3c8e143e54c672ba669c5b2211c7
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-OPENBLOCKS266.tgz) = 3dff6cb4cc77e770b17e56dc132fbb3ecafa65f1
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-OPENBLOCKS266.tgz) = 6309b5240c155074f7f0ad04684043e26886283d81369faa2c5d5ae202a82c5fad980c1101cb5f03fbf50e61b78fa87cf5ce633ab354b90ae0f267c4fc03dd92
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-OPENBLOCKS266.tgz) = 22a0af77fbc2dc62e11aabc36b92701e12a23624
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-OPENBLOCKS266.tgz) = 776cb54622eca1a207cef956b8fe9a2f
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-P2020DS.tgz) = 6ce50d8dc26e08d660edc8daf9b4c35e2a03b005
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-P2020DS.tgz) = b04c1630a1bcf4ac4855e4242c5cd12b82c846b371b6257abb99ba4b28026c546ae914d68ed31ecfc02d952aef81bd8fa50879c698735d453bb0a8ed72131fd0
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-P2020DS.tgz) = 16938708031722094448b4a613dce8e2acbf8c63
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-P2020DS.tgz) = 94ba27899a9ee3756ec7084e362ca968
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-P2020RDB.tgz) = b0bbfe5b10d1596af93eec4960120ebb23d00411
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-P2020RDB.tgz) = 536a382b932643d9e4a65dca9f4601edce766799da3e291484e9460291ce4168b5cfc59a39bb1169e69065bb65d1ff8f56caa98651d643bad9f33ef35b219d0f
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-P2020RDB.tgz) = ea8619e5c65fa02151fb23136e03ee8889f68ab4
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-P2020RDB.tgz) = b14ef5c3eff1d4c89afb1e9d883aa3d4
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-PMPPC.tgz) = 56e8d8a4c533163eaf18a2b9cb988e0a61be8174
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-PMPPC.tgz) = 87f5c77334788e59662c95dd073e3fa8a680f840ccab27e839fb405cc942941d5c2459cfa4d93a02179ab27fc6e75f8d3c957c3c95e5e271a404f64ec08a0b19
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-PMPPC.tgz) = 7160a35f527dc620a2e67e17a22e8cbdffd8fdfe
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-PMPPC.tgz) = d0459860eae7ad936e2b318a2cbfd7ac
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-RB800.tgz) = 79b942c2076a9219525ec9da7b25da3a21488675
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-RB800.tgz) = 0c9462c4519ed0fc1b378a7abb23c3a89768d6fe128c726e2847c6daf576757492438d4cab244e32f1bd7601f1a3e808d79f874b3480e22abff4a45b9cc5a8fb
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-RB800.tgz) = 6c7309b72d5a61879c3151d2065cb70361ad5c70
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-RB800.tgz) = 9951a8e7708ca609ec9abfb3b313f03b
+SHA1 (NetBSD-6.0/evbppc/binary/sets/kern-WALNUT.tgz) = 0a60e6f9a6fbaa8477b05baae64d4b405c9c252d
+SHA512 (NetBSD-6.0/evbppc/binary/sets/kern-WALNUT.tgz) = cf5e16c71fbe6366c41503578254a5be9bacf01cab691f3667c6b3b5ec3413cfd30f3dd00152a7c0dea73effa0f46fde1070df5aa29db02c021bc60a83d2ebc9
+RMD160 (NetBSD-6.0/evbppc/binary/sets/kern-WALNUT.tgz) = 54ade37dbefe29a6de73720d7900ce68b7dff1f3
+MD5 (NetBSD-6.0/evbppc/binary/sets/kern-WALNUT.tgz) = 4f92053a06ab8e494ae5068657a449ee
+SHA1 (NetBSD-6.0/evbppc/binary/sets/modules.tgz) = 3297a716bfbfdb870519304912c1f0ba834ef318
+SHA512 (NetBSD-6.0/evbppc/binary/sets/modules.tgz) = 586c1502a8fcb99323ba75ca343fbb8204fb80a00de8b09aa6722bc4d7bb142dd35bf023f11ef981f5ede707dec673dc1040578677216cb0aab2e1d9d871263d
+RMD160 (NetBSD-6.0/evbppc/binary/sets/modules.tgz) = bb87c0bfbb41190443d888876e2f6329f8c5a0c6
+MD5 (NetBSD-6.0/evbppc/binary/sets/modules.tgz) = be483e96c1f3eb3a155b17fe7097d398
+SHA1 (NetBSD-6.0/evbppc/binary/sets/tests.tgz) = a9c5bab23ec89b45bc96550385064ca681c1aaf7
+SHA512 (NetBSD-6.0/evbppc/binary/sets/tests.tgz) = a629539a7f807f4cf5651329769924fbd42102b4e9f96b4aaef254d1237e0ff4b6a55a9a1968bd6aaecf5f4e4db667fe59b8e2afa8232b80af4372fc436eed18
+RMD160 (NetBSD-6.0/evbppc/binary/sets/tests.tgz) = 8f786bbb44342927ecaee51314d2492b228ca507
+MD5 (NetBSD-6.0/evbppc/binary/sets/tests.tgz) = 6d2a4b03364dadacd276c5e908c6053d
+SHA1 (NetBSD-6.0/evbppc/binary/sets/text.tgz) = 9b944538cc5e87133cecd712523216a783ba97d7
+SHA512 (NetBSD-6.0/evbppc/binary/sets/text.tgz) = 7d87e8bfe246ce56e93257beac1808fd00160911acc22b5abcfc4de9125182d982e69709ff8e7f5dabd2454024cbf2969d836cfec0bc8b314f09143654648e99
+RMD160 (NetBSD-6.0/evbppc/binary/sets/text.tgz) = cf2dc7ca65a246453309df0e94e804c5a04b0719
+MD5 (NetBSD-6.0/evbppc/binary/sets/text.tgz) = e8220cff6b33bd3cb4e91d50573b43ff
+SHA1 (NetBSD-6.0/evbppc/binary/sets/xetc.tgz) = b6aafacecaf76d99a4c3c428e33a23633419f52d
+SHA512 (NetBSD-6.0/evbppc/binary/sets/xetc.tgz) = 9257fc58e039f2afc1ae7f46a7ed2ecdd1a13e67a76960490e89efb8fb12b44100a465270469058071249e0864346ff4dca825786552a4a8ddc804cc7a90dd33
+RMD160 (NetBSD-6.0/evbppc/binary/sets/xetc.tgz) = 6c17517837ddebee9482883db92d1542a89835b4
+MD5 (NetBSD-6.0/evbppc/binary/sets/xetc.tgz) = 77d81348f7721a447c8548aac150659b
+SHA1 (NetBSD-6.0/evbppc/INSTALL.html) = d106438243f94987f5d126102e6324f6c1ad274c
+SHA512 (NetBSD-6.0/evbppc/INSTALL.html) = d83cf719d3601674fe54b1fff57a8916d342ca9924dd38eaf3f6be43a3d109b85213d4217a5ede1f54734644d1e062437a63f428063cc3bf66166c6131860cc8
+RMD160 (NetBSD-6.0/evbppc/INSTALL.html) = 991e52340a15583f9b28560cacf1d10a5e8a6617
+MD5 (NetBSD-6.0/evbppc/INSTALL.html) = ab505dcacfa6b669a830b026c43d929d
+SHA1 (NetBSD-6.0/evbppc/INSTALL.more) = 375545e5f7e921c1635e3538cfa3f615f58ba82a
+SHA512 (NetBSD-6.0/evbppc/INSTALL.more) = d2c28cbf4417afcfcb33f363f3c234403f60c3899cee910767c9dcb7c8f39ef2f1dcc84779e67c5ad386a162ba886c37dfc64d4c7e8a70a3b0fcba1286a5a059
+RMD160 (NetBSD-6.0/evbppc/INSTALL.more) = af295999442791298fff266b84d6ab1a92c3cbe1
+MD5 (NetBSD-6.0/evbppc/INSTALL.more) = b21374e21e9e0599b62595c1aca77cce
+SHA1 (NetBSD-6.0/evbppc/INSTALL.ps) = ec4c228a542dd84139f5eb00ff550be759020a10
+SHA512 (NetBSD-6.0/evbppc/INSTALL.ps) = f784251812449ee49a2a2f69b54e20aaad818e0c07c220553da4d1c34676f843c7f60472c750a3dbe952725aad68e5abdf5dc19bb4d3b90cb742d8fcacf1334a
+RMD160 (NetBSD-6.0/evbppc/INSTALL.ps) = 525b9a28bed1478b2c2ff4a94da78aaae125bcc7
+MD5 (NetBSD-6.0/evbppc/INSTALL.ps) = cfa9f4c9a173353430edc81cfe8a37af
+SHA1 (NetBSD-6.0/evbppc/INSTALL.txt) = fc26b26f28fb8eeeb5bb990fc72d9c3d57067350
+SHA512 (NetBSD-6.0/evbppc/INSTALL.txt) = 1bd1da4343b0ab19075682a1ea38e33c7a0e11aa2253bae18a19dfb82c99c2b21b7e74e28f0952cbe6c3499a00bf412e998309b52c0c6fffafc868fd5a370e43
+RMD160 (NetBSD-6.0/evbppc/INSTALL.txt) = 9d44c454ba9249c02ac948603f1305342bedf9a5
+MD5 (NetBSD-6.0/evbppc/INSTALL.txt) = 44b21d90e58f137302ac1c96f78914ef
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-COMPUTEX7750.gz) = 99907a8b29592f20a683481b351d6c3b629ae74d
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-COMPUTEX7750.gz) = d25c300a0bef7432042f22856f899b60993f739522f62d7c1450da81c6774d01769d54f83b1039ed7b97af8ea4cabd954f8017b77b35d0d1a09c47baa09f0cae
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-COMPUTEX7750.gz) = cca19d946d47159fc455f36067dbd3cfee7f0f5f
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-COMPUTEX7750.gz) = 2556834458fa65b30784812d6defbce0
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-COMPUTEXEVB.gz) = b4fcb725319fdf75cb8fbfe3cc385f0546536032
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-COMPUTEXEVB.gz) = 3ae3fa47d5e760564ba5309b5bcbd4ca32ec52bf80ede5764811779acf73c206643cdfa9b0020b300ee70d75af820aa28ba798663ea962b16af935df79c9e4df
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-COMPUTEXEVB.gz) = 697977f6961f8dc0b2204532edc875fc23dd309b
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-COMPUTEXEVB.gz) = a163b83287053245cd74d74a2c66a13b
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-CQREEKSH3.gz) = 3bc3953e940f68f2edadd93f79c8ef7c841c4000
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-CQREEKSH3.gz) = 532a1d96716c85a6b77ebcbeb19560f2e402cbf68a50feafa6452117b477285ca05a0c86dd073bf9c237b6156fa59b42c05fa5c4029739b4fdb277a0c5238e09
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-CQREEKSH3.gz) = dad35f588cb96a63d46bad58b6f4e565402ecc3e
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-CQREEKSH3.gz) = dfdbab13faaee507abaa31e6b1819e30
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-KZSH401.gz) = 6bc4eb9bc72f6ab2412a0f4db523f849955d12e6
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-KZSH401.gz) = 80208e8df1f7c9fdc60ba1558c6f7182d65d6f96f7d57afc3d41887908dfee3598db6e82e827d2a9f14106ec262c4428fcf1a2046dc847c7993cabd9e6e668e6
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-KZSH401.gz) = e16349b9d4c834165922b78175d291af77caa0d9
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/kernel/netbsd-KZSH401.gz) = f95e0f3c93cff1ad0ea5667fdaba435b
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/games.tgz) = 37e15b0950aaaf1af36427ae5dd5866c1879b6b3
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/games.tgz) = e674abb1b1966acbc581a8f8b3e37841f48656e66f3302077cbb2de443487912b99521336ec5dc096fa3c7769b2d7623e1d1720a079407ec1861d32159a72ebc
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/games.tgz) = 36070071e8315d2352be1b3e563ce7ef7625d184
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/games.tgz) = 0016145b46957b95dd158b4441dfb010
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xbase.tgz) = 564bce6dd7c37b5e941e41d50f363c133fdf8f97
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xbase.tgz) = 23b3306254c789331542e63974f9d7cdc54d99ba2cd67cf6a1c97f09afa4f6cf6aa8798e37b7c38f4a55afd1572154f291fa1bf2e2a1fc87165fd6bd7f89fb80
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xbase.tgz) = 476fbd8301bec0795a01552728ada44204d2dbe6
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xbase.tgz) = 9fbbbdb3acfa4ccd9f0b309ea0ed0700
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xcomp.tgz) = 526a278a13833073e6231e879abdec85400ca888
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xcomp.tgz) = d2081a7536e3d7fa27a363afd8f6eb5fc3de4606f11b4857be2f1df59934da9d3d16e0df3a6edf4cdf52c8f579e0e4c06f07de0959b5213c21be1a8fdc2ee134
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xcomp.tgz) = 4a767ff08e9bcf98f886849cabebd1300397256f
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xcomp.tgz) = a23a2d8be9298497b4b6d39fda330bf4
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xetc.tgz) = 93a5cfbbfdc641f91ab363d4b65d1158d71c0cfc
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xetc.tgz) = 85a67734801e81e129a37b73ae62211459fb16d4e52a945ef21a4bb908dd7d1d775233956086dd3d59af45bcea24fbd6f54a2a9175756d242b57e07d10767548
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xetc.tgz) = 6fb055d0e1b6264bf1ec396236d903218832377a
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xetc.tgz) = af954b56e624948145b91aa451d77392
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xfont.tgz) = 6139c05273b6feeecdfcd11cbe0da91256d12a11
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xfont.tgz) = bb849454ede88d39ca60d6c513c833c2b29ea548adedb9f76870839174a3daa838d38a6ad701c78bfc164e690c5ebda9c9d00d4c23ad816df9f1962313afdbf2
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xfont.tgz) = ea8f123f9f78b429b77ff15c924803da1da2068d
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xfont.tgz) = a87cb6769c37ae20dbf0dd70cef93d11
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xserver.tgz) = 6cd4fdb0ff00ef5d89b47e68e538c86e395b2054
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xserver.tgz) = e3b575cab95e297a05a26a03eeff0cf843d665ebdfd103846ad544bef1d04f93aa20ceab09b1dfaae8f59d89ebb1cbef400b7521bdb41f7542f23156540aa4c0
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xserver.tgz) = 7e52b98276b4d097f7babe918e6768ae9d7945db
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/xserver.tgz) = a505ab4ce0801aabe21fe6038b63809f
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-CQREEKSH3.tgz) = 126932a5bc72bd20874c71d76047894c6a7fedb4
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-CQREEKSH3.tgz) = 89727c156d25912c17f801e7cab55d487eff7abc0a9168f490f77313d38eed5a37bde3c0ffbad4db49cc70c335b1147df1408ded59c4b5aeec9a0557a47e7b8f
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-CQREEKSH3.tgz) = 427056f8e924c6346b86a52b73dc8f0e9a98e44b
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-CQREEKSH3.tgz) = 07b32973dbbb2d0a7bf8f397349c032e
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/base.tgz) = 3dc230ebfc3669475edb5f69a61191cf0310b438
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/base.tgz) = e60bf3c63a76db118e7646ddc582150558df14cfde8cb8a6fa74f06bdfcb1f920e6015091ef4763be13072da77e2243b69a8e2739cc8945ec388b8f7fdb2fe50
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/base.tgz) = 5b347ce9da19b214d2069c8dc029cd0448af298d
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/base.tgz) = 79849fe1cbe830a98d8bc0a7db8f4e62
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/comp.tgz) = 882b629fd6de1ec706834199fb45736bb599bbd9
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/comp.tgz) = 700640c27a7453cb2ca1b5c29a2e0558a9cce8f21e4c44e17659bff25c4727aa578f85d3bdbf6da6173c80cac33955ec1731288160b1870fbf92a5df0ed258c1
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/comp.tgz) = 0c3da5c9c5ad1e9d8835040b230e89192f8cc98f
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/comp.tgz) = ae57e406883549f546048ff2480c5707
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/etc.tgz) = 5ef345b014742f576164cd85dc6744b87a4da775
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/etc.tgz) = 998a737bb0964b9bb61798310ae4f979c9e8518f90c482817bcaff1251036e51bdefb39a6b9595f2e313c0df79d44b387c960878582d7721c551882f2a3aba14
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/etc.tgz) = 64d587adda384831dccfee1548c9c09ed5c36f44
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/etc.tgz) = 495f4d62d00649132f218565bddeb50b
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-COMPUTEX7750.tgz) = 364b983f7368d62a6f35a63945026cd8c19c3bf6
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-COMPUTEX7750.tgz) = 8341464294654062caf3c3cfdc1ece9bff1cb6642b9873cebc4520e4ff9a0ed27e5e0106a488ee323d41d77b0bed99d7ad450c35d9d2f805ab18b3e3a941ea71
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-COMPUTEX7750.tgz) = c84e2532d3efe0b47b0db0c7471f9f78b0fd6dde
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-COMPUTEX7750.tgz) = bf341bdb90b335be676be766b8949217
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-COMPUTEXEVB.tgz) = fd664ded3626416bfbabf99bc73dac4a2bac909e
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-COMPUTEXEVB.tgz) = 3adcebf6f3acda9c84666cc1ce39a75302776e0f640cc02024d1ae2a7fb4ef7df14bfbb32e808f4a30fb482fdf181670c87327c0d5ded1145ee0f6bda268e369
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-COMPUTEXEVB.tgz) = f21c49e3f0a4a5fe70070da938296750a222e0f4
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-COMPUTEXEVB.tgz) = 39ababb0c8156e51b2c9b3854286a72f
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-KZSH401.tgz) = 58b48cb56251a87dfc59abd0ae25e8cb0e0ec7bb
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-KZSH401.tgz) = 4c3c9efd94bf1b9080d7355143d40f2796841448a92bf25c6f8b49772dec595915c8d7aa091afffab8df6f2eec40685c5a008ea65abe3ab32f2da6a7000de523
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-KZSH401.tgz) = 5931d576a61a240dacf5dfdaaeab6ac8a435b17e
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/kern-KZSH401.tgz) = d4dfbdffb2514e61fbfb4d7d39962091
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/modules.tgz) = e5078cfd24cfc29249d14a6a6f84de8d27bf1153
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/modules.tgz) = bc00fa4158aa2606925bd8f71698e543a5628739dcaa953ae99c0218fb8d3d1b70c78134cc5554353c612ec7be6fb4efe2f57b28a91a54c87266a9f7450eb38d
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/modules.tgz) = d35c1aa762a049440ce3095ae19f14cece89102f
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/modules.tgz) = 09a7af7e7ec408df3bd4541aa159ee66
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/tests.tgz) = bc89ec5fa64ca7df4c9b4a748cdf2ea437bbbf11
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/tests.tgz) = 011d3773e6363fccfb41d424a51d455d5508cdfb8da226a3a08670c0f5f96a613f0fa5b9818b634d750ab728a8e1546b3c8823b37c91317eb1d0b1cbd85cb0e6
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/tests.tgz) = b5534365eea74dcca99a5d5568c41b3ce79109c2
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/tests.tgz) = 324430decd8312ba548bff34d8197b5a
+SHA1 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/text.tgz) = 8cbc530ce508c246c6bfca4abc898f139da4cb39
+SHA512 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/text.tgz) = 6cb69d7b7019a82cc1db4326cff681916eee736081c55e08d8a7ff163db75deb91ce2b6feed78fd5775224d3aa24d74d0ca594535447826c03f6613792c9871b
+RMD160 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/text.tgz) = 85f073b017e79c9f8069912fe27ac96b7ad84cc8
+MD5 (NetBSD-6.0/evbsh3-sh3eb/binary/sets/text.tgz) = 72ac1c599c8f41bbe40cad9c17afb550
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-AP_MS104_SH4.bin.gz) = 156a43383fb461877ca595a24fe433c41bb53505
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-AP_MS104_SH4.bin.gz) = 74da9a5e48ac2fcc998176c4a8ae90f6d82e4269b071af2922210d23075c5c8b9b41ee63e9a4a7eddf5edb98a7b1ff32d07ea78a3b1ca95f533bc69a108ecb4b
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-AP_MS104_SH4.bin.gz) = bb94e484f2bfba2253bc36a6724491e54d94739c
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-AP_MS104_SH4.bin.gz) = 02ffe820f66f7d380b2a35522ea3d438
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-AP_MS104_SH4.gz) = 0056d5cf3c88e73792a091ea2aea6ccdfa8ae908
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-AP_MS104_SH4.gz) = 678c13171474bc55453f9a69467b8d85365e6a61e371e212e6e03a75193170bbd033575a46450b11c31724e56eeae77991a225aca564f1e1ca27e625f0dca191
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-AP_MS104_SH4.gz) = 5303158d3acafe0290bbbbff80db24fb2ca0ec28
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-AP_MS104_SH4.gz) = 30c622231e6b9daac8ed290bdeebd164
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LAN.bin.gz) = 16ae6982b9df3f6eb4a035477fd951edb3d300af
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LAN.bin.gz) = c1ca446d125f788e8a155d7069247c3d63daf8ac9c99da2ad9f3b7d56e11b4491444f0ff0fdb2f4ff3722834d9e811f38621d4aa22d2f15434beb2d7033a0355
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LAN.bin.gz) = 032c5396f55b50ad489e595c91c08b680d045154
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LAN.bin.gz) = 47885af19837e332b23aea912dd25c3c
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LAN.gz) = fbe844ab7e33356c35da0a05e841a4e01e4adfa0
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LAN.gz) = abd3144c85d886bf6ed4be0315fe8a6f027d7c31be94d4252fc005c243abe8ac92de6fbb6a5459c0ead867de119ec83caaf6a078c6a6544dfc8c0a98661ed11a
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LAN.gz) = a2e21620fb48f5eac2314187bbafd65cfd80cbcc
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LAN.gz) = c3681279fd8bb4637c6552ba2be82ea6
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LSR.bin.gz) = 3abb9efd6ce8a3dc1fe36eda3e3544d40b8fadaa
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LSR.bin.gz) = 881ed27f7a5b433a6189fa71445db10f9525396c230b1c28a6bdaca291ac658ea15b479cb0bea31a9f1e97ce3d348ec10fbb590c46543a3beb0284b3b12cacfb
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LSR.bin.gz) = fae500b91381408aa48f2cbbd2f10ff4f7f10744
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LSR.bin.gz) = 5b3c31bbb5f5ef0a547728d1d38fe0ad
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LSR.gz) = e108054983abed92e290fb262e94a13afa9d9863
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LSR.gz) = d7c0232734a6cca9d6e077da1b287dc2dbea5c195efd838de60a90121f3625b56978327fd28630d04249faf4f780a54a9154fdab5bf52226a1e7744d417d9d91
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LSR.gz) = c1f2c381a07c03b405656f033475ca9faede3ba2
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/kernel/netbsd-T_SH7706LSR.gz) = 8c1c70f2f1a89d30184699d3a72d690f
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/games.tgz) = 2040b4af557a62f2ade5fc9fcfe4cab3df88c7e2
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/games.tgz) = 8b5071337dc844042537c24c75660e61c9709cd10cbbeab059a84da6d482260b73365ff3870f85060c130a291b6f02be174d288127ca62ce4d291a6982192317
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/games.tgz) = 28acfa5a131d52df7c157e2edca1dd0f20e774dc
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/games.tgz) = d82c46dbc0021fd4694e464042936052
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xcomp.tgz) = 53aa1e2a910e8eed09dc07f8b724804f53fe5e2f
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xcomp.tgz) = 24645da85419528015cdaefd0c835741fa801392e795b363bdfc39558e75e7f384511c0668d12e2440114b7c543c7532aaec438048f08d35c54c9c7a748f20c0
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xcomp.tgz) = 60a461ffc1f1562274110d65c72a541ee131cd21
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xcomp.tgz) = f1d2650a8d7a4ecd60fda8e1aaf8c09b
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xetc.tgz) = 1636a6fe3e01f6d8a07a19cd204a6807c8caa4c7
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xetc.tgz) = 9cea4ba4af287dd57e591d4269f2f2582010250316f323746ac56b12cefcf2590b93fbb0197c665f61b1df41dcca62d17fb6ad80d4b1feb8ac8265e91e15074f
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xetc.tgz) = 5f68e3f96f7bb9ae07fccdb1d058e4b1307b4b29
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xetc.tgz) = da84d97230787283e215a4ee1c4053ad
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xfont.tgz) = 97439ccf6840b18b1e9885f5504a401bf1a93650
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xfont.tgz) = 3d15541f7d7ae2128f44355bf110415adfa4e5182829259d2c6f7a4217feff99e236d13c5bb7bbeb724ff1a09ac1f58f02bdd6eef528bc416ec3118db6fc7d45
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xfont.tgz) = cdc9fcdb5fd5032803d5bba18db58f3ea6d62c85
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xfont.tgz) = a8466a0477c6c443eafe99e9d1c61131
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/base.tgz) = 125d939841f4c0d2d66af02a7cafcb788e62f49e
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/base.tgz) = 768d8f497c4f735be3799406807852393df11f432b5cc9b1ec69ebe56953f1592a48794629c6cf556eb7bbfed2fd8c0c308b91ca9349256d28ce475a75c44ffb
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/base.tgz) = 94a40312cf09aa8867a6dedb8cdb8b3fbdc00f76
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/base.tgz) = 2f9a062d6116d6c89893fc2d0568521c
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/comp.tgz) = b1c32d11d282303c29854fa152b78be77361dfcb
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/comp.tgz) = 715ed5bd87827f3a84d78b28e855c28ea91944b02c1020551d1fa171239547c7b131f11149fae355ae75aae3059c1cbdbaefaa8a22e6daecf26dd045193bd424
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/comp.tgz) = 25c1503f1c807c8edb6521d85a26c45130b066e1
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/comp.tgz) = 5b355abbc1cd023a56a5d91b06b00883
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/etc.tgz) = 9e2708dd9d1dfabdb39ed6979adb744ab09c72af
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/etc.tgz) = c13a2812104b2f36cf94129d638cdffdd62bb86928eb1478306e205745ea5dc56038e40051da26a94cf56a25a6acd46c86cec2e4e04680715089dc8591d84e0c
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/etc.tgz) = 741003e38321059470fcb7bd727ee4c05add965c
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/etc.tgz) = 474217b3b8eb1c86fba55ed465eb0bff
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/modules.tgz) = a6704d748c69ac31bfc6277d625ba6ecce318deb
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/modules.tgz) = ccccacf090cf2a8dcef8df2c43b99f188d6a8898d30546d2f69341819e9feac6f2fd92e0f14086c45e9afcd462a6e4320ef3fc13bde002f3c697094d2d98144e
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/modules.tgz) = 68a529c0d25d89b79bc283b265fb5fd355328d2f
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/modules.tgz) = d7d56e99bb5ba43313e55abf65901ef0
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/tests.tgz) = 68b5f95807399dc8a592abdd911d015938152e1f
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/tests.tgz) = 2798d89e86057ced5d3e12c7771db2e94a96bd6c09fb49ec5803a56d0c484ea0614a1ea6a8a8647ec4427ee34fc191968e9a4025ca1257d072adcd536bc7c3f2
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/tests.tgz) = 6a3f335d038da0dcb81227f0b909399ddecdb0c3
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/tests.tgz) = 7de6b24e3df249a77cdc4c002259ef30
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-AP_MS104_SH4.tgz) = 74f70ee0502eab199c5d1a5855698772627c4ac7
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-AP_MS104_SH4.tgz) = 76656c9b809e842a7db95daa3a5210f845dbc1a6cc2c05dfcd2d31b4404178ab6c3f9dce8705c4c1f1841ee6d75121fec557ffe25660fa24b492e4ee3f4dde4d
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-AP_MS104_SH4.tgz) = d4e2fc853980b624a04b6a4f895a65ea99c3fa6f
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-AP_MS104_SH4.tgz) = cbf232a6d90bbb23a2ff524dc95d0765
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-T_SH7706LAN.tgz) = bd3d26a06d12126b4bcfd594ec43b5b1b2b141ad
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-T_SH7706LAN.tgz) = 7eaeccc298861c058298a99c1f77c4bdc201a4dd11704fa3033177412893e3934f4f6018ba26604c0da00d1544f610af3e606d40b647d25f4d758ebd3803e3f0
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-T_SH7706LAN.tgz) = 802229436fd22dd4213b8ee964c06d0e264032cc
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-T_SH7706LAN.tgz) = d0f7d8401f8a43421267722847806897
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-T_SH7706LSR.tgz) = 07c0d72f0d893ce0812faf6c6a5c98d7b3b58035
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-T_SH7706LSR.tgz) = 8c724d951a2492d879318720c6e768b86094ffbb935c6107ec0bc42fd225e45ec2ac301bd6bad4e2d8df1b59fdf10f0c68df542369ef57c2e2b4ab537b39efe4
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-T_SH7706LSR.tgz) = ce3c2734ca7c81d61f7794add983ac3d40d6c0f1
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/kern-T_SH7706LSR.tgz) = 9efdd97f65905080d86975228272f5ad
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/text.tgz) = ec93765a5c45be2526dd74721c706cf2349cbcad
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/text.tgz) = ca1d8ae749a5cae5b06f568bd4d6cfb9b0af76848cac05b3d6bd6e1bbecbf84a76213064de51cd4ffff3062b5ee039fb7a99b8336474b39110d298dde616a51f
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/text.tgz) = 55c63f02b460a593dcca374f26d03b9595b6a20a
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/text.tgz) = a7d639318aac350f9f955f97035a8fd4
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xbase.tgz) = 4cb422608de78100a7b3bb2113f334951a6d8602
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xbase.tgz) = acbe1e8859d013a1756d97db9bb194d7ead04db13102f45437f1e3054308471ca2c2498cc0c60c4ac8f6431e58ccf7ad4bae62a9d8e2b9857689af4c0f637de2
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xbase.tgz) = 94f03b6f83e22818d2c98c726a4065680049385a
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xbase.tgz) = 7e4b59a51385b2d05aa15b0d98179e7c
+SHA1 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xserver.tgz) = 1423504dda963a794f5710462bd0e3b0ad2a23ba
+SHA512 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xserver.tgz) = 36e50002ccd00c6e945a3e9f49f3f210a3bdd5c493aad4932cb81d30ffcc22ab1d11403bfa04859153148bec4a1c57d6f8d2206dc8ee37dfb2ccb23914144c8c
+RMD160 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xserver.tgz) = 23d438695d917fcf7ece054eeea841fe02bf268c
+MD5 (NetBSD-6.0/evbsh3-sh3el/binary/sets/xserver.tgz) = b526fe22ecba0abf60efad839e21f4d7
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.symbols.gz) = 1a3978b4d00f62cb2ff6277dcdbf79fa3f9bf2eb
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.symbols.gz) = b504aaa9957cb2b08b5656c1c38e35697d38b3fb8f7fe2dcd2942bc0dcbf7d7fd6cfa1ebd79f536a8cb8e86eb1b69a3676afb3c01f9cdd50c2a61a8fa7f6fcb6
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.symbols.gz) = 48c1c3a15270f558fe3b30cbf745a790e51acff6
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.symbols.gz) = e2e15163e4bae081865da32d01514e6f
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.bin.gz) = 873515f4532952c89f5a9f6d91a3f7fa7f948490
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.bin.gz) = c19c7a649d4723f255d79005c6da3caa022857e7a7dfee1afdcaf7db9138d777eebec9a2715032e461ec10129403bbdbb25a5bde1eb84efc2a1e7dc044921149
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.bin.gz) = 18f832108e5af4f1db1314b3d619950f22660c32
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.bin.gz) = 5c15217d997a48ae98f97ef5bc1d9f37
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.gz) = 86b21fd531bdc7e87b16064ae739b5dcb3c92e81
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.gz) = 4e2413b98a091922a7b468169345e4c5090b87264b7232105b0684c2511c78d44a0b0b72f9a8c4ed37bdfb1f24826f87347f883074225fcdd715cadbbf6e8b2b
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.gz) = 882aff308401e9ef5a895233e0759a69840da2f7
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-AP_MS104_SH4_INSTALL.gz) = fa60323505d7a47e47b73dc44e394e47
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.symbols.gz) = 349e56359f7f6dec8f0ae526b3a789516a9e4f88
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.symbols.gz) = c1c075a4ac229add650e83aa77c6d7efe562793645fe7ca868234f53bd79a112f2198905255f0f03e8bdf7a2e44904146907aaf67da9e41652faa7014686ba08
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.symbols.gz) = 6c87f32161c4c2d529cb6a8026cc481dd1d42139
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.symbols.gz) = b64153e036a04f448159999e4f96b863
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.bin.gz) = 23b1af2b9b450007d33c9c68946d6650f8121077
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.bin.gz) = 51a3cb3daaba5d099524325af6a4f32ed164bff6118e88c1e4a5f33ff8a69df456833e5a041396179660af053bd0d1c6a43b5f72ad524be4e61ae9e833222c99
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.bin.gz) = e5bcd565add34239cf0c2083fad873dd12f4e13d
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.bin.gz) = 54fde28b5da7660812ff14933dabc902
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.gz) = 26f7c3703bac98f6350f5a2423f5d9df4a46bbb3
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.gz) = a0a4afa1c58fe9ae74fc03a3780ce16d10f6f00ed6db84e713e2fa51d3b6fb697e281f412eed74d30206edf624ed3bb585b7706252cee2ea37b85de9ed7fe2e4
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.gz) = 6e9be1eba2d6db27781fbcc035d794758b4dd444
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LAN_INSTALL.gz) = d2d661e75be21be7987c548ee785236a
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.bin.gz) = 9f3fabe29ffe68e56430d35f894893491a16c169
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.bin.gz) = 8ca978143e29fed1916beccb35493521ad70772cc7d4093dd2d2d0bee973e06275abd8167a072db9d79f28d2cba1394d7fd940baaf8d55c84622db60ecce735b
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.bin.gz) = 3ecea6d66ed1fc3adb83b5e68d7b5d03ee2ab8ca
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.bin.gz) = 853aef3ffec3749a8e387c0b8cf9c183
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.gz) = 5ea3158a1ddb01af1b0ad97d2788d1e70341faa6
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.gz) = 9d2e7c9da144cc79317b2e40f737b09f5320b90c920d7927db332ed3638c68b5cfbdda3f8dbefcb74330e98bcd9163d9003666b842ef74aada7b2b609de25b1a
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.gz) = 1f2d464e7b2c50a3c33b0a7d2076ff44627e476d
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.gz) = 79f028dbbb91d2c182523ef5d1a26b1e
+SHA1 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.symbols.gz) = e1393c12d538858fc67c3dbb850099d363802af8
+SHA512 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.symbols.gz) = 1a2d80f70a65e38f036a652bcad7774bbc11df1ef51d96868c988dadd25e07c96c2c19d29095b8cebadc6460b2ed5fd141254313d8e3c3f968098cfc136a1b95
+RMD160 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.symbols.gz) = 50d94667fa3c0d7f63e9a6e202967ca006f2f00d
+MD5 (NetBSD-6.0/evbsh3-sh3el/installation/instkernel/netbsd-T_SH7706LSR_INSTALL.symbols.gz) = bd8daee983f82ce040f96f6f929f273d
+SHA1 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-RAMDISK.symbols.gz) = 25a30d5745b993e2102a3786fe1a6f39f470ce45
+SHA512 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-RAMDISK.symbols.gz) = 2c6541b1f613443ffd5f7b331a19ec7e8426783232e3fa9241e621ed96ced5e030fcde14e27c1127e336d74f60e21908f2ff4240285df516a5315c37d5e39943
+RMD160 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-RAMDISK.symbols.gz) = 5736b4fd760d469af93d177f831ea83e63fcee43
+MD5 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-RAMDISK.symbols.gz) = f9ae07f7f20a790a2bba49ed48e9f50b
+SHA1 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-GENERIC.gz) = 4c6d1486cc99844354d97e2b1b2ebd6fe061ecc6
+SHA512 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-GENERIC.gz) = 6f5e544688a50385b3c519e4929508d663e646457c832cd715d0e05ef5f1ef38a40206c90e95356e17cdef5eede141f10371abab306b534087afca9b65536061
+RMD160 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-GENERIC.gz) = 81246f09144ee348e548fa9b7cee0d410ec98f38
+MD5 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-GENERIC.gz) = c861b19c9c0ac6c97350564aebddbe77
+SHA1 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-RAMDISK.gz) = 95a9a9ba6a613ba5be0afdd1457f7243f01d7efd
+SHA512 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-RAMDISK.gz) = 8a36cc3704bc474e9ca4542c8cedcf59dfb93b71a2a5ad44d4c605f059cc515742921eb6de4b64382735a09ae9a72c1fc14e08107480a5090f4319d196a304c3
+RMD160 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-RAMDISK.gz) = 5577d47f6a4429aef2e64789a3ea604718275d7c
+MD5 (NetBSD-6.0/ews4800mips/binary/kernel/netbsd-RAMDISK.gz) = cc1a04eff2275ed68971e5799b9d8af9
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/kern-GENERIC.tgz) = 81a3b610f413d0a6be35c6de2b7047dc4dd1cbf3
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/kern-GENERIC.tgz) = c9716b08912af531dc5304baac333f34ddc0899bca52dc53185bc48d22217613c03533bed4d70faa01423f0a253d2d03ecc6e1c1704430b28eedaec74110cbab
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/kern-GENERIC.tgz) = 5cd01bbebf5245014d265995f6f96e699dd4bad8
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/kern-GENERIC.tgz) = 5a01f783440f099de1bd80cc3abeb52b
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/base.tgz) = 7b4b71623002896a52c0a7c9efe856a0c95de7b1
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/base.tgz) = 97361d892e6c9618569c1022f7b2c2e3485cdf3f1db8b3da1fadd8051a9241dd8baae01c89ffc4b2209651df13be64e8121fa34e1e9373b877add6a4c497e72e
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/base.tgz) = 93372c7049c0a931f1f408d764c3a25600944d7f
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/base.tgz) = 0ba9f6bb4c14ce56fb8b4c24d28c5b54
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/comp.tgz) = fb67d7d7410b3489167d90ac9eab8739d5981b69
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/comp.tgz) = 123e4214744b4b319f93de9443465a1185a755ad34053ef82ed74b5b859ab2ba08655528b98110f7b90973c2f6fe6cc4567d83117e215078819d5558e4795829
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/comp.tgz) = 2949a78034cb32eaf732d7127b21990ef697247e
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/comp.tgz) = 1eaf1d6e18c59de98043f4e477aef4d2
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/etc.tgz) = 9112e98e3b0e6214758b386e4d49dddff2c53fa8
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/etc.tgz) = f6e54b49bd6585c117474ca5a04c9efecebb63f9c074b5e81fc73bb8c4508d21695f8b6689aa518b0a156c1d0fc3653c5d7487e7f373c5eec679bd7d5b80bbc0
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/etc.tgz) = d797fc90bbdef32b5b9d024d4363acec2abbf787
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/etc.tgz) = eb8800ef4e55b63b58066f1f85001efc
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/games.tgz) = e4e2e655f93f3594f4db543839016077023fd1ab
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/games.tgz) = 377f737cae00cc7d9ccc2eae825e68d08a9f6d09474f39294406699ff7d9ca5a0a4347004759b6da9e3a4fb46f3e7ea14c90183bd0ee983cd3625bafb1712e23
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/games.tgz) = 96e4da250eec674b1f3a795026593364798b6a7f
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/games.tgz) = cefe2cbb2de8304de93b3fdb34c664ec
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/modules.tgz) = 5179ba1557042dd0edf4b0dcb43feeb51a51fd9c
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/modules.tgz) = c1f026f1e1ef0dfb74347a9f846971ec05d9c9cd27d9480b4dca4105d7f87c39678c8c76557a8bec407b985087c2371f47856cb81912ccf0e8e219d8f2b1ba4f
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/modules.tgz) = 8cacd504f4fce3b4547758a812d28fc41f1c29a4
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/modules.tgz) = 17f5259f27b6b9e35e05d38e32a47bc7
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/tests.tgz) = 05f79c3300425fa9c41fb0f6d4b67bbd22143c43
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/tests.tgz) = 5202c4bf6086643686bf4fef3927bedb17262acba8c62bfad92db632d6b545a9ffba8eafbb237f8076beba9da3f496f2da068031745bbad9c042d84b954d7bc2
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/tests.tgz) = 7dceaf484da2d9856cbea453914309af8f75faff
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/tests.tgz) = 379a301eaec46b70599b92ff3d69e568
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/text.tgz) = 591abf75de4e52fa3c188ff87fe5fbf28f541766
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/text.tgz) = 0fa9434b5447025c84b3fccbf175b25fe975e88fe711126a9b0625fa070bcfc05c6c962dc59a57ecec38e97e85455911bdc59c411cb6ea9ba2232256191fea4b
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/text.tgz) = 8ccae27fd5067d3e60148abc0751ed5cfb1fb10a
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/text.tgz) = 93c20890d37a4c4b7aacb3cdd534070c
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/xbase.tgz) = 5516e5fd661a6aa8886689fbeab06f0d6ef315bc
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/xbase.tgz) = 16f7b97341977b5b7d1629598d8cc250b0fd361f01b2b65afff93dcc97fcd81e3df2b20b42ef37902b64a20fa5a96c48407eac6f0faa8f6467bddfdfa6dcc975
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/xbase.tgz) = 55c47dd7eed35b436fb033ce22281a13d3c016fb
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/xbase.tgz) = 949eb603afb4e09b5c53facf3ffcba03
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/xcomp.tgz) = c20568ce72c1ab65b9b2b7d6063d4b330c67e0dd
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/xcomp.tgz) = 5ce8a9f1749abed8c536fabd262ca65297d851a26dd108bf917171ae38dc82dda3ecc4315b5d532e8a393778ed566394c3b7a0cd4d8140f4e9ad275371360504
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/xcomp.tgz) = 138ba52cf36085ea08c8f9022fce482e2b119b1e
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/xcomp.tgz) = 9267462e8d885667f784d3e444574bab
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/xetc.tgz) = 0b6040849347e71dc6694909b064c46858ef7267
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/xetc.tgz) = 94cf5fe5f971595d5e17d182aa5fd5cae717fb030336783ec18b34bc054da2b183c184e948b75dda13b1b31468bdadf228682c586e2c1687f4acca2c3545da04
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/xetc.tgz) = f90d3564bda34f368372300e7e0f1dbc716f0761
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/xetc.tgz) = 08fbdb1532ed26f606faba4a71052f15
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/xfont.tgz) = 1c83cc716a88a16e480948fb712c55617dac4840
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/xfont.tgz) = b1913d99dc60c680f2fc82aa8d2ff0970cc7c5a712ca412445334cc2b6136993b6fc58c27aecf12d24455bd8ed5e434e4b6e7067b87f8df73960c5b090f4e624
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/xfont.tgz) = a079720a15cdc7659a8efc5a3ef574814993f517
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/xfont.tgz) = 1ceec721c52139d9b94d42631fb45b5b
+SHA1 (NetBSD-6.0/ews4800mips/binary/sets/xserver.tgz) = 5acda874d4e98472f3bde4d22ee5c76f8e63753d
+SHA512 (NetBSD-6.0/ews4800mips/binary/sets/xserver.tgz) = 044bc28fb73dff4c2c50482adc2b69ec1b0b880b40ca25ea528be078b8f1d84e9e797b5238ea5ce0103aed54f5b32d0ff96ab67661156e28e9969aebe33a548b
+RMD160 (NetBSD-6.0/ews4800mips/binary/sets/xserver.tgz) = df7ea47ab25dbe8529abb8f5dc1d49cd996d6cdc
+MD5 (NetBSD-6.0/ews4800mips/binary/sets/xserver.tgz) = 20191a4f5c5a6cca80c760bfd8836183
+SHA1 (NetBSD-6.0/ews4800mips/installation/boot/boot-RAMDISK.gz) = c0d874d928968bc07c4378652d9df32f5ea0367b
+SHA512 (NetBSD-6.0/ews4800mips/installation/boot/boot-RAMDISK.gz) = 2cfedab16bbb540c131f2518ed74ee2692d96d8a11d008a11279d4c4b95cdf52fb76baf81823e49d3037f1f5230c1194a473f9e0fd37b36025a14988f6e49de3
+RMD160 (NetBSD-6.0/ews4800mips/installation/boot/boot-RAMDISK.gz) = ee3f845cb765fca243be9bb84f17162c7a865304
+MD5 (NetBSD-6.0/ews4800mips/installation/boot/boot-RAMDISK.gz) = 42ccd2d2f905ccadd7497ccd4ff91996
+SHA1 (NetBSD-6.0/ews4800mips/installation/boot/boot) = df1c0cdcdea86e38dface2a89e2fe26dc7df108f
+SHA512 (NetBSD-6.0/ews4800mips/installation/boot/boot) = 6007e2ed816488fc00fca543ab2541f5db95f7a6ad44d4dbde05f4a397fcbf667a41290f7fab5249d6a2f80870a6c04a6bf061d8a25c91b496cbb02d5699b29e
+RMD160 (NetBSD-6.0/ews4800mips/installation/boot/boot) = d321a217c04aafeb530f5d3eb29954eda9fb5838
+MD5 (NetBSD-6.0/ews4800mips/installation/boot/boot) = f39fbdcdde61cea48a1e10e426480550
+SHA1 (NetBSD-6.0/ews4800mips/installation/boot/boot.coff) = e0b297b3888ffdfd4077e67124efa2444194cdc7
+SHA512 (NetBSD-6.0/ews4800mips/installation/boot/boot.coff) = 2c465d178b1c8b4688249410c55b6224b06436dc0b42f09028bd1ce7352c2542749a9e3b685b92f670d3401d6b3b207dfbbf549e19ba38bfe3522f09e08f9429
+RMD160 (NetBSD-6.0/ews4800mips/installation/boot/boot.coff) = 7e7161d03b7f04a55c35dfd8c34a2a5debed56c7
+MD5 (NetBSD-6.0/ews4800mips/installation/boot/boot.coff) = 6bc92c0ddea36ee0816580d8cce6167d
+SHA1 (NetBSD-6.0/ews4800mips/installation/floppy/boot1.fs) = e706f91cc1733ab264473d3f1a887285ca79f013
+SHA512 (NetBSD-6.0/ews4800mips/installation/floppy/boot1.fs) = b946e58e4d1318d5be27e7bfc943b464309c02c63b936f3d11f57a519988d8847b172f30e2d61dad13bd672325dd2dc9ad502ddc5ed0dd49ca5583c1c51c1fed
+RMD160 (NetBSD-6.0/ews4800mips/installation/floppy/boot1.fs) = 16d59bb5fd830cf9551e4184bc338b7395bef5f7
+MD5 (NetBSD-6.0/ews4800mips/installation/floppy/boot1.fs) = 1a09cfb0f06ab364b4a5b55754474310
+SHA1 (NetBSD-6.0/ews4800mips/installation/floppy/boot2.fs) = 73d13ad2676d8db24c4c53e59be5cd53a70e7dee
+SHA512 (NetBSD-6.0/ews4800mips/installation/floppy/boot2.fs) = 4841e1aeb787ece67e3d172c2a614655746beab89f2b09a7566d36979b57d5793d0a308122182e1ca4e052257501f460d0e3d692ef701a1c869041b95e452c14
+RMD160 (NetBSD-6.0/ews4800mips/installation/floppy/boot2.fs) = 3fac30b411e6650a18a85afdca71695e7ecf2d4b
+MD5 (NetBSD-6.0/ews4800mips/installation/floppy/boot2.fs) = 4f501c25c15a582ed08e3e211c040506
+SHA1 (NetBSD-6.0/ews4800mips/installation/floppy/boot3.fs) = 32e2072f8bcef77633e24ec29215c45d2a448c5e
+SHA512 (NetBSD-6.0/ews4800mips/installation/floppy/boot3.fs) = 31f812f795fcecef8d5acf1511e0ccf8a498a51a199cef9384e4f197ecb28409fe9dfa7ccc66ea88fdcdfb7c11bbf2a908f3afda7aba16d4adbce172c48a291c
+RMD160 (NetBSD-6.0/ews4800mips/installation/floppy/boot3.fs) = baa412f7b18b72d89a2f7468b5d10bf76aa1a437
+MD5 (NetBSD-6.0/ews4800mips/installation/floppy/boot3.fs) = e0a8da5b5ed80730a3c4ff8ec316f22b
+SHA1 (NetBSD-6.0/ews4800mips/INSTALL.html) = a2b19549f5348d2f1d52980adce6b6dd1c5fa58c
+SHA512 (NetBSD-6.0/ews4800mips/INSTALL.html) = f70a62de3ff88606a2193b8bf01036b6770079bc8e5c7912c82e223d81671f8e2bc6dddbcd1022fce4352bccee3a1c19c90a2b1fa72bd12bf7edcf4dd42fb101
+RMD160 (NetBSD-6.0/ews4800mips/INSTALL.html) = 500263b32d3fd4f6459496b7e9d250d0d048c79c
+MD5 (NetBSD-6.0/ews4800mips/INSTALL.html) = a341d2e552eea54e2887ab795e752d24
+SHA1 (NetBSD-6.0/ews4800mips/INSTALL.more) = 112fc313673a7ec94f1c6a7ab3ba79d232e0b866
+SHA512 (NetBSD-6.0/ews4800mips/INSTALL.more) = 61df394591fc7b7554c82ced0edec2bd62e7a7e98e0203cc908c6fa48f961062a42148b856f2046f9a3d5262de7d7cc392c15e346b0bea8ec5ef2717760dc30f
+RMD160 (NetBSD-6.0/ews4800mips/INSTALL.more) = e92e60dd50dfc2ed354ed18f01cd412f62257367
+MD5 (NetBSD-6.0/ews4800mips/INSTALL.more) = f6ff574342525c12f5e039e524ab23cf
+SHA1 (NetBSD-6.0/ews4800mips/INSTALL.ps) = a5e622805b2d9d7f96b2aae0b819b7607335d8fc
+SHA512 (NetBSD-6.0/ews4800mips/INSTALL.ps) = c8cfeb73d5c4f033877795597dc9edd1dab7902a9753b09127bd9e1875d55ead42746d06b3b31b6ddecc19d876495201736b9ef6c242c357d0bca6d74aac9dc3
+RMD160 (NetBSD-6.0/ews4800mips/INSTALL.ps) = 07d50c1fde4cd58f0db754495c39509f69e1dbbe
+MD5 (NetBSD-6.0/ews4800mips/INSTALL.ps) = 831c1f71243c24726c508a45dfa97dbc
+SHA1 (NetBSD-6.0/ews4800mips/INSTALL.txt) = 6528e1b0d61bf2daab21a1ad8b36dfaf56ef8289
+SHA512 (NetBSD-6.0/ews4800mips/INSTALL.txt) = f2f1d34cc0d64c9764604de75197554e49095f305042d0d729da16a0a8edfa4792ce647d3321072af4c1980367270b7097275b32bcacf841409ba4eaa6e97edd
+RMD160 (NetBSD-6.0/ews4800mips/INSTALL.txt) = 5311f44e35a9074f47aec723c579e2c04e9928ea
+MD5 (NetBSD-6.0/ews4800mips/INSTALL.txt) = 1e6dfee2b6a42e87aa56dbf9f345174c
+SHA1 (NetBSD-6.0/hp300/binary/kernel/netbsd-RAMDISK.symbols.gz) = 3e4f61e16b7b76ffbda7ab2b2826ed6e47f55cac
+SHA512 (NetBSD-6.0/hp300/binary/kernel/netbsd-RAMDISK.symbols.gz) = 7c0389792e3d8722cd6187619978b413194ec8aebc17fab04ea75f37207c1c74bcf6f44a70beb5ca6712382b745d37d6e1ea3c87e1e93cf03c5891b583f5b513
+RMD160 (NetBSD-6.0/hp300/binary/kernel/netbsd-RAMDISK.symbols.gz) = 94f4e2e55d48069e13e05c43ee7688999a9d8488
+MD5 (NetBSD-6.0/hp300/binary/kernel/netbsd-RAMDISK.symbols.gz) = a1f4d88bc66a8924f563b00b4c194823
+SHA1 (NetBSD-6.0/hp300/binary/kernel/netbsd-GENERIC.gz) = 70a5a051fb4b94008c3598cf7432e40048ac15b5
+SHA512 (NetBSD-6.0/hp300/binary/kernel/netbsd-GENERIC.gz) = 342651536f367f4adcae4435afd623af0818e56362ba8f8c9376b49a0f2c57af2ca568edd32954744792904aa1fdf98392d398d75b5c8cc4f30ac456fdedb62d
+RMD160 (NetBSD-6.0/hp300/binary/kernel/netbsd-GENERIC.gz) = ce09eea6cbeaf12e2fcd4aabcdb2047e48c686ac
+MD5 (NetBSD-6.0/hp300/binary/kernel/netbsd-GENERIC.gz) = d1b8cd8ebde9c0bf97177f7cc8615bbf
+SHA1 (NetBSD-6.0/hp300/binary/kernel/netbsd-RAMDISK.gz) = 653c4beb8dc20a0c8d66e9cee85225fc221b5e8e
+SHA512 (NetBSD-6.0/hp300/binary/kernel/netbsd-RAMDISK.gz) = 62259ecdcaf08723230e0fcd0c9738fa3b4e42954e114146a7bfc11ab775adf2c36a7924fc9532ffeb5b50da52c9789162b56fd991511922a074f109edf22212
+RMD160 (NetBSD-6.0/hp300/binary/kernel/netbsd-RAMDISK.gz) = 634dcaef5fd936621863005e583978fff3f4638c
+MD5 (NetBSD-6.0/hp300/binary/kernel/netbsd-RAMDISK.gz) = b4cfe5ee1d9fcffa55595ceceb2cf7dd
+SHA1 (NetBSD-6.0/hp300/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/hp300/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/hp300/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/hp300/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/hp300/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/hp300/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/hp300/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/hp300/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/hp300/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/hp300/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/hp300/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/hp300/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/hp300/binary/sets/xbase.tgz) = ffc6dc889560371042dd12a5486a9a2c499b86a9
+SHA512 (NetBSD-6.0/hp300/binary/sets/xbase.tgz) = 9aa2ba4d703a13020acf8543d1efcde76b6f0f4b411be20f804709b3802e537be1e651eba469830c4fd4777a379ea9936200a3a3eb4b1a702c04bb81aafcc723
+RMD160 (NetBSD-6.0/hp300/binary/sets/xbase.tgz) = 3ecf53e7414ef859a47fe5afc108cf3bfa82fb1d
+MD5 (NetBSD-6.0/hp300/binary/sets/xbase.tgz) = a6af002ce158cf72eb5c6a7cde2c0989
+SHA1 (NetBSD-6.0/hp300/binary/sets/kern-GENERIC.tgz) = 7ab2f7be438f52926aee3c94e07951b7eb288775
+SHA512 (NetBSD-6.0/hp300/binary/sets/kern-GENERIC.tgz) = a4fdc0d2604b8f00790d8a3766bca90391cde8f0f564b7409738f151355f2bc1bc512a25629ee45ba7321a8791f983dda206124a7280ab082f7b255d50b57df2
+RMD160 (NetBSD-6.0/hp300/binary/sets/kern-GENERIC.tgz) = 85283b11855a8e69be87b21678328f4a675ca02e
+MD5 (NetBSD-6.0/hp300/binary/sets/kern-GENERIC.tgz) = 64374db1afce82099588ba9afc920440
+SHA1 (NetBSD-6.0/hp300/binary/sets/base.tgz) = 06b4b615865b0d72c01ca5676c7755af13eaec39
+SHA512 (NetBSD-6.0/hp300/binary/sets/base.tgz) = 326b28bb808cfc55a3f25766ba747483c7b1ec585b56ef8deaabbb62e3a6adbee3af61eeadf34ea1b6ff41a379e267bfea7516ee2bd80684e3228913c11f771f
+RMD160 (NetBSD-6.0/hp300/binary/sets/base.tgz) = e1bffbda1eb605d10b7eb6e607971d53ba6bf26a
+MD5 (NetBSD-6.0/hp300/binary/sets/base.tgz) = 23ecb1b54aa4c4f5d8a3217a1ef01ca0
+SHA1 (NetBSD-6.0/hp300/binary/sets/comp.tgz) = 3031c0b6b9903720a6b1fe865c366faf35e35af9
+SHA512 (NetBSD-6.0/hp300/binary/sets/comp.tgz) = 37ec2ee919d9d087dd0690cfce76d6be60abc618c3939ab32941ee6c0990c9d5de75f0035f56d2c501d0c5f6e016098bacd502eeaf0849c091dff2ec1ec52cb4
+RMD160 (NetBSD-6.0/hp300/binary/sets/comp.tgz) = 2b934c679fb8e8c0f79a2dcec65e9ffb1ee3477f
+MD5 (NetBSD-6.0/hp300/binary/sets/comp.tgz) = 5db470910b6991bd50d1003122e50bec
+SHA1 (NetBSD-6.0/hp300/binary/sets/etc.tgz) = 6f8edda4999c8a4343fc2bc279241b9550ea490c
+SHA512 (NetBSD-6.0/hp300/binary/sets/etc.tgz) = 562d88456cedf5e071d8fa1d93a8dce22f687ffdac77354129d67db4f701cae1af8108a27d9bbd3fae6035f29cea3438d08954e4e784e0a4a103bbc97362179d
+RMD160 (NetBSD-6.0/hp300/binary/sets/etc.tgz) = 924ef5e6623a78f068d2be3eb41d7acd6dc767d4
+MD5 (NetBSD-6.0/hp300/binary/sets/etc.tgz) = 21fd073754ac797a337928786b03c811
+SHA1 (NetBSD-6.0/hp300/binary/sets/modules.tgz) = 83594fc109e081cdb189cc607f9f0e2bdbd17149
+SHA512 (NetBSD-6.0/hp300/binary/sets/modules.tgz) = 0741d29e6d7a9ab7bdcd0f7d24cfdce277787bb4e4677035222b34a66570a245279b257b1adb1a0e174af3009ba8f54db7801238b754365efee73af0c1aedef7
+RMD160 (NetBSD-6.0/hp300/binary/sets/modules.tgz) = bdf66666ad75847756c3fc123fdcc44ce959e1af
+MD5 (NetBSD-6.0/hp300/binary/sets/modules.tgz) = 28892a09bb10b455457f5f581f57f2f0
+SHA1 (NetBSD-6.0/hp300/binary/sets/tests.tgz) = a5ef542440872976bdd13a62aefa0d14d61c26c0
+SHA512 (NetBSD-6.0/hp300/binary/sets/tests.tgz) = c3f7eec4bdf7dee4746ce7c6f234fb0fd98b97cf4d8eaf6b3ac2f90c3e9ca5cb8cdf35427310135ff7e90f81f584ac3e42c5e7ccfdf2de03c07bca5b5768e078
+RMD160 (NetBSD-6.0/hp300/binary/sets/tests.tgz) = 1088670cc9cf63a9232b07ead39467b939007ec5
+MD5 (NetBSD-6.0/hp300/binary/sets/tests.tgz) = afa98cf6d10be6bd60a4122ad26f69b6
+SHA1 (NetBSD-6.0/hp300/binary/sets/text.tgz) = 34cbcecdf88d3b20397c210adaef51a7aeebdbf1
+SHA512 (NetBSD-6.0/hp300/binary/sets/text.tgz) = 9718fde476237be7d04c9e3bc0fef0ac97fe275d6c98cc58f42e4266a7501b8a95e0edf8b46e1a33b4aef67222731978be2fe427d52993a0fc8ea30185411c5c
+RMD160 (NetBSD-6.0/hp300/binary/sets/text.tgz) = c96e584c3615a0f4e9eb12a8542b0fa8e60e1f1f
+MD5 (NetBSD-6.0/hp300/binary/sets/text.tgz) = 3dc6892231a62bff94ab46648015667f
+SHA1 (NetBSD-6.0/hp300/binary/sets/xcomp.tgz) = 55de1ba9512bb95b3678c1569840e740e6f5b556
+SHA512 (NetBSD-6.0/hp300/binary/sets/xcomp.tgz) = 83011012f7ce5cd11e58e12f068cfbb5ee4987d40aeae1026503899cdb9d5cf4d4edd6497b2ef0a3e75894d6bcf962fc3492572b51a505fae38ce9d12e4dc36b
+RMD160 (NetBSD-6.0/hp300/binary/sets/xcomp.tgz) = d696a85c3da7325eb570111f63f9d3517d47572f
+MD5 (NetBSD-6.0/hp300/binary/sets/xcomp.tgz) = 5729b37859a9265fbbfe184d66daaa9b
+SHA1 (NetBSD-6.0/hp300/binary/sets/xetc.tgz) = 64f0dab5e32092b4ea7dc9352efd06fd648f5f4b
+SHA512 (NetBSD-6.0/hp300/binary/sets/xetc.tgz) = 6fdac8545bf826d9a263cef4354914842986159aae07cd49ffbdda2cefeff6906f3f369141e0f54a213f4530b34160ac420c91c0fa9638354f244c1a625c8ffe
+RMD160 (NetBSD-6.0/hp300/binary/sets/xetc.tgz) = b1167b7794746ee9e9828f6b5d3a34efee1e0fe4
+MD5 (NetBSD-6.0/hp300/binary/sets/xetc.tgz) = fd2d95f88081017c690d585af9cb52fa
+SHA1 (NetBSD-6.0/hp300/binary/sets/xfont.tgz) = 7ff182435282d7ae2377257437bf5f2ead69bf6a
+SHA512 (NetBSD-6.0/hp300/binary/sets/xfont.tgz) = aec8b80b466469fd5ab3d851f46cdeccb90b708401d15bd97301001640888b1d6cb50d4b5df95e95516e74e2b644e9b940be085ecd174a7b165ec6557b15fd40
+RMD160 (NetBSD-6.0/hp300/binary/sets/xfont.tgz) = 1de0aef2c305fd7dd1ed69d5c14ada0f1b709bc7
+MD5 (NetBSD-6.0/hp300/binary/sets/xfont.tgz) = cc29580d8a56cca694e732c04ec99480
+SHA1 (NetBSD-6.0/hp300/binary/sets/xserver.tgz) = 2c9dda0fd8c1e7212d505f36e5c89ad2468efe52
+SHA512 (NetBSD-6.0/hp300/binary/sets/xserver.tgz) = 412e82089215b7a52c4fd12ad4df99d3c2a0ed39207e41b102163ae7a627fd765f6b3b93cf0d197d2122d50a2196f17ff1bcfbdcc99c44f03e4b4cc80ee95455
+RMD160 (NetBSD-6.0/hp300/binary/sets/xserver.tgz) = 133cec24a054a44d8137770ae19faeae2d454a43
+MD5 (NetBSD-6.0/hp300/binary/sets/xserver.tgz) = 5f4ca5d0340f3616df2a4514e9bee2e3
+SHA1 (NetBSD-6.0/hp300/installation/miniroot/miniroot.fs.gz) = 2bffdc8e8f2ad0c26c428349eb4e04adcaaaf0da
+SHA512 (NetBSD-6.0/hp300/installation/miniroot/miniroot.fs.gz) = 6a9135af4681c6b56877b2beff8a5e3e5bd2ae07283f1c78ad2b52d7c56db82779daf57c8c1939aba1dbab03be129372a2d1255f7c23692f548d684bcab2825f
+RMD160 (NetBSD-6.0/hp300/installation/miniroot/miniroot.fs.gz) = f81c0d294b7e481ea7f881e4ee89dfe9090e30bd
+MD5 (NetBSD-6.0/hp300/installation/miniroot/miniroot.fs.gz) = 6e487378f7e4b0cff281e3d2270e0a80
+SHA1 (NetBSD-6.0/hp300/installation/misc/HP-IB.geometry) = 1f0f75de1ee7d8e3181a5d6aa66773677755a884
+SHA512 (NetBSD-6.0/hp300/installation/misc/HP-IB.geometry) = 92d43dab00d4075e373ef3bb391cbfc404778b79b12da342eecc67a3c1a6cd1bcdf6da79ce48dc7262fe8b7d58f62317d4c2175ae67e3b7c69bdab6708509e50
+RMD160 (NetBSD-6.0/hp300/installation/misc/HP-IB.geometry) = c98d08dbec0a38097b07350201358ce795207abb
+MD5 (NetBSD-6.0/hp300/installation/misc/HP-IB.geometry) = 5d37ef7fbd5c7cf0fc9be6ca42e13766
+SHA1 (NetBSD-6.0/hp300/installation/misc/SYS_INST) = a49379b1d8420e60551f6255fef597495bfa6ed1
+SHA512 (NetBSD-6.0/hp300/installation/misc/SYS_INST) = 6c56496dbd3c76c120c9b4acec61a2e91bce64c9c640cc7d2d1aeb7865f57aff311b71526e82eae87b92d5938ce56264d427dfa02b434ce1859ff179e64cfb6f
+RMD160 (NetBSD-6.0/hp300/installation/misc/SYS_INST) = 827a7056af385da9b3d3adaea74d39e819dc0041
+MD5 (NetBSD-6.0/hp300/installation/misc/SYS_INST) = f396854e44d13f00a55e32217d907781
+SHA1 (NetBSD-6.0/hp300/installation/misc/SYS_UBOOT) = 2939db5d57267e58c09ce33be7a91e4842cd8152
+SHA512 (NetBSD-6.0/hp300/installation/misc/SYS_UBOOT) = d609c8e747839742255b0826d0024adb2c9fd6b454e4ab6af71f371c2e437fea20f74eaeec52446d1eeff113edb7a4335a435bd9493d4356f2c6fdabfff6a99b
+RMD160 (NetBSD-6.0/hp300/installation/misc/SYS_UBOOT) = 94935b4c88578641336c28fca15951e613869a4d
+MD5 (NetBSD-6.0/hp300/installation/misc/SYS_UBOOT) = ca853b39c14fb1cf61fb9a8291e86c0f
+SHA1 (NetBSD-6.0/hp300/INSTALL.html) = 8e1c3fbcbc18743ea7a5e551efdb53f84615c5f6
+SHA512 (NetBSD-6.0/hp300/INSTALL.html) = 03450311591c740dd9a59f7d59c82d347f216141a7d297b2aceec341ba73afaa39fe7a97c7d929e93e48db1a38d3e8e82fd5df6036ca1387a9fdcb67e5f1860e
+RMD160 (NetBSD-6.0/hp300/INSTALL.html) = 74b4c33c7bdf6739b4fab6d95811c4a6e705f441
+MD5 (NetBSD-6.0/hp300/INSTALL.html) = b432699922bc91b44886f23df7cf19f3
+SHA1 (NetBSD-6.0/hp300/INSTALL.more) = 1cf75d206beed7a64d40e96fbe895f74a70d1f16
+SHA512 (NetBSD-6.0/hp300/INSTALL.more) = d4ba1700ff39cce32ce327e810d4e87d40d942209a323beee44697e44e541acb0fe44e66d16277a0cda05cbebd0051e6c7573269868b1e7574e6645c678449ff
+RMD160 (NetBSD-6.0/hp300/INSTALL.more) = 89b542e3ef218607f3e65413c3965b7f2333187f
+MD5 (NetBSD-6.0/hp300/INSTALL.more) = 624bd59da093361cdaaab5c1de5cecba
+SHA1 (NetBSD-6.0/hp300/INSTALL.ps) = 382b1bee832f5d64618348011bbafa088821422f
+SHA512 (NetBSD-6.0/hp300/INSTALL.ps) = d986b290afd180501692aca87592c0c71f4a79a2ab774b4b5f28a2fec714547732964125e11ac047afdabbe5f2aec9c44c40d4abbe064716368d012c88a696e6
+RMD160 (NetBSD-6.0/hp300/INSTALL.ps) = 484e2cd1d11eccb452fe023cf442225f60381c75
+MD5 (NetBSD-6.0/hp300/INSTALL.ps) = 532f28fb7f53079a80b851a5ada9cdf5
+SHA1 (NetBSD-6.0/hp300/INSTALL.txt) = 5f6a19f1fcbe957565baf1fae076513a127af37c
+SHA512 (NetBSD-6.0/hp300/INSTALL.txt) = 39744f1a32fa5869dac98bdf458d4c43b55857ea7881f3f66e437c496840707fe2a587be8c38bf1d61593c7d3603d231df56f8110be97a65f6a551d4aa75c1f0
+RMD160 (NetBSD-6.0/hp300/INSTALL.txt) = 026e4872a0fc52ba4d08907a6907cc72a814c577
+MD5 (NetBSD-6.0/hp300/INSTALL.txt) = 025fee7db55908a9ba7a358d3598a074
+SHA1 (NetBSD-6.0/hp700/binary/kernel/netbsd-RAMDISK.symbols.gz) = 3b574a0a7fa12dccfe7ec7a74f3c6d44b3de73d8
+SHA512 (NetBSD-6.0/hp700/binary/kernel/netbsd-RAMDISK.symbols.gz) = 3de19c62127f98cc12b223d296bf8c69c262c7cc79e4eb4975eb313c96882f4df8d8bc0ff64a7c57b7e7d30896b49935c5475203a369a8f2e134622dcc29d3cd
+RMD160 (NetBSD-6.0/hp700/binary/kernel/netbsd-RAMDISK.symbols.gz) = 9c58c704e1a31f946467144840d8eeb207137fbb
+MD5 (NetBSD-6.0/hp700/binary/kernel/netbsd-RAMDISK.symbols.gz) = de4a876f7ef0c5aa9c566e4f976723c5
+SHA1 (NetBSD-6.0/hp700/binary/kernel/netbsd-GENERIC.gz) = b9b1dddb8855998b36022d03cc9c49ce5e6ed212
+SHA512 (NetBSD-6.0/hp700/binary/kernel/netbsd-GENERIC.gz) = 39bcd475712ece695379203c3ec20e2bada75f8b6b6c6f8f80a8826c65ff112a6e2cc8e8c18a5547fa4fa2e2bb7704d6f5b303b2c600f05cadd9dff1da997904
+RMD160 (NetBSD-6.0/hp700/binary/kernel/netbsd-GENERIC.gz) = 0b67d5990ab7491b64a591e99053470eadcb13a6
+MD5 (NetBSD-6.0/hp700/binary/kernel/netbsd-GENERIC.gz) = 2090d459fd5d513c070c401d72b3ca74
+SHA1 (NetBSD-6.0/hp700/binary/kernel/netbsd-RAMDISK.gz) = 38bb542016466c8e1a7c8535520729cc5b9726b8
+SHA512 (NetBSD-6.0/hp700/binary/kernel/netbsd-RAMDISK.gz) = 49d747023260ee1b61b59e0a14ff413c97b1daaf5cc20ae916b42d83b99f7438465afed77185c7ef0154ac762edfa93acc8733574fed66e68b58db11c34ce72f
+RMD160 (NetBSD-6.0/hp700/binary/kernel/netbsd-RAMDISK.gz) = 268e5e4322fb04246e0a1f8df5788e8530cb88c7
+MD5 (NetBSD-6.0/hp700/binary/kernel/netbsd-RAMDISK.gz) = 4175ca432943eb0d4cae87e5eafd3316
+SHA1 (NetBSD-6.0/hp700/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/hp700/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/hp700/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/hp700/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/hp700/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/hp700/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/hp700/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/hp700/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/hp700/binary/sets/kern-GENERIC.tgz) = a7b11dacf977418c4a57b400530c123c99447a66
+SHA512 (NetBSD-6.0/hp700/binary/sets/kern-GENERIC.tgz) = 071f2e512f843bd91f68e757682e5414600220833b8269be06956d29e61f0383a5f187bdf9a9414a8d64edc6ed9808c8df468fabca174f9079954991c6582300
+RMD160 (NetBSD-6.0/hp700/binary/sets/kern-GENERIC.tgz) = be81b5bc0509f3c9a10888b8f7fac2982871320a
+MD5 (NetBSD-6.0/hp700/binary/sets/kern-GENERIC.tgz) = 313aa8cbee11f72da2bb608cb35f7a29
+SHA1 (NetBSD-6.0/hp700/binary/sets/base.tgz) = 4cc8adc7171679140335cc44ecc8f4f338f47ba5
+SHA512 (NetBSD-6.0/hp700/binary/sets/base.tgz) = 48e68c7d28cbc15733f8677d7d139897350c389f7032e78e06d6cbb8b9debc09bde2aa52e7226ef58660da81c238e960e5794689a3f3e19f5eca40f532117542
+RMD160 (NetBSD-6.0/hp700/binary/sets/base.tgz) = 3582b7f0c2852854cccad70a2e8f372a7acf0369
+MD5 (NetBSD-6.0/hp700/binary/sets/base.tgz) = f8166ed58eec05489e3857d9e09469ad
+SHA1 (NetBSD-6.0/hp700/binary/sets/comp.tgz) = d9f4674db21772a521c5eb24e5fbe4ae2656c5d6
+SHA512 (NetBSD-6.0/hp700/binary/sets/comp.tgz) = caa488b17380cc2cc8f35ed9703bcac5c778fd597f8f607b26328c58b6b64dec7a784b22335a5c144f31fddf6d03a67d0f2c473ed7498e4f1ada17570f2893aa
+RMD160 (NetBSD-6.0/hp700/binary/sets/comp.tgz) = b625cf9eaa395a2844cea44b1904ce9358c862b8
+MD5 (NetBSD-6.0/hp700/binary/sets/comp.tgz) = 07a825a8852f558425856a06e5677bfd
+SHA1 (NetBSD-6.0/hp700/binary/sets/etc.tgz) = 0576313db33f67f3208c996a1819d19b5f0bd2e3
+SHA512 (NetBSD-6.0/hp700/binary/sets/etc.tgz) = 4d1eb5b04fd24f34112c49829b68ea0b7c841fc8b465e363ed4e79d58cd448ddcc6a493bae49cc9a4a4e9bb92314ddc032c5ed060f48b6de60e5045e981809af
+RMD160 (NetBSD-6.0/hp700/binary/sets/etc.tgz) = eedfb6a8724ef33f4bc3ef4e08c1ec6f868d548b
+MD5 (NetBSD-6.0/hp700/binary/sets/etc.tgz) = 8c95ad14875e9a87428ac7f6cf3a944e
+SHA1 (NetBSD-6.0/hp700/binary/sets/games.tgz) = 1be2d6b3d863032e376b31b2b4489a65acd09d94
+SHA512 (NetBSD-6.0/hp700/binary/sets/games.tgz) = 322569b0060cc67b16d15a79b8c813e548ea4908ec18fdb91472a4ac5b03bc8abcbba2e5bfed3ed400cbc84ecc82a5edf087f54c06bc682c276a15b516f4dacd
+RMD160 (NetBSD-6.0/hp700/binary/sets/games.tgz) = b4d4f8cbddbca828beadbd87ef4f20f1b23d7421
+MD5 (NetBSD-6.0/hp700/binary/sets/games.tgz) = 235dc6818c1a24a788301264c292ca2a
+SHA1 (NetBSD-6.0/hp700/binary/sets/modules.tgz) = 1b4ecd74bda33a325888994e03e67327a959a381
+SHA512 (NetBSD-6.0/hp700/binary/sets/modules.tgz) = 7f77163eb7973139a1e6a2c4aaf3147b94e5f1f977ee642c08b1ad912861d810d953c71ac9db5c5b74c9f9b691a48faeccb4192b099f6ba3cc7fb41093f55533
+RMD160 (NetBSD-6.0/hp700/binary/sets/modules.tgz) = e6f669845fcac20f9921602a26bfed3d83c0b453
+MD5 (NetBSD-6.0/hp700/binary/sets/modules.tgz) = d5fdd2b3f62edab0ea9e9652c2274b01
+SHA1 (NetBSD-6.0/hp700/binary/sets/tests.tgz) = 4a3701895f22ba6d97662a345fa9c14bda977335
+SHA512 (NetBSD-6.0/hp700/binary/sets/tests.tgz) = 9ec93c9ec1b2732690f2a3d07cce15569b5ff57a2cabe9489ad28e7b52ccbc0382795267abb6d30a7db9b38f3b7b6a0c6016ea175b1d91f24b50922e3098cc4a
+RMD160 (NetBSD-6.0/hp700/binary/sets/tests.tgz) = f62f1798af8d3df9d9653487c543be4411fb2037
+MD5 (NetBSD-6.0/hp700/binary/sets/tests.tgz) = 764d8df608cc1e9c23923eb7292f1962
+SHA1 (NetBSD-6.0/hp700/binary/sets/text.tgz) = 12fe20e8ab174d0f6bcd8ec6be600ed0e0cca782
+SHA512 (NetBSD-6.0/hp700/binary/sets/text.tgz) = b56b29228d79ba548c3ad908f9c81cf7e427bc72e607820438c6154e256f5bb4bd102aab7c31e86b241ecc42f824420aa7969e6ac418250c344eeffd1280abdc
+RMD160 (NetBSD-6.0/hp700/binary/sets/text.tgz) = 1e16f9ea1efaee41bc10b045105a1d0dc4f0d17c
+MD5 (NetBSD-6.0/hp700/binary/sets/text.tgz) = 09610caef8a531f7c490920d43a7c3d0
+SHA1 (NetBSD-6.0/hp700/binary/sets/xbase.tgz) = 0c5e93ea81c0f09063e5c30f42c9d652aa9b68cc
+SHA512 (NetBSD-6.0/hp700/binary/sets/xbase.tgz) = 03f48b4ef5dc3f869866f00214d7d5482f03d2d838ceb05e0003484d8835f05b484d998debf24d801721dbb155aa5632a9a1e6d3a830d6faddc552c4500ac3e7
+RMD160 (NetBSD-6.0/hp700/binary/sets/xbase.tgz) = 8661bbe49a27e86810bee528b84947926e0a2e65
+MD5 (NetBSD-6.0/hp700/binary/sets/xbase.tgz) = 21b4506d3d4f407c33d8c152ca8ef304
+SHA1 (NetBSD-6.0/hp700/binary/sets/xcomp.tgz) = a70481db9baba9f60cf23c52e72dac446888df2d
+SHA512 (NetBSD-6.0/hp700/binary/sets/xcomp.tgz) = 07c5ba6aa0ce0da2c5c2a3987c7c20226e4ee3158578a7ff70609bbfafc83becdd6a6185fd2c0b4a441f7d92c2cf5be3c767252c11f8fae07068f3ddeb48382e
+RMD160 (NetBSD-6.0/hp700/binary/sets/xcomp.tgz) = 2d0179f816fb0a90c931f0733cbfad6dfe3f4d17
+MD5 (NetBSD-6.0/hp700/binary/sets/xcomp.tgz) = 84ddb46d08c60fab91553d60f848e21d
+SHA1 (NetBSD-6.0/hp700/binary/sets/xetc.tgz) = 0ba461866c920a4fb82c50eede51ec242527a428
+SHA512 (NetBSD-6.0/hp700/binary/sets/xetc.tgz) = 1e84618c1e253df70f3801c93b1276ab63df818b231afb21a6c34089fd53cc95c9314a8ff14270d622a231c7fb963473e152f013e1cc2f338e7f231eabf524af
+RMD160 (NetBSD-6.0/hp700/binary/sets/xetc.tgz) = a98382606c9775e89131fc737d791b9c4c8334d6
+MD5 (NetBSD-6.0/hp700/binary/sets/xetc.tgz) = 626d88e448091f14845bf3a565d330ec
+SHA1 (NetBSD-6.0/hp700/binary/sets/xfont.tgz) = b70a4c27223f81cf49a62a85c3addc59b52f4b48
+SHA512 (NetBSD-6.0/hp700/binary/sets/xfont.tgz) = 82d94e80e98de78d71d5bae5af20b2755cadbaca48d548b2575fba4a52b2f35e09b71efb4fc8f0f1eadb5282e449807745feeb1d121275e9457eebe93722deb1
+RMD160 (NetBSD-6.0/hp700/binary/sets/xfont.tgz) = ec9a08a3c3e1563d8c4bd9a86d0e7fa38dcfa944
+MD5 (NetBSD-6.0/hp700/binary/sets/xfont.tgz) = 0bd2c8bc1760f957a2dec6126148ccb3
+SHA1 (NetBSD-6.0/hp700/binary/sets/xserver.tgz) = 892de89d8c46c05b44affea346312132bdc9d7b8
+SHA512 (NetBSD-6.0/hp700/binary/sets/xserver.tgz) = 18f1705c9e448b34e240f0f215fd618f62af2c1efa59fc9456a28df4fd477a6da26af82f7a99c359edd312abfedfc7b3058f651472a17d339f672db872ade390
+RMD160 (NetBSD-6.0/hp700/binary/sets/xserver.tgz) = dadd7b1915e43f92a618b65f739d91fc47cb17f4
+MD5 (NetBSD-6.0/hp700/binary/sets/xserver.tgz) = d0ce54a0227edeea0ed0572c32f7382e
+SHA1 (NetBSD-6.0/hp700/installation/netinstall.lif) = e4f530ba8005c2a02ab8cc5f6f2f9bc266ed7d27
+SHA512 (NetBSD-6.0/hp700/installation/netinstall.lif) = 9cb62f32608d400472276a255cc25c872406cd9a2113a787dd9735759a3d05a1de97c2b53daeeb35b4ab07e3e016aaea0bcc2da165c3c07633ac716900383354
+RMD160 (NetBSD-6.0/hp700/installation/netinstall.lif) = 00807d44c30717d4b524a94e209ae8881d9894b8
+MD5 (NetBSD-6.0/hp700/installation/netinstall.lif) = 070bcd9b95c8c1f02cb3e233bbfd997d
+SHA1 (NetBSD-6.0/hp700/installation/SYSNBSD) = 0458f52af240895100db4e2c15e685a9a8af00da
+SHA512 (NetBSD-6.0/hp700/installation/SYSNBSD) = 6acc8321830dbb38cbbbe88bba88c6f0bbdfcfe60380f11fbe92724b0defcb8dbf3ea9207e7522fb90b95a0a401114a751cdef01ddcd5d354cb7ec058c83f98a
+RMD160 (NetBSD-6.0/hp700/installation/SYSNBSD) = 2c9d5b050abe290f785eaf9fd1fb746ec0c2d310
+MD5 (NetBSD-6.0/hp700/installation/SYSNBSD) = d6cb9aa32688c2b571b6b62f7141d23d
+SHA1 (NetBSD-6.0/hp700/INSTALL.html) = caa84e344b51c67646142496becf7b3580bdd769
+SHA512 (NetBSD-6.0/hp700/INSTALL.html) = 87e4eaa6077a464832397ddf9eb59ca95949c655d9897fb630899274176ded45b22f4da21ebbfad688515b7cb63a7aca9e5fa8b003d4c81208c0c514ddaa9d3f
+RMD160 (NetBSD-6.0/hp700/INSTALL.html) = e46593839ae31aa17259f36ae4f71ee9cf56d317
+MD5 (NetBSD-6.0/hp700/INSTALL.html) = 5b63b1d8b0e76a1626ced50e760b6a24
+SHA1 (NetBSD-6.0/hp700/INSTALL.more) = bec1e3da9f724159b4a5b52e7bde3948e92573a4
+SHA512 (NetBSD-6.0/hp700/INSTALL.more) = 14a618c17e946dfc8c537f48b3f8c225ccf0484acdd1311555c7273a720a867f57b0f72786bf1c5ce874c0a8dc122d6452e476f6b3b5cfd2fdcf3e7b90c20b0a
+RMD160 (NetBSD-6.0/hp700/INSTALL.more) = 3cf2ba4b0c27b4e83b2275ffe8b0736c536b40b0
+MD5 (NetBSD-6.0/hp700/INSTALL.more) = 211474596cbc940278e9edfbf8ab7d23
+SHA1 (NetBSD-6.0/hp700/INSTALL.ps) = 31767f9d14e0018f59f4bf89233f3a546d53234b
+SHA512 (NetBSD-6.0/hp700/INSTALL.ps) = 7f1ef8344a35e0aacf8246212f9ef07fe7727048de0a7b24030fdf7698e736152623e6d5d02c32bffbceb3c0337aeac719c523711f838118f0d31316d46c6fb1
+RMD160 (NetBSD-6.0/hp700/INSTALL.ps) = bca575e3df8abf0c7f8ff70e614fe52a9c39f645
+MD5 (NetBSD-6.0/hp700/INSTALL.ps) = 644eaeb94d45f3183b9cae5f0b39d974
+SHA1 (NetBSD-6.0/hp700/INSTALL.txt) = 546cea2f82e5c548de6f6978f569d3dcf65476ce
+SHA512 (NetBSD-6.0/hp700/INSTALL.txt) = 4d0d5e6363680e11da17d445fe7156b709e11d28f3226d1374e3612e68ba9c445bd2ec01e4422b523ea2d4197fc8a8b465da0c75401b9560ced43f217931b558
+RMD160 (NetBSD-6.0/hp700/INSTALL.txt) = b7536cf8d4f664d03d213978619724a94a16b1d5
+MD5 (NetBSD-6.0/hp700/INSTALL.txt) = 241f27fd87ec0932db94a067465d30b0
+SHA1 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-JORNADA720.gz) = 7a39f220d6af810e25b4799685aab25a226b9b91
+SHA512 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-JORNADA720.gz) = 4b2d4125cf737229264e73bd830c4def0ee33dba71cc5f68abf3e8e936dc89fb02f48a0d821754d2427fe1f72595dd266cd9cfc369c778f50f48573fb2c0bbe1
+RMD160 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-JORNADA720.gz) = 129136e4544bb8fcee75e1addd1fee16c522e416
+MD5 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-JORNADA720.gz) = 6ed126d914383f7ca0c3269960e885db
+SHA1 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-IPAQ.gz) = 7750f05c52fc8460f3ad8b271ae2d9e723c24ebe
+SHA512 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-IPAQ.gz) = 485f621f65f80fa02b8fbc08a876aa135d3e4c541ccc6d13ebb3bf119b0628dc5a540ba168a6e908b84422450829dd5a98915a145d629e893930ed40d9e3dfde
+RMD160 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-IPAQ.gz) = ee2d243a0fd633e6dac497b28b420b4a8157879f
+MD5 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-IPAQ.gz) = 563942f00d685c8618fb5bfa2a6a893b
+SHA1 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-WZERO3.gz) = e6f2cede1c69a3f41582f1a8f2a5187948512248
+SHA512 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-WZERO3.gz) = 8cc9f93b55a9a64341b266f7d3b8c6d1051f84a36f8aa398b24404d8aa57a16e883b1e7215b7cd235764b4507e04259525333f28369aa95efa39713e17bef07b
+RMD160 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-WZERO3.gz) = 536bc6153a0c83339c95e38b87a87bc98e738cb5
+MD5 (NetBSD-6.0/hpcarm/binary/kernel/netbsd-WZERO3.gz) = c4092d8e84f02fa75ea88436d404f1b1
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/hpcarm/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/hpcarm/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/hpcarm/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/kern-IPAQ.tgz) = c2bc2e5d8606cbd122fc825031025e2946f06e40
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/kern-IPAQ.tgz) = 52e8c28012dca6e4cc1bab2cce4443a6600a9cd42b3e1e027e715792e794f34baab32300da9ad58fbc23ecb2a22e7787a1d181577317a0dc6fd457ba66f11fc6
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/kern-IPAQ.tgz) = 7be149eb7b493fd76dfe0dfc533315458fb0bfea
+MD5 (NetBSD-6.0/hpcarm/binary/sets/kern-IPAQ.tgz) = 0d6a168f2d92d06962b581d06f807d46
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/base.tgz) = 080c8331106fce332cc5092a8332c2ad603e2596
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/base.tgz) = e22024be4e644ae872d6cf538a1210f8ec2aefeadfb47f6497e3892de2b617109a082650e1c1b16006cb84312c1550d3e98610ca63a36a083a073c55a08a3ab2
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/base.tgz) = dc0f2bef3b562a81901faf28d738e34168c3b812
+MD5 (NetBSD-6.0/hpcarm/binary/sets/base.tgz) = 0e05338048fb790920168e820e0f5771
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/comp.tgz) = 8ae72e40483c13b3ea15aebb3efbcb5cedcf921e
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/comp.tgz) = 3ee22dfba60196fe19897537c3139dff0b50d1aa6f6c27a024dcdbdc810a9dccd2c32480f73c0ffb0e4dcc4261e03ca6c565a875e291c963011467bc119f292c
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/comp.tgz) = 8bbf9baef503fd64c7676821abad991027f42ccf
+MD5 (NetBSD-6.0/hpcarm/binary/sets/comp.tgz) = 84a5d47bbb69b46673a2b2a53ffe3854
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/etc.tgz) = cbd3aeb7eee9da4d67693adee922e65835ad8908
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/etc.tgz) = 96f02aae1ff4fe6096261449dabe1c749ddf179e809b936393bd3b1aea3d708b878ea9c6fcededf0820216bc3f5a4862da04cd9ad5cd4991094bfc309421dc4f
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/etc.tgz) = b3f5dbf2f1a092a0fed4f7ff661635387bdfb7cc
+MD5 (NetBSD-6.0/hpcarm/binary/sets/etc.tgz) = 940a5d84fd6546eb8ef1fc0fc2af9f12
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/kern-JORNADA720.tgz) = fbe60c24963e700dbcded7ed9d6a006fce937c4d
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/kern-JORNADA720.tgz) = 0ff4a883f983d768355dab3a124bb1ccc3418d7a61bd8dbfc571089b934153eda2b9bcedf4d655e61c680c60b50772a40322804f86accb96acbd11dbd0159aab
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/kern-JORNADA720.tgz) = 010eea6fd1f9645480ed8d96e67a7a87766e6097
+MD5 (NetBSD-6.0/hpcarm/binary/sets/kern-JORNADA720.tgz) = 8a1eb406cc9cb944a0dc11ade6d139d9
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/kern-WZERO3.tgz) = 5a30317da0f7f2c6f1998a8c53350da39a390bff
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/kern-WZERO3.tgz) = 6908dea8428f52a08f481105b602fd2b93318207b5142ccec5104a897a9ad5b10ec25db1a5849074c179e064c7c418cebccbc529609873b031dde5ef1659ec6e
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/kern-WZERO3.tgz) = db2ec740804a2c22b4d9d5f05f7b20748206fcca
+MD5 (NetBSD-6.0/hpcarm/binary/sets/kern-WZERO3.tgz) = b745687a92452be38b0d2cdb625175e8
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/modules.tgz) = cd6c4ccc2c87d573cdb5a92a8806292c5063bd28
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/modules.tgz) = 66efd8e33cb118fcb7e6094a55dce87db0b38f03398688e19eaa29a88a61075ca4456cfbcf262e4ad372d1a85d31f1a230e79a09a60d9d0315ee2691f836f408
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/modules.tgz) = 1a4f4a21d35c183594080c4c2c6aeb63d0f07ec0
+MD5 (NetBSD-6.0/hpcarm/binary/sets/modules.tgz) = 0d07dc5c45004e2442e6da94a40e2082
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/tests.tgz) = d77efdefa2b3df022767062ce3e5b37ee33aca9f
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/tests.tgz) = b2827bef6684fe45b1ca7dc690a30787a0033b46013281c0d12dc182939a32287579ea0ed6dfdda5ac357cb69a1bfccffcce2cbc991a3b47f0cf714df45f511c
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/tests.tgz) = c51c78a413d9b8d240db9965edd6732158319bec
+MD5 (NetBSD-6.0/hpcarm/binary/sets/tests.tgz) = a157cb333c867f1efce0c0009db0c596
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/text.tgz) = 5e276b4e097bd1ab37a48ba8ac4591d784311152
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/text.tgz) = f7d62b4ac928028f37cc0ad711a12e4f5d4a2b77d2e108ce8716194052e6796bf5fb54ce77fa148aa257165f3d71f2e30d562d3dc809052020b85daaa5ba9fcb
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/text.tgz) = 806a5e59b90062c827a23ca33be22cda14a2e0c6
+MD5 (NetBSD-6.0/hpcarm/binary/sets/text.tgz) = e4ed04614c1a767e663fc73d647f5b7a
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/xbase.tgz) = 56daf552141d6161e0b08d5918e351f9cf5f783b
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/xbase.tgz) = ccc570735b9636dad693a87964efa1c6d5b14a15e8e9ea28b0ebbcf97db04a671a771d6163a62f78d9979357f7fb0d5543591ac584781cfb47778228a268d723
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/xbase.tgz) = 134800ce03d324aa4090e1ce235cc5a6e5ba9f2b
+MD5 (NetBSD-6.0/hpcarm/binary/sets/xbase.tgz) = e3afaa495833b5492470b03d432bc773
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/xcomp.tgz) = 380508f5e8d94d66e301a6f8fddbddddaf2eb15d
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/xcomp.tgz) = 4860c2274b0d4d3b1188d915c90b7e183672527e6734023c78694df3f507d2e920e5af9374353f7581c8f0e22462e8af30aff7e989146de61c0c7b9de7cff93c
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/xcomp.tgz) = 2f0f86a40b6887699ea5949b994007a9bb6ad876
+MD5 (NetBSD-6.0/hpcarm/binary/sets/xcomp.tgz) = 8f917121a2bbc2df46c6ab3db5f7c276
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/xetc.tgz) = 4109069bd859ebc949dede730589472e53e9e73a
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/xetc.tgz) = 260ee8565cb3b0fc496ff20856cc718585d36d380a85a5793c0e6502e57b683e132a3904ddb5990ce670ad9069eb999c2a41e427d5bb4ce96dd7f526427dfecf
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/xetc.tgz) = 24731afa16c748e4129111adbc446931859ac8b5
+MD5 (NetBSD-6.0/hpcarm/binary/sets/xetc.tgz) = c5aa4d6e7bda3c04ff21c49fa7a88349
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/xfont.tgz) = 93475dc493faa6b2df35bede901aa170b6f9e9af
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/xfont.tgz) = 182e2f9f19c09b4a10c5591d2d9a85a151263ed9773ecc581fd4ab155f5342b364b2fd15c3ce7e82ba9b760ef567f0ccaa8fd51fa4ad3e70dbc63a429ec544b4
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/xfont.tgz) = ea5190cce3fb48693746b233b2173595263d0b64
+MD5 (NetBSD-6.0/hpcarm/binary/sets/xfont.tgz) = e866b30099f57e267e8be054446c259b
+SHA1 (NetBSD-6.0/hpcarm/binary/sets/xserver.tgz) = 33ea7cf47464441ccaa2779544df524406479446
+SHA512 (NetBSD-6.0/hpcarm/binary/sets/xserver.tgz) = 718cb878630d6a3d8e2a4c8c0ca427e36f6772017810df557ff9bb0a688445af10f4087662e91631ec07a0a83e3007fa016c485950b3753c50bfdd3cc219ccd1
+RMD160 (NetBSD-6.0/hpcarm/binary/sets/xserver.tgz) = 09ce10d8e2254deac07ece3f8625d6c3bf2c4513
+MD5 (NetBSD-6.0/hpcarm/binary/sets/xserver.tgz) = a36d535d398b0d6e6e66da91d03ddb6a
+SHA1 (NetBSD-6.0/hpcarm/installation/miniroot/miniroot.fs.gz) = add38fbef1c9a42872427fc3ae856cc490dba491
+SHA512 (NetBSD-6.0/hpcarm/installation/miniroot/miniroot.fs.gz) = 1ac653efe632dd53dc6bf8f1abda479a4bdecf57b4aadce9b289381a8608601e7444404bac4b4187ea5eb87a8e56affafb06b30c5f27264797b8811b4b4a61ce
+RMD160 (NetBSD-6.0/hpcarm/installation/miniroot/miniroot.fs.gz) = d36e893b023bc07b2ae23e65891cd8edd74ae60c
+MD5 (NetBSD-6.0/hpcarm/installation/miniroot/miniroot.fs.gz) = d790021f968d07d34a34acb3fdc18a3c
+SHA1 (NetBSD-6.0/hpcarm/installation/netbsd-IPAQ.gz) = 640e6d70fa752f3f1e6b415d79bfa26eb524d49f
+SHA512 (NetBSD-6.0/hpcarm/installation/netbsd-IPAQ.gz) = 0266c16c91cd0edf3fad56c8806d8736edcb70138486a8596afd2ad58a89846ed319973d4383c6dc240e894a23658effd390012c6bb55d768a3980c5cb9bfa34
+RMD160 (NetBSD-6.0/hpcarm/installation/netbsd-IPAQ.gz) = 8b57f335f3ce186509ff88c07bc85c27716b542d
+MD5 (NetBSD-6.0/hpcarm/installation/netbsd-IPAQ.gz) = 4963aae14a8da8a218ec0f43110e4329
+SHA1 (NetBSD-6.0/hpcarm/installation/hpcboot.exe) = f62f1b2bbf14dd5ee1159d987365122bbfa061d4
+SHA512 (NetBSD-6.0/hpcarm/installation/hpcboot.exe) = b1ad5471eec903659a2fe6ff79e631ea40d940e447126a6d8d6b46166dadd7cbbbea4285927968134d2ff493fe66a698d97374febf991ee9ecd4d295f06c92b8
+RMD160 (NetBSD-6.0/hpcarm/installation/hpcboot.exe) = fefa32b139995cd0b71c59d09cfb225fce08dbc8
+MD5 (NetBSD-6.0/hpcarm/installation/hpcboot.exe) = e8da90c935c719d600bed4f07046950f
+SHA1 (NetBSD-6.0/hpcarm/installation/netbsd-JORNADA720.symbols.gz) = 04eac0a968c96a038388c18816b735fd0fda5c2e
+SHA512 (NetBSD-6.0/hpcarm/installation/netbsd-JORNADA720.symbols.gz) = 61357b623b75c75df8f2c5318c82f3300183de81003900fb10a1caa566cd9cbc90563277a5d0738b0a7ed52934cfb40d08b4c7af428b06bca90dd907b89673ad
+RMD160 (NetBSD-6.0/hpcarm/installation/netbsd-JORNADA720.symbols.gz) = 43b52d529a62cbfeacdae60b54d9e0fece7a1ab0
+MD5 (NetBSD-6.0/hpcarm/installation/netbsd-JORNADA720.symbols.gz) = acfc91c707d81e9c84b3fb7f6626f9e5
+SHA1 (NetBSD-6.0/hpcarm/installation/netbsd-IPAQ.symbols.gz) = 48c1a0db5c6a2e7d69b1bcf77763e88adadf6373
+SHA512 (NetBSD-6.0/hpcarm/installation/netbsd-IPAQ.symbols.gz) = de5ef76b391472a2c18637f36f58a904d693085bfd9108676a1c0476712ab94b72ac41628a65a9c0bfcd5f33c9e141540906f63cfa5614ab8ea2f3f6867b9b1d
+RMD160 (NetBSD-6.0/hpcarm/installation/netbsd-IPAQ.symbols.gz) = 383e05d6255afda312b4b81fdaffe4e4a9c83dbf
+MD5 (NetBSD-6.0/hpcarm/installation/netbsd-IPAQ.symbols.gz) = 4b4a3474459c93e727e4f20559139464
+SHA1 (NetBSD-6.0/hpcarm/installation/netbsd-JORNADA720.gz) = 70818132f816688fa6d74e13544e9e6f07faaddb
+SHA512 (NetBSD-6.0/hpcarm/installation/netbsd-JORNADA720.gz) = 0b9b7718b30b88b81fb66cdc32ddee57ac7fd6c90c1ecb6a422f84513df70d594b48badb8b71f00b3ef8d90f544c01439bef4942a51eace3d1fc5dbca1461ced
+RMD160 (NetBSD-6.0/hpcarm/installation/netbsd-JORNADA720.gz) = bd193cf9815e6f8a60ca9df77eb1537913c2daa0
+MD5 (NetBSD-6.0/hpcarm/installation/netbsd-JORNADA720.gz) = 39c8584c95a8c2197165b102a1548a5c
+SHA1 (NetBSD-6.0/hpcarm/installation/netbsd-WZERO3.symbols.gz) = 2afaf89d89ef9c6538960f64b36802beb3e74472
+SHA512 (NetBSD-6.0/hpcarm/installation/netbsd-WZERO3.symbols.gz) = 53c9ddac6c56fa5e1c77323483b129b0b1ebe88b558f0e50346d17d54477db1187831c6c8e0e2a231b9473dfcf8d285672f69cbca8197e6fa889f8285836b38f
+RMD160 (NetBSD-6.0/hpcarm/installation/netbsd-WZERO3.symbols.gz) = 9dfb61526eb859fd999c8c05b257d436a6d209f3
+MD5 (NetBSD-6.0/hpcarm/installation/netbsd-WZERO3.symbols.gz) = c8aa20ace8e4938a05386d8c02f1cb6c
+SHA1 (NetBSD-6.0/hpcarm/installation/netbsd-WZERO3.gz) = ded59dfdb078cd978a9a74670d43899ef5186b39
+SHA512 (NetBSD-6.0/hpcarm/installation/netbsd-WZERO3.gz) = f93d2e0c80f5b9f8d2f1d851515b2b50f8f518caf7e0b8b71dfdb002a2f97c1da80f7a7d7263228a0d5400267d0be91ee649b558eb4fea8dac4fe07f23b24138
+RMD160 (NetBSD-6.0/hpcarm/installation/netbsd-WZERO3.gz) = 99920bf26d5c1697ed030c151c630b125e3b6cf1
+MD5 (NetBSD-6.0/hpcarm/installation/netbsd-WZERO3.gz) = c958ba2807a0e03d47f98fa66fcbccef
+SHA1 (NetBSD-6.0/hpcarm/INSTALL.html) = 90f13483a6a7cefd8261806546700202df5e89ee
+SHA512 (NetBSD-6.0/hpcarm/INSTALL.html) = f7b3a19235b72a4a19c27380e6e22f89e4ce58864a8ef3b492b05aff47cd017a0157adf96bf1d04ef4d6c9b1f4f24980afad91f2644e74fccac06274a35bc75b
+RMD160 (NetBSD-6.0/hpcarm/INSTALL.html) = 6228411bb6d6018e59a1fd74f2887aefed5ae8fe
+MD5 (NetBSD-6.0/hpcarm/INSTALL.html) = 3d21d24e5a8b5a1ed45afd2f0e7c25e0
+SHA1 (NetBSD-6.0/hpcarm/INSTALL.more) = bab711c6d2c3ef110b778fa3bb18a690e3350071
+SHA512 (NetBSD-6.0/hpcarm/INSTALL.more) = 85c117ec4b92633391497f62723320999e714a68f0a9b008508fd1b884f77729235859c2ed0ff9539af6615eb452cd87a9bf9f10456ae53fc057b5a3d665dbb5
+RMD160 (NetBSD-6.0/hpcarm/INSTALL.more) = 5283c45bcd291d03e3d2f579eaccdc78708a2dc6
+MD5 (NetBSD-6.0/hpcarm/INSTALL.more) = fd547cbcd59d803d4f5ef38f619fca0c
+SHA1 (NetBSD-6.0/hpcarm/INSTALL.ps) = 6ce0b3584e4b45bbed722cb8bddb66e3deedc88a
+SHA512 (NetBSD-6.0/hpcarm/INSTALL.ps) = 3d766bafb31be6edb83b4ada23bd1eec923f7297f6b4cf51adc247a160749c5488a99282ce7e4380b4c27025581901c6f5d7d774c799fdb23f8410c43c8e4b0b
+RMD160 (NetBSD-6.0/hpcarm/INSTALL.ps) = e8c042d83705b3b63bcb793d856307b95ed31521
+MD5 (NetBSD-6.0/hpcarm/INSTALL.ps) = 1a50f108a265984cdd0f0206c83daa35
+SHA1 (NetBSD-6.0/hpcarm/INSTALL.txt) = 06a8b26e2de81570eaaa71593a67b1e4c517590a
+SHA512 (NetBSD-6.0/hpcarm/INSTALL.txt) = 4fa7355a943c7e48925ab6db1c281ee9cc7e674095c7eea355d270d15afbb73d45891ce07a4b6104b1fcb0dfaceb3af48db6cb134070077fa4f1bcab453e83eb
+RMD160 (NetBSD-6.0/hpcarm/INSTALL.txt) = 3bb0f03d782104ec4792423f3d640e8e7adc29b8
+MD5 (NetBSD-6.0/hpcarm/INSTALL.txt) = 68c0576d6d8b54ebfbb0728b7a73438b
+SHA1 (NetBSD-6.0/hpcmips/binary/kernel/netbsd-GENERIC.gz) = b038fa721af9faeddea84add1762439db98cf908
+SHA512 (NetBSD-6.0/hpcmips/binary/kernel/netbsd-GENERIC.gz) = 6d550d0b1797734c7340d8632930c78be193f397591767e2eed674423ad469dda333206a8f539adfba9d0d81ee70cda7c01de58cfcc4e3ca0440cd6615ba8167
+RMD160 (NetBSD-6.0/hpcmips/binary/kernel/netbsd-GENERIC.gz) = a4627fac6aad12dd9a2f04c3aa90fc8c61699d4f
+MD5 (NetBSD-6.0/hpcmips/binary/kernel/netbsd-GENERIC.gz) = 6b0e8c6ff949fbea7ff99cbbed4df778
+SHA1 (NetBSD-6.0/hpcmips/binary/kernel/netbsd-TX3912.gz) = be377f94448f7026050fbd885d0eeb2ed6a1e84f
+SHA512 (NetBSD-6.0/hpcmips/binary/kernel/netbsd-TX3912.gz) = 3855f4e59d507281b41d8363e8d39ea229bd41fd1cc6090704727dcd97bb75f3c265f68a0cfe84a10292e55c7d58a266f4d27705a1fb9218d34e1727210692f0
+RMD160 (NetBSD-6.0/hpcmips/binary/kernel/netbsd-TX3912.gz) = 686c703228a5ace7ddb3dcbb232bdb4ece47b6f1
+MD5 (NetBSD-6.0/hpcmips/binary/kernel/netbsd-TX3912.gz) = e462f4f6a2cbc6d8eb20e49cbcfed56f
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/games.tgz) = 27d9f98fecb3495e51939df9f107e81e527af26f
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/games.tgz) = 46bb4e10313cfffaaf4f7fa2157474ef940f94bcc9f84b46f829c7615bbf45e4e01edee7b7efb84bc28561e0712c37cfc737f9c2a0d9a73b67c80c8aa0f3a9af
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/games.tgz) = 947feea90ec2698a65d555cb78a29a001b086589
+MD5 (NetBSD-6.0/hpcmips/binary/sets/games.tgz) = 355f00978fed8e8da6a251e591be5387
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/hpcmips/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/hpcmips/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/xcomp.tgz) = d8ac89f3f6ff20abb0adabc49227afdb74aa2040
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/xcomp.tgz) = 4f03213fb061dae9421747209628d06ede6bbb71a7560a9e1a54796b907f1620146a33fdce52974227a21acedcc210b99e15c4fdd36432eba60c1041a92d8cee
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/xcomp.tgz) = 6be5e72b9b57c9bdf8ed8ea127e2a73830feeecb
+MD5 (NetBSD-6.0/hpcmips/binary/sets/xcomp.tgz) = 59a7ea141587417be38ab1f6056cc780
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/xetc.tgz) = b9f6b1a54ffab37b11f4c6e717b481cd087fb609
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/xetc.tgz) = 72f35e65f3a90967e250a2006d500619b3824f7f5c3d7494554f153ec5cda5b28c445f28c34a1e4463f40da5855e8d4257726411796967fe37763d90cf7fe461
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/xetc.tgz) = 1169c246f91189fd0c4ae86ac27a92f5c2edda3e
+MD5 (NetBSD-6.0/hpcmips/binary/sets/xetc.tgz) = 8f3c52cc5af1cafaf7b0d0f884a5b537
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/xfont.tgz) = d06848571034f3b7fc975082f1de37b912acb18c
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/xfont.tgz) = 66a1013c935bee5e7e5d24325a527522306bcded7ced63790f2e58831b3ed91176a1b9510b2159be63504d5167d48d534919927ffc6e225ae2bb2487f90a9ede
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/xfont.tgz) = c9502843a5d4dd7e996e8d158c519cf7f8575cbd
+MD5 (NetBSD-6.0/hpcmips/binary/sets/xfont.tgz) = e812899176eac2bf65a6d949ac3f3424
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/kern-GENERIC.tgz) = 5a49a4163b7d841104dd4082113ba253ca95f946
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/kern-GENERIC.tgz) = 3856b27c3d200e162fb88b7e094e38d843a91f67dadb56b31bd66c18daddd2c0aed58dbea87d43a3d530d3ece68bac562c20d623b613bdd4855fb86bc4794463
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/kern-GENERIC.tgz) = cbd699ebfe796b39eee403ac3831765f5871e789
+MD5 (NetBSD-6.0/hpcmips/binary/sets/kern-GENERIC.tgz) = 22031cc2c2f3a4a6002fe20cff53264c
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/base.tgz) = ff9051176546bd2cacea52fee85fcef472e0fc39
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/base.tgz) = 2a770bede2e0f7af3a0d8c2a1f3871bd72c1f67dbe5aed9f6d1cf12b78c8676c819dfd99d3c7cbfc1794c993e8cf059f9e72b764f8d25a5f1ad3406c42169d6d
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/base.tgz) = c0d7aa660957624cda33c738d6026870f14fb823
+MD5 (NetBSD-6.0/hpcmips/binary/sets/base.tgz) = b79936c5e1c4ff6a86270da2931b1c54
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/comp.tgz) = 32515af667967de5ad8dbca2ad993c62c9794b80
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/comp.tgz) = 5604e8af6fe737b81128a976cd53cc5f5b287f04de2b21fdbc8bfffa1b521ceae4f7244ad8b98580ca77af7c43b75623e2e9ab8772bd23e8e3c7d297b6c54bfa
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/comp.tgz) = b9a5cf74d2c16f7870081a27a3862459c101b690
+MD5 (NetBSD-6.0/hpcmips/binary/sets/comp.tgz) = 4265c60c89150dc4c7de32c0c3f4aeac
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/etc.tgz) = 68b265bdfcdf09e792bcdfe69656516b44d37b66
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/etc.tgz) = af2d02e2aa9a03df02dd8f0a8840e7d185e18b57e8086f0eeb5b7a1349e02433bd7ef1c83f77d5962f90350b71fb4610932e29d723f1cf4488c930048ab43dd1
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/etc.tgz) = 3a5d433571b7a9c44fa0ffca6efd6df514101b15
+MD5 (NetBSD-6.0/hpcmips/binary/sets/etc.tgz) = 295c108b6f0e7a9dd8f7cc142e87dbd9
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/kern-TX3912.tgz) = e1ff4c2bdcfe12d8c26b87801f28970661e5e109
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/kern-TX3912.tgz) = 42d069cd3e055b33ffd04b0e99f3db75a45c80cf8cfffb0a4cc08fd3fafb9e9e8c8c6205cf827689a91080c75250c9e753c5c4f1657427287bd567244e29891a
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/kern-TX3912.tgz) = d5d7c8d6ab8d3cec287bd0ede9c658f5e196471d
+MD5 (NetBSD-6.0/hpcmips/binary/sets/kern-TX3912.tgz) = d9aa987b53c079063b97e947c2b561ed
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/modules.tgz) = fd655bd27b90d1cd9ebb2f64a2b744e5f57178bc
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/modules.tgz) = c7b1ba107094c528d6edc3c3fa68962882af4fa207bb6b323e6230ebd09f0d7555abc34a4f76bc7f6c7fbf393258089a3a11d9ed7284edd0a9deb44bd8b6b1a7
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/modules.tgz) = 13356c7a4e3f09123b31fbd42bcef53ebb10ed61
+MD5 (NetBSD-6.0/hpcmips/binary/sets/modules.tgz) = b820dfc2e2d9420fa72bd887eb9ab505
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/tests.tgz) = 12c5aab5f1f4ab6124d3cb5e8598359b5f893652
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/tests.tgz) = e7656a5f8bb8104576f8218fcbc48c5fdf4d4cfdf407c6805421f1101471c95ac6e1f83444c13ffd1cd82d3b51d4da0d8fc726795b0765363b700d5054cfd553
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/tests.tgz) = 8abc82efc30f6bde5b48bd7778a3774fcd993ae4
+MD5 (NetBSD-6.0/hpcmips/binary/sets/tests.tgz) = d1cd20123adb795808586fef4825bc29
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/text.tgz) = 66f261af8763d48f3c6e62511b0660801b89115a
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/text.tgz) = f7428c73f23bfaec5ddad225487c3e569479c537231c2c7ce46869c6debe07a0bf2f139cecd1622230337871a706d6da3891759bd75166d1ae700e85c014dcca
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/text.tgz) = 8735b6f7b4e4f04f0db4736cce5cced1b12a4cfb
+MD5 (NetBSD-6.0/hpcmips/binary/sets/text.tgz) = 69d9e8e32932f359964186ee95b11c42
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/xbase.tgz) = 0299ef346075a8066e40486b3de09de5148940a3
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/xbase.tgz) = 077e6b5023eeb6ccbbdd3ebe6b4f677d8a2ac2e76ff235951fe3cfba327f87149e9dd46abedf0963ef465fa829589a802cd0b1ad76a49b983f1766a881c648c4
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/xbase.tgz) = 3c7a528dfb109df9525b7f41dd3c1a0ef7ce8bda
+MD5 (NetBSD-6.0/hpcmips/binary/sets/xbase.tgz) = 24312b9cd85e739ec15b4b53ad6955f6
+SHA1 (NetBSD-6.0/hpcmips/binary/sets/xserver.tgz) = 9faebdfa18d6846a47ee49174a2b510265cf26c0
+SHA512 (NetBSD-6.0/hpcmips/binary/sets/xserver.tgz) = 367f12b49e0ab6793075bed49a4830d8d4ca08eca3d93489c90e55201a4e5d7c1454aaea447684309552c5ca3a695abb800fe9da35ec129f1fc11f80f3d904bd
+RMD160 (NetBSD-6.0/hpcmips/binary/sets/xserver.tgz) = ece37a2b4b5096401d6add543d13dc136cabe85d
+MD5 (NetBSD-6.0/hpcmips/binary/sets/xserver.tgz) = 3c0b67d9f4dc00af6b197724b41b572e
+SHA1 (NetBSD-6.0/hpcmips/installation/miniroot/miniroot.fs.gz) = 1e1ce1cba7ab9b704105a3d52f7c5b17773e9ba5
+SHA512 (NetBSD-6.0/hpcmips/installation/miniroot/miniroot.fs.gz) = f1746402d265c51ed693fd30961d3dd7da011a30ad47ccdc709a2a9a5dd665dd884f91de6d56ecab947d8c958bb572a4a19b8c446ec6644fd2f3b3096b14e615
+RMD160 (NetBSD-6.0/hpcmips/installation/miniroot/miniroot.fs.gz) = 15102213a728cb35bcac2a49f93b496b8f9aa838
+MD5 (NetBSD-6.0/hpcmips/installation/miniroot/miniroot.fs.gz) = d910bba08c66b4454242edd78b73cebc
+SHA1 (NetBSD-6.0/hpcmips/installation/netbsd-TX3912.gz) = b1cb178b2c1edd93e4d03ab3205c07c701c1a7ce
+SHA512 (NetBSD-6.0/hpcmips/installation/netbsd-TX3912.gz) = b982379b9ed3f09895be90c2dcaff7c041e249102bbf72f6ff41bd9100e28990095563db8de6c6dbd40accf3b11f9e0848c2b1bff5dcf0ab9688e65d5229d39a
+RMD160 (NetBSD-6.0/hpcmips/installation/netbsd-TX3912.gz) = 6923c07471d3beb90bdb466c1cb76f03ac65ad00
+MD5 (NetBSD-6.0/hpcmips/installation/netbsd-TX3912.gz) = 8860562df651f9ca3adf61dd62718dba
+SHA1 (NetBSD-6.0/hpcmips/installation/hpcboot.exe) = 70e5234558257f49964fcb28a19f544670791c47
+SHA512 (NetBSD-6.0/hpcmips/installation/hpcboot.exe) = bcde10547db4de0623863c93a733706edc1096e2535ff6a7574e86ccab25144c0c653d80ccfb1989eaf685e0b0710eab41f34cc2c45a7bbdc10bb9f845326102
+RMD160 (NetBSD-6.0/hpcmips/installation/hpcboot.exe) = ec4e5dfcbb787ba57de55209e12cbbf891c29f7d
+MD5 (NetBSD-6.0/hpcmips/installation/hpcboot.exe) = 9c4073db4cb8cc5a534f709731e271bf
+SHA1 (NetBSD-6.0/hpcmips/installation/netbsd-TX3912.symbols.gz) = 6aea661d601c817cef6d1283efe84a23e98bfef8
+SHA512 (NetBSD-6.0/hpcmips/installation/netbsd-TX3912.symbols.gz) = 0ae88640bdd00cfd0f1d908bab889b72f71173a376d26159e5bd9221e4241a867f4050bb9c349bf4225ecc4b82ae558002b3303e7c03e98dff7f72f57b08a9fc
+RMD160 (NetBSD-6.0/hpcmips/installation/netbsd-TX3912.symbols.gz) = 1ddaff9ebe6775a9b1f98e3d592c9e38f944a5f3
+MD5 (NetBSD-6.0/hpcmips/installation/netbsd-TX3912.symbols.gz) = ccf4219237474d2c8e2fa02fe33f2e9b
+SHA1 (NetBSD-6.0/hpcmips/installation/netbsd.gz) = 75ecc93d0f321a819aca2fafbf58a92651c2ef8e
+SHA512 (NetBSD-6.0/hpcmips/installation/netbsd.gz) = 94ef6d49c91ac5ffba39ada8854d3a7be535bdcc7a5121a4941255a30a8c9d68acaebcb1e99ad804360910a45562e3c17b307819ed4f97c1f9a4900c765ac06c
+RMD160 (NetBSD-6.0/hpcmips/installation/netbsd.gz) = 10470fb18a31416543c016667bcbcaab1b454297
+MD5 (NetBSD-6.0/hpcmips/installation/netbsd.gz) = 1acf8ad6849c07fb17c0646acf7e76c2
+SHA1 (NetBSD-6.0/hpcmips/installation/netbsd.symbols.gz) = 8a2bfae03f350dc2c9d83709c8255b8ee4eb9e15
+SHA512 (NetBSD-6.0/hpcmips/installation/netbsd.symbols.gz) = c4917814e14d1163139be52927a5a59d422304289239eae15e91495a9964a16e005865f231b3647964bdfed2658d955ef983fccda7775616df92487e10f36b53
+RMD160 (NetBSD-6.0/hpcmips/installation/netbsd.symbols.gz) = b353f7752d20b78218082d129e4ed5b6702ee2a2
+MD5 (NetBSD-6.0/hpcmips/installation/netbsd.symbols.gz) = 453e0c8ae44500b483151a83e1689a2f
+SHA1 (NetBSD-6.0/hpcmips/installation/pbsdboot.exe) = 3b0a8ac9c0d4c6e7fef95970e81f1ae42462f405
+SHA512 (NetBSD-6.0/hpcmips/installation/pbsdboot.exe) = 28b6b8b3ac983d5fa9ae9dd28127981367720c3754a88fd0b08e404093c657df3df93bceae63835fdaf021fd608002464411818ef3e9becf100e0e7ffd94fcbc
+RMD160 (NetBSD-6.0/hpcmips/installation/pbsdboot.exe) = d713fda3478b92d9dc71347122a1fd7bac6cab9b
+MD5 (NetBSD-6.0/hpcmips/installation/pbsdboot.exe) = 5c184fc062316a94d8408adf0884bee2
+SHA1 (NetBSD-6.0/hpcmips/installation/pbsdboot1.exe) = e937c9bf2759e58c32523ff19c45feeb5e90fe77
+SHA512 (NetBSD-6.0/hpcmips/installation/pbsdboot1.exe) = 65e044958194d15fd58b222dba5470343068ffbe968d43819b11744c711bf75083d1e61df0e433ac846629d8d0ccd14ccd0388b58424a123d4018f9731b6415d
+RMD160 (NetBSD-6.0/hpcmips/installation/pbsdboot1.exe) = 9e072b9c080bcfa4213b36fe9d85ac684de46f06
+MD5 (NetBSD-6.0/hpcmips/installation/pbsdboot1.exe) = 4d6c719c61a98aae297369c41e3991a8
+SHA1 (NetBSD-6.0/hpcmips/INSTALL.html) = 34d4a448b23da2e50007d37ba33938d78baf8b03
+SHA512 (NetBSD-6.0/hpcmips/INSTALL.html) = 508dd90bf6b4543b31108ec82b96a8ef765ffd29d2fcfbb463e380bd8cff6909fcad9673a8c7307b8a524347c20c117a94220dc743813028785520f1739b8d89
+RMD160 (NetBSD-6.0/hpcmips/INSTALL.html) = 3e111666257f4bcbc22fba2a542559733ab56f28
+MD5 (NetBSD-6.0/hpcmips/INSTALL.html) = cea8b96d283b5ddec4b1be43b327a986
+SHA1 (NetBSD-6.0/hpcmips/INSTALL.more) = d4dc5bdab669d3e4a97c6e07e3a4e6634a171103
+SHA512 (NetBSD-6.0/hpcmips/INSTALL.more) = 90924423731cdaeca599d151e56ef996a4a217432ffe1791b3bf7ad2ea3e025ae031d9e237377d1cd7fbab33a6e8e666909a77bb4867be3aac99340e4292d140
+RMD160 (NetBSD-6.0/hpcmips/INSTALL.more) = d8517223e07059e28737972d4cc4ebee900a308f
+MD5 (NetBSD-6.0/hpcmips/INSTALL.more) = 6b918c9fc18e093fdae5e4c61fe2fe3e
+SHA1 (NetBSD-6.0/hpcmips/INSTALL.ps) = eb7befb368fa0e792db5c250f1cf7cfa9d21d529
+SHA512 (NetBSD-6.0/hpcmips/INSTALL.ps) = 42f376e89f871f1a1f223d12816ffa887891818897a591d7b6ac0495c088559eac383449569dda24bfae563991e775c89b55dbec27aac2449ce5363c02581ec9
+RMD160 (NetBSD-6.0/hpcmips/INSTALL.ps) = 718659993cfe1a81d63fcb9b7717e551c7213944
+MD5 (NetBSD-6.0/hpcmips/INSTALL.ps) = 660ff8cf43dcbeacb63a10a2ac4442cd
+SHA1 (NetBSD-6.0/hpcmips/INSTALL.txt) = 93686fc2958437cddbb8e0ab34efa7a153b16939
+SHA512 (NetBSD-6.0/hpcmips/INSTALL.txt) = f71addf8728978547ec7d560a4590e392cfb55bd2d06b9987def48a08373fa27fdc7d2d1bfd241d6c9d8b22297b180b434043ffbbe86281b56edb9d4b714a567
+RMD160 (NetBSD-6.0/hpcmips/INSTALL.txt) = 0da553b2c528d6766776dfae2005bd6ff531e905
+MD5 (NetBSD-6.0/hpcmips/INSTALL.txt) = 3c60451e18599c7e2d8bc6a79c6fc8e9
+SHA1 (NetBSD-6.0/hpcsh/binary/kernel/netbsd-GENERIC.gz) = 0a43926fc91b70cb80d51c78394a2fa54fd98ae1
+SHA512 (NetBSD-6.0/hpcsh/binary/kernel/netbsd-GENERIC.gz) = 42ba58126c60285a642156c27dfa9d89009b41739a832898f876abe6387edac7c36f08e71028c326ef617a29020e525d779def3e583381645b5a1fc6ba6413b3
+RMD160 (NetBSD-6.0/hpcsh/binary/kernel/netbsd-GENERIC.gz) = 0d01f666a4b6fd2df148381e442ee85aa8afc635
+MD5 (NetBSD-6.0/hpcsh/binary/kernel/netbsd-GENERIC.gz) = de0c019c15358bd1673689f590e64529
+SHA1 (NetBSD-6.0/hpcsh/binary/kernel/netbsd-HPW650PA.gz) = c0359ab834228b4b0af9fd92ec0870cfa424fcab
+SHA512 (NetBSD-6.0/hpcsh/binary/kernel/netbsd-HPW650PA.gz) = 6e2d1f10d4eda5725c7293c179162091fb9f04630f14bf37506e49700178b1baee5594ccf70fa3ede42ef702bb512016d9edef3a23cd0777fd40f961a43ba021
+RMD160 (NetBSD-6.0/hpcsh/binary/kernel/netbsd-HPW650PA.gz) = f6b944beeaf6fda516165b2196b429db28741e96
+MD5 (NetBSD-6.0/hpcsh/binary/kernel/netbsd-HPW650PA.gz) = 7dc95c93d4b9b5a94e566c9f5565bd74
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/games.tgz) = 2040b4af557a62f2ade5fc9fcfe4cab3df88c7e2
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/games.tgz) = 8b5071337dc844042537c24c75660e61c9709cd10cbbeab059a84da6d482260b73365ff3870f85060c130a291b6f02be174d288127ca62ce4d291a6982192317
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/games.tgz) = 28acfa5a131d52df7c157e2edca1dd0f20e774dc
+MD5 (NetBSD-6.0/hpcsh/binary/sets/games.tgz) = d82c46dbc0021fd4694e464042936052
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/hpcsh/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/hpcsh/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/xcomp.tgz) = 53aa1e2a910e8eed09dc07f8b724804f53fe5e2f
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/xcomp.tgz) = 24645da85419528015cdaefd0c835741fa801392e795b363bdfc39558e75e7f384511c0668d12e2440114b7c543c7532aaec438048f08d35c54c9c7a748f20c0
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/xcomp.tgz) = 60a461ffc1f1562274110d65c72a541ee131cd21
+MD5 (NetBSD-6.0/hpcsh/binary/sets/xcomp.tgz) = f1d2650a8d7a4ecd60fda8e1aaf8c09b
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/xetc.tgz) = 1636a6fe3e01f6d8a07a19cd204a6807c8caa4c7
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/xetc.tgz) = 9cea4ba4af287dd57e591d4269f2f2582010250316f323746ac56b12cefcf2590b93fbb0197c665f61b1df41dcca62d17fb6ad80d4b1feb8ac8265e91e15074f
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/xetc.tgz) = 5f68e3f96f7bb9ae07fccdb1d058e4b1307b4b29
+MD5 (NetBSD-6.0/hpcsh/binary/sets/xetc.tgz) = da84d97230787283e215a4ee1c4053ad
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/xfont.tgz) = 97439ccf6840b18b1e9885f5504a401bf1a93650
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/xfont.tgz) = 3d15541f7d7ae2128f44355bf110415adfa4e5182829259d2c6f7a4217feff99e236d13c5bb7bbeb724ff1a09ac1f58f02bdd6eef528bc416ec3118db6fc7d45
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/xfont.tgz) = cdc9fcdb5fd5032803d5bba18db58f3ea6d62c85
+MD5 (NetBSD-6.0/hpcsh/binary/sets/xfont.tgz) = a8466a0477c6c443eafe99e9d1c61131
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/kern-GENERIC.tgz) = 567f596fd760416c4805a60ccdc39634394b368a
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/kern-GENERIC.tgz) = 517a450a02d80e4ae14463b5abcbb4e887d404ac5fd97a2d70092d9d53b6117af874171db26e1b43712b81f6f5f7c23d34ef4d6ee60a911c1288f07ed86675ba
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/kern-GENERIC.tgz) = 9f9a50ba10b38fd0a92e4671a61dc968ed206c49
+MD5 (NetBSD-6.0/hpcsh/binary/sets/kern-GENERIC.tgz) = 43c86c80541870470199c27117d78bdd
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/base.tgz) = 09469ee791c205b746f290108fb4e0fd2d2e157c
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/base.tgz) = b4f946a01df921d1b6b83db51e4da06934be1c23d5bd8602d357c4716524a944abd24f9053c130121a05a0a73b06124b1fb8d2e433b461e7122a6f7994b70d4f
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/base.tgz) = 9ba69deac2b406c07e38117048bc439865eb8061
+MD5 (NetBSD-6.0/hpcsh/binary/sets/base.tgz) = 7a62d7baa2d993d1de3d579d7076fdb2
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/comp.tgz) = 2487c8289908b3f46b47dfe16a78d041d159e4a9
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/comp.tgz) = 9e89c2f701cd69fc74aeb6ab03304f4bb51d73b6ff6c75b93906d2b05e42639e1da36dbce39a37519070a991bf5efe9ae93b29b6ae20da42fe2b01e951a51cf1
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/comp.tgz) = 3843c49d31f966f8d41b2b07407d5952eb788d18
+MD5 (NetBSD-6.0/hpcsh/binary/sets/comp.tgz) = 313b69abf3e1a78923f1a7c5c6f171b4
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/etc.tgz) = 0ede2593731365cb6501ca69865e1fdcfa72717c
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/etc.tgz) = 612da4fc764826c7f374c846d7712c4142d1cd041eb13944c578054fec342a2cb435c8815f9c477afc70a5655e35e9fb9eb1d01ee6c57218c944c6e11f18ffd7
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/etc.tgz) = e226671156547333000c60e32b9b24376cc63885
+MD5 (NetBSD-6.0/hpcsh/binary/sets/etc.tgz) = 420c5afbc0c1dd6c1d7a085979bab643
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/kern-HPW650PA.tgz) = 5534a47bdec7e7e6ce7d5474d3b159ffebe72cd1
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/kern-HPW650PA.tgz) = a7d789cafbe113131a7a93700ec06da4256ab5f93513d2ce96e0ed715a7dd99e866a89a907336a761ff53e53c20ca325b4a569198b75ca806e810395638a0ebd
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/kern-HPW650PA.tgz) = 2dcb3e3e54ce471cd2185469e4f788aeef5c6539
+MD5 (NetBSD-6.0/hpcsh/binary/sets/kern-HPW650PA.tgz) = e146321b865991498743de2b41a3c034
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/modules.tgz) = 36ccb3afb83508f713aa2aabd8c66990a7bee974
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/modules.tgz) = a9cc7bdcc7e3cb7aab35d329095b0b67cb46b13850f9897433539ce2836b96d38ba69ec95515ae8988a80864f865546dbb619352261f8e413ac21580c78a7be4
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/modules.tgz) = 29b45abec58e7be9e801cf6a2be74bcc56df595e
+MD5 (NetBSD-6.0/hpcsh/binary/sets/modules.tgz) = 82ca10605dffe603d39ad994e305b53e
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/tests.tgz) = d7eb3b59410ff4f341e9dd65c9995e160684fada
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/tests.tgz) = 443ff8b932876a515b75ac9b4eb1e225d2d09bd7dfc531f6e19f812e659de4644d0aac96ca74e73aa877bffbaddf13d308905f28cfe23d48a6cef1decf9b820b
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/tests.tgz) = 7030e2b09ddbe4bd952524d58f0916b2079a4bb1
+MD5 (NetBSD-6.0/hpcsh/binary/sets/tests.tgz) = 9a95f9e73414b2c3ad7acbb2241178fe
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/text.tgz) = 028f0e33f75acdbab625786cec067f630aa63e4a
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/text.tgz) = 434ec2e2627f4068e75db33cf4ad353ae1c7437c21d4aa0e861f06fb5eb1d85bae5ca15f7c1091017f76adb8b517a6e7860c5a406d157cf4485c1e6acfedfdda
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/text.tgz) = 37213e71f1fe2e1d8222d4b64ea6cbbbd2e40a4f
+MD5 (NetBSD-6.0/hpcsh/binary/sets/text.tgz) = da797fc1c503a808baea4b873b4575eb
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/xbase.tgz) = 3c17cc530069599ced85ef999be6012422973217
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/xbase.tgz) = 3dd6421f3248867b6015fcc420b29dcdbe82506c75b7bdd9698dc55b1a93e54d078cc93a68015ccf4bae00dcc96695702acde53f0a47f521116081f44255e205
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/xbase.tgz) = f3a5a0df1ced2758ac1016c970034a8a7e9f16c2
+MD5 (NetBSD-6.0/hpcsh/binary/sets/xbase.tgz) = fef3052b786c27898ebfcab88012729d
+SHA1 (NetBSD-6.0/hpcsh/binary/sets/xserver.tgz) = e518391c0fa08ecefd59c19049aa8b6e05427683
+SHA512 (NetBSD-6.0/hpcsh/binary/sets/xserver.tgz) = 85fe307f64bf7b5eb0300293426a377ddde46de15d7cdc7365eea65651d5b952cee395107dc6d73c55b19d43b19c47bac3bdc253d251c5f98858cd2d0aee8cad
+RMD160 (NetBSD-6.0/hpcsh/binary/sets/xserver.tgz) = 04274aa41e6f003c492c4d27e8a7182694a98386
+MD5 (NetBSD-6.0/hpcsh/binary/sets/xserver.tgz) = 3fb668ea3e2d13574cd78b5a59cc40df
+SHA1 (NetBSD-6.0/hpcsh/installation/miniroot/miniroot.fs.gz) = d65c961e5411c64f1110f55036f20c59b3a4ef75
+SHA512 (NetBSD-6.0/hpcsh/installation/miniroot/miniroot.fs.gz) = 95a54cd59939533feb467c23085569f35f2ac246a205825acb84ad8c144ae0c6cda888844270f74d452c5bbf4bd7056e9ae62e56f22c598f21a2cb92dcd8499b
+RMD160 (NetBSD-6.0/hpcsh/installation/miniroot/miniroot.fs.gz) = 10cd9e01b234129588477829523bed1ea19164f2
+MD5 (NetBSD-6.0/hpcsh/installation/miniroot/miniroot.fs.gz) = f5098b166d3da210356a284e484315e5
+SHA1 (NetBSD-6.0/hpcsh/installation/netbsd.symbols.gz) = 1a92b94312e5e4cdf5c088342d52040948fefc6c
+SHA512 (NetBSD-6.0/hpcsh/installation/netbsd.symbols.gz) = c0ca68315dee6c402bcd7a0180808d4a1c9fab799466d76a8fb460ae110c22fee7ceae5dbac451cb7a0d7ddb59d3af49f3965de88201778c7b14513f2ba1e61a
+RMD160 (NetBSD-6.0/hpcsh/installation/netbsd.symbols.gz) = d9c41a7a101b96727c040c0fdd992ba57999fc89
+MD5 (NetBSD-6.0/hpcsh/installation/netbsd.symbols.gz) = 67c48072e6d7c01c9c35c60071d1e371
+SHA1 (NetBSD-6.0/hpcsh/installation/hpcboot-sh3.exe) = 567ca586f3c3604143e61ee4b644faed466cf60c
+SHA512 (NetBSD-6.0/hpcsh/installation/hpcboot-sh3.exe) = bbbda6cb7c671816e07ac1ba9a05f57632f501019f9e7e2b3a373aa2b55bd56d600f7a6353fe433201284b0ff43908bc988f12568d95b251e8b89d5d5656b244
+RMD160 (NetBSD-6.0/hpcsh/installation/hpcboot-sh3.exe) = cac5d9056182928594f5c15b2c5d8a6bb54e6654
+MD5 (NetBSD-6.0/hpcsh/installation/hpcboot-sh3.exe) = af41643f4b488f837514418c34d06eee
+SHA1 (NetBSD-6.0/hpcsh/installation/hpcboot-sh4.exe) = 3b04443ede94fb5345be01440dfac5c600e46683
+SHA512 (NetBSD-6.0/hpcsh/installation/hpcboot-sh4.exe) = 60ae23af771f81a472d5ea84b5df140f9b2c2678753ca1878d51157366c9d04253a41b19a6bb5ef08ce755ec82b9fa67f82209fa6a0e49eb507e4ba8118dbc3e
+RMD160 (NetBSD-6.0/hpcsh/installation/hpcboot-sh4.exe) = 69a4509e0e173a94a2720f1469a00dd424e19ee4
+MD5 (NetBSD-6.0/hpcsh/installation/hpcboot-sh4.exe) = d259e7fcc3c329c95448f96b7fda6920
+SHA1 (NetBSD-6.0/hpcsh/installation/netbsd.gz) = 77bc4656ee9ce29522e56beeedf26cdec6df77ef
+SHA512 (NetBSD-6.0/hpcsh/installation/netbsd.gz) = 98ba42e9f3d8be016785ef5a807d009f6f8cf46a7c9c4abd8ad860fca5db37bbae22bdfe54bcd8b5963b1d0aa8610fca21402817ceac6b6e59a2c8cf7e986f21
+RMD160 (NetBSD-6.0/hpcsh/installation/netbsd.gz) = 705cf57dfbf1a1ee4e3629d1d82a60b8aa8cd6b6
+MD5 (NetBSD-6.0/hpcsh/installation/netbsd.gz) = 75c72e83a03c4d9f316f28e81c428c2b
+SHA1 (NetBSD-6.0/hpcsh/INSTALL.html) = 8ab73c33b0ecde2e0b0beea372a7996e866553ef
+SHA512 (NetBSD-6.0/hpcsh/INSTALL.html) = 7d7f628cd37890c8db79d76dcc9d87984b6ded522ccb2cb5670aa4a40114b1b323cb78b1b7274bb4bd27daefa25c3ee1dd0c6611736222ee546d0dd895cd6e52
+RMD160 (NetBSD-6.0/hpcsh/INSTALL.html) = 1e3edb91c943f9e1aa17315a592f5c68e7d66487
+MD5 (NetBSD-6.0/hpcsh/INSTALL.html) = 7b6883d6de2349156019286bbf61d14f
+SHA1 (NetBSD-6.0/hpcsh/INSTALL.more) = 29137bc092201f10bb2f2725d72299b5e5475b5b
+SHA512 (NetBSD-6.0/hpcsh/INSTALL.more) = 6a8737896c43bed9befbd131f8b13fc6070008f13bf9a9e798cc5bcb2210271f92c8b4138b20e716b5f48aeb478bc7ca9be66347d8636fdecd7bebb013b35ebc
+RMD160 (NetBSD-6.0/hpcsh/INSTALL.more) = b50c579d04464e3781f5bf7dcb4b69327d79a9a9
+MD5 (NetBSD-6.0/hpcsh/INSTALL.more) = 4f08e258b707193fea1797d2915df90f
+SHA1 (NetBSD-6.0/hpcsh/INSTALL.ps) = bc5b3e51e6a6f8a09ccac7db7f1ac85366921911
+SHA512 (NetBSD-6.0/hpcsh/INSTALL.ps) = 3945a024ba07da3ff29847c33f4061c8395113eaadf053b603b1391c3b994ee23c271442d90b8e9cfe104aee458348422068b5e704f8c89f2cd248e248414f36
+RMD160 (NetBSD-6.0/hpcsh/INSTALL.ps) = fadfccdee249158cab774c1bae128f6889f9bbd1
+MD5 (NetBSD-6.0/hpcsh/INSTALL.ps) = 01cdb6201ba834eb25dd70d0cd7dd827
+SHA1 (NetBSD-6.0/hpcsh/INSTALL.txt) = b291d1be7635867dda1fe5ffb3f24d41b43107ff
+SHA512 (NetBSD-6.0/hpcsh/INSTALL.txt) = 7a5ecbef64ad55680dcaa3e58319a5019096e1fef9ff24de2a8401c29b4006520dc724ff740c14f8bf56cc4fca1bf26a5525040c63d0de3559cfdc7f34710e2c
+RMD160 (NetBSD-6.0/hpcsh/INSTALL.txt) = a2e4347c690cb982b5097800f74a3729dc6c2628
+MD5 (NetBSD-6.0/hpcsh/INSTALL.txt) = 39020135702f1291d2691258a598ef52
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-GENERIC.symbols.gz) = 747df3225196d826d632a750770850510c725c3d
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-GENERIC.symbols.gz) = bf7546bf878dc86c2579e4660adfe0dfc2e7aa06416526ba2ce70425fee806f92bd7e61d2211aa8f302e167f77dd5e61674a1144274be7a3b9a14c13f2a758f0
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-GENERIC.symbols.gz) = e2aef01c044902e8685f72d3f0bba4b0ed6857ce
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-GENERIC.symbols.gz) = 71aca09f9e5bd22fd42144fbadabcda5
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-GENERIC.gz) = d680282ec53e51ed2f2df312764748ef2dbce31f
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-GENERIC.gz) = b9c3bf1bd9a442e5a7e7f515561771436b4c43e44cf454db37c94070de292aa6c00ab0a95957f80f71ffaa517a60dc1651bcb4452853f35fd541cbca2df87139
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-GENERIC.gz) = 60783b17fa32bdef611c8c8c793248f2494f8b4f
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-GENERIC.gz) = 780873f1a06cad1f8e2644f2827e6b8b
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL.symbols.gz) = 986e2b589d49d58105c82c1a3bf8d4292f5ec1c0
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL.symbols.gz) = 0919e2e21da9aace7144d82119ecf8097548ad7179b5f8b495b72b6ad75544c72d462526d7625a2b42fbf9c68a436b2d233ca7e06367f5ddf5be3386d67659ac
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL.symbols.gz) = 4abf1e4dd5c1df9578a256eb7fc9bfc6de174f60
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL.symbols.gz) = acd73bddb752df740099d651da32881d
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL.gz) = 88fdedc8bea8f6e139947e6e4a8922324a2073a2
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL.gz) = 0f13507f05a4dc76faa937fbb9dc8c5107b55e2a7dbcd97a6fd2dede7c2dff1f16ff0b908433b826125a2e1f5c4b9d14b9a809e920b92acd88968588b8129f1a
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL.gz) = 0b7be220f16b74210af24ce8bbb42402909ad847
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL.gz) = 85d626d678c978ad387238dfc76e20a9
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL_XEN3PAE_DOMU.gz) = 82987dd8d3d035c3741ec54e567c797aa527b85e
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL_XEN3PAE_DOMU.gz) = 43c9d6c594b997834e1bfadf63a20fe0735947419a1e86e9e06bc97a7953738219eba2072f9a7b1fa6b23870287be413650145234d2c58166138bb00bd0136a2
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL_XEN3PAE_DOMU.gz) = c0c2edf5e75878f0a07a2d7f971d020a16bd33dc
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL_XEN3PAE_DOMU.gz) = a6a8ef4a7c0da213a9821e7f2d0e18c8
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz) = 67b61d551fd822e4578b9a8d54bc4a08a39f8b34
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz) = bfdb3e7ab7a5456434117156bd187d1f111eeedbc7a2d568266fecfeab33bf847fcc4b72e6edffe8015841b87aa04645c1c0442ce521c8965cd7007326b38e78
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz) = c5378820ecdb9baf20fabded1f5caa4a1d6a3021
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz) = a09e8070066fb225a26b0904422e1704
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-MONOLITHIC.gz) = 205b7f5a5c457a2db4c997c75c02d1f55a0692e7
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-MONOLITHIC.gz) = 68953183a437b13d94af72acbc231553e6aa57f4e3acbe432e710ad452317b974509a9ae83ea0f350d24164de4d1ae6a3d8d4a221e31c61734b67df026b93b03
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-MONOLITHIC.gz) = 11fd88405a800b36b7b030991e632d17992f5e15
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-MONOLITHIC.gz) = f746f0b2fcebfb329cdd45181f2acb74
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3PAE_DOM0.gz) = 6c7943423d026377f0d9308e8aac75d52f08907c
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3PAE_DOM0.gz) = a2fea33cd4aaebb2c2e69d8790ea40b0c2f00e8be3a823ca93274e534a751fe04efdc9d5ed7fc15897c42c9cc7d987ee645f50897cf6ef55383c448885a324f5
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3PAE_DOM0.gz) = 948c072d5d1424578e2ff5bc3bc7bca39364f8e0
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3PAE_DOM0.gz) = 1d4aafba1a470802f7f2c7e10e98ca52
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3PAE_DOMU.gz) = 2ae71d2f1c2b512d124e2d92d431ab5b2c1f05a7
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3PAE_DOMU.gz) = 9b553c5b145d2b29b9032416bc01f5c43bbad80f2c6feb1e96c881e4d1dd77c02740413cefbbd4fb6cd247cb75fd24959d5a60d3210020548236e3a14a82a65a
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3PAE_DOMU.gz) = 2b884a96bb6cdc3059448104c7ddafc31be7c188
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3PAE_DOMU.gz) = dba74b4cb61cf1606556492f6f1b213c
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3_DOM0.gz) = 7b21a86bc29b1573539105b83e6f847124afee15
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3_DOM0.gz) = 9f0a07816ba899e5d003750e1320c6f83c66bee70b71b1356980e64019a4eeff2ee105eea33dc31822c614609782e3143c6575afa7cd9dbfdf05c119ab2cb92c
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3_DOM0.gz) = e976db5aa9e2e5e1109f804913e5a8f075708f85
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3_DOM0.gz) = b8ec7670143458921b7dd71f05251257
+SHA1 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3_DOMU.gz) = f528d474640a5bda692eb50859c208f2277ca61f
+SHA512 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3_DOMU.gz) = 24f2b7317b51e12e15084d1aad1177a63d37be3ecc3777de4f7b2b93076e4c980a4667c7013db8bdb500e033e745adb665c45aa842d4422494d67beb3f2f4442
+RMD160 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3_DOMU.gz) = 373525999967fd37d620cea1b0b38692ea102d64
+MD5 (NetBSD-6.0/i386/binary/kernel/netbsd-XEN3_DOMU.gz) = f76afc8d70580acebe22d4daba31df3b
+SHA1 (NetBSD-6.0/i386/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/i386/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/i386/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/i386/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/i386/binary/sets/kern-GENERIC.tgz) = dfbdb16d93f42cafac4314e173c3698abb2b2249
+SHA512 (NetBSD-6.0/i386/binary/sets/kern-GENERIC.tgz) = 572284b4e2daab363f9f89f6bb9b80428f6d048fbb70120541b7cff881ed7fd8145b2a5dcafb63160a4292d286e57a3191154267167cedb7641f1ee3098072fc
+RMD160 (NetBSD-6.0/i386/binary/sets/kern-GENERIC.tgz) = e663f76167f352828f007b3271408d0c4d1f6735
+MD5 (NetBSD-6.0/i386/binary/sets/kern-GENERIC.tgz) = 43a3993a20de2d5c58aa9a1aa90dc667
+SHA1 (NetBSD-6.0/i386/binary/sets/base.tgz) = 5847817e7b75483373fe51fb6b465404cb74e1ad
+SHA512 (NetBSD-6.0/i386/binary/sets/base.tgz) = 927acc412e1372e2205d4c90fe017b2812bbd6036823b6a18bfcc33513279bdf9f02731b874ad73f614da46194bdacd525a8bf9e301c5842f3f6475fa27507be
+RMD160 (NetBSD-6.0/i386/binary/sets/base.tgz) = b36be3ba67b7b2209c5baf2fe314ddc2a7254054
+MD5 (NetBSD-6.0/i386/binary/sets/base.tgz) = c643ea74ea234056b1f741a561790c1f
+SHA1 (NetBSD-6.0/i386/binary/sets/comp.tgz) = 0f22e69dce5b6678e1ab117b875c7b28f2a1224a
+SHA512 (NetBSD-6.0/i386/binary/sets/comp.tgz) = 99a73445be3ac1354a3ec94c7b4d231d3fe72bc2bc7cc020c9dd4c74d5fa06f1a7e681f48a2dbf3e90f0d8e611d51e6524883a1a4edf1494607259bc1c49a99b
+RMD160 (NetBSD-6.0/i386/binary/sets/comp.tgz) = 1bae0e183624d0dc957e24eb52041e2b3e42492c
+MD5 (NetBSD-6.0/i386/binary/sets/comp.tgz) = 5cff8ef6491c3b9270310558ca8360db
+SHA1 (NetBSD-6.0/i386/binary/sets/etc.tgz) = 00df7a05fddcdbbf9e0ee430c634fd1e1da2a2db
+SHA512 (NetBSD-6.0/i386/binary/sets/etc.tgz) = 0100afa02f2c0f09bcbe513b282b7e23124b94d5d77816f88c7b927e0625bedde3020b0c34e03f26da5d53941cdb0aac1398d2e15c9b4bc6cbb4e46e4bf8786a
+RMD160 (NetBSD-6.0/i386/binary/sets/etc.tgz) = 978efa1d91dea561eaa148f4da679a88e1730c7e
+MD5 (NetBSD-6.0/i386/binary/sets/etc.tgz) = 3f174862437df05c82293f93a42a52f3
+SHA1 (NetBSD-6.0/i386/binary/sets/games.tgz) = eb79bb969242401a2573c8cb861e399f374ffdce
+SHA512 (NetBSD-6.0/i386/binary/sets/games.tgz) = 537eaab987a71933b63673477c276cf3b558f4dd46331ea224f5c0f2b0ac387fb591a7880b1055225746b9c46fcb4ff0f8b72382a629abc6af6315ee038c0d0d
+RMD160 (NetBSD-6.0/i386/binary/sets/games.tgz) = cfbc8842fcc975fdff71c6fc472396d533d8aa5c
+MD5 (NetBSD-6.0/i386/binary/sets/games.tgz) = df096416d676f1a44710711d7c895329
+SHA1 (NetBSD-6.0/i386/binary/sets/kern-XEN3PAE_DOM0.tgz) = 714c9b6c0a41973c06ea62a97babb7000ea1245e
+SHA512 (NetBSD-6.0/i386/binary/sets/kern-XEN3PAE_DOM0.tgz) = 97529a4c90a36ad65bec57dca59bc80f724981c4358d32195e3b4e614761fae96a79cab552fe0388e7c8e57da581a2b07a84a44d12d32f23e6ce45c771493ccc
+RMD160 (NetBSD-6.0/i386/binary/sets/kern-XEN3PAE_DOM0.tgz) = 0171b60434e21cf6d29d38300c05988d19ad1783
+MD5 (NetBSD-6.0/i386/binary/sets/kern-XEN3PAE_DOM0.tgz) = 6baad66e20421f3fb0af25e4b95f8a6d
+SHA1 (NetBSD-6.0/i386/binary/sets/kern-MONOLITHIC.tgz) = 52d1f2b561194201e67abf1ba2c1726d72e97984
+SHA512 (NetBSD-6.0/i386/binary/sets/kern-MONOLITHIC.tgz) = 19aa162f30e144882f2924be4b864821e109991ca16027c4016d54baf812945c8231f423d141091f08ecf8dc9310a74fcbae43b6ea18578afd1bef3346772cf6
+RMD160 (NetBSD-6.0/i386/binary/sets/kern-MONOLITHIC.tgz) = ca3d3b0cb59e5d5ba2089b6cf250c62c079b6855
+MD5 (NetBSD-6.0/i386/binary/sets/kern-MONOLITHIC.tgz) = 56528935806a8a2ec9f48c6dbfd9c175
+SHA1 (NetBSD-6.0/i386/binary/sets/modules.tgz) = a6d22e796d8b1f344b43bcf38fbb79e53ffdce13
+SHA512 (NetBSD-6.0/i386/binary/sets/modules.tgz) = 9bbf31b0e1c1192e9ff0ff38f0978c4c2972a82638e63f5f023bd7263ff9386d36cfd666e55e62a6bf3bf3e8c47571252b3508e485ec86830caaa89c66c19fe7
+RMD160 (NetBSD-6.0/i386/binary/sets/modules.tgz) = e3dcc86e04adaa6f347d51801422854b35fcedfb
+MD5 (NetBSD-6.0/i386/binary/sets/modules.tgz) = 71908d43cbba617e2ff14e3fffa3dae0
+SHA1 (NetBSD-6.0/i386/binary/sets/man.tgz) = f526dfe015359f1181af9cf3dc6061960289451f
+SHA512 (NetBSD-6.0/i386/binary/sets/man.tgz) = 75dc7781f8531f09bee6f1696561d036b12f08a66a44c4e56b11986e6d91df213ca8b4c6e59da9a2168038c94322c6cfdcdeb52125f5fb03c5b84cdb9522bd7a
+RMD160 (NetBSD-6.0/i386/binary/sets/man.tgz) = 1f8551b79ca0342aaf8df0c6f2a77e7337cb7672
+MD5 (NetBSD-6.0/i386/binary/sets/man.tgz) = 6114b3fadf0a5e3bf8fde0e7bf0101fc
+SHA1 (NetBSD-6.0/i386/binary/sets/kern-XEN3PAE_DOMU.tgz) = 4e24d5f9641c69962f0e9124a3a0082074db7117
+SHA512 (NetBSD-6.0/i386/binary/sets/kern-XEN3PAE_DOMU.tgz) = cbbd3c74d74bcd20c8fe2dfa5052b6886a5d25bf8c7aa595638655af790072bd3067e8555201849c2f3d0ec67465f41721c4a8aa14fb060231683de850fd6e99
+RMD160 (NetBSD-6.0/i386/binary/sets/kern-XEN3PAE_DOMU.tgz) = 56610e7d2c9e2844ce0516255bbf76b330d23f80
+MD5 (NetBSD-6.0/i386/binary/sets/kern-XEN3PAE_DOMU.tgz) = e79dd5d5ca1fc640045efccb106e6a01
+SHA1 (NetBSD-6.0/i386/binary/sets/kern-XEN3_DOM0.tgz) = 9c8c6c75aec356a4b6591bd5ce5fcf0e76536c41
+SHA512 (NetBSD-6.0/i386/binary/sets/kern-XEN3_DOM0.tgz) = 2acd400b61f87b32e41daf0cb89b512d887f222310cab9be25f2b030480b720042c86abb68ae81ba73875a2c70dfc01184e1e771ad671e98383ce9c8357b4e8e
+RMD160 (NetBSD-6.0/i386/binary/sets/kern-XEN3_DOM0.tgz) = ac64d2c3ff6ff7352d43f4f275cfc07a509e40de
+MD5 (NetBSD-6.0/i386/binary/sets/kern-XEN3_DOM0.tgz) = 5541acebbb837f4882be868d86bc2b22
+SHA1 (NetBSD-6.0/i386/binary/sets/kern-XEN3_DOMU.tgz) = 01432bab26f65297c0739bc3eb4740bd984d67ab
+SHA512 (NetBSD-6.0/i386/binary/sets/kern-XEN3_DOMU.tgz) = bd7221f127923ebbd3099589b5bfd332cadbdcf2ad29870b9eee66b8241d1ad50c4d9481647d41d9ceba1e7071735538acd19d458d78e666d2b8ae1b097f993b
+RMD160 (NetBSD-6.0/i386/binary/sets/kern-XEN3_DOMU.tgz) = f9c5fd62ac6b11f4cb1ab8eb648f4ee51209ff17
+MD5 (NetBSD-6.0/i386/binary/sets/kern-XEN3_DOMU.tgz) = fead463ca4403cdf358b55114421e53e
+SHA1 (NetBSD-6.0/i386/binary/sets/tests.tgz) = 65e60f978857f50c36bf4066ad82acee0ef06af4
+SHA512 (NetBSD-6.0/i386/binary/sets/tests.tgz) = 714220aecacd2640160768ae00089cb25b5d3b5cf29f715e32257889159699566fe8d9b3bbcfa7bb6e2864ee1945dbfc61b48a66e20463025774616d91cc5392
+RMD160 (NetBSD-6.0/i386/binary/sets/tests.tgz) = 83c54132cfa9e7b0b5352466070bba098576ff86
+MD5 (NetBSD-6.0/i386/binary/sets/tests.tgz) = 1cf15f457ca67156d7dad0f7723ed259
+SHA1 (NetBSD-6.0/i386/binary/sets/text.tgz) = 0e426ee26f13d2523798fa8c09e934725087dc5e
+SHA512 (NetBSD-6.0/i386/binary/sets/text.tgz) = 2809f127e3baa3e6ebdb181c31620b68d01e90208bd191db99aa9657c91db9a97b061cdfdc2d7a39fbedf2288067f2ed885d6515fdcf8e5b5a68dc754e9b3e30
+RMD160 (NetBSD-6.0/i386/binary/sets/text.tgz) = b30ff1dd8f2cfe414939980d4be3b61f39c04353
+MD5 (NetBSD-6.0/i386/binary/sets/text.tgz) = 2667947b26dffe05f3de7d1e2c8906d7
+SHA1 (NetBSD-6.0/i386/binary/sets/xbase.tgz) = 934f64b717d722045717691a55fb9d295f83b4e3
+SHA512 (NetBSD-6.0/i386/binary/sets/xbase.tgz) = 385cf3a944f4a6ef7271220f0367f12d123d9a2b84ebd3ca46181279f7cf5d544a946df3e10ea52f1e07638c5bc5d0b766fd63bed4e08b468f6ea5b0a75e17de
+RMD160 (NetBSD-6.0/i386/binary/sets/xbase.tgz) = 04203a7b8bb5cd1a41aeeb2b92697677cfe58e98
+MD5 (NetBSD-6.0/i386/binary/sets/xbase.tgz) = ec9f6a167fd05c459f1fdf8cc889785d
+SHA1 (NetBSD-6.0/i386/binary/sets/xcomp.tgz) = 7bc2f4e10afaa599959832c62f024d9f2f45bc10
+SHA512 (NetBSD-6.0/i386/binary/sets/xcomp.tgz) = 148bfb83357133e5377aeee82fdae29e0b90913ba59b1f51264108ca70010d55bd4adc4ce0ba7611a83b5f3f13307f196f724f3cb3a170d7f2caef801b79cc38
+RMD160 (NetBSD-6.0/i386/binary/sets/xcomp.tgz) = be8c61b5890936fc93dfb88c02c5f17f79f3cc73
+MD5 (NetBSD-6.0/i386/binary/sets/xcomp.tgz) = 9c25f1bf64f97c778e3c87b6e0e72871
+SHA1 (NetBSD-6.0/i386/binary/sets/xetc.tgz) = ea4db636b3919906a00e7b161b2c5f62fe7b4fa6
+SHA512 (NetBSD-6.0/i386/binary/sets/xetc.tgz) = a59442b3ab58c33774197f9bb28a96836b4c519c750270bd880d166250523f8119a68a9de6b6861f76cdf713da9682772e754075c965c56aa260b52ed837943e
+RMD160 (NetBSD-6.0/i386/binary/sets/xetc.tgz) = 28e3ce094b557af508e1ec82ef46ebb01eb68509
+MD5 (NetBSD-6.0/i386/binary/sets/xetc.tgz) = 2a521f73ba4bd630070b01f24c8647d6
+SHA1 (NetBSD-6.0/i386/binary/sets/xfont.tgz) = a7a41c82046568a695ba0afeb81d11bf92e67950
+SHA512 (NetBSD-6.0/i386/binary/sets/xfont.tgz) = f46f4c6b4c61bbcbde85333cc714654902263c92e70035545caba3f3e2d5029cb074c8e427c85ea83b8478b19f32b93c4735a7adf64cc75609a4acd1118d0416
+RMD160 (NetBSD-6.0/i386/binary/sets/xfont.tgz) = 8863108bc2cc456cd1298b5317f519c5c6b3147a
+MD5 (NetBSD-6.0/i386/binary/sets/xfont.tgz) = 36e968072dae462efddd6014f9f44272
+SHA1 (NetBSD-6.0/i386/binary/sets/xserver.tgz) = 27fd7ca36d5a3ca94b66eb5fd81ceeaed1648fe0
+SHA512 (NetBSD-6.0/i386/binary/sets/xserver.tgz) = 6a0d364672e4513dbf4c76c1cada80f84e774efa85c3e1fe4865ab26333765fab1db8ce3b590682a3e2c63895165e0d694c3e6717789b2f0ec87defa608930dd
+RMD160 (NetBSD-6.0/i386/binary/sets/xserver.tgz) = 7521930788a2410a2842767b9c2886af83fccad7
+MD5 (NetBSD-6.0/i386/binary/sets/xserver.tgz) = ce3565a1b5e8af09e54ef8488edb14df
+SHA1 (NetBSD-6.0/i386/installation/cdrom/boot-com.iso) = bcfbd8c6288248e55d78704802dfdbbd1d20519a
+SHA512 (NetBSD-6.0/i386/installation/cdrom/boot-com.iso) = 9531877436cf8853db4dbd96672cb13a0784a1eef2a90ab43aeaae421f70bb6bdab7d5c10095f186b733d04ee1184087ff7b5d26ec7ef77d0783ee0f5c0d21f3
+RMD160 (NetBSD-6.0/i386/installation/cdrom/boot-com.iso) = 46205ca4d924c43e85b01b7750274f31fa2ad170
+MD5 (NetBSD-6.0/i386/installation/cdrom/boot-com.iso) = da3da9b120520e631bc5c17dfb70bd27
+SHA1 (NetBSD-6.0/i386/installation/cdrom/boot.iso) = 146e96103568f2ab3e98c1a0c7b98f89a93ac474
+SHA512 (NetBSD-6.0/i386/installation/cdrom/boot.iso) = 5073e008276c0fe9a4c3231bea37b2534e40d20b17d32a5bb30e9811a0578feae08a810a808201f44f74ab7258a58c5c1dfa1cc59ad0d4d41eff02f6772dade5
+RMD160 (NetBSD-6.0/i386/installation/cdrom/boot.iso) = 54ff36aedaa5266fb788b1b3f74dee0799c432f7
+MD5 (NetBSD-6.0/i386/installation/cdrom/boot.iso) = 6d1fae4935084e853fa152e09b472be5
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot-com1.fs) = d4891595c9155d7598f1718cce43ed2fde9d4aa8
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot-com1.fs) = 89d2af1f41e20deba16c1abfdc4709f353021710ae33ff40f9f4f20dd4c875db855f2bddf9af444f49dfb2d1d1caf0a2f3eab7bced113c45708da590092c9b04
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot-com1.fs) = f2d8d259d8abaed540079cb0301fd111462bc0ba
+MD5 (NetBSD-6.0/i386/installation/floppy/boot-com1.fs) = 320d7fcd247eee78495d4bc56205ba9f
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot-com2.fs) = 25012df4758eca3d307004fe1b448bfd1002b6ba
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot-com2.fs) = 3ad3778e665bbb8a0ea8e39d9c6a9144a79fc158aeef0af4bac90ee98561beb460b2f3993c929f27a1f26170be53d153faa0ec523e402bb1143d9cec5a54ac91
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot-com2.fs) = e76b6f6a667e4548f8efdce8fded360a9ab7ce00
+MD5 (NetBSD-6.0/i386/installation/floppy/boot-com2.fs) = 1c731748f3af6300b39311051870dd5d
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot-com3.fs) = 00f812e968818ac87e2f0217b9aa2f67cf1826b2
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot-com3.fs) = ac293ed38646e83851e74e70451893b301fe935fd4ee91fbe2f66d4a49583763ce3a5a123f05e38d0806e6b51c6db01dce467908f7ac49447b872e1a06364e74
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot-com3.fs) = cd261aa83970e5699763ec792aebbc4bcedae712
+MD5 (NetBSD-6.0/i386/installation/floppy/boot-com3.fs) = a9073f83732b763206b32fd46c166fab
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot-com4.fs) = 6d9f052a4ba66b7a8d818418c7548a96b358189c
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot-com4.fs) = 86909e41525fe7744c3e10f523b7bd2651a80a000906e7040bae8fadeed8f2ee00e6d39998aab110a4aedbe9af95aa15eff7a8fd5781b6d979545c7751c54aea
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot-com4.fs) = 64980af391f001e6b67d6b603fd67e3d424a48a4
+MD5 (NetBSD-6.0/i386/installation/floppy/boot-com4.fs) = 9868c40fe2e4e26b0db5eb1a24d4b84b
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot-com5.fs) = e138754c8978462f24c07a3e61be0085592ab1be
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot-com5.fs) = 785ae7b940e77d108d20f4c8f9625db138334144e740ccf15949e4434572115fdcafecce25c3ea9c0e0d260e7d4c526a860bacda09ab8b2823d5d48a3a220b1a
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot-com5.fs) = 9eae2380cd42784b68dba1da19eb8e7a2f37940e
+MD5 (NetBSD-6.0/i386/installation/floppy/boot-com5.fs) = 6f1b2546ecddd49db5fae090706ced45
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot1.fs) = 955c193dc080b69fe111652972bb1a4a5fb88b70
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot1.fs) = bea5bb410069dc463f5d670ca33a8040c6bc741ee30e90c93492ce5110334f0e87cc519571f35f2962bc18de0352c3f50002ceb8346f4aed84069b60c61740a8
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot1.fs) = 3828a790e9743011d6b2f257f79deecee3686c4b
+MD5 (NetBSD-6.0/i386/installation/floppy/boot1.fs) = 83997622af685d71b47e687ee0226d5c
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot2.fs) = 25012df4758eca3d307004fe1b448bfd1002b6ba
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot2.fs) = 3ad3778e665bbb8a0ea8e39d9c6a9144a79fc158aeef0af4bac90ee98561beb460b2f3993c929f27a1f26170be53d153faa0ec523e402bb1143d9cec5a54ac91
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot2.fs) = e76b6f6a667e4548f8efdce8fded360a9ab7ce00
+MD5 (NetBSD-6.0/i386/installation/floppy/boot2.fs) = 1c731748f3af6300b39311051870dd5d
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot3.fs) = 00f812e968818ac87e2f0217b9aa2f67cf1826b2
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot3.fs) = ac293ed38646e83851e74e70451893b301fe935fd4ee91fbe2f66d4a49583763ce3a5a123f05e38d0806e6b51c6db01dce467908f7ac49447b872e1a06364e74
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot3.fs) = cd261aa83970e5699763ec792aebbc4bcedae712
+MD5 (NetBSD-6.0/i386/installation/floppy/boot3.fs) = a9073f83732b763206b32fd46c166fab
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot4.fs) = 6d9f052a4ba66b7a8d818418c7548a96b358189c
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot4.fs) = 86909e41525fe7744c3e10f523b7bd2651a80a000906e7040bae8fadeed8f2ee00e6d39998aab110a4aedbe9af95aa15eff7a8fd5781b6d979545c7751c54aea
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot4.fs) = 64980af391f001e6b67d6b603fd67e3d424a48a4
+MD5 (NetBSD-6.0/i386/installation/floppy/boot4.fs) = 9868c40fe2e4e26b0db5eb1a24d4b84b
+SHA1 (NetBSD-6.0/i386/installation/floppy/boot5.fs) = e138754c8978462f24c07a3e61be0085592ab1be
+SHA512 (NetBSD-6.0/i386/installation/floppy/boot5.fs) = 785ae7b940e77d108d20f4c8f9625db138334144e740ccf15949e4434572115fdcafecce25c3ea9c0e0d260e7d4c526a860bacda09ab8b2823d5d48a3a220b1a
+RMD160 (NetBSD-6.0/i386/installation/floppy/boot5.fs) = 9eae2380cd42784b68dba1da19eb8e7a2f37940e
+MD5 (NetBSD-6.0/i386/installation/floppy/boot5.fs) = 6f1b2546ecddd49db5fae090706ced45
+SHA1 (NetBSD-6.0/i386/installation/miniroot/miniroot.kmod) = 3949ed3ca0384f45c40b59eef585566e947fc150
+SHA512 (NetBSD-6.0/i386/installation/miniroot/miniroot.kmod) = e91e8d4aa8ef1f81945c495df4b43f8bcc669fa1f0183c5d0092d526889d985432d6f318418a42910596f1f44cc0d235d32a0b5e3aa1572198182ff1d90188c1
+RMD160 (NetBSD-6.0/i386/installation/miniroot/miniroot.kmod) = 2d67e98155d79210ae2349fb13937724f79cef47
+MD5 (NetBSD-6.0/i386/installation/miniroot/miniroot.kmod) = 2fbac91d26cec04141c2c79a18aa839e
+SHA1 (NetBSD-6.0/i386/installation/misc/pfdisktc.zip) = e3dedc5211120fdb8259075541a6bf4fdb5a0c5b
+SHA512 (NetBSD-6.0/i386/installation/misc/pfdisktc.zip) = 2f4daa1b52b4f40be868ee04faf9b55f17df64ca03ed0b6577f2f1680692226b68d84c0a9f59fd0b08085219555c25e52e447053a6e03589957718b954aadeaf
+RMD160 (NetBSD-6.0/i386/installation/misc/pfdisktc.zip) = 29ed32ef8b4390bd1545f9337f16994a154c20e6
+MD5 (NetBSD-6.0/i386/installation/misc/pfdisktc.zip) = 33c938480de81999f82a3ba3fca0b233
+SHA1 (NetBSD-6.0/i386/installation/misc/dosboot.com) = 0c89f2a01913cbd69002b821273fe196ff835f89
+SHA512 (NetBSD-6.0/i386/installation/misc/dosboot.com) = 661bb1a057d23a8dbd8f33216e590439e83b8cbc1ee7988980de68890148c8d86b9e58254be366afdc92b8238cf1d304ce972b518e4656ed9a378fa5eb7e03e6
+RMD160 (NetBSD-6.0/i386/installation/misc/dosboot.com) = 11182a8c2c18dc561e9b07f84895e21f81d42aeb
+MD5 (NetBSD-6.0/i386/installation/misc/dosboot.com) = 8d32a69f5a7c200404b5e6747eb38397
+SHA1 (NetBSD-6.0/i386/installation/misc/pfdisk.doc) = 9886ea575769f46c49251fe1b096c860457e996b
+SHA512 (NetBSD-6.0/i386/installation/misc/pfdisk.doc) = a34e971ec8a0d1eb5107ddfa2a5a6c7eb028ec58235983658ccee2e3b42bd2e40e2ff4504a2b6aa16668a918e17f0d1866ca4ef904df114f30674dd9f8e32c17
+RMD160 (NetBSD-6.0/i386/installation/misc/pfdisk.doc) = 9e6ddcbeab7d6894f3173efbc9b1067d40d79409
+MD5 (NetBSD-6.0/i386/installation/misc/pfdisk.doc) = 7c9091037c42ecd0d1fb67275af0650a
+SHA1 (NetBSD-6.0/i386/installation/misc/pfdisk.exe) = e780cbcd893d446cc9d07950e9b9462d9a02e439
+SHA512 (NetBSD-6.0/i386/installation/misc/pfdisk.exe) = 798a00ddfd76ffcae1dd427ebcd9eac6ef4fc54bb0eeeba36ecca3903b9de785ff6113e3ee0960ca695d9a8196dbdd3f7434530e50dd0208d5b872e989038c3b
+RMD160 (NetBSD-6.0/i386/installation/misc/pfdisk.exe) = 4569b5259fb5d13606e521a4d85a0748afa92670
+MD5 (NetBSD-6.0/i386/installation/misc/pfdisk.exe) = 6e470b18a39a3b7bf7c8fe7c34241da7
+SHA1 (NetBSD-6.0/i386/installation/misc/pxeboot_ia32.bin) = a1c0c4f7137ad0c4131aec154c3cdc7fd62c4ad6
+SHA512 (NetBSD-6.0/i386/installation/misc/pxeboot_ia32.bin) = 4ef5af523ac4d164885c4ce7ea8286303ce1a60d6225730d98b14f6b96c56c1227bf8bbd4d4ee77ff30645e5f0375aea1f879fc1f61de1263bc5f68e470abe28
+RMD160 (NetBSD-6.0/i386/installation/misc/pxeboot_ia32.bin) = 732aa68a238219b0fa20ac73fed5cdd59ba4b775
+MD5 (NetBSD-6.0/i386/installation/misc/pxeboot_ia32.bin) = d56818a2c96b381e6b907ef7ee5c146d
+SHA1 (NetBSD-6.0/i386/installation/misc/rawr32.exe) = b43acce43bab52a4d7a5cca69b5c448700c3084c
+SHA512 (NetBSD-6.0/i386/installation/misc/rawr32.exe) = c8e466f2a57083a0cd577720f31ec6d84096680e89c824b633f168ccde962be28cc3ec8019cf136a12437b3df92b872a3600266857c4e5c43f12c6989ce3490c
+RMD160 (NetBSD-6.0/i386/installation/misc/rawr32.exe) = b0cafd5f6dab34b71cbd5885821188bb8479bdc8
+MD5 (NetBSD-6.0/i386/installation/misc/rawr32.exe) = a38e68ebd955604d1b4e137c8eb63dbc
+SHA1 (NetBSD-6.0/i386/installation/misc/rawrite.c) = 45e127dcd24e3a5666d1d4fff54349ca9bf5c077
+SHA512 (NetBSD-6.0/i386/installation/misc/rawrite.c) = 05315a055d1b95bb409c986e3a4faa0ffaf407a239ca32638b8df05757af480cd409abf141cc9b695bf2f61ececbb0de07737a9a927e8c9d9e9f78c39a54c9a1
+RMD160 (NetBSD-6.0/i386/installation/misc/rawrite.c) = 424511ff8fe6118c147cda137803fbc3bdea34a0
+MD5 (NetBSD-6.0/i386/installation/misc/rawrite.c) = 606e8042f2343028bbe2fbb7db391c53
+SHA1 (NetBSD-6.0/i386/installation/misc/rawrite.doc) = a5d3f4916c427ec4ec93d3b1e044f8141ed83dd8
+SHA512 (NetBSD-6.0/i386/installation/misc/rawrite.doc) = ccc3a2b7daadd7527e048de382bdf37580fc8069f5ad2e9f5f8feec5e50374ad2c8a8cbd293f38fffddb08a84573f13ed1152695f64a9c4b745c6e6dae793401
+RMD160 (NetBSD-6.0/i386/installation/misc/rawrite.doc) = 892d37aa0401f9d42effec57944c007e7a6d530d
+MD5 (NetBSD-6.0/i386/installation/misc/rawrite.doc) = 0006cfba390f738eb0d4f6c2fcafb7c6
+SHA1 (NetBSD-6.0/i386/installation/misc/rawrite.exe) = 81152a9688b5fdce26ba09c1685ffa842e31c83d
+SHA512 (NetBSD-6.0/i386/installation/misc/rawrite.exe) = 76ca20eca1b087c8d583b23c52734ef6db49f15d5bbbc4da0eef301b2b46fad5b86c063e4d868bf3db41c625e022c4604759e1a1bc50c9caff2665eaecf11920
+RMD160 (NetBSD-6.0/i386/installation/misc/rawrite.exe) = 2b5707df5c5a7a84b8e80fafb03442fd29ca3eac
+MD5 (NetBSD-6.0/i386/installation/misc/rawrite.exe) = 7dac6ea496014d32dbce6c50feb254ca
+SHA1 (NetBSD-6.0/i386/INSTALL.html) = 6b92ae0724869e0b33123151562db113ff87310d
+SHA512 (NetBSD-6.0/i386/INSTALL.html) = a3541d32c0c954af91d5af22c7b1d134096a4d87f61baa9e76d192aed5461f5a44bca260dfabc3cf1979b9736958ea2d4467a5f98023bf816ea9915c6ad81786
+RMD160 (NetBSD-6.0/i386/INSTALL.html) = beba55314f919265ffba84528a2ed7b2ebc2ef7d
+MD5 (NetBSD-6.0/i386/INSTALL.html) = 5597002f70f1f3e1905becc1a21b5046
+SHA1 (NetBSD-6.0/i386/INSTALL.more) = fd226e8ade97b7071048c7f3a71d68b8f2fbc440
+SHA512 (NetBSD-6.0/i386/INSTALL.more) = df5bfc36c307a943d5def074292619b8b9452b7d8ad612feb6e3aed63534c5698701fa0008e007f6b08a742141643b2d9d82d3386a1194421c556a499e12b1b6
+RMD160 (NetBSD-6.0/i386/INSTALL.more) = 811bda03f587e977180da84b2ee3a1715e059a68
+MD5 (NetBSD-6.0/i386/INSTALL.more) = a080d66a0f33055ae14ac59dd13b6c11
+SHA1 (NetBSD-6.0/i386/INSTALL.ps) = 81b57f86901189d2f513553abf30858d95ce11d0
+SHA512 (NetBSD-6.0/i386/INSTALL.ps) = b2fcab6677f9949755c9aa702719c0572c7a7198c926e8d50103e513f2c44ec92b11147488eea8a1f0e5f04c3e024480cde2c47e538137b99f80df27f9deab91
+RMD160 (NetBSD-6.0/i386/INSTALL.ps) = f7e87587ad8249b5f71b89988802cbff68e645cf
+MD5 (NetBSD-6.0/i386/INSTALL.ps) = 134248944ca4bca697eeb3aaa49c1dc6
+SHA1 (NetBSD-6.0/i386/INSTALL.txt) = a1072904f9c7baa1f3b9136a12e7b8fe7821f757
+SHA512 (NetBSD-6.0/i386/INSTALL.txt) = 4229cbe31deb065a67fd10b737e4acb0784f9a8b31546e4c9d8b41fd002e81a9d48acf08a455dfa488669358d19cc1daa5c329cd3ccad5bfa1471432656fc70f
+RMD160 (NetBSD-6.0/i386/INSTALL.txt) = 2dee238856637d6990f33f3aac177f34478c6ff1
+MD5 (NetBSD-6.0/i386/INSTALL.txt) = 92702556c5a08e156b8eae602d975fdf
+SHA1 (NetBSD-6.0/ibmnws/binary/kernel/netbsd-GENERIC.symbols.gz) = c4b53dcc495fbb67f30084776444088c6fa69af6
+SHA512 (NetBSD-6.0/ibmnws/binary/kernel/netbsd-GENERIC.symbols.gz) = 08dc9f41dbc5f88e4e4d718880f8ac072ee9386daf727cd717b7276c88443dbe194781b062cd29409a964737cb8b27f0b158dfefbcb1b4226f9bc40deedd1f19
+RMD160 (NetBSD-6.0/ibmnws/binary/kernel/netbsd-GENERIC.symbols.gz) = 5d66efd39a08359a525748ecd06b42705c53028f
+MD5 (NetBSD-6.0/ibmnws/binary/kernel/netbsd-GENERIC.symbols.gz) = e819b2d7af2bddcf3d4cf935724695f0
+SHA1 (NetBSD-6.0/ibmnws/binary/kernel/netbsd-GENERIC.gz) = 0494a909caf1ca5dec73b1f5aada6ef099653a7d
+SHA512 (NetBSD-6.0/ibmnws/binary/kernel/netbsd-GENERIC.gz) = 5ca8f4fec7a5b89369934e081f7316c4e482ef7090ed8904f0985e941e20bf42fae8396d7da4151b78234568b0a735667b56f7b480fa37d1bba36b594d3d71f6
+RMD160 (NetBSD-6.0/ibmnws/binary/kernel/netbsd-GENERIC.gz) = 2ff1c7a5c604f56f85ff3ade294e3cb55c053ac3
+MD5 (NetBSD-6.0/ibmnws/binary/kernel/netbsd-GENERIC.gz) = d4f4dfb62bac44f16e9bd16c7df8a501
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/games.tgz) = fbf69640b362df2446d7414ac3a13db100c289eb
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/games.tgz) = d86b41d79aea4204ccf45306937a5ec45629e37873a5956c0280fd1d54cf4a808542d097f9d978fd3277791554ce8a6fb4d0ccd46e30210549d5cce1145bb499
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/games.tgz) = fd2aed1eb51f4db522fb5163e8fde4c040b55d30
+MD5 (NetBSD-6.0/ibmnws/binary/sets/games.tgz) = 997ae5fb42196a787df89873be321e47
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/ibmnws/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/ibmnws/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/xbase.tgz) = b7c8146146ebc15191c1bf53f51f8f980fe8c816
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/xbase.tgz) = 091f5d00414a9ad478811bfb0e953f2a204869bc5e310790886a59c11953974cf7068cd9a96c8823856ab2687ffa2ac31e97494f47338bfe31d80217382c59f1
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/xbase.tgz) = 4bd1bfdc7c1e1619de63fb83276c21039b945357
+MD5 (NetBSD-6.0/ibmnws/binary/sets/xbase.tgz) = e621806afa0fcc9cdcef0f9b3c7dfcbd
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/xcomp.tgz) = 960dd33b61e19dec92096a54791aca1cdf56ce54
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/xcomp.tgz) = 111dd50041e4008aeadb898c3d08f9995c5c13a41ccc20993b4ad51c81d7f6ee3b4dab16158ac7436d085b80e4a643b236a9c97edd3e915125a1466154538420
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/xcomp.tgz) = 0cf8b9a8d1489a32ba0b5a277d90e429c40650fb
+MD5 (NetBSD-6.0/ibmnws/binary/sets/xcomp.tgz) = 4ba4077ca2c0edf71813165fcf5321fb
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/xfont.tgz) = 4711fcbade0238d60b7b89cf0d7873b03d7ed1f7
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/xfont.tgz) = c29130f55f536f602253a7f92f073ebf6ba02baea09f8011530bbf7e03ae96594334f0c60b29a8bceaffc3eb8b152db47548e38a3c8a14abc5fe35bc5d1d7d93
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/xfont.tgz) = 3b01af0f8e34367988d559fe0fbb0acbbafb0b2b
+MD5 (NetBSD-6.0/ibmnws/binary/sets/xfont.tgz) = 6ba15ed12217b726d9129db8e942a048
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/xserver.tgz) = 05aac7e617e0cac05a88062fef29bb459da7a1d1
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/xserver.tgz) = 19fb5af5d6afd78839a22e5c0694a492047b5200c569cbf58c676ff32ec250b21edcfe2ed00b65092fdac374d1ab9eaaed6113c69bc03009cf458aedc6014913
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/xserver.tgz) = 774d2a1072b8d122790ad189a6d2ada2ad99e7cf
+MD5 (NetBSD-6.0/ibmnws/binary/sets/xserver.tgz) = 3daf1477cadf3593e9ba45e3703fe8a5
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/kern-GENERIC.tgz) = c9804814e9b76392c467295e0700798f7305d9ea
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/kern-GENERIC.tgz) = dbe66f41c0023cf48726763c0accca7d17146888cef03f6bcd8356f48bca2a5685e60224e3369fcf4ebc524843a9e3a2df558199a4b2b1a43cc7b22931c52c5b
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/kern-GENERIC.tgz) = e054c430a723e57798b9f13d852d6be6895a6b18
+MD5 (NetBSD-6.0/ibmnws/binary/sets/kern-GENERIC.tgz) = 9bb6d0f70b522f8bdfe0da0855fe12b2
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/base.tgz) = 150b9b1ed403c611d17b3bf258f7bf064f3f76c6
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/base.tgz) = 7c9eb4dbb9e770395ea516b27dc37c86a34d10437bfbc59bd6b55ebd9a3565e470ee7553a238e69012c7eb19f1fafe3bb94d750c642c179190566d0b97ba79f7
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/base.tgz) = 6f959eb6b88fa607c19c9ab5e0b82d172960676e
+MD5 (NetBSD-6.0/ibmnws/binary/sets/base.tgz) = 1d2ccb914175ffb1a6e90e787914e08d
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/comp.tgz) = 449a6e0ccfaa3b9105912d05d4204242bab79635
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/comp.tgz) = 5ceb6d751f429f466ae15f98244e82f32461f7f0bf546c982a1e35bcfc4c6c845a121ecf07b387189fa4173d672e0291a0d396010f5c6ab9130f3264ef26f36d
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/comp.tgz) = 6d544592799a77914a724215f8514f0d22bae2b2
+MD5 (NetBSD-6.0/ibmnws/binary/sets/comp.tgz) = 84f35afba48084d9eed192a484616382
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/etc.tgz) = 4ec9d5606ead158c85791c298c829a030aaa6acd
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/etc.tgz) = 2786ad3a1aca388352f2c4fa1da7da624d9762c4d8c7deec54441bd3ce95c79cb2ccd6fd15619a224987f9726c66d5a88b825e57b69b68aac7033ce80c96af3e
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/etc.tgz) = 25c6401fec22c9ec3f2bc6c3d33127b9222def9b
+MD5 (NetBSD-6.0/ibmnws/binary/sets/etc.tgz) = 9f83cc04c872ec0e355e2528387cdcac
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/modules.tgz) = fef0894685186ef94fc691e71a8a366fe7bb66e0
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/modules.tgz) = 0051ecab124fbe7a4a8005ae4fddc9b4be520e6be5c34cd1811f6c280e35f10d79914756f5106a840177b7cc33f39db337c3f461f00669c1838a6ac0c2204ee5
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/modules.tgz) = fce29d3683f7e0eec8e0b45c94bba924bad6b5d7
+MD5 (NetBSD-6.0/ibmnws/binary/sets/modules.tgz) = a47b110fc0e721d6849bb6fa4d3a7ab3
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/tests.tgz) = 3eb8ca45b13b0c43f1d9e10322b8b8469859ffac
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/tests.tgz) = d9d2bc61ad2f5ba8ca9bd4b53c348b01fc4f7dc7417d14fe7c6c3f68b2a0ff32221bda546b9ca26a0b998ee72a393e3231de17c94bd1e72a0bc6365dba42ea5f
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/tests.tgz) = 8348b43e8543ad7ab8ba46978930fd7bef910c6d
+MD5 (NetBSD-6.0/ibmnws/binary/sets/tests.tgz) = 5cb30f9ed33e774f3c1bc14cea070f34
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/text.tgz) = 38ca726175c32d5ef01309254f51584001f2888b
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/text.tgz) = 78102b1494c3e0d92ee40eaed00cdf6a4cd9e6d5dcfe2f523442fdce7f46d9de2e63c9ee5e0ba90fbae71509518ed2d212a0eab357f0a235ad8b4339b8f74bc6
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/text.tgz) = 9532b62eed56ed6308d0b564552a77239ddcc406
+MD5 (NetBSD-6.0/ibmnws/binary/sets/text.tgz) = 25b993723182c6c3fc4c4c7d5544a7c0
+SHA1 (NetBSD-6.0/ibmnws/binary/sets/xetc.tgz) = 6068a07bd5602c1e57dcce29ce0a58ab8d6fc63f
+SHA512 (NetBSD-6.0/ibmnws/binary/sets/xetc.tgz) = 2bc55ed596339c00a303d972145c4621db7f5781f7f4bf7bd8cd6ca634cd397f8b603c83b2f607f9a65c73cc237b16db0fa3ac30f28ed898d555224355741f4f
+RMD160 (NetBSD-6.0/ibmnws/binary/sets/xetc.tgz) = f5b7f09b378d534eb6436d76a135192dae3cae0a
+MD5 (NetBSD-6.0/ibmnws/binary/sets/xetc.tgz) = 1c3134612470159dcad9c60e9e0664d9
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-amd64-install.img.gz) = 0fb40298c03dc94850911ccf296f74b4daee6ab1
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-amd64-install.img.gz) = e0cf82777d65c1f8fa2776a154f297f8cadcca5c8ea8064adf0ac87b51f5999af8208fe284e95478d87f45d68ece4c63e82611d624514b96a9e236bfbe2aa56d
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-amd64-install.img.gz) = 0f38bf9ac003bdc7b7a73a1321af35f77e498de4
+MD5 (NetBSD-6.0/images/NetBSD-6.0-amd64-install.img.gz) = 05aa2e9948e5f613ac8942f04f5703b3
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-acorn26.iso) = 3d532f8e1c0d8c70ac0204a0e30352946d5b4cf8
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-acorn26.iso) = faac85c94da6ff71b98f6ee934aee21d972c52b4ecf1a1bd39609b31ac80956fed51442fa34e423c432fe6a2957768df5db91585c0edd385cbd4e13f067eedfe
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-acorn26.iso) = db40e23e1cd76af703d18f9e9fadfb7bad0bdbc0
+MD5 (NetBSD-6.0/images/NetBSD-6.0-acorn26.iso) = c3adc16971c37d3319e62fe83dbc6fe9
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-acorn32.iso) = 1b8406a3ddc779f865e4edca16d6e5cbb0b33728
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-acorn32.iso) = 8c15a060921d1339eb814456955753badacc1db25f84f471ae66106f78f3ebc22f017ec1ff9af71cf1c59ad9a669943210967105e2669ba9093596e6b2009020
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-acorn32.iso) = 58b72463d91d486398514eac65f3cebb2bbcb0db
+MD5 (NetBSD-6.0/images/NetBSD-6.0-acorn32.iso) = eef67583eee51a578d4f6ce69864fd25
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-alpha.iso) = ff793eb5257ba6f7c3ca97049cab973dafc70785
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-alpha.iso) = e2fcfb789c6c0bf801cb02b1a4f9d133902a9d78be3458b19e12b8050c0686cfae37d2ad4a5661ffc3cddb089e7079d0bfe5b0c7fddbc0ad7c43abc250f21db4
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-alpha.iso) = 50a4b3f98483a0ff94e2c6c4d93615069d2c4953
+MD5 (NetBSD-6.0/images/NetBSD-6.0-alpha.iso) = eacfcb881765bac2c8fc45e1650091a1
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-dreamcast.iso) = dd89f98a8bcd0d8bdc9861682227cd1e48031db3
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-dreamcast.iso) = f18e432d93110b9cafe06c1a5bb13a27b028a5a773bc9ddfc59685737b2939f4ebf30de6e8e7fc5d6bca2f16b576af48cd2aa62ebd791b28d499b008cb5f11db
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-dreamcast.iso) = 763baa9e578be882dd458c8879f42745cf6ff2f2
+MD5 (NetBSD-6.0/images/NetBSD-6.0-dreamcast.iso) = 19d1400e0b92a906c4f01cae132e5d22
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-amd64.iso) = 78d8ca5aa25eef0bdab5c794550e7c43637169a5
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-amd64.iso) = f4900e8effcb1f5b5767873976dbb231a07346f48df20f56a8441942a91ecca0b6ea1309e01ea6a67b0513e61ebe3b8501b436063676558f119735f6d35592b6
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-amd64.iso) = 76a6c030ca86c7d5abdfe91568a543d3bad04ffa
+MD5 (NetBSD-6.0/images/NetBSD-6.0-amd64.iso) = 9155899df5ebc1a69c7f13ef004677a0
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-amiga.iso) = 7a81516c832299ddcfa8b364422e82a63b3869df
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-amiga.iso) = 6695416ad0dbe2bf03bb75df8b40b04cec9179d2f60aec0b1a5e8f56ad12995911158251cb78c67d62d60324e8708c85c02b84ba0fcffd3fcf73a69aaa497b0b
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-amiga.iso) = 72c96741b1fad68368043e16d21ff533490b8275
+MD5 (NetBSD-6.0/images/NetBSD-6.0-amiga.iso) = 6b214d3da92f2d84210ac00c4eb9650b
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-arc.iso) = 09dd2c85bf2772333ec299e45dec5c016dc22d7e
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-arc.iso) = 6eaab9510f8ea92a175115377924dfb7806be38c78d12920a86e6284bc59bf0711adbb5b46809eb48fa8c299d8c9683b777ad16fe78c3e4760adc6ff605941e6
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-arc.iso) = d4f2d0301da83d93a18cce50be4a878cb5955202
+MD5 (NetBSD-6.0/images/NetBSD-6.0-arc.iso) = a4c2332dc064e7d8cbccb921af5c2022
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-atari.iso) = 9976598eb68ec6bb90329161c3ffad985e2b3c35
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-atari.iso) = ac4951dcf3f148925c19db7bc7027db69549ac90e57db25994c7de5959943476eff7eeb0c490ca7b3df4b6f7bc0604fb5515c337e776a384d5b6a8169e92bf47
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-atari.iso) = 35d389ebb1ea02751e819cd76750a1116d472b1f
+MD5 (NetBSD-6.0/images/NetBSD-6.0-atari.iso) = 44c8de8283cccb8a576242adcad878fc
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-cats.iso) = a1f0554b7193949055ee9cb35eae529893bfc8a8
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-cats.iso) = 7a38bfe0e1ff3948579dbcceed822634e3352e690911052dcf25f9b8746f457f1acb80830b6ca22637c559948eb8fb1eab8c9434225f13c000204879b9edc16c
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-cats.iso) = 2116103ecfe4c450432b7c1bad8787aaa6149a51
+MD5 (NetBSD-6.0/images/NetBSD-6.0-cats.iso) = ebcfe064bb40fc87487654d7f8ccc15a
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-cobalt.iso) = d5e6a8be8cfcef7362542c2ecbfe7e0173845061
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-cobalt.iso) = 28181b68559432a4c566bcc9f71a5ed2b00a5d7118073d114ce4085f39d2139ce50e6b843beb46a59ab4e55aab4ead1e2fb952610f633fb77ae87edb5d2c3d76
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-cobalt.iso) = ddcff88c659b8f0190e66ed2df4014395bf819e7
+MD5 (NetBSD-6.0/images/NetBSD-6.0-cobalt.iso) = 5975ccac715d36432aa101e6c1c745e4
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-emips.iso) = 0c9a09ee73ef6d90af39aca9513b539a79e7c505
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-emips.iso) = a0ec2048ab0c44ac69722b79b56308781e9f298fc3366bd628d4cfeebd8891e08091e8d86a576be50ccb12b1ae48263f86c8f0bf42d743d040a2407fb21039de
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-emips.iso) = 2d0e11edc64ceb8af1fc7239a9390868e1febfae
+MD5 (NetBSD-6.0/images/NetBSD-6.0-emips.iso) = d5dbd826114f5e530d171761462718c6
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-evbarm.iso) = 95e132f2d72a36eadf98b59d6883cac167d22887
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-evbarm.iso) = 5c3a43f9609687ac5e5f5d5f21cdc798dd75f0d89bfe3a4d46ee151f60e13a90e2059d9906efcc5831f5e7ef0c267c3615737da03cb781eeff39dcff518b4114
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-evbarm.iso) = 99c9115a98e45e96730163fde4fc90f37ef11e26
+MD5 (NetBSD-6.0/images/NetBSD-6.0-evbarm.iso) = 1bb998b53e8a82a28fdefecd4c2d559b
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mips64eb.iso) = 0ffea2aa4fb1fc1d58b87259e56080caa9fd6996
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mips64eb.iso) = 2d3a7807156a465c9b2d8ee5d23951f5415984c2bc0cd8a7e06102399ac4b89d247380542efe1148d5bf71bb945c4de005fc64df7ecf2cdc9ce63481a2f10d07
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mips64eb.iso) = 1de400a05e285d41af9eb1fcb4164932ecee0888
+MD5 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mips64eb.iso) = 62143f6b35eee23d62a01b9cd05e17bf
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mips64el.iso) = 5b0f9688d925754bd79d28226f29dc0057c634b0
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mips64el.iso) = d4dda568787efe15faa1c00b604c9c262c579ae86f4abd07dcdb796112fa9ca41122efc9c3beedf2281ab1859e11e2ede536d3a7d679a31590021acca4b32324
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mips64el.iso) = 9cb45c46d6ce9d9cabcee0f660fc1a646f849190
+MD5 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mips64el.iso) = 320f53af1cf67bf37bf6d962a49aa688
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mipseb.iso) = c9894866972a80c2ff9032d21339e3ca59c8d0dd
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mipseb.iso) = 04a89998d1cd8e70b045479265ce82b3733aa630d536c349e12b4d12e3aae123bd29cc0a7a6930fe07dc121a89e0327d14c2b78987542f064b67287268300830
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mipseb.iso) = 13cc4119e07eb9a8a26666cbf6ae983001cbf39c
+MD5 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mipseb.iso) = a5af80295a5bce15ae2cb3c585891d7e
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mipsel.iso) = 09155023a46f527048b17f00f554d64b73fb1d40
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mipsel.iso) = 21108a854d7f8ee48d18f8d1fc74886350d1d95ca2eef044f5314570619f108f471c768f93b99b917b887fca4a1d5bfb9f858929c88672faf505ccc6493eef61
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mipsel.iso) = c6c4eddd0acb7b311e6bc40a9ef7acea4c8792d9
+MD5 (NetBSD-6.0/images/NetBSD-6.0-evbmips-mipsel.iso) = 37b00a36438893f30b98de7327628d48
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-evbppc.iso) = bba761cfabb03d27837a21a61e681c0a39b82b50
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-evbppc.iso) = 615d5ba030e1d19c56aaf9152640e652c6aa3ab3609d357b859df61a874125c551ae912f01179f861bae6fa0b09cbb899e9ad689dd62ec7edcd1caec3157d5ca
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-evbppc.iso) = 4cba6606c2fc9febb684665512c89ff8106790bd
+MD5 (NetBSD-6.0/images/NetBSD-6.0-evbppc.iso) = 45b10af76ae7128c4619864237e703fc
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-evbsh3-sh3eb.iso) = 51da3d8f99c84a9e12bab81442a0249624550532
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-evbsh3-sh3eb.iso) = c804c8f1457178bffa1e5b7989a5818381f4911a8fe18a2c75ef9c02b866a9f53be17926faaa4a9460852e482d7a304a13424b8fd6b8013cae15696ebcc24bea
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-evbsh3-sh3eb.iso) = 05f04f2d8e64a4508034424bbd9f6adf795675a5
+MD5 (NetBSD-6.0/images/NetBSD-6.0-evbsh3-sh3eb.iso) = c9358e63b62edc277bb8e630627fa49d
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-evbsh3-sh3el.iso) = 89dd396a870a8d08bb1ab2a09f9e8b24bb55bb53
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-evbsh3-sh3el.iso) = d9d2018111fc190ab0602e87572e210572bebf2185df101265f29d4ac8bfed8ca671038131eefe125ffacef63924e1274c34fa248b88d01764d138144e768b2b
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-evbsh3-sh3el.iso) = ccc5e6f669147c71f9272cae12d63bb270407748
+MD5 (NetBSD-6.0/images/NetBSD-6.0-evbsh3-sh3el.iso) = d33272ecf641d0c4ced897c2fb4d0ae1
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-ews4800mips.iso) = 029c1d1910dd234ad3b33f8a53557a56779dde86
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-ews4800mips.iso) = 09e0dec1e67c44a29cea4eae8c2e7840906c8cc6881331b720905c71dfd0f8050210568d2e5ad6a325a827a08e1e440d84980cb4b515d76501616c7e3f104cf2
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-ews4800mips.iso) = bd7da2f0e68a488d351eab9cda26f11ca2ddaa35
+MD5 (NetBSD-6.0/images/NetBSD-6.0-ews4800mips.iso) = 1286a5646c2f93fc128c8fabb2244bd1
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-hp300.iso) = 3b62c2c6037a1009b5d417e6f09dfdda2781f12a
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-hp300.iso) = 2a3d668fde1b5098933d0fbd9fe9100092043a81389f6f7b457a3425dfca5cca52382a29434309baae791c908855b1aed99d32f290723172c62f439f68e4fe5d
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-hp300.iso) = 8314b4f992aff06157d9dae5951cce3d6083e6cf
+MD5 (NetBSD-6.0/images/NetBSD-6.0-hp300.iso) = 144eb416cc2563df1330cecf26c19f2c
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-hp700.iso) = d2840fa102cff8b3d5825304818c98ba2ffdcbe5
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-hp700.iso) = 322461efc0e1648c8e4e16c93421831d14937b5ca93f2a6f25405882c2de40482315ee9e4c914a2e9206cc25eade89687a2a248bc60ea1145626272067fdecba
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-hp700.iso) = 11dad584942591d9c719eab0248dba8f71ba8ec8
+MD5 (NetBSD-6.0/images/NetBSD-6.0-hp700.iso) = 93522e82b2562f1f889f74153deccf30
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-hpcarm.iso) = 5afcc737502c47e2a4efcf6a897ecbdee400d3aa
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-hpcarm.iso) = 32bd828c5ef1b50b6a9cdac2a419ef80522625bedd2bbb9f60b8076b7f9bef969af19fe28da9b56b6f552e008700b9fa586e1159706aa6eb4c998b2dcf89384f
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-hpcarm.iso) = 9a609fb57d4c4a2f8fd9aecee475eddaf7e26da7
+MD5 (NetBSD-6.0/images/NetBSD-6.0-hpcarm.iso) = 7b8bbdc89300d63043e233de6d56584b
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-hpcmips.iso) = 203b9953e02574d71e49277b847dfd4b253199cb
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-hpcmips.iso) = 72a2e1eb4f9398c3779a64226c8e442e9628edcc0601b9e0c835af9e2ac31d77217b731c831d8d9bbb2c9322ef28b61194281beb0074e39aaa747610fa065ca1
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-hpcmips.iso) = b384e1bd9b5e0644e1d98f68270a82b47e1e0103
+MD5 (NetBSD-6.0/images/NetBSD-6.0-hpcmips.iso) = fc5caa7af29622771e2451debd59f75a
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-hpcsh.iso) = 1b3ad4689058b56f012dcdf2ec78d046c7469d0c
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-hpcsh.iso) = f2d4686d5560a5ebadbd0f235033bb18db4b291ac9080635e67a8b42328108f0944c69e81ff9daaf28820f0ee98d32c0faba0ba3d397053670f4b2312ba7fdf2
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-hpcsh.iso) = a39e04b9cdcfb2d21fe9ee262756b05f122893b7
+MD5 (NetBSD-6.0/images/NetBSD-6.0-hpcsh.iso) = ca44003562262d681f9eb5e6e3c1f25f
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-i386-install.img.gz) = 43e6d3f9d0ae352b8eaec597e3ab48590a8dd62c
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-i386-install.img.gz) = 2911ec984eb0b74ffc89dea948d2f0ec6570cf0a13790be8ce31bfe7d90cbcf132d9b7fa27bc3202d16426cf15c192c3543db7d108455f375aebd291e5162827
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-i386-install.img.gz) = 7da2b6c329c7e19a96d7473bed4fed2847a9e7dd
+MD5 (NetBSD-6.0/images/NetBSD-6.0-i386-install.img.gz) = 9db5437e777175f3d9fee3370070cca1
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-i386.iso) = ccc8c4d50aaa0e43724df3b3c3afa0e130164053
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-i386.iso) = e71e4dc1ab41720e04f34ae8f5daccd5441f58efe983683574578b4f6c3019b53060e25e4e4880792f3012e47acfeb7eb0f571d01910435db6a4ac541ede8fef
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-i386.iso) = 4aefd7279ff09f228506f66ac5e91195c081e31c
+MD5 (NetBSD-6.0/images/NetBSD-6.0-i386.iso) = 9b7aca4464fdd5dbeea6d6d85c5ba64f
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-ibmnws.iso) = 766ffac66f62d90b017d02b9f571b27ee002eb30
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-ibmnws.iso) = ba2e04ac3173b765d98a72796f643f2c7fe2fbc9eae9f7a85402e65d731c3a089df5a685ad98603e6e44c72956507bd77939d855f4820bcf0aaa1e705be68ec4
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-ibmnws.iso) = f6c480b79e05eb34818b5f018750c4dbfceb7b38
+MD5 (NetBSD-6.0/images/NetBSD-6.0-ibmnws.iso) = 8cbc5b4e8fd0cd9d6cbf6d77f1285f3f
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-luna68k.iso) = fb688537b94273c74c52027a5bd0e9f0f1d96381
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-luna68k.iso) = 62911e352841866cdadd4f9ebf909cfe496a03ac4f4452f83ed7a96890448a527a0afc3ab199bcc13a12760bbf287b5b367b96ac340d148d522e759db20a7c5c
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-luna68k.iso) = ad5c1f6747d72a83816e13c37eb97cc4b6b0bbfb
+MD5 (NetBSD-6.0/images/NetBSD-6.0-luna68k.iso) = 5373e0ffd08922c1e8e5a1f66908d2b7
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-mac68k.iso) = 2216006dda929d7b66bb2c92549378362f772b52
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-mac68k.iso) = 26d539ab284db402e00b48bddcdd726e7869bd28f717771d45cb6e5934fb069ec98f789a2baab8b7fd76aa35db5f9992f58094b9e3e936c83901e277a4bbe6b8
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-mac68k.iso) = b8cf8d1c1ccbb739ce29c01896a4aa55ad66469c
+MD5 (NetBSD-6.0/images/NetBSD-6.0-mac68k.iso) = 4e06fdc52d82cc401d3b02c4d0232733
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-macppc.iso) = a8697c11dbd8b3811f1fcc8562a9d11a35f4431b
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-macppc.iso) = ba31ab8d00ac0038dc6509661eb39b41d7cafc268b17e9ff75809aac3fc4978fe338b2ee4c2ff59991ae93c11c32cfe019e7309fc507562f9c276172e63492e4
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-macppc.iso) = 36f6b8b12eba9cb39f412ce2cba71ab88a4445fe
+MD5 (NetBSD-6.0/images/NetBSD-6.0-macppc.iso) = ca246495fb1465b57eb93c826063a20d
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-mipsco.iso) = 5f3a351f960e81c829d7bb8f6924b0b912006c05
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-mipsco.iso) = e04111c293c6a3a6df5433aaa8d7883c7f88bf03c868ddccb05ae7c243d9a880e54329d4d995cc5bfc6539fdb7120207463f54c3a4a5c0a317bd12173e0fac18
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-mipsco.iso) = 85552cf47b7eab35619385444e0d76ce8c6ed887
+MD5 (NetBSD-6.0/images/NetBSD-6.0-mipsco.iso) = 7e684c533513710039e0fa96ba70b51c
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-mvme68k.iso) = 48ed08c58863636dcf49ad5728812def96cf82eb
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-mvme68k.iso) = ded376941ef8437fcf37f7ca801f4e9996b4adcd97d9ccc7a16d30c8045880d4e7a894ab5cd44000bb3895950c007669207bfd58bdbde3a11b2a123e5b747c47
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-mvme68k.iso) = cfb7ee4fc9422ebf6dc0c7d73b59dc2b161d58ef
+MD5 (NetBSD-6.0/images/NetBSD-6.0-mvme68k.iso) = 9ee62757053b2cb7f7a1d6ab82db929d
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-mvmeppc.iso) = 5b74dd3e1d76f697d089ad1a769ef8aba17330ba
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-mvmeppc.iso) = a007559063e269c4f27597f27c3bf6dda97f34a33d7e750c2a6fb36bacc0a64b12a0011b0570ae71b5977735de5f1d58de553e5a89ea4f61b6c09fc34e3989ea
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-mvmeppc.iso) = 9d26c663310b2555b8dc544e9b286a7ab80e8bd3
+MD5 (NetBSD-6.0/images/NetBSD-6.0-mvmeppc.iso) = 3c8ab738e662b3b7f1b481a4712c4525
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-news68k.iso) = b40de418e4f4140f31895100674dc69e1b3c2f80
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-news68k.iso) = bfca4085850abfe577482870397af0c964574cb7b426903c5634a747026e1db835fe6db0dde4d8a320438b1f136dc7aa2dd0bd1e05d664c92ddd307b3ad718e9
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-news68k.iso) = 00df7a8b50bb5b4f45b56107db94a559b1571458
+MD5 (NetBSD-6.0/images/NetBSD-6.0-news68k.iso) = a9a9524f9d696a5104d2b9f157f8a416
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-newsmips.iso) = 91c6ba0265d2ab04f60358dbf8fcb388c81e674f
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-newsmips.iso) = 182904027a2e24e0869e0c177915c2d99be87ea8994298f7106940bfde95feacb1ab07e17f0535adaea35d63eb6ec014378bb2777b0a3dc4e15f362038050460
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-newsmips.iso) = 93bedba32f25a7d6f658e396de5b7eb98ec7654a
+MD5 (NetBSD-6.0/images/NetBSD-6.0-newsmips.iso) = c6a0377dfb49f663d7bf657589a68c48
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-ofppc.iso) = 1b0927effa1f68779ec787536f67447574f50674
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-ofppc.iso) = 7cfa755bab97c165f5ed60063d4fde79d90fa4a786cf13d32617f324759719175b909806aac34df32b39a5a443348f020787bce43f4d7600ba9bc65ec00e111a
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-ofppc.iso) = aab50e82812ffe6b4216d9c9a44787d9f0f667b8
+MD5 (NetBSD-6.0/images/NetBSD-6.0-ofppc.iso) = 97772de08fb8020d661192e622e3cf21
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-pmax.iso) = 5293cfe1a34eced76bd825d7eeef7ee55af98299
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-pmax.iso) = 681eb46ded55a111f6ac2f5baa9ebe4f3f6c252ecd20270377b466305402a97f6be47db192e5a05920a17ecbf03c03bb169161bcb75b4813af5a2e10b1becd53
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-pmax.iso) = b61b7ee3525e26f990f4276d689d23469b4639a1
+MD5 (NetBSD-6.0/images/NetBSD-6.0-pmax.iso) = 4211afdc8ed6225b395f65a089347ebb
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-prep.iso) = e1702b470594f9b5955bba78d9179eec12176e9d
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-prep.iso) = 552a43f2a255b844a0a39db0e352dcf04b7df73cbe6eb4851a2bbfd1f5bcdf12d4742ef9f596052fd678ff4adae4c92a1eda71acccaa53c8bf310cf5900dbaa2
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-prep.iso) = 382ff5006df921cb66fc8ab2bf78544c1dc501ae
+MD5 (NetBSD-6.0/images/NetBSD-6.0-prep.iso) = 2cacc13c35c1e406dfe0aec549f97eee
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-sandpoint.iso) = 6d866b095f838011b6132d443b602d4b97a644e0
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-sandpoint.iso) = 6e6a0eaa9de07b142c43a749bc6257a410f9c7f801c450cfec17fa30c0f7b0f5a925d1c73705a4d2d567451fe5c88304c6e85c4f1ba1c0127b07f9bd0ed452c5
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-sandpoint.iso) = a2d052a86ed3bc1a751de334b737cdd1e1661f8b
+MD5 (NetBSD-6.0/images/NetBSD-6.0-sandpoint.iso) = 8a137ad061aba60a2bcffa8b9c9fa370
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-sgimips.iso) = eee6aecc9d478d101b20756b5438e858d43f2700
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-sgimips.iso) = 3979fa422cd562e6dcfa83eefc072d66380ce1ec10f5534c394c08bebcc977d58d5c27f0f41efe1555570be9eb93e33143df0c1fb1cec47b29f3f8961853132e
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-sgimips.iso) = b20388701c9428de38cf7cd5afa7464bb0d5a07c
+MD5 (NetBSD-6.0/images/NetBSD-6.0-sgimips.iso) = 73c4e4f6723ef82859be32abb34b9367
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-shark.iso) = d331eaa8be85d8a112c277ac018d9d0cc88d8b39
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-shark.iso) = 91aacdd54e4ae41cbf71d4a91533bf66ef9dacaf7d71ffa81f0fabec5e98f3f5685f62b75ceac6db51a3da160a4c3e92fe3a5469165fa92c23d76d4e9aebe9a2
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-shark.iso) = 88a248ed7456f4c08fa9581026c555df29c05daf
+MD5 (NetBSD-6.0/images/NetBSD-6.0-shark.iso) = ea424a950e7168c79a2b80152504fe61
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-source.iso) = 09749966ddaadad296254adec70d4f4c01f20fdf
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-source.iso) = d45abaf7551b96232228024a7f08d19943a8912a2383c456a66aff8bde1dc4ec60a3dc084ea4801c6c4691d714e257672f87436d7070a939fbf0fb5b2119854e
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-source.iso) = 002f87e50d6113c7a2820a4888b8484c1848bfa7
+MD5 (NetBSD-6.0/images/NetBSD-6.0-source.iso) = 4d63a05600813e5588720da5328967ac
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-sparc.iso) = c60cdabd739d287e3424f8a6e2b671b7b41a944a
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-sparc.iso) = 1dd5305519efa2c90341088e26b66b38426ce5e42a066277605abaa0e85322a9af2031ada8faf1e303e7f10f8b29e8765673de14a5a04c4e5f2f6001b7c52241
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-sparc.iso) = ba9dc6b22a648f9b0af3c44eed518401b20e50ab
+MD5 (NetBSD-6.0/images/NetBSD-6.0-sparc.iso) = ec7578864447eb816413264ad512b017
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-sparc64.iso) = a6a5475eeb3e88d520a5bbed7d62f0067c5fe65d
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-sparc64.iso) = 50f36f089ee8c27190512d16ec50661db4136c257c947439d670893fe610a9b07d577a7ab8b9f4d9cd6766e9daa8b619aa3a0f6f95e3abe43a4955dbf9d2d401
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-sparc64.iso) = b8dd4236c01dbe061cc0e0e20e71b805aee8b998
+MD5 (NetBSD-6.0/images/NetBSD-6.0-sparc64.iso) = dd2dd0625585e969262fd0c99751c64e
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-sun2.iso) = 1c0755c7c8a094769b4c1b50566fa05e4848e113
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-sun2.iso) = d37ddcca3ac60bba6e8547c8bdd2029d5ee39517eff1b90534dd02eacb5e5e36b3be9a06b86386d451ee89c2408c151fb55f0427d3ba682b4076dc3f5c8925a8
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-sun2.iso) = 4a20723c243cd7dd43c8eb4272971072d21a2efc
+MD5 (NetBSD-6.0/images/NetBSD-6.0-sun2.iso) = c2f9f999646eef2bcf2c9bdb6d2e860d
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-sun3.iso) = db35e360979a3c38984afb91309387fa9a415bf0
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-sun3.iso) = c4a8fde6c486ee8b23a485d6b2947a1620a2f7582df13a255dc8f6fd2860dd93b0e1c2dc3b56387adad49b935999c70cdb293f25f87c2f227af35e158fe6a7b5
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-sun3.iso) = 0ff6f3798f945c797b2ccae534cbece05e3a4d34
+MD5 (NetBSD-6.0/images/NetBSD-6.0-sun3.iso) = 042f8191d0aa3b4ee986408c1bcce04a
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-vax.iso) = 8f43de5ed15d0178faa9b79763c7564d479711c8
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-vax.iso) = afa099641b4684f021c3a94f3a8624c3aad92a8083555ad3bf78028fcb530d08b9b778d96635bbe098c88e6e08be2733d01c4dfca8933d4120e7571dbc715a88
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-vax.iso) = 09800ce94b2007f7c51850e9db87270e0123e9f7
+MD5 (NetBSD-6.0/images/NetBSD-6.0-vax.iso) = 0830c9dc45aa84e08cf97580708cc60e
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-x68k.iso) = 022558b77ecb7c5b6a35aa0e79c6aaab56031d16
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-x68k.iso) = 0cf2986fa2477df206a46bc19f566c6cbe8712ad14fbf40d9d4c20aa104a65eaeb93d73c86ac101125d0c5b5619f53a7296d032f56c15930baf496853b604902
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-x68k.iso) = 5becbb0b0c10a69dfaf131910da0c72a208beeb3
+MD5 (NetBSD-6.0/images/NetBSD-6.0-x68k.iso) = 6f7c0d6afb962d18f61cfafc78f38b12
+SHA1 (NetBSD-6.0/images/NetBSD-6.0-zaurus.iso) = 5c78cce50c6f26c64456228695ff51b12b8cd44f
+SHA512 (NetBSD-6.0/images/NetBSD-6.0-zaurus.iso) = 8a0849c505a0db1ed89fb066f6814f32e9998017cfd684ac38b9027d94ba4a2ebec496ba1ee194e0f98d176820077ea50c5a45cb85b6f24a1d1a2b14e9a0dd1a
+RMD160 (NetBSD-6.0/images/NetBSD-6.0-zaurus.iso) = f505c50d0049b053abd5fce076e0e67dcd13c2aa
+MD5 (NetBSD-6.0/images/NetBSD-6.0-zaurus.iso) = 5e3a023090f8b8df40a7372dc1749b81
+SHA1 (NetBSD-6.0/iyonix/binary/kernel/netbsd-GENERIC.gz) = 235873272a098d18934590d26ab5c636859262ad
+SHA512 (NetBSD-6.0/iyonix/binary/kernel/netbsd-GENERIC.gz) = 0a4f296210a18785815dc51d191c97aa069403e2e0460038f6dc59a65a97f39d9345abf0e793a12dc562068a7eb0d825881030969ea43a48775704958700ee86
+RMD160 (NetBSD-6.0/iyonix/binary/kernel/netbsd-GENERIC.gz) = 1c5a2e39c1876ee7b46a9ee9751da1d418c2a607
+MD5 (NetBSD-6.0/iyonix/binary/kernel/netbsd-GENERIC.gz) = 5f2302d30d7dcfa644d62c656eeb33e3
+SHA1 (NetBSD-6.0/iyonix/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/iyonix/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/iyonix/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/iyonix/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/iyonix/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/iyonix/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/iyonix/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/iyonix/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/iyonix/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/iyonix/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/iyonix/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/iyonix/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/iyonix/binary/sets/xbase.tgz) = 875fd641f969ec00f854ca1334d084947450c740
+SHA512 (NetBSD-6.0/iyonix/binary/sets/xbase.tgz) = 75d0c9e9685b6b7bb706df7427c8b52f59c4fc4d0e725b02ee18024f75a546dc41de5f1a5d8552a8d2c84bdf87856e5857b0f12914801ca7b36b69536d617b4e
+RMD160 (NetBSD-6.0/iyonix/binary/sets/xbase.tgz) = 1a4d099d59b2bd882e99f1b2df1c7bf22b890d48
+MD5 (NetBSD-6.0/iyonix/binary/sets/xbase.tgz) = 5eb9c573c5a0c96701f268a3470a58b9
+SHA1 (NetBSD-6.0/iyonix/binary/sets/xcomp.tgz) = 8d7469a85b7433c89690cce74e6b3f4e66cf0647
+SHA512 (NetBSD-6.0/iyonix/binary/sets/xcomp.tgz) = 411304cf66e300a7f162128203099bb4d6eebc4a93ba18ed7caf79f30b31cc7ffcede85c4e1bad02c3f5f8a27d009fb71f3ce5862c1d8aa477f39a25c535fdaa
+RMD160 (NetBSD-6.0/iyonix/binary/sets/xcomp.tgz) = 822d26e0ee08b72ca8b991f0709a8c1bf0399208
+MD5 (NetBSD-6.0/iyonix/binary/sets/xcomp.tgz) = 5af361f0334d28119d703064278b3ed3
+SHA1 (NetBSD-6.0/iyonix/binary/sets/xetc.tgz) = 222d14c205f1018cc5a86eb03214d18cda2abb82
+SHA512 (NetBSD-6.0/iyonix/binary/sets/xetc.tgz) = fb82261996aa772fd8a9022eadebf899ee04ee70229ee4fe07758ca14937bdb34752c8218eb4c5b722b6208f719891493bbc141372fcfa503de83e0a61aa7387
+RMD160 (NetBSD-6.0/iyonix/binary/sets/xetc.tgz) = 511ebfe5076f361b7f7ca03a265d16052a16d259
+MD5 (NetBSD-6.0/iyonix/binary/sets/xetc.tgz) = 165cffbb6d2c79663198d80c82afac1e
+SHA1 (NetBSD-6.0/iyonix/binary/sets/xfont.tgz) = ce0e141beeffeb5b470478e9887e4127da85de3c
+SHA512 (NetBSD-6.0/iyonix/binary/sets/xfont.tgz) = 5d98354ff77103793d56af3192ab5f9afcde62208791976064ac33a149f994e0227dd5dd28ed544eeac5ea504e5212d5fb9e7d05e59e5a48a2fe4062e34e3106
+RMD160 (NetBSD-6.0/iyonix/binary/sets/xfont.tgz) = 4d09f5e82fec875ef0ea328809465e7a98f2ebfc
+MD5 (NetBSD-6.0/iyonix/binary/sets/xfont.tgz) = be26b3890261302420b09976a1d38144
+SHA1 (NetBSD-6.0/iyonix/binary/sets/xserver.tgz) = 4ccfef1d49179603286042088bec0218c6b2031d
+SHA512 (NetBSD-6.0/iyonix/binary/sets/xserver.tgz) = 809fc0a9065c1b9e7cd17aeb0d41cfd3158efd6c585556af01c4a3c93f0df3646a2ff77c6994449a703a408c0988fc1aa68cf34c7e297a3056d73ded57034c12
+RMD160 (NetBSD-6.0/iyonix/binary/sets/xserver.tgz) = 403604404261764c74f10fab774c4653fd20cc9b
+MD5 (NetBSD-6.0/iyonix/binary/sets/xserver.tgz) = 914f909b6878cef16a92765a8cbb52ca
+SHA1 (NetBSD-6.0/iyonix/binary/sets/kern-GENERIC.tgz) = 13354b2863a67ec38b91a8b8cab2ae5081cf68cf
+SHA512 (NetBSD-6.0/iyonix/binary/sets/kern-GENERIC.tgz) = 02ad11423d70de2c4b1e937bfdb6348af4025c026513f4f05768f2344997a4414896f10b72af056410dcc62d8760449c2dd47ff2bd37d0e4011d45a1fe0e98b1
+RMD160 (NetBSD-6.0/iyonix/binary/sets/kern-GENERIC.tgz) = 4a98f89230f9faaf839d5b607097d7612aa6741e
+MD5 (NetBSD-6.0/iyonix/binary/sets/kern-GENERIC.tgz) = ecfbf309ba59a5ed39e46ed54b8173e4
+SHA1 (NetBSD-6.0/iyonix/binary/sets/base.tgz) = 697554f5182bff135cb94ba8c99b29d719aeefc1
+SHA512 (NetBSD-6.0/iyonix/binary/sets/base.tgz) = 52b73ea3de1d96f706a48b02e7cc6234576d5bad72828ef34e61929c460ea839f6051e3a650880307a86757f35265c2a33780bbe4640d301f70a4ebae06c7e8b
+RMD160 (NetBSD-6.0/iyonix/binary/sets/base.tgz) = 7e7a5a24095a326e8998ba95c291c5380a89600f
+MD5 (NetBSD-6.0/iyonix/binary/sets/base.tgz) = 74682becd88ad5b73b5434940f1e8436
+SHA1 (NetBSD-6.0/iyonix/binary/sets/comp.tgz) = ab05d7d706899d1a555b6ec101f6d13d7f13ad97
+SHA512 (NetBSD-6.0/iyonix/binary/sets/comp.tgz) = 246d589d8d3c37375496ddd3e15da6a5bb101bc1405c13ba2751818555eaad37c403e27437326bac2ff3c20763c95a49df0bfdb324faf3110c7ec01d7676b78e
+RMD160 (NetBSD-6.0/iyonix/binary/sets/comp.tgz) = a5835f803a5c74d6484e7171085460b803705e22
+MD5 (NetBSD-6.0/iyonix/binary/sets/comp.tgz) = 53c3ef4ec81bc6b1f89e15081ad4bb48
+SHA1 (NetBSD-6.0/iyonix/binary/sets/etc.tgz) = 7294ce630333a9bea7392c5083118cc68bcb5732
+SHA512 (NetBSD-6.0/iyonix/binary/sets/etc.tgz) = f1699017e37109605eecfb44174327a974f1a7a741e16f67f387170ddd1b2c661c58bd9b6dc0795153e828ef52d16cc45b37743cb86be98623da38736938061b
+RMD160 (NetBSD-6.0/iyonix/binary/sets/etc.tgz) = 1a9cdec0a39de8c3d0b2ec63b7c674bd597e67e0
+MD5 (NetBSD-6.0/iyonix/binary/sets/etc.tgz) = d655e4ef20778005efe66b02cdd5f471
+SHA1 (NetBSD-6.0/iyonix/binary/sets/modules.tgz) = 2689f2acb9a977df7801394cd49f6f84d93fab8a
+SHA512 (NetBSD-6.0/iyonix/binary/sets/modules.tgz) = 853553a5ae0acde4b24a80372c1fa71777ede655a76c60f1d2bc835df50fc2ff03270a5edca72c492fe07a3208a8680a10277b83fab4e7a3f064ded4c91cd151
+RMD160 (NetBSD-6.0/iyonix/binary/sets/modules.tgz) = 4d2d0ba3492b751accda0a03daef7cba859f223f
+MD5 (NetBSD-6.0/iyonix/binary/sets/modules.tgz) = 129dd8d6331eacc63934568b1467edc9
+SHA1 (NetBSD-6.0/iyonix/binary/sets/tests.tgz) = b54fb7a814d7bebe4a40a00c17253d0bc6ca4544
+SHA512 (NetBSD-6.0/iyonix/binary/sets/tests.tgz) = c99e6c4b80fc2d6a0f236f324f844a562db128876a5b89ced62097a732b273fb6d9af8fde55f3e949768882cb31fab2918cd731f1259b67a1b2548030417c2de
+RMD160 (NetBSD-6.0/iyonix/binary/sets/tests.tgz) = 61ee29ddcfd0268fb7ef37829aeb75e3152b76d8
+MD5 (NetBSD-6.0/iyonix/binary/sets/tests.tgz) = ce8b49fc2bfd31965b5b989de17d5cd1
+SHA1 (NetBSD-6.0/iyonix/binary/sets/text.tgz) = 6f119b3eb99d94a4aa41b5bde28856b3daa83d84
+SHA512 (NetBSD-6.0/iyonix/binary/sets/text.tgz) = 03a29fcc5ba8ce7d6ab590d61bc0a3f4dbb9bbce89d4e8cefc00cf398fa92e2363f3e3fa5da4cc17d3bd9195434c5a951550c6091b1168614a6a0b2831f3f881
+RMD160 (NetBSD-6.0/iyonix/binary/sets/text.tgz) = 2a1331121dc41105accbf9b491bcd4aaa3589907
+MD5 (NetBSD-6.0/iyonix/binary/sets/text.tgz) = 9bd5612ff2228f1bfee64c0f6a872fe4
+SHA1 (NetBSD-6.0/landisk/binary/kernel/netbsd-INSTALL.symbols.gz) = d9440af1a917beaff6598eec266db86853625b08
+SHA512 (NetBSD-6.0/landisk/binary/kernel/netbsd-INSTALL.symbols.gz) = 982b13dc871a9e562e191ff6d156f202cef18174b66e18adac8e77037fd4edbd29848dfbfec15f94744375b7967bdbd0c5bac0414eac22b78c5ea1fae91f0ed6
+RMD160 (NetBSD-6.0/landisk/binary/kernel/netbsd-INSTALL.symbols.gz) = 6320116f0640f069a52a4c52196ba45a306b594f
+MD5 (NetBSD-6.0/landisk/binary/kernel/netbsd-INSTALL.symbols.gz) = b6d766477c4b69e1e3003d68a28d742a
+SHA1 (NetBSD-6.0/landisk/binary/kernel/netbsd-GENERIC.gz) = 2f1a4b4a1b4b88ab919ce3addcf2310da10c1c12
+SHA512 (NetBSD-6.0/landisk/binary/kernel/netbsd-GENERIC.gz) = 21fe1b84d9c5c85f3c9d963ce9497d6b8250a3c5789dcf387612089aea424a728503c9adc5e047d8887959be84a8cbbdf397b7f2685fbef2d0fab448238279fb
+RMD160 (NetBSD-6.0/landisk/binary/kernel/netbsd-GENERIC.gz) = e35fb6d1b917230c4b622ea52276a47e2a711d33
+MD5 (NetBSD-6.0/landisk/binary/kernel/netbsd-GENERIC.gz) = b6c0c1333ca3b1a45d3a828f7d18d918
+SHA1 (NetBSD-6.0/landisk/binary/kernel/netbsd-INSTALL.gz) = 3348d95ce13a6217331a1992064194aec1775db4
+SHA512 (NetBSD-6.0/landisk/binary/kernel/netbsd-INSTALL.gz) = bfa4fa3ab82db17aef5f5b4b818cb8fb5d9101d6709752bd88231042ce3c2c731a452a1360fdcd77d8eb3c0cd7368de7aa359b65b7d35d4f78d8182670de4a72
+RMD160 (NetBSD-6.0/landisk/binary/kernel/netbsd-INSTALL.gz) = 95d2efee62025110beb81c829712563b4495633b
+MD5 (NetBSD-6.0/landisk/binary/kernel/netbsd-INSTALL.gz) = 143697e4aa570e39175812011fca30f1
+SHA1 (NetBSD-6.0/landisk/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/landisk/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/landisk/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/landisk/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/landisk/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/landisk/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/landisk/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/landisk/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/landisk/binary/sets/kern-GENERIC.tgz) = 4ed0c44b9ce3362aa10429a75e3dcd4a01963055
+SHA512 (NetBSD-6.0/landisk/binary/sets/kern-GENERIC.tgz) = 1764a9d7ef8a4fc9cc321cecd486f767096a6bc34eb83b3bf3fd24c0383a3df139200560a7846d23bebdc4e02feffe7252a26689b2971964b9240a26abf4acd7
+RMD160 (NetBSD-6.0/landisk/binary/sets/kern-GENERIC.tgz) = 75e8fa6b9c66cec999c28d9242379df0142d0bdc
+MD5 (NetBSD-6.0/landisk/binary/sets/kern-GENERIC.tgz) = 7226e2efa45822998b444dfbce3affe8
+SHA1 (NetBSD-6.0/landisk/binary/sets/base.tgz) = 7cef6d1878fea6a5448eb32456056155477dbb47
+SHA512 (NetBSD-6.0/landisk/binary/sets/base.tgz) = fd16dca9619d1e1a3770486594935e091bc7219b24db8bf91ec0cc8b064f2a201d13dca61b50885e1a2428512bbf510ea7f69a9b8174ac82f511f66c6a8cb70b
+RMD160 (NetBSD-6.0/landisk/binary/sets/base.tgz) = 97e06530ed9a98f0d48746c33db25e2ee0460360
+MD5 (NetBSD-6.0/landisk/binary/sets/base.tgz) = d0e0468ef015bcada5e688057a53efc2
+SHA1 (NetBSD-6.0/landisk/binary/sets/comp.tgz) = fb19c5e935ea83f6c5679796cc9527fa3e435508
+SHA512 (NetBSD-6.0/landisk/binary/sets/comp.tgz) = 0636a207ee4126ef209fee7b5fdbee6eea677cd8b640798aeab5138803fbe8754de69aeff925e3298783409009e6cf8658f9983a213425d397e90f76a93e3f7e
+RMD160 (NetBSD-6.0/landisk/binary/sets/comp.tgz) = 0f4190b6173c8618f7609ba726e73cb041ac75e6
+MD5 (NetBSD-6.0/landisk/binary/sets/comp.tgz) = 7317e108ba56869a21b9d7137605eaf5
+SHA1 (NetBSD-6.0/landisk/binary/sets/etc.tgz) = 25f6f82b594c5d383d45e6c7ee3e0720afe0cb32
+SHA512 (NetBSD-6.0/landisk/binary/sets/etc.tgz) = f2f77e86753a1193cc4c37372a303a88e6c51fd0d3d2e6ffa1927a697aab915c9fd5f1f7ac81137e9182388a6a60912b0b2d6d6975abe0029cf9206367b7454d
+RMD160 (NetBSD-6.0/landisk/binary/sets/etc.tgz) = a5db723013194035deb0e61dc04f6985fcc4a51f
+MD5 (NetBSD-6.0/landisk/binary/sets/etc.tgz) = 92d41bd9cd00823be1afb0d3846e10e2
+SHA1 (NetBSD-6.0/landisk/binary/sets/games.tgz) = 65ef265cc562c21af9cea790c1eb0f7d1ee4ac50
+SHA512 (NetBSD-6.0/landisk/binary/sets/games.tgz) = f55cb863e6bd20e52f04d643199317ffeb673d8ad7a1b1506ccb6d798d6b511766d8188b1a567ab148ad38ab8dfb4516eb624044827880a0c1f289631e9d7f88
+RMD160 (NetBSD-6.0/landisk/binary/sets/games.tgz) = 9a0cfcc234841f9b3086c8e6479686a9e486fe27
+MD5 (NetBSD-6.0/landisk/binary/sets/games.tgz) = 9f57cb59ad62f29327c1f1daf6d8e130
+SHA1 (NetBSD-6.0/landisk/binary/sets/modules.tgz) = 0755c390f758947aaa8fa5942c3600a9c1da0155
+SHA512 (NetBSD-6.0/landisk/binary/sets/modules.tgz) = d20bbd1969460b825f413f06e28280bfc549d74e82287ec6f8b7eb70db2dc8680fcb5f1b42e96e48feda3c377eda9ef4890bcb03aeb2401dc45cc79353826a5a
+RMD160 (NetBSD-6.0/landisk/binary/sets/modules.tgz) = b43dea943dd41ece88282f1a858926afba42f061
+MD5 (NetBSD-6.0/landisk/binary/sets/modules.tgz) = 77fe2185916c4e1df174079291a33e61
+SHA1 (NetBSD-6.0/landisk/binary/sets/tests.tgz) = d5cafffe5049a81843f684c81ff1909669e6e8a4
+SHA512 (NetBSD-6.0/landisk/binary/sets/tests.tgz) = b01eccf78b1fac7ca92a10e6440a80ccccbcbc90dcafc44692d149a0b719c9058de6e1a28207f06fa7db29403552df527c200a27ffda708cf49ae2f2c7033886
+RMD160 (NetBSD-6.0/landisk/binary/sets/tests.tgz) = 0a2d702412e9add961586f2cd87eb2895889cdef
+MD5 (NetBSD-6.0/landisk/binary/sets/tests.tgz) = 7fa1f86aabba0e9ff906164c5046418f
+SHA1 (NetBSD-6.0/landisk/binary/sets/text.tgz) = 753e3063d3a42b43208bfb9ee44cadfbf777b02b
+SHA512 (NetBSD-6.0/landisk/binary/sets/text.tgz) = 63c337c80b7fb440d813803b06c0b34d1a484c1e5a18f1bcf6fe90f3880bde3269c8ed7fb0485405bd9ba618069fbe680163be2b4c53c6d81ff8e263777fd51c
+RMD160 (NetBSD-6.0/landisk/binary/sets/text.tgz) = 83afeda6e537627561023c5570ca05aaa2d3027c
+MD5 (NetBSD-6.0/landisk/binary/sets/text.tgz) = fae31d47dbe89c926a95c602012bcd36
+SHA1 (NetBSD-6.0/landisk/binary/sets/xbase.tgz) = 240739fa38b2f6bf5ff63504fc02b5e006d404fa
+SHA512 (NetBSD-6.0/landisk/binary/sets/xbase.tgz) = 93ace6b1ec640cb33e586a2e3b4b53c46b34efa1c3cb40ac7bde2531a6b253a42fa92564ba203f7f5b725b9673017766ba5a7636ac32e6722a3787559be916be
+RMD160 (NetBSD-6.0/landisk/binary/sets/xbase.tgz) = e76eddb131991fd9641a77469b782e1672370644
+MD5 (NetBSD-6.0/landisk/binary/sets/xbase.tgz) = f0502dec4137d4ba757447285b98f09e
+SHA1 (NetBSD-6.0/landisk/binary/sets/xcomp.tgz) = 06e8daf72bf753e226e3d5df7b47ef8344470c27
+SHA512 (NetBSD-6.0/landisk/binary/sets/xcomp.tgz) = 101b0c365ad2209e8b4520f586a9cd60595b0dfa414c061cf24cfbf18a9455ab6a786f968d3a5eb5f06db57cd9cde4262d5031aaf6d5cdde152ac92c91a31c09
+RMD160 (NetBSD-6.0/landisk/binary/sets/xcomp.tgz) = 3bfd31356e625cbb25f035db41d44d3a4523fb25
+MD5 (NetBSD-6.0/landisk/binary/sets/xcomp.tgz) = 2d4a2c3e4a93d2b1e56e7641bfa730d9
+SHA1 (NetBSD-6.0/landisk/binary/sets/xetc.tgz) = 06a24e45e73bf98cb87b951fe3bfe4a81a1d0793
+SHA512 (NetBSD-6.0/landisk/binary/sets/xetc.tgz) = 72d35ff20eec9cb6674031e31c382ff63fea51f6cb10290a540cb83de5639145faff66119fe7f176ba97bb389b9edf4aae3838f008df9f1b111699fb8555f4ee
+RMD160 (NetBSD-6.0/landisk/binary/sets/xetc.tgz) = e63035911479f2a87f20fe5f030ef31b3bee1878
+MD5 (NetBSD-6.0/landisk/binary/sets/xetc.tgz) = 309875d5ca3be7fb66f2ec0ab6e2e18b
+SHA1 (NetBSD-6.0/landisk/binary/sets/xfont.tgz) = 06922d4fa8af9ec61283885a5040552442f1a0dd
+SHA512 (NetBSD-6.0/landisk/binary/sets/xfont.tgz) = 48790c97453934379e37f2826498b64480554cad16ee807d44e83eed4c53b324659df0cc8aa954ec6f5f5a16ae03209a0c03dcf45db3bd807011d6d16d66654a
+RMD160 (NetBSD-6.0/landisk/binary/sets/xfont.tgz) = 5f1a4142f95c2fbf064d94e11afb0660d17c384f
+MD5 (NetBSD-6.0/landisk/binary/sets/xfont.tgz) = 0a8a39b6c5e1ae9be657196b82c16717
+SHA1 (NetBSD-6.0/landisk/binary/sets/xserver.tgz) = fc311910c92490d19bb81ff540f65370a01cfa9d
+SHA512 (NetBSD-6.0/landisk/binary/sets/xserver.tgz) = 8f8f392ab9696e20149e94dc85061be26982179e63fbfaac269dcb13509d4e9ec44c8188b6f333cad0b2139703c78e1f0919b71394ac6ac2526ce7935ec2329d
+RMD160 (NetBSD-6.0/landisk/binary/sets/xserver.tgz) = 86ec983a4047e7a0c146cfab94df6331f0363e89
+MD5 (NetBSD-6.0/landisk/binary/sets/xserver.tgz) = 2befe5df4dce2ccb1770ac2019da8ec6
+SHA1 (NetBSD-6.0/landisk/installation/misc/boot.fs) = b8bbc9b7108311040a9a3e1bad714efccbdeab21
+SHA512 (NetBSD-6.0/landisk/installation/misc/boot.fs) = 8fbf69cfcb9e7e104c244a8cc2c11d0bc2e2f006eb8a5b8e97267604519fb0e415a9da6bc81a0e75fd30e2ce8fb40a4026a97cbd413de71c05caa1e5f16871fa
+RMD160 (NetBSD-6.0/landisk/installation/misc/boot.fs) = 333044e352899852a8fbb7308a6009c1b5a69bcb
+MD5 (NetBSD-6.0/landisk/installation/misc/boot.fs) = 47ea13afac308dfe956f2d5c16a3a285
+SHA1 (NetBSD-6.0/landisk/installation/netboot) = ca38444ab6911f5b12f0797a6198f082030ba9b3
+SHA512 (NetBSD-6.0/landisk/installation/netboot) = 064115997cd9a49abeb68a811406fad102a2ad325dd1e3ddac075f19e86d04d660bc4f6640483f825310e51d7cfdd90de4997c52dabc883e64f7d984444ef276
+RMD160 (NetBSD-6.0/landisk/installation/netboot) = dad8b6e8b216ef75971c7805baf4b4f86ecfad60
+MD5 (NetBSD-6.0/landisk/installation/netboot) = d29e773e58700dde6b5384464b517785
+SHA1 (NetBSD-6.0/landisk/INSTALL.html) = 5222270ac1c6fa408d5ef0bb7e901d99e916be72
+SHA512 (NetBSD-6.0/landisk/INSTALL.html) = 4011e42ffc09b225893c360690d01099ef76445c496e10c2434e50f8c97755d15038206bd2bc9bb4ee773c24e7b5bb64bf969a1e4ac4e07f4ec84c0beb21bf8d
+RMD160 (NetBSD-6.0/landisk/INSTALL.html) = 48a1b2c374b38629c87e1c04e661e36182caab0a
+MD5 (NetBSD-6.0/landisk/INSTALL.html) = dfa8413fc180b897d13c0964362e7b3f
+SHA1 (NetBSD-6.0/landisk/INSTALL.more) = add61a5d904d34e380a4fcd69cb7fffd24143a42
+SHA512 (NetBSD-6.0/landisk/INSTALL.more) = 4165166b8cc79bd589c80490352c0741edc2087e7560658ea0da993347301f94b3685babd2c40e8927fdd8ca9a58350232dad0cc1ec0c247890a283f1ca191b2
+RMD160 (NetBSD-6.0/landisk/INSTALL.more) = 7416e0e529dcbd99dca03cb901e7038cc60731a5
+MD5 (NetBSD-6.0/landisk/INSTALL.more) = 871f600baa29f1db802884fc26783526
+SHA1 (NetBSD-6.0/landisk/INSTALL.ps) = 734d5c64f3e69a68dd0b987492851f7f915692a9
+SHA512 (NetBSD-6.0/landisk/INSTALL.ps) = a34a07c314fe9a7e4f9dfc296f9e05116675f722ad0aaab757d76c31246a9182398bca5906c3882ff1b14fda9480bb674f12daa90274df9968f2c374d7a2d356
+RMD160 (NetBSD-6.0/landisk/INSTALL.ps) = 88c78a031426844ab1afca9dec3ba7289e994dd3
+MD5 (NetBSD-6.0/landisk/INSTALL.ps) = 446d71c39365e90bf6491895a781a4e7
+SHA1 (NetBSD-6.0/landisk/INSTALL.txt) = f4d9af9565019dda406298ac72875959cdcb1b72
+SHA512 (NetBSD-6.0/landisk/INSTALL.txt) = fe20c04bf5c15d95d5bcf8cafc9efd9ffb07e37ed6234c7abe8a2ff01fae1cb7aca2c4eb28a7d032212a31cae34331d0ce9fad7a3f7a01bb0a9b66e40352f5ec
+RMD160 (NetBSD-6.0/landisk/INSTALL.txt) = 3739b2ac5572c87aa6e8a86c6b33023db1c5e6f1
+MD5 (NetBSD-6.0/landisk/INSTALL.txt) = 7e1c46e08b5773bcd5ecc0717834c25a
+SHA1 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 6d24a14ed0376a5672de20c9c3b64137fcfe3b90
+SHA512 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 5b4957606a4a575aa8c0fea6dbb10df17ef4ac7afa8624c456cc625a0e0e2d1d86c2ca9a4fcf770949933af22cda99479bfab55d383878d0acd8f0c0a260820f
+RMD160 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.symbols.gz) = bd90a974d6697d2921362ed308fef5df89a6a7f5
+MD5 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.symbols.gz) = b5fa03bb653ae6c758c1374109969d01
+SHA1 (NetBSD-6.0/luna68k/binary/kernel/netbsd-GENERIC.aout.gz) = 1a6b46426c3e93110e9138dc56dbf4e15391c7c4
+SHA512 (NetBSD-6.0/luna68k/binary/kernel/netbsd-GENERIC.aout.gz) = fe4cf575cd9e08ccf01adec28e38311c7fda42dfd2de5d17f98be37fbac8023b9fa4225c58b5d46728af2f3885825f34068acb82f600447ed60ec54ccc5753ad
+RMD160 (NetBSD-6.0/luna68k/binary/kernel/netbsd-GENERIC.aout.gz) = d1e8da51257a921f3d3c0ecec9f5a06712018302
+MD5 (NetBSD-6.0/luna68k/binary/kernel/netbsd-GENERIC.aout.gz) = 1d29443ff1170766ece9a482e2468f73
+SHA1 (NetBSD-6.0/luna68k/binary/kernel/netbsd-GENERIC.gz) = d36634bfc138c395323135e9c60824b7f987b588
+SHA512 (NetBSD-6.0/luna68k/binary/kernel/netbsd-GENERIC.gz) = b7cdfcd815eea67d65ea003a2e56fd0a83ddfa1695749a5316566f9e59ef69dd9d78e80c54e99c9aa2db57d8e0ee9a3af43580ed40b45086b357362428e4faf1
+RMD160 (NetBSD-6.0/luna68k/binary/kernel/netbsd-GENERIC.gz) = 2d36be27f36008788fee498a9c18dbe7a3d66c08
+MD5 (NetBSD-6.0/luna68k/binary/kernel/netbsd-GENERIC.gz) = ca10cc06f8e60b045230888b523f71ad
+SHA1 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.aout.gz) = e081ce3c03ff74c60f2a0ba80540e5b398aac926
+SHA512 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.aout.gz) = a02d1a6974fe702be5e51419440ebdf00bd333b0c4b88cf1289a992bfc21be4f731edb386bdb5e559b5f1fac064e392b97a800431538bd21e76ebb2f6f1c24a6
+RMD160 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.aout.gz) = 0db65548da46e8d651e8b2b9d4ee3b1f95086f61
+MD5 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.aout.gz) = 22e3b4a434ae0bf2e200bd4f6f223ff9
+SHA1 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.gz) = 43172b3e8115db8f41cff2170f4b5d47dd1da8e5
+SHA512 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.gz) = e7e217acc802aff14a3ea852a1dd0f62088dea15ecadc3cc9b335259ecabf352028dfa5929ff139f31f5b299311a5e42e944c0979be0299501caed3592e1d86e
+RMD160 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.gz) = c53f3f5d7e4150eb768b377877d8a8d71f22d156
+MD5 (NetBSD-6.0/luna68k/binary/kernel/netbsd-INSTALL.gz) = 5d3869dcf1301987a12ffa512b626d19
+SHA1 (NetBSD-6.0/luna68k/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/luna68k/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/luna68k/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/luna68k/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/luna68k/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/luna68k/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/luna68k/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/luna68k/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/luna68k/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/luna68k/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/luna68k/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/luna68k/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/luna68k/binary/sets/xbase.tgz) = ffc6dc889560371042dd12a5486a9a2c499b86a9
+SHA512 (NetBSD-6.0/luna68k/binary/sets/xbase.tgz) = 9aa2ba4d703a13020acf8543d1efcde76b6f0f4b411be20f804709b3802e537be1e651eba469830c4fd4777a379ea9936200a3a3eb4b1a702c04bb81aafcc723
+RMD160 (NetBSD-6.0/luna68k/binary/sets/xbase.tgz) = 3ecf53e7414ef859a47fe5afc108cf3bfa82fb1d
+MD5 (NetBSD-6.0/luna68k/binary/sets/xbase.tgz) = a6af002ce158cf72eb5c6a7cde2c0989
+SHA1 (NetBSD-6.0/luna68k/binary/sets/kern-GENERIC.tgz) = dca3d0e2fc1d884287bd283e81bc797ceeb13195
+SHA512 (NetBSD-6.0/luna68k/binary/sets/kern-GENERIC.tgz) = 58388c5d51f6f09f0884904ba8b18ae63374f807312177898080267382141c631e6aa0698a55b427e5673b34fa995cb3d8cd7e77dc1036c9812fe8356f976dc7
+RMD160 (NetBSD-6.0/luna68k/binary/sets/kern-GENERIC.tgz) = d9c5321bc472e64656a250e3e3bd6d72119435ce
+MD5 (NetBSD-6.0/luna68k/binary/sets/kern-GENERIC.tgz) = 374856b19bd6eb0c072c4b25933f5f8d
+SHA1 (NetBSD-6.0/luna68k/binary/sets/base.tgz) = bc10452b7a7a1a24dec1813d74ff78d1d82ae750
+SHA512 (NetBSD-6.0/luna68k/binary/sets/base.tgz) = 5525e21ff9566b0c7ce169e2a087094e41cd3e60d4f67d8ae026c4169cc5b606cb88f600e4410570053dd9ea8202b0da0fd7293fc8c6531c722bb4109accc605
+RMD160 (NetBSD-6.0/luna68k/binary/sets/base.tgz) = d763e9b40ced7122fa0ccb461386a7b7ff1dce1a
+MD5 (NetBSD-6.0/luna68k/binary/sets/base.tgz) = 665d860c4af2fd73227eda7bbfbf124f
+SHA1 (NetBSD-6.0/luna68k/binary/sets/comp.tgz) = c69dde9c6ef3a0ed4457ced09c7016465b0e82df
+SHA512 (NetBSD-6.0/luna68k/binary/sets/comp.tgz) = bbb46b665a23fb728945c51cc19ae85da4e33da19d91ce15ed24d7832258c0cb53f75351c869aa46704cf09245403b9b28fb55624e0b8e28c2e509b653d459ba
+RMD160 (NetBSD-6.0/luna68k/binary/sets/comp.tgz) = c622dbd3522567457fd890414386ebbebf6204e9
+MD5 (NetBSD-6.0/luna68k/binary/sets/comp.tgz) = c0c2030d7bd68b455be0b4094a1e949a
+SHA1 (NetBSD-6.0/luna68k/binary/sets/etc.tgz) = 7d1db50a753d92b90ee1eaf6b4a4f02cab03d981
+SHA512 (NetBSD-6.0/luna68k/binary/sets/etc.tgz) = 86c1904b4007d3a1f4a91f30140a3c6d53af8b90c38c01fee75b679484096079d357e7a71c027464a5d48d4789d9c4a04f3f2545df907953c739a22877ae130e
+RMD160 (NetBSD-6.0/luna68k/binary/sets/etc.tgz) = 52873f9a82119f52ef847e3e27e00ab4e10c68cf
+MD5 (NetBSD-6.0/luna68k/binary/sets/etc.tgz) = cef84e15f32a2bf92f3657f981235991
+SHA1 (NetBSD-6.0/luna68k/binary/sets/modules.tgz) = 9428e74da3601eab14416d01bc4880dcfe21a6f7
+SHA512 (NetBSD-6.0/luna68k/binary/sets/modules.tgz) = ec64bcf7ebed5af30e85708133fcac6f0946aa0ba7175906b1f9ed06c300c23028ba0ba1957c1e4fe6d4c7a99877e7ed104b1439cec728db79fe9f3cad3eccb1
+RMD160 (NetBSD-6.0/luna68k/binary/sets/modules.tgz) = 8060c8587dfadee593f84db43c0e63acfc259e06
+MD5 (NetBSD-6.0/luna68k/binary/sets/modules.tgz) = 1477ab794d1c6494bb5a9628820c4c08
+SHA1 (NetBSD-6.0/luna68k/binary/sets/tests.tgz) = 8380e48719aca55a72f3f91629e52a774eb7e4d7
+SHA512 (NetBSD-6.0/luna68k/binary/sets/tests.tgz) = eced534537094e8ee83154a5319f89f4cf8e46bf8715ff6329a01f8824e231bdf726ea6f6cd4ad940d0a0a45b5b99c27eb5083e69ae915f56b2beaa7d8b63d89
+RMD160 (NetBSD-6.0/luna68k/binary/sets/tests.tgz) = 05c755294af5ff529c495865595c8bfe7f5d91fb
+MD5 (NetBSD-6.0/luna68k/binary/sets/tests.tgz) = 4e8df8ec4228f385e7eb7d097904a8fc
+SHA1 (NetBSD-6.0/luna68k/binary/sets/text.tgz) = 19f8fb95eef7c6162c661a5262f5f41fd92f6078
+SHA512 (NetBSD-6.0/luna68k/binary/sets/text.tgz) = f2a4f42b05526d21fffc8d4783885b155bdcd8183b194058e9554bb34eb47a6b0ba2d6a9779c12f17844a6bb2fc07530a7a1d7dcacbec44b437fbc08796b65bf
+RMD160 (NetBSD-6.0/luna68k/binary/sets/text.tgz) = f01ee7d5dd88c612e8c8b3aae25ca93e1c70df0b
+MD5 (NetBSD-6.0/luna68k/binary/sets/text.tgz) = c55b5fb2f398aaebe749d7d2a6fc8570
+SHA1 (NetBSD-6.0/luna68k/binary/sets/xcomp.tgz) = 01bdf2494bf84313fb000f36606161f17cbc0114
+SHA512 (NetBSD-6.0/luna68k/binary/sets/xcomp.tgz) = d4fb1fb22011bf3b178593e1a2be51626563c6ccb35f3c2db922374d9dc1dc1fdd7830df24f1f699a89c46d5a7044c221372015134682aba5a2010d5f44ef77f
+RMD160 (NetBSD-6.0/luna68k/binary/sets/xcomp.tgz) = 03191d2a871d99076fe73355da23bfaf537294bf
+MD5 (NetBSD-6.0/luna68k/binary/sets/xcomp.tgz) = c30eac2a665f533444de26dafbbdd77f
+SHA1 (NetBSD-6.0/luna68k/binary/sets/xetc.tgz) = 3d78331b298a38fb6bd231bff59cccdedceaf71a
+SHA512 (NetBSD-6.0/luna68k/binary/sets/xetc.tgz) = ecaaaaa343d9abb3d24d147826956ad64fe96338d38511b5226d3cf2cc564eb8cc39aa833c7e0875fc4378aa6b8c2f3a7ad17c8906f8c68e5adc16c3cec5b715
+RMD160 (NetBSD-6.0/luna68k/binary/sets/xetc.tgz) = 7734dfa9521226f76e23b91d237109bf30855cbf
+MD5 (NetBSD-6.0/luna68k/binary/sets/xetc.tgz) = 0e5ef946483a93d487b70b526477efb0
+SHA1 (NetBSD-6.0/luna68k/binary/sets/xfont.tgz) = dca18181278f672451b3902ebdbf3d79ccfdedb4
+SHA512 (NetBSD-6.0/luna68k/binary/sets/xfont.tgz) = 3979a9cc4b1731c8b31f44cabbe74920cb03d7e7d551743eee78442e0ba67a6faa854cdc674cd0338422aa09119ae653f2fdbd2c78dc6811c49661e812ce7fc1
+RMD160 (NetBSD-6.0/luna68k/binary/sets/xfont.tgz) = 9b946721f534b2fd651e742f9061ef5d648efd3a
+MD5 (NetBSD-6.0/luna68k/binary/sets/xfont.tgz) = a3b4aad9b96343e5565a441b3376f454
+SHA1 (NetBSD-6.0/luna68k/binary/sets/xserver.tgz) = 859f7b47396c427f5d6c3570f6f68227131b2b34
+SHA512 (NetBSD-6.0/luna68k/binary/sets/xserver.tgz) = e1eee654564f67397c0324d8f89e62b0fcb40857b423ad2fb47c04d3bca7fa833a04adef639baf3c48bc27400f4d8a548d55efc7e29dfac74a82794e5182ce2a
+RMD160 (NetBSD-6.0/luna68k/binary/sets/xserver.tgz) = 1f75e4523b978323e96a0c986edbd700ae351846
+MD5 (NetBSD-6.0/luna68k/binary/sets/xserver.tgz) = e50f795889ea9f0cfc49fcc6d8991ec4
+SHA1 (NetBSD-6.0/mac68k/binary/kernel/netbsd-GENERICSBC.gz) = 33453c6105617ec6e41c81d71be7b04b68f26e24
+SHA512 (NetBSD-6.0/mac68k/binary/kernel/netbsd-GENERICSBC.gz) = 9ea5036462094ff9ff7696cc13f9b76166f4c6058ee8e79547898866c27e96b5e31e4e27228fc7bddc69b0f11ca242113778b2ab8c6c458d16fd08e7b5148557
+RMD160 (NetBSD-6.0/mac68k/binary/kernel/netbsd-GENERICSBC.gz) = aa85610097d3144646f7bdcbdfd1cd55fd248280
+MD5 (NetBSD-6.0/mac68k/binary/kernel/netbsd-GENERICSBC.gz) = 4b4ce73206f5d0203aedf08b4e9e73e4
+SHA1 (NetBSD-6.0/mac68k/binary/kernel/netbsd-GENERIC.gz) = 644b65114d6ffc9bef291f18e3935ca539ed29e5
+SHA512 (NetBSD-6.0/mac68k/binary/kernel/netbsd-GENERIC.gz) = 8e590640af3dfd78202b83a4bc6afec869ee37b467a10b3221c08e54c3a66bddc1726cca88d09fa98598f77d8bbc6dd36c136c685bab7e75198a9b6fa89e11da
+RMD160 (NetBSD-6.0/mac68k/binary/kernel/netbsd-GENERIC.gz) = 2bccecd72133b03055457567ea8eca57acc56ac6
+MD5 (NetBSD-6.0/mac68k/binary/kernel/netbsd-GENERIC.gz) = ece356c2c95629fc502bb2e9382f9b4c
+SHA1 (NetBSD-6.0/mac68k/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/mac68k/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/mac68k/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/mac68k/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/mac68k/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/mac68k/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/mac68k/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/mac68k/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/mac68k/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/mac68k/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/mac68k/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/mac68k/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/mac68k/binary/sets/xcomp.tgz) = e13548b8974f5d55e98caf17b2b4bbbcf2430370
+SHA512 (NetBSD-6.0/mac68k/binary/sets/xcomp.tgz) = e4b13c798df04ffef88e72100e2db5af400e5ae255cd7a1ca2907736b8138a59045b6f3bd8531b5753d0b87eadb1b5f801043a929bb25d1611e4be693c1da954
+RMD160 (NetBSD-6.0/mac68k/binary/sets/xcomp.tgz) = 3b1f4e26ddd57e69afd9709553c1bf70d6e29ea0
+MD5 (NetBSD-6.0/mac68k/binary/sets/xcomp.tgz) = 894bb9aa05b164d9923682165d708335
+SHA1 (NetBSD-6.0/mac68k/binary/sets/xetc.tgz) = d2ca34bd668e108cbbfd4b45720823663339f8bd
+SHA512 (NetBSD-6.0/mac68k/binary/sets/xetc.tgz) = 431ca465f300e7eb5d4dbd44c43e412a296fb4d3129217e752f86a720e8a8bdf736c9add05a45518a4f3e6cffa32381ef61e9186d360b68a5f8c64d87e385fb5
+RMD160 (NetBSD-6.0/mac68k/binary/sets/xetc.tgz) = 4c5d664679856b02b694534cd6afdf20597e6d53
+MD5 (NetBSD-6.0/mac68k/binary/sets/xetc.tgz) = 72bd67556ac14ea0ce147374af0ba624
+SHA1 (NetBSD-6.0/mac68k/binary/sets/xfont.tgz) = 24ca4cb77a59246b1b05e0a91fed21c63259d12b
+SHA512 (NetBSD-6.0/mac68k/binary/sets/xfont.tgz) = 8dc297fb6205a995767e68e77cc21169234dfb66a86bbcd2e1828fd32efeda0a25c9f2a9b1a39b97fe8d7b24f8cd5cf6160859af6be2259876f39ee4e76c405b
+RMD160 (NetBSD-6.0/mac68k/binary/sets/xfont.tgz) = d2f134959940e6667aca185f01e388c05dc6bc85
+MD5 (NetBSD-6.0/mac68k/binary/sets/xfont.tgz) = 3c96c1f0a13cd7d277ca35622ac9c058
+SHA1 (NetBSD-6.0/mac68k/binary/sets/kern-GENERIC.tgz) = f8cc845ee4bb3a6eaba937a9aa9ef56ee7df39a1
+SHA512 (NetBSD-6.0/mac68k/binary/sets/kern-GENERIC.tgz) = 173879f5b2cee758aaec0d6baa6adfe208aa0817ce70edb8a4d821189de5e6a64dd5a4f0cd1da4b166579427f416383bc068d7e49677999e075cbe3ed40c99d8
+RMD160 (NetBSD-6.0/mac68k/binary/sets/kern-GENERIC.tgz) = 2e10430ed05682c3d2e2c9496d847535a68988a8
+MD5 (NetBSD-6.0/mac68k/binary/sets/kern-GENERIC.tgz) = 4c60130363f2cf09731d6dd9b98fbcb3
+SHA1 (NetBSD-6.0/mac68k/binary/sets/base.tgz) = 702a0468018c02cc7ce229811a3905477da4f722
+SHA512 (NetBSD-6.0/mac68k/binary/sets/base.tgz) = 871ff91422cfc76ef2e1fdf7a2052cbceaba0b7afacbf5856f2b440e834f1f4cc3759322f99bf85c4effff2a657f03a68978479d495985cf3ecf1cc3d0db4d88
+RMD160 (NetBSD-6.0/mac68k/binary/sets/base.tgz) = 184263ea29fe40e2def660f30c049a1f7c80d42d
+MD5 (NetBSD-6.0/mac68k/binary/sets/base.tgz) = ee8a6af6800f2a8ad6b9d6bb099bdf1d
+SHA1 (NetBSD-6.0/mac68k/binary/sets/comp.tgz) = c355ad494accbc2a9cc99011c6a7f1030027b4cd
+SHA512 (NetBSD-6.0/mac68k/binary/sets/comp.tgz) = 084828af876a61b296f6d34258462165cd23bdcb43ff5ac7f30d2b1ca43be31716c98de636e708ff193d8f97671eff2535d09710a66e4aa67151f326e423052c
+RMD160 (NetBSD-6.0/mac68k/binary/sets/comp.tgz) = 3119965a0c66603ebb2b62b7ca53838f2a468e0b
+MD5 (NetBSD-6.0/mac68k/binary/sets/comp.tgz) = 777aac0001fb61b70b6f5da36c73e8ea
+SHA1 (NetBSD-6.0/mac68k/binary/sets/etc.tgz) = a279de07a8d912b05e056c846bc616c084edeab9
+SHA512 (NetBSD-6.0/mac68k/binary/sets/etc.tgz) = 833a3c74e048bf2cc9f148b14a81eeb526071a1226fbafc3b501409922f4bb67b69d68cdd59cc8b83fe8fccb0afd1135e64b16683e8f42230530efab0e3ed115
+RMD160 (NetBSD-6.0/mac68k/binary/sets/etc.tgz) = 11fed26b10f5d68485667c9b0eb0673b4fb17390
+MD5 (NetBSD-6.0/mac68k/binary/sets/etc.tgz) = c6e0534c4470b66908a3f6e194723ffe
+SHA1 (NetBSD-6.0/mac68k/binary/sets/kern-GENERICSBC.tgz) = 851fd53f568f2c855c934f975d322954de4c6b07
+SHA512 (NetBSD-6.0/mac68k/binary/sets/kern-GENERICSBC.tgz) = 869f6b8f6eb4408a4f2950e8b9e10d020d14c0b829dd951d9746a9a778dbf142d53cb263cd797ec862b34a1aa367dfdbef5a633bd1181e442cce9fc0da2c8de7
+RMD160 (NetBSD-6.0/mac68k/binary/sets/kern-GENERICSBC.tgz) = ff894994dc6fe3773893eae064bbd95aca6077ab
+MD5 (NetBSD-6.0/mac68k/binary/sets/kern-GENERICSBC.tgz) = 0f2df7a929df022d55d5a73fe75e47a4
+SHA1 (NetBSD-6.0/mac68k/binary/sets/modules.tgz) = aefbcaa2fb397cb690e38e3be240caabf9282947
+SHA512 (NetBSD-6.0/mac68k/binary/sets/modules.tgz) = 83c696fccc6143c9c03e4efdf8ec65363dad51bbc48b434dc21a9949424f12db413de66abfa328b6d45f4097c59ee0324797ccc4ee7e462451170ce9ed7a81f9
+RMD160 (NetBSD-6.0/mac68k/binary/sets/modules.tgz) = 44606993e2ae655bdafaf93a92cee5a85efb9e2a
+MD5 (NetBSD-6.0/mac68k/binary/sets/modules.tgz) = 03bdab5790fdf19db36149fc33857b4f
+SHA1 (NetBSD-6.0/mac68k/binary/sets/tests.tgz) = 56b5e85ef88683b81048d2e6136aa949e690d92a
+SHA512 (NetBSD-6.0/mac68k/binary/sets/tests.tgz) = d4290b5069cb2290aac992145bcd69ff6e34b98ae2661e5cc16dd5b70362c1036c079dad7c96288f473c600e9cd1870c079268ffd08acb418ecc21708e3399ae
+RMD160 (NetBSD-6.0/mac68k/binary/sets/tests.tgz) = 7d46086a6a53cd19439f6967849dd294bb27b631
+MD5 (NetBSD-6.0/mac68k/binary/sets/tests.tgz) = 746ea69e63fb5af15f526f2f950ea449
+SHA1 (NetBSD-6.0/mac68k/binary/sets/text.tgz) = db35814cfb2c8ecce27765b3257b885d2e6debde
+SHA512 (NetBSD-6.0/mac68k/binary/sets/text.tgz) = 4110c6d47405005eafdb9fb205505f2cc40c6a2ace5b611312f4ef15ae5207a9ef5c4a42ca3b53164ec6f00a80efa5aa6d669a79a9e89da6f73fadd2dc5e437d
+RMD160 (NetBSD-6.0/mac68k/binary/sets/text.tgz) = 38345e956e8a7be25706d4809bfa83ac626a3e96
+MD5 (NetBSD-6.0/mac68k/binary/sets/text.tgz) = 90b4f37e590530f361f5ba22882f6184
+SHA1 (NetBSD-6.0/mac68k/binary/sets/xbase.tgz) = a9988db70cf4a221f20fa81d7f2525575eff6161
+SHA512 (NetBSD-6.0/mac68k/binary/sets/xbase.tgz) = 996a52c0e2a69be7ffbad4fca9e79e03cd72533d3c5059660b2bc5ebb3e982e010f53a870583d9eba702f143365508f5a8ab307d9806fda3df1f48021a3dcf4e
+RMD160 (NetBSD-6.0/mac68k/binary/sets/xbase.tgz) = 10e9d44638eab39da8b579a32ebf1ae283901401
+MD5 (NetBSD-6.0/mac68k/binary/sets/xbase.tgz) = 649bdf23aca348bbb0d7d3741154cbcd
+SHA1 (NetBSD-6.0/mac68k/binary/sets/xserver.tgz) = 2139abe77fda0708a14f6cf7cb3787ede3369f35
+SHA512 (NetBSD-6.0/mac68k/binary/sets/xserver.tgz) = db558b4f6be34da37cc971183c3a67d8d51ea26f3852b9ae53844ca5bc3fc0be405b6c30b6409d1e0d653178f4f6dc46645f37526ddd7d74be735a38beeaab09
+RMD160 (NetBSD-6.0/mac68k/binary/sets/xserver.tgz) = 32d160c3aab16c5a3ed819c9c020c8189e735c9f
+MD5 (NetBSD-6.0/mac68k/binary/sets/xserver.tgz) = c17de992b6f02ad51a720faaf0ac04d5
+SHA1 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALL.symbols.gz) = 7ab45cb4b64d15f930d7b275acf62d70015c7d9c
+SHA512 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALL.symbols.gz) = 107b76145d7484485984483a8b793bbd3fd56f0eccafc619f9b5cb119bdbd0f87ca5918257554a9623c535416368eb4dac4df8fcdfdd12ac279459b775827e56
+RMD160 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALL.symbols.gz) = 2f2e4239577f923664edb12730c51e15106079a2
+MD5 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALL.symbols.gz) = d53fc2a484e0add618fcdd9b236ffdd3
+SHA1 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALL.gz) = 6f94e9d416e73a7019fd05338369616e459db5a3
+SHA512 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALL.gz) = 8fc1096815fdcc6e987e0c69b991553ff094e226127a10bcd9510ffa0dcc746fb7416896e54ea32f18e80c5782937b8af34d20c55d8758c750ff7810ec69c203
+RMD160 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALL.gz) = 6ddc97fcb3cf13544c3190956c37f34897cf35f7
+MD5 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALL.gz) = 3d4a8d946ed122290abac6375a9ef863
+SHA1 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALLSBC.symbols.gz) = 2672525b1b4997e3793edea3ee8b30c23cffb102
+SHA512 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALLSBC.symbols.gz) = 003877e10fb0dad0b7190bbf559f190f3de2c0e1068caa5601a0a938706225e2cb7b141f8e4e767da7ed1ff15350f42792ee9a7de5e1d7149dfc233d6dbb4da9
+RMD160 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALLSBC.symbols.gz) = 8f7b7ddfd1b96f5ca34f4a074cf27adf7701ceca
+MD5 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALLSBC.symbols.gz) = 2aba4f14a7812f2d935c5ddd84634529
+SHA1 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALLSBC.gz) = c91cbdc339088c1c32868779c918f746d4b5f4f7
+SHA512 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALLSBC.gz) = 11eff94f2d5aaef7decbf6447a91f692c605a5d36acbea876e6a2501dddc681a60a89d3084ed1413c80ba3d8b23c90abfc567dc99254a9d810353992757d6284
+RMD160 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALLSBC.gz) = f26b7b6f484d727ff6aa460985f23af89f72c8f7
+MD5 (NetBSD-6.0/mac68k/installation/instkernel/netbsd-INSTALLSBC.gz) = 2dffa66829a868235a11ab636e793d52
+SHA1 (NetBSD-6.0/mac68k/installation/miniroot/miniroot.fs.gz) = dc091b6ed92bd1269a8f76c427d606345a8f49fa
+SHA512 (NetBSD-6.0/mac68k/installation/miniroot/miniroot.fs.gz) = ba5b9a96d964da2b2c0c5640a4669840352057ea799013ceae75d3d9a7782d6a4096cbc591b287b663edd27a3db54ff5a5b62a81099c2f97d21c3919b0bc7b59
+RMD160 (NetBSD-6.0/mac68k/installation/miniroot/miniroot.fs.gz) = dc09fba5a4fe6ead5f59da6026018a63065ee414
+MD5 (NetBSD-6.0/mac68k/installation/miniroot/miniroot.fs.gz) = ab49b728c7a2ef8c273a3ad07b5e3e6b
+SHA1 (NetBSD-6.0/mac68k/installation/misc/src/Installer_1.1g.src.sea.hqx) = 5ae75a6179968ac955f38b60f57e3811a1e4a3de
+SHA512 (NetBSD-6.0/mac68k/installation/misc/src/Installer_1.1g.src.sea.hqx) = 0017e59c1c000d154df2f9e868a85df1897b8a7918471dd6d468a4527b092ae2d069bbd686487b0b05ed4d61abfffaa7eb6584f5ee03b320469386e2b64c89cf
+RMD160 (NetBSD-6.0/mac68k/installation/misc/src/Installer_1.1g.src.sea.hqx) = d29a9600c614d00c7af518b2f75f1d1ebebf4b6d
+MD5 (NetBSD-6.0/mac68k/installation/misc/src/Installer_1.1g.src.sea.hqx) = 5d00aedc5729c2e2ffcea77e666a4adc
+SHA1 (NetBSD-6.0/mac68k/installation/misc/src/Booter2.0.0-src.sea) = 5a4598fcbd39bfed29d58f9d712ed8d3408ae5c1
+SHA512 (NetBSD-6.0/mac68k/installation/misc/src/Booter2.0.0-src.sea) = 4828cb2efb9b40753be27ecd1cbe235e3842b9b2b024070eb6135f10716dfae1ab7cd6d45db862c64eb5b2267b40c6660af53986d3b5fcfab03600a75c0b08f3
+RMD160 (NetBSD-6.0/mac68k/installation/misc/src/Booter2.0.0-src.sea) = 9f284e11ef74ef0202d4a46ffcdafce282f3104f
+MD5 (NetBSD-6.0/mac68k/installation/misc/src/Booter2.0.0-src.sea) = d9185a15e8dbcefdc26e8dceea7eaa51
+SHA1 (NetBSD-6.0/mac68k/installation/misc/src/Installer_1.1h.src.sea.hqx) = 3a4d1868a5f6c6e010dd6e3d0ff7ddb63a034c9e
+SHA512 (NetBSD-6.0/mac68k/installation/misc/src/Installer_1.1h.src.sea.hqx) = cafa4aadc01ce3c515945359d67df14aefb9cf36cafab93d113cc5079e0cdc06360310173febca13cf7bc8fe66eb9161f6afed97a0810ddf025bca38d327e444
+RMD160 (NetBSD-6.0/mac68k/installation/misc/src/Installer_1.1h.src.sea.hqx) = 90b7070035d00fe09ac95962c4d47e1ba2f565e2
+MD5 (NetBSD-6.0/mac68k/installation/misc/src/Installer_1.1h.src.sea.hqx) = 9f792b26b1a5691f13193a7e08cf6d18
+SHA1 (NetBSD-6.0/mac68k/installation/misc/src/Mkfs_1.47src.sea.hqx) = 76823266114b2ff531d35c646eef705677085907
+SHA512 (NetBSD-6.0/mac68k/installation/misc/src/Mkfs_1.47src.sea.hqx) = ceb5f5665acc0a9c8f273bf659e17a55dec3ffde647deb90cfa9001e43a82d5e1b4e8001175559b2f1d6327f2a80f86bfbf2798f27bbe6bbe52547a92de11d57
+RMD160 (NetBSD-6.0/mac68k/installation/misc/src/Mkfs_1.47src.sea.hqx) = af8327f6e2d66bbd8a04498d27ab3f5668556cce
+MD5 (NetBSD-6.0/mac68k/installation/misc/src/Mkfs_1.47src.sea.hqx) = 61facd7fdeb336f108d78feb8327555b
+SHA1 (NetBSD-6.0/mac68k/installation/misc/BSD_Mac68k_Booter.bin.uue) = 432b619e0eb127a5fd70fd3dc8f2988a93211a34
+SHA512 (NetBSD-6.0/mac68k/installation/misc/BSD_Mac68k_Booter.bin.uue) = ab3650cca71dc57f38f480bfa74f6bdffe2d0ccbf76072658503cd168b91f90a7fe5ba0ef4f51aa497a11684ee05d73376e059957c75773d92f894877042c0ab
+RMD160 (NetBSD-6.0/mac68k/installation/misc/BSD_Mac68k_Booter.bin.uue) = 61bdb1fc795bfe9242816682fc98cfdee036e0ef
+MD5 (NetBSD-6.0/mac68k/installation/misc/BSD_Mac68k_Booter.bin.uue) = aed2003c59f8e824dc30c44366439426
+SHA1 (NetBSD-6.0/mac68k/installation/misc/BSD_Mac68k_Booter.bin) = 8e940cccdfe4e645ddd01738477f7f58342788e0
+SHA512 (NetBSD-6.0/mac68k/installation/misc/BSD_Mac68k_Booter.bin) = 0d3e0d39aa811921b012a6fd07dbf97b63f61dd14800c61d2941f3c624db88cd0805478df900120cd20c3fcf6af11c5989c52400e5b4eefabd4bf5c62f9f2023
+RMD160 (NetBSD-6.0/mac68k/installation/misc/BSD_Mac68k_Booter.bin) = 49146172c77c05a522bdf118e879f0bd933bc99c
+MD5 (NetBSD-6.0/mac68k/installation/misc/BSD_Mac68k_Booter.bin) = 757b6ca3559185feafc36927ce9ab578
+SHA1 (NetBSD-6.0/mac68k/installation/misc/res-edit-and-others.hqx) = fe505f1ff77f1574ddec17dd4de93f0370fe236b
+SHA512 (NetBSD-6.0/mac68k/installation/misc/res-edit-and-others.hqx) = cf382e50ea9a8fd8c30c8bddfadf44b64b94216656dc623039a37c88bc642080b54002b9aca1cad25c251c719cda9fb3ad89bbf3ed645672c0040baf459e0ae9
+RMD160 (NetBSD-6.0/mac68k/installation/misc/res-edit-and-others.hqx) = 19be7f536eee28b7e30cffc4ef3e8a2f8c7fe88f
+MD5 (NetBSD-6.0/mac68k/installation/misc/res-edit-and-others.hqx) = 707c4953e155315abe519d5d48c54318
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Booter-HTML-manual-12.tar) = 94e2f09daeb119ece95abfe24b103f85f9c5d558
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Booter-HTML-manual-12.tar) = 3d9a743e71ee985134ab679608ffc31b197a638e302450c888f90d02fefae72b647622024b3ebb4263e57b6e58ce457890d6a0774c62a8e4a9f90d235d04c15a
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Booter-HTML-manual-12.tar) = ee32b1b55b0495b9b4723ff3cbc42123f5b360a2
+MD5 (NetBSD-6.0/mac68k/installation/misc/Booter-HTML-manual-12.tar) = 24120554ffbac39c8edd8e939706b7c5
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Booter2.0.0.sea) = d5178c25cc71514816986842e39c716e6cd5ab4c
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Booter2.0.0.sea) = fafbf6f153e9b9bf657aac3c74d569b44ff21c1e306f0cbc4a2fcab5fbe439bd46746ff0469113bc715b69990507994ae94934d8caf82321684326f4e8b4d146
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Booter2.0.0.sea) = 97798bf61397243efee8480c7f2f19e63fda7d00
+MD5 (NetBSD-6.0/mac68k/installation/misc/Booter2.0.0.sea) = 05b46210443c60ee28bcbe81f1ebc004
+SHA1 (NetBSD-6.0/mac68k/installation/misc/BooterManual.stxt.bin) = 2859ea6089df13333b6b521d8bc858079083251c
+SHA512 (NetBSD-6.0/mac68k/installation/misc/BooterManual.stxt.bin) = 1891f4c07bfb51de08fea8e3a5cd572e99897d20f6df748ae72af8da5e8191ca07d5f0dc836b39be12236286926677896e4a456a8f64b31517d09285bebed460
+RMD160 (NetBSD-6.0/mac68k/installation/misc/BooterManual.stxt.bin) = 37fe1a762925b8bb8ae71177bea992aad27ee03f
+MD5 (NetBSD-6.0/mac68k/installation/misc/BooterManual.stxt.bin) = fcc43fd81d5691559a5aa8ae15be8899
+SHA1 (NetBSD-6.0/mac68k/installation/misc/BooterManual.stxt.bin.uue) = beb0225c706b12fc8a241025c483133c1d5e6b86
+SHA512 (NetBSD-6.0/mac68k/installation/misc/BooterManual.stxt.bin.uue) = 7e98b555d7cf30da5948b115595f06a725c55cc0ef3e7a705423c600cafceca2e04966c65573805e6e553cf9f7a2faa05803ff2d6cd9deb714f4e98924e2a5d7
+RMD160 (NetBSD-6.0/mac68k/installation/misc/BooterManual.stxt.bin.uue) = ed9a5860dafd3484d380f1f3a91cec366b59be9d
+MD5 (NetBSD-6.0/mac68k/installation/misc/BooterManual.stxt.bin.uue) = cacb436bfbfc9a4b0995c789fee8342f
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Installer.sea.hqx) = c6a6c25ae1fcdfe4a0ba90616c3779068280b759
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Installer.sea.hqx) = 5ff75859fd5eb2fdcf75215ec6c045518ef111d0e8caecbe951dbf6f9f1129cac6948ab991949cbb3ee68d05ee8f398b07206acc9af53a5db1c4c6c7148a3a2a
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Installer.sea.hqx) = 36b141ff6722fd5e76fe293d1247587ae0efdd8a
+MD5 (NetBSD-6.0/mac68k/installation/misc/Installer.sea.hqx) = 01bc744d539b4f2f8e4fb2761d4c77e7
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1g.sea.bin) = 8ef8265fa77478a6741bc65ceb6f64e790c7aac2
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1g.sea.bin) = 45324e1231e7d53816640b8867eb117294373e90463297f05e6d187b1fe719b82bc1782b24dff8ad6a71e0383eddd0f47bd15d604f6cf3bb2bf3499df887eb48
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1g.sea.bin) = 506451703e3f00ac0a26b450d33463fd2c1e4582
+MD5 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1g.sea.bin) = ea338e4327628024d670ae9eb64323db
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1g.sea.hqx) = 8e28517a94b1b0b57a504938077aa740de7e3b80
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1g.sea.hqx) = 6e07c3682a0bbb4f7d23c235f83f3d22d4a8813cade67ab9f76092c68f41767c00eccde01600283df36e4d222bddd2b7fec355db468d07d7db8dbf51adc9f5bb
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1g.sea.hqx) = 4159e0226c6f58b480bd0cdc42f9d2d411521034
+MD5 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1g.sea.hqx) = 2c214a1b2429702942436e92e2a408c3
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1h.sea.bin) = 0bda2b9e6a95f1b10414823f048087ad6455e6ed
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1h.sea.bin) = bb9ad3f95609c3f23d31a876055f2cae692d8abb853431d0945ee7e66e292fe7069dda82f5ee615ac5fe5893e0699323632de8d4c1c668d987a8172597d78386
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1h.sea.bin) = bc7f88652ae4d51954c967dde99dc6c11494a7c8
+MD5 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1h.sea.bin) = 763ff66b2234fd52ffe4ad08de5f090f
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1h.sea.hqx) = c6a6c25ae1fcdfe4a0ba90616c3779068280b759
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1h.sea.hqx) = 5ff75859fd5eb2fdcf75215ec6c045518ef111d0e8caecbe951dbf6f9f1129cac6948ab991949cbb3ee68d05ee8f398b07206acc9af53a5db1c4c6c7148a3a2a
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1h.sea.hqx) = 36b141ff6722fd5e76fe293d1247587ae0efdd8a
+MD5 (NetBSD-6.0/mac68k/installation/misc/Installer_1.1h.sea.hqx) = 01bc744d539b4f2f8e4fb2761d4c77e7
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Mkfs_1.47.sea.bin) = 9783f80336af95dfbf854278f58b577891a6442e
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Mkfs_1.47.sea.bin) = fb3d537f73cd7a5c05b4deeacfebe4805de1172071b97af545ef0c360c8093dd34007cdb498dad1b8fba4930e939c35429b314c575ab1e6d57fc208d72bee767
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Mkfs_1.47.sea.bin) = eb92d84b516d3c84a2c54fa501a1f585434639cb
+MD5 (NetBSD-6.0/mac68k/installation/misc/Mkfs_1.47.sea.bin) = 0b6f626c1d8f578e01818cfc2a2e79b5
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Mkfs.sea.hqx) = e2286a389c29eebadaad19c9c3f3c9095b8bcb3d
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Mkfs.sea.hqx) = 5021b88d12bdc6545c681a3df24750375d63cac19b9e0f6a7148cb8592de6d0cc22f254b9755a96e1780541acbbdf54f0f6f9b62ff7cdab8dc94db0d247b2b87
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Mkfs.sea.hqx) = 14c18aceaab0593ca0f41bcce95499db3fc4f8f7
+MD5 (NetBSD-6.0/mac68k/installation/misc/Mkfs.sea.hqx) = a20825a32ee72f356880169993c3ac73
+SHA1 (NetBSD-6.0/mac68k/installation/misc/README) = 6f10f67afd988de6fa0a66f78ec46da15cc994f3
+SHA512 (NetBSD-6.0/mac68k/installation/misc/README) = e8f6d9c3217e7ad084ebc6758a07f14a664db9a34feb2b4dfb19fce8692ca1703f2b119eabcb13cb38f629a9588dea3279bfcf0cda65260acd585514d129701d
+RMD160 (NetBSD-6.0/mac68k/installation/misc/README) = 9d125cfe0be05fb26b9b5f52690b9280e282af44
+MD5 (NetBSD-6.0/mac68k/installation/misc/README) = 6081e0a4521b8f229bd3c09e094d4bc0
+SHA1 (NetBSD-6.0/mac68k/installation/misc/Mkfs_1.47.sea.hqx) = e2286a389c29eebadaad19c9c3f3c9095b8bcb3d
+SHA512 (NetBSD-6.0/mac68k/installation/misc/Mkfs_1.47.sea.hqx) = 5021b88d12bdc6545c681a3df24750375d63cac19b9e0f6a7148cb8592de6d0cc22f254b9755a96e1780541acbbdf54f0f6f9b62ff7cdab8dc94db0d247b2b87
+RMD160 (NetBSD-6.0/mac68k/installation/misc/Mkfs_1.47.sea.hqx) = 14c18aceaab0593ca0f41bcce95499db3fc4f8f7
+MD5 (NetBSD-6.0/mac68k/installation/misc/Mkfs_1.47.sea.hqx) = a20825a32ee72f356880169993c3ac73
+SHA1 (NetBSD-6.0/mac68k/installation/misc/NetBSD_ROM.sit.hqx) = 009c5f376751cda897cdd5707932a42ed8c4c75f
+SHA512 (NetBSD-6.0/mac68k/installation/misc/NetBSD_ROM.sit.hqx) = a04d6873fe2e0d3b543a05d1c12893f2715479e5bbfeeb9657babd146610197e4eec045a428d51bce4a9f8fb90f23f81b31b35f672692de953d6df8379a7531c
+RMD160 (NetBSD-6.0/mac68k/installation/misc/NetBSD_ROM.sit.hqx) = 6dcd7e0f25e19d77d38b18c22af77ef0c80769e6
+MD5 (NetBSD-6.0/mac68k/installation/misc/NetBSD_ROM.sit.hqx) = 6d9984dacf90adcd3f5f4a906b72b436
+SHA1 (NetBSD-6.0/mac68k/installation/misc/README.Booter) = cb2fb0233a1f5444c5c1b9648a6c167a4ce09437
+SHA512 (NetBSD-6.0/mac68k/installation/misc/README.Booter) = b233f9b5f8e6b615ecbb117d1853c64a82b1ac78958a7d394133e6e5f777ca6075b1e65d74ce52d1bc9cc97257584cbc4c70a11b0865ef095e6376d2c4e46bf4
+RMD160 (NetBSD-6.0/mac68k/installation/misc/README.Booter) = 2bd403db763c410b968f85cb8da32d10a7520b59
+MD5 (NetBSD-6.0/mac68k/installation/misc/README.Booter) = ae0f90a35340fc51be774ebd33674a41
+SHA1 (NetBSD-6.0/mac68k/installation/misc/README.Installer) = e8e4011a516b40ea99e9f1b16708fc91878f88fb
+SHA512 (NetBSD-6.0/mac68k/installation/misc/README.Installer) = 791e8a5415bdfd0ac0412e964d0ed1dac9dbebfbe9d546fbd92d3aa3d9b82eececba55628ac6cbbd7dd843f62183d718e2a1ad98c10311fb76c24dd40c77af06
+RMD160 (NetBSD-6.0/mac68k/installation/misc/README.Installer) = fc1b834d11c4df6677ee4a40b1e3ba2015d5ad00
+MD5 (NetBSD-6.0/mac68k/installation/misc/README.Installer) = bd6be3091a274d7c68da789ad1db0eda
+SHA1 (NetBSD-6.0/mac68k/installation/misc/extensions.map) = 4a5fa646db0c73433f3538e17e7d18b38679284f
+SHA512 (NetBSD-6.0/mac68k/installation/misc/extensions.map) = 32db0ebf9c0e80e4856c963ef21d3626060e20ba33cd61301e4114b77a636cf248e705700444b42a4631d1c56ef09294981158e1f0b0527b795501b9cea1b8f6
+RMD160 (NetBSD-6.0/mac68k/installation/misc/extensions.map) = f6811f3b103ab5c902a204dce2578e8cba6e8e9a
+MD5 (NetBSD-6.0/mac68k/installation/misc/extensions.map) = 5007a814ca2442a9693969cb997b4905
+SHA1 (NetBSD-6.0/mac68k/installation/misc/mode32-7.5.bin) = 6eb3cb3b988e6295f7222016d241f53c61cf347e
+SHA512 (NetBSD-6.0/mac68k/installation/misc/mode32-7.5.bin) = 16f05d2792e03d3a9c9ccd9d435ca5556224bd73619d89b9d2f6ac3b282f6587b76745bbbc9383c20f11c2125b60dff138845dac4a269e459a5b76ee1d5e865c
+RMD160 (NetBSD-6.0/mac68k/installation/misc/mode32-7.5.bin) = be8fc56378e697fc1f6fe9da5e8e69c787dbc434
+MD5 (NetBSD-6.0/mac68k/installation/misc/mode32-7.5.bin) = 33ff34f5db2f0ba88c83ce85b1e51664
+SHA1 (NetBSD-6.0/mac68k/installation/misc/mode32-7.5.hqx) = f588fece9bb911749d1038da2ec31e5ea50b2b21
+SHA512 (NetBSD-6.0/mac68k/installation/misc/mode32-7.5.hqx) = 1d4a1b489419171022e120d7292f479ea0d47833b2868bccc47ea1d97c442ff1e18044f43783fbd920145a6e6aad094be796dc8db00d5d997235c8f9d8ecb7ab
+RMD160 (NetBSD-6.0/mac68k/installation/misc/mode32-7.5.hqx) = 6e0bd805b5595d6d8ee3a24a63290978bd8da8cc
+MD5 (NetBSD-6.0/mac68k/installation/misc/mode32-7.5.hqx) = cf14fb32d042ba270b527ec8b11f6d3e
+SHA1 (NetBSD-6.0/mac68k/installation/misc/pdisk.sea.hqx) = ac3641da27c3615456310ff795b2d684eb2661ef
+SHA512 (NetBSD-6.0/mac68k/installation/misc/pdisk.sea.hqx) = a5404597c2479adf6ad9a910771f8d9cff57dbc4066d73346bfde3f1380a59641855820658ff3a6c8c0fd97b242dcfd4c30e7ecde50047bbbc7a7d45e9d77e4e
+RMD160 (NetBSD-6.0/mac68k/installation/misc/pdisk.sea.hqx) = a5368be868266f37bdf3459067659ef0c4186dc6
+MD5 (NetBSD-6.0/mac68k/installation/misc/pdisk.sea.hqx) = 71be22598a33042751caa6dc6c0af834
+SHA1 (NetBSD-6.0/mac68k/INSTALL.html) = 85efa4b8402dccb52805752ff82e87eb1259e5cd
+SHA512 (NetBSD-6.0/mac68k/INSTALL.html) = dd8012db2cb801b02b808eadd473f529b58977b9d2088c878aeb7deafc214adb2e281aa3b2094e0988f23e1ede88a1528492634211f86fe73d4b6085a1a917fe
+RMD160 (NetBSD-6.0/mac68k/INSTALL.html) = 01614436a73df3cae2149a607abb6c59671dcb63
+MD5 (NetBSD-6.0/mac68k/INSTALL.html) = deaafd9baf0d73ad2fe1e731ca8d4391
+SHA1 (NetBSD-6.0/mac68k/INSTALL.more) = 02b0da5241dfb0e94347c45aa2b59230a4c4beaa
+SHA512 (NetBSD-6.0/mac68k/INSTALL.more) = e167052f3a76308dda76a45e7fe93622a3e40fb7905d2bfc3e6438007d5bee8cafa06f9bddf4fabd9801d82bc3de56fbec1892a4977d2b818ece0ee570bc7729
+RMD160 (NetBSD-6.0/mac68k/INSTALL.more) = 1602b574a726ead87163bea4a121dc4d5573c321
+MD5 (NetBSD-6.0/mac68k/INSTALL.more) = ab7ed66c5f64540dc7b9d036048fcfb1
+SHA1 (NetBSD-6.0/mac68k/INSTALL.ps) = 999ea4a94acf0cf256157ba3b447d866b0347bfa
+SHA512 (NetBSD-6.0/mac68k/INSTALL.ps) = dfaf48953a73ed32b722bc95d34a58866ea8ccbf0d9d79e1fd9769634920426826a1e5cc86b94cc2eaf39eb3365bd5977ae0ee4284af484f64bb3e92847567ce
+RMD160 (NetBSD-6.0/mac68k/INSTALL.ps) = 73548f30c2c139ae5e62e98dbc54a4a80d1398c5
+MD5 (NetBSD-6.0/mac68k/INSTALL.ps) = 43662b6328dcc148ea4b6121de934e7b
+SHA1 (NetBSD-6.0/mac68k/INSTALL.txt) = d198c59c8fb2bcb408013794ef3d8cadcb4ad448
+SHA512 (NetBSD-6.0/mac68k/INSTALL.txt) = efb0679da4c0f9b6b8f15f92579ecabb67a4e7451e156430f9a748368bf8815d563d83050c24784c80985d06d0c257d66f91a03c792ad9b65da17e408d2e732b
+RMD160 (NetBSD-6.0/mac68k/INSTALL.txt) = 3ea97712841cab74a13994769fbe4ff66705b6c0
+MD5 (NetBSD-6.0/mac68k/INSTALL.txt) = ed4f38a04160feaf88388c0970e6ed6e
+SHA1 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC_MD.symbols.gz) = ce9bd080acdc497dd570c416befca032a1e8d823
+SHA512 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC_MD.symbols.gz) = 39b5933f7f43c990c2478041d398e9764dce24bfbae9baba2f603fe574448370d9d5cef5e398613fa047648cc0120dc7e878f527bc12751c6a37fe8966cb9d2b
+RMD160 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC_MD.symbols.gz) = d23e372373d18f19b55bc87635bc45f3f730a91d
+MD5 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC_MD.symbols.gz) = c0e545e698824468f2b0acefaf788bea
+SHA1 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC.MP.gz) = 0a065a75b49d53c192d1a79e9d216a2d9382d570
+SHA512 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC.MP.gz) = dc2a00bcdf70c08d7089b775b3328f1b828c5a5962ec077d95c8ea279586c6b65c48bcde34b9432c4f7a0a7cb4dc6e8f4887ae254038919de8b4f2d2a3d2e3c3
+RMD160 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC.MP.gz) = 39e88535fff406327f536ecd319c2b5785898fbf
+MD5 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC.MP.gz) = 3410df9cc4df7b28a292ed3d150808ea
+SHA1 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC.gz) = 597f394bd55facd236e90f6aa213a5eef4711f7c
+SHA512 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC.gz) = f7cbec6767fd9ce1aa61065ebc360d4aa1d2fcb26c4457f38c409fb5465753b726c8fb37ab0448863efd69c21a8216dea27e8067cd1fa1f74299677985195181
+RMD160 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC.gz) = 21e5329fc0c500af9e333fabef527385021bde0a
+MD5 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC.gz) = 7da219cc304f59d1662eaf7f4dc1833f
+SHA1 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC_MD.gz) = e594f013594f13f586f6789005e49f13b9f3467f
+SHA512 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC_MD.gz) = bc68d5a6cf29cdc0c9ee8b9ca7610703025621f64a9b427f04b87cf53bf9e14e765785283a0a66aed1a15dd0abbe81e8fc2029c3310b715ef75cacc7eec93283
+RMD160 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC_MD.gz) = 7ce6740e080b6f9b5dc8d99c70c779b0486ad916
+MD5 (NetBSD-6.0/macppc/binary/kernel/netbsd-GENERIC_MD.gz) = 3f6f6c37b2c6f7b04c9595245c7224c4
+SHA1 (NetBSD-6.0/macppc/binary/kernel/netbsd-INSTALL.symbols.gz) = de3656de1e94d49bb43e6f0b21fc21ee15f2170a
+SHA512 (NetBSD-6.0/macppc/binary/kernel/netbsd-INSTALL.symbols.gz) = c90cb34afa99a7ceb8ba3742a0a4b7bd59da93ecb4aca1ff1a540d18d540947446467627e3df717bb880f1b0a567336316bc8a2d59026a7a8f6935eca93984ff
+RMD160 (NetBSD-6.0/macppc/binary/kernel/netbsd-INSTALL.symbols.gz) = b617db2dfd9b44f855f06b777f4c69680115ed27
+MD5 (NetBSD-6.0/macppc/binary/kernel/netbsd-INSTALL.symbols.gz) = c90b9ecfb302f54de790366b2e17b625
+SHA1 (NetBSD-6.0/macppc/binary/kernel/netbsd-INSTALL.gz) = 661d08043304e74da8232e5d14d1f4f748762510
+SHA512 (NetBSD-6.0/macppc/binary/kernel/netbsd-INSTALL.gz) = e4dec9781eea446f078df552033c52e4b8df30231ecbc14131ece1f7312c8a0f98d47b06d9b66988c5c4c2ff45e8dd57e7f2715e165c431b391127f0e5c03565
+RMD160 (NetBSD-6.0/macppc/binary/kernel/netbsd-INSTALL.gz) = 99e3fd9681bd7f400de2e2206163d501b6d23d41
+MD5 (NetBSD-6.0/macppc/binary/kernel/netbsd-INSTALL.gz) = 1f1b3e39dcde937788a32ef3a4f65c1b
+SHA1 (NetBSD-6.0/macppc/binary/sets/games.tgz) = fbf69640b362df2446d7414ac3a13db100c289eb
+SHA512 (NetBSD-6.0/macppc/binary/sets/games.tgz) = d86b41d79aea4204ccf45306937a5ec45629e37873a5956c0280fd1d54cf4a808542d097f9d978fd3277791554ce8a6fb4d0ccd46e30210549d5cce1145bb499
+RMD160 (NetBSD-6.0/macppc/binary/sets/games.tgz) = fd2aed1eb51f4db522fb5163e8fde4c040b55d30
+MD5 (NetBSD-6.0/macppc/binary/sets/games.tgz) = 997ae5fb42196a787df89873be321e47
+SHA1 (NetBSD-6.0/macppc/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/macppc/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/macppc/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/macppc/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/macppc/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/macppc/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/macppc/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/macppc/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/macppc/binary/sets/kern-GENERIC.MP.tgz) = e11a4e1da81be3a4650be198c5f9fe7204991540
+SHA512 (NetBSD-6.0/macppc/binary/sets/kern-GENERIC.MP.tgz) = 924fc04dff6c7458196d0a19ec38a9a1114ef3cf5cd557aa68563c3d1d2dee67d9daf3ec72fec95c9bad8862ceb663c1f96cad61965e65c042c2723ffacfe43e
+RMD160 (NetBSD-6.0/macppc/binary/sets/kern-GENERIC.MP.tgz) = 585796f103490e30928aca2c4977a41acb990c84
+MD5 (NetBSD-6.0/macppc/binary/sets/kern-GENERIC.MP.tgz) = 5b9f58a612ad00b10d4812ce9e325204
+SHA1 (NetBSD-6.0/macppc/binary/sets/base.tgz) = a31efb13ffcb70f4f429ad018d0ca6f9bc9e1db5
+SHA512 (NetBSD-6.0/macppc/binary/sets/base.tgz) = 9746428cdb65b283fa668f63cd33cc2c0bff75e85f4357f460da4d7c0c874bbc0369170d813fa70a1f0933fc2240da6536fa1c2c2be59c6722ab3849d92a3dc0
+RMD160 (NetBSD-6.0/macppc/binary/sets/base.tgz) = c83a80159c7128c8d311c62c15776776dae0fd97
+MD5 (NetBSD-6.0/macppc/binary/sets/base.tgz) = 13ea19ca37828efa708cc77efe1a18f4
+SHA1 (NetBSD-6.0/macppc/binary/sets/comp.tgz) = 2608b27059b55a9d53c2e4fb0f6f3417aafa8293
+SHA512 (NetBSD-6.0/macppc/binary/sets/comp.tgz) = 2f6ec81a049c6c4688fc362a341d11c100ce057760eb5832fceb039ce810abde76d035a3f8e9a23fbb0f4ec3709a8729eba0e92c0f56aed9aed0779588b44bc0
+RMD160 (NetBSD-6.0/macppc/binary/sets/comp.tgz) = 566f37564d448641e6bdcbd70e87c7b9406ee78e
+MD5 (NetBSD-6.0/macppc/binary/sets/comp.tgz) = 0ab55dfc92d16a84368d2f1118b6385d
+SHA1 (NetBSD-6.0/macppc/binary/sets/etc.tgz) = 42a97230bebad52fff9236fe06f3ac0aab27f929
+SHA512 (NetBSD-6.0/macppc/binary/sets/etc.tgz) = b574a57a33d58eebac3a048823fa845d4a403e0503b21340c9cfb05ae9a743a213aa7222530c9e20d30fd90003b56366815ebcb28d085c2d9c998a73972ce602
+RMD160 (NetBSD-6.0/macppc/binary/sets/etc.tgz) = dfbd6641e45fed5e9fa425be5c8878462ff8c6fe
+MD5 (NetBSD-6.0/macppc/binary/sets/etc.tgz) = aa3881b4329b45b318e6d6f0d97ac24a
+SHA1 (NetBSD-6.0/macppc/binary/sets/kern-GENERIC.tgz) = 77f4b674c6ef5bf00c6d6173d2498ff7ebbc64f9
+SHA512 (NetBSD-6.0/macppc/binary/sets/kern-GENERIC.tgz) = f16e4dcf74059eafc235bbe7d7b59de1071b56ade3f77308bbb646fdd19e90362635125bff5f81ca92e51502c668106067ca6b377a8aec2bff708e589380977a
+RMD160 (NetBSD-6.0/macppc/binary/sets/kern-GENERIC.tgz) = 0906acf7e10f69ea769a5a58d0ffe2d1e060ba98
+MD5 (NetBSD-6.0/macppc/binary/sets/kern-GENERIC.tgz) = 50cf40ab93c7505da5fe7c9bd488abd2
+SHA1 (NetBSD-6.0/macppc/binary/sets/modules.tgz) = b2c51fb3ca33a8f70c00f9e7d49cd4b91fb79673
+SHA512 (NetBSD-6.0/macppc/binary/sets/modules.tgz) = 2cfd8f4f53c0561b8ab8aafac2c38363750be6484c21c8d670b7afb89390875893a9b549b2e28d08cdeeb81217f7e0e0fe437e09059871d4b063ffa0057bae97
+RMD160 (NetBSD-6.0/macppc/binary/sets/modules.tgz) = 9fb4d8eb95a719022a522b3e9a970cda1a416f15
+MD5 (NetBSD-6.0/macppc/binary/sets/modules.tgz) = 54914b3291b652b921239631c740dcea
+SHA1 (NetBSD-6.0/macppc/binary/sets/tests.tgz) = f87666428063cf6b980c1d284aab5894e2c3d2b3
+SHA512 (NetBSD-6.0/macppc/binary/sets/tests.tgz) = 94474f3ed0feff6b8c10299c4e190154bf4c6d579dd3edced5de901aec60c9413a921b282bc7ae0c2dd3ec49de8162204660a7fe80393102aa7ebd3318f4124e
+RMD160 (NetBSD-6.0/macppc/binary/sets/tests.tgz) = 7467da9599fb2cb270854e337b696568de24b205
+MD5 (NetBSD-6.0/macppc/binary/sets/tests.tgz) = 165d0d19f6c40d8249ddd46214a68e25
+SHA1 (NetBSD-6.0/macppc/binary/sets/text.tgz) = b3e0e6f977a3598fb6f8a377cf91a67aa21ff74f
+SHA512 (NetBSD-6.0/macppc/binary/sets/text.tgz) = 361c67a072fbfe6055fcf8436f3a84b10d92a0cc987c818a32a9f536466b285d47ef2ba39c8f04319ac0a93e7b2353eed589e6b72c3bd32f38c12aae82ff26ed
+RMD160 (NetBSD-6.0/macppc/binary/sets/text.tgz) = 3d0c5c4e3a84335431a0d6cc9b78315495e137d0
+MD5 (NetBSD-6.0/macppc/binary/sets/text.tgz) = d968d8f10bd69add51020decb7cd01bf
+SHA1 (NetBSD-6.0/macppc/binary/sets/xbase.tgz) = 63043b541de378d777f43d0a333d2112a98a4e8a
+SHA512 (NetBSD-6.0/macppc/binary/sets/xbase.tgz) = 189d8b05121b356d4fa587c46cd4bb50df1ff89a197c983dafed9ce93293ad16e82f77d14ae3ea2c8e9f01f8a5eab4d9841274d9caa7143f4d977d921d3e1a84
+RMD160 (NetBSD-6.0/macppc/binary/sets/xbase.tgz) = 3cccd55a4407632e7d7444a6919901aca686c9cb
+MD5 (NetBSD-6.0/macppc/binary/sets/xbase.tgz) = 1e9175f276efb45934e2e976787ec61b
+SHA1 (NetBSD-6.0/macppc/binary/sets/xcomp.tgz) = 9322a94973bf4e59542a1c3fe2d307f1dee362ff
+SHA512 (NetBSD-6.0/macppc/binary/sets/xcomp.tgz) = ca37cdedb39625b92d2068c8736c2d1bdadd132edbffb4bf6ea3a4b1a21ffcd5bfdd78e5aaad874be32cff4d1b98059e142c5a2192dc1f38ffb7a64e8e180a17
+RMD160 (NetBSD-6.0/macppc/binary/sets/xcomp.tgz) = 48ef59c053d4a964872a70f1350252f98423794b
+MD5 (NetBSD-6.0/macppc/binary/sets/xcomp.tgz) = fc0aa962b13c0e092657bfc3d6368284
+SHA1 (NetBSD-6.0/macppc/binary/sets/xetc.tgz) = 5ace04f9545e5ac27432bddcde0d42dd592540c1
+SHA512 (NetBSD-6.0/macppc/binary/sets/xetc.tgz) = ccdaeb27301167072fc0c98b78633c2d52b1eb4a5bf3ed5c606a646a420c7bd73e197b73d1a928c4aa17013fca5bbbd98f06fc4baa4ca97ada3a3e89490fdc06
+RMD160 (NetBSD-6.0/macppc/binary/sets/xetc.tgz) = 048fd168d184f88b2164c654594e68665dec62c4
+MD5 (NetBSD-6.0/macppc/binary/sets/xetc.tgz) = 1735140072351ccaa55f8b25cd002fd6
+SHA1 (NetBSD-6.0/macppc/binary/sets/xfont.tgz) = 2cea3fa057b220c72ba147f9821d33b18d8346d2
+SHA512 (NetBSD-6.0/macppc/binary/sets/xfont.tgz) = d76f6d6613f96475c85427792ad339576815f1423ae7e84018944d31cb66aa6ec14f2a8886f0912963745293326812a7efb8b1d2f08a6ee27da8fbf53c3223d7
+RMD160 (NetBSD-6.0/macppc/binary/sets/xfont.tgz) = 42190ebf50a1db179d8d7b1bdd1aa3e86082ac77
+MD5 (NetBSD-6.0/macppc/binary/sets/xfont.tgz) = 752888a1280d52af5e6b3c79287738e4
+SHA1 (NetBSD-6.0/macppc/binary/sets/xserver.tgz) = 4c9ca17aec65f27a569ee9e6ed4af95ad3b9cd21
+SHA512 (NetBSD-6.0/macppc/binary/sets/xserver.tgz) = 208d60880438a476ecacab3a4ab5872007c2728cafe16022cee9c0d781ce4dd8ef95d302ac9212a1a66b825869dc35c8df096d9f7c97a97054cf963ba58418fa
+RMD160 (NetBSD-6.0/macppc/binary/sets/xserver.tgz) = f0bd1020d51ed7036593840c49bfaee57e09e58c
+MD5 (NetBSD-6.0/macppc/binary/sets/xserver.tgz) = c241cf0caa30e6ae203fef4c95d2d74d
+SHA1 (NetBSD-6.0/macppc/installation/floppy/boot1.fs) = 053808f21cbc6acc50469ffa2a6c48471bfbf8fe
+SHA512 (NetBSD-6.0/macppc/installation/floppy/boot1.fs) = 82f844d8ee09d09a5cb06ad8cf8131826ad9e8c38a289e95757d6b9664b0aff4e30743ba750dd7ea780d556b4aa619388fbbef8727c52b302e314b08a6853306
+RMD160 (NetBSD-6.0/macppc/installation/floppy/boot1.fs) = 291a7e7bd8b98758f2dce412054abbb69c6cf4cb
+MD5 (NetBSD-6.0/macppc/installation/floppy/boot1.fs) = 369cf1bf5a69c9220d3ab6213c0a10d1
+SHA1 (NetBSD-6.0/macppc/installation/floppy/boot2.fs) = 46098cec194fe5de4ffc1b66508397916cabd968
+SHA512 (NetBSD-6.0/macppc/installation/floppy/boot2.fs) = 25ed41f6712ae333101fb168cdafbdb4c4dc677e4a0c701665d02758202af2238a2a53828e833b0917ac0547ea34a1a1c95f8b9018084ff9053bbba985814b91
+RMD160 (NetBSD-6.0/macppc/installation/floppy/boot2.fs) = 9e743d123b1f43953743e347218ad29f022822be
+MD5 (NetBSD-6.0/macppc/installation/floppy/boot2.fs) = 05843ccdeb93f326ddad69e810303fe5
+SHA1 (NetBSD-6.0/macppc/installation/ofwboot.elf) = a013bc2f2d4d39cf9e56b0d625b6c48d08bb455d
+SHA512 (NetBSD-6.0/macppc/installation/ofwboot.elf) = d28569738cfad70b6d5aef80b32e9d44f38dc5038f38143bf93f78eba708ff05e9a7955c03a682833ace2cd20daf4adb1a3c36956768e5f2b08fb59a44573854
+RMD160 (NetBSD-6.0/macppc/installation/ofwboot.elf) = 9a9f54b00b80d91a934e83cb17a68b15a9fe8c00
+MD5 (NetBSD-6.0/macppc/installation/ofwboot.elf) = 2d4598a059853f8f7e99541afcf6e31e
+SHA1 (NetBSD-6.0/macppc/installation/ofwboot.xcf) = a15eef375d155080b6809e2db46d0475baebd872
+SHA512 (NetBSD-6.0/macppc/installation/ofwboot.xcf) = 4756b6eeb05754185c16ff02e9d98642ae75c3545b385a67870e58b8211feda3ce265eaf020ca5252e9c47fab64922d9af8eead98b2cff798c58af9840fbd345
+RMD160 (NetBSD-6.0/macppc/installation/ofwboot.xcf) = 1654bc8a15f5d3c2bb248033cbfbc37ca23980a7
+MD5 (NetBSD-6.0/macppc/installation/ofwboot.xcf) = 84cc2385de486f3e72868ab7c75c8683
+SHA1 (NetBSD-6.0/macppc/INSTALL.html) = 9752ce3a0ae1964208f027404c5aa3b526efe08c
+SHA512 (NetBSD-6.0/macppc/INSTALL.html) = 71dbe4d992bcea022b1aac0dbdc3cf596a7538bf3fd2de390925094bfaa5cb1f71e332a2eb419cdfa1528cb7951c92491b3b3d7b88cd9e4c40f81af0a8ea34b2
+RMD160 (NetBSD-6.0/macppc/INSTALL.html) = b5e2c12fbcf7fcf56e6e9354b178188c88e772b2
+MD5 (NetBSD-6.0/macppc/INSTALL.html) = 31c92f0b3c87409d1d74b17912f05333
+SHA1 (NetBSD-6.0/macppc/INSTALL.more) = 7b4f4aa288bbbacca5a7f69f7fb1dde30b6a67e4
+SHA512 (NetBSD-6.0/macppc/INSTALL.more) = 7ab24e82eb0b779f11e16b10982fb82d6831058b0a51b57c2abbb0c91f09daa92a7a724c18f775d551b6bc4b8bff36eb91b6a823d2f9810a478180c50f9c676e
+RMD160 (NetBSD-6.0/macppc/INSTALL.more) = 7bc31a39cfc1017821c29032432a8765af7b240c
+MD5 (NetBSD-6.0/macppc/INSTALL.more) = 0a198a6d31ac02b702c103117400eafb
+SHA1 (NetBSD-6.0/macppc/INSTALL.ps) = 9a14912c8a58fc4e6d004dc2426c189b991d5e6a
+SHA512 (NetBSD-6.0/macppc/INSTALL.ps) = 94ffb000d582ea09c0f3d4e0b6e757f0bbbe50e6793d33e3e3ec29a0da26a0130f23c778e19e681892ceab4f440dc01d37b206272d24aa96c9ef3a9a6c49ed0e
+RMD160 (NetBSD-6.0/macppc/INSTALL.ps) = edde76230d345a53de93bb00af333be03971d0dc
+MD5 (NetBSD-6.0/macppc/INSTALL.ps) = f275f19c885be2a1ca922cff1561b5c8
+SHA1 (NetBSD-6.0/macppc/INSTALL.txt) = e7e55b4231206d5fc087d6ad0c4b8ef52a73e385
+SHA512 (NetBSD-6.0/macppc/INSTALL.txt) = 51f4462c903b0948ca5634bf27a9988924cfc3a8249310f1c5f2fc3c8372e9ab916cf106fa7bd9153ccc44454a1fc298024214575f43bf938a7e8a8a18163038
+RMD160 (NetBSD-6.0/macppc/INSTALL.txt) = 8213d05b6c035c0932159f098633921ab6d79247
+MD5 (NetBSD-6.0/macppc/INSTALL.txt) = 319bfbce37725d2bbafa032c7891529a
+SHA1 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.ecoff.gz) = c7357a28d27e6ba6fd9a1ca72b7f0d0d95c23089
+SHA512 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.ecoff.gz) = 3a0fbe1a79b886094cbb8a3613d3193d2731dbace050847c6d70ee8961b4d0e0dbf2f5d666e5f6c43e5ee2871ef9c59823b5fcadbf2dba16144f8c13e778c821
+RMD160 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.ecoff.gz) = 12b0c1cda3875379f2cd582b5eac8316d9fec2f4
+MD5 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.ecoff.gz) = c24f3d6e9a289d321c0ee250817cd348
+SHA1 (NetBSD-6.0/mipsco/binary/kernel/netbsd-GENERIC.gz) = 188a82d7aab86e27f7defbd0318c12deb06a5200
+SHA512 (NetBSD-6.0/mipsco/binary/kernel/netbsd-GENERIC.gz) = e6c278b3bc3e93137e2a0ccd894420671dc3d8f880b08aa673e51b758d88667fd416b317b90e1eaa72087a8b97322ce629f538f7daf2bc7746f0209d00e3d2f4
+RMD160 (NetBSD-6.0/mipsco/binary/kernel/netbsd-GENERIC.gz) = 19b32d196282fccad2907b3972d0bd8673b0b63b
+MD5 (NetBSD-6.0/mipsco/binary/kernel/netbsd-GENERIC.gz) = d91b37f1b364bf92609c4cd56e738873
+SHA1 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.symbols.gz) = cfae9b61b6577966f0bf0f99e4592ce788f2e047
+SHA512 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.symbols.gz) = e100ef50b40411ee3886ec6b0a77ac45459c4a50b1f5b6fee1961aecbef6ee4fcc5a4a1a215eeaefcf5a47407a3d907848e09fa0299be61acb7a93da813da77f
+RMD160 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.symbols.gz) = 1e65145861489b78275308a994aca38a4e60e3d6
+MD5 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.symbols.gz) = 5a441172f0a1659f405e7db91dcbdbc9
+SHA1 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.gz) = 517897ab45650448a730ae2d9df177e3858c7ecf
+SHA512 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.gz) = c8f2a2b0e243000b5c6a134b1c822e40cd454230039ed39a147320e049a8c4b8f540ba32613a1a189455d2f14f56b2291549b3cc40a16c65baf451e5e6005874
+RMD160 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.gz) = 7a428cf2e424233910e6941975b984f54639d581
+MD5 (NetBSD-6.0/mipsco/binary/kernel/netbsd-INSTALL.gz) = 989821fb043e7208eb7464b9cc3d6faf
+SHA1 (NetBSD-6.0/mipsco/binary/sets/games.tgz) = f56d3e5181634f6a3d7908dcb002ebcb1c5aaff0
+SHA512 (NetBSD-6.0/mipsco/binary/sets/games.tgz) = 0cff50ea13e34fe338edf70da6a28af061580feb4cb0773828adefa631ebd471a96568a3b30ea0f13f3bb116856a1b6aad8a5a52443346f52e4907f4caabc5f1
+RMD160 (NetBSD-6.0/mipsco/binary/sets/games.tgz) = 1538910578dbb8eee2931200fac0ccda44758e5f
+MD5 (NetBSD-6.0/mipsco/binary/sets/games.tgz) = 2bd5bd0ce72df5cf92767b8c3f7cc208
+SHA1 (NetBSD-6.0/mipsco/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/mipsco/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/mipsco/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/mipsco/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/mipsco/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/mipsco/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/mipsco/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/mipsco/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/mipsco/binary/sets/xbase.tgz) = d81c7fe75a90f1b2111a066e78f1f2b3e8edcd8c
+SHA512 (NetBSD-6.0/mipsco/binary/sets/xbase.tgz) = c241391fcde4a685a0a2af6f843844ac2e918024c447a2b5ea2cf5300f69acc42fdadf53d3b0348f10723b786bcc0f420e68fe36228375bf3cb5140de41eb40f
+RMD160 (NetBSD-6.0/mipsco/binary/sets/xbase.tgz) = 2fbf60b64c0b7ac2be72ebf998d9d7390fc40705
+MD5 (NetBSD-6.0/mipsco/binary/sets/xbase.tgz) = cd23ca0f6b359c4d695d4494a147d40f
+SHA1 (NetBSD-6.0/mipsco/binary/sets/xcomp.tgz) = c8f5ff5ea9f9bbe231f92d8b7f3bfcbd2897069f
+SHA512 (NetBSD-6.0/mipsco/binary/sets/xcomp.tgz) = c7590075195019078b68ec5f87e36479ae2e7b7749c523df4ef21c9d881c343cda9f5c2bba897dd313329a76fe5c18e920d92827878d98ce08a7dc776352cd02
+RMD160 (NetBSD-6.0/mipsco/binary/sets/xcomp.tgz) = bc60e267cb6e11b4a7305f8b7074084e179e0ff5
+MD5 (NetBSD-6.0/mipsco/binary/sets/xcomp.tgz) = 8e58ee51667def3bd015f79769c0d932
+SHA1 (NetBSD-6.0/mipsco/binary/sets/xfont.tgz) = c551bd13179b9508c2e3a7e19cec323e8ba21844
+SHA512 (NetBSD-6.0/mipsco/binary/sets/xfont.tgz) = 764527f2f3f4686759fcae3fd093f4e00f34e1249994126221a6f9afe73d4cf8ddfbe8b8311798da2ed38c52466a44bb26ea08ad5aab1c08eebcc9019b4223f7
+RMD160 (NetBSD-6.0/mipsco/binary/sets/xfont.tgz) = b3a365bedf8b4a20f3920d0e33b9a42fce288953
+MD5 (NetBSD-6.0/mipsco/binary/sets/xfont.tgz) = adac8939da213a0195cc1d351f979199
+SHA1 (NetBSD-6.0/mipsco/binary/sets/xserver.tgz) = 686f6e6d722c9676351ab058736f7077b4ebd2f6
+SHA512 (NetBSD-6.0/mipsco/binary/sets/xserver.tgz) = 5c818f22edbeac7325228af99d6da6e44b5eb659c7c9fcc6b332071e97a0a490081eda7f9e0f22d6a3f3a589ae34179b434751a6191db5c664683d7510aecedc
+RMD160 (NetBSD-6.0/mipsco/binary/sets/xserver.tgz) = 0e9f066095b505c7f062bf877147189a7a2f0649
+MD5 (NetBSD-6.0/mipsco/binary/sets/xserver.tgz) = cdd2e5127838437df40af161e0c8398f
+SHA1 (NetBSD-6.0/mipsco/binary/sets/kern-GENERIC.tgz) = 814522219e9ef7544ff09e8a1aeec2544e62e456
+SHA512 (NetBSD-6.0/mipsco/binary/sets/kern-GENERIC.tgz) = 2e81957dd87b68e9f3b69b89d1eaf2f1cea45ea237558bc50e953d1d4987e86bd1fd7701f00971b252df35c8dfa8c006b1777c5941ee4385894680346aa3f286
+RMD160 (NetBSD-6.0/mipsco/binary/sets/kern-GENERIC.tgz) = 00a21ba72b46c7d743c2255d02a5fe462ac90774
+MD5 (NetBSD-6.0/mipsco/binary/sets/kern-GENERIC.tgz) = 85c821c524ccbfede1d34c6436de595e
+SHA1 (NetBSD-6.0/mipsco/binary/sets/base.tgz) = 1a989a4f1f5bd6aa082d2af9c9e339530994e710
+SHA512 (NetBSD-6.0/mipsco/binary/sets/base.tgz) = 0b0029d19eba066306c386aa7569a5af8ce9e2d4e12f73539cceabb3bf3eb9696f006b0fefda001cef488fe4db40a3b519928fa139fd025c8e95669a2b7fddec
+RMD160 (NetBSD-6.0/mipsco/binary/sets/base.tgz) = 30de7c1cda91944523275d184e5629beb3be54f8
+MD5 (NetBSD-6.0/mipsco/binary/sets/base.tgz) = dbf30b2affc7c471b1488c36fab8c383
+SHA1 (NetBSD-6.0/mipsco/binary/sets/comp.tgz) = eae1cdcf3ca993f6903f7c0315b3bded0cb19954
+SHA512 (NetBSD-6.0/mipsco/binary/sets/comp.tgz) = a777f285e5b72c5cd21eae29dc374956a80b738acd11f13d536513cb30a31273043c8c73554e4d227df99d4ef7d20f15bcc8fafc1af1c16718dbe6276c28f5b9
+RMD160 (NetBSD-6.0/mipsco/binary/sets/comp.tgz) = c4dcbd1a3ddec8bf1dddd2ec18d6d9de13dddcb8
+MD5 (NetBSD-6.0/mipsco/binary/sets/comp.tgz) = 2df422a2c23ad3357f41a02d305ca753
+SHA1 (NetBSD-6.0/mipsco/binary/sets/etc.tgz) = 4035cdd82aad7dd4b19ce7b4f18f93de45b4a35a
+SHA512 (NetBSD-6.0/mipsco/binary/sets/etc.tgz) = 8df26b3954bda34cd79ee7036056c166654d36d642c7abddd10caafb0f6692bd745a1f336047de01dcefc32060712559b82ea4381dbb1c3d90eb962a798e9ed0
+RMD160 (NetBSD-6.0/mipsco/binary/sets/etc.tgz) = cb67e9de5fb8560ab973dd6dd877f856582c0538
+MD5 (NetBSD-6.0/mipsco/binary/sets/etc.tgz) = 7cc0cebd7f9c62e5e2cd7fe61e041a2a
+SHA1 (NetBSD-6.0/mipsco/binary/sets/modules.tgz) = 17b0db51acea9fb430bf4f9ee65a3d10b7e01747
+SHA512 (NetBSD-6.0/mipsco/binary/sets/modules.tgz) = 4b60e6a7405c8cdda48f8c85723b4245f3af0f31c333090bc3833f203606d91cdf067a02a9a179956642b368d4f78d1da53cb48bb783a0abf24ac5a1c56681cd
+RMD160 (NetBSD-6.0/mipsco/binary/sets/modules.tgz) = 34019b1b1080db5d84607337765c6fb19c103651
+MD5 (NetBSD-6.0/mipsco/binary/sets/modules.tgz) = f53620978a24bc909f9555125ddc6416
+SHA1 (NetBSD-6.0/mipsco/binary/sets/tests.tgz) = 528b2898dfd85f9c51f382d31f357ff470fccbed
+SHA512 (NetBSD-6.0/mipsco/binary/sets/tests.tgz) = fb52dddb334a13e19dfd657aa165a2be4c9ed546e739d337141735927c74ed444c63a2ccfc7676ddc7301ade3bd9b713ac238a3cc37b8716705222856f26edde
+RMD160 (NetBSD-6.0/mipsco/binary/sets/tests.tgz) = 4bf30f676d0c7cdb6838ea7807c505de82372884
+MD5 (NetBSD-6.0/mipsco/binary/sets/tests.tgz) = a150e930291903d9751319a92ad116be
+SHA1 (NetBSD-6.0/mipsco/binary/sets/text.tgz) = 01174401e42d87684ed569f3001994142451fe29
+SHA512 (NetBSD-6.0/mipsco/binary/sets/text.tgz) = 8f2c57883df809889d5371730ff738429f147eb659895ef3bd25c23a1c78ed3baacee1e09d82630daa92b9dc5810167924537cdcb1234536acbc02269acbfd2f
+RMD160 (NetBSD-6.0/mipsco/binary/sets/text.tgz) = 690f4481c50ab0bcd2a2773e762f250b60a7d088
+MD5 (NetBSD-6.0/mipsco/binary/sets/text.tgz) = 0bb0dfa52358016da848c0783a4e9ccd
+SHA1 (NetBSD-6.0/mipsco/binary/sets/xetc.tgz) = 1824720386f5e1fca6135a77aad15444221ffd3f
+SHA512 (NetBSD-6.0/mipsco/binary/sets/xetc.tgz) = 1f752393b0913fa39f222eb8cff44c9c4b8045008459e2c2122748114a5c69c684153aed737aabceb9fde1cb4852527d6f4375be177b6f8e270aaef9a3360ab7
+RMD160 (NetBSD-6.0/mipsco/binary/sets/xetc.tgz) = 346eb417698387537bd483d12d70796c968c970a
+MD5 (NetBSD-6.0/mipsco/binary/sets/xetc.tgz) = d9822dfdedccbf5fbd3bf6ab9b178186
+SHA1 (NetBSD-6.0/mipsco/installation/diskimage/diskimage.gz) = 7f3836f8a683b1bc03880af9a5440ce0c43d45be
+SHA512 (NetBSD-6.0/mipsco/installation/diskimage/diskimage.gz) = 1c513851002df0e3d6d11e33b5b62df96547e75c300c22737be8f553613404d94dbddf036cb2a00707b8d23b00a14ab3b37fd2251fa0f04b05ab35fd13c241a8
+RMD160 (NetBSD-6.0/mipsco/installation/diskimage/diskimage.gz) = 8b22ef52868c3da50f224a8663683a990816d87e
+MD5 (NetBSD-6.0/mipsco/installation/diskimage/diskimage.gz) = 0264b27319b43fd4e9c8c74e0478dac4
+SHA1 (NetBSD-6.0/mipsco/installation/netboot/diskimage.tgz) = 62ce9d94cbc2d187ef03f9c4c22f0d865c482500
+SHA512 (NetBSD-6.0/mipsco/installation/netboot/diskimage.tgz) = 4b53601368b9a70e6391efab32547a038c5b05b39ac73c1677f8b1317ca0d0458d1178218aa5457d8e0d8545a1f2a20e65e200c3e8d8b04e395d11886e30c22c
+RMD160 (NetBSD-6.0/mipsco/installation/netboot/diskimage.tgz) = 8da2d5476ab14c8f44c732fc07202a234d5b4abc
+MD5 (NetBSD-6.0/mipsco/installation/netboot/diskimage.tgz) = b83ebc427977f9b30679b06765d6babe
+SHA1 (NetBSD-6.0/mmeye/binary/kernel/netbsd-GENERIC.gz) = 93157fd963d5e5967b626593297490082c21b426
+SHA512 (NetBSD-6.0/mmeye/binary/kernel/netbsd-GENERIC.gz) = 300868a582f1eaa960d0d211374ca563a7a5f8347239b178a368ad3c527ee8ef76ca54628fbacc01521903cda04309b666953e1136d1f1fa8ddd28a046d1182c
+RMD160 (NetBSD-6.0/mmeye/binary/kernel/netbsd-GENERIC.gz) = 7da72149fd4cbd471bf3abf076a4f33c8dc0a3a5
+MD5 (NetBSD-6.0/mmeye/binary/kernel/netbsd-GENERIC.gz) = 053862a7ced67c229e688793b99d2fa1
+SHA1 (NetBSD-6.0/mmeye/binary/sets/games.tgz) = 37e15b0950aaaf1af36427ae5dd5866c1879b6b3
+SHA512 (NetBSD-6.0/mmeye/binary/sets/games.tgz) = e674abb1b1966acbc581a8f8b3e37841f48656e66f3302077cbb2de443487912b99521336ec5dc096fa3c7769b2d7623e1d1720a079407ec1861d32159a72ebc
+RMD160 (NetBSD-6.0/mmeye/binary/sets/games.tgz) = 36070071e8315d2352be1b3e563ce7ef7625d184
+MD5 (NetBSD-6.0/mmeye/binary/sets/games.tgz) = 0016145b46957b95dd158b4441dfb010
+SHA1 (NetBSD-6.0/mmeye/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/mmeye/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/mmeye/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/mmeye/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/mmeye/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/mmeye/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/mmeye/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/mmeye/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/mmeye/binary/sets/xbase.tgz) = 564bce6dd7c37b5e941e41d50f363c133fdf8f97
+SHA512 (NetBSD-6.0/mmeye/binary/sets/xbase.tgz) = 23b3306254c789331542e63974f9d7cdc54d99ba2cd67cf6a1c97f09afa4f6cf6aa8798e37b7c38f4a55afd1572154f291fa1bf2e2a1fc87165fd6bd7f89fb80
+RMD160 (NetBSD-6.0/mmeye/binary/sets/xbase.tgz) = 476fbd8301bec0795a01552728ada44204d2dbe6
+MD5 (NetBSD-6.0/mmeye/binary/sets/xbase.tgz) = 9fbbbdb3acfa4ccd9f0b309ea0ed0700
+SHA1 (NetBSD-6.0/mmeye/binary/sets/xcomp.tgz) = 526a278a13833073e6231e879abdec85400ca888
+SHA512 (NetBSD-6.0/mmeye/binary/sets/xcomp.tgz) = d2081a7536e3d7fa27a363afd8f6eb5fc3de4606f11b4857be2f1df59934da9d3d16e0df3a6edf4cdf52c8f579e0e4c06f07de0959b5213c21be1a8fdc2ee134
+RMD160 (NetBSD-6.0/mmeye/binary/sets/xcomp.tgz) = 4a767ff08e9bcf98f886849cabebd1300397256f
+MD5 (NetBSD-6.0/mmeye/binary/sets/xcomp.tgz) = a23a2d8be9298497b4b6d39fda330bf4
+SHA1 (NetBSD-6.0/mmeye/binary/sets/xetc.tgz) = 93a5cfbbfdc641f91ab363d4b65d1158d71c0cfc
+SHA512 (NetBSD-6.0/mmeye/binary/sets/xetc.tgz) = 85a67734801e81e129a37b73ae62211459fb16d4e52a945ef21a4bb908dd7d1d775233956086dd3d59af45bcea24fbd6f54a2a9175756d242b57e07d10767548
+RMD160 (NetBSD-6.0/mmeye/binary/sets/xetc.tgz) = 6fb055d0e1b6264bf1ec396236d903218832377a
+MD5 (NetBSD-6.0/mmeye/binary/sets/xetc.tgz) = af954b56e624948145b91aa451d77392
+SHA1 (NetBSD-6.0/mmeye/binary/sets/xfont.tgz) = 6139c05273b6feeecdfcd11cbe0da91256d12a11
+SHA512 (NetBSD-6.0/mmeye/binary/sets/xfont.tgz) = bb849454ede88d39ca60d6c513c833c2b29ea548adedb9f76870839174a3daa838d38a6ad701c78bfc164e690c5ebda9c9d00d4c23ad816df9f1962313afdbf2
+RMD160 (NetBSD-6.0/mmeye/binary/sets/xfont.tgz) = ea8f123f9f78b429b77ff15c924803da1da2068d
+MD5 (NetBSD-6.0/mmeye/binary/sets/xfont.tgz) = a87cb6769c37ae20dbf0dd70cef93d11
+SHA1 (NetBSD-6.0/mmeye/binary/sets/xserver.tgz) = 6cd4fdb0ff00ef5d89b47e68e538c86e395b2054
+SHA512 (NetBSD-6.0/mmeye/binary/sets/xserver.tgz) = e3b575cab95e297a05a26a03eeff0cf843d665ebdfd103846ad544bef1d04f93aa20ceab09b1dfaae8f59d89ebb1cbef400b7521bdb41f7542f23156540aa4c0
+RMD160 (NetBSD-6.0/mmeye/binary/sets/xserver.tgz) = 7e52b98276b4d097f7babe918e6768ae9d7945db
+MD5 (NetBSD-6.0/mmeye/binary/sets/xserver.tgz) = a505ab4ce0801aabe21fe6038b63809f
+SHA1 (NetBSD-6.0/mmeye/binary/sets/kern-GENERIC.tgz) = e14c11631e2e88e3b57b7d20fc3c645faf18fe37
+SHA512 (NetBSD-6.0/mmeye/binary/sets/kern-GENERIC.tgz) = 29dfa7b68e616b6192620316e85972381e7c104070f2570a4222b22c738eddeebd3d8a49518f64adada548f3cbc31a2c501db6f186d7c2fb4178cd9187d7e289
+RMD160 (NetBSD-6.0/mmeye/binary/sets/kern-GENERIC.tgz) = b4289ab1966d34a7fc19d6736c374e98c969f2f0
+MD5 (NetBSD-6.0/mmeye/binary/sets/kern-GENERIC.tgz) = 6469d2d171a8a4bb99ec9a396d43c4b1
+SHA1 (NetBSD-6.0/mmeye/binary/sets/base.tgz) = f26be3019cb31f22bea52c431ec65026536117d8
+SHA512 (NetBSD-6.0/mmeye/binary/sets/base.tgz) = d595fa01b6176f11dd722a4c0416e83975fabb7669cfb018b364681a82c1fab6d456e35aee5c1e8f62d721708976da1ddea203ba31c782265d95dadc046080b8
+RMD160 (NetBSD-6.0/mmeye/binary/sets/base.tgz) = d08e45a281fa538ba47d5e01b7ca7d2c34d05847
+MD5 (NetBSD-6.0/mmeye/binary/sets/base.tgz) = 3a7f10d4e415aeeab19f10c6cd9683e6
+SHA1 (NetBSD-6.0/mmeye/binary/sets/comp.tgz) = 0e37635ed1c12873ba9443f765fa8ecd7441aa43
+SHA512 (NetBSD-6.0/mmeye/binary/sets/comp.tgz) = 2528bf14ced0b15c49452d705cb60cf9e33187fc759920e4e400fc7a2cbb140efb4e46a135a3c06b7c8b4ae9a2b06094e4f14b32372d3b744d0d898818ac0e4a
+RMD160 (NetBSD-6.0/mmeye/binary/sets/comp.tgz) = 51bee8a0d676f8f51918b76a816ddd417cc38a6b
+MD5 (NetBSD-6.0/mmeye/binary/sets/comp.tgz) = cb209fc3bf35ff197cec755c15879f27
+SHA1 (NetBSD-6.0/mmeye/binary/sets/etc.tgz) = 574390c9066c5a2867c217726a60c5b0fcd954c6
+SHA512 (NetBSD-6.0/mmeye/binary/sets/etc.tgz) = 29f0fdf264263ddca8a04e2a645999127bac3025daf2ee560647f4d15fbaec3d929c725256244fa561ee69d8eddf4c9439d81629894dcccba13d063ec1a0d70f
+RMD160 (NetBSD-6.0/mmeye/binary/sets/etc.tgz) = 5e68a1f6a88a56e63788525987bcbef81314cfd0
+MD5 (NetBSD-6.0/mmeye/binary/sets/etc.tgz) = bb1639782d6f4027a7b872732e0f819c
+SHA1 (NetBSD-6.0/mmeye/binary/sets/modules.tgz) = d687589906a811d0ecf22c89bf54248326aa0bef
+SHA512 (NetBSD-6.0/mmeye/binary/sets/modules.tgz) = fd536f114ba71d1ed7241a81f89af7d26a8b554b6fa12ccb16d2d4e6e23029be66fbf4d2cb4990c65102bf3206972ca00a329c6a6c8cb86ad283356aa38434bc
+RMD160 (NetBSD-6.0/mmeye/binary/sets/modules.tgz) = c2bde6622408d084a8ed7fbeafce2260220c5560
+MD5 (NetBSD-6.0/mmeye/binary/sets/modules.tgz) = d833b7a1b95c96a2fb4c526ddc7b6a62
+SHA1 (NetBSD-6.0/mmeye/binary/sets/tests.tgz) = 28c07cc4ab9c6688c615ecfae68cdd7afeaf627b
+SHA512 (NetBSD-6.0/mmeye/binary/sets/tests.tgz) = bdf6463ad028eef4bfb3feb78d43924c4c176b8195509d25d1f98cc772cd1d4edf1820497dfb1baee7dcc142d0e64e78d3203feab0636fe4d821a4cd64250459
+RMD160 (NetBSD-6.0/mmeye/binary/sets/tests.tgz) = f10cf5b11bb96eb0be1c08f698897cb2c609c2f8
+MD5 (NetBSD-6.0/mmeye/binary/sets/tests.tgz) = a0f6fcd15874d6439da5f852487e3539
+SHA1 (NetBSD-6.0/mmeye/binary/sets/text.tgz) = 59d1600b40b17a4c0459e6b3e0a0c2cff1194270
+SHA512 (NetBSD-6.0/mmeye/binary/sets/text.tgz) = 0c44d1c586ad834e2ecca5bf57e88d3315e19341deefb36e8f9584d22328fa255d9e7c26028091e8e0465aea5e68ead7fe343138f54cd219c69eaeb7facdf85f
+RMD160 (NetBSD-6.0/mmeye/binary/sets/text.tgz) = 258e107b924fc698dd9ac2933f4b040374cc9291
+MD5 (NetBSD-6.0/mmeye/binary/sets/text.tgz) = 241e3f6acd2a44f23f1368c4897ea43a
+SHA1 (NetBSD-6.0/mmeye/INSTALL.html) = 307db90e852c93274d4d475013aa29db682ad785
+SHA512 (NetBSD-6.0/mmeye/INSTALL.html) = 6a10441885d95313036134e897f41508c5823386532d4e57e33d693164d8a6a727f39aad44e3606b614cd037eed7096a2c88962b495f1915dd9db0f1165897dc
+RMD160 (NetBSD-6.0/mmeye/INSTALL.html) = efd26420ebc8e2bbca8e756d05a8978b3c8f6a21
+MD5 (NetBSD-6.0/mmeye/INSTALL.html) = 4074818595561d15e823f3fcf0e319ab
+SHA1 (NetBSD-6.0/mmeye/INSTALL.more) = 508b142e63e52558c975e9b9e8d3ddd5f392f47a
+SHA512 (NetBSD-6.0/mmeye/INSTALL.more) = da8142dcec08c7c1dd64b680e987abed58c6d8685c93c66fc4b1218f18cb64c626949d841b5ee379a09a0b8d1ae8af12a2690d8dbc4f768497f1c3e8e646f377
+RMD160 (NetBSD-6.0/mmeye/INSTALL.more) = 58a81c1cc83e5033ab3a527190e7ee1fae534d76
+MD5 (NetBSD-6.0/mmeye/INSTALL.more) = 248b67d9ac8e481bdfd7952cef78a14e
+SHA1 (NetBSD-6.0/mmeye/INSTALL.ps) = 4bf1609d1513b6e41cfc5cb480dee72432e5a416
+SHA512 (NetBSD-6.0/mmeye/INSTALL.ps) = 691a138a6af72a7e42cc03c71d6bcde5c210ec570507ee25333e1ef9702aa689be0c7d46009aea72dc1dbca93c52a46f1745c1dc985725fa5e63922c4f5927e2
+RMD160 (NetBSD-6.0/mmeye/INSTALL.ps) = 4387c8bab777418797ccf13a05abc4a085b28fab
+MD5 (NetBSD-6.0/mmeye/INSTALL.ps) = 98a48fdc04e24e9d6976363721d644aa
+SHA1 (NetBSD-6.0/mmeye/INSTALL.txt) = 75f5b090195d57c0542212c1b5eed5e5ccd3297e
+SHA512 (NetBSD-6.0/mmeye/INSTALL.txt) = 7c1310578154afee26aa66db4198dc5ba98b9f985f05c9e6a3847fe88e947e1161d541527dd1986ff3ca20ad92468483a2195013ccb8d16e89914006f1d0b566
+RMD160 (NetBSD-6.0/mmeye/INSTALL.txt) = e05dd82511b132d9047eddeee16043524246867b
+MD5 (NetBSD-6.0/mmeye/INSTALL.txt) = e3de50b8b8480113536fa86b62245902
+SHA1 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-GENERIC.gz) = a13aee658df1b52a7aaf3029d425e922ec26d4c1
+SHA512 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-GENERIC.gz) = 218d038a60dc542188f10c56e096434ebd26acddb4919ceb7ef4263ee85a3d25c60e9265683298fccfdcdb6b7d155138428f5029d37c11455d8f49077e0753cc
+RMD160 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-GENERIC.gz) = 5963381f5dff4d47bd58e488fdead7f9e4886d26
+MD5 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-GENERIC.gz) = 86d45589986fb0bb05dc8c7dc77278a1
+SHA1 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME147.gz) = ea20eed9edbc71eca530c3280770e6f8b09fa270
+SHA512 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME147.gz) = 75a7255373b228b1932477a121111add15fa0ec8b03594794c6b6e3c45055f7ca2be29923b263ffab7ab51b3c9bebc9d8280ea701916b76f581dcc18bb510584
+RMD160 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME147.gz) = ea31d6a830019327b2c3435afdfd947d8464ef23
+MD5 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME147.gz) = 15c5a42f970736283e7a6a0849bd86d4
+SHA1 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME162.gz) = 041755caacc323b08d0d4bc7d7d50fb178374f24
+SHA512 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME162.gz) = 0f9165f9574da412d25c74601c42f6678b78ae78c04b0eb0753dce9266289fb656071115c32425e79dbb88df2482971d3808095228ce56fa7124ba34a396b0d2
+RMD160 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME162.gz) = d93f72e9bf72b15a7f740977f51270620e17afe6
+MD5 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME162.gz) = 0c35781afea5d9df108ffe2ff82563f9
+SHA1 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME167.gz) = 4ede6bb44a66a1ca0582e2bd6b38d94dc66e5c22
+SHA512 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME167.gz) = 33feb4ceaa5352e85ed445bb355d997181f69cfe2b08de57a631be7c93c85cb1f42d052bd6de489f6ac631c88c77192785d170e41c0ec6315b88fd429d88f3bf
+RMD160 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME167.gz) = 6768bab2219da0e3ef78324a701e0fb112c18153
+MD5 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME167.gz) = 6e65873511ff8bb90d721f0c2e559bf4
+SHA1 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME172.gz) = 01ee771c809080dce253e2acbce1bcdfdd46b055
+SHA512 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME172.gz) = 65e0680d9ce92aed2ba08971a434f2a290ccf9f85ce3365327ec8185c5d57e1bdf08593c5ff18e3c0e6581c78ceadd570d25fb1e714edd7896fca09fae727695
+RMD160 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME172.gz) = 93136f2a9773f5e243622e756ea3969c3732403d
+MD5 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME172.gz) = 08a73d99398505743b3de4f5394ffdd7
+SHA1 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME177.gz) = e884157c76ca076bd53f3c1752b4f95ade2eacea
+SHA512 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME177.gz) = 13a0a7e5c50848593ccbf5876cf27988b138582fff9d4f140cc3b63b9d768163ddea65752fd0676614ccbb85f64d0efdd3611ff2fce31837afb9acebcdb63657
+RMD160 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME177.gz) = 898154c89255fca36e0ec7051638b32cfb541dfd
+MD5 (NetBSD-6.0/mvme68k/binary/kernel/netbsd-VME177.gz) = 77d2383aa5faff6ecc139af1e7dc51fa
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/mvme68k/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/mvme68k/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/mvme68k/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/xserver.tgz) = 1d20fd039546a66b428b854c659ea5e2ee9f8114
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/xserver.tgz) = 091d09049d0af5555feec02065234e281677aeb3ecbab5a19413d924a8b58dc7f64401ef68e68bc52d8b6eeb73e091d351c45805374b8bf276b0181415968561
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/xserver.tgz) = feef5d52278d23637d7b8ba77639bfd96918e90e
+MD5 (NetBSD-6.0/mvme68k/binary/sets/xserver.tgz) = b2bd6057c374376388766fc8667eb9a9
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/kern-GENERIC.tgz) = b5f282108361e17368d9ca8615f3021473169abf
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/kern-GENERIC.tgz) = 165bec66d47652cb43981780aa068960efd933f9538145f363a559d8cc58d16d78ae5d588d98bb39795cdde762f280b36750211da2ed3a5298b0d94edf2e0bb5
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/kern-GENERIC.tgz) = 1ad2613634bf8c7654f87c4a54c9d3e6c0b1f349
+MD5 (NetBSD-6.0/mvme68k/binary/sets/kern-GENERIC.tgz) = b4b8eee7f4f1854f8632928b5ee516de
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/base.tgz) = c3e2ce1f54481094d67ff2a87a6b5000d8130ad2
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/base.tgz) = 02c29cbe0171a6c5312fb1a468e68bb8a5a5258df936c0a31fccb7bc04c8e1293d41ce6f67de08ca5584c6208dd9050c70f99c1c3b8c35a499bf94a957808797
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/base.tgz) = 7920bf359b28e793c0410ce08a98025dd3ea6971
+MD5 (NetBSD-6.0/mvme68k/binary/sets/base.tgz) = c9893e324841703eed47b475c2d37607
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/comp.tgz) = 100d0663bb2c601df55d490315c9b36b7ea700f3
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/comp.tgz) = 70bf8fc817821c6c5061776bac0ee9ebf8567fd19a2d98c751d1073a706290eb9870627b2f1fea650d19a876e8a5215e5e52407437d6be977777013f5f59fa8a
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/comp.tgz) = 497fb5a993abc08f005e1f287b8520dbace84549
+MD5 (NetBSD-6.0/mvme68k/binary/sets/comp.tgz) = 24cf494b20e22c8630e6bbba17b96bc1
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/etc.tgz) = c6f1d70ad7bf234c79f4e15508b09c7b0c33f1d8
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/etc.tgz) = 13a8204695757c27b69ed52a02c55a1e2b2d6140a5dfffd8f9f24625a56c9f3bd1f5de868a99c265e5fc759cb80cb7239dbe965c44693fcce6e98e7691076d36
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/etc.tgz) = 7365dfc472b89a3b017cdcf41bf10f928dcf723e
+MD5 (NetBSD-6.0/mvme68k/binary/sets/etc.tgz) = 1e8812db12c38683ce12950d00ded70a
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/kern-VME147.tgz) = 96374aa39856e13589e98f1552dd756b4f1911e9
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/kern-VME147.tgz) = f31cc707ced4c96b2019d7d44169e203f6df2616d09e7a3f4e2a4f0e4c509e978ba324761bdd26d1ee443e4d72e90e00effc24e537644013d5a2de95f3812574
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/kern-VME147.tgz) = 219ba053784c069875b7434631463f61293bab1c
+MD5 (NetBSD-6.0/mvme68k/binary/sets/kern-VME147.tgz) = 5349b757ec12a84df1e102583674646d
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/kern-VME162.tgz) = c56ed72a7c0da9fb44d19ece17801d1b7527e05a
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/kern-VME162.tgz) = 12078cbbbd7b1093f956b6526643b446890b82c043b17fc97e61259f54fc81cdbd8ebc56a735eb5937bff004b63d7f291e7ea2cd0dad3bd5b07f089df2c83ab7
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/kern-VME162.tgz) = cfddd4246205e867729907015fc6dd16da7fe6e5
+MD5 (NetBSD-6.0/mvme68k/binary/sets/kern-VME162.tgz) = 432a04306d40c933f2e04e5a332800e2
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/kern-VME167.tgz) = 90302a0bc14e084f2643de427e87bc5b04553ab0
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/kern-VME167.tgz) = 62c19ad0fb282a427beb1bf2d0d1b9a1cfc2681bcd04e3fb51ade0e793f26b52d04b5eb28e4c25524244e8c6dad724fc07de7a6544438cbd2a503972999f23ea
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/kern-VME167.tgz) = d84d45b735805261e014ae52746e279902ad7e9a
+MD5 (NetBSD-6.0/mvme68k/binary/sets/kern-VME167.tgz) = 8d38010b19b455f324d0b08485482395
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/kern-VME172.tgz) = 017724bf77e35e2021308dadafe5a90e59a32498
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/kern-VME172.tgz) = c3ca75dd2287e6af935934a4dabba21f085889383c395c8c72636047d682541ee5669998dd5988e0127879d7b34df260dc9109c292a2c2663ca8cfbed9c03278
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/kern-VME172.tgz) = d8676c3325db3b3f619599f9e7a33cf3b1eb5bf1
+MD5 (NetBSD-6.0/mvme68k/binary/sets/kern-VME172.tgz) = b89cd9b71b5b68285bf36d958a3b8746
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/kern-VME177.tgz) = f9bdc8e89488ba91385adf9f0960633ba7dbf6da
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/kern-VME177.tgz) = 642825fa141d2de457a0d3eca1224cdb5b087383dca6ed4f36668be6f6fe9f9e30b942ec5eb177b4733aaad40f6a0eace0f744fba3777eb356dd75d8c113785f
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/kern-VME177.tgz) = ef6abd72e2a71a5995c628107f473ceabe2945e6
+MD5 (NetBSD-6.0/mvme68k/binary/sets/kern-VME177.tgz) = 42b79dd96c98e97639d1a9d698673996
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/modules.tgz) = 5479e9142d1f21bc8346cd34e9f00761e2e05f48
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/modules.tgz) = 094b2d20eb3dc973fc212085dcc4d110249fc71eb017ea390b7f9aeffd4d8d0aeb51d421b4c95add33a17ac5d7dae1e3c9fc654f8a4181d078dbe2bac95a96b6
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/modules.tgz) = 187b451690395a8e05f22294016a627e4db4539f
+MD5 (NetBSD-6.0/mvme68k/binary/sets/modules.tgz) = 5d3d2aa79488e5f8e90ff7b26f80fc97
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/tests.tgz) = b994ffc0b63206aa7a8ab6de392ec33189894764
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/tests.tgz) = 714ac7fe966021f842409c135711b7adfb03c4b6a095df9527d02d1b83b14db62f1ec1a7eaaaebc68e4f12588e52fab9318c21912f20b8380a7a8b8e30e8576d
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/tests.tgz) = ba3293225ace42d8c47037879ba0cecd8f883aaf
+MD5 (NetBSD-6.0/mvme68k/binary/sets/tests.tgz) = e32c51104c90b3b684d1d640ba79b46a
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/text.tgz) = 61b398a67c4c47f8633d393dda778ac5c1ed8698
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/text.tgz) = 29b9bb0c5aefb3d765eb6204967c3ff14f7a28b0987723c3685a2b34fa799947c876971bf524a8e43b146e9e91e37cbc89a0c4da87c47e9856bdf9d96a67f125
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/text.tgz) = a73c95546d018a1853c6d00f5924da860fe9e5d0
+MD5 (NetBSD-6.0/mvme68k/binary/sets/text.tgz) = b0dbc4ddc47ab74ab24bdc0bede769a2
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/xbase.tgz) = a31e38ba081b5abb671cf5f7350799782a628712
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/xbase.tgz) = fa78acfbace842e0995a7f181193220f80dcae731221bf1722ece1a5bef6de846089b919beebacd7921567105f8ddae9bdaaabe0b065b62a0f18d917f03b54d9
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/xbase.tgz) = 1cb1d631feb356639d3b1362518ba5f09f084510
+MD5 (NetBSD-6.0/mvme68k/binary/sets/xbase.tgz) = dae635ef3bd334e14be8b8b66a227353
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/xcomp.tgz) = fbc80a68ccbef35cab4228a5ce96b22b383d9080
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/xcomp.tgz) = 694780dd165f0831eac6b47ec6fd5c60589749a21e88700965a99154067b76fa374b8f7a55f26963cdba8caafe9548f66b222826cc265393e992addbf19dd468
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/xcomp.tgz) = 7db19d8ccd7dbda6032d9c29a65d03bf9c71644d
+MD5 (NetBSD-6.0/mvme68k/binary/sets/xcomp.tgz) = 913bbabb9e401d6a31cc09a3d259b132
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/xetc.tgz) = 1aa27f8388f5bb0aa85eec00e225fc92736da214
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/xetc.tgz) = 1b524f2137ea4cc5f816623a7b042b05b1303664d244b0172799b365cb16df34f0a8a47277077055baf266c7c92d5f112830ed357fa811bdf6bd713b2f90275e
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/xetc.tgz) = b50ff4df41b13b9276393e871e976648d344ee7f
+MD5 (NetBSD-6.0/mvme68k/binary/sets/xetc.tgz) = d7709463a7a8404b6ef93aeb60755f7f
+SHA1 (NetBSD-6.0/mvme68k/binary/sets/xfont.tgz) = 4f8d5c51bdd02bdff0dca66f54e5ebd25e4d6110
+SHA512 (NetBSD-6.0/mvme68k/binary/sets/xfont.tgz) = fbad852b3a697906a2ffb460f8fefe8f9aa9f2088f66423d838abc18941d497bf6f9491934de0e3359159d35c98f205b23bb9c328f832e7e62c99310067687e6
+RMD160 (NetBSD-6.0/mvme68k/binary/sets/xfont.tgz) = 41c3686ef9c2cc25eff4b9923ae3163aa9c28590
+MD5 (NetBSD-6.0/mvme68k/binary/sets/xfont.tgz) = 2ec6dafe4dbe645a90960ade3e86caed
+SHA1 (NetBSD-6.0/mvme68k/installation/miniroot/miniroot.fs.gz) = 12df0f0fef9a077c27d02d2960d04ea3a148fa76
+SHA512 (NetBSD-6.0/mvme68k/installation/miniroot/miniroot.fs.gz) = fa3eeb4f14b741311ef72000e6c283195f4513e81a35f9c0a1829dbf8795d0518355b0d54d35a17c56568ac8e6db5977c1a7d4bb902c20786f901efd9b35ec42
+RMD160 (NetBSD-6.0/mvme68k/installation/miniroot/miniroot.fs.gz) = aeeeee1a475c8ef1d595c5cdff5bb3cc765bbea1
+MD5 (NetBSD-6.0/mvme68k/installation/miniroot/miniroot.fs.gz) = 9bff82e8d2d57a3fad2e831272aee965
+SHA1 (NetBSD-6.0/mvme68k/installation/netboot/netboot) = 588e8808e6e24e0a570f529c0dde8f02bcb74edd
+SHA512 (NetBSD-6.0/mvme68k/installation/netboot/netboot) = 6e0b6bc3f5de5940811d0929dd0d5f65351402176ae9c8e44a0220b807b41e98c8363d4917b1f506a847c3510bfec3d78584eae8f9e1c337130b37da4d3c6f07
+RMD160 (NetBSD-6.0/mvme68k/installation/netboot/netboot) = f1239616c5743fba614065450b1aa9ca8f4057f5
+MD5 (NetBSD-6.0/mvme68k/installation/netboot/netboot) = ee5d8acc83e9f62ee902acd1da69b3d5
+SHA1 (NetBSD-6.0/mvme68k/installation/netboot/sboot) = 5f45e50e16e46d9ab20ad20d929d1a01e4d60ad5
+SHA512 (NetBSD-6.0/mvme68k/installation/netboot/sboot) = bcd667220dd50d44aa895c0d76b9ee906dd6e3ff72d9bb80167cf48ddb6456c5cb8c06829e66ee06cf69c99e50afa3005f23a6854fc56ea2a027b50315eace2c
+RMD160 (NetBSD-6.0/mvme68k/installation/netboot/sboot) = eee81405c2dd838804a4d13219b431e93120fdae
+MD5 (NetBSD-6.0/mvme68k/installation/netboot/sboot) = bd2f963054643f0ffa22af1ea8ecda92
+SHA1 (NetBSD-6.0/mvme68k/installation/tapeimage/bootst) = df842ee6dc97b75a8f8b8e20996f60fa5c0e6ff9
+SHA512 (NetBSD-6.0/mvme68k/installation/tapeimage/bootst) = 3a6900acfffe7118e262864abea6c325e1e69060f2b47556b8865f2f28458beb29e56d96a61a8b98520530ba3d6b5ee4e0d5499cc698497445e0d480d0b9466b
+RMD160 (NetBSD-6.0/mvme68k/installation/tapeimage/bootst) = 78ea882ed8fd3cadb3b25971c7d0ad2ef159918b
+MD5 (NetBSD-6.0/mvme68k/installation/tapeimage/bootst) = 720e708780805b3a7afa57bcdb9ee62b
+SHA1 (NetBSD-6.0/mvme68k/installation/tapeimage/netbsd-RAMDISK.symbols.gz) = 0c590bfc2ae0c74a96ac421e16e9f6aea312d63f
+SHA512 (NetBSD-6.0/mvme68k/installation/tapeimage/netbsd-RAMDISK.symbols.gz) = 1f91be15380c61c4b2eebc8e34fb6eba768dc06fe958ba03cd1a074ef76e77c490d63484834b458bef181f18a5dd84444dcb33b4ed1b35360f7df9ab727a5088
+RMD160 (NetBSD-6.0/mvme68k/installation/tapeimage/netbsd-RAMDISK.symbols.gz) = 49fe1be9202c415a147b25ca21b57c4e91f3d886
+MD5 (NetBSD-6.0/mvme68k/installation/tapeimage/netbsd-RAMDISK.symbols.gz) = 387b741997770fa953dd689bdc7c2dce
+SHA1 (NetBSD-6.0/mvme68k/installation/tapeimage/netbsd-RAMDISK.gz) = 071feb6189682ed7fde6e75790b17ed023512e15
+SHA512 (NetBSD-6.0/mvme68k/installation/tapeimage/netbsd-RAMDISK.gz) = 029ef207dc80563c3d28369d7f6b1a99dae4ca573dccae9983bf3d135cbef8aece9d69a8fafe0c989bf5fc851d5a31d61c77911f7680dc4584a9229f582359f5
+RMD160 (NetBSD-6.0/mvme68k/installation/tapeimage/netbsd-RAMDISK.gz) = 6ca56e2be45d06a300f533941a582caafcbe5623
+MD5 (NetBSD-6.0/mvme68k/installation/tapeimage/netbsd-RAMDISK.gz) = 16c9e88acf91351f83fcec78132304bd
+SHA1 (NetBSD-6.0/mvme68k/installation/tapeimage/stboot) = 652f8b35ed92540699c4a0b92d781bab584ff9ed
+SHA512 (NetBSD-6.0/mvme68k/installation/tapeimage/stboot) = 63627858e9ea5ddf22d56e9f5bbc94c53a5fa45eb877b7b540931eaee973bf82251afaf6acf6078456f9aec047eb60b7bd66e694bafaa2210b51b0e83e19fd21
+RMD160 (NetBSD-6.0/mvme68k/installation/tapeimage/stboot) = 1283f83860ab4f66692d5ef01d0cdeceb40668b8
+MD5 (NetBSD-6.0/mvme68k/installation/tapeimage/stboot) = a54cfad8cf02a1a31a004dbc5c0a037e
+SHA1 (NetBSD-6.0/mvme68k/INSTALL.html) = e3f98f5f338b9417a3f88ccc83fda9eb47696c0e
+SHA512 (NetBSD-6.0/mvme68k/INSTALL.html) = b1750f826b36c84a821126455bdba2e1116bd51cd3b404c7b0c0b80110130e81e19105cd5d04563d31824e996820e1992486827b818f3f9a01d87f2b2d4da46b
+RMD160 (NetBSD-6.0/mvme68k/INSTALL.html) = d6ab4cf012544dae8696f8f41208dd27ddc1ea7b
+MD5 (NetBSD-6.0/mvme68k/INSTALL.html) = cd685f3e5b2052919547bfd9c8d98d0e
+SHA1 (NetBSD-6.0/mvme68k/INSTALL.more) = 82746f9fb96a2db4cec433f8bad448fccaa98eef
+SHA512 (NetBSD-6.0/mvme68k/INSTALL.more) = 676952c9168c0dcaea1eef58271884f95e8ad80380e33a060e29be2da7e7b139a731369e6cc0a112779be95c412de4be19f716284a3724b41f93cc5075e93b9d
+RMD160 (NetBSD-6.0/mvme68k/INSTALL.more) = 79436013f39135308106f0d08b8a0fc951773a09
+MD5 (NetBSD-6.0/mvme68k/INSTALL.more) = 95f12215d3961d47f7cc70f786c331da
+SHA1 (NetBSD-6.0/mvme68k/INSTALL.ps) = b2c39b95dd800c754733c8986e8f279a5895b9f9
+SHA512 (NetBSD-6.0/mvme68k/INSTALL.ps) = 120009d7f5781b9c060f3852d92bc047590b3d86d6491aa700c61d935ce8bccec1ddcca64f60fe17ffffa66871ec9c9908d42b738f8e37def53c97ac3a339c6a
+RMD160 (NetBSD-6.0/mvme68k/INSTALL.ps) = 1cc7939281b187b32afa1a30955dfc3751d8dc4b
+MD5 (NetBSD-6.0/mvme68k/INSTALL.ps) = b0c09fe08cf758e2dea14a23111c0c2f
+SHA1 (NetBSD-6.0/mvme68k/INSTALL.txt) = d25191ccd7930c3335bacbc56dfcbfd7ab04091d
+SHA512 (NetBSD-6.0/mvme68k/INSTALL.txt) = 581736f1c9236b74a0321e060d27305911aa735244a5b2e54825617cd97fa5bc1523472b87b65057fb3bc0f08216c7b53e60dca0c8ead238d7ea3da16502f16a
+RMD160 (NetBSD-6.0/mvme68k/INSTALL.txt) = 05b193bfebc12030dcbe3c96273582360eb132e3
+MD5 (NetBSD-6.0/mvme68k/INSTALL.txt) = c895e463555bd32f7b61fa481b63213d
+SHA1 (NetBSD-6.0/mvmeppc/binary/kernel/netbsd-GENERIC.gz) = 418f7d15770b902578623141540daa7987ed2659
+SHA512 (NetBSD-6.0/mvmeppc/binary/kernel/netbsd-GENERIC.gz) = f8ad97d747d2ffc1de7408ae9360afe25fb82eb60f73fc62198432ecb059aa64dfdc7ed74fc0d63e70a815d12414c6c9f1d8e5a717d614bafa0c9c299548ab9a
+RMD160 (NetBSD-6.0/mvmeppc/binary/kernel/netbsd-GENERIC.gz) = e3603ef7455506046e4f789e2341020d81bfb46b
+MD5 (NetBSD-6.0/mvmeppc/binary/kernel/netbsd-GENERIC.gz) = 713e8e8d42cebf7dea0ae4e96670a52a
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/games.tgz) = fbf69640b362df2446d7414ac3a13db100c289eb
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/games.tgz) = d86b41d79aea4204ccf45306937a5ec45629e37873a5956c0280fd1d54cf4a808542d097f9d978fd3277791554ce8a6fb4d0ccd46e30210549d5cce1145bb499
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/games.tgz) = fd2aed1eb51f4db522fb5163e8fde4c040b55d30
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/games.tgz) = 997ae5fb42196a787df89873be321e47
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/xbase.tgz) = b7c8146146ebc15191c1bf53f51f8f980fe8c816
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/xbase.tgz) = 091f5d00414a9ad478811bfb0e953f2a204869bc5e310790886a59c11953974cf7068cd9a96c8823856ab2687ffa2ac31e97494f47338bfe31d80217382c59f1
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/xbase.tgz) = 4bd1bfdc7c1e1619de63fb83276c21039b945357
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/xbase.tgz) = e621806afa0fcc9cdcef0f9b3c7dfcbd
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/xcomp.tgz) = 960dd33b61e19dec92096a54791aca1cdf56ce54
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/xcomp.tgz) = 111dd50041e4008aeadb898c3d08f9995c5c13a41ccc20993b4ad51c81d7f6ee3b4dab16158ac7436d085b80e4a643b236a9c97edd3e915125a1466154538420
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/xcomp.tgz) = 0cf8b9a8d1489a32ba0b5a277d90e429c40650fb
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/xcomp.tgz) = 4ba4077ca2c0edf71813165fcf5321fb
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/xfont.tgz) = 4711fcbade0238d60b7b89cf0d7873b03d7ed1f7
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/xfont.tgz) = c29130f55f536f602253a7f92f073ebf6ba02baea09f8011530bbf7e03ae96594334f0c60b29a8bceaffc3eb8b152db47548e38a3c8a14abc5fe35bc5d1d7d93
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/xfont.tgz) = 3b01af0f8e34367988d559fe0fbb0acbbafb0b2b
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/xfont.tgz) = 6ba15ed12217b726d9129db8e942a048
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/xserver.tgz) = 05aac7e617e0cac05a88062fef29bb459da7a1d1
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/xserver.tgz) = 19fb5af5d6afd78839a22e5c0694a492047b5200c569cbf58c676ff32ec250b21edcfe2ed00b65092fdac374d1ab9eaaed6113c69bc03009cf458aedc6014913
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/xserver.tgz) = 774d2a1072b8d122790ad189a6d2ada2ad99e7cf
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/xserver.tgz) = 3daf1477cadf3593e9ba45e3703fe8a5
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/kern-GENERIC.tgz) = cb6794f87c6c90ffe561a49bb2b3b48a5dacb40a
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/kern-GENERIC.tgz) = 6ee4daa27b1f69c1df2bcfb09ba9efd43a3ffd07e7de964e8f6a59ab46e0f36681a410527be024a58dff6f2efcb8f7a5af5da857fc36cca6d6bb8b71a3fd7c4e
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/kern-GENERIC.tgz) = 809b466fff3437d0e9ef68e9380b08145900b9cb
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/kern-GENERIC.tgz) = 21a47714184c5a998e528ceac6d8acb3
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/base.tgz) = cd5e92a746545a809e765ded7acbaac7de15f633
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/base.tgz) = ae16a9e58ccadf19e57966b608b0230cdeb066f65997cf36749dd72597ad80741f9a5a8f6f9b49e7ff42fe071c07fbdcc237e076ffd7a9fc4cfe94e9aecae6ef
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/base.tgz) = e8ce9e46b09fea354214094c65f085f963f9fabb
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/base.tgz) = 3480b07c4c07ba28b82c27eb4e566b9b
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/comp.tgz) = f8a50dda9bf86a613d543daad62ea5aeb0455af8
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/comp.tgz) = 5a042383539c5fa72acca742a572cc185f28e2e82f9b0a05af00a57ba3ef220272f4221718cb05322b6010236af0a29254afb0e7716a7bc1543a72bdb7ab2990
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/comp.tgz) = e13123ebdbe098433cfe3c82ff350ccf23206004
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/comp.tgz) = 93a0b66d03af7b52d9e2394c7fcc93b4
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/etc.tgz) = 7295ed78597062a35a244940465c2148ba96ccb1
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/etc.tgz) = 28ab60b5de702a8c4369ef7a04fd88d92a33eb79c3537c7593f1e2c3b16aecfdfb03582daa36dc97d1ab147d0a217a0354906475dae397970b991e39d88905b1
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/etc.tgz) = 814c4c6297cc41c8961e92e042c1ceea8d0f7bf5
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/etc.tgz) = 9b00467e487f1dc4c8e6e520f531e48b
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/modules.tgz) = 07df9e6517dc7ab1f7b4d89e4c69a0f6ed5e2551
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/modules.tgz) = bdb4958d494d5cb163ab0c77759fcf2c7c826e4f026d25fd156a19c44dd337064b604d9e5fcfd2bf60140be482cdfce94ce6d382911b813291ba2bf5a0c424cc
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/modules.tgz) = 43473d4d0defd1cff47ee9f1874161538a4b82ac
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/modules.tgz) = b73307a25c9030b40171a0360293a564
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/tests.tgz) = 9b7fcd1db26e218ce61b5325966cbc8fdf647ec7
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/tests.tgz) = c18be2b0c91b327f620d40c6ee7890dbff28fb4a431f2fec6a870c7542e08a0545c256547371cb2039a8707ae5d5d0a5b876ab209f7ea4f2ec66e4d5f676f05b
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/tests.tgz) = 78c4ec64a4a643c239af74a89cc617bd5e959fa2
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/tests.tgz) = d6e2627f54fc989e87ba95e4243e933e
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/text.tgz) = 0ef97a5332a5c76de8329dd7dd9d97fe8528a83b
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/text.tgz) = b75d8259b2a0886380f796340d08c4f56ab60002e02c04b09665e87e14eed8cddd86ae483c12e236e7589291f579a516dd049be349fd3af7c63f245cd8ddc0a4
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/text.tgz) = eaad1bf719adc5b5e1645c5fc77be97c1c946ddf
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/text.tgz) = 22b500a7593d8b412fc9c000558444a3
+SHA1 (NetBSD-6.0/mvmeppc/binary/sets/xetc.tgz) = 98938e35cc38b7007b05b049e42e888ec0a93860
+SHA512 (NetBSD-6.0/mvmeppc/binary/sets/xetc.tgz) = 0e9027a638278b6102fab31d408f258e8798bfffc6400e99b434656b81bf13053605caa8c3e8d0744685d359261fd8576c267f5eeb987da4c3a054aaf17bb993
+RMD160 (NetBSD-6.0/mvmeppc/binary/sets/xetc.tgz) = f71d30b8062059ead3243e21c732ebca57eb117d
+MD5 (NetBSD-6.0/mvmeppc/binary/sets/xetc.tgz) = e09a8d3ed7015c6b274ef5a025041fa2
+SHA1 (NetBSD-6.0/netwinder/binary/kernel/netbsd-GENERIC.gz) = e5f0ce4b52ffef57f8ecc29a7c26ddb9181a5c59
+SHA512 (NetBSD-6.0/netwinder/binary/kernel/netbsd-GENERIC.gz) = e1d81a5be8964559be0b23b0d6a4ca22f95dac64abf4a1ebc7912cbab18f47ee31ab954d85155feb750926267b7b886c1eead88223b16a4c4a363f8286d5110a
+RMD160 (NetBSD-6.0/netwinder/binary/kernel/netbsd-GENERIC.gz) = e270203b95b8a0f7736779454b07957e20ccdbbf
+MD5 (NetBSD-6.0/netwinder/binary/kernel/netbsd-GENERIC.gz) = 18ec5abd22e842bdc99a66e283e07231
+SHA1 (NetBSD-6.0/netwinder/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/netwinder/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/netwinder/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/netwinder/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/netwinder/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/netwinder/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/netwinder/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/netwinder/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/netwinder/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/netwinder/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/netwinder/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/netwinder/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/netwinder/binary/sets/kern-GENERIC.tgz) = 3f337b136bc35343128f53eabc787cf5a5a5a6a4
+SHA512 (NetBSD-6.0/netwinder/binary/sets/kern-GENERIC.tgz) = 2243a1cbdf776e683d5cb32b411adddd35e137dec2bea0e9a2d9df17972a8ebea0302328171c8fdd06da240689991c623b07a953cb8e374ace3607c0bbb6c5f7
+RMD160 (NetBSD-6.0/netwinder/binary/sets/kern-GENERIC.tgz) = bb3ef1387ed7dcee67af89f3662f2eb39a23ee7b
+MD5 (NetBSD-6.0/netwinder/binary/sets/kern-GENERIC.tgz) = b370234d8f18c218bc78739602325c44
+SHA1 (NetBSD-6.0/netwinder/binary/sets/base.tgz) = feddaeaf51113aca08fb9dd5689745efcd3ea178
+SHA512 (NetBSD-6.0/netwinder/binary/sets/base.tgz) = 1fc5531cf2b47451e0eff63df4222a4e88f7f0112d4f0b2e43009b39dd98a0550f015833d22fb0d7c0ffa9b699944fb72283715f51e5bdae97d263e167b787b4
+RMD160 (NetBSD-6.0/netwinder/binary/sets/base.tgz) = 4e1e7dcd563d7e68d0cfa8824cfa25bffd17187b
+MD5 (NetBSD-6.0/netwinder/binary/sets/base.tgz) = b5f660d9a7fe6f6fa951a3a7c3c0f6a5
+SHA1 (NetBSD-6.0/netwinder/binary/sets/comp.tgz) = 06b1e34718e894be491327ee15f5464e91aaac32
+SHA512 (NetBSD-6.0/netwinder/binary/sets/comp.tgz) = 3f6ea371d7852951a374855e3ed4396b683b752aabe0d47e0e6b1d7243b9468023ec6893076a6d77861ccc6f8ff74957bdb4675adc878fcfa620dda04f13d02b
+RMD160 (NetBSD-6.0/netwinder/binary/sets/comp.tgz) = 21fb07ace630d66e088ca8fba7f3de545bf75b0c
+MD5 (NetBSD-6.0/netwinder/binary/sets/comp.tgz) = 0b21dce21957ca73da5de9ebbeb3a157
+SHA1 (NetBSD-6.0/netwinder/binary/sets/etc.tgz) = 6eb3f0d4ee4b86c87bd03cc4f93958a42e9079f3
+SHA512 (NetBSD-6.0/netwinder/binary/sets/etc.tgz) = 2de4303f21bd502d062486b8789198bbf3e7f5068888d62d4da08e5e51d58f42ede6ea13c8a83bfbc9d0cc64cc6e11d3f2e949a3c2ad800aa78680d4046aa7d1
+RMD160 (NetBSD-6.0/netwinder/binary/sets/etc.tgz) = 3a77fb3f3a4ea25db5b8b450274bade4192541c8
+MD5 (NetBSD-6.0/netwinder/binary/sets/etc.tgz) = f57f45618396a67a169ab7c0e74be2d5
+SHA1 (NetBSD-6.0/netwinder/binary/sets/modules.tgz) = 780745396f7dee2fcce36e4c401f9462ee620e55
+SHA512 (NetBSD-6.0/netwinder/binary/sets/modules.tgz) = 9e4ffad337fd2e30a157ec7ade8f868043addcc2e8020a950cfd8e515d17bccae185b04ff15dfccebce764c1e0a8f1f722bac33e385ae294700dac0b0c3a5792
+RMD160 (NetBSD-6.0/netwinder/binary/sets/modules.tgz) = af686e341bf03f36fc43b5bfa86015e3204803f9
+MD5 (NetBSD-6.0/netwinder/binary/sets/modules.tgz) = eb5745d3d6289ded145654a58bf4a9e0
+SHA1 (NetBSD-6.0/netwinder/binary/sets/tests.tgz) = 46a999d0afcee9103c765b57765971557cffb18d
+SHA512 (NetBSD-6.0/netwinder/binary/sets/tests.tgz) = 0937f49f33fd690da609dff62adf04978e1ca36e61e3357e360e3ca622e406758a12e5909fa0aa431f914eb145625cc7dc3dc1caf09bf2793feec7db45cba00a
+RMD160 (NetBSD-6.0/netwinder/binary/sets/tests.tgz) = 7d070858cc4bdbbee9bd6568acf73cc9b70147b0
+MD5 (NetBSD-6.0/netwinder/binary/sets/tests.tgz) = 879591282409cebe2b0c397f9c05f417
+SHA1 (NetBSD-6.0/netwinder/binary/sets/text.tgz) = bc73c2b37be55d902c10db2244412f884dcb2c49
+SHA512 (NetBSD-6.0/netwinder/binary/sets/text.tgz) = cbf470fcdd95eb9bf94d5296d7d728eb537a243ed03448e134e56c6714c6528968d217c69e3ac830045f2b8b5c8c4df451fd24ff2b5b176d37fcd84ca1f07f92
+RMD160 (NetBSD-6.0/netwinder/binary/sets/text.tgz) = 00aeff72db0b05b48fa40bf80b1e24c5a667fd0f
+MD5 (NetBSD-6.0/netwinder/binary/sets/text.tgz) = 42470e4348951037fd056476c26dbb77
+SHA1 (NetBSD-6.0/netwinder/binary/sets/xbase.tgz) = 66d3e62a116c56bfaac8ee3257ba675a845b9ab3
+SHA512 (NetBSD-6.0/netwinder/binary/sets/xbase.tgz) = bfc8c00cfc6bf2fcb3d26ff9abb9e6091c5389aeac5370ae475b3c74569e3ccf05494e363544d6c805820e2c7554a1fea936abab6e3212dd4710e2463625006a
+RMD160 (NetBSD-6.0/netwinder/binary/sets/xbase.tgz) = 26ff99801c9a84190cca4292c137c17305bec08c
+MD5 (NetBSD-6.0/netwinder/binary/sets/xbase.tgz) = 532381165745c160613ef72bcd7e7848
+SHA1 (NetBSD-6.0/netwinder/binary/sets/xcomp.tgz) = 0eed09b5c7a6e8d76c99ddaa31029f414a14d6bd
+SHA512 (NetBSD-6.0/netwinder/binary/sets/xcomp.tgz) = b03064377958f9ca9252e83d2933574a5f0fedc89ac864641340f8e50a6d5fa1a074d45a80f0dcb1567ef7d23eb2bc4bec3de866c2d07912ab4122acaf062c35
+RMD160 (NetBSD-6.0/netwinder/binary/sets/xcomp.tgz) = f7a208a7ac2137d4940ec2f78c0658e630ea329e
+MD5 (NetBSD-6.0/netwinder/binary/sets/xcomp.tgz) = fa248543b87b553473cc67fd45e385ae
+SHA1 (NetBSD-6.0/netwinder/binary/sets/xetc.tgz) = 4e2fdc95511cd90317da41fb941f7ec6f622b84e
+SHA512 (NetBSD-6.0/netwinder/binary/sets/xetc.tgz) = 57a60f983fadbdb0a0ef5720c2bda405d4052d460f67976e71a34ad016d25357cd04fbdf48e866c3641dcabc55194a683931a0b36c7f55549a7998c31e42ef88
+RMD160 (NetBSD-6.0/netwinder/binary/sets/xetc.tgz) = fef501d07dce370292072f65ed25dd32df41bfcb
+MD5 (NetBSD-6.0/netwinder/binary/sets/xetc.tgz) = efdbfcb8e6fbf0c4cb2094e749c54b1a
+SHA1 (NetBSD-6.0/netwinder/binary/sets/xfont.tgz) = b92ebefbcc4a96bdbba5540df3119bed0ee2efdf
+SHA512 (NetBSD-6.0/netwinder/binary/sets/xfont.tgz) = 605e099b75b0133d811b12387461856bcf7ef7cc0dddc68490eb6ef51ba284ac2edafcc757feb0665618b119eacd2509c302f42736eb0d582ab7f17f5fdb1b23
+RMD160 (NetBSD-6.0/netwinder/binary/sets/xfont.tgz) = 084a5e8e5f95debf53ba5be9e52230fe72dbb2d0
+MD5 (NetBSD-6.0/netwinder/binary/sets/xfont.tgz) = 02b5344f23cdb9eb4d9cbe8b30c7707e
+SHA1 (NetBSD-6.0/netwinder/binary/sets/xserver.tgz) = 570bbfb56fda998c07f8414731eaf79af5b01bd1
+SHA512 (NetBSD-6.0/netwinder/binary/sets/xserver.tgz) = b70eccc78ca3e290869502760fcc8a8378db3d49c402f075e2f12e1453a7fbb68911df18993c0966ce840b837225d577344ec7088d2aea5eac78130e9dcce0ec
+RMD160 (NetBSD-6.0/netwinder/binary/sets/xserver.tgz) = 5b7c5740805aebc0ea76f778b429803b25cf9128
+MD5 (NetBSD-6.0/netwinder/binary/sets/xserver.tgz) = d866ffe531725f8c18bd3f88129d09db
+SHA1 (NetBSD-6.0/news68k/binary/kernel/netbsd-GENERIC_TINY.gz) = c260c1b8e7017de3a9c7383ebad6833c172b745c
+SHA512 (NetBSD-6.0/news68k/binary/kernel/netbsd-GENERIC_TINY.gz) = da338bee7bcaf58401ea3fa629c91fc5732016581d869f2bb8897f252c90e296773eaf35dae48667a753e7119340ac376fff713f3f87e25802fb3874879fcc65
+RMD160 (NetBSD-6.0/news68k/binary/kernel/netbsd-GENERIC_TINY.gz) = 25e70f61645eea330feda79fa0e6302bedeecdc3
+MD5 (NetBSD-6.0/news68k/binary/kernel/netbsd-GENERIC_TINY.gz) = df5ca7bb950327f08e460757a4b03de4
+SHA1 (NetBSD-6.0/news68k/binary/kernel/netbsd-GENERIC.gz) = 96c08009db46bd9bf3e0b1b0b8ea6b96b7772396
+SHA512 (NetBSD-6.0/news68k/binary/kernel/netbsd-GENERIC.gz) = 635ef8e6ee4c767afba768a982f587d6040afeb15585be8a8fcfd44e75bcd9031f8965f1bef2b7fdb955b81b2e09f0dc6a51618b48827898763cd75310669a6b
+RMD160 (NetBSD-6.0/news68k/binary/kernel/netbsd-GENERIC.gz) = b9a864c14cc967d2336473c2c2c19eeeefa5b3ec
+MD5 (NetBSD-6.0/news68k/binary/kernel/netbsd-GENERIC.gz) = 76b1a1ad9865766e5d7b1ceb1d374f26
+SHA1 (NetBSD-6.0/news68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 620ddb95366fb58c53d115681a205d73fb79bf02
+SHA512 (NetBSD-6.0/news68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 4eb494f02f39ee17205b28f07993fd1c9bbb872f2617aacdb173f9b458603fe284dedcde279eb0b9ffe083b01f485dc04963ec09117c31927e3e97a9b5441f6f
+RMD160 (NetBSD-6.0/news68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 3456f6c84edd59e0e1db531ec40b838fdd076d14
+MD5 (NetBSD-6.0/news68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 0898606b528a29a5c2c754d365e1fb22
+SHA1 (NetBSD-6.0/news68k/binary/kernel/netbsd-INSTALL.gz) = 76b25bf6b038d7c48a55bf1f1df350717707af3f
+SHA512 (NetBSD-6.0/news68k/binary/kernel/netbsd-INSTALL.gz) = 7aadf02eb4862fc3cf8a0099673414092e8a113e59dfcfda713e430422cc8f03fd4a711ec767b10905ac5feeb6823054e372da6da4f19e15c595712a75dff046
+RMD160 (NetBSD-6.0/news68k/binary/kernel/netbsd-INSTALL.gz) = 4e01f28fc0dd67b8a2b16ac61c27adf4ec83c7e7
+MD5 (NetBSD-6.0/news68k/binary/kernel/netbsd-INSTALL.gz) = 7ecaba69661efb53aea818bfc0df2870
+SHA1 (NetBSD-6.0/news68k/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/news68k/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/news68k/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/news68k/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/news68k/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/news68k/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/news68k/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/news68k/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/news68k/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/news68k/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/news68k/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/news68k/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/news68k/binary/sets/xserver.tgz) = 1d20fd039546a66b428b854c659ea5e2ee9f8114
+SHA512 (NetBSD-6.0/news68k/binary/sets/xserver.tgz) = 091d09049d0af5555feec02065234e281677aeb3ecbab5a19413d924a8b58dc7f64401ef68e68bc52d8b6eeb73e091d351c45805374b8bf276b0181415968561
+RMD160 (NetBSD-6.0/news68k/binary/sets/xserver.tgz) = feef5d52278d23637d7b8ba77639bfd96918e90e
+MD5 (NetBSD-6.0/news68k/binary/sets/xserver.tgz) = b2bd6057c374376388766fc8667eb9a9
+SHA1 (NetBSD-6.0/news68k/binary/sets/kern-GENERIC.tgz) = 6d14a82918f258c781499c87f7ef23fca3c85c68
+SHA512 (NetBSD-6.0/news68k/binary/sets/kern-GENERIC.tgz) = ed399e3bab46335dc4d2bb1f2971692d8a1d8aa22c4196bb340e005c951a3941517d64de8be8c8047a60de791ae934197b38fe02706bcde080f4062a5ffbf431
+RMD160 (NetBSD-6.0/news68k/binary/sets/kern-GENERIC.tgz) = 74c42f841cfb865522b4eda052f46a7b13e491d0
+MD5 (NetBSD-6.0/news68k/binary/sets/kern-GENERIC.tgz) = 6ac0ec8267f457a0d94feba55a094773
+SHA1 (NetBSD-6.0/news68k/binary/sets/base.tgz) = 14763cf9124eb67c9440727bf0559d98d9aa4765
+SHA512 (NetBSD-6.0/news68k/binary/sets/base.tgz) = 24bf851943de08a6e5cb869a69d8d4350f6d6c64988741dbb8691afb927fa8ccb922a7e608da48ef52913796c0e6172c8302b22248c64ce576446d26f26add71
+RMD160 (NetBSD-6.0/news68k/binary/sets/base.tgz) = fc4ad357c41d200d8e12444d1f4e13956521a4d5
+MD5 (NetBSD-6.0/news68k/binary/sets/base.tgz) = 5401468976f41209a9a28889d85f52be
+SHA1 (NetBSD-6.0/news68k/binary/sets/comp.tgz) = 6b20fee4bcb085b5b09893416ce5eee6a96ca5bd
+SHA512 (NetBSD-6.0/news68k/binary/sets/comp.tgz) = 3550045bb700ea29604590e25cd9e6305459476a837f67b4d746e62ce0facc8218aca1d03f2dd570e2590802f32079e438ad4e977a96f9a8939dd986d725d898
+RMD160 (NetBSD-6.0/news68k/binary/sets/comp.tgz) = 85fb356111807dbc811b8fe2fb3d294e4544b358
+MD5 (NetBSD-6.0/news68k/binary/sets/comp.tgz) = 223302daf2a8f7f52863763374438b3e
+SHA1 (NetBSD-6.0/news68k/binary/sets/etc.tgz) = 575f76fc225f509cec73dbc1e6a213d4370c221f
+SHA512 (NetBSD-6.0/news68k/binary/sets/etc.tgz) = 4705c91993153a30b1bf6bab9f1d0b75d9bc29ccbd698d26c44ae70fadeb4a8390298eb1e0e590f0da62748d9429e8e5927558a31d2efe0ef068a9ca353681b4
+RMD160 (NetBSD-6.0/news68k/binary/sets/etc.tgz) = 7ce6e09c062f61b659f2c16138516b3629c010bf
+MD5 (NetBSD-6.0/news68k/binary/sets/etc.tgz) = 234be1ba6587866294eb09b75439840b
+SHA1 (NetBSD-6.0/news68k/binary/sets/kern-GENERIC_TINY.tgz) = 119015b6a9a67300144e248352a3842857ba86e9
+SHA512 (NetBSD-6.0/news68k/binary/sets/kern-GENERIC_TINY.tgz) = 2eecd5ff4fd2a1ca0edc61ff92c804f5202ffedc5b6e74c5c0be372f74cf533e4b4f1b6a69625a155a33661185e1a56943947ab1c98fa8b4dc3892526781950a
+RMD160 (NetBSD-6.0/news68k/binary/sets/kern-GENERIC_TINY.tgz) = 5477d4127ff479fa19aa58a3de57bbd3a4cc0b90
+MD5 (NetBSD-6.0/news68k/binary/sets/kern-GENERIC_TINY.tgz) = fd4f85a1589e4907b314ae996b3aa08a
+SHA1 (NetBSD-6.0/news68k/binary/sets/modules.tgz) = 1885df3fb4ea56feab816bd8dc5e0dc08fae234b
+SHA512 (NetBSD-6.0/news68k/binary/sets/modules.tgz) = beeb1e94ef6f34b7525c0c2de9bfe9927aa443bfdc5be8c4a5546a27483c0ca45006d3f546d93bc0036f25804e7827ea1b8fd943e7642bc73c4b6c75710362ed
+RMD160 (NetBSD-6.0/news68k/binary/sets/modules.tgz) = e3ed23f75e48c70efbdf3b5ec9c28ec41886d878
+MD5 (NetBSD-6.0/news68k/binary/sets/modules.tgz) = e4db103ff1b7f68a57e8fe813b2b8d3c
+SHA1 (NetBSD-6.0/news68k/binary/sets/tests.tgz) = 984686c1f0ad93ff8200e810482527b87bad3de3
+SHA512 (NetBSD-6.0/news68k/binary/sets/tests.tgz) = 508704556a3bc66c9f5f88a6377d34d81edf9aaace78a4496c550021dd5a88c2ff85d5663ff2aa42c4e7a74721249b2dddabd50bf597572b016794c42d22a622
+RMD160 (NetBSD-6.0/news68k/binary/sets/tests.tgz) = 06cb486210f5e4ef2ec33d863cf995780caa24df
+MD5 (NetBSD-6.0/news68k/binary/sets/tests.tgz) = 60053afffd0ad1c95c2654ce6a991d21
+SHA1 (NetBSD-6.0/news68k/binary/sets/text.tgz) = edd7603519c0dbdddbe9b9c8d9ddf066d62ee617
+SHA512 (NetBSD-6.0/news68k/binary/sets/text.tgz) = b5c7ca241708d02df4df5a6bf43b6329cdb063a922bdf23955b3807cf813d10718cdd1a7a4c3167e0869d5f8f0a742ee275951a72fa2cbfbd32a0afa37d3e49e
+RMD160 (NetBSD-6.0/news68k/binary/sets/text.tgz) = c54012faa763171bbd263ba23d4d2495e7cf2762
+MD5 (NetBSD-6.0/news68k/binary/sets/text.tgz) = 2088a3dfd39fd763db42fe375a460a3e
+SHA1 (NetBSD-6.0/news68k/binary/sets/xbase.tgz) = 9b8940f65ca6a841b84406a22a13971665edc464
+SHA512 (NetBSD-6.0/news68k/binary/sets/xbase.tgz) = 4a7d78ad9cf1b84c183fc731bac2fce861f94bc26c7a1681ab1d62a9b761ba89538469688b24588f6c671503a1b66a1e521c2eeef2fd528d21dc0351272e56e8
+RMD160 (NetBSD-6.0/news68k/binary/sets/xbase.tgz) = 85735e089a6ac5293e7438a609dd11105cd4eb25
+MD5 (NetBSD-6.0/news68k/binary/sets/xbase.tgz) = b6f52c8fde2fb1a5372a12d2f321e9c5
+SHA1 (NetBSD-6.0/news68k/binary/sets/xcomp.tgz) = 63a79437c028936698509a386963708082356d29
+SHA512 (NetBSD-6.0/news68k/binary/sets/xcomp.tgz) = 25791832de667b9a44f341f7267f09aaa6b9a4216452ceaab8b56dc6ea5fca3be2da53868b624f47a275edf19ada59dfed40e355e2ff1f62ab96bb54448c1e00
+RMD160 (NetBSD-6.0/news68k/binary/sets/xcomp.tgz) = e681ae34bd83be8dbb6945cef3a129bc1538b66a
+MD5 (NetBSD-6.0/news68k/binary/sets/xcomp.tgz) = c87752020f2ad29a80262eae4bbeaece
+SHA1 (NetBSD-6.0/news68k/binary/sets/xetc.tgz) = 76661bc6d6851cb2ae57f3a7f25f816a33360a2b
+SHA512 (NetBSD-6.0/news68k/binary/sets/xetc.tgz) = a1994fbd97492275e9128c5fc764dc7cf5539bee26bb9d13d9f3fcc14429858e794ed8a10554570c4f70b87714f8b0ab23269ebbaf44d4fb95d0901dcc28fe81
+RMD160 (NetBSD-6.0/news68k/binary/sets/xetc.tgz) = f9f8fc83764439a533110c614e1ef19ffe98361a
+MD5 (NetBSD-6.0/news68k/binary/sets/xetc.tgz) = ab945fe1f43ea47433a047babda53a81
+SHA1 (NetBSD-6.0/news68k/binary/sets/xfont.tgz) = 4403bc158b92ded3d27646c6c0858aa6c117cb8d
+SHA512 (NetBSD-6.0/news68k/binary/sets/xfont.tgz) = 79e31eee0397803ec17a9413b50a5d501fbc3515e4080a0e9e053498c64557809cddfd5718f131d3c451a231c4a38ff4f40b50ef401af5c204a68b61df8f8ba7
+RMD160 (NetBSD-6.0/news68k/binary/sets/xfont.tgz) = b7e19b89a1f67382428aeaf248710dade3b0672e
+MD5 (NetBSD-6.0/news68k/binary/sets/xfont.tgz) = 8a1f532d7a481f797deb226b66d15ceb
+SHA1 (NetBSD-6.0/news68k/installation/floppy/boot.fs) = baea772f5bf7116b8c489a2e75f77c98e308ac5f
+SHA512 (NetBSD-6.0/news68k/installation/floppy/boot.fs) = be4dbd6dc24f56ac71f96d60b8ed0e6b4f725bae2b9d39ef1b9e5ea5fe71053f5fea04979676ff13a50685bcbce539bbc93631408c56d29a2924c79370ded347
+RMD160 (NetBSD-6.0/news68k/installation/floppy/boot.fs) = ff9f3a85babe4d597e2ccb4a864eb0c611a7894f
+MD5 (NetBSD-6.0/news68k/installation/floppy/boot.fs) = 98f566671f6dd720fb61e8c657bd93e8
+SHA1 (NetBSD-6.0/news68k/INSTALL.html) = 8d9ab316296bfbb751b0a05557f4648ff2990af0
+SHA512 (NetBSD-6.0/news68k/INSTALL.html) = 5916c04ef717b2e47ee36f93a1e3a43a27215b5c688b36520e0f160bda3816d6e4645e2e9e922d564260e8b8a60e46da67fbd3b443832032a66e76153596c4eb
+RMD160 (NetBSD-6.0/news68k/INSTALL.html) = a07fa866614d3f5ecfb5642eeb354b6b9c675318
+MD5 (NetBSD-6.0/news68k/INSTALL.html) = 89f43b16d907873c28b8b7b6ab8cb4a9
+SHA1 (NetBSD-6.0/news68k/INSTALL.more) = db7d9b68680f5c20b525bf253e342f2775d04a71
+SHA512 (NetBSD-6.0/news68k/INSTALL.more) = ab50b18effb102ac017c0cad2c054dffe8ccec3876ff9cc6a0353762b5a2b11651296f05b3cf3da76cbb10a4561bc529b5cf113141c742a96fdb73a5358e129c
+RMD160 (NetBSD-6.0/news68k/INSTALL.more) = d6aacc53d5c3384704e2ff1f64a4eb9fd474effe
+MD5 (NetBSD-6.0/news68k/INSTALL.more) = 4c22b00a52d8ad3cdb12f66d23a069a9
+SHA1 (NetBSD-6.0/news68k/INSTALL.ps) = 021d67431fbc7f9fd378e496c25c28097b72af46
+SHA512 (NetBSD-6.0/news68k/INSTALL.ps) = 224e78f8ddc0149a710511083c55a69e1eb2f37089ad15ce1fbc1c07733055eb5b34ad4c32b2803d1f3050b1c5a038ef1d429af780c0a57c8a4b41fde8d10413
+RMD160 (NetBSD-6.0/news68k/INSTALL.ps) = 86b953fd3860caadf7a681e0d75486cb2ac453d2
+MD5 (NetBSD-6.0/news68k/INSTALL.ps) = 4f2098f135e2d4f945dd6365a55b7bc2
+SHA1 (NetBSD-6.0/news68k/INSTALL.txt) = 1491600e777e5a7a96cc05a7fc5a0ab0edf2072f
+SHA512 (NetBSD-6.0/news68k/INSTALL.txt) = 0552976751403a424febde147bdbf34b7e589c0f27225072c9691e30f630e1f49be93c9e75ebbc7d0c6d06ab78419506d4c4313059023e9ae13dbd8d1f5c4445
+RMD160 (NetBSD-6.0/news68k/INSTALL.txt) = 2c6df35393c4ee9d9fb7dcb58002f996c587c32a
+MD5 (NetBSD-6.0/news68k/INSTALL.txt) = 9cff69046f721931b5b5ef4bd511d12c
+SHA1 (NetBSD-6.0/newsmips/binary/kernel/netbsd-INSTALL.symbols.gz) = 0e0add1125bb456d3210efa5035169e1bd7ae98a
+SHA512 (NetBSD-6.0/newsmips/binary/kernel/netbsd-INSTALL.symbols.gz) = 138e28fb744019ee2e89cb8ef1f3e23b5fd296b2f8c12a26245cef11aef9540f12eb2c180e5847d047d74d593e62916694c7f031fda0e3477e42ecdb79da7510
+RMD160 (NetBSD-6.0/newsmips/binary/kernel/netbsd-INSTALL.symbols.gz) = 4ee95362c6f9e38a32cd9e0fe36cdc3aadb91291
+MD5 (NetBSD-6.0/newsmips/binary/kernel/netbsd-INSTALL.symbols.gz) = 0d8837629ba02a89e50b6764649d03a2
+SHA1 (NetBSD-6.0/newsmips/binary/kernel/netbsd-GENERIC.gz) = decd427b7283d775b0356186a50720409c1c2ecf
+SHA512 (NetBSD-6.0/newsmips/binary/kernel/netbsd-GENERIC.gz) = 05df61671fb365dba6ee67d097f5e51b372720a260b0dd05913a4cf283f323836aa7b157d88eaa68e4cdfa2a7180e57e3ba8ee3cd538dffe4a6afadc1ce880c9
+RMD160 (NetBSD-6.0/newsmips/binary/kernel/netbsd-GENERIC.gz) = e997c6efa2aacfb924670a53162157c8fbd93bdd
+MD5 (NetBSD-6.0/newsmips/binary/kernel/netbsd-GENERIC.gz) = 1b105c1608405606b59942471102880a
+SHA1 (NetBSD-6.0/newsmips/binary/kernel/netbsd-INSTALL.gz) = 42aeaa1b3dd454b7ac007db9ac4f9b43ca2bd52f
+SHA512 (NetBSD-6.0/newsmips/binary/kernel/netbsd-INSTALL.gz) = f4262b07a27e2166082ed9cd4b0a247fcbd65f3aebc1c1f8e502f5fc931e130627b0906c92263d2f748d3d30d482391c6b72637c29812f98aaed2fd85830cfdf
+RMD160 (NetBSD-6.0/newsmips/binary/kernel/netbsd-INSTALL.gz) = ab7e5e64d2b4761006e95f8d1605d767f6ace146
+MD5 (NetBSD-6.0/newsmips/binary/kernel/netbsd-INSTALL.gz) = e23868785597388ddbae56348a08d9d7
+SHA1 (NetBSD-6.0/newsmips/binary/sets/games.tgz) = f56d3e5181634f6a3d7908dcb002ebcb1c5aaff0
+SHA512 (NetBSD-6.0/newsmips/binary/sets/games.tgz) = 0cff50ea13e34fe338edf70da6a28af061580feb4cb0773828adefa631ebd471a96568a3b30ea0f13f3bb116856a1b6aad8a5a52443346f52e4907f4caabc5f1
+RMD160 (NetBSD-6.0/newsmips/binary/sets/games.tgz) = 1538910578dbb8eee2931200fac0ccda44758e5f
+MD5 (NetBSD-6.0/newsmips/binary/sets/games.tgz) = 2bd5bd0ce72df5cf92767b8c3f7cc208
+SHA1 (NetBSD-6.0/newsmips/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/newsmips/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/newsmips/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/newsmips/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/newsmips/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/newsmips/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/newsmips/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/newsmips/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/newsmips/binary/sets/kern-GENERIC.tgz) = 7b98d2f4f3acbf629e953e6b694d8f4755b8e8bd
+SHA512 (NetBSD-6.0/newsmips/binary/sets/kern-GENERIC.tgz) = 5d7e2e9bce3611aee142686bab7a69abc59ddb5e1308694cc88e63645d3b411013765ffa5198cbb44fa445ae258f85cfae976c239875ea26ac4d0439cb497746
+RMD160 (NetBSD-6.0/newsmips/binary/sets/kern-GENERIC.tgz) = 849d144d0090f36a2d013a9f85c9b4c472c595df
+MD5 (NetBSD-6.0/newsmips/binary/sets/kern-GENERIC.tgz) = 40ecc8186e3d4328e24ef91e817c5a4e
+SHA1 (NetBSD-6.0/newsmips/binary/sets/base.tgz) = c229edbeb3438aa2444933af1633c73b66f23748
+SHA512 (NetBSD-6.0/newsmips/binary/sets/base.tgz) = 8ce8dce68f07ee529d0f079794502bd225475cabe7f0dd351caf01b5acf8a34d5f865eea046c06998db53a2cb23c7c36764314493d537ecad8e69c5908a07dbe
+RMD160 (NetBSD-6.0/newsmips/binary/sets/base.tgz) = 6d2365c6adbf64a1b6655c7341a7fa1756878e93
+MD5 (NetBSD-6.0/newsmips/binary/sets/base.tgz) = 650ad75dc13c5edd48f4d8a58759375e
+SHA1 (NetBSD-6.0/newsmips/binary/sets/comp.tgz) = d6ce335f1f52b3d77282e7c08c3781202018257f
+SHA512 (NetBSD-6.0/newsmips/binary/sets/comp.tgz) = 4c8cac5f9fff3b5334083d5df788b0967f62817e797206393f6b83a9cbb0b78c151408440045b92bc50ac2540e0b5d38ea854f29b6af69c1043952d472cf0a85
+RMD160 (NetBSD-6.0/newsmips/binary/sets/comp.tgz) = 7985588ccbaf837e8fd044a0ea7064aa023245c4
+MD5 (NetBSD-6.0/newsmips/binary/sets/comp.tgz) = ac02ccf4b35b94d87960214974f909ba
+SHA1 (NetBSD-6.0/newsmips/binary/sets/etc.tgz) = 1744b2b2050df7622a70aec4c4ab39ff4766b598
+SHA512 (NetBSD-6.0/newsmips/binary/sets/etc.tgz) = 933f4b9af8a1f5033c88ecb680c70b258b36267cbd3d8804aa7d2c0ce797f272a4ffc7266bb369505635e0e0ce0efef285d8fa26704ba28690f1dc6db810c42e
+RMD160 (NetBSD-6.0/newsmips/binary/sets/etc.tgz) = c41f76161f0a9ada7ee8cad68d5311f70051c08e
+MD5 (NetBSD-6.0/newsmips/binary/sets/etc.tgz) = adb5f50f9862a06a123d1d848dbeaef0
+SHA1 (NetBSD-6.0/newsmips/binary/sets/modules.tgz) = 494b6a3b255bace06cfee70f87d2ac213b190a5f
+SHA512 (NetBSD-6.0/newsmips/binary/sets/modules.tgz) = c8274f58ae9d514e72f8d82e46599c655e1b959b744e73340a6a106dce528f83687b7bd7f8e769eab60294e6962a7bc5e0d7173330710ee381219ca6f87b51c7
+RMD160 (NetBSD-6.0/newsmips/binary/sets/modules.tgz) = 3536ddd91df0d4d53e6da53bf30548ac60062349
+MD5 (NetBSD-6.0/newsmips/binary/sets/modules.tgz) = 4cefc39360426c683af0c3031403bd54
+SHA1 (NetBSD-6.0/newsmips/binary/sets/tests.tgz) = 8c653879bccb5f7b67536fb96f92fa52cf11e69f
+SHA512 (NetBSD-6.0/newsmips/binary/sets/tests.tgz) = 5cc47261708222b4fe1ca43d1dc014909df674db2c477c9d814e2af319e2c21c66555df78786ec48c08b21c4c8c1ddc8d815967ffaaceb625f61687df9ac46b1
+RMD160 (NetBSD-6.0/newsmips/binary/sets/tests.tgz) = 8712fce841356834ff6036bdcfe58dbb391ffd4e
+MD5 (NetBSD-6.0/newsmips/binary/sets/tests.tgz) = ccc445c6ba7fc49d4de4b0dcb26aefff
+SHA1 (NetBSD-6.0/newsmips/binary/sets/text.tgz) = 766d9d6d34c79c7be29da59f543f6e029090ecff
+SHA512 (NetBSD-6.0/newsmips/binary/sets/text.tgz) = d11a630ead4cf249224c0f887cf6c2ef347983e885f5657c44cc988733880ccfee735f36dd5558ca60ffffb5ea8dab042d016d3824d8e9116cda749516508624
+RMD160 (NetBSD-6.0/newsmips/binary/sets/text.tgz) = 53cfd7b3389f1b71430daad46ff3be2c692690a3
+MD5 (NetBSD-6.0/newsmips/binary/sets/text.tgz) = f0692f4de9721110ecf0e1ecac4bf1d9
+SHA1 (NetBSD-6.0/newsmips/binary/sets/xbase.tgz) = 19fb5f83a2ef362388d812fbe3c4ccad858dd191
+SHA512 (NetBSD-6.0/newsmips/binary/sets/xbase.tgz) = 4774d680e11097be0f6d8b9cdd2a296cfceefdf1c19d0e8188c742efb2603b253b46c2d01084c6bd5470e34ecc6dd81f502a97c9c69e02b9aca1af80f9d3bafb
+RMD160 (NetBSD-6.0/newsmips/binary/sets/xbase.tgz) = b52fbd33962b06618a8334439f89a7114cb762a5
+MD5 (NetBSD-6.0/newsmips/binary/sets/xbase.tgz) = d9c670a2392dd2f58f041b18ecd32be6
+SHA1 (NetBSD-6.0/newsmips/binary/sets/xcomp.tgz) = e99076dd0244130e9ae9ac14533df11f058aab3c
+SHA512 (NetBSD-6.0/newsmips/binary/sets/xcomp.tgz) = 2869e7c2d397772612ce36217da0c8f7ab0ed5b18694d0620e789854dcd2fbc6763dab632614cb9df7be4c7697065db5f68e9e400fc2068a03e38d98709399b7
+RMD160 (NetBSD-6.0/newsmips/binary/sets/xcomp.tgz) = af2372e9b8ba4ed8a4d8f951b9570e411be2dcf8
+MD5 (NetBSD-6.0/newsmips/binary/sets/xcomp.tgz) = cb05a7f616ecaa766d696b7ab5d9120e
+SHA1 (NetBSD-6.0/newsmips/binary/sets/xetc.tgz) = 973a0c9b770b14e156ea2d999b0c155f8675e95f
+SHA512 (NetBSD-6.0/newsmips/binary/sets/xetc.tgz) = 4298ae57e88d6a5853a8832cf06c6d294051708ffaff6e2fa28efd06c2a8cf99274f5d1be0bff31248d3d9d9ee7bcb2738fcc9b5a4f55a2f34246cf5e1bd3546
+RMD160 (NetBSD-6.0/newsmips/binary/sets/xetc.tgz) = 4b9023581af4b378be8ce78fa812c832dae9f682
+MD5 (NetBSD-6.0/newsmips/binary/sets/xetc.tgz) = 8eee7c09a6b78148e9b1260abee79e53
+SHA1 (NetBSD-6.0/newsmips/binary/sets/xfont.tgz) = 389d0d14a3b5ebbdf3f49b0c5bca3efcf7155a42
+SHA512 (NetBSD-6.0/newsmips/binary/sets/xfont.tgz) = e246f6527bb91eecd3190cd9eb82157db0a0d868f95acd47bb292caea573405170156e37dfb50d3ec97b00ac7c50cf0893640945575638bd9f958cfbece4bd72
+RMD160 (NetBSD-6.0/newsmips/binary/sets/xfont.tgz) = eab3db1a489e432867ce806385ed12e1b25165ff
+MD5 (NetBSD-6.0/newsmips/binary/sets/xfont.tgz) = 4030cc9fd13f8d3524a8c161715edc6b
+SHA1 (NetBSD-6.0/newsmips/binary/sets/xserver.tgz) = 2e0e1a1280e01a64615430396697d3a4cc4aabee
+SHA512 (NetBSD-6.0/newsmips/binary/sets/xserver.tgz) = e5c9d65657227d24b52db9d109c9a4993c5962c3f8171b1353709464a0ba18c99264bf3cd8dc53478692cf2a297f36bccf15519f1aa198cf1a6392e3557914da
+RMD160 (NetBSD-6.0/newsmips/binary/sets/xserver.tgz) = 82a04ae9c10abf44d00acaa3f97f99150e7dc607
+MD5 (NetBSD-6.0/newsmips/binary/sets/xserver.tgz) = 9f3edc37a2f786ee70d5f0e100105971
+SHA1 (NetBSD-6.0/newsmips/installation/floppy/boot1.fs) = d55e9f59aac50a141dbec353c4bc9586faa8d00d
+SHA512 (NetBSD-6.0/newsmips/installation/floppy/boot1.fs) = 659476e61e29371975130565ae2e343ad3bc9423a910ef0b08cffe41e87179020c5b2f42f98d351c9957655b67ded13cf6111835e441d2ddd39584bc1a57c7ba
+RMD160 (NetBSD-6.0/newsmips/installation/floppy/boot1.fs) = f3becca1f4c20eadf3e77ff4bcb84990a9e543f6
+MD5 (NetBSD-6.0/newsmips/installation/floppy/boot1.fs) = 992e9d201b2a7183a6f8725486e8f2d0
+SHA1 (NetBSD-6.0/newsmips/installation/floppy/boot2.fs) = 2c228b57a187bbfae507d67aae5d0faef2f308ea
+SHA512 (NetBSD-6.0/newsmips/installation/floppy/boot2.fs) = 72c6b63777f2171c852f15cfd2c04fd9b21a9cfc423542d0127012be6d5ca85ad15bb33a67b1fb28e1f07f2652f94ae2d2f0c0641c6e860c0ed50d9556eacc59
+RMD160 (NetBSD-6.0/newsmips/installation/floppy/boot2.fs) = 495d95dd6cdcbf0a0cdb07fb8500738e306dd970
+MD5 (NetBSD-6.0/newsmips/installation/floppy/boot2.fs) = 90827190455600b1692585932670fc44
+SHA1 (NetBSD-6.0/newsmips/INSTALL.html) = 3bba0333ef60ff85cbb905deb86171f67a7e7d35
+SHA512 (NetBSD-6.0/newsmips/INSTALL.html) = 4778fb087bc4c44b84fec903f4e00003a41cfa3675a2f712bba28b33773800ad6b7d546074787caff68fd34a885ed84e05a0183a4867bed9c3e881ab30c68c64
+RMD160 (NetBSD-6.0/newsmips/INSTALL.html) = 27d6089590736239f38e1b0638f0b1662465ada6
+MD5 (NetBSD-6.0/newsmips/INSTALL.html) = 5041c29c150843c89b4dfa0c1cea869e
+SHA1 (NetBSD-6.0/newsmips/INSTALL.more) = 91afcc03bfa9fd0c378f7d9d22ab81cfe214f36c
+SHA512 (NetBSD-6.0/newsmips/INSTALL.more) = fc99840a5b29382c2f54287ded48994162804002b6947d2fc1fe907a0674b3827c64fa52e2bd3de735f387e09627ea254820bcd142f0552374acd2c951b0edec
+RMD160 (NetBSD-6.0/newsmips/INSTALL.more) = cdb0bd00e8d126b4736b77688ca2ac9bcc330283
+MD5 (NetBSD-6.0/newsmips/INSTALL.more) = 0dd24b3ef2da6fb2fd0989edf90aecd5
+SHA1 (NetBSD-6.0/newsmips/INSTALL.ps) = 2e236b56c944116ec48df342a4a4ab1414be54c8
+SHA512 (NetBSD-6.0/newsmips/INSTALL.ps) = 22e6e7b9975ffcc75b2560ecc103ab0f3337c0e637fc0b13e73c52b8d726c5a7676f8eb60a931113d2ce9570ca78209008810495d6260b374c61aeb79bf1915a
+RMD160 (NetBSD-6.0/newsmips/INSTALL.ps) = 031019f4af07c2dbb384bbb76702d2a6da747a0d
+MD5 (NetBSD-6.0/newsmips/INSTALL.ps) = fe0ac420b2c0c7a4fba8bfbbc247c0fb
+SHA1 (NetBSD-6.0/newsmips/INSTALL.txt) = d2abcef4ce10c3f567350ad9de6370a0f972f3f8
+SHA512 (NetBSD-6.0/newsmips/INSTALL.txt) = a26df9df3950896c9fb77d728190516f1211b1630dff4969c651ad3f343acd9359a9a6251815c560a6e47071717c53b123d911776d5f5d6b8dee38c12d075381
+RMD160 (NetBSD-6.0/newsmips/INSTALL.txt) = f2ef263bdb545134c7dbadb4509ff94ecf14d84d
+MD5 (NetBSD-6.0/newsmips/INSTALL.txt) = fea6e65c9aac2b407af208e4f7272cf9
+SHA1 (NetBSD-6.0/next68k/binary/kernel/netbsd-GENERIC.gz) = 9f78ea3f1d4a4b1c07d0a25487b20560adcb7fab
+SHA512 (NetBSD-6.0/next68k/binary/kernel/netbsd-GENERIC.gz) = daae6643ef07004beaaa345b57182f2d2b69e990896734e18ec50ee925e17acf334da7a5478fa0fa38de4062fef3285582c9a4fe352759770e4cd9012d70d6f6
+RMD160 (NetBSD-6.0/next68k/binary/kernel/netbsd-GENERIC.gz) = 2dcc60a3c451aaf9303c328a8471775b83ae066a
+MD5 (NetBSD-6.0/next68k/binary/kernel/netbsd-GENERIC.gz) = d4502e039874ee01d7564f7572fa4789
+SHA1 (NetBSD-6.0/next68k/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/next68k/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/next68k/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/next68k/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/next68k/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/next68k/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/next68k/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/next68k/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/next68k/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/next68k/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/next68k/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/next68k/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/next68k/binary/sets/xserver.tgz) = 1d20fd039546a66b428b854c659ea5e2ee9f8114
+SHA512 (NetBSD-6.0/next68k/binary/sets/xserver.tgz) = 091d09049d0af5555feec02065234e281677aeb3ecbab5a19413d924a8b58dc7f64401ef68e68bc52d8b6eeb73e091d351c45805374b8bf276b0181415968561
+RMD160 (NetBSD-6.0/next68k/binary/sets/xserver.tgz) = feef5d52278d23637d7b8ba77639bfd96918e90e
+MD5 (NetBSD-6.0/next68k/binary/sets/xserver.tgz) = b2bd6057c374376388766fc8667eb9a9
+SHA1 (NetBSD-6.0/next68k/binary/sets/kern-GENERIC.tgz) = 86b352f48720312e04260ba1dcf2f6e7e9d31e25
+SHA512 (NetBSD-6.0/next68k/binary/sets/kern-GENERIC.tgz) = 602f5ac04b050c0462d21d4e50a9a8e5c794a3b4442b6df19370ab6dbd6839755bc61e2c7745f777aef417d5c1179ff4a2af52a5880d35eb20d1c5d3a580a844
+RMD160 (NetBSD-6.0/next68k/binary/sets/kern-GENERIC.tgz) = f625cea32a206f3738a72b5ec0b01d8485c7eccc
+MD5 (NetBSD-6.0/next68k/binary/sets/kern-GENERIC.tgz) = ff2d20b2f2b0a12231e405b582b61801
+SHA1 (NetBSD-6.0/next68k/binary/sets/base.tgz) = d68bfc49aa82b76a52007a927f1a7bac692aaf18
+SHA512 (NetBSD-6.0/next68k/binary/sets/base.tgz) = 4d2c20f0dcfa061e1a1176d34111225b6c8a94b0742141560ccdc986cd5311906967d06e4294a6f988bcea4cbc09d1a9607810960f2d0be35f4ab2895f68f112
+RMD160 (NetBSD-6.0/next68k/binary/sets/base.tgz) = 6d98b84ec87a909545f72526f63cc27d450865fb
+MD5 (NetBSD-6.0/next68k/binary/sets/base.tgz) = e40a7e78d87959c20f37bd937921383d
+SHA1 (NetBSD-6.0/next68k/binary/sets/comp.tgz) = eb3082aae89eb8720e91538fd100125c9e6a717f
+SHA512 (NetBSD-6.0/next68k/binary/sets/comp.tgz) = 8c695463b6ac0a403023068b670d04c7cbe50a9e3925e19896fddba7f409b2d142e9b2817bf18144d9bb55aefe2d7cd90c1242f9bdd6cea628332277d08f8520
+RMD160 (NetBSD-6.0/next68k/binary/sets/comp.tgz) = 81c05df1b3c2c6a72575a325b2c507081279a587
+MD5 (NetBSD-6.0/next68k/binary/sets/comp.tgz) = 11b81d6d2371e3b3123f0fc776526b80
+SHA1 (NetBSD-6.0/next68k/binary/sets/etc.tgz) = d7697b36fa1c6c814b0745d496709c177b43441d
+SHA512 (NetBSD-6.0/next68k/binary/sets/etc.tgz) = 9b4ed551eb36810109e30dee6273d5c18fc918686ba9cab5ffc4ab25a1763e645a179920e7d4ba56be3b15269425e38abf3237e1e6a788b369a4d26d59aa8a6d
+RMD160 (NetBSD-6.0/next68k/binary/sets/etc.tgz) = beadac2eb477aca072b36fa2587e46645e908d11
+MD5 (NetBSD-6.0/next68k/binary/sets/etc.tgz) = ebd0202a3d65b7a528b4854483ac669d
+SHA1 (NetBSD-6.0/next68k/binary/sets/modules.tgz) = 49e37041d779f3b282c12b3f41d876e4621914f2
+SHA512 (NetBSD-6.0/next68k/binary/sets/modules.tgz) = c8f22b3d92b7089aaf3b5fe563a9d0cbc7124b6e402e53b458881c123468e51b5b4f92d8e8b1a5c0f7ff19fc032bdd012db8dfd801be6330e96e0e79917df08a
+RMD160 (NetBSD-6.0/next68k/binary/sets/modules.tgz) = 093e67a0796abb445f0f3b7f6bbfa42a68dff403
+MD5 (NetBSD-6.0/next68k/binary/sets/modules.tgz) = dcf44be798ece88e148faaabe70e2251
+SHA1 (NetBSD-6.0/next68k/binary/sets/tests.tgz) = 28b7d959516205c1231c7f756614c776fdba9576
+SHA512 (NetBSD-6.0/next68k/binary/sets/tests.tgz) = b704bcbe14b260067ea704350ff9b49d49e040a6a87597211de8cea7e05039054c4f4996bd96829a9acc1a97320b3fa3f1ca2300717365e2c13fefac4e13ec11
+RMD160 (NetBSD-6.0/next68k/binary/sets/tests.tgz) = b7ad8dc285efaeb99c3d1384dada9b20cc7104bb
+MD5 (NetBSD-6.0/next68k/binary/sets/tests.tgz) = 45d4bf99be70595e367459256c139b65
+SHA1 (NetBSD-6.0/next68k/binary/sets/text.tgz) = e079bed4ddd9e37cd0cb2f514823f81de9200669
+SHA512 (NetBSD-6.0/next68k/binary/sets/text.tgz) = 3f66684ea0cdaaa433f52dc40eb6776091d19e5f53c87c3fa888ceaef29524dcd7b5c08ce8f08df94db7f039026dfe60a963d23f888bdeab70da4bf71592b122
+RMD160 (NetBSD-6.0/next68k/binary/sets/text.tgz) = 692b64c1a4e521caa76fdc109175a636ef4f9d21
+MD5 (NetBSD-6.0/next68k/binary/sets/text.tgz) = ea58b70eb622e2bc8fb610431f9f27c4
+SHA1 (NetBSD-6.0/next68k/binary/sets/xbase.tgz) = 5e093e4987d3ef6e66dee1dbf5d2c2781a7be759
+SHA512 (NetBSD-6.0/next68k/binary/sets/xbase.tgz) = 9bf75e2feb514bf47ead4151dfc44e0bd8361bd2155bdd7f5f5bda16c2ce60edef88cfbfe054161af32ea2804ccc5903b5ecc8a4270b2d19d6e864c7df776ef7
+RMD160 (NetBSD-6.0/next68k/binary/sets/xbase.tgz) = 6c8fe359b16a5d6d7ab318ad8970b36b3a9d8b41
+MD5 (NetBSD-6.0/next68k/binary/sets/xbase.tgz) = 4dc8195a284c6ff792f07b0279a1ffee
+SHA1 (NetBSD-6.0/next68k/binary/sets/xcomp.tgz) = 6248c1a2455726a172e7d41ad3b71396d1569c27
+SHA512 (NetBSD-6.0/next68k/binary/sets/xcomp.tgz) = 03272ed1984404a7ed8d6753aae6fd2797b82da0f856173bff109dd46909561af865acf81ec8007e8e95794d41e49caa4ffead9d0f5a304e4fe3a627fc62b5ca
+RMD160 (NetBSD-6.0/next68k/binary/sets/xcomp.tgz) = a6fd52049b8fb32c457db212ea0b0f04ae8837f6
+MD5 (NetBSD-6.0/next68k/binary/sets/xcomp.tgz) = 1e5c017075bcb0ddc800674737475134
+SHA1 (NetBSD-6.0/next68k/binary/sets/xetc.tgz) = fc7edd9e51673c25587253ccfa05b06556554596
+SHA512 (NetBSD-6.0/next68k/binary/sets/xetc.tgz) = 6d1f1584a7dbf8ddc3695951796b3951ef5fcae7176c93e5992aa84618b1a935d28baf14dac468cfd50e084414978e824054e08d30b3761e2467aecaa8a2d5cc
+RMD160 (NetBSD-6.0/next68k/binary/sets/xetc.tgz) = 287ef7ae8028b2cdfdd081f19a387900bcb49b37
+MD5 (NetBSD-6.0/next68k/binary/sets/xetc.tgz) = 9cc9fc5b70004b4e532fc745ac7c07f8
+SHA1 (NetBSD-6.0/next68k/binary/sets/xfont.tgz) = 66f50766e91abe745da27688863877f1002907c7
+SHA512 (NetBSD-6.0/next68k/binary/sets/xfont.tgz) = 3f1fd3be74c0971fe2217fb8e39f6ca693d07b5a272b3eff1028ee2f012ec2c04239ec90cd90846553e3a066b58fa957d0ab1d3695faaf0063a6c947165e63f4
+RMD160 (NetBSD-6.0/next68k/binary/sets/xfont.tgz) = 185771ae1f0ed1ca9d8e7025f402bb41c5a14519
+MD5 (NetBSD-6.0/next68k/binary/sets/xfont.tgz) = 57e25cb12fb7ae0b3cd06def9e685b7d
+SHA1 (NetBSD-6.0/next68k/installation/boot) = 1678cf659734cb8f7d5d034bf1ce6aa506278920
+SHA512 (NetBSD-6.0/next68k/installation/boot) = bf027e98b6c1a81300dfe506c084a9777f4f5f9b4078b35d61ea0a39ff73a5d9abe526f423164ed3c076ce7a33cedf460111142f24861c142a5b2c6485881ab9
+RMD160 (NetBSD-6.0/next68k/installation/boot) = 8d3d5e3786b272a9dda7ca19185e3802639f7f6b
+MD5 (NetBSD-6.0/next68k/installation/boot) = ec7ee9f5d5be157c6a9a56ac77835f47
+SHA1 (NetBSD-6.0/next68k/INSTALL.html) = aaf1f7407874cf9d7bdff5b434a74e298b7dc52f
+SHA512 (NetBSD-6.0/next68k/INSTALL.html) = b2d952c916578af512363fa118f81950b95b545aac62474194ef2ed4df3fc4fd9f334f7b3171335f7669c8d0992c37140daa86bab57dcb0020dfa39abfcc4ecd
+RMD160 (NetBSD-6.0/next68k/INSTALL.html) = 52a08c6bd446a00228899639e98aeb8327f100ee
+MD5 (NetBSD-6.0/next68k/INSTALL.html) = f08b6811f0f572819de3b455714166b7
+SHA1 (NetBSD-6.0/next68k/INSTALL.more) = dced1147a6dc54b1365d13a49d0bf57d596653aa
+SHA512 (NetBSD-6.0/next68k/INSTALL.more) = 5136e7a75ef6c3a39ca15112414c73c023c560dfbc09d4da60e6435112a4108c192f25b200f0a149a9eafdff3a74001630f972f58dcc2a9d18174286c906b680
+RMD160 (NetBSD-6.0/next68k/INSTALL.more) = fd826a26af8b89375881dc361a7426b7841baa52
+MD5 (NetBSD-6.0/next68k/INSTALL.more) = 0d480ba3bfd38cc17c62d387a740111d
+SHA1 (NetBSD-6.0/next68k/INSTALL.ps) = 47541be31baefad1f76a45e45b2050cda159953f
+SHA512 (NetBSD-6.0/next68k/INSTALL.ps) = 297a4fb8e5242a764b721a3bea309d123d3f71b67aec903926d5118b42831ba054242783fcbdc19520609ac06f81b733785b5952e24ae23218219046922f8f8a
+RMD160 (NetBSD-6.0/next68k/INSTALL.ps) = 56423276a2db90876c067eb51b7c19f1341d261b
+MD5 (NetBSD-6.0/next68k/INSTALL.ps) = ed71185d0510303cbb5d8ff681dcfaf5
+SHA1 (NetBSD-6.0/next68k/INSTALL.txt) = 3d70ff39023294025c590934bdaca3fce5dd33bd
+SHA512 (NetBSD-6.0/next68k/INSTALL.txt) = d0485c5d3587022d986a53345ed78f49130ef54070d0c45a7812d57400402079855d6cc72401579d1185d2dbeb5e5846efebfa50fda484cc5a1ac719ca7b706a
+RMD160 (NetBSD-6.0/next68k/INSTALL.txt) = bd984eb4c13e1ec872ee2517b72c13ac7e90e090
+MD5 (NetBSD-6.0/next68k/INSTALL.txt) = 0cf50370809ab3ff52dc710474d37edb
+SHA1 (NetBSD-6.0/ofppc/binary/kernel/netbsd-GENERIC.gz) = 31cf98d9ea175b5ea6fe09455217e660d44f1973
+SHA512 (NetBSD-6.0/ofppc/binary/kernel/netbsd-GENERIC.gz) = 22e1ac76e1fa230f69485f53ac23186a97562a1088b1a99979d9d446dcef8a863f1bd63eb6bf16ebf990b40b161fb75025890d9d52474b82cdb3d497e2056b2a
+RMD160 (NetBSD-6.0/ofppc/binary/kernel/netbsd-GENERIC.gz) = 1ade658130f4e40d57cee2ab641234c1e93c3f01
+MD5 (NetBSD-6.0/ofppc/binary/kernel/netbsd-GENERIC.gz) = ae8374ac0ba9ca59c6068561dcad1ba3
+SHA1 (NetBSD-6.0/ofppc/binary/kernel/netbsd-INSTALL.gz) = 0b815e688d07caf3d93190562bcd53f3057ec1b6
+SHA512 (NetBSD-6.0/ofppc/binary/kernel/netbsd-INSTALL.gz) = 43255a25b3044320db3d12f474a70920efe93a52aad3351933ae80bd079a8f93a866fa1c939a92d075161822066dc76ffe314feaf493a783ca51058eba9e96e0
+RMD160 (NetBSD-6.0/ofppc/binary/kernel/netbsd-INSTALL.gz) = 87995ce3c896b4ffcef1eaeef9c7ff27e8c5446f
+MD5 (NetBSD-6.0/ofppc/binary/kernel/netbsd-INSTALL.gz) = 008fbd36266fbb4ef45c3c289d07dbd3
+SHA1 (NetBSD-6.0/ofppc/binary/sets/games.tgz) = fbf69640b362df2446d7414ac3a13db100c289eb
+SHA512 (NetBSD-6.0/ofppc/binary/sets/games.tgz) = d86b41d79aea4204ccf45306937a5ec45629e37873a5956c0280fd1d54cf4a808542d097f9d978fd3277791554ce8a6fb4d0ccd46e30210549d5cce1145bb499
+RMD160 (NetBSD-6.0/ofppc/binary/sets/games.tgz) = fd2aed1eb51f4db522fb5163e8fde4c040b55d30
+MD5 (NetBSD-6.0/ofppc/binary/sets/games.tgz) = 997ae5fb42196a787df89873be321e47
+SHA1 (NetBSD-6.0/ofppc/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/ofppc/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/ofppc/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/ofppc/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/ofppc/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/ofppc/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/ofppc/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/ofppc/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/ofppc/binary/sets/xcomp.tgz) = 960dd33b61e19dec92096a54791aca1cdf56ce54
+SHA512 (NetBSD-6.0/ofppc/binary/sets/xcomp.tgz) = 111dd50041e4008aeadb898c3d08f9995c5c13a41ccc20993b4ad51c81d7f6ee3b4dab16158ac7436d085b80e4a643b236a9c97edd3e915125a1466154538420
+RMD160 (NetBSD-6.0/ofppc/binary/sets/xcomp.tgz) = 0cf8b9a8d1489a32ba0b5a277d90e429c40650fb
+MD5 (NetBSD-6.0/ofppc/binary/sets/xcomp.tgz) = 4ba4077ca2c0edf71813165fcf5321fb
+SHA1 (NetBSD-6.0/ofppc/binary/sets/xfont.tgz) = 4711fcbade0238d60b7b89cf0d7873b03d7ed1f7
+SHA512 (NetBSD-6.0/ofppc/binary/sets/xfont.tgz) = c29130f55f536f602253a7f92f073ebf6ba02baea09f8011530bbf7e03ae96594334f0c60b29a8bceaffc3eb8b152db47548e38a3c8a14abc5fe35bc5d1d7d93
+RMD160 (NetBSD-6.0/ofppc/binary/sets/xfont.tgz) = 3b01af0f8e34367988d559fe0fbb0acbbafb0b2b
+MD5 (NetBSD-6.0/ofppc/binary/sets/xfont.tgz) = 6ba15ed12217b726d9129db8e942a048
+SHA1 (NetBSD-6.0/ofppc/binary/sets/kern-GENERIC.tgz) = 7ace360c931ac41952447fce2d6241a8393a7b3c
+SHA512 (NetBSD-6.0/ofppc/binary/sets/kern-GENERIC.tgz) = 9c63f0169c8bf1282c54a5ae3b1396376b69a23b6ac881859a304a9d21aad45f64d0998eae3399cc397489a1c3e1b7f52cdce0ee806c160ae5da3287b113c00b
+RMD160 (NetBSD-6.0/ofppc/binary/sets/kern-GENERIC.tgz) = b96e84c0a6d945475f6523d73cabb42ff80caa46
+MD5 (NetBSD-6.0/ofppc/binary/sets/kern-GENERIC.tgz) = 2153bc142bb6f9067287344b5d3703e6
+SHA1 (NetBSD-6.0/ofppc/binary/sets/base.tgz) = 48aef3545f49ee86082480f6712e6c7df6c1c82f
+SHA512 (NetBSD-6.0/ofppc/binary/sets/base.tgz) = 580ad38769fc64e5f50a59f726d13d21625392459a03633c4908fbaf16e08715032dd10fbee9f4efe5261beb24169dcdaf86f11d20f2e2bfc7af22f16ce5b10c
+RMD160 (NetBSD-6.0/ofppc/binary/sets/base.tgz) = 93fe246dba1352ba0bc5ef955094069e82e777cc
+MD5 (NetBSD-6.0/ofppc/binary/sets/base.tgz) = 6a0ea91d58c236cd1d72963bee61dbc8
+SHA1 (NetBSD-6.0/ofppc/binary/sets/comp.tgz) = 7d553fd5460fd823ee474377ad7e4e4a57796d04
+SHA512 (NetBSD-6.0/ofppc/binary/sets/comp.tgz) = 17dff29a91c71c4fcabe616595144201b999b75d56033109f24dfa89e5653ea24890e2657fc007cc0bcbceb749213eb99db5d268db8c96f41f1c2ec203e951ef
+RMD160 (NetBSD-6.0/ofppc/binary/sets/comp.tgz) = 79001f2a220166711cf3e076c137d9944cb72d07
+MD5 (NetBSD-6.0/ofppc/binary/sets/comp.tgz) = bb52657afeeafa0a04fc52d5b96130cb
+SHA1 (NetBSD-6.0/ofppc/binary/sets/etc.tgz) = b19a807890c2859c0c5dfcc27d97c7b94703ba1c
+SHA512 (NetBSD-6.0/ofppc/binary/sets/etc.tgz) = 157110603a432bdf8da99f467e263037d2683372b37c2fb9e8ba7a25a5ed6e44b6d62aa3d60464ea3d0dd101d55b85ff951afde528cc0f61158892a3b379bc90
+RMD160 (NetBSD-6.0/ofppc/binary/sets/etc.tgz) = 8e67db3042b34b9e0ec19853d0209996cb18cc22
+MD5 (NetBSD-6.0/ofppc/binary/sets/etc.tgz) = 7c3ef92dc32ef4a24a29fd071fad94f5
+SHA1 (NetBSD-6.0/ofppc/binary/sets/modules.tgz) = 976ee92c542c431c7eadaf77dc3267c54643aef9
+SHA512 (NetBSD-6.0/ofppc/binary/sets/modules.tgz) = eedd03d73c348500f3df270f002d65d16cdc9f5318ecf14ebc8c4e27af6aff26701d985e5c5a47ed9f37359fb119d61ebe64cbcd726bb5ea7a0b2947aa312a8a
+RMD160 (NetBSD-6.0/ofppc/binary/sets/modules.tgz) = 03d76ba89e00f988e16e0a5cd6798fca65852c82
+MD5 (NetBSD-6.0/ofppc/binary/sets/modules.tgz) = 132d39b3a365d6ecd924789660a7b72c
+SHA1 (NetBSD-6.0/ofppc/binary/sets/tests.tgz) = f643b7607751a3355cc6e9e8d26fcc1bfdd14a22
+SHA512 (NetBSD-6.0/ofppc/binary/sets/tests.tgz) = 0a517f2c914e449c0bedb3be5e96e76c369be5be270ad8ba2aee4b96f3a3d7afce2bb56de0eef54d97b1194101eb24331dd202605eb58e648b3f79f04b44d96a
+RMD160 (NetBSD-6.0/ofppc/binary/sets/tests.tgz) = aca5ea7884341e0dc0f4e06d552b908550cb7dde
+MD5 (NetBSD-6.0/ofppc/binary/sets/tests.tgz) = d8c47bef7caa4afa0ea7967d42a59cfa
+SHA1 (NetBSD-6.0/ofppc/binary/sets/text.tgz) = 010dbafdbd84074ed3acf0bacea61b34dad4005d
+SHA512 (NetBSD-6.0/ofppc/binary/sets/text.tgz) = a8a4fe56016f47a03dd2e23cfb5368111cc7734a7a9dba9ab42081b609c00ac812ec8e73eb75b5dc2f81b847f0bf782257834e09603aac858c8efe1e6755eaf8
+RMD160 (NetBSD-6.0/ofppc/binary/sets/text.tgz) = 263b72d30191910c092ab984458cd1442ba67f3a
+MD5 (NetBSD-6.0/ofppc/binary/sets/text.tgz) = a6dfbc450a9aec79555f52694a2971f0
+SHA1 (NetBSD-6.0/ofppc/binary/sets/xbase.tgz) = 292a1ad5d516609f5c3c5e78e83f4f200f967775
+SHA512 (NetBSD-6.0/ofppc/binary/sets/xbase.tgz) = b3c082fb1fe52edc65fb728d9347d51285a761ba8bbb56cf84744f70614c2c1207a8b48c49d5ad598fc09745f3a900ca2bb08cff4381be8f007d6b89faf7c058
+RMD160 (NetBSD-6.0/ofppc/binary/sets/xbase.tgz) = 954ba03beb3cc9b5064c0d9e9008358cf9c490f5
+MD5 (NetBSD-6.0/ofppc/binary/sets/xbase.tgz) = 410d993f39451d776e2c9d9ca55414ac
+SHA1 (NetBSD-6.0/ofppc/binary/sets/xetc.tgz) = b83db52f87a7a2ba08d22f29249f2b0d8af31028
+SHA512 (NetBSD-6.0/ofppc/binary/sets/xetc.tgz) = 541ca16e25a0cd271b490773e043e6d66d9d704f4d4bd22458d5f3c4f76f23190264201a80cd57b567d8410ca2944a36e10868c4e2916300d978949d78293b33
+RMD160 (NetBSD-6.0/ofppc/binary/sets/xetc.tgz) = de0ae01a1d264465ca58a678c658f75d2844d04a
+MD5 (NetBSD-6.0/ofppc/binary/sets/xetc.tgz) = d60b94274347e3f9073b80da9f5dd874
+SHA1 (NetBSD-6.0/ofppc/binary/sets/xserver.tgz) = e8fd963e80c60b8a85a284484d0d78463038f413
+SHA512 (NetBSD-6.0/ofppc/binary/sets/xserver.tgz) = ca88d3ce0ccd0e82636ae59d4ea4acba9d29ba6fb51be52c6d8de5986d7b037e6062d00bc45390783efd3089de3eabbdbf565929936af7f46c207b705c33176f
+RMD160 (NetBSD-6.0/ofppc/binary/sets/xserver.tgz) = a6b1345264d3fcddf0ff72b3005dd71053aba0f5
+MD5 (NetBSD-6.0/ofppc/binary/sets/xserver.tgz) = 8150c6dfee587ce36ff31c34a1929e29
+SHA1 (NetBSD-6.0/ofppc/installation/netboot/netbsd-GENERIC.gz) = 31cf98d9ea175b5ea6fe09455217e660d44f1973
+SHA512 (NetBSD-6.0/ofppc/installation/netboot/netbsd-GENERIC.gz) = 22e1ac76e1fa230f69485f53ac23186a97562a1088b1a99979d9d446dcef8a863f1bd63eb6bf16ebf990b40b161fb75025890d9d52474b82cdb3d497e2056b2a
+RMD160 (NetBSD-6.0/ofppc/installation/netboot/netbsd-GENERIC.gz) = 1ade658130f4e40d57cee2ab641234c1e93c3f01
+MD5 (NetBSD-6.0/ofppc/installation/netboot/netbsd-GENERIC.gz) = ae8374ac0ba9ca59c6068561dcad1ba3
+SHA1 (NetBSD-6.0/ofppc/installation/netboot/netbsd-INSTALL.gz) = 0b815e688d07caf3d93190562bcd53f3057ec1b6
+SHA512 (NetBSD-6.0/ofppc/installation/netboot/netbsd-INSTALL.gz) = 43255a25b3044320db3d12f474a70920efe93a52aad3351933ae80bd079a8f93a866fa1c939a92d075161822066dc76ffe314feaf493a783ca51058eba9e96e0
+RMD160 (NetBSD-6.0/ofppc/installation/netboot/netbsd-INSTALL.gz) = 87995ce3c896b4ffcef1eaeef9c7ff27e8c5446f
+MD5 (NetBSD-6.0/ofppc/installation/netboot/netbsd-INSTALL.gz) = 008fbd36266fbb4ef45c3c289d07dbd3
+SHA1 (NetBSD-6.0/ofppc/installation/netboot/ofwboot) = 56bb70527f572ae12667a4d9dc71027032602d26
+SHA512 (NetBSD-6.0/ofppc/installation/netboot/ofwboot) = d137aad957d917f4db49ad9b912cf794d5ba9e52ac0f0d1926599dcac166df97c5b81292247b62d15a495134d4c9967ba777b0570701b3340021dcac293ab2d2
+RMD160 (NetBSD-6.0/ofppc/installation/netboot/ofwboot) = 5a6f580e7c000543b09dc7590555ce944b7f2df1
+MD5 (NetBSD-6.0/ofppc/installation/netboot/ofwboot) = 139a6e28174158a78719ab4e67de40b5
+SHA1 (NetBSD-6.0/ofppc/INSTALL.html) = 70ffc237a74825aeff35c638c9dd33b10334c09e
+SHA512 (NetBSD-6.0/ofppc/INSTALL.html) = 5df9959e93527b0f53d3866b15fcac4dbce2edd6a1bff082e588348ada3767bd0ca45d99089540fde08ecc73b8c8846ca7a046ada5f1f1072d6cd1e6c3268497
+RMD160 (NetBSD-6.0/ofppc/INSTALL.html) = 3718a3b3de1edc4d81cc61c88146e69d8b126266
+MD5 (NetBSD-6.0/ofppc/INSTALL.html) = 4a16acd4059c24dbcf1ccab96be7928c
+SHA1 (NetBSD-6.0/ofppc/INSTALL.more) = 14b22fc68257222ce1d15d02554588760ce4fc62
+SHA512 (NetBSD-6.0/ofppc/INSTALL.more) = e0c15cc5760ad5087d58c7659e8692b18fa805b6df85a7965ce142bb7506d3105c1dea0c7acdecfc51fa63f857dc959e25c74fa0ee871417670e013f4c2b2a1c
+RMD160 (NetBSD-6.0/ofppc/INSTALL.more) = b726d0dd772cab274c9b2f6f484d5b1903151827
+MD5 (NetBSD-6.0/ofppc/INSTALL.more) = 40e2acf64e90023938d03f0ff945ab0f
+SHA1 (NetBSD-6.0/ofppc/INSTALL.ps) = 16a078ed4ada6fe71e1d5939bacd3a60c10cefbd
+SHA512 (NetBSD-6.0/ofppc/INSTALL.ps) = 1d9815a162a77d91aebbfd11e0fe6d386c24be9e734683a6eee3cc49e059e8c4c9e559d00c3bfdbd3ceaaf885c11deb5c985ab4de41f1e1b1c9c5b037d300ec5
+RMD160 (NetBSD-6.0/ofppc/INSTALL.ps) = 83f80393d6bd7845dac2c2f789b14104b5ed3b9e
+MD5 (NetBSD-6.0/ofppc/INSTALL.ps) = 9ef011b3eea954489d1e03261175f278
+SHA1 (NetBSD-6.0/ofppc/INSTALL.txt) = 0703c2fc0836a815f8a23c9e295482feced08667
+SHA512 (NetBSD-6.0/ofppc/INSTALL.txt) = e5a59c4554e4dad54c4de8af3ef1fc051a3ed6ddcca88fe60b0f1c5e52c75507268a0cd154482fd7f8633ef0b6de5fa9052334adb93bc787e0f45db400018aea
+RMD160 (NetBSD-6.0/ofppc/INSTALL.txt) = b4b1e1c493973acc61f5280eec83fd1a4b386f9e
+MD5 (NetBSD-6.0/ofppc/INSTALL.txt) = 167ec8dd0f2430f3baafba98c15b0b77
+SHA1 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.ecoff.gz) = c3341e74bbfc424f067743c23369e7d4de2320d8
+SHA512 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.ecoff.gz) = 902237dd2bac97bbf8bc0d70e933307897e375cf760f90531ae39ff8f9abaf1c70091d61678e56448b46d060919eb93b052e0bdcba34482b12174855bf29a941
+RMD160 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.ecoff.gz) = 12abc208e6d943a92255fa99934e2fbdd98b86d5
+MD5 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.ecoff.gz) = 3a5c93ed6aedf91145618578c0283312
+SHA1 (NetBSD-6.0/pmax/binary/kernel/netbsd-GENERIC.gz) = c673249c82581fc220eeab9db4826ae70a879f7d
+SHA512 (NetBSD-6.0/pmax/binary/kernel/netbsd-GENERIC.gz) = 28c33a6cbb2cb4ad53e3e780c74a903ee93a6350da5a36c0232a57e690b80caf1053dc2bad1badd5631abeb20dbfbd223413762bf576db7363a3bd07aa91ddee
+RMD160 (NetBSD-6.0/pmax/binary/kernel/netbsd-GENERIC.gz) = 1c56f35974b50c40595fb19a763e6e13a052136c
+MD5 (NetBSD-6.0/pmax/binary/kernel/netbsd-GENERIC.gz) = 27f93c549aa40bae7bae47978622eb2c
+SHA1 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.symbols.gz) = af7b35f9bea1761095521088a9bad8d6122565c9
+SHA512 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.symbols.gz) = 506859e85d0266360f83d3a7af1deb8f9a84c8f1bbab10c1bd8b9b43bdf8ff7056629450f8aff2ed6f3424ff2034cd36e21144bceaaac6048fe54f58982dfa8f
+RMD160 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.symbols.gz) = 71b182d23dfaa77e92597e840c0d5cb502b9ff7b
+MD5 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.symbols.gz) = f70b79efeefcd03ef2b47a6d61b723c8
+SHA1 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.gz) = f22aa49d239f1c2b49fc2779dbc71b79d6470468
+SHA512 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.gz) = 82136634c9a3ea07a6eb23ad3e6d4214d796f54d406de73cd23f0da45a3872bae0f7f120ddb67aab0da05ef88feb21bb63ec1adf880469ee5d4eda2e32080732
+RMD160 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.gz) = 351fe6fec563003dcb4a0045c740ba3f2fcb73ad
+MD5 (NetBSD-6.0/pmax/binary/kernel/netbsd-INSTALL.gz) = 50f2b444f3462f71810f3c93b47083ff
+SHA1 (NetBSD-6.0/pmax/binary/sets/games.tgz) = 27d9f98fecb3495e51939df9f107e81e527af26f
+SHA512 (NetBSD-6.0/pmax/binary/sets/games.tgz) = 46bb4e10313cfffaaf4f7fa2157474ef940f94bcc9f84b46f829c7615bbf45e4e01edee7b7efb84bc28561e0712c37cfc737f9c2a0d9a73b67c80c8aa0f3a9af
+RMD160 (NetBSD-6.0/pmax/binary/sets/games.tgz) = 947feea90ec2698a65d555cb78a29a001b086589
+MD5 (NetBSD-6.0/pmax/binary/sets/games.tgz) = 355f00978fed8e8da6a251e591be5387
+SHA1 (NetBSD-6.0/pmax/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/pmax/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/pmax/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/pmax/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/pmax/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/pmax/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/pmax/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/pmax/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/pmax/binary/sets/kern-GENERIC.tgz) = 1ae699dc77ef033860c3fcc0df198c6ec15bf312
+SHA512 (NetBSD-6.0/pmax/binary/sets/kern-GENERIC.tgz) = 1a29fbe70596378ab0f543dd010c24ca327822d743152ce0405eb0e4ab268224b91d346d23b9ee1eec706b4cbe88ccdea27cb6a9b115ce9ddcdaced115a58682
+RMD160 (NetBSD-6.0/pmax/binary/sets/kern-GENERIC.tgz) = 5edbc95d6df7a073b545902862a9e012a981b36b
+MD5 (NetBSD-6.0/pmax/binary/sets/kern-GENERIC.tgz) = d9d9dab85e423b5953eb17bdf8072375
+SHA1 (NetBSD-6.0/pmax/binary/sets/base.tgz) = a7e09afd631257929bbc0a4c6705fd56cafdda30
+SHA512 (NetBSD-6.0/pmax/binary/sets/base.tgz) = 8313b9e6146645955a135e9f9c69b90688f9011ef4087a7911e842ff13802150347ac4e7e9b3f60313a06300e90e93c192910741fd427705709be5f669a45701
+RMD160 (NetBSD-6.0/pmax/binary/sets/base.tgz) = 52eb2bdd47d2a4ae8ac2b780e70006dcc79f4cf6
+MD5 (NetBSD-6.0/pmax/binary/sets/base.tgz) = 3b726d62e4341637cf824c141cdc362c
+SHA1 (NetBSD-6.0/pmax/binary/sets/comp.tgz) = 9cc5684de31ac3b6c086f3716926eccbfaec6191
+SHA512 (NetBSD-6.0/pmax/binary/sets/comp.tgz) = fbead7650935dcbea46ef3e11ef03468287b0461cbb70b51e330e641dd7e246bd602bc92935980e3e8ea8100e8ea487906763fc615e477462a9644201a7f616f
+RMD160 (NetBSD-6.0/pmax/binary/sets/comp.tgz) = def96b7d151cc9405fe72c51f7ca95b552f3bd46
+MD5 (NetBSD-6.0/pmax/binary/sets/comp.tgz) = 93a3bdd6f9461cc642955b749cddb59a
+SHA1 (NetBSD-6.0/pmax/binary/sets/etc.tgz) = 73127a1dcbea90c9029538e87773bc7846ac2016
+SHA512 (NetBSD-6.0/pmax/binary/sets/etc.tgz) = b96b30df1576538bcbaddcf471cd4d87258c06d199077d35d4ea37dfc9c3f388bd62c1ea8c3634ee501d6f28409bd966b791bf3eef8741ca2234c12e1101008a
+RMD160 (NetBSD-6.0/pmax/binary/sets/etc.tgz) = 44ef8ce24cdd12aa5af0cbbf700abeef900e12e5
+MD5 (NetBSD-6.0/pmax/binary/sets/etc.tgz) = 0dd976e6a6c855f02a86fc0fb624b4af
+SHA1 (NetBSD-6.0/pmax/binary/sets/modules.tgz) = 9ed1e0f57d9ee14dc3850e541f0b95132a3048c2
+SHA512 (NetBSD-6.0/pmax/binary/sets/modules.tgz) = 7a367e78224326f43584bb7cfa1aedd74763ccfca9d6abc8587882ecb1b8276851ead5ff1afbe9cd16accfd0d415e26db6604d3a9c3a1bac78d94107a57d033b
+RMD160 (NetBSD-6.0/pmax/binary/sets/modules.tgz) = cff6f3fc309012a3f45c047ea5238f83432235a5
+MD5 (NetBSD-6.0/pmax/binary/sets/modules.tgz) = 825fa6d6cac00e2629ec059fcb68008b
+SHA1 (NetBSD-6.0/pmax/binary/sets/tests.tgz) = 802f716b73250eee2696cac4b6e3395833c0237d
+SHA512 (NetBSD-6.0/pmax/binary/sets/tests.tgz) = f56cba629167f2f679a460679faaf566f4baf053d644a71fd70fa3041aa592aa0a53b98876ce474b48f46a582401a882161005360fdddc49246f094680b1029f
+RMD160 (NetBSD-6.0/pmax/binary/sets/tests.tgz) = a9b17f97265bdfb69402190690d77306f42ecb6b
+MD5 (NetBSD-6.0/pmax/binary/sets/tests.tgz) = 54dd7a96d4abee24bb0019a846d77825
+SHA1 (NetBSD-6.0/pmax/binary/sets/text.tgz) = a0b59e7fb204b9db40df7edda528e8ca8b4e3fd6
+SHA512 (NetBSD-6.0/pmax/binary/sets/text.tgz) = fb7c0d5cb17bb2ef1ffeefa5791bab7932a05e33cd064f279d99eebe07a52f1420aa64a8c6acf191efacbfd130509fb427e6d5d8f14c042b3c0e5e285282592b
+RMD160 (NetBSD-6.0/pmax/binary/sets/text.tgz) = b0495549753b7c3a8abb342045ef4f65e7b640d5
+MD5 (NetBSD-6.0/pmax/binary/sets/text.tgz) = 9f9e6d5b8f9dbb70b845a9aba07ffff4
+SHA1 (NetBSD-6.0/pmax/binary/sets/xbase.tgz) = 99d83d866f2f15b6030b0533990e012ab59b1f46
+SHA512 (NetBSD-6.0/pmax/binary/sets/xbase.tgz) = 238db55892d9cbb0bd5dacb225a16e694c79af2fe461f06563a65c5d2c5b3abfc823ab26f23c54bc1514568018726baab0258aac0e52ccf7615d59c2a6ef324a
+RMD160 (NetBSD-6.0/pmax/binary/sets/xbase.tgz) = 16560205f7564558bc22495116ace64618834133
+MD5 (NetBSD-6.0/pmax/binary/sets/xbase.tgz) = 384d33f9a8ec5c7bc8e104869e3e493a
+SHA1 (NetBSD-6.0/pmax/binary/sets/xcomp.tgz) = 6b6b8d6b522b0546a13a304195765526158f6eb2
+SHA512 (NetBSD-6.0/pmax/binary/sets/xcomp.tgz) = 37af51b256f03e8b4c61d4c67724cead53115ccbfda7d597f3b00a020bd8f4c1fff4f6206e5fe8246e0b3fae50c7dc1df313858670a6e1729b1155e0f97e9b23
+RMD160 (NetBSD-6.0/pmax/binary/sets/xcomp.tgz) = 91d9a2cecb3955beabb71191b73d3586f2c370bd
+MD5 (NetBSD-6.0/pmax/binary/sets/xcomp.tgz) = 9028e22a82276249cc188f83101af806
+SHA1 (NetBSD-6.0/pmax/binary/sets/xetc.tgz) = 2171c5c0cb3143aa83fb8e55d4d98fd87d3e556d
+SHA512 (NetBSD-6.0/pmax/binary/sets/xetc.tgz) = a63407a7d884ea60761ccdee9279c37b790aa08defced01410786e0e020a63b5a4e4cfd503a0ef09e555d04a98a99dbfcfb087c476070771f8b5b5a205b4495a
+RMD160 (NetBSD-6.0/pmax/binary/sets/xetc.tgz) = fa4c1f7437db71fb1a3122cc366591b39b00fa07
+MD5 (NetBSD-6.0/pmax/binary/sets/xetc.tgz) = be3b5f617ddd47650cf9423451320c4a
+SHA1 (NetBSD-6.0/pmax/binary/sets/xfont.tgz) = ca16714159668bc20017cbb9a81fe3746171e383
+SHA512 (NetBSD-6.0/pmax/binary/sets/xfont.tgz) = 077ab3a7540abb8d4039b7f017ff52dcb5aae2ba5a984dd12b04d22908863cc60db8aa67b5f772a584aabbe05a74426534eeced9f323aa07c9225c8333c41f3f
+RMD160 (NetBSD-6.0/pmax/binary/sets/xfont.tgz) = 33beb97b3267941786413a7c5624d78297f5ccf6
+MD5 (NetBSD-6.0/pmax/binary/sets/xfont.tgz) = c262ee8846a85c1e5b00a8ecbe754dcc
+SHA1 (NetBSD-6.0/pmax/binary/sets/xserver.tgz) = 86332fccabc2c7b8e7ef7f8fa9eebc2f22c8afba
+SHA512 (NetBSD-6.0/pmax/binary/sets/xserver.tgz) = e02ed6aa6333bd8941d02f15a3797f862f3fe47b5afce08d60021a06d5ed9db56e8bf802920e8b7614ff5e3127706b195ab9a678710b7b6afb6b70e0f3a7f636
+RMD160 (NetBSD-6.0/pmax/binary/sets/xserver.tgz) = 4bc06df7b2012be80b61ef6b9860a4698b815353
+MD5 (NetBSD-6.0/pmax/binary/sets/xserver.tgz) = 5dd0ae8362aa55b5c7ab207d771834f3
+SHA1 (NetBSD-6.0/pmax/installation/diskimage/diskimage.gz) = 013da364eedff1ef317fe4933205a1f6e45a7520
+SHA512 (NetBSD-6.0/pmax/installation/diskimage/diskimage.gz) = 9a415703b540ea67b99a367bf8a2dbd73c18fc1aff0ee2b3ffedb858d09cfa1b3e7bc62a654061963394f3540c50259ad343edfc41518fa444332d7ab9ea5e8e
+RMD160 (NetBSD-6.0/pmax/installation/diskimage/diskimage.gz) = 3c7faef744c1c309dbad390121852ca1ad8ed0f1
+MD5 (NetBSD-6.0/pmax/installation/diskimage/diskimage.gz) = 2e40475c5dfbfa75ac856a0a02f4afd7
+SHA1 (NetBSD-6.0/pmax/installation/miniroot/miniroot.fs.gz) = fb7b259d7649170e5eaa31217417b6e75291529f
+SHA512 (NetBSD-6.0/pmax/installation/miniroot/miniroot.fs.gz) = 3ef73219ab90c01753bf53dc325b64e26b8b41a7cd78ff1fcb85c4d27ab44b2979b6d312c17383ae9f8c3d24c968f5b896fd04a0679e64a47ea859b578022722
+RMD160 (NetBSD-6.0/pmax/installation/miniroot/miniroot.fs.gz) = 4f8d0f80c84f93b4ea5d9025c4fd3227c2880641
+MD5 (NetBSD-6.0/pmax/installation/miniroot/miniroot.fs.gz) = 3e2cc1da2be2c9ae099bd488393a9904
+SHA1 (NetBSD-6.0/pmax/installation/netboot/diskimage.tgz) = de0f5cd5da27716499b56ae61afe5ca6a8bb0839
+SHA512 (NetBSD-6.0/pmax/installation/netboot/diskimage.tgz) = 0283bc16d8fef0704b0d90bda6213d05e63271053ce59cb20d6cf0dc3a76bb8ed711e968de5a194d2d900becf83eb4fccbd82c22ed868c9a79b7cfbbc43acef7
+RMD160 (NetBSD-6.0/pmax/installation/netboot/diskimage.tgz) = a46875bffd27ea9d145b5e5f2a286a49c5b93cdb
+MD5 (NetBSD-6.0/pmax/installation/netboot/diskimage.tgz) = a491535a6424e97d5c52207404922ba9
+SHA1 (NetBSD-6.0/pmax/INSTALL.html) = 416fb09d6569c88845b26c89d9062106799cb772
+SHA512 (NetBSD-6.0/pmax/INSTALL.html) = cc06ccfbe9a109b6873a6e280baa5d401d3adb507160e145446e0c6d3c042cd5ba2f9edbe1c8d9731722d12fcc42bf40c5ff7a8e1746d096c182fe92437d2072
+RMD160 (NetBSD-6.0/pmax/INSTALL.html) = c40efcbd9facf5dce4471b1adf725830cd53b934
+MD5 (NetBSD-6.0/pmax/INSTALL.html) = 140966d090ff98ea58dc24cf673a5e11
+SHA1 (NetBSD-6.0/pmax/INSTALL.more) = c737caf24e7e33dd11ee48d0f0b1c0ec2efe8010
+SHA512 (NetBSD-6.0/pmax/INSTALL.more) = e014f63f15cfe131b38adf13500caab4ba7d43a7dce6432b2d688e916c3939ac851e5cb9af544db231cf729e5e39f223b1a73cff5ad66a92714aac71546c863d
+RMD160 (NetBSD-6.0/pmax/INSTALL.more) = 3d69b81b9dacf7933a2b0e9c76568f9ccd212330
+MD5 (NetBSD-6.0/pmax/INSTALL.more) = 7aae0fb416c11b3ba0558595afc3af37
+SHA1 (NetBSD-6.0/pmax/INSTALL.ps) = 64b1af6366baed6f548759b6a09fdbbfbb85dbf2
+SHA512 (NetBSD-6.0/pmax/INSTALL.ps) = ec6c213be8ee3af8e2720fcce970c9e8d5e220b1b94ba5f1ef1d8fd4a4c1ae773d522e077e28aadbb4c78a814ea4c06e2f1a915de8e8628f2602cd8705ff786a
+RMD160 (NetBSD-6.0/pmax/INSTALL.ps) = 17eac5c26ecf0947848d6742ba0aeb54d5b7ad21
+MD5 (NetBSD-6.0/pmax/INSTALL.ps) = 242d97c9cf75db873cb975d2788a24c5
+SHA1 (NetBSD-6.0/pmax/INSTALL.txt) = 90f4bfa985417eff921768c47ffc495b066292f6
+SHA512 (NetBSD-6.0/pmax/INSTALL.txt) = 36a7a301319525765fa1ae6c4d73b93c02b59a6f532f0dd1f96503a330daf0ba903f97df81dbd906bd54f83a83332efb28a8450d3a99ec5214abe0ed5369041f
+RMD160 (NetBSD-6.0/pmax/INSTALL.txt) = 02fe56f81cd11b4c65a13da0868e887ccfd7d511
+MD5 (NetBSD-6.0/pmax/INSTALL.txt) = c6a7c6addcfbd8f1b1bc708946065b52
+SHA1 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL.symbols.gz) = 4a2e47a10e1c8913a04a5c574a0f09b82540b23d
+SHA512 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL.symbols.gz) = 07c86d3b4d188d94141d181b1828e0548bf1e9597c6b470e7a35c787e7c830905fdc63ea4c8ea3f8310378f2e2bb55097c915d1785379d30c12861047d95af12
+RMD160 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL.symbols.gz) = 70b4600b73a7d8b937790bb9d69c68e82fdf559f
+MD5 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL.symbols.gz) = b0f9598d18b5ff0081a3dcc02e4ae185
+SHA1 (NetBSD-6.0/prep/binary/kernel/netbsd-GENERIC.gz) = aadff547ddd7061ee0fe0c72833b691eaeae554a
+SHA512 (NetBSD-6.0/prep/binary/kernel/netbsd-GENERIC.gz) = 57a25d74b982bbd519271f24456cd5de583e9e5c7e2ef7d8850d6aa64fcccddc9a2e6545c3ed7323e087d04116c2c78ace5b427b14fc3542435ba3bb9497e4b5
+RMD160 (NetBSD-6.0/prep/binary/kernel/netbsd-GENERIC.gz) = 9a642cc44881b1f2b6049710d159f7a4ffa0f25d
+MD5 (NetBSD-6.0/prep/binary/kernel/netbsd-GENERIC.gz) = 2a37ae4ea5cdc2702db0dba34cf7be3c
+SHA1 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL.gz) = c138618a1e3ab93778033de4e66966f08e047d2b
+SHA512 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL.gz) = b4045a71215ac632950cae3022d9d2d7ce9af9d225ffd8a0e775093e934cc4b0492f1e95167bcb7bc245bb9d5f3390de974158b0d0ea8146fd54bc40199ed10f
+RMD160 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL.gz) = 5a2a9371e99acf25730bdd8e9826afc16257560b
+MD5 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL.gz) = 3aaa4706000b77fc8078bf2dc572c746
+SHA1 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL_SMALL.symbols.gz) = 1ef4af8edaba52436270f4eabc0549fd8c57767d
+SHA512 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL_SMALL.symbols.gz) = fba7441719c1023b2719179ad017ac8e4c7a99499d2152ce75dc54014cfb55eecd0bb50e549ce976e1a5d58b420cd60416db364ed8633682a7c9c66a22af1329
+RMD160 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL_SMALL.symbols.gz) = 428a02bccd74b8b6462a0ec5ecfebab5a9576def
+MD5 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL_SMALL.symbols.gz) = 901fb77c124b0ba7923d535a65a06fa6
+SHA1 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL_SMALL.gz) = ec4f1dffaaffea221d480df7dfe89d7a129dd9b1
+SHA512 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL_SMALL.gz) = d5ee09d3d063a6a816b7fd0fd3fa3d0251e1b056ec75368bf557e79836afc0292274d3642d9afedbfb4893a4d4cca97e4f1d0d859db60e3a8b644d9826e57d94
+RMD160 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL_SMALL.gz) = 0bfa88f9965abca2ffa342158b4e1621183887e1
+MD5 (NetBSD-6.0/prep/binary/kernel/netbsd-INSTALL_SMALL.gz) = 8d52534cc5095a06286d6644f2ede176
+SHA1 (NetBSD-6.0/prep/binary/sets/games.tgz) = fbf69640b362df2446d7414ac3a13db100c289eb
+SHA512 (NetBSD-6.0/prep/binary/sets/games.tgz) = d86b41d79aea4204ccf45306937a5ec45629e37873a5956c0280fd1d54cf4a808542d097f9d978fd3277791554ce8a6fb4d0ccd46e30210549d5cce1145bb499
+RMD160 (NetBSD-6.0/prep/binary/sets/games.tgz) = fd2aed1eb51f4db522fb5163e8fde4c040b55d30
+MD5 (NetBSD-6.0/prep/binary/sets/games.tgz) = 997ae5fb42196a787df89873be321e47
+SHA1 (NetBSD-6.0/prep/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/prep/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/prep/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/prep/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/prep/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/prep/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/prep/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/prep/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/prep/binary/sets/xcomp.tgz) = 960dd33b61e19dec92096a54791aca1cdf56ce54
+SHA512 (NetBSD-6.0/prep/binary/sets/xcomp.tgz) = 111dd50041e4008aeadb898c3d08f9995c5c13a41ccc20993b4ad51c81d7f6ee3b4dab16158ac7436d085b80e4a643b236a9c97edd3e915125a1466154538420
+RMD160 (NetBSD-6.0/prep/binary/sets/xcomp.tgz) = 0cf8b9a8d1489a32ba0b5a277d90e429c40650fb
+MD5 (NetBSD-6.0/prep/binary/sets/xcomp.tgz) = 4ba4077ca2c0edf71813165fcf5321fb
+SHA1 (NetBSD-6.0/prep/binary/sets/xfont.tgz) = 4711fcbade0238d60b7b89cf0d7873b03d7ed1f7
+SHA512 (NetBSD-6.0/prep/binary/sets/xfont.tgz) = c29130f55f536f602253a7f92f073ebf6ba02baea09f8011530bbf7e03ae96594334f0c60b29a8bceaffc3eb8b152db47548e38a3c8a14abc5fe35bc5d1d7d93
+RMD160 (NetBSD-6.0/prep/binary/sets/xfont.tgz) = 3b01af0f8e34367988d559fe0fbb0acbbafb0b2b
+MD5 (NetBSD-6.0/prep/binary/sets/xfont.tgz) = 6ba15ed12217b726d9129db8e942a048
+SHA1 (NetBSD-6.0/prep/binary/sets/kern-GENERIC.tgz) = 7ea9bbc043530351e4dfc3ac54ce19938a412ec4
+SHA512 (NetBSD-6.0/prep/binary/sets/kern-GENERIC.tgz) = 0123955eb6ead53c99c21e1dcd5b17f62f228c35e8d17c9f540291f0022574e2ae331a9aebc2ed947cc0cabf439fa47c59e8f820eb8e5241b6446eb79c11bdee
+RMD160 (NetBSD-6.0/prep/binary/sets/kern-GENERIC.tgz) = ef4531ac387b909f96b2cd3079ba8f12ecc61aa9
+MD5 (NetBSD-6.0/prep/binary/sets/kern-GENERIC.tgz) = 3d31ea9358a8ba0d7cb49ae1baf77e52
+SHA1 (NetBSD-6.0/prep/binary/sets/base.tgz) = 586f23dd6c50c12204650c92632bf016c9e4d57e
+SHA512 (NetBSD-6.0/prep/binary/sets/base.tgz) = 712c63416a188e041d85155a36248e5580df0aace895b045b9a2a6cb68f5cb80315dd7f731e5a79139ee19d670c7278e44561336e1224c56a71f89ece1aa79ac
+RMD160 (NetBSD-6.0/prep/binary/sets/base.tgz) = 11a21367c332428fc4e855764763276bae636fb3
+MD5 (NetBSD-6.0/prep/binary/sets/base.tgz) = 8d8b79b420ca775f8a7f33a109e40f0a
+SHA1 (NetBSD-6.0/prep/binary/sets/comp.tgz) = 2ecb14f0695750113144390d254e685c1c41331a
+SHA512 (NetBSD-6.0/prep/binary/sets/comp.tgz) = 7f8528e32862466f82158d4a60e46cf04a9c451b13655d2f25e929bf9df3dcda5c90e1e491457be3a82caea35cb2cfafdd307286e82bbddc466e8b929f44c322
+RMD160 (NetBSD-6.0/prep/binary/sets/comp.tgz) = 8ac4b55abc59b0089485a58d43d304c23dfa7519
+MD5 (NetBSD-6.0/prep/binary/sets/comp.tgz) = 7dc818422b8bdb702d921d284f0f1246
+SHA1 (NetBSD-6.0/prep/binary/sets/etc.tgz) = 56d8194e33b3ee4a1c059b1435e89a915add1275
+SHA512 (NetBSD-6.0/prep/binary/sets/etc.tgz) = 4b5eb6c9222bdcc591d9e6ad9e0781fcaa6a3bb981fe7d5f4b7137ec8df902b9fb979ea419db313dc1a823dbbdc284204b46872516d8f801f18854f75da74d68
+RMD160 (NetBSD-6.0/prep/binary/sets/etc.tgz) = 4b2fb8d900c22be6844c8931cf4c660954d123e4
+MD5 (NetBSD-6.0/prep/binary/sets/etc.tgz) = 553a0fb84d187ff3c420d5b5dc7287eb
+SHA1 (NetBSD-6.0/prep/binary/sets/modules.tgz) = 60eb72b005b0e80f397d42ed5d78fea15e867a1c
+SHA512 (NetBSD-6.0/prep/binary/sets/modules.tgz) = 98ef7da109a52a1814d3a7ff1c6377fd30140cc9783a919d6b3331226b1ea3c7b168598fb3102533637e24ad48be9f265063c0a55043e6614ae5959a56ba0aba
+RMD160 (NetBSD-6.0/prep/binary/sets/modules.tgz) = 214a8c4490e3ba6d6a4861d19bc88700de79a2b8
+MD5 (NetBSD-6.0/prep/binary/sets/modules.tgz) = 775b2278852b97f68453f62cb4a1fabd
+SHA1 (NetBSD-6.0/prep/binary/sets/tests.tgz) = baf4e3d6a0237d7eac65eca2d3e571ccde49c97d
+SHA512 (NetBSD-6.0/prep/binary/sets/tests.tgz) = beea30696935343ffd119c696e826a617a189dd4e9be2a08f468207f0dfa518af4164a1c0bfb6e8d796f609888ef2e1c8d2b1481c58309cd3077cf361118052a
+RMD160 (NetBSD-6.0/prep/binary/sets/tests.tgz) = 8547af5c43e56924032b7b7205c61c7dfb90c018
+MD5 (NetBSD-6.0/prep/binary/sets/tests.tgz) = fad9ca518beadf4a15db6b0aace1d019
+SHA1 (NetBSD-6.0/prep/binary/sets/text.tgz) = 265ca8e29442ca31af66219963a9931d7f71fcd0
+SHA512 (NetBSD-6.0/prep/binary/sets/text.tgz) = 50cd104f35d738fded65600514abc46f96dbcc010f13cade2131a3aad0feb7cf1208360d5869114ca13276096a83e4960ff2f342c1c58b04c26232bc23a8d950
+RMD160 (NetBSD-6.0/prep/binary/sets/text.tgz) = bf0370ee7934a80fdd3dadfe68b2124a7d1a3784
+MD5 (NetBSD-6.0/prep/binary/sets/text.tgz) = 2305e5d5fe891fca62f8500eaf7e32ec
+SHA1 (NetBSD-6.0/prep/binary/sets/xbase.tgz) = a9c6040c6de18dcf42371b7eb0eaa88cb005f1e6
+SHA512 (NetBSD-6.0/prep/binary/sets/xbase.tgz) = 2f5640b41005ccc6b989454a60ae68f9637d701aca7e62a0c5f9965efda0bed43891a239be22ef2f837d0769ce54a649b9e357a920f007778e182d7362feb3e3
+RMD160 (NetBSD-6.0/prep/binary/sets/xbase.tgz) = b171d2bf07e02360363a642a9ccf6b624bdb85cf
+MD5 (NetBSD-6.0/prep/binary/sets/xbase.tgz) = f1029043dab956ff0864f197dc1c0875
+SHA1 (NetBSD-6.0/prep/binary/sets/xetc.tgz) = 3d9da3ee21149017269ed1870b2c5c1096e9ed50
+SHA512 (NetBSD-6.0/prep/binary/sets/xetc.tgz) = d971316b80d139e87b2f7fa47f64ecc41a6285e002986165268e551b0ab059ffa332b9e9278b1e86d60829dac01f8c7cdd3a36f047f0e4a50469046456dbce46
+RMD160 (NetBSD-6.0/prep/binary/sets/xetc.tgz) = e6a7c17de4ac3a609498d8005165277e34f40b8d
+MD5 (NetBSD-6.0/prep/binary/sets/xetc.tgz) = 8ad7ef8013d48e0ca196e8fd2a4fd0aa
+SHA1 (NetBSD-6.0/prep/binary/sets/xserver.tgz) = 16190128b64666ba44729a72387061d80fd14c1e
+SHA512 (NetBSD-6.0/prep/binary/sets/xserver.tgz) = 8f9b3a559b5b53dc2161128db89509e12bb3adc951dd51141212c5082e3afc19b6bd5d960900e7986c72a6ee664ebab7473e2119657c1f34cfebb05737655b6f
+RMD160 (NetBSD-6.0/prep/binary/sets/xserver.tgz) = d62cfac8d16c1e56e866fe621b3cb5bbace44d07
+MD5 (NetBSD-6.0/prep/binary/sets/xserver.tgz) = eafffc08a401b7b8e92e47968dc8faaf
+SHA1 (NetBSD-6.0/prep/installation/floppy/generic_com0.fs) = 7bfb784953be9b7b783a4d7927b8795441ec6096
+SHA512 (NetBSD-6.0/prep/installation/floppy/generic_com0.fs) = 59567fa24b9801e9aaba2fa0b85245b3c1a34894e6f2f58c39877bdb3053b3e21cce4cad703d60626466a2c0d2cd75715919df4a3acacefa627d19946123a840
+RMD160 (NetBSD-6.0/prep/installation/floppy/generic_com0.fs) = 0614c7375a11ffba581e95ea182aef3b59f7f624
+MD5 (NetBSD-6.0/prep/installation/floppy/generic_com0.fs) = b93c25c459836cca031a48a788ac7c78
+SHA1 (NetBSD-6.0/prep/installation/floppy/generic.fs) = c4d629bee0746f9d60ffb5ee501e4e9e73ef3724
+SHA512 (NetBSD-6.0/prep/installation/floppy/generic.fs) = 4df78c22f6a3d4ad414bb85ff6305a0d5caa97cc88375f3bdb2f3872e8103135f5716e72d564fe5fd3b7c1dbf7353f5464317ca30feb7187599186320da0a912
+RMD160 (NetBSD-6.0/prep/installation/floppy/generic.fs) = 7e34800d3411adb3862a914554d3ad27f7775e02
+MD5 (NetBSD-6.0/prep/installation/floppy/generic.fs) = c40503911a43d7bb98c5a5224c776666
+SHA1 (NetBSD-6.0/prep/installation/floppy/sysinst_com0.fs) = 3d67fecfe7d82c9cf7479152b092bd106b87f2fd
+SHA512 (NetBSD-6.0/prep/installation/floppy/sysinst_com0.fs) = 929443de2610ee9409ed76468aa9645a917bdc03366267e8483cc83bbcecb35208acc06ef0d2520d389b408b566c113f5e6b71f5568a7e1c029532979221682f
+RMD160 (NetBSD-6.0/prep/installation/floppy/sysinst_com0.fs) = 51197c7d8ae21a29cf54064c3cf11f8d1eeef956
+MD5 (NetBSD-6.0/prep/installation/floppy/sysinst_com0.fs) = d1e27f1504e7dfeeab0714332e89fda2
+SHA1 (NetBSD-6.0/prep/installation/floppy/sysinst.fs) = 47998496e145c48564efadaf91f3ba4aede44ccd
+SHA512 (NetBSD-6.0/prep/installation/floppy/sysinst.fs) = 6688642f8ad525611b7757bfaa63c958abc0cc1f0c17219df85055c7d97c20896156a543992bbcaf08bfe1bfe36e112e8c8af8610c971585dffa27ae2083d410
+RMD160 (NetBSD-6.0/prep/installation/floppy/sysinst.fs) = d674830e0387841948abeb5e194ab60d9ab942fd
+MD5 (NetBSD-6.0/prep/installation/floppy/sysinst.fs) = 3164ba344aa2283cc7aca4efbd627dd3
+SHA1 (NetBSD-6.0/prep/installation/floppy/sysinst_small_com0.fs) = 2614d29a10f74be3e6ec6563046d2129976f3e1e
+SHA512 (NetBSD-6.0/prep/installation/floppy/sysinst_small_com0.fs) = 061156a6e9e1f9130d9ae085838526f027f3f4263ed03ebc3b5a4532e75243715bc554e4a0ad307401c792f35334d79653642e0d2e1e438dbacc246cda1a92fc
+RMD160 (NetBSD-6.0/prep/installation/floppy/sysinst_small_com0.fs) = 58ef2e610b17686a92958917250c4252bf2d2530
+MD5 (NetBSD-6.0/prep/installation/floppy/sysinst_small_com0.fs) = e1b821660c4f9a7b22a9069631fcefcb
+SHA1 (NetBSD-6.0/prep/installation/floppy/sysinst_small.fs) = 73f7d288f4026018498e79c14d362eeb5e25ef01
+SHA512 (NetBSD-6.0/prep/installation/floppy/sysinst_small.fs) = b65d0794537f5dea1b2a3d6afbd08b85d6d97193a6f0c69928b2edb3fd90c1202035df882878e8f45ddca7214a1abd28e312ab6c334a0708bea0daa1a2686a94
+RMD160 (NetBSD-6.0/prep/installation/floppy/sysinst_small.fs) = b40f136693485d517b455f0443614a487904776b
+MD5 (NetBSD-6.0/prep/installation/floppy/sysinst_small.fs) = 3d605afd5b9a7b57949f448c43e8274c
+SHA1 (NetBSD-6.0/prep/INSTALL.html) = 2674ff3a673f19a61cac4e2877a5656f053b2a3f
+SHA512 (NetBSD-6.0/prep/INSTALL.html) = aabbf165a39dc0207f39cfd27508821de8e50d26892baa27daf1a9b1a01841777fa59a147baa2fc082ebe5ee1f7cafd27674ea44c3e9410179bfbafb33130b49
+RMD160 (NetBSD-6.0/prep/INSTALL.html) = a818880156d01aebc4c92e2e82677fb0890e92c4
+MD5 (NetBSD-6.0/prep/INSTALL.html) = c716d934eb76805dd4acbd677ef13fe5
+SHA1 (NetBSD-6.0/prep/INSTALL.more) = f408ad8a753e682120f22e8763d9e20d8eeda7ed
+SHA512 (NetBSD-6.0/prep/INSTALL.more) = 0a27fc0b1bc6bdf44bc2aced239066f13e352ff248d8ed50d430e676bba3132f26ba807259fda765738bc915a6765fab2fd2e97e04b0166a50cefc4c88de38d2
+RMD160 (NetBSD-6.0/prep/INSTALL.more) = 5cc22227f3a244681cc352cc364650ad683c2fc1
+MD5 (NetBSD-6.0/prep/INSTALL.more) = 69c4b26606cf1e071a451c5afab13cd0
+SHA1 (NetBSD-6.0/prep/INSTALL.ps) = 9ab023c53af56e033541d6c27abf9b666b3f6a06
+SHA512 (NetBSD-6.0/prep/INSTALL.ps) = b68f21d8587797e750a6eabe92273481a396bf68d62e300e6e07139439144660d1e8769404b109759707bccf02a97b27fde4aed219f2b760e9e1f65c0b8c7016
+RMD160 (NetBSD-6.0/prep/INSTALL.ps) = baf09ab6b65aa90ca2f415e4428e21edf2d6d7a5
+MD5 (NetBSD-6.0/prep/INSTALL.ps) = dd269cf99b1eb54e0f7c376c10330ec4
+SHA1 (NetBSD-6.0/prep/INSTALL.txt) = 38f3b013b2b744dd7e21df3db8308dad808e45cd
+SHA512 (NetBSD-6.0/prep/INSTALL.txt) = 2a42b7a45500710fd4df5f3883f8fef5aac4416c41a54c532ce358255541fbf3cd1e5ae03863f1721d845c82caab792d5c8d85feba2cd87225edc8f5606de585
+RMD160 (NetBSD-6.0/prep/INSTALL.txt) = 71583c4ea3b65f1e17ccede286d6025fb6f281cf
+MD5 (NetBSD-6.0/prep/INSTALL.txt) = 15bc48222a898edd8de0a70f559c4a4e
+SHA1 (NetBSD-6.0/rs6000/binary/kernel/netbsd-INSTALL.symbols.gz) = e7fddbe9a6fe76bfec3ec556acf83101b6b1b27d
+SHA512 (NetBSD-6.0/rs6000/binary/kernel/netbsd-INSTALL.symbols.gz) = 7a96ad902221852bdbc290707be328b8374e69d7339165e8af54a65abc17707a1177c2534306ba28e066eaca2eb1cd9bd76fcceaffef911926dacd88c22e3edb
+RMD160 (NetBSD-6.0/rs6000/binary/kernel/netbsd-INSTALL.symbols.gz) = 3f5d25d432d08fa0458c087a3928d3370e60d080
+MD5 (NetBSD-6.0/rs6000/binary/kernel/netbsd-INSTALL.symbols.gz) = f7adcf576fff9a965730d8cb07b677c3
+SHA1 (NetBSD-6.0/rs6000/binary/kernel/netbsd-GENERIC.gz) = 3786662f4c42751a4ad0475d5b7674ba8ecf6113
+SHA512 (NetBSD-6.0/rs6000/binary/kernel/netbsd-GENERIC.gz) = d0ecc5a21218668d185cc74f70ccd066dd08c39ca5e092966623857e7e0e0a9e0d350a055e8f54ed96a046e970ac6e8fbefe3aca12f8cbb238a1240858353dfb
+RMD160 (NetBSD-6.0/rs6000/binary/kernel/netbsd-GENERIC.gz) = edfd5c086e4207543b08fa1125d137a436a17caa
+MD5 (NetBSD-6.0/rs6000/binary/kernel/netbsd-GENERIC.gz) = d2909133467c780a0364052df6f5a906
+SHA1 (NetBSD-6.0/rs6000/binary/kernel/netbsd-INSTALL.gz) = 0588aeaa722ae0065f1e5d92187e088c75000be7
+SHA512 (NetBSD-6.0/rs6000/binary/kernel/netbsd-INSTALL.gz) = 53b6d6603b831ffbb5016ab99f61a20fad9900bbd76b18cd33608c499ad1d2b7a07dd3d0ea386bc27f1f9a8fe68db48691e128186cb4a810c82eca63e8e04e8c
+RMD160 (NetBSD-6.0/rs6000/binary/kernel/netbsd-INSTALL.gz) = 4bbcd396759fe15f6052ec4ebf5b1ab0d1780a77
+MD5 (NetBSD-6.0/rs6000/binary/kernel/netbsd-INSTALL.gz) = 2a0d673dd3b76fbdef31325f905bf6f2
+SHA1 (NetBSD-6.0/rs6000/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/rs6000/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/rs6000/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/rs6000/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/rs6000/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/rs6000/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/rs6000/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/rs6000/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/rs6000/binary/sets/kern-GENERIC.tgz) = 953706a28ce3b7a195c738f805b6ecf878555e93
+SHA512 (NetBSD-6.0/rs6000/binary/sets/kern-GENERIC.tgz) = a699aa0db691fd82015721bf9aab0b201574798731a795112cbe358a61f7fc3b4b1b0540abd25fc52b4c44692b81c4fe400dc6f90315d97563c32c1e2ef12a27
+RMD160 (NetBSD-6.0/rs6000/binary/sets/kern-GENERIC.tgz) = 697ddaf6582c2712860f4c5abd80537b50da0059
+MD5 (NetBSD-6.0/rs6000/binary/sets/kern-GENERIC.tgz) = 6d7ea95cdb07cb265eda9f09ca484ac9
+SHA1 (NetBSD-6.0/rs6000/binary/sets/base.tgz) = c973cd9af8b007e754b99ead0517ab7bed7d3fa3
+SHA512 (NetBSD-6.0/rs6000/binary/sets/base.tgz) = a82112dc5f53f010f6c259a543502b6a0d90259169233b2b043786cfa677ace8ed63f648dd738cc08730d6ac35233a2b1b60cd606222f399546b5f0a61488656
+RMD160 (NetBSD-6.0/rs6000/binary/sets/base.tgz) = 0e84db039067d0ee045bdae56557595dfeb51935
+MD5 (NetBSD-6.0/rs6000/binary/sets/base.tgz) = af2472e60e90aafe55028b419b776975
+SHA1 (NetBSD-6.0/rs6000/binary/sets/comp.tgz) = 2dcac8a8c80d565b5373277deec9a67aee293370
+SHA512 (NetBSD-6.0/rs6000/binary/sets/comp.tgz) = b6b94000d67080ab3ff62768c3afa85ee4a63a0ee62440648bb8c1728c6e4df9b72cc13927e012d9eee0a73792f2ce5e22d6c9d86eaa7c4a6789643177b44371
+RMD160 (NetBSD-6.0/rs6000/binary/sets/comp.tgz) = fc6b3a3b6bb9613f29c50451190dba5fc7884df2
+MD5 (NetBSD-6.0/rs6000/binary/sets/comp.tgz) = e7c6fcfdf054fef00feececd660789ca
+SHA1 (NetBSD-6.0/rs6000/binary/sets/etc.tgz) = 302c5ba7b8efb24364748a665f5cfb824f6068b5
+SHA512 (NetBSD-6.0/rs6000/binary/sets/etc.tgz) = 1ab1027b3082336f54fa330dd4d21924a42a4f76602d35bb2108229b745b305356c5f944247d0b9bfda63f66318a8ad6525eaf5af42cb3a8d0c3cf6e8b4d45b7
+RMD160 (NetBSD-6.0/rs6000/binary/sets/etc.tgz) = 21418d6a16eb9e779b5e6d86cc411c9ab531453b
+MD5 (NetBSD-6.0/rs6000/binary/sets/etc.tgz) = 695e526865e9cf18c91a35647fd75bf8
+SHA1 (NetBSD-6.0/rs6000/binary/sets/games.tgz) = 0a7cc1be35944ade7ef1c617e0bb5f1a60a891e5
+SHA512 (NetBSD-6.0/rs6000/binary/sets/games.tgz) = dacf177fc2affd7189a7cb7b166bf0b3f6b1a92cf1358f1dad2c5e364d28a7183f841befea024435b0f125cf4008741c26f98e5860ea3872d7a8c36e0e699430
+RMD160 (NetBSD-6.0/rs6000/binary/sets/games.tgz) = 2620719e3f39dc3137ebb8f47fcbe482d77ff5e7
+MD5 (NetBSD-6.0/rs6000/binary/sets/games.tgz) = 175c85d188b3c9b4922c4aaa7adc3dc3
+SHA1 (NetBSD-6.0/rs6000/binary/sets/modules.tgz) = a710b61251bc52c73e64a0254489fd7ca7fb766b
+SHA512 (NetBSD-6.0/rs6000/binary/sets/modules.tgz) = a39d57fa5428c4734bf521afdd1356df4213980a9180b4bb28731b5ff7c22b606b2b2189cfba9741cc98fa049ae01a26516c1096969f2b0b17d24e1d1112eb94
+RMD160 (NetBSD-6.0/rs6000/binary/sets/modules.tgz) = ebbd79b609edee28f4c8331d5dfef0e510f67d9e
+MD5 (NetBSD-6.0/rs6000/binary/sets/modules.tgz) = 825a589361390bbf9d409497e022b2ef
+SHA1 (NetBSD-6.0/rs6000/binary/sets/tests.tgz) = a0eb45c7b71306f6cacafd52bf8f7f06b9d5fabc
+SHA512 (NetBSD-6.0/rs6000/binary/sets/tests.tgz) = 4a95458b6a260485c6fa3d136abc9c76c6764f870d30bbf4f7c78c86233241366f84bc5cf7d7be0a3ccf49afd7f5c95e0f732d4164d6f32a01f953ac51a529de
+RMD160 (NetBSD-6.0/rs6000/binary/sets/tests.tgz) = 67ec4f342cf6d25a56f4b0b62675b12df01ae445
+MD5 (NetBSD-6.0/rs6000/binary/sets/tests.tgz) = 1ccae2c93acbafe1ffc9dc329c8a73de
+SHA1 (NetBSD-6.0/rs6000/binary/sets/text.tgz) = ec4ec898eb442d2f8d86aaca0ce5490c7dc1722b
+SHA512 (NetBSD-6.0/rs6000/binary/sets/text.tgz) = cbf687bd4d20115e4f993b08ed41dde158b39a0133af78503c41b3240e7f7aeef3a015594eeb423d6a8c7d74549646e06170eb7dee86d76919163083c81a27d9
+RMD160 (NetBSD-6.0/rs6000/binary/sets/text.tgz) = e638a4bf115fc0fa2e4ef7d5399d79597762b94d
+MD5 (NetBSD-6.0/rs6000/binary/sets/text.tgz) = 6e84e62deb9c45636b7047e88a6b1dce
+SHA1 (NetBSD-6.0/rs6000/binary/sets/xbase.tgz) = 143ea7f8f94f52bf946db4dbf3fccb963f0006fd
+SHA512 (NetBSD-6.0/rs6000/binary/sets/xbase.tgz) = 66442666aa2e6b9139ae8acf690e1c671edb34160977f786332b6f18c87d8be537160b4d8a114b48660a09cdb349890514b9cd6c3cf12a2f5c3e49e6ef070ed0
+RMD160 (NetBSD-6.0/rs6000/binary/sets/xbase.tgz) = f28a5be274784cb9b35ca7c9a452e6fb1758562f
+MD5 (NetBSD-6.0/rs6000/binary/sets/xbase.tgz) = ba48685231270484c0e79da384a77a28
+SHA1 (NetBSD-6.0/rs6000/binary/sets/xcomp.tgz) = 1b1dda90e8376c39a124f39cb8f09824e1d88599
+SHA512 (NetBSD-6.0/rs6000/binary/sets/xcomp.tgz) = c53a3e10df7ec1ddc2687ebf299a37f0b721f83df64797b64968bf1ebf2cdf7becd0ea8505a6a77864e9119c8817aa78deccac0d198b9c815f750a248fdbd5ba
+RMD160 (NetBSD-6.0/rs6000/binary/sets/xcomp.tgz) = 4d57950bc653c7030f7ccae430f5b00812f106c2
+MD5 (NetBSD-6.0/rs6000/binary/sets/xcomp.tgz) = 0cbd6372a9d8cc2488e23708a105f563
+SHA1 (NetBSD-6.0/rs6000/binary/sets/xetc.tgz) = a1c99d1c17918fad811cf27b08625a0b1461f583
+SHA512 (NetBSD-6.0/rs6000/binary/sets/xetc.tgz) = 567bf3cde35f4e54ad9875625c64895d28a5c8accbfb0d5339ca523a9192c312db7ee3c44f9fde3fb5a765839630d282fa59fbe483f5deed16811bb82d8bb3be
+RMD160 (NetBSD-6.0/rs6000/binary/sets/xetc.tgz) = 263747682247c8c38b367970ff103f92d92b0fae
+MD5 (NetBSD-6.0/rs6000/binary/sets/xetc.tgz) = e69bc3b1b38e787aff9d1df386ac63e6
+SHA1 (NetBSD-6.0/rs6000/binary/sets/xfont.tgz) = ebe1c8e3f81f06dc9a816b1ff31240517e9b102d
+SHA512 (NetBSD-6.0/rs6000/binary/sets/xfont.tgz) = 11f0db11eacf0ee00ecafa091c0f9cee84402dcf44a4467d809355d464eb698ff805acfc3da5752b167a2398a1f1080c93e3ca1ed8f08a6129ffe4e4a2402da1
+RMD160 (NetBSD-6.0/rs6000/binary/sets/xfont.tgz) = 7997ed31cdf3895e1fc12b024314c1b72d94be89
+MD5 (NetBSD-6.0/rs6000/binary/sets/xfont.tgz) = 9e4241f680bc0b0303a0aa682b61b1c9
+SHA1 (NetBSD-6.0/rs6000/binary/sets/xserver.tgz) = e0f7bcff652a034a14b70eb608f9d48a21cff87e
+SHA512 (NetBSD-6.0/rs6000/binary/sets/xserver.tgz) = 9838dce48efcde1f60ff163b1c5da7a19d414c730d97d8db7ed19ac77a52f27f2294ba24de75f15fd4d11a30a97830ca2f68b4311379505208025b2ea4913644
+RMD160 (NetBSD-6.0/rs6000/binary/sets/xserver.tgz) = 9072c3c3519475c71ea42925c529ce5e323e9661
+MD5 (NetBSD-6.0/rs6000/binary/sets/xserver.tgz) = 997077c1eb372bf091c82bf06f96f7b6
+SHA1 (NetBSD-6.0/rs6000/installation/bootfs/boot.fs.gz) = 56e0afc45b285ce022bd561db40dcda0eb2fdca4
+SHA512 (NetBSD-6.0/rs6000/installation/bootfs/boot.fs.gz) = c88fa6848032305418c173e9bca58e76545523b762e5ef4f65bc84f1f820e5813a37dcd256af8b0352f5d6f6e1c700d888f5633d1ce58664cbc5886114aa5332
+RMD160 (NetBSD-6.0/rs6000/installation/bootfs/boot.fs.gz) = c575e56387f6956fd086bfeb5f85fed7a9fb4c27
+MD5 (NetBSD-6.0/rs6000/installation/bootfs/boot.fs.gz) = d47804a5227b204d2bea50e243a749ae
+SHA1 (NetBSD-6.0/rs6000/INSTALL.html) = 0f891193771ae2bbe138549727d4df583dc39a94
+SHA512 (NetBSD-6.0/rs6000/INSTALL.html) = 84b1ae87d5befd27db8ed74276b95a91228bf60a05ecf610adacbddc7905cebbfa3909eb6fe8bed0c8f31bb92112fad398f9d4594204057892a538c16861551e
+RMD160 (NetBSD-6.0/rs6000/INSTALL.html) = ca2e4dce100c234133c9da46ffb498d84e0115d3
+MD5 (NetBSD-6.0/rs6000/INSTALL.html) = 031cc1f873f6c8d6f6472b991915701e
+SHA1 (NetBSD-6.0/rs6000/INSTALL.more) = d86963437bc21fb0eb944b4562b79aefcec5c511
+SHA512 (NetBSD-6.0/rs6000/INSTALL.more) = 130cf1977b54ee32332c7c1a2f35e9c19c088753ad8755ce48965aebc1cc19cd89f37f073749ee5f8b84223a8e8b3fc4a68993e0b22d35663c5850c419a0c84e
+RMD160 (NetBSD-6.0/rs6000/INSTALL.more) = 7e35c4d92d61591cf32e7fc4f272734817b60eb8
+MD5 (NetBSD-6.0/rs6000/INSTALL.more) = 4bb3c03008a5857e2c1f7b30cd76f10e
+SHA1 (NetBSD-6.0/rs6000/INSTALL.ps) = 52af7c1bd8dc0f193c6ebaad3320a0d9b9c82497
+SHA512 (NetBSD-6.0/rs6000/INSTALL.ps) = 44c13947238205228eecd13b48642f68179745ae8441ed58db4a3e7103c431a86c86d9ca88d0f71c656f1f0d54e2ebed8b395dbe1a9a437ccac79f91df7ff56b
+RMD160 (NetBSD-6.0/rs6000/INSTALL.ps) = 545bc23ee542bce73f526bfb4184cc2b9314b0f4
+MD5 (NetBSD-6.0/rs6000/INSTALL.ps) = 06416001febd58f722bad81cc2a585d8
+SHA1 (NetBSD-6.0/rs6000/INSTALL.txt) = cfc54ae2bb8482e56b8b0e130285a78532b9772f
+SHA512 (NetBSD-6.0/rs6000/INSTALL.txt) = 9fe957ce5896aa3ca77bf2b62a785904d22b21250e1ed6a18ca0b0e68268ba76f314948e052a0bbea78abe78e95a2d5ca51bf70b7cde2d935ab802a1e276b888
+RMD160 (NetBSD-6.0/rs6000/INSTALL.txt) = aa823cc8082e6b246dc65bce012fec305a7d3ef4
+MD5 (NetBSD-6.0/rs6000/INSTALL.txt) = b47464cee8c76f0b619c0a70acca22ca
+SHA1 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL.symbols.gz) = d09224835f9948e426f67e0008e9e40de1a39635
+SHA512 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL.symbols.gz) = b130c4fc02e1783188dcb4b5a3f8fc88f4294cd331d3beddb039364aa8557c61cf050ccaf520fbbd8badeb018e1c676b589d6eff6a17189ae8edd3dc7d6f94d6
+RMD160 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL.symbols.gz) = cb79e2871b79e109038c8b7e62ec213695e9aff1
+MD5 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL.symbols.gz) = 5f38dd4085224ecbd6ecae5e07a92e1d
+SHA1 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-GENERIC.gz) = c315b6db09ef1d0161ad647352d9983b72da2ba9
+SHA512 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-GENERIC.gz) = 27bf14f92d278fe7b4174cb265862fbd24c96a006f99e5d241f52fee928fdcaed13528f058d6e5cf78656ab7e0e17e974394a2dff8ab37664689ac8eeb457c61
+RMD160 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-GENERIC.gz) = 4aa32ba67c19f07cc67a13835b3773b2bb8178d4
+MD5 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-GENERIC.gz) = 87054c981c0647f65a1aa363c3ad3074
+SHA1 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL.gz) = b43de7e1f292d5d1e050668babd148e3310cbe81
+SHA512 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL.gz) = 0c591bfbaab13c5c0d03a50e0914a97444f87d9513ea48a96fa84e05ea1bed95a63a7ae3cf77c5c71f79cf774f1d1eef2b866c6125173e97027882bb37c38565
+RMD160 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL.gz) = 3bc37d3a7d32ba229944341349eee1d7498487c5
+MD5 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL.gz) = 1812ae09823196a8493b490db6d35829
+SHA1 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL_KURO.symbols.gz) = 81f74ee4373718b36152d797c812097688ce515e
+SHA512 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL_KURO.symbols.gz) = e26f69d2d4df43224e12a922b2d1602678db53a8f7f5823776047ed0f1106e6ffcbaf6d88a4101a75bd3b298737971a99d82b806f78e70a7039dc1e8c027a0cb
+RMD160 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL_KURO.symbols.gz) = 32e0b167f67afd79e83b8b5da906e7eb9822640b
+MD5 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL_KURO.symbols.gz) = 31c633e475629988bf3addc50252b158
+SHA1 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL_KURO.gz) = b857802c9d1b447b451a50601e7592b6c72208a7
+SHA512 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL_KURO.gz) = ef8318f98fc351491b88805dfb1150beb5bac352b18504bbe4756fb9fc54b064ee442999e08fa2a0b82306e717dd100a8a45e02814c5a03d168f33d05c34bd1c
+RMD160 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL_KURO.gz) = 4add6bd73eeaf1c25a9d732adad0e24304e39b39
+MD5 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-INSTALL_KURO.gz) = 61015da4f88490480f8553e59599dbd2
+SHA1 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-KUROBOX.gz) = a2b339d5cb7d614c94341cd9dc8928597275fdbf
+SHA512 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-KUROBOX.gz) = 44b9aa3d91de2f2e0d1c3ec42000182ad97fde311c2bebed17f21fa2165e9f2d574a2fff2330d9f9c2534e595e78bf1eb25e605158e62bf9c65fa449d4d426ef
+RMD160 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-KUROBOX.gz) = 8548f8853cf766e38388c6f16da063334cb4a8a1
+MD5 (NetBSD-6.0/sandpoint/binary/kernel/netbsd-KUROBOX.gz) = 9b8e45e5e31d018a614b2f9f2ec67f95
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/games.tgz) = fbf69640b362df2446d7414ac3a13db100c289eb
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/games.tgz) = d86b41d79aea4204ccf45306937a5ec45629e37873a5956c0280fd1d54cf4a808542d097f9d978fd3277791554ce8a6fb4d0ccd46e30210549d5cce1145bb499
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/games.tgz) = fd2aed1eb51f4db522fb5163e8fde4c040b55d30
+MD5 (NetBSD-6.0/sandpoint/binary/sets/games.tgz) = 997ae5fb42196a787df89873be321e47
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/sandpoint/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/sandpoint/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/xbase.tgz) = b7c8146146ebc15191c1bf53f51f8f980fe8c816
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/xbase.tgz) = 091f5d00414a9ad478811bfb0e953f2a204869bc5e310790886a59c11953974cf7068cd9a96c8823856ab2687ffa2ac31e97494f47338bfe31d80217382c59f1
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/xbase.tgz) = 4bd1bfdc7c1e1619de63fb83276c21039b945357
+MD5 (NetBSD-6.0/sandpoint/binary/sets/xbase.tgz) = e621806afa0fcc9cdcef0f9b3c7dfcbd
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/xcomp.tgz) = 960dd33b61e19dec92096a54791aca1cdf56ce54
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/xcomp.tgz) = 111dd50041e4008aeadb898c3d08f9995c5c13a41ccc20993b4ad51c81d7f6ee3b4dab16158ac7436d085b80e4a643b236a9c97edd3e915125a1466154538420
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/xcomp.tgz) = 0cf8b9a8d1489a32ba0b5a277d90e429c40650fb
+MD5 (NetBSD-6.0/sandpoint/binary/sets/xcomp.tgz) = 4ba4077ca2c0edf71813165fcf5321fb
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/xfont.tgz) = 4711fcbade0238d60b7b89cf0d7873b03d7ed1f7
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/xfont.tgz) = c29130f55f536f602253a7f92f073ebf6ba02baea09f8011530bbf7e03ae96594334f0c60b29a8bceaffc3eb8b152db47548e38a3c8a14abc5fe35bc5d1d7d93
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/xfont.tgz) = 3b01af0f8e34367988d559fe0fbb0acbbafb0b2b
+MD5 (NetBSD-6.0/sandpoint/binary/sets/xfont.tgz) = 6ba15ed12217b726d9129db8e942a048
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/xserver.tgz) = 05aac7e617e0cac05a88062fef29bb459da7a1d1
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/xserver.tgz) = 19fb5af5d6afd78839a22e5c0694a492047b5200c569cbf58c676ff32ec250b21edcfe2ed00b65092fdac374d1ab9eaaed6113c69bc03009cf458aedc6014913
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/xserver.tgz) = 774d2a1072b8d122790ad189a6d2ada2ad99e7cf
+MD5 (NetBSD-6.0/sandpoint/binary/sets/xserver.tgz) = 3daf1477cadf3593e9ba45e3703fe8a5
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/kern-GENERIC.tgz) = 3120fc2c7bad39d27640482bb99222862238a9bd
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/kern-GENERIC.tgz) = 38c1992332ac419fa5e630965bf0bac621fbea752cdec3c147bafdff55bf8b24343913cec8e645b3170cddb071ed501781a47048be08d03c21154c7cf0e2ff6c
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/kern-GENERIC.tgz) = 3964f06ff1e895fe07b28c6758713c82cf0eec72
+MD5 (NetBSD-6.0/sandpoint/binary/sets/kern-GENERIC.tgz) = 1ff2a1c2e3cb2d7f2fd9a270d9cae445
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/base.tgz) = 9e8d3d9c03cbd6db0b99c34641dab20f5835b6bb
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/base.tgz) = 4eb8d796b52589cc4132777dbfeb5295ef44bbe83e1e7c804540d39b98dbf66d7b0805a8e00dcab835309c9a69b3ca518288e0992e53b773d588339da9bbe0ac
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/base.tgz) = 48e26330269decea0489889a395af45b39ad55ff
+MD5 (NetBSD-6.0/sandpoint/binary/sets/base.tgz) = 2f7c4bf56ff06bf89e9c5d49b1154805
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/comp.tgz) = 8f217e53da02ee1bf5445f76ccccd7262aaad680
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/comp.tgz) = 71a6e2221f054534477100908bb3ae686e88eeed96bc7d28920b39863d10881e6951d39011f65415d50c2cadc78874582a1d7f0505c29fbef25800003310febb
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/comp.tgz) = 8507052499e85b2c4d6fd985f3d0ddc099732443
+MD5 (NetBSD-6.0/sandpoint/binary/sets/comp.tgz) = cb3a0690211b22d68a64e941711cc03e
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/etc.tgz) = 6b44f637dd5d01718b446128da95e0bb37c1682a
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/etc.tgz) = 8795d966d0da1b5419f50e577036167ab6e5de5589080ed0ee6903e0d3b59ae9bfd2395d7951b2b38a025acc39daf302a3d22212e0a6ba94344889d7f99d9d57
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/etc.tgz) = df0e4d773d5a180fba5b21b73cb6aabdaec11487
+MD5 (NetBSD-6.0/sandpoint/binary/sets/etc.tgz) = c8ec3910d995970ea51634c4f126474a
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/kern-KUROBOX.tgz) = b4c7f1bc4058463ebb759d84f0ed8a5613cb3c44
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/kern-KUROBOX.tgz) = 50df0ca65f4f7ed454cc4176eb26b63df738d658536d63dfcacf8ea6def0cf3f4778d686b19ff4f5b32dd07e862f9b0d753ac34c93eedc21f47bd27a0ab5a7df
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/kern-KUROBOX.tgz) = a86947596f1a0b658f0cf664ddd67c05385efb56
+MD5 (NetBSD-6.0/sandpoint/binary/sets/kern-KUROBOX.tgz) = 30f2e8b4824b9cedf289c6cdd46df34e
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/modules.tgz) = 7c4b66eea61f3cd7bebee7421f78ddabdce86b26
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/modules.tgz) = db987ae1a97bcaec2085bec2e33c49a53dedad2499e91db24570b50b6f83cd3387e2be0fd6f23dd0611f676133c5fb524c06a4c42c864b41acd74b88e1a2eb34
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/modules.tgz) = 24ff5d8cba57c1fd9aac448c121d8b5446c3d7aa
+MD5 (NetBSD-6.0/sandpoint/binary/sets/modules.tgz) = 380e4c6e51bf10cf6fd605b12332badf
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/tests.tgz) = 45a3f3ff64bc425bfd332e018456252756b0b3af
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/tests.tgz) = 37a7200f8d06849b2eb8e82a19284edcba07a3445ffa40725f288d09eb4e6dba18856b97c64b24373c3c191343c64df2bb2cd5ea8b1367ccae239cb1db9755b8
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/tests.tgz) = ff0eaa5ae045658f2e34b26ee39f41fc03f40589
+MD5 (NetBSD-6.0/sandpoint/binary/sets/tests.tgz) = 19128cd2482ccb19f4486a6090b89d41
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/text.tgz) = 8f4f8a5d09b63477d2a051e2d628b512363ae893
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/text.tgz) = e24825ec69e7b195c384e0fc83bd56a39598721ee30bde5dafc433e24fbedc2e5555a628ec1df0427cff6691f11040e244abd2f8f518421cdf53a94aca7752c6
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/text.tgz) = 264071e66052088a2a9c93b7d030331aa64dc522
+MD5 (NetBSD-6.0/sandpoint/binary/sets/text.tgz) = 3a05d3c0c3a0074852621cc38b0afe82
+SHA1 (NetBSD-6.0/sandpoint/binary/sets/xetc.tgz) = 80be15e90a6779956ecd9acecae91936d1417c2d
+SHA512 (NetBSD-6.0/sandpoint/binary/sets/xetc.tgz) = fa0fd709723b8c3768f9797e34f30dc3cd8a16e3bf178beb883ccddf5041f196fe85828a32e3296c24f96a8a942927aac4587142705d7cd6ce8ffbcc6d4a2fda
+RMD160 (NetBSD-6.0/sandpoint/binary/sets/xetc.tgz) = 02d7f0088ce5bda4f14607ca80de273d00a82137
+MD5 (NetBSD-6.0/sandpoint/binary/sets/xetc.tgz) = e285972d692807df05e4f96ac34ef6f0
+SHA1 (NetBSD-6.0/sandpoint/installation/altboot.bin) = 56c653262e9e672cd47728f06dbf1428a7a16604
+SHA512 (NetBSD-6.0/sandpoint/installation/altboot.bin) = 0ff15a1e8f4fdff1c97f5539c69c4f40e1bbec0ceb6d3ae0df8e6e472fa25dd1b44398135cff0995ca21389819fba455b70a59e2af6fcc817781e09b1b11a3f5
+RMD160 (NetBSD-6.0/sandpoint/installation/altboot.bin) = 7fd0c6c48de76b1fb04eb16a2cbd53531f67d78f
+MD5 (NetBSD-6.0/sandpoint/installation/altboot.bin) = a2b44c7df7a4199c917096623275d178
+SHA1 (NetBSD-6.0/sandpoint/installation/altboot) = 420331106c0a0f28c0cb27f39016852d65f47533
+SHA512 (NetBSD-6.0/sandpoint/installation/altboot) = 7569cc668f087aa5a2af3ed0f231cdc8a0364cf7f64fcb06b08b3aab17e3bd295bcc8f2c8175f1efe73a1e7cca4ba459d35e65872fa8436d729697517dedfe29
+RMD160 (NetBSD-6.0/sandpoint/installation/altboot) = ef26fc304a3f7bfa4717b03a4544207b44e2c382
+MD5 (NetBSD-6.0/sandpoint/installation/altboot) = a5c881881c99da3587d7db293ce8b453
+SHA1 (NetBSD-6.0/sandpoint/installation/altboot.img) = 9db4851a0e6349ca1ae912e60a329b8f250bb51b
+SHA512 (NetBSD-6.0/sandpoint/installation/altboot.img) = 2bfb5c17dcfa6f1619f398a6f994f57be2f2a5e5bee0d2542bfe076f46d13567cf5519ccbea8bc97962122073bcb002309509caa06eab11014ee85766d813410
+RMD160 (NetBSD-6.0/sandpoint/installation/altboot.img) = a140607e1b7ba43d76b22db739253f59234398bd
+MD5 (NetBSD-6.0/sandpoint/installation/altboot.img) = f007fcb1d420ec5ab2f662013f78663a
+SHA1 (NetBSD-6.0/sandpoint/INSTALL.html) = 87c1358b7dd97f4166607bc031ee8fd603d8a2c9
+SHA512 (NetBSD-6.0/sandpoint/INSTALL.html) = b27b71a7b9fe4a37e2ffe20eb09588a3e3aa1337aa7936c064a35752b02ff8b1f560f053206db9ddc4b0a7a5f9163f221dba4690c54f3791fdccdf791b1893ed
+RMD160 (NetBSD-6.0/sandpoint/INSTALL.html) = 790a76dee78dc46f35cf2b4f6078d699707d2adb
+MD5 (NetBSD-6.0/sandpoint/INSTALL.html) = b1a454f7901f9b043c6993ba09ce7e20
+SHA1 (NetBSD-6.0/sandpoint/INSTALL.more) = 60d0c93b382dfe57cc87c292f3cb53f66bc0ef7e
+SHA512 (NetBSD-6.0/sandpoint/INSTALL.more) = 6b1ac0a4e00aee1bcf54d434b02b41102927bb125be551b0cf8cd25016104b3a03f3bf40506bc6076ed3af4a8128a81f733d523e5ccc3679cd8b51bba105cc27
+RMD160 (NetBSD-6.0/sandpoint/INSTALL.more) = 46c78bd1d9df63eeed2f580faaabbac38f5757dd
+MD5 (NetBSD-6.0/sandpoint/INSTALL.more) = f317efc426b562d069a20655d45d361a
+SHA1 (NetBSD-6.0/sandpoint/INSTALL.ps) = f67cac326fc01aa5d0e47013afb174ce0962a46b
+SHA512 (NetBSD-6.0/sandpoint/INSTALL.ps) = ab10cc2d28735af2a34ab85a4c84d7da346375a964a65ba9a328cd93b4b55c6badba306bd7093be08b662695d8ad82e96c4def014a7bac3f711767c9b741c33f
+RMD160 (NetBSD-6.0/sandpoint/INSTALL.ps) = 5db8cd9595e21ecf5132a9bfb2574aaa01260515
+MD5 (NetBSD-6.0/sandpoint/INSTALL.ps) = c36aec246e63cd311c87bdd6ff54f28a
+SHA1 (NetBSD-6.0/sandpoint/INSTALL.txt) = 545b47f56ca866c03078d60d49d3276d4d000648
+SHA512 (NetBSD-6.0/sandpoint/INSTALL.txt) = d7a925733a465005a83a915d9c58ded20149a6118013493b687c7b0ef2e816d8340631828ce1ec7ca13400c0d7a2dbe86c4fed363baf84ba288cb57a47384f89
+RMD160 (NetBSD-6.0/sandpoint/INSTALL.txt) = 1a30cf24c59bd8394d8748102ceb9027d81d66d1
+MD5 (NetBSD-6.0/sandpoint/INSTALL.txt) = 25fb074abc8d6bd5c9aec25dcf7c3667
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/kernel/netbsd-GENERIC.gz) = f23f0dec597709dddd3a0ee1d355f7beb9110b46
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/kernel/netbsd-GENERIC.gz) = c07b4b1360396b00184b77c19fda5ddb4463eef2fddf2c9ba43cbc4e7b0548e79999928db4f662046f73e282051bef9912f497c91b3757d60a1a11a520c3703f
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/kernel/netbsd-GENERIC.gz) = 22b4ec375839d277a7cddcfdf9df0a122a9cba19
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/kernel/netbsd-GENERIC.gz) = b4ee3e5e49f3bdf6fed5e7f9028fe2f1
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/games.tgz) = f56d3e5181634f6a3d7908dcb002ebcb1c5aaff0
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/games.tgz) = 0cff50ea13e34fe338edf70da6a28af061580feb4cb0773828adefa631ebd471a96568a3b30ea0f13f3bb116856a1b6aad8a5a52443346f52e4907f4caabc5f1
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/games.tgz) = 1538910578dbb8eee2931200fac0ccda44758e5f
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/games.tgz) = 2bd5bd0ce72df5cf92767b8c3f7cc208
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/xbase.tgz) = d81c7fe75a90f1b2111a066e78f1f2b3e8edcd8c
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/xbase.tgz) = c241391fcde4a685a0a2af6f843844ac2e918024c447a2b5ea2cf5300f69acc42fdadf53d3b0348f10723b786bcc0f420e68fe36228375bf3cb5140de41eb40f
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/xbase.tgz) = 2fbf60b64c0b7ac2be72ebf998d9d7390fc40705
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/xbase.tgz) = cd23ca0f6b359c4d695d4494a147d40f
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/xcomp.tgz) = c8f5ff5ea9f9bbe231f92d8b7f3bfcbd2897069f
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/xcomp.tgz) = c7590075195019078b68ec5f87e36479ae2e7b7749c523df4ef21c9d881c343cda9f5c2bba897dd313329a76fe5c18e920d92827878d98ce08a7dc776352cd02
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/xcomp.tgz) = bc60e267cb6e11b4a7305f8b7074084e179e0ff5
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/xcomp.tgz) = 8e58ee51667def3bd015f79769c0d932
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/xfont.tgz) = c551bd13179b9508c2e3a7e19cec323e8ba21844
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/xfont.tgz) = 764527f2f3f4686759fcae3fd093f4e00f34e1249994126221a6f9afe73d4cf8ddfbe8b8311798da2ed38c52466a44bb26ea08ad5aab1c08eebcc9019b4223f7
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/xfont.tgz) = b3a365bedf8b4a20f3920d0e33b9a42fce288953
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/xfont.tgz) = adac8939da213a0195cc1d351f979199
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/xserver.tgz) = 686f6e6d722c9676351ab058736f7077b4ebd2f6
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/xserver.tgz) = 5c818f22edbeac7325228af99d6da6e44b5eb659c7c9fcc6b332071e97a0a490081eda7f9e0f22d6a3f3a589ae34179b434751a6191db5c664683d7510aecedc
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/xserver.tgz) = 0e9f066095b505c7f062bf877147189a7a2f0649
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/xserver.tgz) = cdd2e5127838437df40af161e0c8398f
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/kern-GENERIC.tgz) = 3dee2d103b30c27015f41f351b45247d1f1067af
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/kern-GENERIC.tgz) = d9393724341c9d8036646fc768c21cb510aa4915555460753caded9c1f7a5355501d801e72ffb12e3ac1d25a57797b3b9b8c38787f7ae42906c6dbfecd0bf384
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/kern-GENERIC.tgz) = 9e22ac41f53032ad9194b1b0002c56c13211cf65
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/kern-GENERIC.tgz) = 6b9b0560a05738c70d580a25e0c5f203
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/base.tgz) = 61ec72dd34b2103b7b2f3228ee7766133a089c29
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/base.tgz) = 9aa13fa9008c18633f949ee74c5aaa5fa1d58d59459e48cf5f161d3f11e133a0cdaf7caa941a4e435076644ea799d7c9e73274267b18c3401866fdae5444f491
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/base.tgz) = ebc31ee01aa8cf119d20f5e084d536bcc610623b
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/base.tgz) = 828ed9e45442d989a4a5233b6523d82e
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/comp.tgz) = 705bd29c423e517e231920389f853990b8103339
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/comp.tgz) = 33d7feebe4ce7a3f8a4317c49f10f51e69e40374a9291c6b9e657f3e965d533702513b92dba0cba318a786f33fb5f275237be13870c093dc229d2c826a6b15ae
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/comp.tgz) = ea75f4ad366964a45cc5c8aac35cee5a56460d6a
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/comp.tgz) = e37746a52cc63d8d2992aef55484bb81
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/etc.tgz) = 9b4b768dc9d999330aa8fe804d604738fbabf650
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/etc.tgz) = 6e56a5122f29741aa02b651671d5ecdaef0adac94f52c8d550ab8a17352d3fa6755a87c13bd707d1a7f4259fef1c77e4ec85699cabb96bac5c47b82f2fdb6086
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/etc.tgz) = c2c3fbfe163cc38ff774413c1be35f0fee0b0c3f
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/etc.tgz) = 3d6d678755b01ec623ed215f7e1bbbc6
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/modules.tgz) = de0c98fc8b4bb81299edb50e3f99f222ac383dcf
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/modules.tgz) = c279717a8c4a6c66f3dff4e22d72466cf7b2c82070bba336bce5e659dc520c8c1fa1ef80f6f3154b665e0fb76dc2745ac8cf3996389209966f3976c36dc591c2
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/modules.tgz) = 80479a2131441999c8d251d822e00800e4f69b9c
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/modules.tgz) = cef9345e5430560c5955adee76e537c5
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/tests.tgz) = 92c135698d2030f4b378f18fc991c9f4efbcbf1a
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/tests.tgz) = 7fde9b55e820f169c4d1820d5b3f213f460c81bf892df6bff0ccf47ee73054c651c7277d956af77eb6f3d75648c7916be72d08dc3970601dc872662f009e9117
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/tests.tgz) = 38049cb62625ec093f26a53f6fdad2bce0b5a2ee
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/tests.tgz) = dfc74f3ea392e2c963257cb48926147c
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/text.tgz) = f8ddb7ac8fe765ad3760b3c00516f209f31ba211
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/text.tgz) = 9e8f6eb5da98c7c88d96d539e5379bf98f0d6726b84c5d4c2e1236d515d3cc31a4e1deedf1beab8335084f0c8d2795e8bef3391feff024d654877cd105254e03
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/text.tgz) = fc5441996f0f1650b41b80cdeacd377cec93c8ca
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/text.tgz) = 22ad03bdad15b336ac4f73bc31c29d78
+SHA1 (NetBSD-6.0/sbmips-mipseb/binary/sets/xetc.tgz) = f89ac267632b07b88fa020f09c395a6766a2b9b1
+SHA512 (NetBSD-6.0/sbmips-mipseb/binary/sets/xetc.tgz) = 59325ee391ab258e507fad56e2f38e5062c2ca15599c71ed06bd0373dfb109d61605dad949434d521d5ab9ea6139ee099919d485cb6d680d20b1bffc6881fd9a
+RMD160 (NetBSD-6.0/sbmips-mipseb/binary/sets/xetc.tgz) = 6e805117acfbb8c9af9eb6f105b15c11447faaa8
+MD5 (NetBSD-6.0/sbmips-mipseb/binary/sets/xetc.tgz) = 3e113c15bdfceb0a896ebfcee6e75172
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/kernel/netbsd-GENERIC.gz) = 017c9fbd7101f94f65ae9f0a41a1a028a8bd3435
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/kernel/netbsd-GENERIC.gz) = 45e2aa91e69a575f02a48dd776cc7401f37e60905ffc986634f53829aabc87d2dfc52840fc92821a3611b61e728f415ac44ab19f73db85786962df64d87b60c6
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/kernel/netbsd-GENERIC.gz) = 56ea720eb521974e26c07d74f93fcebd6e67de91
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/kernel/netbsd-GENERIC.gz) = e5f16d9d0838695b251b809dd42e10b9
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/games.tgz) = 27d9f98fecb3495e51939df9f107e81e527af26f
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/games.tgz) = 46bb4e10313cfffaaf4f7fa2157474ef940f94bcc9f84b46f829c7615bbf45e4e01edee7b7efb84bc28561e0712c37cfc737f9c2a0d9a73b67c80c8aa0f3a9af
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/games.tgz) = 947feea90ec2698a65d555cb78a29a001b086589
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/games.tgz) = 355f00978fed8e8da6a251e591be5387
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/xbase.tgz) = 76468fcada5a9e26652aa9f0f9f3c94829a317e9
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/xbase.tgz) = b2adcfc2dedef30b21b885c8fc757d0479541744a280a9997fbeaa9c881009ab4b0019e0001a540a8eb6db5f84db87b365e420bb2d4270af209821bdb080369c
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/xbase.tgz) = 1e0074d03d9fbb3373e0a427b25cc7097bf6d3c8
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/xbase.tgz) = a8f29ec2e3768405942f97af3dd08ee7
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/xcomp.tgz) = d8ac89f3f6ff20abb0adabc49227afdb74aa2040
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/xcomp.tgz) = 4f03213fb061dae9421747209628d06ede6bbb71a7560a9e1a54796b907f1620146a33fdce52974227a21acedcc210b99e15c4fdd36432eba60c1041a92d8cee
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/xcomp.tgz) = 6be5e72b9b57c9bdf8ed8ea127e2a73830feeecb
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/xcomp.tgz) = 59a7ea141587417be38ab1f6056cc780
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/xetc.tgz) = b9f6b1a54ffab37b11f4c6e717b481cd087fb609
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/xetc.tgz) = 72f35e65f3a90967e250a2006d500619b3824f7f5c3d7494554f153ec5cda5b28c445f28c34a1e4463f40da5855e8d4257726411796967fe37763d90cf7fe461
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/xetc.tgz) = 1169c246f91189fd0c4ae86ac27a92f5c2edda3e
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/xetc.tgz) = 8f3c52cc5af1cafaf7b0d0f884a5b537
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/xfont.tgz) = d06848571034f3b7fc975082f1de37b912acb18c
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/xfont.tgz) = 66a1013c935bee5e7e5d24325a527522306bcded7ced63790f2e58831b3ed91176a1b9510b2159be63504d5167d48d534919927ffc6e225ae2bb2487f90a9ede
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/xfont.tgz) = c9502843a5d4dd7e996e8d158c519cf7f8575cbd
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/xfont.tgz) = e812899176eac2bf65a6d949ac3f3424
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/xserver.tgz) = ff805022f409202f3346c45475c7ec0f8187218e
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/xserver.tgz) = f2bb3810a5572b519980126a3d934f63b5ab5c2fcf9fb8166c556bd3cc14cfaa151d582086bb1506ac9ac7e21d4e70a5cd5c3faed96212d8a14a0b5bafdcc4c1
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/xserver.tgz) = d5ae336337cc77f7f55f542b3457918d6fc0efe8
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/xserver.tgz) = 92447a1560887d337d22e2deed0670a6
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/kern-GENERIC.tgz) = 8c185e51bf6d6c63d23ce62fd86e5f7bfb3d3845
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/kern-GENERIC.tgz) = 6f1a341b96a6890f1bfe68a588e74639caec8c320b72bac774f03d8f7e71d9198887b791e6528a10bd201bb14537e2f83a4e81aa402adc5bd57e4ada3c8022a9
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/kern-GENERIC.tgz) = 43be2a6c07b4b366d31b2b74ce7666d0337cb84c
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/kern-GENERIC.tgz) = 1ad137c19b7c2df8bcb8bfbe053466d6
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/base.tgz) = d0664b8cdc36b3e6b0381b6a9de9c7556bd383ef
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/base.tgz) = 737f1bed2c71e1473483bec24e7e48be28fca93e0ccb7e124661569d1960fa99bfdfc7f8e86bd3a61f744593346ef767b1ae2ed0c1e2fb9c5b421dd2b8125dcb
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/base.tgz) = 130c2d1408fad9b0c2e8c612b6d720a6c92674b6
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/base.tgz) = c2623377960d1a7fe4db1ffff70882f2
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/comp.tgz) = ed63cf25383b8110ece9e4cb4752fe762b636cd5
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/comp.tgz) = f699747ae04f024400653aa5bf5be624e4cd0bd92c9086ee8f89ce9327c5adb27e7cc53f1a85904b3e0f2cbbb49e45a3098fc803e131338a3100a56f1628218e
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/comp.tgz) = ca975dc6b36da0208cc2a79c346e74fe367ba833
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/comp.tgz) = 063da88eb27db9b012142fbec1707b34
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/etc.tgz) = a6430055b2ccc0d418f11c4eb5628d091998d4f3
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/etc.tgz) = 51a2c3cbb860e042c3ecc234e1e0645489a5546ccf0c87a2925f32c01dfb3fbc1dd088b4bc947cb27c731b9645f234e13fa9e805665be34aa3fe9318c51d12a7
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/etc.tgz) = a7c1913e10b8fdc44a191159b5b6278728bd8a0a
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/etc.tgz) = 690495c3b0cbba76f83085422161887c
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/modules.tgz) = 37c4fabb3a3edebf715572a4c7deca5c2f63508f
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/modules.tgz) = 2245821ee48c5a4a4c7ad378c2d726975b18a3f04b1e4cf04e78ee0c15855502eca0673b11420af837146c9003ec6c9899b815a37aef06632b9e8a00f4f95f0d
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/modules.tgz) = 2ae1af8e754811706b0d5633f2631a306eee664a
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/modules.tgz) = 3136834e1ac671cf35958f353e33d8c0
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/tests.tgz) = d3118b0c152c61b20933e5dc38272991b808fce0
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/tests.tgz) = ce817f1900de3b09a7b063abed50f10f78042f3000f1bb031963db7eb1666fb55b42ffcf446370b4ef2541ea86739e43c9bf0771aba86f5bcd62e6181975a62b
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/tests.tgz) = 6fe992cf685d12015118ce0faf06d77b241e10d6
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/tests.tgz) = d59a11116844dc6e6a754ab8676e30f3
+SHA1 (NetBSD-6.0/sbmips-mipsel/binary/sets/text.tgz) = 82712c2413930b0726af1cc8e3d7f7183e789534
+SHA512 (NetBSD-6.0/sbmips-mipsel/binary/sets/text.tgz) = 2681e2fd0973fa7573dd6a1746ba7c491956a82256a8522cbb65c267402ba700da71b0ce44c65269787385e596913ba1042eca4542e5751f55beaa2679d673d7
+RMD160 (NetBSD-6.0/sbmips-mipsel/binary/sets/text.tgz) = aba3f473d85e3a8fd5ae41ca25c7433a22b11f36
+MD5 (NetBSD-6.0/sbmips-mipsel/binary/sets/text.tgz) = 0b2dbc9b54843ba81289bc994b3fcf7a
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.symbols.gz) = b1a8652e56663a63c6376ecf20ccf9f8f876a9e8
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.symbols.gz) = 3e4a01eeec83c7da8725badd449c51dcc677203373d1ca0725a157a6f9ebee86fa8ca7d66e1936420569e7152fe9bf2089764b94132aa04d61e36661ea0d1b32
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.symbols.gz) = ae01910e3901d7adf1b925f13b4520e46bce2917
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.symbols.gz) = 14b2804f6c6f16940d4bdda28c6426e1
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP12.ecoff.gz) = 532b94eea6032bf2867a860f78973c95b3baf210
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP12.ecoff.gz) = a3017e2f1bc7d008d45d53f3733ed573c18de5d44c2c7a1e969f2938119a5d6996c1eb913e7ef6b28cddfb2e6da4e4ddb6aaddbb9caa6c43b90d046f2ba396db
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP12.ecoff.gz) = bfbcc81a415674512ffdaa8ad7180d4499fd410d
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP12.ecoff.gz) = 01742badd90ac599c850ef5d7f98de49
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP12.gz) = 1040bc406f9543efe4f2a6c198d136ef45d0e9f7
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP12.gz) = 1bb8fe9e495603393f69f25ac5fe57d8f26e64cc1573af4088d3e2929d8043ecff721d38b0d4f3f6b6934661df6f6f2790d1d506ced6f8f21b57c1f1554e79a2
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP12.gz) = eece122ff5df495cfee6fafeba2fb086cce6623b
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP12.gz) = 8bc4a605a8cb06bfcf835aa4a5b16411
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP2x.ecoff.gz) = 0fa0539d5bdaa751a71d3df4a573adb90d742cb3
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP2x.ecoff.gz) = 4e94bbc422b322b6b250a8cdf31144cb97f6349a2cd075b8720497dbae36dc9f90d0b48da549bbfd3d7908bdf078cc95e300bde365df6e204008a0af85a5e7e6
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP2x.ecoff.gz) = ec847458dd2c3b20dcd27d5bc14ced2601c998e5
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP2x.ecoff.gz) = e74b65c6a2f141174323dfe40cc0e730
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP2x.gz) = 2c863ba399e4aad44ef7b76dc60bcedbc112d1dc
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP2x.gz) = 27c329497ed9ac49c096071c6250b01135b590b9d2f5d79366f53409b4abf9daeca15f323a35521b9a79f4264d5784e1d49dec269cc51ee0df52a686bf6fea88
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP2x.gz) = 410dae1e4c4a5b3f2b9b000c413faa6ccedddd5e
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP2x.gz) = 0538c7187f0c5778a89a660749018ccc
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP3x.gz) = 1968926bf27f4cb8f5fac47a22ed3327dfb52c43
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP3x.gz) = 0d5d484b19505ebbebda2daff665c43c77aa9e087946daf198684f7cba944f11e2dde344930e99ef4a24c02c6fb83009115b45a0100b955b0dc8450c00fc2f38
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP3x.gz) = 4194967cb2a542b818e0f4670e194e91c6b20635
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-GENERIC32_IP3x.gz) = 2d25467ddd2b88d4110211ab86f1c77b
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.ecoff.gz) = 8bbc293222db73fb4be9015b07e05070c413de50
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.ecoff.gz) = 7c0f743299c829bea945e1f927dce38ad44b07f012949532d1e0f73bf3f44bb5931f1772db34b8598cb46b1e8d522c1de29e537105e8f4f1c10057bebaabe33c
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.ecoff.gz) = 4c67683e70c5c31659196601d15fc98de34dbd10
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.ecoff.gz) = e3cb87e4586bd5e1ec2602cf7767495f
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.gz) = 66a33c0bed49bb9e1dd95cb3c79f944ee56fea31
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.gz) = f3dfc078ef7e21741758b7e3ea76af80772a1d3218b0178ce825814bd16a895115df7122b394c58f63af6b2128e57a95064ae3fc44a5a3e56d8a03327bf3174f
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.gz) = c60e7094e3801d730f699b7a67c4403ced988c92
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP2x.gz) = 2c406bbd7ec78cc4c97dcdc48ee476d1
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.symbols.gz) = af7722c589f536235fb6d25f27231a6a3eacd3c4
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.symbols.gz) = f7b6acf595cbb8e7a54b34b458c39c384ea0e3ce44fcd142c7f71cb08551b56624969872fde0f90614e40582bc45fa3e41be31de0de954ce43fcd34375cd5d04
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.symbols.gz) = 3b853ba98c7c4016aeec80103318c1147aa52ac6
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.symbols.gz) = 001d3d08526a1d35fe6a2d66baa59ff9
+SHA1 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz) = 9fef8eeac9eedbd6ce7744b13c0e14efc835c1fd
+SHA512 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz) = d4af0b7ffc0596e209e19161bce14533610fd414350b761a58873c16858c3f44f2bc20135f7f14ffc9458dbfc029dfebb998e19f02176c9718f6a6406ea5b262
+RMD160 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz) = 420fe89a1bf2f952113c22d083512456f98738db
+MD5 (NetBSD-6.0/sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz) = 7081086c1dca701908d84d74c29fc81e
+SHA1 (NetBSD-6.0/sgimips/binary/sets/games.tgz) = f56d3e5181634f6a3d7908dcb002ebcb1c5aaff0
+SHA512 (NetBSD-6.0/sgimips/binary/sets/games.tgz) = 0cff50ea13e34fe338edf70da6a28af061580feb4cb0773828adefa631ebd471a96568a3b30ea0f13f3bb116856a1b6aad8a5a52443346f52e4907f4caabc5f1
+RMD160 (NetBSD-6.0/sgimips/binary/sets/games.tgz) = 1538910578dbb8eee2931200fac0ccda44758e5f
+MD5 (NetBSD-6.0/sgimips/binary/sets/games.tgz) = 2bd5bd0ce72df5cf92767b8c3f7cc208
+SHA1 (NetBSD-6.0/sgimips/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/sgimips/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/sgimips/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/sgimips/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/sgimips/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/sgimips/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/sgimips/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/sgimips/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/sgimips/binary/sets/base.tgz) = d02636d2688644bf3230c10bf072000a44cd2f5a
+SHA512 (NetBSD-6.0/sgimips/binary/sets/base.tgz) = abc4fb8ba2047eb2c99070b0b7a22e29a071c44ef8ce3d896969648dfb6ead55d396e8a7c0716e34e45f51565c6e29011d0e35cb914cab4691c8672a29f24fbc
+RMD160 (NetBSD-6.0/sgimips/binary/sets/base.tgz) = f91ad6342293731972f28cb6286e6926b3de10e0
+MD5 (NetBSD-6.0/sgimips/binary/sets/base.tgz) = ff1da3a02630406282d40b75528def3e
+SHA1 (NetBSD-6.0/sgimips/binary/sets/comp.tgz) = 27ba59fd7d5e90f91446a151f804437f8c249e8b
+SHA512 (NetBSD-6.0/sgimips/binary/sets/comp.tgz) = f119dbb5c22cab49fdd8f0dec15407fa520d1d8eb02cb4550bd01f88d49378b4999e0041f6da8d4ee2bfa4712590a5345a184ead5a4b014d80c79c459bb34e3e
+RMD160 (NetBSD-6.0/sgimips/binary/sets/comp.tgz) = 9cf77a31c5419a857ccf19a148eaf510a4d83aed
+MD5 (NetBSD-6.0/sgimips/binary/sets/comp.tgz) = 2a2b72f824b9953fe580cb284a37c96c
+SHA1 (NetBSD-6.0/sgimips/binary/sets/etc.tgz) = 6140d0c55fb88e07b633da0abfd0d5a345eb908b
+SHA512 (NetBSD-6.0/sgimips/binary/sets/etc.tgz) = da25730f805732e0d4b90612dd9b5236f6fed96c75f022f4d1053495d897f7355b5d75b95f010b041795d6331285a2ab0ada3f34175b611147b295e697d54eb9
+RMD160 (NetBSD-6.0/sgimips/binary/sets/etc.tgz) = 79973e6b9ad3344bb4e64ed23a1ba9bcd16fb8a1
+MD5 (NetBSD-6.0/sgimips/binary/sets/etc.tgz) = c96ede97a5ce906a1fb580fc1dabbf94
+SHA1 (NetBSD-6.0/sgimips/binary/sets/modules.tgz) = a206108d50c0e8a138571adf8a674334de685263
+SHA512 (NetBSD-6.0/sgimips/binary/sets/modules.tgz) = bfb96bc27db44cc540d3ca143099e2574ca9a42eeea307eb3b835b624b52ebc14fead54754fb3d95916e6f4c2fecafcaedebaf28a32ec0c1e1b798caf9a7e44c
+RMD160 (NetBSD-6.0/sgimips/binary/sets/modules.tgz) = 9114bd11fa6c211d72726f5e88458396165a6fe4
+MD5 (NetBSD-6.0/sgimips/binary/sets/modules.tgz) = 8f298135900ed72db173ffa002c4103b
+SHA1 (NetBSD-6.0/sgimips/binary/sets/tests.tgz) = b10f0716cc4a705193fe7485de5b6123153a40a0
+SHA512 (NetBSD-6.0/sgimips/binary/sets/tests.tgz) = 79061c6367c51f6b0769e7ad724d440d055cefcc6ce1bf1730e602b2080af16be5a7f74a3c57391567dfb62f49588721bee5704d71039527c4269add0bd8420f
+RMD160 (NetBSD-6.0/sgimips/binary/sets/tests.tgz) = 869f46c688b7d65e6f93dcf06e4d406fea799082
+MD5 (NetBSD-6.0/sgimips/binary/sets/tests.tgz) = b02332c28d31942e96e416d4dbf2f6d8
+SHA1 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP12.tgz) = 18e386c5766aa3391d5d29a7d55ae1eb3b69af2b
+SHA512 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP12.tgz) = 8caad11aefe7fe71d346fbe3950fcaeb08a3454793e24f12c83b91c3078ef4e15f44c94cf47aa785e8b975f7403f0de2be38fa3ad3a48798e70efcdded5eed0d
+RMD160 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP12.tgz) = 8e7531be01ac24bab8b898224ae33df0e84d637c
+MD5 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP12.tgz) = 2f1a7076fdb72698d28a9d8032b79943
+SHA1 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP2x.tgz) = 4097c0cfecd7e8766e4542ffd936ac18fb9ed32f
+SHA512 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP2x.tgz) = 9595785d477c04e57b81e2dd71957dfc3309fad013b7210d93d2501e64c308b57af9a22581ac3e61d8f3ec91aa62d49bb01ed5ab1eaf90557f41c0d4d3c3096f
+RMD160 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP2x.tgz) = 2479e9e6495e16753c6c0e3e8dead0c49095c245
+MD5 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP2x.tgz) = 8661ec66f60bce4cb75af3d6756580c5
+SHA1 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP3x.tgz) = a5a29b61f5eba57e0bcdbd6af9ecfb9a4485a90b
+SHA512 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP3x.tgz) = 4a5c4ebea7ddfad9bf8f3536212eeed17f22dbd74a38b7f48bd7963c6c7c4f29da10ec6454053a441db830cd5c18a3a342b6ad22f5fbb9d97104b683b94685cd
+RMD160 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP3x.tgz) = 3bae9be1ed83ab2eeb80905c1e1bcfc59a4b6f7b
+MD5 (NetBSD-6.0/sgimips/binary/sets/kern-GENERIC32_IP3x.tgz) = e402bda170a73a296a773b851afa1a3b
+SHA1 (NetBSD-6.0/sgimips/binary/sets/text.tgz) = 11418c012b904e8a99e91493d36fdca3f6e6f006
+SHA512 (NetBSD-6.0/sgimips/binary/sets/text.tgz) = 501a9e78e9310aeb3f0c766464b5453e2718f23b5d3290428ad775977cd2a42b5444b91d7b1707ae9991b58af14f376d9d93cebdc54c74ea8d20ed06a7e0387d
+RMD160 (NetBSD-6.0/sgimips/binary/sets/text.tgz) = 272adf1723ad8ab137b985946e64ca3b27055199
+MD5 (NetBSD-6.0/sgimips/binary/sets/text.tgz) = 0f6d77a90f9714d54517c4b5660150fa
+SHA1 (NetBSD-6.0/sgimips/binary/sets/xbase.tgz) = 0e912b46017d4afca665692603e483e95d627af5
+SHA512 (NetBSD-6.0/sgimips/binary/sets/xbase.tgz) = 54c6bb297c09510019a0e21816018b7f8abbecd3e9dab5f5dd48d1cf35493b0cb0ec5ca01f1bbc9066fa1b964cf550119c1678a70d80d4471d9df73627655bb6
+RMD160 (NetBSD-6.0/sgimips/binary/sets/xbase.tgz) = d8b979b953547c386cf66488db96771f3923cc2f
+MD5 (NetBSD-6.0/sgimips/binary/sets/xbase.tgz) = c04dfa38a56e78bf0d075dd4d333a869
+SHA1 (NetBSD-6.0/sgimips/binary/sets/xcomp.tgz) = d764bc540d10ebb805e8c976e8b300d9c6a108e0
+SHA512 (NetBSD-6.0/sgimips/binary/sets/xcomp.tgz) = a6795d24491875468bdabf17698ee483c0aaeaae64772667083049c7f2b2ae82943277cd41fe870c085ae7498f6546d971362d77e62f6150f40aa23f6b92d732
+RMD160 (NetBSD-6.0/sgimips/binary/sets/xcomp.tgz) = 99f0489f322b26960b51a53e24fd03faccccc512
+MD5 (NetBSD-6.0/sgimips/binary/sets/xcomp.tgz) = d6e8029f965bcade40d027658ea70e14
+SHA1 (NetBSD-6.0/sgimips/binary/sets/xetc.tgz) = bcbb9c22987ffa1ec653920c5013030fb974d73c
+SHA512 (NetBSD-6.0/sgimips/binary/sets/xetc.tgz) = 7e2ad6276a043e98c194a03fc38f3754193c0f75bfbb79cc855bf08d7336d01763d7df89edb3ac63056a403d08e7e21b43a1b4468c34cb2969024bf5894988e2
+RMD160 (NetBSD-6.0/sgimips/binary/sets/xetc.tgz) = 35c9e251920fa14e32a68f6d811ec8ef81a233b1
+MD5 (NetBSD-6.0/sgimips/binary/sets/xetc.tgz) = baf2f338baf24e78da645312b33eab7b
+SHA1 (NetBSD-6.0/sgimips/binary/sets/xfont.tgz) = 43b823091c3c5b340538ecf7cbd17be47e6d5692
+SHA512 (NetBSD-6.0/sgimips/binary/sets/xfont.tgz) = 63a18f59b0c2ef7eab2ba7526fe2815155e476426d34e21e06d2c00fc872cc01bc241704971524c9c6410f420650a7d69914205a45a1b232413e9ccbff2d6b93
+RMD160 (NetBSD-6.0/sgimips/binary/sets/xfont.tgz) = 3cee7affdad412ed072636553915fab9f0d23ca2
+MD5 (NetBSD-6.0/sgimips/binary/sets/xfont.tgz) = 0be724043d9312d60c89901238982903
+SHA1 (NetBSD-6.0/sgimips/binary/sets/xserver.tgz) = f604963ee4c952665400bd5742f6ac3925903291
+SHA512 (NetBSD-6.0/sgimips/binary/sets/xserver.tgz) = 2f5d36f2f728aeed88a3a2e8da36acb3117018fe92f97769babe2b37670c0ad9cce319bded4a4c78d7859c12df4124fdb2faed33abaae1b4cea20098582ff99e
+RMD160 (NetBSD-6.0/sgimips/binary/sets/xserver.tgz) = c18f29c81d11389a45b5c8a6226ec1e7c074582c
+MD5 (NetBSD-6.0/sgimips/binary/sets/xserver.tgz) = 41d79391ddbccae7930228219015083b
+SHA1 (NetBSD-6.0/sgimips/installation/diskimage/diskimage.gz) = 5acd23fd19ce75e45f071d5de6396668b89ea681
+SHA512 (NetBSD-6.0/sgimips/installation/diskimage/diskimage.gz) = 007da5ebfe4af418c4f696956cb768575b656dd40297cb39dea7b03146bf48aa22fe9f288325737b6904f5e08b89c79d60a375dce4d885fc83f3bb85595507b2
+RMD160 (NetBSD-6.0/sgimips/installation/diskimage/diskimage.gz) = d4fabae9c31423c0557937fd07cc796f48f392fa
+MD5 (NetBSD-6.0/sgimips/installation/diskimage/diskimage.gz) = 8575ffc5db9771c5aa948ab437c80e1a
+SHA1 (NetBSD-6.0/sgimips/installation/netboot/diskimage.tgz) = 075e8acd73646b2b89509714ba7ca7a001cb72a1
+SHA512 (NetBSD-6.0/sgimips/installation/netboot/diskimage.tgz) = e0dc8dfb79ee590decb7c315fd4b8cf7a55a2981a3752aeddc25afd83a79fd72d6852f9823ab857077cfe40c9619dc8b537ab1227c42441b43b2fb9129a419a3
+RMD160 (NetBSD-6.0/sgimips/installation/netboot/diskimage.tgz) = 4b4d8d21878765a902c28673fa2ff2fe62ccbc55
+MD5 (NetBSD-6.0/sgimips/installation/netboot/diskimage.tgz) = 250ed8b78bb6bc799d92f3e82d62003a
+SHA1 (NetBSD-6.0/sgimips/INSTALL.html) = 57dd965aef89b4c8190886a37ab3fff06021b8eb
+SHA512 (NetBSD-6.0/sgimips/INSTALL.html) = c1e5774651642601daaedef68c0337dbf8d634abddc9eaf8d33d38358076f49867df6644d0c8c7e8e730c2d37a2a35af9c7c03dbd817f5b4eae5d7383e900190
+RMD160 (NetBSD-6.0/sgimips/INSTALL.html) = a5c94dcca469b47cb176426a8cbd4c0e2df210e5
+MD5 (NetBSD-6.0/sgimips/INSTALL.html) = 7c4d8de6801d46c1dac589fc304590a5
+SHA1 (NetBSD-6.0/sgimips/INSTALL.more) = b9c2017ba93cbb87b7d0a88fd6912eb81a9b7ed7
+SHA512 (NetBSD-6.0/sgimips/INSTALL.more) = ca9a739d8c56336ebbfffb856904a4753e8948cf8c1a4da057f212cffaba7493c07467bcd0608923d1dc3deb76ceac989cc556cd025380ad1f80109a46aa6746
+RMD160 (NetBSD-6.0/sgimips/INSTALL.more) = 0e733569f0cd6acc3de8e7b3acdac89953e554d7
+MD5 (NetBSD-6.0/sgimips/INSTALL.more) = a43c8c4a3aea3585e8de329c8efef129
+SHA1 (NetBSD-6.0/sgimips/INSTALL.ps) = e61b0904bc556853037f1a9564486e0962a8b8e2
+SHA512 (NetBSD-6.0/sgimips/INSTALL.ps) = 122ebadac3919533845714c90f87c59a65722d6e79f50bf231866f2917e6d4ebcb4a8b5da8e4ac9acbe4e333e841611ef80665b7e69427db90d4843e5f630c8b
+RMD160 (NetBSD-6.0/sgimips/INSTALL.ps) = efbc102832be0cee24ce3a5810999c5ea9c4b18e
+MD5 (NetBSD-6.0/sgimips/INSTALL.ps) = e86216add5a2ed163e13a17c6ff291f2
+SHA1 (NetBSD-6.0/sgimips/INSTALL.txt) = 104c1ef873cfbe774ba106e437168053539b65b1
+SHA512 (NetBSD-6.0/sgimips/INSTALL.txt) = 8b5ad1ef07604c0e8ac5ec2c7f43a4c483610a7ad7ac4c15a13c4151652500a21b203569bcc9ecbb53e035f8b90e1c7e3fc81d985fe3817685957865fb4924cf
+RMD160 (NetBSD-6.0/sgimips/INSTALL.txt) = 7cc2ca6174d6b5e2ed23f8db3d6b62bb02c41637
+MD5 (NetBSD-6.0/sgimips/INSTALL.txt) = 99bca5bfeb2112666aba79a96379899a
+SHA1 (NetBSD-6.0/shared/ALL/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/shared/ALL/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/shared/ALL/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/shared/ALL/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/shared/ALL/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/shared/ALL/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/shared/ALL/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/shared/ALL/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/shared/arm/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/shared/arm/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/shared/arm/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/shared/arm/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/shared/arm/xbase.tgz) = 875fd641f969ec00f854ca1334d084947450c740
+SHA512 (NetBSD-6.0/shared/arm/xbase.tgz) = 75d0c9e9685b6b7bb706df7427c8b52f59c4fc4d0e725b02ee18024f75a546dc41de5f1a5d8552a8d2c84bdf87856e5857b0f12914801ca7b36b69536d617b4e
+RMD160 (NetBSD-6.0/shared/arm/xbase.tgz) = 1a4d099d59b2bd882e99f1b2df1c7bf22b890d48
+MD5 (NetBSD-6.0/shared/arm/xbase.tgz) = 5eb9c573c5a0c96701f268a3470a58b9
+SHA1 (NetBSD-6.0/shared/arm/xcomp.tgz) = 8d7469a85b7433c89690cce74e6b3f4e66cf0647
+SHA512 (NetBSD-6.0/shared/arm/xcomp.tgz) = 411304cf66e300a7f162128203099bb4d6eebc4a93ba18ed7caf79f30b31cc7ffcede85c4e1bad02c3f5f8a27d009fb71f3ce5862c1d8aa477f39a25c535fdaa
+RMD160 (NetBSD-6.0/shared/arm/xcomp.tgz) = 822d26e0ee08b72ca8b991f0709a8c1bf0399208
+MD5 (NetBSD-6.0/shared/arm/xcomp.tgz) = 5af361f0334d28119d703064278b3ed3
+SHA1 (NetBSD-6.0/shared/arm/xetc.tgz) = 222d14c205f1018cc5a86eb03214d18cda2abb82
+SHA512 (NetBSD-6.0/shared/arm/xetc.tgz) = fb82261996aa772fd8a9022eadebf899ee04ee70229ee4fe07758ca14937bdb34752c8218eb4c5b722b6208f719891493bbc141372fcfa503de83e0a61aa7387
+RMD160 (NetBSD-6.0/shared/arm/xetc.tgz) = 511ebfe5076f361b7f7ca03a265d16052a16d259
+MD5 (NetBSD-6.0/shared/arm/xetc.tgz) = 165cffbb6d2c79663198d80c82afac1e
+SHA1 (NetBSD-6.0/shared/arm/xfont.tgz) = ce0e141beeffeb5b470478e9887e4127da85de3c
+SHA512 (NetBSD-6.0/shared/arm/xfont.tgz) = 5d98354ff77103793d56af3192ab5f9afcde62208791976064ac33a149f994e0227dd5dd28ed544eeac5ea504e5212d5fb9e7d05e59e5a48a2fe4062e34e3106
+RMD160 (NetBSD-6.0/shared/arm/xfont.tgz) = 4d09f5e82fec875ef0ea328809465e7a98f2ebfc
+MD5 (NetBSD-6.0/shared/arm/xfont.tgz) = be26b3890261302420b09976a1d38144
+SHA1 (NetBSD-6.0/shared/arm/xserver.tgz) = 4ccfef1d49179603286042088bec0218c6b2031d
+SHA512 (NetBSD-6.0/shared/arm/xserver.tgz) = 809fc0a9065c1b9e7cd17aeb0d41cfd3158efd6c585556af01c4a3c93f0df3646a2ff77c6994449a703a408c0988fc1aa68cf34c7e297a3056d73ded57034c12
+RMD160 (NetBSD-6.0/shared/arm/xserver.tgz) = 403604404261764c74f10fab774c4653fd20cc9b
+MD5 (NetBSD-6.0/shared/arm/xserver.tgz) = 914f909b6878cef16a92765a8cbb52ca
+SHA1 (NetBSD-6.0/shared/m68k/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/shared/m68k/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/shared/m68k/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/shared/m68k/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/shared/m68k/xbase.tgz) = ffc6dc889560371042dd12a5486a9a2c499b86a9
+SHA512 (NetBSD-6.0/shared/m68k/xbase.tgz) = 9aa2ba4d703a13020acf8543d1efcde76b6f0f4b411be20f804709b3802e537be1e651eba469830c4fd4777a379ea9936200a3a3eb4b1a702c04bb81aafcc723
+RMD160 (NetBSD-6.0/shared/m68k/xbase.tgz) = 3ecf53e7414ef859a47fe5afc108cf3bfa82fb1d
+MD5 (NetBSD-6.0/shared/m68k/xbase.tgz) = a6af002ce158cf72eb5c6a7cde2c0989
+SHA1 (NetBSD-6.0/shared/m68k/xcomp.tgz) = e13548b8974f5d55e98caf17b2b4bbbcf2430370
+SHA512 (NetBSD-6.0/shared/m68k/xcomp.tgz) = e4b13c798df04ffef88e72100e2db5af400e5ae255cd7a1ca2907736b8138a59045b6f3bd8531b5753d0b87eadb1b5f801043a929bb25d1611e4be693c1da954
+RMD160 (NetBSD-6.0/shared/m68k/xcomp.tgz) = 3b1f4e26ddd57e69afd9709553c1bf70d6e29ea0
+MD5 (NetBSD-6.0/shared/m68k/xcomp.tgz) = 894bb9aa05b164d9923682165d708335
+SHA1 (NetBSD-6.0/shared/m68k/xetc.tgz) = d2ca34bd668e108cbbfd4b45720823663339f8bd
+SHA512 (NetBSD-6.0/shared/m68k/xetc.tgz) = 431ca465f300e7eb5d4dbd44c43e412a296fb4d3129217e752f86a720e8a8bdf736c9add05a45518a4f3e6cffa32381ef61e9186d360b68a5f8c64d87e385fb5
+RMD160 (NetBSD-6.0/shared/m68k/xetc.tgz) = 4c5d664679856b02b694534cd6afdf20597e6d53
+MD5 (NetBSD-6.0/shared/m68k/xetc.tgz) = 72bd67556ac14ea0ce147374af0ba624
+SHA1 (NetBSD-6.0/shared/m68k/xfont.tgz) = 24ca4cb77a59246b1b05e0a91fed21c63259d12b
+SHA512 (NetBSD-6.0/shared/m68k/xfont.tgz) = 8dc297fb6205a995767e68e77cc21169234dfb66a86bbcd2e1828fd32efeda0a25c9f2a9b1a39b97fe8d7b24f8cd5cf6160859af6be2259876f39ee4e76c405b
+RMD160 (NetBSD-6.0/shared/m68k/xfont.tgz) = d2f134959940e6667aca185f01e388c05dc6bc85
+MD5 (NetBSD-6.0/shared/m68k/xfont.tgz) = 3c96c1f0a13cd7d277ca35622ac9c058
+SHA1 (NetBSD-6.0/shared/m68k/xserver.tgz) = 1d20fd039546a66b428b854c659ea5e2ee9f8114
+SHA512 (NetBSD-6.0/shared/m68k/xserver.tgz) = 091d09049d0af5555feec02065234e281677aeb3ecbab5a19413d924a8b58dc7f64401ef68e68bc52d8b6eeb73e091d351c45805374b8bf276b0181415968561
+RMD160 (NetBSD-6.0/shared/m68k/xserver.tgz) = feef5d52278d23637d7b8ba77639bfd96918e90e
+MD5 (NetBSD-6.0/shared/m68k/xserver.tgz) = b2bd6057c374376388766fc8667eb9a9
+SHA1 (NetBSD-6.0/shared/mipseb/games.tgz) = f56d3e5181634f6a3d7908dcb002ebcb1c5aaff0
+SHA512 (NetBSD-6.0/shared/mipseb/games.tgz) = 0cff50ea13e34fe338edf70da6a28af061580feb4cb0773828adefa631ebd471a96568a3b30ea0f13f3bb116856a1b6aad8a5a52443346f52e4907f4caabc5f1
+RMD160 (NetBSD-6.0/shared/mipseb/games.tgz) = 1538910578dbb8eee2931200fac0ccda44758e5f
+MD5 (NetBSD-6.0/shared/mipseb/games.tgz) = 2bd5bd0ce72df5cf92767b8c3f7cc208
+SHA1 (NetBSD-6.0/shared/mipseb/xbase.tgz) = d81c7fe75a90f1b2111a066e78f1f2b3e8edcd8c
+SHA512 (NetBSD-6.0/shared/mipseb/xbase.tgz) = c241391fcde4a685a0a2af6f843844ac2e918024c447a2b5ea2cf5300f69acc42fdadf53d3b0348f10723b786bcc0f420e68fe36228375bf3cb5140de41eb40f
+RMD160 (NetBSD-6.0/shared/mipseb/xbase.tgz) = 2fbf60b64c0b7ac2be72ebf998d9d7390fc40705
+MD5 (NetBSD-6.0/shared/mipseb/xbase.tgz) = cd23ca0f6b359c4d695d4494a147d40f
+SHA1 (NetBSD-6.0/shared/mipseb/xcomp.tgz) = c8f5ff5ea9f9bbe231f92d8b7f3bfcbd2897069f
+SHA512 (NetBSD-6.0/shared/mipseb/xcomp.tgz) = c7590075195019078b68ec5f87e36479ae2e7b7749c523df4ef21c9d881c343cda9f5c2bba897dd313329a76fe5c18e920d92827878d98ce08a7dc776352cd02
+RMD160 (NetBSD-6.0/shared/mipseb/xcomp.tgz) = bc60e267cb6e11b4a7305f8b7074084e179e0ff5
+MD5 (NetBSD-6.0/shared/mipseb/xcomp.tgz) = 8e58ee51667def3bd015f79769c0d932
+SHA1 (NetBSD-6.0/shared/mipseb/xfont.tgz) = c551bd13179b9508c2e3a7e19cec323e8ba21844
+SHA512 (NetBSD-6.0/shared/mipseb/xfont.tgz) = 764527f2f3f4686759fcae3fd093f4e00f34e1249994126221a6f9afe73d4cf8ddfbe8b8311798da2ed38c52466a44bb26ea08ad5aab1c08eebcc9019b4223f7
+RMD160 (NetBSD-6.0/shared/mipseb/xfont.tgz) = b3a365bedf8b4a20f3920d0e33b9a42fce288953
+MD5 (NetBSD-6.0/shared/mipseb/xfont.tgz) = adac8939da213a0195cc1d351f979199
+SHA1 (NetBSD-6.0/shared/mipseb/xserver.tgz) = 686f6e6d722c9676351ab058736f7077b4ebd2f6
+SHA512 (NetBSD-6.0/shared/mipseb/xserver.tgz) = 5c818f22edbeac7325228af99d6da6e44b5eb659c7c9fcc6b332071e97a0a490081eda7f9e0f22d6a3f3a589ae34179b434751a6191db5c664683d7510aecedc
+RMD160 (NetBSD-6.0/shared/mipseb/xserver.tgz) = 0e9f066095b505c7f062bf877147189a7a2f0649
+MD5 (NetBSD-6.0/shared/mipseb/xserver.tgz) = cdd2e5127838437df40af161e0c8398f
+SHA1 (NetBSD-6.0/shared/mipsel/games.tgz) = 27d9f98fecb3495e51939df9f107e81e527af26f
+SHA512 (NetBSD-6.0/shared/mipsel/games.tgz) = 46bb4e10313cfffaaf4f7fa2157474ef940f94bcc9f84b46f829c7615bbf45e4e01edee7b7efb84bc28561e0712c37cfc737f9c2a0d9a73b67c80c8aa0f3a9af
+RMD160 (NetBSD-6.0/shared/mipsel/games.tgz) = 947feea90ec2698a65d555cb78a29a001b086589
+MD5 (NetBSD-6.0/shared/mipsel/games.tgz) = 355f00978fed8e8da6a251e591be5387
+SHA1 (NetBSD-6.0/shared/mipsel/xbase.tgz) = 76468fcada5a9e26652aa9f0f9f3c94829a317e9
+SHA512 (NetBSD-6.0/shared/mipsel/xbase.tgz) = b2adcfc2dedef30b21b885c8fc757d0479541744a280a9997fbeaa9c881009ab4b0019e0001a540a8eb6db5f84db87b365e420bb2d4270af209821bdb080369c
+RMD160 (NetBSD-6.0/shared/mipsel/xbase.tgz) = 1e0074d03d9fbb3373e0a427b25cc7097bf6d3c8
+MD5 (NetBSD-6.0/shared/mipsel/xbase.tgz) = a8f29ec2e3768405942f97af3dd08ee7
+SHA1 (NetBSD-6.0/shared/mipsel/xcomp.tgz) = d8ac89f3f6ff20abb0adabc49227afdb74aa2040
+SHA512 (NetBSD-6.0/shared/mipsel/xcomp.tgz) = 4f03213fb061dae9421747209628d06ede6bbb71a7560a9e1a54796b907f1620146a33fdce52974227a21acedcc210b99e15c4fdd36432eba60c1041a92d8cee
+RMD160 (NetBSD-6.0/shared/mipsel/xcomp.tgz) = 6be5e72b9b57c9bdf8ed8ea127e2a73830feeecb
+MD5 (NetBSD-6.0/shared/mipsel/xcomp.tgz) = 59a7ea141587417be38ab1f6056cc780
+SHA1 (NetBSD-6.0/shared/mipsel/xetc.tgz) = b9f6b1a54ffab37b11f4c6e717b481cd087fb609
+SHA512 (NetBSD-6.0/shared/mipsel/xetc.tgz) = 72f35e65f3a90967e250a2006d500619b3824f7f5c3d7494554f153ec5cda5b28c445f28c34a1e4463f40da5855e8d4257726411796967fe37763d90cf7fe461
+RMD160 (NetBSD-6.0/shared/mipsel/xetc.tgz) = 1169c246f91189fd0c4ae86ac27a92f5c2edda3e
+MD5 (NetBSD-6.0/shared/mipsel/xetc.tgz) = 8f3c52cc5af1cafaf7b0d0f884a5b537
+SHA1 (NetBSD-6.0/shared/mipsel/xfont.tgz) = d06848571034f3b7fc975082f1de37b912acb18c
+SHA512 (NetBSD-6.0/shared/mipsel/xfont.tgz) = 66a1013c935bee5e7e5d24325a527522306bcded7ced63790f2e58831b3ed91176a1b9510b2159be63504d5167d48d534919927ffc6e225ae2bb2487f90a9ede
+RMD160 (NetBSD-6.0/shared/mipsel/xfont.tgz) = c9502843a5d4dd7e996e8d158c519cf7f8575cbd
+MD5 (NetBSD-6.0/shared/mipsel/xfont.tgz) = e812899176eac2bf65a6d949ac3f3424
+SHA1 (NetBSD-6.0/shared/mipsel/xserver.tgz) = ff805022f409202f3346c45475c7ec0f8187218e
+SHA512 (NetBSD-6.0/shared/mipsel/xserver.tgz) = f2bb3810a5572b519980126a3d934f63b5ab5c2fcf9fb8166c556bd3cc14cfaa151d582086bb1506ac9ac7e21d4e70a5cd5c3faed96212d8a14a0b5bafdcc4c1
+RMD160 (NetBSD-6.0/shared/mipsel/xserver.tgz) = d5ae336337cc77f7f55f542b3457918d6fc0efe8
+MD5 (NetBSD-6.0/shared/mipsel/xserver.tgz) = 92447a1560887d337d22e2deed0670a6
+SHA1 (NetBSD-6.0/shared/powerpc/games.tgz) = fbf69640b362df2446d7414ac3a13db100c289eb
+SHA512 (NetBSD-6.0/shared/powerpc/games.tgz) = d86b41d79aea4204ccf45306937a5ec45629e37873a5956c0280fd1d54cf4a808542d097f9d978fd3277791554ce8a6fb4d0ccd46e30210549d5cce1145bb499
+RMD160 (NetBSD-6.0/shared/powerpc/games.tgz) = fd2aed1eb51f4db522fb5163e8fde4c040b55d30
+MD5 (NetBSD-6.0/shared/powerpc/games.tgz) = 997ae5fb42196a787df89873be321e47
+SHA1 (NetBSD-6.0/shared/powerpc/xbase.tgz) = b7c8146146ebc15191c1bf53f51f8f980fe8c816
+SHA512 (NetBSD-6.0/shared/powerpc/xbase.tgz) = 091f5d00414a9ad478811bfb0e953f2a204869bc5e310790886a59c11953974cf7068cd9a96c8823856ab2687ffa2ac31e97494f47338bfe31d80217382c59f1
+RMD160 (NetBSD-6.0/shared/powerpc/xbase.tgz) = 4bd1bfdc7c1e1619de63fb83276c21039b945357
+MD5 (NetBSD-6.0/shared/powerpc/xbase.tgz) = e621806afa0fcc9cdcef0f9b3c7dfcbd
+SHA1 (NetBSD-6.0/shared/powerpc/xcomp.tgz) = 960dd33b61e19dec92096a54791aca1cdf56ce54
+SHA512 (NetBSD-6.0/shared/powerpc/xcomp.tgz) = 111dd50041e4008aeadb898c3d08f9995c5c13a41ccc20993b4ad51c81d7f6ee3b4dab16158ac7436d085b80e4a643b236a9c97edd3e915125a1466154538420
+RMD160 (NetBSD-6.0/shared/powerpc/xcomp.tgz) = 0cf8b9a8d1489a32ba0b5a277d90e429c40650fb
+MD5 (NetBSD-6.0/shared/powerpc/xcomp.tgz) = 4ba4077ca2c0edf71813165fcf5321fb
+SHA1 (NetBSD-6.0/shared/powerpc/xfont.tgz) = 4711fcbade0238d60b7b89cf0d7873b03d7ed1f7
+SHA512 (NetBSD-6.0/shared/powerpc/xfont.tgz) = c29130f55f536f602253a7f92f073ebf6ba02baea09f8011530bbf7e03ae96594334f0c60b29a8bceaffc3eb8b152db47548e38a3c8a14abc5fe35bc5d1d7d93
+RMD160 (NetBSD-6.0/shared/powerpc/xfont.tgz) = 3b01af0f8e34367988d559fe0fbb0acbbafb0b2b
+MD5 (NetBSD-6.0/shared/powerpc/xfont.tgz) = 6ba15ed12217b726d9129db8e942a048
+SHA1 (NetBSD-6.0/shared/powerpc/xserver.tgz) = 05aac7e617e0cac05a88062fef29bb459da7a1d1
+SHA512 (NetBSD-6.0/shared/powerpc/xserver.tgz) = 19fb5af5d6afd78839a22e5c0694a492047b5200c569cbf58c676ff32ec250b21edcfe2ed00b65092fdac374d1ab9eaaed6113c69bc03009cf458aedc6014913
+RMD160 (NetBSD-6.0/shared/powerpc/xserver.tgz) = 774d2a1072b8d122790ad189a6d2ada2ad99e7cf
+MD5 (NetBSD-6.0/shared/powerpc/xserver.tgz) = 3daf1477cadf3593e9ba45e3703fe8a5
+SHA1 (NetBSD-6.0/shared/sh3eb/games.tgz) = 37e15b0950aaaf1af36427ae5dd5866c1879b6b3
+SHA512 (NetBSD-6.0/shared/sh3eb/games.tgz) = e674abb1b1966acbc581a8f8b3e37841f48656e66f3302077cbb2de443487912b99521336ec5dc096fa3c7769b2d7623e1d1720a079407ec1861d32159a72ebc
+RMD160 (NetBSD-6.0/shared/sh3eb/games.tgz) = 36070071e8315d2352be1b3e563ce7ef7625d184
+MD5 (NetBSD-6.0/shared/sh3eb/games.tgz) = 0016145b46957b95dd158b4441dfb010
+SHA1 (NetBSD-6.0/shared/sh3eb/xbase.tgz) = 564bce6dd7c37b5e941e41d50f363c133fdf8f97
+SHA512 (NetBSD-6.0/shared/sh3eb/xbase.tgz) = 23b3306254c789331542e63974f9d7cdc54d99ba2cd67cf6a1c97f09afa4f6cf6aa8798e37b7c38f4a55afd1572154f291fa1bf2e2a1fc87165fd6bd7f89fb80
+RMD160 (NetBSD-6.0/shared/sh3eb/xbase.tgz) = 476fbd8301bec0795a01552728ada44204d2dbe6
+MD5 (NetBSD-6.0/shared/sh3eb/xbase.tgz) = 9fbbbdb3acfa4ccd9f0b309ea0ed0700
+SHA1 (NetBSD-6.0/shared/sh3eb/xcomp.tgz) = 526a278a13833073e6231e879abdec85400ca888
+SHA512 (NetBSD-6.0/shared/sh3eb/xcomp.tgz) = d2081a7536e3d7fa27a363afd8f6eb5fc3de4606f11b4857be2f1df59934da9d3d16e0df3a6edf4cdf52c8f579e0e4c06f07de0959b5213c21be1a8fdc2ee134
+RMD160 (NetBSD-6.0/shared/sh3eb/xcomp.tgz) = 4a767ff08e9bcf98f886849cabebd1300397256f
+MD5 (NetBSD-6.0/shared/sh3eb/xcomp.tgz) = a23a2d8be9298497b4b6d39fda330bf4
+SHA1 (NetBSD-6.0/shared/sh3eb/xetc.tgz) = 93a5cfbbfdc641f91ab363d4b65d1158d71c0cfc
+SHA512 (NetBSD-6.0/shared/sh3eb/xetc.tgz) = 85a67734801e81e129a37b73ae62211459fb16d4e52a945ef21a4bb908dd7d1d775233956086dd3d59af45bcea24fbd6f54a2a9175756d242b57e07d10767548
+RMD160 (NetBSD-6.0/shared/sh3eb/xetc.tgz) = 6fb055d0e1b6264bf1ec396236d903218832377a
+MD5 (NetBSD-6.0/shared/sh3eb/xetc.tgz) = af954b56e624948145b91aa451d77392
+SHA1 (NetBSD-6.0/shared/sh3eb/xfont.tgz) = 6139c05273b6feeecdfcd11cbe0da91256d12a11
+SHA512 (NetBSD-6.0/shared/sh3eb/xfont.tgz) = bb849454ede88d39ca60d6c513c833c2b29ea548adedb9f76870839174a3daa838d38a6ad701c78bfc164e690c5ebda9c9d00d4c23ad816df9f1962313afdbf2
+RMD160 (NetBSD-6.0/shared/sh3eb/xfont.tgz) = ea8f123f9f78b429b77ff15c924803da1da2068d
+MD5 (NetBSD-6.0/shared/sh3eb/xfont.tgz) = a87cb6769c37ae20dbf0dd70cef93d11
+SHA1 (NetBSD-6.0/shared/sh3eb/xserver.tgz) = 6cd4fdb0ff00ef5d89b47e68e538c86e395b2054
+SHA512 (NetBSD-6.0/shared/sh3eb/xserver.tgz) = e3b575cab95e297a05a26a03eeff0cf843d665ebdfd103846ad544bef1d04f93aa20ceab09b1dfaae8f59d89ebb1cbef400b7521bdb41f7542f23156540aa4c0
+RMD160 (NetBSD-6.0/shared/sh3eb/xserver.tgz) = 7e52b98276b4d097f7babe918e6768ae9d7945db
+MD5 (NetBSD-6.0/shared/sh3eb/xserver.tgz) = a505ab4ce0801aabe21fe6038b63809f
+SHA1 (NetBSD-6.0/shared/sh3el/games.tgz) = 2040b4af557a62f2ade5fc9fcfe4cab3df88c7e2
+SHA512 (NetBSD-6.0/shared/sh3el/games.tgz) = 8b5071337dc844042537c24c75660e61c9709cd10cbbeab059a84da6d482260b73365ff3870f85060c130a291b6f02be174d288127ca62ce4d291a6982192317
+RMD160 (NetBSD-6.0/shared/sh3el/games.tgz) = 28acfa5a131d52df7c157e2edca1dd0f20e774dc
+MD5 (NetBSD-6.0/shared/sh3el/games.tgz) = d82c46dbc0021fd4694e464042936052
+SHA1 (NetBSD-6.0/shared/sh3el/xcomp.tgz) = 53aa1e2a910e8eed09dc07f8b724804f53fe5e2f
+SHA512 (NetBSD-6.0/shared/sh3el/xcomp.tgz) = 24645da85419528015cdaefd0c835741fa801392e795b363bdfc39558e75e7f384511c0668d12e2440114b7c543c7532aaec438048f08d35c54c9c7a748f20c0
+RMD160 (NetBSD-6.0/shared/sh3el/xcomp.tgz) = 60a461ffc1f1562274110d65c72a541ee131cd21
+MD5 (NetBSD-6.0/shared/sh3el/xcomp.tgz) = f1d2650a8d7a4ecd60fda8e1aaf8c09b
+SHA1 (NetBSD-6.0/shared/sh3el/xetc.tgz) = 1636a6fe3e01f6d8a07a19cd204a6807c8caa4c7
+SHA512 (NetBSD-6.0/shared/sh3el/xetc.tgz) = 9cea4ba4af287dd57e591d4269f2f2582010250316f323746ac56b12cefcf2590b93fbb0197c665f61b1df41dcca62d17fb6ad80d4b1feb8ac8265e91e15074f
+RMD160 (NetBSD-6.0/shared/sh3el/xetc.tgz) = 5f68e3f96f7bb9ae07fccdb1d058e4b1307b4b29
+MD5 (NetBSD-6.0/shared/sh3el/xetc.tgz) = da84d97230787283e215a4ee1c4053ad
+SHA1 (NetBSD-6.0/shared/sh3el/xfont.tgz) = 97439ccf6840b18b1e9885f5504a401bf1a93650
+SHA512 (NetBSD-6.0/shared/sh3el/xfont.tgz) = 3d15541f7d7ae2128f44355bf110415adfa4e5182829259d2c6f7a4217feff99e236d13c5bb7bbeb724ff1a09ac1f58f02bdd6eef528bc416ec3118db6fc7d45
+RMD160 (NetBSD-6.0/shared/sh3el/xfont.tgz) = cdc9fcdb5fd5032803d5bba18db58f3ea6d62c85
+MD5 (NetBSD-6.0/shared/sh3el/xfont.tgz) = a8466a0477c6c443eafe99e9d1c61131
+SHA1 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.symbols.gz) = 4033fc14abf440fef2f4e6370dead899e4983721
+SHA512 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.symbols.gz) = 17fb47f8b2731f8fe73376ab664040eefdc64690156e26acad0791871e64e5d401ea95f592a034eaf963ceebc919a6d54c06874c8be8141b049637cc55aabc84
+RMD160 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.symbols.gz) = 9de247cfdaae7ee9022f6d09030b58665536dd2f
+MD5 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.symbols.gz) = c89c4849f164a941bc9a17cb89ca4dc2
+SHA1 (NetBSD-6.0/shark/binary/kernel/netbsd-GENERIC.aout.gz) = 98a104383326606b65c14160cf13b700c0d0becc
+SHA512 (NetBSD-6.0/shark/binary/kernel/netbsd-GENERIC.aout.gz) = 60c184cc2a78026b2ae297623a540618e63a58962e578fa8ecb0e68c5e94e9c64fe910da565b6e9427e0e99aae311e8645e2083a4cd02373f08c514a29fa9bfc
+RMD160 (NetBSD-6.0/shark/binary/kernel/netbsd-GENERIC.aout.gz) = c1569194e6d7d526911ecc813919db5103eba092
+MD5 (NetBSD-6.0/shark/binary/kernel/netbsd-GENERIC.aout.gz) = 77f58eeb32ecae1a67c7821cfef3e1f1
+SHA1 (NetBSD-6.0/shark/binary/kernel/netbsd-GENERIC.gz) = 3aec79cc4bd37f7777e326445a18e4d551f4dc23
+SHA512 (NetBSD-6.0/shark/binary/kernel/netbsd-GENERIC.gz) = 46894446ed52b86e01d7fed75aa5285670d2d32a972be76a1019ea797583fff37423f4d9d40c29c394d123365b9a196fc7bb3824dc5952f6407b21198127cdba
+RMD160 (NetBSD-6.0/shark/binary/kernel/netbsd-GENERIC.gz) = e34c8493497296b2d98dc0522d2d4d58b56a3546
+MD5 (NetBSD-6.0/shark/binary/kernel/netbsd-GENERIC.gz) = 9ccf14a3d80b596f8e594c2e7db89224
+SHA1 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.aout.gz) = 08fdda8c99f112770acb58f662e7dc7f92e211aa
+SHA512 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.aout.gz) = eb7dd72ec967546883dbf9e50fc9bf770e8aced07020c03f93abdc0c9bd6b1a03ff320a3f5167f74caf732ff37495e7507628e0ea213ae8fbf209fbfc2ed2368
+RMD160 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.aout.gz) = 97cd05778ad6cbef869bfd1ef9bda107db56b099
+MD5 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.aout.gz) = f174a788515cbae3b497a13a1f27b68b
+SHA1 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.gz) = 78fa421384bc331c7bf1194c90f45969e0b9f9ca
+SHA512 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.gz) = c97fe5aa7c364929d749ee65dec8b6a7736da39e4d3366dfd8b17e67e8b5e56f9d37a0b8b4437c161602bfd265b486378ac272fc4e7917851b64faf8a9389370
+RMD160 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.gz) = ef146283b89c96c7d68bef166e853a83df6a65ee
+MD5 (NetBSD-6.0/shark/binary/kernel/netbsd-INSTALL.gz) = dda410ee10ec3e07d4b962e08e5895c6
+SHA1 (NetBSD-6.0/shark/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/shark/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/shark/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/shark/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/shark/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/shark/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/shark/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/shark/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/shark/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/shark/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/shark/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/shark/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/shark/binary/sets/xetc.tgz) = 222d14c205f1018cc5a86eb03214d18cda2abb82
+SHA512 (NetBSD-6.0/shark/binary/sets/xetc.tgz) = fb82261996aa772fd8a9022eadebf899ee04ee70229ee4fe07758ca14937bdb34752c8218eb4c5b722b6208f719891493bbc141372fcfa503de83e0a61aa7387
+RMD160 (NetBSD-6.0/shark/binary/sets/xetc.tgz) = 511ebfe5076f361b7f7ca03a265d16052a16d259
+MD5 (NetBSD-6.0/shark/binary/sets/xetc.tgz) = 165cffbb6d2c79663198d80c82afac1e
+SHA1 (NetBSD-6.0/shark/binary/sets/xfont.tgz) = ce0e141beeffeb5b470478e9887e4127da85de3c
+SHA512 (NetBSD-6.0/shark/binary/sets/xfont.tgz) = 5d98354ff77103793d56af3192ab5f9afcde62208791976064ac33a149f994e0227dd5dd28ed544eeac5ea504e5212d5fb9e7d05e59e5a48a2fe4062e34e3106
+RMD160 (NetBSD-6.0/shark/binary/sets/xfont.tgz) = 4d09f5e82fec875ef0ea328809465e7a98f2ebfc
+MD5 (NetBSD-6.0/shark/binary/sets/xfont.tgz) = be26b3890261302420b09976a1d38144
+SHA1 (NetBSD-6.0/shark/binary/sets/kern-GENERIC.tgz) = 436b25de68b7e666f29611394561037b31f1a9b7
+SHA512 (NetBSD-6.0/shark/binary/sets/kern-GENERIC.tgz) = 64acef2068786ba3afa466eda01db892f03fb48db03ad9ee0817f6a78b8019225beac65553dcd733d9858b4c35da337cbb20a7efa7019e77178e637dd5cb25f2
+RMD160 (NetBSD-6.0/shark/binary/sets/kern-GENERIC.tgz) = 83396c190ee6331e8297e4abc20d5b940b654e23
+MD5 (NetBSD-6.0/shark/binary/sets/kern-GENERIC.tgz) = a00e97b04a6d5affc36743311bc2293e
+SHA1 (NetBSD-6.0/shark/binary/sets/base.tgz) = fa2c393fa435744e1b106d19470278c97d9419fb
+SHA512 (NetBSD-6.0/shark/binary/sets/base.tgz) = a6ec0e86858f7c9faef7b4df4f2a951fa120af290d18d06598bb82b54541fe1a36d60b47f03da404a0d97889a5ea582db0a13b4a1827acf9e1842c70c90fcc0c
+RMD160 (NetBSD-6.0/shark/binary/sets/base.tgz) = 151c8a2e662926762a132b689b24943ac8b93c01
+MD5 (NetBSD-6.0/shark/binary/sets/base.tgz) = 787953226e7c5d1aeb78aba04cb18579
+SHA1 (NetBSD-6.0/shark/binary/sets/comp.tgz) = d37041a235ddf0a129bfa9f1d5e11d2fdb77816f
+SHA512 (NetBSD-6.0/shark/binary/sets/comp.tgz) = 19427e8b7dc48941e4e54ff0b8841358a551599c43862f830a752551044f96ed39bbd8038348fb3f3bf15ee831e0638cc4a3b4f0c04037222666f017cb11b862
+RMD160 (NetBSD-6.0/shark/binary/sets/comp.tgz) = 58df952b8aea84f1e0bc2658871408502eef4667
+MD5 (NetBSD-6.0/shark/binary/sets/comp.tgz) = ef10bf2cdec1811b1d3a2d3376201583
+SHA1 (NetBSD-6.0/shark/binary/sets/etc.tgz) = 07309c170d21a4c786ac5a12f5e792580788cd76
+SHA512 (NetBSD-6.0/shark/binary/sets/etc.tgz) = 6424ecfc34615c6fd1acb909b70414806e516119f30df73b70ee7128e69060da9457043da999de6011e7556a6685091cd30f4033e0ab7ea8cb0a2c6cc02c03ec
+RMD160 (NetBSD-6.0/shark/binary/sets/etc.tgz) = b2fa61062310af5511249b80505cefc966801f9b
+MD5 (NetBSD-6.0/shark/binary/sets/etc.tgz) = 1b69ed72ccfb0af799b148825a53bc9c
+SHA1 (NetBSD-6.0/shark/binary/sets/modules.tgz) = 3ef4de9b2730972b94688f3674b121eeabd2448d
+SHA512 (NetBSD-6.0/shark/binary/sets/modules.tgz) = 7c29c66462378dc8d7e7d5bfce324b012383176d8b381e83122808920f2d88d80665547a6e2974738fb6b1268aeacc4a7cde9ef17faec3d9d5c155ae2544cd37
+RMD160 (NetBSD-6.0/shark/binary/sets/modules.tgz) = ae6f3aba96b1b9b2d2a412754a42296afc85a69c
+MD5 (NetBSD-6.0/shark/binary/sets/modules.tgz) = 5f374bf40599728af733192b3a546d7e
+SHA1 (NetBSD-6.0/shark/binary/sets/tests.tgz) = 62e58a9b83eec5a0fb21b9fe7f5845e5315811e7
+SHA512 (NetBSD-6.0/shark/binary/sets/tests.tgz) = 43d78bd32bff49e6f6c62914cd16916e41541fb446913c688d0fe4fdbcf5fff6d5605688ec165f8e856a418bba4f36c7d7233b8344c86b954ce104e963abe0a0
+RMD160 (NetBSD-6.0/shark/binary/sets/tests.tgz) = 560f27cf65beada1eb6e62458b7450968218fd37
+MD5 (NetBSD-6.0/shark/binary/sets/tests.tgz) = 4d39b8cb6664b022b300186cb7afa8e6
+SHA1 (NetBSD-6.0/shark/binary/sets/text.tgz) = 663a9a70c81324796717d31e46d5e8c00620a132
+SHA512 (NetBSD-6.0/shark/binary/sets/text.tgz) = ae6817fabcfae5fd0a9f35787e6d9af82d64a14c6d532c1a54c347c367d23c6ccc274eb813a23e4bb4dcb036b829437130400c418ffd0eb9c36858443f8d9b84
+RMD160 (NetBSD-6.0/shark/binary/sets/text.tgz) = 51994c6b412ee1e6834b270482f8c0dbbc95a835
+MD5 (NetBSD-6.0/shark/binary/sets/text.tgz) = c93688098447ac5ebf664bfb3362615e
+SHA1 (NetBSD-6.0/shark/binary/sets/xbase.tgz) = 2782c3a99b0cdb6ea4c4b29543f6f06b24c1726f
+SHA512 (NetBSD-6.0/shark/binary/sets/xbase.tgz) = 90a42af846fd7479e30789a28c7908b2b70416e7824d7f78c31b378c5e1dd38d4eb797f4430f6dd9baf051afe1750ad4bacdd3e93f2b65b2ad92945f682a1685
+RMD160 (NetBSD-6.0/shark/binary/sets/xbase.tgz) = 6b4e44c69f47563964562f18c42a5bc5a99e750a
+MD5 (NetBSD-6.0/shark/binary/sets/xbase.tgz) = 1c370ba00bea97b4afbef7e3bc919655
+SHA1 (NetBSD-6.0/shark/binary/sets/xcomp.tgz) = 997e19373b3e9b90464e849f1d635e33235aa5f7
+SHA512 (NetBSD-6.0/shark/binary/sets/xcomp.tgz) = 1e9d84d70a45aa3ea4d4bff9066594e853b9af68912e58bc933060f2b652ceea2d40231e04debed15dc569ec3d1d2d3682b3042b009c0738f17bf11979f2e86e
+RMD160 (NetBSD-6.0/shark/binary/sets/xcomp.tgz) = 60b1ce3cf224d2caf6d4c9757761c8145d4bcc4f
+MD5 (NetBSD-6.0/shark/binary/sets/xcomp.tgz) = 0bd79975afc5e2dbf542c8ab9363b664
+SHA1 (NetBSD-6.0/shark/binary/sets/xserver.tgz) = cf7350b715c568255b8d095503eed754c3d1ff31
+SHA512 (NetBSD-6.0/shark/binary/sets/xserver.tgz) = 3c88b006114891f2e3aaac95d15f25de6c8ac1dd00802097d1885f015326e926a297dcdf6c9c10a798ff73242e3130a7e359bd7f4bab45b23408a628da011725
+RMD160 (NetBSD-6.0/shark/binary/sets/xserver.tgz) = e9a9b2579181cfc7974ab1586990bbb0f2470299
+MD5 (NetBSD-6.0/shark/binary/sets/xserver.tgz) = 795a4afd76d016cb1868344522fb0fb4
+SHA1 (NetBSD-6.0/shark/installation/instkernel/netbsd.gz) = 08fdda8c99f112770acb58f662e7dc7f92e211aa
+SHA512 (NetBSD-6.0/shark/installation/instkernel/netbsd.gz) = eb7dd72ec967546883dbf9e50fc9bf770e8aced07020c03f93abdc0c9bd6b1a03ff320a3f5167f74caf732ff37495e7507628e0ea213ae8fbf209fbfc2ed2368
+RMD160 (NetBSD-6.0/shark/installation/instkernel/netbsd.gz) = 97cd05778ad6cbef869bfd1ef9bda107db56b099
+MD5 (NetBSD-6.0/shark/installation/instkernel/netbsd.gz) = f174a788515cbae3b497a13a1f27b68b
+SHA1 (NetBSD-6.0/shark/INSTALL.html) = ee446561ae849bf3326e81939b2071c706bbbe7e
+SHA512 (NetBSD-6.0/shark/INSTALL.html) = 01bd9dca202f365a64c9f523cf025abc31a7180a8b45f843d1e60cfe4682329aedc8a892b8e2a6a230bfda1803c6740b6d9fe415992f5a2206425cd875ca3e1f
+RMD160 (NetBSD-6.0/shark/INSTALL.html) = c73d5cfb8e656b4634046ab9dabaa09772f8e383
+MD5 (NetBSD-6.0/shark/INSTALL.html) = 4207442c91faf52d0f3778fb77943ec0
+SHA1 (NetBSD-6.0/shark/INSTALL.more) = 9259e39f2fbc92e793da04efa5acb0318ee257c6
+SHA512 (NetBSD-6.0/shark/INSTALL.more) = a9510586f73298c7b0b8af60cf30b86d4588b90682b73adc3f14cb862f0f7ec0f103ff62eda6d4a141a2c5a24fa13d108f08817829a00545f8400ff9785460dc
+RMD160 (NetBSD-6.0/shark/INSTALL.more) = f80b0169a0a6cc36d204319f0e5ea6ac9e3c6256
+MD5 (NetBSD-6.0/shark/INSTALL.more) = cc98ec10bfc9ee19abfac7bb78843b52
+SHA1 (NetBSD-6.0/shark/INSTALL.ps) = d63b6262c2b64c83f763fdc888153b4d5785a5d7
+SHA512 (NetBSD-6.0/shark/INSTALL.ps) = e7082fc171e77f43761b8f8dba6443f9a76103be8b964d70e845940cec689c10579d8e5a6aa80bbb008cbde61c125fe348a3db7d157235df9dd6b53d247c3b8d
+RMD160 (NetBSD-6.0/shark/INSTALL.ps) = 5ae64ccead4bce193eef02a56c1883be5836e3f6
+MD5 (NetBSD-6.0/shark/INSTALL.ps) = b80bf37de21a0d2a7c1891ea18ee27cc
+SHA1 (NetBSD-6.0/shark/INSTALL.txt) = 21743fee95f9d668c37c80415896d05a652d8e5f
+SHA512 (NetBSD-6.0/shark/INSTALL.txt) = 80bc5a7e1ef3338c29c29b51f72b5c014bb10a7e7f367912ecc1e6633c7882ad23c119733c81dbcc4d7ff5178303dc555fa42951a48d364613ff52048d8e500d
+RMD160 (NetBSD-6.0/shark/INSTALL.txt) = 15c92de408750d0c47946ad7c7c7371a79e1e2c6
+MD5 (NetBSD-6.0/shark/INSTALL.txt) = ba3059416376468dad953da22a4bf29e
+SHA1 (NetBSD-6.0/source/sets/sharesrc.tgz) = 87a69ce98fc413c46524823e16dcd0dce768698c
+SHA512 (NetBSD-6.0/source/sets/sharesrc.tgz) = aedb194ace955f8c15820ae3e6d8bdbf67992da79f8cb3d2d0a2ad409819a78c7d3921fda193a982a6f032f92113fc807e0ad2eb064a82da98b8f5ec957bc53a
+RMD160 (NetBSD-6.0/source/sets/sharesrc.tgz) = 8e03f055e853b3b44d48cbafde267da9acd549f2
+MD5 (NetBSD-6.0/source/sets/sharesrc.tgz) = cdf8ab923e83b705dfc8e47e47ebdecf
+SHA1 (NetBSD-6.0/source/sets/gnusrc.tgz) = a5bb46c56b0f27a47dbaa3690758336bdc472292
+SHA512 (NetBSD-6.0/source/sets/gnusrc.tgz) = d94945054d64c9b16ddf2b3fbcf0dc8aa41965f76e469e8da0fc822082189d87324169709f5a95aa8461209522d3cdb387f52beaada7ecefb46571b021d925bf
+RMD160 (NetBSD-6.0/source/sets/gnusrc.tgz) = 562debda10c4d28bc11f9760fa7f7797f062a9fb
+MD5 (NetBSD-6.0/source/sets/gnusrc.tgz) = b72569083f678e665d6658cbd2c3e587
+SHA1 (NetBSD-6.0/source/sets/syssrc.tgz) = 8206633fc5ac0f890ecffdd50176768236cd4cc6
+SHA512 (NetBSD-6.0/source/sets/syssrc.tgz) = 566104c4324710005c869e065dc03889e85824910520d097a88c1bd5219adc750b3ef8d0057a7d98a7d535002c4c6e04594d98b5be138b8e29d74b1f3965b045
+RMD160 (NetBSD-6.0/source/sets/syssrc.tgz) = 8f26506a9ce36e2a163026804d629e30628f8c4b
+MD5 (NetBSD-6.0/source/sets/syssrc.tgz) = 8ece18d74c2fbd264198467f47e8b4bb
+SHA1 (NetBSD-6.0/source/sets/src.tgz) = bada9cb20d00977af0fc80b465ae9bd20648c893
+SHA512 (NetBSD-6.0/source/sets/src.tgz) = 981158338e0123f59b5a38f3f5c3a4fb8142f0280e49db0af5f0753512035113887bdcc9aa3f980761b51abf625764d0e89ca4de41cb80145f5ef7239676d1b2
+RMD160 (NetBSD-6.0/source/sets/src.tgz) = 90dc01e48266e240dd95962496cd2a1aa1ca90f9
+MD5 (NetBSD-6.0/source/sets/src.tgz) = 58e1e661d9640ca3eb542ac3086580f3
+SHA1 (NetBSD-6.0/source/sets/xsrc.tgz) = 73f98faff9d1b90c50d50d50a1f17e6880f43f12
+SHA512 (NetBSD-6.0/source/sets/xsrc.tgz) = dbcf2591e42422a0ddb15529b35cd7e1f198589459806239d9efc917c5b604cd152fda76c5fd5a8e912410ee1fc25e561f7e505b63461192406a121e84fe3784
+RMD160 (NetBSD-6.0/source/sets/xsrc.tgz) = 617e6308cfbb0899c230ceea2d843c197c4f4804
+MD5 (NetBSD-6.0/source/sets/xsrc.tgz) = 68d1535d0baed6625f6dd95fd20758ba
+SHA1 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC.MP.gz) = 496928e218106c5bc8d32bd6c736eddf69258416
+SHA512 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC.MP.gz) = cc26d9ef454d86c7e95a122eb0ef5d6f9dc742b0f9718d0a798e9666974d977de44d90025f38c2947c9d161c3b52a9eb8f42aa866a0198d310f7defd7f472db8
+RMD160 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC.MP.gz) = 3ccc735931179c31c8f2d4b5ce1e9f96121ff695
+MD5 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC.MP.gz) = 61be9899c92c833cb52f77b6f8e6aee4
+SHA1 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC.gz) = 7b45c74363d7977534a97b006e114ef4051246c0
+SHA512 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC.gz) = fc19ac6cf8544def619f803ab7573083991e050b8d551e9c4967d1e327e4ebfe51137f516815152fc00dceed5879309ba4e5e9c420b088378c0323c739df8cdc
+RMD160 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC.gz) = 86944c7c8fbed3cad7ddfef09833eee06231c3bd
+MD5 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC.gz) = 2daad7afb8771cd536a5bd668d3e981b
+SHA1 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC_SCSI3.gz) = 1138b7a86c5bb93d6b3904164e3841031880b675
+SHA512 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC_SCSI3.gz) = df36f0aac760c383f970b2dd9e13a4e6e3ca28d47846c904cc07ba11b6e289fe6c8319a40fd51850e5ced7a4585d61c83f489769cfe8aac189b650116f8faeeb
+RMD160 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC_SCSI3.gz) = e95d11e401563a66d9cc798db312d3f2a1b96c5f
+MD5 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC_SCSI3.gz) = 0aaca233a00a9fce3265a749b9a2852d
+SHA1 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC_SUN4U.gz) = 0732f8665299b419119c4507e525a6c992f20656
+SHA512 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC_SUN4U.gz) = dcd45f52ade746443eeb910f331ccbce2d48eaf03f2e49c7ac75940b36e2097e41ed5873224bf664e4bd935ba17b1503a61640427a7d9ea87ecdcad39f7eee60
+RMD160 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC_SUN4U.gz) = 568b09bb65717c3ae1b2f2e3a5b1c15316a3c53d
+MD5 (NetBSD-6.0/sparc/binary/kernel/netbsd-GENERIC_SUN4U.gz) = 785d8668cfd1df9f6bd6af6587636e0f
+SHA1 (NetBSD-6.0/sparc/binary/kernel/netbsd-KRUPS.gz) = bd5c8ef678bdeca11a32980b732803967ab0398f
+SHA512 (NetBSD-6.0/sparc/binary/kernel/netbsd-KRUPS.gz) = 1c79b7d19dbab9bb132529d1bf10f6a3d9f8bdbf006d1296721c5a987812cf55a077368b75b4775e1425dda56afde6ab35f5995648187c623dcdb3154d2a050a
+RMD160 (NetBSD-6.0/sparc/binary/kernel/netbsd-KRUPS.gz) = 93604d098cedbfd647a5ac6ea9409928bebc48d6
+MD5 (NetBSD-6.0/sparc/binary/kernel/netbsd-KRUPS.gz) = 7108981b6236f991fca67fe58d6eae81
+SHA1 (NetBSD-6.0/sparc/binary/kernel/netbsd-MRCOFFEE.gz) = 976e0a56648d3e03356d7f76426971fa523e4551
+SHA512 (NetBSD-6.0/sparc/binary/kernel/netbsd-MRCOFFEE.gz) = 172bd67678acdf034d897369d1d92be25dd684dbd14f362fad6c9655f7d5265caf4b57d495c570eebc1e53a87c53374d8f552656fa66366d3ac6221ccf98a752
+RMD160 (NetBSD-6.0/sparc/binary/kernel/netbsd-MRCOFFEE.gz) = b3a6897f2e3eb5acfe2d87f7d377697caeb3b007
+MD5 (NetBSD-6.0/sparc/binary/kernel/netbsd-MRCOFFEE.gz) = 7ea122d02744bc1fc5e42853992c908a
+SHA1 (NetBSD-6.0/sparc/binary/kernel/netbsd-MRCOFFEE_OFW.gz) = 181bf7c2d1cd731f71c5334a5d0d097749f166af
+SHA512 (NetBSD-6.0/sparc/binary/kernel/netbsd-MRCOFFEE_OFW.gz) = 63f26657f4bdde1cff58858fd5ffda69867a45d8148c4b4cf13804281389f34026a09f9f228eb670ff01ed8a02e99affb67b7a170fdcdda5f8f5cb128eaa9ece
+RMD160 (NetBSD-6.0/sparc/binary/kernel/netbsd-MRCOFFEE_OFW.gz) = fabe6d8566d88af5324ffa952c57f0fad3accd95
+MD5 (NetBSD-6.0/sparc/binary/kernel/netbsd-MRCOFFEE_OFW.gz) = 8a5f7d38f6ddc835e528d51886df36e7
+SHA1 (NetBSD-6.0/sparc/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/sparc/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/sparc/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/sparc/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/sparc/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/sparc/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/sparc/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/sparc/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC.MP.tgz) = c77b07953f63e5e21d1313e08dacf592acbddeef
+SHA512 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC.MP.tgz) = 40e533f5b17404c1d1137cee7e541193f5f6ad323bc615ba5db6a1dfd4816a27eb54b26d272886dbedc9184e85b36ba1ef6e798e140f84e669475eebdd61a015
+RMD160 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC.MP.tgz) = 2e067f3f9ef9697eba5185ff0d15d847c6e277a4
+MD5 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC.MP.tgz) = 496e0471d0eb80e227337bdaa45db5b2
+SHA1 (NetBSD-6.0/sparc/binary/sets/base.tgz) = 952c71b877521b1af63302bbe4c072b482c3723e
+SHA512 (NetBSD-6.0/sparc/binary/sets/base.tgz) = 14dc66a667648834321d8bde6c4f9e07c582ac569ceda4991552119282b53690521a89cb0fc06e2c0952f75d9dbc6c9c554f922e74111f4d42c94085bd4697ec
+RMD160 (NetBSD-6.0/sparc/binary/sets/base.tgz) = e57ecaa3098d2ae780c38e3e085c6f164498cd95
+MD5 (NetBSD-6.0/sparc/binary/sets/base.tgz) = b9fb689a8d63084ad2d6a4089028296d
+SHA1 (NetBSD-6.0/sparc/binary/sets/comp.tgz) = 59f49bbeaebf959d30414d0cacca3724359d55e8
+SHA512 (NetBSD-6.0/sparc/binary/sets/comp.tgz) = a800a26ddca7c79ccda284ab3b5e815cc4b53c409ca78bb00f386348e4ae973edf66440a931d9fe2ab0f8a16e329d885c3a2f190780600ca4e205936d7d01e8d
+RMD160 (NetBSD-6.0/sparc/binary/sets/comp.tgz) = 3a0cc6492eb72ee033ccd0b60c0c1698fa6b49d1
+MD5 (NetBSD-6.0/sparc/binary/sets/comp.tgz) = 39c91111ea991ede7ef81fa845ac319d
+SHA1 (NetBSD-6.0/sparc/binary/sets/etc.tgz) = 7cca1a9e594b2122f17b67a26d15e2051403bc68
+SHA512 (NetBSD-6.0/sparc/binary/sets/etc.tgz) = 191f890e7588a17a3258e92d51a91407281c97fe84e2ce68f6fc1db48b95011b1c15f86cc3bef58dff5b167c8ee1608fb42c22b55b78df7461a60827882bb0e4
+RMD160 (NetBSD-6.0/sparc/binary/sets/etc.tgz) = 39d06e86cfc8d3fb588c5b95371ece29ef11b5de
+MD5 (NetBSD-6.0/sparc/binary/sets/etc.tgz) = f909a9a70e65ad480468d1de75f057b0
+SHA1 (NetBSD-6.0/sparc/binary/sets/games.tgz) = 352b9089651bdd1ba05526f34fd99bf8e89db039
+SHA512 (NetBSD-6.0/sparc/binary/sets/games.tgz) = bd7c551fde89b7339d6b652a2583322c662bf0d4b69ce143034253f9764cfefabc5abe45d8e8850f7b9ee2d5714cda13f26f1d516679b544c096d27cbaf87b08
+RMD160 (NetBSD-6.0/sparc/binary/sets/games.tgz) = 9e71d26c198691e30f653c47b3b725ab54f1144e
+MD5 (NetBSD-6.0/sparc/binary/sets/games.tgz) = f6932706a5fba3dc666106b7b84ea734
+SHA1 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC_SCSI3.tgz) = e5359bdc3fc08e7fc7b5f0ffae289d8e3bbebe72
+SHA512 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC_SCSI3.tgz) = 88e1c0850a758a10d7752c1c64d4d80b5fc9935eb8cd9f4869585ca42cb5706bb6c1fa38467e7ba67a28f0b3e4e12df989839b1c7f6a777785e919eda6c4e464
+RMD160 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC_SCSI3.tgz) = 6486dfa05e73ea92b83ab42151f3978fb8d9cb3b
+MD5 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC_SCSI3.tgz) = 8965e59f45390938dd1f4cca3b47b215
+SHA1 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC.tgz) = 0803f566c7ab3cc4ac8bdb66f0e6e93e44f6780b
+SHA512 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC.tgz) = ac72f82075f9cd2d7a5aaa4556f0e6efcdd6207ecfd3c6eef2773281f9088fca35169b68987c3a95f8481670fbd637caaccc48a6fea450c5334e1a5a61a009ab
+RMD160 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC.tgz) = 4a8db5843d949d1d2b6c45e23313628ef2db07ae
+MD5 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC.tgz) = 7c8d15c09c139fc7445d83e669004f26
+SHA1 (NetBSD-6.0/sparc/binary/sets/xcomp.tgz) = 4671cf1becbd220fb0693d8dc580bf90fd558a38
+SHA512 (NetBSD-6.0/sparc/binary/sets/xcomp.tgz) = a37753c7f879f4d7205dfa23488b6fda40aa098cdf5d998f3b8335c487d2bffc7d9edbd57de2f12dfce586d60f2044f1617173fa6902e821a74dacc314382b98
+RMD160 (NetBSD-6.0/sparc/binary/sets/xcomp.tgz) = ed445184a03edb2cf1bf204e9cbbd04ce6f8367e
+MD5 (NetBSD-6.0/sparc/binary/sets/xcomp.tgz) = 82dc6b78584e5997bcdf436f37400177
+SHA1 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC_SUN4U.tgz) = 478f84d19aae7f5aee8ddfdb45eb9aa37a21a3d3
+SHA512 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC_SUN4U.tgz) = b9168217a02a3da991b5b3fb069097b663dea23088a529f16ea09dc12c233bc4d63b4310fbc8e26285e6bc9cd566144141898743fc8617bd9296956432b2f9b2
+RMD160 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC_SUN4U.tgz) = e9e53c86f42b75fcc12853ed2dfd5423b0968581
+MD5 (NetBSD-6.0/sparc/binary/sets/kern-GENERIC_SUN4U.tgz) = ee3736e6af879f5d4e0cc369bfa579b5
+SHA1 (NetBSD-6.0/sparc/binary/sets/kern-KRUPS.tgz) = bc69fd900a788cd8ce5d7413b4716f656814b804
+SHA512 (NetBSD-6.0/sparc/binary/sets/kern-KRUPS.tgz) = 64c42a3748d62926aa10870c08331bce20b67f6b50afd13a19a76b232b2f9f2d1c2fa04819cf88f211badbdff0cc1684ca48ca7f1c6d8f44859257764e882842
+RMD160 (NetBSD-6.0/sparc/binary/sets/kern-KRUPS.tgz) = 18df230d31af7e526b9f6fb3254061e6601a9b15
+MD5 (NetBSD-6.0/sparc/binary/sets/kern-KRUPS.tgz) = 1057e644aef74d636a558c03dd9f7e7e
+SHA1 (NetBSD-6.0/sparc/binary/sets/kern-MRCOFFEE.tgz) = 58b500435295d07ef47bd1702ce2f8c5fe798e8c
+SHA512 (NetBSD-6.0/sparc/binary/sets/kern-MRCOFFEE.tgz) = f3657cd11910995d2bf8e4140f4df4d6829311de9d5a4fa39a980af3577035ad7cc1189066aa0d9093803727b0e1405e9e2c5bbad4db8e4e172e9d5d000c2541
+RMD160 (NetBSD-6.0/sparc/binary/sets/kern-MRCOFFEE.tgz) = 91c5e94452446fb8838dfadab79d8f0c915669a5
+MD5 (NetBSD-6.0/sparc/binary/sets/kern-MRCOFFEE.tgz) = 2535895e15ea9dc1c4806df090d1bc81
+SHA1 (NetBSD-6.0/sparc/binary/sets/kern-MRCOFFEE_OFW.tgz) = cc966bc2458bae8bdd3995d423ae83707d0a0a38
+SHA512 (NetBSD-6.0/sparc/binary/sets/kern-MRCOFFEE_OFW.tgz) = 35967055f863081ef3d16144c5324ab62c2e44942100202414961a58b8b3e1243e8a2b3e2ff4d7075df0e624d9da1ff7889f8c9dc710c888f6654d8d845233d9
+RMD160 (NetBSD-6.0/sparc/binary/sets/kern-MRCOFFEE_OFW.tgz) = 5451d5da667a2a57e3af6df7119703db7a2ec8a2
+MD5 (NetBSD-6.0/sparc/binary/sets/kern-MRCOFFEE_OFW.tgz) = 8cb1f508b5103088f400e7422e23a34f
+SHA1 (NetBSD-6.0/sparc/binary/sets/modules.tgz) = 6519d6696e013f8a9e51d2856aac1390c0c3e69a
+SHA512 (NetBSD-6.0/sparc/binary/sets/modules.tgz) = 4dd5d8721c4d0733813e1fc884e9242cbf957f33ccf92fa7a8f3255bcf1af3598de843e15ad052a696cd95065251cae8a6927816c041732a6f12823657ef22fd
+RMD160 (NetBSD-6.0/sparc/binary/sets/modules.tgz) = cab574162ec0996f845835763055d6e65bb4ceb4
+MD5 (NetBSD-6.0/sparc/binary/sets/modules.tgz) = a60477fd2b83a211972512c035679276
+SHA1 (NetBSD-6.0/sparc/binary/sets/tests.tgz) = 816dc19db04ba2f95dcf80c62598f9fec7fa92ff
+SHA512 (NetBSD-6.0/sparc/binary/sets/tests.tgz) = 80c23ac0ed623404542d3e6b6e7dc8194ae876c6a0d17b250151ce6e941e874a033dcce8afa002fbe3d875b1c79687e392fa6f527fa46ec0e3c82ae31cfd5eb9
+RMD160 (NetBSD-6.0/sparc/binary/sets/tests.tgz) = 834ebf4c2126e3ec1b2226e48564ab87d7ff8da0
+MD5 (NetBSD-6.0/sparc/binary/sets/tests.tgz) = 9d0c1bd587f83df1b0090f88357f8531
+SHA1 (NetBSD-6.0/sparc/binary/sets/text.tgz) = 92d7911a1d761b73c8d2080e819705f901d1ce6d
+SHA512 (NetBSD-6.0/sparc/binary/sets/text.tgz) = 4e8e2f2abc8cf95a4672ef492e091142b6cc4a4baafddb6fc123fa5b3cc3d67a16e61ab4a7b188dac4b8ea198d8c88c1c81ffe1eca70f9900780a8a134257c36
+RMD160 (NetBSD-6.0/sparc/binary/sets/text.tgz) = 4d5ca8f6d680d3389d6b90c45875bcc4b4e962f3
+MD5 (NetBSD-6.0/sparc/binary/sets/text.tgz) = c16beb242b426177d80af90e40266abf
+SHA1 (NetBSD-6.0/sparc/binary/sets/xbase.tgz) = 2809df01d9a0aa85270f6f77341cf50d72bc78bc
+SHA512 (NetBSD-6.0/sparc/binary/sets/xbase.tgz) = 886f26f21f95ea17ef60d28fabebf415485d13647d335b237a4ee954039c7c6dfc0d9e68c06aec52ef463b6c2b7b88cd6baf514f2c5b567b8f5421c99df12672
+RMD160 (NetBSD-6.0/sparc/binary/sets/xbase.tgz) = 499a1e2a76a05fa4a0b3b53438d60b8434198695
+MD5 (NetBSD-6.0/sparc/binary/sets/xbase.tgz) = 82bb74d040bf256d711afb55db6c4066
+SHA1 (NetBSD-6.0/sparc/binary/sets/xetc.tgz) = 997196c30074dcc988f2dfa2a7f5dfc8c31df3db
+SHA512 (NetBSD-6.0/sparc/binary/sets/xetc.tgz) = 09670a40f33c9902b5b22c4400f9e8151f1985504cc1c956df68697e3bd6a7b841391d6dd32cdbba42aebf42f4a1cdd3559c5783f79da236603dc6b5cf86d33c
+RMD160 (NetBSD-6.0/sparc/binary/sets/xetc.tgz) = 50061239bbe31a4dce18784bfcece78a234e6ef5
+MD5 (NetBSD-6.0/sparc/binary/sets/xetc.tgz) = 12ae04f5957291f424568bb61a138079
+SHA1 (NetBSD-6.0/sparc/binary/sets/xfont.tgz) = 7e5ccc7436f81855bd5e20960adaddd9b9851fd5
+SHA512 (NetBSD-6.0/sparc/binary/sets/xfont.tgz) = f263bf4a2b1bc795c1c4dcaf0db819dca08e90c51b41c144911f897a991a3575dcbbac203060d8f51842c85c6e85c4839297fb7307353a38b1a46e1b446d29a3
+RMD160 (NetBSD-6.0/sparc/binary/sets/xfont.tgz) = cb721308df7413a821278143750bf95844eb4d82
+MD5 (NetBSD-6.0/sparc/binary/sets/xfont.tgz) = 9de78b2d18118d7435a6c95d8a503ae4
+SHA1 (NetBSD-6.0/sparc/binary/sets/xserver.tgz) = 0d3b410b9501560307d3b9b17a431be0da1de869
+SHA512 (NetBSD-6.0/sparc/binary/sets/xserver.tgz) = d3dceb5ebfb5085e905e8121c952a97bf7035bbd4e60898d913fbaf58c147181ae7c97f913a122e9ce83523d05a585d1e771139192d42c44fa85e60e2bed762a
+RMD160 (NetBSD-6.0/sparc/binary/sets/xserver.tgz) = fd59e7a1c949c113ec555a9ee63ab369f64559fa
+MD5 (NetBSD-6.0/sparc/binary/sets/xserver.tgz) = a89a1c519c6d6759f810717fc0ec43ab
+SHA1 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.aout.gz) = c2c368ba46549cb580707b799f4f0f88b26128de
+SHA512 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.aout.gz) = 9fb6bef663b2fb68b9bf3591834f6e653c0b3b7f69ac8c40f2479efaa5d0641140d87623fe8eeb8a21cb0e0065ceacb57d6a5db4e1905db97f7dffa52ba8b565
+RMD160 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.aout.gz) = 8fbcdca0f8214901d1fec117c567cfe93865e391
+MD5 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.aout.gz) = 1cf0fdefa01fee95d494b3418ea4a0ea
+SHA1 (NetBSD-6.0/sparc/installation/bootfs/boot.fs.gz) = e36798e87b9d195c7df8602883c775f8f4268448
+SHA512 (NetBSD-6.0/sparc/installation/bootfs/boot.fs.gz) = acd6ad2fa9c1618b4b14d6a63679e347aad6302001e36ea63c58968252ce993df23af7e05e590b72efbcdbc1013192b1862d70d7737fc2fa804249410c9d2724
+RMD160 (NetBSD-6.0/sparc/installation/bootfs/boot.fs.gz) = 986addabcfd9f0b1faccd9fed0081f88e78f2aaf
+MD5 (NetBSD-6.0/sparc/installation/bootfs/boot.fs.gz) = 93526666c7879bc6391c5b7c38b24cb0
+SHA1 (NetBSD-6.0/sparc/installation/bootfs/instfs.tgz) = 98f621b007b19382a0d529f2056cd8c82feb863f
+SHA512 (NetBSD-6.0/sparc/installation/bootfs/instfs.tgz) = 7131f92cd02791f6d351a8ea5d8b5fe93b643ba5975522e85bf81da8f69157ebb21f80f5696beca47809a9732e79e85c7e97e07a33e830eeac2f9542685a01ce
+RMD160 (NetBSD-6.0/sparc/installation/bootfs/instfs.tgz) = dc7168f774cac7e9f7eba640dc55c878ab2c16db
+MD5 (NetBSD-6.0/sparc/installation/bootfs/instfs.tgz) = 80ed52c842f1d4d56d4506d293e30b57
+SHA1 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.symbols.gz) = 673b10e3d23ee6e204bdba91b52b0b50304cb8e3
+SHA512 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.symbols.gz) = edf95ecf1f6133e5228d4f8b6a8d004c1f172354acfa34f1235a488456a69b2fd19cd959f97a0a7d06f007347815672bfce07a3ee25ae511ce73a6e5de217267
+RMD160 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.symbols.gz) = 8829961d6f2e5487af4bd4418335139d06916659
+MD5 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.symbols.gz) = 75ea54ba199fcf8a56054d15e4fb3b96
+SHA1 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.gz) = 8eb131ce31d568ee4fb0674f1732052bc686bb18
+SHA512 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.gz) = 7345380b1e2e1140564b9886e4d2afc5dc21dacf7148a5680283abc41f7249a8e8512db23ca58533ebf5bffc588bb6a28b18c7e0eb5d50c8a5a06da4043af319
+RMD160 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.gz) = 37ae0d93bd4532ff69c9187a1fd8ee3b75e97671
+MD5 (NetBSD-6.0/sparc/installation/bootfs/netbsd.ram.gz) = dc1f591b5bca88a07ff8e67a1c3dc01d
+SHA1 (NetBSD-6.0/sparc/installation/miniroot/miniroot.fs.gz) = 4e71664ebc1dc62f55992a935734fe61f52177cd
+SHA512 (NetBSD-6.0/sparc/installation/miniroot/miniroot.fs.gz) = 3cf2607774e1aa7343ed57c78034828878665e9a041561702daf18539a0775d27768ad89d9336c77d897a0f040c71c8cefdd555c00397d26fded0b6ce72c1dc3
+RMD160 (NetBSD-6.0/sparc/installation/miniroot/miniroot.fs.gz) = 39fff07e0ce17f0c62c3a399173b5a8681fa3559
+MD5 (NetBSD-6.0/sparc/installation/miniroot/miniroot.fs.gz) = 0355cc648c33e3ed61ac4ff2f51edd04
+SHA1 (NetBSD-6.0/sparc/installation/netboot/rootfs.tgz) = 98f621b007b19382a0d529f2056cd8c82feb863f
+SHA512 (NetBSD-6.0/sparc/installation/netboot/rootfs.tgz) = 7131f92cd02791f6d351a8ea5d8b5fe93b643ba5975522e85bf81da8f69157ebb21f80f5696beca47809a9732e79e85c7e97e07a33e830eeac2f9542685a01ce
+RMD160 (NetBSD-6.0/sparc/installation/netboot/rootfs.tgz) = dc7168f774cac7e9f7eba640dc55c878ab2c16db
+MD5 (NetBSD-6.0/sparc/installation/netboot/rootfs.tgz) = 80ed52c842f1d4d56d4506d293e30b57
+SHA1 (NetBSD-6.0/sparc/installation/netboot/boot.net) = af35e94ca3d3ca7e07084d17c7d16370c2be1949
+SHA512 (NetBSD-6.0/sparc/installation/netboot/boot.net) = 42e02f39699d1ef5f76a2a07641f5405b74a0ce72df8c1306cdc1bf9e8e176b0857a4c6c1098a35bdaaebb729e887633bfc91cd7ed4316ff549b474e4b29932f
+RMD160 (NetBSD-6.0/sparc/installation/netboot/boot.net) = 5f64296269674b5af481fa3a55d6268bafcdd50c
+MD5 (NetBSD-6.0/sparc/installation/netboot/boot.net) = 9a2b02686d556555bf350f6eb35e07f1
+SHA1 (NetBSD-6.0/sparc/installation/netboot/bootjs.net) = 9bba50438d03cdef774f7572e6260bf1feb544f4
+SHA512 (NetBSD-6.0/sparc/installation/netboot/bootjs.net) = afa66b734ea6f3f9551680c5dc1af1ce43de4b385eed1c732dbf22f676e5adf1432a2048a494932650e36667405df0160b3d1cb87d4d78b5d064dfab2d366cd0
+RMD160 (NetBSD-6.0/sparc/installation/netboot/bootjs.net) = b2cde57103124271b4b9332cb99a7b7e01db3477
+MD5 (NetBSD-6.0/sparc/installation/netboot/bootjs.net) = b6958131d22fe5ced08a41671ddfa073
+SHA1 (NetBSD-6.0/sparc/installation/tape/tapefile1.gz) = c2c368ba46549cb580707b799f4f0f88b26128de
+SHA512 (NetBSD-6.0/sparc/installation/tape/tapefile1.gz) = 9fb6bef663b2fb68b9bf3591834f6e653c0b3b7f69ac8c40f2479efaa5d0641140d87623fe8eeb8a21cb0e0065ceacb57d6a5db4e1905db97f7dffa52ba8b565
+RMD160 (NetBSD-6.0/sparc/installation/tape/tapefile1.gz) = 8fbcdca0f8214901d1fec117c567cfe93865e391
+MD5 (NetBSD-6.0/sparc/installation/tape/tapefile1.gz) = 1cf0fdefa01fee95d494b3418ea4a0ea
+SHA1 (NetBSD-6.0/sparc/installation/tape/tapefile2) = 98f621b007b19382a0d529f2056cd8c82feb863f
+SHA512 (NetBSD-6.0/sparc/installation/tape/tapefile2) = 7131f92cd02791f6d351a8ea5d8b5fe93b643ba5975522e85bf81da8f69157ebb21f80f5696beca47809a9732e79e85c7e97e07a33e830eeac2f9542685a01ce
+RMD160 (NetBSD-6.0/sparc/installation/tape/tapefile2) = dc7168f774cac7e9f7eba640dc55c878ab2c16db
+MD5 (NetBSD-6.0/sparc/installation/tape/tapefile2) = 80ed52c842f1d4d56d4506d293e30b57
+SHA1 (NetBSD-6.0/sparc/INSTALL.html) = 8213ae2b753d10e3eec349c15a7cabde6ae1c3d5
+SHA512 (NetBSD-6.0/sparc/INSTALL.html) = 7a12bfc31cddfda66761861cb87fc54deb5f683863b41ff44152198ea44e9489c8cce0d4702c278e2586dd3189e5c31692a02a3f17b112bfa19f1134571ff8f9
+RMD160 (NetBSD-6.0/sparc/INSTALL.html) = 77a4274595de342e22766d8c468e2a324c26fbf5
+MD5 (NetBSD-6.0/sparc/INSTALL.html) = 80cd31d110f62b89b7b910ee0aecd7b8
+SHA1 (NetBSD-6.0/sparc/INSTALL.more) = fce351f89d2da1fb9f709bbe890892db755f56c4
+SHA512 (NetBSD-6.0/sparc/INSTALL.more) = 496bb7e73d2dda1eb01518c40ab3abc767b8fb6a8b406b07176b9e926c2f4d0e5512bfdc9c26dbfa1b3a4c5069355f6ee1bb8ad8c1d459b71011ea9034f89d17
+RMD160 (NetBSD-6.0/sparc/INSTALL.more) = 89c6de032d286741f2ddde15e4b796205a8b8511
+MD5 (NetBSD-6.0/sparc/INSTALL.more) = 308ae548170c8b1b5a9bf59f64b1df7f
+SHA1 (NetBSD-6.0/sparc/INSTALL.ps) = 3e6e3cbbf8141043fce33e2245513a9683be0edd
+SHA512 (NetBSD-6.0/sparc/INSTALL.ps) = 93b81d3ba2fd2e1fa3ef46360e92e247fa72b320af7b0e60ab35fd90cdd10d7bc3dfc03920b4a8b209ef95facc74e047630cdec03cabe06edde21e795e158e60
+RMD160 (NetBSD-6.0/sparc/INSTALL.ps) = 8d4373a814dc88c7865b14a59e27731783e711e5
+MD5 (NetBSD-6.0/sparc/INSTALL.ps) = ecde0171eda632b616139caf04081ec4
+SHA1 (NetBSD-6.0/sparc/INSTALL.txt) = 556744433939c09c3ef5ee3e9b12c1570ebb1211
+SHA512 (NetBSD-6.0/sparc/INSTALL.txt) = 1686bb5982301002cb580022760f12fe9160a4fe826d7e0fe74cc4a480c891d31099d5219678b0768c0fbc04be329f0f40511d739c201a5e43367b5a27e72545
+RMD160 (NetBSD-6.0/sparc/INSTALL.txt) = cbc495189f2ce52328d87a1a73dc8452ad23e723
+MD5 (NetBSD-6.0/sparc/INSTALL.txt) = 17100faaf077e73c2549484e7623550f
+SHA1 (NetBSD-6.0/sparc64/binary/kernel/netbsd-INSTALL.symbols.gz) = b76da4e7c7cdcdbebd2148ee815c24554b0c4bee
+SHA512 (NetBSD-6.0/sparc64/binary/kernel/netbsd-INSTALL.symbols.gz) = f31c311444a309674e2718baab015b47c0139523e7996a29ab8d3e97a941b5d74be8765571bf3239375c979fff1e963d32d2dbae19ad5c7dedcbd79a8827575f
+RMD160 (NetBSD-6.0/sparc64/binary/kernel/netbsd-INSTALL.symbols.gz) = 95a34099fb1159f17619713ae37d3c6337b479c5
+MD5 (NetBSD-6.0/sparc64/binary/kernel/netbsd-INSTALL.symbols.gz) = ab2e1333f6d957074854ea8f92320442
+SHA1 (NetBSD-6.0/sparc64/binary/kernel/netbsd-GENERIC.UP.gz) = 961388f6e1c9522c0d8f19f0a471f14d3c35fef7
+SHA512 (NetBSD-6.0/sparc64/binary/kernel/netbsd-GENERIC.UP.gz) = 7b3fc655414c6c2334e46315eb91ee562b94400f5729e0a33dcc9e9a79c431b4b5e0c124541b9666731740ce365c034718671348a494c43167eb0b73966133a2
+RMD160 (NetBSD-6.0/sparc64/binary/kernel/netbsd-GENERIC.UP.gz) = e02a398cd00c0b8ab7bc3b6dbd52e767b18e3275
+MD5 (NetBSD-6.0/sparc64/binary/kernel/netbsd-GENERIC.UP.gz) = 200fd2ad96dfa6ec886585e20d4b4b06
+SHA1 (NetBSD-6.0/sparc64/binary/kernel/netbsd-GENERIC.gz) = bf5fe38aaa01c9b2e9963b540f1550562789da22
+SHA512 (NetBSD-6.0/sparc64/binary/kernel/netbsd-GENERIC.gz) = c2b63ce56ff32ddaa96642ae15a33143a245b9239560c86e51e78db333d8bfd19e761d6cbe27ce69647a62fa4c76317670f0d22aa491a2cadf45dae18573511f
+RMD160 (NetBSD-6.0/sparc64/binary/kernel/netbsd-GENERIC.gz) = 65f66c6c7f87e3be728339a1b294b4240b14b953
+MD5 (NetBSD-6.0/sparc64/binary/kernel/netbsd-GENERIC.gz) = 44d6f63922847e6f53d78f10bc776e3d
+SHA1 (NetBSD-6.0/sparc64/binary/kernel/netbsd-INSTALL.gz) = 1fe47cdf745a00c31a47faf1155eb0f9af2ec4fc
+SHA512 (NetBSD-6.0/sparc64/binary/kernel/netbsd-INSTALL.gz) = 7a10dbbdcfdcad97fec4ef476e9b6c876a3bb80b78fb4634e3f502b043b392faaf457b90ff572cc9fcf35c8c26fc908fe035b5859ed66ea2f0db490d2638f9a4
+RMD160 (NetBSD-6.0/sparc64/binary/kernel/netbsd-INSTALL.gz) = 06d3a86dbdb12e0b810888233ed79bc735ab13c7
+MD5 (NetBSD-6.0/sparc64/binary/kernel/netbsd-INSTALL.gz) = 203f7a8aad11cea65388e14dec6a65f9
+SHA1 (NetBSD-6.0/sparc64/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/sparc64/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/sparc64/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/sparc64/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/sparc64/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/sparc64/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/sparc64/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/sparc64/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/sparc64/binary/sets/kern-GENERIC.UP.tgz) = 643e8b15fb356856d93258e6c5d05cb14eb7d569
+SHA512 (NetBSD-6.0/sparc64/binary/sets/kern-GENERIC.UP.tgz) = 26c4eb3392f80d4ba7c28038f548e59a04a84742962da3340fb49d09ef42b2e3debc1387710b3c4baa6c735370b5daaa23a6f4da91f1be6552ae4c0cd314f4de
+RMD160 (NetBSD-6.0/sparc64/binary/sets/kern-GENERIC.UP.tgz) = 37e5fdfd623c179edfa002163e005518b26fab7d
+MD5 (NetBSD-6.0/sparc64/binary/sets/kern-GENERIC.UP.tgz) = 70d61e4a2588eb3242e66d0cd4cf1b1e
+SHA1 (NetBSD-6.0/sparc64/binary/sets/base.tgz) = cdce0eb09c71244d8362eb4e09c0bdbd92fb4900
+SHA512 (NetBSD-6.0/sparc64/binary/sets/base.tgz) = 455fa6b72e5735a13b3106260b7cb5cabeefd3ca83603dd9daf3805a0abe55acc6b484ad8b4875590e5d949c35b8476cec136f79f8ecfcd7b12cbeee44d6f305
+RMD160 (NetBSD-6.0/sparc64/binary/sets/base.tgz) = 13508c9d394104d0c0b460a895f796e091ca8635
+MD5 (NetBSD-6.0/sparc64/binary/sets/base.tgz) = cdafa4124cc784a56444f96fb24a7a34
+SHA1 (NetBSD-6.0/sparc64/binary/sets/comp.tgz) = 71040515074d030a65e0200afe6dbd6955251af6
+SHA512 (NetBSD-6.0/sparc64/binary/sets/comp.tgz) = 52a075300885b0d15ac960430ac3ed1ecb4434cd0bb2de216c6d8c27239011544628ad1ccd87076ac9d40d64e0c088cc2ce0e928902f80629cea11631f30e35c
+RMD160 (NetBSD-6.0/sparc64/binary/sets/comp.tgz) = 96bd6b8b5758360970d9d5b703019bf660aa56d5
+MD5 (NetBSD-6.0/sparc64/binary/sets/comp.tgz) = be2c961313f29bb9c0282516867850d2
+SHA1 (NetBSD-6.0/sparc64/binary/sets/etc.tgz) = e3bae514025003988d5de6ffcc14e130ee8da818
+SHA512 (NetBSD-6.0/sparc64/binary/sets/etc.tgz) = 2e5d76dc66495eb24d8abd5eed70cb05cfef3190e81875f0d6e6da67af962b0de0062bc4e9758859647ebc5d4334bd9bc28a20508f8ddecc7c183de8174a4ed4
+RMD160 (NetBSD-6.0/sparc64/binary/sets/etc.tgz) = 3fe88c6bd07952ad383d6ab1dbb7d6c3d5315b4a
+MD5 (NetBSD-6.0/sparc64/binary/sets/etc.tgz) = 810c7b6940fd2e8049abf4318577f5fa
+SHA1 (NetBSD-6.0/sparc64/binary/sets/games.tgz) = a40f5681634cff38215edeb22795d4e5f3f35324
+SHA512 (NetBSD-6.0/sparc64/binary/sets/games.tgz) = ff66f16eea28f3191abed7466b21d1c1969f0556cb5a9a61e5167bb7a2c4e55ed8682222a389a04d44306b39b424be25623cf8bcd41c97139960ee48ba91199d
+RMD160 (NetBSD-6.0/sparc64/binary/sets/games.tgz) = c3cc1abe005bc98e0afebadc87f0181ba1fd8d6d
+MD5 (NetBSD-6.0/sparc64/binary/sets/games.tgz) = a70797dbec20b831d406952468b8376a
+SHA1 (NetBSD-6.0/sparc64/binary/sets/kern-GENERIC.tgz) = c047c462dd890c992df60d0f23657638875f90c2
+SHA512 (NetBSD-6.0/sparc64/binary/sets/kern-GENERIC.tgz) = 79ca275266c148fa3db47ac564e8f764c75b80a8243a0a32bbd3cd3392621b47733afdedf64f3a2103a99c03ee2f63494d892260951b85949e1383d3bf8c5673
+RMD160 (NetBSD-6.0/sparc64/binary/sets/kern-GENERIC.tgz) = c0b40543a2674c1db7d554e9ad19f8e289683de8
+MD5 (NetBSD-6.0/sparc64/binary/sets/kern-GENERIC.tgz) = a9346477bd0ae3d50b4b82f8f8da8531
+SHA1 (NetBSD-6.0/sparc64/binary/sets/modules.tgz) = c24c622359c9e5f8a05c03adb30e56c8a9862abd
+SHA512 (NetBSD-6.0/sparc64/binary/sets/modules.tgz) = f2f834fded5c1142611bd5ff4ebcec67db75f620256fb27689e4cc626785a1bdf90235965e2fc4f2ee7c0ba574e73063e7f13d7f85d291dd23395074517abb9d
+RMD160 (NetBSD-6.0/sparc64/binary/sets/modules.tgz) = 6a1b6845fc699f9837a88fc3c18585162a7a0aaa
+MD5 (NetBSD-6.0/sparc64/binary/sets/modules.tgz) = e8588a8eed7bb775dfb236cfc8c458d4
+SHA1 (NetBSD-6.0/sparc64/binary/sets/tests.tgz) = 1103500cca9a6dcabfafd50046f15e035a1d0914
+SHA512 (NetBSD-6.0/sparc64/binary/sets/tests.tgz) = cc628d649f4d16af2300baf5edbf075bc43c91b027c19dcd59b6f1be0ff1b02a3f8f97eb88db2f2bcfa93f69ef02653021f416c546dcdb0f0aa5bf4726257f79
+RMD160 (NetBSD-6.0/sparc64/binary/sets/tests.tgz) = ce47518fd68d02d821bb4b4060ea3a775f64e37e
+MD5 (NetBSD-6.0/sparc64/binary/sets/tests.tgz) = 2444ea500f4f8363d339a5eb58b50e27
+SHA1 (NetBSD-6.0/sparc64/binary/sets/text.tgz) = 09bdcb54fb74d5ae4e43b5b74a6a35467e385e09
+SHA512 (NetBSD-6.0/sparc64/binary/sets/text.tgz) = 82834b26dc0a102bdb5da4744fe2677fb50a6018b34a656d7f0813919bfe66168e37b5b47ad027ee6912fb77cceaa5a1cc33eef8269eb6a8a9f42368d01b3037
+RMD160 (NetBSD-6.0/sparc64/binary/sets/text.tgz) = 376a9a61492aed41b486fa58060edcb472152739
+MD5 (NetBSD-6.0/sparc64/binary/sets/text.tgz) = 69cce7d6bb4cb104cc27f75f17da32e2
+SHA1 (NetBSD-6.0/sparc64/binary/sets/xbase.tgz) = 865d8aa735ba57980974089ee2e44d79c69cd036
+SHA512 (NetBSD-6.0/sparc64/binary/sets/xbase.tgz) = 2b7f8d15caf6a2b831bdba3e8a2d4f78633f3350d0fc93f107c35cba746c1423c966313224422832484166e384a54b1fc2c75cba78ab138bf36e81c5468c2952
+RMD160 (NetBSD-6.0/sparc64/binary/sets/xbase.tgz) = ec680d9c70f3e6729a19167932b552a727c628a5
+MD5 (NetBSD-6.0/sparc64/binary/sets/xbase.tgz) = a1907a4afda2ea247a6b54b158ac97f3
+SHA1 (NetBSD-6.0/sparc64/binary/sets/xcomp.tgz) = c0b90da52efa86aadb3af4b7de3773c29289c65c
+SHA512 (NetBSD-6.0/sparc64/binary/sets/xcomp.tgz) = d3774cc192c6ea74391dc0323db4f7e1695f290908c1ba68f885a9e670fb2c31f9a0c831a6020cd1a98e1b93691e02fadb260b26d8c6d252e9638ebf9cc0e8e5
+RMD160 (NetBSD-6.0/sparc64/binary/sets/xcomp.tgz) = 40969f50dcfbfd6948b48f819a7f84957bf14134
+MD5 (NetBSD-6.0/sparc64/binary/sets/xcomp.tgz) = 681754abde2de73609efdcbc7370dbe4
+SHA1 (NetBSD-6.0/sparc64/binary/sets/xetc.tgz) = 43c0a0b2db4bc88c509eb0d271a99e11f823babb
+SHA512 (NetBSD-6.0/sparc64/binary/sets/xetc.tgz) = 4d28ba7d6db0b7c7cb005697eabd739544bae3e3128eb29b8ce62297b26b81d944d0992a6ca3522a51bb83ca874c4a5cf844e06a7aac0a6ab26b30838016faf2
+RMD160 (NetBSD-6.0/sparc64/binary/sets/xetc.tgz) = bf885030bc65c540373a06e2b4c6257a5b634b61
+MD5 (NetBSD-6.0/sparc64/binary/sets/xetc.tgz) = 006f8b77a6fb41dad2dcbf2f28efdb8f
+SHA1 (NetBSD-6.0/sparc64/binary/sets/xfont.tgz) = adf52a9866ae0e4b1e871102f664dd42907d327f
+SHA512 (NetBSD-6.0/sparc64/binary/sets/xfont.tgz) = a02de6961b726d4f5fc291ac48a0a59d0f991ba96fd83788e766be8591e94a64eae0fdb23262f965042348516c52a173e332b8d90b21457d9089b7478273221c
+RMD160 (NetBSD-6.0/sparc64/binary/sets/xfont.tgz) = b458181e798b9b33d15ad35adfb734a0b597d042
+MD5 (NetBSD-6.0/sparc64/binary/sets/xfont.tgz) = cf37180a29cdf9bd6a34a24a8608e6bd
+SHA1 (NetBSD-6.0/sparc64/binary/sets/xserver.tgz) = 6ac9cf2e66f22ee56ef1d692e9bed5ae97092088
+SHA512 (NetBSD-6.0/sparc64/binary/sets/xserver.tgz) = b6c611b3360d537e94339536354d0a5904137b519e4debab49a93a874429a115cee276f3550a6db23ec9caeb17af3ab162999d181189311a66d65f5230a3a99c
+RMD160 (NetBSD-6.0/sparc64/binary/sets/xserver.tgz) = eb216c772571b79eb35e44285f8bed559eeb4fd7
+MD5 (NetBSD-6.0/sparc64/binary/sets/xserver.tgz) = e7994f53d2b295259dfb313f86d4fe4d
+SHA1 (NetBSD-6.0/sparc64/installation/miniroot/miniroot.fs.gz) = dcedff4706750585b89433f833cfe99fdd454400
+SHA512 (NetBSD-6.0/sparc64/installation/miniroot/miniroot.fs.gz) = 94360d4f72150432307bd097e8fa02b18bf3d63ea095b8cecfb4de863ab367c73268116681bb94083bef6445842d4718bfdeec200f57124e95c1de8dfff96b4a
+RMD160 (NetBSD-6.0/sparc64/installation/miniroot/miniroot.fs.gz) = 344981ca28094153d14b7d36321dc5e747f214cf
+MD5 (NetBSD-6.0/sparc64/installation/miniroot/miniroot.fs.gz) = 8e457a7c91b800f997cdaf6a17e79bc8
+SHA1 (NetBSD-6.0/sparc64/installation/misc/boot.fs.gz) = d5afbef3f3b358e77789ea7e9f22298a77415d22
+SHA512 (NetBSD-6.0/sparc64/installation/misc/boot.fs.gz) = aba7c9613d7a34e3b939644d37b0a8fb6c27fa0a8aa208aa729499b367f76fc6d5e1a9a06a5a779748c2d2ebfdf9521ac2fcd484608bf64ee3fa0eee8b97fd5c
+RMD160 (NetBSD-6.0/sparc64/installation/misc/boot.fs.gz) = bb8a8ed04649c3369dd5893897f7ea2ce7085739
+MD5 (NetBSD-6.0/sparc64/installation/misc/boot.fs.gz) = b9aef29dae0ef2a33611cd4655ff58f0
+SHA1 (NetBSD-6.0/sparc64/installation/misc/bootblk) = 9aee0c29c2eeb5c2e61aa9bfcd289e88c1fe1e97
+SHA512 (NetBSD-6.0/sparc64/installation/misc/bootblk) = 294708defc60602553eef0ae08ed910845b4c89ed72f33493c5fedad3737c9ae1cc96e947a11227e52505c62e04ad6d1f8f1f292df7e7885346acb824c4ea3fe
+RMD160 (NetBSD-6.0/sparc64/installation/misc/bootblk) = 28bd7d5c0fe6f33afb9627a3e3c8950ca062afa8
+MD5 (NetBSD-6.0/sparc64/installation/misc/bootblk) = 16b4c89c82c34d5795a50c811941022c
+SHA1 (NetBSD-6.0/sparc64/installation/misc/installboot) = d1cb90b57a258cef3671cc649d50aa7ea6f73f4e
+SHA512 (NetBSD-6.0/sparc64/installation/misc/installboot) = bf100237898c168e020c365da754b8a659b7cbc01ab310fd9b77a2ab60982c67e5f28cfbc7cd152ec37bc9591c1d0402c850803d57a45591282f774b97da3e2e
+RMD160 (NetBSD-6.0/sparc64/installation/misc/installboot) = 64f2ea944507466a6f5a61367e6190897cf00dc5
+MD5 (NetBSD-6.0/sparc64/installation/misc/installboot) = 7436c373285d89dc76dc705c3bbba5c0
+SHA1 (NetBSD-6.0/sparc64/installation/misc/instfs.tgz) = 3715a9104cdd1744835ef982a2a95525a5500c42
+SHA512 (NetBSD-6.0/sparc64/installation/misc/instfs.tgz) = 17a2112d5279ffd1a5889e55cf8e7081d564c330645f8c90082e324d413568db5bb58f8281a5b8e22d566b8699c326fa1661a0eb31d4b167874ea828a283bcc6
+RMD160 (NetBSD-6.0/sparc64/installation/misc/instfs.tgz) = 1065f4e43c679d182e72c654ce6a236f57350137
+MD5 (NetBSD-6.0/sparc64/installation/misc/instfs.tgz) = 75c25d3de06e50ff85364600e40380f4
+SHA1 (NetBSD-6.0/sparc64/installation/misc/ofwboot) = 42516022d9da6a2cd08daa28c5e60e68c6accd8b
+SHA512 (NetBSD-6.0/sparc64/installation/misc/ofwboot) = 1d63340007e8aefb0f0a725f444f8cd8bd62c68045c0ba6bede194f5d5f4c05a795f728ae00b4cdf65dd82cfa163c2f954ebc2a8caa54b35a908a337f1cac736
+RMD160 (NetBSD-6.0/sparc64/installation/misc/ofwboot) = 53bf739509e7c3fe2f4ef8cad8aecec6fed9fd1e
+MD5 (NetBSD-6.0/sparc64/installation/misc/ofwboot) = dfafb8bbdf16b3219ff2b38d69dffb87
+SHA1 (NetBSD-6.0/sparc64/installation/netboot/ofwboot.net) = 42516022d9da6a2cd08daa28c5e60e68c6accd8b
+SHA512 (NetBSD-6.0/sparc64/installation/netboot/ofwboot.net) = 1d63340007e8aefb0f0a725f444f8cd8bd62c68045c0ba6bede194f5d5f4c05a795f728ae00b4cdf65dd82cfa163c2f954ebc2a8caa54b35a908a337f1cac736
+RMD160 (NetBSD-6.0/sparc64/installation/netboot/ofwboot.net) = 53bf739509e7c3fe2f4ef8cad8aecec6fed9fd1e
+MD5 (NetBSD-6.0/sparc64/installation/netboot/ofwboot.net) = dfafb8bbdf16b3219ff2b38d69dffb87
+SHA1 (NetBSD-6.0/sparc64/INSTALL.html) = 0422ec241b04a9456f70ae28d29c7bc2be78b7f4
+SHA512 (NetBSD-6.0/sparc64/INSTALL.html) = 15bd5a5a0362c4412c416767608ce7b9580ebe8777ad15fa529af5a2e658a250000fa4a8d9313e2f7f718bc904518943d0ef095d8f0ba50deb50997f6a447fe7
+RMD160 (NetBSD-6.0/sparc64/INSTALL.html) = d534bc86ddea48b776c562b00bf67b686b91ea9d
+MD5 (NetBSD-6.0/sparc64/INSTALL.html) = 90c6044241bca2933db37134f775bf07
+SHA1 (NetBSD-6.0/sparc64/INSTALL.more) = 055a5f58c1a926fdc7d272cf573eddd0c868ef7f
+SHA512 (NetBSD-6.0/sparc64/INSTALL.more) = 403ee0491131f45d867e10305a65b801f95bd8fa195bfd4e95499d63ba74851774ef14f1fcc8cbd03220f973050903279438f15cb824ae2b294ead99c7d07bcc
+RMD160 (NetBSD-6.0/sparc64/INSTALL.more) = 1744bae9283a6f0e12f95e382f3bedd44bb6da14
+MD5 (NetBSD-6.0/sparc64/INSTALL.more) = c42b30d10ac37a1ac1270335414e796b
+SHA1 (NetBSD-6.0/sparc64/INSTALL.ps) = 60073507d2c04d97ccd9cbbf5fc51458cfd12509
+SHA512 (NetBSD-6.0/sparc64/INSTALL.ps) = 86c33bcc6fb6ff78056914afa17cfbd8efbea1f2100569f4169ba49d1033e4a86ea3ce49d1c5932012712bdf49bd356dcbe59aea4f8271c822482722dc08c7ce
+RMD160 (NetBSD-6.0/sparc64/INSTALL.ps) = 51b6801d68738b1606a65969c2ae3c3fa811310f
+MD5 (NetBSD-6.0/sparc64/INSTALL.ps) = bfeb86c3637bf7b5af6fcb553b62ab1b
+SHA1 (NetBSD-6.0/sparc64/INSTALL.txt) = 518f7cf7bfb65b40a409b78375c0276569ac5540
+SHA512 (NetBSD-6.0/sparc64/INSTALL.txt) = f3e1503729f62b588c53747850b7907b92d823f702ec484925d3c0173c6dd866626ef500b8b581f72d54ce4b2aa72788a5543d98c72408a5060067b832e93a88
+RMD160 (NetBSD-6.0/sparc64/INSTALL.txt) = 2716b124f107462bce88b2bc12d54d5d5aaaef81
+MD5 (NetBSD-6.0/sparc64/INSTALL.txt) = 26984ffe79eab5c070bafdc74267e26a
+SHA1 (NetBSD-6.0/sun2/binary/kernel/netbsd-RAMDISK.symbols.gz) = a1a418aa1a4815cd42b51d842b61002b4acded14
+SHA512 (NetBSD-6.0/sun2/binary/kernel/netbsd-RAMDISK.symbols.gz) = 272b8dc02294eb259adca2d15a6ea1633066c7708a1d8461d5d299bc7ff5887510fd6f20f490a781813fd61e6f95eed92ef03ba3b4f846ba4ecfe6b7a1d91682
+RMD160 (NetBSD-6.0/sun2/binary/kernel/netbsd-RAMDISK.symbols.gz) = c69407e3e5bddd21575929744fd986e7795c7382
+MD5 (NetBSD-6.0/sun2/binary/kernel/netbsd-RAMDISK.symbols.gz) = c47a2dcd2bac0d4ade29e3ceba7b8b90
+SHA1 (NetBSD-6.0/sun2/binary/kernel/netbsd-DISKLESS.gz) = c6cb928563370afd5d467adbd4d24a0ac37bc8c0
+SHA512 (NetBSD-6.0/sun2/binary/kernel/netbsd-DISKLESS.gz) = e24a4feb31212693c9c77732473107dc01cbe19c4d23a3f50a7028079f669e66c5252b9d39904e4d1daab0af8ac020b993f36f027df256a008249a8879d848f9
+RMD160 (NetBSD-6.0/sun2/binary/kernel/netbsd-DISKLESS.gz) = b3bd2f4f03f92c810f3b21d3163d4fad1383a0a9
+MD5 (NetBSD-6.0/sun2/binary/kernel/netbsd-DISKLESS.gz) = 2d2987883fb76005f8b4ca0686fdb261
+SHA1 (NetBSD-6.0/sun2/binary/kernel/netbsd-FOURMEG.gz) = 83451516991b23dddcd67b3d4aed3d4d5eef0af9
+SHA512 (NetBSD-6.0/sun2/binary/kernel/netbsd-FOURMEG.gz) = 8ea5066dcd3ab85ca812a169d2a385befcf5717e1dca01c4d5a9daae2368498c1eedcb683aa76d912be0cb6193217c33a5819d8c597521a21fd9ccc5c4f84932
+RMD160 (NetBSD-6.0/sun2/binary/kernel/netbsd-FOURMEG.gz) = f8dbe58a262e48a7a1bdddfad8bcbf4c02455f93
+MD5 (NetBSD-6.0/sun2/binary/kernel/netbsd-FOURMEG.gz) = f717bd51debc97e9efb5979b5ba425e8
+SHA1 (NetBSD-6.0/sun2/binary/kernel/netbsd-GENERIC.gz) = 89a4c10827c07a9100a4cf7692012221e6f7d99d
+SHA512 (NetBSD-6.0/sun2/binary/kernel/netbsd-GENERIC.gz) = f53dd3eaf33dac52acfcbd6657269783ca14c1a33ea4e0cdf47fe96f3a620961e07905d5eccc2e15ff75cb0910f9e47d8a37487c7a8b455db494b5690d9ce5cf
+RMD160 (NetBSD-6.0/sun2/binary/kernel/netbsd-GENERIC.gz) = dca21703d8350ff9c84920da0fe38b4e96b58c73
+MD5 (NetBSD-6.0/sun2/binary/kernel/netbsd-GENERIC.gz) = 5be2117280d7f1f78689744e44903f49
+SHA1 (NetBSD-6.0/sun2/binary/kernel/netbsd-INSTALL.gz) = 31619c78adb4831a8ae456942ee6a31c5bc0576b
+SHA512 (NetBSD-6.0/sun2/binary/kernel/netbsd-INSTALL.gz) = 08d1e00c5013bfab18920543807657eb480d54d0270d1699a9a583ac0c8fd4df0750924727ee2723c7ad6bd1c0450c5c89378c450b412ab6d6e6c8be723f2b86
+RMD160 (NetBSD-6.0/sun2/binary/kernel/netbsd-INSTALL.gz) = 3d651236509dbd65a585082b2adffa0abd47c298
+MD5 (NetBSD-6.0/sun2/binary/kernel/netbsd-INSTALL.gz) = d39784e7514b56ad37120e1accca74e9
+SHA1 (NetBSD-6.0/sun2/binary/kernel/netbsd-RAMDISK.gz) = abe6ff67ad153c993974749b41bbf6b2e207792a
+SHA512 (NetBSD-6.0/sun2/binary/kernel/netbsd-RAMDISK.gz) = 63fcbf6f7b5582b69aa77b4dcfed2125f32b40a622b2eb533eefd92bf829513488e37c4947c44e004ec8006a7e35030fb3e500f1584922101d376e9cc67dc8aa
+RMD160 (NetBSD-6.0/sun2/binary/kernel/netbsd-RAMDISK.gz) = aa2ba7c4930e6f557f809407458f12a5fe2da818
+MD5 (NetBSD-6.0/sun2/binary/kernel/netbsd-RAMDISK.gz) = 10a7099f6bfc84a63eb89985f93dfab6
+SHA1 (NetBSD-6.0/sun2/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/sun2/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/sun2/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/sun2/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/sun2/binary/sets/kern-DISKLESS.tgz) = a6ddacc5894ed442e82fc8ad75e4ba5a85acbdd0
+SHA512 (NetBSD-6.0/sun2/binary/sets/kern-DISKLESS.tgz) = 7b0afaf8fcafd005d56142659c130fa14fed8681f0907c262b52ba367db985390c1ada5b3c22705655fb8fdbdb2577f112b2e867dae8a47d30da17db9f68dca1
+RMD160 (NetBSD-6.0/sun2/binary/sets/kern-DISKLESS.tgz) = b1566d3099e8654a48e74a7f4b959d22ce72241a
+MD5 (NetBSD-6.0/sun2/binary/sets/kern-DISKLESS.tgz) = 320ebbbe9568d045ad4dc2f4284e45e5
+SHA1 (NetBSD-6.0/sun2/binary/sets/base.tgz) = cdfdfc1f6d5fd3fab1cd9e5546d1060a4cb16b45
+SHA512 (NetBSD-6.0/sun2/binary/sets/base.tgz) = d7a0059ea7babe24d603084826c5a338b33ef3ac4ce1a6039f926692141f28e32d654656a85e995aa000742f8971b33d3e4fad8dbee8a9e6b3cac2c15b9cf01d
+RMD160 (NetBSD-6.0/sun2/binary/sets/base.tgz) = 3652a11470a78517f725320750e8a61c5328510f
+MD5 (NetBSD-6.0/sun2/binary/sets/base.tgz) = 3505f44ff71277ff11e5402646e110ef
+SHA1 (NetBSD-6.0/sun2/binary/sets/comp.tgz) = 40c4eb1b75f3e903a92ea86d8919fd23a56e470d
+SHA512 (NetBSD-6.0/sun2/binary/sets/comp.tgz) = a52435520af63ae741654d81bdd5abd611857aaa19dc757bce5c841fa13b15d878780509be22a31ed893a2a4ca1c29548c5a737a2a650a7241805b518f9c70ac
+RMD160 (NetBSD-6.0/sun2/binary/sets/comp.tgz) = d51f8b1dbebe3ba6c4c3623351e647981b20f9da
+MD5 (NetBSD-6.0/sun2/binary/sets/comp.tgz) = cfdfa248cfcb4e2ae4af64f3f8a4eddf
+SHA1 (NetBSD-6.0/sun2/binary/sets/etc.tgz) = 5872a9f5eeb6004802bba9df4a0d4ec1dfccea8d
+SHA512 (NetBSD-6.0/sun2/binary/sets/etc.tgz) = 617be23175e9c578e834e039720a0c23357cd24b22639c5641a54c5b36ccb725446cda8e3c3def6e8e73c39c1f90065c348a0ea990f7a50384ba9a65ada10e16
+RMD160 (NetBSD-6.0/sun2/binary/sets/etc.tgz) = fa533eae2fafa51d8e2643dbe20be6ac179f5d05
+MD5 (NetBSD-6.0/sun2/binary/sets/etc.tgz) = ea43e005a9a50dcbbf704fa27745eb78
+SHA1 (NetBSD-6.0/sun2/binary/sets/games.tgz) = 97fe1f17370ab456fea7c21c66dabbaefbb8bf39
+SHA512 (NetBSD-6.0/sun2/binary/sets/games.tgz) = 2dfb36fb06f40d0ce519fe3808d53b8babd8bc9ae810c4fadb09e84e93e57b88b893c04cecbaf062c4ed2257eacec30127513aaca5c91ef9234da9226f366c4f
+RMD160 (NetBSD-6.0/sun2/binary/sets/games.tgz) = 6affdde9886085d8acd3bef196096dbff77fd99f
+MD5 (NetBSD-6.0/sun2/binary/sets/games.tgz) = 7eeaf3572032c8e522266e0283594105
+SHA1 (NetBSD-6.0/sun2/binary/sets/kern-FOURMEG.tgz) = 81e4d6b63aa15ea1f60604aa24a21d0eb4ddedf0
+SHA512 (NetBSD-6.0/sun2/binary/sets/kern-FOURMEG.tgz) = 117485cb1d871f3e643c009a998998885011c1d2d826ec2db092d0e3569a21fc63618a73a803332fdd936ecb30738e76f75be3e76ee17d71b190a8bb188aa873
+RMD160 (NetBSD-6.0/sun2/binary/sets/kern-FOURMEG.tgz) = 3c7e6d14f1a2a9b288f245ad0d6f115469b060c2
+MD5 (NetBSD-6.0/sun2/binary/sets/kern-FOURMEG.tgz) = f9ac31754f27f2e22aff03c5ce4e166d
+SHA1 (NetBSD-6.0/sun2/binary/sets/kern-GENERIC.tgz) = 05b5ac2735fe34a61df42c13670bf7a758b8c37a
+SHA512 (NetBSD-6.0/sun2/binary/sets/kern-GENERIC.tgz) = d5273855067665e77291f477adc2bcf482db2ac749b078502d04bc53b103977f4f16da05acbe917a97d4bba20626dd1954132939cfcf168cf8b75f5e12fe71b6
+RMD160 (NetBSD-6.0/sun2/binary/sets/kern-GENERIC.tgz) = bf5c45b36a68224af25aca91aa2eac8d213442c9
+MD5 (NetBSD-6.0/sun2/binary/sets/kern-GENERIC.tgz) = baac1013c64948cd3fb2bff22a21e5c4
+SHA1 (NetBSD-6.0/sun2/binary/sets/man.tgz) = 9bb0fc4bb2f60df3acbdcbd6d03d11e52227c70f
+SHA512 (NetBSD-6.0/sun2/binary/sets/man.tgz) = 3bdb75b91c18982b39f2c2842d9260749491f16c6da624510c603ef0e897298f6ecd620a63a96ccf21354f6a4008b4723249635280e4e956a4668d1984faf7f5
+RMD160 (NetBSD-6.0/sun2/binary/sets/man.tgz) = 3b28f01096b5070887994e84b171cd6c59f0ad94
+MD5 (NetBSD-6.0/sun2/binary/sets/man.tgz) = 06cfb9c81392e3ae7b04daa01475db38
+SHA1 (NetBSD-6.0/sun2/binary/sets/modules.tgz) = 0ff7c443e874d15372f107b6772b5004ee0ff6d2
+SHA512 (NetBSD-6.0/sun2/binary/sets/modules.tgz) = ad3913a8edf4494515dab3a4df4a56799f7cb2cf335ca9e4cf78e61a8b92f161cf2148ea2201ce9e9a6966872c5ee749b69642205ef4fa475aae1b3671e49d69
+RMD160 (NetBSD-6.0/sun2/binary/sets/modules.tgz) = ecbeaeb92cd60504c907b743ebf8bc729483eb35
+MD5 (NetBSD-6.0/sun2/binary/sets/modules.tgz) = 94f595d3a8f52f8b7b202c1715896b1e
+SHA1 (NetBSD-6.0/sun2/binary/sets/tests.tgz) = 4651980ab126f0fb7fa3282e401fed649129dd46
+SHA512 (NetBSD-6.0/sun2/binary/sets/tests.tgz) = 4fcec0fde688d32f2f53d0c3d6ec9218a2c670f0006b421ab907098f7210481d0ef690d9e8415dd5201be799f83b303a8a2a5b4f8b35af16b311b4996a353b93
+RMD160 (NetBSD-6.0/sun2/binary/sets/tests.tgz) = d260affd3d3656aa73171aca7e8f40f2f502a645
+MD5 (NetBSD-6.0/sun2/binary/sets/tests.tgz) = 801c9c531d070d152c1f259dd1111f64
+SHA1 (NetBSD-6.0/sun2/binary/sets/text.tgz) = b76b4bc516bd7a1747415f9bdbd6af7370cded48
+SHA512 (NetBSD-6.0/sun2/binary/sets/text.tgz) = 5654c7217b9d02e327c7803de1dc67d5df4225d1399c3c0a433728fb2fc124ddf0fb2e8cc89d304e03a7c1104a1e1b6ff665b5b29825e3afb0acb43f37fa327a
+RMD160 (NetBSD-6.0/sun2/binary/sets/text.tgz) = 89f288a449a1049aabef74f6033bf00611123bf7
+MD5 (NetBSD-6.0/sun2/binary/sets/text.tgz) = bc500c71253fd2e2b3bb1dac2bf2b738
+SHA1 (NetBSD-6.0/sun2/installation/miniroot/miniroot.fs.gz) = 74ae5c6fe766a40a9bf149885809186bdaae96ff
+SHA512 (NetBSD-6.0/sun2/installation/miniroot/miniroot.fs.gz) = 4c7ab73a13c13b3b4cd7a01e12ca25d7a385691dee2b830fb94885c9eece4e62c45cdb9e3961b5426f0e979b2e0f2e951c52774231129f824787ee6daa8d8ed1
+RMD160 (NetBSD-6.0/sun2/installation/miniroot/miniroot.fs.gz) = 032b6ddf1452800c8f824983c6d3c1310ba723dc
+MD5 (NetBSD-6.0/sun2/installation/miniroot/miniroot.fs.gz) = 6d2927b0648b018b2726f7159e60a911
+SHA1 (NetBSD-6.0/sun2/installation/netboot/bootyy) = f97ac30d2c6258791d64d408e295cc2f48e7892b
+SHA512 (NetBSD-6.0/sun2/installation/netboot/bootyy) = c0aa6a81071323564d4445ae06b9e0629b32b118bf6c516e28109d3c2d7a72613b8a2005b6f968a43acc6115e3edba57f15c314b77a774cfbb977ff668dd946b
+RMD160 (NetBSD-6.0/sun2/installation/netboot/bootyy) = 3de2112b92a222b55ffeff2d5930ed5eccf70a7a
+MD5 (NetBSD-6.0/sun2/installation/netboot/bootyy) = 7a6fce60607e791e1c40186b0b7a5403
+SHA1 (NetBSD-6.0/sun2/installation/netboot/netboot) = f0ab4e961148d2d8885a47a4fd1b2bc1350e4978
+SHA512 (NetBSD-6.0/sun2/installation/netboot/netboot) = b462fb05ea093921b40a1042c15b0013a848c7b022f22523e3dfe73e0141b35982d26825812604bbfcb735f8851fafe9709979d90fb1db21ee552f0e93db6a86
+RMD160 (NetBSD-6.0/sun2/installation/netboot/netboot) = c7c6416042d8ed641a8ed033541a7757492229ba
+MD5 (NetBSD-6.0/sun2/installation/netboot/netboot) = 52d961060a7035f07cb1946d71736289
+SHA1 (NetBSD-6.0/sun2/installation/tapeimage/MakeBootTape) = 1c24969b0bded7ed9bed7203e9c577d896d25566
+SHA512 (NetBSD-6.0/sun2/installation/tapeimage/MakeBootTape) = 33eeb495736ac60dabd87faf803defa85f2e400f49b1b4078c16aff18404673a7e668676dc90eb92dc597835ccac8abe26fb68ecb22ddc5afd5afd7de8f2d680
+RMD160 (NetBSD-6.0/sun2/installation/tapeimage/MakeBootTape) = 234492df364f78e2aef3c9cd8ac4496077ba2760
+MD5 (NetBSD-6.0/sun2/installation/tapeimage/MakeBootTape) = 924860ba84acf16d29a70783d6e106a3
+SHA1 (NetBSD-6.0/sun2/installation/tapeimage/MakeInstTape) = 75b8d9faa2e1960a48354922aef5c25c76f66ee6
+SHA512 (NetBSD-6.0/sun2/installation/tapeimage/MakeInstTape) = ba61feb33064bdb843f8cd563135cc8fe28e9bbbaf8d1ac2eba2c5e1ad083daba83b47295f3c677caa014c9be7606ef6a40a6c1bc9b07e4eaed139d8299be97d
+RMD160 (NetBSD-6.0/sun2/installation/tapeimage/MakeInstTape) = 198879d5058f7ee226c4c669f3a7429bb49c12ce
+MD5 (NetBSD-6.0/sun2/installation/tapeimage/MakeInstTape) = 58a95592c402c3f752f4c801fa3d20a7
+SHA1 (NetBSD-6.0/sun2/installation/tapeimage/tapeboot) = 1612942dd5bbca5773de6ac02723ea898ea4e172
+SHA512 (NetBSD-6.0/sun2/installation/tapeimage/tapeboot) = c5b75882d4b9041edfd74cbf9dc4df8393e687503043e77af766452d780cc8a5584b916d0a792748730e9c87bd52803bbfc0a043720e611079a5cdcce6243bff
+RMD160 (NetBSD-6.0/sun2/installation/tapeimage/tapeboot) = 61a36a8d1737147b7b4587353f974c87fca2b442
+MD5 (NetBSD-6.0/sun2/installation/tapeimage/tapeboot) = 751ee54f544a63177c273ea6757dbdc0
+SHA1 (NetBSD-6.0/sun2/INSTALL.html) = 40cf15ad864adcc8d6216b9d4220cc3eab1463ff
+SHA512 (NetBSD-6.0/sun2/INSTALL.html) = 0992031a6cae198c16b08553e94277a39b34886cf0bfea343b95493439d79868cd50a1c2b9f2ce9852068b43beb7ee2a2016480c3ea452b9d62a25b71c72d567
+RMD160 (NetBSD-6.0/sun2/INSTALL.html) = f7aaba481555931612488d204c9a256899f04efb
+MD5 (NetBSD-6.0/sun2/INSTALL.html) = ccf725a8f39711748946cc414f688dde
+SHA1 (NetBSD-6.0/sun2/INSTALL.more) = 21b6ecc61f6d15fd2b54511150b840b242996f02
+SHA512 (NetBSD-6.0/sun2/INSTALL.more) = 5c43f22fe85470c7069ea524ff18570a1a3605a956157d9f662cf8b76fa6f52e4eef41e765488ae00b491830cde3b148254ed5bec6b20db0f5661d29ff0f7fce
+RMD160 (NetBSD-6.0/sun2/INSTALL.more) = 9adc2008a6388ec7ce907c23ac6f1de1f941c979
+MD5 (NetBSD-6.0/sun2/INSTALL.more) = 79afb0a5f30435a2731e455a85884a28
+SHA1 (NetBSD-6.0/sun2/INSTALL.ps) = 37c7ffa52cf698e058442a61d937a0ad09fa0156
+SHA512 (NetBSD-6.0/sun2/INSTALL.ps) = 09998f504688d7144d223f857edd4273bf00c1c50b1ec47294db2be1abdc050cbf73d0037c0b88279fb1028fde2556bbcadc2d4fbb7466834385905c46f3d688
+RMD160 (NetBSD-6.0/sun2/INSTALL.ps) = cac0f152af9ddd8fd643b2578688e7db03a3deb5
+MD5 (NetBSD-6.0/sun2/INSTALL.ps) = b2a094aacd3846aa4c121629daa938fb
+SHA1 (NetBSD-6.0/sun2/INSTALL.txt) = 90377374ac7c61d0fb6bafdaecd790a86fe7a447
+SHA512 (NetBSD-6.0/sun2/INSTALL.txt) = c37c159387cdfa0f40268a16c5a55cef0473b31f51e5c978ec948fe4964d3e9574dd9bbbd758eccb9304a9af6d8216b38aa256676a36537b480a5606b2cb1fde
+RMD160 (NetBSD-6.0/sun2/INSTALL.txt) = b16dee40608a6b8e8022df13c27783e34e48279f
+MD5 (NetBSD-6.0/sun2/INSTALL.txt) = b33826d2ef20420c36a3723256cd4488
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-DISKLESS3X.gz) = 08ec51564fa19e69828a501a60ac05c687f8471f
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-DISKLESS3X.gz) = d31891f04947a6295085ee899ccb5d532b5e50eb66d1c4f7f7779aae9a1c711b54e142c1d26f45ce10f6ef6815894fe545b436d40cc0ba05149e02885981f029
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-DISKLESS3X.gz) = a71a82ee59a431dd5c7a6d5100d84fd264ca4e4c
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-DISKLESS3X.gz) = 261995193793314b7306c5753aed0e23
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-DISKLESS.gz) = 941fbb0e064253228f04d4baaa8e2db4a09b8d88
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-DISKLESS.gz) = 2013168c4985c258bd2f605cda56dd678c394580edf2afa1fb37fd243b748b4d50e049a2f4b314ee5b70f30d181ec684d886094258115a0cdf0e485c120a2628
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-DISKLESS.gz) = 6028696adecea1922e0bdb1d757a4d70725c3639
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-DISKLESS.gz) = a49e05dd12628e1fcf1a30e8815ea72e
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK.symbols.gz) = be5066fcab92b01e828769c3766ac902896a9dae
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK.symbols.gz) = cc0f0b30fa4b28c2fbaf9229568530ee61e17b9ec8515242e53d4d6ac32d1f3ace313c4d138ff173a2301e208ded7389e93551a4a05d7f9a5bf536a8566c2de2
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK.symbols.gz) = 832199c94540e3274e2376b17e23144cf99af3c7
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK.symbols.gz) = fb76fe7920f7c1e0138270f64dd90315
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-GENERIC.gz) = a1458c3d482f170ce26ff1b4ae12fcbe82206cd0
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-GENERIC.gz) = 703f16ca7fb7cddbf33e84bf7859d73ad619464c859927767e6f3e292c63b7da65ed90d20a32cb7364f425c41aff05e0a08f7ba4e7bcfaa04804f4389425d402
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-GENERIC.gz) = 5a542bbb7c45f6940f5c9a63deba729d2d6e8b75
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-GENERIC.gz) = 28729a3aab91b7b81a0bb5af1378c67c
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-GENERIC3X.gz) = 50f6f8937a0b18960660908aea8a5cd490175077
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-GENERIC3X.gz) = 2798612a5e0d6d60f80dded7a22bdd6c1f5a64709b65fa33bfe8dfa873c38da0269b0a080185efe2025b5682ba9fd18bb3063a1133f8227cdc41acb03fc4bc2c
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-GENERIC3X.gz) = ecd36a3bb10a07cb7dacfd2a8add6b4e51eddcf1
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-GENERIC3X.gz) = 63a3954b02444ee35ebdfc8a280c6eb8
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-INSTALL.gz) = 2da156899061f57aabfe77a55081e1281cc46107
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-INSTALL.gz) = a316b1fb791d3df671cf366c911756cd9e87735247eda75372d73075bd8ec8bfae4aba620740f86cfe8011ffe0614777d480d4979ca021912702ce5699865244
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-INSTALL.gz) = 51a1809d8ddf6701d556d858a18416a72afb0f37
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-INSTALL.gz) = b4a756c7502efd5883243e26139d206a
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-INSTALL3X.gz) = 78f041430b2aafc6768aef55603c4427f90c44ed
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-INSTALL3X.gz) = be3a7f26745d4693d2393f0ee044871dca2ec554f8897b7ec54bba85ff3cd75143a548fa0880bb76810d2811018c9c3b5e8cc44fbe163588b82c0344a2f0cf81
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-INSTALL3X.gz) = 9d21135a1448a6fdc1fa052c56434cf809e43046
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-INSTALL3X.gz) = 0ff6857605eea16d5d90a85b77335229
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK.gz) = 6f90c82aa6150d861190e41dca228549cedcc458
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK.gz) = e4e4f5901d286b164f9e4b471f6084a6ba879c91b21b4e86f44650ccf0447698a11f33008d75cb3e12673396094d91e2d715e24b596727cb97c125340fa82abe
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK.gz) = 13e4983150a8508d64c022000d27b77c1e0da384
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK.gz) = 6ce2d84c334909c66b0d54b928fdcb2d
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK3X.symbols.gz) = 6c31ae63d1149ae040b2f04fdcce0f41aa8095af
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK3X.symbols.gz) = f986b22aef0685dbb454c95d9f0f6b7379a15b365f56f3a13e1357b8b2bf7fb787b09eb4b474d06dd78e6869152e6493177f911929f972a819f688af90854d1e
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK3X.symbols.gz) = 18640447fceaf27b7ebfd19917bf40521718c441
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK3X.symbols.gz) = 639d60631052afddcfb58f64847964c8
+SHA1 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK3X.gz) = 78efb67e8cb813af99a12a1c67c9238916bb1071
+SHA512 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK3X.gz) = ef27cfba56aff6b13544132e71513598e68e488cb27b7038442279eaec9d6a715cf9196ce98d93acfc4a7e89cb679e5ce787f7c4b14a661a2113b1a987861a9f
+RMD160 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK3X.gz) = 556c68e9415f0795d58c4f8c491eed75755a59fa
+MD5 (NetBSD-6.0/sun3/binary/kernel/netbsd-RAMDISK3X.gz) = ff2a3fad6f6dd6504713e5874b3eb8cb
+SHA1 (NetBSD-6.0/sun3/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/sun3/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/sun3/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/sun3/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/sun3/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/sun3/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/sun3/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/sun3/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/sun3/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/sun3/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/sun3/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/sun3/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/sun3/binary/sets/xcomp.tgz) = e13548b8974f5d55e98caf17b2b4bbbcf2430370
+SHA512 (NetBSD-6.0/sun3/binary/sets/xcomp.tgz) = e4b13c798df04ffef88e72100e2db5af400e5ae255cd7a1ca2907736b8138a59045b6f3bd8531b5753d0b87eadb1b5f801043a929bb25d1611e4be693c1da954
+RMD160 (NetBSD-6.0/sun3/binary/sets/xcomp.tgz) = 3b1f4e26ddd57e69afd9709553c1bf70d6e29ea0
+MD5 (NetBSD-6.0/sun3/binary/sets/xcomp.tgz) = 894bb9aa05b164d9923682165d708335
+SHA1 (NetBSD-6.0/sun3/binary/sets/xetc.tgz) = d2ca34bd668e108cbbfd4b45720823663339f8bd
+SHA512 (NetBSD-6.0/sun3/binary/sets/xetc.tgz) = 431ca465f300e7eb5d4dbd44c43e412a296fb4d3129217e752f86a720e8a8bdf736c9add05a45518a4f3e6cffa32381ef61e9186d360b68a5f8c64d87e385fb5
+RMD160 (NetBSD-6.0/sun3/binary/sets/xetc.tgz) = 4c5d664679856b02b694534cd6afdf20597e6d53
+MD5 (NetBSD-6.0/sun3/binary/sets/xetc.tgz) = 72bd67556ac14ea0ce147374af0ba624
+SHA1 (NetBSD-6.0/sun3/binary/sets/xfont.tgz) = 24ca4cb77a59246b1b05e0a91fed21c63259d12b
+SHA512 (NetBSD-6.0/sun3/binary/sets/xfont.tgz) = 8dc297fb6205a995767e68e77cc21169234dfb66a86bbcd2e1828fd32efeda0a25c9f2a9b1a39b97fe8d7b24f8cd5cf6160859af6be2259876f39ee4e76c405b
+RMD160 (NetBSD-6.0/sun3/binary/sets/xfont.tgz) = d2f134959940e6667aca185f01e388c05dc6bc85
+MD5 (NetBSD-6.0/sun3/binary/sets/xfont.tgz) = 3c96c1f0a13cd7d277ca35622ac9c058
+SHA1 (NetBSD-6.0/sun3/binary/sets/kern-DISKLESS.tgz) = 00b387b99dc84b6128941ae2b849feb76c7f88c8
+SHA512 (NetBSD-6.0/sun3/binary/sets/kern-DISKLESS.tgz) = 0b2cf325d14f69c5905bd6d832adfdc806bec302780811c6ad50ecbb646de07d1e91dd0cf16873b0128a44688f9e810d83ae7c6a4415b8393ea0567fe77d5f32
+RMD160 (NetBSD-6.0/sun3/binary/sets/kern-DISKLESS.tgz) = 71913a5ec9bab31e74ff27ab154715fd84b34a96
+MD5 (NetBSD-6.0/sun3/binary/sets/kern-DISKLESS.tgz) = 6988897d69e304577b9f493c44425ddb
+SHA1 (NetBSD-6.0/sun3/binary/sets/base.tgz) = 43ba28352421316629ca0c4a93709af5e5b588cd
+SHA512 (NetBSD-6.0/sun3/binary/sets/base.tgz) = 1b0efd643066d4cc5d689a64ba97092091ac8b94ac5244ca7955b27aa6ce60eaec0f020390d9ed60c00f894312fce76d1ca0555ac4626a4c5c140beb57b97ba4
+RMD160 (NetBSD-6.0/sun3/binary/sets/base.tgz) = 46456971e8d821c310f3ac304fcda320396916be
+MD5 (NetBSD-6.0/sun3/binary/sets/base.tgz) = ed8d7947e7e5282728b94a7fbae41ea3
+SHA1 (NetBSD-6.0/sun3/binary/sets/comp.tgz) = 960167513f2de6e53e0512ba9d8a8fa891d7f096
+SHA512 (NetBSD-6.0/sun3/binary/sets/comp.tgz) = a6d2d94ad9a752263254736253c7be190d2baa69140ca1e40c06719dfb89dd5660fa83c72392b2c5b30c0caee058cb049029b8414fdd48017fba2615781dc08b
+RMD160 (NetBSD-6.0/sun3/binary/sets/comp.tgz) = 9d995295dc5806397c31541ccd589210c0f675b2
+MD5 (NetBSD-6.0/sun3/binary/sets/comp.tgz) = 3f277a5219ca41a91776606698660e31
+SHA1 (NetBSD-6.0/sun3/binary/sets/etc.tgz) = be0c7f05a0122f7fa7e2bf1cf643080c5b434c1b
+SHA512 (NetBSD-6.0/sun3/binary/sets/etc.tgz) = 64d9a05110471e97c99c53479a14ba17dedd7c42f1471e26e2b8e73770d94a27b77ca12ab6cc014f8c131fb6757a26a565d4b8c71e78cab8dbbd21608fa76c33
+RMD160 (NetBSD-6.0/sun3/binary/sets/etc.tgz) = c4c29b032978e5a6f803c353d4d5b5ab4c58985d
+MD5 (NetBSD-6.0/sun3/binary/sets/etc.tgz) = 68851b8898496b07817e828fee991233
+SHA1 (NetBSD-6.0/sun3/binary/sets/kern-DISKLESS3X.tgz) = a63f54a0db8362478ef1f3fbbc18060e3834723a
+SHA512 (NetBSD-6.0/sun3/binary/sets/kern-DISKLESS3X.tgz) = 5ff8b7a463fc5e0edd17f47d2c59a01f9c53f23db8e73ba7bb0e67c73cd84d2688a22aa8e6b56bdccc29a0056fafeb6c984ea6a34a01e454a93d62eb2c54b623
+RMD160 (NetBSD-6.0/sun3/binary/sets/kern-DISKLESS3X.tgz) = 6ff482b8e336432022ac05a24c376d746fe7f8e8
+MD5 (NetBSD-6.0/sun3/binary/sets/kern-DISKLESS3X.tgz) = 1f49b690f568492ba1d2ff5cfd76ec6c
+SHA1 (NetBSD-6.0/sun3/binary/sets/kern-GENERIC.tgz) = 9eb75c58a99f7b046dab7888235bf8162b10834c
+SHA512 (NetBSD-6.0/sun3/binary/sets/kern-GENERIC.tgz) = 9cdcf4835398df2124cc418b977f1cdffaa87d4edaff2c61ded06b44cbd5aa656743e74abd4b5ccd5f7232e0890f4786523d4438feed288bf77df1482fbbb9fd
+RMD160 (NetBSD-6.0/sun3/binary/sets/kern-GENERIC.tgz) = 8a50ed11d968a35170c50ddfcd51c3cfeaa7dfc0
+MD5 (NetBSD-6.0/sun3/binary/sets/kern-GENERIC.tgz) = 510f2e6a9de0cd18e8dfc6cce74964d2
+SHA1 (NetBSD-6.0/sun3/binary/sets/kern-GENERIC3X.tgz) = fc31315a9d236278dc8b6dda1e1385680e35eb4c
+SHA512 (NetBSD-6.0/sun3/binary/sets/kern-GENERIC3X.tgz) = 9de034f2f6ee9cf0c65ba4fc41bf7147205c9918263131957d8555c7d54997d98dead2108ec2fac89805d371e673bd66abb93715b61f3c7a71c9db8caf761c40
+RMD160 (NetBSD-6.0/sun3/binary/sets/kern-GENERIC3X.tgz) = d1b03f8e7188324e362e4fbd7764d4218a3a98d4
+MD5 (NetBSD-6.0/sun3/binary/sets/kern-GENERIC3X.tgz) = b8b84407a1e0d4e215a494aee08eafa8
+SHA1 (NetBSD-6.0/sun3/binary/sets/modules.tgz) = 7c6df8904730e2b7d3ea7e98d3a88ee7450e937c
+SHA512 (NetBSD-6.0/sun3/binary/sets/modules.tgz) = 95d55d7951896249f4b1b3c38ba80c75c415ffee77e3294f40f8680756cb1cd5b5c2b74740ccd66f218474f220f9603feb81bf9e6d72fa130a9ec3c595abba63
+RMD160 (NetBSD-6.0/sun3/binary/sets/modules.tgz) = 485905b274e58b342035d5485507e7c018ee62f0
+MD5 (NetBSD-6.0/sun3/binary/sets/modules.tgz) = 5350f1aec24cf27edd1c4d50c916ba33
+SHA1 (NetBSD-6.0/sun3/binary/sets/tests.tgz) = b76bdb5e8311a0fe1f22aab836007d5cbaf92618
+SHA512 (NetBSD-6.0/sun3/binary/sets/tests.tgz) = 475835a862280be0709e09a8ea5eb132d8c068c63df12dcc925ff3268250afbde228b593f66061d2b946dabc19eeebbb1a4fd313a751c4e5fd8a63ba63f2fdc4
+RMD160 (NetBSD-6.0/sun3/binary/sets/tests.tgz) = 58e77c597950e782b3c75967d864ebbc961ffede
+MD5 (NetBSD-6.0/sun3/binary/sets/tests.tgz) = 729752bb47500babd316c4776ba02e80
+SHA1 (NetBSD-6.0/sun3/binary/sets/text.tgz) = edf2e1f8352a2c45287ecff9c473da4673473a6f
+SHA512 (NetBSD-6.0/sun3/binary/sets/text.tgz) = 2098084f46640c2f45b0fb916a2123eacc2e390faaa04e3a8ea99d93f41c4ca5ba77d4192805b13a053ad8262aecccc2228448c9f048c03c96ca51869f342ebd
+RMD160 (NetBSD-6.0/sun3/binary/sets/text.tgz) = 1adc9b33d9aec637e1f8e7888f07076d500b2ea6
+MD5 (NetBSD-6.0/sun3/binary/sets/text.tgz) = 60c2eabb16dd9df538a98153e2dc7dc7
+SHA1 (NetBSD-6.0/sun3/binary/sets/xbase.tgz) = 404b75757bcc91b281fbd5ec9b9333e6c106579d
+SHA512 (NetBSD-6.0/sun3/binary/sets/xbase.tgz) = 0f1604049c7e1caac48d610304a1490d2e55dcf3f6a325139eaa57a38211836c479b1dc070cc3b8b0afcdddac7a84b679d96330f65f86015a80b7800fdca633e
+RMD160 (NetBSD-6.0/sun3/binary/sets/xbase.tgz) = b1e258608f09cd175c9e15844371daff5fe0f027
+MD5 (NetBSD-6.0/sun3/binary/sets/xbase.tgz) = a7ecfb2c66b224ecf2460fe5c6715f0b
+SHA1 (NetBSD-6.0/sun3/binary/sets/xserver.tgz) = 88091f11f474465d1a996569643d6e22cf08f717
+SHA512 (NetBSD-6.0/sun3/binary/sets/xserver.tgz) = 36de7d4b8be72d53d5f90a144d278359da55008917d2747419d3347d53989e9ceca6230fb2596d4ce6257d1bc9f171c6b9a8e738af86930adc8535e726a8e356
+RMD160 (NetBSD-6.0/sun3/binary/sets/xserver.tgz) = e161f48499d8f1ca64b22d65365704f65344875a
+MD5 (NetBSD-6.0/sun3/binary/sets/xserver.tgz) = 6ed6442ab169c491e991c8074512bb48
+SHA1 (NetBSD-6.0/sun3/installation/miniroot/miniroot.fs.gz) = 8b01f52ec164477fb5ec72725d941e3330c7da94
+SHA512 (NetBSD-6.0/sun3/installation/miniroot/miniroot.fs.gz) = fb6995a81aeb2f9fb89e096290cf0921e92b1b2be0adaf95dd2b62c89bbd047b0879231d4e5805a68bd023026ce563bf6f0fc3214ecfabc449650dee9790385f
+RMD160 (NetBSD-6.0/sun3/installation/miniroot/miniroot.fs.gz) = 54d3f3d3782536c89d2b6bbf6abb793617c83925
+MD5 (NetBSD-6.0/sun3/installation/miniroot/miniroot.fs.gz) = f9994dd6a5b9837915a4ff01a7c9baa2
+SHA1 (NetBSD-6.0/sun3/installation/netboot/netboot) = 88a9ccc7444c4692483705ef90da4af422b33497
+SHA512 (NetBSD-6.0/sun3/installation/netboot/netboot) = f0810823fbe7335cc83516a71bdf4d5ab281fc2fb71309d76cb979e741af00d81b55e4b298af07e4932ec8e70a79518ace9af7ebc3b5d8a3328555785a8c2d2b
+RMD160 (NetBSD-6.0/sun3/installation/netboot/netboot) = 57b89f091bf51dfda7a3b1b3e92bdd0c7e96e958
+MD5 (NetBSD-6.0/sun3/installation/netboot/netboot) = 9041ee544a0625228cbbb93e06d2961f
+SHA1 (NetBSD-6.0/sun3/installation/tapeimage/MakeBootTape) = 2b66897333fbeba29a086477f6d25026b6d60e55
+SHA512 (NetBSD-6.0/sun3/installation/tapeimage/MakeBootTape) = db9307323e7dc0d394fb2b8e012c86df51109357851f2c5ee7894468d4e3b54465ca5015141621fd9d28aeb7a2eef0beac987fc7faeee223f9571ff4589d1036
+RMD160 (NetBSD-6.0/sun3/installation/tapeimage/MakeBootTape) = 986f20c8bab33006ea857b9f925b964ab43b9b03
+MD5 (NetBSD-6.0/sun3/installation/tapeimage/MakeBootTape) = 68ea84a134fa2781294912ca85d4b1ee
+SHA1 (NetBSD-6.0/sun3/installation/tapeimage/MakeInstTape) = a242866885b14ec2e624319b2fe1fc4f940a422f
+SHA512 (NetBSD-6.0/sun3/installation/tapeimage/MakeInstTape) = bd5950ce181ae973784c56bed18085fdfd6fd8b1a46d83564c798c130bc265f7a811cb896be8b9f8f78f014aa1a1d37e34b307a7f806ad8f7790ce2308856b61
+RMD160 (NetBSD-6.0/sun3/installation/tapeimage/MakeInstTape) = cb0330a75c5b5fa600e3789d81ff75f1c1d81078
+MD5 (NetBSD-6.0/sun3/installation/tapeimage/MakeInstTape) = fdc38b08d909159925b6a4efca11a498
+SHA1 (NetBSD-6.0/sun3/installation/tapeimage/tapeboot) = 276be9760458783489c93cea994dc73289ace945
+SHA512 (NetBSD-6.0/sun3/installation/tapeimage/tapeboot) = 7d6f1a348f99e42960f1697105d2771228a921860b0bd78624e96efcd9dde839412511e414f824ea78f4d5c938141c96d896acb3af426fbb393bbc69825c6c57
+RMD160 (NetBSD-6.0/sun3/installation/tapeimage/tapeboot) = 585b74fc55271ea82d4c2e3a38cd3bd7fc9cebd4
+MD5 (NetBSD-6.0/sun3/installation/tapeimage/tapeboot) = 6e786930e4f263c8fd65c0684b10f17f
+SHA1 (NetBSD-6.0/sun3/INSTALL.html) = e1f85d7f20325efe213999b96d606094b64a2c3e
+SHA512 (NetBSD-6.0/sun3/INSTALL.html) = 571b45b18a5fa33d705470440bfc49b38b19f5625aa26b79241f27232a4e902c1689e6acfa563d95204a6bc5a9955565fdd915673db770f739003c8838a7b680
+RMD160 (NetBSD-6.0/sun3/INSTALL.html) = 10984fb54cdde46e9dfe3567fff0a41e2f2fddfa
+MD5 (NetBSD-6.0/sun3/INSTALL.html) = b221aa68f0c0063c7d4ceb493971636b
+SHA1 (NetBSD-6.0/sun3/INSTALL.more) = 3f54bfd9cb004fe817d400878e005dd81f1d2850
+SHA512 (NetBSD-6.0/sun3/INSTALL.more) = 6b56e0d51f7423f74aa64a269fe9a0787b0a71d54f8582242d874066df05cc6bb4840ff6d3fd2817f4919b707ff621ca00a77f32938ece1dada70d8a3e6eedef
+RMD160 (NetBSD-6.0/sun3/INSTALL.more) = 40aec024ba64af07553ff888f3140e1e6793ac68
+MD5 (NetBSD-6.0/sun3/INSTALL.more) = 9c67417a5a30c173b09f1a8b518032d1
+SHA1 (NetBSD-6.0/sun3/INSTALL.ps) = b83169ce92b3dc6bd83a1ca5e858120f8b91db45
+SHA512 (NetBSD-6.0/sun3/INSTALL.ps) = 546cc770038d3194ca5dfab82113644f6b4fbb5930b9560c14550234858d0bb0edc7fe1fe24d44413042dc7f2c64dc5e4002f3fb60b9893c76f0b80dbe02ae02
+RMD160 (NetBSD-6.0/sun3/INSTALL.ps) = 1110e213ad092c715e1c5314d9c11d4e4d0cd977
+MD5 (NetBSD-6.0/sun3/INSTALL.ps) = 848bd14e183958c567bdde20345d9b7b
+SHA1 (NetBSD-6.0/sun3/INSTALL.txt) = f37f80d7db1daf78f66d91f7f76ac9caecc69d65
+SHA512 (NetBSD-6.0/sun3/INSTALL.txt) = aaa6abd3508681ed137796f3f64187fe0e9c7ec26f0d0f81ae73a4e2853ef5aa6b70e861ba69fad5ab51d62f1b09440a0f3f033ef2443a8b12ffc2129e5efdb1
+RMD160 (NetBSD-6.0/sun3/INSTALL.txt) = dfcd996574e4d266e95640301662f4928e3a343b
+MD5 (NetBSD-6.0/sun3/INSTALL.txt) = 194d8eac56ca75bff60e3d8c6e003ab1
+SHA1 (NetBSD-6.0/vax/binary/kernel/netbsd-GENERIC.MP.gz) = 71d44bf3bd2a39ac207a085a22a8310014e4b062
+SHA512 (NetBSD-6.0/vax/binary/kernel/netbsd-GENERIC.MP.gz) = 875f45349bf522e4f63d8f1261433b3e109df5ce7c3ee1edd13e2d4526616b7863507dc305d954300308a4c650b9fa12168219d0deb6622b517442b34e10bcfa
+RMD160 (NetBSD-6.0/vax/binary/kernel/netbsd-GENERIC.MP.gz) = 357c54bfe13253c5fec2c4ca6cd18909b6a3a6a4
+MD5 (NetBSD-6.0/vax/binary/kernel/netbsd-GENERIC.MP.gz) = 5aa951b5c5cb5592f950fa3882b2f60f
+SHA1 (NetBSD-6.0/vax/binary/kernel/netbsd-GENERIC.gz) = 9b77cf6513c4cf4fdb0081400a46c34a1c0cf04b
+SHA512 (NetBSD-6.0/vax/binary/kernel/netbsd-GENERIC.gz) = ff9d18b6c5d3bcd7bf4ea6e341e77180a7c68b034c61e02dc3d540389e9690faf7a157587847b3f1c25199cee097178b0b658118daddd136aa5f5856dcec1c38
+RMD160 (NetBSD-6.0/vax/binary/kernel/netbsd-GENERIC.gz) = 2ed49d64a3f42845c08a8ae30d45569492895cc3
+MD5 (NetBSD-6.0/vax/binary/kernel/netbsd-GENERIC.gz) = 26548ca549cfa4f7c9be70e52a981d69
+SHA1 (NetBSD-6.0/vax/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/vax/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/vax/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/vax/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/vax/binary/sets/kern-GENERIC.MP.tgz) = d4cac92dc06ec7b3c4ec9ca0d60dd1ace1814e50
+SHA512 (NetBSD-6.0/vax/binary/sets/kern-GENERIC.MP.tgz) = 3b10e201e963285a8c3d9319e818510701756a3c33003a5536d273e886cc0b3c02ffe10e762d5d7b4aee2d0098d3600396afc2baafea64cc268fa032203a46f9
+RMD160 (NetBSD-6.0/vax/binary/sets/kern-GENERIC.MP.tgz) = d9b4a6a9c85abeee0178536cd1b5c4f0322067a4
+MD5 (NetBSD-6.0/vax/binary/sets/kern-GENERIC.MP.tgz) = 15126f47c08adefe93c7261b6eeeddec
+SHA1 (NetBSD-6.0/vax/binary/sets/base.tgz) = 9b83f88ab7d06a112cfff79b6657912bddb77987
+SHA512 (NetBSD-6.0/vax/binary/sets/base.tgz) = de7c42524163a5d9de7fda440cd2523834d5c46e4e992724a4a7af5e0768e5b105909e9a60e603b2a942cade3795cf4cc2bb22c7627453eda92bf662da83a16a
+RMD160 (NetBSD-6.0/vax/binary/sets/base.tgz) = 3059d6e4a7d54ebc9c529f90719ca561ebbe8036
+MD5 (NetBSD-6.0/vax/binary/sets/base.tgz) = d06066c8a452b8a7831de680a420ea4c
+SHA1 (NetBSD-6.0/vax/binary/sets/comp.tgz) = 3ad25c223276936b26916121fe8341524e2e51a6
+SHA512 (NetBSD-6.0/vax/binary/sets/comp.tgz) = 852dc3d7a01fc8e11e66723930d90e7141d974b976d8f7986f068fb5202dad396ef2762400c1e9e02b0d6c5a087435a56f65e502079eec9d9e86c24cf81782bb
+RMD160 (NetBSD-6.0/vax/binary/sets/comp.tgz) = a4e74e817807d4d79a43ac450109b14474fda740
+MD5 (NetBSD-6.0/vax/binary/sets/comp.tgz) = cf51957de39d3a72c7dda2633d39e705
+SHA1 (NetBSD-6.0/vax/binary/sets/etc.tgz) = 21f4ff8b449498081fd6dde92b43eaca86d886ef
+SHA512 (NetBSD-6.0/vax/binary/sets/etc.tgz) = c6e43ea57dd0b53f9e0a995aa872d9f7f1d8852fbe7105e125116f577d0ce2acb1e8deddc6a8dcb51e272a982cf549706b23bb26b0acedad416ceef8910a6461
+RMD160 (NetBSD-6.0/vax/binary/sets/etc.tgz) = dd7a5f74812906801bf474d265a4846f069c00ef
+MD5 (NetBSD-6.0/vax/binary/sets/etc.tgz) = fbb2c18ea3be98a3624f54b834399ee9
+SHA1 (NetBSD-6.0/vax/binary/sets/games.tgz) = cd79679fa36349431355dcd14b8a058476f20086
+SHA512 (NetBSD-6.0/vax/binary/sets/games.tgz) = f68c931765849554222cc439d5761411d36e8e95b4331d15525e73f77b31249c220b9de4c2061f5e35207e75e27d5d6ade99a7eadf2baf54fc8eeb16ac243dbe
+RMD160 (NetBSD-6.0/vax/binary/sets/games.tgz) = 7da1dd4ece7e9062635f7b0766af245e2624c032
+MD5 (NetBSD-6.0/vax/binary/sets/games.tgz) = 995e32bef1b920f33c5d7eb946441682
+SHA1 (NetBSD-6.0/vax/binary/sets/kern-GENERIC.tgz) = 6e61cfb380e7cf45e2094ef64d26d44ee33fd086
+SHA512 (NetBSD-6.0/vax/binary/sets/kern-GENERIC.tgz) = 0d35a882e1e98796099bedc0157fc30978b2e43ef0627be603036259069dc13503fee5dd57b2e9da74dd5c2cb1bb823f4bf91d98259d84b993977bae05d8c10c
+RMD160 (NetBSD-6.0/vax/binary/sets/kern-GENERIC.tgz) = 3e2f321e7934e6597ea83627934e88d2214baad3
+MD5 (NetBSD-6.0/vax/binary/sets/kern-GENERIC.tgz) = 2efb4b8d6a76ebb59f4ce1171e1502db
+SHA1 (NetBSD-6.0/vax/binary/sets/man.tgz) = 9c2da95fb72f9fd1eaa8f7baf5fe45496c8b4615
+SHA512 (NetBSD-6.0/vax/binary/sets/man.tgz) = 1a158e92b8414d92745a06fe1c721047e87fd768d7158e078c3a17de1d2634463f8f6b022a001f5f9010e14f0eedf6d5a94e4b73b4dd0ed9ac4576abbf2aeaf4
+RMD160 (NetBSD-6.0/vax/binary/sets/man.tgz) = d2485fd19bffbc6103f8aa7521e52c8f652fafa2
+MD5 (NetBSD-6.0/vax/binary/sets/man.tgz) = 83e81f5c82acdf7ee76ef5854eca3f5b
+SHA1 (NetBSD-6.0/vax/binary/sets/modules.tgz) = 4e60e0177f0e5d6e42ee875a7c30cc612c22ca64
+SHA512 (NetBSD-6.0/vax/binary/sets/modules.tgz) = 0e5926279b9534cb9bd34ff0c4d49fa4cd467966829d080ec8ab739039536f42173c2ec91aea40ca37d94625a5b395c3f55ce7936f963bd8d970d1a81fcff8af
+RMD160 (NetBSD-6.0/vax/binary/sets/modules.tgz) = 54b0d690b929b4df06adc044864e76d47f09c844
+MD5 (NetBSD-6.0/vax/binary/sets/modules.tgz) = aa18ce8768d9fd88206d465fd1ae155d
+SHA1 (NetBSD-6.0/vax/binary/sets/tests.tgz) = ec975a37d490f45fb9e7f0f30f0ec46fc0038531
+SHA512 (NetBSD-6.0/vax/binary/sets/tests.tgz) = 33b8686c97da76e031a9678103ba99a83cc4189545b4020241a83084585f0eb200c0cb44634e578c8882cd849f80151383a54511c80d1a35964a3567f8e6b314
+RMD160 (NetBSD-6.0/vax/binary/sets/tests.tgz) = c27fcdf838dfc43c1527fde3fba2735065a5d12c
+MD5 (NetBSD-6.0/vax/binary/sets/tests.tgz) = 3789eac68014743577dfe22503dd98a5
+SHA1 (NetBSD-6.0/vax/binary/sets/text.tgz) = c7dcf12545842d5563887c983d694fa569d25ab3
+SHA512 (NetBSD-6.0/vax/binary/sets/text.tgz) = 50a7ad69dc23c0d178a3f835e9bed7305cbe432a92cf947e64e28316ac94ddd7def90e91c53515d0cd3ac26c5df23d3f60932ba688ab04525d635555b6078a6a
+RMD160 (NetBSD-6.0/vax/binary/sets/text.tgz) = 24ae1e1016b492c3dd575099936598d00d8ac6fa
+MD5 (NetBSD-6.0/vax/binary/sets/text.tgz) = 99863a74757bc9677befe8c6ef049685
+SHA1 (NetBSD-6.0/vax/binary/sets/xbase.tgz) = 35f6a1b09f246736f7c1c6049831ca0704fe53d1
+SHA512 (NetBSD-6.0/vax/binary/sets/xbase.tgz) = d2d0b6a5702e4a87e4823ce7478f5c8f1527045d96040680960e3d96f98f64e40ac7263ad2ca4c4272d4d253fcb41b7e296a9d27f9ffa7dc03be6c437835878e
+RMD160 (NetBSD-6.0/vax/binary/sets/xbase.tgz) = e2455fc04171cd3aef8662a36820552811c7657b
+MD5 (NetBSD-6.0/vax/binary/sets/xbase.tgz) = ec8b6356f82d4ccb90e93dd78e5c741f
+SHA1 (NetBSD-6.0/vax/binary/sets/xcomp.tgz) = ebadf7653d6173ccc73d1228338a4df09eb7dce2
+SHA512 (NetBSD-6.0/vax/binary/sets/xcomp.tgz) = a4c4cfaaea473e617870a92bfce40fbc2e34413f31ec2159554031c4312dc1e605079a9e0fd3774967bba9cc27bf9efc97899f09959bd401726ceeeec7006790
+RMD160 (NetBSD-6.0/vax/binary/sets/xcomp.tgz) = e6d1591328fcc0af7336d22a5426f72c8343ad49
+MD5 (NetBSD-6.0/vax/binary/sets/xcomp.tgz) = 1cc0fa0971f06c2bd9e296db9d6d6fa5
+SHA1 (NetBSD-6.0/vax/binary/sets/xetc.tgz) = 2c85388aa75c419cc5651c053b00710471a87350
+SHA512 (NetBSD-6.0/vax/binary/sets/xetc.tgz) = 38c9f1abf9d6ff828c361a2c58690f70a7d707aa739f7ded9f256b414e7b78c11ff4f915a59f99884afd5ef0b874c1c1b70aa438f6bdff07e354d67d2257bf72
+RMD160 (NetBSD-6.0/vax/binary/sets/xetc.tgz) = b1186ef0c975fa76d8d4d0c62e24ae86cb3d433c
+MD5 (NetBSD-6.0/vax/binary/sets/xetc.tgz) = 46ca22a86d8052c1044717eb907d7874
+SHA1 (NetBSD-6.0/vax/binary/sets/xfont.tgz) = e9a33e8d99378b3944fc21aa983c02707831f0bf
+SHA512 (NetBSD-6.0/vax/binary/sets/xfont.tgz) = 3d09f4edf49bfa98c7817cdb1b91aa4ec902dc87c1765e9a92f143bf4918a60e011fe614a70d9dd926ca2a019a33e5f0dc2d7198205f2273e755049dd8d5a2a1
+RMD160 (NetBSD-6.0/vax/binary/sets/xfont.tgz) = 9ae96f8628d6a35053f093acee972bdd8b6722cd
+MD5 (NetBSD-6.0/vax/binary/sets/xfont.tgz) = 6e95a6fd030425bb19f0505b9308d20d
+SHA1 (NetBSD-6.0/vax/binary/sets/xserver.tgz) = aa6c021940fae979a4a3a3cd01a138808c49621d
+SHA512 (NetBSD-6.0/vax/binary/sets/xserver.tgz) = 540455f89e8dfe7d376322ab95288e96e54aa0531aab7cb96e0b1354f85ef64778cbf265bfc2fca7827879a286d80b15f9e973d62594e5bf02df4b0add15be0c
+RMD160 (NetBSD-6.0/vax/binary/sets/xserver.tgz) = 84dee738690e4487d7f28cba1d3f61ab9eb12240
+MD5 (NetBSD-6.0/vax/binary/sets/xserver.tgz) = e2df86b6bfa5259e72d02f40de72491b
+SHA1 (NetBSD-6.0/vax/installation/bootfs/boot.fs) = c4d1340eb7d2ea1d555a46fcf2071fa2f091d1d1
+SHA512 (NetBSD-6.0/vax/installation/bootfs/boot.fs) = 155e7faaf14e619309c3ca8cc163e08d6bd3cac41b4d38dc5dc4cd4736e99003a2b6a6d0ffb6cb698772f43d31f577732b9933a71fb1f6315af16dfae34d4f66
+RMD160 (NetBSD-6.0/vax/installation/bootfs/boot.fs) = 52a2200dbef9e624d7ca91eb6d2110599b8010b1
+MD5 (NetBSD-6.0/vax/installation/bootfs/boot.fs) = f02d1ee9291b0dd37f0dc75d0a27ad10
+SHA1 (NetBSD-6.0/vax/installation/miniroot/miniroot.fs.gz) = 5aed885a0dde234caed611cca0f474dc6cf8461b
+SHA512 (NetBSD-6.0/vax/installation/miniroot/miniroot.fs.gz) = 3d647213e86ccb976107853ab81ec82d339d2cc7c7bda4cc0c416f55e521c7a43a73523c7f9ff6e590531f019badcd414f1bdab4c95db0806a606065c6803ef4
+RMD160 (NetBSD-6.0/vax/installation/miniroot/miniroot.fs.gz) = 6ddb63ee115a7b4a78546092ac7b8cee7c056921
+MD5 (NetBSD-6.0/vax/installation/miniroot/miniroot.fs.gz) = 0f860ac5f201e72f4b22392027b25117
+SHA1 (NetBSD-6.0/vax/installation/netboot/install.ram.gz) = 8f48dc649fe71a6f861a9f96e2b63679971b762c
+SHA512 (NetBSD-6.0/vax/installation/netboot/install.ram.gz) = 857920e536fe08897d7e20c62c74a5606ea791d97111740222c8998ee4a1a9ae05f52ac27b5580d5f78a70f75d5a9ea9446802a85297a13411b98ebe8a84a3e1
+RMD160 (NetBSD-6.0/vax/installation/netboot/install.ram.gz) = 9c94e2d64328f88eb7157d6a47e5aec15b1da2a3
+MD5 (NetBSD-6.0/vax/installation/netboot/install.ram.gz) = 23d3d0b714186b3e2e7b70d5f0a1ce21
+SHA1 (NetBSD-6.0/vax/installation/netboot/boot) = 738e9f280ab9874a2eb21af8627d70e2abd2ba0c
+SHA512 (NetBSD-6.0/vax/installation/netboot/boot) = 934496142a69c247ce8b96ea6de19e0cbe0d9e4e8a1ae1043f4d60926c6b3deb30132f3bdc346b3422f1fea02da3a3feaf900d64a9759d265b33fe81ab3da070
+RMD160 (NetBSD-6.0/vax/installation/netboot/boot) = 8a60febc408768e89ebb1a834bffaa06a72d3503
+MD5 (NetBSD-6.0/vax/installation/netboot/boot) = f238dc1fafca2d7f1a83a22b6cb31091
+SHA1 (NetBSD-6.0/vax/installation/netboot/install.ram.symbols.gz) = 6b57f7a857c24539639cce3ed41ed5de16ec233b
+SHA512 (NetBSD-6.0/vax/installation/netboot/install.ram.symbols.gz) = e9ac802e948631231eda425e5bab76bf14bc59462613eb6c1025708d67f54c67e9b928cbf33253473605c6239842667eba5e58240d6cb53afc5c80c8546357f5
+RMD160 (NetBSD-6.0/vax/installation/netboot/install.ram.symbols.gz) = 5a6ea2a19caafd034e75e9440d1e139d1af3ef0c
+MD5 (NetBSD-6.0/vax/installation/netboot/install.ram.symbols.gz) = 712856f65322faccd1b116c548d40196
+SHA1 (NetBSD-6.0/vax/INSTALL.html) = 8d850ffd9374c9bdc63e37fa14dc63eda02a93fe
+SHA512 (NetBSD-6.0/vax/INSTALL.html) = 3c93355dbfd0cbad25eb74c8497975855706a20dafe8a1baa64d0b53801d5e02d81a93c3347c52950fdd424623cbb58c7a0aa58b7989e89116b157f9d18bef51
+RMD160 (NetBSD-6.0/vax/INSTALL.html) = 42d4d65000e12d8f2cbe30f6743d84d7a040bb05
+MD5 (NetBSD-6.0/vax/INSTALL.html) = bbad6392f6badb4a1d0ee2977b9df90c
+SHA1 (NetBSD-6.0/vax/INSTALL.more) = 624b96b802364eb833ca077dc706d75b5f68f336
+SHA512 (NetBSD-6.0/vax/INSTALL.more) = 300954b8c1f3c47a1a45d773f8c7bad3c12dbc292485b7a7206289f56584ce12befa89b8d315511c3e3f7c407de9ca068fbdaae9d75c52dff72a8f8a9b5e4a55
+RMD160 (NetBSD-6.0/vax/INSTALL.more) = ab1b5238e9eb5ad1c937c75901199023c08d2434
+MD5 (NetBSD-6.0/vax/INSTALL.more) = e634a224d0d67c5cc1c7dffd98156b79
+SHA1 (NetBSD-6.0/vax/INSTALL.ps) = 57710ab0d4450b0692b07eb812c9c7e6d70a49d5
+SHA512 (NetBSD-6.0/vax/INSTALL.ps) = 0afac140d664edbb10a41c6dd646c797b78e37c1d36aa4804653fbef64171ddf9688d7220755553ff4add8891bd97f083bde4b03c93fe579f1e9d030c83f3d07
+RMD160 (NetBSD-6.0/vax/INSTALL.ps) = e84f468d6f328faa9889cf2ad76cab5846c45da0
+MD5 (NetBSD-6.0/vax/INSTALL.ps) = 51b9a2a1046494b2443503636fa223da
+SHA1 (NetBSD-6.0/vax/INSTALL.txt) = 0a4b816342615d9a4e60cbc99bfea81afe41d0f1
+SHA512 (NetBSD-6.0/vax/INSTALL.txt) = b1853a3be6cd17449c4e5539945812b9ba87e02e07877dfe791e04c3db39ed1577e795d7d5e3b1048fc60eca5694592bb5671982c24aaa1f78e3783ede603ded
+RMD160 (NetBSD-6.0/vax/INSTALL.txt) = f774566773432a691acf285d569dabcf5037ecfb
+MD5 (NetBSD-6.0/vax/INSTALL.txt) = 43a9353717d9309c11fb5f4a9685942d
+SHA1 (NetBSD-6.0/x68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 0e3d568ade336cd6e538d567ea11a965d49588cf
+SHA512 (NetBSD-6.0/x68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 721a7e1ec94d9a37f37eb30b96d66b19d387090964ee93233de36771e4d106e72cdbeb4b0b17f8d490d9f64484b8a511526841c511b2d33624bd626b4388b623
+RMD160 (NetBSD-6.0/x68k/binary/kernel/netbsd-INSTALL.symbols.gz) = 176ba2b94555c5bda82260a075ba295021d61e8a
+MD5 (NetBSD-6.0/x68k/binary/kernel/netbsd-INSTALL.symbols.gz) = aa03bcea1e574f24c1ef0eeb364f1c8d
+SHA1 (NetBSD-6.0/x68k/binary/kernel/netbsd-GENERIC.gz) = 9a7796c7abf7b4828ee7eb7125b73f5ccd25e2db
+SHA512 (NetBSD-6.0/x68k/binary/kernel/netbsd-GENERIC.gz) = 58c7f85cf73d90a04c42c502a3dedd779d9f5013a58f0df8a279cf559dedb80b6bdf2a22804284fa58a7df9c1ba8a8f0454d3f76a43787a7372afb58d5d734b3
+RMD160 (NetBSD-6.0/x68k/binary/kernel/netbsd-GENERIC.gz) = efce8e9537f895492b5becab7878dec07fafe7c1
+MD5 (NetBSD-6.0/x68k/binary/kernel/netbsd-GENERIC.gz) = adf275bc0aec4a8ba50661637b7707e5
+SHA1 (NetBSD-6.0/x68k/binary/kernel/netbsd-INSTALL.gz) = e5fee2392b742d34a50bd2236dc4ba26acdd57e2
+SHA512 (NetBSD-6.0/x68k/binary/kernel/netbsd-INSTALL.gz) = 6aa21ef102224a5194fd6709b70a47788e073ad0d325dbe3b982a19a24c67b421acb003496ddf42804785b0dae9bb32dccde617e7d6d9185511205ab390cdcb3
+RMD160 (NetBSD-6.0/x68k/binary/kernel/netbsd-INSTALL.gz) = 7251ea070e26aa877c85b9eabffd62cd6ee4b04c
+MD5 (NetBSD-6.0/x68k/binary/kernel/netbsd-INSTALL.gz) = e5e8b74d980cbbbc0324cab3da12af0b
+SHA1 (NetBSD-6.0/x68k/binary/sets/games.tgz) = 16ee93ea4d5fac2fb28fad5c32c8a3d57d011d79
+SHA512 (NetBSD-6.0/x68k/binary/sets/games.tgz) = a7f49ab72f50273f66c8dcf408b57ec4668debd5537c5bd0ec59aa0f4fa1d599ba0798d1b283315c4208cbcb608925808ce003b1ade79034886edb8208f9f48d
+RMD160 (NetBSD-6.0/x68k/binary/sets/games.tgz) = 1e09d99d7fe2e495763f05919472d27a4ba699df
+MD5 (NetBSD-6.0/x68k/binary/sets/games.tgz) = 8a26f3e864444209088bccf21419a616
+SHA1 (NetBSD-6.0/x68k/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/x68k/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/x68k/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/x68k/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/x68k/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/x68k/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/x68k/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/x68k/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/x68k/binary/sets/xcomp.tgz) = e13548b8974f5d55e98caf17b2b4bbbcf2430370
+SHA512 (NetBSD-6.0/x68k/binary/sets/xcomp.tgz) = e4b13c798df04ffef88e72100e2db5af400e5ae255cd7a1ca2907736b8138a59045b6f3bd8531b5753d0b87eadb1b5f801043a929bb25d1611e4be693c1da954
+RMD160 (NetBSD-6.0/x68k/binary/sets/xcomp.tgz) = 3b1f4e26ddd57e69afd9709553c1bf70d6e29ea0
+MD5 (NetBSD-6.0/x68k/binary/sets/xcomp.tgz) = 894bb9aa05b164d9923682165d708335
+SHA1 (NetBSD-6.0/x68k/binary/sets/xfont.tgz) = 24ca4cb77a59246b1b05e0a91fed21c63259d12b
+SHA512 (NetBSD-6.0/x68k/binary/sets/xfont.tgz) = 8dc297fb6205a995767e68e77cc21169234dfb66a86bbcd2e1828fd32efeda0a25c9f2a9b1a39b97fe8d7b24f8cd5cf6160859af6be2259876f39ee4e76c405b
+RMD160 (NetBSD-6.0/x68k/binary/sets/xfont.tgz) = d2f134959940e6667aca185f01e388c05dc6bc85
+MD5 (NetBSD-6.0/x68k/binary/sets/xfont.tgz) = 3c96c1f0a13cd7d277ca35622ac9c058
+SHA1 (NetBSD-6.0/x68k/binary/sets/kern-GENERIC.tgz) = 253e2e072ae66dd896be3d6d936c637bb96ef2c2
+SHA512 (NetBSD-6.0/x68k/binary/sets/kern-GENERIC.tgz) = e2b9221ffad2c150f1529243197e7672c58a41d865dcf02a7252c1bb1f0fdb644e8c6bc3250f16f2091748d2a009badd12c0cbda2ae2b186bbfa0b6302957293
+RMD160 (NetBSD-6.0/x68k/binary/sets/kern-GENERIC.tgz) = cd78ce4ed94bd540d9cfcf2d3a6d51fd83cbef95
+MD5 (NetBSD-6.0/x68k/binary/sets/kern-GENERIC.tgz) = a41a26a51d64ac00f3d0b1f5657a5400
+SHA1 (NetBSD-6.0/x68k/binary/sets/base.tgz) = 97339969786af5934c8db561afd33bf2fdd5cb77
+SHA512 (NetBSD-6.0/x68k/binary/sets/base.tgz) = a5cb607f828570f11ae3653032d442cc191339a00037cc6c37635c726fb2b06a9bf1d2dec7e71bfb824ac11810ff1ccbff55ec69659c66112b36fd28521a304c
+RMD160 (NetBSD-6.0/x68k/binary/sets/base.tgz) = f77783ac8537a39ac77014b7fd8860269a6aae0c
+MD5 (NetBSD-6.0/x68k/binary/sets/base.tgz) = 752b937da621346aaab5b18ac1fc9f3a
+SHA1 (NetBSD-6.0/x68k/binary/sets/comp.tgz) = 5b2f871bf928a68b7ffdf2b2f45e5ee80a8c83a0
+SHA512 (NetBSD-6.0/x68k/binary/sets/comp.tgz) = d037edaa7d8b4a275a39771f2f7ffd4dd46f68a3107af0ca88f9ce205370c756904c6c0bcb7f6138fabeaf0bfb504ce541253c9d6d2892675e7e308358045047
+RMD160 (NetBSD-6.0/x68k/binary/sets/comp.tgz) = b371813449f8d913bf22466d52a7a238522b8a5d
+MD5 (NetBSD-6.0/x68k/binary/sets/comp.tgz) = efab43faa3de48943a5ba3b96a07741d
+SHA1 (NetBSD-6.0/x68k/binary/sets/etc.tgz) = 52e6167471d4788f7f060166de8f23a31f731596
+SHA512 (NetBSD-6.0/x68k/binary/sets/etc.tgz) = ce530878bf230e22786bac9ce6075958eebb52c5119b760ebc183b8f7b2fa59297797768461a44f708b9ce993c21a96e0f49b207c79208e25eea93412889babc
+RMD160 (NetBSD-6.0/x68k/binary/sets/etc.tgz) = ad019f3b95e8cc9d3320909dee7dd91ff45a4da6
+MD5 (NetBSD-6.0/x68k/binary/sets/etc.tgz) = 9f179baf30026ced05db113a623006b9
+SHA1 (NetBSD-6.0/x68k/binary/sets/modules.tgz) = d52fa0ed8a899526add267f705735e9dcbb62a14
+SHA512 (NetBSD-6.0/x68k/binary/sets/modules.tgz) = af60d178109bc5330363f041d688e46e36e1894ca0320c7a1735f5de483349a38e63b316b297a5bbf7fb282c1f69539698f7704e759a27c1c833239ec775e371
+RMD160 (NetBSD-6.0/x68k/binary/sets/modules.tgz) = 5e3db9d5547a118143f5eac40b442cf27dce8a52
+MD5 (NetBSD-6.0/x68k/binary/sets/modules.tgz) = 18d52b98a32e1b37501fb2056be5d356
+SHA1 (NetBSD-6.0/x68k/binary/sets/tests.tgz) = 469b2b371980f0bd11407497ee2c104536867df3
+SHA512 (NetBSD-6.0/x68k/binary/sets/tests.tgz) = bfb64b49fd88386e2012b827d9af754bbc75a21e63650da66a8add45b54bfc700a3d22a3c6e98e8736309f1a1015f82c366e51ac6539556f1645b28d3d018ad5
+RMD160 (NetBSD-6.0/x68k/binary/sets/tests.tgz) = 8e674a86bd2551876719f842f61850d6505b290e
+MD5 (NetBSD-6.0/x68k/binary/sets/tests.tgz) = 5c524dfbbb575f61ff958baa317a4808
+SHA1 (NetBSD-6.0/x68k/binary/sets/text.tgz) = c8b514b008fdd482c7df7df5849c5bbcd04d289c
+SHA512 (NetBSD-6.0/x68k/binary/sets/text.tgz) = 37fe61c52eaa54e8de5709bb3494efe1845a0946c65ed007ec0785902d44acbb3b971bd31b53305ce72d4d32180a56f280a4b29a2a9dcb83c443299edcfe0ea8
+RMD160 (NetBSD-6.0/x68k/binary/sets/text.tgz) = d927619390ecab77ada3966395d227967cb38a43
+MD5 (NetBSD-6.0/x68k/binary/sets/text.tgz) = 1854795033d3fb974637643eed84359a
+SHA1 (NetBSD-6.0/x68k/binary/sets/xbase.tgz) = 012b5faed219406f267667b7d5047ea9e85ac58a
+SHA512 (NetBSD-6.0/x68k/binary/sets/xbase.tgz) = 88b65e79f9801e1d3a0da5d3407754c7d48911bf86e5262fb8d02c46c5653b6fd55e6588177771ff82740b12fc84c8a19e207cee83ceee3a772e5beb182ae72b
+RMD160 (NetBSD-6.0/x68k/binary/sets/xbase.tgz) = e5d43999d4316d561ee7689321c04698af4ed5b4
+MD5 (NetBSD-6.0/x68k/binary/sets/xbase.tgz) = e5cdea5cf19b94dc3ef382951ef923e3
+SHA1 (NetBSD-6.0/x68k/binary/sets/xetc.tgz) = bf1f9fa57ffed50beb8d7d455c95928d560bf224
+SHA512 (NetBSD-6.0/x68k/binary/sets/xetc.tgz) = 3bf13d97afb20cb5e7098d9837f0a1bf471e49ec53672948373fcdb23c25c56fcb6de974a021c7e3bcb00e6069e0a68c5a84cd187e4304af129b3db66942d953
+RMD160 (NetBSD-6.0/x68k/binary/sets/xetc.tgz) = d2f0715f277a6de929f1504d50ce1b5fe27327fc
+MD5 (NetBSD-6.0/x68k/binary/sets/xetc.tgz) = 85342c60f299840da352a811f666392c
+SHA1 (NetBSD-6.0/x68k/binary/sets/xserver.tgz) = 54b441f5b0afb06e26e816a729b259abe8b3c234
+SHA512 (NetBSD-6.0/x68k/binary/sets/xserver.tgz) = a81cf87de57b646f79cbbdf5cf9a69c90bb2f97adccc1310bfaf639313c3027b04cb7591d49cf7dd07f4f6210e971656c7ae8980d8e0a1e854fbbc87ccfd91d0
+RMD160 (NetBSD-6.0/x68k/binary/sets/xserver.tgz) = 0ddef8e502a8ca10a21d59aa99f9476dbac2d29f
+MD5 (NetBSD-6.0/x68k/binary/sets/xserver.tgz) = e60e100d889a7377fd708a441d2a818a
+SHA1 (NetBSD-6.0/x68k/installation/floppy/sysinst1.fs) = 0c52f0ff358294b5fefca38d963f7fcc3c6dfe93
+SHA512 (NetBSD-6.0/x68k/installation/floppy/sysinst1.fs) = aeaba8cc7f83d83ec41a0ffef1a01203de34a89ad6028f8d5df06b2a6523b82ca44f13370f0f2f03e65cf2bb8a76532868471f25ddac4a8e53aa2f8a57f4be57
+RMD160 (NetBSD-6.0/x68k/installation/floppy/sysinst1.fs) = 396eff107455609a3b7322595660741e14a57077
+MD5 (NetBSD-6.0/x68k/installation/floppy/sysinst1.fs) = e1a273155ed6f80cc365bf441909a914
+SHA1 (NetBSD-6.0/x68k/installation/floppy/sysinst2.fs) = 35344d834aba89ce14574026bdc0c3648c4bed0d
+SHA512 (NetBSD-6.0/x68k/installation/floppy/sysinst2.fs) = 59d6206fafca21e1ad29ef12d869f7ad81855f0b1124625278db71dff739a76bc36da83a1bfa4ee920602a246f3f925e4c383ab8ad5455ae3cc19408347da8ed
+RMD160 (NetBSD-6.0/x68k/installation/floppy/sysinst2.fs) = ee5f34edcf9ae13406c1db031b9d99cf2e485c4f
+MD5 (NetBSD-6.0/x68k/installation/floppy/sysinst2.fs) = c5cf691f0b3380cfa9ed93158a0598a2
+SHA1 (NetBSD-6.0/x68k/installation/misc/gz124x5f.lzh) = 50ef2f563b410530f5f52a857705848973a870a4
+SHA512 (NetBSD-6.0/x68k/installation/misc/gz124x5f.lzh) = 7df17f64a217eaba1374a2833326824d43acbe84a8e47e558ec805053fb3d93e07619d5c89287951eb7e6961068aa8e534f74b7da87106d3c0f306bf5191acbe
+RMD160 (NetBSD-6.0/x68k/installation/misc/gz124x5f.lzh) = 2ebf89a1a5ee6564bbd9bdcb5a8d2716f4bc121d
+MD5 (NetBSD-6.0/x68k/installation/misc/gz124x5f.lzh) = e27b76e450d506e3cd555f8ae3a99e61
+SHA1 (NetBSD-6.0/x68k/installation/misc/gzip.x) = 639b9edf903ccc07259e146ac141cc8c102bab95
+SHA512 (NetBSD-6.0/x68k/installation/misc/gzip.x) = cac2274fa0b5e1ac2ef978b8a09c001cf3e3acdeaf7131e93677b4fb13d56412bcfee86fe886758866d6daffb67f54dd6fa4c2796bda49ca0e59e4d3a113e7d6
+RMD160 (NetBSD-6.0/x68k/installation/misc/gzip.x) = 7c431086e8719f5e48c9d698808a1ae74a78b2d1
+MD5 (NetBSD-6.0/x68k/installation/misc/gzip.x) = 69fb6553b4cf7d3825b53c8d7bf5a865
+SHA1 (NetBSD-6.0/x68k/installation/misc/loadbsd.0) = 45a858903634d838d7525fff2db12467195ce1d5
+SHA512 (NetBSD-6.0/x68k/installation/misc/loadbsd.0) = 7c67ae6947fb128acfe72dab897edc0d8cb4c8e82b1886337ed07b5d031e0e550ff791b470f0276ef0fb920b4d6eefdc574efec0dc04116b05b510684ad8044d
+RMD160 (NetBSD-6.0/x68k/installation/misc/loadbsd.0) = 4b30a14f171cf026efa10f44dd0357cc2db91d17
+MD5 (NetBSD-6.0/x68k/installation/misc/loadbsd.0) = 25b2b8aa6efadacb72cf96f497a38d5a
+SHA1 (NetBSD-6.0/x68k/installation/misc/loadbsd.html) = 9cd27c39d6fa54fc2c534e4e6dfb30f86764ea49
+SHA512 (NetBSD-6.0/x68k/installation/misc/loadbsd.html) = 71544bd6ce6c3139654cd55ec1ed293fee603e733fb2cde6574ace66df4ee8450182cf890c4519313ac74bc0d43919340cf277c329e6b7a66734aa33d6465593
+RMD160 (NetBSD-6.0/x68k/installation/misc/loadbsd.html) = d43cd8e0a08f11a2bdd4fcf2d8489761a8dfd629
+MD5 (NetBSD-6.0/x68k/installation/misc/loadbsd.html) = 3228e40e5e967fb87b75ee462388f92a
+SHA1 (NetBSD-6.0/x68k/installation/misc/loadbsd.x) = 9ecad059bb18bfc8fb33c165f63a15770326d3bf
+SHA512 (NetBSD-6.0/x68k/installation/misc/loadbsd.x) = 7ed4df332f2e65e5db31f95bc7635f2ea1f5b638727509ff16ee7a531a0006addf16f1da4eceb727d4148dcad8686b3dc960760d289f361fbdb2177e1089032f
+RMD160 (NetBSD-6.0/x68k/installation/misc/loadbsd.x) = ead03264a128cab57ebeb615b42e3688b5641f80
+MD5 (NetBSD-6.0/x68k/installation/misc/loadbsd.x) = 4b9bcac67fd51cd5bf95911a5431b49a
+SHA1 (NetBSD-6.0/x68k/installation/misc/rawrite.doc) = e2cab55990a4835524655fbaf2ade5d9eee29c17
+SHA512 (NetBSD-6.0/x68k/installation/misc/rawrite.doc) = d9df8ac2fe18ff8cc13ad62af9107e821c40ca41cd0ae6d3cd0dd1c55351f8b0f7bb2cdd7f0917a16738d11e0230c0ec233f2297b8603f3a619ef99b0eb1ed9a
+RMD160 (NetBSD-6.0/x68k/installation/misc/rawrite.doc) = ada5298cb0d2df6d1833f32ff21cc97244376748
+MD5 (NetBSD-6.0/x68k/installation/misc/rawrite.doc) = 53481a27e630ca1b583cd953d24d13ca
+SHA1 (NetBSD-6.0/x68k/installation/misc/rawrite.lzh) = 575e26ad9625ca21e5f3aad4c32fbbe01312c97f
+SHA512 (NetBSD-6.0/x68k/installation/misc/rawrite.lzh) = 36104c3fcd87dbedc2421541f14f54151087348f45f69508e5916c3570915f0b0fc355b3c075e4c1cc3907094abe87e14c85ff333e0064403c8230d93719ea0a
+RMD160 (NetBSD-6.0/x68k/installation/misc/rawrite.lzh) = 4c0538916a9ca007aa9ba66ea42c6c46a4c563f2
+MD5 (NetBSD-6.0/x68k/installation/misc/rawrite.lzh) = c15b00572229133bf9505876ea120a31
+SHA1 (NetBSD-6.0/x68k/installation/misc/rawrite.x) = 30e3d4504bfbf7c55a77a19435d75bb1069ed596
+SHA512 (NetBSD-6.0/x68k/installation/misc/rawrite.x) = 06d706b3581dc972d282ef9a6d254740b721a43d5f9c6325af7fb3d1fc8402071887b0ca99c720c5d02c8edcab6086b819faa69640ba4463c1713b168d432059
+RMD160 (NetBSD-6.0/x68k/installation/misc/rawrite.x) = 844aa4ab7dbef030c140e543475f24fc60f0a075
+MD5 (NetBSD-6.0/x68k/installation/misc/rawrite.x) = 6efe87d85560d8d6e3eec7a7b9d1545a
+SHA1 (NetBSD-6.0/x68k/INSTALL.html) = 5ef0d8d03b7f3f600444752d3763c17000da1e3b
+SHA512 (NetBSD-6.0/x68k/INSTALL.html) = 94181608314a1dcc1fa0c634060b28ce229883affc9f64c33d9eeae09b21f9f88149deff8d84a7f64b6b5e7cfb741b6c43d9ccdd2ccdd4c9d6e043f22452adb5
+RMD160 (NetBSD-6.0/x68k/INSTALL.html) = a5e8a1d8e28859a3e08b662d2363d758baf23eac
+MD5 (NetBSD-6.0/x68k/INSTALL.html) = c7154e6e818d1490ce1dbc392bb8207e
+SHA1 (NetBSD-6.0/x68k/INSTALL.more) = 9771b22f8b8b9a5a3ad2aead71a06bccd63caae8
+SHA512 (NetBSD-6.0/x68k/INSTALL.more) = 4f3561d62f5d3a6f1f936d476d783dca2d4caaa50e21d8571ac795a8f3a06ad10f490d02b05ae8e51ed3e6eeb7aba645215339632aa61c99b93c4c4b37ee5329
+RMD160 (NetBSD-6.0/x68k/INSTALL.more) = a8994368a67cb7bd6df0232815e6c21a1a69537b
+MD5 (NetBSD-6.0/x68k/INSTALL.more) = 13d4f52ad2a72fc92e24c1467463be66
+SHA1 (NetBSD-6.0/x68k/INSTALL.ps) = 3dfb26b142ddfa2771a49a371bcbf72cacd74f7c
+SHA512 (NetBSD-6.0/x68k/INSTALL.ps) = bc12356b462b30559d05d0ce0ccc73f07fda3f5575121bf2911db6c638375416e4a79364f7727ea1adef19ed2679e86600c960585e9ef7899ed583d630655b20
+RMD160 (NetBSD-6.0/x68k/INSTALL.ps) = f46789b092425a148d38cae66d987253e12efecd
+MD5 (NetBSD-6.0/x68k/INSTALL.ps) = 34b1b9c1a6ef25bb677408f0a869ed52
+SHA1 (NetBSD-6.0/x68k/INSTALL.txt) = 7371dc6f22eece4157c00dfb01f59a035f305da6
+SHA512 (NetBSD-6.0/x68k/INSTALL.txt) = 600911e35b9c641ee4315452cc4b534e844695af852328eec243632f462b0685acad59f35588c46d5c083f745ea5c1ab1df32e8e4f2307409dc5dd8cdafe110c
+RMD160 (NetBSD-6.0/x68k/INSTALL.txt) = 8f3c307f17b591859a241414a6a0f33f592e811a
+MD5 (NetBSD-6.0/x68k/INSTALL.txt) = 6bd22ee53bf58cae2454a2f8627718f9
+SHA1 (NetBSD-6.0/zaurus/binary/kernel/netbsd-GENERIC.gz) = 7f4cbcd7d5390357b1873da969b0a7cca60e73c1
+SHA512 (NetBSD-6.0/zaurus/binary/kernel/netbsd-GENERIC.gz) = 0c552ce725209b5686341ac0101cb7969a5a43ab8ba5d1b9a540fa07979e93921acfca844622ee00f5be4d3b06598ef4750772767b72b754e5cae22735ec24e1
+RMD160 (NetBSD-6.0/zaurus/binary/kernel/netbsd-GENERIC.gz) = 2ba59423e410d54f3a829f2ce9e5bcbd43b5b840
+MD5 (NetBSD-6.0/zaurus/binary/kernel/netbsd-GENERIC.gz) = 4cd87eddf3285a67e0f463d4896db002
+SHA1 (NetBSD-6.0/zaurus/binary/kernel/netbsd-C700.gz) = 01cc33fb982cd5f2b188d4688147750a94863fe2
+SHA512 (NetBSD-6.0/zaurus/binary/kernel/netbsd-C700.gz) = ceac21a76cc922a67cbf4d8cc83f471015d36d0896efabbf232ebec9217a3d56f8cea43f3e1c22bc527b32be5179898822807a041ef418e3fd6ff942d09dbac7
+RMD160 (NetBSD-6.0/zaurus/binary/kernel/netbsd-C700.gz) = 781cc21ea042587fe9f4c0fe9305ae159f5a15e5
+MD5 (NetBSD-6.0/zaurus/binary/kernel/netbsd-C700.gz) = 95bcd094f576b6f49e7a1bdbb5048a13
+SHA1 (NetBSD-6.0/zaurus/binary/sets/games.tgz) = e1d2bb091d8202962133475bc83edb55230b9008
+SHA512 (NetBSD-6.0/zaurus/binary/sets/games.tgz) = a147fe6d0419d53d5a428802d0bb6c9fa8a84a76c96d7d6d7c0d399e5af3a69240116463549a83d53387b0214ba0207796d7c10228d92a684fe7ff0ece3aec16
+RMD160 (NetBSD-6.0/zaurus/binary/sets/games.tgz) = 2be515c495548ba5135ff42a75a8ebbfc35ea776
+MD5 (NetBSD-6.0/zaurus/binary/sets/games.tgz) = 9059a6f2cd41cb58827709c9e9a1649b
+SHA1 (NetBSD-6.0/zaurus/binary/sets/man.tgz) = 899b9d8242e983a5110ab755651c24f709b5af67
+SHA512 (NetBSD-6.0/zaurus/binary/sets/man.tgz) = 410999db110d710f4bb498c3d7ae7adc62170c7c2f470ce189c92f6c436c5ea96149659c631ef0b5605caaa025d97dfe1c07c428d86f51239657bd6b71717b15
+RMD160 (NetBSD-6.0/zaurus/binary/sets/man.tgz) = c1270f68c6d41b351877f71f0396ac34877dfc8d
+MD5 (NetBSD-6.0/zaurus/binary/sets/man.tgz) = df4db2bbfa39ef6a4a215d949653d04a
+SHA1 (NetBSD-6.0/zaurus/binary/sets/misc.tgz) = 982918d46b2da2693dded747147baed27160d325
+SHA512 (NetBSD-6.0/zaurus/binary/sets/misc.tgz) = 54a45fa2bf5c57e3b63e23a95b6ca74f3b8e6b8f655715663ec5f83f713a9c6149b8b1ccc298dfa2eff9e81376f9f64107b35841cbd20ee62be6575539e01c81
+RMD160 (NetBSD-6.0/zaurus/binary/sets/misc.tgz) = 9c9161a1e855276c6aa3fe61de655dbea3ec9a43
+MD5 (NetBSD-6.0/zaurus/binary/sets/misc.tgz) = 7b0005d0512287e8a34e24c043582fb8
+SHA1 (NetBSD-6.0/zaurus/binary/sets/xcomp.tgz) = 8d7469a85b7433c89690cce74e6b3f4e66cf0647
+SHA512 (NetBSD-6.0/zaurus/binary/sets/xcomp.tgz) = 411304cf66e300a7f162128203099bb4d6eebc4a93ba18ed7caf79f30b31cc7ffcede85c4e1bad02c3f5f8a27d009fb71f3ce5862c1d8aa477f39a25c535fdaa
+RMD160 (NetBSD-6.0/zaurus/binary/sets/xcomp.tgz) = 822d26e0ee08b72ca8b991f0709a8c1bf0399208
+MD5 (NetBSD-6.0/zaurus/binary/sets/xcomp.tgz) = 5af361f0334d28119d703064278b3ed3
+SHA1 (NetBSD-6.0/zaurus/binary/sets/xetc.tgz) = 222d14c205f1018cc5a86eb03214d18cda2abb82
+SHA512 (NetBSD-6.0/zaurus/binary/sets/xetc.tgz) = fb82261996aa772fd8a9022eadebf899ee04ee70229ee4fe07758ca14937bdb34752c8218eb4c5b722b6208f719891493bbc141372fcfa503de83e0a61aa7387
+RMD160 (NetBSD-6.0/zaurus/binary/sets/xetc.tgz) = 511ebfe5076f361b7f7ca03a265d16052a16d259
+MD5 (NetBSD-6.0/zaurus/binary/sets/xetc.tgz) = 165cffbb6d2c79663198d80c82afac1e
+SHA1 (NetBSD-6.0/zaurus/binary/sets/xfont.tgz) = ce0e141beeffeb5b470478e9887e4127da85de3c
+SHA512 (NetBSD-6.0/zaurus/binary/sets/xfont.tgz) = 5d98354ff77103793d56af3192ab5f9afcde62208791976064ac33a149f994e0227dd5dd28ed544eeac5ea504e5212d5fb9e7d05e59e5a48a2fe4062e34e3106
+RMD160 (NetBSD-6.0/zaurus/binary/sets/xfont.tgz) = 4d09f5e82fec875ef0ea328809465e7a98f2ebfc
+MD5 (NetBSD-6.0/zaurus/binary/sets/xfont.tgz) = be26b3890261302420b09976a1d38144
+SHA1 (NetBSD-6.0/zaurus/binary/sets/kern-C700.tgz) = 645cc6b6c3250ead1e2e121bcc179be2e9056b65
+SHA512 (NetBSD-6.0/zaurus/binary/sets/kern-C700.tgz) = 833883cb8aada6c391917ec890282011d2cfa6c5068d9483ab1b8c9b74361baa093b1c6b074dd5cd89709eb67636cbba1a6be292c23b28b8ff7578194c427263
+RMD160 (NetBSD-6.0/zaurus/binary/sets/kern-C700.tgz) = 0867bac200dd8bd12d1c4d225d392a175e06f24a
+MD5 (NetBSD-6.0/zaurus/binary/sets/kern-C700.tgz) = d1c5388985d5693d492ec75713ef3ccd
+SHA1 (NetBSD-6.0/zaurus/binary/sets/base.tgz) = fcee164dc5d4cd72f3c9841b7c7fbe295c4b3e6a
+SHA512 (NetBSD-6.0/zaurus/binary/sets/base.tgz) = 910606c4dedf523e5db213165fd5a244a655a40a7c4686e7a8e80f015d8ca496a1770b1a94532e118ad7cb4d2f4cfd0abb4e07560e0507275b4a27fefa3fb8af
+RMD160 (NetBSD-6.0/zaurus/binary/sets/base.tgz) = c1f5fb6f7b18486f08cacbf1ea6cef5d852a3b4d
+MD5 (NetBSD-6.0/zaurus/binary/sets/base.tgz) = e646c1da6b4ca9c38607d97cbbb6871a
+SHA1 (NetBSD-6.0/zaurus/binary/sets/comp.tgz) = 9af4ccb1edd8eea77f32d50aad4592c483bc41bc
+SHA512 (NetBSD-6.0/zaurus/binary/sets/comp.tgz) = b3eecf648f57fcc3af7ed707bf7f584db4aff71b7755986652e80e2a11e83b7a663263800f143d4dfe668bff0dd606f7733f1ae36be132f70c888a45e210d14c
+RMD160 (NetBSD-6.0/zaurus/binary/sets/comp.tgz) = ef64fdf6c3e118e4aab5264d457278d625408275
+MD5 (NetBSD-6.0/zaurus/binary/sets/comp.tgz) = c22150f0e6684dc1d64fef0abf882dec
+SHA1 (NetBSD-6.0/zaurus/binary/sets/etc.tgz) = 04a520449ff803fefaf80b0beaee929122d9a5bd
+SHA512 (NetBSD-6.0/zaurus/binary/sets/etc.tgz) = a109dffb85cd44758b30a9fd7b5eeb0e68b43babb96984974662ede674c4e4b06cddfdb84fd4377cdcf66944506547585f2e4e1fde1dd2c6ba0c823fec5af6e7
+RMD160 (NetBSD-6.0/zaurus/binary/sets/etc.tgz) = 1412ce7fbadb5bc2a7ea54662dc5af065a52fd06
+MD5 (NetBSD-6.0/zaurus/binary/sets/etc.tgz) = fdcf4276a2adc8bc6b8899a0f92827b2
+SHA1 (NetBSD-6.0/zaurus/binary/sets/kern-GENERIC.tgz) = 5a4db67f97cbf15dfa86f3d1bdd1e0fbf45cf2c3
+SHA512 (NetBSD-6.0/zaurus/binary/sets/kern-GENERIC.tgz) = d47f1b328c845abe0a131e5fec333a5badbbde60e1abb1c2a01032128350ae33a69df720f9a5a944e93a9c29e04b669f530d7d4b803d9262edef1ce8953099d9
+RMD160 (NetBSD-6.0/zaurus/binary/sets/kern-GENERIC.tgz) = 57cc4468fe4f292c4798dcaf7c7ee8b6a79c72cd
+MD5 (NetBSD-6.0/zaurus/binary/sets/kern-GENERIC.tgz) = 7b6a87debe65e4d987181b2a600a0cc9
+SHA1 (NetBSD-6.0/zaurus/binary/sets/modules.tgz) = 97cf73286143f2ee9d1d75d291226b14382bc3e9
+SHA512 (NetBSD-6.0/zaurus/binary/sets/modules.tgz) = 819d952342aedefae4120c8b0f3aa362089528ea9a604479b4242154b52e76688353386c6c6fe7f675086997459a1038f74037840642d4d522145be09d13b01c
+RMD160 (NetBSD-6.0/zaurus/binary/sets/modules.tgz) = 1c5ade56f427ccb12d516da4b60266496a0dbe7f
+MD5 (NetBSD-6.0/zaurus/binary/sets/modules.tgz) = fdf54f31acaaf41ae7e04155dc2ed8e3
+SHA1 (NetBSD-6.0/zaurus/binary/sets/tests.tgz) = d267f0e6d994c769d85698d5fe84dc84d3eb0aea
+SHA512 (NetBSD-6.0/zaurus/binary/sets/tests.tgz) = 400bcfd917639182daf83eddf20aa476be42285c8c5fdeb187b5086c7c00b0ebf2a0aa7badb7f4e1e43e70f43c46972003a4e6b4dd95eb5b7d621e2f8a562623
+RMD160 (NetBSD-6.0/zaurus/binary/sets/tests.tgz) = b8578e18377c21e4f0bc5509eddaacca4e439849
+MD5 (NetBSD-6.0/zaurus/binary/sets/tests.tgz) = ae201c948e67c3c74b0f5f89dde362ce
+SHA1 (NetBSD-6.0/zaurus/binary/sets/text.tgz) = 3467c94a0c6bcd54efe8849c282fa26f9f02624a
+SHA512 (NetBSD-6.0/zaurus/binary/sets/text.tgz) = 0f24772a93aa15de7b2a40e237ea5efeb0f701a6c3645b7add0e478bfcfb3d3050a74d80b1328eb821591ee0464e051572f2afa6bb2935d34ae369809546cf65
+RMD160 (NetBSD-6.0/zaurus/binary/sets/text.tgz) = 6acb227a392a29ef30d17e861ec681c56da75790
+MD5 (NetBSD-6.0/zaurus/binary/sets/text.tgz) = b4ed717b1487f24bf1768305e0c0065d
+SHA1 (NetBSD-6.0/zaurus/binary/sets/xbase.tgz) = 8b5a46ee79d9bffd6d6eb0af06ff3928029b7a92
+SHA512 (NetBSD-6.0/zaurus/binary/sets/xbase.tgz) = c675ab7e92391becf93b9894115e5149b1ef4b4cb9b2f41a58a12c0009c8c1999de4aa8e239f82308c5892accac5cbbe0a3d380f30134bec29b433a5357d1cfc
+RMD160 (NetBSD-6.0/zaurus/binary/sets/xbase.tgz) = 81d52af994bb130ce57e83468b7ce350f107f3bd
+MD5 (NetBSD-6.0/zaurus/binary/sets/xbase.tgz) = 02cd86601f44cd4ba11e466236b04e1d
+SHA1 (NetBSD-6.0/zaurus/binary/sets/xserver.tgz) = e293d1143593154074951807e155c8e87adff50a
+SHA512 (NetBSD-6.0/zaurus/binary/sets/xserver.tgz) = 060d8e60ec568aebafef85ab34b527dafe11516ef5761598e2ba79e5e7994cd4f710812e857fd20bb1e09b0df5692ef1e10949273027c66ce2255e2b15f78132
+RMD160 (NetBSD-6.0/zaurus/binary/sets/xserver.tgz) = 8ea704c20eb2aafb79603904423f7e137136ef4e
+MD5 (NetBSD-6.0/zaurus/binary/sets/xserver.tgz) = f8d5d948e6ccb12094636c6d4106f895
+SHA1 (NetBSD-6.0/zaurus/installation/kernel/netbsd-INSTALL_C700) = 08e381ea42ccb632460555771fd7fe6bae057a24
+SHA512 (NetBSD-6.0/zaurus/installation/kernel/netbsd-INSTALL_C700) = de5d9f71284b987f67077a0fcf2273d11418b73108ada25e4807614752eea38d58b8d32c53e86293a0492d05a842e81f44e5e5e5bdf3f0ca76e440263becd5ff
+RMD160 (NetBSD-6.0/zaurus/installation/kernel/netbsd-INSTALL_C700) = 91c741493cd043610e542d01a4cde6ed30469be3
+MD5 (NetBSD-6.0/zaurus/installation/kernel/netbsd-INSTALL_C700) = 5544b1f0b4a87402fc0fc5951aa303ae
+SHA1 (NetBSD-6.0/zaurus/installation/kernel/netbsd-INSTALL) = a54eadb65290c45af5e6ae4d0cb0b803640fa2b0
+SHA512 (NetBSD-6.0/zaurus/installation/kernel/netbsd-INSTALL) = e78fc99a17c732908af345a40f102ae8eef248f4c5c3a4fad85a8e9d497346f86b65096e816aba26975a71780672040c148f40fc4879cf0b6f5d5ec7f6aa34af
+RMD160 (NetBSD-6.0/zaurus/installation/kernel/netbsd-INSTALL) = e0bde1431f7c4b3f649b2721c0c38f02ad273bc3
+MD5 (NetBSD-6.0/zaurus/installation/kernel/netbsd-INSTALL) = 02bd814abd9951fec27c269ddefb6346
+SHA1 (NetBSD-6.0/zaurus/installation/zbsdmod.o) = 6f5a55fa2497fac0ae75f20df2074eaedde0aa0c
+SHA512 (NetBSD-6.0/zaurus/installation/zbsdmod.o) = 46e48ce8f3e637b5e708a066847e2f7449c8134f8f8d327e3ace9116cae4fc7b77aeee136cb797e00000277c4d224dcb10d946aff983be3292690580ba666b8b
+RMD160 (NetBSD-6.0/zaurus/installation/zbsdmod.o) = b96bdc9f3009ddb56d5b4b05e01e2cc3862a9e11
+MD5 (NetBSD-6.0/zaurus/installation/zbsdmod.o) = 49e746ab92af22b281d4c15eecf85c10
+SHA1 (NetBSD-6.0/zaurus/installation/zboot) = 142512f9c4e5a1a3762dc5b96416392a19fba367
+SHA512 (NetBSD-6.0/zaurus/installation/zboot) = 30520adab63612d4cf76919b21d2262235d3e2996c5a308f050e480acee5f544aad94993e53cd1e7490ef054b2fecfab7db0483ca1f9c045287debeedd84300e
+RMD160 (NetBSD-6.0/zaurus/installation/zboot) = ebd6148f2ed15ea48fd7a2f2a273136661287134
+MD5 (NetBSD-6.0/zaurus/installation/zboot) = da83febbb31821d4b68c07a9c9487946
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.11 (NetBSD)
+
+iQIcBAEBAgAGBQJQfDnGAAoJEAZJc6xMSnBuq9AP/1n7mninneKOiCjD5RTtdS96
+sjxa7DbX1xd8ZIL+klchZurlqqKeBdk63gALDo6VpAsSbNH45R0Ib9rzvJiwSkRK
+7PHPqijtxgACFV4UclrUXWts+Px6AS8QxMfuLgRwu0KETYMnuR8Ghp9YD6xIGqaw
+kG5Pfnqs2qWi9Q/70uTlmJgl3iEj/KStdDyxcmH2VlejtAGxJxqVVwQ6XpAu5z1Z
+OVMmoZoReFeDiTZAydf0VzvwyfmHuPvXKfO8Z+PhkFboAUfuIKIO8DfljQ7A5OBp
+oEEK1nnjeac59KWPAvI4IbXfVuC1o2rEYmLHz9vBxHKiPf9SxL4XjNbZozejXsMD
+h1NWWt4q6nD4nGQaOPyR4afN0ZWluC+6cASQ+Srmr/0QJbsBwgtXuKza2vwNs0iC
+IF80PL1iPjDPmf1CQnOZqJktUfv4aeAcwNs8oiq+toIlgOkIwCzFQFjflny9pRKp
+/YOxwFY8izCb6pu0/3LM2CSutwDEkR7I6aAn65BFW0ia6Ty5azf9iIFOAIbzefkH
+AP1CJKn36vgtcny/R9KueIw/50Hok2rrFrDqzC8mMq5j3Pletm/4equmVu27e+uc
+0jTiNwCHb6ZvuoO7d1clrIEEJPEXe66Xcmj9iJzo+Ai1nhCj1BDNZnj9zHbIwPIQ
+6yQgxCHP9Ney/0j1V+sF
+=nHXc
+-----END PGP SIGNATURE-----
+EOF
+ cat > expected16 << EOF
+Good signature for b.gpg made Mon Sep 10 00:15:38 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+EOF
+ cat >expected17 <<EOF
+Good signature for a.gpg made Sun Sep 9 17:44:11 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+EOF
+ cat >expected18 <<EOF
+Good signature for gpgsigned-a.gpg made Sun Sep 9 17:43:01 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+EOF
+ cat >expected19 <<EOF
+Good signature for NetBSD-6.0_RC2_hashes.asc made Wed Sep 19 07:53:18 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ cat >expected20 <<EOF
+1. tag & 0x3f
+2. len
+
+one pass (tag 4)
+========
+b version:3
+b sig type
+b hash alg
+b pubkey alg
+8b keyid
+
+literal data (tag 11)
+=============
+b binary/text
+b length
+c string
+L mtime
+text
+EOF
+ cat >expected21 <<EOF
+Good signature for [stdin] made Sun Sep 9 17:44:11 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+EOF
+ cat >expected22 <<EOF
+Good signature for [stdin] made Sun Sep 30 10:50:20 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+EOF
+ cat >expected23 <<EOF
+Good signature for [stdin] made Wed Sep 19 07:53:18 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ cat >expected24 <<EOF
+Good signature for [stdin] made Mon Sep 10 00:15:38 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+EOF
+ cat >expected25 <<EOF
+Good signature for NetBSD-6.0_RC1_hashes.gpg made Tue Oct 16 08:12:16 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ cat >expected26 <<EOF
+Good signature for [stdin] made Tue Oct 16 08:12:16 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ cat >expected27 <<EOF
+Good signature for [stdin] made Mon Oct 15 09:28:54 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ cat >expected28 <<EOF
+Good signature for NetBSD-6.0_hashes.asc made Mon Oct 15 09:28:54 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ cat >expected29 <<EOF
+Good signature for NetBSD-6.0_RC1_hashes_ascii.gpg made Sun Sep 9 17:41:24 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ cat >expected30 <<EOF
+Good signature for [stdin] made Sun Sep 9 17:41:24 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ uudecode <<EOF
+begin-base64 644 expected31
+UFJPRz1wClNSQ1M9cGFyc2UuYwpXQVJOUz01Ck1LTUFOPW5vCkNQUEZMQUdTKz0t
+ZyAtTzAKTERGTEFHUys9LWcgLU8wCgouaW5jbHVkZSA8YnNkLnByb2cubWs+Cgp0
+OiAke1BST0d9CgkuLyR7UFJPR30gZ3Bnc2lnbmVkLWEuZ3BnClBST0c9cApTUkNT
+PXBhcnNlLmMKV0FSTlM9NQpNS01BTj1ubwpDUFBGTEFHUys9LWcgLU8wCkxERkxB
+R1MrPS1nIC1PMAoKLmluY2x1ZGUgPGJzZC5wcm9nLm1rPgoKdDogJHtQUk9HfQoJ
+Li8ke1BST0d9IGdwZ3NpZ25lZC1hLmdwZwpQUk9HPXAKU1JDUz1wYXJzZS5jCldB
+Uk5TPTUKTUtNQU49bm8KQ1BQRkxBR1MrPS1nIC1PMApMREZMQUdTKz0tZyAtTzAK
+Ci5pbmNsdWRlIDxic2QucHJvZy5taz4KCnQ6ICR7UFJPR30KCS4vJHtQUk9HfSBn
+cGdzaWduZWQtYS5ncGcK
+====
+EOF
+ cat >expected32 <<EOF
+Good signature for b.gpg made Mon Sep 10 00:15:38 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+Good signature for b.gpg made Mon Sep 10 00:15:38 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+Good signature for b.gpg made Mon Sep 10 00:15:38 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+EOF
+ uudecode <<EOF
+begin-base64 644 expected33
+UFJPRz1wClNSQ1M9cGFyc2UuYwpXQVJOUz01Ck1LTUFOPW5vCkNQUEZMQUdTKz0t
+ZyAtTzAKTERGTEFHUys9LWcgLU8wCgouaW5jbHVkZSA8YnNkLnByb2cubWs+Cgp0
+OiAke1BST0d9CgkuLyR7UFJPR30gZ3Bnc2lnbmVkLWEuZ3BnCjEuIHRhZyAmIDB4
+M2YKMi4gbGVuCgpvbmUgcGFzcyAodGFnIDQpCj09PT09PT09CmIgdmVyc2lvbjoz
+CmIgc2lnIHR5cGUKYiBoYXNoIGFsZwpiIHB1YmtleSBhbGcKOGIga2V5aWQKCmxp
+dGVyYWwgZGF0YSAodGFnIDExKQo9PT09PT09PT09PT09CmIgYmluYXJ5L3RleHQK
+YiBsZW5ndGgKYyBzdHJpbmcKTCBtdGltZQp0ZXh0ClBST0c9cApTUkNTPXBhcnNl
+LmMKV0FSTlM9NQpNS01BTj1ubwpDUFBGTEFHUys9LWcgLU8wCkxERkxBR1MrPS1n
+IC1PMAoKLmluY2x1ZGUgPGJzZC5wcm9nLm1rPgoKdDogJHtQUk9HfQoJLi8ke1BS
+T0d9IGdwZ3NpZ25lZC1hLmdwZwo=
+====
+EOF
+ cat >expected34 <<EOF
+Good signature for det.sig made Thu Oct 18 02:12:33 2012
+signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
+fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
+uid Alistair Crooks <agc@alistaircrooks.com>
+uid Alistair Crooks <agc@pkgsrc.org>
+uid Alistair Crooks <agc@netbsd.org>
+uid Alistair Crooks <agc@netflix.com>
+encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12
+fingerprint: 57c0 c1e6 bf71 8845 416b 9522 79de b61e 488e ee74
+
+EOF
+ cat >expected35 <<EOF
+To Do
+=====
+tests with -k sig
+detached sigs
+DSA
+
+Done
+====
+basics
+localise pgp_read_packets
+fix lint
+WARNS=5
+lib man page
+prog man page
+do we do it statically linked as well?
+multiple files in netpgpverify
+EOF
+ atf_check -s eq:0 -o file:expected16 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify b.gpg
+ #atf_check -s eq:0 -o file:expected17 -e empty netpgpverify -c verify a.gpg
+ #atf_check -s eq:0 -o file:expected18 -e empty netpgpverify -c verify gpgsigned-a.gpg
+ #atf_check -s eq:0 -o file:expected19 -e empty netpgpverify -c verify NetBSD-6.0_RC2_hashes.asc
+ atf_check -s eq:0 -o file:expected20 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat jj.asc
+ #atf_check -s eq:0 -o file:expected21 -e empty netpgpverify < a.gpg
+ atf_check -s eq:0 -o file:expected22 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < jj.asc
+ #atf_check -s eq:0 -o file:expected23 -e empty netpgpverify < NetBSD-6.0_RC2_hashes.asc
+ atf_check -s eq:0 -o file:expected24 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < b.gpg
+ #atf_check -s eq:0 -o file:expected25 -e empty netpgpverify NetBSD-6.0_RC1_hashes.gpg
+ #atf_check -s eq:0 -o file:expected26 -e empty netpgpverify < NetBSD-6.0_RC1_hashes.gpg
+ atf_check -s eq:0 -o file:expected27 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < NetBSD-6.0_hashes.asc
+ atf_check -s eq:0 -o file:expected28 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg NetBSD-6.0_hashes.asc
+ #atf_check -s eq:0 -o file:expected29 -e empty netpgpverify NetBSD-6.0_RC1_hashes_ascii.gpg
+ #atf_check -s eq:0 -o file:expected30 -e empty netpgpverify < NetBSD-6.0_RC1_hashes_ascii.gpg
+ atf_check -s eq:0 -o file:expected31 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg b.gpg b.gpg
+ atf_check -s eq:0 -o file:expected32 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg b.gpg b.gpg b.gpg
+ atf_check -s eq:0 -o file:expected33 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg jj.asc b.gpg
+ atf_check -s eq:0 -o file:expected34 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg det.sig
+ atf_check -s eq:0 -o file:expected35 -e empty env TZ=US/Pacific netpgpverify -c cat -k pubring.gpg det.sig
+ #atf_check -s eq:0 -o file:expected46 -e empty netpgpverify -k problem-pubring.gpg NetBSD-6.0_hashes.asc
+
+}
+
+atf_test_case netpgpverify_dsa
+netpgpverify_dsa_head() {
+ atf_set "descr" "DSA signatures for netpgpverify"
+}
+netpgpverify_dsa_body() {
+ uudecode << EOF
+begin-base64 600 dsa-pubring.gpg
+mQMuBFCEe2cRCACCpppLdv4Ku5vSFNOp4Qrjc0bO28aoVK77w2lJiPS7F9OAWYg0
+N7AzamDMZolNdanmm4QZv8txwQC/d8XDB3viLmNDgi4D8/MNPvyL3PJ8AWi4ulkz
+/D6e4DPvLvjZzOH+ZroqIwiixzfIx50crLJdbCM3c5A/dz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NY1JzJl5hgGthk+VOfX8Ukucgl2sFHwTs1PTMnNS
+dcoUDPVM9QwN9AwVjAwMjfQNTPUNzBQMLawMTawMzRQS05MVXCsKFPS4uIJDnVw8
+g7RtOXMykxT0wh09QxBCSZl5XFx6mXnJOaUpqQo2ScUpesWlSSmZRXq52XZcHXEs
+DIIcDGysTCBXMHBxCsBct0iSkWHa0k9iZ5i+mtQ43zvsb7nA9sWeSrvwubEbQw0P
+MNe3Vuky/C+59v/fFbGv5ofnzRSY/ld6vkfIxCtxoVEnvHZVrZeeb60BAA==
+====
+EOF
+ cat > in1.asc << EOF
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+# .NetBSD: Makefile,v 1.5.10.1 2012/05/06 18:14:16 agc Exp .
+
+SUBDIR+= lib .WAIT
+SUBDIR+= bin
+
+.include <bsd.subdir.mk>
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.11 (NetBSD)
+
+iF4EAREIAAYFAlCFMdYACgkQJj/nhWLi/H7CkQEAgDQrFwPD76JC+6FnOKEz/9DP
+H7WjRRMoIQNTGC3ZXRsA/1xah8eFePQDmTO1sQGnINbgX9vZ7GAFOgTjW7+tVb7H
+=wtKb
+-----END PGP SIGNATURE-----
+EOF
+ uudecode << EOF
+begin-base64 644 in2.gpg
+owGbwMvMwCGoZv+8NenRnzrGNU1JzJl5RgGtHj+VOfX8Ukucgl2sFHwTs1PTMnNS
+dcoUDPVM9QwN9AwVjAwMjfQNTPUNzBQMLawMTawMzRQS05MVXCsKFPQUuLiCQ51c
+PIO0bTlzMpMU9MIdPUMQQkmZeVxcepl5yTmlKakKNknFKXrFpUkpmUV6udl2XB1x
+LAyCHAxsrEwgZzBwcQrAnFfzjeGv9GtuvQj7X/Kv5IQ8f2s9n/36yaOmu9HPs8/V
+8pg+SdfaxMhwdEOjtLVOGtuaizmXnJ8oa4fN/bfL0WfP1smOn38vsLFlBQA=
+====
+EOF
+ cat > in2.asc << EOF
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+# .NetBSD: Makefile,v 1.5.10.1 2012/05/06 18:14:16 agc Exp .
+
+SUBDIR+= lib .WAIT
+SUBDIR+= bin
+
+.include <bsd.subdir.mk>
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.11 (NetBSD)
+
+iF4EAREIAAYFAlCFSQoACgkQJj/nhWLi/H6aKAD9HCLTwY8CwiqTXrzKxHZ5lHQn
+qEZbcbXjkCxlk+m/PHUA/2Whlc0t5ZtmI221LQy5inTnzpu1U75E5lJvw0YMTdXJ
+=v788
+-----END PGP SIGNATURE-----
+EOF
+ cat > expected36 << EOF
+Good signature for in1.gpg made Mon Oct 22 04:45:41 2012
+signature 2048/DSA 263fe78562e2fc7e 2012-10-21
+fingerprint: d2e5 07b6 5d59 33d3 9c8d a618 263f e785 62e2 fc7e
+uid David Armstrong (Test DSA key - do not use) <dsa@dsa.com>
+encryption 2048/Elgamal (Encrypt Only) 53d1f21240f293c6 2012-10-21 [Expiry 2014-10-21]
+fingerprint: 6a83 d4aa 791f d8af a967 5e44 53d1 f212 40f2 93c6
+
+EOF
+ cat >expected37 <<EOF
+Good signature for [stdin] made Mon Oct 22 04:45:41 2012
+signature 2048/DSA 263fe78562e2fc7e 2012-10-21
+fingerprint: d2e5 07b6 5d59 33d3 9c8d a618 263f e785 62e2 fc7e
+uid David Armstrong (Test DSA key - do not use) <dsa@dsa.com>
+encryption 2048/Elgamal (Encrypt Only) 53d1f21240f293c6 2012-10-21 [Expiry 2014-10-21]
+fingerprint: 6a83 d4aa 791f d8af a967 5e44 53d1 f212 40f2 93c6
+
+EOF
+ cat >expected38 <<EOF
+Good signature for in1.asc made Mon Oct 22 04:45:26 2012
+signature 2048/DSA 263fe78562e2fc7e 2012-10-21
+fingerprint: d2e5 07b6 5d59 33d3 9c8d a618 263f e785 62e2 fc7e
+uid David Armstrong (Test DSA key - do not use) <dsa@dsa.com>
+encryption 2048/Elgamal (Encrypt Only) 53d1f21240f293c6 2012-10-21 [Expiry 2014-10-21]
+fingerprint: 6a83 d4aa 791f d8af a967 5e44 53d1 f212 40f2 93c6
+
+EOF
+ cat >expected39 <<EOF
+Good signature for [stdin] made Mon Oct 22 04:45:26 2012
+signature 2048/DSA 263fe78562e2fc7e 2012-10-21
+fingerprint: d2e5 07b6 5d59 33d3 9c8d a618 263f e785 62e2 fc7e
+uid David Armstrong (Test DSA key - do not use) <dsa@dsa.com>
+encryption 2048/Elgamal (Encrypt Only) 53d1f21240f293c6 2012-10-21 [Expiry 2014-10-21]
+fingerprint: 6a83 d4aa 791f d8af a967 5e44 53d1 f212 40f2 93c6
+
+EOF
+ cat >expected40 <<EOF
+# .NetBSD: Makefile,v 1.5.10.1 2012/05/06 18:14:16 agc Exp .
+
+SUBDIR+= lib .WAIT
+SUBDIR+= bin
+
+.include <bsd.subdir.mk>
+EOF
+ cat >expected41 <<EOF
+# .NetBSD: Makefile,v 1.5.10.1 2012/05/06 18:14:16 agc Exp .
+
+SUBDIR+= lib .WAIT
+SUBDIR+= bin
+
+.include <bsd.subdir.mk>
+EOF
+ cat >expected42 <<EOF
+# .NetBSD: Makefile,v 1.5.10.1 2012/05/06 18:14:16 agc Exp .
+
+SUBDIR+= lib .WAIT
+SUBDIR+= bin
+
+.include <bsd.subdir.mk>
+EOF
+ cat >expected43 <<EOF
+# .NetBSD: Makefile,v 1.5.10.1 2012/05/06 18:14:16 agc Exp .
+
+SUBDIR+= lib .WAIT
+SUBDIR+= bin
+
+.include <bsd.subdir.mk>
+EOF
+ cat >expected44 <<EOF
+Good signature for in2.gpg made Mon Oct 22 06:24:09 2012
+signature 2048/DSA 263fe78562e2fc7e 2012-10-21
+fingerprint: d2e5 07b6 5d59 33d3 9c8d a618 263f e785 62e2 fc7e
+uid David Armstrong (Test DSA key - do not use) <dsa@dsa.com>
+encryption 2048/Elgamal (Encrypt Only) 53d1f21240f293c6 2012-10-21 [Expiry 2014-10-21]
+fingerprint: 6a83 d4aa 791f d8af a967 5e44 53d1 f212 40f2 93c6
+
+EOF
+ cat >expected45 <<EOF
+Good signature for in2.asc made Mon Oct 22 06:24:26 2012
+signature 2048/DSA 263fe78562e2fc7e 2012-10-21
+fingerprint: d2e5 07b6 5d59 33d3 9c8d a618 263f e785 62e2 fc7e
+uid David Armstrong (Test DSA key - do not use) <dsa@dsa.com>
+encryption 2048/Elgamal (Encrypt Only) 53d1f21240f293c6 2012-10-21 [Expiry 2014-10-21]
+fingerprint: 6a83 d4aa 791f d8af a967 5e44 53d1 f212 40f2 93c6
+
+EOF
+ cat >expected46 <<EOF
+Ignoring unusual/reserved signature subpacket 18
+Good signature for NetBSD-6.0_hashes.asc made Mon Oct 15 09:28:54 2012
+signature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
+fingerprint: ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
+uid NetBSD Security Officer <security-officer@NetBSD.org>
+encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
+fingerprint: 1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620
+
+EOF
+ atf_check -s eq:0 -o file:expected36 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.gpg
+ atf_check -s eq:0 -o file:expected37 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.gpg
+ atf_check -s eq:0 -o file:expected38 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.asc
+ atf_check -s eq:0 -o file:expected39 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.asc
+ atf_check -s eq:0 -o file:expected40 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.gpg
+ atf_check -s eq:0 -o file:expected41 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.gpg
+ atf_check -s eq:0 -o file:expected42 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.asc
+ atf_check -s eq:0 -o file:expected43 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.asc
+ atf_check -s eq:0 -o file:expected44 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.gpg
+ atf_check -s eq:0 -o file:expected45 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.asc
+}
+
+atf_init_test_cases() {
+ atf_add_test_case netpgpverify_rsa
+ atf_add_test_case netpgpverify_dsa
+}
diff --git a/contrib/netbsd-tests/usr.bin/pr/d_basic.in b/contrib/netbsd-tests/usr.bin/pr/d_basic.in
new file mode 100644
index 0000000..4e36f6e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/pr/d_basic.in
@@ -0,0 +1,2 @@
+123 456 789
+abc def ghi
diff --git a/contrib/netbsd-tests/usr.bin/pr/d_basic.out b/contrib/netbsd-tests/usr.bin/pr/d_basic.out
new file mode 100644
index 0000000..e187104
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/pr/d_basic.out
@@ -0,0 +1 @@
+123 456 789 abc def ghi
diff --git a/contrib/netbsd-tests/usr.bin/pr/t_basic.sh b/contrib/netbsd-tests/usr.bin/pr/t_basic.sh
new file mode 100755
index 0000000..6bd80dd
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/pr/t_basic.sh
@@ -0,0 +1,46 @@
+# $NetBSD: t_basic.sh,v 1.4 2012/03/13 05:40:00 jruoho Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "A basic test of pr(1) (cf. PR bin/41880)"
+}
+
+basic_body() {
+
+ # The output file was generated with "pr (GNU coreutils) 6.10".
+ #
+ atf_check -s ignore -o file:$(atf_get_srcdir)/d_basic.out \
+ -x "pr -t -2 $(atf_get_srcdir)/d_basic.in"
+}
+
+atf_init_test_cases() {
+ atf_add_test_case basic
+}
diff --git a/contrib/netbsd-tests/usr.bin/rump_server/t_disk.sh b/contrib/netbsd-tests/usr.bin/rump_server/t_disk.sh
new file mode 100755
index 0000000..bf1e7e1
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/rump_server/t_disk.sh
@@ -0,0 +1,130 @@
+# $NetBSD: t_disk.sh,v 1.5 2013/02/19 21:08:25 joerg Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+server='rump_server -lrumpvfs'
+export RUMP_SERVER='unix://commsock'
+
+startsrv()
+{
+
+ atf_check -s exit:0 ${server} $@ ${RUMP_SERVER}
+}
+
+test_case()
+{
+ local name="${1}"; shift
+
+ atf_test_case "${name}" cleanup
+ eval "${name}_head() { \
+ atf_set "require.progs" "rump_server" ; \
+ }"
+ eval "${name}_body() { \
+ ${name}_prefun ; \
+ startsrv $@ ; \
+ ${name} ; \
+ }"
+ eval "${name}_cleanup() { \
+ [ -f halted ] && return 0 ; rump.halt ;
+ }"
+}
+
+test_case size -d key=/img,hostpath=the.img,size=32k
+size()
+{
+ atf_check -s exit:0 -o inline:'32768\n' stat -f %z the.img
+}
+
+test_case offset -d key=/img,hostpath=the.img,size=32k,offset=16k
+offset()
+{
+ atf_check -s exit:0 -o inline:'49152\n' stat -f %z the.img
+}
+
+test_case notrunc -d key=/img,hostpath=the.img,size=8k,offset=16k
+notrunc_prefun()
+{
+ dd if=/dev/zero of=the.img bs=1 oseek=65535 count=1
+}
+notrunc()
+{
+ atf_check -s exit:0 -o inline:'65536\n' stat -f %z the.img
+}
+
+test_case data -d key=/img,hostpath=the.img,size=8k,offset=16k
+data()
+{
+ echo 'test string' | dd of=testfile ibs=512 count=1 conv=sync
+ atf_check -s exit:0 -e ignore -x \
+ "dd if=testfile | rump.dd of=/img bs=512 count=1"
+
+ # cheap fsync
+ atf_check -s exit:0 rump.halt
+ touch halted
+ atf_check -s exit:0 -e ignore -o file:testfile \
+ dd if=the.img iseek=16k bs=1 count=512
+}
+
+test_case type_chr -d key=/img,hostpath=the.img,size=32k,type=chr
+type_chr()
+{
+ atf_check -s exit:0 -o inline:'Character Device\n' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so stat -f %HT /rump/img
+}
+
+test_case type_reg -d key=/img,hostpath=the.img,size=32k,type=reg
+type_reg()
+{
+ atf_check -s exit:0 -o inline:'Regular File\n' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so stat -f %HT /rump/img
+}
+
+test_case type_blk -d key=/img,hostpath=the.img,size=32k,type=blk
+type_blk()
+{
+ atf_check -s exit:0 -o inline:'Block Device\n' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so stat -f %HT /rump/img
+}
+
+test_case type_blk_default -d key=/img,hostpath=the.img,size=32k
+type_blk_default()
+{
+ atf_check -s exit:0 -o inline:'Block Device\n' \
+ env LD_PRELOAD=/usr/lib/librumphijack.so stat -f %HT /rump/img
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case size
+ atf_add_test_case offset
+ atf_add_test_case notrunc
+ atf_add_test_case data
+ atf_add_test_case type_chr
+ atf_add_test_case type_reg
+ atf_add_test_case type_blk
+ atf_add_test_case type_blk_default
+}
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_dot.in b/contrib/netbsd-tests/usr.bin/sdiff/d_dot.in
new file mode 100644
index 0000000..9c558e3
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_dot.in
@@ -0,0 +1 @@
+.
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_flags_l.out b/contrib/netbsd-tests/usr.bin/sdiff/d_flags_l.out
new file mode 100644
index 0000000..c7afce0
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_flags_l.out
@@ -0,0 +1,102 @@
+Policy: /usr/bin/lynx, Emulation: native
+ > native-issetugid: permit
+ > native-mprotect: permit
+ > native-mmap: permit
+ native-__sysctl: permit
+ > native-fsread: filename eq "/var/run/ld.so.hints" then perm
+ > native-fstat: permit
+ native-close: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then perm | native-fsread: filename match "/usr/lib/libssl.so.*" then p
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then per | native-read: permit
+ native-exit: permit | native-fsread: filename match "/usr/lib/libcrypto.so.*" the
+ native-fcntl: cmd eq "F_SETFD" then permit | native-fsread: filename match "/usr/lib/libncurses.so.*" th
+ native-fsread: filename eq "/" then permit | native-fsread: filename match "/usr/lib/libc.so.*" then per
+ native-fsread: filename match "/<non-existent filename>: *" | native-munmap: permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit | native-sigprocmask: permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-getpid: permit
+ native-fsread: filename eq "/etc/utmp" then permit <
+ native-fsread: filename eq "/home" then permit <
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then permi <
+ native-fsread: filename eq "$HOME/.lynxrc" then permit <
+ native-fsread: filename eq "$HOME/.mailcap" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permit <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then permit <
+ native-fsread: filename eq "/obj" then permit <
+ native-fsread: filename eq "/tmp" then permit
+ > native-fswrite: filename match "/tmp/lynx-*" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "/etc/lynx.cfg" then permit
+ > native-fsread: filename eq "/" then permit
+ > native-fsread: filename eq "/usr/obj/bin/systrace/." then p
+ > native-fsread: filename eq "/usr/obj/bin" then permit
+ > native-fcntl: permit
+ > native-getdirentries: permit
+ > native-lseek: permit
+ > native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then per <
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" the <
+ native-fsread: filename match "/usr/lib/libncurses.so.*" th <
+ native-fsread: filename match "/usr/lib/libssl.so.*" then p <
+ native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/usr/obj" then permit | native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit | native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then p | native-fsread: filename eq "$HOME/.lynxrc" then permit
+ > native-fsread: filename match "/<non-existent filename>: *"
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailcap"
+ > native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.typ
+ > native-fsread: filename eq "$HOME/.mime.types" then permit
+ > native-sigaction: permit
+ > native-ioctl: permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then permit
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" th
+ > native-pread: permit
+ > native-write: permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then permi
+ native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then perm | native-fsread: filename eq "/etc/utmp" then permit
+ native-fstat: permit <
+ native-fswrite: filename match "/tmp/lynx-*" then permit <
+ native-getdirentries: permit <
+ native-getpid: permit <
+ native-gettimeofday: permit <
+ native-ioctl: permit <
+ native-issetugid: permit <
+ native-lseek: permit <
+ native-mmap: permit <
+ native-mprotect: prot eq "PROT_READ" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" t <
+ native-munmap: permit <
+ native-nanosleep: permit <
+ native-poll: permit
+ native-pread: permit | native-nanosleep: permit
+ native-read: permit | native-gettimeofday: permit
+ native-recvfrom: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-select: permit <
+ native-sendto: true then permit <
+ native-sigaction: permit <
+ native-sigprocmask: permit <
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_D
+ > native-connect: sockaddr eq "inet-[127.0.0.1]:53" then perm
+ > native-sendto: true then permit
+ > native-select: permit
+ > native-recvfrom: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_S
+ native-write: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then per
+ > native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_flags_s.out b/contrib/netbsd-tests/usr.bin/sdiff/d_flags_s.out
new file mode 100644
index 0000000..19179fe
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_flags_s.out
@@ -0,0 +1,79 @@
+ > native-issetugid: permit
+ > native-mprotect: permit
+ > native-mmap: permit
+ > native-fsread: filename eq "/var/run/ld.so.hints" then perm
+ > native-fstat: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then perm | native-fsread: filename match "/usr/lib/libssl.so.*" then p
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then per | native-read: permit
+ native-exit: permit | native-fsread: filename match "/usr/lib/libcrypto.so.*" the
+ native-fcntl: cmd eq "F_SETFD" then permit | native-fsread: filename match "/usr/lib/libncurses.so.*" th
+ native-fsread: filename eq "/" then permit | native-fsread: filename match "/usr/lib/libc.so.*" then per
+ native-fsread: filename match "/<non-existent filename>: *" | native-munmap: permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit | native-sigprocmask: permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-getpid: permit
+ native-fsread: filename eq "/etc/utmp" then permit <
+ native-fsread: filename eq "/home" then permit <
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then permi <
+ native-fsread: filename eq "$HOME/.lynxrc" then permit <
+ native-fsread: filename eq "$HOME/.mailcap" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permit <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then permit <
+ native-fsread: filename eq "/obj" then permit <
+ > native-fswrite: filename match "/tmp/lynx-*" then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "/etc/lynx.cfg" then permit
+ > native-fsread: filename eq "/" then permit
+ > native-fsread: filename eq "/usr/obj/bin/systrace/." then p
+ > native-fsread: filename eq "/usr/obj/bin" then permit
+ > native-fcntl: permit
+ > native-getdirentries: permit
+ > native-lseek: permit
+ > native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then per <
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" the <
+ native-fsread: filename match "/usr/lib/libncurses.so.*" th <
+ native-fsread: filename match "/usr/lib/libssl.so.*" then p <
+ native-fsread: filename eq "/usr/obj" then permit | native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit | native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then p | native-fsread: filename eq "$HOME/.lynxrc" then permit
+ > native-fsread: filename match "/<non-existent filename>: *"
+ > native-fsread: filename eq "$HOME/.mailcap" then permit
+ > native-fsread: filename eq "$HOME/.mime.types" then permit
+ > native-sigaction: permit
+ > native-ioctl: permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then permit
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ > native-pread: permit
+ > native-write: permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then permi
+ native-fsread: filename eq "/var/run/ld.so.hints" then perm | native-fsread: filename eq "/etc/utmp" then permit
+ native-fstat: permit <
+ native-fswrite: filename match "/tmp/lynx-*" then permit <
+ native-getdirentries: permit <
+ native-getpid: permit <
+ native-gettimeofday: permit <
+ native-ioctl: permit <
+ native-issetugid: permit <
+ native-lseek: permit <
+ native-mmap: permit <
+ native-mprotect: prot eq "PROT_READ" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" t <
+ native-munmap: permit <
+ native-nanosleep: permit <
+ native-pread: permit | native-nanosleep: permit
+ native-read: permit | native-gettimeofday: permit
+ native-recvfrom: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-select: permit <
+ native-sendto: true then permit <
+ native-sigaction: permit <
+ native-sigprocmask: permit <
+ > native-connect: sockaddr eq "inet-[127.0.0.1]:53" then perm
+ > native-sendto: true then permit
+ > native-select: permit
+ > native-recvfrom: permit
+ native-write: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then per
+ > native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_flags_w.out b/contrib/netbsd-tests/usr.bin/sdiff/d_flags_w.out
new file mode 100644
index 0000000..19ea79b
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_flags_w.out
@@ -0,0 +1,102 @@
+Policy: /usr/bin/lynx, Emulation: native Policy: /usr/bin/lynx, Emulation: native
+ > native-issetugid: permit
+ > native-mprotect: permit
+ > native-mmap: permit
+ native-__sysctl: permit native-__sysctl: permit
+ > native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ > native-fstat: permit
+ native-close: permit native-close: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-fsread: filename match "/usr/lib/libssl.so.*" then
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-read: permit
+ native-exit: permit | native-fsread: filename match "/usr/lib/libcrypto.so.*" t
+ native-fcntl: cmd eq "F_SETFD" then permit | native-fsread: filename match "/usr/lib/libncurses.so.*"
+ native-fsread: filename eq "/" then permit | native-fsread: filename match "/usr/lib/libc.so.*" then p
+ native-fsread: filename match "/<non-existent filename>: | native-munmap: permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit | native-sigprocmask: permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-getpid: permit
+ native-fsread: filename eq "/etc/utmp" then permit <
+ native-fsread: filename eq "/home" then permit <
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "$HOME/.lynxrc" then permit <
+ native-fsread: filename eq "$HOME/.mailcap" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "/obj" then permit <
+ native-fsread: filename eq "/tmp" then permit native-fsread: filename eq "/tmp" then permit
+ > native-fswrite: filename match "/tmp/lynx-*" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit native-fsread: filename match "/tmp/lynx-*/." then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "/etc/lynx.cfg" then permit
+ > native-fsread: filename eq "/" then permit
+ > native-fsread: filename eq "/usr/obj/bin/systrace/." then
+ > native-fsread: filename eq "/usr/obj/bin" then permit
+ > native-fcntl: permit
+ > native-getdirentries: permit
+ > native-lseek: permit
+ > native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr" then permit native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then p <
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" t <
+ native-fsread: filename match "/usr/lib/libncurses.so.*" <
+ native-fsread: filename match "/usr/lib/libssl.so.*" then <
+ native-fsread: filename eq "/usr/libdata" then permit native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/usr/libexec" then permit native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/usr/lkm" then permit native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "/usr/local" then permit native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/mdec" then permit native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/usr/obj" then permit | native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit | native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then | native-fsread: filename eq "$HOME/.lynxrc" then permit
+ > native-fsread: filename match "/<non-existent filename>:
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailca native-fsread: filename eq "/usr/obj/bin/systrace/.mailca
+ > native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-sigaction: permit
+ > native-ioctl: permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" native-fsread: filename eq "/usr/share/misc/terminfo.db"
+ > native-pread: permit
+ > native-write: permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ native-fsread: filename eq "/var/run/dev.db" then permit native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe | native-fsread: filename eq "/etc/utmp" then permit
+ native-fstat: permit <
+ native-fswrite: filename match "/tmp/lynx-*" then permit <
+ native-getdirentries: permit <
+ native-getpid: permit <
+ native-gettimeofday: permit <
+ native-ioctl: permit <
+ native-issetugid: permit <
+ native-lseek: permit <
+ native-mmap: permit <
+ native-mprotect: prot eq "PROT_READ" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" <
+ native-munmap: permit <
+ native-nanosleep: permit <
+ native-poll: permit native-poll: permit
+ native-pread: permit | native-nanosleep: permit
+ native-read: permit | native-gettimeofday: permit
+ native-recvfrom: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-select: permit <
+ native-sendto: true then permit <
+ native-sigaction: permit <
+ native-sigprocmask: permit <
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ > native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ > native-sendto: true then permit
+ > native-select: permit
+ > native-recvfrom: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ native-write: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ > native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_a1.out b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_a1.out
new file mode 100644
index 0000000..2a0f532
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_a1.out
@@ -0,0 +1,100 @@
+Policy: /usr/bin/lynx, Emulation: native Policy: /usr/bin/lynx, Emulation: native
+ > native-issetugid: permit
+ > native-mprotect: permit
+ > native-mmap: permit
+ native-__sysctl: permit native-__sysctl: permit
+ > native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ > native-fstat: permit
+ native-close: permit native-close: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-fsread: filename match "/usr/lib/libssl.so.*" then
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-read: permit
+ native-exit: permit | native-fsread: filename match "/usr/lib/libcrypto.so.*" t
+ native-fcntl: cmd eq "F_SETFD" then permit | native-fsread: filename match "/usr/lib/libncurses.so.*"
+ native-fsread: filename eq "/" then permit | native-fsread: filename match "/usr/lib/libc.so.*" then p
+ native-fsread: filename match "/<non-existent filename>: | native-munmap: permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit | native-sigprocmask: permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-getpid: permit
+ native-fsread: filename eq "/etc/utmp" then permit <
+ native-fsread: filename eq "/home" then permit <
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "$HOME/.lynxrc" then permit <
+ native-fsread: filename eq "$HOME/.mailcap" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "/obj" then permit <
+ native-fsread: filename eq "/tmp" then permit native-fsread: filename eq "/tmp" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit native-fswrite: filename match "/tmp/lynx-*" then permit
+ ) native-fsread: filename match "/tmp/lynx-*/." then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "/etc/lynx.cfg" then permit
+ > native-fsread: filename eq "/" then permit
+ > native-fsread: filename eq "/usr/obj/bin/systrace/." then
+ > native-fsread: filename eq "/usr/obj/bin" then permit
+ > native-fcntl: permit
+ > native-getdirentries: permit
+ > native-lseek: permit
+ > native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr" then permit native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then p native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" t native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename match "/usr/lib/libssl.so.*" then native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/libdata" then permit native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/usr/libexec" then permit native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "/usr/lkm" then permit native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/usr/local" then permit native-fsread: filename eq "$HOME/.lynxrc" then permit
+ native-fsread: filename eq "/usr/mdec" then permit native-fsread: filename match "/<non-existent filename>:
+ native-fsread: filename eq "/usr/obj" then permit native-fsread: filename eq "/usr/obj/bin/systrace/.mailca
+ native-fsread: filename eq "/usr/obj/bin" then permit native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailca (
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t (
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-sigaction: permit
+ > native-ioctl: permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" native-fsread: filename eq "/usr/share/misc/terminfo.db"
+ > native-pread: permit
+ > native-write: permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ native-fsread: filename eq "/var/run/dev.db" then permit native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe | native-fsread: filename eq "/etc/utmp" then permit
+ native-fstat: permit <
+ native-fswrite: filename match "/tmp/lynx-*" then permit <
+ native-getdirentries: permit <
+ native-getpid: permit <
+ native-gettimeofday: permit <
+ native-ioctl: permit <
+ native-issetugid: permit <
+ native-lseek: permit <
+ native-mmap: permit <
+ native-mprotect: prot eq "PROT_READ" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" <
+ native-munmap: permit <
+ native-nanosleep: permit <
+ native-poll: permit native-poll: permit
+ native-pread: permit | native-nanosleep: permit
+ native-read: permit | native-gettimeofday: permit
+ native-recvfrom: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-select: permit <
+ native-sendto: true then permit <
+ native-sigaction: permit <
+ native-sigprocmask: permit <
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ > native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ > native-sendto: true then permit
+ > native-select: permit
+ > native-recvfrom: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ native-write: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ > native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_a2.out b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_a2.out
new file mode 100644
index 0000000..4e0d349
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_a2.out
@@ -0,0 +1,96 @@
+Policy: /usr/bin/lynx, Emulation: native Policy: /usr/bin/lynx, Emulation: native
+ native-issetugid: permit <
+ native-mprotect: permit <
+ native-mmap: permit <
+ native-__sysctl: permit native-__sysctl: permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe <
+ native-fstat: permit <
+ native-close: permit native-close: permit
+ native-fsread: filename match "/usr/lib/libssl.so.*" then | native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ native-read: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" t | native-exit: permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" | native-fcntl: cmd eq "F_SETFD" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then p | native-fsread: filename eq "/" then permit
+ native-munmap: permit | native-fsread: filename match "/<non-existent filename>:
+ native-sigprocmask: permit | native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-getpid: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ > native-fsread: filename eq "/etc/utmp" then permit
+ > native-fsread: filename eq "/home" then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ > native-fsread: filename eq "$HOME/.lynxrc" then permit
+ > native-fsread: filename eq "$HOME/.mailcap" then permit
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/tmp" then permit native-fsread: filename eq "/tmp" then permit
+ native-fswrite: filename match "/tmp/lynx-*" then permit native-fsread: filename match "/tmp/lynx-*/." then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit (
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "/etc/lynx.cfg" then permit <
+ native-fsread: filename eq "/" then permit <
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then <
+ native-fsread: filename eq "/usr/obj/bin" then permit <
+ native-fcntl: permit <
+ native-getdirentries: permit <
+ native-lseek: permit <
+ native-fsread: filename eq "/usr/obj" then permit <
+ native-fsread: filename eq "/usr" then permit native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename eq "/usr/libdata" then permit native-fsread: filename match "/usr/lib/libc.so.*" then p
+ native-fsread: filename eq "/usr/libexec" then permit native-fsread: filename match "/usr/lib/libcrypto.so.*" t
+ native-fsread: filename eq "/usr/lkm" then permit native-fsread: filename match "/usr/lib/libncurses.so.*"
+ native-fsread: filename eq "/usr/local" then permit native-fsread: filename match "/usr/lib/libssl.so.*" then
+ native-fsread: filename eq "/usr/mdec" then permit native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/home" then permit native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/obj" then permit native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "$HOME/.lynxrc" then permit native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename match "/<non-existent filename>: native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailca native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "$HOME/.mailcap" then permit native-fsread: filename eq "/usr/obj/bin" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t native-fsread: filename eq "/usr/obj/bin/systrace/." then
+ ) native-fsread: filename eq "/usr/obj/bin/systrace/.mailca
+ ) native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-sigaction: permit <
+ native-ioctl: permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" native-fsread: filename eq "/usr/share/misc/terminfo.db"
+ native-pread: permit <
+ native-write: permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "/var/run/dev.db" then permit native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/etc/utmp" then permit | native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ native-poll: permit | native-fstat: permit
+ native-nanosleep: permit | native-fswrite: filename match "/tmp/lynx-*" then permit
+ > native-getdirentries: permit
+ > native-getpid: permit
+ native-gettimeofday: permit native-gettimeofday: permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-ioctl: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK | native-issetugid: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-lseek: permit
+ native-sendto: true then permit | native-mmap: permit
+ native-select: permit | native-mprotect: prot eq "PROT_READ" then permit
+ > native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi
+ > native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm
+ > native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC"
+ > native-munmap: permit
+ > native-nanosleep: permit
+ > native-poll: permit
+ > native-pread: permit
+ > native-read: permit
+ native-recvfrom: permit native-recvfrom: permit
+ > native-select: permit
+ > native-sendto: true then permit
+ > native-sigaction: permit
+ > native-sigprocmask: permit
+ > native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-write: permit
+ native-exit: permit <
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_b1.out b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_b1.out
new file mode 100644
index 0000000..3e548b6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_b1.out
@@ -0,0 +1,69 @@
+ > native-issetugid: permit
+ > native-mprotect: permit
+ > native-mmap: permit
+ > native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ > native-fstat: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-fsread: filename match "/usr/lib/libssl.so.*" then
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-read: permit
+ native-exit: permit | native-fsread: filename match "/usr/lib/libcrypto.so.*" t
+ native-fcntl: cmd eq "F_SETFD" then permit | native-fsread: filename match "/usr/lib/libncurses.so.*"
+ native-fsread: filename eq "/" then permit | native-fsread: filename match "/usr/lib/libc.so.*" then p
+ native-fsread: filename match "/<non-existent filename>: | native-munmap: permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit | native-sigprocmask: permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-getpid: permit
+ native-fsread: filename eq "/etc/utmp" then permit <
+ native-fsread: filename eq "/home" then permit <
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "$HOME/.lynxrc" then permit <
+ native-fsread: filename eq "$HOME/.mailcap" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "/obj" then permit <
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "/etc/lynx.cfg" then permit
+ > native-fsread: filename eq "/" then permit
+ > native-fsread: filename eq "/usr/obj/bin/systrace/." then
+ > native-fsread: filename eq "/usr/obj/bin" then permit
+ > native-fcntl: permit
+ > native-getdirentries: permit
+ > native-lseek: permit
+ > native-fsread: filename eq "/usr/obj" then permit
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-sigaction: permit
+ > native-ioctl: permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ > native-pread: permit
+ > native-write: permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe | native-fsread: filename eq "/etc/utmp" then permit
+ native-fstat: permit <
+ native-fswrite: filename match "/tmp/lynx-*" then permit <
+ native-getdirentries: permit <
+ native-getpid: permit <
+ native-gettimeofday: permit <
+ native-ioctl: permit <
+ native-issetugid: permit <
+ native-lseek: permit <
+ native-mmap: permit <
+ native-mprotect: prot eq "PROT_READ" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" <
+ native-munmap: permit <
+ native-nanosleep: permit <
+ native-pread: permit | native-nanosleep: permit
+ native-read: permit | native-gettimeofday: permit
+ native-recvfrom: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-select: permit <
+ native-sendto: true then permit <
+ native-sigaction: permit <
+ native-sigprocmask: permit <
+ > native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ > native-sendto: true then permit
+ > native-select: permit
+ > native-recvfrom: permit
+ native-write: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ > native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_b2.out b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_b2.out
new file mode 100644
index 0000000..4504c36
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_b2.out
@@ -0,0 +1,65 @@
+ native-issetugid: permit <
+ native-mprotect: permit <
+ native-mmap: permit <
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe <
+ native-fstat: permit <
+ native-fsread: filename match "/usr/lib/libssl.so.*" then | native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ native-read: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" t | native-exit: permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" | native-fcntl: cmd eq "F_SETFD" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then p | native-fsread: filename eq "/" then permit
+ native-munmap: permit | native-fsread: filename match "/<non-existent filename>:
+ native-sigprocmask: permit | native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-getpid: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ > native-fsread: filename eq "/etc/utmp" then permit
+ > native-fsread: filename eq "/home" then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ > native-fsread: filename eq "$HOME/.lynxrc" then permit
+ > native-fsread: filename eq "$HOME/.mailcap" then permit
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "/etc/lynx.cfg" then permit <
+ native-fsread: filename eq "/" then permit <
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then <
+ native-fsread: filename eq "/usr/obj/bin" then permit <
+ native-fcntl: permit <
+ native-getdirentries: permit <
+ native-lseek: permit <
+ native-fsread: filename eq "/usr/obj" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-sigaction: permit <
+ native-ioctl: permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-pread: permit <
+ native-write: permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "/etc/utmp" then permit | native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ native-poll: permit | native-fstat: permit
+ native-nanosleep: permit | native-fswrite: filename match "/tmp/lynx-*" then permit
+ > native-getdirentries: permit
+ > native-getpid: permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-ioctl: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK | native-issetugid: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-lseek: permit
+ native-sendto: true then permit | native-mmap: permit
+ native-select: permit | native-mprotect: prot eq "PROT_READ" then permit
+ > native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi
+ > native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm
+ > native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC"
+ > native-munmap: permit
+ > native-nanosleep: permit
+ > native-poll: permit
+ > native-pread: permit
+ > native-read: permit
+ > native-select: permit
+ > native-sendto: true then permit
+ > native-sigaction: permit
+ > native-sigprocmask: permit
+ > native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-write: permit
+ native-exit: permit <
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_c1.out b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_c1.out
new file mode 100644
index 0000000..e9ac88e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_c1.out
@@ -0,0 +1,99 @@
+Policy: /usr/bin/lynx, Emulation: native (
+ > native-issetugid: permit
+ > native-mprotect: permit
+ > native-mmap: permit
+ native-__sysctl: permit (
+ > native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ > native-fstat: permit
+ native-close: permit (
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-fsread: filename match "/usr/lib/libssl.so.*" then
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-read: permit
+ native-exit: permit | native-fsread: filename match "/usr/lib/libcrypto.so.*" t
+ native-fcntl: cmd eq "F_SETFD" then permit | native-fsread: filename match "/usr/lib/libncurses.so.*"
+ native-fsread: filename eq "/" then permit | native-fsread: filename match "/usr/lib/libc.so.*" then p
+ native-fsread: filename match "/<non-existent filename>: | native-munmap: permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit | native-sigprocmask: permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit (
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-getpid: permit
+ native-fsread: filename eq "/etc/utmp" then permit <
+ native-fsread: filename eq "/home" then permit <
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "$HOME/.lynxrc" then permit <
+ native-fsread: filename eq "$HOME/.mailcap" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "/obj" then permit <
+ native-fsread: filename eq "/tmp" then permit (
+ native-fsread: filename match "/tmp/lynx-*/." then permit (
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "/etc/lynx.cfg" then permit
+ > native-fsread: filename eq "/" then permit
+ > native-fsread: filename eq "/usr/obj/bin/systrace/." then
+ > native-fsread: filename eq "/usr/obj/bin" then permit
+ > native-fcntl: permit
+ > native-getdirentries: permit
+ > native-lseek: permit
+ > native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr" then permit (
+ native-fsread: filename eq "/usr/bin" then permit (
+ native-fsread: filename eq "/usr/games" then permit (
+ native-fsread: filename eq "/usr/include" then permit (
+ native-fsread: filename eq "/usr/lib" then permit (
+ native-fsread: filename match "/usr/lib/libc.so.*" then p (
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" t (
+ native-fsread: filename match "/usr/lib/libncurses.so.*" (
+ native-fsread: filename match "/usr/lib/libssl.so.*" then (
+ native-fsread: filename eq "/usr/libdata" then permit (
+ native-fsread: filename eq "/usr/libexec" then permit (
+ native-fsread: filename eq "/usr/lkm" then permit (
+ native-fsread: filename eq "/usr/local" then permit (
+ native-fsread: filename eq "/usr/mdec" then permit (
+ native-fsread: filename eq "/usr/obj" then permit (
+ native-fsread: filename eq "/usr/obj/bin" then permit (
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then (
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailca (
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t (
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-sigaction: permit
+ > native-ioctl: permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" (
+ > native-pread: permit
+ > native-write: permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ native-fsread: filename eq "/var/run/dev.db" then permit (
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe | native-fsread: filename eq "/etc/utmp" then permit
+ native-fstat: permit <
+ native-fswrite: filename match "/tmp/lynx-*" then permit <
+ native-getdirentries: permit <
+ native-getpid: permit <
+ native-gettimeofday: permit <
+ native-ioctl: permit <
+ native-issetugid: permit <
+ native-lseek: permit <
+ native-mmap: permit <
+ native-mprotect: prot eq "PROT_READ" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" <
+ native-munmap: permit <
+ native-nanosleep: permit <
+ native-poll: permit (
+ native-pread: permit | native-nanosleep: permit
+ native-read: permit | native-gettimeofday: permit
+ native-recvfrom: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-select: permit <
+ native-sendto: true then permit <
+ native-sigaction: permit <
+ native-sigprocmask: permit <
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK (
+ > native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ > native-sendto: true then permit
+ > native-select: permit
+ > native-recvfrom: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK (
+ native-write: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ > native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_c2.out b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_c2.out
new file mode 100644
index 0000000..fe7af0e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_c2.out
@@ -0,0 +1,94 @@
+Policy: /usr/bin/lynx, Emulation: native (
+ native-issetugid: permit <
+ native-mprotect: permit <
+ native-mmap: permit <
+ native-__sysctl: permit (
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe <
+ native-fstat: permit <
+ native-close: permit (
+ native-fsread: filename match "/usr/lib/libssl.so.*" then | native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ native-read: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" t | native-exit: permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" | native-fcntl: cmd eq "F_SETFD" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then p | native-fsread: filename eq "/" then permit
+ native-munmap: permit | native-fsread: filename match "/<non-existent filename>:
+ native-sigprocmask: permit | native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit (
+ native-getpid: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ > native-fsread: filename eq "/etc/utmp" then permit
+ > native-fsread: filename eq "/home" then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ > native-fsread: filename eq "$HOME/.lynxrc" then permit
+ > native-fsread: filename eq "$HOME/.mailcap" then permit
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/tmp" then permit (
+ native-fswrite: filename match "/tmp/lynx-*" then permit (
+ native-fsread: filename match "/tmp/lynx-*/." then permit (
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "/etc/lynx.cfg" then permit <
+ native-fsread: filename eq "/" then permit <
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then <
+ native-fsread: filename eq "/usr/obj/bin" then permit <
+ native-fcntl: permit <
+ native-getdirentries: permit <
+ native-lseek: permit <
+ native-fsread: filename eq "/usr/obj" then permit <
+ native-fsread: filename eq "/usr" then permit (
+ native-fsread: filename eq "/usr/bin" then permit (
+ native-fsread: filename eq "/usr/games" then permit (
+ native-fsread: filename eq "/usr/include" then permit (
+ native-fsread: filename eq "/usr/lib" then permit (
+ native-fsread: filename eq "/usr/libdata" then permit (
+ native-fsread: filename eq "/usr/libexec" then permit (
+ native-fsread: filename eq "/usr/lkm" then permit (
+ native-fsread: filename eq "/usr/local" then permit (
+ native-fsread: filename eq "/usr/mdec" then permit (
+ native-fsread: filename eq "/home" then permit (
+ native-fsread: filename eq "/obj" then permit (
+ native-fsread: filename eq "$HOME/.lynxrc" then permit (
+ native-fsread: filename match "/<non-existent filename>: (
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailca (
+ native-fsread: filename eq "$HOME/.mailcap" then permit (
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t (
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-sigaction: permit <
+ native-ioctl: permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" (
+ native-pread: permit <
+ native-write: permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "/var/run/dev.db" then permit (
+ native-fsread: filename eq "/etc/utmp" then permit | native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ native-poll: permit | native-fstat: permit
+ native-nanosleep: permit | native-fswrite: filename match "/tmp/lynx-*" then permit
+ > native-getdirentries: permit
+ > native-getpid: permit
+ native-gettimeofday: permit (
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-ioctl: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK | native-issetugid: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-lseek: permit
+ native-sendto: true then permit | native-mmap: permit
+ native-select: permit | native-mprotect: prot eq "PROT_READ" then permit
+ > native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi
+ > native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm
+ > native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC"
+ > native-munmap: permit
+ > native-nanosleep: permit
+ > native-poll: permit
+ > native-pread: permit
+ > native-read: permit
+ native-recvfrom: permit (
+ > native-select: permit
+ > native-sendto: true then permit
+ > native-sigaction: permit
+ > native-sigprocmask: permit
+ > native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK (
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-write: permit
+ native-exit: permit <
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_d1.out b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_d1.out
new file mode 100644
index 0000000..3e548b6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_d1.out
@@ -0,0 +1,69 @@
+ > native-issetugid: permit
+ > native-mprotect: permit
+ > native-mmap: permit
+ > native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ > native-fstat: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-fsread: filename match "/usr/lib/libssl.so.*" then
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-read: permit
+ native-exit: permit | native-fsread: filename match "/usr/lib/libcrypto.so.*" t
+ native-fcntl: cmd eq "F_SETFD" then permit | native-fsread: filename match "/usr/lib/libncurses.so.*"
+ native-fsread: filename eq "/" then permit | native-fsread: filename match "/usr/lib/libc.so.*" then p
+ native-fsread: filename match "/<non-existent filename>: | native-munmap: permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit | native-sigprocmask: permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-getpid: permit
+ native-fsread: filename eq "/etc/utmp" then permit <
+ native-fsread: filename eq "/home" then permit <
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "$HOME/.lynxrc" then permit <
+ native-fsread: filename eq "$HOME/.mailcap" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "/obj" then permit <
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "/etc/lynx.cfg" then permit
+ > native-fsread: filename eq "/" then permit
+ > native-fsread: filename eq "/usr/obj/bin/systrace/." then
+ > native-fsread: filename eq "/usr/obj/bin" then permit
+ > native-fcntl: permit
+ > native-getdirentries: permit
+ > native-lseek: permit
+ > native-fsread: filename eq "/usr/obj" then permit
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-sigaction: permit
+ > native-ioctl: permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ > native-pread: permit
+ > native-write: permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe | native-fsread: filename eq "/etc/utmp" then permit
+ native-fstat: permit <
+ native-fswrite: filename match "/tmp/lynx-*" then permit <
+ native-getdirentries: permit <
+ native-getpid: permit <
+ native-gettimeofday: permit <
+ native-ioctl: permit <
+ native-issetugid: permit <
+ native-lseek: permit <
+ native-mmap: permit <
+ native-mprotect: prot eq "PROT_READ" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" <
+ native-munmap: permit <
+ native-nanosleep: permit <
+ native-pread: permit | native-nanosleep: permit
+ native-read: permit | native-gettimeofday: permit
+ native-recvfrom: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-select: permit <
+ native-sendto: true then permit <
+ native-sigaction: permit <
+ native-sigprocmask: permit <
+ > native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ > native-sendto: true then permit
+ > native-select: permit
+ > native-recvfrom: permit
+ native-write: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ > native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_d2.out b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_d2.out
new file mode 100644
index 0000000..4504c36
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_iflags_d2.out
@@ -0,0 +1,65 @@
+ native-issetugid: permit <
+ native-mprotect: permit <
+ native-mmap: permit <
+ native-fsread: filename eq "/var/run/ld.so.hints" then pe <
+ native-fstat: permit <
+ native-fsread: filename match "/usr/lib/libssl.so.*" then | native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ native-read: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" t | native-exit: permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" | native-fcntl: cmd eq "F_SETFD" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then p | native-fsread: filename eq "/" then permit
+ native-munmap: permit | native-fsread: filename match "/<non-existent filename>:
+ native-sigprocmask: permit | native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-getpid: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ > native-fsread: filename eq "/etc/utmp" then permit
+ > native-fsread: filename eq "/home" then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ > native-fsread: filename eq "$HOME/.lynxrc" then permit
+ > native-fsread: filename eq "$HOME/.mailcap" then permit
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "/etc/lynx.cfg" then permit <
+ native-fsread: filename eq "/" then permit <
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then <
+ native-fsread: filename eq "/usr/obj/bin" then permit <
+ native-fcntl: permit <
+ native-getdirentries: permit <
+ native-lseek: permit <
+ native-fsread: filename eq "/usr/obj" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then permi <
+ native-sigaction: permit <
+ native-ioctl: permit <
+ native-fsread: filename eq "$HOME/.terminfo.db" then perm <
+ native-fsread: filename eq "$HOME/.terminfo" then permit <
+ native-pread: permit <
+ native-write: permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
+ native-fsread: filename eq "/etc/utmp" then permit | native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ native-poll: permit | native-fstat: permit
+ native-nanosleep: permit | native-fswrite: filename match "/tmp/lynx-*" then permit
+ > native-getdirentries: permit
+ > native-getpid: permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit | native-ioctl: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK | native-issetugid: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | native-lseek: permit
+ native-sendto: true then permit | native-mmap: permit
+ native-select: permit | native-mprotect: prot eq "PROT_READ" then permit
+ > native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permi
+ > native-mprotect: prot eq "PROT_READ|PROT_WRITE" then perm
+ > native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC"
+ > native-munmap: permit
+ > native-nanosleep: permit
+ > native-poll: permit
+ > native-pread: permit
+ > native-read: permit
+ > native-select: permit
+ > native-sendto: true then permit
+ > native-sigaction: permit
+ > native-sigprocmask: permit
+ > native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | native-write: permit
+ native-exit: permit <
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_input1 b/contrib/netbsd-tests/usr.bin/sdiff/d_input1
new file mode 100644
index 0000000..686e8ea
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_input1
@@ -0,0 +1,72 @@
+Policy: /usr/bin/lynx, Emulation: native
+ native-__sysctl: permit
+ native-close: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then permit
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then permit
+ native-exit: permit
+ native-fcntl: cmd eq "F_SETFD" then permit
+ native-fsread: filename eq "/" then permit
+ native-fsread: filename match "/<non-existent filename>: *" then permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-fsread: filename eq "/etc/utmp" then permit
+ native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "$HOME" then permit
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then permit
+ native-fsread: filename eq "$HOME/.lynxrc" then permit
+ native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "$HOME/.mime.types" then permit
+ native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "$HOME/.terminfo.db" then permit
+ native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/tmp" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit
+ native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then permit
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" then permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" then permit
+ native-fsread: filename match "/usr/lib/libssl.so.*" then permit
+ native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailcap" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.types" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" then permit
+ native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then permit
+ native-fstat: permit
+ native-fswrite: filename match "/tmp/lynx-*" then permit
+ native-getdirentries: permit
+ native-getpid: permit
+ native-gettimeofday: permit
+ native-ioctl: permit
+ native-issetugid: permit
+ native-lseek: permit
+ native-mmap: permit
+ native-mprotect: prot eq "PROT_READ" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" then permit
+ native-munmap: permit
+ native-nanosleep: permit
+ native-poll: permit
+ native-pread: permit
+ native-read: permit
+ native-recvfrom: permit
+ native-select: permit
+ native-sendto: true then permit
+ native-sigaction: permit
+ native-sigprocmask: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_DGRAM" then permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_STREAM" then permit
+ native-write: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_input2 b/contrib/netbsd-tests/usr.bin/sdiff/d_input2
new file mode 100644
index 0000000..70e1b57
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_input2
@@ -0,0 +1,69 @@
+Policy: /usr/bin/lynx, Emulation: native
+ native-issetugid: permit
+ native-mprotect: permit
+ native-mmap: permit
+ native-__sysctl: permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then permit
+ native-fstat: permit
+ native-close: permit
+ native-fsread: filename match "/usr/lib/libssl.so.*" then permit
+ native-read: permit
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" then permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then permit
+ native-munmap: permit
+ native-sigprocmask: permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-getpid: permit
+ native-fsread: filename eq "/tmp" then permit
+ native-fswrite: filename match "/tmp/lynx-*" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit
+ native-fsread: filename eq "$HOME" then permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-fsread: filename eq "/" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit
+ native-fcntl: permit
+ native-getdirentries: permit
+ native-lseek: permit
+ native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "$HOME/.lynxrc" then permit
+ native-fsread: filename match "/<non-existent filename>: *" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailcap" then permit
+ native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.types" then permit
+ native-fsread: filename eq "$HOME/.mime.types" then permit
+ native-sigaction: permit
+ native-ioctl: permit
+ native-fsread: filename eq "$HOME/.terminfo.db" then permit
+ native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" then permit
+ native-pread: permit
+ native-write: permit
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then permit
+ native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/etc/utmp" then permit
+ native-poll: permit
+ native-nanosleep: permit
+ native-gettimeofday: permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_DGRAM" then permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then permit
+ native-sendto: true then permit
+ native-select: permit
+ native-recvfrom: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_STREAM" then permit
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then permit
+ native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_oneline.in b/contrib/netbsd-tests/usr.bin/sdiff/d_oneline.in
new file mode 100644
index 0000000..acbe86c
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_oneline.in
@@ -0,0 +1 @@
+abcd
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_oneline_a.out b/contrib/netbsd-tests/usr.bin/sdiff/d_oneline_a.out
new file mode 100644
index 0000000..99560a6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_oneline_a.out
@@ -0,0 +1 @@
+ > abcd
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_oneline_b.out b/contrib/netbsd-tests/usr.bin/sdiff/d_oneline_b.out
new file mode 100644
index 0000000..7300b1d
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_oneline_b.out
@@ -0,0 +1 @@
+abcd <
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_same.out b/contrib/netbsd-tests/usr.bin/sdiff/d_same.out
new file mode 100644
index 0000000..bce8944
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_same.out
@@ -0,0 +1,72 @@
+Policy: /usr/bin/lynx, Emulation: native Policy: /usr/bin/lynx, Emulation: native
+ native-__sysctl: permit native-__sysctl: permit
+ native-close: permit native-close: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then perm native-connect: sockaddr eq "inet-[127.0.0.1]:53" then perm
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then per native-connect: sockaddr match "inet-\\\[*\\\]:80" then per
+ native-exit: permit native-exit: permit
+ native-fcntl: cmd eq "F_SETFD" then permit native-fcntl: cmd eq "F_SETFD" then permit
+ native-fsread: filename eq "/" then permit native-fsread: filename eq "/" then permit
+ native-fsread: filename match "/<non-existent filename>: *" native-fsread: filename match "/<non-existent filename>: *"
+ native-fsread: filename eq "/etc/lynx.cfg" then permit native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-fsread: filename eq "/etc/utmp" then permit native-fsread: filename eq "/etc/utmp" then permit
+ native-fsread: filename eq "/home" then permit native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "$HOME" then permit native-fsread: filename eq "$HOME" then permit
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then permi native-fsread: filename eq "$HOME/.lynx-keymaps" then permi
+ native-fsread: filename eq "$HOME/.lynxrc" then permit native-fsread: filename eq "$HOME/.lynxrc" then permit
+ native-fsread: filename eq "$HOME/.mailcap" then permit native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "$HOME/.mime.types" then permit native-fsread: filename eq "$HOME/.mime.types" then permit
+ native-fsread: filename eq "$HOME/.terminfo" then permit native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "$HOME/.terminfo.db" then permit native-fsread: filename eq "$HOME/.terminfo.db" then permit
+ native-fsread: filename eq "/obj" then permit native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/tmp" then permit native-fsread: filename eq "/tmp" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit native-fsread: filename match "/tmp/lynx-*/." then permit
+ native-fsread: filename eq "/usr" then permit native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then per native-fsread: filename match "/usr/lib/libc.so.*" then per
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" the native-fsread: filename match "/usr/lib/libcrypto.so.*" the
+ native-fsread: filename match "/usr/lib/libncurses.so.*" th native-fsread: filename match "/usr/lib/libncurses.so.*" th
+ native-fsread: filename match "/usr/lib/libssl.so.*" then p native-fsread: filename match "/usr/lib/libssl.so.*" then p
+ native-fsread: filename eq "/usr/libdata" then permit native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/usr/libexec" then permit native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/usr/lkm" then permit native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "/usr/local" then permit native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/mdec" then permit native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/usr/obj" then permit native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit native-fsread: filename eq "/usr/obj/bin" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then p native-fsread: filename eq "/usr/obj/bin/systrace/." then p
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailcap" native-fsread: filename eq "/usr/obj/bin/systrace/.mailcap"
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.typ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.typ
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" th native-fsread: filename eq "/usr/share/misc/terminfo.db" th
+ native-fsread: filename eq "/var/run/dev.db" then permit native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then perm native-fsread: filename eq "/var/run/ld.so.hints" then perm
+ native-fstat: permit native-fstat: permit
+ native-fswrite: filename match "/tmp/lynx-*" then permit native-fswrite: filename match "/tmp/lynx-*" then permit
+ native-getdirentries: permit native-getdirentries: permit
+ native-getpid: permit native-getpid: permit
+ native-gettimeofday: permit native-gettimeofday: permit
+ native-ioctl: permit native-ioctl: permit
+ native-issetugid: permit native-issetugid: permit
+ native-lseek: permit native-lseek: permit
+ native-mmap: permit native-mmap: permit
+ native-mprotect: prot eq "PROT_READ" then permit native-mprotect: prot eq "PROT_READ" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permit native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then permit native-mprotect: prot eq "PROT_READ|PROT_WRITE" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" t native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" t
+ native-munmap: permit native-munmap: permit
+ native-nanosleep: permit native-nanosleep: permit
+ native-poll: permit native-poll: permit
+ native-pread: permit native-pread: permit
+ native-read: permit native-read: permit
+ native-recvfrom: permit native-recvfrom: permit
+ native-select: permit native-select: permit
+ native-sendto: true then permit native-sendto: true then permit
+ native-sigaction: permit native-sigaction: permit
+ native-sigprocmask: permit native-sigprocmask: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_D native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_D
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_S native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_S
+ native-write: permit native-write: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_short.out b/contrib/netbsd-tests/usr.bin/sdiff/d_short.out
new file mode 100644
index 0000000..7a33460
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_short.out
@@ -0,0 +1,15 @@
+Policy: /usr/bin/lynx, Emulation: native
+ native-issetugid: permit
+ native-mprotect: permit
+ native-mmap: permit
+ native-__sysctl: permit
+ native-close: permit
+ native-fsread: filename match "/usr/lib/libssl.so.*" then permit
+ native-read: permit
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" then permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then permit
+ native-munmap: permit
+ native-sigprocmask: permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_tabends.in b/contrib/netbsd-tests/usr.bin/sdiff/d_tabends.in
new file mode 100644
index 0000000..0547049
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_tabends.in
@@ -0,0 +1,17 @@
+
+0
+01
+012
+0123
+01234
+012345
+0123456
+01234567
+012345670
+0123456701
+01234567012
+012345670123
+0123456701234
+01234567012345
+012345670123456
+0123456701234567
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_a.out b/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_a.out
new file mode 100644
index 0000000..423bd02
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_a.out
@@ -0,0 +1,17 @@
+ <
+0 <
+01 <
+012 <
+0123 <
+01234 <
+012345 <
+0123456 <
+01234567 <
+012345670 <
+0123456701 <
+01234567012 <
+012345670123 <
+0123456701234 <
+0123456701234 <
+0123456701234 <
+0123456701234 <
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_b.out b/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_b.out
new file mode 100644
index 0000000..b180705
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_b.out
@@ -0,0 +1,17 @@
+ >
+ > 0
+ > 01
+ > 012
+ > 0123
+ > 01234
+ > 012345
+ > 0123456
+ > 01234567
+ > 012345670
+ > 0123456701
+ > 01234567012
+ > 012345670123
+ > 0123456701234
+ > 0123456701234
+ > 0123456701234
+ > 0123456701234
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_c.out b/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_c.out
new file mode 100644
index 0000000..c301382
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_tabends_c.out
@@ -0,0 +1,17 @@
+ <
+0 <
+01 <
+012 <
+0123 <
+01234 <
+012345 <
+0123456 <
+01234567 <
+01234567 <
+01234567 <
+01234567 <
+01234567 <
+01234567 <
+01234567 <
+01234567 <
+01234567 <
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_tabs.out b/contrib/netbsd-tests/usr.bin/sdiff/d_tabs.out
new file mode 100644
index 0000000..eb34bac
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_tabs.out
@@ -0,0 +1,102 @@
+Policy: /usr/bin/lynx, Emulation: native Policy: /usr/bin/lynx, Emulation: native
+ > native-issetugid: permit
+ > native-mprotect: permit
+ > native-mmap: permit
+ native-__sysctl: permit native-__sysctl: permit
+ > native-fsread: filename eq "/var/run/ld.so.hints" then pe
+ > native-fstat: permit
+ native-close: permit native-close: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then | native-fsread: filename match "/usr/lib/libssl.so.*" then
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then | native-read: permit
+ native-exit: permit | native-fsread: filename match "/usr/lib/libcrypto.so.*" t
+ native-fcntl: cmd eq "F_SETFD" then permit | native-fsread: filename match "/usr/lib/libncurses.so.*"
+ native-fsread: filename eq "/" then permit | native-fsread: filename match "/usr/lib/libc.so.*" then p
+ native-fsread: filename match "/<non-existent filename> | native-munmap: permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit | native-sigprocmask: permit
+ native-fsread: filename eq "/etc/malloc.conf" then perm native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-fsread: filename eq "/etc/resolv.conf" then perm | native-getpid: permit
+ native-fsread: filename eq "/etc/utmp" then permit <
+ native-fsread: filename eq "/home" then permit <
+ native-fsread: filename eq "$HOME" then permit <
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then p <
+ native-fsread: filename eq "$HOME/.lynxrc" then permit <
+ native-fsread: filename eq "$HOME/.mailcap" then permit <
+ native-fsread: filename eq "$HOME/.mime.types" then per <
+ native-fsread: filename eq "$HOME/.terminfo" then permi <
+ native-fsread: filename eq "$HOME/.terminfo.db" then pe <
+ native-fsread: filename eq "/obj" then permit <
+ native-fsread: filename eq "/tmp" then permit native-fsread: filename eq "/tmp" then permit
+ > native-fswrite: filename match "/tmp/lynx-*" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then perm native-fsread: filename match "/tmp/lynx-*/." then permit
+ > native-fsread: filename eq "$HOME" then permit
+ > native-fsread: filename eq "/etc/lynx.cfg" then permit
+ > native-fsread: filename eq "/" then permit
+ > native-fsread: filename eq "/usr/obj/bin/systrace/." then
+ > native-fsread: filename eq "/usr/obj/bin" then permit
+ > native-fcntl: permit
+ > native-getdirentries: permit
+ > native-lseek: permit
+ > native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr" then permit native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then <
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" <
+ native-fsread: filename match "/usr/lib/libncurses.so.* <
+ native-fsread: filename match "/usr/lib/libssl.so.*" th <
+ native-fsread: filename eq "/usr/libdata" then permit native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/usr/libexec" then permit native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/usr/lkm" then permit native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "/usr/local" then permit native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/mdec" then permit native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/usr/obj" then permit | native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit | native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." th | native-fsread: filename eq "$HOME/.lynxrc" then permit
+ > native-fsread: filename match "/<non-existent filename>:
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mail native-fsread: filename eq "/usr/obj/bin/systrace/.mailca
+ > native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime native-fsread: filename eq "/usr/obj/bin/systrace/.mime.t
+ > native-fsread: filename eq "$HOME/.mime.types" then permi
+ > native-sigaction: permit
+ > native-ioctl: permit
+ > native-fsread: filename eq "$HOME/.terminfo.db" then perm
+ > native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db native-fsread: filename eq "/usr/share/misc/terminfo.db"
+ > native-pread: permit
+ > native-write: permit
+ > native-fsread: filename eq "$HOME/.lynx-keymaps" then per
+ native-fsread: filename eq "/var/run/dev.db" then permi native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then | native-fsread: filename eq "/etc/utmp" then permit
+ native-fstat: permit <
+ native-fswrite: filename match "/tmp/lynx-*" then permi <
+ native-getdirentries: permit <
+ native-getpid: permit <
+ native-gettimeofday: permit <
+ native-ioctl: permit <
+ native-issetugid: permit <
+ native-lseek: permit <
+ native-mmap: permit <
+ native-mprotect: prot eq "PROT_READ" then permit <
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then per <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then pe <
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXE <
+ native-munmap: permit <
+ native-nanosleep: permit <
+ native-poll: permit native-poll: permit
+ native-pread: permit | native-nanosleep: permit
+ native-read: permit | native-gettimeofday: permit
+ native-recvfrom: permit | native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-select: permit <
+ native-sendto: true then permit <
+ native-sigaction: permit <
+ native-sigprocmask: permit <
+ native-socket: sockdom eq "AF_INET" and socktype eq "SO native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ > native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe
+ > native-sendto: true then permit
+ > native-select: permit
+ > native-recvfrom: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SO native-socket: sockdom eq "AF_INET" and socktype eq "SOCK
+ native-write: permit | native-connect: sockaddr match "inet-\\\[*\\\]:80" then p
+ > native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_tabs1.in b/contrib/netbsd-tests/usr.bin/sdiff/d_tabs1.in
new file mode 100644
index 0000000..b5a1834
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_tabs1.in
@@ -0,0 +1,72 @@
+Policy: /usr/bin/lynx, Emulation: native
+ native-__sysctl: permit
+ native-close: permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then permit
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then permit
+ native-exit: permit
+ native-fcntl: cmd eq "F_SETFD" then permit
+ native-fsread: filename eq "/" then permit
+ native-fsread: filename match "/<non-existent filename>: *" then permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-fsread: filename eq "/etc/utmp" then permit
+ native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "$HOME" then permit
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then permit
+ native-fsread: filename eq "$HOME/.lynxrc" then permit
+ native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "$HOME/.mime.types" then permit
+ native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "$HOME/.terminfo.db" then permit
+ native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "/tmp" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit
+ native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then permit
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" then permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" then permit
+ native-fsread: filename match "/usr/lib/libssl.so.*" then permit
+ native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailcap" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.types" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" then permit
+ native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then permit
+ native-fstat: permit
+ native-fswrite: filename match "/tmp/lynx-*" then permit
+ native-getdirentries: permit
+ native-getpid: permit
+ native-gettimeofday: permit
+ native-ioctl: permit
+ native-issetugid: permit
+ native-lseek: permit
+ native-mmap: permit
+ native-mprotect: prot eq "PROT_READ" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_EXEC" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE" then permit
+ native-mprotect: prot eq "PROT_READ|PROT_WRITE|PROT_EXEC" then permit
+ native-munmap: permit
+ native-nanosleep: permit
+ native-poll: permit
+ native-pread: permit
+ native-read: permit
+ native-recvfrom: permit
+ native-select: permit
+ native-sendto: true then permit
+ native-sigaction: permit
+ native-sigprocmask: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_DGRAM" then permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_STREAM" then permit
+ native-write: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/d_tabs2.in b/contrib/netbsd-tests/usr.bin/sdiff/d_tabs2.in
new file mode 100644
index 0000000..d00f415
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/d_tabs2.in
@@ -0,0 +1,69 @@
+Policy: /usr/bin/lynx, Emulation: native
+ native-issetugid: permit
+ native-mprotect: permit
+ native-mmap: permit
+ native-__sysctl: permit
+ native-fsread: filename eq "/var/run/ld.so.hints" then permit
+ native-fstat: permit
+ native-close: permit
+ native-fsread: filename match "/usr/lib/libssl.so.*" then permit
+ native-read: permit
+ native-fsread: filename match "/usr/lib/libcrypto.so.*" then permit
+ native-fsread: filename match "/usr/lib/libncurses.so.*" then permit
+ native-fsread: filename match "/usr/lib/libc.so.*" then permit
+ native-munmap: permit
+ native-sigprocmask: permit
+ native-fsread: filename eq "/etc/malloc.conf" then permit
+ native-getpid: permit
+ native-fsread: filename eq "/tmp" then permit
+ native-fswrite: filename match "/tmp/lynx-*" then permit
+ native-fsread: filename match "/tmp/lynx-*/." then permit
+ native-fsread: filename eq "$HOME" then permit
+ native-fsread: filename eq "/etc/lynx.cfg" then permit
+ native-fsread: filename eq "/" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/." then permit
+ native-fsread: filename eq "/usr/obj/bin" then permit
+ native-fcntl: permit
+ native-getdirentries: permit
+ native-lseek: permit
+ native-fsread: filename eq "/usr/obj" then permit
+ native-fsread: filename eq "/usr" then permit
+ native-fsread: filename eq "/usr/bin" then permit
+ native-fsread: filename eq "/usr/games" then permit
+ native-fsread: filename eq "/usr/include" then permit
+ native-fsread: filename eq "/usr/lib" then permit
+ native-fsread: filename eq "/usr/libdata" then permit
+ native-fsread: filename eq "/usr/libexec" then permit
+ native-fsread: filename eq "/usr/lkm" then permit
+ native-fsread: filename eq "/usr/local" then permit
+ native-fsread: filename eq "/usr/mdec" then permit
+ native-fsread: filename eq "/home" then permit
+ native-fsread: filename eq "/obj" then permit
+ native-fsread: filename eq "$HOME/.lynxrc" then permit
+ native-fsread: filename match "/<non-existent filename>: *" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mailcap" then permit
+ native-fsread: filename eq "$HOME/.mailcap" then permit
+ native-fsread: filename eq "/usr/obj/bin/systrace/.mime.types" then permit
+ native-fsread: filename eq "$HOME/.mime.types" then permit
+ native-sigaction: permit
+ native-ioctl: permit
+ native-fsread: filename eq "$HOME/.terminfo.db" then permit
+ native-fsread: filename eq "$HOME/.terminfo" then permit
+ native-fsread: filename eq "/usr/share/misc/terminfo.db" then permit
+ native-pread: permit
+ native-write: permit
+ native-fsread: filename eq "$HOME/.lynx-keymaps" then permit
+ native-fsread: filename eq "/var/run/dev.db" then permit
+ native-fsread: filename eq "/etc/utmp" then permit
+ native-poll: permit
+ native-nanosleep: permit
+ native-gettimeofday: permit
+ native-fsread: filename eq "/etc/resolv.conf" then permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_DGRAM" then permit
+ native-connect: sockaddr eq "inet-[127.0.0.1]:53" then permit
+ native-sendto: true then permit
+ native-select: permit
+ native-recvfrom: permit
+ native-socket: sockdom eq "AF_INET" and socktype eq "SOCK_STREAM" then permit
+ native-connect: sockaddr match "inet-\\\[*\\\]:80" then permit
+ native-exit: permit
diff --git a/contrib/netbsd-tests/usr.bin/sdiff/t_sdiff.sh b/contrib/netbsd-tests/usr.bin/sdiff/t_sdiff.sh
new file mode 100755
index 0000000..2d6fc2d
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sdiff/t_sdiff.sh
@@ -0,0 +1,206 @@
+# $NetBSD: t_sdiff.sh,v 1.1 2012/03/17 16:33:15 jruoho Exp $
+#
+# Copyright (c) 2008, 2009 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case flags
+flags_head()
+{
+ atf_set "descr" "Checks -l, -s and -w flags"
+}
+flags_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/d_flags_l.out -s eq:1 \
+ sdiff -l "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2"
+
+ atf_check -o file:$(atf_get_srcdir)/d_flags_s.out -s eq:1 \
+ sdiff -s "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2"
+
+ atf_check -o file:$(atf_get_srcdir)/d_flags_w.out -s eq:1 \
+ sdiff -w 125 "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2"
+}
+
+atf_test_case iflags
+iflags_head()
+{
+ atf_set "descr" "Checks flags -l, -s and -w combined with -I"
+}
+iflags_body()
+{
+ tail1="-w 125 -I .*filename.* $(atf_get_srcdir)/d_input1 $(atf_get_srcdir)/d_input2"
+ tail2="-w 125 -I .*filename.* $(atf_get_srcdir)/d_input2 $(atf_get_srcdir)/d_input1"
+
+ atf_check -o file:$(atf_get_srcdir)/d_iflags_a1.out -s eq:1 sdiff ${tail1}
+ atf_check -o file:$(atf_get_srcdir)/d_iflags_a2.out -s eq:1 sdiff ${tail2}
+ atf_check -o file:$(atf_get_srcdir)/d_iflags_b1.out -s eq:1 sdiff -s ${tail1}
+ atf_check -o file:$(atf_get_srcdir)/d_iflags_b2.out -s eq:1 sdiff -s ${tail2}
+ atf_check -o file:$(atf_get_srcdir)/d_iflags_c1.out -s eq:1 sdiff -l ${tail1}
+ atf_check -o file:$(atf_get_srcdir)/d_iflags_c2.out -s eq:1 sdiff -l ${tail2}
+ atf_check -o file:$(atf_get_srcdir)/d_iflags_d1.out -s eq:1 sdiff -s ${tail1}
+ atf_check -o file:$(atf_get_srcdir)/d_iflags_d2.out -s eq:1 sdiff -s ${tail2}
+}
+
+atf_test_case tabs
+tabs_head()
+{
+ atf_set "descr" "Checks comparing files containing tabs"
+}
+tabs_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/d_tabs.out -s eq:1 \
+ sdiff "$(atf_get_srcdir)/d_tabs1.in" "$(atf_get_srcdir)/d_tabs2.in"
+}
+
+atf_test_case tabends
+tabends_head()
+{
+ atf_set "descr" "Checks correct handling of lines ended with tabs"
+}
+tabends_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/d_tabends_a.out -s eq:1 \
+ sdiff -w30 "$(atf_get_srcdir)/d_tabends.in" /dev/null
+
+ atf_check -o file:$(atf_get_srcdir)/d_tabends_b.out -s eq:1 \
+ sdiff -w30 /dev/null "$(atf_get_srcdir)/d_tabends.in"
+
+ atf_check -o file:$(atf_get_srcdir)/d_tabends_c.out -s eq:1 \
+ sdiff -w19 "$(atf_get_srcdir)/d_tabends.in" /dev/null
+}
+
+atf_test_case merge
+merge_head()
+{
+ atf_set "descr" "Checks interactive merging"
+}
+merge_body()
+{
+ merge_tail="-o merge.out $(atf_get_srcdir)/d_input1 \
+$(atf_get_srcdir)/d_input2 >/dev/null ; cat merge.out"
+
+ cp $(atf_get_srcdir)/d_input* .
+
+ atf_check -o file:d_input1 -x "yes l | sdiff ${merge_tail}"
+ atf_check -o file:d_input2 -x "yes r | sdiff ${merge_tail}"
+
+ atf_check -o file:d_input1 -x \
+ "yes el | EDITOR=cat VISUAL=cat sdiff ${merge_tail}"
+ atf_check -o file:d_input2 -x \
+ "yes er | EDITOR=cat VISUAL=cat sdiff ${merge_tail}"
+
+ atf_check -o file:d_input1 -x "yes l | sdiff -s ${merge_tail}"
+ atf_check -o file:d_input2 -x "yes r | sdiff -s ${merge_tail}"
+ atf_check -o file:d_input1 -x "yes l | sdiff -l ${merge_tail}"
+ atf_check -o file:d_input2 -x "yes r | sdiff -l ${merge_tail}"
+ atf_check -o file:d_input1 -x "yes l | sdiff -ls ${merge_tail}"
+ atf_check -o file:d_input2 -x "yes r | sdiff -ls ${merge_tail}"
+
+ atf_check -o file:d_input1 -x "{ while :; do echo s; echo l; \
+echo v; echo l; done; } | sdiff ${merge_tail}"
+
+ atf_check -o file:d_input2 -x "{ while :; do echo s; echo r; \
+echo v; echo r; done; } | sdiff ${merge_tail}"
+}
+
+atf_test_case same
+same_head()
+{
+ atf_set "descr" "Checks comparing file with itself"
+}
+same_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/d_same.out \
+ sdiff "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input1"
+}
+
+atf_test_case oneline
+oneline_head()
+{
+ atf_set "descr" "Checks comparing one-line files"
+}
+oneline_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/d_oneline_a.out -s eq:1 \
+ sdiff /dev/null "$(atf_get_srcdir)/d_oneline.in"
+
+ atf_check -o file:$(atf_get_srcdir)/d_oneline_b.out -s eq:1 \
+ sdiff "$(atf_get_srcdir)/d_oneline.in" /dev/null
+}
+
+atf_test_case dot
+dot_head()
+{
+ atf_set "descr" "Checks comparing with file containing only one character"
+}
+dot_body()
+{
+ echo ". <" > expout
+ atf_check -o file:expout -s eq:1 sdiff "$(atf_get_srcdir)/d_dot.in" /dev/null
+
+ echo " > ." > expout
+ atf_check -o file:expout -s eq:1 sdiff /dev/null "$(atf_get_srcdir)/d_dot.in"
+}
+
+atf_test_case stdin
+stdin_head()
+{
+ atf_set "descr" "Checks reading data from stdin"
+}
+stdin_body()
+{
+ echo " > stdin" > expout
+ atf_check -o file:expout -s eq:1 -x \
+ "echo stdin | sdiff /dev/null /dev/stdin"
+
+ echo "stdin <" > expout
+ atf_check -o file:expout -s eq:1 -x \
+ "echo stdin | sdiff /dev/stdin /dev/null"
+}
+
+atf_test_case short
+short_head()
+{
+ atf_set "descr" "Checks premature stop of merging"
+}
+short_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/d_short.out -x \
+ "printf \"r\\nl\\nr\\nl\" | sdiff -o merge.out $(atf_get_srcdir)/d_input1 \
+$(atf_get_srcdir)/d_input2 >/dev/null ; cat merge.out"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case flags
+ atf_add_test_case iflags
+ atf_add_test_case tabs
+ atf_add_test_case tabends
+ atf_add_test_case merge
+ atf_add_test_case same
+ atf_add_test_case oneline
+ atf_add_test_case dot
+ atf_add_test_case stdin
+ atf_add_test_case short
+}
diff --git a/contrib/netbsd-tests/usr.bin/sed/d_c2048.in b/contrib/netbsd-tests/usr.bin/sed/d_c2048.in
new file mode 100644
index 0000000..96ea71e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sed/d_c2048.in
@@ -0,0 +1 @@
+s/1/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabc\/defghij/
diff --git a/contrib/netbsd-tests/usr.bin/sed/t_sed.sh b/contrib/netbsd-tests/usr.bin/sed/t_sed.sh
new file mode 100755
index 0000000..892feb9
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sed/t_sed.sh
@@ -0,0 +1,127 @@
+# $NetBSD: t_sed.sh,v 1.5 2013/03/14 06:03:44 jmmv Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen and David A. Holland.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case c2048
+c2048_head() {
+ atf_set "descr" "Test that sed(1) does not fail when the " \
+ "2048'th character is a backslash (PR bin/25899)"
+}
+
+c2048_body() {
+
+ atf_check -s exit:0 -o inline:'foo\n' -e empty \
+ -x "echo foo | sed -f $(atf_get_srcdir)/d_c2048.in"
+}
+
+atf_test_case emptybackref
+emptybackref_head() {
+ atf_set "descr" "Test that sed(1) handles " \
+ "empty back references (PR bin/28126)"
+}
+
+emptybackref_body() {
+
+ atf_check -o inline:"foo1bar1\n" \
+ -x "echo foo1bar1 | sed -ne '/foo\(.*\)bar\1/p'"
+
+ atf_expect_fail "PR bin/28126"
+
+ atf_check -o inline:"foobar\n" \
+ -x "echo foobar | sed -ne '/foo\(.*\)bar\1/p'"
+}
+
+atf_test_case longlines
+longlines_head() {
+ atf_set "descr" "Test that sed(1) handles " \
+ "long lines correctly (PR bin/42261)"
+}
+
+longlines_body() {
+
+ str=$(awk 'BEGIN {while(x<2043){printf "x";x++}}')
+ echo $str > input
+
+ atf_check -o save:output -x "echo x | sed s,x,${str},g"
+ atf_check -s exit:0 -o empty -e empty -x "diff input output"
+}
+
+atf_test_case rangeselection
+rangeselection_head() {
+ atf_set "descr" "Test that sed(1) handles " \
+ "range selection correctly"
+}
+
+rangeselection_body() {
+ # basic cases
+ atf_check -o inline:"D\n" \
+ -x "printf 'A\nB\nC\nD\n' | sed '1,3d'"
+ atf_check -o inline:"A\n" \
+ -x "printf 'A\nB\nC\nD\n' | sed '2,4d'"
+ # two nonoverlapping ranges
+ atf_check -o inline:"C\n" \
+ -x "printf 'A\nB\nC\nD\nE\n' | sed '1,2d;4,5d'"
+ # overlapping ranges; the first prevents the second from being entered
+ atf_check -o inline:"D\nE\n" \
+ -x "printf 'A\nB\nC\nD\nE\n' | sed '1,3d;3,5d'"
+ # the 'n' command can also prevent ranges from being entered
+ atf_check -o inline:"B\nB\nC\nD\n" \
+ -x "printf 'A\nB\nC\nD\n' | sed '1,3s/A/B/;1,3n;1,3s/B/C/'"
+ atf_check -o inline:"B\nC\nC\nD\n" \
+ -x "printf 'A\nB\nC\nD\n' | sed '1,3s/A/B/;1,3n;2,3s/B/C/'"
+
+ # basic cases using regexps
+ atf_check -o inline:"D\n" \
+ -x "printf 'A\nB\nC\nD\n' | sed '/A/,/C/d'"
+ atf_check -o inline:"A\n" \
+ -x "printf 'A\nB\nC\nD\n' | sed '/B/,/D/d'"
+ # two nonoverlapping ranges
+ atf_check -o inline:"C\n" \
+ -x "printf 'A\nB\nC\nD\nE\n' | sed '/A/,/B/d;/D/,/E/d'"
+ # two overlapping ranges; the first blocks the second as above
+ atf_check -o inline:"D\nE\n" \
+ -x "printf 'A\nB\nC\nD\nE\n' | sed '/A/,/C/d;/C/,/E/d'"
+ # the 'n' command makes some lines invisible to downstreap regexps
+ atf_check -o inline:"B\nC\nC\nD\n" \
+ -x "printf 'A\nB\nC\nD\n' | sed '/A/,/C/s/A/B/;1,3n;/B/,/C/s/B/C/'"
+
+ # a range ends at the *first* matching end line
+ atf_check -o inline:"D\nC\n" \
+ -x "printf 'A\nB\nC\nD\nC\n' | sed '/A/,/C/d'"
+ # another matching start line within the range has no effect
+ atf_check -o inline:"D\nC\n" \
+ -x "printf 'A\nB\nA\nC\nD\nC\n' | sed '/A/,/C/d'"
+}
+
+atf_init_test_cases() {
+ atf_add_test_case c2048
+ atf_add_test_case emptybackref
+ atf_add_test_case longlines
+ atf_add_test_case rangeselection
+}
diff --git a/contrib/netbsd-tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue
new file mode 100644
index 0000000..5bc3348
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue
@@ -0,0 +1,104 @@
+begin 644 d_pcap.out.bz2
+M0EIH.3%!62936=O8'&4!%NW?@$`00`5_\0@B0``.Y_X@8"=^\@0```````!P
+M```````![XY0O$\'N'"@P'!M=O2E=5*>#>[0M50X0`Q@V@,$-!@@$%T!A:`P
+MNATWD`,83$T&",0R,)AE/4?O1O52E*@P`$`820U`]4JH-#(#0-`)/5*JFU,:
+MAIDQ--,`("DJ$*>E&F@!B:9'J>H%0J0>BI0``:`#P[E![R+ZY%2,<&JMJ-E3
+M46V)*F;;EK75-K&QM&I2K*&T&T6+/K6_NM*C]*2HP@P@TB)E$3A/FJ+(T01D
+MEE3)*^*HLJRIC"2U2*M!2L$O=47PI1'PJ+)#2".()^T@)^44*>9`3@D/Q2`G
+MVD!-(%K\?\`````````````````````````````````!`D````D`````````
+M`````````````````````````````)"```2$````````````````````````
+M````0```````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````]]]]]]]]]]]]]]]]\]_U>^N]_A_'^7[OYZ?8#!^`0.`X
+M-W=&9F```````]]`-/L!@_`)))``````````*?;[]```````````````````
+M````````````````````````#P``!;;;;0```'.<YP````-W=W=T````DDD`
+M```&9F9F````#,S,S````!F9F9@````S,S,P````DDD````#=W=W=````)))
+M`````W=W=W0```"220````-W=W=T````DDD````#=W=W=````)))`````W=W
+M=W0```"220'\`!T`#=W=W=````)))`````W=W=W0```"220````-W=W=T```
+M`DDD````#=W=W=````)))`````W=W=W0```"220````-W=W=T````DDD````
+M#=W=W=````)))````!F9F9@`=`'0,S,S,````&9F9F````#,S,S````!F9F9
+M@````S,S,P````9F9F8````,S!)`````````````````````````````````
+M```````'FWVVVVM/L!@_`('`<!`_/S\_`````!]_?V``````S,S,P```````
+M``"WWVVVVM/L!@_`<YSG``/?0`````````6VVVT`````````````\>/'CQX\
+M>/'CQX\]]/ODW8-=SN^=SF_;]WWM/UWKN][\SQTV<,++++++9E55"JRD964C
+M*RD964C*RD964C*RD964C*RD969F4C*RF5F:2222222ZZZ2222222222ZZZ2
+M222155555569E5ZA"1F835JZZ2222222_2ZZ2222222222ZZZ2222222222Z
+MZZ2222222222ZZZ22225555557)N<Z(3KKKJ!.B2>PDA8BUYY[\["YG,W,XZ
+M0ZI3(:35+77/7,ERN5RNJ#J*U!J646HJIJB32D)4$%2$(L$/23K?/G?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DDN9'MQQQYQY=2JZJ=2"-46J<$
+M$<=36D42T5%8M93,VIM:10-"E6)36EEEE9:<Q0I\I`3*H2?*0$XBA3YR`GTD
+M!/K%"G:0$^T@)ZT!/^D!,@)[(">T@)\9`3UD!/"J$GK0$X)#TD!/]D!/8D.$
+<@)V2`F0$]$!/:0$]4!/?0$_\7<D4X4)#;V!QE/"J
+`
+end
diff --git a/contrib/netbsd-tests/usr.bin/shmif_dumpbus/d_pkthdrs.out.bz2.uue b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/d_pkthdrs.out.bz2.uue
new file mode 100644
index 0000000..aa4cb6f
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/d_pkthdrs.out.bz2.uue
@@ -0,0 +1,297 @@
+begin 644 d_pkthdrs.out.bz2
+M0EIH.3%!6293686CW<D`OI[9@$`00`3_\#_MWT!@5=\'P````````!\`````
+M````8[P/O`>````````M5ZU2M8;`<R[:5VT[:FVI@\!X&XTWM3;=.FFK00.=
+MWUZUJJJJ#@`!\!P.[W=:U5:P!`=ANULVU4'@,#>7KK33;500',-455U@\!@/
+M.T7K$JH^L!YM3K6M5L$^!>)T:*I:U*:`-<!&J%`*`44L!M4';&V*!@&`::0&
+MC)E355'E'J`VD)1^P89O54J@```JGL)B8$E51@`C!48CT_U4C3%*J,`$8,I[
+M?ZI-JIZC(R5$T&(`,]4B(T1B:JDR>HT]1ZC3GMVDMDD^>,22V26SY_K_%DLD
+MED))+)(MMLMP222663_4DLE1"$6RR62?Y6VV72RVR6S5DDMEJV1))9*B$(0B
+M(0A"$(LD22V2(EI+26K;^VVR6623.N_?K_&_NIK6M`;F`,8P`;[@``#8````
+M`````````````````````````````9S^O]0&Y@8DD`````N[QB;`$D@2JJ@)
+M550$JJHDD```````"20````"20````"20````"20````$D@````$D@````$D
+M@````&))`````)F0````&,8`````22`````22`````22`````22`````22``
+M```22`````22`````22`````22`````22`````22`````22`````22`````2
+M2`````22`````;[@```$D@````&<R``````22`````DD`````DD`````DD``
+M```DD`````DD`````DD`````DD`````DEW=@````````````````````````
+M```````````````"20````````````````````````````````))````````
+M`````````````````````````E3,N222222222]V0```````````````*S<`
+M```````````````E3,N8J][S>V4,W!,R)4VMG$B0NIF[D,YDDDDDDDDDR)),
+MU4WWSF7)))G.<YS=W=W+N[O?>Y+8QE4J9EW)))))))))))))))))+N[N[DDD
+MDDDDDDDDEW=W<N[NY=W=R[N\YJ8M=R23&,27=W=[W>3.,I<DDDDDDDDDDDDD
+MDFTDDJJJIM))*JJJ;222JJJF?TK]9^U]R2>MOVUK6@`J#H!V*``)@(`()@`%
+M`.P!9R``*@Z`!(`#D`L`03``3`0`+.0`"@'8`)``!T%0`.0"P``J#H``'8H`
+M``LY```$@```3`0``*@Z``Y`+``%`.Y``````````````````"0`````````
+M````````````````#L4`````````````````````````!4'0````````````
+M````````````!R`6`````````````````````````2``````````````````
+M``2``````````````````````````()@`````````````_\`%P`````````#
+MH*@````````````````````````"8"`````````````````````````$@```
+M``````````````````````!9R`````````````````````````!T%0``````
+M````````````!V*``````````````````````````J#H````````````````
+M```7`%P```.0"P`````````03``*''''$I<>\2EQ*4I<2E[+B4I2XG;Q99>N
+MV6V69FM26W5MMO:2U?-NK,3S;EEN[9;$LD66)+9$DM;MW;NW4LEW9+4DDJV5
+M)));9N2VZSGGSY[>>_7361`$0*K,S,VV9K(``@R`B``?[_SJ>:U_7],TKGOO
+MK82220```````````````$DDD`&`````````````````````````5\\KG%-6
+MJ("[N[MD"6=1=8-^TK/9E?'6*[QA".*KS7+Z;Q]F)>_>@`.@J``#MKKKJM[Q
+M>]P``````````````````````"8"`````````````M+J4N.)2E+K[YXQGV_O
+MFM9SG,>UA/$[?(M$1$>^@`*2EQQ*2=][679+"6$L*O4L)82PJ6=[9)-VR2;E
+MDCKKK7/`#G,`-Y@!K,`-9@!K,!LWF`&^V`&\P`YS`#MO6@#>8`:S!R&\P#NX
+MS`#>8`:S`#68`:S`#68V!K>M!R-Y@``&9@``&9@`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U47>7?;0ZIC[39;0!OSG;LN[?))=141Q^0:O7\M7#,J/?GSXL
+MELDMG_.[);)+8_XLELDMG_RR6R2V?\-\RRV26SBV6R2V<SM++9);/\<S=DMD
+MEL__3_FR6R2V<3-V2V26S_KJR6R2V?Y].99+9);/\V2V26S7[/%DMDEL^/]Y
+0++9);/_XNY(IPH2$+1[N2/KJ
+`
+end
diff --git a/contrib/netbsd-tests/usr.bin/shmif_dumpbus/shmbus.bz2.uue b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/shmbus.bz2.uue
new file mode 100644
index 0000000..56348b1
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/shmbus.bz2.uue
@@ -0,0 +1,620 @@
+begin 644 shmbus.bz2
+M0EIH.3%!62936>\/Z2$`TP#_____________________________________
+M________X'+^>H!`P```````#['(&C```````(@``+7@```]````%48Z``4)
+M:\Y``%``/H`!U(`#O=O=L=`=V`#2`#8#*V,E&9CM@=MUNW7=F@6LP!\````(
+M(0>]Z[.^O<VRE(E*;#W!;%44;8*((F;2B,%@[LZ1;=P:*=V-T`66VE';!E4T
+MT[NVQ731=6;L;L9MQX`#0``H``:!.LXX`````!YCT`.G:P#3J7AFE7B`TWL#
+M5P0``````!T-W@E554``````````````````#0````?_ZJJ``-#(R>_]5-2G
+MM4#]I4_*@`#U&GO_550W_^JJH````!H]3(?^__5554(HC)30PTT#`$$W@1-(
+M%/>IH](>D](](R'J``&@`#$TT:--'J-^DD#0:`(V@9!HPF()A,$S0":,>H``
+M$P#0-#]4H)40A!C`"`S$TBGJ@/4C333$-#31B:9#":::`R9,F$TPC)@!`P$T
+M,FF)HTR:9#1B9)^A#)IB)Z,C$8AIHGID:9,0"-3U!*?JBJFDFIHVF)A2>$(T
+M_433(`/4,T3)D::9``--```&(9,",AIDT8FAB&(`::`:-&F@`&@-!@`C1D!D
+MT&$P")2:*-%/3:-!-,A,U3P3TIHFTGAH_548GZHVH>H>H_0F4]1ZAXC*:#:3
+M:GIDFU'J;4>4,Q)FIZGJ/$F)ZC;U4T]33U/4/2>4T]3TGE/4\:I^E/TIZF:3
+M]$1Y0T_2&3(GBCTTU`JI)"1C3`3U&A'HF'J8DWJ!,0C#(GIIB384S(TT$]3Q
+M3?ZJ3T:GD&331B!J;0FTT,4S)D">0TU3S1HT--!,&AHWZJ-3TTQ3Q,33$:8"
+M83:J9V-0K45+8@O4H`HM("H,@-N/CX^/OM]OM]C"9$$$9`4O0%!I`7(@,@(4
+M666%16%49%EE85AEDC(!($@2#)N3B3DRQ&L50D1%DS(S)2RS,SP1$1$1AAAA
+MAA%$41AF9F&9E1EE&%$48888888811%$9'O&6564M9M9596[AA$1AF9F&9E1
+MAAAAAAAAD11%$41D8811%$485919E11AAAAAAAAA1AAA!%$&&%)E2``D0!18
+MJ/)(C[I5(^2HE@")5`08.-!H080(08081(08Q81818141A%A!$6D%5S@+X`P
+M"(#`BI`@#$8*A&"%%*4&0:+2@R#16E!D&@"@4`08!"!")""BFKJZNKJZNKJZ
+MNKJZNKJZNKJZNKJZNKZ1O>][WO>][WO>][WO>][WZIO>][WO>][WO>][WO>]
+M[WO>][WO>][W[WOWK>][WO>_@][WO>]^$\)SG.<YSG.<YSG.<YSG.<YSG.<Y
+MSG.<YSFM:UK6M:UK6M:UK6M:UK6M:UK6M:UK6M:UK6M:UK6M:UK6M:UK6M:U
+MK6M:UK6M:UK6M:UK6M:UK6M:UK6M:UK6N<YSG.<YSG/#\YSG.<YSO><YSG.<
+MYSG.<YS\[G.<YSG.<YSP/TO`\#O^_[_Q7/%```#^<```````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````!F9F9F9F9F9F9F9F9F9F9F9F9F9F
+M9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F
+M9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F8`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````_8\>NW[C(Y&B]C2Z7V?:U.KBBX"L
+M6Q.SL225*BGD\GD[.SS5HD-6B0I$$5+8EM&8IBF*5K)-H*@]:@V0&R`2`!2%
+MQ<7%@*V@@$`)`N5(14@(W06R`-("\(=V9!?*C"#"!""EB4DDE)9GCS*I6RQ+
+M))*DL2Q*2Q*2S,S5F48QC&,6"WH`6P1*04"D!6D%I`2D!QA$"$$0("MD%`+B
+MXN+`*P02Z`T@@4@(%(`!2"T@#2`H%I:6E@JML`"V"4@`4@@E("XX`@L("*P%
+MLA9!`I`0+BXN+!`MMDDDM+2TK625*E2M9))4J5*E223J=3J=G8HHO5>F]-ZK
+MUGJ/4:-ZS2-&(:1$0HE$HFD5`#*@JY4!6D!&D%4*4DN+BXK6222I4J5K)))4
+MJ5*UDDE2I4K625*E2I4A)*E2I4J1$"I4J5K(BK)*E2I7Q`/%>*\5WB@/%==P
+M'77<.NNY!UUW"ZZZX===Q)====)===G29UUUTEUUW'77721UUUUUUW"2LJZZ
+MVRS.%58NNMX)===PDZZWA.NMXZZ[IB.NNZ777<2777<)===<)===PEUUW#KK
+M>PZZZXDZZZXNNNY`NNNK+,X994.NNX#KKN!UUW'76]"====!UUUT===P)UUW
+M)'77<DZZ[DEUUW'7770==;TAUUUTCKKN"5E3KKK,RSDK,RK,G77<2ZZ[AG77
+M7#KKKH.NM[$===S$===S$==;Q#KKN_I7].^:OZEX9G@GD7D6\.NNNP.NNNAU
+MUW8CKKN@.NNX&65===V6983KK>88ZZWH.NNSH.NNNCKKN2.NNYB.NNX===P=
+M==T%.NNY(ZZ[DG77<DNNNZ).NMY$NNNSA===9E73,JBS,I===TE'76\DIUMJ
+M#-MV(39:"&S<`+;;8@-FR(;-)`C;=28,VW0$)MNS$&VZ0Q#;=F#&-FA(5F86
+MVVV94F64C9LF(6VYI)B;-QC&-FPDC;;9C$C;;822VW4A)LMQ"3;=3&,VVU(A
+M+;;82^@MRRJRM738&65643&RW$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D//5J5JD]>P8PYYYYYYYYYYYZP9]"\7Q\>#7"8Q
+M-0F8>)C<.9H-&]I3^TR9-33O:61^"&+)DR9,F3)DR9,G\^*!"!"$!E07Q\@(
+M1X1E/,_F<V;*=6?<&'.C[&M:N;\F'8%3*93*99GP/1=,T;/O@7I@6,?N<P]Y
+M@F<=&W[/+L\A[[\'1MTUCPG_%Q7)<ER=R^UX;(N"^QU;L'BOF<16-HUC$-"\
+MA]CB/X-*]IJV#7]@'\G2.E:9YS"K\K'%:]V+X'AO>?:K'&:IW3KV9<9G7[/N
+M:-K7:,\_)6*QL'?.\=PSS8..XKQW^7?O^MRK'&<!GGI/$9]H62;)P7F."_T]
+M%O7Y/,<%H&Y>4V;V'P-TU3;OA:MFVL9E\SSFQ;5L''>V_9^+4O<2-.^=[S8/
+MU<-M&W;!(X*1QFS:AN&S;MQ6M<!MFL;-^3ZWSM\WC]6O;9PGW/L;AMVY?]:Y
+MOV_<!MWX-BXCA-LW+AMB_1^#?-PW+CMZ_1QE8W;]'"?LX+@7^MXZ_WO&WCKQ
+ME_U?]W2\9>#>#>#>#>-O_+I=+I+I))))))))))))))))))))))))))))))))
+M))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+M))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+M))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+M))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+M))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+M)))))))%8K%8K%8K%8K%8K%8C1HT:-&C1HT:-&C1HT:-&C1HT:-&C1HT:-&C
+M1HT:-&C1HT:-&C1HT:-&C1HT:-&C1HT:-&C1HT:-&C1HT:-&C1HT:-&C1HT:
+M-&C1HT:-&C1HT:-&C1HT:-&C1HT:-&K%8K%8K%9)))))))))))))))))))))
+M))))))))))))))))))))))))))))>+O%I$B1(D2)$B1(D2)$B1(D2)$B1+2T
+MM+2TM+2TM+2TM+2TM+2TM+2TM+2TB1(D2)$B1(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DM4$`)EX#U79SU<9X<KWW=,Y7XF];KP/M+;[[[_.00;)"]`
+M[TQ######WQ>/7WG99Z"QF14`LJ3,Q2K%4496*99BE*4I7W(NY(IPH2'>'])
+!"$Q#
+`
+end
diff --git a/contrib/netbsd-tests/usr.bin/shmif_dumpbus/t_basic.sh b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/t_basic.sh
new file mode 100755
index 0000000..10fea10
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/t_basic.sh
@@ -0,0 +1,86 @@
+# $NetBSD: t_basic.sh,v 1.8 2013/04/07 19:14:03 christos Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, 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 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.
+#
+
+unpack_file()
+{
+
+ atf_check -s exit:0 uudecode $(atf_get_srcdir)/${1}.bz2.uue
+ atf_check -s exit:0 bunzip2 -f ${1}.bz2
+}
+
+test_case()
+{
+ local name="${1}"; shift
+
+ atf_test_case "${name}"
+ eval "${name}_head() { }"
+ eval "${name}_body() { \
+ unpack_file shmbus ; \
+ ${name} ; \
+ }"
+}
+
+test_case header
+test_case contents
+test_case pcap
+
+ehdr='bus version 2, lock: 0, generation: 22, firstoff: 0x9e414, lastoff: 0x9dfd0'
+
+header()
+{
+
+ atf_check -s exit:0 -o inline:"${ehdr}\n" shmif_dumpbus -h shmbus
+}
+
+contents()
+{
+
+ unpack_file d_pkthdrs.out
+ atf_check -s exit:0 -o file:d_pkthdrs.out \
+ shmif_dumpbus shmbus
+}
+
+pcap()
+{
+
+ unpack_file d_pcap.out
+ atf_check -s exit:0 -o ignore shmif_dumpbus -p pcap shmbus
+#
+# should not fail anymore...
+#
+# Used to fail for "PR bin/44721"
+ atf_check -s exit:0 -o file:d_pcap.out -e ignore \
+ tcpdump -tt -r pcap
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case header
+ atf_add_test_case contents
+ atf_add_test_case pcap
+}
diff --git a/contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt b/contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt
new file mode 100644
index 0000000..a435545
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt
@@ -0,0 +1 @@
+000 \ No newline at end of file
diff --git a/contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt b/contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt
new file mode 100644
index 0000000..a435545
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt
@@ -0,0 +1 @@
+000 \ No newline at end of file
diff --git a/contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt b/contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt
new file mode 100644
index 0000000..a435545
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt
@@ -0,0 +1 @@
+000 \ No newline at end of file
diff --git a/contrib/netbsd-tests/usr.bin/sort/d_any_char_in.txt b/contrib/netbsd-tests/usr.bin/sort/d_any_char_in.txt
new file mode 100644
index 0000000..5963fca
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sort/d_any_char_in.txt
Binary files differ
diff --git a/contrib/netbsd-tests/usr.bin/sort/t_sort.sh b/contrib/netbsd-tests/usr.bin/sort/t_sort.sh
new file mode 100755
index 0000000..a36457c
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/sort/t_sort.sh
@@ -0,0 +1,1023 @@
+# $NetBSD: t_sort.sh,v 1.1 2012/03/17 16:33:15 jruoho Exp $
+#
+# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case basic
+basic_head()
+{
+ atf_set "descr" "Basic functionality test"
+}
+basic_body()
+{
+ cat >in <<EOF
+z b m f
+y c o e
+x a n h
+x a n g
+EOF
+
+ cat >expout <<EOF
+x a n g
+x a n h
+y c o e
+z b m f
+EOF
+
+ atf_check -o file:expout sort in
+}
+
+atf_test_case empty_file
+empty_file_head()
+{
+ atf_set "descr" "Tests sorting an empty file"
+}
+empty_file_body()
+{
+ touch empty
+ atf_check -o empty sort -S empty
+ atf_check sort -S -c empty
+ atf_check sort -S -c -u empty
+}
+
+atf_test_case end_of_options
+end_of_options_head()
+{
+ atf_set "descr" "Determination of end of option list"
+}
+end_of_options_body()
+{
+ echo x >-k
+ atf_check -o file:-k -x "sort -S -- -k </dev/null"
+ atf_check -s not-exit:1 -e ignore -x "sort -S - -c </dev/null"
+}
+
+atf_test_case missing_newline
+missing_newline_head()
+{
+ atf_set "descr" "Tests with missing new line in input file"
+}
+missing_newline_body()
+{
+ printf '%s' x >in
+ atf_check -o inline:'x\n' sort in
+}
+
+atf_test_case null_bytes
+null_bytes_head()
+{
+ atf_set "descr" "Tests the behavior of null bytes"
+}
+null_bytes_body()
+{
+ printf '\0b\n\0a\n' >in
+ atf_check -o inline:'\0a\n\0b\n' sort -S in
+}
+
+atf_test_case long_records
+long_records_head()
+{
+ atf_set "descr" "Tests long lines and keys"
+}
+long_records_body()
+{
+ awk 'BEGIN { x="x"
+ for(i=1; i<=12; i++) x = x x
+ for(i=15; i<=25; i++) print x i
+}' >in
+
+ awk 'BEGIN { x="x"
+ for(i=1; i<=12; i++) x = x x
+ for(i=25; i>=15; i--) print x i
+}' >out
+
+ atf_check -o file:out sort -r in
+ atf_check -o file:out sort -k 1,1r -k 1 in
+}
+
+atf_test_case long_file
+long_file_head()
+{
+ atf_set "descr" "Tests with a long file to try to force intermediate" \
+ "files"
+}
+long_file_body()
+{
+ awk 'BEGIN { for(i=0; i<20000; i++) print rand() }' >in
+ sort -S -r in | awk '$0 "x" != x { print ; x = $0 "x" }' >out
+ atf_check -o file:out sort -u -r in
+}
+
+atf_test_case any_char
+any_char_head()
+{
+ atf_set "descr" "Tests with files containing non-printable/extended" \
+ "characters"
+}
+any_char_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/d_any_char_dflag_out.txt \
+ sort -d -k 2 $(atf_get_srcdir)/d_any_char_in.txt
+
+ atf_check -o file:$(atf_get_srcdir)/d_any_char_fflag_out.txt \
+ sort -f -k 2 $(atf_get_srcdir)/d_any_char_in.txt
+
+ atf_check -o file:$(atf_get_srcdir)/d_any_char_iflag_out.txt \
+ sort -i -k 2 $(atf_get_srcdir)/d_any_char_in.txt
+}
+
+atf_test_case bflag
+bflag_head()
+{
+ atf_set "descr" "Tests the -b flag"
+}
+bflag_body()
+{
+ cat >in <<EOF
+ b
+ a
+EOF
+
+ atf_check -o file:in sort -b in
+ atf_check -o file:in -x "sort -b <in"
+ atf_check -s exit:1 -o ignore -e ignore -x "sort in | sort -c -r"
+}
+
+atf_test_case cflag
+cflag_head()
+{
+ atf_set "descr" "Tests the -c flag"
+}
+cflag_body()
+{
+ cat >in <<EOF
+b
+a
+EOF
+
+ atf_check -s exit:1 -e ignore sort -S -c in
+}
+
+atf_test_case kflag_one_field
+kflag_one_field_head()
+{
+ atf_set "descr" "Tests the -k flag with one field"
+}
+kflag_one_field_body()
+{
+ cat >in <<EOF
+z b m f
+y c o e
+x a n h
+x a n g
+EOF
+
+ cat >expout <<EOF
+x a n g
+x a n h
+z b m f
+y c o e
+EOF
+
+ atf_check -o file:expout sort -k2.1 in
+}
+
+atf_test_case kflag_two_fields
+kflag_two_fields_head()
+{
+ atf_set "descr" "Tests the -k flag with two fields"
+}
+kflag_two_fields_body()
+{
+ cat >in <<EOF
+z b m f
+y c o e
+x a n h
+x a n g
+EOF
+
+ cat >expout <<EOF
+x a n h
+x a n g
+z b m f
+y c o e
+EOF
+ atf_check -o file:expout sort -k2.1,2.0 in
+}
+
+atf_test_case kflag_many_fields
+kflag_many_fields_head()
+{
+ atf_set "descr" "Tests the -k flag with many fields"
+}
+kflag_many_fields_body()
+{
+ cat >in <<EOF
+0:2:3:4:5:6:7:8:9
+1:1:3:4:5:6:7:8:9
+1:2:2:4:5:6:7:8:9
+1:2:3:3:5:6:7:8:9
+1:2:3:4:4:6:7:8:9
+1:2:3:4:5:5:7:8:9
+1:2:3:4:5:6:6:8:9
+1:2:3:4:5:6:7:7:9
+1:2:3:4:5:6:7:8:8
+EOF
+
+ cat >out <<EOF
+1:2:3:4:5:6:7:8:8
+1:2:3:4:5:6:7:7:9
+1:2:3:4:5:6:6:8:9
+1:2:3:4:5:5:7:8:9
+1:2:3:4:4:6:7:8:9
+1:2:3:3:5:6:7:8:9
+1:2:2:4:5:6:7:8:9
+1:1:3:4:5:6:7:8:9
+0:2:3:4:5:6:7:8:9
+EOF
+
+ atf_check -o file:out sort -t: -k9 -k8 -k7 -k6 -k5 -k4 -k3 \
+ -k2 -k1 in
+}
+
+atf_test_case kflag_outofbounds
+kflag_outofbounds_head()
+{
+ atf_set "descr" "Tests the -k flag with out of bounds fields"
+}
+kflag_outofbounds_body()
+{
+ cat >in <<EOF
+0 5
+1 4
+2 3
+3 2
+4 1
+5 0
+EOF
+
+ atf_check -o file:in sort -k2.2,2.1 -k2.3,2.4 in
+}
+
+atf_test_case kflag_nonmonotone
+kflag_nonmonotone_head()
+{
+ atf_set "descr" "Tests the -k flag with apparently nonmonotone" \
+ "field specs"
+}
+kflag_nonmonotone_body()
+{
+ cat >in <<EOF
+aaaa c
+x a
+0 b
+EOF
+
+ atf_check -o file:in sort -k2,1.3 -k2.5,2.5 in
+}
+
+atf_test_case kflag_limits
+kflag_limits_head()
+{
+ atf_set "descr" "Tests the -k flag field limits"
+}
+kflag_limits_body()
+{
+ cat >in <<EOF
+a 2
+a 1
+b 2
+b 1
+EOF
+
+ cat >out <<EOF
+b 2
+b 1
+a 2
+a 1
+EOF
+
+ atf_check -o file:out sort -r -k1,1 -k2n in
+}
+
+atf_test_case kflag_alpha
+kflag_alpha_head()
+{
+ atf_set "descr" "Tests the -k flag with various alpha fields"
+}
+kflag_alpha_body()
+{
+ sort >in <<EOF
+01:04:19:01:16:01:21:01 a
+02:03:13:15:13:19:15:02 a
+03:02:07:09:07:13:09:03 a
+04:01:01:03:01:07:03:04 a
+05:08:20:16:17:02:20:05 aa
+06:07:14:18:14:20:14:06 aa
+07:06:08:10:08:14:08:07 aa
+08:05:02:04:02:08:02:08 aa
+09:16:22:02:22:04:24:13 b
+10:15:16:20:19:22:18:14 b
+11:14:10:12:10:16:12:15 b
+12:13:04:06:04:10:06:16 b
+13:24:24:22:24:06:22:21 bb
+14:23:18:24:21:24:16:22 bb
+15:22:12:14:12:18:10:23 bb
+16:21:06:08:06:12:04:24 bb
+17:12:21:21:18:03:19:09 ab
+18:11:15:19:15:21:13:10 ab
+19:10:09:11:09:15:07:11 ab
+20:09:03:05:03:09:01:12 ab
+21:20:23:17:23:05:23:17 ba
+22:19:17:23:20:23:17:18 ba
+23:18:11:13:11:17:11:19 ba
+24:17:05:07:05:11:05:20 ba
+EOF
+
+ atf_check -x "sort -S -k2b -k2 in >xx"
+ atf_check -e ignore sort -c -t: -k2n xx
+
+ atf_check -x "sort -S -k2,2.1b -k2 in >xx"
+ atf_check -e ignore sort -c -t: -k3n xx
+
+ atf_check -x "sort -S -k2.3 -k2 in >xx"
+ atf_check -e ignore sort -c -t: -k4n xx
+
+ atf_check -x "sort -S -k2b,2.3 -k2 in >xx"
+ atf_check -e ignore sort -c -t: -k5n xx
+
+ atf_check -x "sort -S -k2.3,2.1b -k2 in >xx"
+ atf_check -e ignore sort -c -t: -k6n xx
+
+ atf_check -x "sort -S -k2,2.1b -k2r in >xx"
+ atf_check -e ignore sort -c -t: -k7n xx
+
+ atf_check -x "sort -S -b -k2,2 -k2 in >xx"
+ atf_check -e ignore sort -c -t: -k8n xx
+
+ # XXX This test is broken. The standard is not clear on the behavior.
+ #atf_check -x "sort -S -b -k2,2b -k2 in >xx"
+ #atf_check -e ignore sort -c -t: -k3n xx
+}
+
+atf_test_case kflag_no_end
+kflag_no_end_head()
+{
+ atf_set "descr" "Tests the -k flag with a field without end"
+}
+kflag_no_end_body()
+{
+ cat >in <<EOF
+a-B
+a+b
+a b
+A+b
+a b
+EOF
+
+ cat >out <<EOF
+a b
+a b
+A+b
+a-B
+a+b
+EOF
+
+ atf_check -o file:out sort -df -k 1 -k 1d <in
+}
+
+atf_test_case mflag
+mflag_head()
+{
+ atf_set "descr" "Tests the -m flag"
+}
+mflag_body()
+{
+ cat >in1 <<EOF
+a
+ab
+ab
+bc
+ca
+EOF
+ cat >in2 <<EOF
+Z
+a
+aa
+ac
+c
+EOF
+ cat >out <<EOF
+Z
+a
+a
+aa
+ab
+ab
+ac
+bc
+c
+ca
+EOF
+
+ atf_check -o file:out sort -S -m in1 in2
+}
+
+atf_test_case mflag_uflag
+mflag_uflag_head()
+{
+ atf_set "descr" "Tests the -m flag together with -u"
+}
+mflag_uflag_body()
+{
+ cat >in <<EOF
+a
+b
+c
+d
+EOF
+
+ atf_check -o file:in sort -m -u in
+}
+
+atf_test_case mflag_uflag_first
+mflag_uflag_first_head()
+{
+ atf_set "descr" "Tests that the -m flag together with -u picks the" \
+ "first among equal"
+}
+mflag_uflag_first_body()
+{
+ cat >in <<EOF
+3B
+3b
+3B2
+~3B2
+4.1
+41
+5
+5.
+EOF
+
+ cat >out <<EOF
+3B
+3B2
+4.1
+5
+EOF
+
+ atf_check -o file:out sort -mudf in
+ atf_check -o file:out sort -mudf -k1 in
+}
+
+atf_test_case nflag
+nflag_head()
+{
+ atf_set "descr" "Tests the -n flag"
+}
+nflag_body()
+{
+ cat >in <<EOF
+-99.0
+-99.1
+-.0002
+-10
+2
+0010.000000000000000000000000000000000001
+10
+3x
+x
+EOF
+
+ cat >expout <<EOF
+-99.1
+-99.0
+-10
+-.0002
+x
+2
+3x
+10
+0010.000000000000000000000000000000000001
+EOF
+
+ atf_check -o file:expout sort -n in
+}
+
+atf_test_case nflag_rflag
+nflag_rflag_head()
+{
+ atf_set "descr" "Tests the -n and -r flag combination"
+}
+nflag_rflag_body()
+{
+ cat >in <<EOF
+1
+123
+2
+EOF
+
+ cat >expout <<EOF
+123
+2
+1
+EOF
+
+ atf_check -o file:expout sort -rn in
+}
+
+atf_test_case oflag
+oflag_head()
+{
+ atf_set "descr" "Tests the -o flag"
+}
+oflag_body()
+{
+ cat >in <<EOF
+1
+1
+2
+2
+3
+3
+4
+4
+EOF
+
+ atf_check sort -u -o in in
+
+ cat >expout <<EOF
+1
+2
+3
+4
+EOF
+
+ atf_check -o file:expout cat in
+}
+
+atf_test_case oflag_displaced
+oflag_displaced_head()
+{
+ atf_set "descr" "Tests the -o flag after the file names"
+}
+oflag_displaced_body()
+{
+ atf_check sort -S /dev/null -o out
+ test -f out || atf_fail "File not created"
+}
+
+atf_test_case rflag
+rflag_head()
+{
+ atf_set "descr" "Tests the -r flag"
+}
+rflag_body()
+{
+ cat >in <<EOF
+z b m f
+y c o e
+x a n h
+x a n g
+EOF
+
+ cat >expout <<EOF
+z b m f
+y c o e
+x a n h
+x a n g
+EOF
+
+ atf_check -o file:expout sort -r in
+}
+
+atf_test_case sflag
+sflag_head()
+{
+ atf_set "descr" "Tests the -s flag"
+}
+sflag_body()
+{
+ cat >in <<EOF
+a 2
+b 1
+c 2
+a 1
+b 2
+c 1
+EOF
+
+ cat >out <<EOF
+a 2
+a 1
+b 1
+b 2
+c 2
+c 1
+EOF
+
+ atf_check -o file:out sort -s -k1,1 in
+}
+
+atf_test_case sflag_many_files
+sflag_many_files_head()
+{
+ atf_set "descr" "Tests the -s flag with multiple files"
+}
+sflag_many_files_body()
+{
+ cat >in1 <<EOF
+c 2
+a 2
+EOF
+
+ cat >in2 <<EOF
+c 1
+b 1
+a 1
+EOF
+
+ cat >out <<EOF
+c 2
+b 1
+a 2
+EOF
+
+ atf_check -o file:out sort -smru -k1,1 in1 in1 in2 in2
+}
+
+atf_test_case tflag
+tflag_head()
+{
+ atf_set "descr" "Tests the -t flag"
+}
+tflag_body()
+{
+ cat >in <<EOF
+a:
+a!
+EOF
+
+ atf_check -o file:in sort -t : -r +0 in
+ atf_check -o file:in sort -t : +0 -1 in
+ atf_check -o file:in sort -t : -r -k 1 in
+ atf_check -o file:in sort -t : -k 1,1 in
+}
+
+atf_test_case tflag_alphabetic
+tflag_alphabetic_head()
+{
+ atf_set "descr" "Tests the -t flag with a character as the delimiter"
+}
+tflag_alphabetic_body()
+{
+ cat >in <<EOF
+zXa
+yXa
+zXb
+EOF
+
+ atf_check -o file:in sort -tX -k2 -k1r,1 in
+}
+
+atf_test_case tflag_char_pos
+tflag_char_pos_head()
+{
+ atf_set "descr" "Tests the -t flag with character positions in fields"
+}
+tflag_char_pos_body()
+{
+ cat >in <<EOF
+: ab
+:bac
+EOF
+
+ cat >out <<EOF
+:bac
+: ab
+EOF
+
+ atf_check -o file:out sort -b -t: +1.1 in
+ atf_check -o file:out sort -t: +1.1r in
+ atf_check -o file:out sort -b -t: -k 2.2 in
+ atf_check -o file:out sort -t: -k 2.2r in
+}
+
+atf_test_case tflag_whitespace
+tflag_whitespace_head()
+{
+ atf_set "descr" "Tests the -t flag with spaces and tabs as the" \
+ "delimiter"
+}
+tflag_whitespace_body()
+{
+ cat >in <<EOF
+ b c
+ b c
+ b c
+EOF
+
+ atf_check -o file:in sort -t ' ' -k2,2 in
+ atf_check -o file:in sort -t ' ' -k2.1,2.0 in
+
+ cat >out <<EOF
+ b c
+ b c
+ b c
+EOF
+
+ atf_check -o file:out sort -t ' ' -k2,2 in
+ atf_check -o file:out sort -t ' ' -k2.1,2.0 in
+
+ cat >out <<EOF
+ b c
+ b c
+ b c
+EOF
+
+ atf_check -o file:out sort -S -k2 in
+
+ cat >out <<EOF
+ b c
+ b c
+ b c
+EOF
+
+ atf_check -o file:out sort -S -k2b in
+}
+
+atf_test_case uflag
+uflag_head()
+{
+ atf_set "descr" "Tests the -u flag"
+}
+uflag_body()
+{
+ cat >in <<EOF
+a
+aa
+aaa
+aa
+EOF
+
+ cat >expout <<EOF
+a
+aa
+aaa
+EOF
+
+ atf_check -o file:expout sort -u in
+}
+
+atf_test_case uflag_rflag
+uflag_rflag_head()
+{
+ atf_set "descr" "Tests the -u and -r flag combination"
+}
+uflag_rflag_body()
+{
+ cat >in <<EOF
+a
+aa
+aaa
+aa
+EOF
+
+ cat >expout <<EOF
+aaa
+aa
+a
+EOF
+
+ atf_check -o file:expout sort -ru in
+}
+
+atf_test_case plus_one
+plus_one_head()
+{
+ atf_set "descr" "Tests +- addressing: +1 should become -k2.1"
+}
+plus_one_body()
+{
+ cat >in <<EOF
+z b m f
+y c o e
+x a n h
+x a n g
+EOF
+
+ cat >expout <<EOF
+x a n g
+x a n h
+z b m f
+y c o e
+EOF
+
+ atf_check -o file:expout sort +1 in
+}
+
+atf_test_case plus_one_minus_two
+plus_one_minus_two_head()
+{
+ atf_set "descr" "Tests +- addressing: +1 -2 should become -k2.1,2.0"
+}
+plus_one_minus_two_body()
+{
+ cat >in <<EOF
+z b m f
+y c o e
+x a n h
+x a n g
+EOF
+
+ cat >expout <<EOF
+x a n h
+x a n g
+z b m f
+y c o e
+EOF
+
+ atf_check -o file:expout sort +1 -2 in
+}
+
+atf_test_case plus_zero
+plus_zero_head()
+{
+ atf_set "descr" "Tests +- addressing: '-- +0' raised a '-k1.1: No" \
+ "such file or directory' error"
+}
+plus_zero_body()
+{
+ echo 'good contents' >./+0
+
+ atf_check -o file:+0 sort -- +0
+}
+
+atf_test_case plus_nonmonotone
+plus_nonmonotone_head()
+{
+ atf_set "descr" "Tests += addressing: apparently nonmonotone field" \
+ "specs"
+}
+plus_nonmonotone_body()
+{
+ cat >in <<EOF
+aaaa c
+x a
+0 b
+EOF
+
+ atf_check -o file:in sort +1 -0.3 +1.4 -1.5 in
+}
+
+atf_test_case plus_as_path
+plus_as_path_head()
+{
+ atf_set "descr" "Tests +- addressing: 'file +0' raised a '-k1.1: No" \
+ "such file or directory' error"
+}
+plus_as_path_body()
+{
+ echo 'good contents' >./+0
+ echo 'more contents' >in
+ cat ./+0 in >expout
+
+ atf_check -o file:expout sort in +0
+}
+
+atf_test_case plus_bad_tempfile
+plus_bad_tempfile_head()
+{
+ atf_set "descr" "Tests +- addressing: intermediate wrong behavior" \
+ "that raised a '+0: No such file or directory' error"
+}
+plus_bad_tempfile_body()
+{
+ echo 'good contents' >in
+ atf_check -o file:in sort -T /tmp +0 in
+}
+
+atf_test_case plus_rflag_invalid
+plus_rflag_invalid_head()
+{
+ atf_set "descr" "Tests +- addressing: invalid record delimiter"
+}
+plus_rflag_invalid_body()
+{
+ (
+ echo 'z b m f'
+ echo 'y c o e'
+ echo 'x a n h'
+ echo 'x a n g'
+ ) | tr '\n' '+' >in
+
+ atf_check -o inline:'x a n g+x a n h+z b m f+y c o e+' \
+ sort -R + -k2 in
+}
+
+atf_test_case plus_tflag
+plus_tflag_head()
+{
+ atf_set "descr" "Tests +- addressing: using -T caused a 'No such file" \
+ "or directory' error"
+}
+plus_tflag_body()
+{
+ mkdir ./+
+ yes | sed 200000q | sort -T + >/dev/null || atf_fail "program failed"
+}
+
+atf_test_case plus_no_end
+plus_no_end_head()
+{
+ atf_set "descr" "Tests +- addressing: field without end"
+}
+plus_no_end_body()
+{
+ cat >in <<EOF
+a-B
+a+b
+a b
+A+b
+a b
+EOF
+
+ cat >out <<EOF
+a b
+a b
+A+b
+a-B
+a+b
+EOF
+
+ atf_check -o file:out sort -df +0 +0d in
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic
+ atf_add_test_case empty_file
+ atf_add_test_case end_of_options
+ atf_add_test_case missing_newline
+ atf_add_test_case null_bytes
+ atf_add_test_case long_records
+ atf_add_test_case long_file
+ atf_add_test_case any_char
+ atf_add_test_case bflag
+ atf_add_test_case cflag
+ atf_add_test_case kflag_one_field
+ atf_add_test_case kflag_two_fields
+ atf_add_test_case kflag_many_fields
+ atf_add_test_case kflag_outofbounds
+ atf_add_test_case kflag_nonmonotone
+ atf_add_test_case kflag_limits
+ atf_add_test_case kflag_alpha
+ atf_add_test_case kflag_no_end
+ atf_add_test_case mflag
+ atf_add_test_case mflag_uflag
+ atf_add_test_case mflag_uflag_first
+ atf_add_test_case nflag
+ atf_add_test_case nflag_rflag
+ atf_add_test_case oflag
+ atf_add_test_case oflag_displaced
+ atf_add_test_case rflag
+ atf_add_test_case sflag
+ atf_add_test_case sflag_many_files
+ atf_add_test_case tflag
+ atf_add_test_case tflag_alphabetic
+ atf_add_test_case tflag_char_pos
+ atf_add_test_case tflag_whitespace
+ atf_add_test_case uflag
+ atf_add_test_case uflag_rflag
+ atf_add_test_case plus_one
+ atf_add_test_case plus_one_minus_two
+ atf_add_test_case plus_zero
+ atf_add_test_case plus_nonmonotone
+ atf_add_test_case plus_as_path
+ atf_add_test_case plus_bad_tempfile
+ atf_add_test_case plus_rflag_invalid
+ atf_add_test_case plus_tflag
+ atf_add_test_case plus_no_end
+}
diff --git a/contrib/netbsd-tests/usr.bin/tmux/t_tmux.sh b/contrib/netbsd-tests/usr.bin/tmux/t_tmux.sh
new file mode 100755
index 0000000..f1852e5
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/tmux/t_tmux.sh
@@ -0,0 +1,49 @@
+# $NetBSD: t_tmux.sh,v 1.2 2012/05/19 07:30:37 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+stdincrash() {
+ atf_check -s ignore -o ignore -e ignore -x \
+ "\"tmux list-sessions 0<&-\" & sleep 2; kill $! >/dev/null 2>&1"
+}
+
+atf_test_case stdin
+stdin_head() {
+ atf_set "descr" "Test that tmux(1) does not crash the system " \
+ "when stdin(4) is closed (PR kern/46463)"
+}
+
+stdin_body() {
+ stdincrash
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case stdin
+}
diff --git a/contrib/netbsd-tests/usr.bin/tr/t_basic.sh b/contrib/netbsd-tests/usr.bin/tr/t_basic.sh
new file mode 100755
index 0000000..4515d11
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/tr/t_basic.sh
@@ -0,0 +1,195 @@
+# $NetBSD: t_basic.sh,v 1.3 2013/08/11 01:50:02 dholland Exp $
+#
+# Copyright (c) 2013 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by David A. Holland.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# tr -d: delete character
+#
+atf_test_case dopt
+dopt_head() {
+ atf_set "descr" "Tests for tr -d"
+}
+
+dopt_body() {
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr -d x'
+ atf_check -o inline:'abde\n' -x 'echo abcde | tr -d c'
+ atf_check -o inline:'ace\n' -x 'echo abcde | tr -d bd'
+ atf_check -o inline:'ae\n' -x 'echo abcde | tr -d b-d'
+ atf_check -o inline:'b\n' -x 'echo abcde | tr -d ac-e'
+ atf_check -o inline:'d\n' -x 'echo abcde | tr -d a-ce'
+ atf_check -o inline:'aei\n' -x 'echo abcdefghi | tr -d b-df-h'
+
+ atf_check -o inline:'' -x 'echo abcde | tr -c -d x'
+ atf_check -o inline:'c' -x 'echo abcde | tr -c -d c'
+ atf_check -o inline:'bd' -x 'echo abcde | tr -c -d bd'
+ atf_check -o inline:'bcd' -x 'echo abcde | tr -c -d b-d'
+ atf_check -o inline:'acde' -x 'echo abcde | tr -c -d ac-e'
+ atf_check -o inline:'abce' -x 'echo abcde | tr -c -d a-ce'
+ atf_check -o inline:'bcdfgh' -x 'echo abcdefghi | tr -c -d b-df-h'
+
+ # see if escape codes work
+ atf_check -o inline:'splice' -x '(echo spl; echo ice) | tr -d '"'\n'"
+ atf_check -o inline:'splice' -x '(echo spl; echo ice) | tr -d '"'\012'"
+
+ # see if escape codes work when followed by other things
+ atf_check -o inline:'slice' -x '(echo spl; echo ice) | tr -d '"'\n'p"
+ atf_check -o inline:'slice' -x '(echo spl; echo ice) | tr -d '"'\012'p"
+
+ # see if the [=x=] syntax works
+ atf_check -o inline:'abde\n' -x 'echo abcde | tr -d '"'[=c=]'"
+ atf_check -o inline:'bde\n' -x 'echo abcde | tr -d '"'[=c=]'a"
+
+ # make sure 0 works
+ # (ignore stderr as dd blabbers to it)
+ atf_check -e ignore -o inline:'ab\n' \
+ -x '(echo -n a; dd if=/dev/zero bs=3 count=1; echo b) | tr -d '"'\0'"
+
+ # test posix classes
+ atf_check -o inline:'.\n' -x 'echo aAzZ.123 | tr -d '"'[:alnum:]'"
+ atf_check -o inline:'.123\n' -x 'echo aAzZ.123 | tr -d '"'[:alpha:]'"
+ atf_check -o inline:'az\n' -x 'echo "a z" | tr -d '"'[:blank:]'"
+ atf_check -o inline:'az' -x '(echo a; echo z) | tr -d '"'[:cntrl:]'"
+ atf_check -o inline:'aAzZ.\n' -x 'echo aAzZ.123 | tr -d '"'[:digit:]'"
+ atf_check -o inline:' \n' -x 'echo "a z.123" | tr -d '"'[:graph:]'"
+ atf_check -o inline:'AZ.123\n' -x 'echo aAzZ.123 | tr -d '"'[:lower:]'"
+ atf_check -o inline:'\n' -x 'echo aAzZ.123 | tr -d '"'[:print:]'"
+ atf_check -o inline:'aAzZ12\n' -x 'echo aAzZ.12 | tr -d '"'[:punct:]'"
+ atf_check -o inline:'az' -x 'echo "a z" | tr -d '"'[:space:]'"
+ atf_check -o inline:'az.123\n' -x 'echo aAzZ.123 | tr -d '"'[:upper:]'"
+ atf_check -o inline:'zZ.\n' -x 'echo aAzZ.123 | tr -d '"'[:xdigit:]'"
+}
+
+#
+# tr -s: squeeze duplicate character runs
+#
+atf_test_case sopt
+sopt_head() {
+ atf_set "descr" "Tests for tr -s"
+}
+
+sopt_body() {
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr -s x'
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr -s c'
+ atf_check -o inline:'abcde\n' -x 'echo abccccde | tr -s c'
+ atf_check -o inline:'abcde\n' -x 'echo abbbcddde | tr -s bd'
+ atf_check -o inline:'abcde\n' -x 'echo abbbcccddde | tr -s b-d'
+
+ atf_check -o inline:'acac\n' -x 'echo acac | tr -s c'
+ atf_check -o inline:'acac\n' -x 'echo accacc | tr -s c'
+
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr -c -s x'
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr -c -s c'
+ atf_check -o inline:'abcccde\n' -x 'echo abcccde | tr -c -s c'
+ atf_check -o inline:'abbbcddde\n' -x 'echo abbbcddde | tr -c -s bd'
+ atf_check -o inline:'abbbccddde\n' -x 'echo abbbccddde | tr -c -s b-d'
+ atf_check -o inline:'abcccde\n' -x 'echo aaabcccde | tr -c -s b-d'
+}
+
+#
+# tr -ds: both -d and -s at once
+#
+atf_test_case dsopt
+dsopt_head() {
+ atf_set "descr" "Tests for tr -ds"
+}
+
+dsopt_body() {
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr -ds x y'
+ atf_check -o inline:'abde\n' -x 'echo abcde | tr -ds c x'
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr -ds x c'
+ atf_check -o inline:'abde\n' -x 'echo abcde | tr -ds c c'
+ atf_check -o inline:'abde\n' -x 'echo abcccde | tr -ds c x'
+ atf_check -o inline:'abcde\n' -x 'echo abcccde | tr -ds x c'
+ atf_check -o inline:'abde\n' -x 'echo abcccde | tr -ds c c'
+
+ # -c complements only the first string
+ atf_check -o inline:'' -x 'echo abcde | tr -c -ds x y'
+ atf_check -o inline:'c' -x 'echo abcde | tr -c -ds c x'
+ atf_check -o inline:'' -x 'echo abcde | tr -c -ds x c'
+ atf_check -o inline:'c' -x 'echo abcde | tr -c -ds c c'
+ atf_check -o inline:'ccc' -x 'echo abcccde | tr -c -ds c x'
+ atf_check -o inline:'' -x 'echo abcccde | tr -c -ds x c'
+ atf_check -o inline:'c' -x 'echo abcccde | tr -c -ds c c'
+}
+
+#
+# test substitution
+#
+atf_test_case subst
+subst_head() {
+ atf_set "descr" "Tests for tr substitution"
+}
+
+subst_body() {
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr a-c a-c'
+ atf_check -o inline:'cbade\n' -x 'echo abcde | tr a-c cba'
+ atf_check -o inline:'abcde\n' -x 'echo abcde | tr a-z a-z'
+ atf_check -o inline:'bcdef\n' -x 'echo abcde | tr a-z b-za'
+ atf_check -o inline:'zabcd\n' -x 'echo abcde | tr b-za a-z'
+ atf_check -o inline:'bbbbb\n' -x 'echo ababa | tr a b'
+ atf_check -o inline:'furrfu\n' -x 'echo sheesh | tr a-z n-za-m'
+ atf_check -o inline:'furrfu\n' -x 'echo sheesh | tr n-za-m a-z'
+
+ atf_check -o inline:'ABCDE\n' -x 'echo abcde | tr a-z A-Z'
+ atf_check -o inline:'ABC\n' \
+ -x 'echo abc | tr '"'[:lower:]' '[:upper:]'"
+
+ # If you don't give enough substitution chars the last is repeated.
+ atf_check -o inline:'bozoo\n' -x 'echo abcde | tr a-z bozo'
+ atf_check -o inline:'qaaaa\n' -x 'echo abcde | tr a-z qa'
+
+ # You can use -s with substitution.
+ atf_check -o inline:'cbade\n' -x 'echo abcde | tr -s a-c cba'
+ atf_check -o inline:'cbaddee\n' -x 'echo aabbccddee | tr -s a-c cba'
+}
+
+#
+# test substitution with -c (does not currently work)
+#
+atf_test_case csubst
+csubst_head() {
+ atf_set "descr" "Tests for tr substitution with -c"
+}
+
+csubst_body() {
+ atf_check -o inline:'abcde\n' -x \
+ 'echo abcde | tr -c '"'\0-ac-\377' b"
+ atf_check -o inline:'abcde\n' -x \
+ 'echo abcde | tr -c '"'\0-ad-\377' bc"
+ atf_check -o inline:'QUACK\n' -x \
+ 'echo ABCDE | tr -c '"'\0-@' QUACK"
+}
+
+atf_init_test_cases() {
+ atf_add_test_case dopt
+ atf_add_test_case sopt
+ atf_add_test_case dsopt
+ atf_add_test_case subst
+ atf_add_test_case csubst
+}
diff --git a/contrib/netbsd-tests/usr.bin/unifdef/d_basic.in b/contrib/netbsd-tests/usr.bin/unifdef/d_basic.in
new file mode 100644
index 0000000..9de6a94
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/unifdef/d_basic.in
@@ -0,0 +1,25 @@
+#if defined(__FreeBSD__)
+#include <netinet/if_fddi.h>
+#else
+#include <net/if_fddi.h>
+#endif
+
+#if defined(__FreeBSD__)
+ #include <stdbool.h>
+ #include <stdbool.h>
+ #include <stdbool.h>
+ #include <stdbool.h>
+ #include <stdbool.h>
+ #include <stdbool.h>
+#else
+#include <stdint.h>
+#endif
+
+#if defined(__FreeBSD__)
+#endif
+
+#ifdef __FreeBSD__
+#include <unistd.h>
+#else
+#include <inttypes.h>
+#endif
diff --git a/contrib/netbsd-tests/usr.bin/unifdef/d_basic.out b/contrib/netbsd-tests/usr.bin/unifdef/d_basic.out
new file mode 100644
index 0000000..2d52e9e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/unifdef/d_basic.out
@@ -0,0 +1,6 @@
+#include <net/if_fddi.h>
+
+#include <stdint.h>
+
+
+#include <inttypes.h>
diff --git a/contrib/netbsd-tests/usr.bin/unifdef/t_basic.sh b/contrib/netbsd-tests/usr.bin/unifdef/t_basic.sh
new file mode 100755
index 0000000..43ca280
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/unifdef/t_basic.sh
@@ -0,0 +1,62 @@
+# $NetBSD: t_basic.sh,v 1.6 2012/10/15 17:49:58 njoly Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "A basic test of unifdef(1) (PR bin/42628)"
+ atf_set "require.progs" "unifdef"
+}
+
+basic_body() {
+
+ atf_check -s ignore -o file:$(atf_get_srcdir)/d_basic.out \
+ -x "unifdef -U__FreeBSD__ $(atf_get_srcdir)/d_basic.in"
+}
+
+atf_test_case lastline
+lastline_head() {
+ atf_set "descr" "Checks with directive on last line (PR bin/47068)"
+}
+
+lastline_body() {
+
+ # With newline after cpp directive
+ printf '#ifdef foo\n#endif\n' >input
+ atf_check -o file:input unifdef -Ubar input
+
+ # Without newline after cpp directive
+ printf '#ifdef foo\n#endif' >input
+ atf_check -o file:input unifdef -Ubar input
+}
+
+atf_init_test_cases() {
+ atf_add_test_case basic
+ atf_add_test_case lastline
+}
diff --git a/contrib/netbsd-tests/usr.bin/vmstat/t_vmstat.sh b/contrib/netbsd-tests/usr.bin/vmstat/t_vmstat.sh
new file mode 100755
index 0000000..6676900
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/vmstat/t_vmstat.sh
@@ -0,0 +1,48 @@
+# $NetBSD: t_vmstat.sh,v 1.1 2014/01/07 16:47:13 gson Exp $
+#
+# Copyright (c) 2013 The NetBSD Foundation, 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 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.
+#
+
+atf_test_case default
+default_head() {
+ atf_set "descr" "Test that vmstat(1) returns success when run with no arguments"
+}
+default_body() {
+ atf_check -s exit:0 -o ignore -e empty vmstat
+}
+
+atf_test_case opt_s
+opt_s_head() {
+ atf_set "descr" "Test that vmstat(1) returns success when run with -s (PR 44518)"
+}
+opt_s_body() {
+ atf_check -s exit:0 -o ignore -e empty vmstat -s
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case default
+ atf_add_test_case opt_s
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_alignof.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_alignof.c
new file mode 100644
index 0000000..4a66134
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_alignof.c
@@ -0,0 +1,6 @@
+/* __alignof__ */
+int
+main(void)
+{
+ return __alignof__(short);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_complex_num.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_complex_num.c
new file mode 100644
index 0000000..c3c952e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_complex_num.c
@@ -0,0 +1,7 @@
+double cabs(double _Complex);
+
+double cabs(double _Complex foo)
+{
+ double d = __real__ foo;
+ return d + 0.1fi;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_complex_split.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_complex_split.c
new file mode 100644
index 0000000..7b3d1a1
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_complex_split.c
@@ -0,0 +1,8 @@
+int b(double a) {
+ return a == 0;
+}
+void a(void) {
+ double _Complex z = 0;
+ if (b(__real__ z) && b(__imag__ z))
+ return;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c
new file mode 100644
index 0000000..f32a963
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c
@@ -0,0 +1,5 @@
+void sample(void)
+{
+ int i = 0; i += 1;
+ int j = 0; j += 1;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c
new file mode 100644
index 0000000..960d392
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c
@@ -0,0 +1,6 @@
+typedef int int_t;
+int main(void) {
+int i = 0; i += 1;
+int_t j = 0; j += 1;
+return 0;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c
new file mode 100644
index 0000000..278fe1b
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c
@@ -0,0 +1,5 @@
+void sample(int i)
+{
+ i += 1;
+ int j = 0; j += 1;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_for_loops.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_for_loops.c
new file mode 100644
index 0000000..48e380c
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_for_loops.c
@@ -0,0 +1,15 @@
+/* c99 for loops */
+extern void foo(int);
+
+int
+main(void)
+{
+ // Test the basic functionality
+ for (int i = 0; i < 10; i++)
+ foo(i);
+
+ // Test that the scope of the iterator is correct
+ for (int i = 0; i < 10; i++)
+ continue;
+ return 0;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_func.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_func.c
new file mode 100644
index 0000000..b827bfa
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_func.c
@@ -0,0 +1,7 @@
+/* C99 __func__ */
+
+void
+foo(const char *p) {
+ p = __func__;
+ foo(p);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_recursive_init.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_recursive_init.c
new file mode 100644
index 0000000..347644f
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_recursive_init.c
@@ -0,0 +1,13 @@
+/* C99 recursive struct/union initialization */
+struct top {
+ int i;
+ char c;
+ union onion {
+ short us;
+ char uc;
+ } u;
+ char *s;
+} c[] = {
+ { .s = "foo", .c = 'b', .u = { .uc = 'c' } },
+ { .i = 1, .c = 'a', .u = { .us = 2 } },
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_struct_init.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_struct_init.c
new file mode 100644
index 0000000..a94cbd1
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_struct_init.c
@@ -0,0 +1,10 @@
+/* C99 struct initialization */
+struct {
+ int i;
+ char *s;
+} c[] = {
+ { .i = 2, },
+ { .s = "foo" },
+ { .i = 1, .s = "bar" },
+ { .s = "foo", .i = -1 },
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init1.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init1.c
new file mode 100644
index 0000000..0e1a1a8
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init1.c
@@ -0,0 +1,8 @@
+/* C99 union initialization */
+union {
+ int i;
+ char *s;
+} c[] = {
+ { i: 1 },
+ { s: "foo" }
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init2.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init2.c
new file mode 100644
index 0000000..51d34d4
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init2.c
@@ -0,0 +1,8 @@
+/* C99 union initialization */
+union {
+ int i[10];
+ short s;
+} c[] = {
+ { s: 2 },
+ { i: { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init3.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init3.c
new file mode 100644
index 0000000..f5e8b59
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init3.c
@@ -0,0 +1,8 @@
+/* C99 union initialization */
+struct {
+ int i[10];
+ char *s;
+} c[] = {
+ { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
+ "foo" },
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c9x_array_init.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c9x_array_init.c
new file mode 100644
index 0000000..66f0e9e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c9x_array_init.c
@@ -0,0 +1,6 @@
+/* C9X array initializers */
+int foo[256] = {
+ [2] = 1,
+ [3] = 2,
+ [4 ... 5] = 3
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c9x_recursive_init.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c9x_recursive_init.c
new file mode 100644
index 0000000..df907cd
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c9x_recursive_init.c
@@ -0,0 +1,16 @@
+/* C9X struct/union member init, with nested union and trailing member */
+union node {
+ void *next;
+ char *data;
+};
+struct foo {
+ int b;
+ union node n;
+ int c;
+};
+
+struct foo f = {
+ .b = 1,
+ .n = { .next = 0, },
+ .c = 1
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_init.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_init.c
new file mode 100644
index 0000000..36986e8
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_init.c
@@ -0,0 +1,27 @@
+/* cast initialization */
+typedef unsigned char u_char;
+typedef unsigned int size_t;
+struct sockaddr_x25 {
+ u_char x25_len;
+ u_char x25_family;
+ short x25_net;
+ char x25_addr[16];
+ struct x25opts {
+ char op_flags;
+ char op_psize;
+ char op_wsize;
+ char op_speed;
+ } x25_opts;
+ short x25_udlen;
+ char x25_udata[16];
+};
+
+struct sockaddr_x25 x25_dgmask = {
+ (unsigned char)(unsigned char)(unsigned int)(unsigned long)(&((( struct sockaddr_x25 *)0)->x25_udata[1])) ,
+ 0,
+ 0,
+ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+ {0, 0, 0, 0},
+ -1,
+ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_init2.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_init2.c
new file mode 100644
index 0000000..9597d35
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_init2.c
@@ -0,0 +1,7 @@
+/* cast initialization as the rhs of a - operand */
+struct sockaddr_dl {
+ char sdl_data[2];
+};
+
+int npdl_datasize = sizeof(struct sockaddr_dl) -
+((int) ((unsigned long)&((struct sockaddr_dl *) 0)->sdl_data[0]));
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_lhs.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_lhs.c
new file mode 100644
index 0000000..eb86569
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_lhs.c
@@ -0,0 +1,7 @@
+/* pointer casts are valid lhs lvalues */
+struct sockaddr { };
+void
+foo() {
+ unsigned long p = 6;
+ ((struct sockaddr *)p) = 0;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals1.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals1.c
new file mode 100644
index 0000000..cd1987a
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals1.c
@@ -0,0 +1,11 @@
+/* compound literals */
+
+struct p {
+ short a, b, c, d;
+};
+
+foo()
+{
+ struct p me = (struct p) {1, 2, 3, 4};
+ me.a = me.b;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals2.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals2.c
new file mode 100644
index 0000000..e4ffb92
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals2.c
@@ -0,0 +1,18 @@
+/* compound literals */
+
+struct p {
+ short a, b, c, d;
+} zz = {
+ 1, 2, 3, 4
+};
+
+struct p *bar(int i)
+{
+ static struct p q[10];
+ return &q[i];
+}
+
+foo()
+{
+ *bar(1) = (struct p) { 1, 2, 3, 4 };
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_constant_conv1.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_constant_conv1.c
new file mode 100644
index 0000000..53795c5
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_constant_conv1.c
@@ -0,0 +1,9 @@
+/* Flag information-losing constant conversion in argument lists */
+
+int f(unsigned int);
+
+void
+should_fail()
+{
+ f(-1);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_constant_conv2.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_constant_conv2.c
new file mode 100644
index 0000000..87066c9
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_constant_conv2.c
@@ -0,0 +1,9 @@
+/* Flag information-losing constant conversion in argument lists */
+
+int f(unsigned int);
+
+void
+should_fail()
+{
+ f(2.1);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cvt_constant.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cvt_constant.c
new file mode 100644
index 0000000..aa74509
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cvt_constant.c
@@ -0,0 +1,8 @@
+/* the second assignment assumes failed before */
+int
+main(void) {
+ double x = 1;
+ int foo = 0;
+ if (foo)
+ x = 1;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cvt_in_ternary.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cvt_in_ternary.c
new file mode 100644
index 0000000..4a6149c
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cvt_in_ternary.c
@@ -0,0 +1,13 @@
+/* CVT node handling in ?: operator */
+typedef unsigned long int size_t;
+struct filecore_direntry {
+ unsigned len:32;
+};
+int
+main(void)
+{
+ struct filecore_direntry dirent = { 0 };
+ size_t uio_resid = 0;
+ size_t bytelen = (((dirent.len)<(uio_resid))?(dirent.len):(uio_resid));
+ return bytelen;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c
new file mode 100644
index 0000000..ba4a338
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c
@@ -0,0 +1,11 @@
+int x(void)
+{
+ int i = 33;
+ switch (i) {
+ case 1 ... 40:
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c
new file mode 100644
index 0000000..d970be1
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c
@@ -0,0 +1,7 @@
+/* GCC compound statements */
+
+foo(unsigned long z)
+{
+ z = ({ unsigned long tmp; tmp = 1; tmp; });
+ foo(z);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements2.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements2.c
new file mode 100644
index 0000000..fa1ee67
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements2.c
@@ -0,0 +1,14 @@
+/* GCC compound statements with non-expressions */
+struct cpu_info {
+ int bar;
+};
+
+int
+main(void)
+{
+ return ({
+ struct cpu_info *__ci;
+ __asm__ volatile("movl %%fs:4,%0":"=r" (__ci));
+ __ci;
+ })->bar;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements3.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements3.c
new file mode 100644
index 0000000..29e9063
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_compound_statements3.c
@@ -0,0 +1,10 @@
+/* GCC compound statements with void type */
+
+void
+main(void)
+{
+ ({
+ void *v;
+ __asm__ volatile("noop");
+ });
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_extension.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_extension.c
new file mode 100644
index 0000000..d8bd8f5
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_extension.c
@@ -0,0 +1,6 @@
+/* extension */
+void a(void) {
+ double __logbw = 1;
+ if (__extension__(({ __typeof((__logbw)) x_ = (__logbw); !__builtin_isinf((x_)) && !__builtin_isnan((x_)); })))
+ __logbw = 1;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_func.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_func.c
new file mode 100644
index 0000000..459919d
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_func.c
@@ -0,0 +1,7 @@
+/* gcc __FUNCTION__ */
+
+void
+foo(const char *p) {
+ p = __FUNCTION__;
+ foo(p);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_variable_array_init.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_variable_array_init.c
new file mode 100644
index 0000000..d5b01ad
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_gcc_variable_array_init.c
@@ -0,0 +1,7 @@
+/* gcc: variable array initializer */
+void foo(int i)
+{
+ int array[i];
+ while (i--)
+ foo(array[i] = 0);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_incorrect_array_size.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_incorrect_array_size.c
new file mode 100644
index 0000000..c86c0d6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_incorrect_array_size.c
@@ -0,0 +1,3 @@
+struct foo {
+ int a[-1];
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_long_double_int.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_long_double_int.c
new file mode 100644
index 0000000..a5a644e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_long_double_int.c
@@ -0,0 +1,7 @@
+/* PR 39639: writing "long double" gave "long int" */
+
+int
+fail(long double *a, long int *b)
+{
+ return a == b;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_nested_structs.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_nested_structs.c
new file mode 100644
index 0000000..edd3396
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_nested_structs.c
@@ -0,0 +1,21 @@
+/* Nested struct */
+typedef void *EditLine;
+typedef void *History;
+
+typedef struct {
+ EditLine *el;
+ History *hist;
+} el_mode_t;
+
+struct el_modes_s {
+ el_mode_t command;
+ el_mode_t string;
+ el_mode_t filec;
+ el_mode_t mime_enc;
+};
+
+struct el_modes_s elm = {
+ .command = { .el = 0, .hist = 0, },
+ .string = { .el = 0, .hist = 0, },
+ .filec = { .el = 0, .hist = 0, },
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_nolimit_init.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_nolimit_init.c
new file mode 100644
index 0000000..68e71b4
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_nolimit_init.c
@@ -0,0 +1,4 @@
+/* no limit initializers */
+char foo[][4] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c
new file mode 100644
index 0000000..71b4384
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c
@@ -0,0 +1,35 @@
+/* packed tests */
+
+struct in_addr {
+ int x;
+};
+struct ip_timestamp {
+ char ipt_code;
+ char ipt_len;
+ char ipt_ptr;
+ unsigned int ipt_flg:4,
+ ipt_oflw:4;
+ union ipt_timestamp {
+ int ipt_time[1];
+ struct ipt_ta {
+ struct in_addr ipt_addr;
+ int ipt_time;
+ } ipt_ta[1] __packed;
+ } ipt_timestamp __packed;
+} __packed;
+
+typedef struct __packed {
+ int x;
+} t;
+
+struct x {
+ char c;
+ long l;
+} __packed;
+
+struct y {
+ char c;
+ long l;
+};
+
+int a[sizeof(struct y) - sizeof(struct x) - 1];
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_shift_to_narrower_type.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_shift_to_narrower_type.c
new file mode 100644
index 0000000..0208944
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_shift_to_narrower_type.c
@@ -0,0 +1,24 @@
+// Test that type shifts that result to narrower types don't produce warnings.
+
+void
+foo(void) {
+ unsigned long l = 100;
+ unsigned long long ll = 100;
+ unsigned int i = 100;
+ unsigned short s = 100;
+ unsigned char c = 1;
+
+ l = ll >> 32;
+// i = ll >> 31;
+ i = ll >> 32;
+ s = ll >> 48;
+ c = ll >> 56;
+ s = i >> 16;
+ c = i >> 24;
+ c = s >> 8;
+ (void)&ll;
+ (void)&l;
+ (void)&i;
+ (void)&s;
+ (void)&c;
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv1.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv1.c
new file mode 100644
index 0000000..d9e470e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv1.c
@@ -0,0 +1,11 @@
+/* Flag information-losing type conversion in argument lists */
+
+int f(unsigned int);
+
+void
+should_fail()
+{
+ long long x = 20;
+
+ f(x);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv2.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv2.c
new file mode 100644
index 0000000..7c2e1f4
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv2.c
@@ -0,0 +1,11 @@
+/* Flag information-losing type conversion in argument lists */
+
+int f(float);
+
+void
+should_fail()
+{
+ double x = 2.0;
+
+ f(x);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv3.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv3.c
new file mode 100644
index 0000000..bc6a8e6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_conv3.c
@@ -0,0 +1,10 @@
+/* Flag information-losing type conversion in argument lists */
+
+int f(unsigned int);
+
+void
+should_fail()
+{
+
+ f(0x7fffffffffffffffLL);
+}
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typename_as_var.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typename_as_var.c
new file mode 100644
index 0000000..248dc75
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typename_as_var.c
@@ -0,0 +1,14 @@
+typedef char h[10];
+
+typedef struct {
+ int i;
+ char *c;
+} fh;
+
+struct foo {
+ fh h;
+ struct {
+ int x;
+ int y;
+ } fl;
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c
new file mode 100644
index 0000000..9c06c6b
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c
@@ -0,0 +1,3 @@
+struct foo {
+int a[0];
+};
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/t_integration.sh b/contrib/netbsd-tests/usr.bin/xlint/lint1/t_integration.sh
new file mode 100755
index 0000000..9575f96
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/t_integration.sh
@@ -0,0 +1,132 @@
+# $NetBSD: t_integration.sh,v 1.4 2014/04/21 19:10:41 christos Exp $
+#
+# Copyright (c) 2008, 2010 The NetBSD Foundation, 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 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.
+#
+
+LINT1=/usr/libexec/lint1
+
+Names=
+
+check_valid()
+{
+ atf_check -s exit:0 ${LINT1} -g -S "$(atf_get_srcdir)/$1" /dev/null
+}
+
+check_invalid()
+{
+ atf_check -s not-exit:0 -o ignore -e ignore ${LINT1} -g -S -w \
+ "$(atf_get_srcdir)/$1" /dev/null
+}
+
+test_case()
+{
+ local result="${1}"; shift
+ local name="${1}"; shift
+ local descr="${*}"
+
+ atf_test_case ${name}
+ eval "${name}_head() {
+ atf_set \"descr\" \"${descr}\";
+ atf_set \"require.progs\" \"${LINT1}\";
+ }"
+ eval "${name}_body() {
+ ${result} d_${name}.c;
+ }"
+
+ Names="${Names} ${name}"
+}
+
+test_case check_valid c99_struct_init "Checks C99 struct initialization"
+test_case check_valid c99_union_init1 "Checks C99 union initialization"
+test_case check_valid c99_union_init2 "Checks C99 union initialization"
+test_case check_valid c99_union_init3 "Checks C99 union initialization"
+test_case check_valid c99_recursive_init "Checks C99 recursive struct/union" \
+ "initialization"
+test_case check_valid c9x_recursive_init "Checks C9X struct/union member" \
+ "init, with nested union and trailing member"
+test_case check_valid nested_structs "Checks nested structs"
+test_case check_valid packed_structs "Checks packed structs"
+
+test_case check_valid cast_init "Checks cast initialization"
+test_case check_valid cast_init2 "Checks cast initialization as the rhs of a" \
+ "- operand"
+test_case check_valid cast_lhs "Checks whether pointer casts are valid lhs" \
+ "lvalues"
+
+test_case check_valid gcc_func "Checks GCC __FUNCTION__"
+test_case check_valid c99_func "Checks C99 __func__"
+
+test_case check_valid gcc_variable_array_init "Checks GCC variable array" \
+ "initializers"
+test_case check_valid c9x_array_init "Checks C9X array initializers"
+test_case check_valid c99_decls_after_stmt "Checks C99 decls after statements"
+test_case check_valid c99_decls_after_stmt3 "Checks C99 decls after statements"
+test_case check_valid nolimit_init "Checks no limit initializers"
+test_case check_valid zero_sized_arrays "Checks zero sized arrays"
+
+test_case check_valid compound_literals1 "Checks compound literals"
+test_case check_valid compound_literals2 "Checks compound literals"
+test_case check_valid gcc_compound_statements1 "Checks GCC compound statements"
+test_case check_valid gcc_compound_statements2 "Checks GCC compound" \
+ "statements with non-expressions"
+test_case check_valid gcc_compound_statements3 "Checks GCC compound" \
+ "statements with void type"
+# XXX: Because of polymorphic __builtin_isnan and expression has null effect
+# test_case check_valid gcc_extension "Checks GCC __extension__ and __typeof__"
+
+test_case check_valid cvt_in_ternary "Checks CVT nodes handling in ?" \
+test_case check_valid cvt_constant "Checks constant conversion"
+test_case check_valid ellipsis_in_switch "Checks ellipsis in switch()"
+test_case check_valid c99_complex_num "Checks C99 complex numbers"
+test_case check_valid c99_complex_split "Checks C99 complex access"
+test_case check_valid c99_for_loops "Checks C99 for loops"
+test_case check_valid alignof "Checks __alignof__"
+test_case check_valid shift_to_narrower_type "Checks that type shifts that" \
+ "result in narrower types do not produce warnings"
+
+test_case check_invalid constant_conv1 "Checks failing on information-losing" \
+ "constant conversion in argument lists"
+test_case check_invalid constant_conv2 "Checks failing on information-losing" \
+ "constant conversion in argument lists"
+
+test_case check_invalid type_conv1 "Checks failing on information-losing" \
+ "type conversion in argument lists"
+test_case check_invalid type_conv2 "Checks failing on information-losing" \
+ "type conversion in argument lists"
+test_case check_invalid type_conv3 "Checks failing on information-losing" \
+ "type conversion in argument lists"
+
+test_case check_invalid incorrect_array_size "Checks failing on incorrect" \
+ "array sizes"
+
+test_case check_invalid long_double_int "Checks for confusion of 'long" \
+ "double' with 'long int'; PR 39639"
+
+atf_init_test_cases()
+{
+ for name in ${Names}; do
+ atf_add_test_case ${name}
+ done
+}
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/d_convert.in b/contrib/netbsd-tests/usr.sbin/mtree/d_convert.in
new file mode 100644
index 0000000..6a1abb0
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/d_convert.in
@@ -0,0 +1,40 @@
+# Similar to d_create.out, but a few entries have been deleted; nlink,
+# size and sha256 attributes have been removed; and the order has been
+# changed to test sorting.
+
+# .
+. type=dir
+ a.symlink.1 type=link link=a.file.1
+ top.dangling type=link link=nonexistent
+ top.symlink.b \
+ type=link link=b
+
+# ./b
+b type=dir
+ b.file.2 type=file
+ b.file.1 type=file
+# end ./b, up to "."
+..
+
+ top.file.1 type=file
+
+# ./a
+a type=dir
+ a.file.2 type=file
+
+# ./a/1
+1 type=dir
+ a1.file.1 type=file
+# end ./a/1, up to "./a"
+..
+
+ a.file.1 type=file
+
+# ./a/2
+2 type=dir
+# end ./a/2, up to "./a"
+..
+
+# end ./a, up to "."
+..
+
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/d_convert_C.out b/contrib/netbsd-tests/usr.sbin/mtree/d_convert_C.out
new file mode 100644
index 0000000..de4d9f6
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/d_convert_C.out
@@ -0,0 +1,14 @@
+. type=dir
+./a.symlink.1 type=link link=a.file.1
+./top.dangling type=link link=nonexistent
+./top.symlink.b type=link link=b
+./b type=dir
+./b/b.file.2 type=file
+./b/b.file.1 type=file
+./top.file.1 type=file
+./a type=dir
+./a/a.file.2 type=file
+./a/1 type=dir
+./a/1/a1.file.1 type=file
+./a/a.file.1 type=file
+./a/2 type=dir
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/d_convert_C_S.out b/contrib/netbsd-tests/usr.sbin/mtree/d_convert_C_S.out
new file mode 100644
index 0000000..bd03cc4
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/d_convert_C_S.out
@@ -0,0 +1,14 @@
+. type=dir
+./a.symlink.1 type=link link=a.file.1
+./top.dangling type=link link=nonexistent
+./top.file.1 type=file
+./top.symlink.b type=link link=b
+./a type=dir
+./a/a.file.1 type=file
+./a/a.file.2 type=file
+./a/1 type=dir
+./a/1/a1.file.1 type=file
+./a/2 type=dir
+./b type=dir
+./b/b.file.1 type=file
+./b/b.file.2 type=file
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/d_convert_D.out b/contrib/netbsd-tests/usr.sbin/mtree/d_convert_D.out
new file mode 100644
index 0000000..c059478
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/d_convert_D.out
@@ -0,0 +1,14 @@
+type=dir .
+type=link link=a.file.1 ./a.symlink.1
+type=link link=nonexistent ./top.dangling
+type=link link=b ./top.symlink.b
+type=dir ./b
+type=file ./b/b.file.2
+type=file ./b/b.file.1
+type=file ./top.file.1
+type=dir ./a
+type=file ./a/a.file.2
+type=dir ./a/1
+type=file ./a/1/a1.file.1
+type=file ./a/a.file.1
+type=dir ./a/2
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/d_convert_D_S.out b/contrib/netbsd-tests/usr.sbin/mtree/d_convert_D_S.out
new file mode 100644
index 0000000..a777a0b
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/d_convert_D_S.out
@@ -0,0 +1,14 @@
+type=dir .
+type=link link=a.file.1 ./a.symlink.1
+type=link link=nonexistent ./top.dangling
+type=file ./top.file.1
+type=link link=b ./top.symlink.b
+type=dir ./a
+type=file ./a/a.file.1
+type=file ./a/a.file.2
+type=dir ./a/1
+type=file ./a/1/a1.file.1
+type=dir ./a/2
+type=dir ./b
+type=file ./b/b.file.1
+type=file ./b/b.file.2
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/d_merge.in b/contrib/netbsd-tests/usr.sbin/mtree/d_merge.in
new file mode 100644
index 0000000..9efd04b
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/d_merge.in
@@ -0,0 +1,27 @@
+# The last entry for any duplicate node should take precedence.
+
+. type=dir
+
+# directory "a" with only one entry, changing from dir to link
+./a type=dir
+./a/change-dir-to-link type=dir mode=0755
+./a/change-dir-to-link type=link mode=0755
+
+# directory "b" with only one entry, changing from link to dir
+./b type=dir
+./b/change-link-to-dir type=link mode=0755
+./b/change-link-to-dir type=dir mode=0755
+
+# directory "c" with multiple entries, one changing from dir to link
+./c type=dir
+./c/aaa type=file
+./c/zzz type=file
+./c/change-dir-to-link type=dir mode=0755
+./c/change-dir-to-link type=link mode=0755
+
+# directory "d" with multiple entries, one changing from link to dir
+./d type=dir
+./d/aaa type=file
+./d/zzz type=file
+./d/change-link-to-dir type=link mode=0755
+./d/change-link-to-dir type=dir mode=0755
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/d_merge_C_M.out b/contrib/netbsd-tests/usr.sbin/mtree/d_merge_C_M.out
new file mode 100644
index 0000000..dea9966
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/d_merge_C_M.out
@@ -0,0 +1,13 @@
+. type=dir
+./a type=dir
+./a/change-dir-to-link type=link mode=0755
+./b type=dir
+./b/change-link-to-dir type=dir mode=0755
+./c type=dir
+./c/aaa type=file
+./c/zzz type=file
+./c/change-dir-to-link type=link mode=0755
+./d type=dir
+./d/aaa type=file
+./d/zzz type=file
+./d/change-link-to-dir type=dir mode=0755
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/d_merge_C_M_S.out b/contrib/netbsd-tests/usr.sbin/mtree/d_merge_C_M_S.out
new file mode 100644
index 0000000..9f02bea
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/d_merge_C_M_S.out
@@ -0,0 +1,13 @@
+. type=dir
+./a type=dir
+./a/change-dir-to-link type=link mode=0755
+./b type=dir
+./b/change-link-to-dir type=dir mode=0755
+./c type=dir
+./c/aaa type=file
+./c/change-dir-to-link type=link mode=0755
+./c/zzz type=file
+./d type=dir
+./d/aaa type=file
+./d/zzz type=file
+./d/change-link-to-dir type=dir mode=0755
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/mtree_d_create.out b/contrib/netbsd-tests/usr.sbin/mtree/mtree_d_create.out
new file mode 100644
index 0000000..389ec65
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/mtree_d_create.out
@@ -0,0 +1,55 @@
+# user: x
+# machine: x
+# tree: x
+# date: x
+
+# .
+/set type=file nlink=1
+. type=dir nlink=4
+ a.symlink.1 type=link link=a.file.1
+ top.dangling \
+ type=link link=nonexistent
+ top.file.1 size=18 \
+ sha256=74c53aaf0cd9543b7efad969de1058ee38859134ba467500b849811fc3513195
+ top.symlink.b \
+ type=link link=b
+
+# ./a
+a type=dir nlink=4
+ a.file.1 size=18 \
+ sha256=bdbea62f7ccdf862f22254ea871d523845250010d5f233896e800142a859eef2
+ a.file.2 size=18 \
+ sha256=77876d113fe1b45a41f8d1d3e178aaad7f91fcd93d3df782690625b74ad90fe6
+ a.hardlink.b2 \
+ nlink=2 size=18 \
+ sha256=784fd6b95fe5054d87bf268de51dea043031c5e985f668d4f51e1c759b0f9333
+
+# ./a/1
+1 type=dir nlink=2
+ a1.file.1 size=21 \
+ sha256=a062cd272facdd38c4fdeff2a18947b28c99a28a8fe51f88468978740382e592
+# ./a/1
+..
+
+
+# ./a/2
+2 type=dir nlink=2
+# ./a/2
+..
+
+# ./a
+..
+
+
+# ./b
+b type=dir nlink=2
+ b.file.1 nlink=2 size=18 \
+ sha256=5754b0d97a8238ea0e495ab871667dcab8f1d684e323290ae76f70c47de18998
+ b.file.2 nlink=2 size=18 \
+ sha256=784fd6b95fe5054d87bf268de51dea043031c5e985f668d4f51e1c759b0f9333
+ b.hardlink.1 \
+ nlink=2 size=18 \
+ sha256=5754b0d97a8238ea0e495ab871667dcab8f1d684e323290ae76f70c47de18998
+# ./b
+..
+
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/netbsd6_d_create.out b/contrib/netbsd-tests/usr.sbin/mtree/netbsd6_d_create.out
new file mode 100644
index 0000000..389ec65
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/netbsd6_d_create.out
@@ -0,0 +1,55 @@
+# user: x
+# machine: x
+# tree: x
+# date: x
+
+# .
+/set type=file nlink=1
+. type=dir nlink=4
+ a.symlink.1 type=link link=a.file.1
+ top.dangling \
+ type=link link=nonexistent
+ top.file.1 size=18 \
+ sha256=74c53aaf0cd9543b7efad969de1058ee38859134ba467500b849811fc3513195
+ top.symlink.b \
+ type=link link=b
+
+# ./a
+a type=dir nlink=4
+ a.file.1 size=18 \
+ sha256=bdbea62f7ccdf862f22254ea871d523845250010d5f233896e800142a859eef2
+ a.file.2 size=18 \
+ sha256=77876d113fe1b45a41f8d1d3e178aaad7f91fcd93d3df782690625b74ad90fe6
+ a.hardlink.b2 \
+ nlink=2 size=18 \
+ sha256=784fd6b95fe5054d87bf268de51dea043031c5e985f668d4f51e1c759b0f9333
+
+# ./a/1
+1 type=dir nlink=2
+ a1.file.1 size=21 \
+ sha256=a062cd272facdd38c4fdeff2a18947b28c99a28a8fe51f88468978740382e592
+# ./a/1
+..
+
+
+# ./a/2
+2 type=dir nlink=2
+# ./a/2
+..
+
+# ./a
+..
+
+
+# ./b
+b type=dir nlink=2
+ b.file.1 nlink=2 size=18 \
+ sha256=5754b0d97a8238ea0e495ab871667dcab8f1d684e323290ae76f70c47de18998
+ b.file.2 nlink=2 size=18 \
+ sha256=784fd6b95fe5054d87bf268de51dea043031c5e985f668d4f51e1c759b0f9333
+ b.hardlink.1 \
+ nlink=2 size=18 \
+ sha256=5754b0d97a8238ea0e495ab871667dcab8f1d684e323290ae76f70c47de18998
+# ./b
+..
+
diff --git a/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh
new file mode 100755
index 0000000..20fda75
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh
@@ -0,0 +1,422 @@
+# $NetBSD: t_mtree.sh,v 1.6 2013/02/05 16:49:42 christos Exp $
+#
+# Copyright (c) 2009, 2012 The NetBSD Foundation, 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 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.
+#
+
+# Postprocess mtree output, canonicalising portions that
+# are expected to differ from one run to another.
+#
+
+h_postprocess()
+{
+ sed -e '
+ /^# user: /s/:.*/: x/
+ /^# machine: /s/:.*/: x/
+ /^# tree: /s/:.*/: x/
+ /^# date: /s/:.*/: x/
+ ' \
+ -e '/type=dir/s/ size=[0-9]*//'
+}
+
+h_check()
+{
+ diff -Nru "$1" "$2" || atf_fail "files $1 and $2 differ"
+}
+
+
+atf_test_case mtree_create
+atf_test_case netbsd6_create
+create_head()
+{
+ atf_set "descr" "Create a specfile describing a directory tree"
+}
+
+create_setup()
+{
+ # create some directories
+ rm -fr create
+ mkdir -p create/a/1 create/a/2 create/b
+ # create some files
+ for file in create/top.file.1 \
+ create/a/a.file.1 \
+ create/a/a.file.2 \
+ create/a/1/a1.file.1 \
+ create/b/b.file.1 \
+ create/b/b.file.2
+ do
+ echo "$file" >$file
+ done
+ # hard link to file in same dir
+ ln create/b/b.file.1 create/b/b.hardlink.1
+ # hard link to file in another dir
+ ln create/b/b.file.2 create/a/a.hardlink.b2
+ # symlink to file
+ ln -s a.file.1 create/a.symlink.1
+ # symlink to dir
+ ln -s b create/top.symlink.b
+ # dangling symlink
+ ln -s nonexistent create/top.dangling
+}
+
+create_body()
+{
+ create_setup
+
+ # run mtree and check output
+ ( cd create && mtree -F ${FLAVOR} -c -k type,nlink,link,size,sha256 ) >output.raw \
+ || atf_fail "mtree exit status $?"
+ h_postprocess <output.raw >output
+ h_check "$(atf_get_srcdir)/${FLAVOR}_d_create.out" output
+}
+
+mtree_create_head()
+{
+ FLAVOR=mtree create_head
+}
+netbsd6_create_head()
+{
+ FLAVOR=netbsd6 create_head
+}
+
+mtree_create_body()
+{
+ FLAVOR=mtree create_body
+}
+netbsd6_create_body()
+{
+ FLAVOR=netbsd6 create_body
+}
+
+
+atf_test_case mtree_check
+atf_test_case netbsd6_check
+check_head()
+{
+ atf_set "descr" "Check a directory tree against a specfile"
+}
+
+check_body()
+{
+ # we use the same directory tree and specfile as in the "create" test
+ create_setup
+
+ # run mtree and check output
+ ( cd create && mtree -F ${FLAVOR} ) <"$(atf_get_srcdir)/${FLAVOR}_d_create.out" >output \
+ || atf_fail "mtree exit status $?"
+ h_check /dev/null output
+}
+
+mtree_check_head()
+{
+ FLAVOR=mtree check_head
+}
+netbsd6_check_head()
+{
+ FLAVOR=netbsd6 check_head
+}
+
+mtree_check_body()
+{
+ FLAVOR=mtree check_body
+}
+netbsd6_check_body()
+{
+ FLAVOR=netbsd6 check_body
+}
+
+
+atf_test_case mtree_convert_C
+atf_test_case netbsd6_convert_C
+convert_C_head()
+{
+ atf_set "descr" "Convert a specfile to mtree -C format, unsorted"
+}
+
+convert_C_body()
+{
+ mtree -F ${FLAVOR} -C -K all <"$(atf_get_srcdir)/d_convert.in" >output
+ h_check "$(atf_get_srcdir)/d_convert_C.out" output
+}
+
+mtree_convert_C_head()
+{
+ FLAVOR=mtree convert_C_head
+}
+netbsd6_convert_C_head()
+{
+ FLAVOR=netbsd6 convert_C_head
+}
+
+mtree_convert_C_body()
+{
+ FLAVOR=mtree convert_C_body
+}
+netbsd6_convert_C_body()
+{
+ FLAVOR=netbsd6 convert_C_body
+}
+
+
+atf_test_case mtree_convert_C_S
+atf_test_case netbsd6_convert_C_S
+convert_C_S_head()
+{
+ atf_set "descr" "Convert a specfile to mtree -C format, sorted"
+}
+
+convert_C_S_body()
+{
+ mtree -F ${FLAVOR} -C -S -K all <"$(atf_get_srcdir)/d_convert.in" >output
+ h_check "$(atf_get_srcdir)/d_convert_C_S.out" output
+}
+
+mtree_convert_C_S_head()
+{
+ FLAVOR=mtree convert_C_S_head
+}
+netbsd6_convert_C_S_head()
+{
+ FLAVOR=netbsd6 convert_C_S_head
+}
+
+mtree_convert_C_S_body()
+{
+ FLAVOR=mtree convert_C_S_body
+}
+netbsd6_convert_C_S_body()
+{
+ FLAVOR=netbsd6 convert_C_S_body
+}
+
+
+atf_test_case mtree_convert_D
+atf_test_case netbsd6_convert_D
+convert_D_head()
+{
+ atf_set "descr" "Convert a specfile to mtree -D format, unsorted"
+}
+
+convert_D_body()
+{
+ mtree -F ${FLAVOR} -D -K all <"$(atf_get_srcdir)/d_convert.in" >output
+ h_check "$(atf_get_srcdir)/d_convert_D.out" output
+}
+
+mtree_convert_D_head()
+{
+ FLAVOR=mtree convert_D_head
+}
+netbsd6_convert_D_head()
+{
+ FLAVOR=netbsd6 convert_D_head
+}
+
+mtree_convert_D_body()
+{
+ FLAVOR=mtree convert_D_body
+}
+netbsd6_convert_D_body()
+{
+ FLAVOR=netbsd6 convert_D_body
+}
+
+
+atf_test_case mtree_convert_D_S
+atf_test_case netbsd6_convert_D_S
+convert_D_S_head()
+{
+ atf_set "descr" "Convert a specfile to mtree -D format, sorted"
+}
+
+convert_D_S_body()
+{
+ mtree -F ${FLAVOR} -D -S -K all <"$(atf_get_srcdir)/d_convert.in" >output
+ h_check "$(atf_get_srcdir)/d_convert_D_S.out" output
+}
+
+mtree_convert_D_S_head()
+{
+ FLAVOR=mtree convert_D_S_head
+}
+netbsd6_convert_D_S_head()
+{
+ FLAVOR=netbsd6 convert_D_S_head
+}
+
+mtree_convert_D_S_body()
+{
+ FLAVOR=mtree convert_D_S_body
+}
+netbsd6_convert_D_S_body()
+{
+ FLAVOR=netbsd6 convert_D_S_body
+}
+
+
+atf_test_case mtree_ignore
+atf_test_case netbs6_ignore
+ignore_head()
+{
+ atf_set "descr" "Test that -d ignores symlinks (PR bin/41061)"
+}
+
+ignore_body()
+{
+ mkdir newdir
+ mtree -F ${FLAVOR} -c | mtree -F ${FLAVOR} -Ck uid,gid,mode > mtree.spec
+ ln -s newdir otherdir
+
+ # This yields "extra: otherdir" even with -d.
+ # (PR bin/41061)
+ atf_check -s ignore -o empty -e empty -x "mtree -F ${FLAVOR} -d < mtree.spec"
+
+ # Delete the symlink and re-verify.
+ #
+ rm otherdir
+ atf_check -s ignore -o empty -e empty -x "mtree -F ${FLAVOR} -d < mtree.spec"
+}
+
+mtree_ignore_head()
+{
+ FLAVOR=mtree ignore_head
+}
+netbsd6_ignore_head()
+{
+ FLAVOR=netbsd6 ignore_head
+}
+
+mtree_ignore_body()
+{
+ FLAVOR=mtree ignore_body
+}
+netbsd6_ignore_body()
+{
+ FLAVOR=netbsd6 ignore_body
+}
+
+
+atf_test_case mtree_merge
+atf_test_case netbsd6_merge
+merge_head()
+{
+ atf_set "descr" "Merge records of different type"
+}
+
+merge_body()
+{
+ mtree -F ${FLAVOR} -C -M -K all <"$(atf_get_srcdir)/d_merge.in" >output
+ h_check "$(atf_get_srcdir)/d_merge_C_M.out" output
+ # same again, with sorting
+ mtree -F ${FLAVOR} -C -M -S -K all <"$(atf_get_srcdir)/d_merge.in" >output
+ h_check "$(atf_get_srcdir)/d_merge_C_M_S.out" output
+}
+
+mtree_merge_head()
+{
+ FLAVOR=mtree merge_head
+}
+netbsd6_merge_head()
+{
+ FLAVOR=netbsd6 merge_head
+}
+
+mtree_merge_body()
+{
+ FLAVOR=mtree merge_body
+}
+netbsd6_merge_body()
+{
+ FLAVOR=netbsd6 merge_body
+}
+
+
+atf_test_case mtree_nonemptydir
+atf_test_case netbsd6_nonemptydir
+nonemptydir_head()
+{
+ atf_set "descr" "Test that new non-empty " \
+ "directories are recorded (PR bin/25693)"
+}
+
+nonemptydir_body()
+{
+ mkdir testdir
+ cd testdir
+
+ mtree -F ${FLAVOR} -c > mtree.spec
+
+ if [ ! -f mtree.spec ]; then
+ atf_fail "mtree failed"
+ fi
+
+ touch bar
+ atf_check -s ignore -o save:output -x "mtree -F ${FLAVOR} -f mtree.spec"
+
+ if [ ! -n "$(egrep "extra: bar" output)" ]; then
+ atf_fail "mtree did not record changes (PR bin/25693)"
+ fi
+}
+
+mtree_nonemptydir_head()
+{
+ FLAVOR=mtree nonemptydir_head
+}
+netbsd6_nonemptydir_head()
+{
+ FLAVOR=netbsd6 nonemptydir_head
+}
+
+mtree_nonemptydir_body()
+{
+ FLAVOR=mtree nonemptydir_body
+}
+netbsd6_nonemptydir_body()
+{
+ FLAVOR=netbsd6 nonemptydir_body
+}
+
+
+atf_init_test_cases()
+{
+ atf_add_test_case mtree_create
+ atf_add_test_case mtree_check
+ atf_add_test_case mtree_convert_C
+ atf_add_test_case mtree_convert_C_S
+ atf_add_test_case mtree_convert_D
+ atf_add_test_case mtree_convert_D_S
+ atf_add_test_case mtree_ignore
+ atf_add_test_case mtree_merge
+ atf_add_test_case mtree_nonemptydir
+
+ atf_add_test_case netbsd6_create
+ atf_add_test_case netbsd6_check
+ atf_add_test_case netbsd6_convert_C
+ atf_add_test_case netbsd6_convert_C_S
+ atf_add_test_case netbsd6_convert_D
+ atf_add_test_case netbsd6_convert_D_S
+ atf_add_test_case netbsd6_ignore
+ atf_add_test_case netbsd6_merge
+ atf_add_test_case netbsd6_nonemptydir
+}
diff --git a/contrib/netbsd-tests/usr.sbin/tcpdump/t_tcpdump.sh b/contrib/netbsd-tests/usr.sbin/tcpdump/t_tcpdump.sh
new file mode 100755
index 0000000..5cd89b4
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/tcpdump/t_tcpdump.sh
@@ -0,0 +1,59 @@
+# $NetBSD: t_tcpdump.sh,v 1.4 2014/09/20 06:08:07 ozaki-r Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+prom() {
+ atf_check -s ignore -o ignore -e ignore -x "tcpdump -c 1 -i $1" &
+ sleep 2; kill $! >/dev/null 2>&1
+}
+
+atf_test_case promiscuous
+promiscuous_head() {
+ atf_set "require.user" "root"
+ atf_set "descr" "Test that switching an interface into and out " \
+ "of promiscuous mode does not lockup (PR kern/46328)"
+}
+
+promiscuous_body() {
+
+ for i in $(ifconfig -l); do
+ case $i in
+ bridge*)
+ echo "Skipping $i"
+ continue
+ ;;
+ esac
+
+ echo "Testing $i"
+ prom $i
+ done
+}
+
+atf_init_test_cases() {
+ atf_add_test_case promiscuous
+}
diff --git a/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh b/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh
new file mode 100755
index 0000000..cc2b2f4
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh
@@ -0,0 +1,128 @@
+# $NetBSD: t_traceroute.sh,v 1.5 2013/02/19 21:08:25 joerg Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, 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 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.
+#
+
+netserver=\
+"rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif"
+
+atf_test_case basic cleanup
+basic_head()
+{
+
+ atf_set "descr" "Does a simple three-hop traceroute"
+ atf_set "require.progs" "rump_server"
+}
+
+cfgendpt ()
+{
+
+ sock=${1}
+ addr=${2}
+ route=${3}
+ bus=${4}
+
+ export RUMP_SERVER=${sock}
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr ${bus}
+ atf_check -s exit:0 rump.ifconfig shmif0 inet ${addr} netmask 0xffffff00
+ atf_check -s exit:0 -o ignore rump.route add default ${route}
+}
+
+threeservers()
+{
+
+ atf_check -s exit:0 ${netserver} unix://commsock1
+ atf_check -s exit:0 ${netserver} unix://commsock2
+ atf_check -s exit:0 ${netserver} unix://commsock3
+
+ # configure endpoints
+ cfgendpt unix://commsock1 1.2.3.4 1.2.3.1 bus1
+ cfgendpt unix://commsock3 2.3.4.5 2.3.4.1 bus2
+
+ # configure the router
+ export RUMP_SERVER=unix://commsock2
+ atf_check -s exit:0 rump.ifconfig shmif0 create
+ atf_check -s exit:0 rump.ifconfig shmif0 linkstr bus1
+ atf_check -s exit:0 rump.ifconfig shmif0 inet 1.2.3.1 netmask 0xffffff00
+
+ atf_check -s exit:0 rump.ifconfig shmif1 create
+ atf_check -s exit:0 rump.ifconfig shmif1 linkstr bus2
+ atf_check -s exit:0 rump.ifconfig shmif1 inet 2.3.4.1 netmask 0xffffff00
+}
+
+threecleanup()
+{
+ env RUMP_SERVER=unix://commsock1 rump.halt
+ env RUMP_SERVER=unix://commsock2 rump.halt
+ env RUMP_SERVER=unix://commsock3 rump.halt
+}
+
+threetests()
+{
+
+ threeservers
+ export RUMP_SERVER=unix://commsock1
+ atf_check -s exit:0 -o inline:'1.2.3.1\n2.3.4.5\n' -e ignore -x \
+ "rump.traceroute ${1} -n 2.3.4.5 | awk '{print \$2}'"
+ export RUMP_SERVER=unix://commsock3
+ atf_check -s exit:0 -o inline:'2.3.4.1\n1.2.3.4\n' -e ignore -x \
+ "rump.traceroute ${1} -n 1.2.3.4 | awk '{print \$2}'"
+}
+
+basic_body()
+{
+ threetests
+}
+
+basic_cleanup()
+{
+ threecleanup
+}
+
+atf_test_case basic_icmp cleanup
+basic_icmp_head()
+{
+
+ atf_set "descr" "Does an ICMP-based three-hop traceroute"
+ atf_set "require.progs" "rump_server"
+}
+
+basic_icmp_body()
+{
+ threetests -I
+}
+
+basic_icmp_cleanup()
+{
+ threecleanup
+}
+
+atf_init_test_cases()
+{
+
+ atf_add_test_case basic
+ atf_add_test_case basic_icmp
+}
diff --git a/contrib/netbsd-tests/usr.sbin/useradd/t_useradd.sh b/contrib/netbsd-tests/usr.sbin/useradd/t_useradd.sh
new file mode 100755
index 0000000..c55818e
--- /dev/null
+++ b/contrib/netbsd-tests/usr.sbin/useradd/t_useradd.sh
@@ -0,0 +1,50 @@
+# $NetBSD: t_useradd.sh,v 1.1 2012/04/19 18:51:36 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+username="test5678901234567"
+
+atf_test_case longname cleanup
+longname_head() {
+ atf_set "require.user" "root"
+ atf_set "descr" "Test that usernames longer than 16 " \
+ "characters are allowed (PR bin/39546)"
+}
+
+longname_body() {
+ atf_expect_fail "PR bin/39546"
+ atf_check -s exit:0 -o ignore -e ignore -x "useradd $username"
+}
+
+longname_cleanup() {
+ atf_check -s ignore -o ignore -e ignore -x "userdel $username"
+}
+
+atf_init_test_cases() {
+ atf_add_test_case longname
+}
diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c
index b2124a6..af34f88 100644
--- a/contrib/tcpdump/tcpdump.c
+++ b/contrib/tcpdump/tcpdump.c
@@ -1533,7 +1533,12 @@ main(int argc, char **argv)
if (RFileName == NULL && VFileName == NULL) {
static const unsigned long cmds[] = { BIOCGSTATS };
- cap_rights_init(&rights, CAP_IOCTL, CAP_READ);
+ /*
+ * the various libpcap devices use a combination of
+ * read (bpf), ioctl (bpf, netmap), poll (netmap)
+ * so we add the relevant access rights.
+ */
+ cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_EVENT);
if (cap_rights_limit(pcap_fileno(pd), &rights) < 0 &&
errno != ENOSYS) {
error("unable to limit pcap descriptor");
diff --git a/etc/devd/usb.conf b/etc/devd/usb.conf
index c8d252a..7828a85 100644
--- a/etc/devd/usb.conf
+++ b/etc/devd/usb.conf
@@ -65,7 +65,23 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x03f0";
- match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116)";
+ match "product" "(0x2016|0x2116|0x2216)";
+ action "kldload -n uipaq";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x03f0";
+ match "product" "(0x241d|0x251d)";
+ action "kldload -n u3g";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x03f0";
+ match "product" "(0x3016|0x3116)";
action "kldload -n uipaq";
};
@@ -129,7 +145,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0403";
- match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)";
+ match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)";
action "kldload -n uftdi";
};
@@ -1057,7 +1073,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0586";
- match "product" "(0x3416|0x341a)";
+ match "product" "(0x3416|0x341a|0x341e)";
action "kldload -n if_run";
};
@@ -1097,7 +1113,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
- match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c)";
+ match "product" "(0x020d|0x020e|0x020f|0x0210|0x0214|0x0215|0x0216|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c)";
action "kldload -n atp";
};
@@ -2353,7 +2369,23 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0b05";
- match "product" "(0x17b5|0x17cb)";
+ match "product" "0x17b5";
+ action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0b05";
+ match "product" "0x17ba";
+ action "kldload -n if_urtwn";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0b05";
+ match "product" "0x17cb";
action "kldload -n ng_ubt";
};
@@ -2481,7 +2513,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0bda";
- match "product" "(0x018a|0x317f)";
+ match "product" "(0x0179|0x018a|0x317f)";
action "kldload -n if_urtwn";
};
@@ -2513,7 +2545,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0bda";
- match "product" "(0x8176|0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e)";
+ match "product" "(0x8176|0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e)";
action "kldload -n if_urtwn";
};
@@ -2929,6 +2961,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0df6";
+ match "product" "0x0072";
+ action "kldload -n if_axge";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0df6";
match "product" "0x061c";
action "kldload -n if_axe";
};
@@ -3577,7 +3617,23 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x12d1";
- match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521|0x1803|0x1c05|0x1c0b)";
+ match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521)";
+ action "kldload -n u3g";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x12d1";
+ match "product" "0x155b";
+ action "kldload -n if_cdce";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x12d1";
+ match "product" "(0x1803|0x1c05|0x1c0b)";
action "kldload -n u3g";
};
@@ -3753,7 +3809,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x1410";
- match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5020|0x5041|0x5100|0x6000|0x6002|0x7042)";
+ match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5020|0x5041|0x5100|0x6000|0x6002|0x7001|0x7031|0x7042)";
action "kldload -n u3g";
};
@@ -4553,7 +4609,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x1cf1";
- match "product" "(0x0001|0x0004)";
+ match "product" "(0x0001|0x0004|0x0022)";
action "kldload -n uftdi";
};
@@ -4568,6 +4624,14 @@ nomatch 32 {
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
+ match "vendor" "0x1d34";
+ match "product" "0x0004";
+ action "kldload -n uled";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
match "vendor" "0x1d4d";
match "product" "(0x0002|0x000c|0x000e|0x0010)";
action "kldload -n if_run";
@@ -4633,7 +4697,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x2001";
- match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d)";
+ match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d|0x330f)";
action "kldload -n if_urtwn";
};
@@ -4665,7 +4729,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x2001";
- match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b|0x3c1f)";
+ match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b|0x3c1f|0x3c20)";
action "kldload -n if_run";
};
@@ -4689,6 +4753,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x2001";
+ match "product" "0x4a00";
+ action "kldload -n if_axge";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x2001";
match "product" "(0x7e12|0xa805)";
action "kldload -n u3g";
};
@@ -5232,6 +5304,36 @@ nomatch 32 {
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
+ match "vendor" "0x12d1";
+ match "intclass" "0xff";
+ match "intsubclass" "0x02";
+ match "intprotocol" "0x16";
+ action "kldload -n if_cdce";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x12d1";
+ match "intclass" "0xff";
+ match "intsubclass" "0x02";
+ match "intprotocol" "0x46";
+ action "kldload -n if_cdce";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x12d1";
+ match "intclass" "0xff";
+ match "intsubclass" "0x02";
+ match "intprotocol" "0x76";
+ action "kldload -n if_cdce";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
match "intclass" "0x02";
match "intsubclass" "0x02";
match "intprotocol" "0x00";
@@ -5399,5 +5501,5 @@ nomatch 32 {
action "kldload -n umass";
};
-# 2621 USB entries processed
+# 2643 USB entries processed
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index beec7a3..3a9d0e0 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -287,6 +287,8 @@
..
newsyslog
..
+ pw
+ ..
sa
..
..
diff --git a/etc/rc.subr b/etc/rc.subr
index 97b631f..4b3fddf 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -68,6 +68,39 @@ list_vars()
done; }
}
+# set_rcvar [var] [defval] [desc]
+#
+# Echo or define a rc.conf(5) variable name. Global variable
+# $rcvars is used.
+#
+# If no argument is specified, echo "${name}_enable".
+#
+# If only a var is specified, echo "${var}_enable".
+#
+# If var and defval are specified, the ${var} is defined as
+# rc.conf(5) variable and the default value is ${defvar}. An
+# optional argument $desc can also be specified to add a
+# description for that.
+#
+set_rcvar()
+{
+ local _var
+
+ case $# in
+ 0) echo ${name}_enable ;;
+ 1) echo ${1}_enable ;;
+ *)
+ debug "set_rcvar: \$$1=$2 is added" \
+ " as a rc.conf(5) variable."
+ _var=$1
+ rcvars="${rcvars# } $_var"
+ eval ${_var}_defval=\"$2\"
+ shift 2
+ eval ${_var}_desc=\"$*\"
+ ;;
+ esac
+}
+
# set_rcvar_obsolete oldvar [newvar] [msg]
# Define obsolete variable.
# Global variable $rcvars_obsolete is used.
@@ -76,7 +109,7 @@ set_rcvar_obsolete()
{
local _var
_var=$1
- debug "rcvar_obsolete: \$$1(old) -> \$$2(new) is defined"
+ debug "set_rcvar_obsolete: \$$1(old) -> \$$2(new) is defined"
rcvars_obsolete="${rcvars_obsolete# } $1"
eval ${1}_newvar=\"$2\"
@@ -1091,8 +1124,8 @@ $command $rc_flags $command_args"
echo ""
fi
echo "#"
- # Get unique vars in $rcvar
- for _v in $rcvar; do
+ # Get unique vars in $rcvar $rcvars
+ for _v in $rcvar $rcvars; do
case $v in
$_v\ *|\ *$_v|*\ $_v\ *) ;;
*) v="${v# } $_v" ;;
@@ -1238,7 +1271,7 @@ run_rc_script()
unset name command command_args command_interpreter \
extra_commands pidfile procname \
- rcvar rcvars_obsolete required_dirs required_files \
+ rcvar rcvars rcvars_obsolete required_dirs required_files \
required_vars
eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd
@@ -1306,7 +1339,7 @@ load_rc_config()
done
# Set defaults if defined.
- for _var in $rcvar; do
+ for _var in $rcvar $rcvars; do
eval _defval=\$${_var}_defval
if [ -n "$_defval" ]; then
eval : \${$_var:=\$${_var}_defval}
diff --git a/games/factor/factor.6 b/games/factor/factor.6
index 508a98b..ba82f14 100644
--- a/games/factor/factor.6
+++ b/games/factor/factor.6
@@ -89,8 +89,7 @@ The
value must not be greater than the maximum.
The default and maximum value of
.Ar stop
-is 4294967295 on 32-bit architectures
-and 3825123056546413050 on 64-bit ones.
+is 3825123056546413050.
.Pp
When the
.Nm primes
diff --git a/games/factor/factor.c b/games/factor/factor.c
index 8b76c17..19fe830 100644
--- a/games/factor/factor.c
+++ b/games/factor/factor.c
@@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
#include <errno.h>
+#include <inttypes.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@@ -227,7 +228,7 @@ pr_fact(BIGNUM *val)
/* Divide factor out until none are left. */
do {
- printf(hflag ? " 0x%lx" : " %lu", *fact);
+ printf(hflag ? " 0x%" PRIx64 "" : " %" PRIu64 "", *fact);
BN_div_word(val, (BN_ULONG)*fact);
} while (BN_mod_word(val, (BN_ULONG)*fact) == 0);
diff --git a/games/primes/primes.c b/games/primes/primes.c
index f5f1faf..a1c95c2 100644
--- a/games/primes/primes.c
+++ b/games/primes/primes.c
@@ -64,6 +64,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <err.h>
#include <errno.h>
+#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
@@ -111,10 +112,10 @@ main(int argc, char *argv[])
argv += optind;
start = 0;
- stop = (sizeof(ubig) > 4) ? SPSPMAX : BIG;
+ stop = SPSPMAX;
/*
- * Convert low and high args. Strtoul(3) sets errno to
+ * Convert low and high args. Strtoumax(3) sets errno to
* ERANGE if the number is too large, but, if there's
* a leading minus sign it returns the negation of the
* result of the conversion, which we'd rather disallow.
@@ -126,19 +127,19 @@ main(int argc, char *argv[])
errx(1, "negative numbers aren't permitted.");
errno = 0;
- start = strtoul(argv[0], &p, 0);
+ start = strtoumax(argv[0], &p, 0);
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 = strtoumax(argv[1], &p, 0);
if (errno)
err(1, "%s", argv[1]);
if (*p != '\0')
errx(1, "%s: illegal numeric format.", argv[1]);
- if ((uint64_t)stop > SPSPMAX)
+ if (stop > SPSPMAX)
errx(1, "%s: stop value too large.", argv[1]);
break;
case 1:
@@ -147,7 +148,7 @@ main(int argc, char *argv[])
errx(1, "negative numbers aren't permitted.");
errno = 0;
- start = strtoul(argv[0], &p, 0);
+ start = strtoumax(argv[0], &p, 0);
if (errno)
err(1, "%s", argv[0]);
if (*p != '\0')
@@ -188,7 +189,7 @@ read_num_buf(void)
if (*p == '-')
errx(1, "negative numbers aren't permitted.");
errno = 0;
- val = strtoul(buf, &p, 0);
+ val = strtoumax(buf, &p, 0);
if (errno)
err(1, "%s", buf);
if (*p != '\n')
@@ -243,7 +244,7 @@ primes(ubig start, ubig 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(hflag ? "%" PRIx64 "\n" : "%" PRIu64 "\n", factor);
}
}
/* return early if we are done */
@@ -306,11 +307,11 @@ primes(ubig start, ubig stop)
*/
for (q = table; q < tab_lim; ++q, start+=2) {
if (*q) {
- if ((uint64_t)start > SIEVEMAX) {
+ if (start > SIEVEMAX) {
if (!isprime(start))
continue;
}
- printf(hflag ? "0x%lx\n" : "%lu\n", start);
+ printf(hflag ? "%" PRIx64 "\n" : "%" PRIu64 "\n", start);
}
}
}
diff --git a/games/primes/primes.h b/games/primes/primes.h
index 7dcef52..3a18fc7 100644
--- a/games/primes/primes.h
+++ b/games/primes/primes.h
@@ -41,8 +41,10 @@
* chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
*/
+#include <stdint.h>
+
/* ubig is the type that holds a large unsigned value */
-typedef unsigned long ubig; /* must be >=32 bit unsigned value */
+typedef uint64_t ubig; /* must be >=32 bit unsigned value */
#define BIG ULONG_MAX /* largest value will sieve */
/* bytes in sieve table (must be > 3*5*7*11) */
diff --git a/gnu/lib/csu/Makefile b/gnu/lib/csu/Makefile
index dee77df..e1224ca 100644
--- a/gnu/lib/csu/Makefile
+++ b/gnu/lib/csu/Makefile
@@ -24,7 +24,7 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \
CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG}
MKDEP= -DCRT_BEGIN
-.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${TARGET_CPUARCH} == "arm"
CFLAGS+= -DTARGET_ARM_EABI
.endif
diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile
index 8480ef4..4fd8b8d 100644
--- a/gnu/lib/libgcc/Makefile
+++ b/gnu/lib/libgcc/Makefile
@@ -15,7 +15,7 @@ MK_SSP= no
.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"
-.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${TARGET_CPUARCH} == "arm"
CFLAGS+= -DTARGET_ARM_EABI
.endif
@@ -56,7 +56,7 @@ LIB2FUNCS+= _fixuns${mode}si
.endfor
# Likewise double-word routines.
-.if ${TARGET_CPUARCH} != "arm" || ${MK_ARM_EABI} == "no"
+.if ${TARGET_CPUARCH} != "arm"
# These are implemented in an ARM specific file but will not be filtered out
.for mode in sf df xf tf
LIB2FUNCS+= _fix${mode}di _fixuns${mode}di
@@ -117,14 +117,10 @@ CFLAGS.clang+= -fheinous-gnu-extensions
LIB1ASMSRC = lib1funcs.asm
LIB1ASMFUNCS = _dvmd_tls _bb_init_func
-.if ${MK_ARM_EABI} != "no"
LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c
# Some compilers generate __aeabi_ functions libgcc_s is missing
DPADD+= ${LIBCOMPILER_RT}
LDADD+= -lcompiler_rt
-.else
-LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
-.endif
.endif
.if ${TARGET_CPUARCH} == mips
@@ -319,7 +315,7 @@ CLEANFILES += cs-*.h option*
SHLIB_MKMAP = ${GCCDIR}/mkmap-symver.awk
SHLIB_MKMAP_OPTS =
SHLIB_MAPFILES = ${GCCDIR}/libgcc-std.ver
-.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${TARGET_CPUARCH} == "arm"
SHLIB_MAPFILES += ${GCCDIR}/config/arm/libgcc-bpabi.ver
.endif
VERSION_MAP = libgcc.map
diff --git a/gnu/lib/libgcov/Makefile b/gnu/lib/libgcov/Makefile
index e2b8074..7582720 100644
--- a/gnu/lib/libgcov/Makefile
+++ b/gnu/lib/libgcov/Makefile
@@ -17,7 +17,7 @@ CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK
CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \
-I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I.
-.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${TARGET_CPUARCH} == "arm"
CFLAGS+= -DTARGET_ARM_EABI
.endif
diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile
index fa1d67e..98a08f4 100644
--- a/gnu/lib/libstdc++/Makefile
+++ b/gnu/lib/libstdc++/Makefile
@@ -16,9 +16,6 @@ LIB= stdc++
SHLIB_MAJOR= 6
CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
-.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} == "no"
-CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1
-.endif
CFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
CFLAGS+= -I${GCCLIB}/include -I${SRCDIR}/include -I.
CFLAGS+= -frandom-seed=RepeatabilityConsideredGood
@@ -596,7 +593,7 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h
CLEANFILES+= ${THRHDRS}
-.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${MACHINE_CPUARCH} == "arm"
unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
.else
unwind.h: ${GCCDIR}/unwind-generic.h
diff --git a/gnu/lib/libsupc++/Makefile b/gnu/lib/libsupc++/Makefile
index c7cc30e..0531a73 100644
--- a/gnu/lib/libsupc++/Makefile
+++ b/gnu/lib/libsupc++/Makefile
@@ -22,9 +22,6 @@ SRCS+= del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc eh_alloc.cc eh_arm.cc \
SRCS+= cp-demangle.c
CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
-.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} == "no"
-CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1
-.endif
CFLAGS+= -I${GCCLIB}/include -I${SRCDIR} -I${GCCDIR}
CFLAGS+= -I${.CURDIR}/../libstdc++ -I.
CFLAGS+= -frandom-seed=RepeatabilityConsideredGood
@@ -35,7 +32,7 @@ HDRS= exception new typeinfo cxxabi.h exception_defines.h
INCS= ${HDRS:S;^;${SRCDIR}/;}
INCSDIR=${INCLUDEDIR}/c++/${GCCVER}
-.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${MACHINE_CPUARCH} == "arm"
unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
.else
unwind.h: ${GCCDIR}/unwind-generic.h
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
index dc97799..1d66b3d 100644
--- a/gnu/usr.bin/cc/Makefile.inc
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -27,7 +27,7 @@ CSTD?= gnu89
CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE
.endif
-.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${TARGET_CPUARCH} == "arm"
CFLAGS+= -DTARGET_ARM_EABI
.endif
diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile
index ae7f8b8..af731c1 100644
--- a/gnu/usr.bin/cc/cc_tools/Makefile
+++ b/gnu/usr.bin/cc/cc_tools/Makefile
@@ -51,10 +51,8 @@ TARGET_INC+= ${GCC_CPU}/elf.h
.endif
.if ${TARGET_CPUARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/aout.h
-.if ${MK_ARM_EABI} != "no"
TARGET_INC+= ${GCC_CPU}/bpabi.h
.endif
-.endif
.if ${TARGET_ARCH} == "powerpc64"
TARGET_INC+= ${GCC_CPU}/biarch64.h
TARGET_INC+= ${GCC_CPU}/default64.h
@@ -352,7 +350,7 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h
GENSRCS+= gthr-default.h
-.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${TARGET_CPUARCH} == "arm"
unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
.else
unwind.h: ${GCCDIR}/unwind-generic.h
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index 3b30fe7..241d15e 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -22,11 +22,10 @@ CFLAGS+= -fno-strict-aliasing
TARGET_ARCH?= ${MACHINE_ARCH}
BUILD_ARCH?= ${MACHINE_ARCH}
-.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \
- ${MK_ARM_EABI} != "no"
-TARGET_ABI= gnueabi
-.elif ${TARGET_ARCH} == "armv6hf"
+.if ${TARGET_ARCH:Marm*hf*} != ""
TARGET_ABI= gnueabihf
+.elif ${TARGET_ARCH:Marm*} != ""
+TARGET_ABI= gnueabi
.else
TARGET_ABI= unknown
.endif
diff --git a/lib/libc/arm/Makefile.inc b/lib/libc/arm/Makefile.inc
index 026bd0a..418f54d 100644
--- a/lib/libc/arm/Makefile.inc
+++ b/lib/libc/arm/Makefile.inc
@@ -9,14 +9,9 @@ SOFTFLOAT_BITS=32
MDSRCS+=machdep_ldisd.c
SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map
-.if ${MK_ARM_EABI} == "no"
-# This contains the symbols that were removed when moving to the ARM EABI
-SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_oabi.map
-.else
.include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc"
-.endif
-.if ${MACHINE_ARCH} == "armv6hf"
+.if ${MACHINE_ARCH:Marm*hf*} != ""
SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map
.endif
diff --git a/lib/libc/arm/Symbol_oabi.map b/lib/libc/arm/Symbol_oabi.map
deleted file mode 100644
index 0c22e4a..0000000
--- a/lib/libc/arm/Symbol_oabi.map
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * $FreeBSD$
- */
-
-/*
- * This only needs to contain symbols that are not listed in
- * symbol maps from other parts of libc (i.e., not found in
- * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...)
- * and are not used in the ARM EABI.
- */
-FBSDprivate_1.0 {
- __umodsi3;
- __modsi3;
- __udivsi3;
- __divsi3;
-};
diff --git a/lib/libc/arm/aeabi/Makefile.inc b/lib/libc/arm/aeabi/Makefile.inc
index 0957c92..c0ce512 100644
--- a/lib/libc/arm/aeabi/Makefile.inc
+++ b/lib/libc/arm/aeabi/Makefile.inc
@@ -5,7 +5,7 @@
SRCS+= aeabi_atexit.c \
aeabi_unwind_cpp.c \
aeabi_unwind_exidx.c
-.if ${MACHINE_ARCH} != "armv6hf"
+.if ${MACHINE_ARCH:Marm*hf*} == ""
SRCS+= aeabi_double.c \
aeabi_float.c
.endif
diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc
index 5fd52c2..8efde09 100644
--- a/lib/libc/arm/gen/Makefile.inc
+++ b/lib/libc/arm/gen/Makefile.inc
@@ -6,10 +6,6 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \
__aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c \
arm_initfini.c
-.if ${MK_ARM_EABI} == "no"
-SRCS+= divsi3.S
-.endif
-
.if ${MACHINE_ARCH} == "armv6hf"
SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \
fpsetround_vfp.c fpsetsticky_vfp.c
diff --git a/lib/libc/powerpc/gen/_ctx_start.S b/lib/libc/powerpc/gen/_ctx_start.S
index 2d3cfcf..4b9fc1d 100644
--- a/lib/libc/powerpc/gen/_ctx_start.S
+++ b/lib/libc/powerpc/gen/_ctx_start.S
@@ -41,5 +41,6 @@
* above branch.
*/
bl PIC_PLT(CNAME(abort)) /* abort */
+ END(_cts_start)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/gen/_setjmp.S b/lib/libc/powerpc/gen/_setjmp.S
index bbf8644..e28386c 100644
--- a/lib/libc/powerpc/gen/_setjmp.S
+++ b/lib/libc/powerpc/gen/_setjmp.S
@@ -58,6 +58,7 @@ ENTRY(_setjmp)
stmw %r9,20(%r3)
li %r3,0
blr
+END(_setjmp)
ENTRY(_longjmp)
lmw %r9,20(%r3)
@@ -68,5 +69,6 @@ ENTRY(_longjmp)
bnelr
li %r3,1
blr
+END(_longjmp)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/gen/eabi.S b/lib/libc/powerpc/gen/eabi.S
index 59c2311..3296af8 100644
--- a/lib/libc/powerpc/gen/eabi.S
+++ b/lib/libc/powerpc/gen/eabi.S
@@ -29,5 +29,6 @@ __FBSDID("$FreeBSD$");
ENTRY(__eabi)
blr
+END(__eabi)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/gen/fabs.S b/lib/libc/powerpc/gen/fabs.S
index 7891012..ac083ae 100644
--- a/lib/libc/powerpc/gen/fabs.S
+++ b/lib/libc/powerpc/gen/fabs.S
@@ -33,5 +33,6 @@ __FBSDID("$FreeBSD$");
ENTRY(fabs)
fabs %f1,%f1
blr
+END(fabs)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/gen/setjmp.S b/lib/libc/powerpc/gen/setjmp.S
index 6df4f93..9325fc2 100644
--- a/lib/libc/powerpc/gen/setjmp.S
+++ b/lib/libc/powerpc/gen/setjmp.S
@@ -68,6 +68,7 @@ ENTRY(setjmp)
stmw %r9,20(%r6)
li %r3,0 /* return (0) */
blr
+END(setjmp)
WEAK_REFERENCE(CNAME(__longjmp), longjmp)
ENTRY(__longjmp)
@@ -86,5 +87,6 @@ ENTRY(__longjmp)
bnelr
li %r3,1
blr
+END(__longjmp)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/gen/sigsetjmp.S b/lib/libc/powerpc/gen/sigsetjmp.S
index 9639dd1..c67afc6 100644
--- a/lib/libc/powerpc/gen/sigsetjmp.S
+++ b/lib/libc/powerpc/gen/sigsetjmp.S
@@ -73,6 +73,7 @@ ENTRY(sigsetjmp)
stmw %r9,20(%r6)
li %r3,0
blr
+END(sigsetjmp)
ENTRY(siglongjmp)
lmw %r9,20(%r3)
@@ -94,5 +95,6 @@ ENTRY(siglongjmp)
bnelr
li %r3,1
blr
+END(siglongjmp)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/sys/brk.S b/lib/libc/powerpc/sys/brk.S
index 018eec9..e14be10 100644
--- a/lib/libc/powerpc/sys/brk.S
+++ b/lib/libc/powerpc/sys/brk.S
@@ -71,5 +71,6 @@ ENTRY(brk)
1:
b PIC_PLT(HIDENAME(cerror))
+END(brk)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/sys/exect.S b/lib/libc/powerpc/sys/exect.S
index 3c39b3c..701f5b0 100644
--- a/lib/libc/powerpc/sys/exect.S
+++ b/lib/libc/powerpc/sys/exect.S
@@ -37,5 +37,6 @@ ENTRY(exect)
blr
1:
b PIC_PLT(HIDENAME(cerror))
+END(exect)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/sys/pipe.S b/lib/libc/powerpc/sys/pipe.S
index 3f6d9a4..1cbbef0 100644
--- a/lib/libc/powerpc/sys/pipe.S
+++ b/lib/libc/powerpc/sys/pipe.S
@@ -41,5 +41,6 @@ ENTRY(pipe)
blr /* and return 0 */
1:
b PIC_PLT(HIDENAME(cerror))
+END(pipe)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/sys/ptrace.S b/lib/libc/powerpc/sys/ptrace.S
index 0bc25c9..cff463d 100644
--- a/lib/libc/powerpc/sys/ptrace.S
+++ b/lib/libc/powerpc/sys/ptrace.S
@@ -56,5 +56,6 @@ ENTRY(ptrace)
blr
1:
b PIC_PLT(HIDENAME(cerror))
+END(ptrace)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc/sys/sbrk.S b/lib/libc/powerpc/sys/sbrk.S
index a5e4020..f058d11 100644
--- a/lib/libc/powerpc/sys/sbrk.S
+++ b/lib/libc/powerpc/sys/sbrk.S
@@ -68,5 +68,6 @@ ENTRY(sbrk)
blr
2:
b PIC_PLT(HIDENAME(cerror))
+END(sbrk)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/gen/_ctx_start.S b/lib/libc/powerpc64/gen/_ctx_start.S
index 79df041..17ec44e 100644
--- a/lib/libc/powerpc64/gen/_ctx_start.S
+++ b/lib/libc/powerpc64/gen/_ctx_start.S
@@ -46,5 +46,6 @@
nop
bl CNAME(abort) /* abort */
nop
+ END(_ctx_start)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/gen/_setjmp.S b/lib/libc/powerpc64/gen/_setjmp.S
index ac0555e..207c4f7 100644
--- a/lib/libc/powerpc64/gen/_setjmp.S
+++ b/lib/libc/powerpc64/gen/_setjmp.S
@@ -80,6 +80,7 @@ ENTRY(_setjmp)
std %r31,40 + 22*8(%r3)
li %r3,0
blr
+END(_setjmp)
ENTRY(_longjmp)
ld %r9,40 + 0*8(%r3)
@@ -113,5 +114,6 @@ ENTRY(_longjmp)
bnelr
li %r3,1
blr
+END(_longjmp)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/gen/fabs.S b/lib/libc/powerpc64/gen/fabs.S
index 7891012..ac083ae 100644
--- a/lib/libc/powerpc64/gen/fabs.S
+++ b/lib/libc/powerpc64/gen/fabs.S
@@ -33,5 +33,6 @@ __FBSDID("$FreeBSD$");
ENTRY(fabs)
fabs %f1,%f1
blr
+END(fabs)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/gen/setjmp.S b/lib/libc/powerpc64/gen/setjmp.S
index 8fe2852..1495466 100644
--- a/lib/libc/powerpc64/gen/setjmp.S
+++ b/lib/libc/powerpc64/gen/setjmp.S
@@ -92,6 +92,7 @@ ENTRY(setjmp)
li %r3,0 /* return (0) */
blr
+END(setjmp)
WEAK_REFERENCE(__longjmp, longjmp)
ENTRY(__longjmp)
@@ -132,5 +133,6 @@ ENTRY(__longjmp)
bnelr
li %r3,1
blr
+END(__longjmp)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/gen/sigsetjmp.S b/lib/libc/powerpc64/gen/sigsetjmp.S
index d5341ea..5cfd684 100644
--- a/lib/libc/powerpc64/gen/sigsetjmp.S
+++ b/lib/libc/powerpc64/gen/sigsetjmp.S
@@ -97,6 +97,7 @@ ENTRY(sigsetjmp)
li %r3,0
blr
+END(sigsetjmp)
ENTRY(siglongjmp)
ld %r9,40 + 0*8(%r3)
@@ -141,5 +142,6 @@ ENTRY(siglongjmp)
bnelr
li %r3,1
blr
+END(siglongjmp)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/sys/brk.S b/lib/libc/powerpc64/sys/brk.S
index 675b400..cbcecc7 100644
--- a/lib/libc/powerpc64/sys/brk.S
+++ b/lib/libc/powerpc64/sys/brk.S
@@ -69,5 +69,6 @@ ENTRY(brk)
ld %r0,16(%r1)
mtlr %r0
blr
+END(brk)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/sys/exect.S b/lib/libc/powerpc64/sys/exect.S
index aa34b9e..b6cda9c 100644
--- a/lib/libc/powerpc64/sys/exect.S
+++ b/lib/libc/powerpc64/sys/exect.S
@@ -45,5 +45,6 @@ ENTRY(exect)
ld %r0,16(%r1)
mtlr %r0
blr
+END(exect)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/sys/pipe.S b/lib/libc/powerpc64/sys/pipe.S
index efd3dd6..ee255a9 100644
--- a/lib/libc/powerpc64/sys/pipe.S
+++ b/lib/libc/powerpc64/sys/pipe.S
@@ -49,5 +49,6 @@ ENTRY(pipe)
ld %r0,16(%r1)
mtlr %r0
blr
+END(pipe)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/sys/ptrace.S b/lib/libc/powerpc64/sys/ptrace.S
index ede00e7..69709dd 100644
--- a/lib/libc/powerpc64/sys/ptrace.S
+++ b/lib/libc/powerpc64/sys/ptrace.S
@@ -63,5 +63,6 @@ ENTRY(ptrace)
ld %r0,16(%r1)
mtlr %r0
blr
+END(ptrace)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/powerpc64/sys/sbrk.S b/lib/libc/powerpc64/sys/sbrk.S
index e147493..4e3b57a 100644
--- a/lib/libc/powerpc64/sys/sbrk.S
+++ b/lib/libc/powerpc64/sys/sbrk.S
@@ -64,5 +64,6 @@ ENTRY(sbrk)
ld %r0,16(%r1)
mtlr %r0
blr
+END(sbrk)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/quad/Makefile.inc b/lib/libc/quad/Makefile.inc
index 1b1ab60..94697fa 100644
--- a/lib/libc/quad/Makefile.inc
+++ b/lib/libc/quad/Makefile.inc
@@ -8,7 +8,7 @@
SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c
-.elif ${LIBC_ARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.elif ${LIBC_ARCH} == "arm"
SRCS+= adddi3.c anddi3.c floatunsdidf.c iordi3.c lshldi3.c notdi2.c \
qdivrem.c subdi3.c xordi3.c
diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3
index 34d2b79..27054460 100644
--- a/lib/libc/stdtime/strptime.3
+++ b/lib/libc/stdtime/strptime.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\" "
-.Dd June 25, 2012
+.Dd October 2, 2014
.Dt STRPTIME 3
.Os
.Sh NAME
@@ -79,7 +79,11 @@ and
.Fa \&%D ,
are now interpreted as beginning at 1969 per POSIX requirements.
Years 69-00 are interpreted in the 20th century (1969-2000), years
-01-68 in the 21st century (2001-2068).
+01-68 in the 21st century (2001-2068). The
+.Fa \&%U
+and
+.Fa %W
+format specifiers accept any value within the range 00 to 53.
.Pp
If the
.Fa format
@@ -161,14 +165,6 @@ and 12PM
is taken as noon.
.Pp
The
-.Fa \&%U
-and
-.Fa %W
-format specifiers accept any value within the range 00 to 53
-without validating against other values supplied (like month
-or day of the year, for example).
-.Pp
-The
.Fa %Z
format specifier only accepts time zone abbreviations of the local time zone,
or the value "GMT".
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index 2333ab4..8576bdb 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -55,10 +55,32 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
#include "libc_private.h"
#include "timelocal.h"
+#include "tzfile.h"
static char * _strptime(const char *, const char *, struct tm *, int *, locale_t);
-#define asizeof(a) (sizeof (a) / sizeof ((a)[0]))
+#define asizeof(a) (sizeof(a) / sizeof((a)[0]))
+
+#define FLAG_NONE (1 << 0)
+#define FLAG_YEAR (1 << 1)
+#define FLAG_MONTH (1 << 2)
+#define FLAG_YDAY (1 << 3)
+#define FLAG_MDAY (1 << 4)
+#define FLAG_WDAY (1 << 5)
+
+/*
+ * Calculate the week day of the first day of a year. Valid for
+ * the Gregorian calendar, which began Sept 14, 1752 in the UK
+ * and its colonies. Ref:
+ * http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week
+ */
+
+static int
+first_wday_of(int year)
+{
+ return (((2 * (3 - (year / 100) % 4)) + (year % 100) +
+ ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7);
+}
static char *
_strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp,
@@ -66,9 +88,18 @@ _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp,
{
char c;
const char *ptr;
+ int day_offset = -1, wday_offset;
+ int week_offset;
int i, len;
+ int flags;
int Ealternative, Oalternative;
- struct lc_time_T *tptr = __get_current_time_locale(locale);
+ const struct lc_time_T *tptr = __get_current_time_locale(locale);
+ static int start_of_month[2][13] = {
+ {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365},
+ {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}
+ };
+
+ flags = FLAG_NONE;
ptr = fmt;
while (*ptr != 0) {
@@ -102,6 +133,7 @@ label:
buf = _strptime(buf, tptr->date_fmt, tm, GMTp, locale);
if (buf == NULL)
return (NULL);
+ flags |= FLAG_WDAY | FLAG_MONTH | FLAG_MDAY | FLAG_YEAR;
break;
case 'C':
@@ -119,19 +151,23 @@ label:
if (i < 19)
return (NULL);
- tm->tm_year = i * 100 - 1900;
+ tm->tm_year = i * 100 - TM_YEAR_BASE;
+ flags |= FLAG_YEAR;
+
break;
case 'c':
buf = _strptime(buf, tptr->c_fmt, tm, GMTp, locale);
if (buf == NULL)
return (NULL);
+ flags |= FLAG_WDAY | FLAG_MONTH | FLAG_MDAY | FLAG_YEAR;
break;
case 'D':
buf = _strptime(buf, "%m/%d/%y", tm, GMTp, locale);
if (buf == NULL)
return (NULL);
+ flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR;
break;
case 'E':
@@ -150,6 +186,7 @@ label:
buf = _strptime(buf, "%Y-%m-%d", tm, GMTp, locale);
if (buf == NULL)
return (NULL);
+ flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR;
break;
case 'R':
@@ -180,6 +217,7 @@ label:
buf = _strptime(buf, tptr->x_fmt, tm, GMTp, locale);
if (buf == NULL)
return (NULL);
+ flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR;
break;
case 'j':
@@ -197,6 +235,8 @@ label:
return (NULL);
tm->tm_yday = i - 1;
+ flags |= FLAG_YDAY;
+
break;
case 'M':
@@ -302,8 +342,9 @@ label:
if (i == asizeof(tptr->weekday))
return (NULL);
- tm->tm_wday = i;
buf += len;
+ tm->tm_wday = i;
+ flags |= FLAG_WDAY;
break;
case 'U':
@@ -327,6 +368,14 @@ label:
if (i > 53)
return (NULL);
+ if (c == 'U')
+ day_offset = TM_SUNDAY;
+ else
+ day_offset = TM_MONDAY;
+
+
+ week_offset = i;
+
break;
case 'w':
@@ -338,6 +387,7 @@ label:
return (NULL);
tm->tm_wday = i;
+ flags |= FLAG_WDAY;
break;
@@ -374,6 +424,7 @@ label:
return (NULL);
tm->tm_mday = i;
+ flags |= FLAG_MDAY;
break;
@@ -413,6 +464,8 @@ label:
tm->tm_mon = i;
buf += len;
+ flags |= FLAG_MONTH;
+
break;
case 'm':
@@ -430,6 +483,7 @@ label:
return (NULL);
tm->tm_mon = i - 1;
+ flags |= FLAG_MONTH;
break;
@@ -449,8 +503,11 @@ label:
}
errno = sverrno;
buf = cp;
- gmtime_r(&t, tm);
+ if (gmtime_r(&t, tm) == NULL)
+ return (NULL);
*GMTp = 1;
+ flags |= FLAG_YDAY | FLAG_WDAY | FLAG_MONTH |
+ FLAG_MDAY | FLAG_YEAR;
}
break;
@@ -471,13 +528,14 @@ label:
len--;
}
if (c == 'Y')
- i -= 1900;
+ i -= TM_YEAR_BASE;
if (c == 'y' && i < 69)
i += 100;
if (i < 0)
return (NULL);
tm->tm_year = i;
+ flags |= FLAG_YEAR;
break;
@@ -543,10 +601,67 @@ label:
break;
}
}
+
+ if (!(flags & FLAG_YDAY) && (flags & FLAG_YEAR)) {
+ if ((flags & (FLAG_MONTH | FLAG_MDAY)) ==
+ (FLAG_MONTH | FLAG_MDAY)) {
+ tm->tm_yday = start_of_month[isleap(tm->tm_year +
+ TM_YEAR_BASE)][tm->tm_mon] + (tm->tm_mday - 1);
+ flags |= FLAG_YDAY;
+ } else if (day_offset != -1) {
+ /* Set the date to the first Sunday (or Monday)
+ * of the specified week of the year.
+ */
+ if (!(flags & FLAG_WDAY)) {
+ tm->tm_wday = day_offset;
+ flags |= FLAG_WDAY;
+ }
+ tm->tm_yday = (7 -
+ first_wday_of(tm->tm_year + TM_YEAR_BASE) +
+ day_offset) % 7 + (week_offset - 1) * 7 +
+ tm->tm_wday - day_offset;
+ flags |= FLAG_YDAY;
+ }
+ }
+
+ if ((flags & (FLAG_YEAR | FLAG_YDAY)) == (FLAG_YEAR | FLAG_YDAY)) {
+ if (!(flags & FLAG_MONTH)) {
+ i = 0;
+ while (tm->tm_yday >=
+ start_of_month[isleap(tm->tm_year +
+ TM_YEAR_BASE)][i])
+ i++;
+ if (i > 12) {
+ i = 1;
+ tm->tm_yday -=
+ start_of_month[isleap(tm->tm_year +
+ TM_YEAR_BASE)][12];
+ tm->tm_year++;
+ }
+ tm->tm_mon = i - 1;
+ flags |= FLAG_MONTH;
+ }
+ if (!(flags & FLAG_MDAY)) {
+ tm->tm_mday = tm->tm_yday -
+ start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)]
+ [tm->tm_mon] + 1;
+ flags |= FLAG_MDAY;
+ }
+ if (!(flags & FLAG_WDAY)) {
+ i = 0;
+ wday_offset = first_wday_of(tm->tm_year);
+ while (i++ <= tm->tm_yday) {
+ if (wday_offset++ >= 6)
+ wday_offset = 0;
+ }
+ tm->tm_wday = wday_offset;
+ flags |= FLAG_WDAY;
+ }
+ }
+
return ((char *)buf);
}
-
char *
strptime_l(const char * __restrict buf, const char * __restrict fmt,
struct tm * __restrict tm, locale_t loc)
@@ -564,6 +679,7 @@ strptime_l(const char * __restrict buf, const char * __restrict fmt,
return (ret);
}
+
char *
strptime(const char * __restrict buf, const char * __restrict fmt,
struct tm * __restrict tm)
diff --git a/lib/libc/sys/connect.2 b/lib/libc/sys/connect.2
index 8ed3f12..e3e5783 100644
--- a/lib/libc/sys/connect.2
+++ b/lib/libc/sys/connect.2
@@ -28,7 +28,7 @@
.\" @(#)connect.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 26, 2014
+.Dd September 29, 2014
.Dt CONNECT 2
.Os
.Sh NAME
@@ -160,6 +160,8 @@ Search permission is denied for a component of the path prefix.
Write access to the named socket is denied.
.It Bq Er ELOOP
Too many symbolic links were encountered in translating the pathname.
+.It Bq Er EPERM
+Write access to the named socket is denied.
.El
.Sh SEE ALSO
.Xr accept 2 ,
diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
index 91ce965..c31eced 100644
--- a/lib/libcompiler_rt/Makefile
+++ b/lib/libcompiler_rt/Makefile
@@ -144,8 +144,7 @@ SRCF+= adddf3 \
truncdfsf2
.endif
-.if ${MACHINE_CPUARCH} != "mips" && \
- (${MACHINE_CPUARCH} != "arm" || ${MK_ARM_EABI} != "no")
+.if ${MACHINE_CPUARCH} != "mips"
SRCF+= divsi3 \
modsi3 \
udivsi3 \
@@ -165,16 +164,16 @@ SRCF+= stdatomic
.endif
.for file in ${SRCF}
-. if ${MACHINE_ARCH} == "armv6hf" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
+. if ${MACHINE_ARCH:Marm*hf*} != "" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
SRCS+= ${file}vfp.S
-. elif (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH} == "armv6hf") && exists(${CRTSRC}/${CRTARCH}/${file}.S)
+. elif !(${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH:Marm*hf*} == "") && exists(${CRTSRC}/${CRTARCH}/${file}.S)
SRCS+= ${file}.S
. else
SRCS+= ${file}.c
. endif
.endfor
-.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${MACHINE_CPUARCH} == "arm"
SRCS+= aeabi_idivmod.S \
aeabi_ldivmod.S \
aeabi_memcmp.S \
diff --git a/lib/libpam/modules/pam_login_access/pam_login_access.c b/lib/libpam/modules/pam_login_access/pam_login_access.c
index a29eb7d..fe16662 100644
--- a/lib/libpam/modules/pam_login_access/pam_login_access.c
+++ b/lib/libpam/modules/pam_login_access/pam_login_access.c
@@ -85,17 +85,21 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused,
if (login_access(user, rhost) != 0)
return (PAM_SUCCESS);
PAM_VERBOSE_ERROR("%s is not allowed to log in from %s",
- user, rhost);
+ (const char *)user, (const char *)rhost);
} else if (tty != NULL && *(const char *)tty != '\0') {
PAM_LOG("Checking login.access for user %s on tty %s",
(const char *)user, (const char *)tty);
if (login_access(user, tty) != 0)
return (PAM_SUCCESS);
PAM_VERBOSE_ERROR("%s is not allowed to log in on %s",
- user, tty);
+ (const char *)user, (const char *)tty);
} else {
- PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required");
- return (PAM_AUTHINFO_UNAVAIL);
+ PAM_LOG("Checking login.access for user %s",
+ (const char *)user);
+ if (login_access(user, "***unknown***") != 0)
+ return (PAM_SUCCESS);
+ PAM_VERBOSE_ERROR("%s is not allowed to log in",
+ (const char *)user);
}
return (PAM_AUTH_ERR);
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index ebf5c30..e57407f 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -64,9 +64,6 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
.if ${MACHINE_CPUARCH} == "arm"
.PATH: ${.CURDIR}/../libc/arm/gen
-.if ${MK_ARM_EABI} == "no"
-SRCS+= divsi3.S
-.else
# Compiler support functions
.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/
# __clzsi2 and ctzsi2 for various builtin functions
@@ -78,7 +75,6 @@ SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c
.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm/
SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S
SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S
-.endif
.endif
.if ${MACHINE_CPUARCH} == "powerpc"
diff --git a/lib/msun/src/e_lgamma_r.c b/lib/msun/src/e_lgamma_r.c
index 58940b3..a0bd310 100644
--- a/lib/msun/src/e_lgamma_r.c
+++ b/lib/msun/src/e_lgamma_r.c
@@ -14,12 +14,12 @@
__FBSDID("$FreeBSD$");
/* __ieee754_lgamma_r(x, signgamp)
- * Reentrant version of the logarithm of the Gamma function
- * with user provide pointer for the sign of Gamma(x).
+ * Reentrant version of the logarithm of the Gamma function
+ * with user provide pointer for the sign of Gamma(x).
*
* Method:
* 1. Argument Reduction for 0 < x <= 8
- * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
+ * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
* reduce x to a number in [1.5,2.5] by
* lgamma(1+s) = log(s) + lgamma(s)
* for example,
@@ -57,20 +57,20 @@ __FBSDID("$FreeBSD$");
* by
* 3 5 11
* w = w0 + w1*z + w2*z + w3*z + ... + w6*z
- * where
+ * where
* |w - f(z)| < 2**-58.74
- *
+ *
* 4. For negative x, since (G is gamma function)
* -x*G(-x)*G(x) = pi/sin(pi*x),
* we have
* G(x) = pi/(sin(pi*x)*(-x)*G(-x))
* since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0
- * Hence, for x<0, signgam = sign(sin(pi*x)) and
+ * Hence, for x<0, signgam = sign(sin(pi*x)) and
* lgamma(x) = log(|Gamma(x)|)
* = log(pi/(|x*sin(pi*x)|)) - lgamma(-x);
- * Note: one should avoid compute pi*(-x) directly in the
+ * Note: one should avoid compute pi*(-x) directly in the
* computation of sin(pi*(-x)).
- *
+ *
* 5. Special Cases
* lgamma(2+s) ~ s*(1-Euler) for tiny s
* lgamma(1) = lgamma(2) = 0
@@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$");
* lgamma(0) = lgamma(neg.integer) = inf and raise divide-by-zero
* lgamma(inf) = inf
* lgamma(-inf) = inf (bug for bug compatible with C99!?)
- *
*/
#include <float.h>
@@ -187,9 +186,9 @@ sin_pi(double x)
switch (n) {
case 0: y = __kernel_sin(pi*y,zero,0); break;
- case 1:
+ case 1:
case 2: y = __kernel_cos(pi*(0.5-y),zero); break;
- case 3:
+ case 3:
case 4: y = __kernel_sin(pi*(one-y),zero,0); break;
case 5:
case 6: y = -__kernel_cos(pi*(y-1.5),zero); break;
@@ -263,7 +262,7 @@ __ieee754_lgamma_r(double x, int *signgamp)
p3 = t2+w*(t5+w*(t8+w*(t11+w*t14)));
p = z*p1-(tt-w*(p2+y*p3));
r += (tf + p); break;
- case 2:
+ case 2:
p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5)))));
p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5))));
r += (-0.5*y + p1/p2);
@@ -291,7 +290,7 @@ __ieee754_lgamma_r(double x, int *signgamp)
y = z*z;
w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6)))));
r = (x-half)*(t-one)+w;
- } else
+ } else
/* 2**58 <= x <= inf */
r = x*(__ieee754_log(x)-one);
if(hx<0) r = nadj - r;
@@ -301,4 +300,3 @@ __ieee754_lgamma_r(double x, int *signgamp)
#if (LDBL_MANT_DIG == 53)
__weak_reference(lgamma_r, lgammal_r);
#endif
-
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 6754451..cc30132 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -46,7 +46,7 @@ LDFLAGS+= -shared -Wl,-Bsymbolic
DPADD= ${LIBC_PIC}
LDADD= -lc_pic
-.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+.if ${MACHINE_CPUARCH} == "arm"
# Some of the required math functions (div & mod) are implemented in
# libcompiler_rt on ARM. The library also needs to be placed first to be
# correctly linked. As some of the functions are used before we have
diff --git a/release/Makefile b/release/Makefile
index 6b4517d..8a6ece7 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -23,6 +23,9 @@
# WITH_DVD: if set, generate dvd1.iso
# WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1)
# (uncompressed images are not removed)
+# WITH_VMIMAGES: if set, build virtual machine images with the release
+# WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images
+# with xz(1) (extremely time consuming)
# TARGET/TARGET_ARCH: architecture of built release
#
@@ -94,6 +97,11 @@ IMAGES+= memstick.img
IMAGES+= mini-memstick.img
.endif
+VMTARGETS= vm-base vm-image
+VMFORMATS?= vhd vmdk qcow2 raw
+VMSIZE?= 20G
+VMBASE?= vm
+
CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES}
.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
. for I in ${IMAGES}
@@ -103,7 +111,16 @@ CLEANFILES+= ${I}.xz
.if defined(WITH_DVD) && !empty(WITH_DVD)
CLEANFILES+= pkg-stage
.endif
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+CLEANFILES+= ${VMBASE}.img
+. for FORMAT in ${VMFORMATS}
+CLEANFILES+= ${VMBASE}.${FORMAT}
+. endfor
+.endif
CLEANDIRS= dist ftp release bootonly dvd
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+CLEANDIRS+= ${VMTARGETS}
+.endif
beforeclean:
chflags -R noschg .
.include <bsd.obj.mk>
@@ -263,6 +280,9 @@ ftp: packagesystem
release:
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+ ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS}
+.endif
install:
.if defined(DESTDIR) && !empty(DESTDIR)
@@ -277,3 +297,44 @@ install:
.endfor
cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+ mkdir -p ${DESTDIR}/vmimages
+. for FORMAT in ${VMFORMATS}
+ cp -p ${VMBASE}.${FORMAT} \
+ ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
+. endfor
+. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES)
+# This is very time consuming, so defer it after the images are moved to
+# the DESTDIR.
+. for FORMAT in ${VMFORMATS}
+ # Don't keep the originals. There is a copy in ${.OBJDIR} if needed.
+ ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
+. endfor
+. endif
+ cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
+ ${DESTDIR}/vmimages/CHECKSUM.SHA256
+ cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \
+ ${DESTDIR}/vmimages/CHECKSUM.MD5
+.endif
+
+vm-base:
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
+ env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+ ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
+ ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE}
+. endif
+.endif
+ touch ${.TARGET}
+
+vm-image: vm-base
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
+. for FORMAT in ${VMFORMATS}
+ env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+ ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
+ ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT}
+. endfor
+. endif
+.endif
+ touch ${.TARGET}
diff --git a/release/amd64/mk-vmimage.sh b/release/amd64/mk-vmimage.sh
new file mode 100755
index 0000000..6ee1482
--- /dev/null
+++ b/release/amd64/mk-vmimage.sh
@@ -0,0 +1,188 @@
+#!/bin/sh
+#-
+# Copyright (c) 2014 The FreeBSD Foundation
+# All rights reserved.
+#
+# This software was developed by Glen Barber under sponsorship
+# from the FreeBSD Foundation.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# mk-vmimage.sh: Create virtual machine disk images in various formats.
+#
+# $FreeBSD$
+#
+
+PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+export PATH
+
+usage_vm_base() {
+ echo -n "$(basename ${0}) vm-base <base image> <source tree>"
+ echo " <dest dir> <disk image size>"
+ return 0
+}
+
+usage_vm_image() {
+ echo -n "$(basename ${0}) vm-image <base image> <image format>"
+ echo " <output image>"
+ return 0
+}
+
+usage() {
+ echo "Usage:"
+ echo "$(basename ${0}) [vm-base|vm-image] [...]"
+ echo
+ usage_vm_base
+ echo
+ usage_vm_image
+ exit 1
+}
+
+panic() {
+ rc="${1}"
+ shift 1
+ msg="${@}"
+ printf "${msg}\n"
+ if [ ! -z "${mddev}" ]; then
+ mdconfig -d -u ${mddev}
+ fi
+ # Do not allow one failure case to chain through any remaining image
+ # builds.
+ exit 0
+}
+
+vm_create_baseimage() {
+ # Creates the UFS root filesystem for the virtual machine disk,
+ # written to the formatted disk image with mkimg(1).
+ #
+ # Arguments:
+ # vm-base <base image> <source tree> <dest dir> <disk image size>
+
+ VMBASE="${1}"
+ WORLDDIR="${2}"
+ DESTDIR="${3}"
+ VMSIZE="${4}"
+
+ if [ -z "${VMBASE}" -o -z "${WORLDDIR}" -o -z "${DESTDIR}" \
+ -o -z "${VMSIZE}" ]; then
+ usage
+ fi
+
+ i=0
+ mkdir -p ${DESTDIR}
+ truncate -s ${VMSIZE} ${VMBASE}
+ mddev=$(mdconfig -f ${VMBASE})
+ newfs -j /dev/${mddev}
+ mount /dev/${mddev} ${DESTDIR}
+ cd ${WORLDDIR} && \
+ make DESTDIR=${DESTDIR} \
+ installworld installkernel distribution || \
+ panic 1 "\n\nCannot install the base system to ${DESTDIR}."
+ chroot ${DESTDIR} /usr/bin/newaliases
+ echo '# Custom /etc/fstab for FreeBSD VM images' \
+ > ${DESTDIR}/etc/fstab
+ echo '/dev/gpt/rootfs / ufs rw 2 2' \
+ >> ${DESTDIR}/etc/fstab
+ echo '/dev/gpt/swapfs none swap sw 0 0' \
+ >> ${DESTDIR}/etc/fstab
+ sync
+ while ! umount ${DESTDIR}; do
+ i=$(( $i + 1 ))
+ if [ $i -ge 10 ]; then
+ # This should never happen. But, it has happened.
+ msg="Cannot umount(8) ${DESTDIR}\n"
+ msg="${msg}Something has gone horribly wrong."
+ panic 1 "${msg}"
+ fi
+ sleep 1
+ done
+
+ return 0
+}
+
+vm_create_vmdisk() {
+ # Creates the virtual machine disk image from the raw disk image.
+ #
+ # Arguments:
+ # vm-image <base image> <image format> <output image>"
+
+ VMBASE="${1}"
+ FORMAT="${2}"
+ VMIMAGE="${3}"
+
+ if [ -z "${VMBASE}" -o -z "${FORMAT}" -o -z "${VMIMAGE}" ]; then
+ usage
+ fi
+
+ mkimg_version=$(mkimg --version 2>/dev/null | awk '{print $2}')
+
+ # We need mkimg(1) '--version' output, at minimum, to be able to
+ # tell what virtual machine disk image formats are available.
+ # Bail if mkimg(1) reports an empty '--version' value.
+ if [ -z "${mkimg_version}" ]; then
+ msg="Cannot determine mkimg(1) version.\n"
+ msg="${msg}Cannot continue without a known mkimg(1) version."
+ panic 0 "${msg}"
+ fi
+
+ if ! mkimg --formats 2>/dev/null | grep -q ${FORMAT}; then
+ panic 0 "'${FORMAT}' is not supported by this mkimg(1).\n"
+ fi
+
+ case ${FORMAT} in
+ vhd)
+ mkimg_format=vhdf
+ ;;
+ *)
+ mkimg_format=${FORMAT}
+ ;;
+ esac
+
+ mkimg -f ${mkimg_format} -s gpt \
+ -b /boot/pmbr -p freebsd-boot/bootfs:=/boot/gptboot \
+ -p freebsd-swap/swapfs::1G \
+ -p freebsd-ufs/rootfs:=${VMBASE} \
+ -o ${VMIMAGE}
+
+ return 0
+}
+
+main() {
+ cmd="${1}"
+ shift 1
+
+ case ${cmd} in
+ vm-base)
+ eval vm_create_baseimage "$@" || return 0
+ ;;
+ vm-image)
+ eval vm_create_vmdisk "$@" || return 0
+ ;;
+ *|\?)
+ usage
+ ;;
+ esac
+
+ return 0
+}
+
+main "$@"
diff --git a/release/i386/mk-vmimage.sh b/release/i386/mk-vmimage.sh
new file mode 100755
index 0000000..6ee1482
--- /dev/null
+++ b/release/i386/mk-vmimage.sh
@@ -0,0 +1,188 @@
+#!/bin/sh
+#-
+# Copyright (c) 2014 The FreeBSD Foundation
+# All rights reserved.
+#
+# This software was developed by Glen Barber under sponsorship
+# from the FreeBSD Foundation.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# mk-vmimage.sh: Create virtual machine disk images in various formats.
+#
+# $FreeBSD$
+#
+
+PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+export PATH
+
+usage_vm_base() {
+ echo -n "$(basename ${0}) vm-base <base image> <source tree>"
+ echo " <dest dir> <disk image size>"
+ return 0
+}
+
+usage_vm_image() {
+ echo -n "$(basename ${0}) vm-image <base image> <image format>"
+ echo " <output image>"
+ return 0
+}
+
+usage() {
+ echo "Usage:"
+ echo "$(basename ${0}) [vm-base|vm-image] [...]"
+ echo
+ usage_vm_base
+ echo
+ usage_vm_image
+ exit 1
+}
+
+panic() {
+ rc="${1}"
+ shift 1
+ msg="${@}"
+ printf "${msg}\n"
+ if [ ! -z "${mddev}" ]; then
+ mdconfig -d -u ${mddev}
+ fi
+ # Do not allow one failure case to chain through any remaining image
+ # builds.
+ exit 0
+}
+
+vm_create_baseimage() {
+ # Creates the UFS root filesystem for the virtual machine disk,
+ # written to the formatted disk image with mkimg(1).
+ #
+ # Arguments:
+ # vm-base <base image> <source tree> <dest dir> <disk image size>
+
+ VMBASE="${1}"
+ WORLDDIR="${2}"
+ DESTDIR="${3}"
+ VMSIZE="${4}"
+
+ if [ -z "${VMBASE}" -o -z "${WORLDDIR}" -o -z "${DESTDIR}" \
+ -o -z "${VMSIZE}" ]; then
+ usage
+ fi
+
+ i=0
+ mkdir -p ${DESTDIR}
+ truncate -s ${VMSIZE} ${VMBASE}
+ mddev=$(mdconfig -f ${VMBASE})
+ newfs -j /dev/${mddev}
+ mount /dev/${mddev} ${DESTDIR}
+ cd ${WORLDDIR} && \
+ make DESTDIR=${DESTDIR} \
+ installworld installkernel distribution || \
+ panic 1 "\n\nCannot install the base system to ${DESTDIR}."
+ chroot ${DESTDIR} /usr/bin/newaliases
+ echo '# Custom /etc/fstab for FreeBSD VM images' \
+ > ${DESTDIR}/etc/fstab
+ echo '/dev/gpt/rootfs / ufs rw 2 2' \
+ >> ${DESTDIR}/etc/fstab
+ echo '/dev/gpt/swapfs none swap sw 0 0' \
+ >> ${DESTDIR}/etc/fstab
+ sync
+ while ! umount ${DESTDIR}; do
+ i=$(( $i + 1 ))
+ if [ $i -ge 10 ]; then
+ # This should never happen. But, it has happened.
+ msg="Cannot umount(8) ${DESTDIR}\n"
+ msg="${msg}Something has gone horribly wrong."
+ panic 1 "${msg}"
+ fi
+ sleep 1
+ done
+
+ return 0
+}
+
+vm_create_vmdisk() {
+ # Creates the virtual machine disk image from the raw disk image.
+ #
+ # Arguments:
+ # vm-image <base image> <image format> <output image>"
+
+ VMBASE="${1}"
+ FORMAT="${2}"
+ VMIMAGE="${3}"
+
+ if [ -z "${VMBASE}" -o -z "${FORMAT}" -o -z "${VMIMAGE}" ]; then
+ usage
+ fi
+
+ mkimg_version=$(mkimg --version 2>/dev/null | awk '{print $2}')
+
+ # We need mkimg(1) '--version' output, at minimum, to be able to
+ # tell what virtual machine disk image formats are available.
+ # Bail if mkimg(1) reports an empty '--version' value.
+ if [ -z "${mkimg_version}" ]; then
+ msg="Cannot determine mkimg(1) version.\n"
+ msg="${msg}Cannot continue without a known mkimg(1) version."
+ panic 0 "${msg}"
+ fi
+
+ if ! mkimg --formats 2>/dev/null | grep -q ${FORMAT}; then
+ panic 0 "'${FORMAT}' is not supported by this mkimg(1).\n"
+ fi
+
+ case ${FORMAT} in
+ vhd)
+ mkimg_format=vhdf
+ ;;
+ *)
+ mkimg_format=${FORMAT}
+ ;;
+ esac
+
+ mkimg -f ${mkimg_format} -s gpt \
+ -b /boot/pmbr -p freebsd-boot/bootfs:=/boot/gptboot \
+ -p freebsd-swap/swapfs::1G \
+ -p freebsd-ufs/rootfs:=${VMBASE} \
+ -o ${VMIMAGE}
+
+ return 0
+}
+
+main() {
+ cmd="${1}"
+ shift 1
+
+ case ${cmd} in
+ vm-base)
+ eval vm_create_baseimage "$@" || return 0
+ ;;
+ vm-image)
+ eval vm_create_vmdisk "$@" || return 0
+ ;;
+ *|\?)
+ usage
+ ;;
+ esac
+
+ return 0
+}
+
+main "$@"
diff --git a/release/release.conf.sample b/release/release.conf.sample
index bdd5a8a..c79ed9f 100644
--- a/release/release.conf.sample
+++ b/release/release.conf.sample
@@ -77,3 +77,24 @@ PORTBRANCH="ports/head@rHEAD"
## as TARGET/TARGET_ARCH.
#CHROOT_MAKEENV=
+## Set to a non-empty value to build virtual machine images as part of the
+## release build.
+#WITH_VMIMAGES=
+
+## Set to a non-empty value to compress virtual machine images with xz(1)
+## as part of the release build.
+#WITH_COMPRESSED_VMIMAGES=
+
+## If WITH_VMIMAGES is set to a non-empty value, this is the name of the
+## file to use for the installed userland/kernel.
+#VMBASE="vm"
+
+## If WITH_VMIMAGES is set to a non-empty value, this is the size of the
+## virtual machine disk filesystem. Valid size values are described in
+## the truncate(1) manual page.
+#VMSIZE="20G"
+
+## If WITH_VMIMAGES is set to a non-empty value, this is a list of disk
+## image formats to create. Valid values are listed in the mkimg(1)
+## manual page, as well as 'mkimg --formats' output.
+#VMFORMATS="vhdf vmdk qcow2 raw"
diff --git a/release/release.sh b/release/release.sh
index e99c403..87b3697 100755
--- a/release/release.sh
+++ b/release/release.sh
@@ -89,6 +89,11 @@ NOPORTS=
WITH_DVD=
WITH_COMPRESSED_IMAGES=
+# Set to non-empty value to build virtual machine images as part of
+# the release.
+WITH_VMIMAGES=
+WITH_COMPRESSED_VMIMAGES=
+
usage() {
echo "Usage: $0 [-c release.conf]"
exit 1
@@ -169,7 +174,7 @@ CHROOT_DMAKEFLAGS="${CONF_FILES}"
RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}"
RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \
- ${DOCPORTS} WITH_DVD=${WITH_DVD}"
+ ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES}"
# Force src checkout if configured
FORCE_SRC_KEY=
@@ -274,4 +279,5 @@ eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel
eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
release
eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
- install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES}
+ install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \
+ WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES}
diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile
index e991fbb..7445f29 100644
--- a/rescue/rescue/Makefile
+++ b/rescue/rescue/Makefile
@@ -137,7 +137,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel
.endif
.if ${MACHINE} == "pc98"
-CRUNCH_PROGS_sbin+= bsdlabel
CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
.endif
diff --git a/sbin/fdisk_pc98/Makefile b/sbin/fdisk_pc98/Makefile
index e5932f8..6961d31 100644
--- a/sbin/fdisk_pc98/Makefile
+++ b/sbin/fdisk_pc98/Makefile
@@ -7,7 +7,7 @@ MAN= fdisk.8
.PATH: ${.CURDIR}/../../sys/geom
-DPADD += ${LIBGEOM}
-LDADD += -lgeom
+DPADD+= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
+LDADD+= -lgeom -lbsdxml -lsbuf
.include <bsd.prog.mk>
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 61ccf3c..02766a1 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -28,7 +28,7 @@
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\" $FreeBSD$
.\"
-.Dd September 9, 2014
+.Dd October 1, 2014
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -679,7 +679,7 @@ Set a flag to enable Neighbor Unreachability Detection.
Clear a flag
.Cm nud .
.It Cm no_prefer_iface
-Set a flag to not honor rule 5 of source address selection in RFC 3484.
+Set a flag to not honor rule 5 of source address selection in RFC 3484.
In practice this means the address on the outgoing interface will not be
preferred, effectively yielding the decision to the address selection
policy table, configurable with
@@ -2331,9 +2331,16 @@ Remove the interface named by
from the aggregation interface.
.It Cm laggproto Ar proto
Set the aggregation protocol.
-The default is failover.
-The available options are failover, lacp, loadbalance, roundrobin, broadcast
-and none.
+The default is
+.Li failover .
+The available options are
+.Li failover ,
+.Li lacp ,
+.Li loadbalance ,
+.Li roundrobin ,
+.Li broadcast
+and
+.Li none .
.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc
Set the packet layers to hash for aggregation protocols which load balance.
The default is
@@ -2348,6 +2355,34 @@ src/dst address for IPv4 or IPv6.
.It Cm l4
src/dst port for TCP/UDP/SCTP.
.El
+.It Cm use_flowid
+Enable local hash computation for RSS hash on the interface.
+The
+.Li loadbalance
+and
+.Li lacp
+modes will use the RSS hash from the network card if available
+to avoid computing one, this may give poor traffic distribution
+if the hash is invalid or uses less of the protocol header information.
+.Cm use_flowid
+disables use of RSS hash from the network card.
+The default value can be set via the
+.Va net.link.lagg.default_use_flowid
+.Xr sysctl 8
+variable.
+.Li 0
+means
+.Dq disabled
+and
+.Li 1
+means
+.Dq enabled .
+.It Cm -use_flowid
+Disable local hash computation for RSS hash on the interface.
+.It Cm flowid_shift Ar number
+Set a shift parameter for RSS local hash computation.
+Hash is calculated by using flowid bits in a packet header mbuf
+which are shifted by the number of this parameter.
.El
.Pp
The following parameters are specific to IP tunnel interfaces,
diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c
index 29b8574..9c478b3 100644
--- a/sbin/ifconfig/iflagg.c
+++ b/sbin/ifconfig/iflagg.c
@@ -68,7 +68,7 @@ setlaggproto(const char *val, int d, int s, const struct afswtch *afp)
bzero(&ra, sizeof(ra));
ra.ra_proto = LAGG_PROTO_MAX;
- for (i = 0; i < (sizeof(lpr) / sizeof(lpr[0])); i++) {
+ for (i = 0; i < nitems(lpr); i++) {
if (strcmp(val, lpr[i].lpr_name) == 0) {
ra.ra_proto = lpr[i].lpr_proto;
break;
@@ -83,6 +83,48 @@ setlaggproto(const char *val, int d, int s, const struct afswtch *afp)
}
static void
+setlaggflowidshift(const char *val, int d, int s, const struct afswtch *afp)
+{
+ struct lagg_reqopts ro;
+
+ bzero(&ro, sizeof(ro));
+ ro.ro_opts = LAGG_OPT_FLOWIDSHIFT;
+ strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname));
+ ro.ro_flowid_shift = (int)strtol(val, NULL, 10);
+ if (ro.ro_flowid_shift & ~LAGG_OPT_FLOWIDSHIFT_MASK)
+ errx(1, "Invalid flowid_shift option: %s", val);
+
+ if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0)
+ err(1, "SIOCSLAGGOPTS");
+}
+
+static void
+setlaggsetopt(const char *val, int d, int s, const struct afswtch *afp)
+{
+ struct lagg_reqopts ro;
+
+ bzero(&ro, sizeof(ro));
+ ro.ro_opts = d;
+ switch (ro.ro_opts) {
+ case LAGG_OPT_USE_FLOWID:
+ case -LAGG_OPT_USE_FLOWID:
+ case LAGG_OPT_LACP_STRICT:
+ case -LAGG_OPT_LACP_STRICT:
+ case LAGG_OPT_LACP_TXTEST:
+ case -LAGG_OPT_LACP_TXTEST:
+ case LAGG_OPT_LACP_RXTEST:
+ case -LAGG_OPT_LACP_RXTEST:
+ break;
+ default:
+ err(1, "Invalid lagg option");
+ }
+ strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname));
+
+ if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0)
+ err(1, "SIOCSLAGGOPTS");
+}
+
+static void
setlagghash(const char *val, int d, int s, const struct afswtch *afp)
{
struct lagg_reqflags rf;
@@ -144,6 +186,7 @@ lagg_status(int s)
struct lagg_protos lpr[] = LAGG_PROTOS;
struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS];
struct lagg_reqall ra;
+ struct lagg_reqopts ro;
struct lagg_reqflags rf;
struct lacp_opreq *lp;
const char *proto = "<unknown>";
@@ -151,6 +194,7 @@ lagg_status(int s)
bzero(&rp, sizeof(rp));
bzero(&ra, sizeof(ra));
+ bzero(&ro, sizeof(ro));
strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname));
strlcpy(rp.rp_portname, name, sizeof(rp.rp_portname));
@@ -162,6 +206,9 @@ lagg_status(int s)
ra.ra_size = sizeof(rpbuf);
ra.ra_port = rpbuf;
+ strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname));
+ ioctl(s, SIOCGLAGGOPTS, &ro);
+
strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname));
if (ioctl(s, SIOCGLAGGFLAGS, &rf) != 0)
rf.rf_flags = 0;
@@ -169,7 +216,7 @@ lagg_status(int s)
if (ioctl(s, SIOCGLAGG, &ra) == 0) {
lp = (struct lacp_opreq *)&ra.ra_lacpreq;
- for (i = 0; i < (sizeof(lpr) / sizeof(lpr[0])); i++) {
+ for (i = 0; i < nitems(lpr); i++) {
if (ra.ra_proto == lpr[i].lpr_proto) {
proto = lpr[i].lpr_name;
break;
@@ -197,9 +244,28 @@ lagg_status(int s)
if (isport)
printf(" laggdev %s", rp.rp_ifname);
putchar('\n');
- if (verbose && ra.ra_proto == LAGG_PROTO_LACP)
- printf("\tlag id: %s\n",
- lacp_format_peer(lp, "\n\t\t "));
+ if (verbose) {
+ printf("\tlagg options:\n");
+ printf("\t\tuse_flowid: %d\n",
+ (ro.ro_opts & LAGG_OPT_USE_FLOWID) ? 1 : 0);
+ printf("\t\tflowid_shift: %d\n", ro.ro_flowid_shift);
+ switch (ra.ra_proto) {
+ case LAGG_PROTO_LACP:
+ printf("\t\tlacp_strict: %d\n",
+ (ro.ro_opts & LAGG_OPT_LACP_STRICT) ? 1 : 0);
+ printf("\t\tlacp_rxtest: %d\n",
+ (ro.ro_opts & LAGG_OPT_LACP_RXTEST) ? 1 : 0);
+ printf("\t\tlacp_txtest: %d\n",
+ (ro.ro_opts & LAGG_OPT_LACP_TXTEST) ? 1 : 0);
+ }
+ printf("\tlagg statistics:\n");
+ printf("\t\tactive ports: %d\n", ro.ro_active);
+ printf("\t\tflapping: %u\n", ro.ro_flapping);
+ if (ra.ra_proto == LAGG_PROTO_LACP) {
+ printf("\tlag id: %s\n",
+ lacp_format_peer(lp, "\n\t\t "));
+ }
+ }
for (i = 0; i < ra.ra_ports; i++) {
lp = (struct lacp_opreq *)&rpbuf[i].rp_lacpreq;
@@ -226,6 +292,15 @@ static struct cmd lagg_cmds[] = {
DEF_CMD_ARG("-laggport", unsetlaggport),
DEF_CMD_ARG("laggproto", setlaggproto),
DEF_CMD_ARG("lagghash", setlagghash),
+ DEF_CMD("use_flowid", LAGG_OPT_USE_FLOWID, setlaggsetopt),
+ DEF_CMD("-use_flowid", -LAGG_OPT_USE_FLOWID, setlaggsetopt),
+ DEF_CMD("lacp_strict", LAGG_OPT_LACP_STRICT, setlaggsetopt),
+ DEF_CMD("-lacp_strict", -LAGG_OPT_LACP_STRICT, setlaggsetopt),
+ DEF_CMD("lacp_txtest", LAGG_OPT_LACP_TXTEST, setlaggsetopt),
+ DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt),
+ DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt),
+ DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt),
+ DEF_CMD_ARG("flowid_shift", setlaggflowidshift),
};
static struct afswtch af_lagg = {
.af_name = "af_lagg",
diff --git a/share/man/man4/icmp.4 b/share/man/man4/icmp.4
index 6b7f78e..c0f51b3 100644
--- a/share/man/man4/icmp.4
+++ b/share/man/man4/icmp.4
@@ -28,7 +28,7 @@
.\" @(#)icmp.4 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd February 9, 2007
+.Dd September 30, 2014
.Dt ICMP 4
.Os
.Sh NAME
@@ -216,6 +216,10 @@ instead of the possibly different return path.
Number of bytes from original packet to quote in ICMP reply.
This number is internally enforced to be at least 8 bytes (per RFC792)
and at most the maximal space left in the ICMP reply mbuf.
+.It Va tstamprepl
+.Pq Vt boolean
+Enable/disable replies to ICMP Timestamp packets.
+Defaults to true.
.El
.Sh ERRORS
A socket operation may fail with one of the following errors returned:
diff --git a/share/man/man4/ipheth.4 b/share/man/man4/ipheth.4
index 4c21976..50491fb 100644
--- a/share/man/man4/ipheth.4
+++ b/share/man/man4/ipheth.4
@@ -27,12 +27,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 25, 2014
+.Dd September 30, 2014
.Dt IPHETH 4
.Os
.Sh NAME
.Nm ipheth
-.Nd "USB Apple iPhone/iPad Ethernet driver"
+.Nd "USB Apple iPhone/iPad tethered Ethernet driver"
.Sh SYNOPSIS
To load the driver as a module at boot time, place the
following line in
@@ -61,6 +61,7 @@ In most cases this must be explicitly enabled on the device first.
.Pp
For more information on configuring this device, see
.Xr ifconfig 8 .
+The device does not support different media types or options.
.Sh HARDWARE
The following devices are supported by the
.Nm
@@ -68,9 +69,9 @@ driver:
.Pp
.Bl -bullet -compact
.It
-Apple iPhone (all models)
+Apple iPhone tethering (all models)
.It
-Apple iPad (all models)
+Apple iPad tethering (all models)
.El
.Sh SEE ALSO
.Xr arp 4 ,
@@ -80,6 +81,7 @@ Apple iPad (all models)
.Xr urndis 4 ,
.Xr usb 4 ,
.Xr ifconfig 8
+.Xr usbconfig 8
.Sh HISTORY
The
.Nm
@@ -91,3 +93,14 @@ The
.Nm
driver was written by
.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org .
+.Sh BUGS
+Some devices may need to be manually configured to use an alternative
+configuration with the
+.Xr usbconfig 8
+utility.
+A command similar to
+.Dl usbconfig -u 1 -a 2 set_config 3
+may be required if the device is not recognised automatically by
+.Nm
+after it is connected.
+
diff --git a/share/man/man4/lagg.4 b/share/man/man4/lagg.4
index 3ea9247..1b40315 100644
--- a/share/man/man4/lagg.4
+++ b/share/man/man4/lagg.4
@@ -16,7 +16,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 23, 2012
+.Dd October 1, 2014
.Dt LAGG 4
.Os
.Sh NAME
@@ -143,9 +143,9 @@ modes will use the RSS hash from the network card if available to avoid
computing one, this may give poor traffic distribution if the hash is invalid
or uses less of the protocol header information.
Local hash computation can be forced per interface by setting the
-.Va net.link.lagg.X.use_flowid
-.Xr sysctl 8
-variable to zero where X is the interface number.
+.Cm use_flowid
+.Xr ifconfig 8
+flag.
The default for new interfaces is set via the
.Va net.link.lagg.default_use_flowid
.Xr sysctl 8 .
diff --git a/share/man/man4/sfxge.4 b/share/man/man4/sfxge.4
index 5e4935d..7930fcf 100644
--- a/share/man/man4/sfxge.4
+++ b/share/man/man4/sfxge.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 8, 2012
+.Dd September 30, 2014
.Dt SFXGE 4
.Os
.Sh NAME
@@ -76,6 +76,39 @@ The
.Nm
driver supports all 10Gb Ethernet adapters based on Solarflare SFC9000
family controllers.
+.Sh LOADER TUNABLES
+Tunables can be set at the
+.Xr loader 8
+prompt before booting the kernel or stored in
+.Xr loader.conf 5 .
+Actual values can be obtained using
+.Xr sysctl 8 .
+.Bl -tag -width indent
+.It Va hw.sfxge.rx_ring
+The maximum number of descriptors in a receive queue ring.
+Supported values are: 512, 1024, 2048 and 4096.
+.It Va hw.sfxge.tx_ring
+The maximum number of descriptors in a transmit queue ring.
+Supported values are: 512, 1024, 2048 and 4096.
+.It Va hw.sfxge.tx_dpl_get_max
+The maximum length of the deferred packet
+.Dq get-list
+for queued transmit
+packets, used only if the transmit queue lock can be acquired.
+If a packet is dropped, the
+.Va tx_early_drops
+counter is incremented and the local sender receives ENOBUFS.
+The value must be greater than 0.
+.It Va hw.sfxge.tx_dpl_put_max
+The maximum length of the deferred packet
+.Dq put-list
+for queued transmit
+packets, used if the transmit queue lock cannot be acquired.
+If a packet is dropped, the
+.Va tx_early_drops
+counter is incremented and the local sender receives ENOBUFS.
+The value must be greater than or equal to 0.
+.El
.Sh SUPPORT
For general information and support,
go to the Solarflare support website at:
diff --git a/share/man/man4/ucom.4 b/share/man/man4/ucom.4
index 9be0294..a13d4d9 100644
--- a/share/man/man4/ucom.4
+++ b/share/man/man4/ucom.4
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 1, 2008
+.Dd October 3, 2014
.Dt UCOM 4
.Os
.Sh NAME
@@ -81,8 +81,10 @@ multiple external ports.
.Xr umcs 4 ,
.Xr umct 4 ,
.Xr umodem 4 ,
+.Xr umoscom 4 ,
.Xr uplcom 4 ,
.Xr usb 4 ,
+.Xr uslcom 4 ,
.Xr uvisor 4 ,
.Xr uvscom 4
.Sh HISTORY
diff --git a/share/man/man4/udplite.4 b/share/man/man4/udplite.4
index 5d06b14..859c966 100644
--- a/share/man/man4/udplite.4
+++ b/share/man/man4/udplite.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 7, 2014
+.Dd October 1, 2014
.Dt UDPLITE 4
.Os
.Sh NAME
@@ -55,16 +55,16 @@ and tested with
.Bl -tag -width ".Dv UDPLITE_SEND_CSCOV"
.It Dv UDPLITE_SEND_CSCOV
This option sets the sender checksum coverage.
-A value of zero indicates that the entire packet
-is covered by the checksum.
-A value of 1 to 7 must be discarded by the receiver.
+A value of zero indicates that all sent packets will have
+full checksum coverage.
+A value of 8 to 65535 limits the checksum coverage of all sent packets
+to the value given.
.It Dv UDPLITE_RECV_CSCOV
This option is the receiver-side analogue.
-It is truly optional, i.e. not required to enable traffic
-with partial checksum coverage.
-Its function is that of a traffic filter:
-when enabled, it instructs the kernel to drop
-all packets which have a coverage less than this value.
+A value of zero instructs the kernel to drop all received packets
+not having full checksum coverage.
+A value of 8 to 65535 instructs the kernel to drop all received
+packets with a partial checksum coverage smaller than the value specified.
.El
.Sh ERRORS
A socket operation may fail with one of the following errors returned:
diff --git a/share/man/man4/urndis.4 b/share/man/man4/urndis.4
index 33acec5..ee367b7 100644
--- a/share/man/man4/urndis.4
+++ b/share/man/man4/urndis.4
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 25, 2014
+.Dd October 2, 2014
.Dt URNDIS 4
.Os
.Sh NAME
@@ -68,6 +68,12 @@ such as those commonly found on Android devices.
It does not support different media types or options.
For more information on configuring this device, see
.Xr ifconfig 8 .
+.Sh HARDWARE
+The
+.Nm
+driver supports the
+.Qq tethering
+functionality of many Android devices.
.Sh SEE ALSO
.Xr arp 4 ,
.Xr cdce 4 ,
diff --git a/share/man/man4/urtwn.4 b/share/man/man4/urtwn.4
index d63d00c..de4ef6d 100644
--- a/share/man/man4/urtwn.4
+++ b/share/man/man4/urtwn.4
@@ -19,7 +19,7 @@
.Os
.Sh NAME
.Nm urtwn
-.Nd Realtek RTL8188CU/RTL8188EU/RTL8192CU USB IEEE 802.11b/g/n wireless network device
+.Nd Realtek RTL8188CU/RTL8188RU/RTL8188EU/RTL8192CU USB IEEE 802.11b/g/n wireless network device
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
@@ -82,10 +82,11 @@ firmware license
.Sh HARDWARE
The
.Nm
-driver supports Realtek RTL8188CU/RTL8188EU/RTL8192CU based USB
+driver supports Realtek RTL8188CU/RTL8188RU/RTL8188EU/RTL8192CU based USB
IEEE 802.11b/g/n wireless network adapters, including:
.Pp
.Bl -tag -width Ds -offset indent -compact
+.It Alfa AWUS036NHR v2
.It ASUS USB-N10 NANO
.It Belkin F7D1102 Surf Wireless Micro
.It D-Link DWA-125 rev D1
diff --git a/share/man/man7/release.7 b/share/man/man7/release.7
index 8fc75f3..93aec89 100644
--- a/share/man/man7/release.7
+++ b/share/man/man7/release.7
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 11, 2014
+.Dd October 2, 2014
.Dt RELEASE 7
.Os
.Sh NAME
@@ -351,6 +351,61 @@ Set to the target directory within
to check out
.Va ${UBOOTSRC}/${UBOOTBRANCH} .
.El
+.Sh VIRTUAL MACHINE DISK IMAGES
+The following
+.Fa release.conf
+variables are relevant only to virtual machine disk image builds:
+.Bl -tag -width Ev
+.It Va WITH_VMIMAGES
+Set to a non-null value to build virtual machine disk images as part
+of the release build.
+.Va WITH_VMIMAGES
+may also be specified as an envirionment variable passed to
+.Xr make 1 .
+.Pp
+The option requires
+.Xr mkimg 1
+version 20140927 or later.
+.It Va WITH_COMPRESSED_VMIMAGES
+Set to a non-null value to compress the virtual machine disk images with
+.Xr xz 1
+as part of the
+.Cm install
+.Xr make 1
+target.
+Note that compressing virtual machine disk images may take a very long
+time on some systems.
+.It Va VMBASE
+Set to change the name of the resulting virtual machine disk image file.
+The default value is
+.Va vm .
+.It Va VMSIZE
+Set to change the size of the virtual machine disk capacity.
+The default value is
+.Va 20G .
+See
+.Xr truncate 1
+for valid values.
+.Pp
+Virtual machine disk images are, by default, created as sparse images.
+When
+.Va WITH_COMPRESSED_VMIMAGES
+is used, the resulting files compressed with
+.Xr xz 1
+compress to roughly the same size, regardless of the specified disk image
+size.
+.It Va VMFORMATS
+Set to the target virtual disk image format(s) to create.
+By default, the
+.Va vhdf , Va vmdk , Va qcow2 ,
+and
+.Va raw
+formats are created.
+See
+.Xr mkimg 1
+for valid format values
+.Pq requires version 20140927 or later .
+.El
.Sh MAKEFILE TARGETS
The release makefile
.Pq Pa src/release/Makefile
@@ -407,6 +462,14 @@ Creates a directory named
.Pa ftp
containing the distribution files used in network installations
and suitable for upload to an FTP mirror.
+.It Cm vm-image
+Creates virtual machine disk images in various formats.
+The
+.Cm vm-image
+target requires the
+.Va WITH_VMIMAGES
+.Xr make 1
+envirionment variable to be set to a non-null value.
.El
.Pp
Major subtargets called by targets above:
diff --git a/share/man/man9/sleepqueue.9 b/share/man/man9/sleepqueue.9
index f09f209..7f6269b 100644
--- a/share/man/man9/sleepqueue.9
+++ b/share/man/man9/sleepqueue.9
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 19, 2013
+.Dd September 22, 2014
.Dt SLEEPQUEUE 9
.Os
.Sh NAME
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 5ce2fa4..afc8ecb 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -123,8 +123,8 @@ ${_YC:R}.o: ${_YC}
# DTrace probe definitions
# libelf is currently needed for drti.o
.if ${SRCS:M*.d}
-LDFLAGS+= -lelf
-LDADD+= ${LIBELF}
+LDADD+= -lelf
+DPADD+= ${LIBELF}
CFLAGS+= -I${.OBJDIR}
.endif
.for _DSRC in ${SRCS:M*.d:N*/*}
diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk
index 565d1aa..c82c37f 100644
--- a/share/mk/bsd.endian.mk
+++ b/share/mk/bsd.endian.mk
@@ -2,16 +2,13 @@
.if ${MACHINE_ARCH} == "amd64" || \
${MACHINE_ARCH} == "i386" || \
- ${MACHINE_ARCH} == "arm" || \
- ${MACHINE_ARCH} == "armv6" || \
- ${MACHINE_ARCH} == "armv6hf" || \
+ (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} == "") || \
${MACHINE_ARCH:Mmips*el} != ""
TARGET_ENDIANNESS= 1234
.elif ${MACHINE_ARCH} == "powerpc" || \
${MACHINE_ARCH} == "powerpc64" || \
${MACHINE_ARCH} == "sparc64" || \
- ${MACHINE_ARCH} == "armeb" || \
- ${MACHINE_ARCH} == "armv6eb" || \
+ (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} != "") || \
${MACHINE_ARCH:Mmips*} != ""
TARGET_ENDIANNESS= 4321
.endif
diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk
index 87e4935..4f73d12 100644
--- a/share/mk/bsd.port.mk
+++ b/share/mk/bsd.port.mk
@@ -1,6 +1,18 @@
# $FreeBSD$
-PORTSDIR?= /usr/ports
+.if !defined(PORTSDIR)
+# Autodetect if the command is being run in a ports tree that's not rooted
+# in the default /usr/ports. The ../../.. case is in case ports ever grows
+# a third level.
+.for RELPATH in . .. ../.. ../../..
+.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk)
+_PORTSDIR= ${.CURDIR}/${RELPATH}
+.endif
+.endfor
+_PORTSDIR?= /usr/ports
+PORTSDIR!= realpath ${_PORTSDIR}
+.endif
+
BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk
# Needed to keep bsd.own.mk from reading in /etc/src.conf
diff --git a/share/mk/bsd.port.subdir.mk b/share/mk/bsd.port.subdir.mk
index 5115602..8e608a1 100644
--- a/share/mk/bsd.port.subdir.mk
+++ b/share/mk/bsd.port.subdir.mk
@@ -1,6 +1,18 @@
# $FreeBSD$
-PORTSDIR?= /usr/ports
+.if !defined(PORTSDIR)
+# Autodetect if the command is being run in a ports tree that's not rooted
+# in the default /usr/ports. The ../../.. case is in case ports ever grows
+# a third level.
+.for RELPATH in . .. ../.. ../../..
+.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk)
+_PORTSDIR= ${.CURDIR}/${RELPATH}
+.endif
+.endfor
+_PORTSDIR?= /usr/ports
+PORTSDIR!= realpath ${_PORTSDIR}
+.endif
+
BSDPORTSUBDIRMK?= ${PORTSDIR}/Mk/bsd.port.subdir.mk
.include "${BSDPORTSUBDIRMK}"
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index e6202b2..a852d3d 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -48,7 +48,6 @@ __DEFAULT_YES_OPTIONS = \
ACPI \
AMD \
APM \
- ARM_EABI \
AT \
ATM \
AUDIT \
@@ -194,7 +193,7 @@ __TT=${MACHINE}
# Clang is only for x86, powerpc and little-endian arm right now, by default.
.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
-.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf"
+.elif ${__TT} == "arm" && ${__T:Marm*eb*} == ""
__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP
# GCC is unable to build the full clang on arm, disable it by default.
__DEFAULT_NO_OPTIONS+=CLANG_FULL
@@ -202,8 +201,8 @@ __DEFAULT_NO_OPTIONS+=CLANG_FULL
__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
.endif
# Clang the default system compiler only on little-endian arm and x86.
-.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
- ${__T} == "armv6hf" || ${__T} == "i386"
+.if ${__T} == "amd64" || (${__TT} == "arm" && ${__T:Marm*eb*} == "") || \
+ ${__T} == "i386"
__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX
.else
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 278409d..ab82771 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -177,6 +177,7 @@ struct init_ops init_ops = {
.mp_bootaddress = mp_bootaddress,
.start_all_aps = native_start_all_aps,
#endif
+ .msi_init = msi_init,
};
/*
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 95adf12..748be15b 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -94,23 +94,18 @@ __FBSDID("$FreeBSD$");
#define PROCBASED_CTLS2_ONE_SETTING PROCBASED2_ENABLE_EPT
#define PROCBASED_CTLS2_ZERO_SETTING 0
-#define VM_EXIT_CTLS_ONE_SETTING_NO_PAT \
+#define VM_EXIT_CTLS_ONE_SETTING \
(VM_EXIT_HOST_LMA | \
VM_EXIT_SAVE_EFER | \
- VM_EXIT_LOAD_EFER)
-
-#define VM_EXIT_CTLS_ONE_SETTING \
- (VM_EXIT_CTLS_ONE_SETTING_NO_PAT | \
+ VM_EXIT_LOAD_EFER | \
VM_EXIT_ACKNOWLEDGE_INTERRUPT | \
VM_EXIT_SAVE_PAT | \
VM_EXIT_LOAD_PAT)
+
#define VM_EXIT_CTLS_ZERO_SETTING VM_EXIT_SAVE_DEBUG_CONTROLS
-#define VM_ENTRY_CTLS_ONE_SETTING_NO_PAT VM_ENTRY_LOAD_EFER
+#define VM_ENTRY_CTLS_ONE_SETTING (VM_ENTRY_LOAD_EFER | VM_ENTRY_LOAD_PAT)
-#define VM_ENTRY_CTLS_ONE_SETTING \
- (VM_ENTRY_CTLS_ONE_SETTING_NO_PAT | \
- VM_ENTRY_LOAD_PAT)
#define VM_ENTRY_CTLS_ZERO_SETTING \
(VM_ENTRY_LOAD_DEBUG_CONTROLS | \
VM_ENTRY_INTO_SMM | \
@@ -152,10 +147,6 @@ SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, initialized, CTLFLAG_RD,
*/
static SYSCTL_NODE(_hw_vmm_vmx, OID_AUTO, cap, CTLFLAG_RW, NULL, NULL);
-static int vmx_patmsr;
-SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, patmsr, CTLFLAG_RD, &vmx_patmsr, 0,
- "PAT MSR saved and restored in VCMS");
-
static int cap_halt_exit;
SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, halt_exit, CTLFLAG_RD, &cap_halt_exit, 0,
"HLT triggers a VM-exit");
@@ -615,48 +606,24 @@ vmx_init(int ipinum)
}
/* Check support for VM-exit controls */
- vmx_patmsr = 1;
error = vmx_set_ctlreg(MSR_VMX_EXIT_CTLS, MSR_VMX_TRUE_EXIT_CTLS,
VM_EXIT_CTLS_ONE_SETTING,
VM_EXIT_CTLS_ZERO_SETTING,
&exit_ctls);
if (error) {
- /* Try again without the PAT MSR bits */
- error = vmx_set_ctlreg(MSR_VMX_EXIT_CTLS,
- MSR_VMX_TRUE_EXIT_CTLS,
- VM_EXIT_CTLS_ONE_SETTING_NO_PAT,
- VM_EXIT_CTLS_ZERO_SETTING,
- &exit_ctls);
- if (error) {
- printf("vmx_init: processor does not support desired "
- "exit controls\n");
- return (error);
- } else {
- if (bootverbose)
- printf("vmm: PAT MSR access not supported\n");
- vmx_patmsr = 0;
- }
+ printf("vmx_init: processor does not support desired "
+ "exit controls\n");
+ return (error);
}
/* Check support for VM-entry controls */
- if (vmx_patmsr) {
- error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS,
- MSR_VMX_TRUE_ENTRY_CTLS,
- VM_ENTRY_CTLS_ONE_SETTING,
- VM_ENTRY_CTLS_ZERO_SETTING,
- &entry_ctls);
- } else {
- error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS,
- MSR_VMX_TRUE_ENTRY_CTLS,
- VM_ENTRY_CTLS_ONE_SETTING_NO_PAT,
- VM_ENTRY_CTLS_ZERO_SETTING,
- &entry_ctls);
- }
-
+ error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS, MSR_VMX_TRUE_ENTRY_CTLS,
+ VM_ENTRY_CTLS_ONE_SETTING, VM_ENTRY_CTLS_ZERO_SETTING,
+ &entry_ctls);
if (error) {
printf("vmx_init: processor does not support desired "
- "entry controls\n");
- return (error);
+ "entry controls\n");
+ return (error);
}
/*
@@ -889,6 +856,10 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
* VM exit and entry respectively. It is also restored from the
* host VMCS area on a VM exit.
*
+ * MSR_PAT is saved and restored in the guest VMCS are on a VM exit
+ * and entry respectively. It is also restored from the host VMCS
+ * area on a VM exit.
+ *
* The TSC MSR is exposed read-only. Writes are disallowed as that
* will impact the host TSC.
* XXX Writes would be implemented with a wrmsr trap, and
@@ -900,19 +871,10 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) ||
guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) ||
guest_msr_rw(vmx, MSR_EFER) ||
+ guest_msr_rw(vmx, MSR_PAT) ||
guest_msr_ro(vmx, MSR_TSC))
panic("vmx_vminit: error setting guest msr access");
- /*
- * MSR_PAT is saved and restored in the guest VMCS are on a VM exit
- * and entry respectively. It is also restored from the host VMCS
- * area on a VM exit. However, if running on a system with no
- * MSR_PAT save/restore support, leave access disabled so accesses
- * will be trapped.
- */
- if (vmx_patmsr && guest_msr_rw(vmx, MSR_PAT))
- panic("vmx_vminit: error setting guest pat msr access");
-
vpid_alloc(vpid, VM_MAXCPU);
if (virtual_interrupt_delivery) {
diff --git a/sys/amd64/vmm/io/vatpic.c b/sys/amd64/vmm/io/vatpic.c
index d8ccebd..b710a84 100644
--- a/sys/amd64/vmm/io/vatpic.c
+++ b/sys/amd64/vmm/io/vatpic.c
@@ -606,20 +606,19 @@ vatpic_write(struct vatpic *vatpic, struct atpic *atpic, bool in, int port,
VATPIC_LOCK(vatpic);
if (port & ICU_IMR_OFFSET) {
- if (atpic->ready) {
+ switch (atpic->icw_num) {
+ case 2:
+ error = vatpic_icw2(vatpic, atpic, val);
+ break;
+ case 3:
+ error = vatpic_icw3(vatpic, atpic, val);
+ break;
+ case 4:
+ error = vatpic_icw4(vatpic, atpic, val);
+ break;
+ default:
error = vatpic_ocw1(vatpic, atpic, val);
- } else {
- switch (atpic->icw_num) {
- case 2:
- error = vatpic_icw2(vatpic, atpic, val);
- break;
- case 3:
- error = vatpic_icw3(vatpic, atpic, val);
- break;
- case 4:
- error = vatpic_icw4(vatpic, atpic, val);
- break;
- }
+ break;
}
} else {
if (val & (1 << 4))
diff --git a/sys/arm/allwinner/timer.c b/sys/arm/allwinner/timer.c
index 5ab6d9d..a04fafa 100644
--- a/sys/arm/allwinner/timer.c
+++ b/sys/arm/allwinner/timer.c
@@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$");
#define TIMER_ENABLE (1<<0)
#define TIMER_AUTORELOAD (1<<1)
#define TIMER_OSC24M (1<<2) /* oscillator = 24mhz */
-#define TIMER_PRESCALAR (4<<4) /* prescalar = 16 */
+#define TIMER_PRESCALAR (0<<4) /* prescalar = 1 */
#define SYS_TIMER_CLKSRC 24000000 /* clock source */
diff --git a/sys/arm/arm/cpufunc_asm_armv7.S b/sys/arm/arm/cpufunc_asm_armv7.S
index 93896d2..9fe6aa5 100644
--- a/sys/arm/arm/cpufunc_asm_armv7.S
+++ b/sys/arm/arm/cpufunc_asm_armv7.S
@@ -33,6 +33,8 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+#include <machine/sysreg.h>
+
.cpu cortex-a8
.Lcoherency_level:
@@ -70,12 +72,12 @@ ENTRY(armv7_setttb)
dsb
orr r0, r0, #PT_ATTR
- mcr p15, 0, r0, c2, c0, 0 /* Translation Table Base Register 0 (TTBR0) */
+ mcr CP15_TTBR0(r0)
isb
#ifdef SMP
- mcr p15, 0, r0, c8, c3, 0 /* invalidate I+D TLBs Inner Shareable*/
+ mcr CP15_TLBIALLIS
#else
- mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
+ mcr CP15_TLBIALL
#endif
dsb
isb
@@ -85,11 +87,11 @@ END(armv7_setttb)
ENTRY(armv7_tlb_flushID)
dsb
#ifdef SMP
- mcr p15, 0, r0, c8, c3, 0 /* flush Unified TLB all entries Inner Shareable */
- mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */
+ mcr CP15_TLBIALLIS
+ mcr CP15_BPIALLIS
#else
- mcr p15, 0, r0, c8, c7, 0 /* flush Unified TLB all entries */
- mcr p15, 0, r0, c7, c5, 6 /* flush BTB */
+ mcr CP15_TLBIALL
+ mcr CP15_BPIALL
#endif
dsb
isb
@@ -100,11 +102,11 @@ ENTRY(armv7_tlb_flushID_SE)
ldr r1, .Lpage_mask
bic r0, r0, r1
#ifdef SMP
- mcr p15, 0, r0, c8, c3, 3 /* flush Unified TLB single entry Inner Shareable */
- mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */
+ mcr CP15_TLBIMVAAIS(r0)
+ mcr CP15_BPIALLIS
#else
- mcr p15, 0, r0, c8, c7, 1 /* flush Unified TLB single entry */
- mcr p15, 0, r0, c7, c5, 6 /* flush BTB */
+ mcr CP15_TLBIMVA(r0)
+ mcr CP15_BPIALL
#endif
dsb
isb
@@ -149,7 +151,7 @@ Loop3:
orr r6, r6, r7, lsl r2
/* Clean and invalidate data cache by way/index */
- mcr p15, 0, r6, c7, c14, 2
+ mcr CP15_DCCISW(r6)
subs r9, r9, #1
bge Loop3
subs r7, r7, #1
@@ -168,9 +170,9 @@ ENTRY(armv7_idcache_wbinv_all)
stmdb sp!, {lr}
bl armv7_dcache_wbinv_all
#ifdef SMP
- mcr p15, 0, r0, c7, c1, 0 /* Invalidate all I caches to PoU (ICIALLUIS) */
+ mcr CP15_ICIALLUIS
#else
- mcr p15, 0, r0, c7, c5, 0 /* Invalidate all I caches to PoU (ICIALLU) */
+ mcr CP15_ICIALLU
#endif
dsb
isb
@@ -191,7 +193,7 @@ ENTRY(armv7_dcache_wb_range)
add r1, r1, r2
bic r0, r0, r3
.Larmv7_wb_next:
- mcr p15, 0, r0, c7, c10, 1 /* Clean D cache SE with VA */
+ mcr CP15_DCCMVAC(r0)
add r0, r0, ip
subs r1, r1, ip
bhi .Larmv7_wb_next
@@ -206,7 +208,7 @@ ENTRY(armv7_dcache_wbinv_range)
add r1, r1, r2
bic r0, r0, r3
.Larmv7_wbinv_next:
- mcr p15, 0, r0, c7, c14, 1 /* Purge D cache SE with VA */
+ mcr CP15_DCCIMVAC(r0)
add r0, r0, ip
subs r1, r1, ip
bhi .Larmv7_wbinv_next
@@ -225,7 +227,7 @@ ENTRY(armv7_dcache_inv_range)
add r1, r1, r2
bic r0, r0, r3
.Larmv7_inv_next:
- mcr p15, 0, r0, c7, c6, 1 /* Invalidate D cache SE with VA */
+ mcr CP15_DCIMVAC(r0)
add r0, r0, ip
subs r1, r1, ip
bhi .Larmv7_inv_next
@@ -240,8 +242,8 @@ ENTRY(armv7_idcache_wbinv_range)
add r1, r1, r2
bic r0, r0, r3
.Larmv7_id_wbinv_next:
- mcr p15, 0, r0, c7, c5, 1 /* Invalidate I cache SE with VA */
- mcr p15, 0, r0, c7, c14, 1 /* Purge D cache SE with VA */
+ mcr CP15_ICIMVAU(r0)
+ mcr CP15_DCCIMVAC(r0)
add r0, r0, ip
subs r1, r1, ip
bhi .Larmv7_id_wbinv_next
@@ -252,9 +254,9 @@ END(armv7_idcache_wbinv_range)
ENTRY_NP(armv7_icache_sync_all)
#ifdef SMP
- mcr p15, 0, r0, c7, c1, 0 /* Invalidate all I cache to PoU Inner Shareable */
+ mcr CP15_ICIALLUIS
#else
- mcr p15, 0, r0, c7, c5, 0 /* Invalidate all I cache to PoU (ICIALLU) */
+ mcr CP15_ICIALLU
#endif
isb /* instruction synchronization barrier */
dsb /* data synchronization barrier */
@@ -264,8 +266,8 @@ END(armv7_icache_sync_all)
ENTRY_NP(armv7_icache_sync_range)
ldr ip, .Larmv7_line_size
.Larmv7_sync_next:
- mcr p15, 0, r0, c7, c5, 1 /* Invalidate I cache SE with VA */
- mcr p15, 0, r0, c7, c10, 1 /* Clean D cache SE with VA */
+ mcr CP15_ICIMVAU(r0)
+ mcr CP15_DCCMVAC(r0)
add r0, r0, ip
subs r1, r1, ip
bhi .Larmv7_sync_next
@@ -283,13 +285,13 @@ END(armv7_cpu_sleep)
ENTRY(armv7_context_switch)
dsb
orr r0, r0, #PT_ATTR
-
- mcr p15, 0, r0, c2, c0, 0 /* set the new TTB */
+
+ mcr CP15_TTBR0(r0)
isb
#ifdef SMP
- mcr p15, 0, r0, c8, c3, 0 /* and flush the I+D tlbs Inner Sharable */
+ mcr CP15_TLBIALLIS
#else
- mcr p15, 0, r0, c8, c7, 0 /* and flush the I+D tlbs */
+ mcr CP15_TLBIALL
#endif
dsb
isb
@@ -309,12 +311,12 @@ ENTRY(armv7_sev)
END(armv7_sev)
ENTRY(armv7_auxctrl)
- mrc p15, 0, r2, c1, c0, 1
+ mrc CP15_ACTLR(r2)
bic r3, r2, r0 /* Clear bits */
eor r3, r3, r1 /* XOR bits */
teq r2, r3
- mcrne p15, 0, r3, c1, c0, 1
+ mcrne CP15_ACTLR(r3)
mov r0, r2
RET
END(armv7_auxctrl)
@@ -325,8 +327,8 @@ END(armv7_auxctrl)
*/
ENTRY(armv7_idcache_inv_all)
mov r0, #0
- mcr p15, 2, r0, c0, c0, 0 @ set cache level to L1
- mrc p15, 1, r0, c0, c0, 0 @ read CCSIDR
+ mcr CP15_CSSELR(r0) @ set cache level to L1
+ mrc CP15_CCSIDR(r0)
ubfx r2, r0, #13, #15 @ get num sets - 1 from CCSIDR
ubfx r3, r0, #3, #10 @ get numways - 1 from CCSIDR
@@ -345,7 +347,7 @@ ENTRY(armv7_idcache_inv_all)
mov r2, ip @ r2 now contains set way decr
/* r3 = ways/sets, r2 = way decr, r1 = set decr, r0 and ip are free */
-1: mcr p15, 0, r3, c7, c6, 2 @ invalidate line
+1: mcr CP15_DCISW(r3) @ invalidate line
movs r0, r3 @ get current way/set
beq 2f @ at 0 means we are done.
movs r0, r0, lsl #10 @ clear way bits leaving only set bits
@@ -355,7 +357,7 @@ ENTRY(armv7_idcache_inv_all)
2: dsb @ wait for stores to finish
mov r0, #0 @ and ...
- mcr p15, 0, r0, c7, c5, 0 @ invalidate instruction+branch cache
+ mcr CP15_ICIALLU @ invalidate instruction+branch cache
isb @ instruction sync barrier
bx lr @ return
END(armv7_idcache_inv_all)
diff --git a/sys/arm/arm/physmem.c b/sys/arm/arm/physmem.c
index d42cac4..8618e46 100644
--- a/sys/arm/arm/physmem.c
+++ b/sys/arm/arm/physmem.c
@@ -168,6 +168,12 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags)
end = hwp->size + start;
realmem += arm32_btop(end - start);
for (exi = 0, exp = exregions; exi < excnt; ++exi, ++exp) {
+ /*
+ * If the excluded region does not match given flags,
+ * continue checking with the next excluded region.
+ */
+ if ((exp->flags & exflags) == 0)
+ continue;
xstart = exp->addr;
xend = exp->size + xstart;
/*
diff --git a/sys/arm/arm/syscall.c b/sys/arm/arm/syscall.c
new file mode 100644
index 0000000..94a028a
--- /dev/null
+++ b/sys/arm/arm/syscall.c
@@ -0,0 +1,196 @@
+/* $NetBSD: fault.c,v 1.45 2003/11/20 14:44:36 scw Exp $ */
+
+/*-
+ * Copyright 2004 Olivier Houchard
+ * Copyright 2003 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Steve C. Woodford for Wasabi Systems, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project by
+ * Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (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-1997 Mark Brinicombe.
+ * Copyright (c) 1994 Brini.
+ * All rights reserved.
+ *
+ * This code is derived from software written for Brini by Mark Brinicombe
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce 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 Brini.
+ * 4. The name of the company nor the name of the author may be used to
+ * endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * RiscBSD kernel project
+ *
+ * fault.c
+ *
+ * Fault handlers
+ *
+ * Created : 28/11/94
+ */
+
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/syscall.h>
+#include <sys/sysent.h>
+#include <sys/signalvar.h>
+#include <sys/ptrace.h>
+#include <sys/pioctl.h>
+
+#include <machine/frame.h>
+
+void swi_handler(struct trapframe *);
+
+static __inline void
+call_trapsignal(struct thread *td, int sig, u_long code)
+{
+ ksiginfo_t ksi;
+
+ ksiginfo_init_trap(&ksi);
+ ksi.ksi_signo = sig;
+ ksi.ksi_code = (int)code;
+ trapsignal(td, &ksi);
+}
+
+int
+cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
+{
+ struct proc *p;
+ register_t *ap;
+ int error;
+
+ sa->code = td->td_frame->tf_r7;
+ ap = &td->td_frame->tf_r0;
+ if (sa->code == SYS_syscall) {
+ sa->code = *ap++;
+ sa->nap--;
+ } else if (sa->code == SYS___syscall) {
+ sa->code = ap[_QUAD_LOWWORD];
+ sa->nap -= 2;
+ ap += 2;
+ }
+ p = td->td_proc;
+ if (p->p_sysent->sv_mask)
+ sa->code &= p->p_sysent->sv_mask;
+ if (sa->code >= p->p_sysent->sv_size)
+ sa->callp = &p->p_sysent->sv_table[0];
+ else
+ sa->callp = &p->p_sysent->sv_table[sa->code];
+ sa->narg = sa->callp->sy_narg;
+ error = 0;
+ memcpy(sa->args, ap, sa->nap * sizeof(register_t));
+ if (sa->narg > sa->nap) {
+ error = copyin((void *)td->td_frame->tf_usr_sp, sa->args +
+ sa->nap, (sa->narg - sa->nap) * sizeof(register_t));
+ }
+ if (error == 0) {
+ td->td_retval[0] = 0;
+ td->td_retval[1] = 0;
+ }
+ return (error);
+}
+
+#include "../../kern/subr_syscall.c"
+
+static void
+syscall(struct thread *td, struct trapframe *frame)
+{
+ struct syscall_args sa;
+ int error;
+
+ sa.nap = 4;
+
+ error = syscallenter(td, &sa);
+ KASSERT(error != 0 || td->td_ar == NULL,
+ ("returning from syscall with td_ar set!"));
+ syscallret(td, error, &sa);
+}
+
+void
+swi_handler(struct trapframe *frame)
+{
+ struct thread *td = curthread;
+
+ td->td_frame = frame;
+
+ td->td_pticks = 0;
+ /*
+ * Make sure the program counter is correctly aligned so we
+ * don't take an alignment fault trying to read the opcode.
+ * XXX: Fix for Thumb mode
+ */
+ if (__predict_false(((frame->tf_pc - INSN_SIZE) & 3) != 0)) {
+ call_trapsignal(td, SIGILL, 0);
+ userret(td, frame);
+ return;
+ }
+ /*
+ * Enable interrupts if they were enabled before the exception.
+ * Since all syscalls *should* come from user mode it will always
+ * be safe to enable them, but check anyway.
+ */
+ if (td->td_md.md_spinlock_count == 0) {
+ if (__predict_true(frame->tf_spsr & PSR_I) == 0)
+ enable_interrupts(PSR_I);
+ if (__predict_true(frame->tf_spsr & PSR_F) == 0)
+ enable_interrupts(PSR_F);
+ }
+
+ syscall(td, frame);
+}
diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c
index 7392cc7..ec14feb 100644
--- a/sys/arm/arm/trap.c
+++ b/sys/arm/arm/trap.c
@@ -79,28 +79,15 @@
*/
-#include "opt_ktrace.h"
-
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
-#include <sys/bus.h>
#include <sys/systm.h>
#include <sys/proc.h>
-#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
-#include <sys/syscall.h>
-#include <sys/sysent.h>
#include <sys/signalvar.h>
-#include <sys/ktr.h>
-#ifdef KTRACE
-#include <sys/uio.h>
-#include <sys/ktrace.h>
-#endif
-#include <sys/ptrace.h>
-#include <sys/pioctl.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -108,28 +95,16 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_map.h>
#include <vm/vm_extern.h>
-#include <machine/armreg.h>
-#include <machine/cpuconf.h>
-#include <machine/vmparam.h>
-#include <machine/frame.h>
#include <machine/cpu.h>
-#include <machine/intr.h>
+#include <machine/frame.h>
+#include <machine/machdep.h>
#include <machine/pcb.h>
-#include <machine/proc.h>
-#include <machine/swi.h>
-
-#include <security/audit/audit.h>
+#include <machine/vmparam.h>
#ifdef KDB
#include <sys/kdb.h>
#endif
-
-void swi_handler(struct trapframe *);
-
-#include <machine/disassem.h>
-#include <machine/machdep.h>
-
extern char fusubailout[];
#ifdef DEBUG
@@ -775,106 +750,4 @@ badaddr_read(void *addr, size_t size, void *rptr)
/* Return EFAULT if the address was invalid, else zero */
return (rv);
-}
-
-int
-cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
-{
- struct proc *p;
- register_t *ap;
- int error;
-
-#ifdef __ARM_EABI__
- sa->code = td->td_frame->tf_r7;
-#else
- sa->code = sa->insn & 0x000fffff;
-#endif
- ap = &td->td_frame->tf_r0;
- if (sa->code == SYS_syscall) {
- sa->code = *ap++;
- sa->nap--;
- } else if (sa->code == SYS___syscall) {
- sa->code = ap[_QUAD_LOWWORD];
- sa->nap -= 2;
- ap += 2;
- }
- p = td->td_proc;
- if (p->p_sysent->sv_mask)
- sa->code &= p->p_sysent->sv_mask;
- if (sa->code >= p->p_sysent->sv_size)
- sa->callp = &p->p_sysent->sv_table[0];
- else
- sa->callp = &p->p_sysent->sv_table[sa->code];
- sa->narg = sa->callp->sy_narg;
- error = 0;
- memcpy(sa->args, ap, sa->nap * sizeof(register_t));
- if (sa->narg > sa->nap) {
- error = copyin((void *)td->td_frame->tf_usr_sp, sa->args +
- sa->nap, (sa->narg - sa->nap) * sizeof(register_t));
- }
- if (error == 0) {
- td->td_retval[0] = 0;
- td->td_retval[1] = 0;
- }
- return (error);
-}
-
-#include "../../kern/subr_syscall.c"
-
-static void
-syscall(struct thread *td, struct trapframe *frame)
-{
- struct syscall_args sa;
- int error;
-
-#ifndef __ARM_EABI__
- sa.insn = *(uint32_t *)(frame->tf_pc - INSN_SIZE);
- switch (sa.insn & SWI_OS_MASK) {
- case 0: /* XXX: we need our own one. */
- break;
- default:
- call_trapsignal(td, SIGILL, 0);
- userret(td, frame);
- return;
- }
-#endif
- sa.nap = 4;
-
- error = syscallenter(td, &sa);
- KASSERT(error != 0 || td->td_ar == NULL,
- ("returning from syscall with td_ar set!"));
- syscallret(td, error, &sa);
-}
-
-void
-swi_handler(struct trapframe *frame)
-{
- struct thread *td = curthread;
-
- td->td_frame = frame;
-
- td->td_pticks = 0;
- /*
- * Make sure the program counter is correctly aligned so we
- * don't take an alignment fault trying to read the opcode.
- */
- if (__predict_false(((frame->tf_pc - INSN_SIZE) & 3) != 0)) {
- call_trapsignal(td, SIGILL, 0);
- userret(td, frame);
- return;
- }
- /*
- * Enable interrupts if they were enabled before the exception.
- * Since all syscalls *should* come from user mode it will always
- * be safe to enable them, but check anyway.
- */
- if (td->td_md.md_spinlock_count == 0) {
- if (__predict_true(frame->tf_spsr & PSR_I) == 0)
- enable_interrupts(PSR_I);
- if (__predict_true(frame->tf_spsr & PSR_F) == 0)
- enable_interrupts(PSR_F);
- }
-
- syscall(td, frame);
-}
-
+} \ No newline at end of file
diff --git a/sys/arm/at91/at91rm9200.c b/sys/arm/at91/at91rm9200.c
index 2cc0c9c..d350117 100644
--- a/sys/arm/at91/at91rm9200.c
+++ b/sys/arm/at91/at91rm9200.c
@@ -105,7 +105,7 @@ static const uint32_t at91_pio_base[] = {
static const struct cpu_devs at91_devs[] =
{
- DEVICE("at91_aic", AIC, 0),
+ DEVICE("at91_aic", AIC, 0),
DEVICE("at91_pmc", PMC, 0),
DEVICE("at91_st", ST, 0),
DEVICE("at91_pio", PIOA, 0),
@@ -128,7 +128,6 @@ static const struct cpu_devs at91_devs[] =
DEVICE("uart", USART1, 2),
DEVICE("uart", USART2, 3),
DEVICE("uart", USART3, 4),
- DEVICE("at91_aic", AIC, 0),
DEVICE("at91_mc", MC, 0),
DEVICE("at91_tc", TC0, 0),
DEVICE("at91_tc", TC1, 1),
diff --git a/sys/arm/at91/at91sam9g45reg.h b/sys/arm/at91/at91sam9g45reg.h
index c063748..0dc31be 100644
--- a/sys/arm/at91/at91sam9g45reg.h
+++ b/sys/arm/at91/at91sam9g45reg.h
@@ -168,8 +168,8 @@
#define AT91SAM9G45_IRQ_PIOA 2
#define AT91SAM9G45_IRQ_PIOB 3
#define AT91SAM9G45_IRQ_PIOC 4
-#define AT91SAM9G45_IRQ_PIOD 5
-#define AT91SAM9G45_IRQ_PIOE 6
+#define AT91SAM9G45_IRQ_PIODE 5
+#define AT91SAM9G45_IRQ_TRNG 6
#define AT91SAM9G45_IRQ_USART0 7
#define AT91SAM9G45_IRQ_USART1 8
#define AT91SAM9G45_IRQ_USART2 9
@@ -202,6 +202,8 @@
#define AT91SAM9G45_IRQ_WDT AT91SAM9G45_IRQ_SYSTEM
#define AT91SAM9G45_IRQ_PIT AT91SAM9G45_IRQ_SYSTEM
#define AT91SAM9G45_IRQ_RSTC AT91SAM9G45_IRQ_SYSTEM
+#define AT91SAM9G45_IRQ_PIOD AT91SAM9G45_IRQ_PIODE
+#define AT91SAM9G45_IRQ_PIOE AT91SAM9G45_IRQ_PIODE
#define AT91SAM9G45_IRQ_OHCI AT91SAM9G45_IRQ_UHP
#define AT91SAM9G45_IRQ_TC0 AT91SAM9G45_IRQ_TC0_TC5
#define AT91SAM9G45_IRQ_TC1 AT91SAM9G45_IRQ_TC0_TC5
@@ -225,9 +227,6 @@
#define AT91SAM9G45_SMC_BASE 0xfffe800
#define AT91SAM9G45_SMC_SIZE 0x200
-#define AT91SAM9G45_PMC_BASE 0xffffc00
-#define AT91SAM9G45_PMC_SIZE 0x100
-
#define AT91SAM9G45_HSMCI0_BASE 0xff80000
#define AT91SAM9G45_HSMCI0_SIZE 0x4000
diff --git a/sys/arm/include/sysreg.h b/sys/arm/include/sysreg.h
new file mode 100644
index 0000000..76b1f2b
--- /dev/null
+++ b/sys/arm/include/sysreg.h
@@ -0,0 +1,232 @@
+/*-
+ * Copyright 2014 Svatopluk Kraus <onwahe@gmail.com>
+ * Copyright 2014 Michal Meloun <meloun@miracle.cz>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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$
+ */
+
+/*
+ * Macros to make working with the System Control Registers simpler.
+ */
+
+#ifndef MACHINE_SYSREG_H
+#define MACHINE_SYSREG_H
+
+#include <machine/acle-compat.h>
+
+/*
+ * CP15 C0 registers
+ */
+#define CP15_MIDR(rr) p15, 0, rr, c0, c0, 0 /* Main ID Register */
+#define CP15_CTR(rr) p15, 0, rr, c0, c0, 1 /* Cache Type Register */
+#define CP15_TCMTR(rr) p15, 0, rr, c0, c0, 2 /* TCM Type Register */
+#define CP15_TLBTR(rr) p15, 0, rr, c0, c0, 3 /* TLB Type Register */
+#define CP15_MPIDR(rr) p15, 0, rr, c0, c0, 5 /* Multiprocessor Affinity Register */
+#define CP15_REVIDR(rr) p15, 0, rr, c0, c0, 6 /* Revision ID Register */
+
+#define CP15_ID_PFR0(rr) p15, 0, rr, c0, c1, 0 /* Processor Feature Register 0 */
+#define CP15_ID_PFR1(rr) p15, 0, rr, c0, c1, 1 /* Processor Feature Register 1 */
+#define CP15_ID_DFR0(rr) p15, 0, rr, c0, c1, 2 /* Debug Feature Register 0 */
+#define CP15_ID_AFR0(rr) p15, 0, rr, c0, c1, 3 /* Auxiliary Feature Register 0 */
+#define CP15_ID_MMFR0(rr) p15, 0, rr, c0, c1, 4 /* Memory Model Feature Register 0 */
+#define CP15_ID_MMFR1(rr) p15, 0, rr, c0, c1, 5 /* Memory Model Feature Register 1 */
+#define CP15_ID_MMFR2(rr) p15, 0, rr, c0, c1, 6 /* Memory Model Feature Register 2 */
+#define CP15_ID_MMFR3(rr) p15, 0, rr, c0, c1, 7 /* Memory Model Feature Register 3 */
+
+#define CP15_ID_ISAR0(rr) p15, 0, rr, c0, c2, 0 /* Instruction Set Attribute Register 0 */
+#define CP15_ID_ISAR1(rr) p15, 0, rr, c0, c2, 1 /* Instruction Set Attribute Register 1 */
+#define CP15_ID_ISAR2(rr) p15, 0, rr, c0, c2, 2 /* Instruction Set Attribute Register 2 */
+#define CP15_ID_ISAR3(rr) p15, 0, rr, c0, c2, 3 /* Instruction Set Attribute Register 3 */
+#define CP15_ID_ISAR4(rr) p15, 0, rr, c0, c2, 4 /* Instruction Set Attribute Register 4 */
+#define CP15_ID_ISAR5(rr) p15, 0, rr, c0, c2, 5 /* Instruction Set Attribute Register 5 */
+
+#define CP15_CCSIDR(rr) p15, 1, rr, c0, c0, 0 /* Cache Size ID Registers */
+#define CP15_CLIDR(rr) p15, 1, rr, c0, c0, 1 /* Cache Level ID Register */
+#define CP15_AIDR(rr) p15, 1, rr, c0, c0, 7 /* Auxiliary ID Register */
+
+#define CP15_CSSELR(rr) p15, 2, rr, c0, c0, 0 /* Cache Size Selection Register */
+
+/*
+ * CP15 C1 registers
+ */
+#define CP15_SCTLR(rr) p15, 0, rr, c1, c0, 0 /* System Control Register */
+#define CP15_ACTLR(rr) p15, 0, rr, c1, c0, 1 /* IMPLEMENTATION DEFINED Auxiliary Control Register */
+#define CP15_CPACR(rr) p15, 0, rr, c1, c0, 2 /* Coprocessor Access Control Register */
+
+#define CP15_SCR(rr) p15, 0, rr, c1, c1, 0 /* Secure Configuration Register */
+#define CP15_SDER(rr) p15, 0, rr, c1, c1, 1 /* Secure Debug Enable Register */
+#define CP15_NSACR(rr) p15, 0, rr, c1, c1, 2 /* Non-Secure Access Control Register */
+
+/*
+ * CP15 C2 registers
+ */
+#define CP15_TTBR0(rr) p15, 0, rr, c2, c0, 0 /* Translation Table Base Register 0 */
+#define CP15_TTBR1(rr) p15, 0, rr, c2, c0, 1 /* Translation Table Base Register 1 */
+#define CP15_TTBCR(rr) p15, 0, rr, c2, c0, 2 /* Translation Table Base Control Register */
+
+/*
+ * CP15 C3 registers
+ */
+#define CP15_DACR(rr) p15, 0, rr, c3, c0, 0 /* Domain Access Control Register */
+
+/*
+ * CP15 C5 registers
+ */
+#define CP15_DFSR(rr) p15, 0, rr, c5, c0, 0 /* Data Fault Status Register */
+
+#if __ARM_ARCH >= 6
+/* From ARMv6: */
+#define CP15_IFSR(rr) p15, 0, rr, c5, c0, 1 /* Instruction Fault Status Register */
+/* From ARMv7: */
+#define CP15_ADFSR(rr) p15, 0, rr, c5, c1, 0 /* Auxiliary Data Fault Status Register */
+#define CP15_AIFSR(rr) p15, 0, rr, c5, c1, 1 /* Auxiliary Instruction Fault Status Register */
+#endif
+
+
+/*
+ * CP15 C6 registers
+ */
+#define CP15_DFAR(rr) p15, 0, rr, c6, c0, 0 /* Data Fault Address Register */
+
+#if __ARM_ARCH >= 6
+/* From ARMv6k: */
+#define CP15_IFAR(rr) p15, 0, rr, c6, c0, 2 /* Instruction Fault Address Register */
+#endif
+
+/*
+ * CP15 C7 registers
+ */
+#if __ARM_ARCH >= 6
+/* From ARMv7: */
+#define CP15_ICIALLUIS p15, 0, r0, c7, c1, 0 /* Instruction cache invalidate all PoU, IS */
+#define CP15_BPIALLIS p15, 0, r0, c7, c1, 6 /* Branch predictor invalidate all IS */
+#endif
+
+#define CP15_PAR p15, 0, r0, c7, c4, 0 /* Physical Address Register */
+
+#define CP15_ICIALLU p15, 0, r0, c7, c5, 0 /* Instruction cache invalidate all PoU */
+#define CP15_ICIMVAU(rr) p15, 0, rr, c7, c5, 1 /* Instruction cache invalidate */
+#if __ARM_ARCH >= 6
+/* Deprecated in ARMv7 */
+#define CP15_CP15ISB p15, 0, r0, c7, c5, 4 /* ISB */
+#endif
+#define CP15_BPIALL p15, 0, r0, c7, c5, 6 /* Branch predictor invalidate all */
+#define CP15_BPIMVA p15, 0, rr, c7, c5, 7 /* Branch predictor invalidate by MVA */
+
+#if __ARM_ARCH >= 6
+/* Only ARMv6: */
+#define CP15_DCIALL p15, 0, r0, c7, c6, 0 /* Data cache invalidate all */
+#endif
+#define CP15_DCIMVAC(rr) p15, 0, rr, c7, c6, 1 /* Data cache invalidate by MVA PoC */
+#define CP15_DCISW(rr) p15, 0, rr, c7, c6, 2 /* Data cache invalidate by set/way */
+
+#define CP15_ATS1CPR(rr) p15, 0, rr, c7, c8, 0 /* Stage 1 Current state PL1 read */
+#define CP15_ATS1CPW(rr) p15, 0, rr, c7, c8, 1 /* Stage 1 Current state PL1 write */
+#define CP15_ATS1CUR(rr) p15, 0, rr, c7, c8, 2 /* Stage 1 Current state unprivileged read */
+#define CP15_ATS1CUW(rr) p15, 0, rr, c7, c8, 3 /* Stage 1 Current state unprivileged write */
+
+#if __ARM_ARCH >= 6
+/* From ARMv7: */
+#define CP15_ATS12NSOPR(rr) p15, 0, rr, c7, c8, 4 /* Stages 1 and 2 Non-secure only PL1 read */
+#define CP15_ATS12NSOPW(rr) p15, 0, rr, c7, c8, 5 /* Stages 1 and 2 Non-secure only PL1 write */
+#define CP15_ATS12NSOUR(rr) p15, 0, rr, c7, c8, 6 /* Stages 1 and 2 Non-secure only unprivileged read */
+#define CP15_ATS12NSOUW(rr) p15, 0, rr, c7, c8, 7 /* Stages 1 and 2 Non-secure only unprivileged write */
+#endif
+
+#if __ARM_ARCH >= 6
+/* Only ARMv6: */
+#define CP15_DCCALL p15, 0, r0, c7, c10, 0 /* Data cache clean all */
+#endif
+#define CP15_DCCMVAC(rr) p15, 0, rr, c7, c10, 1 /* Data cache clean by MVA PoC */
+#define CP15_DCCSW(rr) p15, 0, rr, c7, c10, 2 /* Data cache clean by set/way */
+#if __ARM_ARCH >= 6
+/* Only ARMv6: */
+#define CP15_CP15DSB p15, 0, r0, c7, c10, 4 /* DSB */
+#define CP15_CP15DMB p15, 0, r0, c7, c10, 5 /* DMB */
+#endif
+
+#if __ARM_ARCH >= 6
+/* From ARMv7: */
+#define CP15_DCCMVAU(rr) p15, 0, rr, c7, c11, 1 /* Data cache clean by MVA PoU */
+#endif
+
+#if __ARM_ARCH >= 6
+/* Only ARMv6: */
+#define CP15_DCCIALL p15, 0, r0, c7, c14, 0 /* Data cache clean and invalidate all */
+#endif
+#define CP15_DCCIMVAC(rr) p15, 0, rr, c7, c14, 1 /* Data cache clean and invalidate by MVA PoC */
+#define CP15_DCCISW(rr) p15, 0, rr, c7, c14, 2 /* Data cache clean and invalidate by set/way */
+
+/*
+ * CP15 C8 registers
+ */
+#if __ARM_ARCH >= 6
+/* From ARMv7: */
+#define CP15_TLBIALLIS p15, 0, r0, c8, c3, 0 /* Invalidate entire unified TLB IS */
+#define CP15_TLBIMVAIS(rr) p15, 0, rr, c8, c3, 1 /* Invalidate unified TLB by MVA IS */
+#define CP15_TLBIASIDIS(rr) p15, 0, rr, c8, c3, 2 /* Invalidate unified TLB by ASID IS */
+#define CP15_TLBIMVAAIS(rr) p15, 0, rr, c8, c3, 3 /* Invalidate unified TLB by MVA, all ASID IS */
+#endif
+
+#define CP15_TLBIALL p15, 0, r0, c8, c7, 0 /* Invalidate entire unified TLB */
+#define CP15_TLBIMVA(rr) p15, 0, rr, c8, c7, 1 /* Invalidate unified TLB by MVA */
+#define CP15_TLBIASID(rr) p15, 0, rr, c8, c7, 2 /* Invalidate unified TLB by ASID */
+
+#if __ARM_ARCH >= 6
+/* From ARMv6: */
+#define CP15_TLBIMVAA(rr) p15, 0, rr, c8, c7, 3 /* Invalidate unified TLB by MVA, all ASID */
+#endif
+
+/*
+ * CP15 C10 registers
+ */
+/* Without LPAE this is PRRR, with LPAE it's MAIR0 */
+#define CP15_PRRR(rr) p15, 0, rr, c10, c2, 0 /* Primary Region Remap Register */
+#define CP15_MAIR0(rr) p15, 0, rr, c10, c2, 0 /* Memory Attribute Indirection Register 0 */
+/* Without LPAE this is NMRR, with LPAE it's MAIR1 */
+#define CP15_NMRR(rr) p15, 0, rr, c10, c2, 1 /* Normal Memory Remap Register */
+#define CP15_MAIR1(rr) p15, 0, rr, c10, c2, 1 /* Memory Attribute Indirection Register 1 */
+
+#define CP15_AMAIR0(rr) p15, 0, rr, c10, c3, 0 /* Auxiliary Memory Attribute Indirection Register 0 */
+#define CP15_AMAIR1(rr) p15, 0, rr, c10, c3, 1 /* Auxiliary Memory Attribute Indirection Register 1 */
+
+/*
+ * CP15 C12 registers
+ */
+#define CP15_VBAR(rr) p15, 0, rr, c12, c0, 0 /* Vector Base Address Register */
+#define CP15_MVBAR(rr) p15, 0, rr, c12, c0, 1 /* Monitor Vector Base Address Register */
+
+#define CP15_ISR(rr) p15, 0, rr, c12, c1, 0 /* Interrupt Status Register */
+
+/*
+ * CP15 C13 registers
+ */
+#define CP15_FCSEIDR(rr) p15, 0, rr, c13, c0, 0 /* FCSE Process ID Register */
+#define CP15_CONTEXTIDR(rr) p15, 0, rr, c13, c0, 1 /* Context ID Register */
+#define CP15_TPIDRURW(rr) p15, 0, rr, c13, c0, 2 /* User Read/Write Thread ID Register */
+#define CP15_TPIDRURO(rr) p15, 0, rr, c13, c0, 3 /* User Read-Only Thread ID Register */
+#define CP15_TPIDRPRW(rr) p15, 0, rr, c13, c0, 4 /* PL1 only Thread ID Register */
+
+#endif /* !MACHINE_SYSREG_H */
diff --git a/sys/boot/Makefile.pc98 b/sys/boot/Makefile.pc98
index aa989e1..8468399 100644
--- a/sys/boot/Makefile.pc98
+++ b/sys/boot/Makefile.pc98
@@ -1,4 +1,3 @@
# $FreeBSD$
-# Blank, to override Makefile.i386 since Makefile.$MACHINE is included before
-# Makefile.$MACHINE_ARCH
+SUBDIR+= libstand32
diff --git a/sys/boot/arm/ixp425/boot2/Makefile b/sys/boot/arm/ixp425/boot2/Makefile
index 6fe515e..fe1068f 100644
--- a/sys/boot/arm/ixp425/boot2/Makefile
+++ b/sys/boot/arm/ixp425/boot2/Makefile
@@ -17,9 +17,7 @@ FILES=${P}
SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c
SRCS+=memchr.c memcmp.c memcpy.c memmem.c memset.c printf.c strcmp.c strcpy.c
SRCS+=strlen.c ashldi3.c divsi3.S muldi3.c
-.if ${MK_ARM_EABI} != "no"
SRCS+=aeabi_unwind.c
-.endif
MAN=
KERNPHYSADDR=0x180000
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index fa8c29d..40413e9 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -37,7 +37,7 @@ CFLAGS= -Os \
-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
- -Winline \
+ -Winline
CFLAGS.gcc+= -fno-guess-branch-probability \
-fno-unit-at-a-time \
diff --git a/sys/boot/i386/libfirewire/fwohcireg.h b/sys/boot/i386/libfirewire/fwohcireg.h
index d24f658..d57870c 100644
--- a/sys/boot/i386/libfirewire/fwohcireg.h
+++ b/sys/boot/i386/libfirewire/fwohcireg.h
@@ -235,7 +235,7 @@ struct ohci_registers {
fwohcireg_t config_rom; /* config ROM map 0x34 */
fwohcireg_t post_wr_lo; /* post write addr lo 0x38 */
fwohcireg_t post_wr_hi; /* post write addr hi 0x3c */
- fwohcireg_t vender; /* vender ID 0x40 */
+ fwohcireg_t vendor; /* vendor ID 0x40 */
fwohcireg_t dummy1[3]; /* dummy 0x44-0x4c */
fwohcireg_t hcc_cntl_set; /* HCC control set 0x50 */
fwohcireg_t hcc_cntl_clr; /* HCC control clr 0x54 */
diff --git a/sys/boot/libstand32/Makefile b/sys/boot/libstand32/Makefile
index 39c8e40..437fa3b 100644
--- a/sys/boot/libstand32/Makefile
+++ b/sys/boot/libstand32/Makefile
@@ -67,9 +67,6 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
.if ${MACHINE_CPUARCH} == "arm"
.PATH: ${LIBC}/arm/gen
-.if ${MK_ARM_EABI} == "no"
-SRCS+= divsi3.S
-.else
# Compiler support functions
.PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/
# __clzsi2 and ctzsi2 for various builtin functions
@@ -81,7 +78,6 @@ SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c
.PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/arm/
SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S
SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S
-.endif
.endif
.if ${MACHINE_CPUARCH} == "powerpc"
diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile
index f462717..0b744aa 100644
--- a/sys/boot/pc98/boot2/Makefile
+++ b/sys/boot/pc98/boot2/Makefile
@@ -2,10 +2,6 @@
.include <bsd.own.mk>
-# XXX: clang can compile the boot code just fine, but boot2 gets too big
-#CC:= gcc
-#COMPILER_TYPE:= gcc
-
FILES= boot boot1 boot2
NM?= nm
@@ -114,4 +110,5 @@ boot2.h: boot1.out
.include <bsd.prog.mk>
# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS+= ${CLANG_NO_IAS}
+CFLAGS.boot1.S= ${CLANG_NO_IAS}
+CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
diff --git a/sys/boot/pc98/cdboot/cdboot.S b/sys/boot/pc98/cdboot/cdboot.S
index ae333d1..c97c02b 100644
--- a/sys/boot/pc98/cdboot/cdboot.S
+++ b/sys/boot/pc98/cdboot/cdboot.S
@@ -11,9 +11,6 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 3. 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
diff --git a/sys/boot/pc98/libpc98/Makefile b/sys/boot/pc98/libpc98/Makefile
index b4433a4..e612205 100644
--- a/sys/boot/pc98/libpc98/Makefile
+++ b/sys/boot/pc98/libpc98/Makefile
@@ -44,4 +44,7 @@ CFLAGS+= -I${.CURDIR}/../../common \
# the location of libstand
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
+# Suppress warning from clang for FreeBSD %b and %D formats
+CFLAGS+= -fformat-extensions
+
.include <bsd.lib.mk>
diff --git a/sys/boot/pc98/loader/Makefile b/sys/boot/pc98/loader/Makefile
index 7ab13a1..4d865e7 100644
--- a/sys/boot/pc98/loader/Makefile
+++ b/sys/boot/pc98/loader/Makefile
@@ -56,6 +56,8 @@ LDFLAGS= -static -Ttext 0x0
LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a
CFLAGS+= -I${.CURDIR}/..
+LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a
+
# BTX components
CFLAGS+= -I${.CURDIR}/../btx/lib
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 098c317..3627a50 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -10285,7 +10285,7 @@ ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len)
bl_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
bl_ptr->page_code = SVPD_BLOCK_LIMITS;
- scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length);
+ scsi_ulto2b(sizeof(*bl_ptr) - 4, bl_ptr->page_length);
bl_ptr->max_cmp_write_len = 0xff;
scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len);
if (lun != NULL) {
@@ -10480,7 +10480,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio)
struct ctl_softc *ctl_softc;
struct ctl_lun *lun;
char *val;
- uint32_t alloc_len;
+ uint32_t alloc_len, data_len;
ctl_port_type port_type;
ctl_softc = control_softc;
@@ -10504,16 +10504,17 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio)
* in. If the user only asks for less, we'll give him
* that much.
*/
- ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK | M_ZERO);
+ data_len = offsetof(struct scsi_inquiry_data, vendor_specific1);
+ ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
inq_ptr = (struct scsi_inquiry_data *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
ctsio->kern_data_resid = 0;
ctsio->kern_rel_offset = 0;
- if (sizeof(*inq_ptr) < alloc_len) {
- ctsio->residual = alloc_len - sizeof(*inq_ptr);
- ctsio->kern_data_len = sizeof(*inq_ptr);
- ctsio->kern_total_len = sizeof(*inq_ptr);
+ if (data_len < alloc_len) {
+ ctsio->residual = alloc_len - data_len;
+ ctsio->kern_data_len = data_len;
+ ctsio->kern_total_len = data_len;
} else {
ctsio->residual = 0;
ctsio->kern_data_len = alloc_len;
@@ -10593,8 +10594,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio)
*/
inq_ptr->response_format = SID_HiSup | 2;
- inq_ptr->additional_length =
- offsetof(struct scsi_inquiry_data, vendor_specific1) -
+ inq_ptr->additional_length = data_len -
(offsetof(struct scsi_inquiry_data, additional_length) + 1);
CTL_DEBUG_PRINT(("additional_length = %d\n",
inq_ptr->additional_length));
diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c
index 7a973cb..60ae8a0 100644
--- a/sys/cam/ctl/ctl_tpc.c
+++ b/sys/cam/ctl/ctl_tpc.c
@@ -1812,6 +1812,7 @@ tpc_create_token(struct ctl_lun *lun, struct ctl_port *port, off_t len,
static int id = 0;
struct scsi_vpd_id_descriptor *idd = NULL;
struct scsi_ec_cscd_id *cscd;
+ struct scsi_read_capacity_data_long *dtsd;
int targid_len;
scsi_ulto4b(ROD_TYPE_AUR, token->type);
@@ -1830,9 +1831,19 @@ tpc_create_token(struct ctl_lun *lun, struct ctl_port *port, off_t len,
cscd->type_code = EC_CSCD_ID;
cscd->luidt_pdt = T_DIRECT;
memcpy(&cscd->codeset, idd, 4 + idd->length);
+ scsi_ulto3b(lun->be_lun->blocksize, cscd->dtsp.block_length);
}
- scsi_u64to8b(0, &token->body[40]);
+ scsi_u64to8b(0, &token->body[40]); /* XXX: Should be 128bit value. */
scsi_u64to8b(len, &token->body[48]);
+
+ /* ROD token device type specific data (RC16 without first field) */
+ dtsd = (struct scsi_read_capacity_data_long *)&token->body[88 - 8];
+ scsi_ulto4b(lun->be_lun->blocksize, dtsd->length);
+ dtsd->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE;
+ scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, dtsd->lalba_lbp);
+ if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP)
+ dtsd->lalba_lbp[0] |= SRC16_LBPME | SRC16_LBPRZ;
+
if (port->target_devid) {
targid_len = port->target_devid->len;
memcpy(&token->body[120], port->target_devid->data, targid_len);
@@ -1938,6 +1949,8 @@ ctl_populate_token(struct ctl_scsiio *ctsio)
token->range = &data->desc[0];
token->nrange = scsi_2btoul(data->range_descriptor_length) /
sizeof(struct scsi_range_desc);
+ list->cursectors = tpc_ranges_length(token->range, token->nrange);
+ list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize;
tpc_create_token(lun, port, list->curbytes,
(struct scsi_token *)token->token);
token->active = 0;
@@ -1954,8 +1967,6 @@ ctl_populate_token(struct ctl_scsiio *ctsio)
}
memcpy(list->res_token, token->token, sizeof(list->res_token));
list->res_token_valid = 1;
- list->cursectors = tpc_ranges_length(token->range, token->nrange);
- list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize;
list->curseg = 0;
list->completed = 1;
list->last_active = time_uptime;
diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c
index 42b8774..5677cdd 100644
--- a/sys/cam/scsi/scsi_xpt.c
+++ b/sys/cam/scsi/scsi_xpt.c
@@ -1135,6 +1135,7 @@ out:
u_int8_t periph_qual;
path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID;
+ scsi_find_quirk(path->device);
inq_buf = &path->device->inq_data;
periph_qual = SID_QUAL(inq_buf);
@@ -1163,8 +1164,6 @@ out:
goto out;
}
- scsi_find_quirk(path->device);
-
scsi_devise_transport(path);
if (path->device->lun_id == 0 &&
@@ -1192,15 +1191,9 @@ out:
xpt_schedule(periph, priority);
goto out;
} else if (path->device->lun_id == 0 &&
- SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 &&
+ SID_ANSI_REV(inq_buf) >= SCSI_REV_SPC2 &&
(SCSI_QUIRK(path->device)->quirks &
CAM_QUIRK_NORPTLUNS) == 0) {
- if (path->device->flags &
- CAM_DEV_UNCONFIGURED) {
- path->device->flags &=
- ~CAM_DEV_UNCONFIGURED;
- xpt_acquire_device(path->device);
- }
PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS);
periph->path->target->rpl_size = 16;
xpt_release_ccb(done_ccb);
@@ -1213,10 +1206,13 @@ out:
: SF_RETRY_UA,
&softc->saved_ccb) == ERESTART) {
goto outr;
- } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
- /* Don't wedge the queue */
- xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
- /*run_queue*/TRUE);
+ } else {
+ if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+ /* Don't wedge the queue */
+ xpt_release_devq(done_ccb->ccb_h.path,
+ /*count*/1, /*run_queue*/TRUE);
+ }
+ path->device->flags &= ~CAM_DEV_INQUIRY_DATA_VALID;
}
/*
* If we get to this point, we got an error status back
@@ -1308,14 +1304,6 @@ out:
tlun, 8);
CAM_DEBUG(path, CAM_DEBUG_PROBE,
("lun 0 in position %u\n", idx));
- } else {
- /*
- * There is no lun 0 in our list. Destroy
- * the validity of the inquiry data so we
- * bail here and now.
- */
- path->device->flags &=
- ~CAM_DEV_INQUIRY_DATA_VALID;
}
}
/*
@@ -1328,7 +1316,8 @@ out:
probe_purge_old(path, lp, softc->flags);
lp = NULL;
}
- if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) {
+ if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID &&
+ SID_QUAL(&path->device->inq_data) == SID_QUAL_LU_CONNECTED) {
struct scsi_inquiry_data *inq_buf;
inq_buf = &path->device->inq_data;
if (INQ_DATA_TQ_ENABLED(inq_buf))
@@ -1343,6 +1332,8 @@ out:
if (lp) {
free(lp, M_CAMXPT);
}
+ PROBE_SET_ACTION(softc, PROBE_INVALID);
+ xpt_release_ccb(done_ccb);
break;
}
case PROBE_MODE_SENSE:
@@ -1975,7 +1966,7 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
struct cam_path *path, *oldpath;
scsi_scan_bus_info *scan_info;
struct cam_et *target;
- struct cam_ed *device;
+ struct cam_ed *device, *nextdev;
int next_target;
path_id_t path_id;
target_id_t target_id;
@@ -1984,18 +1975,10 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
oldpath = request_ccb->ccb_h.path;
status = cam_ccb_status(request_ccb);
- /* Reuse the same CCB to query if a device was really found */
scan_info = (scsi_scan_bus_info *)request_ccb->ccb_h.ppriv_ptr0;
- xpt_setup_ccb(&request_ccb->ccb_h, request_ccb->ccb_h.path,
- request_ccb->ccb_h.pinfo.priority);
- request_ccb->ccb_h.func_code = XPT_GDEV_TYPE;
-
-
path_id = request_ccb->ccb_h.path_id;
target_id = request_ccb->ccb_h.target_id;
lun_id = request_ccb->ccb_h.target_lun;
- xpt_action(request_ccb);
-
target = request_ccb->ccb_h.path->target;
next_target = 1;
@@ -2068,56 +2051,39 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
}
}
} else {
- mtx_unlock(&target->luns_mtx);
- if (request_ccb->ccb_h.status != CAM_REQ_CMP) {
- int phl;
-
- /*
- * If we already probed lun 0 successfully, or
- * we have additional configured luns on this
- * target that might have "gone away", go onto
- * the next lun.
- */
- /*
- * We may touch devices that we don't
- * hold references too, so ensure they
- * don't disappear out from under us.
- * The target above is referenced by the
- * path in the request ccb.
- */
- phl = 0;
- device = TAILQ_FIRST(&target->ed_entries);
- if (device != NULL) {
- phl = CAN_SRCH_HI_SPARSE(device);
- if (device->lun_id == 0)
- device = TAILQ_NEXT(device, links);
- }
- if ((lun_id != 0) || (device != NULL)) {
- if (lun_id < (CAM_SCSI2_MAXLUN-1) || phl) {
- lun_id++;
- next_target = 0;
- }
- }
- if (lun_id == request_ccb->ccb_h.target_lun
- || lun_id > scan_info->cpi->max_lun)
- next_target = 1;
- } else {
-
+ mtx_unlock(&target->luns_mtx);
device = request_ccb->ccb_h.path->device;
-
- if ((SCSI_QUIRK(device)->quirks &
- CAM_QUIRK_NOLUNS) == 0) {
- /* Try the next lun */
- if (lun_id < (CAM_SCSI2_MAXLUN-1)
- || CAN_SRCH_HI_DENSE(device)) {
- lun_id++;
+ /* Continue sequential LUN scan if: */
+ /* -- we have more LUNs that need recheck */
+ mtx_lock(&target->bus->eb_mtx);
+ nextdev = device;
+ while ((nextdev = TAILQ_NEXT(nextdev, links)) != NULL)
+ if ((nextdev->flags & CAM_DEV_UNCONFIGURED) == 0)
+ break;
+ mtx_unlock(&target->bus->eb_mtx);
+ if (nextdev != NULL) {
+ next_target = 0;
+ /* -- stop if CAM_QUIRK_NOLUNS is set. */
+ } else if (SCSI_QUIRK(device)->quirks & CAM_QUIRK_NOLUNS) {
+ next_target = 1;
+ /* -- this LUN is connected and its SCSI version
+ * allows more LUNs. */
+ } else if ((device->flags & CAM_DEV_UNCONFIGURED) == 0) {
+ if (lun_id < (CAM_SCSI2_MAXLUN-1) ||
+ CAN_SRCH_HI_DENSE(device))
+ next_target = 0;
+ /* -- this LUN is disconnected, its SCSI version
+ * allows more LUNs and we guess they may be. */
+ } else if ((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) {
+ if (lun_id < (CAM_SCSI2_MAXLUN-1) ||
+ CAN_SRCH_HI_SPARSE(device))
next_target = 0;
- }
}
- if (lun_id == request_ccb->ccb_h.target_lun
- || lun_id > scan_info->cpi->max_lun)
- next_target = 1;
- }
+ if (next_target == 0) {
+ lun_id++;
+ if (lun_id > scan_info->cpi->max_lun)
+ next_target = 1;
+ }
}
/*
diff --git a/sys/cddl/boot/zfs/lz4.c b/sys/cddl/boot/zfs/lz4.c
index 78af959..055bd62 100644
--- a/sys/cddl/boot/zfs/lz4.c
+++ b/sys/cddl/boot/zfs/lz4.c
@@ -83,6 +83,17 @@ lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int dum
#endif
/*
+ * Unaligned memory access is automatically enabled for "common" CPU,
+ * such as x86. For others CPU, the compiler will be more cautious, and
+ * insert extra code to ensure aligned access is respected. If you know
+ * your target CPU supports unaligned memory access, you may want to
+ * force this option manually to improve performance
+ */
+#if defined(__ARM_FEATURE_UNALIGNED)
+#define LZ4_FORCE_UNALIGNED_ACCESS 1
+#endif
+
+/*
* Compiler Options
*/
#if __STDC_VERSION__ >= 199901L /* C99 */
@@ -113,6 +124,10 @@ lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int dum
#define S32 int32_t
#define U64 uint64_t
+#ifndef LZ4_FORCE_UNALIGNED_ACCESS
+#pragma pack(1)
+#endif
+
typedef struct _U16_S {
U16 v;
} U16_S;
@@ -123,6 +138,10 @@ typedef struct _U64_S {
U64 v;
} U64_S;
+#ifndef LZ4_FORCE_UNALIGNED_ACCESS
+#pragma pack()
+#endif
+
#define A64(x) (((U64_S *)(x))->v)
#define A32(x) (((U32_S *)(x))->v)
#define A16(x) (((U16_S *)(x))->v)
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
index a97a10a..d013206 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
@@ -2257,6 +2257,9 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx)
dsl_dir_t *odd = NULL;
uint64_t oldnext_obj;
int64_t delta;
+#if defined(__FreeBSD__) && defined(_KERNEL)
+ char *oldname, *newname;
+#endif
VERIFY0(promote_hold(ddpa, dp, FTAG));
hds = ddpa->ddpa_clone;
@@ -2322,6 +2325,14 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx)
dd->dd_phys->dd_clones, origin_head->ds_object, tx));
}
+#if defined(__FreeBSD__) && defined(_KERNEL)
+ /* Take the spa_namespace_lock early so zvol renames don't deadlock. */
+ mutex_enter(&spa_namespace_lock);
+
+ oldname = kmem_alloc(MAXPATHLEN, KM_SLEEP);
+ newname = kmem_alloc(MAXPATHLEN, KM_SLEEP);
+#endif
+
/* move snapshots to this dir */
for (snap = list_head(&ddpa->shared_snaps); snap;
snap = list_next(&ddpa->shared_snaps, snap)) {
@@ -2356,6 +2367,12 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx)
VERIFY0(dsl_dir_hold_obj(dp, dd->dd_object,
NULL, ds, &ds->ds_dir));
+#if defined(__FreeBSD__) && defined(_KERNEL)
+ dsl_dataset_name(ds, newname);
+ zfsvfs_update_fromname(oldname, newname);
+ zvol_rename_minors(oldname, newname);
+#endif
+
/* move any clone references */
if (ds->ds_phys->ds_next_clones_obj &&
spa_version(dp->dp_spa) >= SPA_VERSION_DIR_CLONES) {
@@ -2393,6 +2410,12 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx)
ASSERT(!dsl_prop_hascb(ds));
}
+#if defined(__FreeBSD__) && defined(_KERNEL)
+ mutex_exit(&spa_namespace_lock);
+
+ kmem_free(newname, MAXPATHLEN);
+ kmem_free(oldname, MAXPATHLEN);
+#endif
/*
* Change space accounting.
* Note, pa->*usedsnap and dd_used_breakdown[SNAP] will either
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
index a6246cc..5f42c79 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
@@ -3540,6 +3540,7 @@ zfs_destroy_unmount_origin(const char *fsname)
static int
zfs_ioc_destroy_snaps(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl)
{
+ int error, poollen;
nvlist_t *snaps;
nvpair_t *pair;
boolean_t defer;
@@ -3548,9 +3549,25 @@ zfs_ioc_destroy_snaps(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl)
return (SET_ERROR(EINVAL));
defer = nvlist_exists(innvl, "defer");
+ poollen = strlen(poolname);
for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL;
pair = nvlist_next_nvpair(snaps, pair)) {
- (void) zfs_unmount_snap(nvpair_name(pair));
+ const char *name = nvpair_name(pair);
+
+ /*
+ * The snap must be in the specified pool to prevent the
+ * invalid removal of zvol minors below.
+ */
+ if (strncmp(name, poolname, poollen) != 0 ||
+ (name[poollen] != '/' && name[poollen] != '@'))
+ return (SET_ERROR(EXDEV));
+
+ error = zfs_unmount_snap(name);
+ if (error != 0)
+ return (error);
+#if defined(__FreeBSD__)
+ zvol_remove_minors(name);
+#endif
}
return (dsl_destroy_snapshots_nvl(snaps, defer, outnvl));
@@ -3644,7 +3661,6 @@ zfs_ioc_destroy_bookmarks(const char *poolname, nvlist_t *innvl,
if (strncmp(name, poolname, poollen) != 0 ||
(name[poollen] != '/' && name[poollen] != '#'))
return (SET_ERROR(EXDEV));
- (void) zvol_remove_minor(name);
}
error = dsl_bookmark_destroy(innvl, outnvl);
@@ -3675,7 +3691,11 @@ zfs_ioc_destroy(zfs_cmd_t *zc)
else
err = dsl_destroy_head(zc->zc_name);
if (zc->zc_objset_type == DMU_OST_ZVOL && err == 0)
+#ifdef __FreeBSD__
+ zvol_remove_minors(zc->zc_name);
+#else
(void) zvol_remove_minor(zc->zc_name);
+#endif
return (err);
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
index d7d5fde..ea17daf 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
@@ -870,6 +870,17 @@ zfsvfs_create(const char *osname, zfsvfs_t **zfvp)
int i, error;
uint64_t sa_obj;
+ /*
+ * XXX: Fix struct statfs so this isn't necessary!
+ *
+ * The 'osname' is used as the filesystem's special node, which means
+ * it must fit in statfs.f_mntfromname, or else it can't be
+ * enumerated, so libzfs_mnttab_find() returns NULL, which causes
+ * 'zfs unmount' to think it's not mounted when it is.
+ */
+ if (strlen(osname) >= MNAMELEN)
+ return (SET_ERROR(ENAMETOOLONG));
+
zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP);
/*
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
index 1f17f05..109a339 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
@@ -2837,6 +2837,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
#endif
vap->va_seq = zp->z_seq;
vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */
+ vap->va_filerev = zp->z_seq;
/*
* Add in any requested optional attributes and the create time.
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
index 05ffdd1..e8a79f2 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
@@ -882,7 +882,8 @@ zvol_remove_minors(const char *name)
LIST_FOREACH_SAFE(zv, &all_zvols, zv_links, tzv) {
if (strcmp(zv->zv_name, name) == 0 ||
(strncmp(zv->zv_name, name, namelen) == 0 &&
- zv->zv_name[namelen] == '/')) {
+ strlen(zv->zv_name) > namelen && (zv->zv_name[namelen] == '/' ||
+ zv->zv_name[namelen] == '@'))) {
(void) zvol_remove_zv(zv);
}
}
@@ -2570,9 +2571,10 @@ zvol_create_minors(const char *name)
if (dmu_objset_type(os) == DMU_OST_ZVOL) {
dsl_dataset_long_hold(os->os_dsl_dataset, FTAG);
dsl_pool_rele(dmu_objset_pool(os), FTAG);
- if ((error = zvol_create_minor(name)) == 0)
+ error = zvol_create_minor(name);
+ if (error == 0 || error == EEXIST) {
error = zvol_create_snapshots(os, name);
- else {
+ } else {
printf("ZFS WARNING: Unable to create ZVOL %s (error=%d).\n",
name, error);
}
@@ -2673,12 +2675,17 @@ zvol_rename_minors(const char *oldname, const char *newname)
size_t oldnamelen, newnamelen;
zvol_state_t *zv;
char *namebuf;
+ boolean_t locked = B_FALSE;
oldnamelen = strlen(oldname);
newnamelen = strlen(newname);
DROP_GIANT();
- mutex_enter(&spa_namespace_lock);
+ /* See comment in zvol_open(). */
+ if (!MUTEX_HELD(&spa_namespace_lock)) {
+ mutex_enter(&spa_namespace_lock);
+ locked = B_TRUE;
+ }
LIST_FOREACH(zv, &all_zvols, zv_links) {
if (strcmp(zv->zv_name, oldname) == 0) {
@@ -2693,7 +2700,8 @@ zvol_rename_minors(const char *oldname, const char *newname)
}
}
- mutex_exit(&spa_namespace_lock);
+ if (locked)
+ mutex_exit(&spa_namespace_lock);
PICKUP_GIANT();
}
diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm
index 67db55d..08e70f3 100644
--- a/sys/conf/Makefile.arm
+++ b/sys/conf/Makefile.arm
@@ -42,11 +42,7 @@ STRIP_FLAGS = -S
# We don't support gcc's thump interwork stuff, so disable it
CFLAGS.gcc += -mno-thumb-interwork
-.if empty(DDB_ENABLED)
-.if ${MK_ARM_EABI} == "no"
-CFLAGS.gcc += -mno-apcs-frame
-.endif
-.elif ${MK_ARM_EABI} != "no"
+.if !empty(DDB_ENABLED)
CFLAGS += -funwind-tables
# clang requires us to tell it to emit assembly with unwind information
CFLAGS.clang += -mllvm -arm-enable-ehabi
diff --git a/sys/conf/files b/sys/conf/files
index 70d4d5a6..20f0d6e 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -255,6 +255,8 @@ contrib/altq/altq/altq_red.c optional altq
contrib/altq/altq/altq_rio.c optional altq
contrib/altq/altq/altq_rmclass.c optional altq
contrib/altq/altq/altq_subr.c optional altq
+contrib/dev/acpica/common/ahids.c optional acpi acpi_debug
+contrib/dev/acpica/common/ahuuids.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbconvert.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbdisply.c optional acpi acpi_debug
@@ -265,6 +267,7 @@ contrib/dev/acpica/components/debugger/dbinput.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbnames.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbstats.c optional acpi acpi_debug
+contrib/dev/acpica/components/debugger/dbtest.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbxface.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmbuffer.c optional acpi acpi_debug
@@ -387,6 +390,7 @@ contrib/dev/acpica/components/resources/rsmisc.c optional acpi
contrib/dev/acpica/components/resources/rsserial.c optional acpi
contrib/dev/acpica/components/resources/rsutils.c optional acpi
contrib/dev/acpica/components/resources/rsxface.c optional acpi
+contrib/dev/acpica/components/tables/tbdata.c optional acpi
contrib/dev/acpica/components/tables/tbfadt.c optional acpi
contrib/dev/acpica/components/tables/tbfind.c optional acpi
contrib/dev/acpica/components/tables/tbinstal.c optional acpi
@@ -407,6 +411,7 @@ contrib/dev/acpica/components/utilities/uterror.c optional acpi
contrib/dev/acpica/components/utilities/uteval.c optional acpi
contrib/dev/acpica/components/utilities/utexcep.c optional acpi
contrib/dev/acpica/components/utilities/utglobal.c optional acpi
+contrib/dev/acpica/components/utilities/uthex.c optional acpi
contrib/dev/acpica/components/utilities/utids.c optional acpi
contrib/dev/acpica/components/utilities/utinit.c optional acpi
contrib/dev/acpica/components/utilities/utlock.c optional acpi
@@ -420,6 +425,7 @@ contrib/dev/acpica/components/utilities/utpredef.c optional acpi
contrib/dev/acpica/components/utilities/utresrc.c optional acpi
contrib/dev/acpica/components/utilities/utstate.c optional acpi
contrib/dev/acpica/components/utilities/utstring.c optional acpi
+contrib/dev/acpica/components/utilities/utuuid.c optional acpi acpi_debug
contrib/dev/acpica/components/utilities/utxface.c optional acpi
contrib/dev/acpica/components/utilities/utxferror.c optional acpi
contrib/dev/acpica/components/utilities/utxfinit.c optional acpi
@@ -2638,6 +2644,9 @@ dev/xen/netfront/netfront.c optional xen | xenhvm
dev/xen/xenpci/xenpci.c optional xenpci
dev/xen/timer/timer.c optional xen | xenhvm
dev/xen/pvcpu/pvcpu.c optional xen | xenhvm
+dev/xen/xenstore/xenstore.c optional xen | xenhvm
+dev/xen/xenstore/xenstore_dev.c optional xen | xenhvm
+dev/xen/xenstore/xenstored_dev.c optional xen | xenhvm
dev/xl/if_xl.c optional xl pci
dev/xl/xlphy.c optional xl pci
fs/autofs/autofs.c optional autofs
@@ -3976,8 +3985,6 @@ xen/xenbus/xenbusb_if.m optional xen | xenhvm
xen/xenbus/xenbusb.c optional xen | xenhvm
xen/xenbus/xenbusb_front.c optional xen | xenhvm
xen/xenbus/xenbusb_back.c optional xen | xenhvm
-xen/xenstore/xenstore.c optional xen | xenhvm
-xen/xenstore/xenstore_dev.c optional xen | xenhvm
xdr/xdr.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
xdr/xdr_array.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
xdr/xdr_mbuf.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index b75732f..9e5a2ed 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -582,3 +582,5 @@ x86/xen/pvcpu_enum.c optional xenhvm
x86/xen/xen_apic.c optional xenhvm
x86/xen/xenpv.c optional xenhvm
x86/xen/xen_nexus.c optional xenhvm
+x86/xen/xen_msi.c optional xenhvm
+x86/xen/xen_pci.c optional xenhvm
diff --git a/sys/conf/files.arm b/sys/conf/files.arm
index 1f7c71d..f8c5fc4 100644
--- a/sys/conf/files.arm
+++ b/sys/conf/files.arm
@@ -49,6 +49,7 @@ arm/arm/stdatomic.c standard \
arm/arm/support.S standard
arm/arm/swtch.S standard
arm/arm/sys_machdep.c standard
+arm/arm/syscall.c standard
arm/arm/trap.c standard
arm/arm/uio_machdep.c standard
arm/arm/undefined.c standard
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index db6b2aa..0e4519d 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -599,3 +599,4 @@ x86/xen/xen_intr.c optional xen | xenhvm
x86/xen/xen_apic.c optional xenhvm
x86/xen/xenpv.c optional xen | xenhvm
x86/xen/xen_nexus.c optional xen | xenhvm
+x86/xen/xen_msi.c optional xen | xenhvm
diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk
index 31555cc..8c7a0ba 100644
--- a/sys/conf/kern.opts.mk
+++ b/sys/conf/kern.opts.mk
@@ -23,7 +23,6 @@
# src tree.
__DEFAULT_YES_OPTIONS = \
- ARM_EABI \
BLUETOOTH \
CDDL \
CRYPT \
diff --git a/sys/contrib/dev/acpica/acpica_prep.sh b/sys/contrib/dev/acpica/acpica_prep.sh
index a6802ef..00c5fa4 100755
--- a/sys/contrib/dev/acpica/acpica_prep.sh
+++ b/sys/contrib/dev/acpica/acpica_prep.sh
@@ -19,9 +19,10 @@ fulldirs="common compiler components include os_specific"
# files to remove
stripdirs="generate libraries tests tools"
stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \
- aclinux.h acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h \
- acwin64.h new_table.txt osfreebsdtbl.c oslinuxtbl.c osunixdir.c \
- osunixmap.c oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c"
+ aclinux.h aclinuxex.h acmacosx.h acmsvc.h acnetbsd.h acos2.h \
+ acwin.h acwin64.h new_table.txt osefitbl.c osefixf.c \
+ osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c \
+ oswintbl.c oswinxf.c readme.txt utclib.c"
# include files to canonify
src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \
@@ -30,8 +31,8 @@ src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \
acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h \
acpredef.h acresrc.h acrestyp.h acstruct.h actables.h actbl.h \
actbl1.h actbl2.h actbl3.h actypes.h acutils.h amlcode.h \
- amlresrc.h platform/acenv.h platform/acfreebsd.h \
- platform/acgcc.h"
+ amlresrc.h platform/acenv.h platform/acenvex.h \
+ platform/acfreebsd.h platform/acgcc.h"
comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \
aslsupport.l asltypes.h dtcompiler.h dttemplate.h preprocess.h"
platform_headers="acfreebsd.h acgcc.h"
diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt
index ab43358..1c2b1ed 100644
--- a/sys/contrib/dev/acpica/changes.txt
+++ b/sys/contrib/dev/acpica/changes.txt
@@ -1,4 +1,921 @@
----------------------------------------
+26 September 2014. Summary of changes for version 20140926:
+
+1) ACPICA kernel-resident subsystem:
+
+Updated the GPIO operation region handler interface (GeneralPurposeIo).
+In order to support GPIO Connection objects with multiple pins, along
+with the related Field objects, the following changes to the interface
+have been made: The Address is now defined to be the offset in bits of
+the field unit from the previous invocation of a Connection. It can be
+viewed as a "Pin Number Index" into the connection resource descriptor.
+The BitWidth is the exact bit width of the field. It is usually one bit,
+but not always. See the ACPICA reference guide (section 8.8.6.2.1) for
+additional information and examples.
+
+GPE support: During ACPICA/GPE initialization, ensure that all GPEs with
+corresponding _Lxx/_Exx methods are disabled (they may have been enabled
+by the firmware), so that they cannot fire until they are enabled via
+AcpiUpdateAllGpes. Rafael J. Wysocki.
+
+Added a new return flag for the Event/GPE status interfaces --
+AcpiGetEventStatus and AcpiGetGpeStatus. The new
+ACPI_EVENT_FLAGS_HAS_HANDLER flag is used to indicate that the event or
+GPE currently has a handler associated with it, and can thus actually
+affect the system. Lv Zheng.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 99.1K Code, 27.3K Data, 126.4K Total
+ Debug Version: 192.8K Code, 79.9K Data, 272.7K Total
+ Previous Release:
+ Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total
+ Debug Version: 192.1K Code, 79.8K Data, 271.9K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a memory allocation/free regression introduced in 20140828
+that could cause the compiler to crash. This was introduced inadvertently
+during the effort to eliminate compiler memory leaks. ACPICA BZ 1111,
+1113.
+
+iASL: Removed two error messages that have been found to create false
+positives, until they can be fixed and fully validated (ACPICA BZ 1112):
+1) Illegal forward reference within a method
+2) Illegal reference across two methods
+
+iASL: Implemented a new option (-lm) to create a hardware mapping file
+that summarizes all GPIO, I2C, SPI, and UART connections. This option
+works for both the compiler and disassembler. See the iASL compiler user
+guide for additional information and examples (section 6.4.6).
+
+AcpiDump: Added support for the version 1 (ACPI 1.0) RSDP in addition to
+version 2. This corrects the AE_BAD_HEADER exception seen on systems with
+a version 1 RSDP. Lv Zheng ACPICA BZ 1097.
+
+AcpiExec: For Unix versions, don't attempt to put STDIN into raw mode
+unless STDIN is actually a terminal. Assists with batch-mode processing.
+ACPICA BZ 1114.
+
+Disassembler/AcpiHelp: Added another large group of recognized _HID
+values.
+
+
+----------------------------------------
+28 August 2014. Summary of changes for version 20140828:
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a problem related to the internal use of the Timer() operator where
+a 64-bit divide could cause an attempted link to a double-precision math
+library. This divide is not actually necessary, so the code was
+restructured to eliminate it. Lv Zheng.
+
+ACPI 5.1: Added support for the runtime validation of the _DSD package
+(similar to the iASL support).
+
+ACPI 5.1/Headers: Added support for the GICC affinity subtable to the
+SRAT table. Hanjun Guo <hanjun.guo@linaro.org>.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total
+ Debug Version: 192.1K Code, 79.8K Data, 271.9K Total
+ Previous Release:
+ Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total1
+ Debug Version: 192.0K Code, 79.7K Data, 271.7K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+AcpiExec: Fixed a problem on unix systems where the original terminal
+state was not always properly restored upon exit. Seen when using the -v
+option. ACPICA BZ 1104.
+
+iASL: Fixed a problem with the validation of the ranges/length within the
+Memory24 resource descriptor. There was a boundary condition when the
+range was equal to the (length -1) caused by the fact that these values
+are defined in 256-byte blocks, not bytes. ACPICA BZ 1098
+
+Disassembler: Fixed a problem with the GpioInt descriptor interrupt
+polarity
+flags. The flags are actually 2 bits, not 1, and the "ActiveBoth" keyword
+is
+now supported properly.
+
+ACPI 5.1: Added the GICC affinity subtable to the SRAT table. Supported
+in the disassembler, data table compiler, and table template generator.
+
+iASL: Added a requirement for Device() objects that one of either a _HID
+or _ADR must exist within the scope of a Device, as per the ACPI
+specification. Remove a similar requirement that was incorrectly in place
+for the _DSD object.
+
+iASL: Added error detection for illegal named references within control
+methods that would cause runtime failures. Now trapped as errors are: 1)
+References to objects within a non-parent control method. 2) Forward
+references (within a method) -- for control methods, AML interpreters use
+a one-pass parse of control methods. ACPICA BZ 1008.
+
+iASL: Added error checking for dependencies related to the _PSx power
+methods. ACPICA BZ 1029.
+1) For _PS0, one of these must exist within the same scope: _PS1, _PS2,
+_PS3.
+2) For _PS1, _PS2, and PS3: A _PS0 object must exist within the same
+scope.
+
+iASL and table compiler: Cleanup miscellaneous memory leaks by fully
+deploying the existing object and string caches and adding new caches for
+the table compiler.
+
+iASL: Split the huge parser source file into multiple subfiles to improve
+manageability. Generation now requires the M4 macro preprocessor, which
+is part of the Bison distribution on both unix and windows platforms.
+
+AcpiSrc: Fixed and removed all extraneous warnings generated during
+entire ACPICA source code scan and/or conversion.
+
+
+----------------------------------------
+
+24 July 2014. Summary of changes for version 20140724:
+
+The ACPI 5.1 specification has been released and is available at:
+http://uefi.org/specs/access
+
+
+0) ACPI 5.1 support in ACPICA:
+
+ACPI 5.1 is fully supported in ACPICA as of this release.
+
+New predefined names. Support includes iASL and runtime ACPICA
+validation.
+ _CCA (Cache Coherency Attribute).
+ _DSD (Device-Specific Data). David Box.
+
+Modifications to existing ACPI tables. Support includes headers, iASL
+Data Table compiler, disassembler, and the template generator.
+ FADT - New fields and flags. Graeme Gregory.
+ GTDT - One new subtable and new fields. Tomasz Nowicki.
+ MADT - Two new subtables. Tomasz Nowicki.
+ PCCT - One new subtable.
+
+Miscellaneous.
+ New notification type for System Resource Affinity change events.
+
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a regression introduced in 20140627 where a fault can happen during
+the deletion of Alias AML namespace objects. The problem affected both
+the core ACPICA and the ACPICA tools including iASL and AcpiExec.
+
+Implemented a new GPE public interface, AcpiMarkGpeForWake. Provides a
+simple mechanism to enable wake GPEs that have no associated handler or
+control method. Rafael Wysocki.
+
+Updated the AcpiEnableGpe interface to disallow the enable if there is no
+handler or control method associated with the particular GPE. This will
+help avoid meaningless GPEs and even GPE floods. Rafael Wysocki.
+
+Updated GPE handling and dispatch by disabling the GPE before clearing
+the status bit for edge-triggered GPEs. Lv Zheng.
+
+Added Timer() support to the AML Debug object. The current timer value is
+now displayed with each invocation of (Store to) the debug object to
+enable simple generation of execution times for AML code (method
+execution for example.) ACPICA BZ 1093.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total
+ Debug Version: 192.0K Code, 79.7K Data, 271.7K Total
+ Previous Release:
+ Non-Debug Version: 98.7K Code, 27.2K Data, 125.9K Total
+ Debug Version: 191.7K Code, 79.6K Data, 271.3K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Fixed an issue with the recently added local printf implementation,
+concerning width/precision specifiers that could cause incorrect output.
+Lv Zheng. ACPICA BZ 1094.
+
+Disassembler: Added support to detect buffers that contain UUIDs and
+disassemble them to an invocation of the ToUUID operator. Also emit
+commented descriptions of known ACPI-related UUIDs.
+
+AcpiHelp: Added support to display known ACPI-related UUIDs. New option,
+-u. Adds three new files.
+
+iASL: Update table compiler and disassembler for DMAR table changes that
+were introduced in September 2013. With assistance by David Woodhouse.
+
+----------------------------------------
+27 June 2014. Summary of changes for version 20140627:
+
+1) ACPICA kernel-resident subsystem:
+
+Formatted Output: Implemented local versions of standard formatted output
+utilities such as printf, etc. Over time, it has been discovered that
+there are in fact many portability issues with printf, and the addition
+of this feature will fix/prevent these issues once and for all. Some
+known issues are summarized below:
+
+1) Output of 64-bit values is not portable. For example, UINT64 is %ull
+for the Linux kernel and is %uI64 for some MSVC versions.
+2) Invoking printf consistently in a manner that is portable across both
+32-bit and 64-bit platforms is difficult at best in many situations.
+3) The output format for pointers varies from system to system (leading
+zeros especially), and leads to inconsistent output from ACPICA across
+platforms.
+4) Certain platform-specific printf formats may conflict with ACPICA use.
+5) If there is no local C library available, ACPICA now has local support
+for printf.
+
+-- To address these printf issues in a complete manner, ACPICA now
+directly implements a small subset of printf format specifiers, only
+those that it requires. Adds a new file, utilities/utprint.c. Lv Zheng.
+
+Implemented support for ACPICA generation within the EFI environment.
+Initially, the AcpiDump utility is supported in the UEFI shell
+environment. Lv Zheng.
+
+Added a new external interface, AcpiLogError, to improve ACPICA
+portability. This allows the host to redirect error messages from the
+ACPICA utilities. Lv Zheng.
+
+Added and deployed new OSL file I/O interfaces to improve ACPICA
+portability:
+ AcpiOsOpenFile
+ AcpiOsCloseFile
+ AcpiOsReadFile
+ AcpiOsWriteFile
+ AcpiOsGetFileOffset
+ AcpiOsSetFileOffset
+There are C library implementations of these functions in the new file
+service_layers/oslibcfs.c -- however, the functions can be implemented by
+the local host in any way necessary. Lv Zheng.
+
+Implemented a mechanism to disable/enable ACPI table checksum validation
+at runtime. This can be useful when loading tables very early during OS
+initialization when it may not be possible to map the entire table in
+order to compute the checksum. Lv Zheng.
+
+Fixed a buffer allocation issue for the Generic Serial Bus support.
+Originally, a fixed buffer length was used. This change allows for
+variable-length buffers based upon the protocol indicated by the field
+access attributes. Reported by Lan Tianyu. Lv Zheng.
+
+Fixed a problem where an object detached from a namespace node was not
+properly terminated/cleared and could cause a circular list problem if
+reattached. ACPICA BZ 1063. David Box.
+
+Fixed a possible recursive lock acquisition in hwregs.c. Rakib Mullick.
+
+Fixed a possible memory leak in an error return path within the function
+AcpiUtCopyIobjectToIobject. ACPICA BZ 1087. Colin Ian King.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 98.7K Code, 27.2K Data, 125.9K Total
+ Debug Version: 191.7K Code, 79.6K Data, 271.3K Total
+ Previous Release:
+ Non-Debug Version: 96.8K Code, 27.2K Data, 124.0K Total
+ Debug Version: 189.5K Code, 79.7K Data, 269.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Add dump of ASCII equivalent text within a comment at the
+end of each line of the output for the Buffer() ASL operator.
+
+AcpiDump: Miscellaneous changes:
+ Fixed repetitive table dump in -n mode.
+ For older EFI platforms, use the ACPI 1.0 GUID during RSDP search if
+the ACPI 2.0 GUID fails.
+
+iASL: Fixed a problem where the compiler could fault if incorrectly given
+an acpidump output file as input. ACPICA BZ 1088. David Box.
+
+AcpiExec/AcpiNames: Fixed a problem where these utilities could fault if
+they are invoked without any arguments.
+
+Debugger: Fixed a possible memory leak in an error return path. ACPICA BZ
+1086. Colin Ian King.
+
+Disassembler: Cleaned up a block of code that extracts a parent Op
+object. Added a comment that explains that the parent is guaranteed to be
+valid in this case. ACPICA BZ 1069.
+
+----------------------------------------
+24 April 2014. Summary of changes for version 20140424:
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented support to skip/ignore NULL address entries in the RSDT/XSDT.
+Some of these tables are known to contain a trailing NULL entry. Lv
+Zheng.
+
+Removed an extraneous error message for the case where there are a large
+number of system GPEs (> 124). This was the "32-bit FADT register is too
+long to convert to GAS struct" message, which is irrelevant for GPEs
+since the GPEx_BLK_LEN fields of the FADT are always used instead of the
+(limited capacity) GAS bit length. Also, several changes to ensure proper
+support for GPE numbers > 255, where some "GPE number" fields were 8-bits
+internally.
+
+Implemented and deployed additional configuration support for the public
+ACPICA external interfaces. Entire classes of interfaces can now be
+easily modified or configured out, replaced by stubbed inline functions
+by default. Lv Zheng.
+
+Moved all public ACPICA runtime configuration globals to the public
+ACPICA external interface file for convenience. Also, removed some
+obsolete/unused globals. See the file acpixf.h. Lv Zheng.
+
+Documentation: Added a new section to the ACPICA reference describing the
+maximum number of GPEs that can be supported by the FADT-defined GPEs in
+block zero and one. About 1200 total. See section 4.4.1 of the ACPICA
+reference.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 96.8K Code, 27.2K Data, 124.0K Total
+ Debug Version: 189.5K Code, 79.7K Data, 269.2K Total
+ Previous Release:
+ Non-Debug Version: 97.0K Code, 27.2K Data, 124.2K Total
+ Debug Version: 189.7K Code, 79.5K Data, 269.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL and disassembler: Add full support for the LPIT table (Low Power
+Idle Table). Includes support in the disassembler, data table compiler,
+and template generator.
+
+AcpiDump utility:
+1) Add option to force the use of the RSDT (over the XSDT).
+2) Improve validation of the RSDP signature (use 8 chars instead of 4).
+
+iASL: Add check for predefined packages that are too large. For
+predefined names that contain subpackages, check if each subpackage is
+too large. (Check for too small already exists.)
+
+Debugger: Updated the GPE command (which simulates a GPE by executing the
+GPE code paths in ACPICA). The GPE device is now optional, and defaults
+to the GPE 0/1 FADT-defined blocks.
+
+Unix application OSL: Update line-editing support. Add additional error
+checking and take care not to reset terminal attributes on exit if they
+were never set. This should help guarantee that the terminal is always
+left in the previous state on program exit.
+
+----------------------------------------
+25 March 2014. Summary of changes for version 20140325:
+
+1) ACPICA kernel-resident subsystem:
+
+Updated the auto-serialize feature for control methods. This feature
+automatically serializes all methods that create named objects in order
+to prevent runtime errors. The update adds support to ignore the
+currently executing AML SyncLevel when invoking such a method, in order
+to prevent disruption of any existing SyncLevel priorities that may exist
+in the AML code. Although the use of SyncLevels is relatively rare, this
+change fixes a regression where an AE_AML_MUTEX_ORDER exception can
+appear on some machines starting with the 20140214 release.
+
+Added a new external interface to allow the host to install ACPI tables
+very early, before the namespace is even created. AcpiInstallTable gives
+the host additional flexibility for ACPI table management. Tables can be
+installed directly by the host as if they had originally appeared in the
+XSDT/RSDT. Installed tables can be SSDTs or other ACPI data tables
+(anything except the DSDT and FACS). Adds a new file, tbdata.c, along
+with additional internal restructuring and cleanup. See the ACPICA
+Reference for interface details. Lv Zheng.
+
+Added validation of the checksum for all incoming dynamically loaded
+tables (via external interfaces or via AML Load/LoadTable operators). Lv
+Zheng.
+
+Updated the use of the AcpiOsWaitEventsComplete interface during Notify
+and GPE handler removal. Restructured calls to eliminate possible race
+conditions. Lv Zheng.
+
+Added a warning for the use/execution of the ASL/AML Unload (table)
+operator. This will help detect and identify machines that use this
+operator if and when it is ever used. This operator has never been seen
+in the field and the usage model and possible side-effects of the drastic
+runtime action of a full table removal are unknown.
+
+Reverted the use of #pragma push/pop which was introduced in the 20140214
+release. It appears that push and pop are not implemented by enough
+compilers to make the use of this feature feasible for ACPICA at this
+time. However, these operators may be deployed in a future ACPICA
+release.
+
+Added the missing EXPORT_SYMBOL macros for the install and remove SCI
+handler interfaces.
+
+Source code generation:
+1) Disabled the use of the "strchr" macro for the gcc-specific
+generation. For some versions of gcc, this macro can periodically expose
+a compiler bug which in turn causes compile-time error(s).
+2) Added support for PPC64 compilation. Colin Ian King.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 97.0K Code, 27.2K Data, 124.2K Total
+ Debug Version: 189.7K Code, 79.5K Data, 269.2K Total
+ Previous Release:
+ Non-Debug Version: 96.5K Code, 27.2K Data, 123.7K Total
+ Debug Version: 188.6K Code, 79.0K Data, 267.6K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Added several new features to improve the readability of
+the resulting ASL code. Extra information is emitted within comment
+fields in the ASL code:
+1) Known _HID/_CID values are decoded to descriptive text.
+2) Standard values for the Notify() operator are decoded to descriptive
+text.
+3) Target operands are expanded to full pathnames (in a comment) when
+possible.
+
+Disassembler: Miscellaneous updates for extern() handling:
+1) Abort compiler if file specified by -fe option does not exist.
+2) Silence unnecessary warnings about argument count mismatches.
+3) Update warning messages concerning unresolved method externals.
+4) Emit "UnknownObj" keyword for externals whose type cannot be
+determined.
+
+AcpiHelp utility:
+1) Added the -a option to display both the ASL syntax and the AML
+encoding for an input ASL operator. This effectively displays all known
+information about an ASL operator with one AcpiHelp invocation.
+2) Added substring match support (similar to a wildcard) for the -i
+(_HID/PNP IDs) option.
+
+iASL/Disassembler: Since this tool does not yet support execution on big-
+endian machines, added detection of endianness and an error message if
+execution is attempted on big-endian. Support for big-endian within iASL
+is a feature that is on the ACPICA to-be-done list.
+
+AcpiBin utility:
+1) Remove option to extract binary files from an acpidump; this function
+is made obsolete by the AcpiXtract utility.
+2) General cleanup of open files and allocated buffers.
+
+----------------------------------------
+14 February 2014. Summary of changes for version 20140214:
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented a new mechanism to proactively prevent problems with ill-
+behaved reentrant control methods that create named ACPI objects. This
+behavior is illegal as per the ACPI specification, but is nonetheless
+frequently seen in the field. Previously, this could lead to an
+AE_ALREADY_EXISTS exception if the method was actually entered by more
+than one thread. This new mechanism detects such methods at table load
+time and marks them "serialized" to prevent reentrancy. A new global
+option, AcpiGbl_AutoSerializeMethods, has been added to disable this
+feature if desired. This mechanism and global option obsoletes and
+supersedes the previous AcpiGbl_SerializeAllMethods option.
+
+Added the "Windows 2013" string to the _OSI support. ACPICA will now
+respond TRUE to _OSI queries with this string. It is the stated policy of
+ACPICA to add new strings to the _OSI support as soon as possible after
+they are defined. See the full ACPICA _OSI policy which has been added to
+the utilities/utosi.c file.
+
+Hardened/updated the _PRT return value auto-repair code:
+1) Do not abort the repair on a single subpackage failure, continue to
+check all subpackages.
+2) Add check for the minimum subpackage length (4).
+3) Properly handle extraneous NULL package elements.
+
+Added support to avoid the possibility of infinite loops when traversing
+object linked lists. Never allow an infinite loop, even in the face of
+corrupted object lists.
+
+ACPICA headers: Deployed the use of #pragma pack(push) and #pragma
+pack(pop) directives to ensure that the ACPICA headers are independent of
+compiler settings or other host headers.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 96.5K Code, 27.2K Data, 123.7K Total
+ Debug Version: 188.6K Code, 79.0K Data, 267.6K Total
+ Previous Release:
+ Non-Debug Version: 96.2K Code, 27.0K Data, 123.2K Total
+ Debug Version: 187.5K Code, 78.3K Data, 265.8K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL/Table-compiler: Fixed a problem with support for the SPMI table. The
+first reserved field was incorrectly forced to have a value of zero. This
+change correctly forces the field to have a value of one. ACPICA BZ 1081.
+
+Debugger: Added missing support for the "Extra" and "Data" subobjects
+when displaying object data.
+
+Debugger: Added support to display entire object linked lists when
+displaying object data.
+
+iASL: Removed the obsolete -g option to obtain ACPI tables from the
+Windows registry. This feature has been superseded by the acpidump
+utility.
+
+----------------------------------------
+14 January 2014. Summary of changes for version 20140114:
+
+1) ACPICA kernel-resident subsystem:
+
+Updated all ACPICA copyrights and signons to 2014. Added the 2014
+copyright to all module headers and signons, including the standard Linux
+header. This affects virtually every file in the ACPICA core subsystem,
+iASL compiler, all ACPICA utilities, and the test suites.
+
+Improved parameter validation for AcpiInstallGpeBlock. Added the
+following checks:
+1) The incoming device handle refers to type ACPI_TYPE_DEVICE.
+2) There is not already a GPE block attached to the device.
+Likewise, with AcpiRemoveGpeBlock, ensure that the incoming object is a
+device.
+
+Correctly support "references" in the ACPI_OBJECT. This change fixes the
+support to allow references (namespace nodes) to be passed as arguments
+to control methods via the evaluate object interface. This is probably
+most useful for testing purposes, however.
+
+Improved support for 32/64 bit physical addresses in printf()-like
+output. This change improves the support for physical addresses in printf
+debug statements and other output on both 32-bit and 64-bit hosts. It
+consistently outputs the appropriate number of bytes for each host. The
+%p specifier is unsatisfactory since it does not emit uniform output on
+all hosts/clib implementations (on some, leading zeros are not supported,
+leading to difficult-to-read output).
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 96.2K Code, 27.0K Data, 123.2K Total
+ Debug Version: 187.5K Code, 78.3K Data, 265.8K Total
+ Previous Release:
+ Non-Debug Version: 96.1K Code, 27.0K Data, 123.1K Total
+ Debug Version: 185.6K Code, 77.3K Data, 262.9K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fix a possible fault when using the Connection() operator. Fixes a
+problem if the parent Field definition for the Connection operator refers
+to an operation region that does not exist. ACPICA BZ 1064.
+
+AcpiExec: Load of local test tables is now optional. The utility has the
+capability to load some various tables to test features of ACPICA.
+However, there are enough of them that the output of the utility became
+confusing. With this change, only the required local tables are displayed
+(RSDP, XSDT, etc.) along with the actual tables loaded via the command
+line specification. This makes the default output simler and easier to
+understand. The -el command line option restores the original behavior
+for testing purposes.
+
+AcpiExec: Added support for overlapping operation regions. This change
+expands the simulation of operation regions by supporting regions that
+overlap within the given address space. Supports SystemMemory and
+SystemIO. ASLTS test suite updated also. David Box. ACPICA BZ 1031.
+
+AcpiExec: Added region handler support for PCI_Config and EC spaces. This
+allows AcpiExec to simulate these address spaces, similar to the current
+support for SystemMemory and SystemIO.
+
+Debugger: Added new command to read/write/compare all namespace objects.
+The command "test objects" will exercise the entire namespace by writing
+new values to each data object, and ensuring that the write was
+successful. The original value is then restored and verified.
+
+Debugger: Added the "test predefined" command. This change makes this
+test public and puts it under the new "test" command. The test executes
+each and every predefined name within the current namespace.
+
+----------------------------------------
+18 December 2013. Summary of changes for version 20131218:
+
+Global note: The ACPI 5.0A specification was released this month. There
+are no changes needed for ACPICA since this release of ACPI is an
+errata/clarification release. The specification is available at
+acpi.info.
+
+
+1) ACPICA kernel-resident subsystem:
+
+Added validation of the XSDT root table if it is present. Some older
+platforms contain an XSDT that is ill-formed or otherwise invalid (such
+as containing some or all entries that are NULL pointers). This change
+adds a new function to validate the XSDT before actually using it. If the
+XSDT is found to be invalid, ACPICA will now automatically fall back to
+using the RSDT instead. Original implementation by Zhao Yakui. Ported to
+ACPICA and enhanced by Lv Zheng and Bob Moore.
+
+Added a runtime option to ignore the XSDT and force the use of the RSDT.
+This change adds a runtime option that will force ACPICA to use the RSDT
+instead of the XSDT (AcpiGbl_DoNotUseXsdt). Although the ACPI spec
+requires that an XSDT be used instead of the RSDT, the XSDT has been
+found to be corrupt or ill-formed on some machines. Lv Zheng.
+
+Added a runtime option to favor 32-bit FADT register addresses over the
+64-bit addresses. This change adds an option to favor 32-bit FADT
+addresses when there is a conflict between the 32-bit and 64-bit versions
+of the same register. The default behavior is to use the 64-bit version
+in accordance with the ACPI specification. This can now be overridden via
+the AcpiGbl_Use32BitFadtAddresses flag. ACPICA BZ 885. Lv Zheng.
+
+During the change above, the internal "Convert FADT" and "Verify FADT"
+functions have been merged to simplify the code, making it easier to
+understand and maintain. ACPICA BZ 933.
+
+Improve exception reporting and handling for GPE block installation.
+Return an actual status from AcpiEvGetGpeXruptBlock and don't clobber the
+status when exiting AcpiEvInstallGpeBlock. ACPICA BZ 1019.
+
+Added helper macros to extract bus/segment numbers from the HEST table.
+This change adds two macros to extract the encoded bus and segment
+numbers from the HEST Bus field - ACPI_HEST_BUS and ACPI_HEST_SEGMENT.
+Betty Dall <betty.dall@hp.com>
+
+Removed the unused ACPI_FREE_BUFFER macro. This macro is no longer used
+by ACPICA. It is not a public macro, so it should have no effect on
+existing OSV code. Lv Zheng.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 96.1K Code, 27.0K Data, 123.1K Total
+ Debug Version: 185.6K Code, 77.3K Data, 262.9K Total
+ Previous Release:
+ Non-Debug Version: 95.9K Code, 27.0K Data, 122.9K Total
+ Debug Version: 185.1K Code, 77.2K Data, 262.3K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Improved pathname support for emitted External()
+statements. This change adds full pathname support for external names
+that have been resolved internally by the inclusion of additional ACPI
+tables (via the iASL -e option). Without this change, the disassembler
+can emit multiple externals for the same object, or it become confused
+when the Scope() operator is used on an external object. Overall, greatly
+improves the ability to actually recompile the emitted ASL code when
+objects a referenced across multiple ACPI tables. Reported by Michael
+Tsirkin (mst@redhat.com).
+
+Tests/ASLTS: Updated functional control suite to execute with no errors.
+David Box. Fixed several errors related to the testing of the interpreter
+slack mode. Lv Zheng.
+
+iASL: Added support to detect names that are declared within a control
+method, but are unused (these are temporary names that are only valid
+during the time the method is executing). A remark is issued for these
+cases. ACPICA BZ 1022.
+
+iASL: Added full support for the DBG2 table. Adds full disassembler,
+table compiler, and template generator support for the DBG2 table (Debug
+Port 2 table).
+
+iASL: Added full support for the PCCT table, update the table definition.
+Updates the PCCT table definition in the actbl3.h header and adds table
+compiler and template generator support.
+
+iASL: Added an option to emit only error messages (no warnings/remarks).
+The -ve option will enable only error messages, warnings and remarks are
+suppressed. This can simplify debugging when only the errors are
+important, such as when an ACPI table is disassembled and there are many
+warnings and remarks -- but only the actual errors are of real interest.
+
+Example ACPICA code (source/tools/examples): Updated the example code so
+that it builds to an actual working program, not just example code. Added
+ACPI tables and execution of an example control method in the DSDT. Added
+makefile support for Unix generation.
+
+----------------------------------------
+15 November 2013. Summary of changes for version 20131115:
+
+This release is available at https://acpica.org/downloads
+
+
+1) ACPICA kernel-resident subsystem:
+
+Resource Manager: Fixed loop termination for the "get AML length"
+function. The loop previously had an error termination on a NULL resource
+pointer, which can never happen since the loop simply increments a valid
+resource pointer. This fix changes the loop to terminate with an error on
+an invalid end-of-buffer condition. The problem can be seen as an
+infinite loop by callers to AcpiSetCurrentResources with an invalid or
+corrupted resource descriptor, or a resource descriptor that is missing
+an END_TAG descriptor. Reported by Dan Carpenter
+<dan.carpenter@oracle.com>. Lv Zheng, Bob Moore.
+
+Table unload and ACPICA termination: Delete all attached data objects
+during namespace node deletion. This fix updates namespace node deletion
+to delete the entire list of attached objects (attached via
+AcpiAttachObject) instead of just one of the attached items. ACPICA BZ
+1024. Tomasz Nowicki (tomasz.nowicki@linaro.org).
+
+ACPICA termination: Added support to delete all objects attached to the
+root namespace node. This fix deletes any and all objects that have been
+attached to the root node via AcpiAttachData. Previously, none of these
+objects were deleted. Reported by Tomasz Nowicki. ACPICA BZ 1026.
+
+Debug output: Do not emit the function nesting level for the in-kernel
+build. The nesting level is really only useful during a single-thread
+execution. Therefore, only enable this output for the AcpiExec utility.
+Also, only emit the thread ID when executing under AcpiExec (Context
+switches are still always detected and a message is emitted). ACPICA BZ
+972.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 95.9K Code, 27.0K Data, 122.9K Total
+ Debug Version: 185.1K Code, 77.2K Data, 262.3K Total
+ Previous Release:
+ Non-Debug Version: 95.8K Code, 27.0K Data, 122.8K Total
+ Debug Version: 185.2K Code, 77.2K Data, 262.4K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+AcpiExec/Unix-OSL: Use <termios.h> instead of <termio.h>. This is the
+correct portable POSIX header for terminal control functions.
+
+Disassembler: Fixed control method invocation issues related to the use
+of the CondRefOf() operator. The problem is seen in the disassembly where
+control method invocations may not be disassembled properly if the
+control method name has been used previously as an argument to CondRefOf.
+The solution is to not attempt to emit an external declaration for the
+CondRefOf target (it is not necessary in the first place). This prevents
+disassembler object type confusion. ACPICA BZ 988.
+
+Unix Makefiles: Added an option to disable compiler optimizations and the
+_FORTIFY_SOURCE flag. Some older compilers have problems compiling ACPICA
+with optimizations (reportedly, gcc 4.4 for example). This change adds a
+command line option for make (NOOPT) that disables all compiler
+optimizations and the _FORTIFY_SOURCE compiler flag. The default
+optimization is -O2 with the _FORTIFY_SOURCE flag specified. ACPICA BZ
+1034. Lv Zheng, Bob Moore.
+
+Tests/ASLTS: Added options to specify individual test cases and modes.
+This allows testers running aslts.sh to optionally specify individual
+test modes and test cases. Also added an option to disable the forced
+generation of the ACPICA tools from source if desired. Lv Zheng.
+
+----------------------------------------
+27 September 2013. Summary of changes for version 20130927:
+
+This release is available at https://acpica.org/downloads
+
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a problem with store operations to reference objects. This change
+fixes a problem where a Store operation to an ArgX object that contained
+a
+reference to a field object did not complete the automatic dereference
+and
+then write to the actual field object. Instead, the object type of the
+field object was inadvertently changed to match the type of the source
+operand. The new behavior will actually write to the field object (buffer
+field or field unit), thus matching the correct ACPI-defined behavior.
+
+Implemented support to allow the host to redefine individual OSL
+prototypes. This change enables the host to redefine OSL prototypes found
+in the acpiosxf.h file. This allows the host to implement OSL interfaces
+with a macro or inlined function. Further, it allows the host to add any
+additional required modifiers such as __iomem, __init, __exit, etc., as
+necessary on a per-interface basis. Enables maximum flexibility for the
+OSL interfaces. Lv Zheng.
+
+Hardcoded the access width for the FADT-defined reset register. The ACPI
+specification requires the reset register width to be 8 bits. ACPICA now
+hardcodes the width to 8 and ignores the FADT width value. This provides
+compatibility with other ACPI implementations that have allowed BIOS code
+with bad register width values to go unnoticed. Matthew Garett, Bob
+Moore,
+Lv Zheng.
+
+Changed the position/use of the ACPI_PRINTF_LIKE macro. This macro is
+used
+in the OSL header (acpiosxf). The change modifies the position of this
+macro in each instance where it is used (AcpiDebugPrint, etc.) to avoid
+build issues if the OSL defines the implementation of the interface to be
+an inline stub function. Lv Zheng.
+
+Deployed a new macro ACPI_EXPORT_SYMBOL_INIT for the main ACPICA
+initialization interfaces. This change adds a new macro for the main init
+and terminate external interfaces in order to support hosts that require
+additional or different processing for these functions. Changed from
+ACPI_EXPORT_SYMBOL to ACPI_EXPORT_SYMBOL_INIT for these functions. Lv
+Zheng, Bob Moore.
+
+Cleaned up the memory allocation macros for configurability. In the
+common
+case, the ACPI_ALLOCATE and related macros now resolve directly to their
+respective AcpiOs* OSL interfaces. Two options:
+1) The ACPI_ALLOCATE_ZEROED macro uses a simple local implementation by
+default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define.
+2) For AcpiExec (and for debugging), the macros can optionally be
+resolved
+to the local ACPICA interfaces that track each allocation (local tracking
+is used to immediately detect memory leaks).
+Lv Zheng.
+
+Simplified the configuration for ACPI_REDUCED_HARDWARE. Allows the kernel
+to predefine this macro to either TRUE or FALSE during the system build.
+
+Replaced __FUNCTION_ with __func__ in the gcc-specific header.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 95.8K Code, 27.0K Data, 122.8K Total
+ Debug Version: 185.2K Code, 77.2K Data, 262.4K Total
+ Previous Release:
+ Non-Debug Version: 96.7K Code, 27.1K Data, 123.9K Total
+ Debug Version: 184.4K Code, 76.8K Data, 261.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Implemented wildcard support for the -e option. This simplifies use
+when there are many SSDTs that must be included to resolve external
+method
+declarations. ACPICA BZ 1041. Example:
+ iasl -e ssdt*.dat -d dsdt.dat
+
+AcpiExec: Add history/line-editing for Unix/Linux systems. This change
+adds a portable module that implements full history and limited line
+editing for Unix and Linux systems. It does not use readline() due to
+portability issues. Instead it uses the POSIX termio interface to put the
+terminal in raw input mode so that the various special keys can be
+trapped
+(such as up/down-arrow for history support and left/right-arrow for line
+editing). Uses the existing debugger history mechanism. ACPICA BZ 1036.
+
+AcpiXtract: Add support to handle (ignore) "empty" lines containing only
+one or more spaces. This provides compatible with early or different
+versions of the AcpiDump utility. ACPICA BZ 1044.
+
+AcpiDump: Do not ignore tables that contain only an ACPI table header.
+Apparently, some BIOSs create SSDTs that contain an ACPI table header but
+no other data. This change adds support to dump these tables. Any tables
+shorter than the length of an ACPI table header remain in error (an error
+message is emitted). Reported by Yi Li.
+
+Debugger: Echo actual command along with the "unknown command" message.
+
+----------------------------------------
23 August 2013. Summary of changes for version 20130823:
1) ACPICA kernel-resident subsystem:
diff --git a/sys/contrib/dev/acpica/common/acgetline.c b/sys/contrib/dev/acpica/common/acgetline.c
new file mode 100644
index 0000000..f0948df
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/acgetline.c
@@ -0,0 +1,440 @@
+/******************************************************************************
+ *
+ * Module Name: acgetline - local line editing
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+#include <contrib/dev/acpica/include/acparser.h>
+#include <contrib/dev/acpica/include/acdebug.h>
+
+#include <stdio.h>
+
+/*
+ * This is an os-independent implementation of line-editing services needed
+ * by the AcpiExec utility. It uses getchar() and putchar() and the existing
+ * history support provided by the AML debugger. It assumes that the terminal
+ * is in the correct line-editing mode such as raw and noecho. The OSL
+ * interface AcpiOsInitialize should do this. AcpiOsTerminate should put the
+ * terminal back into the original mode.
+ */
+#define _COMPONENT ACPI_OS_SERVICES
+ ACPI_MODULE_NAME ("acgetline")
+
+
+/* Local prototypes */
+
+static void
+AcpiAcClearLine (
+ UINT32 EndOfLine,
+ UINT32 CursorPosition);
+
+/* Various ASCII constants */
+
+#define _ASCII_NUL 0
+#define _ASCII_BACKSPACE 0x08
+#define _ASCII_TAB 0x09
+#define _ASCII_ESCAPE 0x1B
+#define _ASCII_SPACE 0x20
+#define _ASCII_LEFT_BRACKET 0x5B
+#define _ASCII_DEL 0x7F
+#define _ASCII_UP_ARROW 'A'
+#define _ASCII_DOWN_ARROW 'B'
+#define _ASCII_RIGHT_ARROW 'C'
+#define _ASCII_LEFT_ARROW 'D'
+#define _ASCII_NEWLINE '\n'
+
+extern UINT32 AcpiGbl_NextCmdNum;
+
+/* Erase a single character on the input command line */
+
+#define ACPI_CLEAR_CHAR() \
+ putchar (_ASCII_BACKSPACE); \
+ putchar (_ASCII_SPACE); \
+ putchar (_ASCII_BACKSPACE);
+
+/* Backup cursor by Count positions */
+
+#define ACPI_BACKUP_CURSOR(i, Count) \
+ for (i = 0; i < (Count); i++) \
+ {putchar (_ASCII_BACKSPACE);}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiAcClearLine
+ *
+ * PARAMETERS: EndOfLine - Current end-of-line index
+ * CursorPosition - Current cursor position within line
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Clear the entire command line the hard way, but probably the
+ * most portable.
+ *
+ *****************************************************************************/
+
+static void
+AcpiAcClearLine (
+ UINT32 EndOfLine,
+ UINT32 CursorPosition)
+{
+ UINT32 i;
+
+
+ if (CursorPosition < EndOfLine)
+ {
+ /* Clear line from current position to end of line */
+
+ for (i = 0; i < (EndOfLine - CursorPosition); i++)
+ {
+ putchar (' ');
+ }
+ }
+
+ /* Clear the entire line */
+
+ for (; EndOfLine > 0; EndOfLine--)
+ {
+ ACPI_CLEAR_CHAR ();
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiOsGetLine
+ *
+ * PARAMETERS: Buffer - Where to return the command line
+ * BufferLength - Maximum length of Buffer
+ * BytesRead - Where the actual byte count is returned
+ *
+ * RETURN: Status and actual bytes read
+ *
+ * DESCRIPTION: Get the next input line from the terminal. NOTE: terminal
+ * is expected to be in a mode that supports line-editing (raw,
+ * noecho). This function is intended to be very portable. Also,
+ * it uses the history support implemented in the AML debugger.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsGetLine (
+ char *Buffer,
+ UINT32 BufferLength,
+ UINT32 *BytesRead)
+{
+ char *NextCommand;
+ UINT32 MaxCommandIndex = AcpiGbl_NextCmdNum - 1;
+ UINT32 CurrentCommandIndex = MaxCommandIndex;
+ UINT32 PreviousCommandIndex = MaxCommandIndex;
+ int InputChar;
+ UINT32 CursorPosition = 0;
+ UINT32 EndOfLine = 0;
+ UINT32 i;
+
+
+ /* Always clear the line buffer before we read a new line */
+
+ memset (Buffer, 0, BufferLength);
+
+ /*
+ * This loop gets one character at a time (except for esc sequences)
+ * until a newline or error is detected.
+ *
+ * Note: Don't attempt to write terminal control ESC sequences, even
+ * though it makes certain things more difficult.
+ */
+ while (1)
+ {
+ if (EndOfLine >= (BufferLength - 1))
+ {
+ return (AE_BUFFER_OVERFLOW);
+ }
+
+ InputChar = getchar ();
+ switch (InputChar)
+ {
+ default: /* This is the normal character case */
+
+ /* Echo the character (at EOL) and copy it to the line buffer */
+
+ if (EndOfLine == CursorPosition)
+ {
+ putchar (InputChar);
+ Buffer[EndOfLine] = (char) InputChar;
+
+ EndOfLine++;
+ CursorPosition++;
+ Buffer[EndOfLine] = 0;
+ continue;
+ }
+
+ /* Insert character into the middle of the buffer */
+
+ memmove (&Buffer[CursorPosition + 1], &Buffer[CursorPosition],
+ (EndOfLine - CursorPosition + 1));
+
+ Buffer [CursorPosition] = (char) InputChar;
+ Buffer [EndOfLine + 1] = 0;
+
+ /* Display the new part of line starting at the new character */
+
+ fprintf (stdout, "%s", &Buffer[CursorPosition]);
+
+ /* Restore cursor */
+
+ ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition);
+ CursorPosition++;
+ EndOfLine++;
+ continue;
+
+ case _ASCII_DEL: /* Backspace key */
+
+ if (!EndOfLine) /* Any characters on the command line? */
+ {
+ continue;
+ }
+
+ if (EndOfLine == CursorPosition) /* Erase the final character */
+ {
+ ACPI_CLEAR_CHAR ();
+ EndOfLine--;
+ CursorPosition--;
+ continue;
+ }
+
+ if (!CursorPosition) /* Do not backup beyond start of line */
+ {
+ continue;
+ }
+
+ /* Remove the character from the line */
+
+ memmove (&Buffer[CursorPosition - 1], &Buffer[CursorPosition],
+ (EndOfLine - CursorPosition + 1));
+
+ /* Display the new part of line starting at the new character */
+
+ putchar (_ASCII_BACKSPACE);
+ fprintf (stdout, "%s ", &Buffer[CursorPosition - 1]);
+
+ /* Restore cursor */
+
+ ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition + 1);
+ EndOfLine--;
+ if (CursorPosition > 0)
+ {
+ CursorPosition--;
+ }
+ continue;
+
+ case _ASCII_NEWLINE: /* Normal exit case at end of command line */
+ case _ASCII_NUL:
+
+ /* Return the number of bytes in the command line string */
+
+ if (BytesRead)
+ {
+ *BytesRead = EndOfLine;
+ }
+
+ /* Echo, terminate string buffer, and exit */
+
+ putchar (InputChar);
+ Buffer[EndOfLine] = 0;
+ return (AE_OK);
+
+ case _ASCII_TAB:
+
+ /* Ignore */
+
+ continue;
+
+ case EOF:
+
+ return (AE_ERROR);
+
+ case _ASCII_ESCAPE:
+
+ /* Check for escape sequences of the form "ESC[x" */
+
+ InputChar = getchar ();
+ if (InputChar != _ASCII_LEFT_BRACKET)
+ {
+ continue; /* Ignore this ESC, does not have the '[' */
+ }
+
+ /* Get the code following the ESC [ */
+
+ InputChar = getchar (); /* Backup one character */
+ switch (InputChar)
+ {
+ case _ASCII_LEFT_ARROW:
+
+ if (CursorPosition > 0)
+ {
+ putchar (_ASCII_BACKSPACE);
+ CursorPosition--;
+ }
+ continue;
+
+ case _ASCII_RIGHT_ARROW:
+ /*
+ * Move one character forward. Do this without sending
+ * ESC sequence to the terminal for max portability.
+ */
+ if (CursorPosition < EndOfLine)
+ {
+ /* Backup to start of line and print the entire line */
+
+ ACPI_BACKUP_CURSOR (i, CursorPosition);
+ fprintf (stdout, "%s", Buffer);
+
+ /* Backup to where the cursor should be */
+
+ CursorPosition++;
+ ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition);
+ }
+ continue;
+
+ case _ASCII_UP_ARROW:
+
+ /* If no commands available or at start of history list, ignore */
+
+ if (!CurrentCommandIndex)
+ {
+ continue;
+ }
+
+ /* Manage our up/down progress */
+
+ if (CurrentCommandIndex > PreviousCommandIndex)
+ {
+ CurrentCommandIndex = PreviousCommandIndex;
+ }
+
+ /* Get the historical command from the debugger */
+
+ NextCommand = AcpiDbGetHistoryByIndex (CurrentCommandIndex);
+ if (!NextCommand)
+ {
+ return (AE_ERROR);
+ }
+
+ /* Make this the active command and echo it */
+
+ AcpiAcClearLine (EndOfLine, CursorPosition);
+ strcpy (Buffer, NextCommand);
+ fprintf (stdout, "%s", Buffer);
+ EndOfLine = CursorPosition = strlen (Buffer);
+
+ PreviousCommandIndex = CurrentCommandIndex;
+ CurrentCommandIndex--;
+ continue;
+
+ case _ASCII_DOWN_ARROW:
+
+ if (!MaxCommandIndex) /* Any commands available? */
+ {
+ continue;
+ }
+
+ /* Manage our up/down progress */
+
+ if (CurrentCommandIndex < PreviousCommandIndex)
+ {
+ CurrentCommandIndex = PreviousCommandIndex;
+ }
+
+ /* If we are the end of the history list, output a clear new line */
+
+ if ((CurrentCommandIndex + 1) > MaxCommandIndex)
+ {
+ AcpiAcClearLine (EndOfLine, CursorPosition);
+ EndOfLine = CursorPosition = 0;
+ PreviousCommandIndex = CurrentCommandIndex;
+ continue;
+ }
+
+ PreviousCommandIndex = CurrentCommandIndex;
+ CurrentCommandIndex++;
+
+ /* Get the historical command from the debugger */
+
+ NextCommand = AcpiDbGetHistoryByIndex (CurrentCommandIndex);
+ if (!NextCommand)
+ {
+ return (AE_ERROR);
+ }
+
+ /* Make this the active command and echo it */
+
+ AcpiAcClearLine (EndOfLine, CursorPosition);
+ strcpy (Buffer, NextCommand);
+ fprintf (stdout, "%s", Buffer);
+ EndOfLine = CursorPosition = strlen (Buffer);
+ continue;
+
+ case 0x31:
+ case 0x32:
+ case 0x33:
+ case 0x34:
+ case 0x35:
+ case 0x36:
+ /*
+ * Ignore the various keys like insert/delete/home/end, etc.
+ * But we must eat the final character of the ESC sequence.
+ */
+ InputChar = getchar ();
+ continue;
+
+ default:
+
+ /* Ignore random escape sequences that we don't care about */
+
+ continue;
+ }
+ continue;
+ }
+ }
+}
diff --git a/sys/contrib/dev/acpica/common/adfile.c b/sys/contrib/dev/acpica/common/adfile.c
index 5cde806..ed5dc99 100644
--- a/sys/contrib/dev/acpica/common/adfile.c
+++ b/sys/contrib/dev/acpica/common/adfile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acapps.h>
@@ -199,20 +199,28 @@ FlGenerateFilename (
{
char *Position;
char *NewFilename;
+ char *DirectoryPosition;
/*
- * Copy the original filename to a new buffer. Leave room for the worst case
- * where we append the suffix, an added dot and the null terminator.
+ * Copy the original filename to a new buffer. Leave room for the worst
+ * case where we append the suffix, an added dot and the null terminator.
*/
- NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE)
+ NewFilename = UtStringCacheCalloc ((ACPI_SIZE)
strlen (InputFilename) + strlen (Suffix) + 2);
+ if (!NewFilename)
+ {
+ return (NULL);
+ }
+
strcpy (NewFilename, InputFilename);
/* Try to find the last dot in the filename */
+ DirectoryPosition = strrchr (NewFilename, '/');
Position = strrchr (NewFilename, '.');
- if (Position)
+
+ if (Position && (Position > DirectoryPosition))
{
/* Tack on the new suffix */
@@ -247,7 +255,7 @@ FlStrdup (
char *NewString;
- NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1);
+ NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1);
if (!NewString)
{
return (NULL);
@@ -288,7 +296,6 @@ FlSplitInputPathname (
*OutDirectoryPath = NULL;
- *OutFilename = NULL;
if (!InputPath)
{
@@ -334,6 +341,12 @@ FlSplitInputPathname (
}
*OutDirectoryPath = DirectoryPath;
- *OutFilename = Filename;
+
+ if (OutFilename)
+ {
+ *OutFilename = Filename;
+ return (AE_OK);
+ }
+
return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/common/adisasm.c b/sys/contrib/dev/acpica/common/adisasm.c
index c361a6a..dd1a93d 100644
--- a/sys/contrib/dev/acpica/common/adisasm.c
+++ b/sys/contrib/dev/acpica/common/adisasm.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,12 +41,9 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#include <contrib/dev/acpica/include/acpi.h>
-#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/amlcode.h>
-#include <contrib/dev/acpica/include/acdebug.h>
#include <contrib/dev/acpica/include/acdisasm.h>
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -60,29 +57,8 @@
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("adisasm")
-/*
- * Older versions of Bison won't emit this external in the generated header.
- * Newer versions do emit the external, so we don't need to do it.
- */
-#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
-extern int AslCompilerdebug;
-#endif
-
-ACPI_STATUS
-NsDisplayNamespace (
- void);
-
-void
-NsSetupNamespaceListing (
- void *Handle);
-
-
/* Local prototypes */
-static UINT32
-AdGetFileSize (
- FILE *File);
-
static void
AdCreateTableHeader (
char *Filename,
@@ -152,39 +128,7 @@ AcpiDsMethodDataInitArgs (
static ACPI_TABLE_DESC LocalTables[1];
-static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
-
-
-/*******************************************************************************
- *
- * FUNCTION: AdGetFileSize
- *
- * PARAMETERS: File - Open file handle
- *
- * RETURN: File Size
- *
- * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
- *
- ******************************************************************************/
-
-static UINT32
-AdGetFileSize (
- FILE *File)
-{
- UINT32 FileSize;
- long Offset;
-
-
- Offset = ftell (File);
-
- fseek (File, 0, SEEK_END);
- FileSize = (UINT32) ftell (File);
-
- /* Restore file pointer */
-
- fseek (File, Offset, SEEK_SET);
- return (FileSize);
-}
+ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
/*******************************************************************************
@@ -206,7 +150,7 @@ AdInitialize (
ACPI_STATUS Status;
- /* ACPI CA subsystem initialization */
+ /* ACPICA subsystem initialization */
Status = AcpiOsInitialize ();
if (ACPI_FAILURE (Status))
@@ -250,7 +194,6 @@ AdInitialize (
* OutToFile - TRUE if output should go to a file
* Prefix - Path prefix for output
* OutFilename - where the filename is returned
- * GetAllTables - TRUE if all tables are desired
*
* RETURN: Status
*
@@ -263,8 +206,7 @@ AdAmlDisassemble (
BOOLEAN OutToFile,
char *Filename,
char *Prefix,
- char **OutFilename,
- BOOLEAN GetAllTables)
+ char **OutFilename)
{
ACPI_STATUS Status;
char *DisasmFilename = NULL;
@@ -348,7 +290,7 @@ AdAmlDisassemble (
}
else
{
- Status = AdGetLocalTables (Filename, GetAllTables);
+ Status = AdGetLocalTables ();
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get ACPI tables, %s\n",
@@ -383,7 +325,7 @@ AdAmlDisassemble (
/* Create/Open a disassembly output file */
DisasmFilename = FlGenerateFilename (Prefix, FILE_SUFFIX_DISASSEMBLY);
- if (!OutFilename)
+ if (!DisasmFilename)
{
fprintf (stderr, "Could not generate output filename\n");
Status = AE_ERROR;
@@ -395,6 +337,7 @@ AdAmlDisassemble (
{
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
Status = AE_ERROR;
+ ACPI_FREE (DisasmFilename);
goto Cleanup;
}
@@ -415,7 +358,7 @@ AdAmlDisassemble (
fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
Table->Signature);
fprintf (stderr, "Formatted output: %s - %u bytes\n",
- DisasmFilename, AdGetFileSize (File));
+ DisasmFilename, CmGetFileSize (File));
}
else
{
@@ -471,9 +414,10 @@ AdAmlDisassemble (
"reparsing with new information\n",
AcpiDmGetExternalMethodCount ());
- /* Reparse, rebuild namespace. no need to xref namespace */
+ /* Reparse, rebuild namespace */
AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
+ AcpiGbl_ParseOpRoot = NULL;
AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
AcpiGbl_RootNode = NULL;
@@ -487,6 +431,9 @@ AdAmlDisassemble (
AcpiGbl_RootNodeStruct.Flags = 0;
Status = AcpiNsRootInitialize ();
+
+ /* New namespace, add the external definitions first */
+
AcpiDmAddExternalsToNamespace ();
/* Parse the table again. No need to reload it, however */
@@ -499,6 +446,14 @@ AdAmlDisassemble (
goto Cleanup;
}
+ /* Cross reference the namespace again */
+
+ AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
+
+ AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
+
if (AslCompilerdebug)
{
AcpiOsPrintf ("/**** After second load and resource conversion\n");
@@ -533,7 +488,15 @@ AdAmlDisassemble (
fprintf (stderr, "Disassembly completed\n");
fprintf (stderr, "ASL Output: %s - %u bytes\n",
- DisasmFilename, AdGetFileSize (File));
+ DisasmFilename, CmGetFileSize (File));
+
+ if (Gbl_MapfileFlag)
+ {
+ fprintf (stderr, "%14s %s - %u bytes\n",
+ Gbl_Files[ASL_FILE_MAP_OUTPUT].ShortDescription,
+ Gbl_Files[ASL_FILE_MAP_OUTPUT].Filename,
+ FlGetFileSize (ASL_FILE_MAP_OUTPUT));
+ }
}
}
@@ -570,7 +533,7 @@ Cleanup:
*
* RETURN: None
*
- * DESCRIPTION: Create the disassembler header, including ACPI CA signon with
+ * DESCRIPTION: Create the disassembler header, including ACPICA signon with
* current time and date.
*
*****************************************************************************/
@@ -602,7 +565,7 @@ AdDisassemblerHeader (
*
* RETURN: None
*
- * DESCRIPTION: Create the ASL table header, including ACPI CA signon with
+ * DESCRIPTION: Create the ASL table header, including ACPICA signon with
* current time and date.
*
*****************************************************************************/
@@ -679,9 +642,18 @@ AdCreateTableHeader (
}
else
{
- NewFilename = ACPI_ALLOCATE_ZEROED (9);
- strncat (NewFilename, Table->Signature, 4);
- strcat (NewFilename, ".aml");
+ NewFilename = UtStringCacheCalloc (9);
+ if (NewFilename)
+ {
+ strncat (NewFilename, Table->Signature, 4);
+ strcat (NewFilename, ".aml");
+ }
+ }
+
+ if (!NewFilename)
+ {
+ AcpiOsPrintf (" **** Could not generate AML output filename\n");
+ return;
}
/* Open the ASL definition block */
@@ -690,8 +662,6 @@ AdCreateTableHeader (
"DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
NewFilename, Table->Signature, Table->Revision,
Table->OemId, Table->OemTableId, Table->OemRevision);
-
- ACPI_FREE (NewFilename);
}
@@ -726,6 +696,7 @@ AdDisplayTables (
}
AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX);
+ MpEmitMappingInfo ();
if (AcpiGbl_DbOpt_verbose)
{
@@ -746,8 +717,7 @@ AdDisplayTables (
*
* FUNCTION: AdGetLocalTables
*
- * PARAMETERS: Filename - Not used
- * GetAllTables - TRUE if all tables are desired
+ * PARAMETERS: None
*
* RETURN: Status
*
@@ -757,105 +727,36 @@ AdDisplayTables (
ACPI_STATUS
AdGetLocalTables (
- char *Filename,
- BOOLEAN GetAllTables)
+ void)
{
ACPI_STATUS Status;
ACPI_TABLE_HEADER TableHeader;
ACPI_TABLE_HEADER *NewTable;
- UINT32 NumTables;
- UINT32 PointerSize;
UINT32 TableIndex;
- if (GetAllTables)
- {
- ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_RSDT);
- AcpiOsTableOverride (&TableHeader, &NewTable);
- if (!NewTable)
- {
- fprintf (stderr, "Could not obtain RSDT\n");
- return (AE_NO_ACPI_TABLES);
- }
- else
- {
- AdWriteTable (NewTable, NewTable->Length,
- ACPI_SIG_RSDT, NewTable->OemTableId);
- }
-
- if (ACPI_COMPARE_NAME (NewTable->Signature, ACPI_SIG_RSDT))
- {
- PointerSize = sizeof (UINT32);
- }
- else
- {
- PointerSize = sizeof (UINT64);
- }
-
- /*
- * Determine the number of tables pointed to by the RSDT/XSDT.
- * This is defined by the ACPI Specification to be the number of
- * pointers contained within the RSDT/XSDT. The size of the pointers
- * is architecture-dependent.
- */
- NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize;
- AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n",
- NumTables, NewTable->Signature);
-
- /* Get the FADT */
-
- ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_FADT);
- AcpiOsTableOverride (&TableHeader, &NewTable);
- if (NewTable)
- {
- AdWriteTable (NewTable, NewTable->Length,
- ACPI_SIG_FADT, NewTable->OemTableId);
- }
- AcpiOsPrintf ("\n");
-
- /* Don't bother with FACS, it is usually all zeros */
- }
-
- /* Always get the DSDT */
+ /* Get the DSDT via table override */
ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT);
AcpiOsTableOverride (&TableHeader, &NewTable);
- if (NewTable)
- {
- AdWriteTable (NewTable, NewTable->Length,
- ACPI_SIG_DSDT, NewTable->OemTableId);
-
- /* Store DSDT in the Table Manager */
-
- Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
- 0, &TableIndex);
- if (ACPI_FAILURE (Status))
- {
- fprintf (stderr, "Could not store DSDT\n");
- return (AE_NO_ACPI_TABLES);
- }
- }
- else
+ if (!NewTable)
{
fprintf (stderr, "Could not obtain DSDT\n");
return (AE_NO_ACPI_TABLES);
}
-#if 0
- /* TBD: Future implementation */
+ AdWriteTable (NewTable, NewTable->Length,
+ ACPI_SIG_DSDT, NewTable->OemTableId);
- AcpiOsPrintf ("\n");
-
- /* Get all SSDTs */
+ /* Store DSDT in the Table Manager */
- ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_SSDT);
- do
+ Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
+ 0, &TableIndex);
+ if (ACPI_FAILURE (Status))
{
- NewTable = NULL;
- Status = AcpiOsTableOverride (&TableHeader, &NewTable);
-
- } while (NewTable);
-#endif
+ fprintf (stderr, "Could not store DSDT\n");
+ return (AE_NO_ACPI_TABLES);
+ }
return (AE_OK);
}
@@ -944,7 +845,8 @@ AdParseTable (
if (LoadTable)
{
Status = AcpiTbStoreTable ((ACPI_PHYSICAL_ADDRESS) Table, Table,
- Table->Length, ACPI_TABLE_ORIGIN_ALLOCATED, &TableIndex);
+ Table->Length, ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
+ &TableIndex);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -979,9 +881,12 @@ AdParseTable (
return (AE_OK);
}
- /* Pass 3: Parse control methods and link their parse trees into the main parse tree */
-
- fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
+ /*
+ * Pass 3: Parse control methods and link their parse trees
+ * into the main parse tree
+ */
+ fprintf (stderr,
+ "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
fprintf (stderr, "\n");
diff --git a/sys/contrib/dev/acpica/common/adwalk.c b/sys/contrib/dev/acpica/common/adwalk.c
index 80f6d83..df0222d 100644
--- a/sys/contrib/dev/acpica/common/adwalk.c
+++ b/sys/contrib/dev/acpica/common/adwalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -469,8 +468,9 @@ AcpiDmFindOrphanDescending (
!ChildOp->Common.Node)
{
AcpiNsExternalizeName (ACPI_UINT32_MAX, ChildOp->Common.Value.String,
- NULL, &Path);
- AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n", Op->Common.AmlOpName, Path);
+ NULL, &Path);
+ AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n",
+ Op->Common.AmlOpName, Path);
ACPI_FREE (Path);
NextOp = Op->Common.Next;
@@ -478,22 +478,26 @@ AcpiDmFindOrphanDescending (
{
/* This NamePath has no args, assume it is an integer */
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
return (AE_OK);
}
ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
- AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op));
+ AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n",
+ ArgCount, AcpiDmCountChildren (Op));
if (ArgCount < 1)
{
/* One Arg means this is just a Store(Name,Target) */
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
return (AE_OK);
}
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
}
break;
#endif
@@ -509,7 +513,8 @@ AcpiDmFindOrphanDescending (
{
/* This NamePath has no args, assume it is an integer */
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
return (AE_OK);
}
@@ -518,11 +523,13 @@ AcpiDmFindOrphanDescending (
{
/* One Arg means this is just a Store(Name,Target) */
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
return (AE_OK);
}
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
}
break;
@@ -554,7 +561,8 @@ AcpiDmFindOrphanDescending (
/* And namepath is the first argument */
(ParentOp->Common.Value.Arg == Op))
{
- AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (Op,
+ Op->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
break;
}
}
@@ -564,8 +572,8 @@ AcpiDmFindOrphanDescending (
* operator) - it *must* be a method invocation, nothing else is
* grammatically possible.
*/
- AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
-
+ AcpiDmAddOpToExternalList (Op,
+ Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
}
break;
@@ -741,6 +749,7 @@ AcpiDmXrefDescendingOp (
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *Object;
UINT32 ParamCount = 0;
+ char *Pathname;
WalkState = Info->WalkState;
@@ -750,11 +759,13 @@ AcpiDmXrefDescendingOp (
if ((!(OpInfo->Flags & AML_NAMED)) &&
(!(OpInfo->Flags & AML_CREATE)) &&
- (Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP))
+ (Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP) &&
+ (Op->Common.AmlOpcode != AML_NOTIFY_OP))
{
goto Exit;
}
+
/* Get the NamePath from the appropriate place */
if (OpInfo->Flags & AML_NAMED)
@@ -791,6 +802,10 @@ AcpiDmXrefDescendingOp (
Path = NextOp->Common.Value.String;
}
}
+ else if (Op->Common.AmlOpcode == AML_NOTIFY_OP)
+ {
+ Path = Op->Common.Value.Arg->Asl.Value.String;
+ }
else
{
Path = Op->Common.Value.String;
@@ -808,11 +823,14 @@ AcpiDmXrefDescendingOp (
* The namespace is also used as a lookup table for references to resource
* descriptors and the fields within them.
*/
+ Node = NULL;
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
WalkState, &Node);
if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
{
+ /* Node was created by an External() statement */
+
Status = AE_NOT_FOUND;
}
@@ -820,25 +838,38 @@ AcpiDmXrefDescendingOp (
{
if (Status == AE_NOT_FOUND)
{
- AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0);
-
/*
- * We could install this into the namespace, but we catch duplicate
- * externals when they are added to the list.
+ * Add this symbol as an external declaration, except if the
+ * parent is a CondRefOf operator. For this operator, we do not
+ * need an external, nor do we want one, since this can cause
+ * disassembly problems if the symbol is actually a control
+ * method.
*/
-#if 0
- Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
- ACPI_IMODE_LOAD_PASS1, ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &Node);
-#endif
+ if (!(Op->Asl.Parent &&
+ (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP)))
+ {
+ if (Node)
+ {
+ AcpiDmAddNodeToExternalList (Node,
+ (UINT8) ObjectType, 0, 0);
+ }
+ else
+ {
+ AcpiDmAddOpToExternalList (Op, Path,
+ (UINT8) ObjectType, 0, 0);
+ }
+ }
}
}
/*
- * Found the node in external table, add it to external list
- * Node->OwnerId == 0 indicates built-in ACPI Names, _OS_ etc
+ * Found the node, but check if it came from an external table.
+ * Add it to external list. Note: Node->OwnerId == 0 indicates
+ * one of the built-in ACPI Names (_OS_ etc.) which can safely
+ * be ignored.
*/
- else if (Node->OwnerId && WalkState->OwnerId != Node->OwnerId)
+ else if (Node->OwnerId &&
+ (WalkState->OwnerId != Node->OwnerId))
{
ObjectType2 = ObjectType;
@@ -852,7 +883,16 @@ AcpiDmXrefDescendingOp (
}
}
- AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount | 0x80);
+ Pathname = AcpiNsGetExternalPathname (Node);
+ if (!Pathname)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ AcpiDmAddNodeToExternalList (Node, (UINT8) ObjectType2,
+ ParamCount, ACPI_EXT_RESOLVED_REFERENCE);
+
+ ACPI_FREE (Pathname);
Op->Common.Node = Node;
}
else
diff --git a/sys/contrib/dev/acpica/common/ahids.c b/sys/contrib/dev/acpica/common/ahids.c
new file mode 100644
index 0000000..d272fda
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/ahids.c
@@ -0,0 +1,240 @@
+/******************************************************************************
+ *
+ * Module Name: ahids - Table of ACPI/PNP _HID/_CID values
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("ahids")
+
+
+/*
+ * ACPI/PNP Device IDs with description strings
+ */
+const AH_DEVICE_ID AslDeviceIds[] =
+{
+ {"10EC5640", "Realtek I2S Audio Codec"},
+ {"80860F09", "Intel PWM Controller"},
+ {"80860F0A", "Intel Atom UART Controller"},
+ {"80860F0E", "Intel SPI Controller"},
+ {"80860F14", "Intel Baytrail SDIO/MMC Host Controller"},
+ {"80860F28", "Intel SST Audio DSP"},
+ {"80860F41", "Intel Baytrail I2C Host Controller"},
+ {"ACPI0001", "SMBus 1.0 Host Controller"},
+ {"ACPI0002", "Smart Battery Subsystem"},
+ {"ACPI0003", "Power Source Device"},
+ {"ACPI0004", "Module Device"},
+ {"ACPI0005", "SMBus 2.0 Host Controller"},
+ {"ACPI0006", "GPE Block Device"},
+ {"ACPI0007", "Processor Device"},
+ {"ACPI0008", "Ambient Light Sensor Device"},
+ {"ACPI0009", "I/O xAPIC Device"},
+ {"ACPI000A", "I/O APIC Device"},
+ {"ACPI000B", "I/O SAPIC Device"},
+ {"ACPI000C", "Processor Aggregator Device"},
+ {"ACPI000D", "Power Meter Device"},
+ {"ACPI000E", "Time and Alarm Device"},
+ {"ACPI000F", "User Presence Detection Device"},
+ {"ADMA0F28", "Intel Audio DMA"},
+ {"AMCR0F28", "Intel Audio Machine Driver"},
+ {"ATK4001", "Asus Radio Control Button"},
+ {"ATML1000", "Atmel Touchscreen Controller"},
+ {"AUTH2750", "AuthenTec AES2750"},
+ {"BCM2E39", "Broadcom BT Serial Bus Driver over UART Bus Enumerator"},
+ {"BCM4752E", "Broadcom GPS Controller"},
+ {"BMG0160", "Bosch Gyro Sensor"},
+ {"CPLM3218", "Capella Micro CM3218x Ambient Light Sensor"},
+ {"DELLABCE", "Dell Airplane Mode Switch Driver"},
+ {"DLAC3002", "Qualcomm Atheros Bluetooth UART Transport"},
+ {"FTTH5506", "FocalTech 5506 Touch Controller"},
+ {"HAD0F28", "Intel HDMI Audio Driver"},
+ {"INBC0000", "GPIO Expander"},
+ {"INT0002", "Virtual GPIO Controller"},
+ {"INT0800", "Intel 82802 Firmware Hub Device"},
+ {"INT3394", "ACPI System Fan"},
+ {"INT3396", "Standard Power Management Controller"},
+ {"INT33A0", "Intel Smart Connect Technology Device"},
+ {"INT33A1", "Intel Power Engine"},
+ {"INT33BB", "Intel Baytrail SD Host Controller"},
+ {"INT33BD", "Intel Baytrail Mailbox Device"},
+ {"INT33BE", "Camera Sensor OV5693"},
+ {"INT33C0", "Intel Serial I/O SPI Host Controller"},
+ {"INT33C1", "Intel Serial I/O SPI Host Controller"},
+ {"INT33C2", "Intel Serial I/O I2C Host Controller"},
+ {"INT33C3", "Intel Serial I/O I2C Host Controller"},
+ {"INT33C4", "Intel Serial I/O UART Host Controller"},
+ {"INT33C5", "Intel Serial I/O UART Host Controller"},
+ {"INT33C6", "Intel SD Host Controller"},
+ {"INT33C7", "Intel Serial I/O GPIO Host Controller"},
+ {"INT33C8", "Intel Smart Sound Technology Host Controller"},
+ {"INT33C9", "Wolfson Microelectronics Audio WM5102"},
+ {"INT33CA", "Intel SPB Peripheral"},
+ {"INT33CB", "Intel Smart Sound Technology Audio Codec"},
+ {"INT33D1", "Intel GPIO Buttons"},
+ {"INT33D2", "Intel GPIO Buttons"},
+ {"INT33D3", "Intel GPIO Buttons"},
+ {"INT33D4", "Intel GPIO Buttons"},
+ {"INT33D6", "Intel Virtual Buttons Device"},
+ {"INT33F0", "Camera Sensor MT9M114"},
+ {"INT33F4", "XPOWER PMIC Controller"},
+ {"INT33F5", "TI PMIC Controller"},
+ {"INT33FB", "MIPI-CSI Camera Sensor OV2722"},
+ {"INT33FC", "Intel Baytrail GPIO Controller"},
+ {"INT33FD", "Intel Baytrail Power Management IC"},
+ {"INT33FE", "XPOWER Battery Device"},
+ {"INT3400", "Intel Dynamic Power Performance Management"},
+ {"INT3401", "Intel Extended Thermal Model CPU"},
+ {"INT3403", "DPTF Temperature Sensor"},
+ {"INT3406", "Intel Dynamic Platform & Thermal Framework Display Participant"},
+ {"INT3407", "DPTF Platform Power Meter"},
+ {"INT340E", "Motherboard Resources"},
+ {"INT3420", "Intel Bluetooth RF Kill"},
+ {"INT3F0D", "ACPI Motherboard Resources"},
+ {"INTCF1A", "Sony IMX175 Camera Sensor"},
+ {"INTCFD9", "Intel Baytrail SOC GPIO Controller"},
+ {"INTL9C60", "Intel Baytrail SOC DMA Controller"},
+ {"INVN6500", "InvenSense MPU-6500 Six Axis Gyroscope and Accelerometer"},
+ {"LNXCPU", "Linux Logical CPU"},
+ {"LNXPOWER", "ACPI Power Resource (power gating)"},
+ {"LNXPWRBN", "System Power Button"},
+ {"LNXSYBUS", "System Bus"},
+ {"LNXSYSTM", "ACPI Root Node"},
+ {"LNXTHERM", "ACPI Thermal Zone"},
+ {"LNXVIDEO", "ACPI Video Controller"},
+ {"MAX17047", "Fuel Gauge Controller"},
+ {"MSFT0101", "TPM 2.0 Security Device"},
+ {"NXP5442", "NXP 5442 Near Field Communications Controller"},
+ {"NXP5472", "NXP NFC"},
+ {"PNP0000", "8259-compatible Programmable Interrupt Controller"},
+ {"PNP0001", "EISA Interrupt Controller"},
+ {"PNP0002", "MCA Interrupt Controller"},
+ {"PNP0003", "IO-APIC Interrupt Controller"},
+ {"PNP0100", "PC-class System Timer"},
+ {"PNP0103", "HPET System Timer"},
+ {"PNP0200", "PC-class DMA Controller"},
+ {"PNP0300", "IBM PC/XT Keyboard Controller (83 key)"},
+ {"PNP0301", "IBM PC/XT Keyboard Controller (86 key)"},
+ {"PNP0302", "IBM PC/XT Keyboard Controller (84 key)"},
+ {"PNP0303", "IBM Enhanced Keyboard (101/102-key, PS/2 Mouse)"},
+ {"PNP0400", "Standard LPT Parallel Port"},
+ {"PNP0401", "ECP Parallel Port"},
+ {"PNP0500", "Standard PC COM Serial Port"},
+ {"PNP0501", "16550A-compatible COM Serial Port"},
+ {"PNP0510", "Generic IRDA-compatible Device"},
+ {"PNP0800", "Microsoft Sound System Compatible Device"},
+ {"PNP0A03", "PCI Bus"},
+ {"PNP0A05", "Generic Container Device"},
+ {"PNP0A06", "Generic Container Device"},
+ {"PNP0A08", "PCI Express Bus"},
+ {"PNP0B00", "AT Real-Time Clock"},
+ {"PNP0B01", "Intel PIIX4-compatible RTC/CMOS Device"},
+ {"PNP0B02", "Dallas Semiconductor-compatible RTC/CMOS Device"},
+ {"PNP0C01", "System Board"},
+ {"PNP0C02", "PNP Motherboard Resources"},
+ {"PNP0C04", "x87-compatible Floating Point Processing Unit"},
+ {"PNP0C08", "ACPI Core Hardware"},
+ {"PNP0C09", "Embedded Controller Device"},
+ {"PNP0C0A", "Control Method Battery"},
+ {"PNP0C0B", "Fan (Thermal Solution)"},
+ {"PNP0C0C", "Power Button Device"},
+ {"PNP0C0D", "Lid Device"},
+ {"PNP0C0E", "Sleep Button Device"},
+ {"PNP0C0F", "PCI Interrupt Link Device"},
+ {"PNP0C10", "System Indicator Device"},
+ {"PNP0C11", "Thermal Zone"},
+ {"PNP0C12", "Device Bay Controller"},
+ {"PNP0C14", "Windows Management Instrumentation Device"},
+ {"PNP0C15", "Docking Station"},
+ {"PNP0C40", "Standard Button Controller"},
+ {"PNP0C50", "HID Protocol Device (I2C bus)"},
+ {"PNP0C60", "Display Sensor Device"},
+ {"PNP0C70", "Dock Sensor Device"},
+ {"PNP0C80", "Memory Device"},
+ {"PNP0D10", "XHCI USB Controller with debug"},
+ {"PNP0D15", "XHCI USB Controller without debug"},
+ {"PNP0D20", "EHCI USB Controller without debug"},
+ {"PNP0D25", "EHCI USB Controller with debug"},
+ {"PNP0D40", "SDA Standard Compliant SD Host Controller"},
+ {"PNP0D80", "Windows-compatible System Power Management Controller"},
+ {"PNP0F03", "Microsoft PS/2-style Mouse"},
+ {"PNP0F13", "PS/2 Mouse"},
+ {"RTL8723", "Realtek Wireless Controller"},
+ {"SMB0349", "Charger"},
+ {"SMO91D0", "Sensor Hub"},
+ {"SMSC3750", "SMSC 3750 USB MUX"},
+ {"SSPX0000", "Intel SSP Device"},
+ {"TBQ24296", "Charger"},
+
+ {NULL, NULL}
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAhMatchHardwareId
+ *
+ * PARAMETERS: HardwareId - String representation of an _HID or _CID
+ *
+ * RETURN: ID info struct. NULL if HardwareId is not found
+ *
+ * DESCRIPTION: Lookup an _HID/_CID in the device ID table
+ *
+ ******************************************************************************/
+
+const AH_DEVICE_ID *
+AcpiAhMatchHardwareId (
+ char *HardwareId)
+{
+ const AH_DEVICE_ID *Info;
+
+
+ for (Info = AslDeviceIds; Info->Name; Info++)
+ {
+ if (!ACPI_STRCMP (HardwareId, Info->Name))
+ {
+ return (Info);
+ }
+ }
+
+ return (NULL);
+}
diff --git a/sys/contrib/dev/acpica/common/ahpredef.c b/sys/contrib/dev/acpica/common/ahpredef.c
index de28b40..4522ca6 100644
--- a/sys/contrib/dev/acpica/common/ahpredef.c
+++ b/sys/contrib/dev/acpica/common/ahpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,6 +44,9 @@
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("ahpredef")
+
/*
* iASL only needs a partial table (short descriptions only).
* AcpiHelp needs the full table.
@@ -94,6 +97,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_BTM", "Battery Time", "Returns the battery runtime"),
AH_PREDEF ("_BTP", "Battery Trip Point", "Sets a Control Method Battery trip point"),
AH_PREDEF ("_CBA", "Configuration Base Address", "Sets the base address for a PCI Express host bridge"),
+ AH_PREDEF ("_CCA", "Cache Coherency Attribute", "Returns a device's support level for cache coherency"),
AH_PREDEF ("_CDM", "Clock Domain", "Returns a logical processor's clock domain identifier"),
AH_PREDEF ("_CID", "Compatible ID", "Returns a device's Plug and Play Compatible ID list"),
AH_PREDEF ("_CLS", "Class Code", "Returns PCI class code and subclass"),
@@ -118,6 +122,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"),
AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"),
AH_PREDEF ("_DRS", "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"),
+ AH_PREDEF ("_DSD", "Device-Specific Data", "Returns a list of device property information"),
AH_PREDEF ("_DSM", "Device-Specific Method", "Executes device-specific functions"),
AH_PREDEF ("_DSS", "Device Set State", "Sets the display device state"),
AH_PREDEF ("_DSW", "Device Sleep Wake", "Sets the sleep and wake transition states for a device"),
@@ -169,6 +174,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_LID", "Lid Status", "Returns the open/closed status of the lid on a mobile system"),
AH_PREDEF ("_LIN", "Lines In Use", "Handshake lines, Resource Descriptor field"),
AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"),
+ AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"),
AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"),
AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"),
AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"),
@@ -321,3 +327,34 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"),
AH_PREDEF (NULL, NULL, NULL)
};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAhMatchPredefinedName
+ *
+ * PARAMETERS: Nameseg - Predefined name string
+ *
+ * RETURN: ID info struct. NULL if Nameseg not found
+ *
+ * DESCRIPTION: Lookup a predefined name.
+ *
+ ******************************************************************************/
+
+const AH_PREDEFINED_NAME *
+AcpiAhMatchPredefinedName (
+ char *Nameseg)
+{
+ const AH_PREDEFINED_NAME *Info;
+
+
+ for (Info = AslPredefinedInfo; Info->Name; Info++)
+ {
+ if (ACPI_COMPARE_NAME (Nameseg, Info->Name))
+ {
+ return (Info);
+ }
+ }
+
+ return (NULL);
+}
diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c
new file mode 100644
index 0000000..ef53008
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/ahuuids.c
@@ -0,0 +1,132 @@
+/******************************************************************************
+ *
+ * Module Name: ahuuids - Table of known ACPI-related UUIDs
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("ahuuids")
+
+/*
+ * Table of "known" (ACPI-related) UUIDs
+ */
+const AH_UUID AcpiUuids[] =
+{
+ {"PCI Host Bridge Device",
+ "33db4d5b-1ff7-401c-9657-7441c03dd766"},
+
+ {"Platform-wide Capabilities",
+ "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"},
+
+ {"Dynamic Enumeration",
+ "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"},
+
+ {"GPIO Controller",
+ "4f248f40-d5e2-499f-834c-27758ea1cd3f"},
+
+ {"Battery Thermal Limit",
+ "4c2067e3-887d-475c-9720-4af1d3ed602e"},
+
+ {"Thermal Extensions",
+ "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"},
+
+ {"USB Controller",
+ "ce2ee385-00e6-48cb-9f05-2edb927c4899"},
+
+ {"HID I2C Device",
+ "3cdff6f7-4267-4555-ad05-b30a3d8938de"},
+
+ {"Power Button Device",
+ "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"},
+
+ {"Device Labeling Interface",
+ "e5c937d0-3553-4d7a-9117-ea4d19c3434d"},
+
+ {"SATA Controller",
+ "e4db149b-fcfe-425b-a6d8-92357d78fc7f"},
+
+ {"Physical Presence Interface",
+ "3dddfaa6-361b-4eb4-a424-8d10089d1653"},
+
+ {"Device Properties for _DSD",
+ "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"},
+
+ {NULL, NULL}
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAhMatchUuid
+ *
+ * PARAMETERS: Data - Data buffer containing a UUID
+ *
+ * RETURN: ASCII description string for the UUID if it is found.
+ *
+ * DESCRIPTION: Returns a description string for "known" UUIDs, which are
+ * are UUIDs that are related to ACPI in some way.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiAhMatchUuid (
+ UINT8 *Data)
+{
+ const AH_UUID *Info;
+ UINT8 UuidBuffer[UUID_BUFFER_LENGTH];
+
+
+ /* Walk the table of known ACPI-related UUIDs */
+
+ for (Info = AcpiUuids; Info->Description; Info++)
+ {
+ AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
+
+ if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH))
+ {
+ return (Info->Description);
+ }
+ }
+
+ return (NULL);
+}
diff --git a/sys/contrib/dev/acpica/common/cmfsize.c b/sys/contrib/dev/acpica/common/cmfsize.c
new file mode 100644
index 0000000..0f9b738
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/cmfsize.c
@@ -0,0 +1,113 @@
+/******************************************************************************
+ *
+ * Module Name: cfsize - Common get file size function
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acapps.h>
+#include <stdio.h>
+
+#define _COMPONENT ACPI_TOOLS
+ ACPI_MODULE_NAME ("cmfsize")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CmGetFileSize
+ *
+ * PARAMETERS: File - Open file descriptor
+ *
+ * RETURN: File Size. On error, -1 (ACPI_UINT32_MAX)
+ *
+ * DESCRIPTION: Get the size of a file. Uses seek-to-EOF. File must be open.
+ * Does not disturb the current file pointer.
+ *
+ ******************************************************************************/
+
+UINT32
+CmGetFileSize (
+ ACPI_FILE File)
+{
+ long FileSize;
+ long CurrentOffset;
+ ACPI_STATUS Status;
+
+
+ /* Save the current file pointer, seek to EOF to obtain file size */
+
+ CurrentOffset = AcpiOsGetFileOffset (File);
+ if (CurrentOffset < 0)
+ {
+ goto OffsetError;
+ }
+
+ Status = AcpiOsSetFileOffset (File, 0, ACPI_FILE_END);
+ if (ACPI_FAILURE (Status))
+ {
+ goto SeekError;
+ }
+
+ FileSize = AcpiOsGetFileOffset (File);
+ if (FileSize < 0)
+ {
+ goto OffsetError;
+ }
+
+ /* Restore original file pointer */
+
+ Status = AcpiOsSetFileOffset (File, CurrentOffset, ACPI_FILE_BEGIN);
+ if (ACPI_FAILURE (Status))
+ {
+ goto SeekError;
+ }
+
+ return ((UINT32) FileSize);
+
+
+OffsetError:
+ AcpiLogError ("Could not get file offset");
+ return (ACPI_UINT32_MAX);
+
+SeekError:
+ AcpiLogError ("Could not set file offset");
+ return (ACPI_UINT32_MAX);
+}
diff --git a/sys/contrib/dev/acpica/common/dmextern.c b/sys/contrib/dev/acpica/common/dmextern.c
index 56e2781..f8362e1 100644
--- a/sys/contrib/dev/acpica/common/dmextern.c
+++ b/sys/contrib/dev/acpica/common/dmextern.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,7 +67,7 @@
*/
static const char *AcpiGbl_DmTypeNames[] =
{
- /* 00 */ "", /* Type ANY */
+ /* 00 */ ", UnknownObj", /* Type ANY */
/* 01 */ ", IntObj",
/* 02 */ ", StrObj",
/* 03 */ ", BuffObj",
@@ -104,10 +104,19 @@ AcpiDmNormalizeParentPrefix (
char *Path);
static void
-AcpiDmAddToExternalListFromFile (
+AcpiDmAddPathToExternalList (
char *Path,
UINT8 Type,
- UINT32 Value);
+ UINT32 Value,
+ UINT16 Flags);
+
+static ACPI_STATUS
+AcpiDmCreateNewExternal (
+ char *ExternalPath,
+ char *InternalPath,
+ UINT8 Type,
+ UINT32 Value,
+ UINT16 Flags);
/*******************************************************************************
@@ -279,48 +288,41 @@ Cleanup:
ACPI_STATUS
AcpiDmAddToExternalFileList (
- char *PathList)
+ char *Pathname)
{
ACPI_EXTERNAL_FILE *ExternalFile;
- char *Path;
- char *TmpPath;
+ char *LocalPathname;
- if (!PathList)
+ if (!Pathname)
{
return (AE_OK);
}
- Path = strtok (PathList, ",");
-
- while (Path)
+ LocalPathname = ACPI_ALLOCATE (strlen (Pathname) + 1);
+ if (!LocalPathname)
{
- TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1);
- if (!TmpPath)
- {
- return (AE_NO_MEMORY);
- }
-
- ACPI_STRCPY (TmpPath, Path);
+ return (AE_NO_MEMORY);
+ }
- ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
- if (!ExternalFile)
- {
- ACPI_FREE (TmpPath);
- return (AE_NO_MEMORY);
- }
+ ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
+ if (!ExternalFile)
+ {
+ ACPI_FREE (LocalPathname);
+ return (AE_NO_MEMORY);
+ }
- ExternalFile->Path = TmpPath;
+ /* Take a copy of the file pathname */
- if (AcpiGbl_ExternalFileList)
- {
- ExternalFile->Next = AcpiGbl_ExternalFileList;
- }
+ strcpy (LocalPathname, Pathname);
+ ExternalFile->Path = LocalPathname;
- AcpiGbl_ExternalFileList = ExternalFile;
- Path = strtok (NULL, ",");
+ if (AcpiGbl_ExternalFileList)
+ {
+ ExternalFile->Next = AcpiGbl_ExternalFileList;
}
+ AcpiGbl_ExternalFileList = ExternalFile;
return (AE_OK);
}
@@ -356,12 +358,139 @@ AcpiDmClearExternalFileList (
/*******************************************************************************
*
- * FUNCTION: AcpiDmAddToExternalList
+ * FUNCTION: AcpiDmGetExternalsFromFile
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Process the optional external reference file.
+ *
+ * Each line in the file should be of the form:
+ * External (<Method namepath>, MethodObj, <ArgCount>)
+ *
+ * Example:
+ * External (_SB_.PCI0.XHC_.PS0X, MethodObj, 4)
+ *
+ ******************************************************************************/
+
+void
+AcpiDmGetExternalsFromFile (
+ void)
+{
+ FILE *ExternalRefFile;
+ char *Token;
+ char *MethodName;
+ UINT32 ArgCount;
+ UINT32 ImportCount = 0;
+
+
+ if (!Gbl_ExternalRefFilename)
+ {
+ return;
+ }
+
+ /* Open the file */
+
+ ExternalRefFile = fopen (Gbl_ExternalRefFilename, "r");
+ if (!ExternalRefFile)
+ {
+ fprintf (stderr, "Could not open external reference file \"%s\"\n",
+ Gbl_ExternalRefFilename);
+ AslAbort ();
+ return;
+ }
+
+ /* Each line defines a method */
+
+ while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile))
+ {
+ Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */
+ if (!Token)
+ {
+ continue;
+ }
+ if (strcmp (Token, "External"))
+ {
+ continue;
+ }
+
+ MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */
+ if (!MethodName)
+ {
+ continue;
+ }
+
+ Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */
+ if (!Token)
+ {
+ continue;
+ }
+
+ if (strcmp (Token, "MethodObj"))
+ {
+ continue;
+ }
+
+ Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */
+ if (!Token)
+ {
+ continue;
+ }
+
+ /* Convert arg count string to an integer */
+
+ errno = 0;
+ ArgCount = strtoul (Token, NULL, 0);
+ if (errno)
+ {
+ fprintf (stderr, "Invalid argument count (%s)\n", Token);
+ continue;
+ }
+ if (ArgCount > 7)
+ {
+ fprintf (stderr, "Invalid argument count (%u)\n", ArgCount);
+ continue;
+ }
+
+ /* Add this external to the global list */
+
+ AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n",
+ Gbl_ExternalRefFilename, ArgCount, MethodName);
+
+ AcpiDmAddPathToExternalList (MethodName, ACPI_TYPE_METHOD,
+ ArgCount, (ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_FILE));
+ ImportCount++;
+ }
+
+ if (!ImportCount)
+ {
+ fprintf (stderr, "Did not find any external methods in reference file \"%s\"\n",
+ Gbl_ExternalRefFilename);
+ }
+ else
+ {
+ /* Add the external(s) to the namespace */
+
+ AcpiDmAddExternalsToNamespace ();
+
+ AcpiOsPrintf ("%s: Imported %u external method definitions\n",
+ Gbl_ExternalRefFilename, ImportCount);
+ }
+
+ fclose (ExternalRefFile);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmAddOpToExternalList
*
* PARAMETERS: Op - Current parser Op
* Path - Internal (AML) path to the object
* Type - ACPI object type to be added
* Value - Arg count if adding a Method object
+ * Flags - To be passed to the external object
*
* RETURN: None
*
@@ -369,60 +498,47 @@ AcpiDmClearExternalFileList (
* will in turn be later emitted as an External() declaration
* in the disassembled output.
*
+ * This function handles the most common case where the referenced
+ * name is simply not found in the constructed namespace.
+ *
******************************************************************************/
void
-AcpiDmAddToExternalList (
+AcpiDmAddOpToExternalList (
ACPI_PARSE_OBJECT *Op,
char *Path,
UINT8 Type,
- UINT32 Value)
+ UINT32 Value,
+ UINT16 Flags)
{
char *ExternalPath;
- char *Fullpath = NULL;
- ACPI_EXTERNAL_LIST *NewExternal;
- ACPI_EXTERNAL_LIST *NextExternal;
- ACPI_EXTERNAL_LIST *PrevExternal = NULL;
+ char *InternalPath = Path;
+ char *Temp;
ACPI_STATUS Status;
- BOOLEAN Resolved = FALSE;
+
+
+ ACPI_FUNCTION_TRACE (DmAddOpToExternalList);
if (!Path)
{
- return;
+ return_VOID;
}
- if (Type == ACPI_TYPE_METHOD)
- {
- if (Value & 0x80)
- {
- Resolved = TRUE;
- }
- Value &= 0x07;
- }
+ /* Remove a root backslash if present */
- /*
- * We don't want External() statements to contain a leading '\'.
- * This prevents duplicate external statements of the form:
- *
- * External (\ABCD)
- * External (ABCD)
- *
- * This would cause a compile time error when the disassembled
- * output file is recompiled.
- */
if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
{
Path++;
}
- /* Externalize the ACPI pathname */
+ /* Externalize the pathname */
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
- NULL, &ExternalPath);
+ NULL, &ExternalPath);
if (ACPI_FAILURE (Status))
{
- return;
+ return_VOID;
}
/*
@@ -431,231 +547,140 @@ AcpiDmAddToExternalList (
*/
if (*Path == (UINT8) AML_PARENT_PREFIX)
{
- Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
- if (Fullpath)
- {
- /* Set new external path */
-
- ACPI_FREE (ExternalPath);
- ExternalPath = Fullpath;
- }
- }
+ Temp = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
- /* Check all existing externals to ensure no duplicates */
+ /* Set new external path */
- NextExternal = AcpiGbl_ExternalList;
- while (NextExternal)
- {
- if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
+ ACPI_FREE (ExternalPath);
+ ExternalPath = Temp;
+ if (!Temp)
{
- /* Duplicate method, check that the Value (ArgCount) is the same */
-
- if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
- (NextExternal->Value != Value))
- {
- ACPI_ERROR ((AE_INFO,
- "External method arg count mismatch %s: Current %u, attempted %u",
- NextExternal->Path, NextExternal->Value, Value));
- }
-
- /* Allow upgrade of type from ANY */
-
- else if (NextExternal->Type == ACPI_TYPE_ANY)
- {
- NextExternal->Type = Type;
- NextExternal->Value = Value;
- }
-
- ACPI_FREE (ExternalPath);
- return;
+ return_VOID;
}
- NextExternal = NextExternal->Next;
- }
-
- /* Allocate and init a new External() descriptor */
-
- NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
- if (!NewExternal)
- {
- ACPI_FREE (ExternalPath);
- return;
- }
-
- NewExternal->Path = ExternalPath;
- NewExternal->Type = Type;
- NewExternal->Value = Value;
- NewExternal->Resolved = Resolved;
- NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
-
- /* Was the external path with parent prefix normalized to a fullpath? */
-
- if (Fullpath == ExternalPath)
- {
- /* Get new internal path */
+ /* Create the new internal pathname */
- Status = AcpiNsInternalizeName (ExternalPath, &Path);
+ Flags |= ACPI_EXT_INTERNAL_PATH_ALLOCATED;
+ Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
if (ACPI_FAILURE (Status))
{
ACPI_FREE (ExternalPath);
- ACPI_FREE (NewExternal);
- return;
+ return_VOID;
}
-
- /* Set flag to indicate External->InternalPath need to be freed */
-
- NewExternal->Flags |= ACPI_IPATH_ALLOCATED;
}
- NewExternal->InternalPath = Path;
-
- /* Link the new descriptor into the global list, alphabetically ordered */
+ /* Create the new External() declaration node */
- NextExternal = AcpiGbl_ExternalList;
- while (NextExternal)
+ Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath,
+ Type, Value, Flags);
+ if (ACPI_FAILURE (Status))
{
- if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0)
+ ACPI_FREE (ExternalPath);
+ if (Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED)
{
- if (PrevExternal)
- {
- PrevExternal->Next = NewExternal;
- }
- else
- {
- AcpiGbl_ExternalList = NewExternal;
- }
-
- NewExternal->Next = NextExternal;
- return;
+ ACPI_FREE (InternalPath);
}
-
- PrevExternal = NextExternal;
- NextExternal = NextExternal->Next;
}
- if (PrevExternal)
- {
- PrevExternal->Next = NewExternal;
- }
- else
- {
- AcpiGbl_ExternalList = NewExternal;
- }
+ return_VOID;
}
/*******************************************************************************
*
- * FUNCTION: AcpiDmGetExternalsFromFile
+ * FUNCTION: AcpiDmAddNodeToExternalList
*
- * PARAMETERS: None
+ * PARAMETERS: Node - Namespace node for object to be added
+ * Type - ACPI object type to be added
+ * Value - Arg count if adding a Method object
+ * Flags - To be passed to the external object
*
* RETURN: None
*
- * DESCRIPTION: Process the optional external reference file.
- *
- * Each line in the file should be of the form:
- * External (<Method namepath>, MethodObj, <ArgCount>)
+ * DESCRIPTION: Insert a new name into the global list of Externals which
+ * will in turn be later emitted as an External() declaration
+ * in the disassembled output.
*
- * Example:
- * External (_SB_.PCI0.XHC_.PS0X, MethodObj, 4)
+ * This function handles the case where the referenced name has
+ * been found in the namespace, but the name originated in a
+ * table other than the one that is being disassembled (such
+ * as a table that is added via the iASL -e option).
*
******************************************************************************/
void
-AcpiDmGetExternalsFromFile (
- void)
+AcpiDmAddNodeToExternalList (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT8 Type,
+ UINT32 Value,
+ UINT16 Flags)
{
- FILE *ExternalRefFile;
- char *Token;
- char *MethodName;
- UINT32 ArgCount;
- UINT32 ImportCount = 0;
+ char *ExternalPath;
+ char *InternalPath;
+ char *Temp;
+ ACPI_STATUS Status;
- if (!Gbl_ExternalRefFilename)
- {
- return;
- }
+ ACPI_FUNCTION_TRACE (DmAddNodeToExternalList);
- /* Open the file */
- ExternalRefFile = fopen (Gbl_ExternalRefFilename, "r");
- if (!ExternalRefFile)
+ if (!Node)
{
- fprintf (stderr, "Could not open external reference file \"%s\"\n",
- Gbl_ExternalRefFilename);
- return;
+ return_VOID;
}
- /* Each line defines a method */
+ /* Get the full external and internal pathnames to the node */
- while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile))
+ ExternalPath = AcpiNsGetExternalPathname (Node);
+ if (!ExternalPath)
{
- Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */
- if (!Token) continue;
- if (strcmp (Token, "External")) continue;
-
- MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */
- if (!MethodName) continue;
-
- Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */
- if (!Token) continue;
- if (strcmp (Token, "MethodObj")) continue;
+ return_VOID;
+ }
- Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */
- if (!Token) continue;
+ Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (ExternalPath);
+ return_VOID;
+ }
- /* Convert arg count string to an integer */
+ /* Remove the root backslash */
- errno = 0;
- ArgCount = strtoul (Token, NULL, 0);
- if (errno)
- {
- fprintf (stderr, "Invalid argument count (%s)\n", Token);
- continue;
- }
- if (ArgCount > 7)
+ if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1]))
+ {
+ Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1);
+ if (!Temp)
{
- fprintf (stderr, "Invalid argument count (%u)\n", ArgCount);
- continue;
+ return_VOID;
}
- /* Add this external to the global list */
-
- AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n",
- Gbl_ExternalRefFilename, ArgCount, MethodName);
-
- AcpiDmAddToExternalListFromFile (MethodName, ACPI_TYPE_METHOD, ArgCount | 0x80);
- ImportCount++;
- }
-
- if (!ImportCount)
- {
- fprintf (stderr, "Did not find any external methods in reference file \"%s\"\n",
- Gbl_ExternalRefFilename);
+ ACPI_STRCPY (Temp, &ExternalPath[1]);
+ ACPI_FREE (ExternalPath);
+ ExternalPath = Temp;
}
- else
- {
- /* Add the external(s) to the namespace */
- AcpiDmAddExternalsToNamespace ();
+ /* Create the new External() declaration node */
- AcpiOsPrintf ("%s: Imported %u external method definitions\n",
- Gbl_ExternalRefFilename, ImportCount);
+ Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath, Type,
+ Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED));
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (ExternalPath);
+ ACPI_FREE (InternalPath);
}
- fclose (ExternalRefFile);
+ return_VOID;
}
/*******************************************************************************
*
- * FUNCTION: AcpiDmAddToExternalListFromFile
+ * FUNCTION: AcpiDmAddPathToExternalList
*
- * PARAMETERS: Path - Internal (AML) path to the object
+ * PARAMETERS: Path - External name of the object to be added
* Type - ACPI object type to be added
* Value - Arg count if adding a Method object
+ * Flags - To be passed to the external object
*
* RETURN: None
*
@@ -663,73 +688,135 @@ AcpiDmGetExternalsFromFile (
* will in turn be later emitted as an External() declaration
* in the disassembled output.
*
+ * This function currently is used to add externals via a
+ * reference file (via the -fe iASL option).
+ *
******************************************************************************/
static void
-AcpiDmAddToExternalListFromFile (
+AcpiDmAddPathToExternalList (
char *Path,
UINT8 Type,
- UINT32 Value)
+ UINT32 Value,
+ UINT16 Flags)
{
char *InternalPath;
char *ExternalPath;
- ACPI_EXTERNAL_LIST *NewExternal;
- ACPI_EXTERNAL_LIST *NextExternal;
- ACPI_EXTERNAL_LIST *PrevExternal = NULL;
ACPI_STATUS Status;
- BOOLEAN Resolved = FALSE;
+
+
+ ACPI_FUNCTION_TRACE (DmAddPathToExternalList);
if (!Path)
{
- return;
+ return_VOID;
}
- /* TBD: Add a flags parameter */
+ /* Remove a root backslash if present */
- if (Type == ACPI_TYPE_METHOD)
+ if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
{
- if (Value & 0x80)
- {
- Resolved = TRUE;
- }
- Value &= 0x07;
+ Path++;
}
- /*
- * We don't want External() statements to contain a leading '\'.
- * This prevents duplicate external statements of the form:
- *
- * External (\ABCD)
- * External (ABCD)
- *
- * This would cause a compile time error when the disassembled
- * output file is recompiled.
- */
- if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
+ /* Create the internal and external pathnames */
+
+ Status = AcpiNsInternalizeName (Path, &InternalPath);
+ if (ACPI_FAILURE (Status))
{
- Path++;
+ return_VOID;
+ }
+
+ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath,
+ NULL, &ExternalPath);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (InternalPath);
+ return_VOID;
+ }
+
+ /* Create the new External() declaration node */
+
+ Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath,
+ Type, Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED));
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (ExternalPath);
+ ACPI_FREE (InternalPath);
}
+ return_VOID;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmCreateNewExternal
+ *
+ * PARAMETERS: ExternalPath - External path to the object
+ * InternalPath - Internal (AML) path to the object
+ * Type - ACPI object type to be added
+ * Value - Arg count if adding a Method object
+ * Flags - To be passed to the external object
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Common low-level function to insert a new name into the global
+ * list of Externals which will in turn be later emitted as
+ * External() declarations in the disassembled output.
+ *
+ * Note: The external name should not include a root prefix
+ * (backslash). We do not want External() statements to contain
+ * a leading '\', as this prevents duplicate external statements
+ * of the form:
+ *
+ * External (\ABCD)
+ * External (ABCD)
+ *
+ * This would cause a compile time error when the disassembled
+ * output file is recompiled.
+ *
+ * There are two cases that are handled here. For both, we emit
+ * an External() statement:
+ * 1) The name was simply not found in the namespace.
+ * 2) The name was found, but it originated in a table other than
+ * the table that is being disassembled.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDmCreateNewExternal (
+ char *ExternalPath,
+ char *InternalPath,
+ UINT8 Type,
+ UINT32 Value,
+ UINT16 Flags)
+{
+ ACPI_EXTERNAL_LIST *NewExternal;
+ ACPI_EXTERNAL_LIST *NextExternal;
+ ACPI_EXTERNAL_LIST *PrevExternal = NULL;
+
+
+ ACPI_FUNCTION_TRACE (DmCreateNewExternal);
+
+
/* Check all existing externals to ensure no duplicates */
NextExternal = AcpiGbl_ExternalList;
while (NextExternal)
{
- if (!ACPI_STRCMP (Path, NextExternal->Path))
+ if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
{
/* Duplicate method, check that the Value (ArgCount) is the same */
if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
- (NextExternal->Value != Value))
+ (NextExternal->Value != Value) &&
+ (Value > 0))
{
ACPI_ERROR ((AE_INFO,
- "(File) External method arg count mismatch %s: Current %u, override to %u",
+ "External method arg count mismatch %s: Current %u, attempted %u",
NextExternal->Path, NextExternal->Value, Value));
-
- /* Override, since new value came from external reference file */
-
- NextExternal->Value = Value;
}
/* Allow upgrade of type from ANY */
@@ -740,44 +827,31 @@ AcpiDmAddToExternalListFromFile (
NextExternal->Value = Value;
}
- return;
+ return_ACPI_STATUS (AE_ALREADY_EXISTS);
}
NextExternal = NextExternal->Next;
}
- /* Get the internal pathname (AML format) */
-
- Status = AcpiNsInternalizeName (Path, &InternalPath);
- if (ACPI_FAILURE (Status))
- {
- return;
- }
-
/* Allocate and init a new External() descriptor */
NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
if (!NewExternal)
{
- ACPI_FREE (InternalPath);
- return;
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
- /* Must copy and normalize the input path */
-
- AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, NULL, &ExternalPath);
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Adding external reference node (%s) type [%s]\n",
+ ExternalPath, AcpiUtGetTypeName (Type)));
+ NewExternal->Flags = Flags;
+ NewExternal->Value = Value;
NewExternal->Path = ExternalPath;
NewExternal->Type = Type;
- NewExternal->Value = Value;
- NewExternal->Resolved = Resolved;
- NewExternal->Length = (UINT16) ACPI_STRLEN (Path);
+ NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
NewExternal->InternalPath = InternalPath;
- /* Set flag to indicate External->InternalPath needs to be freed */
-
- NewExternal->Flags |= ACPI_IPATH_ALLOCATED | ACPI_FROM_REFERENCE_FILE;
-
/* Link the new descriptor into the global list, alphabetically ordered */
NextExternal = AcpiGbl_ExternalList;
@@ -795,7 +869,7 @@ AcpiDmAddToExternalListFromFile (
}
NewExternal->Next = NextExternal;
- return;
+ return_ACPI_STATUS (AE_OK);
}
PrevExternal = NextExternal;
@@ -810,6 +884,8 @@ AcpiDmAddToExternalListFromFile (
{
AcpiGbl_ExternalList = NewExternal;
}
+
+ return_ACPI_STATUS (AE_OK);
}
@@ -985,7 +1061,7 @@ AcpiDmEmitExternals (
if (NextExternal->Type == ACPI_TYPE_METHOD)
{
AcpiGbl_NumExternalMethods++;
- if (NextExternal->Resolved)
+ if (NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)
{
AcpiGbl_ResolvedExternalMethods++;
}
@@ -1004,18 +1080,17 @@ AcpiDmEmitExternals (
while (NextExternal)
{
if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
- (!NextExternal->Resolved))
+ (!(NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)))
{
AcpiOsPrintf (" External (%s%s",
NextExternal->Path,
AcpiDmGetObjectTypeName (NextExternal->Type));
- AcpiOsPrintf (
- ") // Warning: Unresolved Method, "
- "guessing %u arguments (may be incorrect, see warning above)\n",
+ AcpiOsPrintf (") // Warning: Unresolved method, "
+ "guessing %u arguments\n",
NextExternal->Value);
- NextExternal->Emitted = TRUE;
+ NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
}
NextExternal = NextExternal->Next;
@@ -1036,7 +1111,8 @@ AcpiDmEmitExternals (
NextExternal = AcpiGbl_ExternalList;
while (NextExternal)
{
- if (!NextExternal->Emitted && (NextExternal->Flags & ACPI_FROM_REFERENCE_FILE))
+ if (!(NextExternal->Flags & ACPI_EXT_EXTERNAL_EMITTED) &&
+ (NextExternal->Flags & ACPI_EXT_ORIGIN_FROM_FILE))
{
AcpiOsPrintf (" External (%s%s",
NextExternal->Path,
@@ -1051,7 +1127,7 @@ AcpiDmEmitExternals (
{
AcpiOsPrintf (")\n");
}
- NextExternal->Emitted = TRUE;
+ NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
}
NextExternal = NextExternal->Next;
@@ -1065,7 +1141,7 @@ AcpiDmEmitExternals (
*/
while (AcpiGbl_ExternalList)
{
- if (!AcpiGbl_ExternalList->Emitted)
+ if (!(AcpiGbl_ExternalList->Flags & ACPI_EXT_EXTERNAL_EMITTED))
{
AcpiOsPrintf (" External (%s%s",
AcpiGbl_ExternalList->Path,
@@ -1087,7 +1163,7 @@ AcpiDmEmitExternals (
/* Free this external info block and move on to next external */
NextExternal = AcpiGbl_ExternalList->Next;
- if (AcpiGbl_ExternalList->Flags & ACPI_IPATH_ALLOCATED)
+ if (AcpiGbl_ExternalList->Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED)
{
ACPI_FREE (AcpiGbl_ExternalList->InternalPath);
}
@@ -1209,12 +1285,24 @@ AcpiDmUnresolvedWarning (
" * were not specified. This resulting disassembler output file may not\n"
" * compile because the disassembler did not know how many arguments\n"
" * to assign to these methods. To specify the tables needed to resolve\n"
- " * external control method references, use the one of the following\n"
- " * example iASL invocations:\n"
- " * iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
- " * iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n"
+ " * external control method references, the -e option can be used to\n"
+ " * specify the filenames. Example iASL invocations:\n"
+ " * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
+ " * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
+ " * iasl -e ssdt*.aml -d dsdt.aml\n"
+ " *\n"
+ " * In addition, the -fe option can be used to specify a file containing\n"
+ " * control method external declarations with the associated method\n"
+ " * argument counts. Each line of the file must be of the form:\n"
+ " * External (<method pathname>, MethodObj, <argument count>)\n"
+ " * Invocation:\n"
+ " * iasl -fe refs.txt -d dsdt.aml\n"
+ " *\n"
+ " * The following methods were unresolved and many not compile properly\n"
+ " * because the disassembler had to guess at the number of arguments\n"
+ " * required for each:\n"
" */\n",
- AcpiGbl_NumExternalMethods);
+ AcpiGbl_NumExternalMethods);
}
else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
{
@@ -1223,10 +1311,21 @@ AcpiDmUnresolvedWarning (
AcpiOsPrintf (" /*\n"
" * iASL Warning: There were %u external control methods found during\n"
" * disassembly, but only %u %s resolved (%u unresolved). Additional\n"
- " * ACPI tables are required to properly disassemble the code. This\n"
+ " * ACPI tables may be required to properly disassemble the code. This\n"
" * resulting disassembler output file may not compile because the\n"
" * disassembler did not know how many arguments to assign to the\n"
" * unresolved methods.\n"
+ " *\n"
+ " * If necessary, the -fe option can be used to specify a file containing\n"
+ " * control method external declarations with the associated method\n"
+ " * argument counts. Each line of the file must be of the form:\n"
+ " * External (<method pathname>, MethodObj, <argument count>)\n"
+ " * Invocation:\n"
+ " * iasl -fe refs.txt -d dsdt.aml\n"
+ " *\n"
+ " * The following methods were unresolved and many not compile properly\n"
+ " * because the disassembler had to guess at the number of arguments\n"
+ " * required for each:\n"
" */\n",
AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
(AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
@@ -1245,10 +1344,18 @@ AcpiDmUnresolvedWarning (
"were not specified. The resulting disassembler output file may not\n"
"compile because the disassembler did not know how many arguments\n"
"to assign to these methods. To specify the tables needed to resolve\n"
- "external control method references, use the one of the following\n"
- "example iASL invocations:\n"
- " iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
- " iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n",
+ "external control method references, the -e option can be used to\n"
+ "specify the filenames. Example iASL invocations:\n"
+ " iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
+ " iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
+ " iasl -e ssdt*.aml -d dsdt.aml\n"
+ "\n"
+ "In addition, the -fe option can be used to specify a file containing\n"
+ "control method external declarations with the associated method\n"
+ "argument counts. Each line of the file must be of the form:\n"
+ " External (<method pathname>, MethodObj, <argument count>)\n"
+ "Invocation:\n"
+ " iasl -fe refs.txt -d dsdt.aml\n",
AcpiGbl_NumExternalMethods);
}
else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
@@ -1258,10 +1365,17 @@ AcpiDmUnresolvedWarning (
fprintf (stderr, "\n"
"iASL Warning: There were %u external control methods found during\n"
"disassembly, but only %u %s resolved (%u unresolved). Additional\n"
- "ACPI tables are required to properly disassemble the code. The\n"
+ "ACPI tables may be required to properly disassemble the code. The\n"
"resulting disassembler output file may not compile because the\n"
"disassembler did not know how many arguments to assign to the\n"
- "unresolved methods.\n",
+ "unresolved methods.\n"
+ "\n"
+ "If necessary, the -fe option can be used to specify a file containing\n"
+ "control method external declarations with the associated method\n"
+ "argument counts. Each line of the file must be of the form:\n"
+ " External (<method pathname>, MethodObj, <argument count>)\n"
+ "Invocation:\n"
+ " iasl -fe refs.txt -d dsdt.aml\n",
AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
(AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
(AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
diff --git a/sys/contrib/dev/acpica/common/dmrestag.c b/sys/contrib/dev/acpica/common/dmrestag.c
index 9b85498..e1b435b 100644
--- a/sys/contrib/dev/acpica/common/dmrestag.c
+++ b/sys/contrib/dev/acpica/common/dmrestag.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c
index e7ce520..0b75653 100644
--- a/sys/contrib/dev/acpica/common/dmtable.c
+++ b/sys/contrib/dev/acpica/common/dmtable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -87,9 +87,21 @@ static const char *AcpiDmDmarSubnames[] =
"Reserved Memory Region",
"Root Port ATS Capability",
"Remapping Hardware Static Affinity",
+ "ACPI Namespace Device Declaration",
"Unknown SubTable Type" /* Reserved */
};
+static const char *AcpiDmDmarScope[] =
+{
+ "Reserved value",
+ "PCI Endpoint Device",
+ "PCI Bridge Device",
+ "IOAPIC Device",
+ "Message-capable HPET Device",
+ "Namespace Device",
+ "Unknown Scope Type" /* Reserved */
+};
+
static const char *AcpiDmEinjActions[] =
{
"Begin Operation",
@@ -160,6 +172,13 @@ static const char *AcpiDmErstInstructions[] =
"Unknown Instruction"
};
+static const char *AcpiDmGtdtSubnames[] =
+{
+ "Generic Timer Block",
+ "Generic Watchdog Timer",
+ "Unknown SubTable Type" /* Reserved */
+};
+
static const char *AcpiDmHestSubnames[] =
{
"IA-32 Machine Check Exception",
@@ -189,20 +208,29 @@ static const char *AcpiDmHestNotifySubnames[] =
static const char *AcpiDmMadtSubnames[] =
{
- "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
- "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
- "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
- "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
- "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
- "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
- "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
- "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
- "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
- "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
- "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
- "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
- "Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */
- "Unknown SubTable Type" /* Reserved */
+ "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
+ "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
+ "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
+ "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
+ "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
+ "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
+ "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
+ "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
+ "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
+ "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
+ "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
+ "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
+ "Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */
+ "Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */
+ "Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
+ "Unknown SubTable Type" /* Reserved */
+};
+
+static const char *AcpiDmPcctSubnames[] =
+{
+ "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
+ "HW-Reduced Communications Subspace",
+ "Unknown SubTable Type" /* Reserved */
};
static const char *AcpiDmPmttSubnames[] =
@@ -225,6 +253,7 @@ static const char *AcpiDmSratSubnames[] =
"Processor Local APIC/SAPIC Affinity",
"Memory Affinity",
"Processor Local x2APIC Affinity",
+ "GICC Affinity",
"Unknown SubTable Type" /* Reserved */
};
@@ -235,6 +264,12 @@ static const char *AcpiDmIvrsSubnames[] =
"Unknown SubTable Type" /* Reserved */
};
+static const char *AcpiDmLpitSubnames[] =
+{
+ "Native C-state Idle Structure",
+ "Simple I/O Idle Structure",
+ "Unknown SubTable Type" /* Reserved */
+};
#define ACPI_FADT_PM_RESERVED 9
@@ -286,7 +321,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"},
{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt, "Core System Resource Table"},
- {ACPI_SIG_DBG2, NULL, AcpiDmDumpDbg2, NULL, NULL, "Debug Port table type 2"},
+ {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2, "Debug Port table type 2"},
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"},
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"},
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"},
@@ -294,17 +329,18 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table (FADT)"},
{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"},
- {ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"},
+ {ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt, "Generic Timer Description Table"},
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
+ {ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit, "Low Power Idle Table"},
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table (MADT)"},
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"},
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"},
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
{ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr, "MID Timer Table"},
- {ACPI_SIG_PCCT, NULL, AcpiDmDumpPcct, NULL, NULL, "Platform Communications Channel Table"},
+ {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct, "Platform Communications Channel Table"},
{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"},
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"},
{ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt, "S3 Performance Table"},
@@ -650,6 +686,7 @@ AcpiDmDumpTable (
UINT32 ByteLength;
UINT8 Temp8;
UINT16 Temp16;
+ UINT64 Value;
ACPI_DMTABLE_DATA *TableData;
const char *Name;
BOOLEAN LastOutputBlankLine = FALSE;
@@ -691,7 +728,9 @@ AcpiDmDumpTable (
case ACPI_DMT_SPACEID:
case ACPI_DMT_ACCWIDTH:
case ACPI_DMT_IVRS:
+ case ACPI_DMT_GTDT:
case ACPI_DMT_MADT:
+ case ACPI_DMT_PCCT:
case ACPI_DMT_PMTT:
case ACPI_DMT_SRAT:
case ACPI_DMT_ASF:
@@ -701,6 +740,7 @@ AcpiDmDumpTable (
case ACPI_DMT_EINJINST:
case ACPI_DMT_ERSTACT:
case ACPI_DMT_ERSTINST:
+ case ACPI_DMT_DMAR_SCOPE:
ByteLength = 1;
break;
@@ -721,6 +761,7 @@ AcpiDmDumpTable (
case ACPI_DMT_NAME4:
case ACPI_DMT_SIG:
case ACPI_DMT_SLIC:
+ case ACPI_DMT_LPIT:
ByteLength = 4;
break;
@@ -863,10 +904,19 @@ AcpiDmDumpTable (
* Dump bytes - high byte first, low byte last.
* Note: All ACPI tables are little-endian.
*/
+ Value = 0;
for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)
{
AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);
+ Value |= Target[Temp8 - 1];
+ Value <<= 8;
+ }
+
+ if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))
+ {
+ AcpiOsPrintf (" [Optional field not present]");
}
+
AcpiOsPrintf ("\n");
break;
@@ -1022,6 +1072,19 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
break;
+ case ACPI_DMT_DMAR_SCOPE:
+
+ /* DMAR device scope types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]);
+ break;
+
case ACPI_DMT_EINJACT:
/* EINJ Action types */
@@ -1074,6 +1137,19 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
break;
+ case ACPI_DMT_GTDT:
+
+ /* GTDT subtable types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_GTDT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]);
+ break;
+
case ACPI_DMT_HEST:
/* HEST subtable types */
@@ -1122,6 +1198,19 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
break;
+ case ACPI_DMT_PCCT:
+
+ /* PCCT subtable types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_PCCT_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_PCCT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPcctSubnames[Temp8]);
+ break;
+
case ACPI_DMT_PMTT:
/* PMTT subtable types */
@@ -1202,6 +1291,32 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
break;
+ case ACPI_DMT_LPIT:
+
+ /* LPIT subtable types */
+
+ Temp8 = *Target;
+ switch (Temp8)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ Name = AcpiDmLpitSubnames[0];
+ break;
+
+ case ACPI_LPIT_TYPE_SIMPLE_IO:
+
+ Name = AcpiDmLpitSubnames[1];
+ break;
+
+ default:
+
+ Name = AcpiDmLpitSubnames[2];
+ break;
+ }
+
+ AcpiOsPrintf (UINT32_FORMAT, *Target, Name);
+ break;
+
case ACPI_DMT_EXIT:
return (AE_OK);
diff --git a/sys/contrib/dev/acpica/common/dmtbdump.c b/sys/contrib/dev/acpica/common/dmtbdump.c
index 89d38e7..2f88a54 100644
--- a/sys/contrib/dev/acpica/common/dmtbdump.c
+++ b/sys/contrib/dev/acpica/common/dmtbdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -419,12 +419,12 @@ AcpiDmDumpAsf (
UINT8 Type;
- /* No main table, only sub-tables */
+ /* No main table, only subtables */
SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
@@ -479,7 +479,7 @@ AcpiDmDumpAsf (
default:
- AcpiOsPrintf ("\n**** Unknown ASF sub-table type 0x%X\n", SubTable->Header.Type);
+ AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", SubTable->Header.Type);
return;
}
@@ -541,7 +541,7 @@ AcpiDmDumpAsf (
AcpiOsPrintf ("\n");
- /* Point to next sub-table */
+ /* Point to next subtable */
if (!SubTable->Header.Length)
{
@@ -586,7 +586,7 @@ AcpiDmDumpCpep (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
while (Offset < Table->Length)
@@ -599,7 +599,7 @@ AcpiDmDumpCpep (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
@@ -638,7 +638,7 @@ AcpiDmDumpCsrt (
/* The main table only contains the ACPI header, thus already handled */
- /* Sub-tables (Resource Groups) */
+ /* Subtables (Resource Groups) */
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
while (Offset < Table->Length)
@@ -702,7 +702,7 @@ AcpiDmDumpCsrt (
SubSubTable->Length);
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
@@ -746,7 +746,7 @@ AcpiDmDumpDbg2 (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
while (Offset < Table->Length)
@@ -809,10 +809,13 @@ AcpiDmDumpDbg2 (
/* Dump the OemData (optional) */
- AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
- Offset + SubTable->OemDataOffset, "OEM Data");
+ if (SubTable->OemDataOffset)
+ {
+ AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
+ Offset + SubTable->OemDataOffset, "OEM Data");
+ }
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
@@ -858,12 +861,12 @@ AcpiDmDumpDmar (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -888,21 +891,27 @@ AcpiDmDumpDmar (
ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
break;
- case ACPI_DMAR_TYPE_ATSR:
+ case ACPI_DMAR_TYPE_ROOT_ATS:
InfoTable = AcpiDmTableInfoDmar2;
ScopeOffset = sizeof (ACPI_DMAR_ATSR);
break;
- case ACPI_DMAR_HARDWARE_AFFINITY:
+ case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
InfoTable = AcpiDmTableInfoDmar3;
ScopeOffset = sizeof (ACPI_DMAR_RHSA);
break;
+ case ACPI_DMAR_TYPE_NAMESPACE:
+
+ InfoTable = AcpiDmTableInfoDmar4;
+ ScopeOffset = sizeof (ACPI_DMAR_ANDD);
+ break;
+
default:
- AcpiOsPrintf ("\n**** Unknown DMAR sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
return;
}
@@ -913,7 +922,16 @@ AcpiDmDumpDmar (
return;
}
- /* Dump the device scope entries (if any) */
+ /*
+ * Dump the optional device scope entries
+ */
+ if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+ (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE))
+ {
+ /* These types do not support device scopes */
+
+ goto NextSubtable;
+ }
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
while (ScopeOffset < SubTable->Length)
@@ -953,7 +971,8 @@ AcpiDmDumpDmar (
ScopeTable, ScopeTable->Length);
}
- /* Point to next sub-table */
+NextSubtable:
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
@@ -992,7 +1011,7 @@ AcpiDmDumpEinj (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1005,7 +1024,7 @@ AcpiDmDumpEinj (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_WHEA_HEADER);
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
@@ -1045,7 +1064,7 @@ AcpiDmDumpErst (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1058,7 +1077,7 @@ AcpiDmDumpErst (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_WHEA_HEADER);
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
@@ -1093,12 +1112,12 @@ AcpiDmDumpFpdt (
/* There is no main table (other than the standard ACPI header) */
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -1122,7 +1141,7 @@ AcpiDmDumpFpdt (
default:
- AcpiOsPrintf ("\n**** Unknown FPDT sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", SubTable->Type);
/* Attempt to continue */
@@ -1142,7 +1161,7 @@ AcpiDmDumpFpdt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
@@ -1152,6 +1171,123 @@ NextSubTable:
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpGtdt
+ *
+ * PARAMETERS: Table - A GTDT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a GTDT. This table type consists
+ * of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpGtdt (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_GTDT_HEADER *SubTable;
+ UINT32 Length = Table->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 SubTableLength;
+ UINT32 GtCount;
+ ACPI_GTDT_TIMER_ENTRY *GtxTable;
+
+
+ /* Main table */
+
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Subtables */
+
+ SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ /* Common subtable header */
+
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTable->Length, AcpiDmTableInfoGtdtHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ GtCount = 0;
+ switch (SubTable->Type)
+ {
+ case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+ SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
+ GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ SubTable))->TimerCount;
+
+ InfoTable = AcpiDmTableInfoGtdt0;
+ break;
+
+ case ACPI_GTDT_TYPE_WATCHDOG:
+
+ SubTableLength = sizeof (ACPI_GTDT_WATCHDOG);
+
+ InfoTable = AcpiDmTableInfoGtdt1;
+ break;
+
+ default:
+
+ /* Cannot continue on unknown type - no length */
+
+ AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type);
+ return;
+ }
+
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTable->Length, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Point to end of current subtable (each subtable above is of fixed length) */
+
+ Offset += SubTableLength;
+
+ /* If there are any Gt Timer Blocks from above, dump them now */
+
+ if (GtCount)
+ {
+ GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
+ SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
+
+ while (GtCount)
+ {
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, GtxTable,
+ sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
+ GtxTable++;
+ GtCount--;
+ }
+ }
+
+ /* Point to next subtable */
+
+ SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpHest
*
* PARAMETERS: Table - A HEST table
@@ -1185,7 +1321,7 @@ AcpiDmDumpHest (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1243,7 +1379,7 @@ AcpiDmDumpHest (
/* Cannot continue on unknown type - no length */
- AcpiOsPrintf ("\n**** Unknown HEST sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", SubTable->Type);
return;
}
@@ -1281,7 +1417,7 @@ AcpiDmDumpHest (
}
}
- /* Point to next sub-table */
+ /* Point to next subtable */
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
}
@@ -1324,12 +1460,12 @@ AcpiDmDumpIvrs (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1355,7 +1491,7 @@ AcpiDmDumpIvrs (
default:
- AcpiOsPrintf ("\n**** Unknown IVRS sub-table type 0x%X\n",
+ AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
SubTable->Type);
/* Attempt to continue */
@@ -1458,7 +1594,7 @@ AcpiDmDumpIvrs (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
@@ -1468,6 +1604,85 @@ NextSubTable:
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpLpit
+ *
+ * PARAMETERS: Table - A LPIT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a LPIT. This table type consists
+ * of an open-ended number of subtables. Note: There are no
+ * entries in the main table. An LPIT consists of the table
+ * header and then subtables only.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpLpit (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_LPIT_HEADER *SubTable;
+ UINT32 Length = Table->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_LPIT);
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 SubTableLength;
+
+
+ /* Subtables */
+
+ SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ /* Common subtable header */
+
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ switch (SubTable->Type)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ InfoTable = AcpiDmTableInfoLpit0;
+ SubTableLength = sizeof (ACPI_LPIT_NATIVE);
+ break;
+
+ case ACPI_LPIT_TYPE_SIMPLE_IO:
+
+ InfoTable = AcpiDmTableInfoLpit1;
+ SubTableLength = sizeof (ACPI_LPIT_IO);
+ break;
+
+ default:
+
+ /* Cannot continue on unknown type - no length */
+
+ AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", SubTable->Type);
+ return;
+ }
+
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTableLength, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ AcpiOsPrintf ("\n");
+
+ /* Point to next subtable */
+
+ Offset += SubTableLength;
+ SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, SubTable, SubTableLength);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpMadt
*
* PARAMETERS: Table - A MADT table
@@ -1498,12 +1713,12 @@ AcpiDmDumpMadt (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -1580,9 +1795,19 @@ AcpiDmDumpMadt (
InfoTable = AcpiDmTableInfoMadt12;
break;
+ case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
+
+ InfoTable = AcpiDmTableInfoMadt13;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
+
+ InfoTable = AcpiDmTableInfoMadt14;
+ break;
+
default:
- AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
/* Attempt to continue */
@@ -1602,7 +1827,7 @@ AcpiDmDumpMadt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
@@ -1639,7 +1864,7 @@ AcpiDmDumpMcfg (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
while (Offset < Table->Length)
@@ -1659,7 +1884,7 @@ AcpiDmDumpMcfg (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_MCFG_ALLOCATION);
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
@@ -1841,12 +2066,12 @@ AcpiDmDumpMsct (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1856,7 +2081,7 @@ AcpiDmDumpMsct (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_MSCT_PROXIMITY);
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
@@ -1893,12 +2118,12 @@ AcpiDmDumpMtmr (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1908,7 +2133,7 @@ AcpiDmDumpMtmr (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_MTMR_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
@@ -1935,6 +2160,7 @@ AcpiDmDumpPcct (
{
ACPI_STATUS Status;
ACPI_PCCT_SUBSPACE *SubTable;
+ ACPI_DMTABLE_INFO *InfoTable;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_PCCT);
@@ -1947,20 +2173,50 @@ AcpiDmDumpPcct (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
while (Offset < Table->Length)
{
+ /* Common subtable header */
+
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Header.Length, AcpiDmTableInfoPcct0);
+ SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
if (ACPI_FAILURE (Status))
{
return;
}
- /* Point to next sub-table */
+ switch (SubTable->Header.Type)
+ {
+ case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct0;
+ break;
+
+ case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct1;
+ break;
+
+ default:
+
+ AcpiOsPrintf (
+ "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
+ SubTable->Header.Type);
+ return;
+ }
+
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTable->Header.Length, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Point to next subtable */
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
@@ -2108,8 +2364,7 @@ AcpiDmDumpPmtt (
if (DomainCount)
{
AcpiOsPrintf (
- "\n**** DomainCount exceeds subtable length\n\n",
- MemSubTable->Type);
+ "\n**** DomainCount exceeds subtable length\n\n");
}
/* Walk the physical component (DIMM) subtables */
@@ -2209,7 +2464,7 @@ AcpiDmDumpS3pt (
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, S3ptTable, Offset);
while (Offset < S3ptTable->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
@@ -2233,7 +2488,7 @@ AcpiDmDumpS3pt (
default:
- AcpiOsPrintf ("\n**** Unknown S3PT sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2254,7 +2509,7 @@ AcpiDmDumpS3pt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, SubTable, SubTable->Length);
@@ -2291,7 +2546,7 @@ AcpiDmDumpSlic (
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2315,7 +2570,7 @@ AcpiDmDumpSlic (
default:
- AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown SLIC subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2336,7 +2591,7 @@ AcpiDmDumpSlic (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
@@ -2452,12 +2707,12 @@ AcpiDmDumpSrat (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2484,8 +2739,13 @@ AcpiDmDumpSrat (
InfoTable = AcpiDmTableInfoSrat2;
break;
+ case ACPI_SRAT_TYPE_GICC_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat3;
+ break;
+
default:
- AcpiOsPrintf ("\n**** Unknown SRAT sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2506,7 +2766,7 @@ AcpiDmDumpSrat (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
@@ -2543,12 +2803,12 @@ AcpiDmDumpVrtc (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2558,7 +2818,7 @@ AcpiDmDumpVrtc (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_VRTC_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
@@ -2595,12 +2855,12 @@ AcpiDmDumpWdat (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2610,7 +2870,7 @@ AcpiDmDumpWdat (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_WDAT_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));
diff --git a/sys/contrib/dev/acpica/common/dmtbinfo.c b/sys/contrib/dev/acpica/common/dmtbinfo.c
index 4272a33..cadb4c4 100644
--- a/sys/contrib/dev/acpica/common/dmtbinfo.c
+++ b/sys/contrib/dev/acpica/common/dmtbinfo.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -137,11 +137,16 @@
#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
#define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
+#define ACPI_DMAR4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ANDD,f)
#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT,f)
#define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f)
+#define ACPI_GTDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_BLOCK,f)
+#define ACPI_GTDT0a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_ENTRY,f)
+#define ACPI_GTDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_WATCHDOG,f)
+#define ACPI_GTDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_HEADER,f)
#define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
#define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
#define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
@@ -158,6 +163,9 @@
#define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f)
#define ACPI_IVRS8B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f)
#define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f)
+#define ACPI_LPITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_HEADER,f)
+#define ACPI_LPIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_NATIVE,f)
+#define ACPI_LPIT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_IO,f)
#define ACPI_MADT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f)
#define ACPI_MADT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_APIC,f)
#define ACPI_MADT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f)
@@ -171,6 +179,8 @@
#define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f)
#define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f)
#define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f)
+#define ACPI_MADT13_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f)
+#define ACPI_MADT14_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f)
#define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
#define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f)
@@ -181,6 +191,7 @@
#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
#define ACPI_MTMR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,f)
#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
+#define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f)
#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f)
@@ -196,6 +207,7 @@
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
+#define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
@@ -212,7 +224,11 @@
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o)
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
+#define ACPI_SRAT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GICC_AFFINITY,f,o)
#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
+#define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
+#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
+#define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o)
#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o)
#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f,o)
@@ -223,9 +239,11 @@
#define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
#define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
#define ACPI_MADT11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o)
+#define ACPI_MADT13_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f,o)
#define ACPI_MPST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o)
#define ACPI_MPST2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o)
#define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
+#define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o)
#define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o)
#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
@@ -436,17 +454,22 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[] =
{
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
- {ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
-/* ACPI 2.0+ Extensions (FADT version 3 and 4) */
+/* ACPI 2.0+ Extensions (FADT version 3, 4, and 5) */
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
{
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
- {ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "ARM Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0), "PSCI Compliant", 0},
+ {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0), "Must use HVC for PSCI", 0},
+ ACPI_DMT_NEW_LINE,
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "FADT Minor Revision", 0},
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XFacs), "FACS Address", 0},
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XDsdt), "DSDT Address", 0},
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1aEventBlock), "PM1A Event Block", 0},
@@ -720,12 +743,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[] =
{
{ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (Revision), "Revision", 0},
- {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Length), "Length", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (RegisterCount), "Register Count", 0},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathLength), "Namepath Length", 0},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathOffset), "Namepath Offset", 0},
- {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataLength), "OEM Data Length", 0},
- {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataOffset), "OEM Data Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataLength), "OEM Data Length", DT_DESCRIBES_OPTIONAL},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataOffset), "OEM Data Offset", DT_DESCRIBES_OPTIONAL},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortType), "Port Type", 0},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortSubtype), "Port Subtype", 0},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Reserved), "Reserved", 0},
@@ -754,6 +777,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[] =
ACPI_DMT_TERMINATOR
};
+ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[] =
+{
+ {ACPI_DMT_BUFFER, 0, "OEM Data", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
@@ -797,7 +826,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
{
- {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EntryType), "Device Scope Entry Type", 0},
+ {ACPI_DMT_DMAR_SCOPE, ACPI_DMARS_OFFSET (EntryType), "Device Scope Type", 0},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length", DT_LENGTH},
{ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID", 0},
@@ -849,6 +878,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] =
ACPI_DMT_TERMINATOR
};
+/* 4: ACPI Namespace Device Declaration Structure */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] =
+{
+ {ACPI_DMT_UINT24, ACPI_DMAR4_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_DMAR4_OFFSET (DeviceNumber), "Device Number", 0},
+ {ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (DeviceName[0]), "Device Name", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
@@ -988,29 +1027,89 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] =
{
- {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (Address), "Timer Address", 0},
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (Flags,0), "Memory Present", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterBlockAddresss), "Counter Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_NEW_LINE,
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Interrupt), "Secure PL1 Interrupt", 0},
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Flags), "SPL1 Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Trigger Mode", 0},
- {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Interrupt), "Secure EL1 Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Flags), "EL1 Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Always On", 0},
ACPI_DMT_NEW_LINE,
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Interrupt), "Non-Secure PL1 Interrupt", 0},
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Flags), "NSPL1 Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Trigger Mode", 0},
- {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Interrupt), "Non-Secure EL1 Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Flags), "NEL1 Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Always On", 0},
ACPI_DMT_NEW_LINE,
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerFlags), "VT Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Trigger Mode", 0},
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Always On", 0},
ACPI_DMT_NEW_LINE,
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Interrupt), "Non-Secure PL2 Interrupt", 0},
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Flags), "NSPL2 Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Trigger Mode", 0},
- {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Interrupt), "Non-Secure EL2 Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Flags), "NEL2 Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Always On", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterReadBlockAddress), "Counter Read Block Address", 0},
+ ACPI_DMT_NEW_LINE,
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerCount), "Platform Timer Count", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerOffset), "Platform Timer Offset", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* GTDT Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[] =
+{
+ {ACPI_DMT_GTDT, ACPI_GTDTH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT16, ACPI_GTDTH_OFFSET (Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
+};
+
+/* GTDT Subtables */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[] =
+{
+ {ACPI_DMT_UINT8, ACPI_GTDT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT0_OFFSET (BlockAddress), "Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerCount), "Timer Count", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerOffset), "Timer Offset", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[] =
+{
+ {ACPI_DMT_UINT8 , ACPI_GTDT0a_OFFSET (FrameNumber), "Frame Number", 0},
+ {ACPI_DMT_UINT24, ACPI_GTDT0a_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (El0BaseAddress), "EL0 Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerInterrupt), "Timer Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerFlags), "Timer Flags (decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerFlags), "Virtual Timer Flags (decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (CommonFlags), "Common Flags (decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Secure", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Always On", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[] =
+{
+ {ACPI_DMT_UINT8, ACPI_GTDT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (RefreshFrameAddress), "Refresh Frame Address", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (ControlFrameAddress), "Control Frame Address", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerInterrupt), "Timer Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerFlags), "Timer Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Security", 0},
ACPI_DMT_TERMINATOR
};
@@ -1301,6 +1400,59 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] =
/*******************************************************************************
*
+ * LPIT - Low Power Idle Table
+ *
+ ******************************************************************************/
+
+/* Main table consists only of the standard ACPI table header */
+
+/* Common Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[] =
+{
+ {ACPI_DMT_LPIT, ACPI_LPITH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (UniqueId), "Unique ID", 0},
+ {ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "State Disabled", 0},
+ {ACPI_DMT_FLAG1, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "No Counter", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* LPIT Subtables */
+
+/* 0: Native C-state */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[] =
+{
+ {ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (EntryTrigger), "Entry Trigger", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Residency), "Residency", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Latency), "Latency", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (ResidencyCounter), "Residency Counter", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT0_OFFSET (CounterFrequency), "Counter Frequency", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 1: Simple I/O */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[] =
+{
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (EntryTrigger), "Entry Trigger", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (TriggerAction), "Trigger Action", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerValue), "Trigger Value", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerMask), "Trigger Mask", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (MinimumIdleState), "Minimum Idle State", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Residency), "Residency", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Latency), "Latency", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (ResidencyCounter), "Residency Counter", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (CounterFrequency), "Counter Frequency", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* MADT - Multiple APIC Description Table and subtables
*
******************************************************************************/
@@ -1464,14 +1616,21 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] =
{
{ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (Reserved), "Reserved", 0},
- {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (GicId), "Local GIC Hardware ID", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (CpuInterfaceNumber), "CPU Interface Number", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Uid), "Processor UID", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Processor Enabled", 0},
+ {ACPI_DMT_FLAG1, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Performance Interrupt Trigger Mode", 0},
+ {ACPI_DMT_FLAG2, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Virtual GIC Interrupt Trigger Mode", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (ParkingVersion), "Parking Protocol Version", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (PerformanceInterrupt), "Performance Interrupt", 0},
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ParkedAddress), "Parked Address", 0},
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicvBaseAddress), "Virtual GIC Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GichBaseAddress), "Hypervisor GIC Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (VgicInterrupt), "Virtual GIC Interrupt", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicrBaseAddress), "Redistributor Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ArmMpidr), "ARM MPIDR", 0},
ACPI_DMT_TERMINATOR
};
@@ -1487,6 +1646,30 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[] =
ACPI_DMT_TERMINATOR
};
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[] =
+{
+ {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (MsiFrameId), "MSI Frame ID", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT13_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_MADT13_FLAG_OFFSET (Flags,0), "Select SPI", 0},
+ {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiCount), "SPI Count", 0},
+ {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiBase), "SPI Base", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[] =
+{
+ {ACPI_DMT_UINT16, ACPI_MADT14_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT14_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT14_OFFSET (Length), "Length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
@@ -1677,25 +1860,52 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[] =
{
{ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_PCCT_FLAG_OFFSET (Flags,0), "Doorbell", 0},
- {ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Latency), "Command Latency", 0},
- {ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/* PCCT subtables */
+ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[] =
+{
+ {ACPI_DMT_PCCT, ACPI_PCCT0_OFFSET (Header.Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
+};
+
/* 0: Generic Communications Subspace */
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[] =
{
- {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Type), "Subtable Type", 0},
- {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT48, ACPI_PCCT0_OFFSET (Reserved[0]), "Reserved", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (BaseAddress), "Base Address", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (Length), "Address Length", 0},
{ACPI_DMT_GAS, ACPI_PCCT0_OFFSET (DoorbellRegister), "Doorbell Register", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (PreserveMask), "Preserve Mask", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (WriteMask), "Write Mask", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT0_OFFSET (Latency), "Command Latency", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT0_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
+ {ACPI_DMT_UINT16, ACPI_PCCT0_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] =
+{
+ {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Polarity", 0},
+ {ACPI_DMT_FLAG1, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Mode", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (Length), "Address Length", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT1_OFFSET (DoorbellRegister), "Doorbell Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (PreserveMask), "Preserve Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (WriteMask), "Write Mask", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (Latency), "Command Latency", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
+ {ACPI_DMT_UINT16, ACPI_PCCT1_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
ACPI_DMT_TERMINATOR
};
@@ -1927,7 +2137,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] =
{
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type", 0},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", DT_NON_ZERO}, /* Value must be 1 */
{ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version", 0},
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type", 0},
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number", 0},
@@ -1978,7 +2188,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] =
{ACPI_DMT_FLAG0, ACPI_SRAT0_FLAG_OFFSET (Flags,0), "Enabled", 0},
{ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (LocalSapicEid), "Local Sapic EID", 0},
{ACPI_DMT_UINT24, ACPI_SRAT0_OFFSET (ProximityDomainHi[0]), "Proximity Domain High(24)", 0},
- {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (ClockDomain), "Clock Domain", 0},
ACPI_DMT_TERMINATOR
};
@@ -2013,6 +2223,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
ACPI_DMT_TERMINATOR
};
+/* : GICC Affinity (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] =
+{
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ProximityDomain), "Proximity Domain", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (AcpiProcessorUid), "Acpi Processor UID", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_SRAT3_FLAG_OFFSET (Flags,0), "Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ClockDomain), "Clock Domain", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
diff --git a/sys/contrib/dev/acpica/common/getopt.c b/sys/contrib/dev/acpica/common/getopt.c
index 69f2ed5..cf3eb59 100644
--- a/sys/contrib/dev/acpica/common/getopt.c
+++ b/sys/contrib/dev/acpica/common/getopt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,14 +51,12 @@
* "f|" - Option has required single-char sub-options
*/
-#include <stdio.h>
-#include <string.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acapps.h>
#define ACPI_OPTION_ERROR(msg, badchar) \
- if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);}
+ if (AcpiGbl_Opterr) {AcpiLogError ("%s%c\n", msg, badchar);}
int AcpiGbl_Opterr = 1;
@@ -123,7 +121,7 @@ AcpiGetoptArgument (
* PARAMETERS: argc, argv - from main
* opts - options info list
*
- * RETURN: Option character or EOF
+ * RETURN: Option character or ACPI_OPT_END
*
* DESCRIPTION: Get the next option
*
@@ -145,12 +143,12 @@ AcpiGetopt(
argv[AcpiGbl_Optind][0] != '-' ||
argv[AcpiGbl_Optind][1] == '\0')
{
- return (EOF);
+ return (ACPI_OPT_END);
}
- else if (strcmp (argv[AcpiGbl_Optind], "--") == 0)
+ else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0)
{
AcpiGbl_Optind++;
- return (EOF);
+ return (ACPI_OPT_END);
}
}
@@ -161,7 +159,7 @@ AcpiGetopt(
/* Make sure that the option is legal */
if (CurrentChar == ':' ||
- (OptsPtr = strchr (opts, CurrentChar)) == NULL)
+ (OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL)
{
ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar);
diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c
index f5338bc..acd41be 100644
--- a/sys/contrib/dev/acpica/compiler/aslanalyze.c
+++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <string.h>
@@ -569,3 +568,51 @@ ApCheckRegMethod (
AslError (ASL_WARNING, ASL_MSG_NO_REGION, Op, NULL);
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: ApFindNameInScope
+ *
+ * PARAMETERS: Name - Name to search for
+ * Op - Current parse op
+ *
+ * RETURN: TRUE if name found in the same scope as Op.
+ *
+ * DESCRIPTION: Determine if a name appears in the same scope as Op, as either
+ * a Method() or a Name().
+ *
+ ******************************************************************************/
+
+BOOLEAN
+ApFindNameInScope (
+ char *Name,
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *Next;
+ ACPI_PARSE_OBJECT *Parent;
+
+
+ /* Get the start of the current scope */
+
+ Parent = Op->Asl.Parent;
+ Next = Parent->Asl.Child;
+
+ /* Search entire scope for a match to the name */
+
+ while (Next)
+ {
+ if ((Next->Asl.ParseOpcode == PARSEOP_METHOD) ||
+ (Next->Asl.ParseOpcode == PARSEOP_NAME))
+ {
+ if (ACPI_COMPARE_NAME (Name, Next->Asl.NameSeg))
+ {
+ return (TRUE);
+ }
+ }
+
+ Next = Next->Asl.Next;
+ }
+
+ return (FALSE);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslascii.c b/sys/contrib/dev/acpica/compiler/aslascii.c
new file mode 100644
index 0000000..f8a3980
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslascii.c
@@ -0,0 +1,349 @@
+/******************************************************************************
+ *
+ * Module Name: aslascii - ASCII detection and support routines
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include <contrib/dev/acpica/include/acapps.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslascii")
+
+
+/* Local prototypes */
+
+static void
+FlConsumeAnsiComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status);
+
+static void
+FlConsumeNewComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlCheckForAcpiTable
+ *
+ * PARAMETERS: Handle - Open input file
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
+ * following checks on what would be the table header:
+ * 0) File must be at least as long as an ACPI_TABLE_HEADER
+ * 1) The header length field must match the file size
+ * 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+FlCheckForAcpiTable (
+ FILE *Handle)
+{
+ ACPI_TABLE_HEADER Table;
+ UINT32 FileSize;
+ size_t Actual;
+ UINT32 i;
+
+
+ /* Read a potential table header */
+
+ Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
+ fseek (Handle, 0, SEEK_SET);
+
+ if (Actual < sizeof (ACPI_TABLE_HEADER))
+ {
+ return (AE_ERROR);
+ }
+
+ /* Header length field must match the file size */
+
+ FileSize = CmGetFileSize (Handle);
+ if (Table.Length != FileSize)
+ {
+ return (AE_ERROR);
+ }
+
+ /*
+ * These fields must be ASCII:
+ * Signature, OemId, OemTableId, AslCompilerId.
+ * We allow a NULL terminator in OemId and OemTableId.
+ */
+ for (i = 0; i < ACPI_NAME_SIZE; i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
+ {
+ return (AE_ERROR);
+ }
+
+ if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ printf ("Binary file appears to be a valid ACPI table, disassembling\n");
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlCheckForAscii
+ *
+ * PARAMETERS: Handle - Open input file
+ * Filename - Input filename
+ * DisplayErrors - TRUE if error messages desired
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
+ * within comments. Note: does not handle nested comments and does
+ * not handle comment delimiters within string literals. However,
+ * on the rare chance this happens and an invalid character is
+ * missed, the parser will catch the error by failing in some
+ * spectactular manner.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+FlCheckForAscii (
+ FILE *Handle,
+ char *Filename,
+ BOOLEAN DisplayErrors)
+{
+ UINT8 Byte;
+ ACPI_SIZE BadBytes = 0;
+ BOOLEAN OpeningComment = FALSE;
+ ASL_FILE_STATUS Status;
+
+
+ Status.Line = 1;
+ Status.Offset = 0;
+
+ /* Read the entire file */
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ /* Ignore comment fields (allow non-ascii within) */
+
+ if (OpeningComment)
+ {
+ /* Check for second comment open delimiter */
+
+ if (Byte == '*')
+ {
+ FlConsumeAnsiComment (Handle, &Status);
+ }
+
+ if (Byte == '/')
+ {
+ FlConsumeNewComment (Handle, &Status);
+ }
+
+ /* Reset */
+
+ OpeningComment = FALSE;
+ }
+ else if (Byte == '/')
+ {
+ OpeningComment = TRUE;
+ }
+
+ /* Check for an ASCII character */
+
+ if (!ACPI_IS_ASCII (Byte))
+ {
+ if ((BadBytes < 10) && (DisplayErrors))
+ {
+ AcpiOsPrintf (
+ "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
+ Byte, Status.Line, Status.Offset);
+ }
+
+ BadBytes++;
+ }
+
+ /* Update line counter */
+
+ else if (Byte == 0x0A)
+ {
+ Status.Line++;
+ }
+
+ Status.Offset++;
+ }
+
+ /* Seek back to the beginning of the source file */
+
+ fseek (Handle, 0, SEEK_SET);
+
+ /* Were there any non-ASCII characters in the file? */
+
+ if (BadBytes)
+ {
+ if (DisplayErrors)
+ {
+ AcpiOsPrintf (
+ "%u non-ASCII characters found in input source text, could be a binary file\n",
+ BadBytes);
+ AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
+ }
+
+ return (AE_BAD_CHARACTER);
+ }
+
+ /* File is OK (100% ASCII) */
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlConsumeAnsiComment
+ *
+ * PARAMETERS: Handle - Open input file
+ * Status - File current status struct
+ *
+ * RETURN: Number of lines consumed
+ *
+ * DESCRIPTION: Step over a normal slash-star type comment
+ *
+ ******************************************************************************/
+
+static void
+FlConsumeAnsiComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status)
+{
+ UINT8 Byte;
+ BOOLEAN ClosingComment = FALSE;
+
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ /* Scan until comment close is found */
+
+ if (ClosingComment)
+ {
+ if (Byte == '/')
+ {
+ return;
+ }
+
+ if (Byte != '*')
+ {
+ /* Reset */
+
+ ClosingComment = FALSE;
+ }
+ }
+ else if (Byte == '*')
+ {
+ ClosingComment = TRUE;
+ }
+
+ /* Maintain line count */
+
+ if (Byte == 0x0A)
+ {
+ Status->Line++;
+ }
+
+ Status->Offset++;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlConsumeNewComment
+ *
+ * PARAMETERS: Handle - Open input file
+ * Status - File current status struct
+ *
+ * RETURN: Number of lines consumed
+ *
+ * DESCRIPTION: Step over a slash-slash type of comment
+ *
+ ******************************************************************************/
+
+static void
+FlConsumeNewComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status)
+{
+ UINT8 Byte;
+
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ Status->Offset++;
+
+ /* Comment ends at newline */
+
+ if (Byte == 0x0A)
+ {
+ Status->Line++;
+ return;
+ }
+ }
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslbtypes.c b/sys/contrib/dev/acpica/compiler/aslbtypes.c
index 16f3a0b..0ff8664 100644
--- a/sys/contrib/dev/acpica/compiler/aslbtypes.c
+++ b/sys/contrib/dev/acpica/compiler/aslbtypes.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -243,7 +242,7 @@ AnMapEtypeToBtype (
return (ACPI_BTYPE_INTEGER | ACPI_BTYPE_DDB_HANDLE);
- case ACPI_BTYPE_DEBUG_OBJECT:
+ case ACPI_TYPE_DEBUG_OBJECT:
/* Cannot be used as a source operand */
diff --git a/sys/contrib/dev/acpica/compiler/aslcodegen.c b/sys/contrib/dev/acpica/compiler/aslcodegen.c
index b7d510d..b462d7b 100644
--- a/sys/contrib/dev/acpica/compiler/aslcodegen.c
+++ b/sys/contrib/dev/acpica/compiler/aslcodegen.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c
index 48ccfa3..b26c9e8 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompile.c
+++ b/sys/contrib/dev/acpica/compiler/aslcompile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,7 @@
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
#include <stdio.h>
#include <time.h>
@@ -67,488 +68,12 @@ CmFlushSourceCode (
void);
static void
-FlConsumeAnsiComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status);
-
-static void
-FlConsumeNewComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status);
-
-static void
CmDumpAllEvents (
void);
/*******************************************************************************
*
- * FUNCTION: AslCompilerSignon
- *
- * PARAMETERS: FileId - ID of the output file
- *
- * RETURN: None
- *
- * DESCRIPTION: Display compiler signon
- *
- ******************************************************************************/
-
-void
-AslCompilerSignon (
- UINT32 FileId)
-{
- char *Prefix = "";
- char *UtilityName;
-
-
- /* Set line prefix depending on the destination file type */
-
- switch (FileId)
- {
- case ASL_FILE_ASM_SOURCE_OUTPUT:
- case ASL_FILE_ASM_INCLUDE_OUTPUT:
-
- Prefix = "; ";
- break;
-
- case ASL_FILE_HEX_OUTPUT:
-
- if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
- {
- Prefix = "; ";
- }
- else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
- (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
- {
- FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n");
- Prefix = " * ";
- }
- break;
-
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- Prefix = " * ";
- break;
-
- default:
-
- /* No other output types supported */
-
- break;
- }
-
- /* Running compiler or disassembler? */
-
- if (Gbl_DisasmFlag)
- {
- UtilityName = AML_DISASSEMBLER_NAME;
- }
- else
- {
- UtilityName = ASL_COMPILER_NAME;
- }
-
- /* Compiler signon with copyright */
-
- FlPrintFile (FileId, "%s\n", Prefix);
- FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix));
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AslCompilerFileHeader
- *
- * PARAMETERS: FileId - ID of the output file
- *
- * RETURN: None
- *
- * DESCRIPTION: Header used at the beginning of output files
- *
- ******************************************************************************/
-
-void
-AslCompilerFileHeader (
- UINT32 FileId)
-{
- struct tm *NewTime;
- time_t Aclock;
- char *Prefix = "";
-
-
- /* Set line prefix depending on the destination file type */
-
- switch (FileId)
- {
- case ASL_FILE_ASM_SOURCE_OUTPUT:
- case ASL_FILE_ASM_INCLUDE_OUTPUT:
-
- Prefix = "; ";
- break;
-
- case ASL_FILE_HEX_OUTPUT:
-
- if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
- {
- Prefix = "; ";
- }
- else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
- (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
- {
- Prefix = " * ";
- }
- break;
-
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- Prefix = " * ";
- break;
-
- default:
-
- /* No other output types supported */
-
- break;
- }
-
- /* Compilation header with timestamp */
-
- (void) time (&Aclock);
- NewTime = localtime (&Aclock);
-
- FlPrintFile (FileId,
- "%sCompilation of \"%s\" - %s%s\n",
- Prefix, Gbl_Files[ASL_FILE_INPUT].Filename, asctime (NewTime),
- Prefix);
-
- switch (FileId)
- {
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- FlPrintFile (FileId, " */\n");
- break;
-
- default:
-
- /* Nothing to do for other output types */
-
- break;
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: CmFlushSourceCode
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Read in any remaining source code after the parse tree
- * has been constructed.
- *
- ******************************************************************************/
-
-static void
-CmFlushSourceCode (
- void)
-{
- char Buffer;
-
-
- while (FlReadFile (ASL_FILE_INPUT, &Buffer, 1) != AE_ERROR)
- {
- AslInsertLineBuffer ((int) Buffer);
- }
-
- AslResetCurrentLineBuffer ();
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlConsume*
- *
- * PARAMETERS: Handle - Open input file
- * Status - File current status struct
- *
- * RETURN: Number of lines consumed
- *
- * DESCRIPTION: Step over both types of comment during check for ascii chars
- *
- ******************************************************************************/
-
-static void
-FlConsumeAnsiComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status)
-{
- UINT8 Byte;
- BOOLEAN ClosingComment = FALSE;
-
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- /* Scan until comment close is found */
-
- if (ClosingComment)
- {
- if (Byte == '/')
- {
- return;
- }
-
- if (Byte != '*')
- {
- /* Reset */
-
- ClosingComment = FALSE;
- }
- }
- else if (Byte == '*')
- {
- ClosingComment = TRUE;
- }
-
- /* Maintain line count */
-
- if (Byte == 0x0A)
- {
- Status->Line++;
- }
-
- Status->Offset++;
- }
-}
-
-
-static void
-FlConsumeNewComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status)
-{
- UINT8 Byte;
-
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- Status->Offset++;
-
- /* Comment ends at newline */
-
- if (Byte == 0x0A)
- {
- Status->Line++;
- return;
- }
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlCheckForAcpiTable
- *
- * PARAMETERS: Handle - Open input file
- *
- * RETURN: Status
- *
- * DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
- * following checks on what would be the table header:
- * 0) File must be at least as long as an ACPI_TABLE_HEADER
- * 1) The header length field must match the file size
- * 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
- *
- ******************************************************************************/
-
-ACPI_STATUS
-FlCheckForAcpiTable (
- FILE *Handle)
-{
- ACPI_TABLE_HEADER Table;
- UINT32 FileSize;
- size_t Actual;
- UINT32 i;
-
-
- /* Read a potential table header */
-
- Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
- fseek (Handle, 0, SEEK_SET);
-
- if (Actual < sizeof (ACPI_TABLE_HEADER))
- {
- return (AE_ERROR);
- }
-
- /* Header length field must match the file size */
-
- FileSize = DtGetFileSize (Handle);
- if (Table.Length != FileSize)
- {
- return (AE_ERROR);
- }
-
- /*
- * These fields must be ASCII:
- * Signature, OemId, OemTableId, AslCompilerId.
- * We allow a NULL terminator in OemId and OemTableId.
- */
- for (i = 0; i < ACPI_NAME_SIZE; i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
- {
- return (AE_ERROR);
- }
-
- if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- printf ("Binary file appears to be a valid ACPI table, disassembling\n");
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlCheckForAscii
- *
- * PARAMETERS: Handle - Open input file
- * Filename - Input filename
- * DisplayErrors - TRUE if error messages desired
- *
- * RETURN: Status
- *
- * DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
- * within comments. Note: does not handle nested comments and does
- * not handle comment delimiters within string literals. However,
- * on the rare chance this happens and an invalid character is
- * missed, the parser will catch the error by failing in some
- * spectactular manner.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-FlCheckForAscii (
- FILE *Handle,
- char *Filename,
- BOOLEAN DisplayErrors)
-{
- UINT8 Byte;
- ACPI_SIZE BadBytes = 0;
- BOOLEAN OpeningComment = FALSE;
- ASL_FILE_STATUS Status;
-
-
- Status.Line = 1;
- Status.Offset = 0;
-
- /* Read the entire file */
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- /* Ignore comment fields (allow non-ascii within) */
-
- if (OpeningComment)
- {
- /* Check for second comment open delimiter */
-
- if (Byte == '*')
- {
- FlConsumeAnsiComment (Handle, &Status);
- }
-
- if (Byte == '/')
- {
- FlConsumeNewComment (Handle, &Status);
- }
-
- /* Reset */
-
- OpeningComment = FALSE;
- }
- else if (Byte == '/')
- {
- OpeningComment = TRUE;
- }
-
- /* Check for an ASCII character */
-
- if (!ACPI_IS_ASCII (Byte))
- {
- if ((BadBytes < 10) && (DisplayErrors))
- {
- AcpiOsPrintf (
- "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
- Byte, Status.Line, Status.Offset);
- }
-
- BadBytes++;
- }
-
- /* Update line counter */
-
- else if (Byte == 0x0A)
- {
- Status.Line++;
- }
-
- Status.Offset++;
- }
-
- /* Seek back to the beginning of the source file */
-
- fseek (Handle, 0, SEEK_SET);
-
- /* Were there any non-ASCII characters in the file? */
-
- if (BadBytes)
- {
- if (DisplayErrors)
- {
- AcpiOsPrintf (
- "%u non-ASCII characters found in input source text, could be a binary file\n",
- BadBytes);
- AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
- }
-
- return (AE_BAD_CHARACTER);
- }
-
- /* File is OK (100% ASCII) */
-
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: CmDoCompile
*
* PARAMETERS: None
@@ -617,7 +142,6 @@ CmDoCompile (
goto ErrorExit;
}
-
/* Flush out any remaining source after parse tree is complete */
Event = UtBeginEvent ("Flush source input");
@@ -802,6 +326,197 @@ ErrorExit:
/*******************************************************************************
*
+ * FUNCTION: AslCompilerSignon
+ *
+ * PARAMETERS: FileId - ID of the output file
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Display compiler signon
+ *
+ ******************************************************************************/
+
+void
+AslCompilerSignon (
+ UINT32 FileId)
+{
+ char *Prefix = "";
+ char *UtilityName;
+
+
+ /* Set line prefix depending on the destination file type */
+
+ switch (FileId)
+ {
+ case ASL_FILE_ASM_SOURCE_OUTPUT:
+ case ASL_FILE_ASM_INCLUDE_OUTPUT:
+
+ Prefix = "; ";
+ break;
+
+ case ASL_FILE_HEX_OUTPUT:
+
+ if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
+ {
+ Prefix = "; ";
+ }
+ else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
+ (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
+ {
+ FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n");
+ Prefix = " * ";
+ }
+ break;
+
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ Prefix = " * ";
+ break;
+
+ default:
+
+ /* No other output types supported */
+
+ break;
+ }
+
+ /* Running compiler or disassembler? */
+
+ if (Gbl_DisasmFlag)
+ {
+ UtilityName = AML_DISASSEMBLER_NAME;
+ }
+ else
+ {
+ UtilityName = ASL_COMPILER_NAME;
+ }
+
+ /* Compiler signon with copyright */
+
+ FlPrintFile (FileId, "%s\n", Prefix);
+ FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AslCompilerFileHeader
+ *
+ * PARAMETERS: FileId - ID of the output file
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Header used at the beginning of output files
+ *
+ ******************************************************************************/
+
+void
+AslCompilerFileHeader (
+ UINT32 FileId)
+{
+ struct tm *NewTime;
+ time_t Aclock;
+ char *Prefix = "";
+
+
+ /* Set line prefix depending on the destination file type */
+
+ switch (FileId)
+ {
+ case ASL_FILE_ASM_SOURCE_OUTPUT:
+ case ASL_FILE_ASM_INCLUDE_OUTPUT:
+
+ Prefix = "; ";
+ break;
+
+ case ASL_FILE_HEX_OUTPUT:
+
+ if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
+ {
+ Prefix = "; ";
+ }
+ else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
+ (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
+ {
+ Prefix = " * ";
+ }
+ break;
+
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ Prefix = " * ";
+ break;
+
+ default:
+
+ /* No other output types supported */
+
+ break;
+ }
+
+ /* Compilation header with timestamp */
+
+ (void) time (&Aclock);
+ NewTime = localtime (&Aclock);
+
+ FlPrintFile (FileId,
+ "%sCompilation of \"%s\" - %s%s\n",
+ Prefix, Gbl_Files[ASL_FILE_INPUT].Filename, asctime (NewTime),
+ Prefix);
+
+ switch (FileId)
+ {
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ FlPrintFile (FileId, " */\n");
+ break;
+
+ default:
+
+ /* Nothing to do for other output types */
+
+ break;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CmFlushSourceCode
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Read in any remaining source code after the parse tree
+ * has been constructed.
+ *
+ ******************************************************************************/
+
+static void
+CmFlushSourceCode (
+ void)
+{
+ char Buffer;
+
+
+ while (FlReadFile (ASL_FILE_INPUT, &Buffer, 1) != AE_ERROR)
+ {
+ AslInsertLineBuffer ((int) Buffer);
+ }
+
+ AslResetCurrentLineBuffer ();
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: CmDoOutputFiles
*
* PARAMETERS: None
@@ -825,6 +540,10 @@ CmDoOutputFiles (
/* Dump the namespace to the .nsp file if requested */
(void) NsDisplayNamespace ();
+
+ /* Dump the device mapping file */
+
+ MpEmitMappingInfo ();
}
@@ -965,7 +684,8 @@ CmCleanupAndExit (
* We will delete the AML file if there are errors and the
* force AML output option has not been used.
*/
- if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
+ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) &&
+ (!Gbl_IgnoreErrors) &&
Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
{
DeleteAmlFile = TRUE;
@@ -1025,4 +745,71 @@ CmCleanupAndExit (
{
FlDeleteFile (ASL_FILE_SOURCE_OUTPUT);
}
+
+ /* Final cleanup after compiling one file */
+
+ CmDeleteCaches ();
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CmDeleteCaches
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Delete all local cache buffer blocks
+ *
+ ******************************************************************************/
+
+void
+CmDeleteCaches (
+ void)
+{
+ UINT32 BufferCount;
+ ASL_CACHE_INFO *Next;
+
+
+ /* Parse Op cache */
+
+ BufferCount = 0;
+ while (Gbl_ParseOpCacheList)
+ {
+ Next = Gbl_ParseOpCacheList->Next;
+ ACPI_FREE (Gbl_ParseOpCacheList);
+ Gbl_ParseOpCacheList = Next;
+ BufferCount++;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u ParseOps, Buffer size: %u ops (%u bytes), %u Buffers\n",
+ Gbl_ParseOpCount, ASL_PARSEOP_CACHE_SIZE,
+ (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
+
+ Gbl_ParseOpCount = 0;
+ Gbl_ParseOpCacheNext = NULL;
+ Gbl_ParseOpCacheLast = NULL;
+ RootNode = NULL;
+
+ /* Generic string cache */
+
+ BufferCount = 0;
+ while (Gbl_StringCacheList)
+ {
+ Next = Gbl_StringCacheList->Next;
+ ACPI_FREE (Gbl_StringCacheList);
+ Gbl_StringCacheList = Next;
+ BufferCount++;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Strings (%u bytes), Buffer size: %u bytes, %u Buffers\n",
+ Gbl_StringCount, Gbl_StringSize, ASL_STRING_CACHE_SIZE, BufferCount);
+
+ Gbl_StringSize = 0;
+ Gbl_StringCount = 0;
+ Gbl_StringCacheNext = NULL;
+ Gbl_StringCacheLast = NULL;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.h b/sys/contrib/dev/acpica/compiler/aslcompiler.h
index 132ae7d..1667d8f 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLCOMPILER_H
#define __ASLCOMPILER_H
@@ -111,6 +110,11 @@ AslPushInputFileStack (
FILE *InputFile,
char *Filename);
+void
+AslParserCleanup (
+ void);
+
+
/*
* aslstartup - entered from main()
*/
@@ -123,11 +127,6 @@ ACPI_STATUS (*ASL_PATHNAME_CALLBACK) (
char *);
ACPI_STATUS
-AslDoOnePathname (
- char *Pathname,
- ASL_PATHNAME_CALLBACK Callback);
-
-ACPI_STATUS
AslDoOneFile (
char *Filename);
@@ -159,6 +158,14 @@ void
CmCleanupAndExit (
void);
+void
+CmDeleteCaches (
+ void);
+
+
+/*
+ * aslascii - ascii support
+ */
ACPI_STATUS
FlCheckForAcpiTable (
FILE *Handle);
@@ -280,14 +287,23 @@ void
ApCheckRegMethod (
ACPI_PARSE_OBJECT *Op);
+BOOLEAN
+ApFindNameInScope (
+ char *Name,
+ ACPI_PARSE_OBJECT *Op);
+
/*
* aslerror - error handling/reporting
*/
void
+AslAbort (
+ void);
+
+void
AslError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage);
@@ -298,7 +314,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
- UINT8 MessageId);
+ UINT16 MessageId);
void
AslCoreSubsystemError (
@@ -314,7 +330,7 @@ AslCompilererror(
void
AslCommonError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@@ -325,7 +341,7 @@ AslCommonError (
void
AslCommonError2 (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@@ -346,10 +362,6 @@ void
AeClearErrorLog (
void);
-ACPI_PHYSICAL_ADDRESS
-AeLocalGetRootPointer (
- void);
-
/*
* asllisting - generate all "listing" type files
@@ -440,6 +452,22 @@ OpcAmlConstantWalk (
/*
+ * aslmessages - exception strings
+ */
+const char *
+AeDecodeMessageId (
+ UINT16 MessageId);
+
+const char *
+AeDecodeExceptionLevel (
+ UINT8 Level);
+
+UINT16
+AeBuildFullExceptionCode (
+ UINT8 Level,
+ UINT16 MessageId);
+
+/*
* asloffset - generate C offset file for BIOS support
*/
ACPI_STATUS
@@ -708,10 +736,6 @@ TrLinkPeerNodes (
* aslfiles - File I/O support
*/
void
-AslAbort (
- void);
-
-void
FlAddIncludeDirectory (
char *Dir);
@@ -784,6 +808,13 @@ ACPI_STATUS
FlOpenMiscOutputFiles (
char *InputFilename);
+/*
+ * aslhwmap - hardware map summary
+ */
+void
+MpEmitMappingInfo (
+ void);
+
/*
* asload - load namespace in prep for cross reference
@@ -883,10 +914,6 @@ void
UtDisplaySummary (
UINT32 FileId);
-UINT8
-UtHexCharToValue (
- int HexChar);
-
void
UtConvertByteToHex (
UINT8 RawByte,
@@ -906,13 +933,17 @@ UtSetParseOpName (
ACPI_PARSE_OBJECT *Op);
char *
-UtGetStringBuffer (
+UtStringCacheCalloc (
UINT32 Length);
void
UtExpandLineBuffers (
void);
+void
+UtFreeLineBuffers (
+ void);
+
ACPI_STATUS
UtInternalizeName (
char *ExternalName,
@@ -948,11 +979,6 @@ AuValidateUuid (
char *InString);
ACPI_STATUS
-AuConvertStringToUuid (
- char *InString,
- char *UuIdBuffer);
-
-ACPI_STATUS
AuConvertUuidToString (
char *UuIdBuffer,
char *OutString);
@@ -1026,8 +1052,7 @@ RsCheckListForDuplicates (
ASL_RESOURCE_NODE *
RsDoOneResourceDescriptor (
- ACPI_PARSE_OBJECT *DescriptorTypeOp,
- UINT32 CurrentByteOffset,
+ ASL_RESOURCE_INFO *Info,
UINT8 *State);
/* Values for State above */
@@ -1051,43 +1076,35 @@ RsDoResourceTemplate (
*/
ASL_RESOURCE_NODE *
RsDoEndTagDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoEndDependentDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory24Descriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory32Descriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory32FixedDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoStartDependentDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoStartDependentNoPriDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoVendorSmallDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1095,33 +1112,27 @@ RsDoVendorSmallDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoDmaDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoFixedDmaDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoFixedIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIrqDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIrqNoFlagsDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1129,61 +1140,50 @@ RsDoIrqNoFlagsDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoInterruptDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoVendorLargeDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGeneralRegisterDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGpioIntDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGpioIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoI2cSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoSpiSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoUartSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
* aslrestype2d - DWord address descriptors
*/
ASL_RESOURCE_NODE *
RsDoDwordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoDwordMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoDwordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1191,18 +1191,15 @@ RsDoDwordSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoExtendedIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoExtendedMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoExtendedSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1210,18 +1207,15 @@ RsDoExtendedSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoQwordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoQwordMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoQwordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1229,18 +1223,16 @@ RsDoQwordSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoWordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoWordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoWordBusNumberDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
+
/*
* Entry to data table compiler subsystem
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.l b/sys/contrib/dev/acpica/compiler/aslcompiler.l
index 5b2d9ce..bbf41cd 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.l
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -110,10 +110,11 @@ NamePathTail [.]{NameSeg}
[ \t] { count (0); }
-"/*" { if (!AslDoComment ()) yyterminate (); }
-"//" { if (!AslDoCommentType2 ()) yyterminate (); }
+"/*" { if (!AslDoComment ()) {yyterminate ();} }
+"//" { if (!AslDoCommentType2 ()) {yyterminate ();} }
-"\"" { if (AslDoStringLiteral ()) return (PARSEOP_STRING_LITERAL); else yyterminate (); }
+"\"" { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);}
+ else {yyterminate ();} }
";" { count (0); return(';'); }
@@ -607,7 +608,7 @@ NamePathTail [.]{NameSeg}
{NameSeg} { char *s;
count (0);
- s=malloc (ACPI_NAME_SIZE + 1);
+ s=UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
if (strcmp (AslCompilertext, "\\"))
{
strcpy (s, "____");
@@ -620,10 +621,9 @@ NamePathTail [.]{NameSeg}
{NameString} { char *s;
count (0);
- s=malloc (strlen (AslCompilertext)+1);
+ s=UtStringCacheCalloc (strlen (AslCompilertext)+1);
AcpiUtStrupr (AslCompilertext);
strcpy (s, AslCompilertext);
- s[strlen (AslCompilertext)] = 0;
AslCompilerlval.s = s;
DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
return (PARSEOP_NAMESTRING); }
@@ -639,9 +639,9 @@ NamePathTail [.]{NameSeg}
AslCompilererror (MsgBuffer);}
<<EOF>> { if (AslPopInputFileStack ())
- yyterminate();
+ {yyterminate();}
else
- return (PARSEOP_INCLUDE_END);};
+ {return (PARSEOP_INCLUDE_END);} };
%%
diff --git a/sys/contrib/dev/acpica/compiler/asldefine.h b/sys/contrib/dev/acpica/compiler/asldefine.h
index 76e2e12..9400281 100644
--- a/sys/contrib/dev/acpica/compiler/asldefine.h
+++ b/sys/contrib/dev/acpica/compiler/asldefine.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLDEFINE_H
#define __ASLDEFINE_H
@@ -55,14 +54,14 @@
#define ASL_INVOCATION_NAME "iasl"
#define ASL_CREATOR_ID "INTL"
-#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.0"
+#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.1"
/* Configuration constants */
#define ASL_MAX_ERROR_COUNT 200
-#define ASL_NODE_CACHE_SIZE 1024
-#define ASL_STRING_CACHE_SIZE 32768
+#define ASL_PARSEOP_CACHE_SIZE (1024 * 16)
+#define ASL_STRING_CACHE_SIZE (1024 * 64)
#define ASL_FIRST_PARSE_OPCODE PARSEOP_ACCESSAS
#define ASL_PARSE_OPCODE_BASE PARSEOP_ACCESSAS /* First Lex type */
@@ -109,6 +108,7 @@
#define FILE_SUFFIX_PREPROCESSOR "i"
#define FILE_SUFFIX_AML_CODE "aml"
+#define FILE_SUFFIX_MAP "map"
#define FILE_SUFFIX_LISTING "lst"
#define FILE_SUFFIX_HEX_DUMP "hex"
#define FILE_SUFFIX_DEBUG "txt"
diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c
index ff6ec36..7f25f97 100644
--- a/sys/contrib/dev/acpica/compiler/aslerror.c
+++ b/sys/contrib/dev/acpica/compiler/aslerror.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define ASL_EXCEPTIONS
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
@@ -56,6 +55,36 @@ AeAddToErrorLog (
/*******************************************************************************
*
+ * FUNCTION: AslAbort
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump the error log and abort the compiler. Used for serious
+ * I/O errors.
+ *
+ ******************************************************************************/
+
+void
+AslAbort (
+ void)
+{
+
+ AePrintErrorLog (ASL_FILE_STDERR);
+ if (Gbl_DebugFlag)
+ {
+ /* Print error summary to stdout also */
+
+ AePrintErrorLog (ASL_FILE_STDOUT);
+ }
+
+ exit (1);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AeClearErrorLog
*
* PARAMETERS: None
@@ -174,7 +203,7 @@ AePrintException (
int Actual;
size_t RActual;
UINT32 MsgLength;
- char *MainMessage;
+ const char *MainMessage;
char *ExtraMessage;
UINT32 SourceColumn;
UINT32 ErrorColumn;
@@ -200,6 +229,16 @@ AePrintException (
switch (Enode->Level)
{
+ case ASL_WARNING:
+ case ASL_WARNING2:
+ case ASL_WARNING3:
+
+ if (!Gbl_DisplayWarnings)
+ {
+ return;
+ }
+ break;
+
case ASL_REMARK:
if (!Gbl_DisplayRemarks)
@@ -222,11 +261,10 @@ AePrintException (
}
}
- /* Get the file handles */
+ /* Get the various required file handles */
OutputFile = Gbl_Files[FileId].Handle;
-
if (!Enode->SourceLine)
{
/* Use the merged header/source file if present, otherwise use input file */
@@ -360,109 +398,93 @@ AePrintException (
}
}
- /* NULL message ID, just print the raw message */
+ /* If a NULL message ID, just print the raw message */
if (Enode->MessageId == 0)
{
fprintf (OutputFile, "%s\n", Enode->Message);
+ return;
}
- else
- {
- /* Decode the message ID */
- if (Gbl_VerboseErrors)
- {
- fprintf (OutputFile, "%s %4.4d -",
- AslErrorLevel[Enode->Level],
- Enode->MessageId + ((Enode->Level+1) * 1000));
- }
- else /* IDE case */
- {
- fprintf (OutputFile, "%s %4.4d:",
- AslErrorLevelIde[Enode->Level],
- Enode->MessageId + ((Enode->Level+1) * 1000));
- }
+ /* Decode the message ID */
- MainMessage = AslMessages[Enode->MessageId];
- ExtraMessage = Enode->Message;
+ fprintf (OutputFile, "%s %4.4d -",
+ AeDecodeExceptionLevel (Enode->Level),
+ AeBuildFullExceptionCode (Enode->Level, Enode->MessageId));
- if (Enode->LineNumber)
- {
- /* Main message: try to use string from AslMessages first */
+ MainMessage = AeDecodeMessageId (Enode->MessageId);
+ ExtraMessage = Enode->Message;
- if (!MainMessage)
- {
- MainMessage = "";
- }
+ /* If a NULL line number, just print the decoded message */
- MsgLength = strlen (MainMessage);
- if (MsgLength == 0)
- {
- /* Use the secondary/extra message as main message */
+ if (!Enode->LineNumber)
+ {
+ fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
+ return;
+ }
- MainMessage = Enode->Message;
- if (!MainMessage)
- {
- MainMessage = "";
- }
+ MsgLength = strlen (MainMessage);
+ if (MsgLength == 0)
+ {
+ /* Use the secondary/extra message as main message */
- MsgLength = strlen (MainMessage);
- ExtraMessage = NULL;
- }
+ MainMessage = Enode->Message;
+ if (!MainMessage)
+ {
+ MainMessage = "";
+ }
- if (Gbl_VerboseErrors && !PrematureEOF)
- {
- if (Total >= 256)
- {
- fprintf (OutputFile, " %s",
- MainMessage);
- }
- else
- {
- SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
- ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+ MsgLength = strlen (MainMessage);
+ ExtraMessage = NULL;
+ }
- if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
- {
- fprintf (OutputFile, "%*s%s",
- (int) ((SourceColumn - 1) - ErrorColumn),
- MainMessage, " ^ ");
- }
- else
- {
- fprintf (OutputFile, "%*s %s",
- (int) ((SourceColumn - ErrorColumn) + 1), "^",
- MainMessage);
- }
- }
+ if (Gbl_VerboseErrors && !PrematureEOF)
+ {
+ if (Total >= 256)
+ {
+ fprintf (OutputFile, " %s",
+ MainMessage);
+ }
+ else
+ {
+ SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
+ ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+
+ if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
+ {
+ fprintf (OutputFile, "%*s%s",
+ (int) ((SourceColumn - 1) - ErrorColumn),
+ MainMessage, " ^ ");
}
else
{
- fprintf (OutputFile, " %s", MainMessage);
+ fprintf (OutputFile, "%*s %s",
+ (int) ((SourceColumn - ErrorColumn) + 1), "^",
+ MainMessage);
}
+ }
+ }
+ else
+ {
+ fprintf (OutputFile, " %s", MainMessage);
+ }
- /* Print the extra info message if present */
+ /* Print the extra info message if present */
- if (ExtraMessage)
- {
- fprintf (OutputFile, " (%s)", ExtraMessage);
- }
+ if (ExtraMessage)
+ {
+ fprintf (OutputFile, " (%s)", ExtraMessage);
+ }
- if (PrematureEOF)
- {
- fprintf (OutputFile, " and premature End-Of-File");
- }
+ if (PrematureEOF)
+ {
+ fprintf (OutputFile, " and premature End-Of-File");
+ }
- fprintf (OutputFile, "\n");
- if (Gbl_VerboseErrors)
- {
- fprintf (OutputFile, "\n");
- }
- }
- else
- {
- fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
- }
+ fprintf (OutputFile, "\n");
+ if (Gbl_VerboseErrors)
+ {
+ fprintf (OutputFile, "\n");
}
}
@@ -517,7 +539,7 @@ AePrintErrorLog (
void
AslCommonError2 (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@@ -535,7 +557,7 @@ AslCommonError2 (
{
/* Allocate a buffer for the message and a new error node */
- MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1);
+ MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
/* Keep a copy of the extra message */
@@ -549,7 +571,7 @@ AslCommonError2 (
if (Filename)
{
- Enode->Filename = Filename;
+ Enode->Filename = Filename;
Enode->FilenameLength = strlen (Filename);
if (Enode->FilenameLength < 6)
{
@@ -603,7 +625,7 @@ AslCommonError2 (
void
AslCommonError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@@ -611,7 +633,6 @@ AslCommonError (
char *Filename,
char *ExtraMessage)
{
- UINT32 MessageSize;
char *MessageBuffer = NULL;
ASL_ERROR_MSG *Enode;
@@ -622,8 +643,7 @@ AslCommonError (
{
/* Allocate a buffer for the message and a new error node */
- MessageSize = strlen (ExtraMessage) + 1;
- MessageBuffer = UtLocalCalloc (MessageSize);
+ MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
/* Keep a copy of the extra message */
@@ -634,7 +654,7 @@ AslCommonError (
if (Filename)
{
- Enode->Filename = Filename;
+ Enode->Filename = Filename;
Enode->FilenameLength = strlen (Filename);
if (Enode->FilenameLength < 6)
{
@@ -739,7 +759,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
- UINT8 MessageId)
+ UINT16 MessageId)
{
UINT32 EncodedMessageId;
UINT32 i;
@@ -764,7 +784,7 @@ AslIsExceptionDisabled (
* Ignore this warning/remark if it has been disabled by
* the user (-vw option)
*/
- EncodedMessageId = MessageId + ((Level + 1) * 1000);
+ EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);
for (i = 0; i < Gbl_DisabledMessagesIndex; i++)
{
/* Simple implementation via fixed array */
@@ -803,14 +823,15 @@ AslIsExceptionDisabled (
void
AslError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage)
{
/* Check if user wants to ignore this exception */
- if (AslIsExceptionDisabled (Level, MessageId))
+ if (Gbl_AllExceptionsDisabled ||
+ AslIsExceptionDisabled (Level, MessageId))
{
return;
}
@@ -836,14 +857,14 @@ AslError (
* FUNCTION: AslCoreSubsystemError
*
* PARAMETERS: Op - Parse node where error happened
- * Status - The ACPI CA Exception
+ * Status - The ACPICA Exception
* ExtraMessage - additional error message
* Abort - TRUE -> Abort compilation
*
* RETURN: None
*
- * DESCRIPTION: Error reporting routine for exceptions returned by the ACPI
- * CA core subsystem.
+ * DESCRIPTION: Error reporting routine for exceptions returned by the ACPICA
+ * core subsystem.
*
******************************************************************************/
diff --git a/sys/contrib/dev/acpica/compiler/aslfileio.c b/sys/contrib/dev/acpica/compiler/aslfileio.c
index 660b82f..a408575 100644
--- a/sys/contrib/dev/acpica/compiler/aslfileio.c
+++ b/sys/contrib/dev/acpica/compiler/aslfileio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslfileio")
@@ -49,36 +50,6 @@
/*******************************************************************************
*
- * FUNCTION: AslAbort
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Dump the error log and abort the compiler. Used for serious
- * I/O errors.
- *
- ******************************************************************************/
-
-void
-AslAbort (
- void)
-{
-
- AePrintErrorLog (ASL_FILE_STDERR);
- if (Gbl_DebugFlag)
- {
- /* Print error summary to stdout also */
-
- AePrintErrorLog (ASL_FILE_STDOUT);
- }
-
- exit (1);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: FlFileError
*
* PARAMETERS: FileId - Index into file info array
@@ -147,7 +118,8 @@ FlOpenFile (
*
* RETURN: File Size
*
- * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
+ * DESCRIPTION: Get current file size. Uses common seek-to-EOF function.
+ * File must be open. Aborts compiler on error.
*
******************************************************************************/
@@ -155,20 +127,15 @@ UINT32
FlGetFileSize (
UINT32 FileId)
{
- FILE *fp;
UINT32 FileSize;
- long Offset;
-
-
- fp = Gbl_Files[FileId].Handle;
- Offset = ftell (fp);
- fseek (fp, 0, SEEK_END);
- FileSize = (UINT32) ftell (fp);
- /* Restore file pointer */
+ FileSize = CmGetFileSize (Gbl_Files[FileId].Handle);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ AslAbort();
+ }
- fseek (fp, Offset, SEEK_SET);
return (FileSize);
}
@@ -352,6 +319,8 @@ FlCloseFile (
AslAbort ();
}
+ /* Do not clear/free the filename string */
+
Gbl_Files[FileId].Handle = NULL;
return;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslfiles.c b/sys/contrib/dev/acpica/compiler/aslfiles.c
index 2ed9413..2c84c9e 100644
--- a/sys/contrib/dev/acpica/compiler/aslfiles.c
+++ b/sys/contrib/dev/acpica/compiler/aslfiles.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -107,6 +107,8 @@ FlSetFilename (
DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New filename %s (old %s)\n",
Filename, Gbl_Files[ASL_FILE_INPUT].Filename);
+ /* No need to free any existing filename */
+
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
}
@@ -216,14 +218,14 @@ FlMergePathnames (
(*FilePathname == '/') ||
(FilePathname[1] == ':'))
{
- Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1);
+ Pathname = UtStringCacheCalloc (strlen (FilePathname) + 1);
strcpy (Pathname, FilePathname);
goto ConvertBackslashes;
}
/* Need a local copy of the prefix directory path */
- CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1);
+ CommonPath = UtStringCacheCalloc (strlen (PrefixDir) + 1);
strcpy (CommonPath, PrefixDir);
/*
@@ -259,14 +261,13 @@ FlMergePathnames (
/* Build the final merged pathname */
ConcatenatePaths:
- Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2);
+ Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2);
if (LastElement && *CommonPath)
{
strcpy (Pathname, CommonPath);
strcat (Pathname, "/");
}
strcat (Pathname, FilePathname);
- ACPI_FREE (CommonPath);
/* Convert all backslashes to normal slashes */
@@ -824,6 +825,7 @@ FlParseInputPathname (
*(Substring+1) = 0;
}
+ UtConvertBackslashes (Gbl_OutputFilenamePrefix);
return (AE_OK);
}
#endif
diff --git a/sys/contrib/dev/acpica/compiler/aslfold.c b/sys/contrib/dev/acpica/compiler/aslfold.c
index 00595af..8804233 100644
--- a/sys/contrib/dev/acpica/compiler/aslfold.c
+++ b/sys/contrib/dev/acpica/compiler/aslfold.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/compiler/aslglobal.h b/sys/contrib/dev/acpica/compiler/aslglobal.h
index 3f2c401..8106824 100644
--- a/sys/contrib/dev/acpica/compiler/aslglobal.h
+++ b/sys/contrib/dev/acpica/compiler/aslglobal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLGLOBAL_H
#define __ASLGLOBAL_H
@@ -63,11 +62,6 @@
#ifdef _DECLARE_GLOBALS
UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
-char AslHexLookup[] =
-{
- '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
-};
-
/* Table below must match ASL_FILE_TYPES in asltypes.h */
@@ -87,12 +81,12 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] =
{NULL, NULL, "C Source: ", "C Code Output"},
{NULL, NULL, "ASM Include: ", "Assembly Header Output"},
{NULL, NULL, "C Include: ", "C Header Output"},
- {NULL, NULL, "Offset Table: ", "C Offset Table Output"}
+ {NULL, NULL, "Offset Table: ", "C Offset Table Output"},
+ {NULL, NULL, "Device Map: ", "Device Map Output"}
};
#else
extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
-extern char AslHexLookup[];
extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
#endif
@@ -102,12 +96,20 @@ extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
*/
extern int yydebug;
extern FILE *AslCompilerin;
-extern int AslCompilerdebug;
extern int DtParserdebug;
extern int PrParserdebug;
extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
extern char *AslCompilertext;
+/*
+ * Older versions of Bison won't emit this external in the generated header.
+ * Newer versions do emit the external, so we don't need to do it.
+ */
+#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
+extern int AslCompilerdebug;
+#endif
+
+
#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */
#define ASL_MSG_BUFFER_SIZE 4096
#define ASL_MAX_DISABLED_MESSAGES 32
@@ -140,6 +142,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE);
@@ -159,16 +162,17 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_WarningsAsErrors, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE);
-ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayWarnings, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE);
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE);
#define HEX_OUTPUT_NONE 0
@@ -206,6 +210,25 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocated, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalFolds, 0);
+/* Local caches */
+
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ParseOpCount, 0);
+ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_ParseOpCacheList, NULL);
+ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheNext, NULL);
+ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheLast, NULL);
+
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringCount, 0);
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringSize, 0);
+ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_StringCacheList, NULL);
+ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
+ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
+
+/* Map file */
+
+ASL_EXTERN ACPI_GPIO_INFO ASL_INIT_GLOBAL (*Gbl_GpioList, NULL);
+ASL_EXTERN ACPI_SERIAL_INFO ASL_INIT_GLOBAL (*Gbl_SerialList, NULL);
+
+
/* Misc */
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0);
@@ -214,10 +237,6 @@ ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*RootNode, NULL);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_TableLength, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_SourceLine, 0);
ASL_EXTERN ASL_LISTING_NODE ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL);
-ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheNext, NULL);
-ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL);
-ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
-ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
@@ -232,7 +251,6 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0)
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG");
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID");
-ASL_EXTERN FILE *AcpiGbl_DebugFile; /* Placeholder for oswinxf only */
/* Static structures */
diff --git a/sys/contrib/dev/acpica/compiler/aslhex.c b/sys/contrib/dev/acpica/compiler/aslhex.c
index 8d69b92..7eb678a 100644
--- a/sys/contrib/dev/acpica/compiler/aslhex.c
+++ b/sys/contrib/dev/acpica/compiler/aslhex.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
diff --git a/sys/contrib/dev/acpica/compiler/asllength.c b/sys/contrib/dev/acpica/compiler/asllength.c
index 53e860c..5b3f8a2 100644
--- a/sys/contrib/dev/acpica/compiler/asllength.c
+++ b/sys/contrib/dev/acpica/compiler/asllength.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/compiler/asllisting.c b/sys/contrib/dev/acpica/compiler/asllisting.c
index 2b02541..865d646 100644
--- a/sys/contrib/dev/acpica/compiler/asllisting.c
+++ b/sys/contrib/dev/acpica/compiler/asllisting.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asllistsup.c b/sys/contrib/dev/acpica/compiler/asllistsup.c
index 795672e..7d121a3 100644
--- a/sys/contrib/dev/acpica/compiler/asllistsup.c
+++ b/sys/contrib/dev/acpica/compiler/asllistsup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslload.c b/sys/contrib/dev/acpica/compiler/aslload.c
index bc4d593..9d5117a 100644
--- a/sys/contrib/dev/acpica/compiler/aslload.c
+++ b/sys/contrib/dev/acpica/compiler/aslload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -129,6 +129,7 @@ LdLoadNamespace (
/* Dump the namespace if debug is enabled */
AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX);
+ ACPI_FREE (WalkState);
return (AE_OK);
}
@@ -359,7 +360,6 @@ LdNamespace1Begin (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n",
Op, Op->Asl.ParseOpName));
-
/*
* We are only interested in opcodes that have an associated name
* (or multiple names)
@@ -373,6 +373,34 @@ LdNamespace1Begin (
Status = LdLoadFieldElements (Op, WalkState);
return (Status);
+ case AML_INT_CONNECTION_OP:
+
+
+ if (Op->Asl.Child->Asl.AmlOpcode != AML_INT_NAMEPATH_OP)
+ {
+ break;
+ }
+ Arg = Op->Asl.Child;
+
+ Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Asl.ExternalName,
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
+ WalkState, &Node);
+ if (ACPI_FAILURE (Status))
+ {
+ break;
+ }
+
+ if (Node->Type == ACPI_TYPE_BUFFER)
+ {
+ Arg->Asl.Node = Node;
+
+ Arg = Node->Op->Asl.Child; /* Get namepath */
+ Arg = Arg->Asl.Next; /* Get actual buffer */
+ Arg = Arg->Asl.Child; /* Buffer length */
+ Arg = Arg->Asl.Next; /* RAW_DATA buffer */
+ }
+ break;
+
default:
/* All other opcodes go below */
@@ -466,7 +494,6 @@ LdNamespace1Begin (
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
break;
-
case PARSEOP_SCOPE:
/*
* The name referenced by Scope(Name) must already exist at this point.
diff --git a/sys/contrib/dev/acpica/compiler/asllookup.c b/sys/contrib/dev/acpica/compiler/asllookup.c
index 66c0950..6f3f0c2 100644
--- a/sys/contrib/dev/acpica/compiler/asllookup.c
+++ b/sys/contrib/dev/acpica/compiler/asllookup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@@ -105,7 +104,9 @@ LkFindUnreferencedObjects (
* DESCRIPTION: Check for an unreferenced namespace object and emit a warning.
* We have to be careful, because some types and names are
* typically or always unreferenced, we don't want to issue
- * excessive warnings.
+ * excessive warnings. Note: Names that are declared within a
+ * control method are temporary, so we always issue a remark
+ * if they are not referenced.
*
******************************************************************************/
@@ -117,6 +118,7 @@ LkIsObjectUsed (
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
+ ACPI_NAMESPACE_NODE *Next;
/* Referenced flag is set during the namespace xref */
@@ -126,23 +128,19 @@ LkIsObjectUsed (
return (AE_OK);
}
- /*
- * Ignore names that start with an underscore,
- * these are the reserved ACPI names and are typically not referenced,
- * they are called by the host OS.
- */
- if (Node->Name.Ascii[0] == '_')
+ if (!Node->Op)
{
return (AE_OK);
}
- /* There are some types that are typically not referenced, ignore them */
+ /* These types are typically never directly referenced, ignore them */
switch (Node->Type)
{
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_POWER:
+ case ACPI_TYPE_THERMAL:
case ACPI_TYPE_LOCAL_RESOURCE:
return (AE_OK);
@@ -152,12 +150,47 @@ LkIsObjectUsed (
break;
}
- /* All others are valid unreferenced namespace objects */
+ /* Determine if the name is within a control method */
+
+ Next = Node->Parent;
+ while (Next)
+ {
+ if (Next->Type == ACPI_TYPE_METHOD)
+ {
+ /*
+ * Name is within a method, therefore it is temporary.
+ * Issue a remark even if it is a reserved name (starts
+ * with an underscore).
+ */
+ sprintf (MsgBuffer, "Name is within method [%4.4s]",
+ Next->Name.Ascii);
+ AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED,
+ LkGetNameOp (Node->Op), MsgBuffer);
+ return (AE_OK);
+ }
+
+ Next = Next->Parent;
+ }
+
+ /* The name is not within a control method */
- if (Node->Op)
+ /*
+ * Ignore names that start with an underscore. These are the reserved
+ * ACPI names and are typically not referenced since they are meant
+ * to be called by the host OS.
+ */
+ if (Node->Name.Ascii[0] == '_')
{
- AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), NULL);
+ return (AE_OK);
}
+
+ /*
+ * What remains is an unresolved user name that is not within a method.
+ * However, the object could be referenced via another table, so issue
+ * the warning at level 2.
+ */
+ AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED,
+ LkGetNameOp (Node->Op), NULL);
return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslmain.c b/sys/contrib/dev/acpica/compiler/aslmain.c
index 67e561a..8c3d2d2 100644
--- a/sys/contrib/dev/acpica/compiler/aslmain.c
+++ b/sys/contrib/dev/acpica/compiler/aslmain.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,17 @@
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslmain")
+/*
+ * Main routine for the iASL compiler.
+ *
+ * Portability note: The compiler depends upon the host for command-line
+ * wildcard support - it is not implemented locally. For example:
+ *
+ * Linux/Unix systems: Shell expands wildcards automatically.
+ *
+ * Windows: The setargv.obj module must be linked in to automatically
+ * expand wildcards.
+ */
/* Local prototypes */
@@ -62,6 +73,36 @@ static void
AslInitialize (
void);
+UINT8
+AcpiIsBigEndianMachine (
+ void);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiIsBigEndianMachine
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: TRUE if machine is big endian
+ * FALSE if machine is little endian
+ *
+ * DESCRIPTION: Detect whether machine is little endian or big endian.
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiIsBigEndianMachine (
+ void)
+{
+ union {
+ UINT32 Integer;
+ UINT8 Bytes[4];
+ } Overlay = {0xFF000000};
+
+ return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
+}
+
/*******************************************************************************
*
@@ -83,11 +124,21 @@ Usage (
printf ("%s\n\n", ASL_COMPLIANCE);
ACPI_USAGE_HEADER ("iasl [Options] [Files]");
- printf ("\nGlobal:\n");
+ printf ("\nGeneral:\n");
ACPI_OPTION ("-@ <file>", "Specify command file");
ACPI_OPTION ("-I <dir>", "Specify additional include directory");
ACPI_OPTION ("-T <sig>|ALL|*", "Create table template file for ACPI <Sig>");
+ ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
ACPI_OPTION ("-v", "Display compiler version");
+ ACPI_OPTION ("-vo", "Enable optimization comments");
+ ACPI_OPTION ("-vs", "Disable signon");
+
+ printf ("\nHelp:\n");
+ ACPI_OPTION ("-h", "This message");
+ ACPI_OPTION ("-hc", "Display operators allowed in constant expressions");
+ ACPI_OPTION ("-hf", "Display help for output filename generation");
+ ACPI_OPTION ("-hr", "Display ACPI reserved method names");
+ ACPI_OPTION ("-ht", "Display currently supported ACPI table names");
printf ("\nPreprocessor:\n");
ACPI_OPTION ("-D <symbol>", "Define symbol for preprocessor use");
@@ -95,13 +146,11 @@ Usage (
ACPI_OPTION ("-P", "Preprocess only and create preprocessor output file (*.i)");
ACPI_OPTION ("-Pn", "Disable preprocessor");
- printf ("\nGeneral Processing:\n");
- ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
- ACPI_OPTION ("-va", "Disable all errors and warnings (summary only)");
+ printf ("\nErrors, Warnings, and Remarks:\n");
+ ACPI_OPTION ("-va", "Disable all errors/warnings/remarks");
+ ACPI_OPTION ("-ve", "Report only errors (ignore warnings and remarks)");
ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs");
- ACPI_OPTION ("-vo", "Enable optimization comments");
ACPI_OPTION ("-vr", "Disable remarks");
- ACPI_OPTION ("-vs", "Disable signon");
ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark");
ACPI_OPTION ("-w1 -w2 -w3", "Set warning reporting level");
ACPI_OPTION ("-we", "Report warnings as errors");
@@ -123,6 +172,7 @@ Usage (
printf ("\nOptional Listing Files:\n");
ACPI_OPTION ("-l", "Create mixed listing file (ASL source and AML) (*.lst)");
+ ACPI_OPTION ("-lm", "Create hardware summary map file (*.map)");
ACPI_OPTION ("-ln", "Create namespace file (*.nsp)");
ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)");
@@ -131,25 +181,17 @@ Usage (
ACPI_OPTION ("-vt", "Create verbose template files (full disassembly)");
printf ("\nAML Disassembler:\n");
- ACPI_OPTION ("-d <f1,f2>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
+ ACPI_OPTION ("-d <f1 f2 ...>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
ACPI_OPTION ("", " (Optional, file type is automatically detected)");
- ACPI_OPTION ("-da <f1,f2>", "Disassemble multiple tables from single namespace");
+ ACPI_OPTION ("-da <f1 f2 ...>", "Disassemble multiple tables from single namespace");
ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
- ACPI_OPTION ("-dc <f1,f2>", "Disassemble AML and immediately compile it");
+ ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
- ACPI_OPTION ("-e <f1,f2>", "Include ACPI table(s) for external symbol resolution");
+ ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");
- ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)");
ACPI_OPTION ("-in", "Ignore NoOp opcodes");
ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file");
- printf ("\nHelp:\n");
- ACPI_OPTION ("-h", "This message");
- ACPI_OPTION ("-hc", "Display operators allowed in constant expressions");
- ACPI_OPTION ("-hf", "Display help for output filename generation");
- ACPI_OPTION ("-hr", "Display ACPI reserved method names");
- ACPI_OPTION ("-ht", "Display currently supported ACPI table names");
-
printf ("\nDebug Options:\n");
ACPI_OPTION ("-bf -bt", "Create debug file (full or parse tree only) (*.txt)");
ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)");
@@ -286,8 +328,22 @@ main (
ACPI_STATUS Status;
int Index1;
int Index2;
+ int ReturnStatus = 0;
+
+ /*
+ * Big-endian machines are not currently supported. ACPI tables must
+ * be little-endian, and support for big-endian machines needs to
+ * be implemented.
+ */
+ if (AcpiIsBigEndianMachine ())
+ {
+ fprintf (stderr,
+ "iASL is not currently supported on big-endian machines.\n");
+ return (-1);
+ }
+ AcpiOsInitialize ();
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
/* Initialize preprocessor and compiler before command line processing */
@@ -307,21 +363,11 @@ main (
/* Perform global actions first/only */
- if (Gbl_GetAllTables)
- {
- Status = AslDoOneFile (NULL);
- if (ACPI_FAILURE (Status))
- {
- return (-1);
- }
- return (0);
- }
-
if (Gbl_DisassembleAll)
{
while (argv[Index1])
{
- Status = AslDoOnePathname (argv[Index1], AcpiDmAddToExternalFileList);
+ Status = AcpiDmAddToExternalFileList (argv[Index1]);
if (ACPI_FAILURE (Status))
{
return (-1);
@@ -335,19 +381,36 @@ main (
while (argv[Index2])
{
- Status = AslDoOnePathname (argv[Index2], AslDoOneFile);
+ /*
+ * If -p not specified, we will use the input filename as the
+ * output filename prefix
+ */
+ if (Gbl_UseDefaultAmlFilename)
+ {
+ Gbl_OutputFilenamePrefix = argv[Index2];
+ UtConvertBackslashes (Gbl_OutputFilenamePrefix);
+ }
+
+ Status = AslDoOneFile (argv[Index2]);
if (ACPI_FAILURE (Status))
{
- return (-1);
+ ReturnStatus = -1;
+ goto CleanupAndExit;
}
Index2++;
}
+
+CleanupAndExit:
+
+ UtFreeLineBuffers ();
+ AslParserCleanup ();
+
if (AcpiGbl_ExternalFileList)
{
AcpiDmClearExternalFileList();
}
- return (0);
+ return (ReturnStatus);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslmap.c b/sys/contrib/dev/acpica/compiler/aslmap.c
index 0d2e636..a4b4e67 100644
--- a/sys/contrib/dev/acpica/compiler/aslmap.c
+++ b/sys/contrib/dev/acpica/compiler/aslmap.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmapenter.c b/sys/contrib/dev/acpica/compiler/aslmapenter.c
new file mode 100644
index 0000000..5dced39
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslmapenter.c
@@ -0,0 +1,346 @@
+/******************************************************************************
+ *
+ * Module Name: aslmapenter - Build resource descriptor/device maps
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acapps.h>
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+
+/* This module used for application-level code only */
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmapenter")
+
+/* Local prototypes */
+
+static ACPI_GPIO_INFO *
+MpCreateGpioInfo (
+ UINT16 PinNumber,
+ char *DeviceName);
+
+static ACPI_SERIAL_INFO *
+MpCreateSerialInfo (
+ char *DeviceName,
+ UINT16 Address);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpSaveGpioInfo
+ *
+ * PARAMETERS: Resource - GPIO resource descriptor
+ * PinCount - From GPIO descriptor
+ * PinList - From GPIO descriptor
+ * DeviceName - The "ResourceSource" name
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: External Interface.
+ * Save GPIO resource descriptor information.
+ * Creates new GPIO info blocks, one for each pin defined by the
+ * GPIO descriptor.
+ *
+ ******************************************************************************/
+
+void
+MpSaveGpioInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ UINT32 PinCount,
+ UINT16 *PinList,
+ char *DeviceName)
+{
+ ACPI_GPIO_INFO *Info;
+ UINT32 i;
+
+
+ /* Mapfile option enabled? */
+
+ if (!Gbl_MapfileFlag)
+ {
+ return;
+ }
+
+ /* Create an info block for each pin defined in the descriptor */
+
+ for (i = 0; i < PinCount; i++)
+ {
+ Info = MpCreateGpioInfo (PinList[i], DeviceName);
+
+ Info->Op = Op;
+ Info->DeviceName = DeviceName;
+ Info->PinCount = PinCount;
+ Info->PinIndex = i;
+ Info->PinNumber = PinList[i];
+ Info->Type = Resource->Gpio.ConnectionType;
+ Info->Direction = (UINT8) (Resource->Gpio.IntFlags & 0x0003); /* _IOR, for IO descriptor */
+ Info->Polarity = (UINT8) ((Resource->Gpio.IntFlags >> 1) & 0x0003); /* _POL, for INT descriptor */
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpSaveSerialInfo
+ *
+ * PARAMETERS: Resource - A Serial resource descriptor
+ * DeviceName - The "ResourceSource" name.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: External Interface.
+ * Save serial resource descriptor information.
+ * Creates a new serial info block.
+ *
+ ******************************************************************************/
+
+void
+MpSaveSerialInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ char *DeviceName)
+{
+ ACPI_SERIAL_INFO *Info;
+ UINT16 Address;
+ UINT32 Speed;
+
+
+ /* Mapfile option enabled? */
+
+ if (!Gbl_MapfileFlag)
+ {
+ return;
+ }
+
+ if (Resource->DescriptorType != ACPI_RESOURCE_NAME_SERIAL_BUS)
+ {
+ return;
+ }
+
+ /* Extract address and speed from the resource descriptor */
+
+ switch (Resource->CommonSerialBus.Type)
+ {
+ case AML_RESOURCE_I2C_SERIALBUSTYPE:
+
+ Address = Resource->I2cSerialBus.SlaveAddress;
+ Speed = Resource->I2cSerialBus.ConnectionSpeed;
+ break;
+
+ case AML_RESOURCE_SPI_SERIALBUSTYPE:
+
+ Address = Resource->SpiSerialBus.DeviceSelection;
+ Speed = Resource->SpiSerialBus.ConnectionSpeed;
+ break;
+
+ case AML_RESOURCE_UART_SERIALBUSTYPE:
+
+ Address = 0;
+ Speed = Resource->UartSerialBus.DefaultBaudRate;
+ break;
+
+ default: /* Invalid bus subtype */
+ return;
+ }
+
+ Info = MpCreateSerialInfo (DeviceName, Address);
+
+ Info->Op = Op;
+ Info->DeviceName = DeviceName;
+ Info->Resource = Resource;
+ Info->Address = Address;
+ Info->Speed = Speed;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpCreateGpioInfo
+ *
+ * PARAMETERS: PinNumber - GPIO pin number
+ * DeviceName - The "ResourceSource" name
+ *
+ * RETURN: New GPIO info block.
+ *
+ * DESCRIPTION: Create a new GPIO info block and place it on the global list.
+ * The list is sorted by GPIO device names first, and pin numbers
+ * secondarily.
+ *
+ ******************************************************************************/
+
+static ACPI_GPIO_INFO *
+MpCreateGpioInfo (
+ UINT16 PinNumber,
+ char *DeviceName)
+{
+ ACPI_GPIO_INFO *Info;
+ ACPI_GPIO_INFO *NextGpio;
+ ACPI_GPIO_INFO *PrevGpio;
+
+
+ /*
+ * Allocate a new info block and insert it into the global GPIO list
+ * sorted by both source device name and then the pin number. There is
+ * one block per pin.
+ */
+ Info = ACPI_CAST_PTR (ACPI_GPIO_INFO,
+ UtStringCacheCalloc (sizeof (ACPI_GPIO_INFO)));
+
+ NextGpio = Gbl_GpioList;
+ PrevGpio = NULL;
+ if (!Gbl_GpioList)
+ {
+ Gbl_GpioList = Info;
+ Info->Next = NULL;
+ return (Info);
+ }
+
+ /* Sort on source DeviceName first */
+
+ while (NextGpio &&
+ (ACPI_STRCMP (DeviceName, NextGpio->DeviceName) > 0))
+ {
+ PrevGpio = NextGpio;
+ NextGpio = NextGpio->Next;
+ }
+
+ /* Now sort on the PinNumber */
+
+ while (NextGpio &&
+ (NextGpio->PinNumber < PinNumber) &&
+ !ACPI_STRCMP (DeviceName, NextGpio->DeviceName))
+ {
+ PrevGpio = NextGpio;
+ NextGpio = NextGpio->Next;
+ }
+
+ /* Finish the list insertion */
+
+ if (PrevGpio)
+ {
+ PrevGpio->Next = Info;
+ }
+ else
+ {
+ Gbl_GpioList = Info;
+ }
+
+ Info->Next = NextGpio;
+ return (Info);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpCreateSerialInfo
+ *
+ * PARAMETERS: DeviceName - The "ResourceSource" name.
+ * Address - Physical address for the device
+ *
+ * RETURN: New Serial info block.
+ *
+ * DESCRIPTION: Create a new Serial info block and place it on the global list.
+ * The list is sorted by Serial device names first, and addresses
+ * secondarily.
+ *
+ ******************************************************************************/
+
+static ACPI_SERIAL_INFO *
+MpCreateSerialInfo (
+ char *DeviceName,
+ UINT16 Address)
+{
+ ACPI_SERIAL_INFO *Info;
+ ACPI_SERIAL_INFO *NextSerial;
+ ACPI_SERIAL_INFO *PrevSerial;
+
+
+ /*
+ * Allocate a new info block and insert it into the global Serial list
+ * sorted by both source device name and then the address.
+ */
+ Info = ACPI_CAST_PTR (ACPI_SERIAL_INFO,
+ UtStringCacheCalloc (sizeof (ACPI_SERIAL_INFO)));
+
+ NextSerial = Gbl_SerialList;
+ PrevSerial = NULL;
+ if (!Gbl_SerialList)
+ {
+ Gbl_SerialList = Info;
+ Info->Next = NULL;
+ return (Info);
+ }
+
+ /* Sort on source DeviceName */
+
+ while (NextSerial &&
+ (ACPI_STRCMP (DeviceName, NextSerial->DeviceName) > 0))
+ {
+ PrevSerial = NextSerial;
+ NextSerial = NextSerial->Next;
+ }
+
+ /* Now sort on the Address */
+
+ while (NextSerial &&
+ (NextSerial->Address < Address) &&
+ !ACPI_STRCMP (DeviceName, NextSerial->DeviceName))
+ {
+ PrevSerial = NextSerial;
+ NextSerial = NextSerial->Next;
+ }
+
+ /* Finish the list insertion */
+
+ if (PrevSerial)
+ {
+ PrevSerial->Next = Info;
+ }
+ else
+ {
+ Gbl_SerialList = Info;
+ }
+
+ Info->Next = NextSerial;
+ return (Info);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslmapoutput.c b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
new file mode 100644
index 0000000..26d4fed
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
@@ -0,0 +1,661 @@
+/******************************************************************************
+ *
+ * Module Name: aslmapoutput - Output/emit the resource descriptor/device maps
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acapps.h>
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include "aslcompiler.y.h"
+#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/acparser.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+
+/* This module used for application-level code only */
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmapoutput")
+
+/* Local prototypes */
+
+static void
+MpEmitGpioInfo (
+ void);
+
+static void
+MpEmitSerialInfo (
+ void);
+
+static void
+MpEmitDeviceTree (
+ void);
+
+static ACPI_STATUS
+MpEmitOneDevice (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue);
+
+static void
+MpXrefDevices (
+ ACPI_GPIO_INFO *Info);
+
+static ACPI_STATUS
+MpNamespaceXrefBegin (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context);
+
+
+/* Strings used to decode flag bits */
+
+const char *DirectionDecode[] =
+{
+ "Both I/O ",
+ "InputOnly ",
+ "OutputOnly ",
+ "Preserve "
+};
+
+const char *PolarityDecode[] =
+{
+ "ActiveHigh",
+ "ActiveLow ",
+ "ActiveBoth",
+ "Reserved "
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitMappingInfo
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: External interface.
+ * Create and open the mapfile and emit all of the collected
+ * hardware mapping information. Includes: GPIO information,
+ * Serial information, and a dump of the entire ACPI device tree.
+ *
+ ******************************************************************************/
+
+void
+MpEmitMappingInfo (
+ void)
+{
+ char *NewFilename;
+
+
+ /* Mapfile option enabled? */
+
+ if (!Gbl_MapfileFlag)
+ {
+ return;
+ }
+
+ /* Create/Open a map file */
+
+ NewFilename = FlGenerateFilename (Gbl_OutputFilenamePrefix,
+ FILE_SUFFIX_MAP);
+ if (!NewFilename)
+ {
+ AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
+ 0, 0, 0, 0, NULL, NULL);
+ }
+
+ /* Open the hex file, text mode (closed at compiler exit) */
+
+ FlOpenFile (ASL_FILE_MAP_OUTPUT, NewFilename, "w+t");
+ AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
+ AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
+
+ if (!Gbl_GpioList)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "\nNo GPIO devices found\n");
+ }
+
+ if (!Gbl_SerialList)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "\nNo Serial devices found (I2C/SPI/UART)\n");
+ }
+
+ if (!Gbl_GpioList && !Gbl_SerialList)
+ {
+ return;
+ }
+
+ /* Headers */
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\nResource Descriptor Connectivity Map\n");
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "------------------------------------\n");
+
+ /* Emit GPIO and Serial descriptors, then entire ACPI device tree */
+
+ MpEmitGpioInfo ();
+ MpEmitSerialInfo ();
+ MpEmitDeviceTree ();
+
+ /* Clear the lists - no need to free memory here */
+
+ Gbl_SerialList = NULL;
+ Gbl_GpioList = NULL;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitGpioInfo
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit the info about all GPIO devices found during the
+ * compile or disassembly.
+ *
+ ******************************************************************************/
+
+static void
+MpEmitGpioInfo (
+ void)
+{
+ ACPI_GPIO_INFO *Info;
+ char *Type;
+ char *PrevDeviceName = NULL;
+ const char *Direction;
+ const char *Polarity;
+ char *ParentPathname;
+ const char *Description;
+ char *HidString;
+ const AH_DEVICE_ID *HidInfo;
+
+
+ /* Walk the GPIO descriptor list */
+
+ Info = Gbl_GpioList;
+ while (Info)
+ {
+ HidString = MpGetHidViaNamestring (Info->DeviceName);
+
+ /* Print header info for the controller itself */
+
+ if (!PrevDeviceName ||
+ ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "\n\nGPIO Controller: %-8s %-28s",
+ HidString, Info->DeviceName);
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "\n\nPin Type Direction Polarity"
+ " Dest _HID Destination\n");
+ }
+
+ PrevDeviceName = Info->DeviceName;
+
+ /* Setup various strings based upon the type (GpioInt or GpioIo) */
+
+ switch (Info->Type)
+ {
+ case AML_RESOURCE_GPIO_TYPE_INT:
+
+ Type = "GpioInt";
+ Direction = "-Interrupt-";
+ Polarity = PolarityDecode[Info->Polarity];
+ break;
+
+ case AML_RESOURCE_GPIO_TYPE_IO:
+
+ Type = "GpioIo ";
+ Direction = DirectionDecode[Info->Direction];
+ Polarity = " ";
+ break;
+
+ default:
+ continue;
+ }
+
+ /* Emit the GPIO info */
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%4.4X %s %s %s ",
+ Info->PinNumber, Type, Direction, Polarity);
+
+ ParentPathname = NULL;
+ HidString = MpGetConnectionInfo (Info->Op, Info->PinIndex,
+ &Info->TargetNode, &ParentPathname);
+ if (HidString)
+ {
+ /*
+ * This is a Connection() field
+ * Attempt to find all references to the field.
+ */
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
+ HidString, ParentPathname);
+
+ MpXrefDevices (Info);
+ }
+ else
+ {
+ /*
+ * For Devices, attempt to get the _HID description string.
+ * Failing that (many _HIDs are not recognized), attempt to
+ * get the _DDN description string.
+ */
+ HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
+ &ParentPathname);
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
+ HidString, ParentPathname);
+
+ /* Get the _HID description or _DDN string */
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+ else if ((Description = MpGetDdnValue (ParentPathname)))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)",
+ Description);
+ }
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
+ ACPI_FREE (ParentPathname);
+ Info = Info->Next;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitSerialInfo
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit the info about all Serial devices found during the
+ * compile or disassembly.
+ *
+ ******************************************************************************/
+
+static void
+MpEmitSerialInfo (
+ void)
+{
+ ACPI_SERIAL_INFO *Info;
+ char *Type;
+ char *ParentPathname;
+ char *PrevDeviceName = NULL;
+ char *HidString;
+ const AH_DEVICE_ID *HidInfo;
+ const char *Description;
+ AML_RESOURCE *Resource;
+
+
+ /* Walk the constructed serial descriptor list */
+
+ Info = Gbl_SerialList;
+ while (Info)
+ {
+ Resource = Info->Resource;
+ switch (Resource->CommonSerialBus.Type)
+ {
+ case AML_RESOURCE_I2C_SERIALBUSTYPE:
+ Type = "I2C ";
+ break;
+
+ case AML_RESOURCE_SPI_SERIALBUSTYPE:
+ Type = "SPI ";
+ break;
+
+ case AML_RESOURCE_UART_SERIALBUSTYPE:
+ Type = "UART";
+ break;
+
+ default:
+ Type = "UNKN";
+ break;
+ }
+
+ HidString = MpGetHidViaNamestring (Info->DeviceName);
+
+ /* Print header info for the controller itself */
+
+ if (!PrevDeviceName ||
+ ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller: ",
+ Type);
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-8s %-28s",
+ HidString, Info->DeviceName);
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n");
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "Type Address Speed Dest _HID Destination\n");
+ }
+
+ PrevDeviceName = Info->DeviceName;
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%s %4.4X %8.8X ",
+ Type, Info->Address, Info->Speed);
+
+ ParentPathname = NULL;
+ HidString = MpGetConnectionInfo (Info->Op, 0, &Info->TargetNode,
+ &ParentPathname);
+ if (HidString)
+ {
+ /*
+ * This is a Connection() field
+ * Attempt to find all references to the field.
+ */
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
+ HidString, ParentPathname);
+ }
+ else
+ {
+ /* Normal resource template */
+
+ HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
+ &ParentPathname);
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
+ HidString, ParentPathname);
+
+ /* Get the _HID description or _DDN string */
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+ else if ((Description = MpGetDdnValue (ParentPathname)))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)",
+ Description);
+ }
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
+ ACPI_FREE (ParentPathname);
+ Info = Info->Next;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitDeviceTree
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit information about all devices within the ACPI namespace.
+ *
+ ******************************************************************************/
+
+static void
+MpEmitDeviceTree (
+ void)
+{
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\nACPI Device Tree\n");
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "----------------\n\n");
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "Device Pathname "
+ "_HID Description\n\n");
+
+ /* Walk the namespace from the root */
+
+ (void) AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitOneDevice
+ *
+ * PARAMETERS: ACPI_NAMESPACE_WALK callback
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Emit information about one ACPI device in the namespace. Used
+ * during dump of all device objects within the namespace.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+MpEmitOneDevice (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue)
+{
+ char *DevicePathname;
+ char *DdnString;
+ char *HidString;
+ const AH_DEVICE_ID *HidInfo;
+
+
+ /* Device pathname */
+
+ DevicePathname = AcpiNsGetExternalPathname (
+ ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle));
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-32s", DevicePathname);
+
+ /* _HID or _DDN */
+
+ HidString = MpGetHidValue (
+ ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle));
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s", HidString);
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+ else if ((DdnString = MpGetDdnValue (DevicePathname)))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)", DdnString);
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
+ ACPI_FREE (DevicePathname);
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpXrefDevices
+ *
+ * PARAMETERS: Info - A GPIO Info block
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Cross-reference the parse tree and find all references to the
+ * specified GPIO device.
+ *
+ ******************************************************************************/
+
+static void
+MpXrefDevices (
+ ACPI_GPIO_INFO *Info)
+{
+
+ /* Walk the entire parse tree */
+
+ TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+ MpNamespaceXrefBegin, NULL, Info);
+
+ if (!Info->References)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // **** No references in table");
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpNamespaceXrefBegin
+ *
+ * PARAMETERS: WALK_PARSE_TREE callback
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Walk parse tree callback used to cross-reference GPIO pins.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+MpNamespaceXrefBegin (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context)
+{
+ ACPI_GPIO_INFO *Info = ACPI_CAST_PTR (ACPI_GPIO_INFO, Context);
+ const ACPI_OPCODE_INFO *OpInfo;
+ char *DevicePathname;
+ ACPI_PARSE_OBJECT *ParentOp;
+ char *HidString;
+
+
+ ACPI_FUNCTION_TRACE_PTR (MpNamespaceXrefBegin, Op);
+
+ /*
+ * If this node is the actual declaration of a name
+ * [such as the XXXX name in "Method (XXXX)"],
+ * we are not interested in it here. We only care about names that
+ * are references to other objects within the namespace and the
+ * parent objects of name declarations
+ */
+ if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
+ {
+ return (AE_OK);
+ }
+
+ /* We are only interested in opcodes that have an associated name */
+
+ OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
+
+ if ((OpInfo->Flags & AML_NAMED) ||
+ (OpInfo->Flags & AML_CREATE))
+ {
+ return (AE_OK);
+ }
+
+ if ((Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
+ (Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
+ (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
+ {
+ return (AE_OK);
+ }
+
+ if (!Op->Asl.Node)
+ {
+ return (AE_OK);
+ }
+
+ ParentOp = Op->Asl.Parent;
+ if (ParentOp->Asl.ParseOpcode == PARSEOP_FIELD)
+ {
+ return (AE_OK);
+ }
+
+ if (Op->Asl.Node == Info->TargetNode)
+ {
+ DevicePathname = AcpiNsGetExternalPathname (
+ Info->TargetNode);
+
+ while (ParentOp && (!ParentOp->Asl.Node))
+ {
+ ParentOp = ParentOp->Asl.Parent;
+ }
+
+ if (ParentOp)
+ {
+ DevicePathname = AcpiNsGetExternalPathname (
+ ParentOp->Asl.Node);
+
+ if (!Info->References)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // References:");
+ }
+
+ HidString = MpGetHidViaNamestring (DevicePathname);
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " %s [%s]",
+ DevicePathname, HidString);
+
+ Info->References++;
+ }
+ }
+
+ return (AE_OK);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslmaputils.c b/sys/contrib/dev/acpica/compiler/aslmaputils.c
new file mode 100644
index 0000000..f50c9ea
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslmaputils.c
@@ -0,0 +1,402 @@
+/******************************************************************************
+ *
+ * Module Name: aslmaputils - Utilities for the resource descriptor/device maps
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acapps.h>
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include "aslcompiler.y.h"
+#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+
+/* This module used for application-level code only */
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmaputils")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetHidFromParseTree
+ *
+ * PARAMETERS: HidNode - Node for a _HID object
+ *
+ * RETURN: An _HID string value. Automatically converts _HID integers
+ * to strings. Never NULL.
+ *
+ * DESCRIPTION: Extract a _HID value from the parse tree, not the namespace.
+ * Used when a fully initialized namespace is not available.
+ *
+ ******************************************************************************/
+
+char *
+MpGetHidFromParseTree (
+ ACPI_NAMESPACE_NODE *HidNode)
+{
+ ACPI_PARSE_OBJECT *Op;
+ ACPI_PARSE_OBJECT *Arg;
+ char *HidString;
+
+
+ Op = HidNode->Op;
+
+ switch (Op->Asl.ParseOpcode)
+ {
+ case PARSEOP_NAME:
+
+ Arg = Op->Asl.Child; /* Get the NameSeg/NameString node */
+ Arg = Arg->Asl.Next; /* First peer is the object to be associated with the name */
+
+ switch (Arg->Asl.ParseOpcode)
+ {
+ case PARSEOP_STRING_LITERAL:
+
+ return (Arg->Asl.Value.String);
+
+ case PARSEOP_INTEGER:
+
+ /* Convert EISAID to a string */
+
+ HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
+ AcpiExEisaIdToString (HidString, Arg->Asl.Value.Integer);
+ return (HidString);
+
+ default:
+
+ return ("UNKNOWN");
+ }
+
+ default:
+ return ("-No HID-");
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetHidValue
+ *
+ * PARAMETERS: DeviceNode - Node for parent device
+ *
+ * RETURN: An _HID string value. Automatically converts _HID integers
+ * to strings. Never NULL.
+ *
+ * DESCRIPTION: Extract _HID value from within a device scope. Does not
+ * actually execute a method, just gets the string or integer
+ * value for the _HID.
+ *
+ ******************************************************************************/
+
+char *
+MpGetHidValue (
+ ACPI_NAMESPACE_NODE *DeviceNode)
+{
+ ACPI_NAMESPACE_NODE *HidNode;
+ char *HidString;
+ ACPI_STATUS Status;
+
+
+ Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__HID,
+ ACPI_NS_NO_UPSEARCH, &HidNode);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ /* If only partial namespace, get the _HID from the parse tree */
+
+ if (!HidNode->Object)
+ {
+ return (MpGetHidFromParseTree (HidNode));
+ }
+
+ /* Handle the different _HID flavors */
+
+ switch (HidNode->Type)
+ {
+ case ACPI_TYPE_STRING:
+
+ return (HidNode->Object->String.Pointer);
+
+ case ACPI_TYPE_INTEGER:
+
+ /* Convert EISAID to a string */
+
+ HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
+ AcpiExEisaIdToString (HidString, HidNode->Object->Integer.Value);
+ return (HidString);
+
+ case ACPI_TYPE_METHOD:
+
+ return ("-Method-");
+
+ default:
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "BAD HID TYPE: %u", HidNode->Type);
+ break;
+ }
+
+
+ErrorExit:
+ return ("-No HID-");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetHidViaNamestring
+ *
+ * PARAMETERS: DeviceName - Namepath for parent device
+ *
+ * RETURN: _HID string. Never NULL.
+ *
+ * DESCRIPTION: Get a _HID value via a device pathname (instead of just simply
+ * a device node.)
+ *
+ ******************************************************************************/
+
+char *
+MpGetHidViaNamestring (
+ char *DeviceName)
+{
+ ACPI_NAMESPACE_NODE *DeviceNode;
+ ACPI_STATUS Status;
+
+
+ Status = AcpiNsGetNode (NULL, DeviceName, ACPI_NS_NO_UPSEARCH,
+ &DeviceNode);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ return (MpGetHidValue (DeviceNode));
+
+
+ErrorExit:
+ return ("-No HID-");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetParentDeviceHid
+ *
+ * PARAMETERS: Op - Parse Op to be examined
+ * TargetNode - Where the field node is returned
+ * ParentDeviceName - Where the node path is returned
+ *
+ * RETURN: _HID string. Never NULL.
+ *
+ * DESCRIPTION: Find the parent Device or Scope Op, get the full pathname to
+ * the parent, and get the _HID associated with the parent.
+ *
+ ******************************************************************************/
+
+char *
+MpGetParentDeviceHid (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **ParentDeviceName)
+{
+ ACPI_NAMESPACE_NODE *DeviceNode;
+
+
+ /* Find parent Device() or Scope() Op */
+
+ while (Op &&
+ (Op->Asl.AmlOpcode != AML_DEVICE_OP) &&
+ (Op->Asl.AmlOpcode != AML_SCOPE_OP))
+ {
+ Op = Op->Asl.Parent;
+ }
+
+ if (!Op)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Parent_Device ");
+ goto ErrorExit;
+ }
+
+ /* Get the full pathname to the device and the _HID */
+
+ DeviceNode = Op->Asl.Node;
+ if (!DeviceNode)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Device_Node ");
+ goto ErrorExit;
+ }
+
+ *ParentDeviceName = AcpiNsGetExternalPathname (DeviceNode);
+ return (MpGetHidValue (DeviceNode));
+
+
+ErrorExit:
+ return ("-No HID-");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetDdnValue
+ *
+ * PARAMETERS: DeviceName - Namepath for parent device
+ *
+ * RETURN: _DDN description string. NULL on failure.
+ *
+ * DESCRIPTION: Execute the _DDN method for the device.
+ *
+ ******************************************************************************/
+
+char *
+MpGetDdnValue (
+ char *DeviceName)
+{
+ ACPI_NAMESPACE_NODE *DeviceNode;
+ ACPI_NAMESPACE_NODE *DdnNode;
+ ACPI_STATUS Status;
+
+
+ Status = AcpiNsGetNode (NULL, DeviceName, ACPI_NS_NO_UPSEARCH,
+ &DeviceNode);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__DDN, ACPI_NS_NO_UPSEARCH,
+ &DdnNode);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ if ((DdnNode->Type != ACPI_TYPE_STRING) ||
+ !DdnNode->Object)
+ {
+ goto ErrorExit;
+ }
+
+ return (DdnNode->Object->String.Pointer);
+
+
+ErrorExit:
+ return (NULL);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetConnectionInfo
+ *
+ * PARAMETERS: Op - Parse Op to be examined
+ * PinIndex - Index into GPIO PinList
+ * TargetNode - Where the field node is returned
+ * TargetName - Where the node path is returned
+ *
+ * RETURN: A substitute _HID string, indicating that the name is actually
+ * a field. NULL if the Op does not refer to a Connection.
+ *
+ * DESCRIPTION: Get the Field Unit that corresponds to the PinIndex after
+ * a Connection() invocation.
+ *
+ ******************************************************************************/
+
+char *
+MpGetConnectionInfo (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 PinIndex,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **TargetName)
+{
+ ACPI_PARSE_OBJECT *NextOp;
+ UINT32 i;
+
+
+ /*
+ * Handle Connection() here. Find the next named FieldUnit.
+ * Note: we look at the ParseOpcode for the compiler, look
+ * at the AmlOpcode for the disassembler.
+ */
+ if ((Op->Asl.AmlOpcode == AML_INT_CONNECTION_OP) ||
+ (Op->Asl.ParseOpcode == PARSEOP_CONNECTION))
+ {
+ /* Find the correct field unit definition */
+
+ NextOp = Op;
+ for (i = 0; i <= PinIndex;)
+ {
+ NextOp = NextOp->Asl.Next;
+ while (NextOp &&
+ (NextOp->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
+ (NextOp->Asl.AmlOpcode != AML_INT_NAMEDFIELD_OP))
+ {
+ NextOp = NextOp->Asl.Next;
+ }
+
+ if (!NextOp)
+ {
+ return ("UNKNOWN");
+ }
+
+ /* Add length of this field to the current pin index */
+
+ if (NextOp->Asl.ParseOpcode == PARSEOP_NAMESEG)
+ {
+ i += (UINT32) NextOp->Asl.Child->Asl.Value.Integer;
+ }
+ else /* AML_INT_NAMEDFIELD_OP */
+ {
+ i += (UINT32) NextOp->Asl.Value.Integer;
+ }
+ }
+
+ /* Return the node and pathname for the field unit */
+
+ *TargetNode = NextOp->Asl.Node;
+ *TargetName = AcpiNsGetExternalPathname (*TargetNode);
+ return ("-Field-");
+ }
+
+ return (NULL);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.c b/sys/contrib/dev/acpica/compiler/aslmessages.c
new file mode 100644
index 0000000..da4c736
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.c
@@ -0,0 +1,409 @@
+/******************************************************************************
+ *
+ * Module Name: aslmessages.c - Compiler error/warning message strings
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmessages")
+
+
+/*
+ * Strings for message reporting levels, must match error
+ * type string tables in aslmessages.c
+ */
+const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
+ "Optimize",
+ "Remark ",
+ "Warning ",
+ "Warning ",
+ "Warning ",
+ "Error "
+};
+
+/* All lowercase versions for IDEs */
+
+const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
+ "optimize",
+ "remark ",
+ "warning ",
+ "warning ",
+ "warning ",
+ "error "
+};
+
+
+/*
+ * Actual message strings for each compiler message ID. There are currently
+ * three distinct blocks of error messages (so that they can be expanded
+ * individually):
+ * Main ASL compiler
+ * Data Table compiler
+ * Preprocessor
+ *
+ * NOTE1: These tables must match the enum list of message IDs in the file
+ * aslmessages.h exactly.
+ *
+ * NOTE2: With the introduction of the -vw option to disable specific messages,
+ * new messages should only be added to the end of this list, so that values
+ * for existing messages are not disturbed.
+ */
+
+/* ASL compiler */
+
+const char *AslCompilerMsgs [] =
+{
+/* The zeroth message is reserved */ "",
+/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
+/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
+/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
+/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
+/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
+/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
+/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
+/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
+/* ASL_MSG_CLOSE */ "Could not close file",
+/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
+/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
+/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId",
+/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator",
+/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
+/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
+/* ASL_MSG_CORE_EXCEPTION */ "From ACPICA Subsystem",
+/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
+/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
+/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",
+/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
+/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
+/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
+/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
+/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
+/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
+/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
+/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
+/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
+/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
+/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
+/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
+/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
+/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
+/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits",
+/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits",
+/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
+/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
+/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
+/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
+/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
+/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
+/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
+/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
+/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
+/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
+/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
+/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
+/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
+/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
+/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
+/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
+/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
+/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
+/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
+/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
+/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
+/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
+/* ASL_MSG_INVALID_TYPE */ "Invalid type",
+/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
+/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
+/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
+/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
+/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
+/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
+/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
+/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
+/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
+/* ASL_MSG_LONG_LINE */ "Splitting long input line",
+/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
+/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
+/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
+/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
+/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
+/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
+/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
+/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
+/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
+/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
+/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
+/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
+/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
+/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
+/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
+/* ASL_MSG_NOT_EXIST */ "Object does not exist",
+/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
+/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
+/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
+/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
+/* ASL_MSG_NOT_REFERENCED */ "Object is not referenced",
+/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
+/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
+/* ASL_MSG_OPEN */ "Could not open file",
+/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
+/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
+/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
+/* ASL_MSG_PREPROCESSOR_FILENAME */ "Could not create preprocessor filename",
+/* ASL_MSG_READ */ "Could not read file",
+/* ASL_MSG_RECURSION */ "Recursive method call",
+/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
+/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
+/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
+/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
+/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
+/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
+/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
+/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
+/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
+/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
+/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
+/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
+/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
+/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
+/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
+/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
+/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
+/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
+/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
+/* ASL_MSG_SEEK */ "Could not seek file",
+/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
+/* ASL_MSG_SERIALIZED_REQUIRED */ "Control Method should be made Serialized",
+/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
+/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
+/* ASL_MSG_STRING_LENGTH */ "String literal too long",
+/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
+/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
+/* ASL_MSG_SYNTAX */ "",
+/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
+/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field",
+/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field",
+/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
+/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
+/* ASL_MSG_TRUNCATION */ "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
+/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
+/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
+/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
+/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
+/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
+/* ASL_MSG_WRITE */ "Could not write file",
+/* ASL_MSG_RANGE */ "Constant out of range",
+/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
+/* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency",
+/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference within a method",
+/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods"
+};
+
+/* Table compiler */
+
+const char *AslTableCompilerMsgs [] =
+{
+/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
+/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero",
+/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
+/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
+/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
+/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
+/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
+/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
+/* ASL_MSG_RESERVED_VALUE */ "Reserved field",
+/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
+/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
+/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
+/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
+};
+
+/* Preprocessor */
+
+const char *AslPreprocessorMsgs [] =
+{
+/* ASL_MSG_DIRECTIVE_SYNTAX */ "Invalid directive syntax",
+/* ASL_MSG_ENDIF_MISMATCH */ "Mismatched #endif",
+/* ASL_MSG_ERROR_DIRECTIVE */ "#error",
+/* ASL_MSG_EXISTING_NAME */ "Name is already defined",
+/* ASL_MSG_INVALID_INVOCATION */ "Invalid macro invocation",
+/* ASL_MSG_MACRO_SYNTAX */ "Invalid macro syntax",
+/* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments",
+/* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive",
+/* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma",
+/* ASL_MSG_WARNING_DIRECTIVE */ "#warning"
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeDecodeMessageId
+ *
+ * PARAMETERS: MessageId - ASL message ID (exception code) to be
+ * formatted. Possibly fully encoded.
+ *
+ * RETURN: A string containing the exception message text.
+ *
+ * DESCRIPTION: This function validates and translates an ASL message ID into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+
+const char *
+AeDecodeMessageId (
+ UINT16 MessageId)
+{
+ UINT32 Index;
+ const char **MessageTable;
+
+
+ /* Main ASL Compiler messages */
+
+ if (MessageId <= ASL_MSG_MAIN_COMPILER_END)
+ {
+ MessageTable = AslCompilerMsgs;
+ Index = MessageId;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs))
+ {
+ return ("[Unknown ASL Compiler exception ID]");
+ }
+ }
+
+ /* Data Table Compiler messages */
+
+ else if (MessageId <= ASL_MSG_TABLE_COMPILER_END)
+ {
+ MessageTable = AslTableCompilerMsgs;
+ Index = MessageId - ASL_MSG_TABLE_COMPILER;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs))
+ {
+ return ("[Unknown Table Compiler exception ID]");
+ }
+ }
+
+ /* Preprocessor messages */
+
+ else if (MessageId <= ASL_MSG_PREPROCESSOR_END)
+ {
+ MessageTable = AslPreprocessorMsgs;
+ Index = MessageId - ASL_MSG_PREPROCESSOR;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs))
+ {
+ return ("[Unknown Preprocesor exception ID]");
+ }
+ }
+
+ /* Everything else is unknown */
+
+ else
+ {
+ return ("[Unknown exception/component ID]");
+ }
+
+ return (MessageTable[Index]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeDecodeExceptionLevel
+ *
+ * PARAMETERS: Level - The ASL error level to be decoded
+ *
+ * RETURN: A string containing the error level text
+ *
+ * DESCRIPTION: This function validates and translates an ASL error level into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+
+const char *
+AeDecodeExceptionLevel (
+ UINT8 Level)
+{
+ /* Range check on Level */
+
+ if (Level >= ACPI_ARRAY_LENGTH (AslErrorLevel))
+ {
+ return ("Unknown exception level");
+ }
+
+ /* Differentiate the string type to be used (IDE is all lower case) */
+
+ if (Gbl_VerboseErrors)
+ {
+ return (AslErrorLevel[Level]);
+ }
+
+ return (AslErrorLevelIde[Level]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeBuildFullExceptionCode
+ *
+ * PARAMETERS: Level - ASL error level
+ * MessageId - ASL exception code to be formatted
+ *
+ * RETURN: Fully encoded exception code
+ *
+ * DESCRIPTION: Build the full exception code from the error level and the
+ * actual message ID.
+ *
+ ******************************************************************************/
+
+UINT16
+AeBuildFullExceptionCode (
+ UINT8 Level,
+ UINT16 MessageId)
+{
+
+ /*
+ * Error level is in the thousands slot (error/warning/remark, etc.)
+ * Error codes are 0 - 999
+ */
+ return (((Level + 1) * 1000) + MessageId);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.h b/sys/contrib/dev/acpica/compiler/aslmessages.h
index 9fb7229..ba0c22b 100644
--- a/sys/contrib/dev/acpica/compiler/aslmessages.h
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,11 +41,12 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLMESSAGES_H
#define __ASLMESSAGES_H
+/* These values must match error type string tables in aslmessages.c */
+
typedef enum
{
ASL_OPTIMIZATION = 0,
@@ -58,43 +59,41 @@ typedef enum
} ASL_MESSAGE_TYPES;
-#ifdef ASL_EXCEPTIONS
-/* Strings for message reporting levels, must match values above */
+#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings for types above */
-const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
- "Optimize",
- "Remark ",
- "Warning ",
- "Warning ",
- "Warning ",
- "Error "
-};
+/*
+ * Exception code blocks, 0 - 999
+ * Available for new exception blocks: 600 - 999
+ */
+#define ASL_MSG_MAIN_COMPILER 0 /* 0 - 299 */
+#define ASL_MSG_MAIN_COMPILER_END 299
-/* All lowercase versions for IDEs */
+#define ASL_MSG_TABLE_COMPILER 300 /* 300 - 499 */
+#define ASL_MSG_TABLE_COMPILER_END 499
-const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
- "optimize",
- "remark ",
- "warning ",
- "warning ",
- "warning ",
- "error "
-};
+#define ASL_MSG_PREPROCESSOR 500 /* 500 - 599 */
+#define ASL_MSG_PREPROCESSOR_END 599
-#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */
-#endif
/*
- * Values for all compiler messages.
+ * Values (message IDs) for all compiler messages. There are currently
+ * three distinct blocks of error messages (so that they can be expanded
+ * individually):
+ * Main ASL compiler
+ * Data Table compiler
+ * Preprocessor
+ *
+ * NOTE1: This list must match the tables of message strings in the file
+ * aslmessages.c exactly.
*
- * NOTE: With the introduction of the -vw option to disable specific messages,
- * new messages should only be added to the end of this list, so that values
- * for existing messages are not disturbed.
+ * NOTE2: With the introduction of the -vw option to disable specific
+ * messages, new messages should only be added to the end of these
+ * lists, so that values for existing messages are not disturbed.
*/
typedef enum
{
- ASL_MSG_RESERVED = 0,
+ ASL_MSG_RESERVED = ASL_MSG_MAIN_COMPILER,
ASL_MSG_ALIGNMENT,
ASL_MSG_ALPHANUMERIC_STRING,
@@ -236,23 +235,13 @@ typedef enum
ASL_MSG_WRITE,
ASL_MSG_RANGE,
ASL_MSG_BUFFER_ALLOCATION,
+ ASL_MSG_MISSING_DEPENDENCY,
+ ASL_MSG_ILLEGAL_FORWARD_REF,
+ ASL_MSG_ILLEGAL_METHOD_REF,
- /* These messages are used by the Preprocessor only */
+ /* These messages are used by the Data Table compiler only */
- ASL_MSG_DIRECTIVE_SYNTAX,
- ASL_MSG_ENDIF_MISMATCH,
- ASL_MSG_ERROR_DIRECTIVE,
- ASL_MSG_EXISTING_NAME,
- ASL_MSG_INVALID_INVOCATION,
- ASL_MSG_MACRO_SYNTAX,
- ASL_MSG_TOO_MANY_ARGUMENTS,
- ASL_MSG_UNKNOWN_DIRECTIVE,
- ASL_MSG_UNKNOWN_PRAGMA,
- ASL_MSG_WARNING_DIRECTIVE,
-
- /* These messages are used by the data table compiler only */
-
- ASL_MSG_BUFFER_ELEMENT,
+ ASL_MSG_BUFFER_ELEMENT = ASL_MSG_TABLE_COMPILER,
ASL_MSG_DIVIDE_BY_ZERO,
ASL_MSG_FLAG_VALUE,
ASL_MSG_INTEGER_SIZE,
@@ -264,194 +253,22 @@ typedef enum
ASL_MSG_UNKNOWN_LABEL,
ASL_MSG_UNKNOWN_SUBTABLE,
ASL_MSG_UNKNOWN_TABLE,
- ASL_MSG_ZERO_VALUE
-
-} ASL_MESSAGE_IDS;
+ ASL_MSG_ZERO_VALUE,
+ /* These messages are used by the Preprocessor only */
-#ifdef ASL_EXCEPTIONS
-
-/*
- * Actual message strings for each compiler message.
- *
- * NOTE: With the introduction of the -vw option to disable specific messages,
- * new messages should only be added to the end of this list, so that values
- * for existing messages are not disturbed.
- */
-char *AslMessages [] =
-{
-/* The zeroth message is reserved */ "",
-/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
-/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
-/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
-/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
-/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
-/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
-/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
-/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
-/* ASL_MSG_CLOSE */ "Could not close file",
-/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
-/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
-/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId",
-/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator",
-/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
-/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
-/* ASL_MSG_CORE_EXCEPTION */ "From ACPI CA Subsystem",
-/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
-/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
-/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",\
-/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
-/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
-/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
-/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
-/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
-/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
-/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
-/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
-/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
-/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
-/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
-/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
-/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
-/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
-/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits",
-/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits",
-/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
-/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
-/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
-/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
-/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
-/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
-/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
-/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
-/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
-/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
-/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
-/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
-/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
-/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
-/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
-/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
-/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
-/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
-/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
-/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
-/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
-/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
-/* ASL_MSG_INVALID_TYPE */ "Invalid type",
-/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
-/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
-/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
-/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
-/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
-/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
-/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
-/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
-/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
-/* ASL_MSG_LONG_LINE */ "Splitting long input line",
-/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
-/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
-/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
-/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
-/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
-/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
-/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
-/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
-/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
-/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
-/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
-/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
-/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
-/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
-/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
-/* ASL_MSG_NOT_EXIST */ "Object does not exist",
-/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
-/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
-/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
-/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
-/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced",
-/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
-/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
-/* ASL_MSG_OPEN */ "Could not open file",
-/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
-/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
-/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
-/* ASL_MSG_PREPROCESSOR_FILENAME */ "Could not create preprocessor filename",
-/* ASL_MSG_READ */ "Could not read file",
-/* ASL_MSG_RECURSION */ "Recursive method call",
-/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
-/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
-/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
-/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
-/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
-/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
-/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
-/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
-/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
-/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
-/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
-/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
-/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
-/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
-/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
-/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
-/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
-/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
-/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
-/* ASL_MSG_SEEK */ "Could not seek file",
-/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
-/* ASL_MSG_SERIALIZED_REQUIRED */ "Control Method should be made Serialized",
-/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
-/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
-/* ASL_MSG_STRING_LENGTH */ "String literal too long",
-/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
-/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
-/* ASL_MSG_SYNTAX */ "",
-/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
-/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field",
-/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field",
-/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
-/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
-/* ASL_MSG_TRUNCATION */ "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
-/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
-/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
-/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
-/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
-/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
-/* ASL_MSG_WRITE */ "Could not write file",
-/* ASL_MSG_RANGE */ "Constant out of range",
-/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
-
-/* Preprocessor */
-
-/* ASL_MSG_DIRECTIVE_SYNTAX */ "Invalid directive syntax",
-/* ASL_MSG_ENDIF_MISMATCH */ "Mismatched #endif",
-/* ASL_MSG_ERROR_DIRECTIVE */ "#error",
-/* ASL_MSG_EXISTING_NAME */ "Name is already defined",
-/* ASL_MSG_INVALID_INVOCATION */ "Invalid macro invocation",
-/* ASL_MSG_MACRO_SYNTAX */ "Invalid macro syntax",
-/* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments",
-/* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive",
-/* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma",
-/* ASL_MSG_WARNING_DIRECTIVE */ "#warning",
-
-/* Table compiler */
+ ASL_MSG_DIRECTIVE_SYNTAX = ASL_MSG_PREPROCESSOR,
+ ASL_MSG_ENDIF_MISMATCH,
+ ASL_MSG_ERROR_DIRECTIVE,
+ ASL_MSG_EXISTING_NAME,
+ ASL_MSG_INVALID_INVOCATION,
+ ASL_MSG_MACRO_SYNTAX,
+ ASL_MSG_TOO_MANY_ARGUMENTS,
+ ASL_MSG_UNKNOWN_DIRECTIVE,
+ ASL_MSG_UNKNOWN_PRAGMA,
+ ASL_MSG_WARNING_DIRECTIVE,
-/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
-/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero",
-/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
-/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
-/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
-/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
-/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
-/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
-/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero",
-/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
-/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
-/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
-/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
-};
+} ASL_MESSAGE_IDS;
-#endif /* ASL_EXCEPTIONS */
#endif /* __ASLMESSAGES_H */
diff --git a/sys/contrib/dev/acpica/compiler/aslmethod.c b/sys/contrib/dev/acpica/compiler/aslmethod.c
index 72f7647..4e85351 100644
--- a/sys/contrib/dev/acpica/compiler/aslmethod.c
+++ b/sys/contrib/dev/acpica/compiler/aslmethod.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@@ -108,7 +107,42 @@ MtMethodAnalysisWalkBegin (
WalkInfo->MethodStack = MethodInfo;
- /* Get the name node, ignored here */
+ /*
+ * Special handling for _PSx methods. Dependency rules (same scope):
+ *
+ * 1) _PS0 - One of these must exist: _PS1, _PS2, _PS3
+ * 2) _PS1/_PS2/_PS3: A _PS0 must exist
+ */
+ if (ACPI_COMPARE_NAME (METHOD_NAME__PS0, Op->Asl.NameSeg))
+ {
+ /* For _PS0, one of _PS1/_PS2/_PS3 must exist */
+
+ if ((!ApFindNameInScope (METHOD_NAME__PS1, Op)) &&
+ (!ApFindNameInScope (METHOD_NAME__PS2, Op)) &&
+ (!ApFindNameInScope (METHOD_NAME__PS3, Op)))
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_PS0 requires one of _PS1/_PS2/_PS3 in same scope");
+ }
+ }
+ else if (
+ ACPI_COMPARE_NAME (METHOD_NAME__PS1, Op->Asl.NameSeg) ||
+ ACPI_COMPARE_NAME (METHOD_NAME__PS2, Op->Asl.NameSeg) ||
+ ACPI_COMPARE_NAME (METHOD_NAME__PS3, Op->Asl.NameSeg))
+ {
+ /* For _PS1/_PS2/_PS3, a _PS0 must exist */
+
+ if (!ApFindNameInScope (METHOD_NAME__PS0, Op))
+ {
+ sprintf (MsgBuffer,
+ "%4.4s requires _PS0 in same scope", Op->Asl.NameSeg);
+
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ MsgBuffer);
+ }
+ }
+
+ /* Get the name node */
Next = Op->Asl.Child;
@@ -359,6 +393,17 @@ MtMethodAnalysisWalkBegin (
break;
case PARSEOP_DEVICE:
+
+ Next = Op->Asl.Child;
+
+ if (!ApFindNameInScope (METHOD_NAME__HID, Next) &&
+ !ApFindNameInScope (METHOD_NAME__ADR, Next))
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "Device object requires a _HID or _ADR in same scope");
+ }
+ break;
+
case PARSEOP_EVENT:
case PARSEOP_MUTEX:
case PARSEOP_OPERATIONREGION:
@@ -412,6 +457,7 @@ MtMethodAnalysisWalkBegin (
AnCheckId (Next, ASL_TYPE_CID);
}
}
+
break;
default:
diff --git a/sys/contrib/dev/acpica/compiler/aslnamesp.c b/sys/contrib/dev/acpica/compiler/aslnamesp.c
index e7ad672..550c730 100644
--- a/sys/contrib/dev/acpica/compiler/aslnamesp.c
+++ b/sys/contrib/dev/acpica/compiler/aslnamesp.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/compiler/asloffset.c b/sys/contrib/dev/acpica/compiler/asloffset.c
index 390a118..cbe69b2 100644
--- a/sys/contrib/dev/acpica/compiler/asloffset.c
+++ b/sys/contrib/dev/acpica/compiler/asloffset.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslopcodes.c b/sys/contrib/dev/acpica/compiler/aslopcodes.c
index 6d39da9..76e2b05 100644
--- a/sys/contrib/dev/acpica/compiler/aslopcodes.c
+++ b/sys/contrib/dev/acpica/compiler/aslopcodes.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -403,6 +402,7 @@ OpcDoConnection (
ACPI_PARSE_OBJECT *BufferOp;
ACPI_PARSE_OBJECT *BufferLengthOp;
ACPI_PARSE_OBJECT *BufferDataOp;
+ ASL_RESOURCE_INFO Info;
UINT8 State;
@@ -417,8 +417,10 @@ OpcDoConnection (
BufferLengthOp = BufferOp->Asl.Child;
BufferDataOp = BufferLengthOp->Asl.Next;
+ Info.DescriptorTypeOp = BufferDataOp->Asl.Next;
+ Info.CurrentByteOffset = 0;
State = ACPI_RSTATE_NORMAL;
- Rnode = RsDoOneResourceDescriptor (BufferDataOp->Asl.Next, 0, &State);
+ Rnode = RsDoOneResourceDescriptor (&Info, &State);
if (!Rnode)
{
return; /* error */
@@ -623,10 +625,10 @@ OpcDoEisaId (
(UINT32) ((UINT8) (InString[1] - 0x40)) << 21 |
(UINT32) ((UINT8) (InString[2] - 0x40)) << 16 |
- (UtHexCharToValue (InString[3])) << 12 |
- (UtHexCharToValue (InString[4])) << 8 |
- (UtHexCharToValue (InString[5])) << 4 |
- UtHexCharToValue (InString[6]);
+ (AcpiUtAsciiCharToHex (InString[3])) << 12 |
+ (AcpiUtAsciiCharToHex (InString[4])) << 8 |
+ (AcpiUtAsciiCharToHex (InString[5])) << 4 |
+ AcpiUtAsciiCharToHex (InString[6]);
/* Swap to little-endian to get final ID (see function header) */
@@ -666,7 +668,7 @@ OpcDoUuId (
ACPI_PARSE_OBJECT *Op)
{
char *InString;
- char *Buffer;
+ UINT8 *Buffer;
ACPI_STATUS Status = AE_OK;
ACPI_PARSE_OBJECT *NewOp;
@@ -681,7 +683,7 @@ OpcDoUuId (
}
else
{
- (void) AuConvertStringToUuid (InString, Buffer);
+ AcpiUtConvertStringToUuid (InString, Buffer);
}
/* Change Op to a Buffer */
diff --git a/sys/contrib/dev/acpica/compiler/asloperands.c b/sys/contrib/dev/acpica/compiler/asloperands.c
index 07bf88f..8c6bfbd 100644
--- a/sys/contrib/dev/acpica/compiler/asloperands.c
+++ b/sys/contrib/dev/acpica/compiler/asloperands.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -913,8 +912,8 @@ OpnDoDefinitionBlock (
* We will use the AML filename that is embedded in the source file
* for the output filename.
*/
- Filename = ACPI_ALLOCATE (strlen (Gbl_DirectoryPath) +
- strlen ((char *) Child->Asl.Value.Buffer) + 1);
+ Filename = UtStringCacheCalloc (strlen (Gbl_DirectoryPath) +
+ strlen ((char *) Child->Asl.Value.Buffer) + 1);
/* Prepend the current directory path */
@@ -922,6 +921,7 @@ OpnDoDefinitionBlock (
strcat (Filename, (char *) Child->Asl.Value.Buffer);
Gbl_OutputFilenamePrefix = Filename;
+ UtConvertBackslashes (Gbl_OutputFilenamePrefix);
}
Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
@@ -968,7 +968,7 @@ OpnDoDefinitionBlock (
if (Child->Asl.Value.String)
{
Length = ACPI_STRLEN (Child->Asl.Value.String);
- Gbl_TableId = AcpiOsAllocate (Length + 1);
+ Gbl_TableId = UtStringCacheCalloc (Length + 1);
ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String);
/*
diff --git a/sys/contrib/dev/acpica/compiler/aslopt.c b/sys/contrib/dev/acpica/compiler/aslopt.c
index 3471006..8e63292 100644
--- a/sys/contrib/dev/acpica/compiler/aslopt.c
+++ b/sys/contrib/dev/acpica/compiler/aslopt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -168,7 +167,7 @@ OptSearchToRoot (
/* We must allocate a new string for the name (TargetPath gets deleted) */
- *NewPath = ACPI_ALLOCATE_ZEROED (ACPI_NAME_SIZE + 1);
+ *NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
ACPI_STRCPY (*NewPath, Path);
if (ACPI_STRNCMP (*NewPath, "_T_", 3))
@@ -576,7 +575,8 @@ OptOptimizeNamePath (
return_VOID;
}
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "%5d [%12.12s] [%12.12s] ",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
+ "PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ",
Op->Asl.LogicalLineNumber,
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode),
AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
@@ -620,7 +620,7 @@ OptOptimizeNamePath (
{
/* This is the declaration of a new name */
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME\n"));
/*
* The node of interest is the parent of this node (the containing
@@ -646,7 +646,7 @@ OptOptimizeNamePath (
{
/* This is a reference to an existing named object */
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REF "));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REFERENCE\n"));
}
/*
@@ -688,9 +688,10 @@ OptOptimizeNamePath (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
- "%37s (%2u) ==> %-32s(%2u) %-32s",
- (char *) CurrentPath.Pointer, (UINT32) CurrentPath.Length,
- (char *) TargetPath.Pointer, (UINT32) TargetPath.Length, ExternalNameString));
+ "CURRENT SCOPE: (%2u) %-37s FULL PATH TO NAME: (%2u) %-32s ACTUAL AML:%-32s\n",
+ (UINT32) CurrentPath.Length, (char *) CurrentPath.Pointer,
+ (UINT32) TargetPath.Length, (char *) TargetPath.Pointer,
+ ExternalNameString));
ACPI_FREE (ExternalNameString);
@@ -747,7 +748,8 @@ OptOptimizeNamePath (
HowMuchShorter = (AmlNameStringLength - ACPI_STRLEN (NewPath));
OptTotal += HowMuchShorter;
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " REDUCED %2u (%u)",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
+ " REDUCED BY %2u (TOTAL SAVED %2u)",
(UINT32) HowMuchShorter, OptTotal));
if (Flags & AML_NAMED)
diff --git a/sys/contrib/dev/acpica/compiler/asloptions.c b/sys/contrib/dev/acpica/compiler/asloptions.c
index 66a9249..9c38371 100644
--- a/sys/contrib/dev/acpica/compiler/asloptions.c
+++ b/sys/contrib/dev/acpica/compiler/asloptions.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -118,8 +118,7 @@ AslCommandLine (
/* Next parameter must be the input filename */
if (!argv[AcpiGbl_Optind] &&
- !Gbl_DisasmFlag &&
- !Gbl_GetAllTables)
+ !Gbl_DisasmFlag)
{
printf ("Missing input filename\n");
BadCommandLine = TRUE;
@@ -169,7 +168,7 @@ AslDoOptions (
/* Get the command line options */
- while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != EOF) switch (j)
+ while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch (j)
{
case '@': /* Begin a response file */
@@ -267,11 +266,22 @@ AslDoOptions (
case 'e': /* External files for disassembler */
- Status = AcpiDmAddToExternalFileList (AcpiGbl_Optarg);
- if (ACPI_FAILURE (Status))
+ /* Get entire list of external files */
+
+ AcpiGbl_Optind--;
+ argv[AcpiGbl_Optind] = AcpiGbl_Optarg;
+
+ while (argv[AcpiGbl_Optind] &&
+ (argv[AcpiGbl_Optind][0] != '-'))
{
- printf ("Could not add %s to external list\n", AcpiGbl_Optarg);
- return (-1);
+ Status = AcpiDmAddToExternalFileList (argv[AcpiGbl_Optind]);
+ if (ACPI_FAILURE (Status))
+ {
+ printf ("Could not add %s to external list\n", argv[AcpiGbl_Optind]);
+ return (-1);
+ }
+
+ AcpiGbl_Optind++;
}
break;
@@ -308,9 +318,8 @@ AslDoOptions (
case 'g': /* Get all ACPI tables */
- Gbl_GetAllTables = TRUE;
- Gbl_DoCompile = FALSE;
- break;
+ printf ("-g option is deprecated, use acpidump utility instead\n");
+ exit (1);
case 'h':
@@ -404,6 +413,13 @@ AslDoOptions (
Gbl_PreprocessorOutputFlag = TRUE;
break;
+ case 'm':
+
+ /* Produce hardware map summary file */
+
+ Gbl_MapfileFlag = TRUE;
+ break;
+
case 'n':
/* Produce namespace file */
@@ -513,6 +529,8 @@ AslDoOptions (
case 'p': /* Override default AML output filename */
Gbl_OutputFilenamePrefix = AcpiGbl_Optarg;
+ UtConvertBackslashes (Gbl_OutputFilenamePrefix);
+
Gbl_UseDefaultAmlFilename = FALSE;
break;
@@ -596,11 +614,19 @@ AslDoOptions (
case 'a':
- /* Disable All error/warning messages */
+ /* Disable all error/warning/remark messages */
Gbl_NoErrors = TRUE;
break;
+ case 'e':
+
+ /* Disable all warning/remark messages (errors only) */
+
+ Gbl_DisplayRemarks = FALSE;
+ Gbl_DisplayWarnings = FALSE;
+ break;
+
case 'i':
/*
* Support for integrated development environment(s).
diff --git a/sys/contrib/dev/acpica/compiler/aslparser.y b/sys/contrib/dev/acpica/compiler/aslparser.y
new file mode 100644
index 0000000..b473041a
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslparser.y
@@ -0,0 +1,131 @@
+%{
+/******************************************************************************
+ *
+ * Module Name: aslparser.y - Master Bison/Yacc input file for iASL
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslparse")
+
+/*
+ * Global Notes:
+ *
+ * October 2005: The following list terms have been optimized (from the
+ * original ASL grammar in the ACPI specification) to force the immediate
+ * reduction of each list item so that the parse stack use doesn't increase on
+ * each list element and possibly overflow on very large lists (>4000 items).
+ * This dramatically reduces use of the parse stack overall.
+ *
+ * ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
+ * ResourceMacroList, and FieldUnitList
+ */
+
+void *
+AslLocalAllocate (
+ unsigned int Size);
+
+/* Bison/yacc configuration */
+
+#define static
+#undef malloc
+#define malloc AslLocalAllocate
+#undef alloca
+#define alloca AslLocalAllocate
+#define yytname AslCompilername
+
+#define YYINITDEPTH 600 /* State stack depth */
+#define YYDEBUG 1 /* Enable debug output */
+#define YYERROR_VERBOSE 1 /* Verbose error messages */
+#define YYFLAG -32768
+
+/* Define YYMALLOC/YYFREE to prevent redefinition errors */
+
+#define YYMALLOC AslLocalAllocate
+#define YYFREE ACPI_FREE
+%}
+
+/*
+ * Declare the type of values in the grammar
+ */
+%union {
+ UINT64 i;
+ char *s;
+ ACPI_PARSE_OBJECT *n;
+}
+
+/*
+ * These shift/reduce conflicts are expected. There should be zero
+ * reduce/reduce conflicts.
+ */
+%expect 86
+
+/*! [Begin] no source code translation */
+
+/*
+ * The M4 macro processor is used to bring in the parser items,
+ * in order to keep this master file smaller, and to break up
+ * the various parser items.
+ */
+m4_define(NoEcho)
+
+/* Token types */
+
+m4_include(asltokens.y)
+
+/* Production types/names */
+
+m4_include(asltypes.y)
+%%
+
+/* Production rules */
+
+m4_include(aslrules.y)
+%%
+
+/*! [End] no source code translation !*/
+
+/* Local support functions in C */
+
+m4_include(aslsupport.y)
diff --git a/sys/contrib/dev/acpica/compiler/aslpredef.c b/sys/contrib/dev/acpica/compiler/aslpredef.c
index 7f411fb..e436f87 100644
--- a/sys/contrib/dev/acpica/compiler/aslpredef.c
+++ b/sys/contrib/dev/acpica/compiler/aslpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -251,10 +251,16 @@ ApCheckPredefinedReturnValue (
const ACPI_PREDEFINED_INFO *ThisName;
- /* Check parent method for a match against the predefined name list */
-
+ /*
+ * Check parent method for a match against the predefined name list.
+ *
+ * Note: Disable compiler errors/warnings because any errors will be
+ * caught when analyzing the parent method. Eliminates duplicate errors.
+ */
+ Gbl_AllExceptionsDisabled = TRUE;
Index = ApCheckForPredefinedName (MethodInfo->Op,
MethodInfo->Op->Asl.NameSeg);
+ Gbl_AllExceptionsDisabled = FALSE;
switch (Index)
{
diff --git a/sys/contrib/dev/acpica/compiler/aslprepkg.c b/sys/contrib/dev/acpica/compiler/aslprepkg.c
index 9cc67f4..174bb82 100644
--- a/sys/contrib/dev/acpica/compiler/aslprepkg.c
+++ b/sys/contrib/dev/acpica/compiler/aslprepkg.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -169,7 +169,7 @@ ApCheckPackage (
{
case ACPI_PTYPE1_FIXED:
/*
- * The package count is fixed and there are no sub-packages
+ * The package count is fixed and there are no subpackages
*
* If package is too small, exit.
* If package is larger than expected, issue warning but continue
@@ -194,7 +194,7 @@ ApCheckPackage (
case ACPI_PTYPE1_VAR:
/*
- * The package count is variable, there are no sub-packages,
+ * The package count is variable, there are no subpackages,
* and all elements must be of the same type
*/
for (i = 0; i < Count; i++)
@@ -207,7 +207,7 @@ ApCheckPackage (
case ACPI_PTYPE1_OPTION:
/*
- * The package count is variable, there are no sub-packages.
+ * The package count is variable, there are no subpackages.
* There are a fixed number of required elements, and a variable
* number of optional elements.
*
@@ -251,7 +251,7 @@ ApCheckPackage (
Op = Op->Asl.Next;
Count--;
- /* Examine the sub-packages */
+ /* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 1, Count);
@@ -259,7 +259,7 @@ ApCheckPackage (
case ACPI_PTYPE2_PKG_COUNT:
- /* First element is the (Integer) count of sub-packages to follow */
+ /* First element is the (Integer) count of subpackages to follow */
Status = ApCheckObjectType (Predefined->Info.Name, Op,
ACPI_RTYPE_INTEGER, 0);
@@ -283,12 +283,47 @@ ApCheckPackage (
Op = Op->Asl.Next;
- /* Examine the sub-packages */
+ /* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 1, Count);
break;
+ case ACPI_PTYPE2_UUID_PAIR:
+
+ /* The package contains a variable list of UUID Buffer/Package pairs */
+
+ /* The length of the package must be even */
+
+ if (Count & 1)
+ {
+ sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.",
+ Predefined->Info.Name, Count);
+
+ AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH,
+ ParentOp->Asl.Child, MsgBuffer);
+ }
+
+ /* Validate the alternating types */
+
+ for (i = 0; i < Count; ++i)
+ {
+ if (i & 1)
+ {
+ ApCheckObjectType (Predefined->Info.Name, Op,
+ Package->RetInfo.ObjectType2, i);
+ }
+ else
+ {
+ ApCheckObjectType (Predefined->Info.Name, Op,
+ Package->RetInfo.ObjectType1, i);
+ }
+
+ Op = Op->Asl.Next;
+ }
+
+ break;
+
case ACPI_PTYPE2:
case ACPI_PTYPE2_FIXED:
case ACPI_PTYPE2_MIN:
@@ -296,10 +331,10 @@ ApCheckPackage (
case ACPI_PTYPE2_FIX_VAR:
/*
* These types all return a single Package that consists of a
- * variable number of sub-Packages.
+ * variable number of subpackages.
*/
- /* Examine the sub-packages */
+ /* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 0, Count);
@@ -467,6 +502,12 @@ ApCheckPackageList (
Count, ExpectedCount);
break;
}
+ if (Count > ExpectedCount)
+ {
+ ApPackageTooLarge (PredefinedName, SubPackageOp,
+ Count, ExpectedCount);
+ break;
+ }
ApCheckPackageElements (PredefinedName, Op,
Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
@@ -494,7 +535,7 @@ ApCheckPackageList (
case ACPI_PTYPE2_FIXED:
- /* Each sub-package has a fixed length */
+ /* Each subpackage has a fixed length */
ExpectedCount = Package->RetInfo2.Count;
if (Count < ExpectedCount)
@@ -503,6 +544,12 @@ ApCheckPackageList (
Count, ExpectedCount);
break;
}
+ if (Count > ExpectedCount)
+ {
+ ApPackageTooLarge (PredefinedName, SubPackageOp,
+ Count, ExpectedCount);
+ break;
+ }
/* Check each object/type combination */
@@ -517,7 +564,7 @@ ApCheckPackageList (
case ACPI_PTYPE2_MIN:
- /* Each sub-package has a variable but minimum length */
+ /* Each subpackage has a variable but minimum length */
ExpectedCount = Package->RetInfo.Count1;
if (Count < ExpectedCount)
@@ -527,7 +574,7 @@ ApCheckPackageList (
break;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
ApCheckPackageElements (PredefinedName, Op,
Package->RetInfo.ObjectType1, Count, 0, 0);
@@ -576,7 +623,7 @@ ApCheckPackageList (
Count = ExpectedCount;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
Op = Op->Asl.Next;
ApCheckPackageElements (PredefinedName, Op,
diff --git a/sys/contrib/dev/acpica/compiler/aslresource.c b/sys/contrib/dev/acpica/compiler/aslresource.c
index 0a95a90..3cedeed 100644
--- a/sys/contrib/dev/acpica/compiler/aslresource.c
+++ b/sys/contrib/dev/acpica/compiler/aslresource.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -123,22 +122,10 @@ RsSmallAddressCheck (
return;
}
- /* Special case for Memory24, values are compressed */
-
- if (Type == ACPI_RESOURCE_NAME_MEMORY24)
- {
- if (!Alignment) /* Alignment==0 means 64K - no invalid alignment */
- {
- Alignment = ACPI_UINT16_MAX + 1;
- }
-
- Minimum <<= 8;
- Maximum <<= 8;
- Length *= 256;
- }
-
- /* IO descriptor has different definition of min/max, don't check */
-
+ /*
+ * Range checks for Memory24 and Memory32.
+ * IO descriptor has different definition of min/max, don't check.
+ */
if (Type != ACPI_RESOURCE_NAME_IO)
{
/* Basic checks on Min/Max/Length */
@@ -151,6 +138,19 @@ RsSmallAddressCheck (
{
AslError (ASL_ERROR, ASL_MSG_INVALID_LENGTH, LengthOp, NULL);
}
+
+ /* Special case for Memory24, min/max values are compressed */
+
+ if (Type == ACPI_RESOURCE_NAME_MEMORY24)
+ {
+ if (!Alignment) /* Alignment==0 means 64K alignment */
+ {
+ Alignment = ACPI_UINT16_MAX + 1;
+ }
+
+ Minimum <<= 8;
+ Maximum <<= 8;
+ }
}
/* Alignment of zero is not in ACPI spec, but is used to mean byte acc */
@@ -645,8 +645,7 @@ RsCheckListForDuplicates (
ASL_RESOURCE_NODE *
RsDoOneResourceDescriptor (
- ACPI_PARSE_OBJECT *DescriptorTypeOp,
- UINT32 CurrentByteOffset,
+ ASL_RESOURCE_INFO *Info,
UINT8 *State)
{
ASL_RESOURCE_NODE *Rnode = NULL;
@@ -654,36 +653,31 @@ RsDoOneResourceDescriptor (
/* Construct the resource */
- switch (DescriptorTypeOp->Asl.ParseOpcode)
+ switch (Info->DescriptorTypeOp->Asl.ParseOpcode)
{
case PARSEOP_DMA:
- Rnode = RsDoDmaDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoDmaDescriptor (Info);
break;
case PARSEOP_FIXEDDMA:
- Rnode = RsDoFixedDmaDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoFixedDmaDescriptor (Info);
break;
case PARSEOP_DWORDIO:
- Rnode = RsDoDwordIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoDwordIoDescriptor (Info);
break;
case PARSEOP_DWORDMEMORY:
- Rnode = RsDoDwordMemoryDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoDwordMemoryDescriptor (Info);
break;
case PARSEOP_DWORDSPACE:
- Rnode = RsDoDwordSpaceDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoDwordSpaceDescriptor (Info);
break;
case PARSEOP_ENDDEPENDENTFN:
@@ -693,13 +687,13 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_NORMAL:
AslError (ASL_ERROR, ASL_MSG_MISSING_STARTDEPENDENT,
- DescriptorTypeOp, NULL);
+ Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
- DescriptorTypeOp, NULL);
+ Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_DEPENDENT_LIST:
@@ -709,104 +703,87 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_NORMAL;
- Rnode = RsDoEndDependentDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoEndDependentDescriptor (Info);
break;
case PARSEOP_ENDTAG:
- Rnode = RsDoEndTagDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoEndTagDescriptor (Info);
break;
case PARSEOP_EXTENDEDIO:
- Rnode = RsDoExtendedIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoExtendedIoDescriptor (Info);
break;
case PARSEOP_EXTENDEDMEMORY:
- Rnode = RsDoExtendedMemoryDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoExtendedMemoryDescriptor (Info);
break;
case PARSEOP_EXTENDEDSPACE:
- Rnode = RsDoExtendedSpaceDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoExtendedSpaceDescriptor (Info);
break;
case PARSEOP_FIXEDIO:
- Rnode = RsDoFixedIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoFixedIoDescriptor (Info);
break;
case PARSEOP_INTERRUPT:
- Rnode = RsDoInterruptDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoInterruptDescriptor (Info);
break;
case PARSEOP_IO:
- Rnode = RsDoIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoIoDescriptor (Info);
break;
case PARSEOP_IRQ:
- Rnode = RsDoIrqDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoIrqDescriptor (Info);
break;
case PARSEOP_IRQNOFLAGS:
- Rnode = RsDoIrqNoFlagsDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoIrqNoFlagsDescriptor (Info);
break;
case PARSEOP_MEMORY24:
- Rnode = RsDoMemory24Descriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoMemory24Descriptor (Info);
break;
case PARSEOP_MEMORY32:
- Rnode = RsDoMemory32Descriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoMemory32Descriptor (Info);
break;
case PARSEOP_MEMORY32FIXED:
- Rnode = RsDoMemory32FixedDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoMemory32FixedDescriptor (Info);
break;
case PARSEOP_QWORDIO:
- Rnode = RsDoQwordIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoQwordIoDescriptor (Info);
break;
case PARSEOP_QWORDMEMORY:
- Rnode = RsDoQwordMemoryDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoQwordMemoryDescriptor (Info);
break;
case PARSEOP_QWORDSPACE:
- Rnode = RsDoQwordSpaceDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoQwordSpaceDescriptor (Info);
break;
case PARSEOP_REGISTER:
- Rnode = RsDoGeneralRegisterDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoGeneralRegisterDescriptor (Info);
break;
case PARSEOP_STARTDEPENDENTFN:
@@ -816,7 +793,7 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
- DescriptorTypeOp, NULL);
+ Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_NORMAL:
@@ -827,8 +804,7 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_START_DEPENDENT;
- Rnode = RsDoStartDependentDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoStartDependentDescriptor (Info);
*State = ACPI_RSTATE_DEPENDENT_LIST;
break;
@@ -839,7 +815,7 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
- DescriptorTypeOp, NULL);
+ Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_NORMAL:
@@ -850,69 +826,58 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_START_DEPENDENT;
- Rnode = RsDoStartDependentNoPriDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoStartDependentNoPriDescriptor (Info);
*State = ACPI_RSTATE_DEPENDENT_LIST;
break;
case PARSEOP_VENDORLONG:
- Rnode = RsDoVendorLargeDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoVendorLargeDescriptor (Info);
break;
case PARSEOP_VENDORSHORT:
- Rnode = RsDoVendorSmallDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoVendorSmallDescriptor (Info);
break;
case PARSEOP_WORDBUSNUMBER:
- Rnode = RsDoWordBusNumberDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoWordBusNumberDescriptor (Info);
break;
case PARSEOP_WORDIO:
- Rnode = RsDoWordIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoWordIoDescriptor (Info);
break;
case PARSEOP_WORDSPACE:
- Rnode = RsDoWordSpaceDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoWordSpaceDescriptor (Info);
break;
case PARSEOP_GPIO_INT:
- Rnode = RsDoGpioIntDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoGpioIntDescriptor (Info);
break;
case PARSEOP_GPIO_IO:
- Rnode = RsDoGpioIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoGpioIoDescriptor (Info);
break;
case PARSEOP_I2C_SERIALBUS:
- Rnode = RsDoI2cSerialBusDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoI2cSerialBusDescriptor (Info);
break;
case PARSEOP_SPI_SERIALBUS:
- Rnode = RsDoSpiSerialBusDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoSpiSerialBusDescriptor (Info);
break;
case PARSEOP_UART_SERIALBUS:
- Rnode = RsDoUartSerialBusDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoUartSerialBusDescriptor (Info);
break;
case PARSEOP_DEFAULT_ARG:
@@ -923,7 +888,7 @@ RsDoOneResourceDescriptor (
default:
printf ("Unknown resource descriptor type [%s]\n",
- DescriptorTypeOp->Asl.ParseOpName);
+ Info->DescriptorTypeOp->Asl.ParseOpName);
break;
}
@@ -932,14 +897,14 @@ RsDoOneResourceDescriptor (
* This allows the resource to be installed in the namespace so that
* references to the descriptor can be resolved.
*/
- DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
- DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
- DescriptorTypeOp->Asl.Value.Integer = CurrentByteOffset;
+ Info->DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ Info->DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
+ Info->DescriptorTypeOp->Asl.Value.Integer = Info->CurrentByteOffset;
if (Rnode)
{
- DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
- DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
+ Info->DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
+ Info->DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
}
return (Rnode);
@@ -1023,6 +988,7 @@ RsDoResourceTemplate (
ASL_RESOURCE_NODE HeadRnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *Rnode;
+ ASL_RESOURCE_INFO Info;
UINT8 State;
@@ -1055,9 +1021,22 @@ RsDoResourceTemplate (
PreviousRnode = &HeadRnode;
while (DescriptorTypeOp)
{
+ /* Save information for optional mapfile */
+
+ if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONNECTION)
+ {
+ Info.MappingOp = Op->Asl.Parent;
+ }
+ else
+ {
+ Info.MappingOp = DescriptorTypeOp;
+ }
+
+ Info.DescriptorTypeOp = DescriptorTypeOp;
+ Info.CurrentByteOffset = CurrentByteOffset;
+
DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
- Rnode = RsDoOneResourceDescriptor (DescriptorTypeOp, CurrentByteOffset,
- &State);
+ Rnode = RsDoOneResourceDescriptor (&Info, &State);
/*
* Update current byte offset to indicate the number of bytes from the
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1.c b/sys/contrib/dev/acpica/compiler/aslrestype1.c
index 21a8705..46bb1fa 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype1.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype1.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -65,9 +64,7 @@
*
* FUNCTION: RsDoEndTagDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -77,8 +74,7 @@
ASL_RESOURCE_NODE *
RsDoEndTagDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ASL_RESOURCE_NODE *Rnode;
@@ -99,9 +95,7 @@ RsDoEndTagDescriptor (
*
* FUNCTION: RsDoEndDependentDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -111,8 +105,7 @@ RsDoEndTagDescriptor (
ASL_RESOURCE_NODE *
RsDoEndDependentDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ASL_RESOURCE_NODE *Rnode;
@@ -131,9 +124,7 @@ RsDoEndDependentDescriptor (
*
* FUNCTION: RsDoMemory24Descriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -143,8 +134,7 @@ RsDoEndDependentDescriptor (
ASL_RESOURCE_NODE *
RsDoMemory24Descriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -152,10 +142,12 @@ RsDoMemory24Descriptor (
ACPI_PARSE_OBJECT *MaxOp = NULL;
ACPI_PARSE_OBJECT *LengthOp = NULL;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY24));
Descriptor = Rnode->Buffer;
@@ -208,7 +200,7 @@ RsDoMemory24Descriptor (
case 5: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -227,7 +219,7 @@ RsDoMemory24Descriptor (
Descriptor->Memory24.Maximum,
Descriptor->Memory24.AddressLength,
Descriptor->Memory24.Alignment,
- MinOp, MaxOp, LengthOp, NULL, Op);
+ MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
return (Rnode);
}
@@ -237,9 +229,7 @@ RsDoMemory24Descriptor (
*
* FUNCTION: RsDoMemory32Descriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -249,8 +239,7 @@ RsDoMemory24Descriptor (
ASL_RESOURCE_NODE *
RsDoMemory32Descriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -259,10 +248,12 @@ RsDoMemory32Descriptor (
ACPI_PARSE_OBJECT *LengthOp = NULL;
ACPI_PARSE_OBJECT *AlignOp = NULL;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY32));
Descriptor = Rnode->Buffer;
@@ -316,7 +307,7 @@ RsDoMemory32Descriptor (
case 5: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -335,7 +326,7 @@ RsDoMemory32Descriptor (
Descriptor->Memory32.Maximum,
Descriptor->Memory32.AddressLength,
Descriptor->Memory32.Alignment,
- MinOp, MaxOp, LengthOp, AlignOp, Op);
+ MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
return (Rnode);
}
@@ -345,9 +336,7 @@ RsDoMemory32Descriptor (
*
* FUNCTION: RsDoMemory32FixedDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -357,16 +346,17 @@ RsDoMemory32Descriptor (
ASL_RESOURCE_NODE *
RsDoMemory32FixedDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_MEMORY32));
Descriptor = Rnode->Buffer;
@@ -402,7 +392,7 @@ RsDoMemory32FixedDescriptor (
case 3: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -422,9 +412,7 @@ RsDoMemory32FixedDescriptor (
*
* FUNCTION: RsDoStartDependentDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -434,19 +422,21 @@ RsDoMemory32FixedDescriptor (
ASL_RESOURCE_NODE *
RsDoStartDependentDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *NextRnode;
+ ASL_RESOURCE_INFO NextInfo;
+ UINT32 CurrentByteOffset;
UINT32 i;
UINT8 State;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT));
PreviousRnode = Rnode;
@@ -492,8 +482,10 @@ RsDoStartDependentDescriptor (
default:
- NextRnode = RsDoOneResourceDescriptor (InitializerOp,
- CurrentByteOffset, &State);
+ NextInfo.CurrentByteOffset = CurrentByteOffset;
+ NextInfo.DescriptorTypeOp = InitializerOp;
+
+ NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
/*
* Update current byte offset to indicate the number of bytes from the
@@ -517,9 +509,7 @@ RsDoStartDependentDescriptor (
*
* FUNCTION: RsDoStartDependentNoPriDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -529,18 +519,20 @@ RsDoStartDependentDescriptor (
ASL_RESOURCE_NODE *
RsDoStartDependentNoPriDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *NextRnode;
+ ASL_RESOURCE_INFO NextInfo;
+ UINT32 CurrentByteOffset;
UINT8 State;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO));
Descriptor = Rnode->Buffer;
@@ -557,8 +549,10 @@ RsDoStartDependentNoPriDescriptor (
State = ACPI_RSTATE_START_DEPENDENT;
while (InitializerOp)
{
- NextRnode = RsDoOneResourceDescriptor (InitializerOp,
- CurrentByteOffset, &State);
+ NextInfo.CurrentByteOffset = CurrentByteOffset;
+ NextInfo.DescriptorTypeOp = InitializerOp;
+
+ NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
/*
* Update current byte offset to indicate the number of bytes from the
@@ -579,9 +573,7 @@ RsDoStartDependentNoPriDescriptor (
*
* FUNCTION: RsDoVendorSmallDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -591,8 +583,7 @@ RsDoStartDependentNoPriDescriptor (
ASL_RESOURCE_NODE *
RsDoVendorSmallDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -601,7 +592,7 @@ RsDoVendorSmallDescriptor (
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
/* Allocate worst case - 7 vendor bytes */
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1i.c b/sys/contrib/dev/acpica/compiler/aslrestype1i.c
index 4e78c2c..6de7b93 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype1i.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype1i.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -63,9 +62,7 @@
*
* FUNCTION: RsDoDmaDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -75,18 +72,19 @@
ASL_RESOURCE_NODE *
RsDoDmaDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
UINT8 DmaChannelMask = 0;
UINT8 DmaChannels = 0;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_DMA));
Descriptor = Rnode->Buffer;
@@ -122,7 +120,7 @@ RsDoDmaDescriptor (
case 3: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -184,9 +182,7 @@ RsDoDmaDescriptor (
*
* FUNCTION: RsDoFixedDmaDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -196,16 +192,17 @@ RsDoDmaDescriptor (
ASL_RESOURCE_NODE *
RsDoFixedDmaDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_DMA));
Descriptor = Rnode->Buffer;
@@ -241,7 +238,7 @@ RsDoFixedDmaDescriptor (
case 3: /* Descriptor Name (optional) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default: /* Ignore any extra nodes */
@@ -260,9 +257,7 @@ RsDoFixedDmaDescriptor (
*
* FUNCTION: RsDoFixedIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -272,17 +267,18 @@ RsDoFixedDmaDescriptor (
ASL_RESOURCE_NODE *
RsDoFixedIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ACPI_PARSE_OBJECT *AddressOp = NULL;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_IO));
Descriptor = Rnode->Buffer;
@@ -314,7 +310,7 @@ RsDoFixedIoDescriptor (
case 2: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -341,9 +337,7 @@ RsDoFixedIoDescriptor (
*
* FUNCTION: RsDoIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -353,8 +347,7 @@ RsDoFixedIoDescriptor (
ASL_RESOURCE_NODE *
RsDoIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -363,10 +356,12 @@ RsDoIoDescriptor (
ACPI_PARSE_OBJECT *LengthOp = NULL;
ACPI_PARSE_OBJECT *AlignOp = NULL;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IO));
Descriptor = Rnode->Buffer;
@@ -424,7 +419,7 @@ RsDoIoDescriptor (
case 5: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -443,7 +438,7 @@ RsDoIoDescriptor (
Descriptor->Io.Maximum,
Descriptor->Io.AddressLength,
Descriptor->Io.Alignment,
- MinOp, MaxOp, LengthOp, AlignOp, Op);
+ MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
return (Rnode);
}
@@ -453,9 +448,7 @@ RsDoIoDescriptor (
*
* FUNCTION: RsDoIrqDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -465,18 +458,19 @@ RsDoIoDescriptor (
ASL_RESOURCE_NODE *
RsDoIrqDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT32 Interrupts = 0;
UINT16 IrqMask = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ));
/* Length = 3 (with flag byte) */
@@ -514,7 +508,7 @@ RsDoIrqDescriptor (
case 3: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -576,9 +570,7 @@ RsDoIrqDescriptor (
*
* FUNCTION: RsDoIrqNoFlagsDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -588,18 +580,19 @@ RsDoIrqDescriptor (
ASL_RESOURCE_NODE *
RsDoIrqNoFlagsDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT16 IrqMask = 0;
UINT32 Interrupts = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ_NOFLAGS));
Descriptor = Rnode->Buffer;
@@ -614,7 +607,7 @@ RsDoIrqNoFlagsDescriptor (
{
case 0: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2.c b/sys/contrib/dev/acpica/compiler/aslrestype2.c
index 942d45e..ec6067b 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -61,9 +60,7 @@
*
* FUNCTION: RsDoGeneralRegisterDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -73,16 +70,17 @@
ASL_RESOURCE_NODE *
RsDoGeneralRegisterDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_GENERIC_REGISTER));
Descriptor = Rnode->Buffer;
@@ -138,7 +136,7 @@ RsDoGeneralRegisterDescriptor (
case 5: /* ResourceTag (ACPI 3.0b) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -157,9 +155,7 @@ RsDoGeneralRegisterDescriptor (
*
* FUNCTION: RsDoInterruptDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -169,8 +165,7 @@ RsDoGeneralRegisterDescriptor (
ASL_RESOURCE_NODE *
RsDoInterruptDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
AML_RESOURCE *Rover = NULL;
@@ -178,13 +173,15 @@ RsDoInterruptDescriptor (
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN HasResSourceIndex = FALSE;
UINT8 ResSourceIndex = 0;
UINT8 *ResSourceString = NULL;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
StringLength = RsGetStringDataLength (InitializerOp);
/* Count the interrupt numbers */
@@ -211,9 +208,9 @@ RsDoInterruptDescriptor (
OptionIndex += 4;
}
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_EXTENDED_IRQ) +
- 1 + OptionIndex + StringLength);
+ 1 + OptionIndex + StringLength);
Descriptor = Rnode->Buffer;
Descriptor->ExtendedIrq.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_IRQ;
@@ -303,7 +300,7 @@ RsDoInterruptDescriptor (
case 6: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -396,9 +393,7 @@ RsDoInterruptDescriptor (
*
* FUNCTION: RsDoVendorLargeDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -408,8 +403,7 @@ RsDoInterruptDescriptor (
ASL_RESOURCE_NODE *
RsDoVendorLargeDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -420,7 +414,7 @@ RsDoVendorLargeDescriptor (
/* Count the number of data bytes */
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
for (i = 0; InitializerOp; i++)
@@ -432,7 +426,7 @@ RsDoVendorLargeDescriptor (
InitializerOp = InitializerOp->Asl.Next;
}
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_LARGE) + i);
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2d.c b/sys/contrib/dev/acpica/compiler/aslrestype2d.c
index 035b6ec..39b1f6b 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2d.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2d.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -60,9 +59,7 @@
*
* FUNCTION: RsDoDwordIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoDwordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -85,12 +81,14 @@ RsDoDwordIoDescriptor (
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT8 *OptionalFields;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@@ -245,7 +243,7 @@ RsDoDwordIoDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@@ -279,10 +277,10 @@ RsDoDwordIoDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -291,9 +289,7 @@ RsDoDwordIoDescriptor (
*
* FUNCTION: RsDoDwordMemoryDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -303,8 +299,7 @@ RsDoDwordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoDwordMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -316,12 +311,14 @@ RsDoDwordMemoryDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@@ -480,7 +477,7 @@ RsDoDwordMemoryDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@@ -515,10 +512,10 @@ RsDoDwordMemoryDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -527,9 +524,7 @@ RsDoDwordMemoryDescriptor (
*
* FUNCTION: RsDoDwordSpaceDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -539,8 +534,7 @@ RsDoDwordMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoDwordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -552,12 +546,14 @@ RsDoDwordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@@ -712,7 +708,7 @@ RsDoDwordSpaceDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -733,9 +729,9 @@ RsDoDwordSpaceDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2e.c b/sys/contrib/dev/acpica/compiler/aslrestype2e.c
index 5621762..b395563 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2e.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2e.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
@@ -59,9 +58,7 @@
*
* FUNCTION: RsDoExtendedIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -71,8 +68,7 @@
ASL_RESOURCE_NODE *
RsDoExtendedIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -82,11 +78,13 @@ RsDoExtendedIoDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@@ -187,7 +185,7 @@ RsDoExtendedIoDescriptor (
case 11: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 12: /* Type */
@@ -221,9 +219,10 @@ RsDoExtendedIoDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
- Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
+ Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
+ StringLength;
return (Rnode);
}
@@ -232,9 +231,7 @@ RsDoExtendedIoDescriptor (
*
* FUNCTION: RsDoExtendedMemoryDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -244,8 +241,7 @@ RsDoExtendedIoDescriptor (
ASL_RESOURCE_NODE *
RsDoExtendedMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -255,11 +251,13 @@ RsDoExtendedMemoryDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@@ -367,7 +365,7 @@ RsDoExtendedMemoryDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@@ -402,9 +400,10 @@ RsDoExtendedMemoryDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
- Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
+ Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
+ StringLength;
return (Rnode);
}
@@ -413,9 +412,7 @@ RsDoExtendedMemoryDescriptor (
*
* FUNCTION: RsDoExtendedSpaceDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -425,8 +422,7 @@ RsDoExtendedMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoExtendedSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -436,11 +432,13 @@ RsDoExtendedSpaceDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@@ -545,7 +543,7 @@ RsDoExtendedSpaceDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -565,8 +563,9 @@ RsDoExtendedSpaceDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
- Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
+ Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
+ StringLength;
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2q.c b/sys/contrib/dev/acpica/compiler/aslrestype2q.c
index 3a002a4..f79680f 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2q.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2q.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -60,9 +59,7 @@
*
* FUNCTION: RsDoQwordIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoQwordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -85,12 +81,14 @@ RsDoQwordIoDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@@ -236,7 +234,7 @@ RsDoQwordIoDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@@ -270,10 +268,10 @@ RsDoQwordIoDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -282,9 +280,7 @@ RsDoQwordIoDescriptor (
*
* FUNCTION: RsDoQwordMemoryDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -294,8 +290,7 @@ RsDoQwordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoQwordMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -307,12 +302,14 @@ RsDoQwordMemoryDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@@ -465,7 +462,7 @@ RsDoQwordMemoryDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@@ -500,10 +497,10 @@ RsDoQwordMemoryDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -512,9 +509,7 @@ RsDoQwordMemoryDescriptor (
*
* FUNCTION: RsDoQwordSpaceDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -524,8 +519,7 @@ RsDoQwordMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoQwordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -537,12 +531,14 @@ RsDoQwordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@@ -692,7 +688,7 @@ RsDoQwordSpaceDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -712,9 +708,9 @@ RsDoQwordSpaceDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2s.c b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
index 96be2ad..2be295b 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2s.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -268,9 +267,7 @@ RsGetVendorData (
*
* FUNCTION: RsDoGpioIntDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -280,8 +277,7 @@ RsGetVendorData (
ASL_RESOURCE_NODE *
RsDoGpioIntDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -289,14 +285,18 @@ RsDoGpioIntDescriptor (
char *ResourceSource = NULL;
UINT8 *VendorData = NULL;
UINT16 *InterruptList = NULL;
+ UINT16 *PinList = NULL;
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 InterruptLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 PinCount = 0;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -324,6 +324,7 @@ RsDoGpioIntDescriptor (
/* Build pointers to optional areas */
InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
+ PinList = InterruptList;
ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
@@ -407,7 +408,7 @@ RsDoGpioIntDescriptor (
case 8: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -438,6 +439,7 @@ RsDoGpioIntDescriptor (
*/
*InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
InterruptList++;
+ PinCount++;
/* Case 10: First interrupt number in list */
@@ -466,6 +468,7 @@ RsDoGpioIntDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
return (Rnode);
}
@@ -474,9 +477,7 @@ RsDoGpioIntDescriptor (
*
* FUNCTION: RsDoGpioIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -486,8 +487,7 @@ RsDoGpioIntDescriptor (
ASL_RESOURCE_NODE *
RsDoGpioIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -495,14 +495,18 @@ RsDoGpioIoDescriptor (
char *ResourceSource = NULL;
UINT8 *VendorData = NULL;
UINT16 *InterruptList = NULL;
+ UINT16 *PinList = NULL;
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 InterruptLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 PinCount = 0;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -513,6 +517,7 @@ RsDoGpioIoDescriptor (
ResSourceLength = RsGetStringDataLength (InitializerOp);
VendorLength = RsGetBufferDataLength (InitializerOp);
InterruptLength = RsGetInterruptDataLength (InitializerOp);
+ PinList = InterruptList;
DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
ResSourceLength + VendorLength + InterruptLength;
@@ -530,6 +535,7 @@ RsDoGpioIoDescriptor (
/* Build pointers to optional areas */
InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
+ PinList = InterruptList;
ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
@@ -613,7 +619,7 @@ RsDoGpioIoDescriptor (
case 8: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -643,6 +649,7 @@ RsDoGpioIoDescriptor (
*/
*InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
InterruptList++;
+ PinCount++;
/* Case 10: First interrupt number in list */
@@ -671,6 +678,7 @@ RsDoGpioIoDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
return (Rnode);
}
@@ -679,9 +687,7 @@ RsDoGpioIoDescriptor (
*
* FUNCTION: RsDoI2cSerialBusDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -691,8 +697,7 @@ RsDoGpioIoDescriptor (
ASL_RESOURCE_NODE *
RsDoI2cSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -702,10 +707,12 @@ RsDoI2cSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -801,7 +808,7 @@ RsDoI2cSerialBusDescriptor (
case 7: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -818,6 +825,7 @@ RsDoI2cSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
@@ -826,9 +834,7 @@ RsDoI2cSerialBusDescriptor (
*
* FUNCTION: RsDoSpiSerialBusDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -838,8 +844,7 @@ RsDoI2cSerialBusDescriptor (
ASL_RESOURCE_NODE *
RsDoSpiSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -849,10 +854,12 @@ RsDoSpiSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -976,7 +983,7 @@ RsDoSpiSerialBusDescriptor (
case 11: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 12: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -993,6 +1000,7 @@ RsDoSpiSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
@@ -1001,9 +1009,7 @@ RsDoSpiSerialBusDescriptor (
*
* FUNCTION: RsDoUartSerialBusDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -1013,8 +1019,7 @@ RsDoSpiSerialBusDescriptor (
ASL_RESOURCE_NODE *
RsDoUartSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -1024,10 +1029,12 @@ RsDoUartSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -1168,7 +1175,7 @@ RsDoUartSerialBusDescriptor (
case 12: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -1185,5 +1192,6 @@ RsDoUartSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2w.c b/sys/contrib/dev/acpica/compiler/aslrestype2w.c
index be388b7..34c3e1e 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2w.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2w.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -60,9 +59,7 @@
*
* FUNCTION: RsDoWordIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoWordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -85,12 +81,14 @@ RsDoWordIoDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@@ -236,7 +234,7 @@ RsDoWordIoDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@@ -270,10 +268,10 @@ RsDoWordIoDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -282,9 +280,7 @@ RsDoWordIoDescriptor (
*
* FUNCTION: RsDoWordBusNumberDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -294,8 +290,7 @@ RsDoWordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoWordBusNumberDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -307,12 +302,14 @@ RsDoWordBusNumberDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@@ -456,7 +453,7 @@ RsDoWordBusNumberDescriptor (
case 11: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -476,10 +473,10 @@ RsDoWordBusNumberDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -488,9 +485,7 @@ RsDoWordBusNumberDescriptor (
*
* FUNCTION: RsDoWordSpaceDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -500,8 +495,7 @@ RsDoWordBusNumberDescriptor (
ASL_RESOURCE_NODE *
RsDoWordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -513,12 +507,14 @@ RsDoWordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@@ -673,7 +669,7 @@ RsDoWordSpaceDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -693,9 +689,9 @@ RsDoWordSpaceDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.y b/sys/contrib/dev/acpica/compiler/aslrules.y
index 42ff850..2bc48db 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.y
+++ b/sys/contrib/dev/acpica/compiler/aslrules.y
@@ -1,12 +1,12 @@
-%{
+NoEcho('
/******************************************************************************
*
- * Module Name: aslcompiler.y - Bison/Yacc input file (ASL grammar and actions)
+ * Module Name: aslrules.y - Bison/Yacc production rules
*
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,755 +42,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#include <contrib/dev/acpica/compiler/aslcompiler.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <contrib/dev/acpica/include/acpi.h>
-#include <contrib/dev/acpica/include/accommon.h>
+')
-#define _COMPONENT ACPI_COMPILER
- ACPI_MODULE_NAME ("aslparse")
-
-/*
- * Global Notes:
- *
- * October 2005: The following list terms have been optimized (from the
- * original ASL grammar in the ACPI specification) to force the immediate
- * reduction of each list item so that the parse stack use doesn't increase on
- * each list element and possibly overflow on very large lists (>4000 items).
- * This dramatically reduces use of the parse stack overall.
- *
- * ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
- * ResourceMacroList, and FieldUnitList
- */
-
-void * AslLocalAllocate (unsigned int Size);
-
-/* Bison/yacc configuration */
-
-#define static
-#undef alloca
-#define alloca AslLocalAllocate
-#define yytname AslCompilername
-
-#define YYINITDEPTH 600 /* State stack depth */
-#define YYDEBUG 1 /* Enable debug output */
-#define YYERROR_VERBOSE 1 /* Verbose error messages */
-
-/* Define YYMALLOC/YYFREE to prevent redefinition errors */
-
-#define YYMALLOC malloc
-#define YYFREE free
-
-/*
- * The windows version of bison defines this incorrectly as "32768" (Not negative).
- * We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
- * instead (#define YYFBAD 32768), so we can define it correctly here.
- *
- * The problem is that if YYFLAG is positive, the extended syntax error messages
- * are disabled.
- */
-#define YYFLAG -32768
-
-%}
-
-/*
- * Declare the type of values in the grammar
- */
-%union {
- UINT64 i;
- char *s;
- ACPI_PARSE_OBJECT *n;
-}
-
-/*! [Begin] no source code translation */
-
-/*
- * These shift/reduce conflicts are expected. There should be zero
- * reduce/reduce conflicts.
- */
-%expect 86
-
-/******************************************************************************
- *
- * Token types: These are returned by the lexer
- *
- * NOTE: This list MUST match the AslKeywordMapping table found
- * in aslmap.c EXACTLY! Double check any changes!
- *
- *****************************************************************************/
-
-%token <i> PARSEOP_ACCESSAS
-%token <i> PARSEOP_ACCESSATTRIB_BLOCK
-%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
-%token <i> PARSEOP_ACCESSATTRIB_BYTE
-%token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
-%token <i> PARSEOP_ACCESSATTRIB_QUICK
-%token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
-%token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
-%token <i> PARSEOP_ACCESSATTRIB_SND_RCV
-%token <i> PARSEOP_ACCESSATTRIB_WORD
-%token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
-%token <i> PARSEOP_ACCESSTYPE_ANY
-%token <i> PARSEOP_ACCESSTYPE_BUF
-%token <i> PARSEOP_ACCESSTYPE_BYTE
-%token <i> PARSEOP_ACCESSTYPE_DWORD
-%token <i> PARSEOP_ACCESSTYPE_QWORD
-%token <i> PARSEOP_ACCESSTYPE_WORD
-%token <i> PARSEOP_ACQUIRE
-%token <i> PARSEOP_ADD
-%token <i> PARSEOP_ADDRESSINGMODE_7BIT
-%token <i> PARSEOP_ADDRESSINGMODE_10BIT
-%token <i> PARSEOP_ADDRESSTYPE_ACPI
-%token <i> PARSEOP_ADDRESSTYPE_MEMORY
-%token <i> PARSEOP_ADDRESSTYPE_NVS
-%token <i> PARSEOP_ADDRESSTYPE_RESERVED
-%token <i> PARSEOP_ALIAS
-%token <i> PARSEOP_AND
-%token <i> PARSEOP_ARG0
-%token <i> PARSEOP_ARG1
-%token <i> PARSEOP_ARG2
-%token <i> PARSEOP_ARG3
-%token <i> PARSEOP_ARG4
-%token <i> PARSEOP_ARG5
-%token <i> PARSEOP_ARG6
-%token <i> PARSEOP_BANKFIELD
-%token <i> PARSEOP_BITSPERBYTE_EIGHT
-%token <i> PARSEOP_BITSPERBYTE_FIVE
-%token <i> PARSEOP_BITSPERBYTE_NINE
-%token <i> PARSEOP_BITSPERBYTE_SEVEN
-%token <i> PARSEOP_BITSPERBYTE_SIX
-%token <i> PARSEOP_BREAK
-%token <i> PARSEOP_BREAKPOINT
-%token <i> PARSEOP_BUFFER
-%token <i> PARSEOP_BUSMASTERTYPE_MASTER
-%token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
-%token <i> PARSEOP_BYTECONST
-%token <i> PARSEOP_CASE
-%token <i> PARSEOP_CLOCKPHASE_FIRST
-%token <i> PARSEOP_CLOCKPHASE_SECOND
-%token <i> PARSEOP_CLOCKPOLARITY_HIGH
-%token <i> PARSEOP_CLOCKPOLARITY_LOW
-%token <i> PARSEOP_CONCATENATE
-%token <i> PARSEOP_CONCATENATERESTEMPLATE
-%token <i> PARSEOP_CONDREFOF
-%token <i> PARSEOP_CONNECTION
-%token <i> PARSEOP_CONTINUE
-%token <i> PARSEOP_COPYOBJECT
-%token <i> PARSEOP_CREATEBITFIELD
-%token <i> PARSEOP_CREATEBYTEFIELD
-%token <i> PARSEOP_CREATEDWORDFIELD
-%token <i> PARSEOP_CREATEFIELD
-%token <i> PARSEOP_CREATEQWORDFIELD
-%token <i> PARSEOP_CREATEWORDFIELD
-%token <i> PARSEOP_DATABUFFER
-%token <i> PARSEOP_DATATABLEREGION
-%token <i> PARSEOP_DEBUG
-%token <i> PARSEOP_DECODETYPE_POS
-%token <i> PARSEOP_DECODETYPE_SUB
-%token <i> PARSEOP_DECREMENT
-%token <i> PARSEOP_DEFAULT
-%token <i> PARSEOP_DEFAULT_ARG
-%token <i> PARSEOP_DEFINITIONBLOCK
-%token <i> PARSEOP_DEREFOF
-%token <i> PARSEOP_DEVICE
-%token <i> PARSEOP_DEVICEPOLARITY_HIGH
-%token <i> PARSEOP_DEVICEPOLARITY_LOW
-%token <i> PARSEOP_DIVIDE
-%token <i> PARSEOP_DMA
-%token <i> PARSEOP_DMATYPE_A
-%token <i> PARSEOP_DMATYPE_COMPATIBILITY
-%token <i> PARSEOP_DMATYPE_B
-%token <i> PARSEOP_DMATYPE_F
-%token <i> PARSEOP_DWORDCONST
-%token <i> PARSEOP_DWORDIO
-%token <i> PARSEOP_DWORDMEMORY
-%token <i> PARSEOP_DWORDSPACE
-%token <i> PARSEOP_EISAID
-%token <i> PARSEOP_ELSE
-%token <i> PARSEOP_ELSEIF
-%token <i> PARSEOP_ENDDEPENDENTFN
-%token <i> PARSEOP_ENDIAN_BIG
-%token <i> PARSEOP_ENDIAN_LITTLE
-%token <i> PARSEOP_ENDTAG
-%token <i> PARSEOP_ERRORNODE
-%token <i> PARSEOP_EVENT
-%token <i> PARSEOP_EXTENDEDIO
-%token <i> PARSEOP_EXTENDEDMEMORY
-%token <i> PARSEOP_EXTENDEDSPACE
-%token <i> PARSEOP_EXTERNAL
-%token <i> PARSEOP_FATAL
-%token <i> PARSEOP_FIELD
-%token <i> PARSEOP_FINDSETLEFTBIT
-%token <i> PARSEOP_FINDSETRIGHTBIT
-%token <i> PARSEOP_FIXEDDMA
-%token <i> PARSEOP_FIXEDIO
-%token <i> PARSEOP_FLOWCONTROL_HW
-%token <i> PARSEOP_FLOWCONTROL_NONE
-%token <i> PARSEOP_FLOWCONTROL_SW
-%token <i> PARSEOP_FROMBCD
-%token <i> PARSEOP_FUNCTION
-%token <i> PARSEOP_GPIO_INT
-%token <i> PARSEOP_GPIO_IO
-%token <i> PARSEOP_I2C_SERIALBUS
-%token <i> PARSEOP_IF
-%token <i> PARSEOP_INCLUDE
-%token <i> PARSEOP_INCLUDE_END
-%token <i> PARSEOP_INCREMENT
-%token <i> PARSEOP_INDEX
-%token <i> PARSEOP_INDEXFIELD
-%token <i> PARSEOP_INTEGER
-%token <i> PARSEOP_INTERRUPT
-%token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
-%token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
-%token <i> PARSEOP_INTLEVEL_ACTIVELOW
-%token <i> PARSEOP_INTTYPE_EDGE
-%token <i> PARSEOP_INTTYPE_LEVEL
-%token <i> PARSEOP_IO
-%token <i> PARSEOP_IODECODETYPE_10
-%token <i> PARSEOP_IODECODETYPE_16
-%token <i> PARSEOP_IORESTRICT_IN
-%token <i> PARSEOP_IORESTRICT_NONE
-%token <i> PARSEOP_IORESTRICT_OUT
-%token <i> PARSEOP_IORESTRICT_PRESERVE
-%token <i> PARSEOP_IRQ
-%token <i> PARSEOP_IRQNOFLAGS
-%token <i> PARSEOP_LAND
-%token <i> PARSEOP_LEQUAL
-%token <i> PARSEOP_LGREATER
-%token <i> PARSEOP_LGREATEREQUAL
-%token <i> PARSEOP_LLESS
-%token <i> PARSEOP_LLESSEQUAL
-%token <i> PARSEOP_LNOT
-%token <i> PARSEOP_LNOTEQUAL
-%token <i> PARSEOP_LOAD
-%token <i> PARSEOP_LOADTABLE
-%token <i> PARSEOP_LOCAL0
-%token <i> PARSEOP_LOCAL1
-%token <i> PARSEOP_LOCAL2
-%token <i> PARSEOP_LOCAL3
-%token <i> PARSEOP_LOCAL4
-%token <i> PARSEOP_LOCAL5
-%token <i> PARSEOP_LOCAL6
-%token <i> PARSEOP_LOCAL7
-%token <i> PARSEOP_LOCKRULE_LOCK
-%token <i> PARSEOP_LOCKRULE_NOLOCK
-%token <i> PARSEOP_LOR
-%token <i> PARSEOP_MATCH
-%token <i> PARSEOP_MATCHTYPE_MEQ
-%token <i> PARSEOP_MATCHTYPE_MGE
-%token <i> PARSEOP_MATCHTYPE_MGT
-%token <i> PARSEOP_MATCHTYPE_MLE
-%token <i> PARSEOP_MATCHTYPE_MLT
-%token <i> PARSEOP_MATCHTYPE_MTR
-%token <i> PARSEOP_MAXTYPE_FIXED
-%token <i> PARSEOP_MAXTYPE_NOTFIXED
-%token <i> PARSEOP_MEMORY24
-%token <i> PARSEOP_MEMORY32
-%token <i> PARSEOP_MEMORY32FIXED
-%token <i> PARSEOP_MEMTYPE_CACHEABLE
-%token <i> PARSEOP_MEMTYPE_NONCACHEABLE
-%token <i> PARSEOP_MEMTYPE_PREFETCHABLE
-%token <i> PARSEOP_MEMTYPE_WRITECOMBINING
-%token <i> PARSEOP_METHOD
-%token <i> PARSEOP_METHODCALL
-%token <i> PARSEOP_MID
-%token <i> PARSEOP_MINTYPE_FIXED
-%token <i> PARSEOP_MINTYPE_NOTFIXED
-%token <i> PARSEOP_MOD
-%token <i> PARSEOP_MULTIPLY
-%token <i> PARSEOP_MUTEX
-%token <i> PARSEOP_NAME
-%token <s> PARSEOP_NAMESEG
-%token <s> PARSEOP_NAMESTRING
-%token <i> PARSEOP_NAND
-%token <i> PARSEOP_NOOP
-%token <i> PARSEOP_NOR
-%token <i> PARSEOP_NOT
-%token <i> PARSEOP_NOTIFY
-%token <i> PARSEOP_OBJECTTYPE
-%token <i> PARSEOP_OBJECTTYPE_BFF
-%token <i> PARSEOP_OBJECTTYPE_BUF
-%token <i> PARSEOP_OBJECTTYPE_DDB
-%token <i> PARSEOP_OBJECTTYPE_DEV
-%token <i> PARSEOP_OBJECTTYPE_EVT
-%token <i> PARSEOP_OBJECTTYPE_FLD
-%token <i> PARSEOP_OBJECTTYPE_INT
-%token <i> PARSEOP_OBJECTTYPE_MTH
-%token <i> PARSEOP_OBJECTTYPE_MTX
-%token <i> PARSEOP_OBJECTTYPE_OPR
-%token <i> PARSEOP_OBJECTTYPE_PKG
-%token <i> PARSEOP_OBJECTTYPE_POW
-%token <i> PARSEOP_OBJECTTYPE_PRO
-%token <i> PARSEOP_OBJECTTYPE_STR
-%token <i> PARSEOP_OBJECTTYPE_THZ
-%token <i> PARSEOP_OBJECTTYPE_UNK
-%token <i> PARSEOP_OFFSET
-%token <i> PARSEOP_ONE
-%token <i> PARSEOP_ONES
-%token <i> PARSEOP_OPERATIONREGION
-%token <i> PARSEOP_OR
-%token <i> PARSEOP_PACKAGE
-%token <i> PARSEOP_PACKAGE_LENGTH
-%token <i> PARSEOP_PARITYTYPE_EVEN
-%token <i> PARSEOP_PARITYTYPE_MARK
-%token <i> PARSEOP_PARITYTYPE_NONE
-%token <i> PARSEOP_PARITYTYPE_ODD
-%token <i> PARSEOP_PARITYTYPE_SPACE
-%token <i> PARSEOP_PIN_NOPULL
-%token <i> PARSEOP_PIN_PULLDEFAULT
-%token <i> PARSEOP_PIN_PULLDOWN
-%token <i> PARSEOP_PIN_PULLUP
-%token <i> PARSEOP_POWERRESOURCE
-%token <i> PARSEOP_PROCESSOR
-%token <i> PARSEOP_QWORDCONST
-%token <i> PARSEOP_QWORDIO
-%token <i> PARSEOP_QWORDMEMORY
-%token <i> PARSEOP_QWORDSPACE
-%token <i> PARSEOP_RANGETYPE_ENTIRE
-%token <i> PARSEOP_RANGETYPE_ISAONLY
-%token <i> PARSEOP_RANGETYPE_NONISAONLY
-%token <i> PARSEOP_RAW_DATA
-%token <i> PARSEOP_READWRITETYPE_BOTH
-%token <i> PARSEOP_READWRITETYPE_READONLY
-%token <i> PARSEOP_REFOF
-%token <i> PARSEOP_REGIONSPACE_CMOS
-%token <i> PARSEOP_REGIONSPACE_EC
-%token <i> PARSEOP_REGIONSPACE_FFIXEDHW
-%token <i> PARSEOP_REGIONSPACE_GPIO
-%token <i> PARSEOP_REGIONSPACE_GSBUS
-%token <i> PARSEOP_REGIONSPACE_IO
-%token <i> PARSEOP_REGIONSPACE_IPMI
-%token <i> PARSEOP_REGIONSPACE_MEM
-%token <i> PARSEOP_REGIONSPACE_PCC
-%token <i> PARSEOP_REGIONSPACE_PCI
-%token <i> PARSEOP_REGIONSPACE_PCIBAR
-%token <i> PARSEOP_REGIONSPACE_SMBUS
-%token <i> PARSEOP_REGISTER
-%token <i> PARSEOP_RELEASE
-%token <i> PARSEOP_RESERVED_BYTES
-%token <i> PARSEOP_RESET
-%token <i> PARSEOP_RESOURCETEMPLATE
-%token <i> PARSEOP_RESOURCETYPE_CONSUMER
-%token <i> PARSEOP_RESOURCETYPE_PRODUCER
-%token <i> PARSEOP_RETURN
-%token <i> PARSEOP_REVISION
-%token <i> PARSEOP_SCOPE
-%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
-%token <i> PARSEOP_SERIALIZERULE_SERIAL
-%token <i> PARSEOP_SHARETYPE_EXCLUSIVE
-%token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
-%token <i> PARSEOP_SHARETYPE_SHARED
-%token <i> PARSEOP_SHARETYPE_SHAREDWAKE
-%token <i> PARSEOP_SHIFTLEFT
-%token <i> PARSEOP_SHIFTRIGHT
-%token <i> PARSEOP_SIGNAL
-%token <i> PARSEOP_SIZEOF
-%token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
-%token <i> PARSEOP_SLAVEMODE_DEVICEINIT
-%token <i> PARSEOP_SLEEP
-%token <i> PARSEOP_SPI_SERIALBUS
-%token <i> PARSEOP_STALL
-%token <i> PARSEOP_STARTDEPENDENTFN
-%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
-%token <i> PARSEOP_STOPBITS_ONE
-%token <i> PARSEOP_STOPBITS_ONEPLUSHALF
-%token <i> PARSEOP_STOPBITS_TWO
-%token <i> PARSEOP_STOPBITS_ZERO
-%token <i> PARSEOP_STORE
-%token <s> PARSEOP_STRING_LITERAL
-%token <i> PARSEOP_SUBTRACT
-%token <i> PARSEOP_SWITCH
-%token <i> PARSEOP_THERMALZONE
-%token <i> PARSEOP_TIMER
-%token <i> PARSEOP_TOBCD
-%token <i> PARSEOP_TOBUFFER
-%token <i> PARSEOP_TODECIMALSTRING
-%token <i> PARSEOP_TOHEXSTRING
-%token <i> PARSEOP_TOINTEGER
-%token <i> PARSEOP_TOSTRING
-%token <i> PARSEOP_TOUUID
-%token <i> PARSEOP_TRANSLATIONTYPE_DENSE
-%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
-%token <i> PARSEOP_TYPE_STATIC
-%token <i> PARSEOP_TYPE_TRANSLATION
-%token <i> PARSEOP_UART_SERIALBUS
-%token <i> PARSEOP_UNICODE
-%token <i> PARSEOP_UNLOAD
-%token <i> PARSEOP_UPDATERULE_ONES
-%token <i> PARSEOP_UPDATERULE_PRESERVE
-%token <i> PARSEOP_UPDATERULE_ZEROS
-%token <i> PARSEOP_VAR_PACKAGE
-%token <i> PARSEOP_VENDORLONG
-%token <i> PARSEOP_VENDORSHORT
-%token <i> PARSEOP_WAIT
-%token <i> PARSEOP_WHILE
-%token <i> PARSEOP_WIREMODE_FOUR
-%token <i> PARSEOP_WIREMODE_THREE
-%token <i> PARSEOP_WORDBUSNUMBER
-%token <i> PARSEOP_WORDCONST
-%token <i> PARSEOP_WORDIO
-%token <i> PARSEOP_WORDSPACE
-%token <i> PARSEOP_XFERSIZE_8
-%token <i> PARSEOP_XFERSIZE_16
-%token <i> PARSEOP_XFERSIZE_32
-%token <i> PARSEOP_XFERSIZE_64
-%token <i> PARSEOP_XFERSIZE_128
-%token <i> PARSEOP_XFERSIZE_256
-%token <i> PARSEOP_XFERTYPE_8
-%token <i> PARSEOP_XFERTYPE_8_16
-%token <i> PARSEOP_XFERTYPE_16
-%token <i> PARSEOP_XOR
-%token <i> PARSEOP_ZERO
-
-/*
- * Special functions. These should probably stay at the end of this
- * table.
- */
-%token <i> PARSEOP___DATE__
-%token <i> PARSEOP___FILE__
-%token <i> PARSEOP___LINE__
-%token <i> PARSEOP___PATH__
-
-
-/******************************************************************************
- *
- * Production names
- *
- *****************************************************************************/
-
-%type <n> ArgList
-%type <n> ASLCode
-%type <n> BufferData
-%type <n> BufferTermData
-%type <n> CompilerDirective
-%type <n> DataObject
-%type <n> DefinitionBlockTerm
-%type <n> IntegerData
-%type <n> NamedObject
-%type <n> NameSpaceModifier
-%type <n> Object
-%type <n> ObjectList
-%type <n> PackageData
-%type <n> ParameterTypePackage
-%type <n> ParameterTypePackageList
-%type <n> ParameterTypesPackage
-%type <n> ParameterTypesPackageList
-%type <n> RequiredTarget
-%type <n> SimpleTarget
-%type <n> StringData
-%type <n> Target
-%type <n> Term
-%type <n> TermArg
-%type <n> TermList
-%type <n> UserTerm
-
-/* Type4Opcode is obsolete */
-
-%type <n> Type1Opcode
-%type <n> Type2BufferOpcode
-%type <n> Type2BufferOrStringOpcode
-%type <n> Type2IntegerOpcode
-%type <n> Type2Opcode
-%type <n> Type2StringOpcode
-%type <n> Type3Opcode
-%type <n> Type5Opcode
-%type <n> Type6Opcode
-
-%type <n> AccessAsTerm
-%type <n> ExternalTerm
-%type <n> FieldUnit
-%type <n> FieldUnitEntry
-%type <n> FieldUnitList
-%type <n> IncludeTerm
-%type <n> OffsetTerm
-%type <n> OptionalAccessAttribTerm
-
-/* Named Objects */
-
-%type <n> BankFieldTerm
-%type <n> CreateBitFieldTerm
-%type <n> CreateByteFieldTerm
-%type <n> CreateDWordFieldTerm
-%type <n> CreateFieldTerm
-%type <n> CreateQWordFieldTerm
-%type <n> CreateWordFieldTerm
-%type <n> DataRegionTerm
-%type <n> DeviceTerm
-%type <n> EventTerm
-%type <n> FieldTerm
-%type <n> FunctionTerm
-%type <n> IndexFieldTerm
-%type <n> MethodTerm
-%type <n> MutexTerm
-%type <n> OpRegionTerm
-%type <n> OpRegionSpaceIdTerm
-%type <n> PowerResTerm
-%type <n> ProcessorTerm
-%type <n> ThermalZoneTerm
-
-/* Namespace modifiers */
-
-%type <n> AliasTerm
-%type <n> NameTerm
-%type <n> ScopeTerm
-
-/* Type 1 opcodes */
-
-%type <n> BreakPointTerm
-%type <n> BreakTerm
-%type <n> CaseDefaultTermList
-%type <n> CaseTerm
-%type <n> ContinueTerm
-%type <n> DefaultTerm
-%type <n> ElseTerm
-%type <n> FatalTerm
-%type <n> IfElseTerm
-%type <n> IfTerm
-%type <n> LoadTerm
-%type <n> NoOpTerm
-%type <n> NotifyTerm
-%type <n> ReleaseTerm
-%type <n> ResetTerm
-%type <n> ReturnTerm
-%type <n> SignalTerm
-%type <n> SleepTerm
-%type <n> StallTerm
-%type <n> SwitchTerm
-%type <n> UnloadTerm
-%type <n> WhileTerm
-/* %type <n> CaseTermList */
-
-/* Type 2 opcodes */
-
-%type <n> AcquireTerm
-%type <n> AddTerm
-%type <n> AndTerm
-%type <n> ConcatResTerm
-%type <n> ConcatTerm
-%type <n> CondRefOfTerm
-%type <n> CopyObjectTerm
-%type <n> DecTerm
-%type <n> DerefOfTerm
-%type <n> DivideTerm
-%type <n> FindSetLeftBitTerm
-%type <n> FindSetRightBitTerm
-%type <n> FromBCDTerm
-%type <n> IncTerm
-%type <n> IndexTerm
-%type <n> LAndTerm
-%type <n> LEqualTerm
-%type <n> LGreaterEqualTerm
-%type <n> LGreaterTerm
-%type <n> LLessEqualTerm
-%type <n> LLessTerm
-%type <n> LNotEqualTerm
-%type <n> LNotTerm
-%type <n> LoadTableTerm
-%type <n> LOrTerm
-%type <n> MatchTerm
-%type <n> MidTerm
-%type <n> ModTerm
-%type <n> MultiplyTerm
-%type <n> NAndTerm
-%type <n> NOrTerm
-%type <n> NotTerm
-%type <n> ObjectTypeTerm
-%type <n> OrTerm
-%type <n> RefOfTerm
-%type <n> ShiftLeftTerm
-%type <n> ShiftRightTerm
-%type <n> SizeOfTerm
-%type <n> StoreTerm
-%type <n> SubtractTerm
-%type <n> TimerTerm
-%type <n> ToBCDTerm
-%type <n> ToBufferTerm
-%type <n> ToDecimalStringTerm
-%type <n> ToHexStringTerm
-%type <n> ToIntegerTerm
-%type <n> ToStringTerm
-%type <n> WaitTerm
-%type <n> XOrTerm
-
-/* Keywords */
-
-%type <n> AccessAttribKeyword
-%type <n> AccessTypeKeyword
-%type <n> AddressingModeKeyword
-%type <n> AddressKeyword
-%type <n> AddressSpaceKeyword
-%type <n> BitsPerByteKeyword
-%type <n> ClockPhaseKeyword
-%type <n> ClockPolarityKeyword
-%type <n> DecodeKeyword
-%type <n> DevicePolarityKeyword
-%type <n> DMATypeKeyword
-%type <n> EndianKeyword
-%type <n> FlowControlKeyword
-%type <n> InterruptLevel
-%type <n> InterruptTypeKeyword
-%type <n> IODecodeKeyword
-%type <n> IoRestrictionKeyword
-%type <n> LockRuleKeyword
-%type <n> MatchOpKeyword
-%type <n> MaxKeyword
-%type <n> MemTypeKeyword
-%type <n> MinKeyword
-%type <n> ObjectTypeKeyword
-%type <n> OptionalBusMasterKeyword
-%type <n> OptionalReadWriteKeyword
-%type <n> ParityTypeKeyword
-%type <n> PinConfigByte
-%type <n> PinConfigKeyword
-%type <n> RangeTypeKeyword
-%type <n> RegionSpaceKeyword
-%type <n> ResourceTypeKeyword
-%type <n> SerializeRuleKeyword
-%type <n> ShareTypeKeyword
-%type <n> SlaveModeKeyword
-%type <n> StopBitsKeyword
-%type <n> TranslationKeyword
-%type <n> TypeKeyword
-%type <n> UpdateRuleKeyword
-%type <n> WireModeKeyword
-%type <n> XferSizeKeyword
-%type <n> XferTypeKeyword
-
-/* Types */
-
-%type <n> SuperName
-%type <n> ObjectTypeName
-%type <n> ArgTerm
-%type <n> LocalTerm
-%type <n> DebugTerm
-
-%type <n> Integer
-%type <n> ByteConst
-%type <n> WordConst
-%type <n> DWordConst
-%type <n> QWordConst
-%type <n> String
-
-%type <n> ConstTerm
-%type <n> ConstExprTerm
-%type <n> ByteConstExpr
-%type <n> WordConstExpr
-%type <n> DWordConstExpr
-%type <n> QWordConstExpr
-
-%type <n> DWordList
-%type <n> BufferTerm
-%type <n> ByteList
-
-%type <n> PackageElement
-%type <n> PackageList
-%type <n> PackageTerm
-%type <n> VarPackageLengthTerm
-
-/* Macros */
-
-%type <n> EISAIDTerm
-%type <n> ResourceMacroList
-%type <n> ResourceMacroTerm
-%type <n> ResourceTemplateTerm
-%type <n> ToUUIDTerm
-%type <n> UnicodeTerm
-
-/* Resource Descriptors */
-
-%type <n> ConnectionTerm
-%type <n> DataBufferTerm
-%type <n> DMATerm
-%type <n> DWordIOTerm
-%type <n> DWordMemoryTerm
-%type <n> DWordSpaceTerm
-%type <n> EndDependentFnTerm
-%type <n> ExtendedIOTerm
-%type <n> ExtendedMemoryTerm
-%type <n> ExtendedSpaceTerm
-%type <n> FixedDmaTerm
-%type <n> FixedIOTerm
-%type <n> GpioIntTerm
-%type <n> GpioIoTerm
-%type <n> I2cSerialBusTerm
-%type <n> InterruptTerm
-%type <n> IOTerm
-%type <n> IRQNoFlagsTerm
-%type <n> IRQTerm
-%type <n> Memory24Term
-%type <n> Memory32FixedTerm
-%type <n> Memory32Term
-%type <n> NameSeg
-%type <n> NameString
-%type <n> QWordIOTerm
-%type <n> QWordMemoryTerm
-%type <n> QWordSpaceTerm
-%type <n> RegisterTerm
-%type <n> SpiSerialBusTerm
-%type <n> StartDependentFnNoPriTerm
-%type <n> StartDependentFnTerm
-%type <n> UartSerialBusTerm
-%type <n> VendorLongTerm
-%type <n> VendorShortTerm
-%type <n> WordBusNumberTerm
-%type <n> WordIOTerm
-%type <n> WordSpaceTerm
-
-/* Local types that help construct the AML, not in ACPI spec */
-
-%type <n> AmlPackageLengthTerm
-%type <n> IncludeEndTerm
-%type <n> NameStringItem
-%type <n> TermArgItem
-
-%type <n> OptionalAccessSize
-%type <n> OptionalAddressingMode
-%type <n> OptionalAddressRange
-%type <n> OptionalBitsPerByte
-%type <n> OptionalBuffer_Last
-%type <n> OptionalByteConstExpr
-%type <n> OptionalCount
-%type <n> OptionalDecodeType
-%type <n> OptionalDevicePolarity
-%type <n> OptionalDWordConstExpr
-%type <n> OptionalEndian
-%type <n> OptionalFlowControl
-%type <n> OptionalIoRestriction
-%type <n> OptionalListString
-%type <n> OptionalMaxType
-%type <n> OptionalMemType
-%type <n> OptionalMinType
-%type <n> OptionalNameString
-%type <n> OptionalNameString_First
-%type <n> OptionalNameString_Last
-%type <n> OptionalObjectTypeKeyword
-%type <n> OptionalParameterTypePackage
-%type <n> OptionalParameterTypesPackage
-%type <n> OptionalParityType
-%type <n> OptionalQWordConstExpr
-%type <n> OptionalRangeType
-%type <n> OptionalReference
-%type <n> OptionalResourceType
-%type <n> OptionalResourceType_First
-%type <n> OptionalReturnArg
-%type <n> OptionalSerializeRuleKeyword
-%type <n> OptionalShareType
-%type <n> OptionalShareType_First
-%type <n> OptionalSlaveMode
-%type <n> OptionalStopBits
-%type <n> OptionalStringData
-%type <n> OptionalTermArg
-%type <n> OptionalTranslationType_Last
-%type <n> OptionalType
-%type <n> OptionalType_Last
-%type <n> OptionalWireMode
-%type <n> OptionalWordConst
-%type <n> OptionalWordConstExpr
-%type <n> OptionalXferSize
-
-%%
/*******************************************************************************
*
* Production rules start here
@@ -799,10 +52,7 @@ void * AslLocalAllocate (unsigned int Size);
/*
* ASL Names
- */
-
-
-/*
+ *
* Root rule. Allow multiple #line directives before the definition block
* to handle output from preprocessors
*/
@@ -3511,77 +2761,3 @@ OptionalXferSize
| ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
| ',' XferSizeKeyword {$$ = $2;}
;
-
-%%
-/******************************************************************************
- *
- * Local support functions
- *
- *****************************************************************************/
-
-int
-AslCompilerwrap(void)
-{
- return (1);
-}
-
-/*! [End] no source code translation !*/
-
-void *
-AslLocalAllocate (unsigned int Size)
-{
- void *Mem;
-
-
- DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
-
- Mem = ACPI_ALLOCATE_ZEROED (Size);
- if (!Mem)
- {
- AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_InputByteCount, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
- exit (1);
- }
-
- return (Mem);
-}
-
-ACPI_PARSE_OBJECT *
-AslDoError (void)
-{
-
-
- return (TrCreateLeafNode (PARSEOP_ERRORNODE));
-
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: UtGetOpName
- *
- * PARAMETERS: ParseOpcode - Parser keyword ID
- *
- * RETURN: Pointer to the opcode name
- *
- * DESCRIPTION: Get the ascii name of the parse opcode
- *
- ******************************************************************************/
-
-char *
-UtGetOpName (
- UINT32 ParseOpcode)
-{
-#ifdef ASL_YYTNAME_START
- /*
- * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
- * Ignore first 8 characters of the name
- */
- return ((char *) yytname
- [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
-#else
- return ("[Unknown parser generator]");
-#endif
-}
diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c
index e50b103..56603be 100644
--- a/sys/contrib/dev/acpica/compiler/aslstartup.c
+++ b/sys/contrib/dev/acpica/compiler/aslstartup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/actables.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -51,18 +50,8 @@
ACPI_MODULE_NAME ("aslstartup")
-#define ASL_MAX_FILES 256
-static char *FileList[ASL_MAX_FILES];
-static BOOLEAN AslToFile = TRUE;
-
-
/* Local prototypes */
-static char **
-AsDoWildcard (
- char *DirectoryPathname,
- char *FileSpecifier);
-
static UINT8
AslDetectSourceFileType (
ASL_FILE_INFO *Info);
@@ -72,6 +61,11 @@ AslDoDisassembly (
void);
+/* Globals */
+
+static BOOLEAN AslToFile = TRUE;
+
+
/*******************************************************************************
*
* FUNCTION: AslInitializeGlobals
@@ -131,82 +125,6 @@ AslInitializeGlobals (
}
-/******************************************************************************
- *
- * FUNCTION: AsDoWildcard
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Process files via wildcards. This function is for the Windows
- * case only.
- *
- ******************************************************************************/
-
-static char **
-AsDoWildcard (
- char *DirectoryPathname,
- char *FileSpecifier)
-{
-#ifdef WIN32
- void *DirInfo;
- char *Filename;
- int FileCount;
-
-
- FileCount = 0;
-
- /* Open parent directory */
-
- DirInfo = AcpiOsOpenDirectory (DirectoryPathname, FileSpecifier, REQUEST_FILE_ONLY);
- if (!DirInfo)
- {
- /* Either the directory of file does not exist */
-
- Gbl_Files[ASL_FILE_INPUT].Filename = FileSpecifier;
- FlFileError (ASL_FILE_INPUT, ASL_MSG_OPEN);
- AslAbort ();
- }
-
- /* Process each file that matches the wildcard specification */
-
- while ((Filename = AcpiOsGetNextFilename (DirInfo)))
- {
- /* Add the filename to the file list */
-
- FileList[FileCount] = AcpiOsAllocate (strlen (Filename) + 1);
- strcpy (FileList[FileCount], Filename);
- FileCount++;
-
- if (FileCount >= ASL_MAX_FILES)
- {
- printf ("Max files reached\n");
- FileList[0] = NULL;
- return (FileList);
- }
- }
-
- /* Cleanup */
-
- AcpiOsCloseDirectory (DirInfo);
- FileList[FileCount] = NULL;
- return (FileList);
-
-#else
- /*
- * Linux/Unix cases - Wildcards are expanded by the shell automatically.
- * Just return the filename in a null terminated list
- */
- FileList[0] = AcpiOsAllocate (strlen (FileSpecifier) + 1);
- strcpy (FileList[0], FileSpecifier);
- FileList[1] = NULL;
-
- return (FileList);
-#endif
-}
-
-
/*******************************************************************************
*
* FUNCTION: AslDetectSourceFileType
@@ -332,7 +250,7 @@ AslDoDisassembly (
AcpiGbl_DbOpt_disasm = TRUE;
Status = AdAmlDisassemble (AslToFile,
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix,
- &Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_GetAllTables);
+ &Gbl_Files[ASL_FILE_INPUT].Filename);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -365,8 +283,11 @@ AslDoDisassembly (
return (AE_CTRL_CONTINUE);
}
- ACPI_FREE (Gbl_Files[ASL_FILE_INPUT].Filename);
+ /* No need to free the filename string */
+
Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
+
+ CmDeleteCaches ();
return (AE_OK);
}
@@ -395,12 +316,29 @@ AslDoOneFile (
AslInitializeGlobals ();
PrInitializeGlobals ();
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
+ /*
+ * Extract the directory path. This path is used for possible include
+ * files and the optional AML filename embedded in the input file
+ * DefinitionBlock declaration.
+ */
+ Status = FlSplitInputPathname (Filename, &Gbl_DirectoryPath, NULL);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Take a copy of the input filename, convert any backslashes */
+
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+ UtConvertBackslashes (Gbl_Files[ASL_FILE_INPUT].Filename);
/*
* AML Disassembly (Optional)
*/
- if (Gbl_DisasmFlag || Gbl_GetAllTables)
+ if (Gbl_DisasmFlag)
{
Status = AslDoDisassembly ();
if (Status != AE_CTRL_CONTINUE)
@@ -465,7 +403,6 @@ AslDoOneFile (
if (Gbl_Signature)
{
- ACPI_FREE (Gbl_Signature);
Gbl_Signature = NULL;
}
@@ -543,77 +480,6 @@ AslDoOneFile (
/*******************************************************************************
*
- * FUNCTION: AslDoOnePathname
- *
- * PARAMETERS: Pathname - Full pathname, possibly with wildcards
- *
- * RETURN: Status
- *
- * DESCRIPTION: Process one pathname, possible terminated with a wildcard
- * specification. If a wildcard, it is expanded and the multiple
- * files are processed.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AslDoOnePathname (
- char *Pathname,
- ASL_PATHNAME_CALLBACK PathCallback)
-{
- ACPI_STATUS Status = AE_OK;
- char **WildcardList;
- char *Filename;
- char *FullPathname;
-
-
- /* Split incoming path into a directory/filename combo */
-
- Status = FlSplitInputPathname (Pathname, &Gbl_DirectoryPath, &Filename);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- /* Expand possible wildcard into a file list (Windows/DOS only) */
-
- WildcardList = AsDoWildcard (Gbl_DirectoryPath, Filename);
- while (*WildcardList)
- {
- FullPathname = ACPI_ALLOCATE (
- strlen (Gbl_DirectoryPath) + strlen (*WildcardList) + 1);
-
- /* Construct a full path to the file */
-
- strcpy (FullPathname, Gbl_DirectoryPath);
- strcat (FullPathname, *WildcardList);
-
- /*
- * If -p not specified, we will use the input filename as the
- * output filename prefix
- */
- if (Gbl_UseDefaultAmlFilename)
- {
- Gbl_OutputFilenamePrefix = FullPathname;
- }
-
- /* Save status from all compiles */
-
- Status |= (*PathCallback) (FullPathname);
-
- ACPI_FREE (FullPathname);
- ACPI_FREE (*WildcardList);
- *WildcardList = NULL;
- WildcardList++;
- }
-
- ACPI_FREE (Gbl_DirectoryPath);
- ACPI_FREE (Filename);
- return (Status);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AslCheckForErrorExit
*
* PARAMETERS: None. Examines global exception count array
diff --git a/sys/contrib/dev/acpica/compiler/aslstubs.c b/sys/contrib/dev/acpica/compiler/aslstubs.c
index 9ac9698..ff05d9a 100644
--- a/sys/contrib/dev/acpica/compiler/aslstubs.c
+++ b/sys/contrib/dev/acpica/compiler/aslstubs.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -53,17 +53,10 @@
/*
- * Stubs to simplify linkage to the ACPI CA core subsystem.
+ * Stubs to simplify linkage to the ACPICA core subsystem.
* Things like Events, Global Lock, etc. are not used
* by the compiler, so they are stubbed out here.
*/
-ACPI_PHYSICAL_ADDRESS
-AeLocalGetRootPointer (
- void)
-{
- return (0);
-}
-
void
AcpiNsExecModuleCodeList (
void)
@@ -232,21 +225,3 @@ AcpiTbFindTable (
{
return (AE_SUPPORT);
}
-
-/* OSL interfaces */
-
-ACPI_THREAD_ID
-AcpiOsGetThreadId (
- void)
-{
- return (0xFFFF);
-}
-
-ACPI_STATUS
-AcpiOsExecute (
- ACPI_EXECUTE_TYPE Type,
- ACPI_OSD_EXEC_CALLBACK Function,
- void *Context)
-{
- return (AE_SUPPORT);
-}
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.l b/sys/contrib/dev/acpica/compiler/aslsupport.l
index e7d2b1f..7ea43a0 100644
--- a/sys/contrib/dev/acpica/compiler/aslsupport.l
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
/* Configuration */
#define ASL_SPACES_PER_TAB 4
@@ -70,6 +69,15 @@ typedef struct asl_file_node
ASL_FILE_NODE *Gbl_IncludeFileStack = NULL;
+void
+AslParserCleanup (
+ void)
+{
+
+ yy_delete_buffer (YY_CURRENT_BUFFER);
+}
+
+
/*******************************************************************************
*
* FUNCTION: AslDoLineDirective
@@ -259,7 +267,11 @@ AslPushInputFileStack (
/* Reset the global line count and filename */
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+
Gbl_CurrentLineNumber = 1;
yyin = InputFile;
}
@@ -797,7 +809,7 @@ CompletedString:
*/
*StringBuffer = 0;
- CleanString = UtGetStringBuffer (strlen (MsgBuffer) + 1);
+ CleanString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
if (!CleanString)
{
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.y b/sys/contrib/dev/acpica/compiler/aslsupport.y
new file mode 100644
index 0000000..dfeca6e
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.y
@@ -0,0 +1,120 @@
+NoEcho('
+/******************************************************************************
+ *
+ * Module Name: aslsupport.y - Bison/Yacc C support functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+')
+
+/******************************************************************************
+ *
+ * Local support functions
+ *
+ *****************************************************************************/
+
+/*! [Begin] no source code translation */
+int
+AslCompilerwrap(void)
+{
+ return (1);
+}
+/*! [End] no source code translation !*/
+
+
+void *
+AslLocalAllocate (
+ unsigned int Size)
+{
+ void *Mem;
+
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
+
+ Mem = ACPI_ALLOCATE_ZEROED (Size);
+ if (!Mem)
+ {
+ AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_InputByteCount, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ exit (1);
+ }
+
+ return (Mem);
+}
+
+ACPI_PARSE_OBJECT *
+AslDoError (
+ void)
+{
+
+ return (TrCreateLeafNode (PARSEOP_ERRORNODE));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: UtGetOpName
+ *
+ * PARAMETERS: ParseOpcode - Parser keyword ID
+ *
+ * RETURN: Pointer to the opcode name
+ *
+ * DESCRIPTION: Get the ascii name of the parse opcode
+ *
+ ******************************************************************************/
+
+char *
+UtGetOpName (
+ UINT32 ParseOpcode)
+{
+#ifdef ASL_YYTNAME_START
+ /*
+ * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
+ * Ignore first 8 characters of the name
+ */
+ return ((char *) yytname
+ [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
+#else
+ return ("[Unknown parser generator]");
+#endif
+}
diff --git a/sys/contrib/dev/acpica/compiler/asltokens.y b/sys/contrib/dev/acpica/compiler/asltokens.y
new file mode 100644
index 0000000..c296fea
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/asltokens.y
@@ -0,0 +1,386 @@
+NoEcho('
+/******************************************************************************
+ *
+ * Module Name: asltokens.y - Bison/Yacc token types
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+')
+
+/******************************************************************************
+ *
+ * Token types: These are returned by the lexer
+ *
+ * NOTE: This list MUST match the AslKeywordMapping table found
+ * in aslmap.c EXACTLY! Double check any changes!
+ *
+ *****************************************************************************/
+
+%token <i> PARSEOP_ACCESSAS
+%token <i> PARSEOP_ACCESSATTRIB_BLOCK
+%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
+%token <i> PARSEOP_ACCESSATTRIB_BYTE
+%token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
+%token <i> PARSEOP_ACCESSATTRIB_QUICK
+%token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
+%token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
+%token <i> PARSEOP_ACCESSATTRIB_SND_RCV
+%token <i> PARSEOP_ACCESSATTRIB_WORD
+%token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
+%token <i> PARSEOP_ACCESSTYPE_ANY
+%token <i> PARSEOP_ACCESSTYPE_BUF
+%token <i> PARSEOP_ACCESSTYPE_BYTE
+%token <i> PARSEOP_ACCESSTYPE_DWORD
+%token <i> PARSEOP_ACCESSTYPE_QWORD
+%token <i> PARSEOP_ACCESSTYPE_WORD
+%token <i> PARSEOP_ACQUIRE
+%token <i> PARSEOP_ADD
+%token <i> PARSEOP_ADDRESSINGMODE_7BIT
+%token <i> PARSEOP_ADDRESSINGMODE_10BIT
+%token <i> PARSEOP_ADDRESSTYPE_ACPI
+%token <i> PARSEOP_ADDRESSTYPE_MEMORY
+%token <i> PARSEOP_ADDRESSTYPE_NVS
+%token <i> PARSEOP_ADDRESSTYPE_RESERVED
+%token <i> PARSEOP_ALIAS
+%token <i> PARSEOP_AND
+%token <i> PARSEOP_ARG0
+%token <i> PARSEOP_ARG1
+%token <i> PARSEOP_ARG2
+%token <i> PARSEOP_ARG3
+%token <i> PARSEOP_ARG4
+%token <i> PARSEOP_ARG5
+%token <i> PARSEOP_ARG6
+%token <i> PARSEOP_BANKFIELD
+%token <i> PARSEOP_BITSPERBYTE_EIGHT
+%token <i> PARSEOP_BITSPERBYTE_FIVE
+%token <i> PARSEOP_BITSPERBYTE_NINE
+%token <i> PARSEOP_BITSPERBYTE_SEVEN
+%token <i> PARSEOP_BITSPERBYTE_SIX
+%token <i> PARSEOP_BREAK
+%token <i> PARSEOP_BREAKPOINT
+%token <i> PARSEOP_BUFFER
+%token <i> PARSEOP_BUSMASTERTYPE_MASTER
+%token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
+%token <i> PARSEOP_BYTECONST
+%token <i> PARSEOP_CASE
+%token <i> PARSEOP_CLOCKPHASE_FIRST
+%token <i> PARSEOP_CLOCKPHASE_SECOND
+%token <i> PARSEOP_CLOCKPOLARITY_HIGH
+%token <i> PARSEOP_CLOCKPOLARITY_LOW
+%token <i> PARSEOP_CONCATENATE
+%token <i> PARSEOP_CONCATENATERESTEMPLATE
+%token <i> PARSEOP_CONDREFOF
+%token <i> PARSEOP_CONNECTION
+%token <i> PARSEOP_CONTINUE
+%token <i> PARSEOP_COPYOBJECT
+%token <i> PARSEOP_CREATEBITFIELD
+%token <i> PARSEOP_CREATEBYTEFIELD
+%token <i> PARSEOP_CREATEDWORDFIELD
+%token <i> PARSEOP_CREATEFIELD
+%token <i> PARSEOP_CREATEQWORDFIELD
+%token <i> PARSEOP_CREATEWORDFIELD
+%token <i> PARSEOP_DATABUFFER
+%token <i> PARSEOP_DATATABLEREGION
+%token <i> PARSEOP_DEBUG
+%token <i> PARSEOP_DECODETYPE_POS
+%token <i> PARSEOP_DECODETYPE_SUB
+%token <i> PARSEOP_DECREMENT
+%token <i> PARSEOP_DEFAULT
+%token <i> PARSEOP_DEFAULT_ARG
+%token <i> PARSEOP_DEFINITIONBLOCK
+%token <i> PARSEOP_DEREFOF
+%token <i> PARSEOP_DEVICE
+%token <i> PARSEOP_DEVICEPOLARITY_HIGH
+%token <i> PARSEOP_DEVICEPOLARITY_LOW
+%token <i> PARSEOP_DIVIDE
+%token <i> PARSEOP_DMA
+%token <i> PARSEOP_DMATYPE_A
+%token <i> PARSEOP_DMATYPE_COMPATIBILITY
+%token <i> PARSEOP_DMATYPE_B
+%token <i> PARSEOP_DMATYPE_F
+%token <i> PARSEOP_DWORDCONST
+%token <i> PARSEOP_DWORDIO
+%token <i> PARSEOP_DWORDMEMORY
+%token <i> PARSEOP_DWORDSPACE
+%token <i> PARSEOP_EISAID
+%token <i> PARSEOP_ELSE
+%token <i> PARSEOP_ELSEIF
+%token <i> PARSEOP_ENDDEPENDENTFN
+%token <i> PARSEOP_ENDIAN_BIG
+%token <i> PARSEOP_ENDIAN_LITTLE
+%token <i> PARSEOP_ENDTAG
+%token <i> PARSEOP_ERRORNODE
+%token <i> PARSEOP_EVENT
+%token <i> PARSEOP_EXTENDEDIO
+%token <i> PARSEOP_EXTENDEDMEMORY
+%token <i> PARSEOP_EXTENDEDSPACE
+%token <i> PARSEOP_EXTERNAL
+%token <i> PARSEOP_FATAL
+%token <i> PARSEOP_FIELD
+%token <i> PARSEOP_FINDSETLEFTBIT
+%token <i> PARSEOP_FINDSETRIGHTBIT
+%token <i> PARSEOP_FIXEDDMA
+%token <i> PARSEOP_FIXEDIO
+%token <i> PARSEOP_FLOWCONTROL_HW
+%token <i> PARSEOP_FLOWCONTROL_NONE
+%token <i> PARSEOP_FLOWCONTROL_SW
+%token <i> PARSEOP_FROMBCD
+%token <i> PARSEOP_FUNCTION
+%token <i> PARSEOP_GPIO_INT
+%token <i> PARSEOP_GPIO_IO
+%token <i> PARSEOP_I2C_SERIALBUS
+%token <i> PARSEOP_IF
+%token <i> PARSEOP_INCLUDE
+%token <i> PARSEOP_INCLUDE_END
+%token <i> PARSEOP_INCREMENT
+%token <i> PARSEOP_INDEX
+%token <i> PARSEOP_INDEXFIELD
+%token <i> PARSEOP_INTEGER
+%token <i> PARSEOP_INTERRUPT
+%token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
+%token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
+%token <i> PARSEOP_INTLEVEL_ACTIVELOW
+%token <i> PARSEOP_INTTYPE_EDGE
+%token <i> PARSEOP_INTTYPE_LEVEL
+%token <i> PARSEOP_IO
+%token <i> PARSEOP_IODECODETYPE_10
+%token <i> PARSEOP_IODECODETYPE_16
+%token <i> PARSEOP_IORESTRICT_IN
+%token <i> PARSEOP_IORESTRICT_NONE
+%token <i> PARSEOP_IORESTRICT_OUT
+%token <i> PARSEOP_IORESTRICT_PRESERVE
+%token <i> PARSEOP_IRQ
+%token <i> PARSEOP_IRQNOFLAGS
+%token <i> PARSEOP_LAND
+%token <i> PARSEOP_LEQUAL
+%token <i> PARSEOP_LGREATER
+%token <i> PARSEOP_LGREATEREQUAL
+%token <i> PARSEOP_LLESS
+%token <i> PARSEOP_LLESSEQUAL
+%token <i> PARSEOP_LNOT
+%token <i> PARSEOP_LNOTEQUAL
+%token <i> PARSEOP_LOAD
+%token <i> PARSEOP_LOADTABLE
+%token <i> PARSEOP_LOCAL0
+%token <i> PARSEOP_LOCAL1
+%token <i> PARSEOP_LOCAL2
+%token <i> PARSEOP_LOCAL3
+%token <i> PARSEOP_LOCAL4
+%token <i> PARSEOP_LOCAL5
+%token <i> PARSEOP_LOCAL6
+%token <i> PARSEOP_LOCAL7
+%token <i> PARSEOP_LOCKRULE_LOCK
+%token <i> PARSEOP_LOCKRULE_NOLOCK
+%token <i> PARSEOP_LOR
+%token <i> PARSEOP_MATCH
+%token <i> PARSEOP_MATCHTYPE_MEQ
+%token <i> PARSEOP_MATCHTYPE_MGE
+%token <i> PARSEOP_MATCHTYPE_MGT
+%token <i> PARSEOP_MATCHTYPE_MLE
+%token <i> PARSEOP_MATCHTYPE_MLT
+%token <i> PARSEOP_MATCHTYPE_MTR
+%token <i> PARSEOP_MAXTYPE_FIXED
+%token <i> PARSEOP_MAXTYPE_NOTFIXED
+%token <i> PARSEOP_MEMORY24
+%token <i> PARSEOP_MEMORY32
+%token <i> PARSEOP_MEMORY32FIXED
+%token <i> PARSEOP_MEMTYPE_CACHEABLE
+%token <i> PARSEOP_MEMTYPE_NONCACHEABLE
+%token <i> PARSEOP_MEMTYPE_PREFETCHABLE
+%token <i> PARSEOP_MEMTYPE_WRITECOMBINING
+%token <i> PARSEOP_METHOD
+%token <i> PARSEOP_METHODCALL
+%token <i> PARSEOP_MID
+%token <i> PARSEOP_MINTYPE_FIXED
+%token <i> PARSEOP_MINTYPE_NOTFIXED
+%token <i> PARSEOP_MOD
+%token <i> PARSEOP_MULTIPLY
+%token <i> PARSEOP_MUTEX
+%token <i> PARSEOP_NAME
+%token <s> PARSEOP_NAMESEG
+%token <s> PARSEOP_NAMESTRING
+%token <i> PARSEOP_NAND
+%token <i> PARSEOP_NOOP
+%token <i> PARSEOP_NOR
+%token <i> PARSEOP_NOT
+%token <i> PARSEOP_NOTIFY
+%token <i> PARSEOP_OBJECTTYPE
+%token <i> PARSEOP_OBJECTTYPE_BFF
+%token <i> PARSEOP_OBJECTTYPE_BUF
+%token <i> PARSEOP_OBJECTTYPE_DDB
+%token <i> PARSEOP_OBJECTTYPE_DEV
+%token <i> PARSEOP_OBJECTTYPE_EVT
+%token <i> PARSEOP_OBJECTTYPE_FLD
+%token <i> PARSEOP_OBJECTTYPE_INT
+%token <i> PARSEOP_OBJECTTYPE_MTH
+%token <i> PARSEOP_OBJECTTYPE_MTX
+%token <i> PARSEOP_OBJECTTYPE_OPR
+%token <i> PARSEOP_OBJECTTYPE_PKG
+%token <i> PARSEOP_OBJECTTYPE_POW
+%token <i> PARSEOP_OBJECTTYPE_PRO
+%token <i> PARSEOP_OBJECTTYPE_STR
+%token <i> PARSEOP_OBJECTTYPE_THZ
+%token <i> PARSEOP_OBJECTTYPE_UNK
+%token <i> PARSEOP_OFFSET
+%token <i> PARSEOP_ONE
+%token <i> PARSEOP_ONES
+%token <i> PARSEOP_OPERATIONREGION
+%token <i> PARSEOP_OR
+%token <i> PARSEOP_PACKAGE
+%token <i> PARSEOP_PACKAGE_LENGTH
+%token <i> PARSEOP_PARITYTYPE_EVEN
+%token <i> PARSEOP_PARITYTYPE_MARK
+%token <i> PARSEOP_PARITYTYPE_NONE
+%token <i> PARSEOP_PARITYTYPE_ODD
+%token <i> PARSEOP_PARITYTYPE_SPACE
+%token <i> PARSEOP_PIN_NOPULL
+%token <i> PARSEOP_PIN_PULLDEFAULT
+%token <i> PARSEOP_PIN_PULLDOWN
+%token <i> PARSEOP_PIN_PULLUP
+%token <i> PARSEOP_POWERRESOURCE
+%token <i> PARSEOP_PROCESSOR
+%token <i> PARSEOP_QWORDCONST
+%token <i> PARSEOP_QWORDIO
+%token <i> PARSEOP_QWORDMEMORY
+%token <i> PARSEOP_QWORDSPACE
+%token <i> PARSEOP_RANGETYPE_ENTIRE
+%token <i> PARSEOP_RANGETYPE_ISAONLY
+%token <i> PARSEOP_RANGETYPE_NONISAONLY
+%token <i> PARSEOP_RAW_DATA
+%token <i> PARSEOP_READWRITETYPE_BOTH
+%token <i> PARSEOP_READWRITETYPE_READONLY
+%token <i> PARSEOP_REFOF
+%token <i> PARSEOP_REGIONSPACE_CMOS
+%token <i> PARSEOP_REGIONSPACE_EC
+%token <i> PARSEOP_REGIONSPACE_FFIXEDHW
+%token <i> PARSEOP_REGIONSPACE_GPIO
+%token <i> PARSEOP_REGIONSPACE_GSBUS
+%token <i> PARSEOP_REGIONSPACE_IO
+%token <i> PARSEOP_REGIONSPACE_IPMI
+%token <i> PARSEOP_REGIONSPACE_MEM
+%token <i> PARSEOP_REGIONSPACE_PCC
+%token <i> PARSEOP_REGIONSPACE_PCI
+%token <i> PARSEOP_REGIONSPACE_PCIBAR
+%token <i> PARSEOP_REGIONSPACE_SMBUS
+%token <i> PARSEOP_REGISTER
+%token <i> PARSEOP_RELEASE
+%token <i> PARSEOP_RESERVED_BYTES
+%token <i> PARSEOP_RESET
+%token <i> PARSEOP_RESOURCETEMPLATE
+%token <i> PARSEOP_RESOURCETYPE_CONSUMER
+%token <i> PARSEOP_RESOURCETYPE_PRODUCER
+%token <i> PARSEOP_RETURN
+%token <i> PARSEOP_REVISION
+%token <i> PARSEOP_SCOPE
+%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
+%token <i> PARSEOP_SERIALIZERULE_SERIAL
+%token <i> PARSEOP_SHARETYPE_EXCLUSIVE
+%token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
+%token <i> PARSEOP_SHARETYPE_SHARED
+%token <i> PARSEOP_SHARETYPE_SHAREDWAKE
+%token <i> PARSEOP_SHIFTLEFT
+%token <i> PARSEOP_SHIFTRIGHT
+%token <i> PARSEOP_SIGNAL
+%token <i> PARSEOP_SIZEOF
+%token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
+%token <i> PARSEOP_SLAVEMODE_DEVICEINIT
+%token <i> PARSEOP_SLEEP
+%token <i> PARSEOP_SPI_SERIALBUS
+%token <i> PARSEOP_STALL
+%token <i> PARSEOP_STARTDEPENDENTFN
+%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
+%token <i> PARSEOP_STOPBITS_ONE
+%token <i> PARSEOP_STOPBITS_ONEPLUSHALF
+%token <i> PARSEOP_STOPBITS_TWO
+%token <i> PARSEOP_STOPBITS_ZERO
+%token <i> PARSEOP_STORE
+%token <s> PARSEOP_STRING_LITERAL
+%token <i> PARSEOP_SUBTRACT
+%token <i> PARSEOP_SWITCH
+%token <i> PARSEOP_THERMALZONE
+%token <i> PARSEOP_TIMER
+%token <i> PARSEOP_TOBCD
+%token <i> PARSEOP_TOBUFFER
+%token <i> PARSEOP_TODECIMALSTRING
+%token <i> PARSEOP_TOHEXSTRING
+%token <i> PARSEOP_TOINTEGER
+%token <i> PARSEOP_TOSTRING
+%token <i> PARSEOP_TOUUID
+%token <i> PARSEOP_TRANSLATIONTYPE_DENSE
+%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
+%token <i> PARSEOP_TYPE_STATIC
+%token <i> PARSEOP_TYPE_TRANSLATION
+%token <i> PARSEOP_UART_SERIALBUS
+%token <i> PARSEOP_UNICODE
+%token <i> PARSEOP_UNLOAD
+%token <i> PARSEOP_UPDATERULE_ONES
+%token <i> PARSEOP_UPDATERULE_PRESERVE
+%token <i> PARSEOP_UPDATERULE_ZEROS
+%token <i> PARSEOP_VAR_PACKAGE
+%token <i> PARSEOP_VENDORLONG
+%token <i> PARSEOP_VENDORSHORT
+%token <i> PARSEOP_WAIT
+%token <i> PARSEOP_WHILE
+%token <i> PARSEOP_WIREMODE_FOUR
+%token <i> PARSEOP_WIREMODE_THREE
+%token <i> PARSEOP_WORDBUSNUMBER
+%token <i> PARSEOP_WORDCONST
+%token <i> PARSEOP_WORDIO
+%token <i> PARSEOP_WORDSPACE
+%token <i> PARSEOP_XFERSIZE_8
+%token <i> PARSEOP_XFERSIZE_16
+%token <i> PARSEOP_XFERSIZE_32
+%token <i> PARSEOP_XFERSIZE_64
+%token <i> PARSEOP_XFERSIZE_128
+%token <i> PARSEOP_XFERSIZE_256
+%token <i> PARSEOP_XFERTYPE_8
+%token <i> PARSEOP_XFERTYPE_8_16
+%token <i> PARSEOP_XFERTYPE_16
+%token <i> PARSEOP_XOR
+%token <i> PARSEOP_ZERO
+
+/*
+ * Special functions. These should probably stay at the end of this
+ * table.
+ */
+%token <i> PARSEOP___DATE__
+%token <i> PARSEOP___FILE__
+%token <i> PARSEOP___LINE__
+%token <i> PARSEOP___PATH__
diff --git a/sys/contrib/dev/acpica/compiler/asltransform.c b/sys/contrib/dev/acpica/compiler/asltransform.c
index 7e6ad39..44b9f03 100644
--- a/sys/contrib/dev/acpica/compiler/asltransform.c
+++ b/sys/contrib/dev/acpica/compiler/asltransform.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -377,7 +376,6 @@ TrDoDefinitionBlock (
*
* RETURN: None
*
- *
* DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is
* no actual AML opcode for SWITCH -- it must be simulated.
*
@@ -450,10 +448,6 @@ TrDoSwitch (
{
/* Add an ELSE to complete the previous CASE */
- if (!Conditional)
- {
- return;
- }
NewOp = TrCreateLeafNode (PARSEOP_ELSE);
NewOp->Asl.Parent = Conditional->Asl.Parent;
TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent);
@@ -620,11 +614,6 @@ TrDoSwitch (
{
/* Convert the DEFAULT node to an ELSE */
- if (!Conditional)
- {
- return;
- }
-
TrAmlInitNode (DefaultOp, PARSEOP_ELSE);
DefaultOp->Asl.Parent = Conditional->Asl.Parent;
diff --git a/sys/contrib/dev/acpica/compiler/asltree.c b/sys/contrib/dev/acpica/compiler/asltree.c
index b2bbbfd..a6e5f73 100644
--- a/sys/contrib/dev/acpica/compiler/asltree.c
+++ b/sys/contrib/dev/acpica/compiler/asltree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acapps.h>
@@ -79,15 +78,29 @@ static ACPI_PARSE_OBJECT *
TrGetNextNode (
void)
{
+ ASL_CACHE_INFO *Cache;
+
- if (Gbl_NodeCacheNext >= Gbl_NodeCacheLast)
+ if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
{
- Gbl_NodeCacheNext = UtLocalCalloc (sizeof (ACPI_PARSE_OBJECT) *
- ASL_NODE_CACHE_SIZE);
- Gbl_NodeCacheLast = Gbl_NodeCacheNext + ASL_NODE_CACHE_SIZE;
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_ParseOpCacheList;
+ Gbl_ParseOpCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
+ Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
}
- return (Gbl_NodeCacheNext++);
+ Gbl_ParseOpCount++;
+ return (Gbl_ParseOpCacheNext++);
}
@@ -517,7 +530,6 @@ TrCreateConstantLeafNode (
/* Get the simple filename from the full path */
FlSplitInputPathname (Op->Asl.Filename, &Path, &Filename);
- ACPI_FREE (Path);
Op->Asl.Value.String = Filename;
break;
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.h b/sys/contrib/dev/acpica/compiler/asltypes.h
index 5ca17b3..5f01c80 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.h
+++ b/sys/contrib/dev/acpica/compiler/asltypes.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLTYPES_H
#define __ASLTYPES_H
@@ -166,15 +165,26 @@ typedef enum
ASL_FILE_C_SOURCE_OUTPUT,
ASL_FILE_ASM_INCLUDE_OUTPUT,
ASL_FILE_C_INCLUDE_OUTPUT,
- ASL_FILE_C_OFFSET_OUTPUT
+ ASL_FILE_C_OFFSET_OUTPUT,
+ ASL_FILE_MAP_OUTPUT
} ASL_FILE_TYPES;
-#define ASL_MAX_FILE_TYPE 14
+#define ASL_MAX_FILE_TYPE 15
#define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1)
+/* Cache block structure for ParseOps and Strings */
+
+typedef struct asl_cache_info
+{
+ void *Next;
+ char Buffer[1];
+
+} ASL_CACHE_INFO;
+
+
typedef struct asl_include_dir
{
char *Dir;
@@ -196,7 +206,7 @@ typedef struct asl_error_msg
char *Filename;
char *SourceLine;
UINT32 FilenameLength;
- UINT8 MessageId;
+ UINT16 MessageId;
UINT8 Level;
} ASL_ERROR_MSG;
@@ -238,4 +248,35 @@ typedef struct asl_event_info
} ASL_EVENT_INFO;
+/* Hardware mapping file structures */
+
+typedef struct acpi_gpio_info
+{
+ struct acpi_gpio_info *Next;
+ ACPI_PARSE_OBJECT *Op;
+ char *DeviceName;
+ ACPI_NAMESPACE_NODE *TargetNode;
+ UINT32 References;
+ UINT32 PinCount;
+ UINT32 PinIndex;
+ UINT16 PinNumber;
+ UINT8 Type;
+ UINT8 Direction;
+ UINT8 Polarity;
+
+} ACPI_GPIO_INFO;
+
+typedef struct acpi_serial_info
+{
+ struct acpi_serial_info *Next;
+ ACPI_PARSE_OBJECT *Op;
+ char *DeviceName;
+ ACPI_NAMESPACE_NODE *TargetNode;
+ AML_RESOURCE *Resource;
+ UINT32 Speed;
+ UINT16 Address;
+
+} ACPI_SERIAL_INFO;
+
+
#endif /* __ASLTYPES_H */
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.y b/sys/contrib/dev/acpica/compiler/asltypes.y
new file mode 100644
index 0000000..b991453
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/asltypes.y
@@ -0,0 +1,381 @@
+NoEcho('
+/******************************************************************************
+ *
+ * Module Name: asltypes.y - Bison/Yacc production types/names
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+')
+
+/******************************************************************************
+ *
+ * Production names
+ *
+ *****************************************************************************/
+
+%type <n> ArgList
+%type <n> ASLCode
+%type <n> BufferData
+%type <n> BufferTermData
+%type <n> CompilerDirective
+%type <n> DataObject
+%type <n> DefinitionBlockTerm
+%type <n> IntegerData
+%type <n> NamedObject
+%type <n> NameSpaceModifier
+%type <n> Object
+%type <n> ObjectList
+%type <n> PackageData
+%type <n> ParameterTypePackage
+%type <n> ParameterTypePackageList
+%type <n> ParameterTypesPackage
+%type <n> ParameterTypesPackageList
+%type <n> RequiredTarget
+%type <n> SimpleTarget
+%type <n> StringData
+%type <n> Target
+%type <n> Term
+%type <n> TermArg
+%type <n> TermList
+%type <n> UserTerm
+
+/* Type4Opcode is obsolete */
+
+%type <n> Type1Opcode
+%type <n> Type2BufferOpcode
+%type <n> Type2BufferOrStringOpcode
+%type <n> Type2IntegerOpcode
+%type <n> Type2Opcode
+%type <n> Type2StringOpcode
+%type <n> Type3Opcode
+%type <n> Type5Opcode
+%type <n> Type6Opcode
+
+%type <n> AccessAsTerm
+%type <n> ExternalTerm
+%type <n> FieldUnit
+%type <n> FieldUnitEntry
+%type <n> FieldUnitList
+%type <n> IncludeTerm
+%type <n> OffsetTerm
+%type <n> OptionalAccessAttribTerm
+
+/* Named Objects */
+
+%type <n> BankFieldTerm
+%type <n> CreateBitFieldTerm
+%type <n> CreateByteFieldTerm
+%type <n> CreateDWordFieldTerm
+%type <n> CreateFieldTerm
+%type <n> CreateQWordFieldTerm
+%type <n> CreateWordFieldTerm
+%type <n> DataRegionTerm
+%type <n> DeviceTerm
+%type <n> EventTerm
+%type <n> FieldTerm
+%type <n> FunctionTerm
+%type <n> IndexFieldTerm
+%type <n> MethodTerm
+%type <n> MutexTerm
+%type <n> OpRegionTerm
+%type <n> OpRegionSpaceIdTerm
+%type <n> PowerResTerm
+%type <n> ProcessorTerm
+%type <n> ThermalZoneTerm
+
+/* Namespace modifiers */
+
+%type <n> AliasTerm
+%type <n> NameTerm
+%type <n> ScopeTerm
+
+/* Type 1 opcodes */
+
+%type <n> BreakPointTerm
+%type <n> BreakTerm
+%type <n> CaseDefaultTermList
+%type <n> CaseTerm
+%type <n> ContinueTerm
+%type <n> DefaultTerm
+%type <n> ElseTerm
+%type <n> FatalTerm
+%type <n> IfElseTerm
+%type <n> IfTerm
+%type <n> LoadTerm
+%type <n> NoOpTerm
+%type <n> NotifyTerm
+%type <n> ReleaseTerm
+%type <n> ResetTerm
+%type <n> ReturnTerm
+%type <n> SignalTerm
+%type <n> SleepTerm
+%type <n> StallTerm
+%type <n> SwitchTerm
+%type <n> UnloadTerm
+%type <n> WhileTerm
+/* %type <n> CaseTermList */
+
+/* Type 2 opcodes */
+
+%type <n> AcquireTerm
+%type <n> AddTerm
+%type <n> AndTerm
+%type <n> ConcatResTerm
+%type <n> ConcatTerm
+%type <n> CondRefOfTerm
+%type <n> CopyObjectTerm
+%type <n> DecTerm
+%type <n> DerefOfTerm
+%type <n> DivideTerm
+%type <n> FindSetLeftBitTerm
+%type <n> FindSetRightBitTerm
+%type <n> FromBCDTerm
+%type <n> IncTerm
+%type <n> IndexTerm
+%type <n> LAndTerm
+%type <n> LEqualTerm
+%type <n> LGreaterEqualTerm
+%type <n> LGreaterTerm
+%type <n> LLessEqualTerm
+%type <n> LLessTerm
+%type <n> LNotEqualTerm
+%type <n> LNotTerm
+%type <n> LoadTableTerm
+%type <n> LOrTerm
+%type <n> MatchTerm
+%type <n> MidTerm
+%type <n> ModTerm
+%type <n> MultiplyTerm
+%type <n> NAndTerm
+%type <n> NOrTerm
+%type <n> NotTerm
+%type <n> ObjectTypeTerm
+%type <n> OrTerm
+%type <n> RefOfTerm
+%type <n> ShiftLeftTerm
+%type <n> ShiftRightTerm
+%type <n> SizeOfTerm
+%type <n> StoreTerm
+%type <n> SubtractTerm
+%type <n> TimerTerm
+%type <n> ToBCDTerm
+%type <n> ToBufferTerm
+%type <n> ToDecimalStringTerm
+%type <n> ToHexStringTerm
+%type <n> ToIntegerTerm
+%type <n> ToStringTerm
+%type <n> WaitTerm
+%type <n> XOrTerm
+
+/* Keywords */
+
+%type <n> AccessAttribKeyword
+%type <n> AccessTypeKeyword
+%type <n> AddressingModeKeyword
+%type <n> AddressKeyword
+%type <n> AddressSpaceKeyword
+%type <n> BitsPerByteKeyword
+%type <n> ClockPhaseKeyword
+%type <n> ClockPolarityKeyword
+%type <n> DecodeKeyword
+%type <n> DevicePolarityKeyword
+%type <n> DMATypeKeyword
+%type <n> EndianKeyword
+%type <n> FlowControlKeyword
+%type <n> InterruptLevel
+%type <n> InterruptTypeKeyword
+%type <n> IODecodeKeyword
+%type <n> IoRestrictionKeyword
+%type <n> LockRuleKeyword
+%type <n> MatchOpKeyword
+%type <n> MaxKeyword
+%type <n> MemTypeKeyword
+%type <n> MinKeyword
+%type <n> ObjectTypeKeyword
+%type <n> OptionalBusMasterKeyword
+%type <n> OptionalReadWriteKeyword
+%type <n> ParityTypeKeyword
+%type <n> PinConfigByte
+%type <n> PinConfigKeyword
+%type <n> RangeTypeKeyword
+%type <n> RegionSpaceKeyword
+%type <n> ResourceTypeKeyword
+%type <n> SerializeRuleKeyword
+%type <n> ShareTypeKeyword
+%type <n> SlaveModeKeyword
+%type <n> StopBitsKeyword
+%type <n> TranslationKeyword
+%type <n> TypeKeyword
+%type <n> UpdateRuleKeyword
+%type <n> WireModeKeyword
+%type <n> XferSizeKeyword
+%type <n> XferTypeKeyword
+
+/* Types */
+
+%type <n> SuperName
+%type <n> ObjectTypeName
+%type <n> ArgTerm
+%type <n> LocalTerm
+%type <n> DebugTerm
+
+%type <n> Integer
+%type <n> ByteConst
+%type <n> WordConst
+%type <n> DWordConst
+%type <n> QWordConst
+%type <n> String
+
+%type <n> ConstTerm
+%type <n> ConstExprTerm
+%type <n> ByteConstExpr
+%type <n> WordConstExpr
+%type <n> DWordConstExpr
+%type <n> QWordConstExpr
+
+%type <n> DWordList
+%type <n> BufferTerm
+%type <n> ByteList
+
+%type <n> PackageElement
+%type <n> PackageList
+%type <n> PackageTerm
+%type <n> VarPackageLengthTerm
+
+/* Macros */
+
+%type <n> EISAIDTerm
+%type <n> ResourceMacroList
+%type <n> ResourceMacroTerm
+%type <n> ResourceTemplateTerm
+%type <n> ToUUIDTerm
+%type <n> UnicodeTerm
+
+/* Resource Descriptors */
+
+%type <n> ConnectionTerm
+%type <n> DataBufferTerm
+%type <n> DMATerm
+%type <n> DWordIOTerm
+%type <n> DWordMemoryTerm
+%type <n> DWordSpaceTerm
+%type <n> EndDependentFnTerm
+%type <n> ExtendedIOTerm
+%type <n> ExtendedMemoryTerm
+%type <n> ExtendedSpaceTerm
+%type <n> FixedDmaTerm
+%type <n> FixedIOTerm
+%type <n> GpioIntTerm
+%type <n> GpioIoTerm
+%type <n> I2cSerialBusTerm
+%type <n> InterruptTerm
+%type <n> IOTerm
+%type <n> IRQNoFlagsTerm
+%type <n> IRQTerm
+%type <n> Memory24Term
+%type <n> Memory32FixedTerm
+%type <n> Memory32Term
+%type <n> NameSeg
+%type <n> NameString
+%type <n> QWordIOTerm
+%type <n> QWordMemoryTerm
+%type <n> QWordSpaceTerm
+%type <n> RegisterTerm
+%type <n> SpiSerialBusTerm
+%type <n> StartDependentFnNoPriTerm
+%type <n> StartDependentFnTerm
+%type <n> UartSerialBusTerm
+%type <n> VendorLongTerm
+%type <n> VendorShortTerm
+%type <n> WordBusNumberTerm
+%type <n> WordIOTerm
+%type <n> WordSpaceTerm
+
+/* Local types that help construct the AML, not in ACPI spec */
+
+%type <n> AmlPackageLengthTerm
+%type <n> IncludeEndTerm
+%type <n> NameStringItem
+%type <n> TermArgItem
+
+%type <n> OptionalAccessSize
+%type <n> OptionalAddressingMode
+%type <n> OptionalAddressRange
+%type <n> OptionalBitsPerByte
+%type <n> OptionalBuffer_Last
+%type <n> OptionalByteConstExpr
+%type <n> OptionalCount
+%type <n> OptionalDecodeType
+%type <n> OptionalDevicePolarity
+%type <n> OptionalDWordConstExpr
+%type <n> OptionalEndian
+%type <n> OptionalFlowControl
+%type <n> OptionalIoRestriction
+%type <n> OptionalListString
+%type <n> OptionalMaxType
+%type <n> OptionalMemType
+%type <n> OptionalMinType
+%type <n> OptionalNameString
+%type <n> OptionalNameString_First
+%type <n> OptionalNameString_Last
+%type <n> OptionalObjectTypeKeyword
+%type <n> OptionalParameterTypePackage
+%type <n> OptionalParameterTypesPackage
+%type <n> OptionalParityType
+%type <n> OptionalQWordConstExpr
+%type <n> OptionalRangeType
+%type <n> OptionalReference
+%type <n> OptionalResourceType
+%type <n> OptionalResourceType_First
+%type <n> OptionalReturnArg
+%type <n> OptionalSerializeRuleKeyword
+%type <n> OptionalShareType
+%type <n> OptionalShareType_First
+%type <n> OptionalSlaveMode
+%type <n> OptionalStopBits
+%type <n> OptionalStringData
+%type <n> OptionalTermArg
+%type <n> OptionalTranslationType_Last
+%type <n> OptionalType
+%type <n> OptionalType_Last
+%type <n> OptionalWireMode
+%type <n> OptionalWordConst
+%type <n> OptionalWordConstExpr
+%type <n> OptionalXferSize
diff --git a/sys/contrib/dev/acpica/compiler/aslutils.c b/sys/contrib/dev/acpica/compiler/aslutils.c
index eea5d68..0ec4473 100644
--- a/sys/contrib/dev/acpica/compiler/aslutils.c
+++ b/sys/contrib/dev/acpica/compiler/aslutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -243,37 +242,6 @@ UtEndEvent (
/*******************************************************************************
*
- * FUNCTION: UtHexCharToValue
- *
- * PARAMETERS: HexChar - Hex character in Ascii
- *
- * RETURN: The binary value of the hex character
- *
- * DESCRIPTION: Perform ascii-to-hex translation
- *
- ******************************************************************************/
-
-UINT8
-UtHexCharToValue (
- int HexChar)
-{
-
- if (HexChar <= 0x39)
- {
- return ((UINT8) (HexChar - 0x30));
- }
-
- if (HexChar <= 0x46)
- {
- return ((UINT8) (HexChar - 0x37));
- }
-
- return ((UINT8) (HexChar - 0x57));
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: UtConvertByteToHex
*
* PARAMETERS: RawByte - Binary data
@@ -296,8 +264,8 @@ UtConvertByteToHex (
Buffer[0] = '0';
Buffer[1] = 'x';
- Buffer[2] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
- Buffer[3] = (UINT8) AslHexLookup[RawByte & 0xF];
+ Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
+ Buffer[3] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
}
@@ -312,7 +280,7 @@ UtConvertByteToHex (
* RETURN: Ascii hex byte is stored in Buffer.
*
* DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
- * with "0x"
+ * with '0', and a trailing 'h' is added.
*
******************************************************************************/
@@ -323,8 +291,8 @@ UtConvertByteToAsmHex (
{
Buffer[0] = '0';
- Buffer[1] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
- Buffer[2] = (UINT8) AslHexLookup[RawByte & 0xF];
+ Buffer[1] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
+ Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
Buffer[3] = 'h';
}
@@ -585,7 +553,7 @@ UtCheckIntegerRange (
/*******************************************************************************
*
- * FUNCTION: UtGetStringBuffer
+ * FUNCTION: UtStringCacheCalloc
*
* PARAMETERS: Length - Size of buffer requested
*
@@ -598,22 +566,42 @@ UtCheckIntegerRange (
******************************************************************************/
char *
-UtGetStringBuffer (
+UtStringCacheCalloc (
UINT32 Length)
{
char *Buffer;
+ ASL_CACHE_INFO *Cache;
+ if (Length > ASL_STRING_CACHE_SIZE)
+ {
+ Buffer = UtLocalCalloc (Length);
+ return (Buffer);
+ }
+
if ((Gbl_StringCacheNext + Length) >= Gbl_StringCacheLast)
{
- Gbl_StringCacheNext = UtLocalCalloc (ASL_STRING_CACHE_SIZE + Length);
- Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE +
- Length;
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ ASL_STRING_CACHE_SIZE);
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_StringCacheList;
+ Gbl_StringCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_StringCacheNext = Cache->Buffer;
+ Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE;
}
+ Gbl_StringCount++;
+ Gbl_StringSize += Length;
+
Buffer = Gbl_StringCacheNext;
Gbl_StringCacheNext += Length;
-
return (Buffer);
}
@@ -646,7 +634,8 @@ UtExpandLineBuffers (
NewSize = Gbl_LineBufferSize * 2;
if (Gbl_CurrentLineBuffer)
{
- DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n",
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "Increasing line buffer size from %u to %u\n",
Gbl_LineBufferSize, NewSize);
}
@@ -691,6 +680,30 @@ ErrorExit:
}
+/******************************************************************************
+ *
+ * FUNCTION: UtFreeLineBuffers
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Free all line buffers
+ *
+ *****************************************************************************/
+
+void
+UtFreeLineBuffers (
+ void)
+{
+
+ free (Gbl_CurrentLineBuffer);
+ free (Gbl_MainTokenBuffer);
+ free (Gbl_MacroTokenBuffer);
+ free (Gbl_ExpressionTokenBuffer);
+}
+
+
/*******************************************************************************
*
* FUNCTION: UtInternalizeName
@@ -723,9 +736,9 @@ UtInternalizeName (
Info.ExternalName = ExternalName;
AcpiNsGetInternalNameLength (&Info);
- /* We need a segment to store the internal name */
+ /* We need a segment to store the internal name */
- Info.InternalName = UtGetStringBuffer (Info.Length);
+ Info.InternalName = UtStringCacheCalloc (Info.Length);
if (!Info.InternalName)
{
return (AE_NO_MEMORY);
@@ -918,7 +931,7 @@ UtDoConstant (
}
-/* TBD: use version in ACPI CA main code base? */
+/* TBD: use version in ACPICA main code base? */
/*******************************************************************************
*
diff --git a/sys/contrib/dev/acpica/compiler/asluuid.c b/sys/contrib/dev/acpica/compiler/asluuid.c
index ed884dc..8ba9dd9 100644
--- a/sys/contrib/dev/acpica/compiler/asluuid.c
+++ b/sys/contrib/dev/acpica/compiler/asluuid.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,42 +41,13 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("asluuid")
-/*
- * UUID support functions.
- *
- * This table is used to convert an input UUID ascii string to a 16 byte
- * buffer and the reverse. The table maps a UUID buffer index 0-15 to
- * the index within the 36-byte UUID string where the associated 2-byte
- * hex value can be found.
- *
- * 36-byte UUID strings are of the form:
- * aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
- * Where aa-pp are one byte hex numbers, made up of two hex digits
- *
- * Note: This table is basically the inverse of the string-to-offset table
- * found in the ACPI spec in the description of the ToUUID macro.
- */
-static UINT8 Gbl_MapToUuidOffset[16] =
-{
- 6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
-};
-
-#define UUID_BUFFER_LENGTH 16
-#define UUID_STRING_LENGTH 36
-
-/* Positions for required hyphens (dashes) in UUID strings */
-
-#define UUID_HYPHEN1_OFFSET 8
-#define UUID_HYPHEN2_OFFSET 13
-#define UUID_HYPHEN3_OFFSET 18
-#define UUID_HYPHEN4_OFFSET 23
+extern UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH];
/*******************************************************************************
@@ -137,42 +108,6 @@ AuValidateUuid (
/*******************************************************************************
*
- * FUNCTION: AuConvertStringToUuid
- *
- * PARAMETERS: InString - 36-byte formatted UUID string
- * UuidBuffer - 16-byte UUID buffer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Convert 36-byte formatted UUID string to 16-byte UUID buffer
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AuConvertStringToUuid (
- char *InString,
- char *UuidBuffer)
-{
- UINT32 i;
-
-
- if (!InString || !UuidBuffer)
- {
- return (AE_BAD_PARAMETER);
- }
-
- for (i = 0; i < UUID_BUFFER_LENGTH; i++)
- {
- UuidBuffer[i] = (char) (UtHexCharToValue (InString[Gbl_MapToUuidOffset[i]]) << 4);
- UuidBuffer[i] |= (char) UtHexCharToValue (InString[Gbl_MapToUuidOffset[i] + 1]);
- }
-
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AuConvertUuidToString
*
* PARAMETERS: UuidBuffer - 16-byte UUID buffer
@@ -200,8 +135,11 @@ AuConvertUuidToString (
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
{
- OutString[Gbl_MapToUuidOffset[i]] = (UINT8) AslHexLookup[(UuidBuffer[i] >> 4) & 0xF];
- OutString[Gbl_MapToUuidOffset[i] + 1] = (UINT8) AslHexLookup[UuidBuffer[i] & 0xF];
+ OutString[AcpiGbl_MapToUuidOffset[i]] =
+ AcpiUtHexToAsciiChar (UuidBuffer[i], 4);
+
+ OutString[AcpiGbl_MapToUuidOffset[i] + 1] =
+ AcpiUtHexToAsciiChar (UuidBuffer[i], 0);
}
/* Insert required hyphens (dashes) */
diff --git a/sys/contrib/dev/acpica/compiler/aslwalks.c b/sys/contrib/dev/acpica/compiler/aslwalks.c
index 7dfa7af..1ce5918 100644
--- a/sys/contrib/dev/acpica/compiler/aslwalks.c
+++ b/sys/contrib/dev/acpica/compiler/aslwalks.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@@ -605,6 +604,10 @@ AnOtherSemanticAnalysisWalkBegin (
ArgNode = Op->Asl.Parent; /* Field definition */
ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */
Node = ArgNode->Asl.Node; /* OpRegion namespace node */
+ if (!Node)
+ {
+ break;
+ }
ArgNode = Node->Op; /* OpRegion definition */
ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */
diff --git a/sys/contrib/dev/acpica/compiler/aslxref.c b/sys/contrib/dev/acpica/compiler/aslxref.c
index 51addc3..3d73d27 100644
--- a/sys/contrib/dev/acpica/compiler/aslxref.c
+++ b/sys/contrib/dev/acpica/compiler/aslxref.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@@ -86,6 +85,22 @@ XfCheckFieldRange (
UINT32 FieldBitLength,
UINT32 AccessBitWidth);
+#ifdef __UNDER_DEVELOPMENT
+static ACPI_PARSE_OBJECT *
+XfGetParentMethod (
+ ACPI_PARSE_OBJECT *Op);
+
+static void
+XfCheckIllegalReference (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE *Node);
+
+static BOOLEAN
+XfIsObjectParental (
+ ACPI_PARSE_OBJECT *MethodOp1,
+ ACPI_PARSE_OBJECT *MethodOp2);
+#endif
+
/*******************************************************************************
*
@@ -130,6 +145,8 @@ XfCrossReferenceNamespace (
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin,
XfNamespaceLocateEnd, WalkState);
+
+ ACPI_FREE (WalkState);
return (AE_OK);
}
@@ -262,6 +279,182 @@ XfCheckFieldRange (
}
}
+
+#ifdef __UNDER_DEVELOPMENT
+/*******************************************************************************
+ *
+ * FUNCTION: XfIsObjectParental
+ *
+ * PARAMETERS: ChildOp - Op to be checked
+ * PossibleParentOp - Determine if this op is in the family
+ *
+ * RETURN: TRUE if ChildOp is a descendent of PossibleParentOp
+ *
+ * DESCRIPTION: Determine if an Op is a descendent of another Op. Used to
+ * detect if a method is declared within another method.
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+XfIsObjectParental (
+ ACPI_PARSE_OBJECT *ChildOp,
+ ACPI_PARSE_OBJECT *PossibleParentOp)
+{
+ ACPI_PARSE_OBJECT *ParentOp;
+
+
+ /* Search upwards through the tree for possible parent */
+
+ ParentOp = ChildOp;
+ while (ParentOp)
+ {
+ if (ParentOp == PossibleParentOp)
+ {
+ return (TRUE);
+ }
+
+ ParentOp = ParentOp->Asl.Parent;
+ }
+
+ return (FALSE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: XfGetParentMethod
+ *
+ * PARAMETERS: Op - Op to be checked
+ *
+ * RETURN: Op for parent method. NULL if object is not within a method.
+ *
+ * DESCRIPTION: Determine if an object is within a control method. Used to
+ * implement special rules for named references from within a
+ * control method.
+ *
+ * NOTE: It would be better to have the parser set a flag in the Op if possible.
+ *
+ ******************************************************************************/
+
+static ACPI_PARSE_OBJECT *
+XfGetParentMethod (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *ParentOp;
+
+
+ if (!Op)
+ {
+ return (NULL);
+ }
+
+ if (Op->Asl.ParseOpcode == PARSEOP_METHOD)
+ {
+ return (NULL);
+ }
+
+ /* Walk upwards through the parse tree, up to the root if necessary */
+
+ ParentOp = Op;
+ while (ParentOp)
+ {
+ if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD)
+ {
+ return (ParentOp);
+ }
+
+ ParentOp = ParentOp->Asl.Parent;
+ }
+
+ /* Object is not within a method */
+
+ return (NULL);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: XfCheckIllegalReference
+ *
+ * PARAMETERS: Op - Op referring to the target
+ * TargetNode - Target of the reference
+ *
+ * RETURN: None. Emits error message for an illegal reference
+ *
+ * DESCRIPTION: Determine if a named reference is legal. A "named" reference
+ * is something like: Store(ABCD, ...), where ABCD is an AML
+ * Nameseg or Namepath.
+ *
+ * NOTE: Caller must ensure that the name Op is in fact a reference, and not
+ * an actual name declaration (creation of a named object).
+ *
+ ******************************************************************************/
+
+static void
+XfCheckIllegalReference (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE *TargetNode)
+{
+ ACPI_PARSE_OBJECT *MethodOp1;
+ ACPI_PARSE_OBJECT *MethodOp2;
+ ACPI_PARSE_OBJECT *TargetOp;
+
+
+ /*
+ * Check for an illegal reference to a named object:
+ *
+ * 1) References from one control method to another, non-parent
+ * method are not allowed, they will fail at runtime.
+ *
+ * 2) Forward references within a control method are not allowed.
+ * AML interpreters use a one-pass parse of control methods
+ * so these forward references will fail at runtime.
+ */
+ TargetOp = TargetNode->Op;
+
+ MethodOp1 = XfGetParentMethod (Op);
+ MethodOp2 = XfGetParentMethod (TargetOp);
+
+ /* Are both objects within control method(s)? */
+
+ if (!MethodOp1 || !MethodOp2)
+ {
+ return;
+ }
+
+ /* Objects not in the same method? */
+
+ if (MethodOp1 != MethodOp2)
+ {
+ /*
+ * 1) Cross-method named reference
+ *
+ * This is OK if and only if the target reference is within in a
+ * method that is a parent of current method
+ */
+ if (!XfIsObjectParental (MethodOp1, MethodOp2))
+ {
+ AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op,
+ Op->Asl.ExternalName);
+ }
+ }
+
+ /*
+ * 2) Both reference and target are in the same method. Check if this is
+ * an (illegal) forward reference by examining the exact source code
+ * location of each (the referenced object and the object declaration).
+ * This is a bit nasty, yet effective.
+ */
+ else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset)
+ {
+ AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
+ Op->Asl.ExternalName);
+ }
+
+}
+#endif
+
+
/*******************************************************************************
*
* FUNCTION: XfNamespaceLocateBegin
@@ -316,7 +509,7 @@ XfNamespaceLocateBegin (
*/
if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/* We are only interested in opcodes that have an associated name */
@@ -329,7 +522,7 @@ XfNamespaceLocateBegin (
(Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
(Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/*
@@ -340,7 +533,7 @@ XfNamespaceLocateBegin (
if ((Op->Asl.Parent) &&
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/*
@@ -459,7 +652,8 @@ XfNamespaceLocateBegin (
Status = AE_OK;
}
- return (Status);
+
+ return_ACPI_STATUS (Status);
}
/* Check for a reference vs. name declaration */
@@ -470,6 +664,13 @@ XfNamespaceLocateBegin (
/* This node has been referenced, mark it for reference check */
Node->Flags |= ANOBJ_IS_REFERENCED;
+
+#ifdef __UNDER_DEVELOPMENT
+
+ /* Check for an illegal reference */
+
+ XfCheckIllegalReference (Op, Node);
+#endif
}
/* Attempt to optimize the NamePath */
@@ -624,7 +825,6 @@ XfNamespaceLocateBegin (
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
{
-
/*
* A reference to a method within one of these opcodes is not an
* invocation of the method, it is simply a reference to the method.
@@ -634,7 +834,7 @@ XfNamespaceLocateBegin (
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEREFOF) ||
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_OBJECTTYPE)))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/*
* There are two types of method invocation:
@@ -650,7 +850,7 @@ XfNamespaceLocateBegin (
Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer);
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/* Save the method node in the caller's op */
@@ -658,7 +858,7 @@ XfNamespaceLocateBegin (
Op->Asl.Node = Node;
if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/*
@@ -822,8 +1022,16 @@ XfNamespaceLocateBegin (
}
}
+ /* 5) Check for a connection object */
+#if 0
+ else if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONNECTION)
+ {
+ return_ACPI_STATUS (Status);
+ }
+#endif
+
Op->Asl.Node = Node;
- return (Status);
+ return_ACPI_STATUS (Status);
}
@@ -858,7 +1066,7 @@ XfNamespaceLocateEnd (
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
if (!(OpInfo->Flags & AML_NAMED))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/* Not interested in name references, we did not open a scope for them */
@@ -867,7 +1075,7 @@ XfNamespaceLocateEnd (
(Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/* Pop the scope stack if necessary */
@@ -882,5 +1090,5 @@ XfNamespaceLocateEnd (
(void) AcpiDsScopeStackPop (WalkState);
}
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/compiler/dtcompile.c b/sys/contrib/dev/acpica/compiler/dtcompile.c
index 3407e1d..69344b1 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompile.c
+++ b/sys/contrib/dev/acpica/compiler/dtcompile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -141,8 +141,6 @@ DtDoCompile (
Status = DtCompileDataTable (&FieldList);
UtEndEvent (Event);
- DtFreeFieldList ();
-
if (ACPI_FAILURE (Status))
{
/* TBD: temporary error message. Msgs should come from function above */
@@ -170,6 +168,8 @@ DtDoCompile (
CleanupAndExit:
+ AcpiUtDeleteCaches ();
+ DtDeleteCaches ();
CmCleanupAndExit ();
return (Status);
}
@@ -298,7 +298,7 @@ DtCompileDataTable (
return (AE_ERROR);
}
- Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1);
+ Gbl_Signature = UtStringCacheCalloc (ACPI_STRLEN (Signature) + 1);
strcpy (Gbl_Signature, Signature);
/*
@@ -437,6 +437,7 @@ DtCompileTable (
UINT8 FieldType;
UINT8 *Buffer;
UINT8 *FlagBuffer = NULL;
+ char *String;
UINT32 CurrentFlagByteOffset = 0;
ACPI_STATUS Status;
@@ -446,18 +447,29 @@ DtCompileTable (
return (AE_BAD_PARAMETER);
}
+ /* Ignore optional subtable if name does not match */
+
+ if ((Info->Flags & DT_OPTIONAL) &&
+ ACPI_STRCMP ((*Field)->Name, Info->Name))
+ {
+ *RetSubtable = NULL;
+ return (AE_OK);
+ }
+
Length = DtGetSubtableLength (*Field, Info);
if (Length == ASL_EOF)
{
return (AE_ERROR);
}
- Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
+ Subtable = UtSubtableCacheCalloc ();
if (Length > 0)
{
- Subtable->Buffer = UtLocalCalloc (Length);
+ String = UtStringCacheCalloc (Length);
+ Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
}
+
Subtable->Length = Length;
Subtable->TotalLength = Length;
Buffer = Subtable->Buffer;
@@ -558,8 +570,6 @@ DtCompileTable (
DtSetSubtableLength (InlineSubtable);
ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
- ACPI_FREE (InlineSubtable->Buffer);
- ACPI_FREE (InlineSubtable);
LocalField = *Field;
break;
diff --git a/sys/contrib/dev/acpica/compiler/dtcompiler.h b/sys/contrib/dev/acpica/compiler/dtcompiler.h
index 51fec6d..dbf1125 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/dtcompiler.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,10 @@
#include <contrib/dev/acpica/include/acdisasm.h>
+#define ASL_FIELD_CACHE_SIZE 512
+#define ASL_SUBTABLE_CACHE_SIZE 128
+
+
#undef DT_EXTERN
#ifdef _DECLARE_DT_GLOBALS
@@ -143,6 +147,18 @@ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_LabelList, NULL);
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_CurrentTableOffset, 0);
+/* Local caches */
+
+DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_SubtableCount, 0);
+DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_SubtableCacheList, NULL);
+DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheNext, NULL);
+DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheLast, NULL);
+
+DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_FieldCount, 0);
+DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_FieldCacheList, NULL);
+DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheNext, NULL);
+DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheLast, NULL);
+
/* dtcompiler - main module */
@@ -321,20 +337,20 @@ DtWalkTableTree (
void
DtError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
void
DtNameError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
void
DtFatal (
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
@@ -343,10 +359,6 @@ DtStrtoul64 (
char *String,
UINT64 *ReturnInteger);
-UINT32
-DtGetFileSize (
- FILE *Handle);
-
char*
DtGetFieldValue (
DT_FIELD *Field);
@@ -372,8 +384,16 @@ void
DtSetTableLength(
void);
+DT_SUBTABLE *
+UtSubtableCacheCalloc (
+ void);
+
+DT_FIELD *
+UtFieldCacheCalloc (
+ void);
+
void
-DtFreeFieldList (
+DtDeleteCaches (
void);
@@ -400,6 +420,10 @@ DtCompileCsrt (
void **PFieldList);
ACPI_STATUS
+DtCompileDbg2 (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileDmar (
void **PFieldList);
@@ -420,6 +444,10 @@ DtCompileFpdt (
void **PFieldList);
ACPI_STATUS
+DtCompileGtdt (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileHest (
void **PFieldList);
@@ -428,6 +456,10 @@ DtCompileIvrs (
void **PFieldList);
ACPI_STATUS
+DtCompileLpit (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileMadt (
void **PFieldList);
@@ -452,6 +484,10 @@ DtCompilePmtt (
void **PFieldList);
ACPI_STATUS
+DtCompilePcct (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileRsdt (
void **PFieldList);
@@ -503,6 +539,7 @@ extern const unsigned char TemplateBert[];
extern const unsigned char TemplateBgrt[];
extern const unsigned char TemplateCpep[];
extern const unsigned char TemplateCsrt[];
+extern const unsigned char TemplateDbg2[];
extern const unsigned char TemplateDbgp[];
extern const unsigned char TemplateDmar[];
extern const unsigned char TemplateEcdt[];
@@ -514,12 +551,14 @@ extern const unsigned char TemplateGtdt[];
extern const unsigned char TemplateHest[];
extern const unsigned char TemplateHpet[];
extern const unsigned char TemplateIvrs[];
+extern const unsigned char TemplateLpit[];
extern const unsigned char TemplateMadt[];
extern const unsigned char TemplateMcfg[];
extern const unsigned char TemplateMchi[];
extern const unsigned char TemplateMpst[];
extern const unsigned char TemplateMsct[];
extern const unsigned char TemplateMtmr[];
+extern const unsigned char TemplatePcct[];
extern const unsigned char TemplatePmtt[];
extern const unsigned char TemplateRsdt[];
extern const unsigned char TemplateS3pt[];
diff --git a/sys/contrib/dev/acpica/compiler/dtexpress.c b/sys/contrib/dev/acpica/compiler/dtexpress.c
index 9689ef6..59181f3 100644
--- a/sys/contrib/dev/acpica/compiler/dtexpress.c
+++ b/sys/contrib/dev/acpica/compiler/dtexpress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtfield.c b/sys/contrib/dev/acpica/compiler/dtfield.c
index 1f273d9..a19b985 100644
--- a/sys/contrib/dev/acpica/compiler/dtfield.c
+++ b/sys/contrib/dev/acpica/compiler/dtfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -259,7 +259,7 @@ DtCompileUuid (
}
else
{
- Status = AuConvertStringToUuid (InString, (char *) Buffer);
+ AcpiUtConvertStringToUuid (InString, Buffer);
}
return (Status);
@@ -311,21 +311,37 @@ DtCompileInteger (
return;
}
- /* Ensure that reserved fields are set to zero */
- /* TBD: should we set to zero, or just make this an ERROR? */
- /* TBD: Probably better to use a flag */
+ /*
+ * Ensure that reserved fields are set properly. Note: uses
+ * the DT_NON_ZERO flag to indicate that the reserved value
+ * must be exactly one. Otherwise, the value must be zero.
+ * This is sufficient for now.
+ */
+
+ /* TBD: Should use a flag rather than compare "Reserved" */
- if (!ACPI_STRCMP (Field->Name, "Reserved") &&
- (Value != 0))
+ if (!ACPI_STRCMP (Field->Name, "Reserved"))
{
- DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
- "Setting to zero");
- Value = 0;
+ if (Flags & DT_NON_ZERO)
+ {
+ if (Value != 1)
+ {
+ DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+ "Must be one, setting to one");
+ Value = 1;
+ }
+ }
+ else if (Value != 0)
+ {
+ DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+ "Must be zero, setting to zero");
+ Value = 0;
+ }
}
/* Check if the value must be non-zero */
- if ((Value == 0) && (Flags & DT_NON_ZERO))
+ else if ((Flags & DT_NON_ZERO) && (Value == 0))
{
DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL);
}
@@ -340,7 +356,8 @@ DtCompileInteger (
if (Value > MaxValue)
{
- sprintf (MsgBuffer, "%8.8X%8.8X", ACPI_FORMAT_UINT64 (Value));
+ sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes",
+ ACPI_FORMAT_UINT64 (Value), ByteLength);
DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
}
diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c
index 39fb9da..1f5b620 100644
--- a/sys/contrib/dev/acpica/compiler/dtio.c
+++ b/sys/contrib/dev/acpica/compiler/dtio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,7 @@
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
+#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT DT_COMPILER
ACPI_MODULE_NAME ("dtio")
@@ -132,7 +133,7 @@ DtTrim (
if (!ACPI_STRCMP (String, " "))
{
- ReturnString = UtLocalCalloc (1);
+ ReturnString = UtStringCacheCalloc (1);
return (ReturnString);
}
@@ -180,7 +181,7 @@ DtTrim (
/* Create the trimmed return string */
Length = ACPI_PTR_DIFF (End, Start) + 1;
- ReturnString = UtLocalCalloc (Length + 1);
+ ReturnString = UtStringCacheCalloc (Length + 1);
if (ACPI_STRLEN (Start))
{
ACPI_STRNCPY (ReturnString, Start, Length);
@@ -369,7 +370,7 @@ DtParseLine (
if ((Value && *Value) || IsNullString)
{
- Field = UtLocalCalloc (sizeof (DT_FIELD));
+ Field = UtFieldCacheCalloc ();
Field->Name = Name;
Field->Value = Value;
Field->Line = Line;
@@ -379,11 +380,7 @@ DtParseLine (
DtLinkField (Field);
}
- else /* Ignore this field, it has no valid data */
- {
- ACPI_FREE (Name);
- ACPI_FREE (Value);
- }
+ /* Else -- Ignore this field, it has no valid data */
return (AE_OK);
}
@@ -737,7 +734,11 @@ DtScanFile (
/* Get the file size */
- Gbl_InputByteCount = DtGetFileSize (Handle);
+ Gbl_InputByteCount = CmGetFileSize (Handle);
+ if (Gbl_InputByteCount == ACPI_UINT32_MAX)
+ {
+ AslAbort ();
+ }
Gbl_CurrentLineNumber = 0;
Gbl_CurrentLineOffset = 0;
@@ -816,7 +817,12 @@ DtOutputBinary (
/* Walk the entire parse tree, emitting the binary data */
DtWalkTableTree (RootTable, DtWriteBinary, NULL, NULL);
- Gbl_TableLength = DtGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+
+ Gbl_TableLength = CmGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+ if (Gbl_TableLength == ACPI_UINT32_MAX)
+ {
+ AslAbort ();
+ }
}
@@ -1025,6 +1031,8 @@ DtDumpSubtableList (
DbgPrint (ASL_DEBUG_OUTPUT,
"\nSubtable Tree: (Depth, Subtable, Length, TotalLength)\n\n");
DtWalkTableTree (Gbl_RootTable, DtDumpSubtableTree, NULL, NULL);
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "\n");
}
diff --git a/sys/contrib/dev/acpica/compiler/dtparser.l b/sys/contrib/dev/acpica/compiler/dtparser.l
index b0f6d6c..c6578ef 100644
--- a/sys/contrib/dev/acpica/compiler/dtparser.l
+++ b/sys/contrib/dev/acpica/compiler/dtparser.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtparser.y b/sys/contrib/dev/acpica/compiler/dtparser.y
index 47e74bd..135eaae 100644
--- a/sys/contrib/dev/acpica/compiler/dtparser.y
+++ b/sys/contrib/dev/acpica/compiler/dtparser.y
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtsubtable.c b/sys/contrib/dev/acpica/compiler/dtsubtable.c
index 67fcb9d..fc700cd 100644
--- a/sys/contrib/dev/acpica/compiler/dtsubtable.c
+++ b/sys/contrib/dev/acpica/compiler/dtsubtable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -73,13 +73,15 @@ DtCreateSubtable (
DT_SUBTABLE **RetSubtable)
{
DT_SUBTABLE *Subtable;
+ char *String;
- Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
+ Subtable = UtSubtableCacheCalloc ();
/* Create a new buffer for the subtable data */
- Subtable->Buffer = UtLocalCalloc (Length);
+ String = UtStringCacheCalloc (Length);
+ Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
ACPI_MEMCPY (Subtable->Buffer, Buffer, Length);
Subtable->Length = Length;
diff --git a/sys/contrib/dev/acpica/compiler/dttable.c b/sys/contrib/dev/acpica/compiler/dttable.c
index bb6c7cb..56eb922 100644
--- a/sys/contrib/dev/acpica/compiler/dttable.c
+++ b/sys/contrib/dev/acpica/compiler/dttable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -454,7 +454,7 @@ DtCompileCsrt (
UINT32 GroupLength;
- /* Sub-tables (Resource Groups) */
+ /* Subtables (Resource Groups) */
while (*PFieldList)
{
@@ -520,6 +520,156 @@ DtCompileCsrt (
/******************************************************************************
*
+ * FUNCTION: DtCompileDbg2
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile DBG2.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileDbg2 (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ UINT32 SubtableCount;
+ ACPI_DBG2_HEADER *Dbg2Header;
+ ACPI_DBG2_DEVICE *DeviceInfo;
+ UINT16 CurrentOffset;
+ UINT32 i;
+
+
+ /* Main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Main table fields */
+
+ Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
+ Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
+ ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
+
+ SubtableCount = Dbg2Header->InfoCount;
+ DtPushSubtable (Subtable);
+
+ /* Process all Device Information subtables (Count = InfoCount) */
+
+ while (*PFieldList && SubtableCount)
+ {
+ /* Subtable: Debug Device Information */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
+ CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ ParentTable = DtPeekSubtable ();
+
+ /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
+
+ DeviceInfo->BaseAddressOffset = CurrentOffset;
+ for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ /* AddressSize array (Required, size = RegisterCount) */
+
+ DeviceInfo->AddressSizeOffset = CurrentOffset;
+ for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ CurrentOffset += (UINT16) sizeof (UINT32);
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ /* NamespaceString device identifier (Required, size = NamePathLength) */
+
+ DeviceInfo->NamepathOffset = CurrentOffset;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Update the device info header */
+
+ DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
+ CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* OemData - Variable-length data (Optional, size = OemDataLength) */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Update the device info header (zeros if no OEM data present) */
+
+ DeviceInfo->OemDataOffset = 0;
+ DeviceInfo->OemDataLength = 0;
+
+ /* Optional subtable (OemData) */
+
+ if (Subtable && Subtable->Length)
+ {
+ DeviceInfo->OemDataOffset = CurrentOffset;
+ DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ SubtableCount--;
+ DtPopSubtable (); /* Get next Device Information subtable */
+ }
+
+ DtPopSubtable ();
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileDmar
*
* PARAMETERS: List - Current field list pointer
@@ -586,16 +736,21 @@ DtCompileDmar (
InfoTable = AcpiDmTableInfoDmar1;
break;
- case ACPI_DMAR_TYPE_ATSR:
+ case ACPI_DMAR_TYPE_ROOT_ATS:
InfoTable = AcpiDmTableInfoDmar2;
break;
- case ACPI_DMAR_HARDWARE_AFFINITY:
+ case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
InfoTable = AcpiDmTableInfoDmar3;
break;
+ case ACPI_DMAR_TYPE_NAMESPACE:
+
+ InfoTable = AcpiDmTableInfoDmar4;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
@@ -612,10 +767,20 @@ DtCompileDmar (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
- /* Optional Device Scope subtables */
+ /*
+ * Optional Device Scope subtables
+ */
+ if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+ (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
+ {
+ /* These types do not support device scopes */
+ DtPopSubtable ();
+ continue;
+ }
+
+ DtPushSubtable (Subtable);
DeviceScopeLength = DmarHeader->Length - Subtable->Length -
ParentTable->Length;
while (DeviceScopeLength)
@@ -788,6 +953,125 @@ DtCompileFadt (
return (AE_OK);
}
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileGtdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile GTDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileGtdt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *GtdtHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 GtCount;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (GtdtHeader->Type)
+ {
+ case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+ InfoTable = AcpiDmTableInfoGtdt0;
+ break;
+
+ case ACPI_GTDT_TYPE_WATCHDOG:
+
+ InfoTable = AcpiDmTableInfoGtdt1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Additional GT block subtable data
+ */
+
+ switch (GtdtHeader->Type)
+ {
+ case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+
+ GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
+ while (GtCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+
+ DtInsertSubtable (ParentTable, Subtable);
+ GtCount--;
+ }
+ DtPopSubtable ();
+ break;
+
+ default:
+
+ break;
+ }
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
/******************************************************************************
*
@@ -1154,6 +1438,87 @@ DtCompileIvrs (
/******************************************************************************
*
+ * FUNCTION: DtCompileLpit
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile LPIT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileLpit (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_LPIT_HEADER *LpitHeader;
+
+
+ /* Note: Main table consists only of the standard ACPI table header */
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+
+ /* LPIT Subtable header */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
+
+ switch (LpitHeader->Type)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ InfoTable = AcpiDmTableInfoLpit0;
+ break;
+
+ case ACPI_LPIT_TYPE_SIMPLE_IO:
+
+ InfoTable = AcpiDmTableInfoLpit1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
+ return (AE_ERROR);
+ }
+
+ /* LPIT Subtable */
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileMadt
*
* PARAMETERS: List - Current field list pointer
@@ -1270,6 +1635,16 @@ DtCompileMadt (
InfoTable = AcpiDmTableInfoMadt12;
break;
+ case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
+
+ InfoTable = AcpiDmTableInfoMadt13;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
+
+ InfoTable = AcpiDmTableInfoMadt14;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
@@ -1505,6 +1880,90 @@ DtCompileMtmr (
/******************************************************************************
*
+ * FUNCTION: DtCompilePcct
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile PCCT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompilePcct (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *PcctHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (PcctHeader->Type)
+ {
+ case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct0;
+ break;
+
+ case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompilePmtt
*
* PARAMETERS: List - Current field list pointer
@@ -1961,6 +2420,11 @@ DtCompileSrat (
InfoTable = AcpiDmTableInfoSrat2;
break;
+ case ACPI_SRAT_TYPE_GICC_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat3;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.c b/sys/contrib/dev/acpica/compiler/dttemplate.c
index ca66d16..cb3cafd 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.c
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -187,6 +187,12 @@ GetTemplate:
}
Status = DtCreateOneTemplate (Signature, TableData);
+
+
+ /* Shutdown ACPICA subsystem */
+
+ (void) AcpiTerminate ();
+ CmDeleteCaches ();
return (Status);
}
@@ -397,6 +403,5 @@ DtCreateOneTemplate (
Cleanup:
fclose (File);
AcpiOsRedirectOutput (stdout);
- ACPI_FREE (DisasmFilename);
return (Status);
}
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.h b/sys/contrib/dev/acpica/compiler/dttemplate.h
index f620abd..4011f08 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.h
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -174,6 +174,33 @@ const unsigned char TemplateCsrt[] =
0x43,0x48,0x41,0x37 /* 00000148 "CHA7" */
};
+const unsigned char TemplateDbg2[] =
+{
+ 0x44,0x42,0x47,0x32,0xB2,0x00,0x00,0x00, /* 00000000 "DBG2...." */
+ 0x01,0xBA,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x15,0x11,0x13,0x20,0x2C,0x00,0x00,0x00, /* 00000020 "... ,..." */
+ 0x02,0x00,0x00,0x00,0xEE,0x3F,0x00,0x02, /* 00000028 ".....?.." */
+ 0x09,0x00,0x36,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..6....." */
+ 0x00,0x80,0x00,0x00,0x00,0x00,0x16,0x00, /* 00000038 "........" */
+ 0x2E,0x00,0x01,0x32,0x00,0x03,0x88,0x77, /* 00000040 "...2...w" */
+ 0x66,0x55,0x44,0x33,0x22,0x11,0x01,0x64, /* 00000048 "fUD3"..d" */
+ 0x00,0x04,0x11,0x00,0xFF,0xEE,0xDD,0xCC, /* 00000050 "........" */
+ 0xBB,0xAA,0x10,0x32,0x54,0x76,0x98,0xBA, /* 00000058 "...2Tv.." */
+ 0xDC,0xFE,0x4D,0x79,0x44,0x65,0x76,0x69, /* 00000060 "..MyDevi" */
+ 0x63,0x65,0x00,0xEE,0x47,0x00,0x01,0x11, /* 00000068 "ce..G..." */
+ 0x00,0x26,0x00,0x10,0x00,0x37,0x00,0x00, /* 00000070 ".&...7.." */
+ 0x80,0x00,0x00,0x00,0x00,0x16,0x00,0x22, /* 00000078 "......."" */
+ 0x00,0x01,0x64,0x00,0x04,0x11,0x00,0xFF, /* 00000080 "..d....." */
+ 0xEE,0xDD,0xCC,0xBB,0xAA,0x98,0xBA,0xDC, /* 00000088 "........" */
+ 0xFE,0x5C,0x5C,0x5F,0x53,0x42,0x5F,0x2E, /* 00000090 ".\\_SB_." */
+ 0x50,0x43,0x49,0x30,0x2E,0x44,0x42,0x47, /* 00000098 "PCI0.DBG" */
+ 0x50,0x00,0x41,0x42,0x43,0x44,0x45,0x46, /* 000000A0 "P.ABCDEF" */
+ 0x47,0x48,0x49,0x50,0x51,0x52,0x53,0x54, /* 000000A8 "GHIPQRST" */
+ 0x55,0x56 /* 000000B0 "UV" */
+};
+
const unsigned char TemplateDbgp[] =
{
0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00, /* 00000000 "DBGP4..." */
@@ -353,10 +380,10 @@ const unsigned char TemplateFacs[] =
const unsigned char TemplateFadt[] =
{
0x46,0x41,0x43,0x50,0x0C,0x01,0x00,0x00, /* 00000000 "FACP...." */
- 0x05,0x18,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x05,0x64,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".dINTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x23,0x11,0x11,0x20,0x01,0x00,0x00,0x00, /* 00000020 "#.. ...." */
+ 0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -368,7 +395,7 @@ const unsigned char TemplateFadt[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000070 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
- 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
@@ -379,7 +406,7 @@ const unsigned char TemplateFadt[] =
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000C0 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
0x01,0x20,0x00,0x03,0x01,0x00,0x00,0x00, /* 000000D0 ". ......" */
- 0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01, /* 000000D8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x01, /* 000000D8 ".....@.." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000F0 "........" */
@@ -407,16 +434,34 @@ const unsigned char TemplateFpdt[] =
const unsigned char TemplateGtdt[] =
{
- 0x47,0x54,0x44,0x54,0x50,0x00,0x00,0x00, /* 00000000 "GTDTP..." */
- 0x01,0xF1,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
- 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */
- 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000048 "........" */
+ 0x47,0x54,0x44,0x54,0xe0,0x00,0x00,0x00, /* 00000000 "GTDT...." */
+ 0x02,0xb0,0x4c,0x49,0x4e,0x41,0x52,0x4f, /* 00000008 "..LINARO" */
+ 0x52,0x54,0x53,0x4d,0x56,0x45,0x56,0x38, /* 00000010 "RTSMVEV8" */
+ 0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
+ 0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x1d,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
+ 0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x1b,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x02,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000058 "....`..." */
+ 0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 ".d......" */
+ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000068 "........" */
+ 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000b0 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000b8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x1c,0x00,0x00, /* 000000c0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000c8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000d8 "........" */
};
const unsigned char TemplateHest[] =
@@ -521,41 +566,75 @@ const unsigned char TemplateIvrs[] =
0x00,0x00,0x00,0x00 /* 000000B8 "...." */
};
-/* MADT with ACPI 5.0 subtables */
-
-const unsigned char TemplateMadt[] =
+const unsigned char TemplateLpit[] =
{
- 0x41,0x50,0x49,0x43,0xF6,0x00,0x00,0x00, /* 00000000 "APIC...." */
- 0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x4C,0x50,0x49,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "LPIT...." */
+ 0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */
+ 0x25,0x03,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "%.. ...." */
+ 0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "8......." */
+ 0x00,0x00,0x00,0x00,0x7F,0x01,0x02,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x20,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ". ......" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x58,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000060 "X......." */
+ 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000068 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
+ 0x00,0x00,0x00,0x00 /* 000000B0 "...." */
+};
+
+/* MADT with ACPI 5.1 subtables */
+
+const unsigned char TemplateMadt[] =
+{
+ 0x41,0x50,0x49,0x43,0x2a,0x01,0x00,0x00, /* 00000000 "APIC*..." */
+ 0x04,0x34,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 ".4INTEL " */
+ 0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
+ 0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */
0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */
- 0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */
+ 0x01,0x00,0x00,0x00,0x01,0x0c,0x01,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
- 0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
- 0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00, /* 00000048 "........" */
+ 0x02,0x0a,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x00,0x03,0x08,0x0d,0x00,0x01,0x00, /* 00000048 "........" */
0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01, /* 00000050 "........" */
- 0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x05,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00, /* 00000060 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000078 "........" */
- 0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55, /* 00000080 "....\CPU" */
+ 0x00,0x00,0x00,0x00,0x5c,0x43,0x50,0x55, /* 00000080 "....\CPU" */
0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00, /* 00000088 "0......." */
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, /* 00000090 "........" */
0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00, /* 00000098 "........" */
- 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
- 0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00, /* 000000A8 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x28, /* 000000B0 ".......(" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
- 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18, /* 000000D8 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00 /* 000000F0 "......" */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000a0 "........" */
+ 0x00,0x00,0x0a,0x0c,0x05,0x00,0x00,0x00, /* 000000a8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x4c, /* 000000b0 ".......L" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000c0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000c8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */
+ 0x00,0x00,0x0e,0x10,0x00,0x00,0x00,0x00, /* 00000100 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
+ 0x00,0x00,0x0c,0x18,0x00,0x00,0x00,0x00, /* 00000110 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
+ 0x00,0x00 /* 00000128 ".. " */
};
const unsigned char TemplateMcfg[] =
@@ -646,6 +725,32 @@ const unsigned char TemplateMtmr[] =
0x00,0x00,0x00,0x00 /* 00000048 "...." */
};
+const unsigned char TemplatePcct[] =
+{
+ 0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00, /* 00000000 "PCCT...." */
+ 0x01,0xCF,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x27,0x06,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "'.. ...." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x01,0x32,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ".2......" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000058 "........" */
+ 0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00, /* 00000060 "........" */
+ 0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x3E, /* 00000068 ".......>" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000080 ".......2" */
+ 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000098 "........" */
+ 0xFF,0xFF,0x01,0x00,0x00,0x00,0x01,0x00, /* 000000A0 "........" */
+ 0x00,0x00,0x01,0x00 /* 000000A8 "...." */
+};
+
const unsigned char TemplatePmtt[] =
{
0x50,0x4D,0x54,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "PMTT...." */
@@ -844,10 +949,10 @@ const unsigned char TemplateSpcr[] =
const unsigned char TemplateSpmi[] =
{
0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */
- 0x04,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x04,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
+ 0x14,0x01,0x14,0x20,0x00,0x01,0x00,0x00, /* 00000020 "... ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -856,11 +961,11 @@ const unsigned char TemplateSpmi[] =
const unsigned char TemplateSrat[] =
{
- 0x53,0x52,0x41,0x54,0x80,0x00,0x00,0x00, /* 00000000 "SRAT...." */
- 0x03,0x5A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".ZINTEL " */
- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x53,0x52,0x41,0x54,0x92,0x00,0x00,0x00, /* 00000000 "SRAT...." */
+ 0x03,0x50,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".PINTEL " */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
+ 0x24,0x07,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "$.. ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -871,7 +976,10 @@ const unsigned char TemplateSrat[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
0x02,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x03,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00 /* 00000090 ".." */
};
const unsigned char TemplateTcpa[] =
diff --git a/sys/contrib/dev/acpica/compiler/dtutils.c b/sys/contrib/dev/acpica/compiler/dtutils.c
index d7ef56e..1cd281a 100644
--- a/sys/contrib/dev/acpica/compiler/dtutils.c
+++ b/sys/contrib/dev/acpica/compiler/dtutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -77,7 +77,7 @@ DtSum (
void
DtError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -124,7 +124,7 @@ DtError (
void
DtNameError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -177,7 +177,7 @@ DtNameError (
void
DtFatal (
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -286,36 +286,6 @@ DtStrtoul64 (
/******************************************************************************
*
- * FUNCTION: DtGetFileSize
- *
- * PARAMETERS: Handle - Open file handler
- *
- * RETURN: Current file size
- *
- * DESCRIPTION: Get the current size of a file. Seek to the EOF and get the
- * offset. Seek back to the original location.
- *
- *****************************************************************************/
-
-UINT32
-DtGetFileSize (
- FILE *Handle)
-{
- int CurrentOffset;
- int LastOffset;
-
-
- CurrentOffset = ftell (Handle);
- fseek (Handle, 0, SEEK_END);
- LastOffset = ftell (Handle);
- fseek (Handle, CurrentOffset, SEEK_SET);
-
- return ((UINT32) LastOffset);
-}
-
-
-/******************************************************************************
- *
* FUNCTION: DtGetFieldValue
*
* PARAMETERS: Field - Current field list pointer
@@ -531,7 +501,9 @@ DtGetFieldLength (
case ACPI_DMT_SPACEID:
case ACPI_DMT_ACCWIDTH:
case ACPI_DMT_IVRS:
+ case ACPI_DMT_GTDT:
case ACPI_DMT_MADT:
+ case ACPI_DMT_PCCT:
case ACPI_DMT_PMTT:
case ACPI_DMT_SRAT:
case ACPI_DMT_ASF:
@@ -541,6 +513,7 @@ DtGetFieldLength (
case ACPI_DMT_EINJINST:
case ACPI_DMT_ERSTACT:
case ACPI_DMT_ERSTINST:
+ case ACPI_DMT_DMAR_SCOPE:
ByteLength = 1;
break;
@@ -562,6 +535,7 @@ DtGetFieldLength (
case ACPI_DMT_NAME4:
case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
+ case ACPI_DMT_LPIT:
ByteLength = 4;
break;
@@ -871,39 +845,151 @@ DtWalkTableTree (
}
-/******************************************************************************
+/*******************************************************************************
+ *
+ * FUNCTION: UtSubtableCacheCalloc
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Pointer to the buffer. Aborts on allocation failure
+ *
+ * DESCRIPTION: Allocate a subtable object buffer. Bypass the local
+ * dynamic memory manager for performance reasons (This has a
+ * major impact on the speed of the compiler.)
+ *
+ ******************************************************************************/
+
+DT_SUBTABLE *
+UtSubtableCacheCalloc (
+ void)
+{
+ ASL_CACHE_INFO *Cache;
+
+
+ if (Gbl_SubtableCacheNext >= Gbl_SubtableCacheLast)
+ {
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_SubtableCacheList;
+ Gbl_SubtableCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_SubtableCacheNext = ACPI_CAST_PTR (DT_SUBTABLE, Cache->Buffer);
+ Gbl_SubtableCacheLast = Gbl_SubtableCacheNext + ASL_SUBTABLE_CACHE_SIZE;
+ }
+
+ Gbl_SubtableCount++;
+ return (Gbl_SubtableCacheNext++);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: UtFieldCacheCalloc
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Pointer to the buffer. Aborts on allocation failure
+ *
+ * DESCRIPTION: Allocate a field object buffer. Bypass the local
+ * dynamic memory manager for performance reasons (This has a
+ * major impact on the speed of the compiler.)
+ *
+ ******************************************************************************/
+
+DT_FIELD *
+UtFieldCacheCalloc (
+ void)
+{
+ ASL_CACHE_INFO *Cache;
+
+
+ if (Gbl_FieldCacheNext >= Gbl_FieldCacheLast)
+ {
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_FieldCacheList;
+ Gbl_FieldCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_FieldCacheNext = ACPI_CAST_PTR (DT_FIELD, Cache->Buffer);
+ Gbl_FieldCacheLast = Gbl_FieldCacheNext + ASL_FIELD_CACHE_SIZE;
+ }
+
+ Gbl_FieldCount++;
+ return (Gbl_FieldCacheNext++);
+}
+
+
+/*******************************************************************************
*
- * FUNCTION: DtFreeFieldList
+ * FUNCTION: DtDeleteCaches
*
* PARAMETERS: None
*
* RETURN: None
*
- * DESCRIPTION: Free the field list
+ * DESCRIPTION: Delete all local cache buffer blocks
*
- *****************************************************************************/
+ ******************************************************************************/
void
-DtFreeFieldList (
+DtDeleteCaches (
void)
{
- DT_FIELD *Field = Gbl_FieldList;
- DT_FIELD *NextField;
+ UINT32 BufferCount;
+ ASL_CACHE_INFO *Next;
- /* Walk and free entire field list */
+ /* Field cache */
- while (Field)
+ BufferCount = 0;
+ while (Gbl_FieldCacheList)
{
- NextField = Field->Next; /* Save link */
+ Next = Gbl_FieldCacheList->Next;
+ ACPI_FREE (Gbl_FieldCacheList);
+ Gbl_FieldCacheList = Next;
+ BufferCount++;
+ }
- if (!(Field->Flags & DT_FIELD_NOT_ALLOCATED))
- {
- ACPI_FREE (Field->Name);
- ACPI_FREE (Field->Value);
- }
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Fields, Buffer size: %u fields (%u bytes), %u Buffers\n",
+ Gbl_FieldCount, ASL_FIELD_CACHE_SIZE,
+ (sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
+
+ Gbl_FieldCount = 0;
+ Gbl_FieldCacheNext = NULL;
+ Gbl_FieldCacheLast = NULL;
- ACPI_FREE (Field);
- Field = NextField;
+ /* Subtable cache */
+
+ BufferCount = 0;
+ while (Gbl_SubtableCacheList)
+ {
+ Next = Gbl_SubtableCacheList->Next;
+ ACPI_FREE (Gbl_SubtableCacheList);
+ Gbl_SubtableCacheList = Next;
+ BufferCount++;
}
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Subtables, Buffer size: %u subtables (%u bytes), %u Buffers\n",
+ Gbl_SubtableCount, ASL_SUBTABLE_CACHE_SIZE,
+ (sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
+
+ Gbl_SubtableCount = 0;
+ Gbl_SubtableCacheNext = NULL;
+ Gbl_SubtableCacheLast = NULL;
}
diff --git a/sys/contrib/dev/acpica/compiler/preprocess.h b/sys/contrib/dev/acpica/compiler/preprocess.h
index ae32a8c..5322034 100644
--- a/sys/contrib/dev/acpica/compiler/preprocess.h
+++ b/sys/contrib/dev/acpica/compiler/preprocess.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -257,7 +257,7 @@ PrGetNextToken (
void
PrError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 Column);
void
diff --git a/sys/contrib/dev/acpica/compiler/prexpress.c b/sys/contrib/dev/acpica/compiler/prexpress.c
index c0aa565..886da89 100644
--- a/sys/contrib/dev/acpica/compiler/prexpress.c
+++ b/sys/contrib/dev/acpica/compiler/prexpress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prmacros.c b/sys/contrib/dev/acpica/compiler/prmacros.c
index d76de8b..ad7dfa0 100644
--- a/sys/contrib/dev/acpica/compiler/prmacros.c
+++ b/sys/contrib/dev/acpica/compiler/prmacros.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -360,7 +360,7 @@ PrAddMacro (
if (ArgCount >= PR_MAX_MACRO_ARGS)
{
PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, TokenOffset);
- return;
+ goto ErrorExit;
}
}
@@ -400,7 +400,7 @@ PrAddMacro (
PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS,
THIS_TOKEN_OFFSET (Token));
- return;
+ goto ErrorExit;
}
break;
}
@@ -432,7 +432,7 @@ AddMacroToList:
THIS_TOKEN_OFFSET (Name));
}
- return;
+ goto ErrorExit;
}
DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
@@ -451,6 +451,13 @@ AddMacroToList:
DefineInfo->Args = Args;
DefineInfo->ArgCount = ArgCount;
}
+
+ return;
+
+
+ErrorExit:
+ ACPI_FREE (Args);
+ return;
}
diff --git a/sys/contrib/dev/acpica/compiler/prparser.l b/sys/contrib/dev/acpica/compiler/prparser.l
index b580d57..4fc4512 100644
--- a/sys/contrib/dev/acpica/compiler/prparser.l
+++ b/sys/contrib/dev/acpica/compiler/prparser.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prparser.y b/sys/contrib/dev/acpica/compiler/prparser.y
index 391ad3f..c7c1123 100644
--- a/sys/contrib/dev/acpica/compiler/prparser.y
+++ b/sys/contrib/dev/acpica/compiler/prparser.y
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prscan.c b/sys/contrib/dev/acpica/compiler/prscan.c
index a3ac0c2..ef5d52f 100644
--- a/sys/contrib/dev/acpica/compiler/prscan.c
+++ b/sys/contrib/dev/acpica/compiler/prscan.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prutils.c b/sys/contrib/dev/acpica/compiler/prutils.c
index 0dbf307..92d810f 100644
--- a/sys/contrib/dev/acpica/compiler/prutils.c
+++ b/sys/contrib/dev/acpica/compiler/prutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -149,7 +149,7 @@ PrGetNextToken (
void
PrError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 Column)
{
#if 0
@@ -340,7 +340,6 @@ PrOpenIncludeWithPrefix (
if (!IncludeFile)
{
fprintf (stderr, "Could not open include file %s\n", Pathname);
- ACPI_FREE (Pathname);
return (NULL);
}
@@ -393,15 +392,17 @@ PrPushInputFileStack (
/* Reset the global line count and filename */
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+
Gbl_Files[ASL_FILE_INPUT].Handle = InputFile;
Gbl_PreviousLineNumber = 0;
Gbl_CurrentLineNumber = 0;
/* Emit a new #line directive for the include file */
- FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n",
- 1, Filename);
+ FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", 1, Filename);
}
diff --git a/sys/contrib/dev/acpica/components/debugger/dbcmds.c b/sys/contrib/dev/acpica/components/debugger/dbcmds.c
index 921f428..f28ed2f 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbcmds.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbcmds.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
@@ -116,7 +115,7 @@ AcpiDbConvertToNode (
Node = ACPI_TO_POINTER (Address);
if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
{
- AcpiOsPrintf ("Address %p is invalid in this address space\n",
+ AcpiOsPrintf ("Address %p is invalid",
Node);
return (NULL);
}
@@ -125,7 +124,7 @@ AcpiDbConvertToNode (
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
- AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n",
+ AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n",
Node, AcpiUtGetDescriptorName (Node));
return (NULL);
}
@@ -139,6 +138,8 @@ AcpiDbConvertToNode (
Node = AcpiDbLocalNsLookup (InString);
if (!Node)
{
+ AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n",
+ InString);
Node = AcpiGbl_RootNode;
}
}
@@ -337,7 +338,7 @@ AcpiDbDisplayTableInfo (
/* Header */
- AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n");
+ AcpiOsPrintf ("Idx ID Status Type TableHeader (Sig, Address, Length)\n");
/* Walk the entire root table list */
@@ -362,35 +363,30 @@ AcpiDbDisplayTableInfo (
switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
{
- case ACPI_TABLE_ORIGIN_UNKNOWN:
-
- AcpiOsPrintf ("Unknown ");
- break;
-
- case ACPI_TABLE_ORIGIN_MAPPED:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
- AcpiOsPrintf ("Mapped ");
+ AcpiOsPrintf ("External/virtual ");
break;
- case ACPI_TABLE_ORIGIN_ALLOCATED:
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
- AcpiOsPrintf ("Allocated ");
+ AcpiOsPrintf ("Internal/physical ");
break;
- case ACPI_TABLE_ORIGIN_OVERRIDE:
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
- AcpiOsPrintf ("Override ");
+ AcpiOsPrintf ("Internal/virtual ");
break;
default:
- AcpiOsPrintf ("INVALID ");
+ AcpiOsPrintf ("INVALID TYPE ");
break;
}
/* Make sure that the table is mapped */
- Status = AcpiTbVerifyTable (TableDesc);
+ Status = AcpiTbValidateTable (TableDesc);
if (ACPI_FAILURE (Status))
{
return;
@@ -440,8 +436,6 @@ AcpiDbUnloadAcpiTable (
Node = AcpiDbConvertToNode (ObjectName);
if (!Node)
{
- AcpiOsPrintf ("Could not find [%s] in namespace\n",
- ObjectName);
return;
}
@@ -830,7 +824,7 @@ AcpiDmTestResourceConversion (
/* Convert internal resource list to external AML resource template */
- Status = AcpiRsCreateAmlResources (ResourceBuffer.Pointer, &NewAml);
+ Status = AcpiRsCreateAmlResources (&ResourceBuffer, &NewAml);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n",
@@ -842,8 +836,8 @@ AcpiDmTestResourceConversion (
OriginalAml = ReturnBuffer.Pointer;
- AcpiDmCompareAmlResources (
- OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
+ AcpiDmCompareAmlResources (OriginalAml->Buffer.Pointer,
+ (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length);
/* Cleanup and exit */
@@ -1042,7 +1036,7 @@ GetCrs:
}
EndCrs:
- ACPI_FREE_BUFFER (ReturnBuffer);
+ ACPI_FREE (ReturnBuffer.Pointer);
}
@@ -1192,14 +1186,25 @@ AcpiDbGenerateGpe (
char *GpeArg,
char *BlockArg)
{
- UINT32 BlockNumber;
+ UINT32 BlockNumber = 0;
UINT32 GpeNumber;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
- GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
- BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
+ GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
+ /*
+ * If no block arg, or block arg == 0 or 1, use the FADT-defined
+ * GPE blocks.
+ */
+ if (BlockArg)
+ {
+ BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
+ if (BlockNumber == 1)
+ {
+ BlockNumber = 0;
+ }
+ }
GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
GpeNumber);
diff --git a/sys/contrib/dev/acpica/components/debugger/dbconvert.c b/sys/contrib/dev/acpica/components/debugger/dbconvert.c
index 6daa753..1b23002 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbconvert.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbconvert.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
diff --git a/sys/contrib/dev/acpica/components/debugger/dbdisply.c b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
index 62edea0..988ab83 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbdisply.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -303,6 +302,10 @@ AcpiDbDecodeAndDisplayObject (
/* Is not a recognizeable object */
+ AcpiOsPrintf (
+ "Not a known ACPI internal object, descriptor type %2.2X\n",
+ ACPI_GET_DESCRIPTOR_TYPE (ObjPtr));
+
Size = 16;
if (AcpiOsReadable (ObjPtr, 64))
{
diff --git a/sys/contrib/dev/acpica/components/debugger/dbexec.c b/sys/contrib/dev/acpica/components/debugger/dbexec.c
index 2566e2d..da90784 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbexec.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbexec.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -62,7 +61,7 @@ AcpiDbExecuteMethod (
ACPI_DB_METHOD_INFO *Info,
ACPI_BUFFER *ReturnObj);
-static void
+static ACPI_STATUS
AcpiDbExecuteSetup (
ACPI_DB_METHOD_INFO *Info);
@@ -237,10 +236,15 @@ Cleanup:
*
******************************************************************************/
-static void
+static ACPI_STATUS
AcpiDbExecuteSetup (
ACPI_DB_METHOD_INFO *Info)
{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_NAME (DbExecuteSetup);
+
/* Catenate the current scope to the supplied name */
@@ -248,10 +252,21 @@ AcpiDbExecuteSetup (
if ((Info->Name[0] != '\\') &&
(Info->Name[0] != '/'))
{
- ACPI_STRCAT (Info->Pathname, AcpiGbl_DbScopeBuf);
+ if (AcpiUtSafeStrcat (Info->Pathname, sizeof (Info->Pathname),
+ AcpiGbl_DbScopeBuf))
+ {
+ Status = AE_BUFFER_OVERFLOW;
+ goto ErrorExit;
+ }
+ }
+
+ if (AcpiUtSafeStrcat (Info->Pathname, sizeof (Info->Pathname),
+ Info->Name))
+ {
+ Status = AE_BUFFER_OVERFLOW;
+ goto ErrorExit;
}
- ACPI_STRCAT (Info->Pathname, Info->Name);
AcpiDbPrepNamestring (Info->Pathname);
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
@@ -269,6 +284,13 @@ AcpiDbExecuteSetup (
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
}
+
+ return (AE_OK);
+
+ErrorExit:
+
+ ACPI_EXCEPTION ((AE_INFO, Status, "During setup for method execution"));
+ return (Status);
}
@@ -429,7 +451,12 @@ AcpiDbExecute (
ReturnObj.Pointer = NULL;
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
- AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (NameString);
+ return;
+ }
/* Get the NS node, determines existence also */
@@ -729,7 +756,11 @@ AcpiDbCreateExecutionThreads (
AcpiDbUint32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr);
- AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ goto CleanupAndExit;
+ }
/* Get the NS node, determines existence also */
diff --git a/sys/contrib/dev/acpica/components/debugger/dbfileio.c b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
index 05fa4e7..579d2ac 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbfileio.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,48 +42,18 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
-
-#ifdef ACPI_APPLICATION
#include <contrib/dev/acpica/include/actables.h>
-#endif
-
-#ifdef ACPI_ASL_COMPILER
-#include <contrib/dev/acpica/compiler/aslcompiler.h>
-#endif
#if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER)
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
-/*
- * NOTE: this is here for lack of a better place. It is used in all
- * flavors of the debugger, need LCD file
- */
-#ifdef ACPI_APPLICATION
-#include <stdio.h>
-FILE *AcpiGbl_DebugFile = NULL;
-#endif
-
-
#ifdef ACPI_DEBUGGER
-/* Local prototypes */
-
-#ifdef ACPI_APPLICATION
-
-static ACPI_STATUS
-AcpiDbCheckTextModeCorruption (
- UINT8 *Table,
- UINT32 TableLength,
- UINT32 FileLength);
-
-#endif
-
/*******************************************************************************
*
* FUNCTION: AcpiDbCloseDebugFile
@@ -152,242 +122,7 @@ AcpiDbOpenDebugFile (
#ifdef ACPI_APPLICATION
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbCheckTextModeCorruption
- *
- * PARAMETERS: Table - Table buffer
- * TableLength - Length of table from the table header
- * FileLength - Length of the file that contains the table
- *
- * RETURN: Status
- *
- * DESCRIPTION: Check table for text mode file corruption where all linefeed
- * characters (LF) have been replaced by carriage return linefeed
- * pairs (CR/LF).
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiDbCheckTextModeCorruption (
- UINT8 *Table,
- UINT32 TableLength,
- UINT32 FileLength)
-{
- UINT32 i;
- UINT32 Pairs = 0;
-
-
- if (TableLength != FileLength)
- {
- ACPI_WARNING ((AE_INFO,
- "File length (0x%X) is not the same as the table length (0x%X)",
- FileLength, TableLength));
- }
-
- /* Scan entire table to determine if each LF has been prefixed with a CR */
-
- for (i = 1; i < FileLength; i++)
- {
- if (Table[i] == 0x0A)
- {
- if (Table[i - 1] != 0x0D)
- {
- /* The LF does not have a preceding CR, table not corrupted */
-
- return (AE_OK);
- }
- else
- {
- /* Found a CR/LF pair */
-
- Pairs++;
- }
- i++;
- }
- }
-
- if (!Pairs)
- {
- return (AE_OK);
- }
-
- /*
- * Entire table scanned, each CR is part of a CR/LF pair --
- * meaning that the table was treated as a text file somewhere.
- *
- * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
- * original table are left untouched by the text conversion process --
- * meaning that we cannot simply replace CR/LF pairs with LFs.
- */
- AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
- AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
- AcpiOsPrintf ("Table cannot be repaired!\n");
- return (AE_BAD_VALUE);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbReadTable
- *
- * PARAMETERS: fp - File that contains table
- * Table - Return value, buffer with table
- * TableLength - Return value, length of table
- *
- * RETURN: Status
- *
- * DESCRIPTION: Load the DSDT from the file pointer
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiDbReadTable (
- FILE *fp,
- ACPI_TABLE_HEADER **Table,
- UINT32 *TableLength)
-{
- ACPI_TABLE_HEADER TableHeader;
- UINT32 Actual;
- ACPI_STATUS Status;
- UINT32 FileSize;
- BOOLEAN StandardHeader = TRUE;
-
-
- /* Get the file size */
-
- fseek (fp, 0, SEEK_END);
- FileSize = (UINT32) ftell (fp);
- fseek (fp, 0, SEEK_SET);
-
- if (FileSize < 4)
- {
- return (AE_BAD_HEADER);
- }
-
- /* Read the signature */
-
- if (fread (&TableHeader, 1, 4, fp) != 4)
- {
- AcpiOsPrintf ("Could not read the table signature\n");
- return (AE_BAD_HEADER);
- }
-
- fseek (fp, 0, SEEK_SET);
-
- /* The RSDP table does not have standard ACPI header */
-
- if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD "))
- {
- *TableLength = FileSize;
- StandardHeader = FALSE;
- }
- else
- {
- /* Read the table header */
-
- if (fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp) !=
- sizeof (ACPI_TABLE_HEADER))
- {
- AcpiOsPrintf ("Could not read the table header\n");
- return (AE_BAD_HEADER);
- }
-
-#if 0
- /* Validate the table header/length */
-
- Status = AcpiTbValidateTableHeader (&TableHeader);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Table header is invalid!\n");
- return (Status);
- }
-#endif
-
- /* File size must be at least as long as the Header-specified length */
-
- if (TableHeader.Length > FileSize)
- {
- AcpiOsPrintf (
- "TableHeader length [0x%X] greater than the input file size [0x%X]\n",
- TableHeader.Length, FileSize);
-
-#ifdef ACPI_ASL_COMPILER
- Status = FlCheckForAscii (fp, NULL, FALSE);
- if (ACPI_SUCCESS (Status))
- {
- AcpiOsPrintf ("File appears to be ASCII only, must be binary\n",
- TableHeader.Length, FileSize);
- }
-#endif
- return (AE_BAD_HEADER);
- }
-
-#ifdef ACPI_OBSOLETE_CODE
- /* We only support a limited number of table types */
-
- if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) &&
- !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) &&
- !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT))
- {
- AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n",
- (char *) TableHeader.Signature);
- ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER));
- return (AE_ERROR);
- }
-#endif
-
- *TableLength = TableHeader.Length;
- }
-
- /* Allocate a buffer for the table */
-
- *Table = AcpiOsAllocate ((size_t) FileSize);
- if (!*Table)
- {
- AcpiOsPrintf (
- "Could not allocate memory for ACPI table %4.4s (size=0x%X)\n",
- TableHeader.Signature, *TableLength);
- return (AE_NO_MEMORY);
- }
-
- /* Get the rest of the table */
-
- fseek (fp, 0, SEEK_SET);
- Actual = fread (*Table, 1, (size_t) FileSize, fp);
- if (Actual == FileSize)
- {
- if (StandardHeader)
- {
- /* Now validate the checksum */
-
- Status = AcpiTbVerifyChecksum ((void *) *Table,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
-
- if (Status == AE_BAD_CHECKSUM)
- {
- Status = AcpiDbCheckTextModeCorruption ((UINT8 *) *Table,
- FileSize, (*Table)->Length);
- return (Status);
- }
- }
- return (AE_OK);
- }
-
- if (Actual > 0)
- {
- AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n",
- FileSize, Actual);
- return (AE_OK);
- }
-
- AcpiOsPrintf ("Error - could not read the table file\n");
- AcpiOsFree (*Table);
- *Table = NULL;
- *TableLength = 0;
- return (AE_ERROR);
-}
-
+#include <contrib/dev/acpica/include/acapps.h>
/*******************************************************************************
*
@@ -431,7 +166,7 @@ AeLocalLoadTable (
/* Install the new table into the local data structures */
- Status = AcpiTbInstallTable (&TableInfo);
+ Status = AcpiTbInitTableDescriptor (&TableInfo);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -462,54 +197,6 @@ AeLocalLoadTable (
return_ACPI_STATUS (Status);
}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbReadTableFromFile
- *
- * PARAMETERS: Filename - File where table is located
- * Table - Where a pointer to the table is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Get an ACPI table from a file
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiDbReadTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **Table)
-{
- FILE *File;
- UINT32 TableLength;
- ACPI_STATUS Status;
-
-
- /* Open the file */
-
- File = fopen (Filename, "rb");
- if (!File)
- {
- AcpiOsPrintf ("Could not open input file %s\n", Filename);
- return (AE_ERROR);
- }
-
- /* Get the entire file */
-
- fprintf (stderr, "Loading Acpi table from file %s\n", Filename);
- Status = AcpiDbReadTable (File, Table, &TableLength);
- fclose(File);
-
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not get table from the file\n");
- return (Status);
- }
-
- return (AE_OK);
- }
#endif
@@ -537,7 +224,7 @@ AcpiDbGetTableFromFile (
BOOLEAN IsAmlTable = TRUE;
- Status = AcpiDbReadTableFromFile (Filename, &Table);
+ Status = AcpiUtReadTableFromFile (Filename, &Table);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -568,6 +255,8 @@ AcpiDbGetTableFromFile (
return (Status);
}
+ AcpiTbPrintTableHeader (0, Table);
+
fprintf (stderr,
"Acpi table [%4.4s] successfully installed and loaded\n",
Table->Signature);
diff --git a/sys/contrib/dev/acpica/components/debugger/dbhistry.c b/sys/contrib/dev/acpica/components/debugger/dbhistry.c
index 4a97ba4..4a6935b 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbhistry.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbhistry.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -69,7 +68,7 @@ static HISTORY_INFO AcpiGbl_HistoryBuffer[HISTORY_SIZE];
static UINT16 AcpiGbl_LoHistory = 0;
static UINT16 AcpiGbl_NumHistory = 0;
static UINT16 AcpiGbl_NextHistoryIndex = 0;
-static UINT32 AcpiGbl_NextCmdNum = 1;
+UINT32 AcpiGbl_NextCmdNum = 1;
/*******************************************************************************
@@ -94,6 +93,11 @@ AcpiDbAddToHistory (
/* Put command into the next available slot */
CmdLen = (UINT16) ACPI_STRLEN (CommandLine);
+ if (!CmdLen)
+ {
+ return;
+ }
+
if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL)
{
BufferLen = (UINT16) ACPI_STRLEN (
@@ -203,8 +207,6 @@ char *
AcpiDbGetFromHistory (
char *CommandNumArg)
{
- UINT32 i;
- UINT16 HistoryIndex;
UINT32 CmdNum;
@@ -218,6 +220,31 @@ AcpiDbGetFromHistory (
CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0);
}
+ return (AcpiDbGetHistoryByIndex (CmdNum));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbGetHistoryByIndex
+ *
+ * PARAMETERS: CmdNum - Index of the desired history entry.
+ * Values are 0...(AcpiGbl_NextCmdNum - 1)
+ *
+ * RETURN: Pointer to the retrieved command. Null on error.
+ *
+ * DESCRIPTION: Get a command from the history buffer
+ *
+ ******************************************************************************/
+
+char *
+AcpiDbGetHistoryByIndex (
+ UINT32 CmdNum)
+{
+ UINT32 i;
+ UINT16 HistoryIndex;
+
+
/* Search history buffer */
HistoryIndex = AcpiGbl_LoHistory;
@@ -230,6 +257,7 @@ AcpiDbGetFromHistory (
return (AcpiGbl_HistoryBuffer[HistoryIndex].Command);
}
+ /* History buffer is circular */
HistoryIndex++;
if (HistoryIndex >= HISTORY_SIZE)
diff --git a/sys/contrib/dev/acpica/components/debugger/dbinput.c b/sys/contrib/dev/acpica/components/debugger/dbinput.c
index c1a51f8..309bcc3 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbinput.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbinput.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -93,7 +92,6 @@ enum AcpiExDebuggerCommands
CMD_ALLOCATIONS,
CMD_ARGS,
CMD_ARGUMENTS,
- CMD_BATCH,
CMD_BREAKPOINT,
CMD_BUSINFO,
CMD_CALL,
@@ -128,7 +126,7 @@ enum AcpiExDebuggerCommands
CMD_METHODS,
CMD_NAMESPACE,
CMD_NOTIFY,
- CMD_OBJECT,
+ CMD_OBJECTS,
CMD_OPEN,
CMD_OSI,
CMD_OWNER,
@@ -147,6 +145,7 @@ enum AcpiExDebuggerCommands
CMD_TABLES,
CMD_TEMPLATE,
CMD_TERMINATE,
+ CMD_TEST,
CMD_THREADS,
CMD_TRACE,
CMD_TREE,
@@ -166,7 +165,6 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"ALLOCATIONS", 0},
{"ARGS", 0},
{"ARGUMENTS", 0},
- {"BATCH", 0},
{"BREAKPOINT", 1},
{"BUSINFO", 0},
{"CALL", 0},
@@ -182,7 +180,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"EXIT", 0},
{"FIND", 1},
{"GO", 0},
- {"GPE", 2},
+ {"GPE", 1},
{"GPES", 0},
{"HANDLERS", 0},
{"HELP", 0},
@@ -201,7 +199,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"METHODS", 0},
{"NAMESPACE", 0},
{"NOTIFY", 2},
- {"OBJECT", 1},
+ {"OBJECTS", 1},
{"OPEN", 1},
{"OSI", 0},
{"OWNER", 1},
@@ -220,6 +218,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"TABLES", 0},
{"TEMPLATE", 1},
{"TERMINATE", 0},
+ {"TEST", 1},
{"THREADS", 3},
{"TRACE", 1},
{"TREE", 0},
@@ -246,8 +245,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
{1, " Locks", "Current status of internal mutexes\n"},
{1, " Osi [Install|Remove <name>]", "Display or modify global _OSI list\n"},
{1, " Quit or Exit", "Exit this command\n"},
- {9, " Stats [Allocations|Memory|Misc|", "\n"},
- {1, " Objects|Sizes|Stack|Tables]", "Display namespace and memory statistics\n"},
+ {8, " Stats <SubCommand>", "Display namespace and memory statistics\n"},
{1, " Allocations", "Display list of current memory allocations\n"},
{1, " Memory", "Dump internal memory lists\n"},
{1, " Misc", "Namespace search and mutex stats\n"},
@@ -306,7 +304,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
{0, "\nHardware Related Commands:", "\n"},
{1, " Event <F|G> <Value>", "Generate AcpiEvent (Fixed/GPE)\n"},
- {1, " Gpe <GpeNum> <GpeBlock>", "Simulate a GPE\n"},
+ {1, " Gpe <GpeNum> [GpeBlockDevice]", "Simulate a GPE\n"},
{1, " Gpes", "Display info on all GPEs\n"},
{1, " Sci", "Generate an SCI\n"},
{1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"},
@@ -315,6 +313,11 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
{1, " Close", "Close debug output file\n"},
{1, " Load <Input Filename>", "Load ACPI table from a file\n"},
{1, " Open <Output Filename>", "Open a file for debug output\n"},
+
+ {0, "\nDebug Test Commands:", "\n"},
+ {3, " Test <TestName>", "Invoke a debug test\n"},
+ {1, " Objects", "Read/write/compare all namespace data objects\n"},
+ {1, " Predefined", "Execute all ACPI predefined names (_STA, etc.)\n"},
{0, NULL, NULL}
};
@@ -635,7 +638,13 @@ AcpiDbGetLine (
char *This;
- ACPI_STRCPY (AcpiGbl_DbParsedBuf, InputBuffer);
+ if (AcpiUtSafeStrcpy (AcpiGbl_DbParsedBuf, sizeof (AcpiGbl_DbParsedBuf),
+ InputBuffer))
+ {
+ AcpiOsPrintf ("Buffer overflow while parsing input line (max %u characters)\n",
+ sizeof (AcpiGbl_DbParsedBuf));
+ return (0);
+ }
This = AcpiGbl_DbParsedBuf;
for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
@@ -740,6 +749,11 @@ AcpiDbCommandDispatch (
return (AE_CTRL_TERMINATE);
}
+
+ /* Add all commands that come here to the history buffer */
+
+ AcpiDbAddToHistory (InputBuffer);
+
ParamCount = AcpiDbGetLine (InputBuffer);
CommandIndex = AcpiDbMatchCommand (AcpiGbl_DbArgs[0]);
Temp = 0;
@@ -781,11 +795,6 @@ AcpiDbCommandDispatch (
AcpiDbDisplayArguments ();
break;
- case CMD_BATCH:
-
- AcpiDbBatchExecute (AcpiGbl_DbArgs[1]);
- break;
-
case CMD_BREAKPOINT:
AcpiDbSetMethodBreakpoint (AcpiGbl_DbArgs[1], WalkState, Op);
@@ -989,7 +998,7 @@ AcpiDbCommandDispatch (
AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp);
break;
- case CMD_OBJECT:
+ case CMD_OBJECTS:
AcpiUtStrupr (AcpiGbl_DbArgs[1]);
Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
@@ -1088,6 +1097,11 @@ AcpiDbCommandDispatch (
/* AcpiInitialize (NULL); */
break;
+ case CMD_TEST:
+
+ AcpiDbExecuteTest (AcpiGbl_DbArgs[1]);
+ break;
+
case CMD_THREADS:
AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
@@ -1135,7 +1149,7 @@ AcpiDbCommandDispatch (
case CMD_NOT_FOUND:
default:
- AcpiOsPrintf ("Unknown Command\n");
+ AcpiOsPrintf ("%s: unknown command\n", AcpiGbl_DbArgs[0]);
return (AE_CTRL_TRUE);
}
@@ -1144,9 +1158,6 @@ AcpiDbCommandDispatch (
Status = AE_CTRL_TRUE;
}
- /* Add all commands that come here to the history buffer */
-
- AcpiDbAddToHistory (InputBuffer);
return (Status);
}
diff --git a/sys/contrib/dev/acpica/components/debugger/dbmethod.c b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
index ca2d92b..dc8a09a 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbmethod.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
@@ -58,16 +57,6 @@
ACPI_MODULE_NAME ("dbmethod")
-/* Local prototypes */
-
-static ACPI_STATUS
-AcpiDbWalkForExecute (
- ACPI_HANDLE ObjHandle,
- UINT32 NestingLevel,
- void *Context,
- void **ReturnValue);
-
-
/*******************************************************************************
*
* FUNCTION: AcpiDbSetMethodBreakpoint
@@ -190,6 +179,11 @@ AcpiDbSetMethodData (
if (Type == 'N')
{
Node = AcpiDbConvertToNode (IndexArg);
+ if (!Node)
+ {
+ return;
+ }
+
if (Node->Type != ACPI_TYPE_INTEGER)
{
AcpiOsPrintf ("Can only set Integer nodes\n");
@@ -418,195 +412,4 @@ AcpiDbDisassembleMethod (
return (AE_OK);
}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbWalkForExecute
- *
- * PARAMETERS: Callback from WalkNamespace
- *
- * RETURN: Status
- *
- * DESCRIPTION: Batch execution module. Currently only executes predefined
- * ACPI names.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiDbWalkForExecute (
- ACPI_HANDLE ObjHandle,
- UINT32 NestingLevel,
- void *Context,
- void **ReturnValue)
-{
- ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
- ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context;
- char *Pathname;
- const ACPI_PREDEFINED_INFO *Predefined;
- ACPI_DEVICE_INFO *ObjInfo;
- ACPI_OBJECT_LIST ParamObjects;
- ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
- ACPI_OBJECT *ThisParam;
- ACPI_BUFFER ReturnObj;
- ACPI_STATUS Status;
- UINT16 ArgTypeList;
- UINT8 ArgCount;
- UINT8 ArgType;
- UINT32 i;
-
-
- /* The name must be a predefined ACPI name */
-
- Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
- if (!Predefined)
- {
- return (AE_OK);
- }
-
- if (Node->Type == ACPI_TYPE_LOCAL_SCOPE)
- {
- return (AE_OK);
- }
-
- Pathname = AcpiNsGetExternalPathname (Node);
- if (!Pathname)
- {
- return (AE_OK);
- }
-
- /* Get the object info for number of method parameters */
-
- Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParamObjects.Count = 0;
- ParamObjects.Pointer = NULL;
-
- if (ObjInfo->Type == ACPI_TYPE_METHOD)
- {
- /* Setup default parameters (with proper types) */
-
- ArgTypeList = Predefined->Info.ArgumentList;
- ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList);
-
- /*
- * Setup the ACPI-required number of arguments, regardless of what
- * the actual method defines. If there is a difference, then the
- * method is wrong and a warning will be issued during execution.
- */
- ThisParam = Params;
- for (i = 0; i < ArgCount; i++)
- {
- ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList);
- ThisParam->Type = ArgType;
-
- switch (ArgType)
- {
- case ACPI_TYPE_INTEGER:
-
- ThisParam->Integer.Value = 1;
- break;
-
- case ACPI_TYPE_STRING:
-
- ThisParam->String.Pointer = "This is the default argument string";
- ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer);
- break;
-
- case ACPI_TYPE_BUFFER:
-
- ThisParam->Buffer.Pointer = (UINT8 *) Params; /* just a garbage buffer */
- ThisParam->Buffer.Length = 48;
- break;
-
- case ACPI_TYPE_PACKAGE:
-
- ThisParam->Package.Elements = NULL;
- ThisParam->Package.Count = 0;
- break;
-
- default:
-
- AcpiOsPrintf ("%s: Unsupported argument type: %u\n",
- Pathname, ArgType);
- break;
- }
-
- ThisParam++;
- }
-
- ParamObjects.Count = ArgCount;
- ParamObjects.Pointer = Params;
- }
-
- ACPI_FREE (ObjInfo);
- ReturnObj.Pointer = NULL;
- ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
-
- /* Do the actual method execution */
-
- AcpiGbl_MethodExecuting = TRUE;
-
- Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
-
- AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
- AcpiGbl_MethodExecuting = FALSE;
- ACPI_FREE (Pathname);
-
- /* Ignore status from method execution */
-
- Status = AE_OK;
-
- /* Update count, check if we have executed enough methods */
-
- Info->Count++;
- if (Info->Count >= Info->MaxCount)
- {
- Status = AE_CTRL_TERMINATE;
- }
-
- return (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbBatchExecute
- *
- * PARAMETERS: CountArg - Max number of methods to execute
- *
- * RETURN: None
- *
- * DESCRIPTION: Namespace batch execution. Execute predefined names in the
- * namespace, up to the max count, if specified.
- *
- ******************************************************************************/
-
-void
-AcpiDbBatchExecute (
- char *CountArg)
-{
- ACPI_DB_EXECUTE_WALK Info;
-
-
- Info.Count = 0;
- Info.MaxCount = ACPI_UINT32_MAX;
-
- if (CountArg)
- {
- Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0);
- }
-
-
- /* Search all nodes in namespace */
-
- (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
- AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
-
- AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
-}
-
#endif /* ACPI_DEBUGGER */
diff --git a/sys/contrib/dev/acpica/components/debugger/dbnames.c b/sys/contrib/dev/acpica/components/debugger/dbnames.c
index 5ac39fd..4345f3a 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbnames.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -171,8 +170,7 @@ AcpiDbSetScope (
goto ErrorExit;
}
- ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
- ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
+ AcpiGbl_DbScopeBuf[0] = 0;
}
else
{
@@ -184,9 +182,22 @@ AcpiDbSetScope (
{
goto ErrorExit;
}
+ }
- ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
- ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
+ /* Build the final pathname */
+
+ if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
+ Name))
+ {
+ Status = AE_BUFFER_OVERFLOW;
+ goto ErrorExit;
+ }
+
+ if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
+ "\\"))
+ {
+ Status = AE_BUFFER_OVERFLOW;
+ goto ErrorExit;
}
AcpiGbl_DbScopeNode = Node;
diff --git a/sys/contrib/dev/acpica/components/debugger/dbstats.c b/sys/contrib/dev/acpica/components/debugger/dbstats.c
index ef23634..9430854 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbstats.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbstats.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -401,7 +400,7 @@ AcpiDbDisplayStatistics (
AcpiUtStrupr (TypeArg);
Temp = AcpiDbMatchArgument (TypeArg, AcpiDbStatTypes);
- if (Temp == (UINT32) -1)
+ if (Temp == ACPI_TYPE_NOT_FOUND)
{
AcpiOsPrintf ("Invalid or unsupported argument\n");
return (AE_OK);
diff --git a/sys/contrib/dev/acpica/components/debugger/dbtest.c b/sys/contrib/dev/acpica/components/debugger/dbtest.c
new file mode 100644
index 0000000..fe7a33f
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/debugger/dbtest.c
@@ -0,0 +1,1138 @@
+/*******************************************************************************
+ *
+ * Module Name: dbtest - Various debug-related tests
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acdebug.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/acpredef.h>
+
+#ifdef ACPI_DEBUGGER
+
+#define _COMPONENT ACPI_CA_DEBUGGER
+ ACPI_MODULE_NAME ("dbtest")
+
+
+/* Local prototypes */
+
+static void
+AcpiDbTestAllObjects (
+ void);
+
+static ACPI_STATUS
+AcpiDbTestOneObject (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue);
+
+static ACPI_STATUS
+AcpiDbTestIntegerType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 BitLength);
+
+static ACPI_STATUS
+AcpiDbTestBufferType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 BitLength);
+
+static ACPI_STATUS
+AcpiDbTestStringType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 ByteLength);
+
+static ACPI_STATUS
+AcpiDbReadFromObject (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OBJECT_TYPE ExpectedType,
+ ACPI_OBJECT **Value);
+
+static ACPI_STATUS
+AcpiDbWriteToObject (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OBJECT *Value);
+
+static void
+AcpiDbEvaluateAllPredefinedNames (
+ char *CountArg);
+
+static ACPI_STATUS
+AcpiDbEvaluateOnePredefinedName (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue);
+
+/*
+ * Test subcommands
+ */
+static ACPI_DB_ARGUMENT_INFO AcpiDbTestTypes [] =
+{
+ {"OBJECTS"},
+ {"PREDEFINED"},
+ {NULL} /* Must be null terminated */
+};
+
+#define CMD_TEST_OBJECTS 0
+#define CMD_TEST_PREDEFINED 1
+
+#define BUFFER_FILL_VALUE 0xFF
+
+/*
+ * Support for the special debugger read/write control methods.
+ * These methods are installed into the current namespace and are
+ * used to read and write the various namespace objects. The point
+ * is to force the AML interpreter do all of the work.
+ */
+#define ACPI_DB_READ_METHOD "\\_T98"
+#define ACPI_DB_WRITE_METHOD "\\_T99"
+
+static ACPI_HANDLE ReadHandle = NULL;
+static ACPI_HANDLE WriteHandle = NULL;
+
+/* ASL Definitions of the debugger read/write control methods */
+
+#if 0
+DefinitionBlock ("ssdt.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
+{
+ Method (_T98, 1, NotSerialized) /* Read */
+ {
+ Return (DeRefOf (Arg0))
+ }
+}
+DefinitionBlock ("ssdt2.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
+{
+ Method (_T99, 2, NotSerialized) /* Write */
+ {
+ Store (Arg1, Arg0)
+ }
+}
+#endif
+
+static unsigned char ReadMethodCode[] =
+{
+ 0x53,0x53,0x44,0x54,0x2E,0x00,0x00,0x00, /* 00000000 "SSDT...." */
+ 0x02,0xC9,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
+ 0x44,0x45,0x42,0x55,0x47,0x00,0x00,0x00, /* 00000010 "DEBUG..." */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x18,0x12,0x13,0x20,0x14,0x09,0x5F,0x54, /* 00000020 "... .._T" */
+ 0x39,0x38,0x01,0xA4,0x83,0x68 /* 00000028 "98...h" */
+};
+
+static unsigned char WriteMethodCode[] =
+{
+ 0x53,0x53,0x44,0x54,0x2E,0x00,0x00,0x00, /* 00000000 "SSDT...." */
+ 0x02,0x15,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
+ 0x44,0x45,0x42,0x55,0x47,0x00,0x00,0x00, /* 00000010 "DEBUG..." */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x18,0x12,0x13,0x20,0x14,0x09,0x5F,0x54, /* 00000020 "... .._T" */
+ 0x39,0x39,0x02,0x70,0x69,0x68 /* 00000028 "99.pih" */
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbExecuteTest
+ *
+ * PARAMETERS: TypeArg - Subcommand
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Execute various debug tests.
+ *
+ * Note: Code is prepared for future expansion of the TEST command.
+ *
+ ******************************************************************************/
+
+void
+AcpiDbExecuteTest (
+ char *TypeArg)
+{
+ UINT32 Temp;
+
+
+ AcpiUtStrupr (TypeArg);
+ Temp = AcpiDbMatchArgument (TypeArg, AcpiDbTestTypes);
+ if (Temp == ACPI_TYPE_NOT_FOUND)
+ {
+ AcpiOsPrintf ("Invalid or unsupported argument\n");
+ return;
+ }
+
+ switch (Temp)
+ {
+ case CMD_TEST_OBJECTS:
+
+ AcpiDbTestAllObjects ();
+ break;
+
+ case CMD_TEST_PREDEFINED:
+
+ AcpiDbEvaluateAllPredefinedNames (NULL);
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestAllObjects
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: This test implements the OBJECTS subcommand. It exercises the
+ * namespace by reading/writing/comparing all data objects such
+ * as integers, strings, buffers, fields, buffer fields, etc.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDbTestAllObjects (
+ void)
+{
+ ACPI_STATUS Status;
+
+
+ /* Install the debugger read-object control method if necessary */
+
+ if (!ReadHandle)
+ {
+ Status = AcpiInstallMethod (ReadMethodCode);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("%s, Could not install debugger read method\n",
+ AcpiFormatException (Status));
+ return;
+ }
+
+ Status = AcpiGetHandle (NULL, ACPI_DB_READ_METHOD, &ReadHandle);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not obtain handle for debug method %s\n",
+ ACPI_DB_READ_METHOD);
+ return;
+ }
+ }
+
+ /* Install the debugger write-object control method if necessary */
+
+ if (!WriteHandle)
+ {
+ Status = AcpiInstallMethod (WriteMethodCode);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("%s, Could not install debugger write method\n",
+ AcpiFormatException (Status));
+ return;
+ }
+
+ Status = AcpiGetHandle (NULL, ACPI_DB_WRITE_METHOD, &WriteHandle);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not obtain handle for debug method %s\n",
+ ACPI_DB_WRITE_METHOD);
+ return;
+ }
+ }
+
+ /* Walk the entire namespace, testing each supported named data object */
+
+ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, AcpiDbTestOneObject, NULL, NULL, NULL);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestOneObject
+ *
+ * PARAMETERS: ACPI_WALK_CALLBACK
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Test one namespace object. Supported types are Integer,
+ * String, Buffer, BufferField, and FieldUnit. All other object
+ * types are simply ignored.
+ *
+ * Note: Support for Packages is not implemented.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbTestOneObject (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue)
+{
+ ACPI_NAMESPACE_NODE *Node;
+ ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *RegionObj;
+ ACPI_OBJECT_TYPE LocalType;
+ UINT32 BitLength = 0;
+ UINT32 ByteLength = 0;
+ ACPI_STATUS Status = AE_OK;
+
+
+ Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
+ ObjDesc = Node->Object;
+
+ /*
+ * For the supported types, get the actual bit length or
+ * byte length. Map the type to one of Integer/String/Buffer.
+ */
+ switch (Node->Type)
+ {
+ case ACPI_TYPE_INTEGER:
+
+ /* Integer width is either 32 or 64 */
+
+ LocalType = ACPI_TYPE_INTEGER;
+ BitLength = AcpiGbl_IntegerBitWidth;
+ break;
+
+ case ACPI_TYPE_STRING:
+
+ LocalType = ACPI_TYPE_STRING;
+ ByteLength = ObjDesc->String.Length;
+ break;
+
+ case ACPI_TYPE_BUFFER:
+
+ LocalType = ACPI_TYPE_BUFFER;
+ ByteLength = ObjDesc->Buffer.Length;
+ BitLength = ByteLength * 8;
+ break;
+
+ case ACPI_TYPE_FIELD_UNIT:
+ case ACPI_TYPE_BUFFER_FIELD:
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+ case ACPI_TYPE_LOCAL_INDEX_FIELD:
+ case ACPI_TYPE_LOCAL_BANK_FIELD:
+
+ LocalType = ACPI_TYPE_INTEGER;
+ if (ObjDesc)
+ {
+ /*
+ * Returned object will be a Buffer if the field length
+ * is larger than the size of an Integer (32 or 64 bits
+ * depending on the DSDT version).
+ */
+ BitLength = ObjDesc->CommonField.BitLength;
+ ByteLength = ACPI_ROUND_BITS_UP_TO_BYTES (BitLength);
+ if (BitLength > AcpiGbl_IntegerBitWidth)
+ {
+ LocalType = ACPI_TYPE_BUFFER;
+ }
+ }
+ break;
+
+ default:
+
+ /* Ignore all other types */
+
+ return (AE_OK);
+ }
+
+ /* Emit the common prefix: Type:Name */
+
+ AcpiOsPrintf ("%14s: %4.4s",
+ AcpiUtGetTypeName (Node->Type), Node->Name.Ascii);
+ if (!ObjDesc)
+ {
+ AcpiOsPrintf (" Ignoring, no attached object\n");
+ return (AE_OK);
+ }
+
+ /*
+ * Check for unsupported region types. Note: AcpiExec simulates
+ * access to SystemMemory, SystemIO, PCI_Config, and EC.
+ */
+ switch (Node->Type)
+ {
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+
+ RegionObj = ObjDesc->Field.RegionObj;
+ switch (RegionObj->Region.SpaceId)
+ {
+ case ACPI_ADR_SPACE_SYSTEM_MEMORY:
+ case ACPI_ADR_SPACE_SYSTEM_IO:
+ case ACPI_ADR_SPACE_PCI_CONFIG:
+ case ACPI_ADR_SPACE_EC:
+
+ break;
+
+ default:
+
+ AcpiOsPrintf (" %s space is not supported [%4.4s]\n",
+ AcpiUtGetRegionName (RegionObj->Region.SpaceId),
+ RegionObj->Region.Node->Name.Ascii);
+ return (AE_OK);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ /* At this point, we have resolved the object to one of the major types */
+
+ switch (LocalType)
+ {
+ case ACPI_TYPE_INTEGER:
+
+ Status = AcpiDbTestIntegerType (Node, BitLength);
+ break;
+
+ case ACPI_TYPE_STRING:
+
+ Status = AcpiDbTestStringType (Node, ByteLength);
+ break;
+
+ case ACPI_TYPE_BUFFER:
+
+ Status = AcpiDbTestBufferType (Node, BitLength);
+ break;
+
+ default:
+
+ AcpiOsPrintf (" Ignoring, type not implemented (%2.2X)",
+ LocalType);
+ break;
+ }
+
+ switch (Node->Type)
+ {
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+
+ RegionObj = ObjDesc->Field.RegionObj;
+ AcpiOsPrintf (" (%s)",
+ AcpiUtGetRegionName (RegionObj->Region.SpaceId));
+ break;
+
+ default:
+ break;
+ }
+
+ AcpiOsPrintf ("\n");
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestIntegerType
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * BitLength - Actual length of the object. Used for
+ * support of arbitrary length FieldUnit
+ * and BufferField objects.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Test read/write for an Integer-valued object. Performs a
+ * write/read/compare of an arbitrary new value, then performs
+ * a write/read/compare of the original value.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbTestIntegerType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 BitLength)
+{
+ ACPI_OBJECT *Temp1 = NULL;
+ ACPI_OBJECT *Temp2 = NULL;
+ ACPI_OBJECT *Temp3 = NULL;
+ ACPI_OBJECT WriteValue;
+ UINT64 ValueToWrite;
+ ACPI_STATUS Status;
+
+
+ if (BitLength > 64)
+ {
+ AcpiOsPrintf (" Invalid length for an Integer: %u", BitLength);
+ return (AE_OK);
+ }
+
+ /* Read the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_INTEGER, &Temp1);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ AcpiOsPrintf (" (%4.4X/%3.3X) %8.8X%8.8X",
+ BitLength, ACPI_ROUND_BITS_UP_TO_BYTES (BitLength),
+ ACPI_FORMAT_UINT64 (Temp1->Integer.Value));
+
+ ValueToWrite = ACPI_UINT64_MAX >> (64 - BitLength);
+ if (Temp1->Integer.Value == ValueToWrite)
+ {
+ ValueToWrite = 0;
+ }
+
+ /* Write a new value */
+
+ WriteValue.Type = ACPI_TYPE_INTEGER;
+ WriteValue.Integer.Value = ValueToWrite;
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the new value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_INTEGER, &Temp2);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (Temp2->Integer.Value != ValueToWrite)
+ {
+ AcpiOsPrintf (" MISMATCH 2: %8.8X%8.8X, expecting %8.8X%8.8X",
+ ACPI_FORMAT_UINT64 (Temp2->Integer.Value),
+ ACPI_FORMAT_UINT64 (ValueToWrite));
+ }
+
+ /* Write back the original value */
+
+ WriteValue.Integer.Value = Temp1->Integer.Value;
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_INTEGER, &Temp3);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (Temp3->Integer.Value != Temp1->Integer.Value)
+ {
+ AcpiOsPrintf (" MISMATCH 3: %8.8X%8.8X, expecting %8.8X%8.8X",
+ ACPI_FORMAT_UINT64 (Temp3->Integer.Value),
+ ACPI_FORMAT_UINT64 (Temp1->Integer.Value));
+ }
+
+Exit:
+ if (Temp1) {AcpiOsFree (Temp1);}
+ if (Temp2) {AcpiOsFree (Temp2);}
+ if (Temp3) {AcpiOsFree (Temp3);}
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestBufferType
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * BitLength - Actual length of the object.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Test read/write for an Buffer-valued object. Performs a
+ * write/read/compare of an arbitrary new value, then performs
+ * a write/read/compare of the original value.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbTestBufferType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 BitLength)
+{
+ ACPI_OBJECT *Temp1 = NULL;
+ ACPI_OBJECT *Temp2 = NULL;
+ ACPI_OBJECT *Temp3 = NULL;
+ UINT8 *Buffer;
+ ACPI_OBJECT WriteValue;
+ ACPI_STATUS Status;
+ UINT32 ByteLength;
+ UINT32 i;
+ UINT8 ExtraBits;
+
+
+ ByteLength = ACPI_ROUND_BITS_UP_TO_BYTES (BitLength);
+ if (ByteLength == 0)
+ {
+ AcpiOsPrintf (" Ignoring zero length buffer");
+ return (AE_OK);
+ }
+
+ /* Allocate a local buffer */
+
+ Buffer = ACPI_ALLOCATE_ZEROED (ByteLength);
+ if (!Buffer)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Read the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_BUFFER, &Temp1);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Emit a few bytes of the buffer */
+
+ AcpiOsPrintf (" (%4.4X/%3.3X)", BitLength, Temp1->Buffer.Length);
+ for (i = 0; ((i < 4) && (i < ByteLength)); i++)
+ {
+ AcpiOsPrintf (" %2.2X", Temp1->Buffer.Pointer[i]);
+ }
+ AcpiOsPrintf ("... ");
+
+ /*
+ * Write a new value.
+ *
+ * Handle possible extra bits at the end of the buffer. Can
+ * happen for FieldUnits larger than an integer, but the bit
+ * count is not an integral number of bytes. Zero out the
+ * unused bits.
+ */
+ ACPI_MEMSET (Buffer, BUFFER_FILL_VALUE, ByteLength);
+ ExtraBits = BitLength % 8;
+ if (ExtraBits)
+ {
+ Buffer [ByteLength - 1] = ACPI_MASK_BITS_ABOVE (ExtraBits);
+ }
+
+ WriteValue.Type = ACPI_TYPE_BUFFER;
+ WriteValue.Buffer.Length = ByteLength;
+ WriteValue.Buffer.Pointer = Buffer;
+
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the new value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_BUFFER, &Temp2);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (ACPI_MEMCMP (Temp2->Buffer.Pointer, Buffer, ByteLength))
+ {
+ AcpiOsPrintf (" MISMATCH 2: New buffer value");
+ }
+
+ /* Write back the original value */
+
+ WriteValue.Buffer.Length = ByteLength;
+ WriteValue.Buffer.Pointer = Temp1->Buffer.Pointer;
+
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_BUFFER, &Temp3);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (ACPI_MEMCMP (Temp1->Buffer.Pointer, Temp3->Buffer.Pointer, ByteLength))
+ {
+ AcpiOsPrintf (" MISMATCH 3: While restoring original buffer");
+ }
+
+Exit:
+ ACPI_FREE (Buffer);
+ if (Temp1) {AcpiOsFree (Temp1);}
+ if (Temp2) {AcpiOsFree (Temp2);}
+ if (Temp3) {AcpiOsFree (Temp3);}
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestStringType
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * ByteLength - Actual length of the object.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Test read/write for an String-valued object. Performs a
+ * write/read/compare of an arbitrary new value, then performs
+ * a write/read/compare of the original value.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbTestStringType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 ByteLength)
+{
+ ACPI_OBJECT *Temp1 = NULL;
+ ACPI_OBJECT *Temp2 = NULL;
+ ACPI_OBJECT *Temp3 = NULL;
+ char *ValueToWrite = "Test String from AML Debugger";
+ ACPI_OBJECT WriteValue;
+ ACPI_STATUS Status;
+
+
+ /* Read the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp1);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ AcpiOsPrintf (" (%4.4X/%3.3X) \"%s\"", (Temp1->String.Length * 8),
+ Temp1->String.Length, Temp1->String.Pointer);
+
+ /* Write a new value */
+
+ WriteValue.Type = ACPI_TYPE_STRING;
+ WriteValue.String.Length = ACPI_STRLEN (ValueToWrite);
+ WriteValue.String.Pointer = ValueToWrite;
+
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the new value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp2);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (ACPI_STRCMP (Temp2->String.Pointer, ValueToWrite))
+ {
+ AcpiOsPrintf (" MISMATCH 2: %s, expecting %s",
+ Temp2->String.Pointer, ValueToWrite);
+ }
+
+ /* Write back the original value */
+
+ WriteValue.String.Length = ACPI_STRLEN (Temp1->String.Pointer);
+ WriteValue.String.Pointer = Temp1->String.Pointer;
+
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp3);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (ACPI_STRCMP (Temp1->String.Pointer, Temp3->String.Pointer))
+ {
+ AcpiOsPrintf (" MISMATCH 3: %s, expecting %s",
+ Temp3->String.Pointer, Temp1->String.Pointer);
+ }
+
+Exit:
+ if (Temp1) {AcpiOsFree (Temp1);}
+ if (Temp2) {AcpiOsFree (Temp2);}
+ if (Temp3) {AcpiOsFree (Temp3);}
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbReadFromObject
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * ExpectedType - Object type expected from the read
+ * Value - Where the value read is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Performs a read from the specified object by invoking the
+ * special debugger control method that reads the object. Thus,
+ * the AML interpreter is doing all of the work, increasing the
+ * validity of the test.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbReadFromObject (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OBJECT_TYPE ExpectedType,
+ ACPI_OBJECT **Value)
+{
+ ACPI_OBJECT *RetValue;
+ ACPI_OBJECT_LIST ParamObjects;
+ ACPI_OBJECT Params[2];
+ ACPI_BUFFER ReturnObj;
+ ACPI_STATUS Status;
+
+
+ Params[0].Type = ACPI_TYPE_LOCAL_REFERENCE;
+ Params[0].Reference.ActualType = Node->Type;
+ Params[0].Reference.Handle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
+
+ ParamObjects.Count = 1;
+ ParamObjects.Pointer = Params;
+
+ ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
+
+ AcpiGbl_MethodExecuting = TRUE;
+ Status = AcpiEvaluateObject (ReadHandle, NULL, &ParamObjects, &ReturnObj);
+ AcpiGbl_MethodExecuting = FALSE;
+
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not read from object, %s",
+ AcpiFormatException (Status));
+ return (Status);
+ }
+
+ RetValue = (ACPI_OBJECT *) ReturnObj.Pointer;
+
+ switch (RetValue->Type)
+ {
+ case ACPI_TYPE_INTEGER:
+ case ACPI_TYPE_BUFFER:
+ case ACPI_TYPE_STRING:
+ /*
+ * Did we receive the type we wanted? Most important for the
+ * Integer/Buffer case (when a field is larger than an Integer,
+ * it should return a Buffer).
+ */
+ if (RetValue->Type != ExpectedType)
+ {
+ AcpiOsPrintf (" Type mismatch: Expected %s, Received %s",
+ AcpiUtGetTypeName (ExpectedType),
+ AcpiUtGetTypeName (RetValue->Type));
+
+ return (AE_TYPE);
+ }
+
+ *Value = RetValue;
+ break;
+
+ default:
+
+ AcpiOsPrintf (" Unsupported return object type, %s",
+ AcpiUtGetTypeName (RetValue->Type));
+ AcpiOsFree (ReturnObj.Pointer);
+
+ return (AE_TYPE);
+ }
+
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbWriteToObject
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * Value - Value to be written
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Performs a write to the specified object by invoking the
+ * special debugger control method that writes the object. Thus,
+ * the AML interpreter is doing all of the work, increasing the
+ * validity of the test.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbWriteToObject (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OBJECT *Value)
+{
+ ACPI_OBJECT_LIST ParamObjects;
+ ACPI_OBJECT Params[2];
+ ACPI_STATUS Status;
+
+
+ Params[0].Type = ACPI_TYPE_LOCAL_REFERENCE;
+ Params[0].Reference.ActualType = Node->Type;
+ Params[0].Reference.Handle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
+
+ /* Copy the incoming user parameter */
+
+ ACPI_MEMCPY (&Params[1], Value, sizeof (ACPI_OBJECT));
+
+ ParamObjects.Count = 2;
+ ParamObjects.Pointer = Params;
+
+ AcpiGbl_MethodExecuting = TRUE;
+ Status = AcpiEvaluateObject (WriteHandle, NULL, &ParamObjects, NULL);
+ AcpiGbl_MethodExecuting = FALSE;
+
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not write to object, %s",
+ AcpiFormatException (Status));
+ }
+
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbEvaluateAllPredefinedNames
+ *
+ * PARAMETERS: CountArg - Max number of methods to execute
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Namespace batch execution. Execute predefined names in the
+ * namespace, up to the max count, if specified.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDbEvaluateAllPredefinedNames (
+ char *CountArg)
+{
+ ACPI_DB_EXECUTE_WALK Info;
+
+
+ Info.Count = 0;
+ Info.MaxCount = ACPI_UINT32_MAX;
+
+ if (CountArg)
+ {
+ Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0);
+ }
+
+ /* Search all nodes in namespace */
+
+ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
+ AcpiDbEvaluateOnePredefinedName, NULL, (void *) &Info, NULL);
+
+ AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbEvaluateOnePredefinedName
+ *
+ * PARAMETERS: Callback from WalkNamespace
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Batch execution module. Currently only executes predefined
+ * ACPI names.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbEvaluateOnePredefinedName (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue)
+{
+ ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
+ ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context;
+ char *Pathname;
+ const ACPI_PREDEFINED_INFO *Predefined;
+ ACPI_DEVICE_INFO *ObjInfo;
+ ACPI_OBJECT_LIST ParamObjects;
+ ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
+ ACPI_OBJECT *ThisParam;
+ ACPI_BUFFER ReturnObj;
+ ACPI_STATUS Status;
+ UINT16 ArgTypeList;
+ UINT8 ArgCount;
+ UINT8 ArgType;
+ UINT32 i;
+
+
+ /* The name must be a predefined ACPI name */
+
+ Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
+ if (!Predefined)
+ {
+ return (AE_OK);
+ }
+
+ if (Node->Type == ACPI_TYPE_LOCAL_SCOPE)
+ {
+ return (AE_OK);
+ }
+
+ Pathname = AcpiNsGetExternalPathname (Node);
+ if (!Pathname)
+ {
+ return (AE_OK);
+ }
+
+ /* Get the object info for number of method parameters */
+
+ Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (Pathname);
+ return (Status);
+ }
+
+ ParamObjects.Count = 0;
+ ParamObjects.Pointer = NULL;
+
+ if (ObjInfo->Type == ACPI_TYPE_METHOD)
+ {
+ /* Setup default parameters (with proper types) */
+
+ ArgTypeList = Predefined->Info.ArgumentList;
+ ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList);
+
+ /*
+ * Setup the ACPI-required number of arguments, regardless of what
+ * the actual method defines. If there is a difference, then the
+ * method is wrong and a warning will be issued during execution.
+ */
+ ThisParam = Params;
+ for (i = 0; i < ArgCount; i++)
+ {
+ ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList);
+ ThisParam->Type = ArgType;
+
+ switch (ArgType)
+ {
+ case ACPI_TYPE_INTEGER:
+
+ ThisParam->Integer.Value = 1;
+ break;
+
+ case ACPI_TYPE_STRING:
+
+ ThisParam->String.Pointer = "This is the default argument string";
+ ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer);
+ break;
+
+ case ACPI_TYPE_BUFFER:
+
+ ThisParam->Buffer.Pointer = (UINT8 *) Params; /* just a garbage buffer */
+ ThisParam->Buffer.Length = 48;
+ break;
+
+ case ACPI_TYPE_PACKAGE:
+
+ ThisParam->Package.Elements = NULL;
+ ThisParam->Package.Count = 0;
+ break;
+
+ default:
+
+ AcpiOsPrintf ("%s: Unsupported argument type: %u\n",
+ Pathname, ArgType);
+ break;
+ }
+
+ ThisParam++;
+ }
+
+ ParamObjects.Count = ArgCount;
+ ParamObjects.Pointer = Params;
+ }
+
+ ACPI_FREE (ObjInfo);
+ ReturnObj.Pointer = NULL;
+ ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
+
+ /* Do the actual method execution */
+
+ AcpiGbl_MethodExecuting = TRUE;
+
+ Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
+
+ AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
+ AcpiGbl_MethodExecuting = FALSE;
+ ACPI_FREE (Pathname);
+
+ /* Ignore status from method execution */
+
+ Status = AE_OK;
+
+ /* Update count, check if we have executed enough methods */
+
+ Info->Count++;
+ if (Info->Count >= Info->MaxCount)
+ {
+ Status = AE_CTRL_TERMINATE;
+ }
+
+ return (Status);
+}
+
+#endif /* ACPI_DEBUGGER */
diff --git a/sys/contrib/dev/acpica/components/debugger/dbutils.c b/sys/contrib/dev/acpica/components/debugger/dbutils.c
index 43036fd..f321608 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbutils.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/debugger/dbxface.c b/sys/contrib/dev/acpica/components/debugger/dbxface.c
index c154c45..b58ef4e 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbxface.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbxface.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -513,6 +512,10 @@ AcpiDbTerminate (
AcpiOsFree (AcpiGbl_DbBuffer);
AcpiGbl_DbBuffer = NULL;
}
+
+ /* Ensure that debug output is now disabled */
+
+ AcpiGbl_DbOutputFlags = ACPI_DB_DISABLE_OUTPUT;
}
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
index 32a7ddf..9e479fb 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,12 +41,13 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acutils.h>
#include <contrib/dev/acpica/include/acdisasm.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/amlcode.h>
+#include <contrib/dev/acpica/include/acinterp.h>
#ifdef ACPI_DISASSEMBLER
@@ -57,11 +58,15 @@
/* Local prototypes */
static void
+AcpiDmUuid (
+ ACPI_PARSE_OBJECT *Op);
+
+static void
AcpiDmUnicode (
ACPI_PARSE_OBJECT *Op);
static void
-AcpiDmIsEisaIdElement (
+AcpiDmGetHardwareIdType (
ACPI_PARSE_OBJECT *Op);
static void
@@ -71,6 +76,9 @@ AcpiDmPldBuffer (
UINT32 ByteCount);
+#define ACPI_BUFFER_BYTES_PER_LINE 8
+
+
/*******************************************************************************
*
* FUNCTION: AcpiDmDisasmByteList
@@ -93,6 +101,9 @@ AcpiDmDisasmByteList (
UINT32 ByteCount)
{
UINT32 i;
+ UINT32 j;
+ UINT32 CurrentIndex;
+ UINT8 BufChar;
if (!ByteCount)
@@ -100,39 +111,68 @@ AcpiDmDisasmByteList (
return;
}
- /* Dump the byte list */
-
- for (i = 0; i < ByteCount; i++)
+ for (i = 0; i < ByteCount; i += ACPI_BUFFER_BYTES_PER_LINE)
{
- /* New line every 8 bytes */
+ /* Line indent and offset prefix for each new line */
+
+ AcpiDmIndent (Level);
+ if (ByteCount > ACPI_BUFFER_BYTES_PER_LINE)
+ {
+ AcpiOsPrintf ("/* %04X */ ", i);
+ }
+
+ /* Dump the actual hex values */
- if (((i % 8) == 0) && (i < ByteCount))
+ for (j = 0; j < ACPI_BUFFER_BYTES_PER_LINE; j++)
{
- if (i > 0)
+ CurrentIndex = i + j;
+ if (CurrentIndex >= ByteCount)
{
- AcpiOsPrintf ("\n");
+ /* Dump fill spaces */
+
+ AcpiOsPrintf (" ");
+ continue;
}
- AcpiDmIndent (Level);
- if (ByteCount > 8)
+ AcpiOsPrintf (" 0x%2.2X", ByteData[CurrentIndex]);
+
+ /* Add comma if there are more bytes to display */
+
+ if (CurrentIndex < (ByteCount - 1))
{
- AcpiOsPrintf ("/* %04X */ ", i);
+ AcpiOsPrintf (",");
+ }
+ else
+ {
+ AcpiOsPrintf (" ");
}
}
- AcpiOsPrintf (" 0x%2.2X", (UINT32) ByteData[i]);
+ /* Dump the ASCII equivalents within a comment */
- /* Add comma if there are more bytes to display */
-
- if (i < (ByteCount -1))
+ AcpiOsPrintf (" /* ");
+ for (j = 0; j < ACPI_BUFFER_BYTES_PER_LINE; j++)
{
- AcpiOsPrintf (",");
+ CurrentIndex = i + j;
+ if (CurrentIndex >= ByteCount)
+ {
+ break;
+ }
+
+ BufChar = ByteData[CurrentIndex];
+ if (ACPI_IS_PRINT (BufChar))
+ {
+ AcpiOsPrintf ("%c", BufChar);
+ }
+ else
+ {
+ AcpiOsPrintf (".");
+ }
}
- }
- if (Level)
- {
- AcpiOsPrintf ("\n");
+ /* Finished with this line */
+
+ AcpiOsPrintf (" */\n");
}
}
@@ -181,6 +221,11 @@ AcpiDmByteList (
AcpiOsPrintf ("\n");
break;
+ case ACPI_DASM_UUID:
+
+ AcpiDmUuid (Op);
+ break;
+
case ACPI_DASM_UNICODE:
AcpiDmUnicode (Op);
@@ -206,6 +251,137 @@ AcpiDmByteList (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmIsUuidBuffer
+ *
+ * PARAMETERS: Op - Buffer Object to be examined
+ *
+ * RETURN: TRUE if buffer contains a UUID
+ *
+ * DESCRIPTION: Determine if a buffer Op contains a UUID
+ *
+ * To help determine whether the buffer is a UUID versus a raw data buffer,
+ * there a are a couple bytes we can look at:
+ *
+ * xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
+ *
+ * The variant covered by the UUID specification is indicated by the two most
+ * significant bits of N being 1 0 (i.e., the hexadecimal N will always be
+ * 8, 9, A, or B).
+ *
+ * The variant covered by the UUID specification has five versions. For this
+ * variant, the four bits of M indicates the UUID version (i.e., the
+ * hexadecimal M will be either 1, 2, 3, 4, or 5).
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiDmIsUuidBuffer (
+ ACPI_PARSE_OBJECT *Op)
+{
+ UINT8 *ByteData;
+ UINT32 ByteCount;
+ ACPI_PARSE_OBJECT *SizeOp;
+ ACPI_PARSE_OBJECT *NextOp;
+
+
+ /* Buffer size is the buffer argument */
+
+ SizeOp = Op->Common.Value.Arg;
+
+ /* Next, the initializer byte list to examine */
+
+ NextOp = SizeOp->Common.Next;
+ if (!NextOp)
+ {
+ return (FALSE);
+ }
+
+ /* Extract the byte list info */
+
+ ByteData = NextOp->Named.Data;
+ ByteCount = (UINT32) NextOp->Common.Value.Integer;
+
+ /* Byte count must be exactly 16 */
+
+ if (ByteCount != UUID_BUFFER_LENGTH)
+ {
+ return (FALSE);
+ }
+
+ /* Check for valid "M" and "N" values (see function header above) */
+
+ if (((ByteData[7] & 0xF0) == 0x00) || /* M={1,2,3,4,5} */
+ ((ByteData[7] & 0xF0) > 0x50) ||
+ ((ByteData[8] & 0xF0) < 0x80) || /* N={8,9,A,B} */
+ ((ByteData[8] & 0xF0) > 0xB0))
+ {
+ return (FALSE);
+ }
+
+ /* Ignore the Size argument in the disassembly of this buffer op */
+
+ SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmUuid
+ *
+ * PARAMETERS: Op - Byte List op containing a UUID
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump a buffer containing a UUID as a standard ASCII string.
+ *
+ * Output Format:
+ * In its canonical form, the UUID is represented by a string containing 32
+ * lowercase hexadecimal digits, displayed in 5 groups separated by hyphens.
+ * The complete form is 8-4-4-4-12 for a total of 36 characters (32
+ * alphanumeric characters representing hex digits and 4 hyphens). In bytes,
+ * 4-2-2-2-6. Example:
+ *
+ * ToUUID ("107ededd-d381-4fd7-8da9-08e9a6c79644")
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmUuid (
+ ACPI_PARSE_OBJECT *Op)
+{
+ UINT8 *Data;
+ const char *Description;
+
+
+ Data = ACPI_CAST_PTR (UINT8, Op->Named.Data);
+
+ /* Emit the 36-byte UUID string in the proper format/order */
+
+ AcpiOsPrintf (
+ "\"%2.2x%2.2x%2.2x%2.2x-"
+ "%2.2x%2.2x-"
+ "%2.2x%2.2x-"
+ "%2.2x%2.2x-"
+ "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\")",
+ Data[3], Data[2], Data[1], Data[0],
+ Data[5], Data[4],
+ Data[7], Data[6],
+ Data[8], Data[9],
+ Data[10], Data[11], Data[12], Data[13], Data[14], Data[15]);
+
+ /* Dump the UUID description string if available */
+
+ Description = AcpiAhMatchUuid (Data);
+ if (Description)
+ {
+ AcpiOsPrintf (" /* %s */", Description);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmIsUnicodeBuffer
*
* PARAMETERS: Op - Buffer Object to be examined
@@ -537,19 +713,20 @@ AcpiDmUnicode (
/*******************************************************************************
*
- * FUNCTION: AcpiDmIsEisaIdElement
+ * FUNCTION: AcpiDmGetHardwareIdType
*
* PARAMETERS: Op - Op to be examined
*
* RETURN: None
*
- * DESCRIPTION: Determine if an Op (argument to _HID or _CID) can be converted
- * to an EISA ID.
+ * DESCRIPTION: Determine the type of the argument to a _HID or _CID
+ * 1) Strings are allowed
+ * 2) If Integer, determine if it is a valid EISAID
*
******************************************************************************/
static void
-AcpiDmIsEisaIdElement (
+AcpiDmGetHardwareIdType (
ACPI_PARSE_OBJECT *Op)
{
UINT32 BigEndianId;
@@ -557,55 +734,66 @@ AcpiDmIsEisaIdElement (
UINT32 i;
- /* The parameter must be either a word or a dword */
-
- if ((Op->Common.AmlOpcode != AML_DWORD_OP) &&
- (Op->Common.AmlOpcode != AML_WORD_OP))
+ switch (Op->Common.AmlOpcode)
{
- return;
- }
+ case AML_STRING_OP:
- /* Swap from little-endian to big-endian to simplify conversion */
+ /* Mark this string as an _HID/_CID string */
- BigEndianId = AcpiUtDwordByteSwap ((UINT32) Op->Common.Value.Integer);
+ Op->Common.DisasmOpcode = ACPI_DASM_HID_STRING;
+ break;
- /* Create the 3 leading ASCII letters */
+ case AML_WORD_OP:
+ case AML_DWORD_OP:
- Prefix[0] = ((BigEndianId >> 26) & 0x1F) + 0x40;
- Prefix[1] = ((BigEndianId >> 21) & 0x1F) + 0x40;
- Prefix[2] = ((BigEndianId >> 16) & 0x1F) + 0x40;
+ /* Determine if a Word/Dword is a valid encoded EISAID */
- /* Verify that all 3 are ascii and alpha */
+ /* Swap from little-endian to big-endian to simplify conversion */
- for (i = 0; i < 3; i++)
- {
- if (!ACPI_IS_ASCII (Prefix[i]) ||
- !ACPI_IS_ALPHA (Prefix[i]))
+ BigEndianId = AcpiUtDwordByteSwap ((UINT32) Op->Common.Value.Integer);
+
+ /* Create the 3 leading ASCII letters */
+
+ Prefix[0] = ((BigEndianId >> 26) & 0x1F) + 0x40;
+ Prefix[1] = ((BigEndianId >> 21) & 0x1F) + 0x40;
+ Prefix[2] = ((BigEndianId >> 16) & 0x1F) + 0x40;
+
+ /* Verify that all 3 are ascii and alpha */
+
+ for (i = 0; i < 3; i++)
{
- return;
+ if (!ACPI_IS_ASCII (Prefix[i]) ||
+ !ACPI_IS_ALPHA (Prefix[i]))
+ {
+ return;
+ }
}
- }
- /* OK - mark this node as convertable to an EISA ID */
+ /* Mark this node as convertable to an EISA ID string */
- Op->Common.DisasmOpcode = ACPI_DASM_EISAID;
+ Op->Common.DisasmOpcode = ACPI_DASM_EISAID;
+ break;
+
+ default:
+ break;
+ }
}
/*******************************************************************************
*
- * FUNCTION: AcpiDmIsEisaId
+ * FUNCTION: AcpiDmCheckForHardwareId
*
* PARAMETERS: Op - Op to be examined
*
* RETURN: None
*
- * DESCRIPTION: Determine if a Name() Op can be converted to an EisaId.
+ * DESCRIPTION: Determine if a Name() Op is a _HID/_CID.
*
******************************************************************************/
void
-AcpiDmIsEisaId (
+AcpiDmCheckForHardwareId (
ACPI_PARSE_OBJECT *Op)
{
UINT32 Name;
@@ -630,7 +818,7 @@ AcpiDmIsEisaId (
if (ACPI_COMPARE_NAME (&Name, METHOD_NAME__HID))
{
- AcpiDmIsEisaIdElement (NextOp);
+ AcpiDmGetHardwareIdType (NextOp);
return;
}
@@ -645,20 +833,24 @@ AcpiDmIsEisaId (
if (NextOp->Common.AmlOpcode != AML_PACKAGE_OP)
{
- AcpiDmIsEisaIdElement (NextOp);
+ AcpiDmGetHardwareIdType (NextOp);
return;
}
- /* _CID with Package: get the package length */
+ /* _CID with Package: get the package length, check all elements */
NextOp = AcpiPsGetDepthNext (NULL, NextOp);
+ if (!NextOp)
+ {
+ return;
+ }
/* Don't need to use the length, just walk the peer list */
NextOp = NextOp->Common.Next;
while (NextOp)
{
- AcpiDmIsEisaIdElement (NextOp);
+ AcpiDmGetHardwareIdType (NextOp);
NextOp = NextOp->Common.Next;
}
}
@@ -666,41 +858,38 @@ AcpiDmIsEisaId (
/*******************************************************************************
*
- * FUNCTION: AcpiDmEisaId
+ * FUNCTION: AcpiDmDecompressEisaId
*
* PARAMETERS: EncodedId - Raw encoded EISA ID.
*
* RETURN: None
*
- * DESCRIPTION: Convert an encoded EISAID back to the original ASCII String.
+ * DESCRIPTION: Convert an encoded EISAID back to the original ASCII String
+ * and emit the correct ASL statement. If the ID is known, emit
+ * a description of the ID as a comment.
*
******************************************************************************/
void
-AcpiDmEisaId (
+AcpiDmDecompressEisaId (
UINT32 EncodedId)
{
- UINT32 BigEndianId;
-
-
- /* Swap from little-endian to big-endian to simplify conversion */
-
- BigEndianId = AcpiUtDwordByteSwap (EncodedId);
+ char IdBuffer[ACPI_EISAID_STRING_SIZE];
+ const AH_DEVICE_ID *Info;
- /* Split to form "AAANNNN" string */
+ /* Convert EISAID to a string an emit the statement */
- AcpiOsPrintf ("EisaId (\"%c%c%c%4.4X\")",
+ AcpiExEisaIdToString (IdBuffer, EncodedId);
+ AcpiOsPrintf ("EisaId (\"%s\")", IdBuffer);
- /* Three Alpha characters (AAA), 5 bits each */
+ /* If we know about the ID, emit the description */
- (int) ((BigEndianId >> 26) & 0x1F) + 0x40,
- (int) ((BigEndianId >> 21) & 0x1F) + 0x40,
- (int) ((BigEndianId >> 16) & 0x1F) + 0x40,
-
- /* Numeric part (NNNN) is simply the lower 16 bits */
-
- (UINT32) (BigEndianId & 0xFFFF));
+ Info = AcpiAhMatchHardwareId (IdBuffer);
+ if (Info)
+ {
+ AcpiOsPrintf (" /* %s */", Info->Description);
+ }
}
#endif
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
index b047a60..9fa82b0 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmnames.c b/sys/contrib/dev/acpica/components/disassembler/dmnames.c
index db7434d..e0b8545 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmnames.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmobject.c b/sys/contrib/dev/acpica/components/disassembler/dmobject.c
index 5541e5a..6df0ff5 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmobject.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmobject.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
index 5435e13..e8f2c97 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,6 +46,8 @@
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acdisasm.h>
+#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
#ifdef ACPI_DISASSEMBLER
@@ -61,6 +63,159 @@ AcpiDmMatchKeyword (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDisplayTargetPathname
+ *
+ * PARAMETERS: Op - Parse object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: For AML opcodes that have a target operand, display the full
+ * pathname for the target, in a comment field. Handles Return()
+ * statements also.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDisplayTargetPathname (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *NextOp;
+ ACPI_PARSE_OBJECT *PrevOp = NULL;
+ char *Pathname;
+ const ACPI_OPCODE_INFO *OpInfo;
+
+
+ if (Op->Common.AmlOpcode == AML_RETURN_OP)
+ {
+ PrevOp = Op->Asl.Value.Arg;
+ }
+ else
+ {
+ OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+ if (!(OpInfo->Flags & AML_HAS_TARGET))
+ {
+ return;
+ }
+
+ /* Target is the last Op in the arg list */
+
+ NextOp = Op->Asl.Value.Arg;
+ while (NextOp)
+ {
+ PrevOp = NextOp;
+ NextOp = PrevOp->Asl.Next;
+ }
+ }
+
+ if (!PrevOp)
+ {
+ return;
+ }
+
+ /* We must have a namepath AML opcode */
+
+ if (PrevOp->Asl.AmlOpcode != AML_INT_NAMEPATH_OP)
+ {
+ return;
+ }
+
+ /* A null string is the "no target specified" case */
+
+ if (!PrevOp->Asl.Value.String)
+ {
+ return;
+ }
+
+ /* No node means "unresolved external reference" */
+
+ if (!PrevOp->Asl.Node)
+ {
+ AcpiOsPrintf (" /* External reference */");
+ return;
+ }
+
+ /* Ignore if path is already from the root */
+
+ if (*PrevOp->Asl.Value.String == '\\')
+ {
+ return;
+ }
+
+ /* Now: we can get the full pathname */
+
+ Pathname = AcpiNsGetExternalPathname (PrevOp->Asl.Node);
+ if (!Pathname)
+ {
+ return;
+ }
+
+ AcpiOsPrintf (" /* %s */", Pathname);
+ ACPI_FREE (Pathname);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmNotifyDescription
+ *
+ * PARAMETERS: Op - Name() parse object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit a description comment for the value associated with a
+ * Notify() operator.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmNotifyDescription (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *NextOp;
+ ACPI_NAMESPACE_NODE *Node;
+ UINT8 NotifyValue;
+ UINT8 Type = ACPI_TYPE_ANY;
+
+
+ /* The notify value is the second argument */
+
+ NextOp = Op->Asl.Value.Arg;
+ NextOp = NextOp->Asl.Next;
+
+ switch (NextOp->Common.AmlOpcode)
+ {
+ case AML_ZERO_OP:
+ case AML_ONE_OP:
+
+ NotifyValue = (UINT8) NextOp->Common.AmlOpcode;
+ break;
+
+ case AML_BYTE_OP:
+
+ NotifyValue = (UINT8) NextOp->Asl.Value.Integer;
+ break;
+
+ default:
+ return;
+ }
+
+ /*
+ * Attempt to get the namespace node so we can determine the object type.
+ * Some notify values are dependent on the object type (Device, Thermal,
+ * or Processor).
+ */
+ Node = Op->Asl.Node;
+ if (Node)
+ {
+ Type = Node->Type;
+ }
+
+ AcpiOsPrintf (" // %s", AcpiUtGetNotifyName (NotifyValue, Type));
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmPredefinedDescription
*
* PARAMETERS: Op - Name() parse object
@@ -183,14 +338,11 @@ AcpiDmPredefinedDescription (
/* Match the name in the info table */
- for (Info = AslPredefinedInfo; Info->Name; Info++)
+ Info = AcpiAhMatchPredefinedName (NameString);
+ if (Info)
{
- if (ACPI_COMPARE_NAME (NameString, Info->Name))
- {
- AcpiOsPrintf (" // %4.4s: %s",
- NameString, ACPI_CAST_PTR (char, Info->Description));
- return;
- }
+ AcpiOsPrintf (" // %4.4s: %s",
+ NameString, ACPI_CAST_PTR (char, Info->Description));
}
#endif
@@ -267,14 +419,11 @@ AcpiDmFieldPredefinedDescription (
/* Match the name in the info table */
- for (Info = AslPredefinedInfo; Info->Name; Info++)
+ Info = AcpiAhMatchPredefinedName (Tag);
+ if (Info)
{
- if (ACPI_COMPARE_NAME (Tag, Info->Name))
- {
- AcpiOsPrintf (" // %4.4s: %s", Tag,
- ACPI_CAST_PTR (char, Info->Description));
- return;
- }
+ AcpiOsPrintf (" // %4.4s: %s", Tag,
+ ACPI_CAST_PTR (char, Info->Description));
}
#endif
@@ -527,6 +676,7 @@ AcpiDmDisassembleOneOp (
ACPI_PARSE_OBJECT *Child;
ACPI_STATUS Status;
UINT8 *Aml;
+ const AH_DEVICE_ID *IdInfo;
if (!Op)
@@ -605,7 +755,7 @@ AcpiDmDisassembleOneOp (
if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID)
{
- AcpiDmEisaId ((UINT32) Op->Common.Value.Integer);
+ AcpiDmDecompressEisaId ((UINT32) Op->Common.Value.Integer);
}
else
{
@@ -617,7 +767,7 @@ AcpiDmDisassembleOneOp (
if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID)
{
- AcpiDmEisaId ((UINT32) Op->Common.Value.Integer);
+ AcpiDmDecompressEisaId ((UINT32) Op->Common.Value.Integer);
}
else
{
@@ -634,6 +784,19 @@ AcpiDmDisassembleOneOp (
case AML_STRING_OP:
AcpiUtPrintString (Op->Common.Value.String, ACPI_UINT16_MAX);
+
+ /* For _HID/_CID strings, attempt to output a descriptive comment */
+
+ if (Op->Common.DisasmOpcode == ACPI_DASM_HID_STRING)
+ {
+ /* If we know about the ID, emit the description */
+
+ IdInfo = AcpiAhMatchHardwareId (Op->Common.Value.String);
+ if (IdInfo)
+ {
+ AcpiOsPrintf (" /* %s */", IdInfo->Description);
+ }
+ }
break;
case AML_BUFFER_OP:
@@ -664,7 +827,12 @@ AcpiDmDisassembleOneOp (
}
}
- if (AcpiDmIsUnicodeBuffer (Op))
+ if (AcpiDmIsUuidBuffer (Op))
+ {
+ Op->Common.DisasmOpcode = ACPI_DASM_UUID;
+ AcpiOsPrintf ("ToUUID (");
+ }
+ else if (AcpiDmIsUnicodeBuffer (Op))
{
Op->Common.DisasmOpcode = ACPI_DASM_UNICODE;
AcpiOsPrintf ("Unicode (");
@@ -765,7 +933,9 @@ AcpiDmDisassembleOneOp (
Length = (UINT32) Child->Common.Value.Integer;
Info->Level += 1;
+ Info->MappingOp = Op;
Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
+
AcpiDmResourceTemplate (Info, Op->Common.Parent, Aml, Length);
Info->Level -= 1;
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
index 6cdd07b..04a6fbb 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -260,6 +259,11 @@ AcpiDmResourceTemplate (
ACPI_NAMESPACE_NODE *Node;
+ if (Op->Asl.AmlOpcode != AML_FIELD_OP)
+ {
+ Info->MappingOp = Op;
+ }
+
Level = Info->Level;
ResourceName = ACPI_DEFAULT_RESNAME;
Node = Op->Common.Node;
@@ -328,7 +332,7 @@ AcpiDmResourceTemplate (
/* Go ahead and insert EndDependentFn() */
- AcpiDmEndDependentDescriptor (Aml, ResourceLength, Level);
+ AcpiDmEndDependentDescriptor (Info, Aml, ResourceLength, Level);
AcpiDmIndent (Level);
AcpiOsPrintf (
@@ -350,7 +354,7 @@ AcpiDmResourceTemplate (
}
AcpiGbl_DmResourceDispatch [ResourceIndex] (
- Aml, ResourceLength, Level);
+ Info, Aml, ResourceLength, Level);
/* Descriptor post-processing */
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
index 792ae80..a6c38a8 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -576,7 +575,8 @@ AcpiDmResourceSource (
*
* FUNCTION: AcpiDmWordDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -588,6 +588,7 @@ AcpiDmResourceSource (
void
AcpiDmWordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -621,7 +622,8 @@ AcpiDmWordDescriptor (
*
* FUNCTION: AcpiDmDwordDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -633,6 +635,7 @@ AcpiDmWordDescriptor (
void
AcpiDmDwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -666,7 +669,8 @@ AcpiDmDwordDescriptor (
*
* FUNCTION: AcpiDmQwordDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -678,6 +682,7 @@ AcpiDmDwordDescriptor (
void
AcpiDmQwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -711,7 +716,8 @@ AcpiDmQwordDescriptor (
*
* FUNCTION: AcpiDmExtendedDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -723,6 +729,7 @@ AcpiDmQwordDescriptor (
void
AcpiDmExtendedDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -758,7 +765,8 @@ AcpiDmExtendedDescriptor (
*
* FUNCTION: AcpiDmMemory24Descriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -770,6 +778,7 @@ AcpiDmExtendedDescriptor (
void
AcpiDmMemory24Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -797,7 +806,8 @@ AcpiDmMemory24Descriptor (
*
* FUNCTION: AcpiDmMemory32Descriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -809,6 +819,7 @@ AcpiDmMemory24Descriptor (
void
AcpiDmMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -836,7 +847,8 @@ AcpiDmMemory32Descriptor (
*
* FUNCTION: AcpiDmFixedMemory32Descriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -848,6 +860,7 @@ AcpiDmMemory32Descriptor (
void
AcpiDmFixedMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -877,7 +890,8 @@ AcpiDmFixedMemory32Descriptor (
*
* FUNCTION: AcpiDmGenericRegisterDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -889,6 +903,7 @@ AcpiDmFixedMemory32Descriptor (
void
AcpiDmGenericRegisterDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -933,7 +948,8 @@ AcpiDmGenericRegisterDescriptor (
*
* FUNCTION: AcpiDmInterruptDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -945,6 +961,7 @@ AcpiDmGenericRegisterDescriptor (
void
AcpiDmInterruptDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -1039,7 +1056,8 @@ AcpiDmVendorCommon (
*
* FUNCTION: AcpiDmVendorLargeDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -1051,6 +1069,7 @@ AcpiDmVendorCommon (
void
AcpiDmVendorLargeDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
index f938f93..452cde0 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -56,24 +55,28 @@
static void
AcpiDmI2cSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
static void
AcpiDmSpiSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
static void
AcpiDmUartSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
static void
AcpiDmGpioCommon (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Level);
@@ -168,7 +171,8 @@ Finish:
*
* FUNCTION: AcpiDmGpioCommon
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Level - Current source code indentation level
*
* RETURN: None
@@ -179,12 +183,14 @@ Finish:
static void
AcpiDmGpioCommon (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Level)
{
- UINT32 PinCount;
UINT16 *PinList;
UINT8 *VendorData;
+ char *DeviceName = NULL;
+ UINT32 PinCount;
UINT32 i;
@@ -193,9 +199,8 @@ AcpiDmGpioCommon (
AcpiDmIndent (Level + 1);
if (Resource->Gpio.ResSourceOffset)
{
- AcpiUtPrintString (
- ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
- ACPI_UINT16_MAX);
+ DeviceName = ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
}
AcpiOsPrintf (", ");
@@ -243,6 +248,10 @@ AcpiDmGpioCommon (
AcpiDmIndent (Level + 1);
AcpiOsPrintf ("}\n");
+
+#ifndef _KERNEL
+ MpSaveGpioInfo (Info->MappingOp, Resource, PinCount, PinList, DeviceName);
+#endif
}
@@ -250,7 +259,8 @@ AcpiDmGpioCommon (
*
* FUNCTION: AcpiDmGpioIntDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -262,6 +272,7 @@ AcpiDmGpioCommon (
static void
AcpiDmGpioIntDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -274,7 +285,7 @@ AcpiDmGpioIntDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
- AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Gpio.IntFlags, 1)],
+ AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
/* PinConfig, DebounceTimeout */
@@ -292,7 +303,7 @@ AcpiDmGpioIntDescriptor (
/* Dump the GpioInt/GpioIo common portion of the descriptor */
- AcpiDmGpioCommon (Resource, Level);
+ AcpiDmGpioCommon (Info, Resource, Level);
}
@@ -300,7 +311,8 @@ AcpiDmGpioIntDescriptor (
*
* FUNCTION: AcpiDmGpioIoDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -312,6 +324,7 @@ AcpiDmGpioIntDescriptor (
static void
AcpiDmGpioIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -344,7 +357,7 @@ AcpiDmGpioIoDescriptor (
/* Dump the GpioInt/GpioIo common portion of the descriptor */
- AcpiDmGpioCommon (Resource, Level);
+ AcpiDmGpioCommon (Info, Resource, Level);
}
@@ -352,7 +365,8 @@ AcpiDmGpioIoDescriptor (
*
* FUNCTION: AcpiDmGpioDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -364,6 +378,7 @@ AcpiDmGpioIoDescriptor (
void
AcpiDmGpioDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -377,12 +392,12 @@ AcpiDmGpioDescriptor (
{
case AML_RESOURCE_GPIO_TYPE_INT:
- AcpiDmGpioIntDescriptor (Resource, Length, Level);
+ AcpiDmGpioIntDescriptor (Info, Resource, Length, Level);
break;
case AML_RESOURCE_GPIO_TYPE_IO:
- AcpiDmGpioIoDescriptor (Resource, Length, Level);
+ AcpiDmGpioIoDescriptor (Info, Resource, Length, Level);
break;
default:
@@ -460,7 +475,8 @@ AcpiDmDumpSerialBusVendorData (
*
* FUNCTION: AcpiDmI2cSerialBusDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -472,11 +488,13 @@ AcpiDmDumpSerialBusVendorData (
static void
AcpiDmI2cSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
{
UINT32 ResourceSourceOffset;
+ char *DeviceName;
/* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
@@ -496,9 +514,8 @@ AcpiDmI2cSerialBusDescriptor (
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
Resource->CommonSerialBus.TypeDataLength;
- AcpiUtPrintString (
- ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
- ACPI_UINT16_MAX);
+ DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
/* ResourceSourceIndex, ResourceUsage */
@@ -519,6 +536,10 @@ AcpiDmI2cSerialBusDescriptor (
AcpiDmIndent (Level + 1);
AcpiDmDumpSerialBusVendorData (Resource, Level);
AcpiOsPrintf (")\n");
+
+#ifndef _KERNEL
+ MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
+#endif
}
@@ -526,7 +547,8 @@ AcpiDmI2cSerialBusDescriptor (
*
* FUNCTION: AcpiDmSpiSerialBusDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -538,11 +560,13 @@ AcpiDmI2cSerialBusDescriptor (
static void
AcpiDmSpiSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
{
UINT32 ResourceSourceOffset;
+ char *DeviceName;
/* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
@@ -571,9 +595,8 @@ AcpiDmSpiSerialBusDescriptor (
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
Resource->CommonSerialBus.TypeDataLength;
- AcpiUtPrintString (
- ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
- ACPI_UINT16_MAX);
+ DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
/* ResourceSourceIndex, ResourceUsage */
@@ -594,6 +617,10 @@ AcpiDmSpiSerialBusDescriptor (
AcpiDmIndent (Level + 1);
AcpiDmDumpSerialBusVendorData (Resource, Level);
AcpiOsPrintf (")\n");
+
+#ifndef _KERNEL
+ MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
+#endif
}
@@ -601,7 +628,8 @@ AcpiDmSpiSerialBusDescriptor (
*
* FUNCTION: AcpiDmUartSerialBusDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -613,11 +641,13 @@ AcpiDmSpiSerialBusDescriptor (
static void
AcpiDmUartSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
{
UINT32 ResourceSourceOffset;
+ char *DeviceName;
/* ConnectionSpeed, BitsPerByte, StopBits */
@@ -649,9 +679,8 @@ AcpiDmUartSerialBusDescriptor (
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
Resource->CommonSerialBus.TypeDataLength;
- AcpiUtPrintString (
- ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
- ACPI_UINT16_MAX);
+ DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
/* ResourceSourceIndex, ResourceUsage */
@@ -672,6 +701,10 @@ AcpiDmUartSerialBusDescriptor (
AcpiDmIndent (Level + 1);
AcpiDmDumpSerialBusVendorData (Resource, Level);
AcpiOsPrintf (")\n");
+
+#ifndef _KERNEL
+ MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
+#endif
}
@@ -679,7 +712,8 @@ AcpiDmUartSerialBusDescriptor (
*
* FUNCTION: AcpiDmSerialBusDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -691,13 +725,14 @@ AcpiDmUartSerialBusDescriptor (
void
AcpiDmSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
{
SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
- Resource, Length, Level);
+ Info, Resource, Length, Level);
}
#endif
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
index 778d663..549c3d6 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -57,7 +56,8 @@
*
* FUNCTION: AcpiDmIrqDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -69,6 +69,7 @@
void
AcpiDmIrqDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -102,7 +103,8 @@ AcpiDmIrqDescriptor (
*
* FUNCTION: AcpiDmDmaDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -114,6 +116,7 @@ AcpiDmIrqDescriptor (
void
AcpiDmDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -139,7 +142,8 @@ AcpiDmDmaDescriptor (
*
* FUNCTION: AcpiDmFixedDmaDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -151,6 +155,7 @@ AcpiDmDmaDescriptor (
void
AcpiDmFixedDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -182,7 +187,8 @@ AcpiDmFixedDmaDescriptor (
*
* FUNCTION: AcpiDmIoDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -194,6 +200,7 @@ AcpiDmFixedDmaDescriptor (
void
AcpiDmIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -227,7 +234,8 @@ AcpiDmIoDescriptor (
*
* FUNCTION: AcpiDmFixedIoDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -239,6 +247,7 @@ AcpiDmIoDescriptor (
void
AcpiDmFixedIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -265,7 +274,8 @@ AcpiDmFixedIoDescriptor (
*
* FUNCTION: AcpiDmStartDependentDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -277,6 +287,7 @@ AcpiDmFixedIoDescriptor (
void
AcpiDmStartDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -304,7 +315,8 @@ AcpiDmStartDependentDescriptor (
*
* FUNCTION: AcpiDmEndDependentDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -316,6 +328,7 @@ AcpiDmStartDependentDescriptor (
void
AcpiDmEndDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -332,7 +345,8 @@ AcpiDmEndDependentDescriptor (
*
* FUNCTION: AcpiDmVendorSmallDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -344,6 +358,7 @@ AcpiDmEndDependentDescriptor (
void
AcpiDmVendorSmallDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmutils.c b/sys/contrib/dev/acpica/components/disassembler/dmutils.c
index 5d35d83..bb9ef73 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmutils.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
index 5a3fbc6..8021a97 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -285,7 +284,8 @@ AcpiDmBlockType (
case AML_BUFFER_OP:
- if (Op->Common.DisasmOpcode == ACPI_DASM_UNICODE)
+ if ((Op->Common.DisasmOpcode == ACPI_DASM_UNICODE) ||
+ (Op->Common.DisasmOpcode == ACPI_DASM_UUID))
{
return (BLOCK_NONE);
}
@@ -568,7 +568,7 @@ AcpiDmDescendingOp (
/* Check for _HID and related EISAID() */
- AcpiDmIsEisaId (Op);
+ AcpiDmCheckForHardwareId (Op);
AcpiOsPrintf (", ");
break;
@@ -842,6 +842,15 @@ AcpiDmAscendingOp (
AcpiDmFieldPredefinedDescription (Op);
}
+ /* Decode Notify() values */
+
+ if (Op->Common.AmlOpcode == AML_NOTIFY_OP)
+ {
+ AcpiDmNotifyDescription (Op);
+ }
+
+ AcpiDmDisplayTargetPathname (Op);
+
/* Could be a nested operator, check if comma required */
if (!AcpiDmCommaIfListMember (Op))
@@ -949,6 +958,13 @@ AcpiDmAscendingOp (
}
/*
+ * The parent Op is guaranteed to be valid because of the flag
+ * ACPI_PARSEOP_PARAMLIST -- which means that this op is part of
+ * a parameter list and thus has a valid parent.
+ */
+ ParentOp = Op->Common.Parent;
+
+ /*
* Just completed a parameter node for something like "Buffer (param)".
* Close the paren and open up the term list block with a brace
*/
@@ -956,25 +972,24 @@ AcpiDmAscendingOp (
{
AcpiOsPrintf (")");
- /* Emit description comment for Name() with a predefined ACPI name */
-
- ParentOp = Op->Common.Parent;
- if (ParentOp)
+ /*
+ * Emit a description comment for a Name() operator that is a
+ * predefined ACPI name. Must check the grandparent.
+ */
+ ParentOp = ParentOp->Common.Parent;
+ if (ParentOp &&
+ (ParentOp->Asl.AmlOpcode == AML_NAME_OP))
{
- ParentOp = ParentOp->Common.Parent;
- if (ParentOp && ParentOp->Asl.AmlOpcode == AML_NAME_OP)
- {
- AcpiDmPredefinedDescription (ParentOp);
- }
+ AcpiDmPredefinedDescription (ParentOp);
}
+
AcpiOsPrintf ("\n");
AcpiDmIndent (Level - 1);
AcpiOsPrintf ("{\n");
}
else
{
- Op->Common.Parent->Common.DisasmFlags |=
- ACPI_PARSEOP_EMPTY_TERMLIST;
+ ParentOp->Common.DisasmFlags |= ACPI_PARSEOP_EMPTY_TERMLIST;
AcpiOsPrintf (") {");
}
}
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
index 2c574ca1..fd7c795 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
index 3d256ea..c2fac77 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
index ab4f5b9..262b63a 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -116,7 +116,7 @@ AcpiDsCreateExternalRegion (
* OperationRegion not found. Generate an External for it, and
* insert the name into the namespace.
*/
- AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0);
+ AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
if (ACPI_FAILURE (Status))
@@ -391,6 +391,7 @@ AcpiDsGetFieldNames (
*/
Info->ResourceBuffer = NULL;
Info->ConnectionNode = NULL;
+ Info->PinNumberIndex = 0;
/*
* A Connection() is either an actual resource descriptor (buffer)
@@ -466,6 +467,7 @@ AcpiDsGetFieldNames (
}
Info->FieldBitPosition += Info->FieldBitLength;
+ Info->PinNumberIndex++; /* Index relative to previous Connection() */
break;
default:
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsinit.c b/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
index 5ab1f50..6789fe4 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,7 @@
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsinit")
+
/* Local prototypes */
static ACPI_STATUS
@@ -91,8 +92,8 @@ AcpiDsInitOneObject (
{
ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
- ACPI_OBJECT_TYPE Type;
ACPI_STATUS Status;
+ ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_FUNCTION_ENTRY ();
@@ -111,9 +112,7 @@ AcpiDsInitOneObject (
/* And even then, we are only interested in a few object types */
- Type = AcpiNsGetType (ObjHandle);
-
- switch (Type)
+ switch (AcpiNsGetType (ObjHandle))
{
case ACPI_TYPE_REGION:
@@ -129,8 +128,45 @@ AcpiDsInitOneObject (
break;
case ACPI_TYPE_METHOD:
-
+ /*
+ * Auto-serialization support. We will examine each method that is
+ * NotSerialized to determine if it creates any Named objects. If
+ * it does, it will be marked serialized to prevent problems if
+ * the method is entered by two or more threads and an attempt is
+ * made to create the same named object twice -- which results in
+ * an AE_ALREADY_EXISTS exception and method abort.
+ */
Info->MethodCount++;
+ ObjDesc = AcpiNsGetAttachedObject (Node);
+ if (!ObjDesc)
+ {
+ break;
+ }
+
+ /* Ignore if already serialized */
+
+ if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
+ {
+ Info->SerialMethodCount++;
+ break;
+ }
+
+ if (AcpiGbl_AutoSerializeMethods)
+ {
+ /* Parse/scan method and serialize it if necessary */
+
+ AcpiDsAutoSerializeMethod (Node, ObjDesc);
+ if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
+ {
+ /* Method was just converted to Serialized */
+
+ Info->SerialMethodCount++;
+ Info->SerializedMethodCount++;
+ break;
+ }
+ }
+
+ Info->NonSerialMethodCount++;
break;
case ACPI_TYPE_DEVICE:
@@ -187,7 +223,6 @@ AcpiDsInitializeObjects (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
/* Set all init info to zero */
@@ -223,12 +258,14 @@ AcpiDsInitializeObjects (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- "\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n",
- Table->Signature, OwnerId, Info.ObjectCount,
- Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%u Methods, %u Regions\n", Info.MethodCount, Info.OpRegionCount));
+ "Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, "
+ "%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n",
+ Table->Signature, OwnerId, Info.ObjectCount, Info.DeviceCount,
+ Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
+ Info.NonSerialMethodCount, Info.SerializedMethodCount));
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
+ Info.MethodCount, Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
index d2dccaf..1fd8173 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,8 @@
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/acdisasm.h>
+#include <contrib/dev/acpica/include/acparser.h>
+#include <contrib/dev/acpica/include/amlcode.h>
#define _COMPONENT ACPI_DISPATCHER
@@ -57,12 +59,156 @@
/* Local prototypes */
static ACPI_STATUS
+AcpiDsDetectNamedOpcodes (
+ ACPI_WALK_STATE *WalkState,
+ ACPI_PARSE_OBJECT **OutOp);
+
+static ACPI_STATUS
AcpiDsCreateMethodMutex (
ACPI_OPERAND_OBJECT *MethodDesc);
/*******************************************************************************
*
+ * FUNCTION: AcpiDsAutoSerializeMethod
+ *
+ * PARAMETERS: Node - Namespace Node of the method
+ * ObjDesc - Method object attached to node
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Parse a control method AML to scan for control methods that
+ * need serialization due to the creation of named objects.
+ *
+ * NOTE: It is a bit of overkill to mark all such methods serialized, since
+ * there is only a problem if the method actually blocks during execution.
+ * A blocking operation is, for example, a Sleep() operation, or any access
+ * to an operation region. However, it is probably not possible to easily
+ * detect whether a method will block or not, so we simply mark all suspicious
+ * methods as serialized.
+ *
+ * NOTE2: This code is essentially a generic routine for parsing a single
+ * control method.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDsAutoSerializeMethod (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OPERAND_OBJECT *ObjDesc)
+{
+ ACPI_STATUS Status;
+ ACPI_PARSE_OBJECT *Op = NULL;
+ ACPI_WALK_STATE *WalkState;
+
+
+ ACPI_FUNCTION_TRACE_PTR (DsAutoSerializeMethod, Node);
+
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Method auto-serialization parse [%4.4s] %p\n",
+ AcpiUtGetNodeName (Node), Node));
+
+ /* Create/Init a root op for the method parse tree */
+
+ Op = AcpiPsAllocOp (AML_METHOD_OP);
+ if (!Op)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ AcpiPsSetName (Op, Node->Name.Integer);
+ Op->Common.Node = Node;
+
+ /* Create and initialize a new walk state */
+
+ WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL);
+ if (!WalkState)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
+ ObjDesc->Method.AmlLength, NULL, 0);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiDsDeleteWalkState (WalkState);
+ return_ACPI_STATUS (Status);
+ }
+
+ WalkState->DescendingCallback = AcpiDsDetectNamedOpcodes;
+
+ /* Parse the method, scan for creation of named objects */
+
+ Status = AcpiPsParseAml (WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ AcpiPsDeleteParseTree (Op);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDsDetectNamedOpcodes
+ *
+ * PARAMETERS: WalkState - Current state of the parse tree walk
+ * OutOp - Unused, required for parser interface
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Descending callback used during the loading of ACPI tables.
+ * Currently used to detect methods that must be marked serialized
+ * in order to avoid problems with the creation of named objects.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDsDetectNamedOpcodes (
+ ACPI_WALK_STATE *WalkState,
+ ACPI_PARSE_OBJECT **OutOp)
+{
+
+ ACPI_FUNCTION_NAME (AcpiDsDetectNamedOpcodes);
+
+
+ /* We are only interested in opcodes that create a new name */
+
+ if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_FIELD)))
+ {
+ return (AE_OK);
+ }
+
+ /*
+ * At this point, we know we have a Named object opcode.
+ * Mark the method as serialized. Later code will create a mutex for
+ * this method to enforce serialization.
+ *
+ * Note, ACPI_METHOD_IGNORE_SYNC_LEVEL flag means that we will ignore the
+ * Sync Level mechanism for this method, even though it is now serialized.
+ * Otherwise, there can be conflicts with existing ASL code that actually
+ * uses sync levels.
+ */
+ WalkState->MethodDesc->Method.SyncLevel = 0;
+ WalkState->MethodDesc->Method.InfoFlags |=
+ (ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Method serialized [%4.4s] %p - [%s] (%4.4X)\n",
+ WalkState->MethodNode->Name.Ascii, WalkState->MethodNode,
+ WalkState->OpInfo->Name, WalkState->Opcode));
+
+ /* Abort the parse, no need to examine this method any further */
+
+ return (AE_CTRL_TERMINATE);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDsMethodError
*
* PARAMETERS: Status - Execution status
@@ -238,11 +384,16 @@ AcpiDsBeginMethodExecution (
/*
* The CurrentSyncLevel (per-thread) must be less than or equal to
* the sync level of the method. This mechanism provides some
- * deadlock prevention
+ * deadlock prevention.
+ *
+ * If the method was auto-serialized, we just ignore the sync level
+ * mechanism, because auto-serialization of methods can interfere
+ * with ASL code that actually uses sync levels.
*
* Top-level method invocation has no walk state at this point
*/
if (WalkState &&
+ (!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
(WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel))
{
ACPI_ERROR ((AE_INFO,
@@ -710,7 +861,8 @@ AcpiDsTerminateControlMethod (
* thread exits here.
*/
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING;
- MethodDesc->Method.InfoFlags |= ACPI_METHOD_SERIALIZED;
+ MethodDesc->Method.InfoFlags |=
+ (ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
MethodDesc->Method.SyncLevel = 0;
}
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c b/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
index 76157f5..8e4555c 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
index a853d3d..04515fd 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
index b7ff590..fa225ce 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
index 0a386cc..cb1c846 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -779,16 +779,16 @@ AcpiDsCreateOperands (
Index++;
}
- Index--;
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "NumOperands %d, ArgCount %d, Index %d\n",
+ WalkState->NumOperands, ArgCount, Index));
- /* It is the appropriate order to get objects from the Result stack */
+ /* Create the interpreter arguments, in reverse order */
+ Index--;
for (i = 0; i < ArgCount; i++)
{
Arg = Arguments[Index];
-
- /* Force the filling of the operand stack in inverse order */
-
WalkState->OperandIndex = (UINT8) Index;
Status = AcpiDsCreateOperand (WalkState, Arg, Index);
@@ -797,10 +797,10 @@ AcpiDsCreateOperands (
goto Cleanup;
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Created Arg #%u (%p) %u args total\n",
+ Index, Arg, ArgCount));
Index--;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%u (%p) done, Arg1=%p\n",
- Index, Arg, FirstArg));
}
return_ACPI_STATUS (Status);
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
index 6955f3c..c6009fb 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -541,7 +541,8 @@ AcpiDsExecEndOp (
return_ACPI_STATUS (AE_OK);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Method invocation, Op=%p\n", Op));
/*
* (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload.c b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
index 1cc8d4f..eca145e 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -80,8 +80,21 @@ AcpiDsInitCallbacks (
switch (PassNumber)
{
+ case 0:
+
+ /* Parse only - caller will setup callbacks */
+
+ WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
+ ACPI_PARSE_DELETE_TREE |
+ ACPI_PARSE_DISASSEMBLE;
+ WalkState->DescendingCallback = NULL;
+ WalkState->AscendingCallback = NULL;
+ break;
+
case 1:
+ /* Load pass 1 */
+
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsLoad1BeginOp;
@@ -90,6 +103,8 @@ AcpiDsInitCallbacks (
case 2:
+ /* Load pass 2 */
+
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsLoad2BeginOp;
@@ -98,6 +113,8 @@ AcpiDsInitCallbacks (
case 3:
+ /* Execution pass */
+
#ifndef ACPI_NO_METHOD_EXECUTION
WalkState->ParseFlags |= ACPI_PARSE_EXECUTE |
ACPI_PARSE_DELETE_TREE;
@@ -193,7 +210,7 @@ AcpiDsLoad1BeginOp (
* Target of Scope() not found. Generate an External for it, and
* insert the name into the namespace.
*/
- AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0);
+ AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0);
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
WalkState, &Node);
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
index 2b85413..abcc1c3 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswscope.c b/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
index 8530b5d..5d2152b 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswstate.c b/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
index 8fd36bf..4071d5f 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __DSWSTATE_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/events/evevent.c b/sys/contrib/dev/acpica/components/events/evevent.c
index dc8457c..3116ac6 100644
--- a/sys/contrib/dev/acpica/components/events/evevent.c
+++ b/sys/contrib/dev/acpica/components/events/evevent.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evglock.c b/sys/contrib/dev/acpica/components/events/evglock.c
index 9c5ade0..44c768a 100644
--- a/sys/contrib/dev/acpica/components/events/evglock.c
+++ b/sys/contrib/dev/acpica/components/events/evglock.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evgpe.c b/sys/contrib/dev/acpica/components/events/evgpe.c
index f4d1214..7d4a5d0 100644
--- a/sys/contrib/dev/acpica/components/events/evgpe.c
+++ b/sys/contrib/dev/acpica/components/events/evgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -432,7 +432,7 @@ AcpiEvGpeDetect (
GpeRegisterInfo->EnableForWake))
{
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Ignore disabled registers for GPE%02X-GPE%02X: "
+ "Ignore disabled registers for GPE %02X-%02X: "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
@@ -458,7 +458,7 @@ AcpiEvGpeDetect (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
+ "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
@@ -549,6 +549,7 @@ AcpiEvAsynchExecuteGpeMethod (
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
+ ACPI_FREE (LocalGpeEventInfo);
return_VOID;
}
@@ -557,6 +558,7 @@ AcpiEvAsynchExecuteGpeMethod (
if (!AcpiEvValidGpeEvent (GpeEventInfo))
{
Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+ ACPI_FREE (LocalGpeEventInfo);
return_VOID;
}
@@ -570,6 +572,7 @@ AcpiEvAsynchExecuteGpeMethod (
Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
+ ACPI_FREE (LocalGpeEventInfo);
return_VOID;
}
@@ -758,22 +761,6 @@ AcpiEvGpeDispatch (
}
/*
- * If edge-triggered, clear the GPE status bit now. Note that
- * level-triggered events are cleared after the GPE is serviced.
- */
- if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
- ACPI_GPE_EDGE_TRIGGERED)
- {
- Status = AcpiHwClearGpe (GpeEventInfo);
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to clear GPE%02X", GpeNumber));
- return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
- }
- }
-
- /*
* Always disable the GPE so that it does not keep firing before
* any asynchronous activity completes (either from the execution
* of a GPE method or an asynchronous GPE handler.)
@@ -786,11 +773,29 @@ AcpiEvGpeDispatch (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to disable GPE%02X", GpeNumber));
+ "Unable to disable GPE %02X", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
/*
+ * If edge-triggered, clear the GPE status bit now. Note that
+ * level-triggered events are cleared after the GPE is serviced.
+ */
+ if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
+ ACPI_GPE_EDGE_TRIGGERED)
+ {
+ Status = AcpiHwClearGpe (GpeEventInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Unable to clear GPE %02X", GpeNumber));
+ (void) AcpiHwLowSetGpe (GpeEventInfo,
+ ACPI_GPE_CONDITIONAL_ENABLE);
+ return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
+ }
+ }
+
+ /*
* Dispatch the GPE to either an installed handler or the control
* method associated with this GPE (_Lxx or _Exx). If a handler
* exists, we invoke it and do not attempt to run the method.
@@ -826,7 +831,7 @@ AcpiEvGpeDispatch (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to queue handler for GPE%02X - event disabled",
+ "Unable to queue handler for GPE %02X - event disabled",
GpeNumber));
}
break;
@@ -838,7 +843,7 @@ AcpiEvGpeDispatch (
* a GPE to be enabled if it has no handler or method.
*/
ACPI_ERROR ((AE_INFO,
- "No handler or method for GPE%02X, disabling event",
+ "No handler or method for GPE %02X, disabling event",
GpeNumber));
break;
}
diff --git a/sys/contrib/dev/acpica/components/events/evgpeblk.c b/sys/contrib/dev/acpica/components/events/evgpeblk.c
index f0d53a3..e8f0d63 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeblk.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeblk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -97,10 +97,9 @@ AcpiEvInstallGpeBlock (
return_ACPI_STATUS (Status);
}
- GpeXruptBlock = AcpiEvGetGpeXruptBlock (InterruptNumber);
- if (!GpeXruptBlock)
+ Status = AcpiEvGetGpeXruptBlock (InterruptNumber, &GpeXruptBlock);
+ if (ACPI_FAILURE (Status))
{
- Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
@@ -128,7 +127,7 @@ AcpiEvInstallGpeBlock (
UnlockAndExit:
- Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (Status);
}
@@ -283,17 +282,17 @@ AcpiEvCreateGpeInfoBlocks (
{
/* Init the RegisterInfo for this GPE register (8 GPEs) */
- ThisRegister->BaseGpeNumber = (UINT8) (GpeBlock->BlockBaseNumber +
- (i * ACPI_GPE_REGISTER_WIDTH));
+ ThisRegister->BaseGpeNumber = (UINT16)
+ (GpeBlock->BlockBaseNumber + (i * ACPI_GPE_REGISTER_WIDTH));
ThisRegister->StatusAddress.Address =
- GpeBlock->BlockAddress.Address + i;
+ GpeBlock->Address + i;
ThisRegister->EnableAddress.Address =
- GpeBlock->BlockAddress.Address + i + GpeBlock->RegisterCount;
+ GpeBlock->Address + i + GpeBlock->RegisterCount;
- ThisRegister->StatusAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
- ThisRegister->EnableAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
+ ThisRegister->StatusAddress.SpaceId = GpeBlock->SpaceId;
+ ThisRegister->EnableAddress.SpaceId = GpeBlock->SpaceId;
ThisRegister->StatusAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
ThisRegister->EnableAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
ThisRegister->StatusAddress.BitOffset = 0;
@@ -366,9 +365,10 @@ ErrorExit:
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
- ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT64 Address,
+ UINT8 SpaceId,
UINT32 RegisterCount,
- UINT8 GpeBlockBaseNumber,
+ UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
{
@@ -395,15 +395,14 @@ AcpiEvCreateGpeBlock (
/* Initialize the new GPE block */
+ GpeBlock->Address = Address;
+ GpeBlock->SpaceId = SpaceId;
GpeBlock->Node = GpeDevice;
GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
GpeBlock->Initialized = FALSE;
GpeBlock->RegisterCount = RegisterCount;
GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
- ACPI_MEMCPY (&GpeBlock->BlockAddress, GpeBlockAddress,
- sizeof (ACPI_GENERIC_ADDRESS));
-
/*
* Create the RegisterInfo and EventInfo sub-structures
* Note: disables and clears all GPEs in the block
@@ -446,11 +445,11 @@ AcpiEvCreateGpeBlock (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
+ " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
(UINT32) GpeBlock->BlockBaseNumber,
(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
- GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
- InterruptNumber));
+ GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
+ InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
/* Update global count of currently available GPEs */
diff --git a/sys/contrib/dev/acpica/components/events/evgpeinit.c b/sys/contrib/dev/acpica/components/events/evgpeinit.c
index 8c74149..d5e00e3 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeinit.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
@@ -139,7 +138,9 @@ AcpiEvGpeInitialize (
/* Install GPE Block 0 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- &AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,
+ AcpiGbl_FADT.XGpe0Block.Address,
+ AcpiGbl_FADT.XGpe0Block.SpaceId,
+ RegisterCount0, 0,
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
if (ACPI_FAILURE (Status))
@@ -177,7 +178,9 @@ AcpiEvGpeInitialize (
/* Install GPE Block 1 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- &AcpiGbl_FADT.XGpe1Block, RegisterCount1,
+ AcpiGbl_FADT.XGpe1Block.Address,
+ AcpiGbl_FADT.XGpe1Block.SpaceId,
+ RegisterCount1,
AcpiGbl_FADT.Gpe1Base,
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
@@ -440,6 +443,10 @@ AcpiEvMatchGpeMethod (
return_ACPI_STATUS (AE_OK);
}
+ /* Disable the GPE in case it's been enabled already. */
+
+ (void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
+
/*
* Add the GPE information from above to the GpeEventInfo block for
* use during dispatch of this GPE.
diff --git a/sys/contrib/dev/acpica/components/events/evgpeutil.c b/sys/contrib/dev/acpica/components/events/evgpeutil.c
index 35caa5a..e2a44bc 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeutil.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeutil.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -217,8 +217,9 @@ AcpiEvGetGpeDevice (
* FUNCTION: AcpiEvGetGpeXruptBlock
*
* PARAMETERS: InterruptNumber - Interrupt for a GPE block
+ * GpeXruptBlock - Where the block is returned
*
- * RETURN: A GPE interrupt block
+ * RETURN: Status
*
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
* block per unique interrupt level used for GPEs. Should be
@@ -227,9 +228,10 @@ AcpiEvGetGpeDevice (
*
******************************************************************************/
-ACPI_GPE_XRUPT_INFO *
+ACPI_STATUS
AcpiEvGetGpeXruptBlock (
- UINT32 InterruptNumber)
+ UINT32 InterruptNumber,
+ ACPI_GPE_XRUPT_INFO **GpeXruptBlock)
{
ACPI_GPE_XRUPT_INFO *NextGpeXrupt;
ACPI_GPE_XRUPT_INFO *GpeXrupt;
@@ -247,7 +249,8 @@ AcpiEvGetGpeXruptBlock (
{
if (NextGpeXrupt->InterruptNumber == InterruptNumber)
{
- return_PTR (NextGpeXrupt);
+ *GpeXruptBlock = NextGpeXrupt;
+ return_ACPI_STATUS (AE_OK);
}
NextGpeXrupt = NextGpeXrupt->Next;
@@ -258,7 +261,7 @@ AcpiEvGetGpeXruptBlock (
GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO));
if (!GpeXrupt)
{
- return_PTR (NULL);
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
GpeXrupt->InterruptNumber = InterruptNumber;
@@ -281,6 +284,7 @@ AcpiEvGetGpeXruptBlock (
{
AcpiGbl_GpeXruptListHead = GpeXrupt;
}
+
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
/* Install new interrupt handler if not SCI_INT */
@@ -291,14 +295,15 @@ AcpiEvGetGpeXruptBlock (
AcpiEvGpeXruptHandler, GpeXrupt);
if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO,
+ ACPI_EXCEPTION ((AE_INFO, Status,
"Could not install GPE interrupt handler at level 0x%X",
InterruptNumber));
- return_PTR (NULL);
+ return_ACPI_STATUS (Status);
}
}
- return_PTR (GpeXrupt);
+ *GpeXruptBlock = GpeXrupt;
+ return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/events/evhandler.c b/sys/contrib/dev/acpica/components/events/evhandler.c
index cb03bc9..73a2df2 100644
--- a/sys/contrib/dev/acpica/components/events/evhandler.c
+++ b/sys/contrib/dev/acpica/components/events/evhandler.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EVHANDLER_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/events/evmisc.c b/sys/contrib/dev/acpica/components/events/evmisc.c
index 547534b..a710b56 100644
--- a/sys/contrib/dev/acpica/components/events/evmisc.c
+++ b/sys/contrib/dev/acpica/components/events/evmisc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -181,7 +181,7 @@ AcpiEvQueueNotifyRequest (
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n",
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
- NotifyValue, AcpiUtGetNotifyName (NotifyValue), Node));
+ NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
Info);
diff --git a/sys/contrib/dev/acpica/components/events/evregion.c b/sys/contrib/dev/acpica/components/events/evregion.c
index d469d6e..8078bf9 100644
--- a/sys/contrib/dev/acpica/components/events/evregion.c
+++ b/sys/contrib/dev/acpica/components/events/evregion.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EVREGION_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -159,6 +158,7 @@ AcpiEvAddressSpaceDispatch (
ACPI_OPERAND_OBJECT *RegionObj2;
void *RegionContext = NULL;
ACPI_CONNECTION_INFO *Context;
+ ACPI_PHYSICAL_ADDRESS Address;
ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
@@ -248,23 +248,23 @@ AcpiEvAddressSpaceDispatch (
/* We have everything we need, we can invoke the address space handler */
Handler = HandlerDesc->AddressSpace.Handler;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
- "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
- &RegionObj->Region.Handler->AddressSpace, Handler,
- ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset),
- AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+ Address = (RegionObj->Region.Address + RegionOffset);
/*
* Special handling for GenericSerialBus and GeneralPurposeIo:
* There are three extra parameters that must be passed to the
* handler via the context:
- * 1) Connection buffer, a resource template from Connection() op.
- * 2) Length of the above buffer.
- * 3) Actual access length from the AccessAs() op.
+ * 1) Connection buffer, a resource template from Connection() op
+ * 2) Length of the above buffer
+ * 3) Actual access length from the AccessAs() op
+ *
+ * In addition, for GeneralPurposeIo, the Address and BitWidth fields
+ * are defined as follows:
+ * 1) Address is the pin number index of the field (bit offset from
+ * the previous Connection)
+ * 2) BitWidth is the actual bit length of the field (number of pins)
*/
- if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) ||
- (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) &&
+ if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) &&
Context &&
FieldObj)
{
@@ -274,6 +274,24 @@ AcpiEvAddressSpaceDispatch (
Context->Length = FieldObj->Field.ResourceLength;
Context->AccessLength = FieldObj->Field.AccessLength;
}
+ if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) &&
+ Context &&
+ FieldObj)
+ {
+ /* Get the Connection (ResourceTemplate) buffer */
+
+ Context->Connection = FieldObj->Field.ResourceBuffer;
+ Context->Length = FieldObj->Field.ResourceLength;
+ Context->AccessLength = FieldObj->Field.AccessLength;
+ Address = FieldObj->Field.PinNumberIndex;
+ BitWidth = FieldObj->Field.BitLength;
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
+ &RegionObj->Region.Handler->AddressSpace, Handler,
+ ACPI_FORMAT_NATIVE_UINT (Address),
+ AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
if (!(HandlerDesc->AddressSpace.HandlerFlags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
@@ -288,9 +306,8 @@ AcpiEvAddressSpaceDispatch (
/* Call the handler */
- Status = Handler (Function,
- (RegionObj->Region.Address + RegionOffset), BitWidth, Value,
- Context, RegionObj2->Extra.RegionContext);
+ Status = Handler (Function, Address, BitWidth, Value, Context,
+ RegionObj2->Extra.RegionContext);
if (ACPI_FAILURE (Status))
{
@@ -333,6 +350,7 @@ AcpiEvDetachRegion(
{
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *StartDesc;
ACPI_OPERAND_OBJECT **LastObjPtr;
ACPI_ADR_SPACE_SETUP RegionSetup;
void **RegionContext;
@@ -363,6 +381,7 @@ AcpiEvDetachRegion(
/* Find this region in the handler's list */
ObjDesc = HandlerObj->AddressSpace.RegionList;
+ StartDesc = ObjDesc;
LastObjPtr = &HandlerObj->AddressSpace.RegionList;
while (ObjDesc)
@@ -457,6 +476,16 @@ AcpiEvDetachRegion(
LastObjPtr = &ObjDesc->Region.Next;
ObjDesc = ObjDesc->Region.Next;
+
+ /* Prevent infinite loop if list is corrupted */
+
+ if (ObjDesc == StartDesc)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Circular handler list in region object %p",
+ RegionObj));
+ return_VOID;
+ }
}
/* If we get here, the region was not in the handler's region list */
diff --git a/sys/contrib/dev/acpica/components/events/evrgnini.c b/sys/contrib/dev/acpica/components/events/evrgnini.c
index 5a9e9e8..14fea69 100644
--- a/sys/contrib/dev/acpica/components/events/evrgnini.c
+++ b/sys/contrib/dev/acpica/components/events/evrgnini.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EVRGNINI_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/events/evsci.c b/sys/contrib/dev/acpica/components/events/evsci.c
index 4fa84f3..8688a31 100644
--- a/sys/contrib/dev/acpica/components/events/evsci.c
+++ b/sys/contrib/dev/acpica/components/events/evsci.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -135,7 +135,7 @@ AcpiEvSciXruptHandler (
/*
- * We are guaranteed by the ACPI CA initialization/shutdown code that
+ * We are guaranteed by the ACPICA initialization/shutdown code that
* if this interrupt handler is installed, ACPI is enabled.
*/
diff --git a/sys/contrib/dev/acpica/components/events/evxface.c b/sys/contrib/dev/acpica/components/events/evxface.c
index 4ed3247..cdb6fce 100644
--- a/sys/contrib/dev/acpica/components/events/evxface.c
+++ b/sys/contrib/dev/acpica/components/events/evxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EVXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -265,7 +265,7 @@ AcpiRemoveNotifyHandler (
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_OPERAND_OBJECT *PreviousHandlerObj;
- ACPI_STATUS Status;
+ ACPI_STATUS Status = AE_OK;
UINT32 i;
@@ -280,16 +280,6 @@ AcpiRemoveNotifyHandler (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Make sure all deferred notify tasks are completed */
-
- AcpiOsWaitEventsComplete ();
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
/* Root Object. Global handlers are removed here */
if (Device == ACPI_ROOT_OBJECT)
@@ -298,6 +288,12 @@ AcpiRemoveNotifyHandler (
{
if (HandlerType & (i+1))
{
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
if (!AcpiGbl_GlobalNotify[i].Handler ||
(AcpiGbl_GlobalNotify[i].Handler != Handler))
{
@@ -310,18 +306,23 @@ AcpiRemoveNotifyHandler (
AcpiGbl_GlobalNotify[i].Handler = NULL;
AcpiGbl_GlobalNotify[i].Context = NULL;
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
+ /* Make sure all deferred notify tasks are completed */
+
+ AcpiOsWaitEventsComplete ();
}
}
- goto UnlockAndExit;
+ return_ACPI_STATUS (AE_OK);
}
/* All other objects: Are Notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
- Status = AE_TYPE;
- goto UnlockAndExit;
+ return_ACPI_STATUS (AE_TYPE);
}
/* Must have an existing internal object */
@@ -329,8 +330,7 @@ AcpiRemoveNotifyHandler (
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
- Status = AE_NOT_EXIST;
- goto UnlockAndExit;
+ return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Internal object exists. Find the handler and remove it */
@@ -339,6 +339,12 @@ AcpiRemoveNotifyHandler (
{
if (HandlerType & (i+1))
{
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
HandlerObj = ObjDesc->CommonNotify.NotifyList[i];
PreviousHandlerObj = NULL;
@@ -370,10 +376,17 @@ AcpiRemoveNotifyHandler (
HandlerObj->Notify.Next[i];
}
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
+ /* Make sure all deferred notify tasks are completed */
+
+ AcpiOsWaitEventsComplete ();
AcpiUtRemoveReference (HandlerObj);
}
}
+ return_ACPI_STATUS (Status);
+
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
@@ -519,6 +532,8 @@ Exit:
return_ACPI_STATUS (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiInstallSciHandler)
+
/*******************************************************************************
*
@@ -595,6 +610,8 @@ UnlockAndExit:
return_ACPI_STATUS (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiRemoveSciHandler)
+
/*******************************************************************************
*
@@ -969,10 +986,6 @@ AcpiRemoveGpeHandler (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Make sure all deferred GPE tasks are completed */
-
- AcpiOsWaitEventsComplete ();
-
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
@@ -1023,16 +1036,24 @@ AcpiRemoveGpeHandler (
* enabled, it should be enabled at this point to restore the
* post-initialization configuration.
*/
- if ((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) &&
+ if (((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) ||
+ (Handler->OriginalFlags & ACPI_GPE_DISPATCH_NOTIFY)) &&
Handler->OriginallyEnabled)
{
(void) AcpiEvAddGpeReference (GpeEventInfo);
}
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+
+ /* Make sure all deferred GPE tasks are completed */
+
+ AcpiOsWaitEventsComplete ();
+
/* Now we can free the handler object */
ACPI_FREE (Handler);
-
+ return_ACPI_STATUS (Status);
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
diff --git a/sys/contrib/dev/acpica/components/events/evxfevnt.c b/sys/contrib/dev/acpica/components/events/evxfevnt.c
index eb17a3f..abb0c0e 100644
--- a/sys/contrib/dev/acpica/components/events/evxfevnt.c
+++ b/sys/contrib/dev/acpica/components/events/evxfevnt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EVXFEVNT_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -364,7 +364,9 @@ AcpiGetEventStatus (
UINT32 Event,
ACPI_EVENT_STATUS *EventStatus)
{
- ACPI_STATUS Status = AE_OK;
+ ACPI_STATUS Status;
+ ACPI_EVENT_STATUS LocalEventStatus = 0;
+ UINT32 InByte;
ACPI_FUNCTION_TRACE (AcpiGetEventStatus);
@@ -382,12 +384,43 @@ AcpiGetEventStatus (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Get the status of the requested fixed event */
+ /* Fixed event currently can be dispatched? */
+
+ if (AcpiGbl_FixedEventHandlers[Event].Handler)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+ }
+
+ /* Fixed event currently enabled? */
Status = AcpiReadBitRegister (
- AcpiGbl_FixedEventInfo[Event].StatusRegisterId, EventStatus);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
- return_ACPI_STATUS (Status);
+ if (InByte)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
+ }
+
+ /* Fixed event currently active? */
+
+ Status = AcpiReadBitRegister (
+ AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ if (InByte)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_SET;
+ }
+
+ (*EventStatus) = LocalEventStatus;
+ return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
diff --git a/sys/contrib/dev/acpica/components/events/evxfgpe.c b/sys/contrib/dev/acpica/components/events/evxfgpe.c
index 0a40bd9..c03f5c0 100644
--- a/sys/contrib/dev/acpica/components/events/evxfgpe.c
+++ b/sys/contrib/dev/acpica/components/events/evxfgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EVXFGPE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -140,12 +140,23 @@ AcpiEnableGpe (
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
- /* Ensure that we have a valid GPE number */
-
+ /*
+ * Ensure that we have a valid GPE number and that there is some way
+ * of handling the GPE (handler or a GPE method). In other words, we
+ * won't allow a valid GPE to be enabled if there is no way to handle it.
+ */
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (GpeEventInfo)
{
- Status = AcpiEvAddGpeReference (GpeEventInfo);
+ if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
+ ACPI_GPE_DISPATCH_NONE)
+ {
+ Status = AcpiEvAddGpeReference (GpeEventInfo);
+ }
+ else
+ {
+ Status = AE_NO_HANDLER;
+ }
}
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
@@ -275,6 +286,60 @@ ACPI_EXPORT_SYMBOL (AcpiSetGpe)
/*******************************************************************************
*
+ * FUNCTION: AcpiMarkGpeForWake
+ *
+ * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
+ * GpeNumber - GPE level within the GPE block
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Mark a GPE as having the ability to wake the system. Simply
+ * sets the ACPI_GPE_CAN_WAKE flag.
+ *
+ * Some potential callers of AcpiSetupGpeForWake may know in advance that
+ * there won't be any notify handlers installed for device wake notifications
+ * from the given GPE (one example is a button GPE in Linux). For these cases,
+ * AcpiMarkGpeForWake should be used instead of AcpiSetupGpeForWake.
+ * This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
+ * setup implicit wake notification for it (since there's no handler method).
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiMarkGpeForWake (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber)
+{
+ ACPI_GPE_EVENT_INFO *GpeEventInfo;
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+ ACPI_CPU_FLAGS Flags;
+
+
+ ACPI_FUNCTION_TRACE (AcpiMarkGpeForWake);
+
+
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+
+ /* Ensure that we have a valid GPE number */
+
+ GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
+ if (GpeEventInfo)
+ {
+ /* Mark the GPE as a possible wake event */
+
+ GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
+ Status = AE_OK;
+ }
+
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiMarkGpeForWake)
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiSetupGpeForWake
*
* PARAMETERS: WakeDevice - Device associated with the GPE (via _PRW)
@@ -790,11 +855,26 @@ AcpiInstallGpeBlock (
goto UnlockAndExit;
}
+ /* Validate the parent device */
+
+ if (Node->Type != ACPI_TYPE_DEVICE)
+ {
+ Status = AE_TYPE;
+ goto UnlockAndExit;
+ }
+
+ if (Node->Object)
+ {
+ Status = AE_ALREADY_EXISTS;
+ goto UnlockAndExit;
+ }
+
/*
* For user-installed GPE Block Devices, the GpeBlockBaseNumber
* is always zero
*/
- Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
+ Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
+ GpeBlockAddress->SpaceId, RegisterCount,
0, InterruptNumber, &GpeBlock);
if (ACPI_FAILURE (Status))
{
@@ -883,6 +963,14 @@ AcpiRemoveGpeBlock (
goto UnlockAndExit;
}
+ /* Validate the parent device */
+
+ if (Node->Type != ACPI_TYPE_DEVICE)
+ {
+ Status = AE_TYPE;
+ goto UnlockAndExit;
+ }
+
/* Get the DeviceObject attached to the node */
ObjDesc = AcpiNsGetAttachedObject (Node);
diff --git a/sys/contrib/dev/acpica/components/events/evxfregn.c b/sys/contrib/dev/acpica/components/events/evxfregn.c
index 432657d..eb53c0d 100644
--- a/sys/contrib/dev/acpica/components/events/evxfregn.c
+++ b/sys/contrib/dev/acpica/components/events/evxfregn.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,7 @@
*/
#define __EVXFREGN_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exconfig.c b/sys/contrib/dev/acpica/components/executer/exconfig.c
index 2306e83..c3bb563 100644
--- a/sys/contrib/dev/acpica/components/executer/exconfig.c
+++ b/sys/contrib/dev/acpica/components/executer/exconfig.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -380,8 +380,8 @@ AcpiExLoadOp (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT *DdbHandle;
+ ACPI_TABLE_HEADER *TableHeader;
ACPI_TABLE_HEADER *Table;
- ACPI_TABLE_DESC TableDesc;
UINT32 TableIndex;
ACPI_STATUS Status;
UINT32 Length;
@@ -390,8 +390,6 @@ AcpiExLoadOp (
ACPI_FUNCTION_TRACE (ExLoadOp);
- ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC));
-
/* Source Object can be either an OpRegion or a Buffer/Field */
switch (ObjDesc->Common.Type)
@@ -423,16 +421,16 @@ AcpiExLoadOp (
/* Get the table header first so we can get the table length */
- Table = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
- if (!Table)
+ TableHeader = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
+ if (!TableHeader)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiExRegionRead (ObjDesc, sizeof (ACPI_TABLE_HEADER),
- ACPI_CAST_PTR (UINT8, Table));
- Length = Table->Length;
- ACPI_FREE (Table);
+ ACPI_CAST_PTR (UINT8, TableHeader));
+ Length = TableHeader->Length;
+ ACPI_FREE (TableHeader);
if (ACPI_FAILURE (Status))
{
@@ -464,8 +462,8 @@ AcpiExLoadOp (
/* Allocate a buffer for the table */
- TableDesc.Pointer = ACPI_ALLOCATE (Length);
- if (!TableDesc.Pointer)
+ Table = ACPI_ALLOCATE (Length);
+ if (!Table)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -473,14 +471,12 @@ AcpiExLoadOp (
/* Read the entire table */
Status = AcpiExRegionRead (ObjDesc, Length,
- ACPI_CAST_PTR (UINT8, TableDesc.Pointer));
+ ACPI_CAST_PTR (UINT8, Table));
if (ACPI_FAILURE (Status))
{
- ACPI_FREE (TableDesc.Pointer);
+ ACPI_FREE (Table);
return_ACPI_STATUS (Status);
}
-
- TableDesc.Address = ObjDesc->Region.Address;
break;
case ACPI_TYPE_BUFFER: /* Buffer or resolved RegionField */
@@ -497,8 +493,8 @@ AcpiExLoadOp (
/* Get the actual table length from the table header */
- Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
- Length = Table->Length;
+ TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
+ Length = TableHeader->Length;
/* Table cannot extend beyond the buffer */
@@ -515,14 +511,13 @@ AcpiExLoadOp (
* Copy the table from the buffer because the buffer could be modified
* or even deleted in the future
*/
- TableDesc.Pointer = ACPI_ALLOCATE (Length);
- if (!TableDesc.Pointer)
+ Table = ACPI_ALLOCATE (Length);
+ if (!Table)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
- ACPI_MEMCPY (TableDesc.Pointer, Table, Length);
- TableDesc.Address = ACPI_TO_INTEGER (TableDesc.Pointer);
+ ACPI_MEMCPY (Table, TableHeader, Length);
break;
default:
@@ -530,28 +525,31 @@ AcpiExLoadOp (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
- /* Validate table checksum (will not get validated in TbAddTable) */
+ /* Install the new table into the local data structures */
+
+ ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
+ Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
+ &TableIndex);
- Status = AcpiTbVerifyChecksum (TableDesc.Pointer, Length);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
if (ACPI_FAILURE (Status))
{
- ACPI_FREE (TableDesc.Pointer);
+ /* Delete allocated table buffer */
+
+ ACPI_FREE (Table);
return_ACPI_STATUS (Status);
}
- /* Complete the table descriptor */
-
- TableDesc.Length = Length;
- TableDesc.Flags = ACPI_TABLE_ORIGIN_ALLOCATED;
-
- /* Install the new table into the local data structures */
-
- Status = AcpiTbAddTable (&TableDesc, &TableIndex);
+ /*
+ * Note: Now table is "INSTALLED", it must be validated before
+ * loading.
+ */
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
- /* Delete allocated table buffer */
-
- AcpiTbDeleteTable (&TableDesc);
return_ACPI_STATUS (Status);
}
@@ -583,9 +581,6 @@ AcpiExLoadOp (
return_ACPI_STATUS (Status);
}
- ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
- AcpiTbPrintTableHeader (0, TableDesc.Pointer);
-
/* Remove the reference by added by AcpiExStore above */
AcpiUtRemoveReference (DdbHandle);
@@ -594,7 +589,7 @@ AcpiExLoadOp (
if (AcpiGbl_TableHandler)
{
- (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, TableDesc.Pointer,
+ (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
AcpiGbl_TableHandlerContext);
}
@@ -628,6 +623,14 @@ AcpiExUnloadTable (
/*
+ * Temporarily emit a warning so that the ASL for the machine can be
+ * hopefully obtained. This is to say that the Unload() operator is
+ * extremely rare if not completely unused.
+ */
+ ACPI_WARNING ((AE_INFO,
+ "Received request to unload an ACPI table"));
+
+ /*
* Validate the handle
* Although the handle is partially validated in AcpiExReconfiguration()
* when it calls AcpiExResolveOperands(), the handle is more completely
diff --git a/sys/contrib/dev/acpica/components/executer/exconvrt.c b/sys/contrib/dev/acpica/components/executer/exconvrt.c
index f6113a5..f2557c0 100644
--- a/sys/contrib/dev/acpica/components/executer/exconvrt.c
+++ b/sys/contrib/dev/acpica/components/executer/exconvrt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EXCONVRT_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/executer/excreate.c b/sys/contrib/dev/acpica/components/executer/excreate.c
index 55715c2..224249d 100644
--- a/sys/contrib/dev/acpica/components/executer/excreate.c
+++ b/sys/contrib/dev/acpica/components/executer/excreate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exdebug.c b/sys/contrib/dev/acpica/components/executer/exdebug.c
index 06f35b8..ec8b5a0 100644
--- a/sys/contrib/dev/acpica/components/executer/exdebug.c
+++ b/sys/contrib/dev/acpica/components/executer/exdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -82,6 +82,7 @@ AcpiExDoDebugObject (
UINT32 Index)
{
UINT32 i;
+ UINT32 Timer;
ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
@@ -96,12 +97,20 @@ AcpiExDoDebugObject (
}
/*
+ * We will emit the current timer value (in microseconds) with each
+ * debug output. Only need the lower 26 bits. This allows for 67
+ * million microseconds or 67 seconds before rollover.
+ */
+ Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
+ Timer &= 0x03FFFFFF;
+
+ /*
* Print line header as long as we are not in the middle of an
* object display
*/
if (!((Level > 0) && Index == 0))
{
- AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
+ AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
}
/* Display the index for package output only */
diff --git a/sys/contrib/dev/acpica/components/executer/exdump.c b/sys/contrib/dev/acpica/components/executer/exdump.c
index c37f9ae..153b2c1 100644
--- a/sys/contrib/dev/acpica/components/executer/exdump.c
+++ b/sys/contrib/dev/acpica/components/executer/exdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -114,13 +114,14 @@ static ACPI_EXDUMP_INFO AcpiExDumpBuffer[5] =
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer), NULL},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Buffer.Length), "Length"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Pointer), "Pointer"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},
{ACPI_EXD_BUFFER, 0, NULL}
};
-static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] =
+static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Elements"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"},
@@ -130,9 +131,9 @@ static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] =
static ACPI_EXDUMP_INFO AcpiExDumpDevice[4] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice), NULL},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.Handler), "Handler"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[0]), "System Notify"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"}
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"},
+ {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Device.Handler), "Handler"}
};
static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] =
@@ -154,33 +155,36 @@ static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.AmlStart), "Aml Start"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpMutex[5] =
+static ACPI_EXDUMP_INFO AcpiExDumpMutex[6] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.SyncLevel), "Sync Level"},
+ {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.OriginalSyncLevel), "Original Sync Level"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OwnerThread), "Owner Thread"},
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Mutex.AcquisitionDepth), "Acquire Depth"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OsMutex), "OsMutex"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpRegion[7] =
+static ACPI_EXDUMP_INFO AcpiExDumpRegion[8] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.SpaceId), "Space Id"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.Flags), "Flags"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Region.Node), "Parent Node"},
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Region.Address), "Address"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Region.Length), "Length"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Handler), "Handler"},
+ {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Region.Handler), "Handler"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Next), "Next"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpPower[5] =
+static ACPI_EXDUMP_INFO AcpiExDumpPower[6] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower), NULL},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.SystemLevel), "System Level"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.ResourceOrder), "Resource Order"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[0]), "System Notify"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"}
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.Handler), "Handler"}
};
static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
@@ -243,7 +247,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpReference[8] =
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.TargetType), "Target Type"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Reference.Value), "Value"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Node), "Node"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"},
{ACPI_EXD_REFERENCE,0, NULL}
};
@@ -252,16 +256,16 @@ static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler[6] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (AddressSpace.SpaceId), "Space Id"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},
+ {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},
+ {ACPI_EXD_RGN_LIST, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Context), "Context"}
};
static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify), NULL},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Node), "Node"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Notify.Node), "Node"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Notify.HandlerType), "Handler Type"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Handler), "Handler"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"},
@@ -269,15 +273,32 @@ static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[1]), "Next Device Notify"}
};
+static ACPI_EXDUMP_INFO AcpiExDumpExtra[6] =
+{
+ {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra), NULL},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.Method_REG), "_REG Method"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Extra.ScopeNode), "Scope Node"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.RegionContext), "Region Context"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.AmlStart), "Aml Start"},
+ {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Extra.AmlLength), "Aml Length"}
+};
+
+static ACPI_EXDUMP_INFO AcpiExDumpData[3] =
+{
+ {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpData), NULL},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Handler), "Handler"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Pointer), "Raw Data"}
+};
/* Miscellaneous tables */
-static ACPI_EXDUMP_INFO AcpiExDumpCommon[4] =
+static ACPI_EXDUMP_INFO AcpiExDumpCommon[5] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon), NULL},
{ACPI_EXD_TYPE , 0, NULL},
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Common.ReferenceCount), "Reference Count"},
- {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"}
+ {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"},
+ {ACPI_EXD_LIST, ACPI_EXD_OFFSET (Common.NextObject), "Object List"}
};
static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
@@ -288,16 +309,18 @@ static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BitLength), "Bit Length"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (CommonField.StartFieldBitOffset),"Field Bit Offset"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BaseByteOffset), "Base Byte Offset"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpNode[5] =
+static ACPI_EXDUMP_INFO AcpiExDumpNode[7] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (Flags), "Flags"},
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},
- {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Child), "Child List"},
- {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Peer), "Next Peer"}
+ {ACPI_EXD_LIST, ACPI_EXD_NSOFFSET (Object), "Object List"},
+ {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Parent), "Parent"},
+ {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Child), "Child"},
+ {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Peer), "Peer"}
};
@@ -332,7 +355,9 @@ static ACPI_EXDUMP_INFO *AcpiExDumpInfo[] =
AcpiExDumpAddressHandler,
NULL,
NULL,
- NULL
+ NULL,
+ AcpiExDumpExtra,
+ AcpiExDumpData
};
@@ -359,6 +384,10 @@ AcpiExDumpObject (
char *Name;
const char *ReferenceName;
UINT8 Count;
+ ACPI_OPERAND_OBJECT *Start;
+ ACPI_OPERAND_OBJECT *Data = NULL;
+ ACPI_OPERAND_OBJECT *Next;
+ ACPI_NAMESPACE_NODE *Node;
if (!Info)
@@ -386,7 +415,8 @@ AcpiExDumpObject (
case ACPI_EXD_TYPE:
- AcpiExOutString ("Type", AcpiUtGetObjectTypeName (ObjDesc));
+ AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
+ ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc));
break;
case ACPI_EXD_UINT8:
@@ -447,6 +477,120 @@ AcpiExDumpObject (
AcpiExDumpReferenceObj (ObjDesc);
break;
+ case ACPI_EXD_LIST:
+
+ Start = *ACPI_CAST_PTR (void *, Target);
+ Next = Start;
+
+ AcpiOsPrintf ("%20s : %p", Name, Next);
+ if (Next)
+ {
+ AcpiOsPrintf ("(%s %2.2X)",
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ while (Next->Common.NextObject)
+ {
+ if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
+ !Data)
+ {
+ Data = Next;
+ }
+
+ Next = Next->Common.NextObject;
+ AcpiOsPrintf ("->%p(%s %2.2X)", Next,
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ if ((Next == Start) || (Next == Data))
+ {
+ AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
+ break;
+ }
+ }
+ }
+
+ AcpiOsPrintf ("\n");
+ break;
+
+ case ACPI_EXD_HDLR_LIST:
+
+ Start = *ACPI_CAST_PTR (void *, Target);
+ Next = Start;
+
+ AcpiOsPrintf ("%20s : %p", Name, Next);
+ if (Next)
+ {
+ AcpiOsPrintf ("(%s %2.2X)",
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ while (Next->AddressSpace.Next)
+ {
+ if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
+ !Data)
+ {
+ Data = Next;
+ }
+
+ Next = Next->AddressSpace.Next;
+ AcpiOsPrintf ("->%p(%s %2.2X)", Next,
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ if ((Next == Start) || (Next == Data))
+ {
+ AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
+ break;
+ }
+ }
+ }
+
+ AcpiOsPrintf ("\n");
+ break;
+
+ case ACPI_EXD_RGN_LIST:
+
+ Start = *ACPI_CAST_PTR (void *, Target);
+ Next = Start;
+
+ AcpiOsPrintf ("%20s : %p", Name, Next);
+ if (Next)
+ {
+ AcpiOsPrintf ("(%s %2.2X)",
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ while (Next->Region.Next)
+ {
+ if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
+ !Data)
+ {
+ Data = Next;
+ }
+
+ Next = Next->Region.Next;
+ AcpiOsPrintf ("->%p(%s %2.2X)", Next,
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ if ((Next == Start) || (Next == Data))
+ {
+ AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
+ break;
+ }
+ }
+ }
+
+ AcpiOsPrintf ("\n");
+ break;
+
+ case ACPI_EXD_NODE:
+
+ Node = *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE *, Target);
+
+ AcpiOsPrintf ("%20s : %p", Name, Node);
+ if (Node)
+ {
+ AcpiOsPrintf (" [%4.4s]", Node->Name.Ascii);
+ }
+ AcpiOsPrintf ("\n");
+ break;
+
default:
AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
@@ -864,9 +1008,8 @@ AcpiExDumpNamespaceNode (
}
AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));
- AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type));
- AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node));
- AcpiExOutPointer ("Parent", Node->Parent);
+ AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
+ Node->Type, AcpiUtGetTypeName (Node->Type));
AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node),
AcpiExDumpNode);
@@ -1074,24 +1217,30 @@ AcpiExDumpObjectDescriptor (
AcpiOsPrintf ("\nAttached Object (%p):\n",
((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
- AcpiExDumpObjectDescriptor (
- ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags);
- return_VOID;
+ ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;
+ goto DumpObject;
}
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
{
AcpiOsPrintf (
- "ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n",
+ "%p is not an ACPI operand object: [%s]\n",
ObjDesc, AcpiUtGetDescriptorName (ObjDesc));
return_VOID;
}
- if (ObjDesc->Common.Type > ACPI_TYPE_NS_NODE_MAX)
+ /* Validate the object type */
+
+ if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
{
+ AcpiOsPrintf ("Not a known object type: %2.2X\n",
+ ObjDesc->Common.Type);
return_VOID;
}
+
+DumpObject:
+
/* Common Fields */
AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
@@ -1099,6 +1248,22 @@ AcpiExDumpObjectDescriptor (
/* Object-specific fields */
AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
+
+ if (ObjDesc->Common.Type == ACPI_TYPE_REGION)
+ {
+ ObjDesc = ObjDesc->Common.NextObject;
+ if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
+ {
+ AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
+ ObjDesc->Common.Type);
+
+ return_VOID;
+ }
+
+ AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc);
+ AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
+ }
+
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/components/executer/exfield.c b/sys/contrib/dev/acpica/components/executer/exfield.c
index 9cab258..2b61790 100644
--- a/sys/contrib/dev/acpica/components/executer/exfield.c
+++ b/sys/contrib/dev/acpica/components/executer/exfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,18 +41,86 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EXFIELD_C__
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/amlcode.h>
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME ("exfield")
+/* Local prototypes */
+
+static UINT32
+AcpiExGetSerialAccessLength (
+ UINT32 AccessorType,
+ UINT32 AccessLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExGetSerialAccessLength
+ *
+ * PARAMETERS: AccessorType - The type of the protocol indicated by region
+ * field access attributes
+ * AccessLength - The access length of the region field
+ *
+ * RETURN: Decoded access length
+ *
+ * DESCRIPTION: This routine returns the length of the GenericSerialBus
+ * protocol bytes
+ *
+ ******************************************************************************/
+
+static UINT32
+AcpiExGetSerialAccessLength (
+ UINT32 AccessorType,
+ UINT32 AccessLength)
+{
+ UINT32 Length;
+
+
+ switch (AccessorType)
+ {
+ case AML_FIELD_ATTRIB_QUICK:
+
+ Length = 0;
+ break;
+
+ case AML_FIELD_ATTRIB_SEND_RCV:
+ case AML_FIELD_ATTRIB_BYTE:
+
+ Length = 1;
+ break;
+
+ case AML_FIELD_ATTRIB_WORD:
+ case AML_FIELD_ATTRIB_WORD_CALL:
+
+ Length = 2;
+ break;
+
+ case AML_FIELD_ATTRIB_MULTIBYTE:
+ case AML_FIELD_ATTRIB_RAW_BYTES:
+ case AML_FIELD_ATTRIB_RAW_PROCESS:
+
+ Length = AccessLength;
+ break;
+
+ case AML_FIELD_ATTRIB_BLOCK:
+ case AML_FIELD_ATTRIB_BLOCK_CALL:
+ default:
+
+ Length = ACPI_GSBUS_BUFFER_SIZE - 2;
+ break;
+ }
+
+ return (Length);
+}
+
/*******************************************************************************
*
@@ -80,6 +148,7 @@ AcpiExReadDataFromField (
ACPI_SIZE Length;
void *Buffer;
UINT32 Function;
+ UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
@@ -129,8 +198,19 @@ AcpiExReadDataFromField (
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
{
- Length = ACPI_GSBUS_BUFFER_SIZE;
- Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
+ AccessorType = ObjDesc->Field.Attribute;
+ Length = AcpiExGetSerialAccessLength (AccessorType,
+ ObjDesc->Field.AccessLength);
+
+ /*
+ * Add additional 2 bytes for the GenericSerialBus data buffer:
+ *
+ * Status; (Byte 0 of the data buffer)
+ * Length; (Byte 1 of the data buffer)
+ * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
+ */
+ Length += 2;
+ Function = ACPI_READ | (AccessorType << 16);
}
else /* IPMI */
{
@@ -193,6 +273,39 @@ AcpiExReadDataFromField (
Buffer = &BufferDesc->Integer.Value;
}
+ if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+ (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
+ {
+ /*
+ * For GPIO (GeneralPurposeIo), the Address will be the bit offset
+ * from the previous Connection() operator, making it effectively a
+ * pin number index. The BitLength is the length of the field, which
+ * is thus the number of pins.
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+ "GPIO FieldRead [FROM]: Pin %u Bits %u\n",
+ ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
+
+ /* Lock entire transaction if requested */
+
+ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
+
+ /* Perform the write */
+
+ Status = AcpiExAccessRegion (ObjDesc, 0,
+ (UINT64 *) Buffer, ACPI_READ);
+ AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiUtRemoveReference (BufferDesc);
+ }
+ else
+ {
+ *RetBufferDesc = BufferDesc;
+ }
+ return_ACPI_STATUS (Status);
+ }
+
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n",
ObjDesc, ObjDesc->Common.Type, Buffer, (UINT32) Length));
@@ -251,6 +364,7 @@ AcpiExWriteDataToField (
void *Buffer;
ACPI_OPERAND_OBJECT *BufferDesc;
UINT32 Function;
+ UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
@@ -310,8 +424,19 @@ AcpiExWriteDataToField (
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
{
- Length = ACPI_GSBUS_BUFFER_SIZE;
- Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
+ AccessorType = ObjDesc->Field.Attribute;
+ Length = AcpiExGetSerialAccessLength (AccessorType,
+ ObjDesc->Field.AccessLength);
+
+ /*
+ * Add additional 2 bytes for the GenericSerialBus data buffer:
+ *
+ * Status; (Byte 0 of the data buffer)
+ * Length; (Byte 1 of the data buffer)
+ * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
+ */
+ Length += 2;
+ Function = ACPI_WRITE | (AccessorType << 16);
}
else /* IPMI */
{
@@ -354,6 +479,41 @@ AcpiExWriteDataToField (
*ResultDesc = BufferDesc;
return_ACPI_STATUS (Status);
}
+ else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+ (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
+ {
+ /*
+ * For GPIO (GeneralPurposeIo), we will bypass the entire field
+ * mechanism and handoff the bit address and bit width directly to
+ * the handler. The Address will be the bit offset
+ * from the previous Connection() operator, making it effectively a
+ * pin number index. The BitLength is the length of the field, which
+ * is thus the number of pins.
+ */
+ if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
+ {
+ return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+ "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
+ AcpiUtGetTypeName (SourceDesc->Common.Type),
+ SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
+ ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
+
+ Buffer = &SourceDesc->Integer.Value;
+
+ /* Lock entire transaction if requested */
+
+ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
+
+ /* Perform the write */
+
+ Status = AcpiExAccessRegion (ObjDesc, 0,
+ (UINT64 *) Buffer, ACPI_WRITE);
+ AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
+ return_ACPI_STATUS (Status);
+ }
/* Get a pointer to the data to be written */
diff --git a/sys/contrib/dev/acpica/components/executer/exfldio.c b/sys/contrib/dev/acpica/components/executer/exfldio.c
index c355b74..5586cad 100644
--- a/sys/contrib/dev/acpica/components/executer/exfldio.c
+++ b/sys/contrib/dev/acpica/components/executer/exfldio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EXFLDIO_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exmisc.c b/sys/contrib/dev/acpica/components/executer/exmisc.c
index 2abbe29..b9b331d 100644
--- a/sys/contrib/dev/acpica/components/executer/exmisc.c
+++ b/sys/contrib/dev/acpica/components/executer/exmisc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exmutex.c b/sys/contrib/dev/acpica/components/executer/exmutex.c
index a6e5e14..c14d3c0 100644
--- a/sys/contrib/dev/acpica/components/executer/exmutex.c
+++ b/sys/contrib/dev/acpica/components/executer/exmutex.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exnames.c b/sys/contrib/dev/acpica/components/executer/exnames.c
index 9c11e7f..af5aa7e 100644
--- a/sys/contrib/dev/acpica/components/executer/exnames.c
+++ b/sys/contrib/dev/acpica/components/executer/exnames.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg1.c b/sys/contrib/dev/acpica/components/executer/exoparg1.c
index cd917ef..849c442 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg1.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg1.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg2.c b/sys/contrib/dev/acpica/components/executer/exoparg2.c
index 6f98753..b110355 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg2.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EXOPARG2_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg3.c b/sys/contrib/dev/acpica/components/executer/exoparg3.c
index b9c1c1a..79deb87 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg3.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg3.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg6.c b/sys/contrib/dev/acpica/components/executer/exoparg6.c
index ae675d3..3191f66 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg6.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg6.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exprep.c b/sys/contrib/dev/acpica/components/executer/exprep.c
index 33c2049..bc270b8 100644
--- a/sys/contrib/dev/acpica/components/executer/exprep.c
+++ b/sys/contrib/dev/acpica/components/executer/exprep.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -515,6 +515,8 @@ AcpiExPrepFieldValue (
ObjDesc->Field.ResourceLength = Info->ResourceLength;
}
+ ObjDesc->Field.PinNumberIndex = Info->PinNumberIndex;
+
/* Allow full data read from EC address space */
if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
diff --git a/sys/contrib/dev/acpica/components/executer/exregion.c b/sys/contrib/dev/acpica/components/executer/exregion.c
index 753cba6..0b5c6fc 100644
--- a/sys/contrib/dev/acpica/components/executer/exregion.c
+++ b/sys/contrib/dev/acpica/components/executer/exregion.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __EXREGION_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exresnte.c b/sys/contrib/dev/acpica/components/executer/exresnte.c
index 267801c..2aeac6c 100644
--- a/sys/contrib/dev/acpica/components/executer/exresnte.c
+++ b/sys/contrib/dev/acpica/components/executer/exresnte.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -134,8 +134,8 @@ AcpiExResolveNodeToValue (
if (!SourceDesc)
{
- ACPI_ERROR ((AE_INFO, "No object attached to node %p",
- Node));
+ ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p",
+ Node->Name.Ascii, Node));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
diff --git a/sys/contrib/dev/acpica/components/executer/exresolv.c b/sys/contrib/dev/acpica/components/executer/exresolv.c
index 837ba87..b2aa570 100644
--- a/sys/contrib/dev/acpica/components/executer/exresolv.c
+++ b/sys/contrib/dev/acpica/components/executer/exresolv.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exresop.c b/sys/contrib/dev/acpica/components/executer/exresop.c
index 24df299..e861c26 100644
--- a/sys/contrib/dev/acpica/components/executer/exresop.c
+++ b/sys/contrib/dev/acpica/components/executer/exresop.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exstore.c b/sys/contrib/dev/acpica/components/executer/exstore.c
index 894af0b..fe0cde8 100644
--- a/sys/contrib/dev/acpica/components/executer/exstore.c
+++ b/sys/contrib/dev/acpica/components/executer/exstore.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,6 +62,12 @@ AcpiExStoreObjectToIndex (
ACPI_OPERAND_OBJECT *DestDesc,
ACPI_WALK_STATE *WalkState);
+static ACPI_STATUS
+AcpiExStoreDirectToNode (
+ ACPI_OPERAND_OBJECT *SourceDesc,
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_WALK_STATE *WalkState);
+
/*******************************************************************************
*
@@ -393,7 +399,11 @@ AcpiExStoreObjectToIndex (
* When storing into an object the data is converted to the
* target object type then stored in the object. This means
* that the target object type (for an initialized target) will
- * not be changed by a store operation.
+ * not be changed by a store operation. A CopyObject can change
+ * the target type, however.
+ *
+ * The ImplicitConversion flag is set to NO/FALSE only when
+ * storing to an ArgX -- as per the rules of the ACPI spec.
*
* Assumes parameters are already validated.
*
@@ -420,7 +430,7 @@ AcpiExStoreObjectToNode (
TargetType = AcpiNsGetType (Node);
TargetDesc = AcpiNsGetAttachedObject (Node);
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n",
SourceDesc, AcpiUtGetObjectTypeName (SourceDesc),
Node, AcpiUtGetTypeName (TargetType)));
@@ -434,49 +444,35 @@ AcpiExStoreObjectToNode (
return_ACPI_STATUS (Status);
}
- /* If no implicit conversion, drop into the default case below */
-
- if ((!ImplicitConversion) ||
- ((WalkState->Opcode == AML_COPY_OP) &&
- (TargetType != ACPI_TYPE_LOCAL_REGION_FIELD) &&
- (TargetType != ACPI_TYPE_LOCAL_BANK_FIELD) &&
- (TargetType != ACPI_TYPE_LOCAL_INDEX_FIELD)))
- {
- /*
- * Force execution of default (no implicit conversion). Note:
- * CopyObject does not perform an implicit conversion, as per the ACPI
- * spec -- except in case of region/bank/index fields -- because these
- * objects must retain their original type permanently.
- */
- TargetType = ACPI_TYPE_ANY;
- }
-
/* Do the actual store operation */
switch (TargetType)
{
- case ACPI_TYPE_BUFFER_FIELD:
- case ACPI_TYPE_LOCAL_REGION_FIELD:
- case ACPI_TYPE_LOCAL_BANK_FIELD:
- case ACPI_TYPE_LOCAL_INDEX_FIELD:
-
- /* For fields, copy the source data to the target field. */
-
- Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
- &WalkState->ResultObj);
- break;
-
case ACPI_TYPE_INTEGER:
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
/*
- * These target types are all of type Integer/String/Buffer, and
- * therefore support implicit conversion before the store.
- *
- * Copy and/or convert the source object to a new target object
+ * The simple data types all support implicit source operand
+ * conversion before the store.
*/
+
+ if ((WalkState->Opcode == AML_COPY_OP) ||
+ !ImplicitConversion)
+ {
+ /*
+ * However, CopyObject and Stores to ArgX do not perform
+ * an implicit conversion, as per the ACPI specification.
+ * A direct store is performed instead.
+ */
+ Status = AcpiExStoreDirectToNode (SourceDesc, Node,
+ WalkState);
+ break;
+ }
+
+ /* Store with implicit source operand conversion support */
+
Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc,
- &NewDesc, WalkState);
+ &NewDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -489,11 +485,12 @@ AcpiExStoreObjectToNode (
* the Name's type to that of the value being stored in it.
* SourceDesc reference count is incremented by AttachObject.
*
- * Note: This may change the type of the node if an explicit store
- * has been performed such that the node/object type has been
- * changed.
+ * Note: This may change the type of the node if an explicit
+ * store has been performed such that the node/object type
+ * has been changed.
*/
- Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
+ Status = AcpiNsAttachObject (Node, NewDesc,
+ NewDesc->Common.Type);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Store %s into %s via Convert/Attach\n",
@@ -502,33 +499,86 @@ AcpiExStoreObjectToNode (
}
break;
- default:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Storing [%s] (%p) directly into node [%s] (%p)"
- " with no implicit conversion\n",
- AcpiUtGetObjectTypeName (SourceDesc), SourceDesc,
- AcpiUtGetObjectTypeName (TargetDesc), Node));
+ case ACPI_TYPE_BUFFER_FIELD:
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+ case ACPI_TYPE_LOCAL_BANK_FIELD:
+ case ACPI_TYPE_LOCAL_INDEX_FIELD:
+ /*
+ * For all fields, always write the source data to the target
+ * field. Any required implicit source operand conversion is
+ * performed in the function below as necessary. Note, field
+ * objects must retain their original type permanently.
+ */
+ Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
+ &WalkState->ResultObj);
+ break;
+ default:
/*
* No conversions for all other types. Directly store a copy of
- * the source object. NOTE: This is a departure from the ACPI
- * spec, which states "If conversion is impossible, abort the
- * running control method".
+ * the source object. This is the ACPI spec-defined behavior for
+ * the CopyObject operator.
*
- * This code implements "If conversion is impossible, treat the
- * Store operation as a CopyObject".
+ * NOTE: For the Store operator, this is a departure from the
+ * ACPI spec, which states "If conversion is impossible, abort
+ * the running control method". Instead, this code implements
+ * "If conversion is impossible, treat the Store operation as
+ * a CopyObject".
*/
- Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
- AcpiUtRemoveReference (NewDesc);
+ Status = AcpiExStoreDirectToNode (SourceDesc, Node,
+ WalkState);
break;
}
return_ACPI_STATUS (Status);
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExStoreDirectToNode
+ *
+ * PARAMETERS: SourceDesc - Value to be stored
+ * Node - Named object to receive the value
+ * WalkState - Current walk state
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: "Store" an object directly to a node. This involves a copy
+ * and an attach.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiExStoreDirectToNode (
+ ACPI_OPERAND_OBJECT *SourceDesc,
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_WALK_STATE *WalkState)
+{
+ ACPI_STATUS Status;
+ ACPI_OPERAND_OBJECT *NewDesc;
+
+
+ ACPI_FUNCTION_TRACE (ExStoreDirectToNode);
+
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Storing [%s] (%p) directly into node [%s] (%p)"
+ " with no implicit conversion\n",
+ AcpiUtGetObjectTypeName (SourceDesc), SourceDesc,
+ AcpiUtGetTypeName (Node->Type), Node));
+
+ /* Copy the source object to a new object */
+
+ Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Attach the new object to the node */
+
+ Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
+ AcpiUtRemoveReference (NewDesc);
+ return_ACPI_STATUS (Status);
+}
diff --git a/sys/contrib/dev/acpica/components/executer/exstoren.c b/sys/contrib/dev/acpica/components/executer/exstoren.c
index c0302c1..803b2b6 100644
--- a/sys/contrib/dev/acpica/components/executer/exstoren.c
+++ b/sys/contrib/dev/acpica/components/executer/exstoren.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exstorob.c b/sys/contrib/dev/acpica/components/executer/exstorob.c
index c68263c..560a634 100644
--- a/sys/contrib/dev/acpica/components/executer/exstorob.c
+++ b/sys/contrib/dev/acpica/components/executer/exstorob.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exsystem.c b/sys/contrib/dev/acpica/components/executer/exsystem.c
index cc18d80..790813c 100644
--- a/sys/contrib/dev/acpica/components/executer/exsystem.c
+++ b/sys/contrib/dev/acpica/components/executer/exsystem.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -87,7 +87,7 @@ AcpiExSystemWaitSemaphore (
{
/* We must wait, so unlock the interpreter */
- AcpiExRelinquishInterpreter ();
+ AcpiExExitInterpreter ();
Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);
@@ -97,7 +97,7 @@ AcpiExSystemWaitSemaphore (
/* Reacquire the interpreter */
- AcpiExReacquireInterpreter ();
+ AcpiExEnterInterpreter ();
}
return_ACPI_STATUS (Status);
@@ -140,7 +140,7 @@ AcpiExSystemWaitMutex (
{
/* We must wait, so unlock the interpreter */
- AcpiExRelinquishInterpreter ();
+ AcpiExExitInterpreter ();
Status = AcpiOsAcquireMutex (Mutex, Timeout);
@@ -150,7 +150,7 @@ AcpiExSystemWaitMutex (
/* Reacquire the interpreter */
- AcpiExReacquireInterpreter ();
+ AcpiExEnterInterpreter ();
}
return_ACPI_STATUS (Status);
@@ -227,7 +227,7 @@ AcpiExSystemDoSleep (
/* Since this thread will sleep, we must release the interpreter */
- AcpiExRelinquishInterpreter ();
+ AcpiExExitInterpreter ();
/*
* For compatibility with other ACPI implementations and to prevent
@@ -242,7 +242,7 @@ AcpiExSystemDoSleep (
/* And now we must get the interpreter again */
- AcpiExReacquireInterpreter ();
+ AcpiExEnterInterpreter ();
return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/executer/exutils.c b/sys/contrib/dev/acpica/components/executer/exutils.c
index 29abfd1..1958c19 100644
--- a/sys/contrib/dev/acpica/components/executer/exutils.c
+++ b/sys/contrib/dev/acpica/components/executer/exutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -112,42 +112,6 @@ AcpiExEnterInterpreter (
/*******************************************************************************
*
- * FUNCTION: AcpiExReacquireInterpreter
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Reacquire the interpreter execution region from within the
- * interpreter code. Failure to enter the interpreter region is a
- * fatal system error. Used in conjunction with
- * RelinquishInterpreter
- *
- ******************************************************************************/
-
-void
-AcpiExReacquireInterpreter (
- void)
-{
- ACPI_FUNCTION_TRACE (ExReacquireInterpreter);
-
-
- /*
- * If the global serialized flag is set, do not release the interpreter,
- * since it was not actually released by AcpiExRelinquishInterpreter.
- * This forces the interpreter to be single threaded.
- */
- if (!AcpiGbl_AllMethodsSerialized)
- {
- AcpiExEnterInterpreter ();
- }
-
- return_VOID;
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiExExitInterpreter
*
* PARAMETERS: None
@@ -156,7 +120,16 @@ AcpiExReacquireInterpreter (
*
* DESCRIPTION: Exit the interpreter execution region. This is the top level
* routine used to exit the interpreter when all processing has
- * been completed.
+ * been completed, or when the method blocks.
+ *
+ * Cases where the interpreter is unlocked internally:
+ * 1) Method will be blocked on a Sleep() AML opcode
+ * 2) Method will be blocked on an Acquire() AML opcode
+ * 3) Method will be blocked on a Wait() AML opcode
+ * 4) Method will be blocked to acquire the global lock
+ * 5) Method will be blocked waiting to execute a serialized control
+ * method that is currently executing
+ * 6) About to invoke a user-installed opregion handler
*
******************************************************************************/
@@ -182,49 +155,6 @@ AcpiExExitInterpreter (
/*******************************************************************************
*
- * FUNCTION: AcpiExRelinquishInterpreter
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Exit the interpreter execution region, from within the
- * interpreter - before attempting an operation that will possibly
- * block the running thread.
- *
- * Cases where the interpreter is unlocked internally
- * 1) Method to be blocked on a Sleep() AML opcode
- * 2) Method to be blocked on an Acquire() AML opcode
- * 3) Method to be blocked on a Wait() AML opcode
- * 4) Method to be blocked to acquire the global lock
- * 5) Method to be blocked waiting to execute a serialized control method
- * that is currently executing
- * 6) About to invoke a user-installed opregion handler
- *
- ******************************************************************************/
-
-void
-AcpiExRelinquishInterpreter (
- void)
-{
- ACPI_FUNCTION_TRACE (ExRelinquishInterpreter);
-
-
- /*
- * If the global serialized flag is set, do not release the interpreter.
- * This forces the interpreter to be single threaded.
- */
- if (!AcpiGbl_AllMethodsSerialized)
- {
- AcpiExExitInterpreter ();
- }
-
- return_VOID;
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiExTruncateFor32bitTable
*
* PARAMETERS: ObjDesc - Object to be truncated
diff --git a/sys/contrib/dev/acpica/components/hardware/hwacpi.c b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
index 3cd3a44..9476795 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwacpi.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwesleep.c b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
index 6717801..d125bcc 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwesleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwgpe.c b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
index 99c0de6..e00aeb2 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwgpe.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -241,6 +241,14 @@ AcpiHwGetGpeStatus (
return (AE_BAD_PARAMETER);
}
+ /* GPE currently handled? */
+
+ if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
+ ACPI_GPE_DISPATCH_NONE)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+ }
+
/* Get the info block for the entire GPE register */
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
diff --git a/sys/contrib/dev/acpica/components/hardware/hwpci.c b/sys/contrib/dev/acpica/components/hardware/hwpci.c
index a89a3dd..d14bf75 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwpci.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwpci.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -161,11 +161,12 @@ AcpiHwDerivePciId (
/* Walk the list, updating the PCI device/function/bus numbers */
Status = AcpiHwProcessPciList (PciId, ListHead);
- }
- /* Always delete the list */
+ /* Delete the list */
+
+ AcpiHwDeletePciList (ListHead);
+ }
- AcpiHwDeletePciList (ListHead);
return_ACPI_STATUS (Status);
}
@@ -213,6 +214,9 @@ AcpiHwBuildPciList (
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
if (ACPI_FAILURE (Status))
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (Status);
}
@@ -227,6 +231,9 @@ AcpiHwBuildPciList (
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
if (!ListElement)
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (AE_NO_MEMORY);
}
diff --git a/sys/contrib/dev/acpica/components/hardware/hwregs.c b/sys/contrib/dev/acpica/components/hardware/hwregs.c
index 9c3f2a9..155cb49 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwregs.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwregs.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -310,17 +310,19 @@ AcpiHwClearAcpiStatus (
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
ACPI_BITMASK_ALL_FIXED_STATUS);
+
+ AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+
if (ACPI_FAILURE (Status))
{
- goto UnlockAndExit;
+ goto Exit;
}
/* Clear the GPE Bits in all GPE registers in all GPE blocks */
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
-UnlockAndExit:
- AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+Exit:
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/hardware/hwsleep.c b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
index 0e6691a..d4b346b 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -72,7 +72,6 @@ AcpiHwLegacySleep (
UINT32 Pm1aControl;
UINT32 Pm1bControl;
UINT32 InValue;
- UINT32 Retry;
ACPI_STATUS Status;
@@ -192,7 +191,6 @@ AcpiHwLegacySleep (
/* Wait for transition back to Working State */
- Retry = 1000;
do
{
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
@@ -201,18 +199,6 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
- if (AcpiGbl_EnableInterpreterSlack)
- {
- /*
- * Some BIOSs don't set WAK_STS at all. Give up waiting after
- * 1000 retries if it still isn't set.
- */
- if (Retry-- == 0)
- {
- break;
- }
- }
-
} while (!InValue);
return_ACPI_STATUS (AE_OK);
diff --git a/sys/contrib/dev/acpica/components/hardware/hwtimer.c b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
index e103014..643cc67 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwtimer.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/hardware/hwvalid.c b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
index 85a87d1..c8046cd 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwvalid.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxface.c b/sys/contrib/dev/acpica/components/hardware/hwxface.c
index 8e0e5be..0ec2f5c 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxface.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -90,9 +92,15 @@ AcpiReset (
* For I/O space, write directly to the OSL. This bypasses the port
* validation mechanism, which may block a valid write to the reset
* register.
+ *
+ * NOTE:
+ * The ACPI spec requires the reset register width to be 8, so we
+ * hardcode it here and ignore the FADT value. This maintains
+ * compatibility with other ACPI implementations that have allowed
+ * BIOS code with bad register width values to go unnoticed.
*/
Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) ResetReg->Address,
- AcpiGbl_FADT.ResetValue, ResetReg->BitWidth);
+ AcpiGbl_FADT.ResetValue, ACPI_RESET_REGISTER_WIDTH);
}
else
{
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
index 8c3ec41..dfc712b 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsaccess.c b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
index 523e092..d6f1800 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsaccess.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsalloc.c b/sys/contrib/dev/acpica/components/namespace/nsalloc.c
index ecec172..a107f77 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsalloc.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsalloc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __NSALLOC_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -121,6 +120,7 @@ AcpiNsDeleteNode (
ACPI_NAMESPACE_NODE *Node)
{
ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *NextDesc;
ACPI_FUNCTION_NAME (NsDeleteNode);
@@ -131,12 +131,13 @@ AcpiNsDeleteNode (
AcpiNsDetachObject (Node);
/*
- * Delete an attached data object if present (an object that was created
- * and attached via AcpiAttachData). Note: After any normal object is
- * detached above, the only possible remaining object is a data object.
+ * Delete an attached data object list if present (objects that were
+ * attached via AcpiAttachData). Note: After any normal object is
+ * detached above, the only possible remaining object(s) are data
+ * objects, in a linked list.
*/
ObjDesc = Node->Object;
- if (ObjDesc &&
+ while (ObjDesc &&
(ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA))
{
/* Invoke the attached data deletion handler if present */
@@ -146,7 +147,16 @@ AcpiNsDeleteNode (
ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer);
}
+ NextDesc = ObjDesc->Common.NextObject;
AcpiUtRemoveReference (ObjDesc);
+ ObjDesc = NextDesc;
+ }
+
+ /* Special case for the statically allocated root node */
+
+ if (Node == AcpiGbl_RootNode)
+ {
+ return;
}
/* Now we can delete the node */
diff --git a/sys/contrib/dev/acpica/components/namespace/nsarguments.c b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
index 52ab8a9..98e831d 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsarguments.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsconvert.c b/sys/contrib/dev/acpica/components/namespace/nsconvert.c
index 4b12d3d..2b39776 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsconvert.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsconvert.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsdump.c b/sys/contrib/dev/acpica/components/namespace/nsdump.c
index 0ec5642..ff1f10f 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsdump.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -748,6 +748,13 @@ AcpiNsDumpOneObjectPath (
}
Node = AcpiNsValidateHandle (ObjHandle);
+ if (!Node)
+ {
+ /* Ignore bad node during namespace walk */
+
+ return (AE_OK);
+ }
+
Pathname = AcpiNsGetExternalPathname (Node);
PathIndent = 1;
diff --git a/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c b/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
index 868b104..a130a03 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nseval.c b/sys/contrib/dev/acpica/components/namespace/nseval.c
index 57098f4..fa4465b 100644
--- a/sys/contrib/dev/acpica/components/namespace/nseval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nseval.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsinit.c b/sys/contrib/dev/acpica/components/namespace/nsinit.c
index cd50447..f40ff58 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsinit.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __NSXFINIT_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -129,9 +128,8 @@ AcpiNsInitializeObjects (
Info.PackageInit, Info.PackageCount, Info.ObjectCount));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%u Control Methods found\n", Info.MethodCount));
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%u Op Regions found\n", Info.OpRegionCount));
+ "%u Control Methods found\n%u Op Regions found\n",
+ Info.MethodCount, Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nsload.c b/sys/contrib/dev/acpica/components/namespace/nsload.c
index d29a891..71c3cfc 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsload.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -148,12 +148,12 @@ Unlock:
* parse trees.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "**** Begin Table Method Parsing and Object Initialization\n"));
+ "**** Begin Table Object Initialization\n"));
Status = AcpiDsInitializeObjects (TableIndex, Node);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "**** Completed Table Method Parsing and Object Initialization\n"));
+ "**** Completed Table Object Initialization\n"));
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nsnames.c b/sys/contrib/dev/acpica/components/namespace/nsnames.c
index cd4d440..2b1057d 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsnames.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsobject.c b/sys/contrib/dev/acpica/components/namespace/nsobject.c
index b1d1f01..24d5467 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsobject.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsobject.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __NSOBJECT_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -247,17 +246,32 @@ AcpiNsDetachObject (
}
}
- /* Clear the entry in all cases */
+ /* Clear the Node entry in all cases */
Node->Object = NULL;
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND)
{
+ /* Unlink object from front of possible object list */
+
Node->Object = ObjDesc->Common.NextObject;
+
+ /* Handle possible 2-descriptor object */
+
if (Node->Object &&
- ((Node->Object)->Common.Type != ACPI_TYPE_LOCAL_DATA))
+ (Node->Object->Common.Type != ACPI_TYPE_LOCAL_DATA))
{
Node->Object = Node->Object->Common.NextObject;
}
+
+ /*
+ * Detach the object from any data objects (which are still held by
+ * the namespace node)
+ */
+ if (ObjDesc->Common.NextObject &&
+ ((ObjDesc->Common.NextObject)->Common.Type == ACPI_TYPE_LOCAL_DATA))
+ {
+ ObjDesc->Common.NextObject = NULL;
+ }
}
/* Reset the node type to untyped */
diff --git a/sys/contrib/dev/acpica/components/namespace/nsparse.c b/sys/contrib/dev/acpica/components/namespace/nsparse.c
index f327f26..8e6bd0a 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsparse.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nspredef.c b/sys/contrib/dev/acpica/components/namespace/nspredef.c
index 74ed8f7..6670870 100644
--- a/sys/contrib/dev/acpica/components/namespace/nspredef.c
+++ b/sys/contrib/dev/acpica/components/namespace/nspredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
index cccd2c1..62c3847 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -144,13 +144,13 @@ AcpiNsCheckPackage (
* Decode the type of the expected package contents
*
* PTYPE1 packages contain no subpackages
- * PTYPE2 packages contain sub-packages
+ * PTYPE2 packages contain subpackages
*/
switch (Package->RetInfo.Type)
{
case ACPI_PTYPE1_FIXED:
/*
- * The package count is fixed and there are no sub-packages
+ * The package count is fixed and there are no subpackages
*
* If package is too small, exit.
* If package is larger than expected, issue warning but continue
@@ -177,7 +177,7 @@ AcpiNsCheckPackage (
case ACPI_PTYPE1_VAR:
/*
- * The package count is variable, there are no sub-packages, and all
+ * The package count is variable, there are no subpackages, and all
* elements must be of the same type
*/
for (i = 0; i < Count; i++)
@@ -194,7 +194,7 @@ AcpiNsCheckPackage (
case ACPI_PTYPE1_OPTION:
/*
- * The package count is variable, there are no sub-packages. There are
+ * The package count is variable, there are no subpackages. There are
* a fixed number of required elements, and a variable number of
* optional elements.
*
@@ -250,14 +250,14 @@ AcpiNsCheckPackage (
Elements++;
Count--;
- /* Examine the sub-packages */
+ /* Examine the subpackages */
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
break;
case ACPI_PTYPE2_PKG_COUNT:
- /* First element is the (Integer) count of sub-packages to follow */
+ /* First element is the (Integer) count of subpackages to follow */
Status = AcpiNsCheckObjectType (Info, Elements,
ACPI_RTYPE_INTEGER, 0);
@@ -279,7 +279,7 @@ AcpiNsCheckPackage (
Count = ExpectedCount;
Elements++;
- /* Examine the sub-packages */
+ /* Examine the subpackages */
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
break;
@@ -291,9 +291,9 @@ AcpiNsCheckPackage (
case ACPI_PTYPE2_FIX_VAR:
/*
* These types all return a single Package that consists of a
- * variable number of sub-Packages.
+ * variable number of subpackages.
*
- * First, ensure that the first element is a sub-Package. If not,
+ * First, ensure that the first element is a subpackage. If not,
* the BIOS may have incorrectly returned the object as a single
* package instead of a Package of Packages (a common error if
* there is only one entry). We may be able to repair this by
@@ -316,11 +316,51 @@ AcpiNsCheckPackage (
Count = 1;
}
- /* Examine the sub-packages */
+ /* Examine the subpackages */
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
break;
+ case ACPI_PTYPE2_UUID_PAIR:
+
+ /* The package must contain pairs of (UUID + type) */
+
+ if (Count & 1)
+ {
+ ExpectedCount = Count + 1;
+ goto PackageTooSmall;
+ }
+
+ while (Count > 0)
+ {
+ Status = AcpiNsCheckObjectType(Info, Elements,
+ Package->RetInfo.ObjectType1, 0);
+ if (ACPI_FAILURE(Status))
+ {
+ return (Status);
+ }
+
+ /* Validate length of the UUID buffer */
+
+ if ((*Elements)->Buffer.Length != 16)
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+ Info->NodeFlags, "Invalid length for UUID Buffer"));
+ return (AE_AML_OPERAND_VALUE);
+ }
+
+ Status = AcpiNsCheckObjectType(Info, Elements + 1,
+ Package->RetInfo.ObjectType2, 0);
+ if (ACPI_FAILURE(Status))
+ {
+ return (Status);
+ }
+
+ Elements += 2;
+ Count -= 2;
+ }
+ break;
+
default:
/* Should not get here if predefined info table is correct */
@@ -379,9 +419,9 @@ AcpiNsCheckPackageList (
/*
- * Validate each sub-Package in the parent Package
+ * Validate each subpackage in the parent Package
*
- * NOTE: assumes list of sub-packages contains no NULL elements.
+ * NOTE: assumes list of subpackages contains no NULL elements.
* Any NULL elements should have been removed by earlier call
* to AcpiNsRemoveNullElements.
*/
@@ -400,7 +440,7 @@ AcpiNsCheckPackageList (
return (Status);
}
- /* Examine the different types of expected sub-packages */
+ /* Examine the different types of expected subpackages */
Info->ParentPackage = SubPackage;
switch (Package->RetInfo.Type)
@@ -452,7 +492,7 @@ AcpiNsCheckPackageList (
case ACPI_PTYPE2_FIXED:
- /* Each sub-package has a fixed length */
+ /* Each subpackage has a fixed length */
ExpectedCount = Package->RetInfo2.Count;
if (SubPackage->Package.Count < ExpectedCount)
@@ -460,7 +500,7 @@ AcpiNsCheckPackageList (
goto PackageTooSmall;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
for (j = 0; j < ExpectedCount; j++)
{
@@ -475,7 +515,7 @@ AcpiNsCheckPackageList (
case ACPI_PTYPE2_MIN:
- /* Each sub-package has a variable but minimum length */
+ /* Each subpackage has a variable but minimum length */
ExpectedCount = Package->RetInfo.Count1;
if (SubPackage->Package.Count < ExpectedCount)
@@ -483,7 +523,7 @@ AcpiNsCheckPackageList (
goto PackageTooSmall;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
Status = AcpiNsCheckPackageElements (Info, SubElements,
Package->RetInfo.ObjectType1,
@@ -532,7 +572,7 @@ AcpiNsCheckPackageList (
(*SubElements)->Integer.Value = ExpectedCount;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
Status = AcpiNsCheckPackageElements (Info, (SubElements + 1),
Package->RetInfo.ObjectType1,
@@ -556,10 +596,10 @@ AcpiNsCheckPackageList (
PackageTooSmall:
- /* The sub-package count was smaller than required */
+ /* The subpackage count was smaller than required */
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
- "Return Sub-Package[%u] is too small - found %u elements, expected %u",
+ "Return SubPackage[%u] is too small - found %u elements, expected %u",
i, SubPackage->Package.Count, ExpectedCount));
return (AE_AML_OPERAND_VALUE);
diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair.c b/sys/contrib/dev/acpica/components/namespace/nsrepair.c
index 879c95a..f26497c 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsrepair.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsrepair.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -212,14 +212,29 @@ AcpiNsSimpleRepair (
* this predefined name. Either one return value is expected, or none,
* for both methods and other objects.
*
- * Exit now if there is no return object. Warning if one was expected.
+ * Try to fix if there was no return object. Warning if failed to fix.
*/
if (!ReturnObject)
{
if (ExpectedBtypes && (!(ExpectedBtypes & ACPI_RTYPE_NONE)))
{
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
- ACPI_WARN_ALWAYS, "Missing expected return value"));
+ if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+ ACPI_WARN_ALWAYS, "Found unexpected NULL package element"));
+
+ Status = AcpiNsRepairNullElement (Info, ExpectedBtypes,
+ PackageIndex, ReturnObjectPtr);
+ if (ACPI_SUCCESS (Status))
+ {
+ return (AE_OK); /* Repair was successful */
+ }
+ }
+ else
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+ ACPI_WARN_ALWAYS, "Missing expected return value"));
+ }
return (AE_AML_NO_RETURN_VALUE);
}
@@ -474,7 +489,7 @@ AcpiNsRepairNullElement (
* RETURN: None.
*
* DESCRIPTION: Remove all NULL package elements from packages that contain
- * a variable number of sub-packages. For these types of
+ * a variable number of subpackages. For these types of
* packages, NULL elements can be safely removed.
*
*****************************************************************************/
@@ -498,7 +513,7 @@ AcpiNsRemoveNullElements (
/*
* We can safely remove all NULL elements from these package types:
* PTYPE1_VAR packages contain a variable number of simple data types.
- * PTYPE2 packages contain a variable number of sub-packages.
+ * PTYPE2 packages contain a variable number of subpackages.
*/
switch (PackageType)
{
diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
index 6bfd17a..664e281 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -478,8 +478,8 @@ AcpiNsRepair_CID (
* DESCRIPTION: Repair for the _CST object:
* 1. Sort the list ascending by C state type
* 2. Ensure type cannot be zero
- * 3. A sub-package count of zero means _CST is meaningless
- * 4. Count must match the number of C state sub-packages
+ * 3. A subpackage count of zero means _CST is meaningless
+ * 4. Count must match the number of C state subpackages
*
*****************************************************************************/
@@ -672,6 +672,7 @@ AcpiNsRepair_PRT (
ACPI_OPERAND_OBJECT **TopObjectList;
ACPI_OPERAND_OBJECT **SubObjectList;
ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *SubPackage;
UINT32 ElementCount;
UINT32 Index;
@@ -681,9 +682,19 @@ AcpiNsRepair_PRT (
TopObjectList = PackageObject->Package.Elements;
ElementCount = PackageObject->Package.Count;
- for (Index = 0; Index < ElementCount; Index++)
+ /* Examine each subpackage */
+
+ for (Index = 0; Index < ElementCount; Index++, TopObjectList++)
{
- SubObjectList = (*TopObjectList)->Package.Elements;
+ SubPackage = *TopObjectList;
+ SubObjectList = SubPackage->Package.Elements;
+
+ /* Check for minimum required element count */
+
+ if (SubPackage->Package.Count < 4)
+ {
+ continue;
+ }
/*
* If the BIOS has erroneously reversed the _PRT SourceName (index 2)
@@ -698,14 +709,11 @@ AcpiNsRepair_PRT (
SubObjectList[2] = ObjDesc;
Info->ReturnFlags |= ACPI_OBJECT_REPAIRED;
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ ACPI_WARN_PREDEFINED ((AE_INFO,
+ Info->FullPathname, Info->NodeFlags,
"PRT[%X]: Fixed reversed SourceName and SourceIndex",
Index));
}
-
- /* Point to the next ACPI_OPERAND_OBJECT in the top level package */
-
- TopObjectList++;
}
return (AE_OK);
@@ -745,7 +753,7 @@ AcpiNsRepair_PSS (
/*
- * Entries (sub-packages) in the _PSS Package must be sorted by power
+ * Entries (subpackages) in the _PSS Package must be sorted by power
* dissipation, in descending order. If it appears that the list is
* incorrectly sorted, sort it. We sort by CpuFrequency, since this
* should be proportional to the power.
@@ -838,9 +846,9 @@ AcpiNsRepair_TSS (
*
* PARAMETERS: Info - Method execution information block
* ReturnObject - Pointer to the top-level returned object
- * StartIndex - Index of the first sub-package
- * ExpectedCount - Minimum length of each sub-package
- * SortIndex - Sub-package entry to sort on
+ * StartIndex - Index of the first subpackage
+ * ExpectedCount - Minimum length of each subpackage
+ * SortIndex - Subpackage entry to sort on
* SortDirection - Ascending or descending
* SortKeyName - Name of the SortIndex field
*
@@ -881,7 +889,7 @@ AcpiNsCheckSortedList (
}
/*
- * NOTE: assumes list of sub-packages contains no NULL elements.
+ * NOTE: assumes list of subpackages contains no NULL elements.
* Any NULL elements should have been removed by earlier call
* to AcpiNsRemoveNullElements.
*/
@@ -911,7 +919,7 @@ AcpiNsCheckSortedList (
return (AE_AML_OPERAND_TYPE);
}
- /* Each sub-package must have the minimum length */
+ /* Each subpackage must have the minimum length */
if ((*OuterElements)->Package.Count < ExpectedCount)
{
diff --git a/sys/contrib/dev/acpica/components/namespace/nssearch.c b/sys/contrib/dev/acpica/components/namespace/nssearch.c
index 255956f..e46403c 100644
--- a/sys/contrib/dev/acpica/components/namespace/nssearch.c
+++ b/sys/contrib/dev/acpica/components/namespace/nssearch.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsutils.c b/sys/contrib/dev/acpica/components/namespace/nsutils.c
index fdde368..7cb91b8 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsutils.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsutils.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -693,27 +693,29 @@ void
AcpiNsTerminate (
void)
{
- ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (NsTerminate);
/*
- * 1) Free the entire namespace -- all nodes and objects
- *
- * Delete all object descriptors attached to namepsace nodes
+ * Free the entire namespace -- all nodes and all objects
+ * attached to the nodes
*/
AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
- /* Detach any objects attached to the root */
+ /* Delete any objects attached to the root node */
- ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
- if (ObjDesc)
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
{
- AcpiNsDetachObject (AcpiGbl_RootNode);
+ return_VOID;
}
+ AcpiNsDeleteNode (AcpiGbl_RootNode);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace freed\n"));
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nswalk.c b/sys/contrib/dev/acpica/components/namespace/nswalk.c
index bba76ce..ce5ac9e 100644
--- a/sys/contrib/dev/acpica/components/namespace/nswalk.c
+++ b/sys/contrib/dev/acpica/components/namespace/nswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __NSWALK_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
index 984ee64..85749d6 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __NSXFEVAL_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -91,7 +91,7 @@ AcpiEvaluateObjectTyped (
ACPI_OBJECT_TYPE ReturnType)
{
ACPI_STATUS Status;
- BOOLEAN MustFree = FALSE;
+ BOOLEAN FreeBufferOnError = FALSE;
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@@ -106,12 +106,13 @@ AcpiEvaluateObjectTyped (
if (ReturnBuffer->Length == ACPI_ALLOCATE_BUFFER)
{
- MustFree = TRUE;
+ FreeBufferOnError = TRUE;
}
/* Evaluate the object */
- Status = AcpiEvaluateObject (Handle, Pathname, ExternalParams, ReturnBuffer);
+ Status = AcpiEvaluateObject (Handle, Pathname,
+ ExternalParams, ReturnBuffer);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -146,10 +147,15 @@ AcpiEvaluateObjectTyped (
AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
AcpiUtGetTypeName (ReturnType)));
- if (MustFree)
+ if (FreeBufferOnError)
{
- /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
-
+ /*
+ * Free a buffer created via ACPI_ALLOCATE_BUFFER.
+ * Note: We use AcpiOsFree here because AcpiOsAllocate was used
+ * to allocate the buffer. This purposefully bypasses the
+ * (optionally enabled) allocation tracking mechanism since we
+ * only want to track internal allocations.
+ */
AcpiOsFree (ReturnBuffer->Pointer);
ReturnBuffer->Pointer = NULL;
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfname.c b/sys/contrib/dev/acpica/components/namespace/nsxfname.c
index 9a7642e..d9595f1 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfname.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfname.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,7 @@
*/
#define __NSXFNAME_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfobj.c b/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
index 153dfaa..545ee17 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __NSXFOBJ_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psargs.c b/sys/contrib/dev/acpica/components/parser/psargs.c
index f61d4e1..8f1089f 100644
--- a/sys/contrib/dev/acpica/components/parser/psargs.c
+++ b/sys/contrib/dev/acpica/components/parser/psargs.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psloop.c b/sys/contrib/dev/acpica/components/parser/psloop.c
index 6a88f4e..4a3ab90 100644
--- a/sys/contrib/dev/acpica/components/parser/psloop.c
+++ b/sys/contrib/dev/acpica/components/parser/psloop.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
/*
* Parse the AML and build an operation tree as most interpreters, (such as
* Perl) do. Parsing is done by hand rather than with a YACC generated parser
@@ -489,6 +488,11 @@ AcpiPsParseLoop (
Status = AE_OK;
}
+ if (Status == AE_CTRL_TERMINATE)
+ {
+ return_ACPI_STATUS (Status);
+ }
+
Status = AcpiPsCompleteOp (WalkState, &Op, Status);
if (ACPI_FAILURE (Status))
{
diff --git a/sys/contrib/dev/acpica/components/parser/psobject.c b/sys/contrib/dev/acpica/components/parser/psobject.c
index 4bdb6dc..11cf35a 100644
--- a/sys/contrib/dev/acpica/components/parser/psobject.c
+++ b/sys/contrib/dev/acpica/components/parser/psobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -229,7 +228,10 @@ AcpiPsBuildNamedOp (
Status = WalkState->DescendingCallback (WalkState, Op);
if (ACPI_FAILURE (Status))
{
- ACPI_EXCEPTION ((AE_INFO, Status, "During name lookup/catalog"));
+ if (Status != AE_CTRL_TERMINATE)
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During name lookup/catalog"));
+ }
return_ACPI_STATUS (Status);
}
@@ -243,7 +245,7 @@ AcpiPsBuildNamedOp (
{
if (Status == AE_CTRL_PENDING)
{
- return_ACPI_STATUS (AE_CTRL_PARSE_PENDING);
+ Status = AE_CTRL_PARSE_PENDING;
}
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/parser/psopcode.c b/sys/contrib/dev/acpica/components/parser/psopcode.c
index 8ae0c80..85cb31d 100644
--- a/sys/contrib/dev/acpica/components/parser/psopcode.c
+++ b/sys/contrib/dev/acpica/components/parser/psopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acopcode.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psopinfo.c b/sys/contrib/dev/acpica/components/parser/psopinfo.c
index 3c6e4a5..6dbdfb6 100644
--- a/sys/contrib/dev/acpica/components/parser/psopinfo.c
+++ b/sys/contrib/dev/acpica/components/parser/psopinfo.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -76,6 +75,10 @@ const ACPI_OPCODE_INFO *
AcpiPsGetOpcodeInfo (
UINT16 Opcode)
{
+#ifdef ACPI_DEBUG_OUTPUT
+ const char *OpcodeName = "Unknown AML opcode";
+#endif
+
ACPI_FUNCTION_NAME (PsGetOpcodeInfo);
@@ -97,10 +100,56 @@ AcpiPsGetOpcodeInfo (
return (&AcpiGbl_AmlOpInfo [AcpiGbl_LongOpIndex [(UINT8) Opcode]]);
}
+#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT
+#include <contrib/dev/acpica/compiler/asldefine.h>
+
+ switch (Opcode)
+ {
+ case AML_RAW_DATA_BYTE:
+ OpcodeName = "-Raw Data Byte-";
+ break;
+
+ case AML_RAW_DATA_WORD:
+ OpcodeName = "-Raw Data Word-";
+ break;
+
+ case AML_RAW_DATA_DWORD:
+ OpcodeName = "-Raw Data Dword-";
+ break;
+
+ case AML_RAW_DATA_QWORD:
+ OpcodeName = "-Raw Data Qword-";
+ break;
+
+ case AML_RAW_DATA_BUFFER:
+ OpcodeName = "-Raw Data Buffer-";
+ break;
+
+ case AML_RAW_DATA_CHAIN:
+ OpcodeName = "-Raw Data Buffer Chain-";
+ break;
+
+ case AML_PACKAGE_LENGTH:
+ OpcodeName = "-Package Length-";
+ break;
+
+ case AML_UNASSIGNED_OPCODE:
+ OpcodeName = "-Unassigned Opcode-";
+ break;
+
+ case AML_DEFAULT_ARG_OP:
+ OpcodeName = "-Default Arg-";
+ break;
+
+ default:
+ break;
+ }
+#endif
+
/* Unknown AML opcode */
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Unknown AML opcode [%4.4X]\n", Opcode));
+ "%s [%4.4X]\n", OpcodeName, Opcode));
return (&AcpiGbl_AmlOpInfo [_UNK]);
}
diff --git a/sys/contrib/dev/acpica/components/parser/psparse.c b/sys/contrib/dev/acpica/components/parser/psparse.c
index 989abdf..52ccdec 100644
--- a/sys/contrib/dev/acpica/components/parser/psparse.c
+++ b/sys/contrib/dev/acpica/components/parser/psparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
/*
* Parse the AML and build an operation tree as most interpreters,
* like Perl, do. Parsing is done by hand rather than with a YACC
diff --git a/sys/contrib/dev/acpica/components/parser/psscope.c b/sys/contrib/dev/acpica/components/parser/psscope.c
index 3aa102bd..c396422 100644
--- a/sys/contrib/dev/acpica/components/parser/psscope.c
+++ b/sys/contrib/dev/acpica/components/parser/psscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/parser/pstree.c b/sys/contrib/dev/acpica/components/parser/pstree.c
index c0eeaf6..4dd9979 100644
--- a/sys/contrib/dev/acpica/components/parser/pstree.c
+++ b/sys/contrib/dev/acpica/components/parser/pstree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __PSTREE_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psutils.c b/sys/contrib/dev/acpica/components/parser/psutils.c
index 4b555cc..1ef18bc 100644
--- a/sys/contrib/dev/acpica/components/parser/psutils.c
+++ b/sys/contrib/dev/acpica/components/parser/psutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/parser/pswalk.c b/sys/contrib/dev/acpica/components/parser/pswalk.c
index 6b6e289..20f32d6 100644
--- a/sys/contrib/dev/acpica/components/parser/pswalk.c
+++ b/sys/contrib/dev/acpica/components/parser/pswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psxface.c b/sys/contrib/dev/acpica/components/parser/psxface.c
index 6235e19..d0922ee 100644
--- a/sys/contrib/dev/acpica/components/parser/psxface.c
+++ b/sys/contrib/dev/acpica/components/parser/psxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsaddr.c b/sys/contrib/dev/acpica/components/resources/rsaddr.c
index a8fa79d..bcf76f5 100644
--- a/sys/contrib/dev/acpica/components/resources/rsaddr.c
+++ b/sys/contrib/dev/acpica/components/resources/rsaddr.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rscalc.c b/sys/contrib/dev/acpica/components/resources/rscalc.c
index 7fadb41..dfeff39 100644
--- a/sys/contrib/dev/acpica/components/resources/rscalc.c
+++ b/sys/contrib/dev/acpica/components/resources/rscalc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -197,6 +197,7 @@ AcpiRsStreamOptionLength (
* FUNCTION: AcpiRsGetAmlLength
*
* PARAMETERS: Resource - Pointer to the resource linked list
+ * ResourceListSize - Size of the resource linked list
* SizeNeeded - Where the required size is returned
*
* RETURN: Status
@@ -210,9 +211,11 @@ AcpiRsStreamOptionLength (
ACPI_STATUS
AcpiRsGetAmlLength (
ACPI_RESOURCE *Resource,
+ ACPI_SIZE ResourceListSize,
ACPI_SIZE *SizeNeeded)
{
ACPI_SIZE AmlSizeNeeded = 0;
+ ACPI_RESOURCE *ResourceEnd;
ACPI_RS_LENGTH TotalSize;
@@ -221,7 +224,8 @@ AcpiRsGetAmlLength (
/* Traverse entire list of internal resource descriptors */
- while (Resource)
+ ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, ResourceListSize);
+ while (Resource < ResourceEnd)
{
/* Validate the descriptor type */
@@ -655,7 +659,7 @@ AcpiRsGetPciRoutingTableLength (
for (Index = 0; Index < NumberOfElements; Index++)
{
- /* Dereference the sub-package */
+ /* Dereference the subpackage */
PackageElement = *TopObjectList;
diff --git a/sys/contrib/dev/acpica/components/resources/rscreate.c b/sys/contrib/dev/acpica/components/resources/rscreate.c
index b599666..3847272 100644
--- a/sys/contrib/dev/acpica/components/resources/rscreate.c
+++ b/sys/contrib/dev/acpica/components/resources/rscreate.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -77,6 +77,10 @@ AcpiBufferToResource (
void *Resource;
void *CurrentResourcePtr;
+
+ ACPI_FUNCTION_TRACE (AcpiBufferToResource);
+
+
/*
* Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag
* is not required here.
@@ -92,7 +96,7 @@ AcpiBufferToResource (
}
if (ACPI_FAILURE (Status))
{
- return (Status);
+ return_ACPI_STATUS (Status);
}
/* Allocate a buffer for the converted resource */
@@ -101,7 +105,7 @@ AcpiBufferToResource (
CurrentResourcePtr = Resource;
if (!Resource)
{
- return (AE_NO_MEMORY);
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Perform the AML-to-Resource conversion */
@@ -121,9 +125,11 @@ AcpiBufferToResource (
*ResourcePtr = Resource;
}
- return (Status);
+ return_ACPI_STATUS (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiBufferToResource)
+
/*******************************************************************************
*
@@ -297,7 +303,7 @@ AcpiRsCreatePciRoutingTable (
*/
UserPrt->Length = (sizeof (ACPI_PCI_ROUTING_TABLE) - 4);
- /* Each sub-package must be of length 4 */
+ /* Each subpackage must be of length 4 */
if ((*TopObjectList)->Package.Count != 4)
{
@@ -308,7 +314,7 @@ AcpiRsCreatePciRoutingTable (
}
/*
- * Dereference the sub-package.
+ * Dereference the subpackage.
* The SubObjectList will now point to an array of the four IRQ
* elements: [Address, Pin, Source, SourceIndex]
*/
@@ -317,7 +323,7 @@ AcpiRsCreatePciRoutingTable (
/* 1) First subobject: Dereference the PRT.Address */
ObjDesc = SubObjectList[0];
- if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
+ if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
ACPI_ERROR ((AE_INFO, "(PRT[%u].Address) Need Integer, found %s",
Index, AcpiUtGetObjectTypeName (ObjDesc)));
@@ -329,7 +335,7 @@ AcpiRsCreatePciRoutingTable (
/* 2) Second subobject: Dereference the PRT.Pin */
ObjDesc = SubObjectList[1];
- if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
+ if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
ACPI_ERROR ((AE_INFO, "(PRT[%u].Pin) Need Integer, found %s",
Index, AcpiUtGetObjectTypeName (ObjDesc)));
@@ -410,7 +416,7 @@ AcpiRsCreatePciRoutingTable (
/* 4) Fourth subobject: Dereference the PRT.SourceIndex */
ObjDesc = SubObjectList[3];
- if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
+ if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
ACPI_ERROR ((AE_INFO,
"(PRT[%u].SourceIndex) Need Integer, found %s",
@@ -435,23 +441,22 @@ AcpiRsCreatePciRoutingTable (
*
* FUNCTION: AcpiRsCreateAmlResources
*
- * PARAMETERS: LinkedListBuffer - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's buffer
+ * PARAMETERS: ResourceList - Pointer to the resource list buffer
+ * OutputBuffer - Where the AML buffer is returned
*
* RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code.
* If the OutputBuffer is too small, the error will be
* AE_BUFFER_OVERFLOW and OutputBuffer->Length will point
* to the size buffer needed.
*
- * DESCRIPTION: Takes the linked list of device resources and
- * creates a bytestream to be used as input for the
- * _SRS control method.
+ * DESCRIPTION: Converts a list of device resources to an AML bytestream
+ * to be used as input for the _SRS control method.
*
******************************************************************************/
ACPI_STATUS
AcpiRsCreateAmlResources (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_BUFFER *ResourceList,
ACPI_BUFFER *OutputBuffer)
{
ACPI_STATUS Status;
@@ -461,17 +466,15 @@ AcpiRsCreateAmlResources (
ACPI_FUNCTION_TRACE (RsCreateAmlResources);
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "LinkedListBuffer = %p\n",
- LinkedListBuffer));
+ /* Params already validated, no need to re-validate here */
- /*
- * Params already validated, so we don't re-validate here
- *
- * Pass the LinkedListBuffer into a module that calculates
- * the buffer size needed for the byte stream.
- */
- Status = AcpiRsGetAmlLength (LinkedListBuffer,
- &AmlSizeNeeded);
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ResourceList Buffer = %p\n",
+ ResourceList->Pointer));
+
+ /* Get the buffer size needed for the AML byte stream */
+
+ Status = AcpiRsGetAmlLength (ResourceList->Pointer,
+ ResourceList->Length, &AmlSizeNeeded);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
(UINT32) AmlSizeNeeded, AcpiFormatException (Status)));
@@ -490,14 +493,14 @@ AcpiRsCreateAmlResources (
/* Do the conversion */
- Status = AcpiRsConvertResourcesToAml (LinkedListBuffer, AmlSizeNeeded,
- OutputBuffer->Pointer);
+ Status = AcpiRsConvertResourcesToAml (ResourceList->Pointer,
+ AmlSizeNeeded, OutputBuffer->Pointer);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer %p Length %X\n",
- OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
+ OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/resources/rsdump.c b/sys/contrib/dev/acpica/components/resources/rsdump.c
index d729795..253347b 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdump.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdump.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __RSDUMP_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -52,7 +51,7 @@
ACPI_MODULE_NAME ("rsdump")
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
/* Local prototypes */
diff --git a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
index 865209b..6fa5cef 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __RSDUMPINFO_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -52,7 +51,7 @@
ACPI_MODULE_NAME ("rsdumpinfo")
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
#define ACPI_RSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE_DATA,f)
diff --git a/sys/contrib/dev/acpica/components/resources/rsinfo.c b/sys/contrib/dev/acpica/components/resources/rsinfo.c
index cb72332..fb60bfd 100644
--- a/sys/contrib/dev/acpica/components/resources/rsinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsinfo.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -141,7 +141,7 @@ ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[] =
};
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
/* Dispatch table for resource dump functions */
diff --git a/sys/contrib/dev/acpica/components/resources/rsio.c b/sys/contrib/dev/acpica/components/resources/rsio.c
index 1a41fb9..008f504 100644
--- a/sys/contrib/dev/acpica/components/resources/rsio.c
+++ b/sys/contrib/dev/acpica/components/resources/rsio.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsirq.c b/sys/contrib/dev/acpica/components/resources/rsirq.c
index b3b5ee57..8a2223f 100644
--- a/sys/contrib/dev/acpica/components/resources/rsirq.c
+++ b/sys/contrib/dev/acpica/components/resources/rsirq.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rslist.c b/sys/contrib/dev/acpica/components/resources/rslist.c
index 81e7292..6934ad1 100644
--- a/sys/contrib/dev/acpica/components/resources/rslist.c
+++ b/sys/contrib/dev/acpica/components/resources/rslist.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsmemory.c b/sys/contrib/dev/acpica/components/resources/rsmemory.c
index 049a7b1..01089ee 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmemory.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmemory.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsmisc.c b/sys/contrib/dev/acpica/components/resources/rsmisc.c
index e895add..8194faf 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmisc.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmisc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsserial.c b/sys/contrib/dev/acpica/components/resources/rsserial.c
index 69e2259..dc3ffc2 100644
--- a/sys/contrib/dev/acpica/components/resources/rsserial.c
+++ b/sys/contrib/dev/acpica/components/resources/rsserial.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsutils.c b/sys/contrib/dev/acpica/components/resources/rsutils.c
index 499efb9..c53a964 100644
--- a/sys/contrib/dev/acpica/components/resources/rsutils.c
+++ b/sys/contrib/dev/acpica/components/resources/rsutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __RSUTILS_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -827,7 +826,7 @@ AcpiRsSetSrsMethodData (
* Convert the linked list into a byte stream
*/
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
- Status = AcpiRsCreateAmlResources (InBuffer->Pointer, &Buffer);
+ Status = AcpiRsCreateAmlResources (InBuffer, &Buffer);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
diff --git a/sys/contrib/dev/acpica/components/resources/rsxface.c b/sys/contrib/dev/acpica/components/resources/rsxface.c
index b2ff381..d213892 100644
--- a/sys/contrib/dev/acpica/components/resources/rsxface.c
+++ b/sys/contrib/dev/acpica/components/resources/rsxface.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __RSXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/tables/tbdata.c b/sys/contrib/dev/acpica/components/tables/tbdata.c
new file mode 100644
index 0000000..19991ce
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/tables/tbdata.c
@@ -0,0 +1,855 @@
+/******************************************************************************
+ *
+ * Module Name: tbdata - Table manager data structure functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#define __TBDATA_C__
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/actables.h>
+
+#define _COMPONENT ACPI_TABLES
+ ACPI_MODULE_NAME ("tbdata")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbInitTableDescriptor
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ * Address - Physical address of the table
+ * Flags - Allocation flags of the table
+ * Table - Pointer to the table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Initialize a new table descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiTbInitTableDescriptor (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags,
+ ACPI_TABLE_HEADER *Table)
+{
+
+ /*
+ * Initialize the table descriptor. Set the pointer to NULL, since the
+ * table is not fully mapped at this time.
+ */
+ ACPI_MEMSET (TableDesc, 0, sizeof (ACPI_TABLE_DESC));
+ TableDesc->Address = Address;
+ TableDesc->Length = Table->Length;
+ TableDesc->Flags = Flags;
+ ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbAcquireTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ * TablePtr - Where table is returned
+ * TableLength - Where table length is returned
+ * TableFlags - Where table allocation flags are returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Acquire an ACPI table. It can be used for tables not
+ * maintained in the AcpiGbl_RootTableList.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbAcquireTable (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_TABLE_HEADER **TablePtr,
+ UINT32 *TableLength,
+ UINT8 *TableFlags)
+{
+ ACPI_TABLE_HEADER *Table = NULL;
+
+
+ switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
+ {
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
+
+ Table = AcpiOsMapMemory (TableDesc->Address, TableDesc->Length);
+ break;
+
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
+
+ Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, TableDesc->Address);
+ break;
+
+ default:
+
+ break;
+ }
+
+ /* Table is not valid yet */
+
+ if (!Table)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Fill the return values */
+
+ *TablePtr = Table;
+ *TableLength = TableDesc->Length;
+ *TableFlags = TableDesc->Flags;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbReleaseTable
+ *
+ * PARAMETERS: Table - Pointer for the table
+ * TableLength - Length for the table
+ * TableFlags - Allocation flags for the table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Release a table. The inverse of AcpiTbAcquireTable().
+ *
+ ******************************************************************************/
+
+void
+AcpiTbReleaseTable (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 TableLength,
+ UINT8 TableFlags)
+{
+
+ switch (TableFlags & ACPI_TABLE_ORIGIN_MASK)
+ {
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
+
+ AcpiOsUnmapMemory (Table, TableLength);
+ break;
+
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
+ default:
+
+ break;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbAcquireTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor to be acquired
+ * Address - Address of the table
+ * Flags - Allocation flags of the table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function validates the table header to obtain the length
+ * of a table and fills the table descriptor to make its state as
+ * "INSTALLED". Such a table descriptor is only used for verified
+ * installation.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbAcquireTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags)
+{
+ ACPI_TABLE_HEADER *TableHeader;
+
+
+ switch (Flags & ACPI_TABLE_ORIGIN_MASK)
+ {
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
+
+ /* Get the length of the full table from the header */
+
+ TableHeader = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
+ if (!TableHeader)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader);
+ AcpiOsUnmapMemory (TableHeader, sizeof (ACPI_TABLE_HEADER));
+ return (AE_OK);
+
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
+
+ TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, Address);
+ if (!TableHeader)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader);
+ return (AE_OK);
+
+ default:
+
+ break;
+ }
+
+ /* Table is not valid yet */
+
+ return (AE_NO_MEMORY);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbReleaseTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor to be released
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: The inverse of AcpiTbAcquireTempTable().
+ *
+ *****************************************************************************/
+
+void
+AcpiTbReleaseTempTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+
+ /*
+ * Note that the .Address is maintained by the callers of
+ * AcpiTbAcquireTempTable(), thus do not invoke AcpiTbUninstallTable()
+ * where .Address will be freed.
+ */
+ AcpiTbInvalidateTable (TableDesc);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiTbValidateTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to validate the table, the returned
+ * table descriptor is in "VALIDATED" state.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiTbValidateTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ ACPI_FUNCTION_TRACE (TbValidateTable);
+
+
+ /* Validate the table if necessary */
+
+ if (!TableDesc->Pointer)
+ {
+ Status = AcpiTbAcquireTable (TableDesc, &TableDesc->Pointer,
+ &TableDesc->Length, &TableDesc->Flags);
+ if (!TableDesc->Pointer)
+ {
+ Status = AE_NO_MEMORY;
+ }
+ }
+
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbInvalidateTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Invalidate one internal ACPI table, this is the inverse of
+ * AcpiTbValidateTable().
+ *
+ ******************************************************************************/
+
+void
+AcpiTbInvalidateTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+
+ ACPI_FUNCTION_TRACE (TbInvalidateTable);
+
+
+ /* Table must be validated */
+
+ if (!TableDesc->Pointer)
+ {
+ return_VOID;
+ }
+
+ AcpiTbReleaseTable (TableDesc->Pointer, TableDesc->Length,
+ TableDesc->Flags);
+ TableDesc->Pointer = NULL;
+
+ return_VOID;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiTbValidateTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to validate the table, the returned
+ * table descriptor is in "VALIDATED" state.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiTbValidateTempTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+
+ if (!TableDesc->Pointer && !AcpiGbl_VerifyTableChecksum)
+ {
+ /*
+ * Only validates the header of the table.
+ * Note that Length contains the size of the mapping after invoking
+ * this work around, this value is required by
+ * AcpiTbReleaseTempTable().
+ * We can do this because in AcpiInitTableDescriptor(), the Length
+ * field of the installed descriptor is filled with the actual
+ * table length obtaining from the table header.
+ */
+ TableDesc->Length = sizeof (ACPI_TABLE_HEADER);
+ }
+
+ return (AcpiTbValidateTable (TableDesc));
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiTbVerifyTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ * Signature - Table signature to verify
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to validate and verify the table, the
+ * returned table descriptor is in "VALIDATED" state.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiTbVerifyTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ char *Signature)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ ACPI_FUNCTION_TRACE (TbVerifyTempTable);
+
+
+ /* Validate the table */
+
+ Status = AcpiTbValidateTempTable (TableDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ /* If a particular signature is expected (DSDT/FACS), it must match */
+
+ if (Signature &&
+ !ACPI_COMPARE_NAME (&TableDesc->Signature, Signature))
+ {
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "Invalid signature 0x%X for ACPI table, expected [%s]",
+ TableDesc->Signature.Integer, Signature));
+ Status = AE_BAD_SIGNATURE;
+ goto InvalidateAndExit;
+ }
+
+ /* Verify the checksum */
+
+ if (AcpiGbl_VerifyTableChecksum)
+ {
+ Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
+ "%4.4s " ACPI_PRINTF_UINT
+ " Attempted table install failed",
+ AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
+ TableDesc->Signature.Ascii : "????",
+ ACPI_FORMAT_TO_UINT (TableDesc->Address)));
+ goto InvalidateAndExit;
+ }
+ }
+
+ return_ACPI_STATUS (AE_OK);
+
+InvalidateAndExit:
+ AcpiTbInvalidateTable (TableDesc);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbResizeRootTableList
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Expand the size of global table array
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbResizeRootTableList (
+ void)
+{
+ ACPI_TABLE_DESC *Tables;
+ UINT32 TableCount;
+
+
+ ACPI_FUNCTION_TRACE (TbResizeRootTableList);
+
+
+ /* AllowResize flag is a parameter to AcpiInitializeTables */
+
+ if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE))
+ {
+ ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed"));
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+
+ /* Increase the Table Array size */
+
+ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ {
+ TableCount = AcpiGbl_RootTableList.MaxTableCount;
+ }
+ else
+ {
+ TableCount = AcpiGbl_RootTableList.CurrentTableCount;
+ }
+
+ Tables = ACPI_ALLOCATE_ZEROED (
+ ((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) *
+ sizeof (ACPI_TABLE_DESC));
+ if (!Tables)
+ {
+ ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ /* Copy and free the previous table array */
+
+ if (AcpiGbl_RootTableList.Tables)
+ {
+ ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables,
+ (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC));
+
+ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ {
+ ACPI_FREE (AcpiGbl_RootTableList.Tables);
+ }
+ }
+
+ AcpiGbl_RootTableList.Tables = Tables;
+ AcpiGbl_RootTableList.MaxTableCount =
+ TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
+ AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbGetNextRootIndex
+ *
+ * PARAMETERS: TableIndex - Where table index is returned
+ *
+ * RETURN: Status and table index.
+ *
+ * DESCRIPTION: Allocate a new ACPI table entry to the global table list
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbGetNextRootIndex (
+ UINT32 *TableIndex)
+{
+ ACPI_STATUS Status;
+
+
+ /* Ensure that there is room for the table in the Root Table List */
+
+ if (AcpiGbl_RootTableList.CurrentTableCount >=
+ AcpiGbl_RootTableList.MaxTableCount)
+ {
+ Status = AcpiTbResizeRootTableList();
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ }
+
+ *TableIndex = AcpiGbl_RootTableList.CurrentTableCount;
+ AcpiGbl_RootTableList.CurrentTableCount++;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbTerminate
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Delete all internal ACPI tables
+ *
+ ******************************************************************************/
+
+void
+AcpiTbTerminate (
+ void)
+{
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (TbTerminate);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
+ /* Delete the individual tables */
+
+ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
+ {
+ AcpiTbUninstallTable (&AcpiGbl_RootTableList.Tables[i]);
+ }
+
+ /*
+ * Delete the root table array if allocated locally. Array cannot be
+ * mapped, so we don't need to check for that flag.
+ */
+ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ {
+ ACPI_FREE (AcpiGbl_RootTableList.Tables);
+ }
+
+ AcpiGbl_RootTableList.Tables = NULL;
+ AcpiGbl_RootTableList.Flags = 0;
+ AcpiGbl_RootTableList.CurrentTableCount = 0;
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n"));
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_VOID;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbDeleteNamespaceByOwner
+ *
+ * PARAMETERS: TableIndex - Table index
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Delete all namespace objects created when this table was loaded.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbDeleteNamespaceByOwner (
+ UINT32 TableIndex)
+{
+ ACPI_OWNER_ID OwnerId;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner);
+
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ /* The table index does not exist */
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (AE_NOT_EXIST);
+ }
+
+ /* Get the owner ID for this table, used to delete namespace nodes */
+
+ OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+
+ /*
+ * Need to acquire the namespace writer lock to prevent interference
+ * with any concurrent namespace walks. The interpreter must be
+ * released during the deletion since the acquisition of the deletion
+ * lock may block, and also since the execution of a namespace walk
+ * must be allowed to use the interpreter.
+ */
+ (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
+ Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock);
+
+ AcpiNsDeleteNamespaceByOwner (OwnerId);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbAllocateOwnerId
+ *
+ * PARAMETERS: TableIndex - Table index
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Allocates OwnerId in TableDesc
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbAllocateOwnerId (
+ UINT32 TableIndex)
+{
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+
+
+ ACPI_FUNCTION_TRACE (TbAllocateOwnerId);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ Status = AcpiUtAllocateOwnerId (
+ &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbReleaseOwnerId
+ *
+ * PARAMETERS: TableIndex - Table index
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Releases OwnerId in TableDesc
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbReleaseOwnerId (
+ UINT32 TableIndex)
+{
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+
+
+ ACPI_FUNCTION_TRACE (TbReleaseOwnerId);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ AcpiUtReleaseOwnerId (
+ &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
+ Status = AE_OK;
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbGetOwnerId
+ *
+ * PARAMETERS: TableIndex - Table index
+ * OwnerId - Where the table OwnerId is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: returns OwnerId for the ACPI table
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbGetOwnerId (
+ UINT32 TableIndex,
+ ACPI_OWNER_ID *OwnerId)
+{
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+
+
+ ACPI_FUNCTION_TRACE (TbGetOwnerId);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
+ Status = AE_OK;
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbIsTableLoaded
+ *
+ * PARAMETERS: TableIndex - Index into the root table
+ *
+ * RETURN: Table Loaded Flag
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiTbIsTableLoaded (
+ UINT32 TableIndex)
+{
+ BOOLEAN IsLoaded = FALSE;
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ IsLoaded = (BOOLEAN)
+ (AcpiGbl_RootTableList.Tables[TableIndex].Flags &
+ ACPI_TABLE_IS_LOADED);
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return (IsLoaded);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbSetTableLoadedFlag
+ *
+ * PARAMETERS: TableIndex - Table index
+ * IsLoaded - TRUE if table is loaded, FALSE otherwise
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE.
+ *
+ ******************************************************************************/
+
+void
+AcpiTbSetTableLoadedFlag (
+ UINT32 TableIndex,
+ BOOLEAN IsLoaded)
+{
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ if (IsLoaded)
+ {
+ AcpiGbl_RootTableList.Tables[TableIndex].Flags |=
+ ACPI_TABLE_IS_LOADED;
+ }
+ else
+ {
+ AcpiGbl_RootTableList.Tables[TableIndex].Flags &=
+ ~ACPI_TABLE_IS_LOADED;
+ }
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+}
diff --git a/sys/contrib/dev/acpica/components/tables/tbfadt.c b/sys/contrib/dev/acpica/components/tables/tbfadt.c
index 4a27520..56a3fba 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfadt.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfadt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,20 +58,23 @@ AcpiTbInitGenericAddress (
UINT8 SpaceId,
UINT8 ByteWidth,
UINT64 Address,
- char *RegisterName);
+ char *RegisterName,
+ UINT8 Flags);
static void
AcpiTbConvertFadt (
void);
static void
-AcpiTbValidateFadt (
- void);
-
-static void
AcpiTbSetupFadtRegisters (
void);
+static UINT64
+AcpiTbSelectAddress (
+ char *RegisterName,
+ UINT32 Address32,
+ UINT64 Address64);
+
/* Table for conversion of FADT to common internal format and FADT validation */
@@ -82,13 +85,14 @@ typedef struct acpi_fadt_info
UINT16 Address32;
UINT16 Length;
UINT8 DefaultLength;
- UINT8 Type;
+ UINT8 Flags;
} ACPI_FADT_INFO;
#define ACPI_FADT_OPTIONAL 0
#define ACPI_FADT_REQUIRED 1
#define ACPI_FADT_SEPARATE_LENGTH 2
+#define ACPI_FADT_GPE_REGISTER 4
static ACPI_FADT_INFO FadtInfoTable[] =
{
@@ -139,14 +143,14 @@ static ACPI_FADT_INFO FadtInfoTable[] =
ACPI_FADT_OFFSET (Gpe0Block),
ACPI_FADT_OFFSET (Gpe0BlockLength),
0,
- ACPI_FADT_SEPARATE_LENGTH},
+ ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER},
{"Gpe1Block",
ACPI_FADT_OFFSET (XGpe1Block),
ACPI_FADT_OFFSET (Gpe1Block),
ACPI_FADT_OFFSET (Gpe1BlockLength),
0,
- ACPI_FADT_SEPARATE_LENGTH}
+ ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER}
};
#define ACPI_FADT_INFO_ENTRIES \
@@ -194,6 +198,7 @@ static ACPI_FADT_PM_INFO FadtPmInfoTable[] =
* SpaceId - ACPI Space ID for this register
* ByteWidth - Width of this register
* Address - Address of the register
+ * RegisterName - ASCII name of the ACPI register
*
* RETURN: None
*
@@ -209,21 +214,31 @@ AcpiTbInitGenericAddress (
UINT8 SpaceId,
UINT8 ByteWidth,
UINT64 Address,
- char *RegisterName)
+ char *RegisterName,
+ UINT8 Flags)
{
UINT8 BitWidth;
- /* Bit width field in the GAS is only one byte long, 255 max */
-
+ /*
+ * Bit width field in the GAS is only one byte long, 255 max.
+ * Check for BitWidth overflow in GAS.
+ */
BitWidth = (UINT8) (ByteWidth * 8);
-
- if (ByteWidth > 31) /* (31*8)=248 */
+ if (ByteWidth > 31) /* (31*8)=248, (32*8)=256 */
{
- ACPI_ERROR ((AE_INFO,
- "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
- "to convert to GAS struct - 255 bits max, truncating",
- RegisterName, ByteWidth, (ByteWidth * 8)));
+ /*
+ * No error for GPE blocks, because we do not use the BitWidth
+ * for GPEs, the legacy length (ByteWidth) is used instead to
+ * allow for a large number of GPEs.
+ */
+ if (!(Flags & ACPI_FADT_GPE_REGISTER))
+ {
+ ACPI_ERROR ((AE_INFO,
+ "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
+ "to convert to GAS struct - 255 bits max, truncating",
+ RegisterName, ByteWidth, (ByteWidth * 8)));
+ }
BitWidth = 255;
}
@@ -245,6 +260,72 @@ AcpiTbInitGenericAddress (
/*******************************************************************************
*
+ * FUNCTION: AcpiTbSelectAddress
+ *
+ * PARAMETERS: RegisterName - ASCII name of the ACPI register
+ * Address32 - 32-bit address of the register
+ * Address64 - 64-bit address of the register
+ *
+ * RETURN: The resolved 64-bit address
+ *
+ * DESCRIPTION: Select between 32-bit and 64-bit versions of addresses within
+ * the FADT. Used for the FACS and DSDT addresses.
+ *
+ * NOTES:
+ *
+ * Check for FACS and DSDT address mismatches. An address mismatch between
+ * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
+ * DSDT/X_DSDT) could be a corrupted address field or it might indicate
+ * the presence of two FACS or two DSDT tables.
+ *
+ * November 2013:
+ * By default, as per the ACPICA specification, a valid 64-bit address is
+ * used regardless of the value of the 32-bit address. However, this
+ * behavior can be overridden via the AcpiGbl_Use32BitFadtAddresses flag.
+ *
+ ******************************************************************************/
+
+static UINT64
+AcpiTbSelectAddress (
+ char *RegisterName,
+ UINT32 Address32,
+ UINT64 Address64)
+{
+
+ if (!Address64)
+ {
+ /* 64-bit address is zero, use 32-bit address */
+
+ return ((UINT64) Address32);
+ }
+
+ if (Address32 &&
+ (Address64 != (UINT64) Address32))
+ {
+ /* Address mismatch between 32-bit and 64-bit versions */
+
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "32/64X %s address mismatch in FADT: "
+ "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
+ RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64),
+ AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
+
+ /* 32-bit address override */
+
+ if (AcpiGbl_Use32BitFadtAddresses)
+ {
+ return ((UINT64) Address32);
+ }
+ }
+
+ /* Default is to use the 64-bit address */
+
+ return (Address64);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiTbParseFadt
*
* PARAMETERS: TableIndex - Index for the FADT
@@ -296,14 +377,14 @@ AcpiTbParseFadt (
/* Obtain the DSDT and FACS tables via their addresses within the FADT */
- AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt,
+ AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt,
ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
/* If Hardware Reduced flag is set, there is no FACS */
if (!AcpiGbl_ReducedHardware)
{
- AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs,
+ AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs,
ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
}
}
@@ -365,10 +446,6 @@ AcpiTbCreateLocalFadt (
AcpiTbConvertFadt ();
- /* Validate FADT values now, before we make any changes */
-
- AcpiTbValidateFadt ();
-
/* Initialize the global ACPI register structures */
AcpiTbSetupFadtRegisters ();
@@ -379,33 +456,43 @@ AcpiTbCreateLocalFadt (
*
* FUNCTION: AcpiTbConvertFadt
*
- * PARAMETERS: None, uses AcpiGbl_FADT
+ * PARAMETERS: None - AcpiGbl_FADT is used.
*
* RETURN: None
*
* DESCRIPTION: Converts all versions of the FADT to a common internal format.
- * Expand 32-bit addresses to 64-bit as necessary.
+ * Expand 32-bit addresses to 64-bit as necessary. Also validate
+ * important fields within the FADT.
*
- * NOTE: AcpiGbl_FADT must be of size (ACPI_TABLE_FADT),
- * and must contain a copy of the actual FADT.
+ * NOTE: AcpiGbl_FADT must be of size (ACPI_TABLE_FADT), and must
+ * contain a copy of the actual BIOS-provided FADT.
*
* Notes on 64-bit register addresses:
*
* After this FADT conversion, later ACPICA code will only use the 64-bit "X"
* fields of the FADT for all ACPI register addresses.
*
- * The 64-bit "X" fields are optional extensions to the original 32-bit FADT
+ * The 64-bit X fields are optional extensions to the original 32-bit FADT
* V1.0 fields. Even if they are present in the FADT, they are optional and
* are unused if the BIOS sets them to zero. Therefore, we must copy/expand
- * 32-bit V1.0 fields if the corresponding X field is zero.
+ * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is
+ * originally zero.
*
- * For ACPI 1.0 FADTs, all 32-bit address fields are expanded to the
- * corresponding "X" fields in the internal FADT.
+ * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address
+ * fields are expanded to the corresponding 64-bit X fields in the internal
+ * common FADT.
*
* For ACPI 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded
- * to the corresponding 64-bit X fields. For compatibility with other ACPI
- * implementations, we ignore the 64-bit field if the 32-bit field is valid,
- * regardless of whether the host OS is 32-bit or 64-bit.
+ * to the corresponding 64-bit X fields, if the 64-bit field is originally
+ * zero. Adhering to the ACPI specification, we completely ignore the 32-bit
+ * field if the 64-bit field is valid, regardless of whether the host OS is
+ * 32-bit or 64-bit.
+ *
+ * Possible additional checks:
+ * (AcpiGbl_FADT.Pm1EventLength >= 4)
+ * (AcpiGbl_FADT.Pm1ControlLength >= 2)
+ * (AcpiGbl_FADT.PmTimerLength >= 4)
+ * Gpe block lengths must be multiple of 2
*
******************************************************************************/
@@ -413,25 +500,15 @@ static void
AcpiTbConvertFadt (
void)
{
+ char *Name;
ACPI_GENERIC_ADDRESS *Address64;
UINT32 Address32;
+ UINT8 Length;
+ UINT8 Flags;
UINT32 i;
/*
- * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
- * Later code will always use the X 64-bit field.
- */
- if (!AcpiGbl_FADT.XFacs)
- {
- AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs;
- }
- if (!AcpiGbl_FADT.XDsdt)
- {
- AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt;
- }
-
- /*
* For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
* should be zero are indeed zero. This will workaround BIOSs that
* inadvertently place values in these fields.
@@ -458,113 +535,14 @@ AcpiTbConvertFadt (
AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT);
/*
- * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
- * generic address structures as necessary. Later code will always use
- * the 64-bit address structures.
- *
- * March 2009:
- * We now always use the 32-bit address if it is valid (non-null). This
- * is not in accordance with the ACPI specification which states that
- * the 64-bit address supersedes the 32-bit version, but we do this for
- * compatibility with other ACPI implementations. Most notably, in the
- * case where both the 32 and 64 versions are non-null, we use the 32-bit
- * version. This is the only address that is guaranteed to have been
- * tested by the BIOS manufacturer.
- */
- for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++)
- {
- Address32 = *ACPI_ADD_PTR (UINT32,
- &AcpiGbl_FADT, FadtInfoTable[i].Address32);
-
- Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS,
- &AcpiGbl_FADT, FadtInfoTable[i].Address64);
-
- /*
- * If both 32- and 64-bit addresses are valid (non-zero),
- * they must match.
- */
- if (Address64->Address && Address32 &&
- (Address64->Address != (UINT64) Address32))
- {
- ACPI_BIOS_ERROR ((AE_INFO,
- "32/64X address mismatch in FADT/%s: "
- "0x%8.8X/0x%8.8X%8.8X, using 32",
- FadtInfoTable[i].Name, Address32,
- ACPI_FORMAT_UINT64 (Address64->Address)));
- }
-
- /* Always use 32-bit address if it is valid (non-null) */
-
- if (Address32)
- {
- /*
- * Copy the 32-bit address to the 64-bit GAS structure. The
- * Space ID is always I/O for 32-bit legacy address fields
- */
- AcpiTbInitGenericAddress (Address64, ACPI_ADR_SPACE_SYSTEM_IO,
- *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length),
- (UINT64) Address32, FadtInfoTable[i].Name);
- }
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbValidateFadt
- *
- * PARAMETERS: Table - Pointer to the FADT to be validated
- *
- * RETURN: None
- *
- * DESCRIPTION: Validate various important fields within the FADT. If a problem
- * is found, issue a message, but no status is returned.
- * Used by both the table manager and the disassembler.
- *
- * Possible additional checks:
- * (AcpiGbl_FADT.Pm1EventLength >= 4)
- * (AcpiGbl_FADT.Pm1ControlLength >= 2)
- * (AcpiGbl_FADT.PmTimerLength >= 4)
- * Gpe block lengths must be multiple of 2
- *
- ******************************************************************************/
-
-static void
-AcpiTbValidateFadt (
- void)
-{
- char *Name;
- ACPI_GENERIC_ADDRESS *Address64;
- UINT8 Length;
- UINT32 i;
-
-
- /*
- * Check for FACS and DSDT address mismatches. An address mismatch between
- * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
- * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.
+ * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
+ * Later ACPICA code will always use the X 64-bit field.
*/
- if (AcpiGbl_FADT.Facs &&
- (AcpiGbl_FADT.XFacs != (UINT64) AcpiGbl_FADT.Facs))
- {
- ACPI_BIOS_WARNING ((AE_INFO,
- "32/64X FACS address mismatch in FADT - "
- "0x%8.8X/0x%8.8X%8.8X, using 32",
- AcpiGbl_FADT.Facs, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XFacs)));
-
- AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs;
- }
-
- if (AcpiGbl_FADT.Dsdt &&
- (AcpiGbl_FADT.XDsdt != (UINT64) AcpiGbl_FADT.Dsdt))
- {
- ACPI_BIOS_WARNING ((AE_INFO,
- "32/64X DSDT address mismatch in FADT - "
- "0x%8.8X/0x%8.8X%8.8X, using 32",
- AcpiGbl_FADT.Dsdt, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XDsdt)));
+ AcpiGbl_FADT.XFacs = AcpiTbSelectAddress ("FACS",
+ AcpiGbl_FADT.Facs, AcpiGbl_FADT.XFacs);
- AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt;
- }
+ AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT",
+ AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt);
/* If Hardware Reduced flag is set, we are all done */
@@ -578,14 +556,81 @@ AcpiTbValidateFadt (
for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++)
{
/*
- * Generate pointer to the 64-bit address, get the register
- * length (width) and the register name
+ * Get the 32-bit and 64-bit addresses, as well as the register
+ * length and register name.
*/
+ Address32 = *ACPI_ADD_PTR (UINT32,
+ &AcpiGbl_FADT, FadtInfoTable[i].Address32);
+
Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS,
- &AcpiGbl_FADT, FadtInfoTable[i].Address64);
+ &AcpiGbl_FADT, FadtInfoTable[i].Address64);
+
Length = *ACPI_ADD_PTR (UINT8,
- &AcpiGbl_FADT, FadtInfoTable[i].Length);
+ &AcpiGbl_FADT, FadtInfoTable[i].Length);
+
Name = FadtInfoTable[i].Name;
+ Flags = FadtInfoTable[i].Flags;
+
+ /*
+ * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
+ * generic address structures as necessary. Later code will always use
+ * the 64-bit address structures.
+ *
+ * November 2013:
+ * Now always use the 64-bit address if it is valid (non-zero), in
+ * accordance with the ACPI specification which states that a 64-bit
+ * address supersedes the 32-bit version. This behavior can be
+ * overridden by the AcpiGbl_Use32BitFadtAddresses flag.
+ *
+ * During 64-bit address construction and verification,
+ * these cases are handled:
+ *
+ * Address32 zero, Address64 [don't care] - Use Address64
+ *
+ * Address32 non-zero, Address64 zero - Copy/use Address32
+ * Address32 non-zero == Address64 non-zero - Use Address64
+ * Address32 non-zero != Address64 non-zero - Warning, use Address64
+ *
+ * Override: if AcpiGbl_Use32BitFadtAddresses is TRUE, and:
+ * Address32 non-zero != Address64 non-zero - Warning, copy/use Address32
+ *
+ * Note: SpaceId is always I/O for 32-bit legacy address fields
+ */
+ if (Address32)
+ {
+ if (!Address64->Address)
+ {
+ /* 64-bit address is zero, use 32-bit address */
+
+ AcpiTbInitGenericAddress (Address64,
+ ACPI_ADR_SPACE_SYSTEM_IO,
+ *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
+ FadtInfoTable[i].Length),
+ (UINT64) Address32, Name, Flags);
+ }
+ else if (Address64->Address != (UINT64) Address32)
+ {
+ /* Address mismatch */
+
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "32/64X address mismatch in FADT/%s: "
+ "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
+ Name, Address32,
+ ACPI_FORMAT_UINT64 (Address64->Address),
+ AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
+
+ if (AcpiGbl_Use32BitFadtAddresses)
+ {
+ /* 32-bit address override */
+
+ AcpiTbInitGenericAddress (Address64,
+ ACPI_ADR_SPACE_SYSTEM_IO,
+ *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
+ FadtInfoTable[i].Length),
+ (UINT64) Address32, Name, Flags);
+ }
+ }
+ }
/*
* For each extended field, check for length mismatch between the
@@ -603,7 +648,7 @@ AcpiTbValidateFadt (
Name, ACPI_MUL_8 (Length), Address64->BitWidth));
}
- if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED)
+ if (FadtInfoTable[i].Flags & ACPI_FADT_REQUIRED)
{
/*
* Field is required (PM1aEvent, PM1aControl).
@@ -617,7 +662,7 @@ AcpiTbValidateFadt (
Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));
}
}
- else if (FadtInfoTable[i].Type & ACPI_FADT_SEPARATE_LENGTH)
+ else if (FadtInfoTable[i].Flags & ACPI_FADT_SEPARATE_LENGTH)
{
/*
* Field is optional (PM2Control, GPE0, GPE1) AND has its own
@@ -724,7 +769,7 @@ AcpiTbSetupFadtRegisters (
Source64->SpaceId, Pm1RegisterByteWidth,
Source64->Address +
(FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
- "PmRegisters");
+ "PmRegisters", 0);
}
}
}
diff --git a/sys/contrib/dev/acpica/components/tables/tbfind.c b/sys/contrib/dev/acpica/components/tables/tbfind.c
index 6cd30e8..b59a6c2 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfind.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfind.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -108,7 +108,7 @@ AcpiTbFindTable (
{
/* Table is not currently mapped, map it */
- Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/sys/contrib/dev/acpica/components/tables/tbinstal.c b/sys/contrib/dev/acpica/components/tables/tbinstal.c
index 0652b16..b62e0e0 100644
--- a/sys/contrib/dev/acpica/components/tables/tbinstal.c
+++ b/sys/contrib/dev/acpica/components/tables/tbinstal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,778 +41,528 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __TBINSTAL_C__
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
-#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/actables.h>
-
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbinstal")
+/* Local prototypes */
-/******************************************************************************
+static BOOLEAN
+AcpiTbCompareTables (
+ ACPI_TABLE_DESC *TableDesc,
+ UINT32 TableIndex);
+
+
+/*******************************************************************************
*
- * FUNCTION: AcpiTbVerifyTable
+ * FUNCTION: AcpiTbCompareTables
*
- * PARAMETERS: TableDesc - table
+ * PARAMETERS: TableDesc - Table 1 descriptor to be compared
+ * TableIndex - Index of table 2 to be compared
*
- * RETURN: Status
+ * RETURN: TRUE if both tables are identical.
*
- * DESCRIPTION: this function is called to verify and map table
+ * DESCRIPTION: This function compares a table with another table that has
+ * already been installed in the root table list.
*
- *****************************************************************************/
+ ******************************************************************************/
-ACPI_STATUS
-AcpiTbVerifyTable (
- ACPI_TABLE_DESC *TableDesc)
+static BOOLEAN
+AcpiTbCompareTables (
+ ACPI_TABLE_DESC *TableDesc,
+ UINT32 TableIndex)
{
ACPI_STATUS Status = AE_OK;
+ BOOLEAN IsIdentical;
+ ACPI_TABLE_HEADER *Table;
+ UINT32 TableLength;
+ UINT8 TableFlags;
- ACPI_FUNCTION_TRACE (TbVerifyTable);
-
-
- /* Map the table if necessary */
-
- if (!TableDesc->Pointer)
+ Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex],
+ &Table, &TableLength, &TableFlags);
+ if (ACPI_FAILURE (Status))
{
- if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
- ACPI_TABLE_ORIGIN_MAPPED)
- {
- TableDesc->Pointer = AcpiOsMapMemory (
- TableDesc->Address, TableDesc->Length);
- }
-
- if (!TableDesc->Pointer)
- {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
+ return (FALSE);
}
- /* Always calculate checksum, ignore bad checksum if requested */
+ /*
+ * Check for a table match on the entire table length,
+ * not just the header.
+ */
+ IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength ||
+ ACPI_MEMCMP (TableDesc->Pointer, Table, TableLength)) ?
+ FALSE : TRUE);
- Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
+ /* Release the acquired table */
- return_ACPI_STATUS (Status);
+ AcpiTbReleaseTable (Table, TableLength, TableFlags);
+ return (IsIdentical);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbAddTable
+ * FUNCTION: AcpiTbInstallTableWithOverride
*
- * PARAMETERS: TableDesc - Table descriptor
- * TableIndex - Where the table index is returned
+ * PARAMETERS: TableIndex - Index into root table array
+ * NewTableDesc - New table descriptor to install
+ * Override - Whether override should be performed
*
- * RETURN: Status
+ * RETURN: None
*
- * DESCRIPTION: This function is called to add an ACPI table. It is used to
- * dynamically load tables via the Load and LoadTable AML
- * operators.
+ * DESCRIPTION: Install an ACPI table into the global data structure. The
+ * table override mechanism is called to allow the host
+ * OS to replace any table before it is installed in the root
+ * table array.
*
******************************************************************************/
-ACPI_STATUS
-AcpiTbAddTable (
- ACPI_TABLE_DESC *TableDesc,
- UINT32 *TableIndex)
+void
+AcpiTbInstallTableWithOverride (
+ UINT32 TableIndex,
+ ACPI_TABLE_DESC *NewTableDesc,
+ BOOLEAN Override)
{
- UINT32 i;
- ACPI_STATUS Status = AE_OK;
-
-
- ACPI_FUNCTION_TRACE (TbAddTable);
-
- if (!TableDesc->Pointer)
+ if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
{
- Status = AcpiTbVerifyTable (TableDesc);
- if (ACPI_FAILURE (Status) || !TableDesc->Pointer)
- {
- return_ACPI_STATUS (Status);
- }
+ return;
}
/*
- * Validate the incoming table signature.
+ * ACPI Table Override:
*
- * 1) Originally, we checked the table signature for "SSDT" or "PSDT".
- * 2) We added support for OEMx tables, signature "OEM".
- * 3) Valid tables were encountered with a null signature, so we just
- * gave up on validating the signature, (05/2008).
- * 4) We encountered non-AML tables such as the MADT, which caused
- * interpreter errors and kernel faults. So now, we once again allow
- * only "SSDT", "OEMx", and now, also a null signature. (05/2011).
+ * Before we install the table, let the host OS override it with a new
+ * one if desired. Any table within the RSDT/XSDT can be replaced,
+ * including the DSDT which is pointed to by the FADT.
*/
- if ((TableDesc->Pointer->Signature[0] != 0x00) &&
- (!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) &&
- (ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3)))
+ if (Override)
{
- ACPI_BIOS_ERROR ((AE_INFO,
- "Table has invalid signature [%4.4s] (0x%8.8X), "
- "must be SSDT or OEMx",
- AcpiUtValidAcpiName (TableDesc->Pointer->Signature) ?
- TableDesc->Pointer->Signature : "????",
- *(UINT32 *) TableDesc->Pointer->Signature));
-
- return_ACPI_STATUS (AE_BAD_SIGNATURE);
+ AcpiTbOverrideTable (NewTableDesc);
}
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
-
- /* Check if table is already registered */
-
- for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
- {
- if (!AcpiGbl_RootTableList.Tables[i].Pointer)
- {
- Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);
- if (ACPI_FAILURE (Status) ||
- !AcpiGbl_RootTableList.Tables[i].Pointer)
- {
- continue;
- }
- }
-
- /*
- * Check for a table match on the entire table length,
- * not just the header.
- */
- if (TableDesc->Length != AcpiGbl_RootTableList.Tables[i].Length)
- {
- continue;
- }
+ AcpiTbInitTableDescriptor (&AcpiGbl_RootTableList.Tables[TableIndex],
+ NewTableDesc->Address, NewTableDesc->Flags, NewTableDesc->Pointer);
- if (ACPI_MEMCMP (TableDesc->Pointer,
- AcpiGbl_RootTableList.Tables[i].Pointer,
- AcpiGbl_RootTableList.Tables[i].Length))
- {
- continue;
- }
+ AcpiTbPrintTableHeader (NewTableDesc->Address, NewTableDesc->Pointer);
- /*
- * Note: the current mechanism does not unregister a table if it is
- * dynamically unloaded. The related namespace entries are deleted,
- * but the table remains in the root table list.
- *
- * The assumption here is that the number of different tables that
- * will be loaded is actually small, and there is minimal overhead
- * in just keeping the table in case it is needed again.
- *
- * If this assumption changes in the future (perhaps on large
- * machines with many table load/unload operations), tables will
- * need to be unregistered when they are unloaded, and slots in the
- * root table list should be reused when empty.
- */
+ /* Set the global integer width (based upon revision of the DSDT) */
- /*
- * Table is already registered.
- * We can delete the table that was passed as a parameter.
- */
- AcpiTbDeleteTable (TableDesc);
- *TableIndex = i;
-
- if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED)
- {
- /* Table is still loaded, this is an error */
-
- Status = AE_ALREADY_EXISTS;
- goto Release;
- }
- else
- {
- /* Table was unloaded, allow it to be reloaded */
-
- TableDesc->Pointer = AcpiGbl_RootTableList.Tables[i].Pointer;
- TableDesc->Address = AcpiGbl_RootTableList.Tables[i].Address;
- Status = AE_OK;
- goto PrintHeader;
- }
- }
-
- /*
- * ACPI Table Override:
- * Allow the host to override dynamically loaded tables.
- * NOTE: the table is fully mapped at this point, and the mapping will
- * be deleted by TbTableOverride if the table is actually overridden.
- */
- (void) AcpiTbTableOverride (TableDesc->Pointer, TableDesc);
-
- /* Add the table to the global root table list */
-
- Status = AcpiTbStoreTable (TableDesc->Address, TableDesc->Pointer,
- TableDesc->Length, TableDesc->Flags, TableIndex);
- if (ACPI_FAILURE (Status))
+ if (TableIndex == ACPI_TABLE_INDEX_DSDT)
{
- goto Release;
+ AcpiUtSetIntegerWidth (NewTableDesc->Pointer->Revision);
}
-
-PrintHeader:
- AcpiTbPrintTableHeader (TableDesc->Address, TableDesc->Pointer);
-
-Release:
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbTableOverride
+ * FUNCTION: AcpiTbInstallFixedTable
*
- * PARAMETERS: TableHeader - Header for the original table
- * TableDesc - Table descriptor initialized for the
- * original table. May or may not be mapped.
+ * PARAMETERS: Address - Physical address of DSDT or FACS
+ * Signature - Table signature, NULL if no need to
+ * match
+ * TableIndex - Index into root table array
*
- * RETURN: Pointer to the entire new table. NULL if table not overridden.
- * If overridden, installs the new table within the input table
- * descriptor.
+ * RETURN: Status
*
- * DESCRIPTION: Attempt table override by calling the OSL override functions.
- * Note: If the table is overridden, then the entire new table
- * is mapped and returned by this function.
+ * DESCRIPTION: Install a fixed ACPI table (DSDT/FACS) into the global data
+ * structure.
*
******************************************************************************/
-ACPI_TABLE_HEADER *
-AcpiTbTableOverride (
- ACPI_TABLE_HEADER *TableHeader,
- ACPI_TABLE_DESC *TableDesc)
+ACPI_STATUS
+AcpiTbInstallFixedTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ char *Signature,
+ UINT32 TableIndex)
{
+ ACPI_TABLE_DESC NewTableDesc;
ACPI_STATUS Status;
- ACPI_TABLE_HEADER *NewTable = NULL;
- ACPI_PHYSICAL_ADDRESS NewAddress = 0;
- UINT32 NewTableLength = 0;
- UINT8 NewFlags;
- char *OverrideType;
- /* (1) Attempt logical override (returns a logical address) */
+ ACPI_FUNCTION_TRACE (TbInstallFixedTable);
+
- Status = AcpiOsTableOverride (TableHeader, &NewTable);
- if (ACPI_SUCCESS (Status) && NewTable)
+ if (!Address)
{
- NewAddress = ACPI_PTR_TO_PHYSADDR (NewTable);
- NewTableLength = NewTable->Length;
- NewFlags = ACPI_TABLE_ORIGIN_OVERRIDE;
- OverrideType = "Logical";
- goto FinishOverride;
+ ACPI_ERROR ((AE_INFO, "Null physical address for ACPI table [%s]",
+ Signature));
+ return (AE_NO_MEMORY);
}
- /* (2) Attempt physical override (returns a physical address) */
+ /* Fill a table descriptor for validation */
- Status = AcpiOsPhysicalTableOverride (TableHeader,
- &NewAddress, &NewTableLength);
- if (ACPI_SUCCESS (Status) && NewAddress && NewTableLength)
+ Status = AcpiTbAcquireTempTable (&NewTableDesc, Address,
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
+ if (ACPI_FAILURE (Status))
{
- /* Map the entire new table */
-
- NewTable = AcpiOsMapMemory (NewAddress, NewTableLength);
- if (!NewTable)
- {
- ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
- "%4.4s %p Attempted physical table override failed",
- TableHeader->Signature,
- ACPI_CAST_PTR (void, TableDesc->Address)));
- return (NULL);
- }
-
- OverrideType = "Physical";
- NewFlags = ACPI_TABLE_ORIGIN_MAPPED;
- goto FinishOverride;
+ ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p",
+ ACPI_CAST_PTR (void, Address)));
+ return_ACPI_STATUS (Status);
}
- return (NULL); /* There was no override */
-
-
-FinishOverride:
+ /* Validate and verify a table before installation */
- ACPI_INFO ((AE_INFO,
- "%4.4s %p %s table override, new table: %p",
- TableHeader->Signature,
- ACPI_CAST_PTR (void, TableDesc->Address),
- OverrideType, NewTable));
-
- /* We can now unmap/delete the original table (if fully mapped) */
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, Signature);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ReleaseAndExit;
+ }
- AcpiTbDeleteTable (TableDesc);
+ AcpiTbInstallTableWithOverride (TableIndex, &NewTableDesc, TRUE);
- /* Setup descriptor for the new table */
+ReleaseAndExit:
- TableDesc->Address = NewAddress;
- TableDesc->Pointer = NewTable;
- TableDesc->Length = NewTableLength;
- TableDesc->Flags = NewFlags;
+ /* Release the temporary table descriptor */
- return (NewTable);
+ AcpiTbReleaseTempTable (&NewTableDesc);
+ return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbResizeRootTableList
+ * FUNCTION: AcpiTbInstallStandardTable
*
- * PARAMETERS: None
+ * PARAMETERS: Address - Address of the table (might be a virtual
+ * address depending on the TableFlags)
+ * Flags - Flags for the table
+ * Reload - Whether reload should be performed
+ * Override - Whether override should be performed
+ * TableIndex - Where the table index is returned
*
* RETURN: Status
*
- * DESCRIPTION: Expand the size of global table array
+ * DESCRIPTION: This function is called to install an ACPI table that is
+ * neither DSDT nor FACS (a "standard" table.)
+ * When this function is called by "Load" or "LoadTable" opcodes,
+ * or by AcpiLoadTable() API, the "Reload" parameter is set.
+ * After sucessfully returning from this function, table is
+ * "INSTALLED" but not "VALIDATED".
*
******************************************************************************/
ACPI_STATUS
-AcpiTbResizeRootTableList (
- void)
+AcpiTbInstallStandardTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags,
+ BOOLEAN Reload,
+ BOOLEAN Override,
+ UINT32 *TableIndex)
{
- ACPI_TABLE_DESC *Tables;
- UINT32 TableCount;
+ UINT32 i;
+ ACPI_STATUS Status = AE_OK;
+ ACPI_TABLE_DESC NewTableDesc;
- ACPI_FUNCTION_TRACE (TbResizeRootTableList);
+ ACPI_FUNCTION_TRACE (TbInstallStandardTable);
- /* AllowResize flag is a parameter to AcpiInitializeTables */
+ /* Acquire a temporary table descriptor for validation */
- if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE))
+ Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags);
+ if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed"));
- return_ACPI_STATUS (AE_SUPPORT);
+ ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p",
+ ACPI_CAST_PTR (void, Address)));
+ return_ACPI_STATUS (Status);
}
- /* Increase the Table Array size */
-
- if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
- {
- TableCount = AcpiGbl_RootTableList.MaxTableCount;
- }
- else
+ /*
+ * Optionally do not load any SSDTs from the RSDT/XSDT. This can
+ * be useful for debugging ACPI problems on some machines.
+ */
+ if (!Reload &&
+ AcpiGbl_DisableSsdtTableInstall &&
+ ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT))
{
- TableCount = AcpiGbl_RootTableList.CurrentTableCount;
+ ACPI_INFO ((AE_INFO, "Ignoring installation of %4.4s at %p",
+ NewTableDesc.Signature.Ascii, ACPI_CAST_PTR (void, Address)));
+ goto ReleaseAndExit;
}
- Tables = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) *
- sizeof (ACPI_TABLE_DESC));
- if (!Tables)
+ /* Validate and verify a table before installation */
+
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
+ if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
- return_ACPI_STATUS (AE_NO_MEMORY);
+ goto ReleaseAndExit;
}
- /* Copy and free the previous table array */
-
- if (AcpiGbl_RootTableList.Tables)
+ if (Reload)
{
- ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables,
- (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC));
-
- if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ /*
+ * Validate the incoming table signature.
+ *
+ * 1) Originally, we checked the table signature for "SSDT" or "PSDT".
+ * 2) We added support for OEMx tables, signature "OEM".
+ * 3) Valid tables were encountered with a null signature, so we just
+ * gave up on validating the signature, (05/2008).
+ * 4) We encountered non-AML tables such as the MADT, which caused
+ * interpreter errors and kernel faults. So now, we once again allow
+ * only "SSDT", "OEMx", and now, also a null signature. (05/2011).
+ */
+ if ((NewTableDesc.Signature.Ascii[0] != 0x00) &&
+ (!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) &&
+ (ACPI_STRNCMP (NewTableDesc.Signature.Ascii, "OEM", 3)))
{
- ACPI_FREE (AcpiGbl_RootTableList.Tables);
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "Table has invalid signature [%4.4s] (0x%8.8X), "
+ "must be SSDT or OEMx",
+ AcpiUtValidAcpiName (NewTableDesc.Signature.Ascii) ?
+ NewTableDesc.Signature.Ascii : "????",
+ NewTableDesc.Signature.Integer));
+
+ Status = AE_BAD_SIGNATURE;
+ goto ReleaseAndExit;
}
- }
-
- AcpiGbl_RootTableList.Tables = Tables;
- AcpiGbl_RootTableList.MaxTableCount =
- TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
- AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
- return_ACPI_STATUS (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbStoreTable
- *
- * PARAMETERS: Address - Table address
- * Table - Table header
- * Length - Table length
- * Flags - flags
- *
- * RETURN: Status and table index.
- *
- * DESCRIPTION: Add an ACPI table to the global table list
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiTbStoreTable (
- ACPI_PHYSICAL_ADDRESS Address,
- ACPI_TABLE_HEADER *Table,
- UINT32 Length,
- UINT8 Flags,
- UINT32 *TableIndex)
-{
- ACPI_STATUS Status;
- ACPI_TABLE_DESC *NewTable;
+ /* Check if table is already registered */
+ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
+ {
+ /*
+ * Check for a table match on the entire table length,
+ * not just the header.
+ */
+ if (!AcpiTbCompareTables (&NewTableDesc, i))
+ {
+ continue;
+ }
- /* Ensure that there is room for the table in the Root Table List */
+ /*
+ * Note: the current mechanism does not unregister a table if it is
+ * dynamically unloaded. The related namespace entries are deleted,
+ * but the table remains in the root table list.
+ *
+ * The assumption here is that the number of different tables that
+ * will be loaded is actually small, and there is minimal overhead
+ * in just keeping the table in case it is needed again.
+ *
+ * If this assumption changes in the future (perhaps on large
+ * machines with many table load/unload operations), tables will
+ * need to be unregistered when they are unloaded, and slots in the
+ * root table list should be reused when empty.
+ */
+ if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED)
+ {
+ /* Table is still loaded, this is an error */
- if (AcpiGbl_RootTableList.CurrentTableCount >=
- AcpiGbl_RootTableList.MaxTableCount)
- {
- Status = AcpiTbResizeRootTableList();
- if (ACPI_FAILURE (Status))
- {
- return (Status);
+ Status = AE_ALREADY_EXISTS;
+ goto ReleaseAndExit;
+ }
+ else
+ {
+ /*
+ * Table was unloaded, allow it to be reloaded.
+ * As we are going to return AE_OK to the caller, we should
+ * take the responsibility of freeing the input descriptor.
+ * Refill the input descriptor to ensure
+ * AcpiTbInstallTableWithOverride() can be called again to
+ * indicate the re-installation.
+ */
+ AcpiTbUninstallTable (&NewTableDesc);
+ *TableIndex = i;
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (AE_OK);
+ }
}
}
- NewTable = &AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount];
-
- /* Initialize added table */
-
- NewTable->Address = Address;
- NewTable->Pointer = Table;
- NewTable->Length = Length;
- NewTable->OwnerId = 0;
- NewTable->Flags = Flags;
-
- ACPI_MOVE_32_TO_32 (&NewTable->Signature, Table->Signature);
-
- *TableIndex = AcpiGbl_RootTableList.CurrentTableCount;
- AcpiGbl_RootTableList.CurrentTableCount++;
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbDeleteTable
- *
- * PARAMETERS: TableIndex - Table index
- *
- * RETURN: None
- *
- * DESCRIPTION: Delete one internal ACPI table
- *
- ******************************************************************************/
-
-void
-AcpiTbDeleteTable (
- ACPI_TABLE_DESC *TableDesc)
-{
-
- /* Table must be mapped or allocated */
+ /* Add the table to the global root table list */
- if (!TableDesc->Pointer)
+ Status = AcpiTbGetNextRootIndex (&i);
+ if (ACPI_FAILURE (Status))
{
- return;
+ goto ReleaseAndExit;
}
- switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
- {
- case ACPI_TABLE_ORIGIN_MAPPED:
-
- AcpiOsUnmapMemory (TableDesc->Pointer, TableDesc->Length);
- break;
-
- case ACPI_TABLE_ORIGIN_ALLOCATED:
+ *TableIndex = i;
+ AcpiTbInstallTableWithOverride (i, &NewTableDesc, Override);
- ACPI_FREE (TableDesc->Pointer);
- break;
+ReleaseAndExit:
- /* Not mapped or allocated, there is nothing we can do */
+ /* Release the temporary table descriptor */
- default:
-
- return;
- }
-
- TableDesc->Pointer = NULL;
+ AcpiTbReleaseTempTable (&NewTableDesc);
+ return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbTerminate
+ * FUNCTION: AcpiTbOverrideTable
*
- * PARAMETERS: None
+ * PARAMETERS: OldTableDesc - Validated table descriptor to be
+ * overridden
*
* RETURN: None
*
- * DESCRIPTION: Delete all internal ACPI tables
+ * DESCRIPTION: Attempt table override by calling the OSL override functions.
+ * Note: If the table is overridden, then the entire new table
+ * is acquired and returned by this function.
+ * Before/after invocation, the table descriptor is in a state
+ * that is "VALIDATED".
*
******************************************************************************/
void
-AcpiTbTerminate (
- void)
+AcpiTbOverrideTable (
+ ACPI_TABLE_DESC *OldTableDesc)
{
- UINT32 i;
-
-
- ACPI_FUNCTION_TRACE (TbTerminate);
-
+ ACPI_STATUS Status;
+ char *OverrideType;
+ ACPI_TABLE_DESC NewTableDesc;
+ ACPI_TABLE_HEADER *Table;
+ ACPI_PHYSICAL_ADDRESS Address;
+ UINT32 Length;
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- /* Delete the individual tables */
+ /* (1) Attempt logical override (returns a logical address) */
- for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
+ Status = AcpiOsTableOverride (OldTableDesc->Pointer, &Table);
+ if (ACPI_SUCCESS (Status) && Table)
{
- AcpiTbDeleteTable (&AcpiGbl_RootTableList.Tables[i]);
+ AcpiTbAcquireTempTable (&NewTableDesc, ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);
+ OverrideType = "Logical";
+ goto FinishOverride;
}
- /*
- * Delete the root table array if allocated locally. Array cannot be
- * mapped, so we don't need to check for that flag.
- */
- if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ /* (2) Attempt physical override (returns a physical address) */
+
+ Status = AcpiOsPhysicalTableOverride (OldTableDesc->Pointer,
+ &Address, &Length);
+ if (ACPI_SUCCESS (Status) && Address && Length)
{
- ACPI_FREE (AcpiGbl_RootTableList.Tables);
+ AcpiTbAcquireTempTable (&NewTableDesc, Address,
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
+ OverrideType = "Physical";
+ goto FinishOverride;
}
- AcpiGbl_RootTableList.Tables = NULL;
- AcpiGbl_RootTableList.Flags = 0;
- AcpiGbl_RootTableList.CurrentTableCount = 0;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n"));
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
-
- return_VOID;
-}
-
+ return; /* There was no override */
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbDeleteNamespaceByOwner
- *
- * PARAMETERS: TableIndex - Table index
- *
- * RETURN: Status
- *
- * DESCRIPTION: Delete all namespace objects created when this table was loaded.
- *
- ******************************************************************************/
-ACPI_STATUS
-AcpiTbDeleteNamespaceByOwner (
- UINT32 TableIndex)
-{
- ACPI_OWNER_ID OwnerId;
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner);
+FinishOverride:
+ /* Validate and verify a table before overriding */
- Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ return;
}
- if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
- {
- /* The table index does not exist */
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (AE_NOT_EXIST);
- }
+ ACPI_INFO ((AE_INFO, "%4.4s " ACPI_PRINTF_UINT
+ " %s table override, new table: " ACPI_PRINTF_UINT,
+ OldTableDesc->Signature.Ascii,
+ ACPI_FORMAT_TO_UINT (OldTableDesc->Address),
+ OverrideType, ACPI_FORMAT_TO_UINT (NewTableDesc.Address)));
- /* Get the owner ID for this table, used to delete namespace nodes */
+ /* We can now uninstall the original table */
- OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ AcpiTbUninstallTable (OldTableDesc);
/*
- * Need to acquire the namespace writer lock to prevent interference
- * with any concurrent namespace walks. The interpreter must be
- * released during the deletion since the acquisition of the deletion
- * lock may block, and also since the execution of a namespace walk
- * must be allowed to use the interpreter.
+ * Replace the original table descriptor and keep its state as
+ * "VALIDATED".
*/
- (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
- Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock);
+ AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,
+ NewTableDesc.Flags, NewTableDesc.Pointer);
+ AcpiTbValidateTempTable (OldTableDesc);
- AcpiNsDeleteNamespaceByOwner (OwnerId);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
+ /* Release the temporary table descriptor */
- Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
- return_ACPI_STATUS (Status);
+ AcpiTbReleaseTempTable (&NewTableDesc);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbAllocateOwnerId
+ * FUNCTION: AcpiTbStoreTable
*
- * PARAMETERS: TableIndex - Table index
+ * PARAMETERS: Address - Table address
+ * Table - Table header
+ * Length - Table length
+ * Flags - Install flags
+ * TableIndex - Where the table index is returned
*
- * RETURN: Status
+ * RETURN: Status and table index.
*
- * DESCRIPTION: Allocates OwnerId in TableDesc
+ * DESCRIPTION: Add an ACPI table to the global table list
*
******************************************************************************/
ACPI_STATUS
-AcpiTbAllocateOwnerId (
- UINT32 TableIndex)
+AcpiTbStoreTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ ACPI_TABLE_HEADER *Table,
+ UINT32 Length,
+ UINT8 Flags,
+ UINT32 *TableIndex)
{
- ACPI_STATUS Status = AE_BAD_PARAMETER;
-
-
- ACPI_FUNCTION_TRACE (TbAllocateOwnerId);
+ ACPI_STATUS Status;
+ ACPI_TABLE_DESC *TableDesc;
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ Status = AcpiTbGetNextRootIndex (TableIndex);
+ if (ACPI_FAILURE (Status))
{
- Status = AcpiUtAllocateOwnerId
- (&(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
+ return (Status);
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbReleaseOwnerId
- *
- * PARAMETERS: TableIndex - Table index
- *
- * RETURN: Status
- *
- * DESCRIPTION: Releases OwnerId in TableDesc
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiTbReleaseOwnerId (
- UINT32 TableIndex)
-{
- ACPI_STATUS Status = AE_BAD_PARAMETER;
-
-
- ACPI_FUNCTION_TRACE (TbReleaseOwnerId);
-
-
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
- {
- AcpiUtReleaseOwnerId (
- &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
- Status = AE_OK;
- }
+ /* Initialize added table */
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
+ TableDesc = &AcpiGbl_RootTableList.Tables[*TableIndex];
+ AcpiTbInitTableDescriptor (TableDesc, Address, Flags, Table);
+ TableDesc->Pointer = Table;
+ return (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbGetOwnerId
+ * FUNCTION: AcpiTbUninstallTable
*
- * PARAMETERS: TableIndex - Table index
- * OwnerId - Where the table OwnerId is returned
+ * PARAMETERS: TableDesc - Table descriptor
*
- * RETURN: Status
+ * RETURN: None
*
- * DESCRIPTION: returns OwnerId for the ACPI table
+ * DESCRIPTION: Delete one internal ACPI table
*
******************************************************************************/
-ACPI_STATUS
-AcpiTbGetOwnerId (
- UINT32 TableIndex,
- ACPI_OWNER_ID *OwnerId)
+void
+AcpiTbUninstallTable (
+ ACPI_TABLE_DESC *TableDesc)
{
- ACPI_STATUS Status = AE_BAD_PARAMETER;
+ ACPI_FUNCTION_TRACE (TbUninstallTable);
- ACPI_FUNCTION_TRACE (TbGetOwnerId);
+ /* Table must be installed */
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ if (!TableDesc->Address)
{
- *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
- Status = AE_OK;
+ return_VOID;
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbIsTableLoaded
- *
- * PARAMETERS: TableIndex - Table index
- *
- * RETURN: Table Loaded Flag
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiTbIsTableLoaded (
- UINT32 TableIndex)
-{
- BOOLEAN IsLoaded = FALSE;
-
+ AcpiTbInvalidateTable (TableDesc);
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL)
{
- IsLoaded = (BOOLEAN)
- (AcpiGbl_RootTableList.Tables[TableIndex].Flags &
- ACPI_TABLE_IS_LOADED);
+ ACPI_FREE (ACPI_CAST_PTR (void, TableDesc->Address));
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return (IsLoaded);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbSetTableLoadedFlag
- *
- * PARAMETERS: TableIndex - Table index
- * IsLoaded - TRUE if table is loaded, FALSE otherwise
- *
- * RETURN: None
- *
- * DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE.
- *
- ******************************************************************************/
-
-void
-AcpiTbSetTableLoadedFlag (
- UINT32 TableIndex,
- BOOLEAN IsLoaded)
-{
-
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
- {
- if (IsLoaded)
- {
- AcpiGbl_RootTableList.Tables[TableIndex].Flags |=
- ACPI_TABLE_IS_LOADED;
- }
- else
- {
- AcpiGbl_RootTableList.Tables[TableIndex].Flags &=
- ~ACPI_TABLE_IS_LOADED;
- }
- }
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL);
+ return_VOID;
}
diff --git a/sys/contrib/dev/acpica/components/tables/tbprint.c b/sys/contrib/dev/acpica/components/tables/tbprint.c
index e85acce..00b6f1a 100644
--- a/sys/contrib/dev/acpica/components/tables/tbprint.c
+++ b/sys/contrib/dev/acpica/components/tables/tbprint.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -147,15 +147,17 @@ AcpiTbPrintTableHeader (
/*
- * The reason that the Address is cast to a void pointer is so that we
- * can use %p which will work properly on both 32-bit and 64-bit hosts.
+ * The reason that we use ACPI_PRINTF_UINT and ACPI_FORMAT_TO_UINT is to
+ * support both 32-bit and 64-bit hosts/addresses in a consistent manner.
+ * The %p specifier does not emit uniform output on all hosts. On some,
+ * leading zeros are not supported.
*/
if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS))
{
/* FACS only has signature and length fields */
- ACPI_INFO ((AE_INFO, "%4.4s %p %05X",
- Header->Signature, ACPI_CAST_PTR (void, Address),
+ ACPI_INFO ((AE_INFO, "%-4.4s " ACPI_PRINTF_UINT " %06X",
+ Header->Signature, ACPI_FORMAT_TO_UINT (Address),
Header->Length));
}
else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
@@ -166,8 +168,8 @@ AcpiTbPrintTableHeader (
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE);
AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
- ACPI_INFO ((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)",
- ACPI_CAST_PTR (void, Address),
+ ACPI_INFO ((AE_INFO, "RSDP " ACPI_PRINTF_UINT " %06X (v%.2d %-6.6s)",
+ ACPI_FORMAT_TO_UINT (Address),
(ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ?
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20,
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision,
@@ -180,8 +182,9 @@ AcpiTbPrintTableHeader (
AcpiTbCleanupTableHeader (&LocalHeader, Header);
ACPI_INFO ((AE_INFO,
- "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)",
- LocalHeader.Signature, ACPI_CAST_PTR (void, Address),
+ "%-4.4s " ACPI_PRINTF_UINT
+ " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
+ LocalHeader.Signature, ACPI_FORMAT_TO_UINT (Address),
LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
LocalHeader.OemTableId, LocalHeader.OemRevision,
LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
diff --git a/sys/contrib/dev/acpica/components/tables/tbutils.c b/sys/contrib/dev/acpica/components/tables/tbutils.c
index 5cc157d..e86e1d1 100644
--- a/sys/contrib/dev/acpica/components/tables/tbutils.c
+++ b/sys/contrib/dev/acpica/components/tables/tbutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -193,9 +193,12 @@ AcpiTbCopyDsdt (
}
ACPI_MEMCPY (NewTable, TableDesc->Pointer, TableDesc->Length);
- AcpiTbDeleteTable (TableDesc);
- TableDesc->Pointer = NewTable;
- TableDesc->Flags = ACPI_TABLE_ORIGIN_ALLOCATED;
+ AcpiTbUninstallTable (TableDesc);
+
+ AcpiTbInitTableDescriptor (
+ &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT],
+ ACPI_PTR_TO_PHYSADDR (NewTable), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
+ NewTable);
ACPI_INFO ((AE_INFO,
"Forced DSDT copy: length 0x%05X copied locally, original unmapped",
@@ -207,125 +210,6 @@ AcpiTbCopyDsdt (
/*******************************************************************************
*
- * FUNCTION: AcpiTbInstallTable
- *
- * PARAMETERS: Address - Physical address of DSDT or FACS
- * Signature - Table signature, NULL if no need to
- * match
- * TableIndex - Index into root table array
- *
- * RETURN: None
- *
- * DESCRIPTION: Install an ACPI table into the global data structure. The
- * table override mechanism is called to allow the host
- * OS to replace any table before it is installed in the root
- * table array.
- *
- ******************************************************************************/
-
-void
-AcpiTbInstallTable (
- ACPI_PHYSICAL_ADDRESS Address,
- char *Signature,
- UINT32 TableIndex)
-{
- ACPI_TABLE_HEADER *Table;
- ACPI_TABLE_HEADER *FinalTable;
- ACPI_TABLE_DESC *TableDesc;
-
-
- if (!Address)
- {
- ACPI_ERROR ((AE_INFO, "Null physical address for ACPI table [%s]",
- Signature));
- return;
- }
-
- /* Map just the table header */
-
- Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
- if (!Table)
- {
- ACPI_ERROR ((AE_INFO, "Could not map memory for table [%s] at %p",
- Signature, ACPI_CAST_PTR (void, Address)));
- return;
- }
-
- /* If a particular signature is expected (DSDT/FACS), it must match */
-
- if (Signature &&
- !ACPI_COMPARE_NAME (Table->Signature, Signature))
- {
- ACPI_BIOS_ERROR ((AE_INFO,
- "Invalid signature 0x%X for ACPI table, expected [%s]",
- *ACPI_CAST_PTR (UINT32, Table->Signature), Signature));
- goto UnmapAndExit;
- }
-
- /*
- * Initialize the table entry. Set the pointer to NULL, since the
- * table is not fully mapped at this time.
- */
- TableDesc = &AcpiGbl_RootTableList.Tables[TableIndex];
-
- TableDesc->Address = Address;
- TableDesc->Pointer = NULL;
- TableDesc->Length = Table->Length;
- TableDesc->Flags = ACPI_TABLE_ORIGIN_MAPPED;
- ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature);
-
- /*
- * ACPI Table Override:
- *
- * Before we install the table, let the host OS override it with a new
- * one if desired. Any table within the RSDT/XSDT can be replaced,
- * including the DSDT which is pointed to by the FADT.
- *
- * NOTE: If the table is overridden, then FinalTable will contain a
- * mapped pointer to the full new table. If the table is not overridden,
- * or if there has been a physical override, then the table will be
- * fully mapped later (in verify table). In any case, we must
- * unmap the header that was mapped above.
- */
- FinalTable = AcpiTbTableOverride (Table, TableDesc);
- if (!FinalTable)
- {
- FinalTable = Table; /* There was no override */
- }
-
- AcpiTbPrintTableHeader (TableDesc->Address, FinalTable);
-
- /* Set the global integer width (based upon revision of the DSDT) */
-
- if (TableIndex == ACPI_TABLE_INDEX_DSDT)
- {
- AcpiUtSetIntegerWidth (FinalTable->Revision);
- }
-
- /*
- * If we have a physical override during this early loading of the ACPI
- * tables, unmap the table for now. It will be mapped again later when
- * it is actually used. This supports very early loading of ACPI tables,
- * before virtual memory is fully initialized and running within the
- * host OS. Note: A logical override has the ACPI_TABLE_ORIGIN_OVERRIDE
- * flag set and will not be deleted below.
- */
- if (FinalTable != Table)
- {
- AcpiTbDeleteTable (TableDesc);
- }
-
-
-UnmapAndExit:
-
- /* Always unmap the table header that we mapped above */
-
- AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiTbGetRootTableEntry
*
* PARAMETERS: TableEntry - Pointer to the RSDT/XSDT table entry
@@ -353,7 +237,7 @@ AcpiTbGetRootTableEntry (
* Get the table physical address (32-bit for RSDT, 64-bit for XSDT):
* Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT
*/
- if (TableEntrySize == sizeof (UINT32))
+ if (TableEntrySize == ACPI_RSDT_ENTRY_SIZE)
{
/*
* 32-bit platform, RSDT: Return 32-bit table entry
@@ -416,14 +300,14 @@ AcpiTbParseRootTable (
UINT32 Length;
UINT8 *TableEntry;
ACPI_STATUS Status;
+ UINT32 TableIndex;
ACPI_FUNCTION_TRACE (TbParseRootTable);
- /*
- * Map the entire RSDP and extract the address of the RSDT or XSDT
- */
+ /* Map the entire RSDP and extract the address of the RSDT or XSDT */
+
Rsdp = AcpiOsMapMemory (RsdpAddress, sizeof (ACPI_TABLE_RSDP));
if (!Rsdp)
{
@@ -433,24 +317,26 @@ AcpiTbParseRootTable (
AcpiTbPrintTableHeader (RsdpAddress,
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Rsdp));
- /* Differentiate between RSDT and XSDT root tables */
+ /* Use XSDT if present and not overridden. Otherwise, use RSDT */
- if (Rsdp->Revision > 1 && Rsdp->XsdtPhysicalAddress)
+ if ((Rsdp->Revision > 1) &&
+ Rsdp->XsdtPhysicalAddress &&
+ !AcpiGbl_DoNotUseXsdt)
{
/*
- * Root table is an XSDT (64-bit physical addresses). We must use the
- * XSDT if the revision is > 1 and the XSDT pointer is present, as per
- * the ACPI specification.
+ * RSDP contains an XSDT (64-bit physical addresses). We must use
+ * the XSDT if the revision is > 1 and the XSDT pointer is present,
+ * as per the ACPI specification.
*/
Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->XsdtPhysicalAddress;
- TableEntrySize = sizeof (UINT64);
+ TableEntrySize = ACPI_XSDT_ENTRY_SIZE;
}
else
{
/* Root table is an RSDT (32-bit physical addresses) */
Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress;
- TableEntrySize = sizeof (UINT32);
+ TableEntrySize = ACPI_RSDT_ENTRY_SIZE;
}
/*
@@ -459,7 +345,6 @@ AcpiTbParseRootTable (
*/
AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP));
-
/* Map the RSDT/XSDT table header to get the full table length */
Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
@@ -470,12 +355,14 @@ AcpiTbParseRootTable (
AcpiTbPrintTableHeader (Address, Table);
- /* Get the length of the full table, verify length and map entire table */
-
+ /*
+ * Validate length of the table, and map entire table.
+ * Minimum length table must contain at least one entry.
+ */
Length = Table->Length;
AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
- if (Length < sizeof (ACPI_TABLE_HEADER))
+ if (Length < (sizeof (ACPI_TABLE_HEADER) + TableEntrySize))
{
ACPI_BIOS_ERROR ((AE_INFO,
"Invalid table length 0x%X in RSDT/XSDT", Length));
@@ -497,71 +384,50 @@ AcpiTbParseRootTable (
return_ACPI_STATUS (Status);
}
- /* Calculate the number of tables described in the root table */
+ /* Get the number of entries and pointer to first entry */
TableCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
TableEntrySize);
+ TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
/*
* First two entries in the table array are reserved for the DSDT
* and FACS, which are not actually present in the RSDT/XSDT - they
* come from the FADT
*/
- TableEntry = ACPI_CAST_PTR (UINT8, Table) + sizeof (ACPI_TABLE_HEADER);
AcpiGbl_RootTableList.CurrentTableCount = 2;
- /*
- * Initialize the root table array from the RSDT/XSDT
- */
+ /* Initialize the root table array from the RSDT/XSDT */
+
for (i = 0; i < TableCount; i++)
{
- if (AcpiGbl_RootTableList.CurrentTableCount >=
- AcpiGbl_RootTableList.MaxTableCount)
- {
- /* There is no more room in the root table array, attempt resize */
-
- Status = AcpiTbResizeRootTableList ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_WARNING ((AE_INFO, "Truncating %u table entries!",
- (unsigned) (TableCount -
- (AcpiGbl_RootTableList.CurrentTableCount - 2))));
- break;
- }
- }
-
/* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
- AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount].Address =
- AcpiTbGetRootTableEntry (TableEntry, TableEntrySize);
+ Address = AcpiTbGetRootTableEntry (TableEntry, TableEntrySize);
- TableEntry += TableEntrySize;
- AcpiGbl_RootTableList.CurrentTableCount++;
- }
-
- /*
- * It is not possible to map more than one entry in some environments,
- * so unmap the root table here before mapping other tables
- */
- AcpiOsUnmapMemory (Table, Length);
+ /* Skip NULL entries in RSDT/XSDT */
- /*
- * Complete the initialization of the root table array by examining
- * the header of each table
- */
- for (i = 2; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
- {
- AcpiTbInstallTable (AcpiGbl_RootTableList.Tables[i].Address,
- NULL, i);
+ if (!Address)
+ {
+ goto NextTable;
+ }
- /* Special case for FADT - get the DSDT and FACS */
+ Status = AcpiTbInstallStandardTable (Address,
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
- if (ACPI_COMPARE_NAME (
- &AcpiGbl_RootTableList.Tables[i].Signature, ACPI_SIG_FADT))
+ if (ACPI_SUCCESS (Status) &&
+ ACPI_COMPARE_NAME (&AcpiGbl_RootTableList.Tables[TableIndex].Signature,
+ ACPI_SIG_FADT))
{
- AcpiTbParseFadt (i);
+ AcpiTbParseFadt (TableIndex);
}
+
+NextTable:
+
+ TableEntry += TableEntrySize;
}
+ AcpiOsUnmapMemory (Table, Length);
+
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/tables/tbxface.c b/sys/contrib/dev/acpica/components/tables/tbxface.c
index 80381aa..126d9ca 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxface.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
*/
#define __TBXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -161,7 +162,7 @@ AcpiInitializeTables (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiInitializeTables)
+ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeTables)
/*******************************************************************************
@@ -204,7 +205,7 @@ AcpiReallocateRootTable (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiReallocateRootTable)
+ACPI_EXPORT_SYMBOL_INIT (AcpiReallocateRootTable)
/*******************************************************************************
@@ -261,7 +262,7 @@ AcpiGetTableHeader (
{
if ((AcpiGbl_RootTableList.Tables[i].Flags &
ACPI_TABLE_ORIGIN_MASK) ==
- ACPI_TABLE_ORIGIN_MAPPED)
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL)
{
Header = AcpiOsMapMemory (
AcpiGbl_RootTableList.Tables[i].Address,
@@ -344,7 +345,7 @@ AcpiGetTable (
continue;
}
- Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]);
if (ACPI_SUCCESS (Status))
{
*OutTable = AcpiGbl_RootTableList.Tables[i].Pointer;
@@ -405,7 +406,7 @@ AcpiGetTableByIndex (
{
/* Table is not mapped, map it */
- Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfload.c b/sys/contrib/dev/acpica/components/tables/tbxfload.c
index 171f74c..da34e3d 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfload.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
*/
#define __TBXFLOAD_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -92,7 +93,7 @@ AcpiLoadTables (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiLoadTables)
+ACPI_EXPORT_SYMBOL_INIT (AcpiLoadTables)
/*******************************************************************************
@@ -130,7 +131,7 @@ AcpiTbLoadNamespace (
!ACPI_COMPARE_NAME (
&(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature),
ACPI_SIG_DSDT) ||
- ACPI_FAILURE (AcpiTbVerifyTable (
+ ACPI_FAILURE (AcpiTbValidateTable (
&AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT])))
{
Status = AE_NO_ACPI_TABLES;
@@ -141,7 +142,7 @@ AcpiTbLoadNamespace (
* Save the DSDT pointer for simple access. This is the mapped memory
* address. We must take care here because the address of the .Tables
* array can change dynamically as tables are loaded at run-time. Note:
- * .Pointer field is not validated until after call to AcpiTbVerifyTable.
+ * .Pointer field is not validated until after call to AcpiTbValidateTable.
*/
AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer;
@@ -186,24 +187,12 @@ AcpiTbLoadNamespace (
ACPI_SIG_SSDT) &&
!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
ACPI_SIG_PSDT)) ||
- ACPI_FAILURE (AcpiTbVerifyTable (
+ ACPI_FAILURE (AcpiTbValidateTable (
&AcpiGbl_RootTableList.Tables[i])))
{
continue;
}
- /*
- * Optionally do not load any SSDTs from the RSDT/XSDT. This can
- * be useful for debugging ACPI problems on some machines.
- */
- if (AcpiGbl_DisableSsdtTableLoad)
- {
- ACPI_INFO ((AE_INFO, "Ignoring %4.4s at %p",
- AcpiGbl_RootTableList.Tables[i].Signature.Ascii,
- ACPI_CAST_PTR (void, AcpiGbl_RootTableList.Tables[i].Address)));
- continue;
- }
-
/* Ignore errors while loading tables, get as many as possible */
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
@@ -221,6 +210,53 @@ UnlockAndExit:
/*******************************************************************************
*
+ * FUNCTION: AcpiInstallTable
+ *
+ * PARAMETERS: Address - Address of the ACPI table to be installed.
+ * Physical - Whether the address is a physical table
+ * address or not
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Dynamically install an ACPI table.
+ * Note: This function should only be invoked after
+ * AcpiInitializeTables() and before AcpiLoadTables().
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInstallTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ BOOLEAN Physical)
+{
+ ACPI_STATUS Status;
+ UINT8 Flags;
+ UINT32 TableIndex;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInstallTable);
+
+
+ if (Physical)
+ {
+ Flags = ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL;
+ }
+ else
+ {
+ Flags = ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL;
+ }
+
+ Status = AcpiTbInstallStandardTable (Address, Flags,
+ FALSE, FALSE, &TableIndex);
+
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL_INIT (AcpiInstallTable)
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiLoadTable
*
* PARAMETERS: Table - Pointer to a buffer containing the ACPI
@@ -241,7 +277,6 @@ AcpiLoadTable (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
- ACPI_TABLE_DESC TableDesc;
UINT32 TableIndex;
@@ -255,14 +290,6 @@ AcpiLoadTable (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Init local table descriptor */
-
- ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC));
- TableDesc.Address = ACPI_PTR_TO_PHYSADDR (Table);
- TableDesc.Pointer = Table;
- TableDesc.Length = Table->Length;
- TableDesc.Flags = ACPI_TABLE_ORIGIN_UNKNOWN;
-
/* Must acquire the interpreter lock during this operation */
Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
@@ -274,7 +301,23 @@ AcpiLoadTable (
/* Install the table and load it into the namespace */
ACPI_INFO ((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));
- Status = AcpiTbAddTable (&TableDesc, &TableIndex);
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
+ Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, TRUE, FALSE,
+ &TableIndex);
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ if (ACPI_FAILURE (Status))
+ {
+ goto UnlockAndExit;
+ }
+
+ /*
+ * Note: Now table is "INSTALLED", it must be validated before
+ * using.
+ */
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfroot.c b/sys/contrib/dev/acpica/components/tables/tbxfroot.c
index 0b9fe72..885350ea2 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfroot.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfroot.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,43 @@
/*******************************************************************************
*
+ * FUNCTION: AcpiTbGetRsdpLength
+ *
+ * PARAMETERS: Rsdp - Pointer to RSDP
+ *
+ * RETURN: Table length
+ *
+ * DESCRIPTION: Get the length of the RSDP
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiTbGetRsdpLength (
+ ACPI_TABLE_RSDP *Rsdp)
+{
+
+ if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature))
+ {
+ /* BAD Signature */
+
+ return (0);
+ }
+
+ /* "Length" field is available if table version >= 2 */
+
+ if (Rsdp->Revision >= 2)
+ {
+ return (Rsdp->Length);
+ }
+ else
+ {
+ return (ACPI_RSDP_CHECKSUM_LENGTH);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiTbValidateRsdp
*
* PARAMETERS: Rsdp - Pointer to unvalidated RSDP
diff --git a/sys/contrib/dev/acpica/components/utilities/utaddress.c b/sys/contrib/dev/acpica/components/utilities/utaddress.c
index da8b046..77d3ece 100644
--- a/sys/contrib/dev/acpica/components/utilities/utaddress.c
+++ b/sys/contrib/dev/acpica/components/utilities/utaddress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -248,10 +248,11 @@ AcpiUtCheckAddressRange (
while (RangeInfo)
{
/*
- * Check if the requested Address/Length overlaps this AddressRange.
- * Four cases to consider:
+ * Check if the requested address/length overlaps this
+ * address range. There are four cases to consider:
*
- * 1) Input address/length is contained completely in the address range
+ * 1) Input address/length is contained completely in the
+ * address range
* 2) Input address/length overlaps range at the range start
* 3) Input address/length overlaps range at the range end
* 4) Input address/length completely encompasses the range
@@ -267,10 +268,13 @@ AcpiUtCheckAddressRange (
Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode);
ACPI_WARNING ((AE_INFO,
- "0x%p-0x%p %s conflicts with Region %s %d",
+ "%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)",
+ AcpiUtGetRegionName (SpaceId),
ACPI_CAST_PTR (void, Address),
ACPI_CAST_PTR (void, EndAddress),
- AcpiUtGetRegionName (SpaceId), Pathname, OverlapCount));
+ ACPI_CAST_PTR (void, RangeInfo->StartAddress),
+ ACPI_CAST_PTR (void, RangeInfo->EndAddress),
+ Pathname));
ACPI_FREE (Pathname);
}
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utalloc.c b/sys/contrib/dev/acpica/components/utilities/utalloc.c
index 0bdb2ff..70a8131 100644
--- a/sys/contrib/dev/acpica/components/utilities/utalloc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utalloc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,45 @@
ACPI_MODULE_NAME ("utalloc")
+#if !defined (USE_NATIVE_ALLOCATE_ZEROED)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsAllocateZeroed
+ *
+ * PARAMETERS: Size - Size of the allocation
+ *
+ * RETURN: Address of the allocated memory on success, NULL on failure.
+ *
+ * DESCRIPTION: Subsystem equivalent of calloc. Allocate and zero memory.
+ * This is the default implementation. Can be overridden via the
+ * USE_NATIVE_ALLOCATE_ZEROED flag.
+ *
+ ******************************************************************************/
+
+void *
+AcpiOsAllocateZeroed (
+ ACPI_SIZE Size)
+{
+ void *Allocation;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ Allocation = AcpiOsAllocate (Size);
+ if (Allocation)
+ {
+ /* Clear the memory block */
+
+ ACPI_MEMSET (Allocation, 0, Size);
+ }
+
+ return (Allocation);
+}
+
+#endif /* !USE_NATIVE_ALLOCATE_ZEROED */
+
+
/*******************************************************************************
*
* FUNCTION: AcpiUtCreateCaches
@@ -285,9 +324,13 @@ AcpiUtInitializeBuffer (
return (AE_BUFFER_OVERFLOW);
case ACPI_ALLOCATE_BUFFER:
-
- /* Allocate a new buffer */
-
+ /*
+ * Allocate a new buffer. We directectly call AcpiOsAllocate here to
+ * purposefully bypass the (optionally enabled) internal allocation
+ * tracking mechanism since we only want to track internal
+ * allocations. Note: The caller should use AcpiOsFree to free this
+ * buffer created via ACPI_ALLOCATE_BUFFER.
+ */
Buffer->Pointer = AcpiOsAllocate (RequiredLength);
break;
@@ -321,95 +364,3 @@ AcpiUtInitializeBuffer (
ACPI_MEMSET (Buffer->Pointer, 0, RequiredLength);
return (AE_OK);
}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtAllocate
- *
- * PARAMETERS: Size - Size of the allocation
- * Component - Component type of caller
- * Module - Source file name of caller
- * Line - Line number of caller
- *
- * RETURN: Address of the allocated memory on success, NULL on failure.
- *
- * DESCRIPTION: Subsystem equivalent of malloc.
- *
- ******************************************************************************/
-
-void *
-AcpiUtAllocate (
- ACPI_SIZE Size,
- UINT32 Component,
- const char *Module,
- UINT32 Line)
-{
- void *Allocation;
-
-
- ACPI_FUNCTION_TRACE_U32 (UtAllocate, Size);
-
-
- /* Check for an inadvertent size of zero bytes */
-
- if (!Size)
- {
- ACPI_WARNING ((Module, Line,
- "Attempt to allocate zero bytes, allocating 1 byte"));
- Size = 1;
- }
-
- Allocation = AcpiOsAllocate (Size);
- if (!Allocation)
- {
- /* Report allocation error */
-
- ACPI_WARNING ((Module, Line,
- "Could not allocate size %u", (UINT32) Size));
-
- return_PTR (NULL);
- }
-
- return_PTR (Allocation);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtAllocateZeroed
- *
- * PARAMETERS: Size - Size of the allocation
- * Component - Component type of caller
- * Module - Source file name of caller
- * Line - Line number of caller
- *
- * RETURN: Address of the allocated memory on success, NULL on failure.
- *
- * DESCRIPTION: Subsystem equivalent of calloc. Allocate and zero memory.
- *
- ******************************************************************************/
-
-void *
-AcpiUtAllocateZeroed (
- ACPI_SIZE Size,
- UINT32 Component,
- const char *Module,
- UINT32 Line)
-{
- void *Allocation;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- Allocation = AcpiUtAllocate (Size, Component, Module, Line);
- if (Allocation)
- {
- /* Clear the memory block */
-
- ACPI_MEMSET (Allocation, 0, Size);
- }
-
- return (Allocation);
-}
diff --git a/sys/contrib/dev/acpica/components/utilities/utbuffer.c b/sys/contrib/dev/acpica/components/utilities/utbuffer.c
index 508a940..ee7f9e5 100644
--- a/sys/contrib/dev/acpica/components/utilities/utbuffer.c
+++ b/sys/contrib/dev/acpica/components/utilities/utbuffer.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -218,3 +218,138 @@ AcpiUtDebugDumpBuffer (
AcpiUtDumpBuffer (Buffer, Count, Display, 0);
}
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtDumpBufferToFile
+ *
+ * PARAMETERS: File - File descriptor
+ * Buffer - Buffer to dump
+ * Count - Amount to dump, in bytes
+ * Display - BYTE, WORD, DWORD, or QWORD display:
+ * DB_BYTE_DISPLAY
+ * DB_WORD_DISPLAY
+ * DB_DWORD_DISPLAY
+ * DB_QWORD_DISPLAY
+ * BaseOffset - Beginning buffer offset (display only)
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Generic dump buffer in both hex and ascii to a file.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtDumpBufferToFile (
+ ACPI_FILE File,
+ UINT8 *Buffer,
+ UINT32 Count,
+ UINT32 Display,
+ UINT32 BaseOffset)
+{
+ UINT32 i = 0;
+ UINT32 j;
+ UINT32 Temp32;
+ UINT8 BufChar;
+
+
+ if (!Buffer)
+ {
+ AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n");
+ return;
+ }
+
+ if ((Count < 4) || (Count & 0x01))
+ {
+ Display = DB_BYTE_DISPLAY;
+ }
+
+ /* Nasty little dump buffer routine! */
+
+ while (i < Count)
+ {
+ /* Print current offset */
+
+ AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i));
+
+ /* Print 16 hex chars */
+
+ for (j = 0; j < 16;)
+ {
+ if (i + j >= Count)
+ {
+ /* Dump fill spaces */
+
+ AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " ");
+ j += Display;
+ continue;
+ }
+
+ switch (Display)
+ {
+ case DB_BYTE_DISPLAY:
+ default: /* Default is BYTE display */
+
+ AcpiUtFilePrintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
+ break;
+
+ case DB_WORD_DISPLAY:
+
+ ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%04X ", Temp32);
+ break;
+
+ case DB_DWORD_DISPLAY:
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%08X ", Temp32);
+ break;
+
+ case DB_QWORD_DISPLAY:
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%08X", Temp32);
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
+ AcpiUtFilePrintf (File, "%08X ", Temp32);
+ break;
+ }
+
+ j += Display;
+ }
+
+ /*
+ * Print the ASCII equivalent characters but watch out for the bad
+ * unprintable ones (printable chars are 0x20 through 0x7E)
+ */
+ AcpiUtFilePrintf (File, " ");
+ for (j = 0; j < 16; j++)
+ {
+ if (i + j >= Count)
+ {
+ AcpiUtFilePrintf (File, "\n");
+ return;
+ }
+
+ BufChar = Buffer[(ACPI_SIZE) i + j];
+ if (ACPI_IS_PRINT (BufChar))
+ {
+ AcpiUtFilePrintf (File, "%c", BufChar);
+ }
+ else
+ {
+ AcpiUtFilePrintf (File, ".");
+ }
+ }
+
+ /* Done with that line. */
+
+ AcpiUtFilePrintf (File, "\n");
+ i += 16;
+ }
+
+ return;
+}
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utcache.c b/sys/contrib/dev/acpica/components/utilities/utcache.c
index 2aa3e5b..f6c2d02 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcache.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcache.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -286,13 +286,13 @@ AcpiOsAcquireObject (
if (!Cache)
{
- return (NULL);
+ return_PTR (NULL);
}
Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
{
- return (NULL);
+ return_PTR (NULL);
}
ACPI_MEM_TRACKING (Cache->Requests++);
@@ -315,7 +315,7 @@ AcpiOsAcquireObject (
Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
{
- return (NULL);
+ return_PTR (NULL);
}
/* Clear (zero) the previously used Object */
@@ -340,16 +340,16 @@ AcpiOsAcquireObject (
Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
{
- return (NULL);
+ return_PTR (NULL);
}
Object = ACPI_ALLOCATE_ZEROED (Cache->ObjectSize);
if (!Object)
{
- return (NULL);
+ return_PTR (NULL);
}
}
- return (Object);
+ return_PTR (Object);
}
#endif /* ACPI_USE_LOCAL_CACHE */
diff --git a/sys/contrib/dev/acpica/components/utilities/utcopy.c b/sys/contrib/dev/acpica/components/utilities/utcopy.c
index dacbc5c..68e58dd 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcopy.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcopy.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -564,10 +564,10 @@ AcpiUtCopyEsimpleToIsimple (
case ACPI_TYPE_LOCAL_REFERENCE:
- /* TBD: should validate incoming handle */
+ /* An incoming reference is defined to be a namespace node */
- InternalObject->Reference.Class = ACPI_REFCLASS_NAME;
- InternalObject->Reference.Node = ExternalObject->Reference.Handle;
+ InternalObject->Reference.Class = ACPI_REFCLASS_REFOF;
+ InternalObject->Reference.Object = ExternalObject->Reference.Handle;
break;
default:
@@ -1063,5 +1063,12 @@ AcpiUtCopyIobjectToIobject (
Status = AcpiUtCopySimpleObject (SourceDesc, *DestDesc);
}
+ /* Delete the allocated object if copy failed */
+
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiUtRemoveReference(*DestDesc);
+ }
+
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utdebug.c b/sys/contrib/dev/acpica/components/utilities/utdebug.c
index 93c0361..33350ca 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdebug.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
*/
#define __UTDEBUG_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -210,6 +211,7 @@ AcpiDebugPrint (
}
AcpiGbl_PrevThreadId = ThreadId;
+ AcpiGbl_NestingLevel = 0;
}
/*
@@ -218,13 +220,22 @@ AcpiDebugPrint (
*/
AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber);
+#ifdef ACPI_APPLICATION
+ /*
+ * For AcpiExec/iASL only, emit the thread ID and nesting level.
+ * Note: nesting level is really only useful during a single-thread
+ * execution. Otherwise, multiple threads will keep resetting the
+ * level.
+ */
if (ACPI_LV_THREADS & AcpiDbgLevel)
{
AcpiOsPrintf ("[%u] ", (UINT32) ThreadId);
}
- AcpiOsPrintf ("[%02ld] %-22.22s: ",
- AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName));
+ AcpiOsPrintf ("[%02ld] ", AcpiGbl_NestingLevel);
+#endif
+
+ AcpiOsPrintf ("%-22.22s: ", AcpiUtTrimFunctionName (FunctionName));
va_start (args, Format);
AcpiOsVprintf (Format, args);
@@ -474,7 +485,10 @@ AcpiUtExit (
"%s\n", AcpiGbl_FnExitStr);
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtExit)
@@ -526,7 +540,10 @@ AcpiUtStatusExit (
}
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtStatusExit)
@@ -568,7 +585,10 @@ AcpiUtValueExit (
ACPI_FORMAT_UINT64 (Value));
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtValueExit)
@@ -609,7 +629,40 @@ AcpiUtPtrExit (
"%s %p\n", AcpiGbl_FnExitStr, Ptr);
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
+}
+
+#endif
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiLogError
+ *
+ * PARAMETERS: Format - Printf format field
+ * ... - Optional printf arguments
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print error message to the console, used by applications.
+ *
+ ******************************************************************************/
+
+void ACPI_INTERNAL_VAR_XFACE
+AcpiLogError (
+ const char *Format,
+ ...)
+{
+ va_list Args;
+
+ va_start (Args, Format);
+ (void) AcpiUtFileVprintf (ACPI_FILE_ERR, Format, Args);
+ va_end (Args);
}
+ACPI_EXPORT_SYMBOL (AcpiLogError)
#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utdecode.c b/sys/contrib/dev/acpica/components/utilities/utdecode.c
index 3075479..9fd5207 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdecode.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdecode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -93,38 +93,6 @@ const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
/*******************************************************************************
*
- * FUNCTION: AcpiUtHexToAsciiChar
- *
- * PARAMETERS: Integer - Contains the hex digit
- * Position - bit position of the digit within the
- * integer (multiple of 4)
- *
- * RETURN: The converted Ascii character
- *
- * DESCRIPTION: Convert a hex digit to an Ascii character
- *
- ******************************************************************************/
-
-/* Hex to ASCII conversion table */
-
-static const char AcpiGbl_HexToAscii[] =
-{
- '0','1','2','3','4','5','6','7',
- '8','9','A','B','C','D','E','F'
-};
-
-char
-AcpiUtHexToAsciiChar (
- UINT64 Integer,
- UINT32 Position)
-{
-
- return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiUtGetRegionName
*
* PARAMETERS: Space ID - ID for the region
@@ -527,7 +495,7 @@ AcpiUtGetMutexName (
/* Names for Notify() values, used for debug output */
-static const char *AcpiGbl_NotifyValueNames[ACPI_NOTIFY_MAX + 1] =
+static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] =
{
/* 00 */ "Bus Check",
/* 01 */ "Device Check",
@@ -539,32 +507,88 @@ static const char *AcpiGbl_NotifyValueNames[ACPI_NOTIFY_MAX + 1] =
/* 07 */ "Power Fault",
/* 08 */ "Capabilities Check",
/* 09 */ "Device PLD Check",
- /* 10 */ "Reserved",
- /* 11 */ "System Locality Update",
- /* 12 */ "Shutdown Request"
+ /* 0A */ "Reserved",
+ /* 0B */ "System Locality Update",
+ /* 0C */ "Shutdown Request",
+ /* 0D */ "System Resource Affinity Update"
+};
+
+static const char *AcpiGbl_DeviceNotify[4] =
+{
+ /* 80 */ "Status Change",
+ /* 81 */ "Information Change",
+ /* 82 */ "Device-Specific Change",
+ /* 83 */ "Device-Specific Change"
};
+static const char *AcpiGbl_ProcessorNotify[4] =
+{
+ /* 80 */ "Performance Capability Change",
+ /* 81 */ "C-State Change",
+ /* 82 */ "Throttling Capability Change",
+ /* 83 */ "Device-Specific Change"
+};
+
+static const char *AcpiGbl_ThermalNotify[4] =
+{
+ /* 80 */ "Thermal Status Change",
+ /* 81 */ "Thermal Trip Point Change",
+ /* 82 */ "Thermal Device List Change",
+ /* 83 */ "Thermal Relationship Change"
+};
+
+
const char *
AcpiUtGetNotifyName (
- UINT32 NotifyValue)
+ UINT32 NotifyValue,
+ ACPI_OBJECT_TYPE Type)
{
+ /* 00 - 0D are common to all object types */
+
if (NotifyValue <= ACPI_NOTIFY_MAX)
{
- return (AcpiGbl_NotifyValueNames[NotifyValue]);
+ return (AcpiGbl_GenericNotify[NotifyValue]);
}
- else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
+
+ /* 0D - 7F are reserved */
+
+ if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
return ("Reserved");
}
- else if (NotifyValue <= ACPI_MAX_DEVICE_SPECIFIC_NOTIFY)
+
+ /* 80 - 83 are per-object-type */
+
+ if (NotifyValue <= 0x83)
{
- return ("Device Specific");
+ switch (Type)
+ {
+ case ACPI_TYPE_ANY:
+ case ACPI_TYPE_DEVICE:
+ return (AcpiGbl_DeviceNotify [NotifyValue - 0x80]);
+
+ case ACPI_TYPE_PROCESSOR:
+ return (AcpiGbl_ProcessorNotify [NotifyValue - 0x80]);
+
+ case ACPI_TYPE_THERMAL:
+ return (AcpiGbl_ThermalNotify [NotifyValue - 0x80]);
+
+ default:
+ return ("Target object type does not support notifies");
+ }
}
- else
+
+ /* 84 - BF are device-specific */
+
+ if (NotifyValue <= ACPI_MAX_DEVICE_SPECIFIC_NOTIFY)
{
- return ("Hardware Specific");
+ return ("Device-Specific");
}
+
+ /* C0 and above are hardware-specific */
+
+ return ("Hardware-Specific");
}
#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utdelete.c b/sys/contrib/dev/acpica/components/utilities/utdelete.c
index 6f1f89b..60b456f 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdelete.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -86,6 +86,7 @@ AcpiUtDeleteInternalObj (
ACPI_OPERAND_OBJECT *HandlerDesc;
ACPI_OPERAND_OBJECT *SecondDesc;
ACPI_OPERAND_OBJECT *NextDesc;
+ ACPI_OPERAND_OBJECT *StartDesc;
ACPI_OPERAND_OBJECT **LastObjPtr;
@@ -250,9 +251,10 @@ AcpiUtDeleteInternalObj (
if (HandlerDesc)
{
NextDesc = HandlerDesc->AddressSpace.RegionList;
+ StartDesc = NextDesc;
LastObjPtr = &HandlerDesc->AddressSpace.RegionList;
- /* Remove the region object from the handler's list */
+ /* Remove the region object from the handler list */
while (NextDesc)
{
@@ -262,10 +264,20 @@ AcpiUtDeleteInternalObj (
break;
}
- /* Walk the linked list of handler */
+ /* Walk the linked list of handlers */
LastObjPtr = &NextDesc->Region.Next;
NextDesc = NextDesc->Region.Next;
+
+ /* Prevent infinite loop if list is corrupted */
+
+ if (NextDesc == StartDesc)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Circular region list in address handler object %p",
+ HandlerDesc));
+ return_VOID;
+ }
}
if (HandlerDesc->AddressSpace.HandlerFlags &
diff --git a/sys/contrib/dev/acpica/components/utilities/uterror.c b/sys/contrib/dev/acpica/components/utilities/uterror.c
index b7aef18..3c62b62 100644
--- a/sys/contrib/dev/acpica/components/utilities/uterror.c
+++ b/sys/contrib/dev/acpica/components/utilities/uterror.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/uteval.c b/sys/contrib/dev/acpica/components/utilities/uteval.c
index ba4d6ee..a693c84 100644
--- a/sys/contrib/dev/acpica/components/utilities/uteval.c
+++ b/sys/contrib/dev/acpica/components/utilities/uteval.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utexcep.c b/sys/contrib/dev/acpica/components/utilities/utexcep.c
index d69dbf0..c7f7b9c 100644
--- a/sys/contrib/dev/acpica/components/utilities/utexcep.c
+++ b/sys/contrib/dev/acpica/components/utilities/utexcep.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTEXCEP_C__
+#define EXPORT_ACPI_INTERFACES
#define ACPI_DEFINE_EXCEPTION_TABLE
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utfileio.c b/sys/contrib/dev/acpica/components/utilities/utfileio.c
new file mode 100644
index 0000000..936fa6f
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/utfileio.c
@@ -0,0 +1,361 @@
+/*******************************************************************************
+ *
+ * Module Name: utfileio - simple file I/O routines
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/actables.h>
+#include <contrib/dev/acpica/include/acapps.h>
+
+#ifdef ACPI_ASL_COMPILER
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#endif
+
+
+#define _COMPONENT ACPI_CA_DEBUGGER
+ ACPI_MODULE_NAME ("utfileio")
+
+
+#ifdef ACPI_APPLICATION
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiUtCheckTextModeCorruption (
+ UINT8 *Table,
+ UINT32 TableLength,
+ UINT32 FileLength);
+
+static ACPI_STATUS
+AcpiUtReadTable (
+ FILE *fp,
+ ACPI_TABLE_HEADER **Table,
+ UINT32 *TableLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtCheckTextModeCorruption
+ *
+ * PARAMETERS: Table - Table buffer
+ * TableLength - Length of table from the table header
+ * FileLength - Length of the file that contains the table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Check table for text mode file corruption where all linefeed
+ * characters (LF) have been replaced by carriage return linefeed
+ * pairs (CR/LF).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtCheckTextModeCorruption (
+ UINT8 *Table,
+ UINT32 TableLength,
+ UINT32 FileLength)
+{
+ UINT32 i;
+ UINT32 Pairs = 0;
+
+
+ if (TableLength != FileLength)
+ {
+ ACPI_WARNING ((AE_INFO,
+ "File length (0x%X) is not the same as the table length (0x%X)",
+ FileLength, TableLength));
+ }
+
+ /* Scan entire table to determine if each LF has been prefixed with a CR */
+
+ for (i = 1; i < FileLength; i++)
+ {
+ if (Table[i] == 0x0A)
+ {
+ if (Table[i - 1] != 0x0D)
+ {
+ /* The LF does not have a preceding CR, table not corrupted */
+
+ return (AE_OK);
+ }
+ else
+ {
+ /* Found a CR/LF pair */
+
+ Pairs++;
+ }
+ i++;
+ }
+ }
+
+ if (!Pairs)
+ {
+ return (AE_OK);
+ }
+
+ /*
+ * Entire table scanned, each CR is part of a CR/LF pair --
+ * meaning that the table was treated as a text file somewhere.
+ *
+ * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
+ * original table are left untouched by the text conversion process --
+ * meaning that we cannot simply replace CR/LF pairs with LFs.
+ */
+ AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
+ AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
+ AcpiOsPrintf ("Table cannot be repaired!\n");
+ return (AE_BAD_VALUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadTable
+ *
+ * PARAMETERS: fp - File that contains table
+ * Table - Return value, buffer with table
+ * TableLength - Return value, length of table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Load the DSDT from the file pointer
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtReadTable (
+ FILE *fp,
+ ACPI_TABLE_HEADER **Table,
+ UINT32 *TableLength)
+{
+ ACPI_TABLE_HEADER TableHeader;
+ UINT32 Actual;
+ ACPI_STATUS Status;
+ UINT32 FileSize;
+ BOOLEAN StandardHeader = TRUE;
+ INT32 Count;
+
+ /* Get the file size */
+
+ FileSize = CmGetFileSize (fp);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ return (AE_ERROR);
+ }
+
+ if (FileSize < 4)
+ {
+ return (AE_BAD_HEADER);
+ }
+
+ /* Read the signature */
+
+ fseek (fp, 0, SEEK_SET);
+
+ Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp);
+ if (Count != sizeof (ACPI_TABLE_HEADER))
+ {
+ AcpiOsPrintf ("Could not read the table header\n");
+ return (AE_BAD_HEADER);
+ }
+
+ /* The RSDP table does not have standard ACPI header */
+
+ if (ACPI_VALIDATE_RSDP_SIG (TableHeader.Signature))
+ {
+ *TableLength = FileSize;
+ StandardHeader = FALSE;
+ }
+ else
+ {
+
+#if 0
+ /* Validate the table header/length */
+
+ Status = AcpiTbValidateTableHeader (&TableHeader);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Table header is invalid!\n");
+ return (Status);
+ }
+#endif
+
+ /* File size must be at least as long as the Header-specified length */
+
+ if (TableHeader.Length > FileSize)
+ {
+ AcpiOsPrintf (
+ "TableHeader length [0x%X] greater than the input file size [0x%X]\n",
+ TableHeader.Length, FileSize);
+
+#ifdef ACPI_ASL_COMPILER
+ Status = FlCheckForAscii (fp, NULL, FALSE);
+ if (ACPI_SUCCESS (Status))
+ {
+ AcpiOsPrintf ("File appears to be ASCII only, must be binary\n");
+ }
+#endif
+ return (AE_BAD_HEADER);
+ }
+
+#ifdef ACPI_OBSOLETE_CODE
+ /* We only support a limited number of table types */
+
+ if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) &&
+ !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) &&
+ !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT))
+ {
+ AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n",
+ (char *) TableHeader.Signature);
+ ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER));
+ return (AE_ERROR);
+ }
+#endif
+
+ *TableLength = TableHeader.Length;
+ }
+
+ /* Allocate a buffer for the table */
+
+ *Table = AcpiOsAllocate ((size_t) FileSize);
+ if (!*Table)
+ {
+ AcpiOsPrintf (
+ "Could not allocate memory for ACPI table %4.4s (size=0x%X)\n",
+ TableHeader.Signature, *TableLength);
+ return (AE_NO_MEMORY);
+ }
+
+ /* Get the rest of the table */
+
+ fseek (fp, 0, SEEK_SET);
+ Actual = fread (*Table, 1, (size_t) FileSize, fp);
+ if (Actual == FileSize)
+ {
+ if (StandardHeader)
+ {
+ /* Now validate the checksum */
+
+ Status = AcpiTbVerifyChecksum ((void *) *Table,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
+
+ if (Status == AE_BAD_CHECKSUM)
+ {
+ Status = AcpiUtCheckTextModeCorruption ((UINT8 *) *Table,
+ FileSize, (*Table)->Length);
+ return (Status);
+ }
+ }
+ return (AE_OK);
+ }
+
+ if (Actual > 0)
+ {
+ AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n",
+ FileSize, Actual);
+ return (AE_OK);
+ }
+
+ AcpiOsPrintf ("Error - could not read the table file\n");
+ AcpiOsFree (*Table);
+ *Table = NULL;
+ *TableLength = 0;
+ return (AE_ERROR);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadTableFromFile
+ *
+ * PARAMETERS: Filename - File where table is located
+ * Table - Where a pointer to the table is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get an ACPI table from a file
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtReadTableFromFile (
+ char *Filename,
+ ACPI_TABLE_HEADER **Table)
+{
+ FILE *File;
+ UINT32 FileSize;
+ UINT32 TableLength;
+ ACPI_STATUS Status = AE_ERROR;
+
+
+ /* Open the file, get current size */
+
+ File = fopen (Filename, "rb");
+ if (!File)
+ {
+ perror ("Could not open input file");
+ return (Status);
+ }
+
+ FileSize = CmGetFileSize (File);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ goto Exit;
+ }
+
+ /* Get the entire file */
+
+ fprintf (stderr, "Loading Acpi table from file %10s - Length %.8u (%06X)\n",
+ Filename, FileSize, FileSize);
+
+ Status = AcpiUtReadTable (File, Table, &TableLength);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not get table from the file\n");
+ }
+
+Exit:
+ fclose(File);
+ return (Status);
+}
+
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utglobal.c b/sys/contrib/dev/acpica/components/utilities/utglobal.c
index 6233a4a..00aa777 100644
--- a/sys/contrib/dev/acpica/components/utilities/utglobal.c
+++ b/sys/contrib/dev/acpica/components/utilities/utglobal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
*/
#define __UTGLOBAL_C__
+#define EXPORT_ACPI_INTERFACES
#define DEFINE_ACPI_GLOBALS
#include <contrib/dev/acpica/include/acpi.h>
@@ -57,37 +58,7 @@
*
******************************************************************************/
-/*
- * We want the debug switches statically initialized so they
- * are already set when the debugger is entered.
- */
-
-/* Debug switch - level and trace mask */
-
-#ifdef ACPI_DEBUG_OUTPUT
-UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
-#else
-UINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT;
-#endif
-
-/* Debug switch - layer (component) mask */
-
-UINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT;
-UINT32 AcpiGbl_NestingLevel = 0;
-
-/* Debugger globals */
-
-BOOLEAN AcpiGbl_DbTerminateThreads = FALSE;
-BOOLEAN AcpiGbl_AbortMethod = FALSE;
-BOOLEAN AcpiGbl_MethodExecuting = FALSE;
-
-/* System flags */
-
-UINT32 AcpiGbl_StartupFlags = 0;
-
-/* System starts uninitialized */
-
-BOOLEAN AcpiGbl_Shutdown = TRUE;
+/* Various state name strings */
const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
{
@@ -202,163 +173,6 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
};
#endif /* !ACPI_REDUCED_HARDWARE */
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtInitGlobals
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
- * initialization should be initialized here. This allows for
- * a warm restart.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtInitGlobals (
- void)
-{
- ACPI_STATUS Status;
- UINT32 i;
-
-
- ACPI_FUNCTION_TRACE (UtInitGlobals);
-
-
- /* Create all memory caches */
-
- Status = AcpiUtCreateCaches ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Address Range lists */
-
- for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
- {
- AcpiGbl_AddressRangeList[i] = NULL;
- }
-
- /* Mutex locked flags */
-
- for (i = 0; i < ACPI_NUM_MUTEX; i++)
- {
- AcpiGbl_MutexInfo[i].Mutex = NULL;
- AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
- AcpiGbl_MutexInfo[i].UseCount = 0;
- }
-
- for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
- {
- AcpiGbl_OwnerIdMask[i] = 0;
- }
-
- /* Last OwnerID is never valid */
-
- AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
-
- /* Event counters */
-
- AcpiMethodCount = 0;
- AcpiSciCount = 0;
- AcpiGpeCount = 0;
-
- for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
- {
- AcpiFixedEventCount[i] = 0;
- }
-
-#if (!ACPI_REDUCED_HARDWARE)
-
- /* GPE/SCI support */
-
- AcpiGbl_AllGpesInitialized = FALSE;
- AcpiGbl_GpeXruptListHead = NULL;
- AcpiGbl_GpeFadtBlocks[0] = NULL;
- AcpiGbl_GpeFadtBlocks[1] = NULL;
- AcpiCurrentGpeCount = 0;
-
- AcpiGbl_GlobalEventHandler = NULL;
- AcpiGbl_SciHandlerList = NULL;
-
-#endif /* !ACPI_REDUCED_HARDWARE */
-
- /* Global handlers */
-
- AcpiGbl_GlobalNotify[0].Handler = NULL;
- AcpiGbl_GlobalNotify[1].Handler = NULL;
- AcpiGbl_ExceptionHandler = NULL;
- AcpiGbl_InitHandler = NULL;
- AcpiGbl_TableHandler = NULL;
- AcpiGbl_InterfaceHandler = NULL;
-
- /* Global Lock support */
-
- AcpiGbl_GlobalLockSemaphore = NULL;
- AcpiGbl_GlobalLockMutex = NULL;
- AcpiGbl_GlobalLockAcquired = FALSE;
- AcpiGbl_GlobalLockHandle = 0;
- AcpiGbl_GlobalLockPresent = FALSE;
-
- /* Miscellaneous variables */
-
- AcpiGbl_DSDT = NULL;
- AcpiGbl_CmSingleStep = FALSE;
- AcpiGbl_DbTerminateThreads = FALSE;
- AcpiGbl_Shutdown = FALSE;
- AcpiGbl_NsLookupCount = 0;
- AcpiGbl_PsFindCount = 0;
- AcpiGbl_AcpiHardwarePresent = TRUE;
- AcpiGbl_LastOwnerIdIndex = 0;
- AcpiGbl_NextOwnerIdOffset = 0;
- AcpiGbl_TraceMethodName = 0;
- AcpiGbl_TraceDbgLevel = 0;
- AcpiGbl_TraceDbgLayer = 0;
- AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
- AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
- AcpiGbl_OsiMutex = NULL;
- AcpiGbl_RegMethodsExecuted = FALSE;
-
- /* Hardware oriented */
-
- AcpiGbl_EventsInitialized = FALSE;
- AcpiGbl_SystemAwakeAndRunning = TRUE;
-
- /* Namespace */
-
- AcpiGbl_ModuleCodeList = NULL;
- AcpiGbl_RootNode = NULL;
- AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
- AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
- AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
- AcpiGbl_RootNodeStruct.Parent = NULL;
- AcpiGbl_RootNodeStruct.Child = NULL;
- AcpiGbl_RootNodeStruct.Peer = NULL;
- AcpiGbl_RootNodeStruct.Object = NULL;
-
-
-#ifdef ACPI_DISASSEMBLER
- AcpiGbl_ExternalList = NULL;
- AcpiGbl_NumExternalMethods = 0;
- AcpiGbl_ResolvedExternalMethods = 0;
-#endif
-
-#ifdef ACPI_DEBUG_OUTPUT
- AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
-#endif
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
- AcpiGbl_DisplayFinalMemStats = FALSE;
- AcpiGbl_DisableMemTracking = FALSE;
-#endif
-
- return_ACPI_STATUS (AE_OK);
-}
-
/* Public globals */
ACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
diff --git a/sys/contrib/dev/acpica/components/utilities/uthex.c b/sys/contrib/dev/acpica/components/utilities/uthex.c
new file mode 100644
index 0000000..8003231
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/uthex.c
@@ -0,0 +1,113 @@
+/******************************************************************************
+ *
+ * Module Name: uthex -- Hex/ASCII support functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#define __UTHEX_C__
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("uthex")
+
+
+/* Hex to ASCII conversion table */
+
+static char AcpiGbl_HexToAscii[] =
+{
+ '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtHexToAsciiChar
+ *
+ * PARAMETERS: Integer - Contains the hex digit
+ * Position - bit position of the digit within the
+ * integer (multiple of 4)
+ *
+ * RETURN: The converted Ascii character
+ *
+ * DESCRIPTION: Convert a hex digit to an Ascii character
+ *
+ ******************************************************************************/
+
+char
+AcpiUtHexToAsciiChar (
+ UINT64 Integer,
+ UINT32 Position)
+{
+
+ return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtHexCharToValue
+ *
+ * PARAMETERS: AsciiChar - Hex character in Ascii
+ *
+ * RETURN: The binary value of the ascii/hex character
+ *
+ * DESCRIPTION: Perform ascii-to-hex translation
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiUtAsciiCharToHex (
+ int HexChar)
+{
+
+ if (HexChar <= 0x39)
+ {
+ return ((UINT8) (HexChar - 0x30));
+ }
+
+ if (HexChar <= 0x46)
+ {
+ return ((UINT8) (HexChar - 0x37));
+ }
+
+ return ((UINT8) (HexChar - 0x57));
+}
diff --git a/sys/contrib/dev/acpica/components/utilities/utids.c b/sys/contrib/dev/acpica/components/utilities/utids.c
index b001767..ca2a372 100644
--- a/sys/contrib/dev/acpica/components/utilities/utids.c
+++ b/sys/contrib/dev/acpica/components/utilities/utids.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utinit.c b/sys/contrib/dev/acpica/components/utilities/utinit.c
index 760d789..6a07ef6 100644
--- a/sys/contrib/dev/acpica/components/utilities/utinit.c
+++ b/sys/contrib/dev/acpica/components/utilities/utinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTINIT_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -116,6 +115,162 @@ AcpiUtFreeGpeLists (
#endif /* !ACPI_REDUCED_HARDWARE */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtInitGlobals
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
+ * initialization should be initialized here. This allows for
+ * a warm restart.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtInitGlobals (
+ void)
+{
+ ACPI_STATUS Status;
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (UtInitGlobals);
+
+
+ /* Create all memory caches */
+
+ Status = AcpiUtCreateCaches ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Address Range lists */
+
+ for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
+ {
+ AcpiGbl_AddressRangeList[i] = NULL;
+ }
+
+ /* Mutex locked flags */
+
+ for (i = 0; i < ACPI_NUM_MUTEX; i++)
+ {
+ AcpiGbl_MutexInfo[i].Mutex = NULL;
+ AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
+ AcpiGbl_MutexInfo[i].UseCount = 0;
+ }
+
+ for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
+ {
+ AcpiGbl_OwnerIdMask[i] = 0;
+ }
+
+ /* Last OwnerID is never valid */
+
+ AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
+
+ /* Event counters */
+
+ AcpiMethodCount = 0;
+ AcpiSciCount = 0;
+ AcpiGpeCount = 0;
+
+ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
+ {
+ AcpiFixedEventCount[i] = 0;
+ }
+
+#if (!ACPI_REDUCED_HARDWARE)
+
+ /* GPE/SCI support */
+
+ AcpiGbl_AllGpesInitialized = FALSE;
+ AcpiGbl_GpeXruptListHead = NULL;
+ AcpiGbl_GpeFadtBlocks[0] = NULL;
+ AcpiGbl_GpeFadtBlocks[1] = NULL;
+ AcpiCurrentGpeCount = 0;
+
+ AcpiGbl_GlobalEventHandler = NULL;
+ AcpiGbl_SciHandlerList = NULL;
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+ /* Global handlers */
+
+ AcpiGbl_GlobalNotify[0].Handler = NULL;
+ AcpiGbl_GlobalNotify[1].Handler = NULL;
+ AcpiGbl_ExceptionHandler = NULL;
+ AcpiGbl_InitHandler = NULL;
+ AcpiGbl_TableHandler = NULL;
+ AcpiGbl_InterfaceHandler = NULL;
+
+ /* Global Lock support */
+
+ AcpiGbl_GlobalLockSemaphore = NULL;
+ AcpiGbl_GlobalLockMutex = NULL;
+ AcpiGbl_GlobalLockAcquired = FALSE;
+ AcpiGbl_GlobalLockHandle = 0;
+ AcpiGbl_GlobalLockPresent = FALSE;
+
+ /* Miscellaneous variables */
+
+ AcpiGbl_DSDT = NULL;
+ AcpiGbl_CmSingleStep = FALSE;
+ AcpiGbl_Shutdown = FALSE;
+ AcpiGbl_NsLookupCount = 0;
+ AcpiGbl_PsFindCount = 0;
+ AcpiGbl_AcpiHardwarePresent = TRUE;
+ AcpiGbl_LastOwnerIdIndex = 0;
+ AcpiGbl_NextOwnerIdOffset = 0;
+ AcpiGbl_TraceDbgLevel = 0;
+ AcpiGbl_TraceDbgLayer = 0;
+ AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
+ AcpiGbl_OsiMutex = NULL;
+ AcpiGbl_RegMethodsExecuted = FALSE;
+
+ /* Hardware oriented */
+
+ AcpiGbl_EventsInitialized = FALSE;
+ AcpiGbl_SystemAwakeAndRunning = TRUE;
+
+ /* Namespace */
+
+ AcpiGbl_ModuleCodeList = NULL;
+ AcpiGbl_RootNode = NULL;
+ AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
+ AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
+ AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
+ AcpiGbl_RootNodeStruct.Parent = NULL;
+ AcpiGbl_RootNodeStruct.Child = NULL;
+ AcpiGbl_RootNodeStruct.Peer = NULL;
+ AcpiGbl_RootNodeStruct.Object = NULL;
+
+
+#ifdef ACPI_DISASSEMBLER
+ AcpiGbl_ExternalList = NULL;
+ AcpiGbl_NumExternalMethods = 0;
+ AcpiGbl_ResolvedExternalMethods = 0;
+#endif
+
+#ifdef ACPI_DEBUG_OUTPUT
+ AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
+#endif
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+ AcpiGbl_DisplayFinalMemStats = FALSE;
+ AcpiGbl_DisableMemTracking = FALSE;
+#endif
+
+ ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = FALSE);
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: AcpiUtTerminate
diff --git a/sys/contrib/dev/acpica/components/utilities/utlock.c b/sys/contrib/dev/acpica/components/utilities/utlock.c
index da933c2..626a46f 100644
--- a/sys/contrib/dev/acpica/components/utilities/utlock.c
+++ b/sys/contrib/dev/acpica/components/utilities/utlock.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utmath.c b/sys/contrib/dev/acpica/components/utilities/utmath.c
index b535ffc..c653179 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmath.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmath.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTMATH_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utmisc.c b/sys/contrib/dev/acpica/components/utilities/utmisc.c
index 6ff6b2a..356b0ce 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmisc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmisc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTMISC_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utmutex.c b/sys/contrib/dev/acpica/components/utilities/utmutex.c
index 260f2b5..546adab 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmutex.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTMUTEX_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utobject.c b/sys/contrib/dev/acpica/components/utilities/utobject.c
index 46c3514..398fae5 100644
--- a/sys/contrib/dev/acpica/components/utilities/utobject.c
+++ b/sys/contrib/dev/acpica/components/utilities/utobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -400,7 +400,7 @@ AcpiUtValidInternalObject (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "%p is not not an ACPI operand obj [%s]\n",
+ "%p is not an ACPI operand obj [%s]\n",
Object, AcpiUtGetDescriptorName (Object)));
break;
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utosi.c b/sys/contrib/dev/acpica/components/utilities/utosi.c
index 9cf5765..6b61871 100644
--- a/sys/contrib/dev/acpica/components/utilities/utosi.c
+++ b/sys/contrib/dev/acpica/components/utilities/utosi.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,34 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utosi")
+
+/******************************************************************************
+ *
+ * ACPICA policy for new _OSI strings:
+ *
+ * It is the stated policy of ACPICA that new _OSI strings will be integrated
+ * into this module as soon as possible after they are defined. It is strongly
+ * recommended that all ACPICA hosts mirror this policy and integrate any
+ * changes to this module as soon as possible. There are several historical
+ * reasons behind this policy:
+ *
+ * 1) New BIOSs tend to test only the case where the host responds TRUE to
+ * the latest version of Windows, which would respond to the latest/newest
+ * _OSI string. Not responding TRUE to the latest version of Windows will
+ * risk executing untested code paths throughout the DSDT and SSDTs.
+ *
+ * 2) If a new _OSI string is recognized only after a significant delay, this
+ * has the potential to cause problems on existing working machines because
+ * of the possibility that a new and different path through the ASL code
+ * will be executed.
+ *
+ * 3) New _OSI strings are tending to come out about once per year. A delay
+ * in recognizing a new string for a significant amount of time risks the
+ * release of another string which only compounds the initial problem.
+ *
+ *****************************************************************************/
+
+
/*
* Strings supported by the _OSI predefined control method (which is
* implemented internally within this module.)
@@ -78,6 +106,7 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
{"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */
+ {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
/* Feature Group Strings */
diff --git a/sys/contrib/dev/acpica/components/utilities/utownerid.c b/sys/contrib/dev/acpica/components/utilities/utownerid.c
index 74f4d83..70919fb 100644
--- a/sys/contrib/dev/acpica/components/utilities/utownerid.c
+++ b/sys/contrib/dev/acpica/components/utilities/utownerid.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTOWNERID_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utpredef.c b/sys/contrib/dev/acpica/components/utilities/utpredef.c
index 8864120..9dcbd54 100644
--- a/sys/contrib/dev/acpica/components/utilities/utpredef.c
+++ b/sys/contrib/dev/acpica/components/utilities/utpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utprint.c b/sys/contrib/dev/acpica/components/utilities/utprint.c
new file mode 100644
index 0000000..0c99079
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/utprint.c
@@ -0,0 +1,811 @@
+/******************************************************************************
+ *
+ * Module Name: utprint - Formatted printing routines
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utprint")
+
+
+#define ACPI_FORMAT_SIGN 0x01
+#define ACPI_FORMAT_SIGN_PLUS 0x02
+#define ACPI_FORMAT_SIGN_PLUS_SPACE 0x04
+#define ACPI_FORMAT_ZERO 0x08
+#define ACPI_FORMAT_LEFT 0x10
+#define ACPI_FORMAT_UPPER 0x20
+#define ACPI_FORMAT_PREFIX 0x40
+
+
+/* Local prototypes */
+
+static ACPI_SIZE
+AcpiUtBoundStringLength (
+ const char *String,
+ ACPI_SIZE Count);
+
+static char *
+AcpiUtBoundStringOutput (
+ char *String,
+ const char *End,
+ char c);
+
+static char *
+AcpiUtFormatNumber (
+ char *String,
+ char *End,
+ UINT64 Number,
+ UINT8 Base,
+ INT32 Width,
+ INT32 Precision,
+ UINT8 Type);
+
+static char *
+AcpiUtPutNumber (
+ char *String,
+ UINT64 Number,
+ UINT8 Base,
+ BOOLEAN Upper);
+
+
+/* Module globals */
+
+static const char AcpiGbl_LowerHexDigits[] = "0123456789abcdef";
+static const char AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF";
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtBoundStringLength
+ *
+ * PARAMETERS: String - String with boundary
+ * Count - Boundary of the string
+ *
+ * RETURN: Length of the string. Less than or equal to Count.
+ *
+ * DESCRIPTION: Calculate the length of a string with boundary.
+ *
+ ******************************************************************************/
+
+static ACPI_SIZE
+AcpiUtBoundStringLength (
+ const char *String,
+ ACPI_SIZE Count)
+{
+ UINT32 Length = 0;
+
+
+ while (*String && Count)
+ {
+ Length++;
+ String++;
+ Count--;
+ }
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtBoundStringOutput
+ *
+ * PARAMETERS: String - String with boundary
+ * End - Boundary of the string
+ * c - Character to be output to the string
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Output a character into a string with boundary check.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtBoundStringOutput (
+ char *String,
+ const char *End,
+ char c)
+{
+
+ if (String < End)
+ {
+ *String = c;
+ }
+
+ ++String;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtPutNumber
+ *
+ * PARAMETERS: String - Buffer to hold reverse-ordered string
+ * Number - Integer to be converted
+ * Base - Base of the integer
+ * Upper - Whether or not using upper cased digits
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Convert an integer into a string, note that, the string holds a
+ * reversed ordered number without the trailing zero.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtPutNumber (
+ char *String,
+ UINT64 Number,
+ UINT8 Base,
+ BOOLEAN Upper)
+{
+ const char *Digits;
+ UINT64 DigitIndex;
+ char *Pos;
+
+
+ Pos = String;
+ Digits = Upper ? AcpiGbl_UpperHexDigits : AcpiGbl_LowerHexDigits;
+
+ if (Number == 0)
+ {
+ *(Pos++) = '0';
+ }
+ else
+ {
+ while (Number)
+ {
+ (void) AcpiUtDivide (Number, Base, &Number, &DigitIndex);
+ *(Pos++) = Digits[DigitIndex];
+ }
+ }
+
+ /* *(Pos++) = '0'; */
+ return (Pos);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtScanNumber
+ *
+ * PARAMETERS: String - String buffer
+ * NumberPtr - Where the number is returned
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Scan a string for a decimal integer.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtScanNumber (
+ const char *String,
+ UINT64 *NumberPtr)
+{
+ UINT64 Number = 0;
+
+
+ while (ACPI_IS_DIGIT (*String))
+ {
+ Number *= 10;
+ Number += *(String++) - '0';
+ }
+
+ *NumberPtr = Number;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtPrintNumber
+ *
+ * PARAMETERS: String - String buffer
+ * Number - The number to be converted
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Print a decimal integer into a string.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtPrintNumber (
+ char *String,
+ UINT64 Number)
+{
+ char AsciiString[20];
+ const char *Pos1;
+ char *Pos2;
+
+
+ Pos1 = AcpiUtPutNumber (AsciiString, Number, 10, FALSE);
+ Pos2 = String;
+
+ while (Pos1 != AsciiString)
+ {
+ *(Pos2++) = *(--Pos1);
+ }
+
+ *Pos2 = 0;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFormatNumber
+ *
+ * PARAMETERS: String - String buffer with boundary
+ * End - Boundary of the string
+ * Number - The number to be converted
+ * Base - Base of the integer
+ * Width - Field width
+ * Precision - Precision of the integer
+ * Type - Special printing flags
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Print an integer into a string with any base and any precision.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtFormatNumber (
+ char *String,
+ char *End,
+ UINT64 Number,
+ UINT8 Base,
+ INT32 Width,
+ INT32 Precision,
+ UINT8 Type)
+{
+ char *Pos;
+ char Sign;
+ char Zero;
+ BOOLEAN NeedPrefix;
+ BOOLEAN Upper;
+ INT32 i;
+ char ReversedString[66];
+
+
+ /* Parameter validation */
+
+ if (Base < 2 || Base > 16)
+ {
+ return (NULL);
+ }
+
+ if (Type & ACPI_FORMAT_LEFT)
+ {
+ Type &= ~ACPI_FORMAT_ZERO;
+ }
+
+ NeedPrefix = ((Type & ACPI_FORMAT_PREFIX) && Base != 10) ? TRUE : FALSE;
+ Upper = (Type & ACPI_FORMAT_UPPER) ? TRUE : FALSE;
+ Zero = (Type & ACPI_FORMAT_ZERO) ? '0' : ' ';
+
+ /* Calculate size according to sign and prefix */
+
+ Sign = '\0';
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ if ((INT64) Number < 0)
+ {
+ Sign = '-';
+ Number = - (INT64) Number;
+ Width--;
+ }
+ else if (Type & ACPI_FORMAT_SIGN_PLUS)
+ {
+ Sign = '+';
+ Width--;
+ }
+ else if (Type & ACPI_FORMAT_SIGN_PLUS_SPACE)
+ {
+ Sign = ' ';
+ Width--;
+ }
+ }
+ if (NeedPrefix)
+ {
+ Width--;
+ if (Base == 16)
+ {
+ Width--;
+ }
+ }
+
+ /* Generate full string in reverse order */
+
+ Pos = AcpiUtPutNumber (ReversedString, Number, Base, Upper);
+ i = ACPI_PTR_DIFF (Pos, ReversedString);
+
+ /* Printing 100 using %2d gives "100", not "00" */
+
+ if (i > Precision)
+ {
+ Precision = i;
+ }
+
+ Width -= Precision;
+
+ /* Output the string */
+
+ if (!(Type & (ACPI_FORMAT_ZERO | ACPI_FORMAT_LEFT)))
+ {
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, ' ');
+ }
+ }
+ if (Sign)
+ {
+ String = AcpiUtBoundStringOutput (String, End, Sign);
+ }
+ if (NeedPrefix)
+ {
+ String = AcpiUtBoundStringOutput (String, End, '0');
+ if (Base == 16)
+ {
+ String = AcpiUtBoundStringOutput (String, End,
+ Upper ? 'X' : 'x');
+ }
+ }
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, Zero);
+ }
+ }
+
+ while (i <= --Precision)
+ {
+ String = AcpiUtBoundStringOutput (String, End, '0');
+ }
+ while (--i >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End,
+ ReversedString[i]);
+ }
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, ' ');
+ }
+
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtVsnprintf
+ *
+ * PARAMETERS: String - String with boundary
+ * Size - Boundary of the string
+ * Format - Standard printf format
+ * Args - Argument list
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtVsnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ va_list Args)
+{
+ UINT8 Base = 10;
+ UINT8 Type = 0;
+ INT32 Width = -1;
+ INT32 Precision = -1;
+ char Qualifier = 0;
+ UINT64 Number;
+ char *Pos;
+ char *End;
+ char c;
+ const char *s;
+ const void *p;
+ INT32 Length;
+ int i;
+
+
+ Pos = String;
+ End = String + Size;
+
+ for (; *Format; ++Format)
+ {
+ if (*Format != '%')
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *Format);
+ continue;
+ }
+
+ /* Process sign */
+
+ do
+ {
+ ++Format;
+ if (*Format == '#')
+ {
+ Type |= ACPI_FORMAT_PREFIX;
+ }
+ else if (*Format == '0')
+ {
+ Type |= ACPI_FORMAT_ZERO;
+ }
+ else if (*Format == '+')
+ {
+ Type |= ACPI_FORMAT_SIGN_PLUS;
+ }
+ else if (*Format == ' ')
+ {
+ Type |= ACPI_FORMAT_SIGN_PLUS_SPACE;
+ }
+ else if (*Format == '-')
+ {
+ Type |= ACPI_FORMAT_LEFT;
+ }
+ else
+ {
+ break;
+ }
+ } while (1);
+
+ /* Process width */
+
+ Width = -1;
+ if (ACPI_IS_DIGIT (*Format))
+ {
+ Format = AcpiUtScanNumber (Format, &Number);
+ Width = (INT32) Number;
+ }
+ else if (*Format == '*')
+ {
+ ++Format;
+ Width = va_arg (Args, int);
+ if (Width < 0)
+ {
+ Width = -Width;
+ Type |= ACPI_FORMAT_LEFT;
+ }
+ }
+
+ /* Process precision */
+
+ Precision = -1;
+ if (*Format == '.')
+ {
+ ++Format;
+ if (ACPI_IS_DIGIT(*Format))
+ {
+ Format = AcpiUtScanNumber (Format, &Number);
+ Precision = (INT32) Number;
+ }
+ else if (*Format == '*')
+ {
+ ++Format;
+ Precision = va_arg (Args, int);
+ }
+ if (Precision < 0)
+ {
+ Precision = 0;
+ }
+ }
+
+ /* Process qualifier */
+
+ Qualifier = -1;
+ if (*Format == 'h' || *Format == 'l' || *Format == 'L')
+ {
+ Qualifier = *Format;
+ ++Format;
+
+ if (Qualifier == 'l' && *Format == 'l')
+ {
+ Qualifier = 'L';
+ ++Format;
+ }
+ }
+
+ switch (*Format)
+ {
+ case '%':
+
+ Pos = AcpiUtBoundStringOutput (Pos, End, '%');
+ continue;
+
+ case 'c':
+
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (--Width > 0)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ }
+
+ c = (char) va_arg (Args, int);
+ Pos = AcpiUtBoundStringOutput (Pos, End, c);
+
+ while (--Width > 0)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ continue;
+
+ case 's':
+
+ s = va_arg (Args, char *);
+ if (!s)
+ {
+ s = "<NULL>";
+ }
+ Length = AcpiUtBoundStringLength (s, Precision);
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (Length < Width--)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ }
+ for (i = 0; i < Length; ++i)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *s);
+ ++s;
+ }
+ while (Length < Width--)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ continue;
+
+ case 'o':
+
+ Base = 8;
+ break;
+
+ case 'X':
+
+ Type |= ACPI_FORMAT_UPPER;
+
+ case 'x':
+
+ Base = 16;
+ break;
+
+ case 'd':
+ case 'i':
+
+ Type |= ACPI_FORMAT_SIGN;
+
+ case 'u':
+
+ break;
+
+ case 'p':
+
+ if (Width == -1)
+ {
+ Width = 2 * sizeof (void *);
+ Type |= ACPI_FORMAT_ZERO;
+ }
+
+ p = va_arg (Args, void *);
+ Pos = AcpiUtFormatNumber (Pos, End,
+ ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
+ continue;
+
+ default:
+
+ Pos = AcpiUtBoundStringOutput (Pos, End, '%');
+ if (*Format)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *Format);
+ }
+ else
+ {
+ --Format;
+ }
+ continue;
+ }
+
+ if (Qualifier == 'L')
+ {
+ Number = va_arg (Args, UINT64);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT64) Number;
+ }
+ }
+ else if (Qualifier == 'l')
+ {
+ Number = va_arg (Args, unsigned long);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT32) Number;
+ }
+ }
+ else if (Qualifier == 'h')
+ {
+ Number = (UINT16) va_arg (Args, int);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT16) Number;
+ }
+ }
+ else
+ {
+ Number = va_arg (Args, unsigned int);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (signed int) Number;
+ }
+ }
+
+ Pos = AcpiUtFormatNumber (Pos, End, Number, Base,
+ Width, Precision, Type);
+ }
+
+ if (Size > 0)
+ {
+ if (Pos < End)
+ {
+ *Pos = '\0';
+ }
+ else
+ {
+ End[-1] = '\0';
+ }
+ }
+
+ return (ACPI_PTR_DIFF (Pos, String));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtSnprintf
+ *
+ * PARAMETERS: String - String with boundary
+ * Size - Boundary of the string
+ * Format, ... - Standard printf format
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtSnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ ...)
+{
+ va_list Args;
+ int Length;
+
+
+ va_start (Args, Format);
+ Length = AcpiUtVsnprintf (String, Size, Format, Args);
+ va_end (Args);
+
+ return (Length);
+}
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFileVprintf
+ *
+ * PARAMETERS: File - File descriptor
+ * Format - Standard printf format
+ * Args - Argument list
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a file using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtFileVprintf (
+ ACPI_FILE File,
+ const char *Format,
+ va_list Args)
+{
+ ACPI_CPU_FLAGS Flags;
+ int Length;
+
+
+ Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
+ Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
+ sizeof (AcpiGbl_PrintBuffer), Format, Args);
+
+ (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
+ AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFilePrintf
+ *
+ * PARAMETERS: File - File descriptor
+ * Format, ... - Standard printf format
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a file.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtFilePrintf (
+ ACPI_FILE File,
+ const char *Format,
+ ...)
+{
+ va_list Args;
+ int Length;
+
+
+ va_start (Args, Format);
+ Length = AcpiUtFileVprintf (File, Format, Args);
+ va_end (Args);
+
+ return (Length);
+}
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utresrc.c b/sys/contrib/dev/acpica/components/utilities/utresrc.c
index 3a47a0c..3b549fe 100644
--- a/sys/contrib/dev/acpica/components/utilities/utresrc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utresrc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTRESRC_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -53,7 +52,7 @@
ACPI_MODULE_NAME ("utresrc")
-#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
/*
* Strings used to decode resource descriptors.
@@ -100,7 +99,9 @@ const char *AcpiGbl_IoDecode[] =
const char *AcpiGbl_LlDecode[] =
{
"ActiveHigh",
- "ActiveLow"
+ "ActiveLow",
+ "ActiveBoth",
+ "Reserved"
};
const char *AcpiGbl_MaxDecode[] =
diff --git a/sys/contrib/dev/acpica/components/utilities/utstate.c b/sys/contrib/dev/acpica/components/utilities/utstate.c
index e0e5cce..2fa8fd6 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstate.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstate.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTSTATE_C__
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utstring.c b/sys/contrib/dev/acpica/components/utilities/utstring.c
index 79b5452..2e3ea03 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstring.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstring.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTSTRING_C__
#include <contrib/dev/acpica/include/acpi.h>
@@ -420,7 +419,7 @@ AcpiUtPrintString (
}
AcpiOsPrintf ("\"");
- for (i = 0; String[i] && (i < MaxLength); i++)
+ for (i = 0; (i < MaxLength) && String[i]; i++)
{
/* Escape sequences */
@@ -685,3 +684,81 @@ UtConvertBackslashes (
}
}
#endif
+
+#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtSafeStrcpy, AcpiUtSafeStrcat, AcpiUtSafeStrncat
+ *
+ * PARAMETERS: Adds a "DestSize" parameter to each of the standard string
+ * functions. This is the size of the Destination buffer.
+ *
+ * RETURN: TRUE if the operation would overflow the destination buffer.
+ *
+ * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
+ * the result of the operation will not overflow the output string
+ * buffer.
+ *
+ * NOTE: These functions are typically only helpful for processing
+ * user input and command lines. For most ACPICA code, the
+ * required buffer length is precisely calculated before buffer
+ * allocation, so the use of these functions is unnecessary.
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiUtSafeStrcpy (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source)
+{
+
+ if (ACPI_STRLEN (Source) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ ACPI_STRCPY (Dest, Source);
+ return (FALSE);
+}
+
+BOOLEAN
+AcpiUtSafeStrcat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source)
+{
+
+ if ((ACPI_STRLEN (Dest) + ACPI_STRLEN (Source)) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ ACPI_STRCAT (Dest, Source);
+ return (FALSE);
+}
+
+#ifndef _KERNEL
+BOOLEAN
+AcpiUtSafeStrncat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source,
+ ACPI_SIZE MaxTransferLength)
+{
+ ACPI_SIZE ActualTransferLength;
+
+
+ ActualTransferLength = ACPI_MIN (MaxTransferLength, ACPI_STRLEN (Source));
+
+ if ((ACPI_STRLEN (Dest) + ActualTransferLength) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ ACPI_STRNCAT (Dest, Source, MaxTransferLength);
+ return (FALSE);
+}
+#endif
+
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/uttrack.c b/sys/contrib/dev/acpica/components/utilities/uttrack.c
index 5c381f0..1447bc3 100644
--- a/sys/contrib/dev/acpica/components/utilities/uttrack.c
+++ b/sys/contrib/dev/acpica/components/utilities/uttrack.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -151,10 +151,23 @@ AcpiUtAllocateAndTrack (
ACPI_STATUS Status;
- Allocation = AcpiUtAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER),
- Component, Module, Line);
+ /* Check for an inadvertent size of zero bytes */
+
+ if (!Size)
+ {
+ ACPI_WARNING ((Module, Line,
+ "Attempt to allocate zero bytes, allocating 1 byte"));
+ Size = 1;
+ }
+
+ Allocation = AcpiOsAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER));
if (!Allocation)
{
+ /* Report allocation error */
+
+ ACPI_WARNING ((Module, Line,
+ "Could not allocate size %u", (UINT32) Size));
+
return (NULL);
}
@@ -204,8 +217,16 @@ AcpiUtAllocateZeroedAndTrack (
ACPI_STATUS Status;
- Allocation = AcpiUtAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER),
- Component, Module, Line);
+ /* Check for an inadvertent size of zero bytes */
+
+ if (!Size)
+ {
+ ACPI_WARNING ((Module, Line,
+ "Attempt to allocate zero bytes, allocating 1 byte"));
+ Size = 1;
+ }
+
+ Allocation = AcpiOsAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER));
if (!Allocation)
{
/* Report allocation error */
@@ -286,7 +307,8 @@ AcpiUtFreeAndTrack (
}
AcpiOsFree (DebugBlock);
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", Allocation));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed (block %p)\n",
+ Allocation, DebugBlock));
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utuuid.c b/sys/contrib/dev/acpica/components/utilities/utuuid.c
new file mode 100644
index 0000000..b9c6a09
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/utuuid.c
@@ -0,0 +1,103 @@
+/******************************************************************************
+ *
+ * Module Name: utuuid -- UUID support functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#define __UTUUID_C__
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("utuuid")
+
+
+/*
+ * UUID support functions.
+ *
+ * This table is used to convert an input UUID ascii string to a 16 byte
+ * buffer and the reverse. The table maps a UUID buffer index 0-15 to
+ * the index within the 36-byte UUID string where the associated 2-byte
+ * hex value can be found.
+ *
+ * 36-byte UUID strings are of the form:
+ * aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
+ * Where aa-pp are one byte hex numbers, made up of two hex digits
+ *
+ * Note: This table is basically the inverse of the string-to-offset table
+ * found in the ACPI spec in the description of the ToUUID macro.
+ */
+const UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH] =
+{
+ 6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtConvertStringToUuid
+ *
+ * PARAMETERS: InString - 36-byte formatted UUID string
+ * UuidBuffer - Where the 16-byte UUID buffer is returned
+ *
+ * RETURN: None. Output data is returned in the UuidBuffer
+ *
+ * DESCRIPTION: Convert a 36-byte formatted UUID string to 16-byte UUID buffer
+ *
+ ******************************************************************************/
+
+void
+AcpiUtConvertStringToUuid (
+ char *InString,
+ UINT8 *UuidBuffer)
+{
+ UINT32 i;
+
+
+ for (i = 0; i < UUID_BUFFER_LENGTH; i++)
+ {
+ UuidBuffer[i] =
+ (AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
+
+ UuidBuffer[i] |=
+ AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
+ }
+}
diff --git a/sys/contrib/dev/acpica/components/utilities/utxface.c b/sys/contrib/dev/acpica/components/utilities/utxface.c
index b6003e6..7ce79c0 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxface.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -114,7 +114,7 @@ AcpiTerminate (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiTerminate)
+ACPI_EXPORT_SYMBOL_INIT (AcpiTerminate)
#ifndef ACPI_ASL_COMPILER
diff --git a/sys/contrib/dev/acpica/components/utilities/utxferror.c b/sys/contrib/dev/acpica/components/utilities/utxferror.c
index 8f11b29..e5d3083 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxferror.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxferror.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
*/
#define __UTXFERROR_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -55,6 +56,8 @@
* tools/applications.
*/
+#ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
+
/*******************************************************************************
*
* FUNCTION: AcpiError
@@ -294,3 +297,5 @@ AcpiBiosWarning (
}
ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfinit.c b/sys/contrib/dev/acpica/components/utilities/utxfinit.c
index c828a71..061ca19 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfinit.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#define __UTXFINIT_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -130,11 +130,19 @@ AcpiInitializeSubsystem (
/* If configured, initialize the AML debugger */
- ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ());
- return_ACPI_STATUS (Status);
+#ifdef ACPI_DEBUGGER
+ Status = AcpiDbInitialize ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During Debugger initialization"));
+ return_ACPI_STATUS (Status);
+ }
+#endif
+
+ return_ACPI_STATUS (AE_OK);
}
-ACPI_EXPORT_SYMBOL (AcpiInitializeSubsystem)
+ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeSubsystem)
/*******************************************************************************
@@ -256,7 +264,7 @@ AcpiEnableSubsystem (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiEnableSubsystem)
+ACPI_EXPORT_SYMBOL_INIT (AcpiEnableSubsystem)
/*******************************************************************************
@@ -355,4 +363,4 @@ AcpiInitializeObjects (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiInitializeObjects)
+ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeObjects)
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
index ae5a345..dfa5225 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acapps.h b/sys/contrib/dev/acpica/include/acapps.h
index fc95423..5d46ff4 100644
--- a/sys/contrib/dev/acpica/include/acapps.h
+++ b/sys/contrib/dev/acpica/include/acapps.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,7 @@
/* Common info for tool signons */
#define ACPICA_NAME "Intel ACPI Component Architecture"
-#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2013 Intel Corporation"
+#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2014 Intel Corporation"
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_WIDTH "-64"
@@ -84,10 +84,13 @@
/* Macros for usage messages */
#define ACPI_USAGE_HEADER(Usage) \
- printf ("Usage: %s\nOptions:\n", Usage);
+ AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
+
+#define ACPI_USAGE_TEXT(Description) \
+ AcpiOsPrintf (Description);
#define ACPI_OPTION(Name, Description) \
- printf (" %-18s%s\n", Name, Description);
+ AcpiOsPrintf (" %-18s%s\n", Name, Description);
#define FILE_SUFFIX_DISASSEMBLY "dsl"
@@ -114,6 +117,14 @@ extern int AcpiGbl_SubOptChar;
extern char *AcpiGbl_Optarg;
+/*
+ * cmfsize - Common get file size function
+ */
+UINT32
+CmGetFileSize (
+ ACPI_FILE File);
+
+
#ifndef ACPI_DUMP_APP
/*
* adisasm
@@ -123,8 +134,7 @@ AdAmlDisassemble (
BOOLEAN OutToFile,
char *Filename,
char *Prefix,
- char **OutFilename,
- BOOLEAN GetAllTables);
+ char **OutFilename);
void
AdPrintStatistics (
@@ -141,8 +151,7 @@ AdDumpTables (
ACPI_STATUS
AdGetLocalTables (
- char *Filename,
- BOOLEAN GetAllTables);
+ void);
ACPI_STATUS
AdParseTable (
diff --git a/sys/contrib/dev/acpica/include/acbuffer.h b/sys/contrib/dev/acpica/include/acbuffer.h
index 9651024..a36a980 100644
--- a/sys/contrib/dev/acpica/include/acbuffer.h
+++ b/sys/contrib/dev/acpica/include/acbuffer.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/accommon.h b/sys/contrib/dev/acpica/include/accommon.h
index 074b6c1..dc6a9b4 100644
--- a/sys/contrib/dev/acpica/include/accommon.h
+++ b/sys/contrib/dev/acpica/include/accommon.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acconfig.h b/sys/contrib/dev/acpica/include/acconfig.h
index 6a267fe..69242ee 100644
--- a/sys/contrib/dev/acpica/include/acconfig.h
+++ b/sys/contrib/dev/acpica/include/acconfig.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -84,7 +84,9 @@
* Should the subsystem abort the loading of an ACPI table if the
* table checksum is incorrect?
*/
+#ifndef ACPI_CHECKSUM_ABORT
#define ACPI_CHECKSUM_ABORT FALSE
+#endif
/*
* Generate a version of ACPICA that only supports "reduced hardware"
@@ -101,7 +103,9 @@
* ACPI PM timer
* FACS table (Waking vectors and Global Lock)
*/
+#ifndef ACPI_REDUCED_HARDWARE
#define ACPI_REDUCED_HARDWARE FALSE
+#endif
/******************************************************************************
@@ -219,6 +223,25 @@
/******************************************************************************
*
+ * Miscellaneous constants
+ *
+ *****************************************************************************/
+
+/* UUID constants */
+
+#define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */
+#define UUID_STRING_LENGTH 36 /* Total length of a UUID string */
+
+/* Positions for required hyphens (dashes) in UUID strings */
+
+#define UUID_HYPHEN1_OFFSET 8
+#define UUID_HYPHEN2_OFFSET 13
+#define UUID_HYPHEN3_OFFSET 18
+#define UUID_HYPHEN4_OFFSET 23
+
+
+/******************************************************************************
+ *
* ACPI AML Debugger
*
*****************************************************************************/
diff --git a/sys/contrib/dev/acpica/include/acdebug.h b/sys/contrib/dev/acpica/include/acdebug.h
index 37d41d3..a856257 100644
--- a/sys/contrib/dev/acpica/include/acdebug.h
+++ b/sys/contrib/dev/acpica/include/acdebug.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -164,6 +164,11 @@ void
AcpiDbGenerateSci (
void))
+void
+AcpiDbExecuteTest (
+ char *TypeArg);
+
+
/*
* dbconvert - miscellaneous conversion routines
*/
@@ -372,11 +377,6 @@ AcpiDbGetTableFromFile (
char *Filename,
ACPI_TABLE_HEADER **Table);
-ACPI_STATUS
-AcpiDbReadTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **Table);
-
/*
* dbhistry - debugger HISTORY command
@@ -393,6 +393,10 @@ char *
AcpiDbGetFromHistory (
char *CommandNumArg);
+char *
+AcpiDbGetHistoryByIndex (
+ UINT32 CommanddNum);
+
/*
* dbinput - user front-end to the AML debugger
diff --git a/sys/contrib/dev/acpica/include/acdisasm.h b/sys/contrib/dev/acpica/include/acdisasm.h
index 4fadd40..687991e 100644
--- a/sys/contrib/dev/acpica/include/acdisasm.h
+++ b/sys/contrib/dev/acpica/include/acdisasm.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -69,14 +69,14 @@ typedef const struct acpi_dmtable_info
} ACPI_DMTABLE_INFO;
+/* Values for Flags field above */
+
#define DT_LENGTH 0x01 /* Field is a subtable length */
#define DT_FLAG 0x02 /* Field is a flag value */
#define DT_NON_ZERO 0x04 /* Field must be non-zero */
-
-/* TBD: Not used at this time */
-
-#define DT_OPTIONAL 0x08
-#define DT_COUNT 0x10
+#define DT_OPTIONAL 0x08 /* Field is optional */
+#define DT_DESCRIBES_OPTIONAL 0x10 /* Field describes an optional field (length, etc.) */
+#define DT_COUNT 0x20 /* Currently not used */
/*
* Values for Opcode above.
@@ -137,16 +137,20 @@ typedef enum
ACPI_DMT_ASF,
ACPI_DMT_DMAR,
+ ACPI_DMT_DMAR_SCOPE,
ACPI_DMT_EINJACT,
ACPI_DMT_EINJINST,
ACPI_DMT_ERSTACT,
ACPI_DMT_ERSTINST,
ACPI_DMT_FADTPM,
+ ACPI_DMT_GTDT,
ACPI_DMT_HEST,
ACPI_DMT_HESTNTFY,
ACPI_DMT_HESTNTYP,
ACPI_DMT_IVRS,
+ ACPI_DMT_LPIT,
ACPI_DMT_MADT,
+ ACPI_DMT_PCCT,
ACPI_DMT_PMTT,
ACPI_DMT_SLIC,
ACPI_DMT_SRAT,
@@ -186,6 +190,7 @@ typedef struct acpi_op_walk_info
UINT32 BitOffset;
UINT32 Flags;
ACPI_WALK_STATE *WalkState;
+ ACPI_PARSE_OBJECT *MappingOp;
} ACPI_OP_WALK_INFO;
@@ -203,6 +208,7 @@ ACPI_STATUS (*ASL_WALK_CALLBACK) (
typedef
void (*ACPI_RESOURCE_HANDLER) (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
@@ -244,6 +250,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[];
@@ -252,6 +259,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
@@ -269,6 +277,10 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[];
@@ -281,6 +293,9 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[];
@@ -303,6 +318,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[];
@@ -324,7 +341,9 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[];
@@ -343,6 +362,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
@@ -438,6 +458,10 @@ AcpiDmDumpFpdt (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpGtdt (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpHest (
ACPI_TABLE_HEADER *Table);
@@ -446,6 +470,10 @@ AcpiDmDumpIvrs (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpLpit (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpMadt (
ACPI_TABLE_HEADER *Table);
@@ -549,6 +577,14 @@ AcpiDmMethodFlags (
ACPI_PARSE_OBJECT *Op);
void
+AcpiDmDisplayTargetPathname (
+ ACPI_PARSE_OBJECT *Op);
+
+void
+AcpiDmNotifyDescription (
+ ACPI_PARSE_OBJECT *Op);
+
+void
AcpiDmPredefinedDescription (
ACPI_PARSE_OBJECT *Op);
@@ -628,14 +664,18 @@ AcpiDmByteList (
ACPI_PARSE_OBJECT *Op);
void
-AcpiDmIsEisaId (
+AcpiDmCheckForHardwareId (
ACPI_PARSE_OBJECT *Op);
void
-AcpiDmEisaId (
+AcpiDmDecompressEisaId (
UINT32 EncodedId);
BOOLEAN
+AcpiDmIsUuidBuffer (
+ ACPI_PARSE_OBJECT *Op);
+
+BOOLEAN
AcpiDmIsUnicodeBuffer (
ACPI_PARSE_OBJECT *Op);
@@ -668,11 +708,19 @@ AcpiDmClearExternalFileList (
void);
void
-AcpiDmAddToExternalList (
+AcpiDmAddOpToExternalList (
ACPI_PARSE_OBJECT *Op,
char *Path,
UINT8 Type,
- UINT32 Value);
+ UINT32 Value,
+ UINT16 Flags);
+
+void
+AcpiDmAddNodeToExternalList (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT8 Type,
+ UINT32 Value,
+ UINT16 Flags);
void
AcpiDmAddExternalsToNamespace (
@@ -747,72 +795,84 @@ AcpiDmDescriptorName (
*/
void
AcpiDmWordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmDwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmExtendedDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmQwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmMemory24Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmGenericRegisterDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmInterruptDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmVendorLargeDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmGpioDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
@@ -830,48 +890,56 @@ AcpiDmVendorCommon (
*/
void
AcpiDmIrqDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmStartDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmEndDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmVendorSmallDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
diff --git a/sys/contrib/dev/acpica/include/acdispat.h b/sys/contrib/dev/acpica/include/acdispat.h
index fc747f1..c4abebb 100644
--- a/sys/contrib/dev/acpica/include/acdispat.h
+++ b/sys/contrib/dev/acpica/include/acdispat.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef _ACDISPAT_H_
#define _ACDISPAT_H_
@@ -173,13 +172,15 @@ AcpiDsInitFieldObjects (
/*
- * dsload - Parser/Interpreter interface, pass 1 namespace load callbacks
+ * dsload - Parser/Interpreter interface
*/
ACPI_STATUS
AcpiDsInitCallbacks (
ACPI_WALK_STATE *WalkState,
UINT32 PassNumber);
+/* dsload - pass 1 namespace load callbacks */
+
ACPI_STATUS
AcpiDsLoad1BeginOp (
ACPI_WALK_STATE *WalkState,
@@ -190,9 +191,8 @@ AcpiDsLoad1EndOp (
ACPI_WALK_STATE *WalkState);
-/*
- * dsload - Parser/Interpreter interface, pass 2 namespace load callbacks
- */
+/* dsload - pass 2 namespace load callbacks */
+
ACPI_STATUS
AcpiDsLoad2BeginOp (
ACPI_WALK_STATE *WalkState,
@@ -257,8 +257,9 @@ AcpiDsMethodDataInit (
* dsmethod - Parser/Interpreter interface - control method parsing
*/
ACPI_STATUS
-AcpiDsParseMethod (
- ACPI_NAMESPACE_NODE *Node);
+AcpiDsAutoSerializeMethod (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiDsCallControlMethod (
diff --git a/sys/contrib/dev/acpica/include/acevents.h b/sys/contrib/dev/acpica/include/acevents.h
index 67095aa..43c1d7c 100644
--- a/sys/contrib/dev/acpica/include/acevents.h
+++ b/sys/contrib/dev/acpica/include/acevents.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -144,9 +144,10 @@ AcpiEvFinishGpe (
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
- ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT64 Address,
+ UINT8 SpaceId,
UINT32 RegisterCount,
- UINT8 GpeBlockBaseNumber,
+ UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock);
@@ -206,9 +207,10 @@ AcpiEvGetGpeDevice (
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
-ACPI_GPE_XRUPT_INFO *
+ACPI_STATUS
AcpiEvGetGpeXruptBlock (
- UINT32 InterruptNumber);
+ UINT32 InterruptNumber,
+ ACPI_GPE_XRUPT_INFO **GpeXruptBlock);
ACPI_STATUS
AcpiEvDeleteGpeXrupt (
diff --git a/sys/contrib/dev/acpica/include/acexcep.h b/sys/contrib/dev/acpica/include/acexcep.h
index 7bcfe1d..aab6941 100644
--- a/sys/contrib/dev/acpica/include/acexcep.h
+++ b/sys/contrib/dev/acpica/include/acexcep.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acglobal.h b/sys/contrib/dev/acpica/include/acglobal.h
index cb76f65..a83f8c3 100644
--- a/sys/contrib/dev/acpica/include/acglobal.h
+++ b/sys/contrib/dev/acpica/include/acglobal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,167 +45,42 @@
#define __ACGLOBAL_H__
-/*
- * Ensure that the globals are actually defined and initialized only once.
- *
- * The use of these macros allows a single list of globals (here) in order
- * to simplify maintenance of the code.
- */
-#ifdef DEFINE_ACPI_GLOBALS
-#define ACPI_EXTERN
-#define ACPI_INIT_GLOBAL(a,b) a=b
-#else
-#define ACPI_EXTERN extern
-#define ACPI_INIT_GLOBAL(a,b) a
-#endif
-
-
-#ifdef DEFINE_ACPI_GLOBALS
-
-/* Public globals, available from outside ACPICA subsystem */
-
/*****************************************************************************
*
- * Runtime configuration (static defaults that can be overriden at runtime)
+ * Globals related to the ACPI tables
*
****************************************************************************/
-/*
- * Enable "slack" in the AML interpreter? Default is FALSE, and the
- * interpreter strictly follows the ACPI specification. Setting to TRUE
- * allows the interpreter to ignore certain errors and/or bad AML constructs.
- *
- * Currently, these features are enabled by this flag:
- *
- * 1) Allow "implicit return" of last value in a control method
- * 2) Allow access beyond the end of an operation region
- * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
- * 4) Allow ANY object type to be a source operand for the Store() operator
- * 5) Allow unresolved references (invalid target name) in package objects
- * 6) Enable warning messages for behavior that is not ACPI spec compliant
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableInterpreterSlack, FALSE);
-
-/*
- * Automatically serialize ALL control methods? Default is FALSE, meaning
- * to use the Serialized/NotSerialized method flags on a per method basis.
- * Only change this if the ASL code is poorly written and cannot handle
- * reentrancy even though methods are marked "NotSerialized".
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_AllMethodsSerialized, FALSE);
-
-/*
- * Create the predefined _OSI method in the namespace? Default is TRUE
- * because ACPI CA is fully compatible with other ACPI implementations.
- * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CreateOsiMethod, TRUE);
-
-/*
- * Optionally use default values for the ACPI register widths. Set this to
- * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_UseDefaultRegisterWidths, TRUE);
-
-/*
- * Optionally enable output from the AML Debug Object.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE);
-
-/*
- * Optionally copy the entire DSDT to local memory (instead of simply
- * mapping it.) There are some BIOSs that corrupt or replace the original
- * DSDT, creating the need for this option. Default is FALSE, do not copy
- * the DSDT.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE);
-
-/*
- * Optionally truncate I/O addresses to 16 bits. Provides compatibility
- * with other ACPI implementations. NOTE: During ACPICA initialization,
- * this value is set to TRUE if any Windows OSI strings have been
- * requested by the BIOS.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE);
-
-/*
- * Disable runtime checking and repair of values returned by control methods.
- * Use only if the repair is causing a problem on a particular machine.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE);
-
-/*
- * Optionally do not load any SSDTs from the RSDT/XSDT during initialization.
- * This can be useful for debugging ACPI problems on some machines.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableSsdtTableLoad, FALSE);
-
-/*
- * We keep track of the latest version of Windows that has been requested by
- * the BIOS.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_OsiData, 0);
-
-
-/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
+/* Master list of all ACPI tables that were found in the RSDT/XSDT */
-ACPI_TABLE_FADT AcpiGbl_FADT;
-UINT32 AcpiCurrentGpeCount;
-UINT32 AcpiGbl_TraceFlags;
-ACPI_NAME AcpiGbl_TraceMethodName;
-BOOLEAN AcpiGbl_SystemAwakeAndRunning;
+ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
-/*
- * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
- * that the ACPI hardware is no longer required. A flag in the FADT indicates
- * a reduced HW machine, and that flag is duplicated here for convenience.
- */
-BOOLEAN AcpiGbl_ReducedHardware;
-
-#endif /* DEFINE_ACPI_GLOBALS */
-
-/* Do not disassemble buffers to resource descriptors */
-
-ACPI_EXTERN UINT8 ACPI_INIT_GLOBAL (AcpiGbl_NoResourceDisassembly, FALSE);
-
-/*****************************************************************************
- *
- * ACPI Table globals
- *
- ****************************************************************************/
+/* DSDT information. Used to check for DSDT corruption */
-/*
- * AcpiGbl_RootTableList is the master list of ACPI tables that were
- * found in the RSDT/XSDT.
- */
-ACPI_EXTERN ACPI_TABLE_LIST AcpiGbl_RootTableList;
+ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT);
+ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader);
#if (!ACPI_REDUCED_HARDWARE)
-ACPI_EXTERN ACPI_TABLE_FACS *AcpiGbl_FACS;
+ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS);
#endif /* !ACPI_REDUCED_HARDWARE */
/* These addresses are calculated from the FADT Event Block addresses */
-ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aStatus;
-ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aEnable;
-
-ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bStatus;
-ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bEnable;
-
-/* DSDT information. Used to check for DSDT corruption */
+ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aStatus);
+ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aEnable);
-ACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_DSDT;
-ACPI_EXTERN ACPI_TABLE_HEADER AcpiGbl_OriginalDsdtHeader;
+ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bStatus);
+ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bEnable);
/*
- * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
+ * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is
* determined by the revision of the DSDT: If the DSDT revision is less than
* 2, use only the lower 32 bits of the internal 64-bit Integer.
*/
-ACPI_EXTERN UINT8 AcpiGbl_IntegerBitWidth;
-ACPI_EXTERN UINT8 AcpiGbl_IntegerByteWidth;
-ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth;
+ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth);
+ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth);
+ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth);
/*****************************************************************************
@@ -219,36 +94,36 @@ ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth;
* actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
* (The table maps local handles to the real OS handles)
*/
-ACPI_EXTERN ACPI_MUTEX_INFO AcpiGbl_MutexInfo[ACPI_NUM_MUTEX];
+ACPI_GLOBAL (ACPI_MUTEX_INFO, AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]);
/*
* Global lock mutex is an actual AML mutex object
* Global lock semaphore works in conjunction with the actual global lock
* Global lock spinlock is used for "pending" handshake
*/
-ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_GlobalLockMutex;
-ACPI_EXTERN ACPI_SEMAPHORE AcpiGbl_GlobalLockSemaphore;
-ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GlobalLockPendingLock;
-ACPI_EXTERN UINT16 AcpiGbl_GlobalLockHandle;
-ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired;
-ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent;
-ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPending;
+ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_GlobalLockMutex);
+ACPI_GLOBAL (ACPI_SEMAPHORE, AcpiGbl_GlobalLockSemaphore);
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GlobalLockPendingLock);
+ACPI_GLOBAL (UINT16, AcpiGbl_GlobalLockHandle);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockAcquired);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPresent);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPending);
/*
* Spinlocks are used for interfaces that can be possibly called at
* interrupt level
*/
-ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GpeLock; /* For GPE data structs and registers */
-ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_HardwareLock; /* For ACPI H/W except GPE registers */
-ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_ReferenceCountLock;
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GpeLock); /* For GPE data structs and registers */
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_HardwareLock); /* For ACPI H/W except GPE registers */
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_ReferenceCountLock);
/* Mutex for _OSI support */
-ACPI_EXTERN ACPI_MUTEX AcpiGbl_OsiMutex;
+ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_OsiMutex);
/* Reader/Writer lock is used for namespace walk and dynamic table unload */
-ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock;
+ACPI_GLOBAL (ACPI_RW_LOCK, AcpiGbl_NamespaceRwLock);
/*****************************************************************************
@@ -259,69 +134,67 @@ ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock;
/* Object caches */
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_NamespaceCache;
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_StateCache;
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeCache;
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeExtCache;
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_OperandCache;
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_NamespaceCache);
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_StateCache);
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeCache);
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeExtCache);
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache);
+
+/* System */
+
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE);
/* Global handlers */
-ACPI_EXTERN ACPI_GLOBAL_NOTIFY_HANDLER AcpiGbl_GlobalNotify[2];
-ACPI_EXTERN ACPI_EXCEPTION_HANDLER AcpiGbl_ExceptionHandler;
-ACPI_EXTERN ACPI_INIT_HANDLER AcpiGbl_InitHandler;
-ACPI_EXTERN ACPI_TABLE_HANDLER AcpiGbl_TableHandler;
-ACPI_EXTERN void *AcpiGbl_TableHandlerContext;
-ACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_BreakpointWalk;
-ACPI_EXTERN ACPI_INTERFACE_HANDLER AcpiGbl_InterfaceHandler;
-ACPI_EXTERN ACPI_SCI_HANDLER_INFO *AcpiGbl_SciHandlerList;
+ACPI_GLOBAL (ACPI_GLOBAL_NOTIFY_HANDLER,AcpiGbl_GlobalNotify[2]);
+ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler);
+ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler);
+ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler);
+ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext);
+ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler);
+ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList);
/* Owner ID support */
-ACPI_EXTERN UINT32 AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS];
-ACPI_EXTERN UINT8 AcpiGbl_LastOwnerIdIndex;
-ACPI_EXTERN UINT8 AcpiGbl_NextOwnerIdOffset;
+ACPI_GLOBAL (UINT32, AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]);
+ACPI_GLOBAL (UINT8, AcpiGbl_LastOwnerIdIndex);
+ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset);
/* Initialization sequencing */
-ACPI_EXTERN BOOLEAN AcpiGbl_RegMethodsExecuted;
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsExecuted);
/* Misc */
-ACPI_EXTERN UINT32 AcpiGbl_OriginalMode;
-ACPI_EXTERN UINT32 AcpiGbl_RsdpOriginalLocation;
-ACPI_EXTERN UINT32 AcpiGbl_NsLookupCount;
-ACPI_EXTERN UINT32 AcpiGbl_PsFindCount;
-ACPI_EXTERN UINT16 AcpiGbl_Pm1EnableRegisterSave;
-ACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration;
-ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall;
-ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
-ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized;
-ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces;
-ACPI_EXTERN ACPI_ADDRESS_RANGE *AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX];
+ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode);
+ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount);
+ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount);
+ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave);
+ACPI_GLOBAL (UINT8, AcpiGbl_DebuggerConfiguration);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_StepToNextCall);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_AcpiHardwarePresent);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_EventsInitialized);
+ACPI_GLOBAL (ACPI_INTERFACE_INFO *, AcpiGbl_SupportedInterfaces);
+ACPI_GLOBAL (ACPI_ADDRESS_RANGE *, AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]);
-#ifndef DEFINE_ACPI_GLOBALS
+/* Other miscellaneous, declared and initialized in utglobal */
-/* Other miscellaneous */
-
-extern BOOLEAN AcpiGbl_Shutdown;
-extern UINT32 AcpiGbl_StartupFlags;
extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT];
extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS];
extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS];
-extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES];
extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS];
-#endif
+extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES];
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-/* Lists for tracking memory allocations */
+/* Lists for tracking memory allocations (debug only) */
-ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_GlobalList;
-ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_NsNodeList;
-ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats;
-ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking;
+ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_GlobalList);
+ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_NsNodeList);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisplayFinalMemStats);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking);
#endif
@@ -337,22 +210,23 @@ ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking;
#define NUM_PREDEFINED_NAMES 9
#endif
-ACPI_EXTERN ACPI_NAMESPACE_NODE AcpiGbl_RootNodeStruct;
-ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_RootNode;
-ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_FadtGpeDevice;
-ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_ModuleCodeList;
+ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
+ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);
+ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice);
+ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_ModuleCodeList);
extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES];
extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
#ifdef ACPI_DEBUG_OUTPUT
-ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeCount;
-ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeSize;
-ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentNodeCount;
-ACPI_EXTERN ACPI_SIZE *AcpiGbl_EntryStackPointer;
-ACPI_EXTERN ACPI_SIZE *AcpiGbl_LowestStackPointer;
-ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting;
+ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount);
+ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize);
+ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount);
+ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer);
+ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer);
+ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting);
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0);
#endif
@@ -362,11 +236,11 @@ ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting;
*
****************************************************************************/
-ACPI_EXTERN ACPI_THREAD_STATE *AcpiGbl_CurrentWalkList;
+ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList);
/* Control method single step flag */
-ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep;
+ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep);
/*****************************************************************************
@@ -375,9 +249,10 @@ ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep;
*
****************************************************************************/
-extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG];
-ACPI_EXTERN UINT8 AcpiGbl_SleepTypeA;
-ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB;
+extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG];
+
+ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeA);
+ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeB);
/*****************************************************************************
@@ -388,13 +263,14 @@ ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB;
#if (!ACPI_REDUCED_HARDWARE)
-ACPI_EXTERN UINT8 AcpiGbl_AllGpesInitialized;
-ACPI_EXTERN ACPI_GPE_XRUPT_INFO *AcpiGbl_GpeXruptListHead;
-ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS];
-ACPI_EXTERN ACPI_GBL_EVENT_HANDLER AcpiGbl_GlobalEventHandler;
-ACPI_EXTERN void *AcpiGbl_GlobalEventHandlerContext;
-ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS];
-extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
+ACPI_GLOBAL (UINT8, AcpiGbl_AllGpesInitialized);
+ACPI_GLOBAL (ACPI_GPE_XRUPT_INFO *, AcpiGbl_GpeXruptListHead);
+ACPI_GLOBAL (ACPI_GPE_BLOCK_INFO *, AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]);
+ACPI_GLOBAL (ACPI_GBL_EVENT_HANDLER, AcpiGbl_GlobalEventHandler);
+ACPI_GLOBAL (void *, AcpiGbl_GlobalEventHandlerContext);
+ACPI_GLOBAL (ACPI_FIXED_EVENT_HANDLER, AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]);
+
+extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -404,23 +280,19 @@ extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EV
*
****************************************************************************/
-/* Procedure nesting level for debug output */
-
-extern UINT32 AcpiGbl_NestingLevel;
-
/* Event counters */
-ACPI_EXTERN UINT32 AcpiMethodCount;
-ACPI_EXTERN UINT32 AcpiGpeCount;
-ACPI_EXTERN UINT32 AcpiSciCount;
-ACPI_EXTERN UINT32 AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS];
+ACPI_GLOBAL (UINT32, AcpiMethodCount);
+ACPI_GLOBAL (UINT32, AcpiGpeCount);
+ACPI_GLOBAL (UINT32, AcpiSciCount);
+ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]);
/* Support for dynamic control method tracing mechanism */
-ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLevel;
-ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLayer;
-ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLevel;
-ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer;
+ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel);
+ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer);
+ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel);
+ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer);
/*****************************************************************************
@@ -429,65 +301,80 @@ ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer;
*
****************************************************************************/
-ACPI_EXTERN UINT8 AcpiGbl_DbOutputFlags;
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT);
#ifdef ACPI_DISASSEMBLER
-ACPI_EXTERN BOOLEAN ACPI_INIT_GLOBAL (AcpiGbl_IgnoreNoopOperator, FALSE);
+/* Do not disassemble buffers to resource descriptors */
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose;
-ACPI_EXTERN BOOLEAN AcpiGbl_NumExternalMethods;
-ACPI_EXTERN UINT32 AcpiGbl_ResolvedExternalMethods;
-ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList;
-ACPI_EXTERN ACPI_EXTERNAL_FILE *AcpiGbl_ExternalFileList;
-#endif
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_disasm);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_verbose);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods);
+ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods);
+ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList);
+ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList);
+#endif
#ifdef ACPI_DEBUGGER
-extern BOOLEAN AcpiGbl_MethodExecuting;
-extern BOOLEAN AcpiGbl_AbortMethod;
-extern BOOLEAN AcpiGbl_DbTerminateThreads;
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_tables;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_stats;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_ini_methods;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_NoRegionSupport;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOutputToFile;
-ACPI_EXTERN char *AcpiGbl_DbBuffer;
-ACPI_EXTERN char *AcpiGbl_DbFilename;
-ACPI_EXTERN UINT32 AcpiGbl_DbDebugLevel;
-ACPI_EXTERN UINT32 AcpiGbl_DbConsoleDebugLevel;
-ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_DbScopeNode;
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_tables);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_stats);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_ini_methods);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile);
+ACPI_GLOBAL (char *, AcpiGbl_DbBuffer);
+ACPI_GLOBAL (char *, AcpiGbl_DbFilename);
+ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel);
+ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel);
+ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode);
-ACPI_EXTERN char *AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS];
-ACPI_EXTERN ACPI_OBJECT_TYPE AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS];
+ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]);
+ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]);
/* These buffers should all be the same size */
-ACPI_EXTERN char AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_GLOBAL (char, AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]);
+ACPI_GLOBAL (char, AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]);
+ACPI_GLOBAL (char, AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE]);
+ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE]);
/*
* Statistic globals
*/
-ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1];
-ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1];
-ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCountMisc;
-ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCountMisc;
-ACPI_EXTERN UINT32 AcpiGbl_NumNodes;
-ACPI_EXTERN UINT32 AcpiGbl_NumObjects;
+ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1]);
+ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1]);
+ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc);
+ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc);
+ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes);
+ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects);
+
+#endif /* ACPI_DEBUGGER */
+
+
+/*****************************************************************************
+ *
+ * Application globals
+ *
+ ****************************************************************************/
+#ifdef ACPI_APPLICATION
-ACPI_EXTERN UINT32 AcpiGbl_SizeOfParseTree;
-ACPI_EXTERN UINT32 AcpiGbl_SizeOfMethodTrees;
-ACPI_EXTERN UINT32 AcpiGbl_SizeOfNodeEntries;
-ACPI_EXTERN UINT32 AcpiGbl_SizeOfAcpiObjects;
+ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL);
+ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_OutputFile, NULL);
-#endif /* ACPI_DEBUGGER */
+/* Print buffer */
+
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_PrintLock); /* For print buffer */
+ACPI_GLOBAL (char, AcpiGbl_PrintBuffer[1024]);
+
+#endif /* ACPI_APPLICATION */
/*****************************************************************************
@@ -496,7 +383,8 @@ ACPI_EXTERN UINT32 AcpiGbl_SizeOfAcpiObjects;
*
****************************************************************************/
-extern const AH_PREDEFINED_NAME AslPredefinedInfo[];
+extern const AH_PREDEFINED_NAME AslPredefinedInfo[];
+extern const AH_DEVICE_ID AslDeviceIds[];
#endif /* __ACGLOBAL_H__ */
diff --git a/sys/contrib/dev/acpica/include/achware.h b/sys/contrib/dev/acpica/include/achware.h
index 9577fd1..1b13318 100644
--- a/sys/contrib/dev/acpica/include/achware.h
+++ b/sys/contrib/dev/acpica/include/achware.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acinterp.h b/sys/contrib/dev/acpica/include/acinterp.h
index ebf4c98..b778640 100644
--- a/sys/contrib/dev/acpica/include/acinterp.h
+++ b/sys/contrib/dev/acpica/include/acinterp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -89,6 +89,10 @@ typedef const struct acpi_exdump_info
#define ACPI_EXD_PACKAGE 11
#define ACPI_EXD_FIELD 12
#define ACPI_EXD_REFERENCE 13
+#define ACPI_EXD_LIST 14 /* Operand object list */
+#define ACPI_EXD_HDLR_LIST 15 /* Address Handler list */
+#define ACPI_EXD_RGN_LIST 16 /* Region list */
+#define ACPI_EXD_NODE 17 /* Namespace Node */
/* restore default alignment */
@@ -612,14 +616,6 @@ void
AcpiExExitInterpreter (
void);
-void
-AcpiExReacquireInterpreter (
- void);
-
-void
-AcpiExRelinquishInterpreter (
- void);
-
BOOLEAN
AcpiExTruncateFor32bitTable (
ACPI_OPERAND_OBJECT *ObjDesc);
diff --git a/sys/contrib/dev/acpica/include/aclocal.h b/sys/contrib/dev/acpica/include/aclocal.h
index 5ee1430..d911985 100644
--- a/sys/contrib/dev/acpica/include/aclocal.h
+++ b/sys/contrib/dev/acpica/include/aclocal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -291,6 +291,7 @@ typedef struct acpi_create_field_info
UINT32 FieldBitPosition;
UINT32 FieldBitLength;
UINT16 ResourceLength;
+ UINT16 PinNumberIndex;
UINT8 FieldFlags;
UINT8 Attribute;
UINT8 FieldType;
@@ -516,9 +517,9 @@ typedef struct acpi_gpe_register_info
{
ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
+ UINT16 BaseGpeNumber; /* Base GPE number for this register */
UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
UINT8 EnableForRun; /* GPEs to keep enabled when running */
- UINT8 BaseGpeNumber; /* Base GPE number for this register */
} ACPI_GPE_REGISTER_INFO;
@@ -534,10 +535,11 @@ typedef struct acpi_gpe_block_info
struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
- ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */
+ UINT64 Address; /* Base address of the block */
UINT32 RegisterCount; /* Number of register pairs in block */
UINT16 GpeCount; /* Number of individual GPEs in block */
- UINT8 BlockBaseNumber;/* Base GPE number for this block */
+ UINT16 BlockBaseNumber;/* Base GPE number for this block */
+ UINT8 SpaceId;
BOOLEAN Initialized; /* TRUE if this block is initialized */
} ACPI_GPE_BLOCK_INFO;
@@ -877,11 +879,13 @@ typedef union acpi_parse_value
#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
-#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */
-#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */
-#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_IGNORE 0x09 /* Not used at this time */
+#define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */
+#define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */
+#define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */
+#define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */
+#define ACPI_DASM_IGNORE 0x0B /* Not used at this time */
/*
* Generic operation (for example: If, While, Store)
@@ -1218,17 +1222,17 @@ typedef struct acpi_external_list
struct acpi_external_list *Next;
UINT32 Value;
UINT16 Length;
+ UINT16 Flags;
UINT8 Type;
- UINT8 Flags;
- BOOLEAN Resolved;
- BOOLEAN Emitted;
} ACPI_EXTERNAL_LIST;
/* Values for Flags field above */
-#define ACPI_IPATH_ALLOCATED 0x01
-#define ACPI_FROM_REFERENCE_FILE 0x02
+#define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
+#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
+#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
+#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
typedef struct acpi_external_file
@@ -1259,7 +1263,7 @@ typedef struct acpi_db_method_info
char *Name;
UINT32 Flags;
UINT32 NumLoops;
- char Pathname[128];
+ char Pathname[ACPI_DB_LINE_BUFFER_SIZE];
char **Args;
ACPI_OBJECT_TYPE *Types;
@@ -1286,6 +1290,7 @@ typedef struct acpi_integrity_info
} ACPI_INTEGRITY_INFO;
+#define ACPI_DB_DISABLE_OUTPUT 0x00
#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
#define ACPI_DB_CONSOLE_OUTPUT 0x02
#define ACPI_DB_DUPLICATE_OUTPUT 0x03
@@ -1348,4 +1353,18 @@ typedef struct ah_predefined_name
} AH_PREDEFINED_NAME;
+typedef struct ah_device_id
+{
+ char *Name;
+ char *Description;
+
+} AH_DEVICE_ID;
+
+typedef struct ah_uuid
+{
+ char *Description;
+ char *String;
+
+} AH_UUID;
+
#endif /* __ACLOCAL_H__ */
diff --git a/sys/contrib/dev/acpica/include/acmacros.h b/sys/contrib/dev/acpica/include/acmacros.h
index 28bd2af..19a3e8e 100644
--- a/sys/contrib/dev/acpica/include/acmacros.h
+++ b/sys/contrib/dev/acpica/include/acmacros.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,17 +64,21 @@
#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (UINT64) (val))
/*
- * printf() format helpers
+ * printf() format helpers. These macros are workarounds for the difficulties
+ * with emitting 64-bit integers and 64-bit pointers with the same code
+ * for both 32-bit and 64-bit hosts.
*/
-
-/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */
-
#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
+#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i)
+#define ACPI_PRINTF_UINT "0x%8.8X%8.8X"
+
#else
-#define ACPI_FORMAT_NATIVE_UINT(i) 0, (i)
+#define ACPI_FORMAT_NATIVE_UINT(i) 0, (UINT32) (i)
+#define ACPI_FORMAT_TO_UINT(i) (UINT32) (i)
+#define ACPI_PRINTF_UINT "0x%8.8X"
#endif
@@ -415,32 +419,6 @@
/*
- * Memory allocation tracking (DEBUG ONLY)
- */
-#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__
-
-#ifndef ACPI_DBG_TRACK_ALLOCATIONS
-
-/* Memory allocation */
-
-#define ACPI_ALLOCATE(a) AcpiUtAllocate((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
-#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroed((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
-#define ACPI_FREE(a) AcpiOsFree(a)
-#define ACPI_MEM_TRACKING(a)
-
-#else
-
-/* Memory allocation */
-
-#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
-#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
-#define ACPI_FREE(a) AcpiUtFreeAndTrack(a, ACPI_MEM_PARAMETERS)
-#define ACPI_MEM_TRACKING(a) a
-
-#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
-
-
-/*
* Macros used for ACPICA utilities only
*/
diff --git a/sys/contrib/dev/acpica/include/acnames.h b/sys/contrib/dev/acpica/include/acnames.h
index d6fdaa6..3297a73 100644
--- a/sys/contrib/dev/acpica/include/acnames.h
+++ b/sys/contrib/dev/acpica/include/acnames.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,24 +46,31 @@
/* Method names - these methods can appear anywhere in the namespace */
-#define METHOD_NAME__SB_ "_SB_"
-#define METHOD_NAME__HID "_HID"
-#define METHOD_NAME__CID "_CID"
-#define METHOD_NAME__UID "_UID"
-#define METHOD_NAME__SUB "_SUB"
#define METHOD_NAME__ADR "_ADR"
-#define METHOD_NAME__INI "_INI"
-#define METHOD_NAME__STA "_STA"
-#define METHOD_NAME__REG "_REG"
-#define METHOD_NAME__SEG "_SEG"
+#define METHOD_NAME__AEI "_AEI"
#define METHOD_NAME__BBN "_BBN"
-#define METHOD_NAME__PRT "_PRT"
+#define METHOD_NAME__CBA "_CBA"
+#define METHOD_NAME__CID "_CID"
#define METHOD_NAME__CRS "_CRS"
+#define METHOD_NAME__DDN "_DDN"
+#define METHOD_NAME__HID "_HID"
+#define METHOD_NAME__INI "_INI"
+#define METHOD_NAME__PLD "_PLD"
+#define METHOD_NAME__DSD "_DSD"
#define METHOD_NAME__PRS "_PRS"
-#define METHOD_NAME__AEI "_AEI"
+#define METHOD_NAME__PRT "_PRT"
#define METHOD_NAME__PRW "_PRW"
+#define METHOD_NAME__PS0 "_PS0"
+#define METHOD_NAME__PS1 "_PS1"
+#define METHOD_NAME__PS2 "_PS2"
+#define METHOD_NAME__PS3 "_PS3"
+#define METHOD_NAME__REG "_REG"
+#define METHOD_NAME__SB_ "_SB_"
+#define METHOD_NAME__SEG "_SEG"
#define METHOD_NAME__SRS "_SRS"
-#define METHOD_NAME__PLD "_PLD"
+#define METHOD_NAME__STA "_STA"
+#define METHOD_NAME__SUB "_SUB"
+#define METHOD_NAME__UID "_UID"
/* Method names - these methods must appear at the namespace root */
diff --git a/sys/contrib/dev/acpica/include/acnamesp.h b/sys/contrib/dev/acpica/include/acnamesp.h
index 2dba629..9fd3841 100644
--- a/sys/contrib/dev/acpica/include/acnamesp.h
+++ b/sys/contrib/dev/acpica/include/acnamesp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acobject.h b/sys/contrib/dev/acpica/include/acobject.h
index e755daa..c08c827 100644
--- a/sys/contrib/dev/acpica/include/acobject.h
+++ b/sys/contrib/dev/acpica/include/acobject.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -232,7 +232,8 @@ typedef struct acpi_object_method
#define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
#define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
#define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
-#define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */
+#define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */
+#define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */
/******************************************************************************
@@ -337,6 +338,7 @@ typedef struct acpi_object_region_field
UINT16 ResourceLength;
union acpi_operand_object *RegionObj; /* Containing OpRegion object */
UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */
+ UINT16 PinNumberIndex; /* Index relative to previous Connection/Template */
} ACPI_OBJECT_REGION_FIELD;
diff --git a/sys/contrib/dev/acpica/include/acopcode.h b/sys/contrib/dev/acpica/include/acopcode.h
index ba37842..b968fc6 100644
--- a/sys/contrib/dev/acpica/include/acopcode.h
+++ b/sys/contrib/dev/acpica/include/acopcode.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acoutput.h b/sys/contrib/dev/acpica/include/acoutput.h
index e7b1248..8f054ae 100644
--- a/sys/contrib/dev/acpica/include/acoutput.h
+++ b/sys/contrib/dev/acpica/include/acoutput.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acparser.h b/sys/contrib/dev/acpica/include/acparser.h
index 7f236d8..8d8adba 100644
--- a/sys/contrib/dev/acpica/include/acparser.h
+++ b/sys/contrib/dev/acpica/include/acparser.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ACPARSER_H__
#define __ACPARSER_H__
diff --git a/sys/contrib/dev/acpica/include/acpi.h b/sys/contrib/dev/acpica/include/acpi.h
index 5450ad4..aab3dd3 100644
--- a/sys/contrib/dev/acpica/include/acpi.h
+++ b/sys/contrib/dev/acpica/include/acpi.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,5 +62,6 @@
#include <contrib/dev/acpica/include/acrestyp.h> /* Resource Descriptor structs */
#include <contrib/dev/acpica/include/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */
#include <contrib/dev/acpica/include/acpixf.h> /* ACPI core subsystem external interfaces */
+#include <contrib/dev/acpica/include/platform/acenvex.h> /* Extra environment-specific items */
#endif /* __ACPI_H__ */
diff --git a/sys/contrib/dev/acpica/include/acpiosxf.h b/sys/contrib/dev/acpica/include/acpiosxf.h
index c948d3f..1a1aa1b 100644
--- a/sys/contrib/dev/acpica/include/acpiosxf.h
+++ b/sys/contrib/dev/acpica/include/acpiosxf.h
@@ -6,9 +6,8 @@
*
*****************************************************************************/
-
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -85,85 +84,111 @@ typedef struct acpi_signal_fatal_info
/*
* OSL Initialization and shutdown primitives
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
ACPI_STATUS
AcpiOsInitialize (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
ACPI_STATUS
AcpiOsTerminate (
void);
+#endif
/*
* ACPI Table interfaces
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetRootPointer
ACPI_PHYSICAL_ADDRESS
AcpiOsGetRootPointer (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPredefinedOverride
ACPI_STATUS
AcpiOsPredefinedOverride (
const ACPI_PREDEFINED_NAMES *InitVal,
ACPI_STRING *NewVal);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTableOverride
ACPI_STATUS
AcpiOsTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
ACPI_TABLE_HEADER **NewTable);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPhysicalTableOverride
ACPI_STATUS
AcpiOsPhysicalTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
ACPI_PHYSICAL_ADDRESS *NewAddress,
UINT32 *NewTableLength);
+#endif
/*
* Spinlock primitives
*/
-#ifndef AcpiOsCreateLock
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
ACPI_STATUS
AcpiOsCreateLock (
ACPI_SPINLOCK *OutHandle);
#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteLock
void
AcpiOsDeleteLock (
ACPI_SPINLOCK Handle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireLock
ACPI_CPU_FLAGS
AcpiOsAcquireLock (
ACPI_SPINLOCK Handle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseLock
void
AcpiOsReleaseLock (
ACPI_SPINLOCK Handle,
ACPI_CPU_FLAGS Flags);
+#endif
/*
* Semaphore primitives
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateSemaphore
ACPI_STATUS
AcpiOsCreateSemaphore (
UINT32 MaxUnits,
UINT32 InitialUnits,
ACPI_SEMAPHORE *OutHandle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteSemaphore
ACPI_STATUS
AcpiOsDeleteSemaphore (
ACPI_SEMAPHORE Handle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitSemaphore
ACPI_STATUS
AcpiOsWaitSemaphore (
ACPI_SEMAPHORE Handle,
UINT32 Units,
UINT16 Timeout);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignalSemaphore
ACPI_STATUS
AcpiOsSignalSemaphore (
ACPI_SEMAPHORE Handle,
UINT32 Units);
+#endif
/*
@@ -172,151 +197,208 @@ AcpiOsSignalSemaphore (
*/
#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateMutex
ACPI_STATUS
AcpiOsCreateMutex (
ACPI_MUTEX *OutHandle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteMutex
void
AcpiOsDeleteMutex (
ACPI_MUTEX Handle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireMutex
ACPI_STATUS
AcpiOsAcquireMutex (
ACPI_MUTEX Handle,
UINT16 Timeout);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseMutex
void
AcpiOsReleaseMutex (
ACPI_MUTEX Handle);
#endif
+#endif
+
/*
* Memory allocation and mapping
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
void *
AcpiOsAllocate (
ACPI_SIZE Size);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
+void *
+AcpiOsAllocateZeroed (
+ ACPI_SIZE Size);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
void
AcpiOsFree (
void * Memory);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
void *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS Where,
ACPI_SIZE Length);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
void
AcpiOsUnmapMemory (
void *LogicalAddress,
ACPI_SIZE Size);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetPhysicalAddress
ACPI_STATUS
AcpiOsGetPhysicalAddress (
void *LogicalAddress,
ACPI_PHYSICAL_ADDRESS *PhysicalAddress);
+#endif
/*
* Memory/Object Cache
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateCache
ACPI_STATUS
AcpiOsCreateCache (
char *CacheName,
UINT16 ObjectSize,
UINT16 MaxDepth,
ACPI_CACHE_T **ReturnCache);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteCache
ACPI_STATUS
AcpiOsDeleteCache (
ACPI_CACHE_T *Cache);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPurgeCache
ACPI_STATUS
AcpiOsPurgeCache (
ACPI_CACHE_T *Cache);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
void *
AcpiOsAcquireObject (
ACPI_CACHE_T *Cache);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseObject
ACPI_STATUS
AcpiOsReleaseObject (
ACPI_CACHE_T *Cache,
void *Object);
+#endif
/*
* Interrupt handlers
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInstallInterruptHandler
ACPI_STATUS
AcpiOsInstallInterruptHandler (
UINT32 InterruptNumber,
ACPI_OSD_HANDLER ServiceRoutine,
void *Context);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRemoveInterruptHandler
ACPI_STATUS
AcpiOsRemoveInterruptHandler (
UINT32 InterruptNumber,
ACPI_OSD_HANDLER ServiceRoutine);
+#endif
/*
* Threads and Scheduling
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
ACPI_THREAD_ID
AcpiOsGetThreadId (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsExecute
ACPI_STATUS
AcpiOsExecute (
ACPI_EXECUTE_TYPE Type,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitEventsComplete
void
AcpiOsWaitEventsComplete (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSleep
void
AcpiOsSleep (
UINT64 Milliseconds);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsStall
void
AcpiOsStall (
UINT32 Microseconds);
+#endif
/*
* Platform and hardware-independent I/O interfaces
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPort
ACPI_STATUS
AcpiOsReadPort (
ACPI_IO_ADDRESS Address,
UINT32 *Value,
UINT32 Width);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePort
ACPI_STATUS
AcpiOsWritePort (
ACPI_IO_ADDRESS Address,
UINT32 Value,
UINT32 Width);
+#endif
/*
* Platform and hardware-independent physical memory interfaces
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadMemory
ACPI_STATUS
AcpiOsReadMemory (
ACPI_PHYSICAL_ADDRESS Address,
UINT64 *Value,
UINT32 Width);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteMemory
ACPI_STATUS
AcpiOsWriteMemory (
ACPI_PHYSICAL_ADDRESS Address,
UINT64 Value,
UINT32 Width);
+#endif
/*
@@ -324,103 +406,131 @@ AcpiOsWriteMemory (
* Note: Can't use "Register" as a parameter, changed to "Reg" --
* certain compilers complain.
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPciConfiguration
ACPI_STATUS
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Reg,
UINT64 *Value,
UINT32 Width);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePciConfiguration
ACPI_STATUS
AcpiOsWritePciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Reg,
UINT64 Value,
UINT32 Width);
+#endif
/*
* Miscellaneous
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
BOOLEAN
AcpiOsReadable (
void *Pointer,
ACPI_SIZE Length);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
BOOLEAN
AcpiOsWritable (
void *Pointer,
ACPI_SIZE Length);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTimer
UINT64
AcpiOsGetTimer (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignal
ACPI_STATUS
AcpiOsSignal (
UINT32 Function,
void *Info);
+#endif
/*
* Debug print routines
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf
void ACPI_INTERNAL_VAR_XFACE
AcpiOsPrintf (
const char *Format,
...);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsVprintf
void
AcpiOsVprintf (
const char *Format,
va_list Args);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
void
AcpiOsRedirectOutput (
void *Destination);
+#endif
/*
* Debug input
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
ACPI_STATUS
AcpiOsGetLine (
char *Buffer,
UINT32 BufferLength,
UINT32 *BytesRead);
+#endif
/*
* Obtain ACPI table(s)
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
ACPI_STATUS
AcpiOsGetTableByName (
char *Signature,
UINT32 Instance,
ACPI_TABLE_HEADER **Table,
ACPI_PHYSICAL_ADDRESS *Address);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
ACPI_STATUS
AcpiOsGetTableByIndex (
UINT32 Index,
ACPI_TABLE_HEADER **Table,
UINT32 *Instance,
ACPI_PHYSICAL_ADDRESS *Address);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
ACPI_STATUS
AcpiOsGetTableByAddress (
ACPI_PHYSICAL_ADDRESS Address,
ACPI_TABLE_HEADER **Table);
+#endif
/*
* Directory manipulation
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
void *
AcpiOsOpenDirectory (
char *Pathname,
char *WildcardSpec,
char RequestedFileType);
+#endif
/* RequesteFileType values */
@@ -428,13 +538,66 @@ AcpiOsOpenDirectory (
#define REQUEST_DIR_ONLY 1
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
char *
AcpiOsGetNextFilename (
void *DirHandle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
void
AcpiOsCloseDirectory (
void *DirHandle);
+#endif
+
+
+/*
+ * File I/O and related support
+ */
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenFile
+ACPI_FILE
+AcpiOsOpenFile (
+ const char *Path,
+ UINT8 Modes);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseFile
+void
+AcpiOsCloseFile (
+ ACPI_FILE File);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadFile
+int
+AcpiOsReadFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteFile
+int
+AcpiOsWriteFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetFileOffset
+long
+AcpiOsGetFileOffset (
+ ACPI_FILE File);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSetFileOffset
+ACPI_STATUS
+AcpiOsSetFileOffset (
+ ACPI_FILE File,
+ long Offset,
+ UINT8 From);
+#endif
#endif /* __ACPIOSXF_H__ */
diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h
index 80f724a..93e9c14 100644
--- a/sys/contrib/dev/acpica/include/acpixf.h
+++ b/sys/contrib/dev/acpica/include/acpixf.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,62 +41,258 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ACXFACE_H__
#define __ACXFACE_H__
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20130823
+#define ACPI_CA_VERSION 0x20140926
#include <contrib/dev/acpica/include/acconfig.h>
#include <contrib/dev/acpica/include/actypes.h>
#include <contrib/dev/acpica/include/actbl.h>
#include <contrib/dev/acpica/include/acbuffer.h>
+
+/*****************************************************************************
+ *
+ * Macros used for ACPICA globals and configuration
+ *
+ ****************************************************************************/
+
/*
- * Globals that are publically available
+ * Ensure that global variables are defined and initialized only once.
+ *
+ * The use of these macros allows for a single list of globals (here)
+ * in order to simplify maintenance of the code.
*/
-extern UINT32 AcpiCurrentGpeCount;
-extern ACPI_TABLE_FADT AcpiGbl_FADT;
-extern BOOLEAN AcpiGbl_SystemAwakeAndRunning;
-extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */
-extern UINT8 AcpiGbl_OsiData;
+#ifdef DEFINE_ACPI_GLOBALS
+#define ACPI_GLOBAL(type,name) \
+ extern type name; \
+ type name
+
+#define ACPI_INIT_GLOBAL(type,name,value) \
+ type name=value
+
+#else
+#ifndef ACPI_GLOBAL
+#define ACPI_GLOBAL(type,name) \
+ extern type name
+#endif
+
+#ifndef ACPI_INIT_GLOBAL
+#define ACPI_INIT_GLOBAL(type,name,value) \
+ extern type name
+#endif
+#endif
+
+/*
+ * These macros configure the various ACPICA interfaces. They are
+ * useful for generating stub inline functions for features that are
+ * configured out of the current kernel or ACPICA application.
+ */
+#ifndef ACPI_EXTERNAL_RETURN_STATUS
+#define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_OK
+#define ACPI_EXTERNAL_RETURN_OK(Prototype) \
+ Prototype;
+#endif
-/* Runtime configuration of debug print levels */
+#ifndef ACPI_EXTERNAL_RETURN_VOID
+#define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_UINT32
+#define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_PTR
+#define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
+ Prototype;
+#endif
+
+
+/*****************************************************************************
+ *
+ * Public globals and runtime configuration options
+ *
+ ****************************************************************************/
+
+/*
+ * Enable "slack mode" of the AML interpreter? Default is FALSE, and the
+ * interpreter strictly follows the ACPI specification. Setting to TRUE
+ * allows the interpreter to ignore certain errors and/or bad AML constructs.
+ *
+ * Currently, these features are enabled by this flag:
+ *
+ * 1) Allow "implicit return" of last value in a control method
+ * 2) Allow access beyond the end of an operation region
+ * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
+ * 4) Allow ANY object type to be a source operand for the Store() operator
+ * 5) Allow unresolved references (invalid target name) in package objects
+ * 6) Enable warning messages for behavior that is not ACPI spec compliant
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE);
+
+/*
+ * Automatically serialize all methods that create named objects? Default
+ * is TRUE, meaning that all NonSerialized methods are scanned once at
+ * table load time to determine those that create named objects. Methods
+ * that create named objects are marked Serialized in order to prevent
+ * possible run-time problems if they are entered by more than one thread.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE);
-extern UINT32 AcpiDbgLevel;
-extern UINT32 AcpiDbgLayer;
+/*
+ * Create the predefined _OSI method in the namespace? Default is TRUE
+ * because ACPICA is fully compatible with other ACPI implementations.
+ * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE);
+
+/*
+ * Optionally use default values for the ACPI register widths. Set this to
+ * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE);
+
+/*
+ * Whether or not to verify the table checksum before installation. Set
+ * this to TRUE to verify the table checksum before install it to the table
+ * manager. Note that enabling this option causes errors to happen in some
+ * OSPMs during early initialization stages. Default behavior is to do such
+ * verification.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_VerifyTableChecksum, TRUE);
+
+/*
+ * Optionally enable output from the AML Debug Object.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE);
+
+/*
+ * Optionally copy the entire DSDT to local memory (instead of simply
+ * mapping it.) There are some BIOSs that corrupt or replace the original
+ * DSDT, creating the need for this option. Default is FALSE, do not copy
+ * the DSDT.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
+
+/*
+ * Optionally ignore an XSDT if present and use the RSDT instead.
+ * Although the ACPI specification requires that an XSDT be used instead
+ * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
+ * some machines. Default behavior is to use the XSDT if present.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
+
+/*
+ * Optionally use 32-bit FADT addresses if and when there is a conflict
+ * (address mismatch) between the 32-bit and 64-bit versions of the
+ * address. Although ACPICA adheres to the ACPI specification which
+ * requires the use of the corresponding 64-bit address if it is non-zero,
+ * some machines have been found to have a corrupted non-zero 64-bit
+ * address. Default is FALSE, do not favor the 32-bit addresses.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE);
+
+/*
+ * Optionally truncate I/O addresses to 16 bits. Provides compatibility
+ * with other ACPI implementations. NOTE: During ACPICA initialization,
+ * this value is set to TRUE if any Windows OSI strings have been
+ * requested by the BIOS.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE);
+
+/*
+ * Disable runtime checking and repair of values returned by control methods.
+ * Use only if the repair is causing a problem on a particular machine.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE);
+
+/*
+ * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
+ * This can be useful for debugging ACPI problems on some machines.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE);
+
+/*
+ * We keep track of the latest version of Windows that has been requested by
+ * the BIOS. ACPI 5.0.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0);
+
+/*
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
+ */
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE);
+
+/*
+ * This mechanism is used to trace a specified AML method. The method is
+ * traced each time it is executed.
+ */
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceFlags, 0);
+ACPI_INIT_GLOBAL (ACPI_NAME, AcpiGbl_TraceMethodName, 0);
+
+/*
+ * Runtime configuration of debug output control masks. We want the debug
+ * switches statically initialized so they are already set when the debugger
+ * is entered.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_DEBUG_DEFAULT);
+#else
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_NORMAL_DEFAULT);
+#endif
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLayer, ACPI_COMPONENT_DEFAULT);
-/* ACPICA runtime options */
+/*
+ * Other miscellaneous globals
+ */
+ACPI_GLOBAL (ACPI_TABLE_FADT, AcpiGbl_FADT);
+ACPI_GLOBAL (UINT32, AcpiCurrentGpeCount);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
-extern UINT8 AcpiGbl_EnableInterpreterSlack;
-extern UINT8 AcpiGbl_AllMethodsSerialized;
-extern UINT8 AcpiGbl_CreateOsiMethod;
-extern UINT8 AcpiGbl_UseDefaultRegisterWidths;
-extern ACPI_NAME AcpiGbl_TraceMethodName;
-extern UINT32 AcpiGbl_TraceFlags;
-extern UINT8 AcpiGbl_EnableAmlDebugObject;
-extern UINT8 AcpiGbl_CopyDsdtLocally;
-extern UINT8 AcpiGbl_TruncateIoAddresses;
-extern UINT8 AcpiGbl_DisableAutoRepair;
-extern UINT8 AcpiGbl_DisableSsdtTableLoad;
+/*****************************************************************************
+ *
+ * ACPICA public interface configuration.
+ *
+ * Interfaces that are configured out of the ACPICA build are replaced
+ * by inlined stubs by default.
+ *
+ ****************************************************************************/
/*
- * Hardware-reduced prototypes. All interfaces that use these macros will
- * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
+ * Hardware-reduced prototypes (default: Not hardware reduced).
+ *
+ * All ACPICA hardware-related interfaces that use these macros will be
+ * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
* is set to TRUE.
+ *
+ * Note: This static build option for reduced hardware is intended to
+ * reduce ACPICA code size if desired or necessary. However, even if this
+ * option is not specified, the runtime behavior of ACPICA is dependent
+ * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
+ * the flag will enable similar behavior -- ACPICA will not attempt
+ * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
*/
#if (!ACPI_REDUCED_HARDWARE)
#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_STATUS(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_OK(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_VOID(Prototype)
#else
#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
@@ -106,35 +302,100 @@ extern UINT8 AcpiGbl_DisableSsdtTableLoad;
static ACPI_INLINE Prototype {return(AE_OK);}
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
- static ACPI_INLINE Prototype {}
+ static ACPI_INLINE Prototype {return;}
#endif /* !ACPI_REDUCED_HARDWARE */
/*
+ * Error message prototypes (default: error messages enabled).
+ *
+ * All interfaces related to error and warning messages
+ * will be configured out of the ACPICA build if the
+ * ACPI_NO_ERROR_MESSAGE flag is defined.
+ */
+#ifndef ACPI_NO_ERROR_MESSAGES
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
+
+
+/*
+ * Debugging output prototypes (default: no debug output).
+ *
+ * All interfaces related to debug output messages
+ * will be configured out of the ACPICA build unless the
+ * ACPI_DEBUG_OUTPUT flag is defined.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_DEBUG_OUTPUT */
+
+
+/*
+ * Application prototypes
+ *
+ * All interfaces used by application will be configured
+ * out of the ACPICA build unless the ACPI_APPLICATION
+ * flag is defined.
+ */
+#ifdef ACPI_APPLICATION
+#define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_APPLICATION */
+
+
+/*****************************************************************************
+ *
+ * ACPICA public interface prototypes
+ *
+ ****************************************************************************/
+
+/*
* Initialization
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeTables (
ACPI_TABLE_DESC *InitialStorage,
UINT32 InitialTableCount,
- BOOLEAN AllowResize);
+ BOOLEAN AllowResize))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeSubsystem (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnableSubsystem (
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeObjects (
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiTerminate (
- void);
+ void))
/*
@@ -150,124 +411,136 @@ ACPI_STATUS
AcpiDisable (
void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiSubsystemStatus (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetSystemInfo (
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetStatistics (
- ACPI_STATISTICS *Stats);
+ ACPI_STATISTICS *Stats))
+ACPI_EXTERNAL_RETURN_PTR (
const char *
AcpiFormatException (
- ACPI_STATUS Exception);
+ ACPI_STATUS Exception))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiPurgeCachedObjects (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInterface (
- ACPI_STRING InterfaceName);
+ ACPI_STRING InterfaceName))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveInterface (
- ACPI_STRING InterfaceName);
+ ACPI_STRING InterfaceName))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUpdateInterfaces (
- UINT8 Action);
+ UINT8 Action))
+ACPI_EXTERNAL_RETURN_UINT32 (
UINT32
AcpiCheckAddressRange (
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_PHYSICAL_ADDRESS Address,
ACPI_SIZE Length,
- BOOLEAN Warn);
+ BOOLEAN Warn))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDecodePldBuffer (
UINT8 *InBuffer,
ACPI_SIZE Length,
- ACPI_PLD_INFO **ReturnBuffer);
-
-/*
- * ACPI Memory management
- */
-void *
-AcpiAllocate (
- UINT32 Size);
-
-void *
-AcpiCallocate (
- UINT32 Size);
-
-void
-AcpiFree (
- void *Address);
+ ACPI_PLD_INFO **ReturnBuffer))
/*
* ACPI table load/unload interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
+ACPI_STATUS
+AcpiInstallTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ BOOLEAN Physical))
+
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTable (
- ACPI_TABLE_HEADER *Table);
+ ACPI_TABLE_HEADER *Table))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUnloadParentTable (
- ACPI_HANDLE Object);
+ ACPI_HANDLE Object))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTables (
- void);
+ void))
/*
* ACPI table manipulation interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReallocateRootTable (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiFindRootPointer (
- ACPI_SIZE *RsdpAddress);
+ ACPI_SIZE *RsdpAddress))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTableHeader (
ACPI_STRING Signature,
UINT32 Instance,
- ACPI_TABLE_HEADER *OutTableHeader);
+ ACPI_TABLE_HEADER *OutTableHeader))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTable (
ACPI_STRING Signature,
UINT32 Instance,
- ACPI_TABLE_HEADER **OutTable);
+ ACPI_TABLE_HEADER **OutTable))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTableByIndex (
UINT32 TableIndex,
- ACPI_TABLE_HEADER **OutTable);
+ ACPI_TABLE_HEADER **OutTable))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallTableHandler (
ACPI_TABLE_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveTableHandler (
- ACPI_TABLE_HANDLER Handler);
+ ACPI_TABLE_HANDLER Handler))
/*
* Namespace and name interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
@@ -276,104 +549,119 @@ AcpiWalkNamespace (
ACPI_WALK_CALLBACK DescendingCallback,
ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
- void **ReturnValue);
+ void **ReturnValue))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetDevices (
char *HID,
ACPI_WALK_CALLBACK UserFunction,
void *Context,
- void **ReturnValue);
+ void **ReturnValue))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetName (
ACPI_HANDLE Object,
UINT32 NameType,
- ACPI_BUFFER *RetPathPtr);
+ ACPI_BUFFER *RetPathPtr))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetHandle (
ACPI_HANDLE Parent,
ACPI_STRING Pathname,
- ACPI_HANDLE *RetHandle);
+ ACPI_HANDLE *RetHandle))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiAttachData (
ACPI_HANDLE Object,
ACPI_OBJECT_HANDLER Handler,
- void *Data);
+ void *Data))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDetachData (
ACPI_HANDLE Object,
- ACPI_OBJECT_HANDLER Handler);
+ ACPI_OBJECT_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetData (
ACPI_HANDLE Object,
ACPI_OBJECT_HANDLER Handler,
- void **Data);
+ void **Data))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDebugTrace (
char *Name,
UINT32 DebugLevel,
UINT32 DebugLayer,
- UINT32 Flags);
+ UINT32 Flags))
/*
* Object manipulation and enumeration
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEvaluateObject (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ParameterObjects,
- ACPI_BUFFER *ReturnObjectBuffer);
+ ACPI_BUFFER *ReturnObjectBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEvaluateObjectTyped (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ExternalParams,
ACPI_BUFFER *ReturnBuffer,
- ACPI_OBJECT_TYPE ReturnType);
+ ACPI_OBJECT_TYPE ReturnType))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetObjectInfo (
ACPI_HANDLE Object,
- ACPI_DEVICE_INFO **ReturnBuffer);
+ ACPI_DEVICE_INFO **ReturnBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallMethod (
- UINT8 *Buffer);
+ UINT8 *Buffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetNextObject (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE Parent,
ACPI_HANDLE Child,
- ACPI_HANDLE *OutHandle);
+ ACPI_HANDLE *OutHandle))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetType (
ACPI_HANDLE Object,
- ACPI_OBJECT_TYPE *OutType);
+ ACPI_OBJECT_TYPE *OutType))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetParent (
ACPI_HANDLE Object,
- ACPI_HANDLE *OutHandle);
+ ACPI_HANDLE *OutHandle))
/*
* Handler interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInitializationHandler (
ACPI_INIT_HANDLER Handler,
- UINT32 Function);
+ UINT32 Function))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -421,40 +709,46 @@ AcpiRemoveGpeHandler (
UINT32 GpeNumber,
ACPI_GPE_HANDLER Address))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
ACPI_NOTIFY_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
- ACPI_NOTIFY_HANDLER Handler);
+ ACPI_NOTIFY_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallAddressSpaceHandler (
ACPI_HANDLE Device,
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_ADR_SPACE_HANDLER Handler,
ACPI_ADR_SPACE_SETUP Setup,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveAddressSpaceHandler (
ACPI_HANDLE Device,
ACPI_ADR_SPACE_TYPE SpaceId,
- ACPI_ADR_SPACE_HANDLER Handler);
+ ACPI_ADR_SPACE_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallExceptionHandler (
- ACPI_EXCEPTION_HANDLER Handler);
+ ACPI_EXCEPTION_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInterfaceHandler (
- ACPI_INTERFACE_HANDLER Handler);
+ ACPI_INTERFACE_HANDLER Handler))
/*
@@ -475,16 +769,18 @@ AcpiReleaseGlobalLock (
/*
* Interfaces to AML mutex objects
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiAcquireMutex (
ACPI_HANDLE Handle,
ACPI_STRING Pathname,
- UINT16 Timeout);
+ UINT16 Timeout))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReleaseMutex (
ACPI_HANDLE Handle,
- ACPI_STRING Pathname);
+ ACPI_STRING Pathname))
/*
@@ -555,6 +851,12 @@ AcpiFinishGpe (
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
+AcpiMarkGpeForWake (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber))
+
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
AcpiSetupGpeForWake (
ACPI_HANDLE ParentDevice,
ACPI_HANDLE GpeDevice,
@@ -612,79 +914,92 @@ ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
ACPI_RESOURCE *Resource,
void *Context);
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetVendorResource (
ACPI_HANDLE Device,
char *Name,
ACPI_VENDOR_UUID *Uuid,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetCurrentResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetPossibleResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetEventResources (
ACPI_HANDLE DeviceHandle,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkResourceBuffer (
ACPI_BUFFER *Buffer,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkResources (
ACPI_HANDLE Device,
char *Name,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiSetCurrentResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *InBuffer);
+ ACPI_BUFFER *InBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetIrqRoutingTable (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiResourceToAddress64 (
ACPI_RESOURCE *Resource,
- ACPI_RESOURCE_ADDRESS64 *Out);
+ ACPI_RESOURCE_ADDRESS64 *Out))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiBufferToResource (
UINT8 *AmlBuffer,
UINT16 AmlBufferLength,
- ACPI_RESOURCE **ResourcePtr);
+ ACPI_RESOURCE **ResourcePtr))
/*
* Hardware (ACPI device) interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReset (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRead (
UINT64 *Value,
- ACPI_GENERIC_ADDRESS *Reg);
+ ACPI_GENERIC_ADDRESS *Reg))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWrite (
UINT64 Value,
- ACPI_GENERIC_ADDRESS *Reg);
+ ACPI_GENERIC_ADDRESS *Reg))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -702,32 +1017,37 @@ AcpiWriteBitRegister (
/*
* Sleep/Wake interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetSleepTypeData (
UINT8 SleepState,
UINT8 *Slp_TypA,
- UINT8 *Slp_TypB);
+ UINT8 *Slp_TypB))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStatePrep (
- UINT8 SleepState);
+ UINT8 SleepState))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepState (
- UINT8 SleepState);
+ UINT8 SleepState))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStateS4bios (
void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLeaveSleepStatePrep (
- UINT8 SleepState);
+ UINT8 SleepState))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLeaveSleepState (
- UINT8 SleepState);
+ UINT8 SleepState))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -766,55 +1086,67 @@ AcpiGetTimerDuration (
/*
* Error/Warning output
*/
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(4)
void ACPI_INTERNAL_VAR_XFACE
AcpiException (
const char *ModuleName,
UINT32 LineNumber,
ACPI_STATUS Status,
const char *Format,
- ...) ACPI_PRINTF_LIKE(4);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiInfo (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiBiosError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiBiosWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
/*
* Debug output
*/
-#ifdef ACPI_DEBUG_OUTPUT
-
+ACPI_DBG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(6)
void ACPI_INTERNAL_VAR_XFACE
AcpiDebugPrint (
UINT32 RequestedDebugLevel,
@@ -823,8 +1155,10 @@ AcpiDebugPrint (
const char *ModuleName,
UINT32 ComponentId,
const char *Format,
- ...) ACPI_PRINTF_LIKE(6);
+ ...))
+ACPI_DBG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(6)
void ACPI_INTERNAL_VAR_XFACE
AcpiDebugPrintRaw (
UINT32 RequestedDebugLevel,
@@ -833,7 +1167,13 @@ AcpiDebugPrintRaw (
const char *ModuleName,
UINT32 ComponentId,
const char *Format,
- ...) ACPI_PRINTF_LIKE(6);
-#endif
+ ...))
+
+ACPI_APP_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(1)
+void ACPI_INTERNAL_VAR_XFACE
+AcpiLogError (
+ const char *Format,
+ ...))
#endif /* __ACXFACE_H__ */
diff --git a/sys/contrib/dev/acpica/include/acpredef.h b/sys/contrib/dev/acpica/include/acpredef.h
index 46f3d69..c41ab03 100644
--- a/sys/contrib/dev/acpica/include/acpredef.h
+++ b/sys/contrib/dev/acpica/include/acpredef.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@
*
* Return Package types
*
- * 1) PTYPE1 packages do not contain sub-packages.
+ * 1) PTYPE1 packages do not contain subpackages.
*
* ACPI_PTYPE1_FIXED: Fixed-length length, 1 or 2 object types:
* object type
@@ -64,8 +64,8 @@
* (Used for _PRW)
*
*
- * 2) PTYPE2 packages contain a Variable-length number of sub-packages. Each
- * of the different types describe the contents of each of the sub-packages.
+ * 2) PTYPE2 packages contain a Variable-length number of subpackages. Each
+ * of the different types describe the contents of each of the subpackages.
*
* ACPI_PTYPE2: Each subpackage contains 1 or 2 object types. Zero-length
* parent package is allowed:
@@ -106,6 +106,11 @@
* count = 0 (optional)
* (Used for _DLM)
*
+ * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
+ * defines the format of the package. Zero-length parent package is
+ * allowed.
+ * (Used for _DSD)
+ *
*****************************************************************************/
enum AcpiReturnPackageTypes
@@ -119,7 +124,8 @@ enum AcpiReturnPackageTypes
ACPI_PTYPE2_FIXED = 7,
ACPI_PTYPE2_MIN = 8,
ACPI_PTYPE2_REV_FIXED = 9,
- ACPI_PTYPE2_FIX_VAR = 10
+ ACPI_PTYPE2_FIX_VAR = 10,
+ ACPI_PTYPE2_UUID_PAIR = 11
};
@@ -366,6 +372,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
{{"_CBA", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
+ {{"_CCA", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
+
{{"_CDM", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
@@ -434,6 +443,10 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
{{"_DOS", METHOD_1ARGS (ACPI_TYPE_INTEGER),
METHOD_NO_RETURN_VALUE}},
+ {{"_DSD", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
+ PACKAGE_INFO (ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_PACKAGE, 1,0),
+
{{"_DSM", METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE),
METHOD_RETURNS (ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */
@@ -554,7 +567,7 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
/*
* For _HPX, a single package is returned, containing a variable-length number
- * of sub-packages. Each sub-package contains a PCI record setting.
+ * of subpackages. Each subpackage contains a PCI record setting.
* There are several different type of record settings, of different
* lengths, but all elements of all settings are Integers.
*/
@@ -580,6 +593,10 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
{{"_LID", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+ {{"_LPD", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Int) */
+ PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0),
+
{{"_MAT", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
diff --git a/sys/contrib/dev/acpica/include/acresrc.h b/sys/contrib/dev/acpica/include/acresrc.h
index b894e2f..5f79274 100644
--- a/sys/contrib/dev/acpica/include/acresrc.h
+++ b/sys/contrib/dev/acpica/include/acresrc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -197,7 +197,7 @@ AcpiRsCreateResourceList (
ACPI_STATUS
AcpiRsCreateAmlResources (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_BUFFER *ResourceList,
ACPI_BUFFER *OutputBuffer);
ACPI_STATUS
@@ -251,7 +251,8 @@ AcpiRsGetListLength (
ACPI_STATUS
AcpiRsGetAmlLength (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_RESOURCE *ResourceList,
+ ACPI_SIZE ResourceListSize,
ACPI_SIZE *SizeNeeded);
ACPI_STATUS
diff --git a/sys/contrib/dev/acpica/include/acrestyp.h b/sys/contrib/dev/acpica/include/acrestyp.h
index 9d69825..b0412aa 100644
--- a/sys/contrib/dev/acpica/include/acrestyp.h
+++ b/sys/contrib/dev/acpica/include/acrestyp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acstruct.h b/sys/contrib/dev/acpica/include/acstruct.h
index a6ba5ea..5a0baf4 100644
--- a/sys/contrib/dev/acpica/include/acstruct.h
+++ b/sys/contrib/dev/acpica/include/acstruct.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -139,6 +139,9 @@ typedef struct acpi_init_walk_info
UINT32 TableIndex;
UINT32 ObjectCount;
UINT32 MethodCount;
+ UINT32 SerialMethodCount;
+ UINT32 NonSerialMethodCount;
+ UINT32 SerializedMethodCount;
UINT32 DeviceCount;
UINT32 OpRegionCount;
UINT32 FieldCount;
diff --git a/sys/contrib/dev/acpica/include/actables.h b/sys/contrib/dev/acpica/include/actables.h
index 4295894..2e30658 100644
--- a/sys/contrib/dev/acpica/include/actables.h
+++ b/sys/contrib/dev/acpica/include/actables.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,10 @@ AcpiAllocateRootTable (
/*
* tbxfroot - Root pointer utilities
*/
+UINT32
+AcpiTbGetRsdpLength (
+ ACPI_TABLE_RSDP *Rsdp);
+
ACPI_STATUS
AcpiTbValidateRsdp (
ACPI_TABLE_RSDP *Rsdp);
@@ -63,6 +67,49 @@ AcpiTbScanMemoryForRsdp (
/*
+ * tbdata - table data structure management
+ */
+ACPI_STATUS
+AcpiTbGetNextRootIndex (
+ UINT32 *TableIndex);
+
+void
+AcpiTbInitTableDescriptor (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags,
+ ACPI_TABLE_HEADER *Table);
+
+ACPI_STATUS
+AcpiTbAcquireTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags);
+
+void
+AcpiTbReleaseTempTable (
+ ACPI_TABLE_DESC *TableDesc);
+
+ACPI_STATUS
+AcpiTbValidateTempTable (
+ ACPI_TABLE_DESC *TableDesc);
+
+ACPI_STATUS
+AcpiTbVerifyTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ char *Signature);
+
+BOOLEAN
+AcpiTbIsTableLoaded (
+ UINT32 TableIndex);
+
+void
+AcpiTbSetTableLoadedFlag (
+ UINT32 TableIndex,
+ BOOLEAN IsLoaded);
+
+
+/*
* tbfadt - FADT parse/convert/validate
*/
void
@@ -94,17 +141,36 @@ AcpiTbResizeRootTableList (
void);
ACPI_STATUS
-AcpiTbVerifyTable (
+AcpiTbValidateTable (
ACPI_TABLE_DESC *TableDesc);
-ACPI_TABLE_HEADER *
-AcpiTbTableOverride (
- ACPI_TABLE_HEADER *TableHeader,
+void
+AcpiTbInvalidateTable (
ACPI_TABLE_DESC *TableDesc);
+void
+AcpiTbOverrideTable (
+ ACPI_TABLE_DESC *OldTableDesc);
+
ACPI_STATUS
-AcpiTbAddTable (
+AcpiTbAcquireTable (
ACPI_TABLE_DESC *TableDesc,
+ ACPI_TABLE_HEADER **TablePtr,
+ UINT32 *TableLength,
+ UINT8 *TableFlags);
+
+void
+AcpiTbReleaseTable (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 TableLength,
+ UINT8 TableFlags);
+
+ACPI_STATUS
+AcpiTbInstallStandardTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags,
+ BOOLEAN Reload,
+ BOOLEAN Override,
UINT32 *TableIndex);
ACPI_STATUS
@@ -116,7 +182,7 @@ AcpiTbStoreTable (
UINT32 *TableIndex);
void
-AcpiTbDeleteTable (
+AcpiTbUninstallTable (
ACPI_TABLE_DESC *TableDesc);
void
@@ -140,15 +206,6 @@ AcpiTbGetOwnerId (
UINT32 TableIndex,
ACPI_OWNER_ID *OwnerId);
-BOOLEAN
-AcpiTbIsTableLoaded (
- UINT32 TableIndex);
-
-void
-AcpiTbSetTableLoadedFlag (
- UINT32 TableIndex,
- BOOLEAN IsLoaded);
-
/*
* tbutils - table manager utilities
@@ -185,7 +242,13 @@ AcpiTbCopyDsdt (
UINT32 TableIndex);
void
-AcpiTbInstallTable (
+AcpiTbInstallTableWithOverride (
+ UINT32 TableIndex,
+ ACPI_TABLE_DESC *NewTableDesc,
+ BOOLEAN Override);
+
+ACPI_STATUS
+AcpiTbInstallFixedTable (
ACPI_PHYSICAL_ADDRESS Address,
char *Signature,
UINT32 TableIndex);
diff --git a/sys/contrib/dev/acpica/include/actbl.h b/sys/contrib/dev/acpica/include/actbl.h
index d77d6c4..707511d 100644
--- a/sys/contrib/dev/acpica/include/actbl.h
+++ b/sys/contrib/dev/acpica/include/actbl.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -203,6 +203,9 @@ typedef struct acpi_table_xsdt
} ACPI_TABLE_XSDT;
+#define ACPI_RSDT_ENTRY_SIZE (sizeof (UINT32))
+#define ACPI_XSDT_ENTRY_SIZE (sizeof (UINT64))
+
/*******************************************************************************
*
@@ -293,7 +296,8 @@ typedef struct acpi_table_fadt
UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */
ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */
UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */
- UINT8 Reserved4[3]; /* Reserved, must be zero */
+ UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
+ UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */
UINT64 XFacs; /* 64-bit physical address of FACS */
UINT64 XDsdt; /* 64-bit physical address of DSDT */
ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -310,7 +314,7 @@ typedef struct acpi_table_fadt
} ACPI_TABLE_FADT;
-/* Masks for FADT Boot Architecture Flags (BootFlags) [Vx]=Introduced in this FADT revision */
+/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -319,6 +323,11 @@ typedef struct acpi_table_fadt
#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */
+/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
+
+#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */
+#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
+
/* Masks for FADT flags */
#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */
@@ -399,12 +408,11 @@ typedef struct acpi_table_desc
/* Masks for Flags field above */
-#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
-#define ACPI_TABLE_ORIGIN_MAPPED (1)
-#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
-#define ACPI_TABLE_ORIGIN_OVERRIDE (4)
-#define ACPI_TABLE_ORIGIN_MASK (7)
-#define ACPI_TABLE_IS_LOADED (8)
+#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */
+#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */
+#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */
+#define ACPI_TABLE_ORIGIN_MASK (3)
+#define ACPI_TABLE_IS_LOADED (8)
/*
@@ -433,7 +441,7 @@ typedef struct acpi_table_desc
* FADT V5 size: 0x10C
*/
#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
-#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3)
+#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1)
#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl))
#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
diff --git a/sys/contrib/dev/acpica/include/actbl1.h b/sys/contrib/dev/acpica/include/actbl1.h
index 67579da..a781056 100644
--- a/sys/contrib/dev/acpica/include/actbl1.h
+++ b/sys/contrib/dev/acpica/include/actbl1.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -524,7 +524,7 @@ typedef struct acpi_hest_aer_common
UINT8 Enabled;
UINT32 RecordsToPreallocate;
UINT32 MaxSectionsPerRecord;
- UINT32 Bus;
+ UINT32 Bus; /* Bus and Segment numbers */
UINT16 Device;
UINT16 Function;
UINT16 DeviceControl;
@@ -541,6 +541,14 @@ typedef struct acpi_hest_aer_common
#define ACPI_HEST_FIRMWARE_FIRST (1)
#define ACPI_HEST_GLOBAL (1<<1)
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ * Bus number is encoded in bits 7:0
+ * Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF)
+
/* Hardware Error Notification */
@@ -754,25 +762,27 @@ typedef struct acpi_table_madt
enum AcpiMadtType
{
- ACPI_MADT_TYPE_LOCAL_APIC = 0,
- ACPI_MADT_TYPE_IO_APIC = 1,
- ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
- ACPI_MADT_TYPE_NMI_SOURCE = 3,
- ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
- ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
- ACPI_MADT_TYPE_IO_SAPIC = 6,
- ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
- ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
- ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
- ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
- ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
- ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
- ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
+ ACPI_MADT_TYPE_LOCAL_APIC = 0,
+ ACPI_MADT_TYPE_IO_APIC = 1,
+ ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
+ ACPI_MADT_TYPE_NMI_SOURCE = 3,
+ ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
+ ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
+ ACPI_MADT_TYPE_IO_SAPIC = 6,
+ ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
+ ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
+ ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
+ ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
+ ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
+ ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
+ ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
+ ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
+ ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */
};
/*
- * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC */
@@ -928,16 +938,27 @@ typedef struct acpi_madt_generic_interrupt
{
ACPI_SUBTABLE_HEADER Header;
UINT16 Reserved; /* Reserved - must be zero */
- UINT32 GicId;
+ UINT32 CpuInterfaceNumber;
UINT32 Uid;
UINT32 Flags;
UINT32 ParkingVersion;
UINT32 PerformanceInterrupt;
UINT64 ParkedAddress;
UINT64 BaseAddress;
+ UINT64 GicvBaseAddress;
+ UINT64 GichBaseAddress;
+ UINT32 VgicInterrupt;
+ UINT64 GicrBaseAddress;
+ UINT64 ArmMpidr;
} ACPI_MADT_GENERIC_INTERRUPT;
+/* Masks for Flags field above */
+
+/* ACPI_MADT_ENABLED (1) Processor is usable if set */
+#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
+
/* 12: Generic Distributor (ACPI 5.0) */
@@ -953,11 +974,42 @@ typedef struct acpi_madt_generic_distributor
} ACPI_MADT_GENERIC_DISTRIBUTOR;
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_msi_frame
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved; /* Reserved - must be zero */
+ UINT32 MsiFrameId;
+ UINT64 BaseAddress;
+ UINT32 Flags;
+ UINT16 SpiCount;
+ UINT16 SpiBase;
+
+} ACPI_MADT_GENERIC_MSI_FRAME;
+
+/* Masks for Flags field above */
+
+#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
+
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_redistributor
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved; /* reserved - must be zero */
+ UINT64 BaseAddress;
+ UINT32 Length;
+
+} ACPI_MADT_GENERIC_REDISTRIBUTOR;
+
+
/*
* Common flags fields for MADT subtables
*/
-/* MADT Local APIC flags (LapicFlags) and GIC flags */
+/* MADT Local APIC flags */
#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
@@ -1066,11 +1118,12 @@ enum AcpiSratType
ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
- ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
+ ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
+ ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
};
/*
- * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC/SAPIC Affinity */
@@ -1083,7 +1136,7 @@ typedef struct acpi_srat_cpu_affinity
UINT32 Flags;
UINT8 LocalSapicEid;
UINT8 ProximityDomainHi[3];
- UINT32 Reserved; /* Reserved, must be zero */
+ UINT32 ClockDomain;
} ACPI_SRAT_CPU_AFFINITY;
@@ -1133,6 +1186,22 @@ typedef struct acpi_srat_x2apic_cpu_affinity
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
+/* 3: GICC Affinity (ACPI 5.1) */
+
+typedef struct acpi_srat_gicc_affinity
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 ProximityDomain;
+ UINT32 AcpiProcessorUid;
+ UINT32 Flags;
+ UINT32 ClockDomain;
+
+} ACPI_SRAT_GICC_AFFINITY;
+
+/* Flags for ACPI_SRAT_GICC_AFFINITY */
+
+#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
+
/* Reset to default packing */
#pragma pack()
diff --git a/sys/contrib/dev/acpica/include/actbl2.h b/sys/contrib/dev/acpica/include/actbl2.h
index 327a810..a6f2f20 100644
--- a/sys/contrib/dev/acpica/include/actbl2.h
+++ b/sys/contrib/dev/acpica/include/actbl2.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -72,6 +72,7 @@
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
+#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
@@ -373,6 +374,14 @@ typedef struct acpi_table_dbg2
} ACPI_TABLE_DBG2;
+typedef struct acpi_dbg2_header
+{
+ UINT32 InfoOffset;
+ UINT32 InfoCount;
+
+} ACPI_DBG2_HEADER;
+
+
/* Debug Device Information Subtable */
typedef struct acpi_dbg2_device
@@ -441,7 +450,7 @@ typedef struct acpi_table_dbgp
* Version 1
*
* Conforms to "Intel Virtualization Technology for Directed I/O",
- * Version 1.2, Sept. 2008
+ * Version 2.2, Sept. 2013
*
******************************************************************************/
@@ -474,9 +483,10 @@ enum AcpiDmarType
{
ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
- ACPI_DMAR_TYPE_ATSR = 2,
- ACPI_DMAR_HARDWARE_AFFINITY = 3,
- ACPI_DMAR_TYPE_RESERVED = 4 /* 4 and greater are reserved */
+ ACPI_DMAR_TYPE_ROOT_ATS = 2,
+ ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
+ ACPI_DMAR_TYPE_NAMESPACE = 4,
+ ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */
};
@@ -492,7 +502,7 @@ typedef struct acpi_dmar_device_scope
} ACPI_DMAR_DEVICE_SCOPE;
-/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
+/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
enum AcpiDmarScopeType
{
@@ -501,7 +511,8 @@ enum AcpiDmarScopeType
ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
ACPI_DMAR_SCOPE_TYPE_HPET = 4,
- ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */
+ ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
+ ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */
};
typedef struct acpi_dmar_pci_path
@@ -513,7 +524,7 @@ typedef struct acpi_dmar_pci_path
/*
- * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
+ * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
*/
/* 0: Hardware Unit Definition */
@@ -578,6 +589,18 @@ typedef struct acpi_dmar_rhsa
} ACPI_DMAR_RHSA;
+/* 4: ACPI Namespace Device Declaration Structure */
+
+typedef struct acpi_dmar_andd
+{
+ ACPI_DMAR_HEADER Header;
+ UINT8 Reserved[3];
+ UINT8 DeviceNumber;
+ char DeviceName[1];
+
+} ACPI_DMAR_ANDD;
+
+
/*******************************************************************************
*
* HPET - High Precision Event Timer table
@@ -926,7 +949,83 @@ typedef struct acpi_ivrs_memory
/*******************************************************************************
*
- * MCFG - PCI Memory Mapped Configuration table and sub-table
+ * LPIT - Low Power Idle Table
+ *
+ * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_lpit
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_LPIT;
+
+
+/* LPIT subtable header */
+
+typedef struct acpi_lpit_header
+{
+ UINT32 Type; /* Subtable type */
+ UINT32 Length; /* Subtable length */
+ UINT16 UniqueId;
+ UINT16 Reserved;
+ UINT32 Flags;
+
+} ACPI_LPIT_HEADER;
+
+/* Values for subtable Type above */
+
+enum AcpiLpitType
+{
+ ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
+ ACPI_LPIT_TYPE_SIMPLE_IO = 0x01
+};
+
+/* Masks for Flags field above */
+
+#define ACPI_LPIT_STATE_DISABLED (1)
+#define ACPI_LPIT_NO_COUNTER (1<<1)
+
+/*
+ * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
+ */
+
+/* 0x00: Native C-state instruction based LPI structure */
+
+typedef struct acpi_lpit_native
+{
+ ACPI_LPIT_HEADER Header;
+ ACPI_GENERIC_ADDRESS EntryTrigger;
+ UINT32 Residency;
+ UINT32 Latency;
+ ACPI_GENERIC_ADDRESS ResidencyCounter;
+ UINT64 CounterFrequency;
+
+} ACPI_LPIT_NATIVE;
+
+
+/* 0x01: Simple I/O based LPI structure */
+
+typedef struct acpi_lpit_io
+{
+ ACPI_LPIT_HEADER Header;
+ ACPI_GENERIC_ADDRESS EntryTrigger;
+ UINT32 TriggerAction;
+ UINT64 TriggerValue;
+ UINT64 TriggerMask;
+ ACPI_GENERIC_ADDRESS MinimumIdleState;
+ UINT32 Residency;
+ UINT32 Latency;
+ ACPI_GENERIC_ADDRESS ResidencyCounter;
+ UINT64 CounterFrequency;
+
+} ACPI_LPIT_IO;
+
+
+/*******************************************************************************
+ *
+ * MCFG - PCI Memory Mapped Configuration table and subtable
* Version 1
*
* Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
@@ -1050,7 +1149,7 @@ enum AcpiSlicType
/*
- * SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
+ * SLIC Subtables, correspond to Type in ACPI_SLIC_HEADER
*/
/* 0: Public Key Structure */
diff --git a/sys/contrib/dev/acpica/include/actbl3.h b/sys/contrib/dev/acpica/include/actbl3.h
index acf2e13..2f98b372 100644
--- a/sys/contrib/dev/acpica/include/actbl3.h
+++ b/sys/contrib/dev/acpica/include/actbl3.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -280,35 +280,115 @@ typedef struct acpi_s3pt_suspend
/*******************************************************************************
*
- * GTDT - Generic Timer Description Table (ACPI 5.0)
- * Version 1
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ * Version 2
*
******************************************************************************/
typedef struct acpi_table_gtdt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT64 Address;
- UINT32 Flags;
- UINT32 SecurePl1Interrupt;
- UINT32 SecurePl1Flags;
- UINT32 NonSecurePl1Interrupt;
- UINT32 NonSecurePl1Flags;
+ UINT64 CounterBlockAddresss;
+ UINT32 Reserved;
+ UINT32 SecureEl1Interrupt;
+ UINT32 SecureEl1Flags;
+ UINT32 NonSecureEl1Interrupt;
+ UINT32 NonSecureEl1Flags;
UINT32 VirtualTimerInterrupt;
UINT32 VirtualTimerFlags;
- UINT32 NonSecurePl2Interrupt;
- UINT32 NonSecurePl2Flags;
+ UINT32 NonSecureEl2Interrupt;
+ UINT32 NonSecureEl2Flags;
+ UINT64 CounterReadBlockAddress;
+ UINT32 PlatformTimerCount;
+ UINT32 PlatformTimerOffset;
} ACPI_TABLE_GTDT;
-/* Values for Flags field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
+
+#define ACPI_GTDT_INTERRUPT_MODE (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
+#define ACPI_GTDT_ALWAYS_ON (1<<2)
+
+
+/* Common GTDT subtable header */
+
+typedef struct acpi_gtdt_header
+{
+ UINT8 Type;
+ UINT16 Length;
+
+} ACPI_GTDT_HEADER;
+
+/* Values for GTDT subtable type above */
+
+enum AcpiGtdtType
+{
+ ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
+ ACPI_GTDT_TYPE_WATCHDOG = 1,
+ ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+
+/* GTDT Subtables, correspond to Type in acpi_gtdt_header */
+
+/* 0: Generic Timer Block */
+
+typedef struct acpi_gtdt_timer_block
+{
+ ACPI_GTDT_HEADER Header;
+ UINT8 Reserved;
+ UINT64 BlockAddress;
+ UINT32 TimerCount;
+ UINT32 TimerOffset;
+
+} ACPI_GTDT_TIMER_BLOCK;
+
+/* Timer Sub-Structure, one per timer */
+
+typedef struct acpi_gtdt_timer_entry
+{
+ UINT8 FrameNumber;
+ UINT8 Reserved[3];
+ UINT64 BaseAddress;
+ UINT64 El0BaseAddress;
+ UINT32 TimerInterrupt;
+ UINT32 TimerFlags;
+ UINT32 VirtualTimerInterrupt;
+ UINT32 VirtualTimerFlags;
+ UINT32 CommonFlags;
+
+} ACPI_GTDT_TIMER_ENTRY;
-#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1
+/* Flag Definitions: TimerFlags and VirtualTimerFlags above */
-/* Values for all "TimerFlags" fields above */
+#define ACPI_GTDT_GT_IRQ_MODE (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
-#define ACPI_GTDT_INTERRUPT_MODE 1
-#define ACPI_GTDT_INTERRUPT_POLARITY 2
+/* Flag Definitions: CommonFlags above */
+
+#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
+#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
+
+
+/* 1: SBSA Generic Watchdog Structure */
+
+typedef struct acpi_gtdt_watchdog
+{
+ ACPI_GTDT_HEADER Header;
+ UINT8 Reserved;
+ UINT64 RefreshFrameAddress;
+ UINT64 ControlFrameAddress;
+ UINT32 TimerInterrupt;
+ UINT32 TimerFlags;
+
+} ACPI_GTDT_WATCHDOG;
+
+/* Flag Definitions: TimerFlags above */
+
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
/*******************************************************************************
@@ -440,8 +520,7 @@ typedef struct acpi_table_pcct
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 Flags;
- UINT32 Latency;
- UINT32 Reserved;
+ UINT64 Reserved;
} ACPI_TABLE_PCCT;
@@ -449,8 +528,17 @@ typedef struct acpi_table_pcct
#define ACPI_PCCT_DOORBELL 1
+/* Values for subtable type in ACPI_SUBTABLE_HEADER */
+
+enum AcpiPcctType
+{
+ ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
+ ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
+ ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
+};
+
/*
- * PCCT subtables
+ * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Generic Communications Subspace */
@@ -464,10 +552,38 @@ typedef struct acpi_pcct_subspace
ACPI_GENERIC_ADDRESS DoorbellRegister;
UINT64 PreserveMask;
UINT64 WriteMask;
+ UINT32 Latency;
+ UINT32 MaxAccessRate;
+ UINT16 MinTurnaroundTime;
} ACPI_PCCT_SUBSPACE;
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
+
+typedef struct acpi_pcct_hw_reduced
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 DoorbellInterrupt;
+ UINT8 Flags;
+ UINT8 Reserved;
+ UINT64 BaseAddress;
+ UINT64 Length;
+ ACPI_GENERIC_ADDRESS DoorbellRegister;
+ UINT64 PreserveMask;
+ UINT64 WriteMask;
+ UINT32 Latency;
+ UINT32 MaxAccessRate;
+ UINT16 MinTurnaroundTime;
+
+} ACPI_PCCT_HW_REDUCED;
+
+/* Values for doorbell flags above */
+
+#define ACPI_PCCT_INTERRUPT_POLARITY (1)
+#define ACPI_PCCT_INTERRUPT_MODE (1<<1)
+
+
/*
* PCC memory structures (not part of the ACPI table)
*/
diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h
index dafbfd5..0444f5e 100644
--- a/sys/contrib/dev/acpica/include/actypes.h
+++ b/sys/contrib/dev/acpica/include/actypes.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,8 +55,6 @@
#error ACPI_MACHINE_WIDTH not defined
#endif
-/*! [Begin] no source code translation */
-
/*
* Data type ranges
* Note: These macros are designed to be compiler independent as well as
@@ -124,13 +122,16 @@
*
******************************************************************************/
+#ifndef ACPI_USE_SYSTEM_INTTYPES
+
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef unsigned short UINT16;
+typedef short INT16;
typedef COMPILER_DEPENDENT_UINT64 UINT64;
typedef COMPILER_DEPENDENT_INT64 INT64;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
/*
* Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
@@ -151,12 +152,12 @@ typedef COMPILER_DEPENDENT_INT64 INT64;
#if ACPI_MACHINE_WIDTH == 64
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned int UINT32;
typedef int INT32;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
typedef INT64 ACPI_NATIVE_INT;
@@ -190,12 +191,12 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
#elif ACPI_MACHINE_WIDTH == 32
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned int UINT32;
typedef int INT32;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
typedef INT32 ACPI_NATIVE_INT;
@@ -303,9 +304,18 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
#endif
/*
- * All ACPICA functions that are available to the rest of the kernel are
- * tagged with this macro which can be defined as appropriate for the host.
+ * All ACPICA external functions that are available to the rest of the kernel
+ * are tagged with thes macros which can be defined as appropriate for the host.
+ *
+ * Notes:
+ * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
+ * interfaces that may need special processing.
+ * ACPI_EXPORT_SYMBOL is used for all other public external functions.
*/
+#ifndef ACPI_EXPORT_SYMBOL_INIT
+#define ACPI_EXPORT_SYMBOL_INIT(Symbol)
+#endif
+
#ifndef ACPI_EXPORT_SYMBOL
#define ACPI_EXPORT_SYMBOL(Symbol)
#endif
@@ -319,6 +329,45 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
#endif
+/*******************************************************************************
+ *
+ * Configuration
+ *
+ ******************************************************************************/
+
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE(a) NULL
+#define ACPI_ALLOCATE_ZEROED(a) NULL
+#define ACPI_FREE(a)
+#define ACPI_MEM_TRACKING(a)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+/*
+ * Memory allocation tracking (used by AcpiExec to detect memory leaks)
+ */
+#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__
+#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
+#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
+#define ACPI_FREE(a) AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS)
+#define ACPI_MEM_TRACKING(a) a
+
+#else
+/*
+ * Normal memory allocation directly via the OS services layer
+ */
+#define ACPI_ALLOCATE(a) AcpiOsAllocate ((ACPI_SIZE) (a))
+#define ACPI_ALLOCATE_ZEROED(a) AcpiOsAllocateZeroed ((ACPI_SIZE) (a))
+#define ACPI_FREE(a) AcpiOsFree (a)
+#define ACPI_MEM_TRACKING(a)
+
+#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
+
+
/******************************************************************************
*
* ACPI Specification constants (Do not change unless the specification changes)
@@ -335,6 +384,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
#define ACPI_PM1_REGISTER_WIDTH 16
#define ACPI_PM2_REGISTER_WIDTH 8
#define ACPI_PM_TIMER_WIDTH 32
+#define ACPI_RESET_REGISTER_WIDTH 8
/* Names within the namespace are 4 bytes long */
@@ -474,7 +524,7 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i)
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
-#define ACPI_OFFSET(d, f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
+#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
@@ -568,8 +618,9 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_NOTIFY_RESERVED (UINT8) 0x0A
#define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B
#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C
+#define ACPI_NOTIFY_AFFINITY_UPDATE (UINT8) 0x0D
-#define ACPI_NOTIFY_MAX 0x0C
+#define ACPI_NOTIFY_MAX 0x0D
/*
* Types associated with ACPI names and objects. The first group of
@@ -669,14 +720,15 @@ typedef UINT32 ACPI_EVENT_TYPE;
* The encoding of ACPI_EVENT_STATUS is illustrated below.
* Note that a set bit (1) indicates the property is TRUE
* (e.g. if bit 0 is set then the event is enabled).
- * +-------------+-+-+-+
- * | Bits 31:3 |2|1|0|
- * +-------------+-+-+-+
- * | | | |
- * | | | +- Enabled?
- * | | +--- Enabled for wake?
- * | +----- Set?
- * +----------- <Reserved>
+ * +-------------+-+-+-+-+
+ * | Bits 31:4 |3|2|1|0|
+ * +-------------+-+-+-+-+
+ * | | | | |
+ * | | | | +- Enabled?
+ * | | | +--- Enabled for wake?
+ * | | +----- Set?
+ * | +------- Has a handler?
+ * +------------- <Reserved>
*/
typedef UINT32 ACPI_EVENT_STATUS;
@@ -684,6 +736,7 @@ typedef UINT32 ACPI_EVENT_STATUS;
#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
#define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02
#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04
+#define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x08
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
@@ -916,8 +969,18 @@ typedef struct acpi_object_list
* Miscellaneous common Data Structures used by the interfaces
*/
#define ACPI_NO_BUFFER 0
-#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1)
-#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2)
+
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (0)
+#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (0)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
+#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) /* Let ACPICA allocate buffer */
+#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) /* For internal use only (enables tracking) */
+
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
typedef struct acpi_buffer
{
@@ -926,10 +989,6 @@ typedef struct acpi_buffer
} ACPI_BUFFER;
-/* Free a buffer created in an ACPI_BUFFER via ACPI_ALLOCATE_LOCAL_BUFFER */
-
-#define ACPI_FREE_BUFFER(b) ACPI_FREE(b.Pointer)
-
/*
* NameType for AcpiGetName
@@ -1281,4 +1340,19 @@ typedef struct acpi_memory_list
#define ACPI_OSI_WIN_8 0x0C
+/* Definitions of file IO */
+
+#define ACPI_FILE_READING 0x01
+#define ACPI_FILE_WRITING 0x02
+#define ACPI_FILE_BINARY 0x04
+
+#define ACPI_FILE_BEGIN 0x01
+#define ACPI_FILE_END 0x02
+
+
+/* Definitions of getopt */
+
+#define ACPI_OPT_END -1
+
+
#endif /* __ACTYPES_H__ */
diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h
index c80dd36..8031fd3 100644
--- a/sys/contrib/dev/acpica/include/acutils.h
+++ b/sys/contrib/dev/acpica/include/acutils.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@ extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[];
/* Strings used by the disassembler and debugger resource dump routines */
-#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
extern const char *AcpiGbl_BmDecode[];
extern const char *AcpiGbl_ConfigDecode[];
@@ -96,7 +96,6 @@ extern const char *AcpiGbl_PtDecode[];
#ifdef ACPI_ASL_COMPILER
#include <stdio.h>
-extern FILE *AcpiGbl_OutputFile;
#define ACPI_MSG_REDIRECT_BEGIN \
FILE *OutputFile = AcpiGbl_OutputFile; \
@@ -189,8 +188,8 @@ AcpiUtGetMutexName (
const char *
AcpiUtGetNotifyName (
- UINT32 NotifyValue);
-
+ UINT32 NotifyValue,
+ ACPI_OBJECT_TYPE Type);
#endif
char *
@@ -226,6 +225,10 @@ AcpiUtHexToAsciiChar (
UINT64 Integer,
UINT32 Position);
+UINT8
+AcpiUtAsciiCharToHex (
+ int HexChar);
+
BOOLEAN
AcpiUtValidObjectType (
ACPI_OBJECT_TYPE Type);
@@ -253,6 +256,11 @@ AcpiUtStrlen (
const char *String);
char *
+AcpiUtStrchr (
+ const char *String,
+ int ch);
+
+char *
AcpiUtStrcpy (
char *DstString,
const char *SrcString);
@@ -340,7 +348,7 @@ extern const UINT8 _acpi_ctype[];
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
-#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
+#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
#endif /* !ACPI_USE_SYSTEM_CLIBRARY */
@@ -482,6 +490,16 @@ AcpiUtDumpBuffer (
UINT32 Display,
UINT32 Offset);
+#ifdef ACPI_APPLICATION
+void
+AcpiUtDumpBufferToFile (
+ ACPI_FILE File,
+ UINT8 *Buffer,
+ UINT32 Count,
+ UINT32 Display,
+ UINT32 BaseOffset);
+#endif
+
void
AcpiUtReportError (
char *ModuleName,
@@ -551,6 +569,17 @@ AcpiUtExecutePowerMethods (
/*
+ * utfileio - file operations
+ */
+#ifdef ACPI_APPLICATION
+ACPI_STATUS
+AcpiUtReadTableFromFile (
+ char *Filename,
+ ACPI_TABLE_HEADER **Table);
+#endif
+
+
+/*
* utids - device ID support
*/
ACPI_STATUS
@@ -926,6 +955,29 @@ void
AcpiUtRepairName (
char *Name);
+#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+BOOLEAN
+AcpiUtSafeStrcpy (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source);
+
+BOOLEAN
+AcpiUtSafeStrcat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source);
+
+#ifndef _KERNEL
+BOOLEAN
+AcpiUtSafeStrncat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source,
+ ACPI_SIZE MaxTransferLength);
+#endif
+#endif
+
/*
* utmutex - mutex support
@@ -967,20 +1019,6 @@ AcpiUtInitializeBuffer (
ACPI_BUFFER *Buffer,
ACPI_SIZE RequiredLength);
-void *
-AcpiUtAllocate (
- ACPI_SIZE Size,
- UINT32 Component,
- const char *Module,
- UINT32 Line);
-
-void *
-AcpiUtAllocateZeroed (
- ACPI_SIZE Size,
- UINT32 Component,
- const char *Module,
- UINT32 Line);
-
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
void *
AcpiUtAllocateAndTrack (
@@ -1092,4 +1130,68 @@ AcpiUtMethodError (
const char *Path,
ACPI_STATUS LookupStatus);
+/*
+ * Utility functions for ACPI names and IDs
+ */
+const AH_PREDEFINED_NAME *
+AcpiAhMatchPredefinedName (
+ char *Nameseg);
+
+const AH_DEVICE_ID *
+AcpiAhMatchHardwareId (
+ char *Hid);
+
+const char *
+AcpiAhMatchUuid (
+ UINT8 *Data);
+
+/*
+ * utprint - printf/vprintf output functions
+ */
+const char *
+AcpiUtScanNumber (
+ const char *String,
+ UINT64 *NumberPtr);
+
+const char *
+AcpiUtPrintNumber (
+ char *String,
+ UINT64 Number);
+
+int
+AcpiUtVsnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ va_list Args);
+
+int
+AcpiUtSnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ ...);
+
+#ifdef ACPI_APPLICATION
+int
+AcpiUtFileVprintf (
+ ACPI_FILE File,
+ const char *Format,
+ va_list Args);
+
+int
+AcpiUtFilePrintf (
+ ACPI_FILE File,
+ const char *Format,
+ ...);
+#endif
+
+/*
+ * utuuid -- UUID support functions
+ */
+void
+AcpiUtConvertStringToUuid (
+ char *InString,
+ UINT8 *UuidBuffer);
+
#endif /* _ACUTILS_H */
diff --git a/sys/contrib/dev/acpica/include/amlcode.h b/sys/contrib/dev/acpica/include/amlcode.h
index 66af4c2..bc8c0b0 100644
--- a/sys/contrib/dev/acpica/include/amlcode.h
+++ b/sys/contrib/dev/acpica/include/amlcode.h
@@ -7,7 +7,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/amlresrc.h b/sys/contrib/dev/acpica/include/amlresrc.h
index 8e68559..cd8b3b6 100644
--- a/sys/contrib/dev/acpica/include/amlresrc.h
+++ b/sys/contrib/dev/acpica/include/amlresrc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -122,6 +122,14 @@ typedef struct asl_resource_node
} ASL_RESOURCE_NODE;
+typedef struct asl_resource_info
+{
+ ACPI_PARSE_OBJECT *DescriptorTypeOp; /* Resource descriptor parse node */
+ ACPI_PARSE_OBJECT *MappingOp; /* Used for mapfile support */
+ UINT32 CurrentByteOffset; /* Offset in resource template */
+
+} ASL_RESOURCE_INFO;
+
/* Macros used to generate AML resource length fields */
@@ -574,4 +582,50 @@ typedef union aml_resource
} AML_RESOURCE;
+
+/* Interfaces used by both the disassembler and compiler */
+
+void
+MpSaveGpioInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ UINT32 PinCount,
+ UINT16 *PinList,
+ char *DeviceName);
+
+void
+MpSaveSerialInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ char *DeviceName);
+
+char *
+MpGetHidFromParseTree (
+ ACPI_NAMESPACE_NODE *HidNode);
+
+char *
+MpGetHidViaNamestring (
+ char *DeviceName);
+
+char *
+MpGetConnectionInfo (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 PinIndex,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **TargetName);
+
+char *
+MpGetParentDeviceHid (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **ParentDeviceName);
+
+char *
+MpGetDdnValue (
+ char *DeviceName);
+
+char *
+MpGetHidValue (
+ ACPI_NAMESPACE_NODE *DeviceNode);
+
#endif
diff --git a/sys/contrib/dev/acpica/include/platform/acenv.h b/sys/contrib/dev/acpica/include/platform/acenv.h
index 6866de2..8b8e890 100644
--- a/sys/contrib/dev/acpica/include/platform/acenv.h
+++ b/sys/contrib/dev/acpica/include/platform/acenv.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -88,32 +88,55 @@
#define ACPI_DBG_TRACK_ALLOCATIONS
#endif
-/* AcpiNames configuration. Single threaded with debugger output enabled. */
-
-#ifdef ACPI_NAMES_APP
-#define ACPI_DEBUGGER
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
-#endif
-
/*
- * AcpiBin/AcpiDump/AcpiSrc/AcpiXtract configuration. All single
- * threaded, with no debug output.
+ * AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example configuration.
+ * All single threaded.
*/
-#if (defined ACPI_BIN_APP) || \
- (defined ACPI_DUMP_APP) || \
- (defined ACPI_SRC_APP) || \
- (defined ACPI_XTRACT_APP)
+#if (defined ACPI_BIN_APP) || \
+ (defined ACPI_DUMP_APP) || \
+ (defined ACPI_HELP_APP) || \
+ (defined ACPI_NAMES_APP) || \
+ (defined ACPI_SRC_APP) || \
+ (defined ACPI_XTRACT_APP) || \
+ (defined ACPI_EXAMPLE_APP)
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#endif
+/* AcpiHelp configuration. Error messages disabled. */
+
#ifdef ACPI_HELP_APP
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
#define ACPI_NO_ERROR_MESSAGES
#endif
+/* AcpiNames configuration. Debug output enabled. */
+
+#ifdef ACPI_NAMES_APP
+#define ACPI_DEBUG_OUTPUT
+#endif
+
+/* AcpiExec/AcpiNames/Example configuration. Native RSDP used. */
+
+#if (defined ACPI_EXEC_APP) || \
+ (defined ACPI_EXAMPLE_APP) || \
+ (defined ACPI_NAMES_APP)
+#define ACPI_USE_NATIVE_RSDP_POINTER
+#endif
+
+/* AcpiDump configuration. Native mapping used if provied by OSPMs */
+
+#ifdef ACPI_DUMP_APP
+#define ACPI_USE_NATIVE_MEMORY_MAPPING
+#define USE_NATIVE_ALLOCATE_ZEROED
+#endif
+
+/* AcpiNames/Example configuration. Hardware disabled */
+
+#if (defined ACPI_EXAMPLE_APP) || \
+ (defined ACPI_NAMES_APP)
+#define ACPI_REDUCED_HARDWARE 1
+#endif
+
/* Linkable ACPICA library */
#ifdef ACPI_LIBRARY
@@ -184,6 +207,9 @@
#elif defined(_AED_EFI)
#include "acefi.h"
+#elif defined(_GNU_EFI)
+#include "acefi.h"
+
#elif defined(__HAIKU__)
#include "achaiku.h"
@@ -396,4 +422,17 @@ typedef char *va_list;
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
+#ifndef ACPI_FILE
+#ifdef ACPI_APPLICATION
+#include <stdio.h>
+#define ACPI_FILE FILE *
+#define ACPI_FILE_OUT stdout
+#define ACPI_FILE_ERR stderr
+#else
+#define ACPI_FILE void *
+#define ACPI_FILE_OUT NULL
+#define ACPI_FILE_ERR NULL
+#endif /* ACPI_APPLICATION */
+#endif /* ACPI_FILE */
+
#endif /* __ACENV_H__ */
diff --git a/sys/contrib/dev/acpica/include/platform/acenvex.h b/sys/contrib/dev/acpica/include/platform/acenvex.h
new file mode 100644
index 0000000..a1de87f
--- /dev/null
+++ b/sys/contrib/dev/acpica/include/platform/acenvex.h
@@ -0,0 +1,63 @@
+/******************************************************************************
+ *
+ * Name: acenvex.h - Extra host and compiler configuration
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACENVEX_H__
+#define __ACENVEX_H__
+
+/*! [Begin] no source code translation */
+
+/******************************************************************************
+ *
+ * Extra host configuration files. All ACPICA headers are included before
+ * including these files.
+ *
+ *****************************************************************************/
+
+#if defined(_LINUX) || defined(__linux__)
+#include "aclinuxex.h"
+
+#endif
+
+/*! [End] no source code translation !*/
+
+#endif /* __ACENVEX_H__ */
diff --git a/sys/contrib/dev/acpica/include/platform/acfreebsd.h b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
index 34786c3..ab4dc98 100644
--- a/sys/contrib/dev/acpica/include/platform/acfreebsd.h
+++ b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/platform/acgcc.h b/sys/contrib/dev/acpica/include/platform/acgcc.h
index 1662a9b..23db324 100644
--- a/sys/contrib/dev/acpica/include/platform/acgcc.h
+++ b/sys/contrib/dev/acpica/include/platform/acgcc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,7 @@
/* Function name is used for debug output. Non-ANSI, compiler-dependent */
-#define ACPI_GET_FUNCTION_NAME __FUNCTION__
+#define ACPI_GET_FUNCTION_NAME __func__
/*
* This macro is used to tag functions as "printf-like" because
@@ -64,4 +64,15 @@
*/
#define ACPI_UNUSED_VAR __attribute__ ((unused))
+/*
+ * Some versions of gcc implement strchr() with a buggy macro. So,
+ * undef it here. Prevents error messages of this form (usually from the
+ * file getopt.c):
+ *
+ * error: logical '&&' with non-zero constant will always evaluate as true
+ */
+#ifdef strchr
+#undef strchr
+#endif
+
#endif /* __ACGCC_H__ */
diff --git a/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c b/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c
new file mode 100644
index 0000000..9f55cc7
--- /dev/null
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c
@@ -0,0 +1,255 @@
+/******************************************************************************
+ *
+ * Module Name: oslibcfs - C library OSL for file I/O
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#define _COMPONENT ACPI_OS_SERVICES
+ ACPI_MODULE_NAME ("oslibcfs")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsOpenFile
+ *
+ * PARAMETERS: Path - File path
+ * Modes - File operation type
+ *
+ * RETURN: File descriptor.
+ *
+ * DESCRIPTION: Open a file for reading (ACPI_FILE_READING) or/and writing
+ * (ACPI_FILE_WRITING).
+ *
+ ******************************************************************************/
+
+ACPI_FILE
+AcpiOsOpenFile (
+ const char *Path,
+ UINT8 Modes)
+{
+ ACPI_FILE File;
+ UINT32 i = 0;
+ char ModesStr[4];
+
+
+ if (Modes & ACPI_FILE_READING)
+ {
+ ModesStr[i++] = 'r';
+ }
+ if (Modes & ACPI_FILE_WRITING)
+ {
+ ModesStr[i++] = 'w';
+ }
+ if (Modes & ACPI_FILE_BINARY)
+ {
+ ModesStr[i++] = 'b';
+ }
+
+ ModesStr[i++] = '\0';
+
+ File = fopen (Path, ModesStr);
+ if (!File)
+ {
+ perror ("Could not open file");
+ }
+
+ return (File);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsCloseFile
+ *
+ * PARAMETERS: File - An open file descriptor
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Close a file opened via AcpiOsOpenFile.
+ *
+ ******************************************************************************/
+
+void
+AcpiOsCloseFile (
+ ACPI_FILE File)
+{
+ fclose (File);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsReadFile
+ *
+ * PARAMETERS: File - An open file descriptor
+ * Buffer - Data buffer
+ * Size - Data block size
+ * Count - Number of data blocks
+ *
+ * RETURN: Number of bytes actually read.
+ *
+ * DESCRIPTION: Read from a file.
+ *
+ ******************************************************************************/
+
+int
+AcpiOsReadFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count)
+{
+ int Length;
+
+
+ Length = fread (Buffer, Size, Count, File);
+ if (Length < 0)
+ {
+ perror ("Error reading file");
+ }
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsWriteFile
+ *
+ * PARAMETERS: File - An open file descriptor
+ * Buffer - Data buffer
+ * Size - Data block size
+ * Count - Number of data blocks
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Write to a file.
+ *
+ ******************************************************************************/
+
+int
+AcpiOsWriteFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count)
+{
+ int Length;
+
+
+ Length = fwrite (Buffer, Size, Count, File);
+ if (Length < 0)
+ {
+ perror ("Error writing file");
+ }
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsGetFileOffset
+ *
+ * PARAMETERS: File - An open file descriptor
+ *
+ * RETURN: Current file pointer position.
+ *
+ * DESCRIPTION: Get current file offset.
+ *
+ ******************************************************************************/
+
+long
+AcpiOsGetFileOffset (
+ ACPI_FILE File)
+{
+ long Offset;
+
+
+ Offset = ftell (File);
+ return (Offset);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsSetFileOffset
+ *
+ * PARAMETERS: File - An open file descriptor
+ * Offset - New file offset
+ * From - From begin/end of file
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Set current file offset.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiOsSetFileOffset (
+ ACPI_FILE File,
+ long Offset,
+ UINT8 From)
+{
+ int Ret = 0;
+
+
+ if (From == ACPI_FILE_BEGIN)
+ {
+ Ret = fseek (File, Offset, SEEK_SET);
+ }
+ if (From == ACPI_FILE_END)
+ {
+ Ret = fseek (File, Offset, SEEK_END);
+ }
+
+ if (Ret < 0)
+ {
+ return (AE_ERROR);
+ }
+ else
+ {
+ return (AE_OK);
+ }
+}
diff --git a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
index 31bb471..d4febe2 100644
--- a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
/*
* These interfaces are required in order to compile the ASL compiler and the
* various ACPICA tools under Linux or other Unix-like system.
@@ -65,16 +64,11 @@
ACPI_MODULE_NAME ("osunixxf")
-extern FILE *AcpiGbl_DebugFile;
-FILE *AcpiGbl_OutputFile;
+BOOLEAN AcpiGbl_DebugTimeout = FALSE;
/* Upcalls to AcpiExec */
-ACPI_PHYSICAL_ADDRESS
-AeLocalGetRootPointer (
- void);
-
void
AeTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
@@ -84,7 +78,127 @@ typedef void* (*PTHREAD_CALLBACK) (void *);
/* Buffer used by AcpiOsVprintf */
-#define ACPI_VPRINTF_BUFFER_SIZE 512
+#define ACPI_VPRINTF_BUFFER_SIZE 512
+#define _ASCII_NEWLINE '\n'
+
+/* Terminal support for AcpiExec only */
+
+#ifdef ACPI_EXEC_APP
+#include <termios.h>
+
+struct termios OriginalTermAttributes;
+int TermAttributesWereSet = 0;
+
+ACPI_STATUS
+AcpiUtReadLine (
+ char *Buffer,
+ UINT32 BufferLength,
+ UINT32 *BytesRead);
+
+static void
+OsEnterLineEditMode (
+ void);
+
+static void
+OsExitLineEditMode (
+ void);
+
+
+/******************************************************************************
+ *
+ * FUNCTION: OsEnterLineEditMode, OsExitLineEditMode
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Enter/Exit the raw character input mode for the terminal.
+ *
+ * Interactive line-editing support for the AML debugger. Used with the
+ * common/acgetline module.
+ *
+ * readline() is not used because of non-portability. It is not available
+ * on all systems, and if it is, often the package must be manually installed.
+ *
+ * Therefore, we use the POSIX tcgetattr/tcsetattr and do the minimal line
+ * editing that we need in AcpiOsGetLine.
+ *
+ * If the POSIX tcgetattr/tcsetattr interfaces are unavailable, these
+ * calls will also work:
+ * For OsEnterLineEditMode: system ("stty cbreak -echo")
+ * For OsExitLineEditMode: system ("stty cooked echo")
+ *
+ *****************************************************************************/
+
+static void
+OsEnterLineEditMode (
+ void)
+{
+ struct termios LocalTermAttributes;
+
+
+ TermAttributesWereSet = 0;
+
+ /* STDIN must be a terminal */
+
+ if (!isatty (STDIN_FILENO))
+ {
+ return;
+ }
+
+ /* Get and keep the original attributes */
+
+ if (tcgetattr (STDIN_FILENO, &OriginalTermAttributes))
+ {
+ fprintf (stderr, "Could not get terminal attributes!\n");
+ return;
+ }
+
+ /* Set the new attributes to enable raw character input */
+
+ memcpy (&LocalTermAttributes, &OriginalTermAttributes,
+ sizeof (struct termios));
+
+ LocalTermAttributes.c_lflag &= ~(ICANON | ECHO);
+ LocalTermAttributes.c_cc[VMIN] = 1;
+ LocalTermAttributes.c_cc[VTIME] = 0;
+
+ if (tcsetattr (STDIN_FILENO, TCSANOW, &LocalTermAttributes))
+ {
+ fprintf (stderr, "Could not set terminal attributes!\n");
+ return;
+ }
+
+ TermAttributesWereSet = 1;
+}
+
+
+static void
+OsExitLineEditMode (
+ void)
+{
+
+ if (!TermAttributesWereSet)
+ {
+ return;
+ }
+
+ /* Set terminal attributes back to the original values */
+
+ if (tcsetattr (STDIN_FILENO, TCSANOW, &OriginalTermAttributes))
+ {
+ fprintf (stderr, "Could not restore terminal attributes!\n");
+ }
+}
+
+
+#else
+
+/* These functions are not needed for other ACPICA utilities */
+
+#define OsEnterLineEditMode()
+#define OsExitLineEditMode()
+#endif
/******************************************************************************
@@ -95,7 +209,7 @@ typedef void* (*PTHREAD_CALLBACK) (void *);
*
* RETURN: Status
*
- * DESCRIPTION: Init and terminate. Nothing to do.
+ * DESCRIPTION: Initialize and terminate this module.
*
*****************************************************************************/
@@ -103,21 +217,33 @@ ACPI_STATUS
AcpiOsInitialize (
void)
{
+ ACPI_STATUS Status;
+
AcpiGbl_OutputFile = stdout;
+
+ OsEnterLineEditMode ();
+
+ Status = AcpiOsCreateLock (&AcpiGbl_PrintLock);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
return (AE_OK);
}
-
ACPI_STATUS
AcpiOsTerminate (
void)
{
+ OsExitLineEditMode ();
return (AE_OK);
}
+#ifndef ACPI_USE_NATIVE_RSDP_POINTER
/******************************************************************************
*
* FUNCTION: AcpiOsGetRootPointer
@@ -135,8 +261,9 @@ AcpiOsGetRootPointer (
void)
{
- return (AeLocalGetRootPointer ());
+ return (0);
}
+#endif
/******************************************************************************
@@ -370,6 +497,7 @@ AcpiOsVprintf (
}
+#ifndef ACPI_EXEC_APP
/******************************************************************************
*
* FUNCTION: AcpiOsGetLine
@@ -380,7 +508,9 @@ AcpiOsVprintf (
*
* RETURN: Status and actual bytes read
*
- * DESCRIPTION: Formatted input with argument list pointer
+ * DESCRIPTION: Get the next input line from the terminal. NOTE: For the
+ * AcpiExec utility, we use the acgetline module instead to
+ * provide line-editing and history support.
*
*****************************************************************************/
@@ -390,44 +520,49 @@ AcpiOsGetLine (
UINT32 BufferLength,
UINT32 *BytesRead)
{
- int Temp;
- UINT32 i;
+ int InputChar;
+ UINT32 EndOfLine;
+
+ /* Standard AcpiOsGetLine for all utilities except AcpiExec */
- for (i = 0; ; i++)
+ for (EndOfLine = 0; ; EndOfLine++)
{
- if (i >= BufferLength)
+ if (EndOfLine >= BufferLength)
{
return (AE_BUFFER_OVERFLOW);
}
- if ((Temp = getchar ()) == EOF)
+ if ((InputChar = getchar ()) == EOF)
{
return (AE_ERROR);
}
- if (!Temp || Temp == '\n')
+ if (!InputChar || InputChar == _ASCII_NEWLINE)
{
break;
}
- Buffer [i] = (char) Temp;
+ Buffer[EndOfLine] = (char) InputChar;
}
/* Null terminate the buffer */
- Buffer [i] = 0;
+ Buffer[EndOfLine] = 0;
/* Return the number of bytes in the string */
if (BytesRead)
{
- *BytesRead = i;
+ *BytesRead = EndOfLine;
}
+
return (AE_OK);
}
+#endif
+#ifndef ACPI_USE_NATIVE_MEMORY_MAPPING
/******************************************************************************
*
* FUNCTION: AcpiOsMapMemory
@@ -473,6 +608,7 @@ AcpiOsUnmapMemory (
return;
}
+#endif
/******************************************************************************
@@ -499,6 +635,32 @@ AcpiOsAllocate (
}
+#ifdef USE_NATIVE_ALLOCATE_ZEROED
+/******************************************************************************
+ *
+ * FUNCTION: AcpiOsAllocateZeroed
+ *
+ * PARAMETERS: Size - Amount to allocate, in bytes
+ *
+ * RETURN: Pointer to the new allocation. Null on error.
+ *
+ * DESCRIPTION: Allocate and zero memory. Algorithm is dependent on the OS.
+ *
+ *****************************************************************************/
+
+void *
+AcpiOsAllocateZeroed (
+ ACPI_SIZE size)
+{
+ void *Mem;
+
+
+ Mem = (void *) calloc (1, (size_t) size);
+ return (Mem);
+}
+#endif
+
+
/******************************************************************************
*
* FUNCTION: AcpiOsFree
@@ -1005,7 +1167,7 @@ AcpiOsGetTimer (
* FUNCTION: AcpiOsReadPciConfiguration
*
* PARAMETERS: PciId - Seg/Bus/Dev
- * Register - Device Register
+ * PciRegister - Device Register
* Value - Buffer where value is placed
* Width - Number of bits
*
@@ -1018,7 +1180,7 @@ AcpiOsGetTimer (
ACPI_STATUS
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
- UINT32 Register,
+ UINT32 PciRegister,
UINT64 *Value,
UINT32 Width)
{
@@ -1033,7 +1195,7 @@ AcpiOsReadPciConfiguration (
* FUNCTION: AcpiOsWritePciConfiguration
*
* PARAMETERS: PciId - Seg/Bus/Dev
- * Register - Device Register
+ * PciRegister - Device Register
* Value - Value to be written
* Width - Number of bits
*
@@ -1046,7 +1208,7 @@ AcpiOsReadPciConfiguration (
ACPI_STATUS
AcpiOsWritePciConfiguration (
ACPI_PCI_ID *PciId,
- UINT32 Register,
+ UINT32 PciRegister,
UINT64 Value,
UINT32 Width)
{
@@ -1242,7 +1404,7 @@ AcpiOsWritable (
*
* FUNCTION: AcpiOsSignal
*
- * PARAMETERS: Function - ACPI CA signal function code
+ * PARAMETERS: Function - ACPI A signal function code
* Info - Pointer to function-dependent structure
*
* RETURN: Status
@@ -1334,6 +1496,26 @@ AcpiOsExecute (
return (0);
}
+#else /* ACPI_SINGLE_THREADED */
+ACPI_THREAD_ID
+AcpiOsGetThreadId (
+ void)
+{
+ return (1);
+}
+
+ACPI_STATUS
+AcpiOsExecute (
+ ACPI_EXECUTE_TYPE Type,
+ ACPI_OSD_EXEC_CALLBACK Function,
+ void *Context)
+{
+
+ Function (Context);
+
+ return (AE_OK);
+}
+
#endif /* ACPI_SINGLE_THREADED */
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h
index 73b902f..30c55a0 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h
@@ -1181,10 +1181,11 @@ struct ath_hal;
extern struct ath_hal_9300 * ar9300_new_state(u_int16_t devid,
HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config,
HAL_STATUS *status);
extern struct ath_hal * ar9300_attach(u_int16_t devid,
HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
- HAL_STATUS *status);
+ HAL_OPS_CONFIG *ah_config, HAL_STATUS *status);
extern void ar9300_detach(struct ath_hal *ah);
extern void ar9300_read_revisions(struct ath_hal *ah);
extern HAL_BOOL ar9300_chip_test(struct ath_hal *ah);
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
index 9cc99ec..80dc2a3 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
@@ -618,7 +618,8 @@ ar9300_read_revisions(struct ath_hal *ah)
*/
struct ath_hal *
ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
- HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *status)
+ HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_OPS_CONFIG *ah_config,
+ HAL_STATUS *status)
{
struct ath_hal_9300 *ahp;
struct ath_hal *ah;
@@ -628,7 +629,7 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
HAL_NO_INTERSPERSED_READS;
/* NB: memory is returned zero'd */
- ahp = ar9300_new_state(devid, sc, st, sh, eepromdata, status);
+ ahp = ar9300_new_state(devid, sc, st, sh, eepromdata, ah_config, status);
if (ahp == AH_NULL) {
return AH_NULL;
}
@@ -654,12 +655,6 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
/* XXX FreeBSD: enable RX mitigation */
ah->ah_config.ath_hal_intr_mitigation_rx = 1;
- /*
- * XXX what's this do? Check in the qcamain driver code
- * as to what it does.
- */
- ah->ah_config.ath_hal_ext_atten_margin_cfg = 0;
-
/* interrupt mitigation */
#ifdef AR5416_INT_MITIGATION
if (ah->ah_config.ath_hal_intr_mitigation_rx != 0) {
@@ -2378,7 +2373,9 @@ ar9300_detach(struct ath_hal *ah)
struct ath_hal_9300 *
ar9300_new_state(u_int16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh,
- uint16_t *eepromdata, HAL_STATUS *status)
+ uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config,
+ HAL_STATUS *status)
{
static const u_int8_t defbssidmask[IEEE80211_ADDR_LEN] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
@@ -2430,7 +2427,7 @@ ar9300_new_state(u_int16_t devid, HAL_SOFTC sc,
** Initialize factory defaults in the private space
*/
// ath_hal_factory_defaults(AH_PRIVATE(ah), hal_conf_parm);
- ar9300_config_defaults_freebsd(ah);
+ ar9300_config_defaults_freebsd(ah, ah_config);
/* XXX FreeBSD: cal is always in EEPROM */
#if 0
@@ -2456,6 +2453,7 @@ ar9300_new_state(u_int16_t devid, HAL_SOFTC sc,
AH_PRIVATE(ah)->ah_tpScale = HAL_TP_SCALE_MAX; /* no scaling */
ahp->ah_atim_window = 0; /* [0..1000] */
+
ahp->ah_diversity_control =
ah->ah_config.ath_hal_diversity_control;
ahp->ah_antenna_switch_swap =
@@ -3835,6 +3833,11 @@ ar9300_ant_div_comb_get_config(struct ath_hal *ah,
} else {
div_comb_conf->antdiv_configgroup = DEFAULT_ANTDIV_CONFIG_GROUP;
}
+
+ /*
+ * XXX TODO: allow the HAL to override the rssithres and fast_div_bias
+ * values (eg CUS198.)
+ */
}
void
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
index ba7777e..669104a 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
@@ -1606,6 +1606,7 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct ath_hal *ah, HAL_BOOL is_2ghz)
if ( AR_SREV_POSEIDON(ah) && (ahp->ah_lna_div_use_bt_ant_enable == TRUE) ) {
value &= ~AR_SWITCH_TABLE_COM2_ALL;
value |= ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable;
+ HALDEBUG(ah, HAL_DEBUG_RESET, "%s: com2=0x%08x\n", __func__, value)
}
#endif /* ATH_ANT_DIV_COMB */
OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM_2, AR_SWITCH_TABLE_COM2_ALL, value);
@@ -1711,6 +1712,8 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct ath_hal *ah, HAL_BOOL is_2ghz)
/* For WB225, need to swith ANT2 from BT to Wifi
* This will not affect HB125 LNA diversity feature.
*/
+ HALDEBUG(ah, HAL_DEBUG_RESET, "%s: com2=0x%08x\n", __func__,
+ ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable)
OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM_2, AR_SWITCH_TABLE_COM2_ALL,
ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable);
break;
@@ -1776,6 +1779,7 @@ ar9300_attenuation_margin_chain_get(struct ath_hal *ah, int chain,
return 0;
}
+#if 0
HAL_BOOL ar9300_attenuation_apply(struct ath_hal *ah, u_int16_t channel)
{
u_int32_t value;
@@ -1814,6 +1818,75 @@ HAL_BOOL ar9300_attenuation_apply(struct ath_hal *ah, u_int16_t channel)
}
return 0;
}
+#endif
+HAL_BOOL
+ar9300_attenuation_apply(struct ath_hal *ah, u_int16_t channel)
+{
+ int i;
+ uint32_t value;
+ uint32_t ext_atten_reg[3] = {
+ AR_PHY_EXT_ATTEN_CTL_0,
+ AR_PHY_EXT_ATTEN_CTL_1,
+ AR_PHY_EXT_ATTEN_CTL_2
+ };
+
+ /*
+ * If it's an AR9462 and we're receiving on the second
+ * chain only, set the chain 0 details from chain 1
+ * calibration.
+ *
+ * This is from ath9k.
+ */
+ if (AR_SREV_JUPITER(ah) && (AH9300(ah)->ah_rx_chainmask == 0x2)) {
+ value = ar9300_attenuation_chain_get(ah, 1, channel);
+ OS_REG_RMW_FIELD(ah, ext_atten_reg[0],
+ AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB, value);
+ value = ar9300_attenuation_margin_chain_get(ah, 1, channel);
+ OS_REG_RMW_FIELD(ah, ext_atten_reg[0],
+ AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN, value);
+ }
+
+ /*
+ * Now, loop over the configured transmit chains and
+ * load in the attenuation/margin settings as appropriate.
+ */
+ for (i = 0; i < 3; i++) {
+ if ((AH9300(ah)->ah_tx_chainmask & (1 << i)) == 0)
+ continue;
+
+ value = ar9300_attenuation_chain_get(ah, i, channel);
+ OS_REG_RMW_FIELD(ah, ext_atten_reg[i],
+ AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB,
+ value);
+
+ if (AR_SREV_POSEIDON(ah) &&
+ (ar9300_rx_gain_index_get(ah) == 0) &&
+ ah->ah_config.ath_hal_ext_atten_margin_cfg) {
+ value = 5;
+ } else {
+ value = ar9300_attenuation_margin_chain_get(ah, 0,
+ channel);
+ }
+
+ /*
+ * I'm not sure why it's loading in this setting into
+ * the chain 0 margin regardless of the current chain.
+ */
+ if (ah->ah_config.ath_hal_min_gainidx)
+ OS_REG_RMW_FIELD(ah,
+ AR_PHY_EXT_ATTEN_CTL_0,
+ AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN,
+ value);
+
+ OS_REG_RMW_FIELD(ah,
+ ext_atten_reg[i],
+ AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN,
+ value);
+ }
+
+ return (0);
+}
+
static u_int16_t ar9300_quick_drop_get(struct ath_hal *ah,
int chain, u_int16_t channel)
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
index ff4baa0..a6968c1 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
@@ -252,9 +252,6 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah)
/* LNA diversity functions */
ah->ah_divLnaConfGet = ar9300_ant_div_comb_get_config;
ah->ah_divLnaConfSet = ar9300_ant_div_comb_set_config;
-
- /* Setup HAL configuration defaults */
- ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable = 0x000bbb88;
}
HAL_BOOL
@@ -338,9 +335,11 @@ ar9300_ani_poll_freebsd(struct ath_hal *ah,
* wants.
*/
void
-ar9300_config_defaults_freebsd(struct ath_hal *ah)
+ar9300_config_defaults_freebsd(struct ath_hal *ah, HAL_OPS_CONFIG *ah_config)
{
+ /* Until FreeBSD's HAL does this by default - just copy */
+ OS_MEMCPY(&ah->ah_config, ah_config, sizeof(HAL_OPS_CONFIG));
ah->ah_config.ath_hal_enable_ani = AH_TRUE;
}
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h
index c07c32f..524c3f3 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h
@@ -11,7 +11,8 @@ extern HAL_STATUS ar9300_eeprom_get_freebsd(struct ath_hal *, int param,
extern HAL_BOOL ar9300_stop_tx_dma_freebsd(struct ath_hal *ah, u_int q);
extern void ar9300_ani_poll_freebsd(struct ath_hal *ah,
const struct ieee80211_channel *chan);
-extern void ar9300_config_defaults_freebsd(struct ath_hal *ah);
+extern void ar9300_config_defaults_freebsd(struct ath_hal *ah,
+ HAL_OPS_CONFIG *ah_config);
extern HAL_BOOL ar9300_stop_dma_receive_freebsd(struct ath_hal *ah);
extern HAL_BOOL ar9300_get_pending_interrupts_freebsd(struct ath_hal *ah,
HAL_INT *masked);
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
index 1090c9c..51ce195 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
@@ -6151,6 +6151,7 @@ ar9300_ant_ctrl_set_lna_div_use_bt_ant(struct ath_hal *ah, HAL_BOOL enable, cons
value &= ~AR_SWITCH_TABLE_COM2_ALL;
value |= ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable;
}
+ HALDEBUG(ah, HAL_DEBUG_RESET, "%s: com2=0x%08x\n", __func__, value);
OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM_2, AR_SWITCH_TABLE_COM2_ALL, value);
value = ar9300_eeprom_get(ahp, EEP_ANTDIV_control);
diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c
index d49f886..e998fee 100644
--- a/sys/dev/acpica/Osd/OsdSchedule.c
+++ b/sys/dev/acpica/Osd/OsdSchedule.c
@@ -60,6 +60,13 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, max_tasks, CTLFLAG_RDTUN, &acpi_max_tasks,
0, "Maximum acpi tasks");
/*
+ * Track and report the system's demand for task slots.
+ */
+static int acpi_tasks_hiwater;
+SYSCTL_INT(_debug_acpi, OID_AUTO, tasks_hiwater, CTLFLAG_RD,
+ &acpi_tasks_hiwater, 1, "Peak demand for ACPI event task slots.");
+
+/*
* Allow the user to tune the number of task threads we start. It seems
* some systems have problems with increased parallelism.
*/
@@ -151,6 +158,10 @@ acpi_task_enqueue(int priority, ACPI_OSD_EXEC_CALLBACK Function, void *Context)
acpi_task_count++;
break;
}
+
+ if (i > acpi_tasks_hiwater)
+ atomic_cmpset_int(&acpi_tasks_hiwater, acpi_tasks_hiwater, i);
+
if (at == NULL) {
printf("AcpiOsExecute: failed to enqueue task, consider increasing "
"the debug.acpi.max_tasks tunable\n");
diff --git a/sys/dev/acpica/Osd/OsdTable.c b/sys/dev/acpica/Osd/OsdTable.c
index 1e738f8..006b2ce 100644
--- a/sys/dev/acpica/Osd/OsdTable.c
+++ b/sys/dev/acpica/Osd/OsdTable.c
@@ -91,8 +91,8 @@ AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable,
if (hdr == NULL || sz == 0)
return (AE_ERROR);
#ifndef notyet
- /* Assume SSDT is loaded with DSDT. */
- AcpiGbl_DisableSsdtTableLoad = TRUE;
+ /* Assume SSDT is installed with DSDT. */
+ AcpiGbl_DisableSsdtTableInstall = TRUE;
#endif
*NewTable = hdr;
return (AE_OK);
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 1913912..37c79a5 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -256,16 +256,6 @@ static char acpi_remove_interface[256];
TUNABLE_STR("hw.acpi.remove_interface", acpi_remove_interface,
sizeof(acpi_remove_interface));
-/*
- * Allow override of whether methods execute in parallel or not.
- * Enable this for serial behavior, which fixes "AE_ALREADY_EXISTS"
- * errors for AML that really can't handle parallel method execution.
- * It is off by default since this breaks recursive methods and
- * some IBMs use such code.
- */
-static int acpi_serialize_methods;
-TUNABLE_INT("hw.acpi.serialize_methods", &acpi_serialize_methods);
-
/* Allow users to dump Debug objects without ACPI debugger. */
static int acpi_debug_objects;
TUNABLE_INT("debug.acpi.enable_debug_objects", &acpi_debug_objects);
@@ -279,6 +269,12 @@ TUNABLE_INT("debug.acpi.interpreter_slack", &acpi_interpreter_slack);
SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN,
&acpi_interpreter_slack, 1, "Turn on interpreter slack mode.");
+/* Ignore register widths set by FADT and use default widths instead. */
+static int acpi_ignore_reg_width = 1;
+TUNABLE_INT("debug.acpi.default_register_width", &acpi_ignore_reg_width);
+SYSCTL_INT(_debug_acpi, OID_AUTO, default_register_width, CTLFLAG_RDTUN,
+ &acpi_ignore_reg_width, 1, "Ignore register widths set by FADT");
+
#ifdef __amd64__
/* Reset system clock while resuming. XXX Remove once tested. */
static int acpi_reset_clock = 1;
@@ -474,9 +470,9 @@ acpi_attach(device_t dev)
* Set the globals from our tunables. This is needed because ACPI-CA
* uses UINT8 for some values and we have no tunable_byte.
*/
- AcpiGbl_AllMethodsSerialized = acpi_serialize_methods ? TRUE : FALSE;
AcpiGbl_EnableInterpreterSlack = acpi_interpreter_slack ? TRUE : FALSE;
AcpiGbl_EnableAmlDebugObject = acpi_debug_objects ? TRUE : FALSE;
+ AcpiGbl_UseDefaultRegisterWidths = acpi_ignore_reg_width ? TRUE : FALSE;
#ifndef ACPI_DEBUG
/*
diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c
index f4e794a..d94b6f0 100644
--- a/sys/dev/acpica/acpi_pci.c
+++ b/sys/dev/acpica/acpi_pci.c
@@ -282,7 +282,7 @@ acpi_pci_probe(device_t dev)
if (acpi_get_handle(dev) == NULL)
return (ENXIO);
device_set_desc(dev, "ACPI PCI bus");
- return (0);
+ return (BUS_PROBE_DEFAULT);
}
static int
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 0c3197a..69fa76b 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -1126,6 +1126,7 @@ ahci_ch_intr_direct(void *arg)
struct ahci_channel *ch = (struct ahci_channel *)arg;
struct ccb_hdr *ccb_h;
uint32_t istatus;
+ STAILQ_HEAD(, ccb_hdr) tmp_doneq = STAILQ_HEAD_INITIALIZER(tmp_doneq);
/* Read interrupt statuses. */
istatus = ATA_INL(ch->r_mem, AHCI_P_IS);
@@ -1136,9 +1137,14 @@ ahci_ch_intr_direct(void *arg)
ch->batch = 1;
ahci_ch_intr_main(ch, istatus);
ch->batch = 0;
+ /*
+ * Prevent the possibility of issues caused by processing the queue
+ * while unlocked below by moving the contents to a local queue.
+ */
+ STAILQ_CONCAT(&tmp_doneq, &ch->doneq);
mtx_unlock(&ch->mtx);
- while ((ccb_h = STAILQ_FIRST(&ch->doneq)) != NULL) {
- STAILQ_REMOVE_HEAD(&ch->doneq, sim_links.stqe);
+ while ((ccb_h = STAILQ_FIRST(&tmp_doneq)) != NULL) {
+ STAILQ_REMOVE_HEAD(&tmp_doneq, sim_links.stqe);
xpt_done_direct((union ccb *)ccb_h);
}
}
diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c
index 750248e..2aefc89 100644
--- a/sys/dev/ath/ath_hal/ah.c
+++ b/sys/dev/ath/ath_hal/ah.c
@@ -55,7 +55,9 @@ ath_hal_probe(uint16_t vendorid, uint16_t devid)
*/
struct ath_hal*
ath_hal_attach(uint16_t devid, HAL_SOFTC sc,
- HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *error)
+ HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config,
+ HAL_STATUS *error)
{
struct ath_hal_chip * const *pchip;
@@ -66,7 +68,8 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC sc,
/* XXX don't have vendorid, assume atheros one works */
if (chip->probe(ATHEROS_VENDOR_ID, devid) == AH_NULL)
continue;
- ah = chip->attach(devid, sc, st, sh, eepromdata, error);
+ ah = chip->attach(devid, sc, st, sh, eepromdata, ah_config,
+ error);
if (ah != AH_NULL) {
/* copy back private state to public area */
ah->ah_devid = AH_PRIVATE(ah)->ah_devid;
diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h
index 4f2d3e9..239ebc8 100644
--- a/sys/dev/ath/ath_hal/ah.h
+++ b/sys/dev/ath/ath_hal/ah.h
@@ -1264,6 +1264,7 @@ typedef struct
int ath_hal_show_bb_panic;
int ath_hal_ant_ctrl_comm2g_switch_enable;
int ath_hal_ext_atten_margin_cfg;
+ int ath_hal_min_gainidx;
int ath_hal_war70c;
uint32_t ath_hal_mci_config;
} HAL_OPS_CONFIG;
@@ -1616,7 +1617,8 @@ extern const char *__ahdecl ath_hal_probe(uint16_t vendorid, uint16_t devid);
* be returned if the status parameter is non-zero.
*/
extern struct ath_hal * __ahdecl ath_hal_attach(uint16_t devid, HAL_SOFTC,
- HAL_BUS_TAG, HAL_BUS_HANDLE, uint16_t *eepromdata, HAL_STATUS* status);
+ HAL_BUS_TAG, HAL_BUS_HANDLE, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config, HAL_STATUS* status);
extern const char *ath_hal_mac_name(struct ath_hal *);
extern const char *ath_hal_rf_name(struct ath_hal *);
diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h
index 2e35148..0892a42 100644
--- a/sys/dev/ath/ath_hal/ah_internal.h
+++ b/sys/dev/ath/ath_hal/ah_internal.h
@@ -91,6 +91,7 @@ struct ath_hal_chip {
const char *(*probe)(uint16_t vendorid, uint16_t devid);
struct ath_hal *(*attach)(uint16_t devid, HAL_SOFTC,
HAL_BUS_TAG, HAL_BUS_HANDLE, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah,
HAL_STATUS *error);
};
#ifndef AH_CHIP
diff --git a/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c b/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
index ee11ce9..ceafa99 100644
--- a/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
+++ b/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
@@ -183,7 +183,7 @@ static HAL_BOOL ar5210FillCapabilityInfo(struct ath_hal *ah);
*/
static struct ath_hal *
ar5210Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh,
- uint16_t *eepromdata, HAL_STATUS *status)
+ uint16_t *eepromdata, HAL_OPS_CONFIG *ah_config, HAL_STATUS *status)
{
#define N(a) (sizeof(a)/sizeof(a[0]))
struct ath_hal_5210 *ahp;
diff --git a/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c b/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
index 4549295..3416dc0 100644
--- a/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
+++ b/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
@@ -203,7 +203,7 @@ ar5211GetRadioRev(struct ath_hal *ah)
static struct ath_hal *
ar5211Attach(uint16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
- HAL_STATUS *status)
+ HAL_OPS_CONFIG *ah_config, HAL_STATUS *status)
{
#define N(a) (sizeof(a)/sizeof(a[0]))
struct ath_hal_5211 *ahp;
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
index e0af27c..a95f244 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
@@ -317,7 +317,7 @@ ar5212IsMacSupported(uint8_t macVersion, uint8_t macRev)
static struct ath_hal *
ar5212Attach(uint16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
- HAL_STATUS *status)
+ HAL_OPS_CONFIG *ah_config, HAL_STATUS *status)
{
#define AH_EEPROM_PROTECT(ah) \
(AH_PRIVATE(ah)->ah_ispcie)? AR_EEPROM_PROTECT_PCIE : AR_EEPROM_PROTECT)
diff --git a/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c b/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c
index 4ca1a4d..5c84eb8 100644
--- a/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c
+++ b/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c
@@ -62,7 +62,7 @@ ar5312AniSetup(struct ath_hal *ah)
static struct ath_hal *
ar5312Attach(uint16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
- HAL_STATUS *status)
+ HAL_OPS_CONFIG *ah_config, HAL_STATUS *status)
{
struct ath_hal_5212 *ahp = AH_NULL;
struct ath_hal *ah;
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
index bdc6111..a20499a 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
@@ -297,7 +297,7 @@ ar5416GetRadioRev(struct ath_hal *ah)
static struct ath_hal *
ar5416Attach(uint16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
- HAL_STATUS *status)
+ HAL_OPS_CONFIG *ah_config, HAL_STATUS *status)
{
struct ath_hal_5416 *ahp5416;
struct ath_hal_5212 *ahp;
diff --git a/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c b/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
index 4f478c0..c270bab 100644
--- a/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
+++ b/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
@@ -69,7 +69,9 @@ static HAL_BOOL ar9130FillCapabilityInfo(struct ath_hal *ah);
*/
static struct ath_hal *
ar9130Attach(uint16_t devid, HAL_SOFTC sc,
- HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *status)
+ HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config,
+ HAL_STATUS *status)
{
struct ath_hal_5416 *ahp5416;
struct ath_hal_5212 *ahp;
diff --git a/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c b/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
index 979ba1a..5bda519 100644
--- a/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
+++ b/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
@@ -114,6 +114,7 @@ ar9160InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan)
static struct ath_hal *
ar9160Attach(uint16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config,
HAL_STATUS *status)
{
struct ath_hal_5416 *ahp5416;
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
index 2a67fe5..3be3e35 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
@@ -148,6 +148,7 @@ ar9280InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan)
static struct ath_hal *
ar9280Attach(uint16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config,
HAL_STATUS *status)
{
struct ath_hal_9280 *ahp9280;
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
index edb6f26..eb3490a 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
@@ -133,6 +133,7 @@ ar9285_eeprom_print_diversity_settings(struct ath_hal *ah)
static struct ath_hal *
ar9285Attach(uint16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config,
HAL_STATUS *status)
{
struct ath_hal_9285 *ahp9285;
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
index 010e2c3..0ea565c 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
@@ -111,6 +111,7 @@ ar9287AniSetup(struct ath_hal *ah)
static struct ath_hal *
ar9287Attach(uint16_t devid, HAL_SOFTC sc,
HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
+ HAL_OPS_CONFIG *ah_config,
HAL_STATUS *status)
{
struct ath_hal_9287 *ahp9287;
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 898433e..af686f0 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -435,6 +435,81 @@ _ath_power_restore_power_state(struct ath_softc *sc, const char *file, int line)
}
+/*
+ * Configure the initial HAL configuration values based on bus
+ * specific parameters.
+ *
+ * Some PCI IDs and other information may need tweaking.
+ *
+ * XXX TODO: ath9k and the Atheros HAL only program comm2g_switch_enable
+ * if BT antenna diversity isn't enabled.
+ *
+ * So, let's also figure out how to enable BT diversity for AR9485.
+ */
+static void
+ath_setup_hal_config(struct ath_softc *sc, HAL_OPS_CONFIG *ah_config)
+{
+ /* XXX TODO: only for PCI devices? */
+
+ if (sc->sc_pci_devinfo & (ATH_PCI_CUS198 | ATH_PCI_CUS230)) {
+ ah_config->ath_hal_ext_lna_ctl_gpio = 0x200; /* bit 9 */
+ ah_config->ath_hal_ext_atten_margin_cfg = AH_TRUE;
+ ah_config->ath_hal_min_gainidx = AH_TRUE;
+ ah_config->ath_hal_ant_ctrl_comm2g_switch_enable = 0x000bbb88;
+ /* XXX low_rssi_thresh */
+ /* XXX fast_div_bias */
+ device_printf(sc->sc_dev, "configuring for %s\n",
+ (sc->sc_pci_devinfo & ATH_PCI_CUS198) ?
+ "CUS198" : "CUS230");
+ }
+
+ if (sc->sc_pci_devinfo & ATH_PCI_CUS217)
+ device_printf(sc->sc_dev, "CUS217 card detected\n");
+
+ if (sc->sc_pci_devinfo & ATH_PCI_CUS252)
+ device_printf(sc->sc_dev, "CUS252 card detected\n");
+
+ if (sc->sc_pci_devinfo & ATH_PCI_AR9565_1ANT)
+ device_printf(sc->sc_dev, "WB335 1-ANT card detected\n");
+
+ if (sc->sc_pci_devinfo & ATH_PCI_AR9565_2ANT)
+ device_printf(sc->sc_dev, "WB335 2-ANT card detected\n");
+
+ if (sc->sc_pci_devinfo & ATH_PCI_KILLER)
+ device_printf(sc->sc_dev, "Killer Wireless card detected\n");
+
+#if 0
+ /*
+ * Some WB335 cards do not support antenna diversity. Since
+ * we use a hardcoded value for AR9565 instead of using the
+ * EEPROM/OTP data, remove the combining feature from
+ * the HW capabilities bitmap.
+ */
+ if (sc->sc_pci_devinfo & (ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_AR9565_2ANT)) {
+ if (!(sc->sc_pci_devinfo & ATH9K_PCI_BT_ANT_DIV))
+ pCap->hw_caps &= ~ATH9K_HW_CAP_ANT_DIV_COMB;
+ }
+
+ if (sc->sc_pci_devinfo & ATH9K_PCI_BT_ANT_DIV) {
+ pCap->hw_caps |= ATH9K_HW_CAP_BT_ANT_DIV;
+ device_printf(sc->sc_dev, "Set BT/WLAN RX diversity capability\n");
+ }
+#endif
+
+ if (sc->sc_pci_devinfo & ATH_PCI_D3_L1_WAR) {
+ ah_config->ath_hal_pcie_waen = 0x0040473b;
+ device_printf(sc->sc_dev, "Enable WAR for ASPM D3/L1\n");
+ }
+
+#if 0
+ if (sc->sc_pci_devinfo & ATH9K_PCI_NO_PLL_PWRSAVE) {
+ ah->config.no_pll_pwrsave = true;
+ device_printf(sc->sc_dev, "Disable PLL PowerSave\n");
+ }
+#endif
+
+}
+
#define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20)
#define HAL_MODE_HT40 \
(HAL_MODE_11NG_HT40PLUS | HAL_MODE_11NG_HT40MINUS | \
@@ -450,6 +525,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
u_int wmodes;
uint8_t macaddr[IEEE80211_ADDR_LEN];
int rx_chainmask, tx_chainmask;
+ HAL_OPS_CONFIG ah_config;
DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid);
@@ -468,8 +544,17 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
device_get_unit(sc->sc_dev));
CURVNET_RESTORE();
+ /*
+ * Configure the initial configuration data.
+ *
+ * This is stuff that may be needed early during attach
+ * rather than done via configuration calls later.
+ */
+ bzero(&ah_config, sizeof(ah_config));
+ ath_setup_hal_config(sc, &ah_config);
+
ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh,
- sc->sc_eepromdata, &status);
+ sc->sc_eepromdata, &ah_config, &status);
if (ah == NULL) {
if_printf(ifp, "unable to attach hardware; HAL status %u\n",
status);
@@ -7101,6 +7186,6 @@ ath_node_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m)
MODULE_VERSION(if_ath, 1);
MODULE_DEPEND(if_ath, wlan, 1, 1, 1); /* 802.11 media layer */
-#if defined(IEEE80211_ALQ) || defined(AH_DEBUG_ALQ)
+#if defined(IEEE80211_ALQ) || defined(AH_DEBUG_ALQ) || defined(ATH_DEBUG_ALQ)
MODULE_DEPEND(if_ath, alq, 1, 1, 1);
#endif
diff --git a/sys/dev/ath/if_ath_lna_div.c b/sys/dev/ath/if_ath_lna_div.c
index 961b834..f0a33a5 100644
--- a/sys/dev/ath/if_ath_lna_div.c
+++ b/sys/dev/ath/if_ath_lna_div.c
@@ -209,6 +209,10 @@ bad:
return (error);
}
+/*
+ * XXX need to low_rssi_thresh config from ath9k, to support CUS198
+ * antenna diversity correctly.
+ */
static HAL_BOOL
ath_is_alt_ant_ratio_better(int alt_ratio, int maxdelta, int mindelta,
int main_rssi_avg, int alt_rssi_avg, int pkt_count)
diff --git a/sys/dev/ath/if_ath_pci.c b/sys/dev/ath/if_ath_pci.c
index dbbc411..057ec2c 100644
--- a/sys/dev/ath/if_ath_pci.c
+++ b/sys/dev/ath/if_ath_pci.c
@@ -80,6 +80,98 @@ struct ath_pci_softc {
void *sc_ih; /* interrupt handler */
};
+/*
+ * XXX eventually this should be some system level definition
+ * so modules will hvae probe/attach information like USB.
+ * But for now..
+ */
+struct pci_device_id {
+ int vendor_id;
+ int device_id;
+
+ int sub_vendor_id;
+ int sub_device_id;
+
+ int driver_data;
+
+ int match_populated:1;
+ int match_vendor_id:1;
+ int match_device_id:1;
+ int match_sub_vendor_id:1;
+ int match_sub_device_id:1;
+};
+
+#define PCI_VDEVICE(v, s) \
+ .vendor_id = (v), \
+ .device_id = (s), \
+ .match_populated = 1, \
+ .match_vendor_id = 1, \
+ .match_device_id = 1
+
+#define PCI_DEVICE_SUB(v, d, dv, ds) \
+ .match_populated = 1, \
+ .vendor_id = (v), .match_vendor_id = 1, \
+ .device_id = (d), .match_device_id = 1, \
+ .sub_vendor_id = (dv), .match_sub_vendor_id = 1, \
+ .sub_device_id = (ds), .match_sub_device_id = 1
+
+#define PCI_VENDOR_ID_ATHEROS 0x168c
+#define PCI_VENDOR_ID_SAMSUNG 0x144d
+#define PCI_VENDOR_ID_AZWAVE 0x1a3b
+#define PCI_VENDOR_ID_FOXCONN 0x105b
+#define PCI_VENDOR_ID_ATTANSIC 0x1969
+#define PCI_VENDOR_ID_ASUSTEK 0x1043
+#define PCI_VENDOR_ID_DELL 0x1028
+#define PCI_VENDOR_ID_QMI 0x1a32
+#define PCI_VENDOR_ID_LENOVO 0x17aa
+#define PCI_VENDOR_ID_HP 0x103c
+
+#include "if_ath_pci_devlist.h"
+
+/*
+ * Attempt to find a match for the given device in
+ * the given device table.
+ *
+ * Returns the device structure or NULL if no matching
+ * PCI device is found.
+ */
+static const struct pci_device_id *
+ath_pci_probe_device(device_t dev, const struct pci_device_id *dev_table, int nentries)
+{
+ int i;
+ int vendor_id, device_id;
+ int sub_vendor_id, sub_device_id;
+
+ vendor_id = pci_get_vendor(dev);
+ device_id = pci_get_device(dev);
+ sub_vendor_id = pci_get_subvendor(dev);
+ sub_device_id = pci_get_subdevice(dev);
+
+ for (i = 0; i < nentries; i++) {
+ /* Don't match on non-populated (eg empty) entries */
+ if (! dev_table[i].match_populated)
+ continue;
+
+ if (dev_table[i].match_vendor_id &&
+ (dev_table[i].vendor_id != vendor_id))
+ continue;
+ if (dev_table[i].match_device_id &&
+ (dev_table[i].device_id != device_id))
+ continue;
+ if (dev_table[i].match_sub_vendor_id &&
+ (dev_table[i].sub_vendor_id != sub_vendor_id))
+ continue;
+ if (dev_table[i].match_sub_device_id &&
+ (dev_table[i].sub_device_id != sub_device_id))
+ continue;
+
+ /* Match */
+ return (&dev_table[i]);
+ }
+
+ return (NULL);
+}
+
#define BS_BAR 0x10
#define PCIR_RETRY_TIMEOUT 0x41
#define PCIR_CFG_PMCSR 0x48
@@ -150,9 +242,15 @@ ath_pci_attach(device_t dev)
const struct firmware *fw = NULL;
const char *buf;
#endif
+ const struct pci_device_id *pd;
sc->sc_dev = dev;
+ /* Do this lookup anyway; figure out what to do with it later */
+ pd = ath_pci_probe_device(dev, ath_pci_id_table, nitems(ath_pci_id_table));
+ if (pd)
+ sc->sc_pci_devinfo = pd->driver_data;
+
/*
* Enable bus mastering.
*/
diff --git a/sys/dev/ath/if_ath_pci_devlist.h b/sys/dev/ath/if_ath_pci_devlist.h
new file mode 100644
index 0000000..ae65909
--- /dev/null
+++ b/sys/dev/ath/if_ath_pci_devlist.h
@@ -0,0 +1,669 @@
+/*-
+ * Copyright (c) 2014 Qualcomm Atheros.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ * redistribution must be conditioned upon including a substantially
+ * similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * $FreeBSD$
+ */
+
+static const struct pci_device_id ath_pci_id_table[] = {
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0023) }, /* PCI */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0024) }, /* PCI-E */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0027) }, /* PCI */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0029) }, /* PCI */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002A) }, /* PCI-E */
+
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x1C71),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ PCI_VENDOR_ID_FOXCONN,
+ 0xE01F),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ 0x11AD, /* LITEON */
+ 0x6632),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ 0x11AD, /* LITEON */
+ 0x6642),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ PCI_VENDOR_ID_QMI,
+ 0x0306),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ 0x185F, /* WNC */
+ 0x309D),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ 0x10CF, /* Fujitsu */
+ 0x147C),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ 0x10CF, /* Fujitsu */
+ 0x147D),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002A,
+ 0x10CF, /* Fujitsu */
+ 0x1536),
+ .driver_data = ATH_PCI_D3_L1_WAR },
+
+ /* AR9285 card for Asus */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x002B,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2C37),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002B) }, /* PCI-E */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002D) }, /* PCI */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002E) }, /* PCI-E */
+
+ /* Killer Wireless (3x3) */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0030,
+ 0x1A56,
+ 0x2000),
+ .driver_data = ATH_PCI_KILLER },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0030,
+ 0x1A56,
+ 0x2001),
+ .driver_data = ATH_PCI_KILLER },
+
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0030) }, /* PCI-E AR9300 */
+
+ /* PCI-E CUS198 */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2086),
+ .driver_data = ATH_PCI_CUS198 | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x1237),
+ .driver_data = ATH_PCI_CUS198 | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2126),
+ .driver_data = ATH_PCI_CUS198 | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x126A),
+ .driver_data = ATH_PCI_CUS198 | ATH_PCI_BT_ANT_DIV },
+
+ /* PCI-E CUS230 */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2152),
+ .driver_data = ATH_PCI_CUS230 | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_FOXCONN,
+ 0xE075),
+ .driver_data = ATH_PCI_CUS230 | ATH_PCI_BT_ANT_DIV },
+
+ /* WB225 */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x3119),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x3122),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x185F, /* WNC */
+ 0x3119),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x185F, /* WNC */
+ 0x3027),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x4105),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x4106),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x410D),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x410E),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x410F),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0xC706),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0xC680),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0xC708),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_LENOVO,
+ 0x3218),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_LENOVO,
+ 0x3219),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+
+ /* AR9485 cards with PLL power-save disabled by default. */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2C97),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2100),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x1C56, /* ASKEY */
+ 0x4001),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x11AD, /* LITEON */
+ 0x6627),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x11AD, /* LITEON */
+ 0x6628),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_FOXCONN,
+ 0xE04E),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_FOXCONN,
+ 0xE04F),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x144F, /* ASKEY */
+ 0x7197),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x1B9A, /* XAVI */
+ 0x2000),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x1B9A, /* XAVI */
+ 0x2001),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x1186),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x1F86),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x1195),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x1F95),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x1B9A, /* XAVI */
+ 0x1C00),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ 0x1B9A, /* XAVI */
+ 0x1C01),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0032,
+ PCI_VENDOR_ID_ASUSTEK,
+ 0x850D),
+ .driver_data = ATH_PCI_NO_PLL_PWRSAVE },
+
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0032) }, /* PCI-E AR9485 */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0033) }, /* PCI-E AR9580 */
+
+ /* PCI-E CUS217 */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2116),
+ .driver_data = ATH_PCI_CUS217 },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x11AD, /* LITEON */
+ 0x6661),
+ .driver_data = ATH_PCI_CUS217 },
+
+ /* AR9462 with WoW support */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x3117),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_LENOVO,
+ 0x3214),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_ATTANSIC,
+ 0x0091),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2110),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_ASUSTEK,
+ 0x850E),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x11AD, /* LITEON */
+ 0x6631),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x11AD, /* LITEON */
+ 0x6641),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_HP,
+ 0x1864),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x14CD, /* USI */
+ 0x0063),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x14CD, /* USI */
+ 0x0064),
+ .driver_data = ATH_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x10CF, /* Fujitsu */
+ 0x1783),
+ .driver_data = ATH_PCI_WOW },
+
+ /* Killer Wireless (2x2) */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0030,
+ 0x1A56,
+ 0x2003),
+ .driver_data = ATH_PCI_KILLER },
+
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0034) }, /* PCI-E AR9462 */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */
+
+ /* CUS252 */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x3028),
+ .driver_data = ATH_PCI_CUS252 |
+ ATH_PCI_AR9565_2ANT |
+ ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2176),
+ .driver_data = ATH_PCI_CUS252 |
+ ATH_PCI_AR9565_2ANT |
+ ATH_PCI_BT_ANT_DIV },
+
+ /* WB335 1-ANT */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_FOXCONN,
+ 0xE068),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x185F, /* WNC */
+ 0xA119),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0632),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x06B2),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0842),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x6671),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x1B9A, /* XAVI */
+ 0x2811),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x1B9A, /* XAVI */
+ 0x2812),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x1B9A, /* XAVI */
+ 0x28A1),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x218A),
+ .driver_data = ATH_PCI_AR9565_1ANT },
+
+ /* WB335 1-ANT / Antenna Diversity */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x3025),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x3026),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x302B),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_FOXCONN,
+ 0xE069),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x185F, /* WNC */
+ 0x3028),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0622),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0672),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0662),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x06A2),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0682),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x213A),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_HP,
+ 0x18E3),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_HP,
+ 0x217F),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_HP,
+ 0x2005),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_DELL,
+ 0x020C),
+ .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV },
+
+ /* WB335 2-ANT / Antenna-Diversity */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x411A),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x411B),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x411C),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x411D),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_SAMSUNG,
+ 0x411E),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x3027),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x302C),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0642),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0652),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0612),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0832),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x11AD, /* LITEON */
+ 0x0692),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2130),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x213B),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2182),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x144F, /* ASKEY */
+ 0x7202),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x1B9A, /* XAVI */
+ 0x2810),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x1B9A, /* XAVI */
+ 0x28A2),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x185F, /* WNC */
+ 0x3027),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ 0x185F, /* WNC */
+ 0xA120),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_FOXCONN,
+ 0xE07F),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_FOXCONN,
+ 0xE081),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_LENOVO,
+ 0x3026),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_LENOVO,
+ 0x4026),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_ASUSTEK,
+ 0x85F2),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0036,
+ PCI_VENDOR_ID_DELL,
+ 0x020E),
+ .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV },
+
+ /* PCI-E AR9565 (WB335) */
+ { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0036),
+ .driver_data = ATH_PCI_BT_ANT_DIV },
+
+ { 0 }
+};
+
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index 67eaecf..e888ca2 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -82,6 +82,25 @@
#define ATH_BEACON_CWMAX_DEFAULT 0 /* default cwmax for ap beacon q */
/*
+ * The following bits can be set during the PCI (and perhaps non-PCI
+ * later) device probe path.
+ *
+ * It controls some of the driver and HAL behaviour.
+ */
+
+#define ATH_PCI_CUS198 0x0001
+#define ATH_PCI_CUS230 0x0002
+#define ATH_PCI_CUS217 0x0004
+#define ATH_PCI_CUS252 0x0008
+#define ATH_PCI_WOW 0x0010
+#define ATH_PCI_BT_ANT_DIV 0x0020
+#define ATH_PCI_D3_L1_WAR 0x0040
+#define ATH_PCI_AR9565_1ANT 0x0080
+#define ATH_PCI_AR9565_2ANT 0x0100
+#define ATH_PCI_NO_PLL_PWRSAVE 0x0200
+#define ATH_PCI_KILLER 0x0400
+
+/*
* The key cache is used for h/w cipher state and also for
* tracking station state such as the current tx antenna.
* We also setup a mapping table between key cache slot indices
@@ -884,6 +903,9 @@ struct ath_softc {
HAL_POWER_MODE sc_cur_powerstate;
int sc_powersave_refcnt;
+
+ /* ATH_PCI_* flags */
+ uint32_t sc_pci_devinfo;
};
#define ATH_LOCK_INIT(_sc) \
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 374a419..838be4f 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -5828,7 +5828,7 @@ bge_ioctl(if_t ifp, u_long command, caddr_t data)
#ifdef DEVICE_POLLING
if (mask & IFCAP_POLLING) {
if (ifr->ifr_reqcap & IFCAP_POLLING) {
- error = ether_poll_register_drv(bge_poll, ifp);
+ error = ether_poll_register(bge_poll, ifp);
if (error)
return (error);
BGE_LOCK(sc);
diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c
index 36c4ba4..d0dd0c7 100644
--- a/sys/dev/ce/if_ce.c
+++ b/sys/dev/ce/if_ce.c
@@ -1133,12 +1133,7 @@ static void ce_receive (ce_chan_t *c, unsigned char *data, int len)
m->m_pkthdr.rcvif = d->ifp;
/* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to bpf. */
-#if __FreeBSD_version >= 500000
- BPF_TAP (d->ifp, data, len);
-#else
- if (d->ifp->if_bpf)
- bpf_tap (d->ifp, data, len);
-#endif
+ BPF_MTAP(d->ifp, m);
IF_ENQUEUE(&d->rqueue, m);
#endif
}
diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c
index ca6aaf4..4e70838 100644
--- a/sys/dev/cp/if_cp.c
+++ b/sys/dev/cp/if_cp.c
@@ -902,7 +902,7 @@ static void cp_receive (cp_chan_t *c, unsigned char *data, int len)
m->m_pkthdr.rcvif = d->ifp;
/* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to bpf. */
- BPF_TAP (d->ifp, data, len);
+ BPF_MTAP(d->ifp, m);
IF_ENQUEUE (&d->queue, m);
#endif
}
diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c
index 5cf20dd..397c3ac 100644
--- a/sys/dev/ctau/if_ct.c
+++ b/sys/dev/ctau/if_ct.c
@@ -1120,7 +1120,7 @@ static void ct_receive (ct_chan_t *c, char *data, int len)
m->m_pkthdr.rcvif = d->ifp;
/* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to bpf. */
- BPF_TAP (d->ifp, data, len);
+ BPF_MTAP(d->ifp, m);
IF_ENQUEUE (&d->queue, m);
#endif
}
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index eecab5f..360e1f6 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -1318,7 +1318,7 @@ static void cx_receive (cx_chan_t *c, char *data, int len)
m->m_pkthdr.rcvif = d->ifp;
/* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to bpf. */
- BPF_TAP (d->ifp, data, len);
+ BPF_MTAP(d->ifp, m);
IF_ENQUEUE (&d->queue, m);
#endif
}
diff --git a/sys/dev/cxgb/cxgb_adapter.h b/sys/dev/cxgb/cxgb_adapter.h
index 6aaacd3..6f3abe7 100644
--- a/sys/dev/cxgb/cxgb_adapter.h
+++ b/sys/dev/cxgb/cxgb_adapter.h
@@ -97,6 +97,7 @@ struct port_info {
const struct port_type_info *port_type;
struct cphy phy;
struct cmac mac;
+ struct timeval last_refreshed;
struct link_config link_config;
struct ifmedia media;
struct mtx lock;
@@ -575,4 +576,5 @@ void cxgb_tx_watchdog(void *arg);
int cxgb_transmit(struct ifnet *ifp, struct mbuf *m);
void cxgb_qflush(struct ifnet *ifp);
void t3_iterate(void (*)(struct adapter *, void *), void *);
+void cxgb_refresh_stats(struct port_info *);
#endif
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index 7488553..b4bacc6 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -96,6 +96,7 @@ static int cxgb_media_change(struct ifnet *);
static int cxgb_ifm_type(int);
static void cxgb_build_medialist(struct port_info *);
static void cxgb_media_status(struct ifnet *, struct ifmediareq *);
+static uint64_t cxgb_get_counter(struct ifnet *, ift_counter);
static int setup_sge_qsets(adapter_t *);
static void cxgb_async_intr(void *);
static void cxgb_tick_handler(void *, int);
@@ -1022,6 +1023,7 @@ cxgb_port_attach(device_t dev)
ifp->if_ioctl = cxgb_ioctl;
ifp->if_transmit = cxgb_transmit;
ifp->if_qflush = cxgb_qflush;
+ ifp->if_get_counter = cxgb_get_counter;
ifp->if_capabilities = CXGB_CAP;
#ifdef TCP_OFFLOAD
@@ -2189,6 +2191,71 @@ cxgb_media_status(struct ifnet *ifp, struct ifmediareq *ifmr)
speed));
}
+static uint64_t
+cxgb_get_counter(struct ifnet *ifp, ift_counter c)
+{
+ struct port_info *pi = ifp->if_softc;
+ struct adapter *sc = pi->adapter;
+ struct cmac *mac = &pi->mac;
+ struct mac_stats *mstats = &mac->stats;
+
+ cxgb_refresh_stats(pi);
+
+ switch (c) {
+ case IFCOUNTER_IPACKETS:
+ return (mstats->rx_frames);
+
+ case IFCOUNTER_IERRORS:
+ return (mstats->rx_jabber + mstats->rx_data_errs +
+ mstats->rx_sequence_errs + mstats->rx_runt +
+ mstats->rx_too_long + mstats->rx_mac_internal_errs +
+ mstats->rx_short + mstats->rx_fcs_errs);
+
+ case IFCOUNTER_OPACKETS:
+ return (mstats->tx_frames);
+
+ case IFCOUNTER_OERRORS:
+ return (mstats->tx_excess_collisions + mstats->tx_underrun +
+ mstats->tx_len_errs + mstats->tx_mac_internal_errs +
+ mstats->tx_excess_deferral + mstats->tx_fcs_errs);
+
+ case IFCOUNTER_COLLISIONS:
+ return (mstats->tx_total_collisions);
+
+ case IFCOUNTER_IBYTES:
+ return (mstats->rx_octets);
+
+ case IFCOUNTER_OBYTES:
+ return (mstats->tx_octets);
+
+ case IFCOUNTER_IMCASTS:
+ return (mstats->rx_mcast_frames);
+
+ case IFCOUNTER_OMCASTS:
+ return (mstats->tx_mcast_frames);
+
+ case IFCOUNTER_IQDROPS:
+ return (mstats->rx_cong_drops);
+
+ case IFCOUNTER_OQDROPS: {
+ int i;
+ uint64_t drops;
+
+ drops = 0;
+ if (sc->flags & FULL_INIT_DONE) {
+ for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++)
+ drops += sc->sge.qs[i].txq[TXQ_ETH].txq_mr->br_drops;
+ }
+
+ return (drops);
+
+ }
+
+ default:
+ return (if_get_counter_default(ifp, c));
+ }
+}
+
static void
cxgb_async_intr(void *data)
{
@@ -2289,6 +2356,23 @@ cxgb_tick(void *arg)
callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc);
}
+void
+cxgb_refresh_stats(struct port_info *pi)
+{
+ struct timeval tv;
+ const struct timeval interval = {0, 250000}; /* 250ms */
+
+ getmicrotime(&tv);
+ timevalsub(&tv, &interval);
+ if (timevalcmp(&tv, &pi->last_refreshed, <))
+ return;
+
+ PORT_LOCK(pi);
+ t3_mac_update_stats(&pi->mac);
+ PORT_UNLOCK(pi);
+ getmicrotime(&pi->last_refreshed);
+}
+
static void
cxgb_tick_handler(void *arg, int count)
{
@@ -2333,48 +2417,12 @@ cxgb_tick_handler(void *arg, int count)
for (i = 0; i < sc->params.nports; i++) {
struct port_info *pi = &sc->port[i];
- struct ifnet *ifp = pi->ifp;
struct cmac *mac = &pi->mac;
- struct mac_stats *mstats = &mac->stats;
- int drops, j;
if (!isset(&sc->open_device_map, pi->port_id))
continue;
- PORT_LOCK(pi);
- t3_mac_update_stats(mac);
- PORT_UNLOCK(pi);
-
- ifp->if_opackets = mstats->tx_frames;
- ifp->if_ipackets = mstats->rx_frames;
- ifp->if_obytes = mstats->tx_octets;
- ifp->if_ibytes = mstats->rx_octets;
- ifp->if_omcasts = mstats->tx_mcast_frames;
- ifp->if_imcasts = mstats->rx_mcast_frames;
- ifp->if_collisions = mstats->tx_total_collisions;
- ifp->if_iqdrops = mstats->rx_cong_drops;
-
- drops = 0;
- for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; j++)
- drops += sc->sge.qs[j].txq[TXQ_ETH].txq_mr->br_drops;
- ifp->if_oqdrops = drops;
-
- ifp->if_oerrors =
- mstats->tx_excess_collisions +
- mstats->tx_underrun +
- mstats->tx_len_errs +
- mstats->tx_mac_internal_errs +
- mstats->tx_excess_deferral +
- mstats->tx_fcs_errs;
- ifp->if_ierrors =
- mstats->rx_jabber +
- mstats->rx_data_errs +
- mstats->rx_sequence_errs +
- mstats->rx_runt +
- mstats->rx_too_long +
- mstats->rx_mac_internal_errs +
- mstats->rx_short +
- mstats->rx_fcs_errs;
+ cxgb_refresh_stats(pi);
if (mac->multiport)
continue;
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c
index fcc0376..88ee7cc 100644
--- a/sys/dev/cxgb/cxgb_sge.c
+++ b/sys/dev/cxgb/cxgb_sge.c
@@ -3410,10 +3410,8 @@ sysctl_handle_macstat(SYSCTL_HANDLER_ARGS)
if (!p)
return (EINVAL);
+ cxgb_refresh_stats(p);
parg = (uint64_t *) ((uint8_t *)&p->mac.stats + arg2);
- PORT_LOCK(p);
- t3_mac_update_stats(&p->mac);
- PORT_UNLOCK(p);
return (sysctl_handle_64(oidp, parg, 0, req));
}
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index 316852b..8cebdaa 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -268,7 +268,10 @@ struct port_info {
int linkdnrc;
struct link_config link_cfg;
- struct port_stats stats;
+
+ struct timeval last_refreshed;
+ struct port_stats stats;
+ u_int tnl_cong_drops;
eventhandler_tag vlan_c;
@@ -790,6 +793,8 @@ struct adapter {
TAILQ_HEAD(, sge_fl) sfl;
struct callout sfl_callout;
+ struct mtx regwin_lock; /* for indirect reads and memory windows */
+
an_handler_t an_handler __aligned(CACHE_LINE_SIZE);
fw_msg_handler_t fw_msg_handler[5]; /* NUM_FW6_TYPES */
cpl_handler_t cpl_handler[0xef]; /* NUM_CPL_CMDS */
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 99bc344..77c99b2 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -151,6 +151,7 @@ static void cxgbe_init(void *);
static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t);
static int cxgbe_transmit(struct ifnet *, struct mbuf *);
static void cxgbe_qflush(struct ifnet *);
+static uint64_t cxgbe_get_counter(struct ifnet *, ift_counter);
static int cxgbe_media_change(struct ifnet *);
static void cxgbe_media_status(struct ifnet *, struct ifmediareq *);
@@ -386,6 +387,7 @@ static int t4_free_irq(struct adapter *, struct irq *);
static void reg_block_dump(struct adapter *, uint8_t *, unsigned int,
unsigned int);
static void t4_get_regs(struct adapter *, struct t4_regdump *, uint8_t *);
+static void cxgbe_refresh_stats(struct adapter *, struct port_info *);
static void cxgbe_tick(void *);
static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t);
static int cpl_not_handled(struct sge_iq *, const struct rss_header *,
@@ -609,6 +611,8 @@ t4_attach(device_t dev)
TAILQ_INIT(&sc->sfl);
callout_init(&sc->sfl_callout, CALLOUT_MPSAFE);
+ mtx_init(&sc->regwin_lock, "register and memory window", 0, MTX_DEF);
+
rc = map_bars_0_and_4(sc);
if (rc != 0)
goto done; /* error message displayed already */
@@ -1024,6 +1028,8 @@ t4_detach(device_t dev)
mtx_destroy(&sc->sfl_lock);
if (mtx_initialized(&sc->ifp_lock))
mtx_destroy(&sc->ifp_lock);
+ if (mtx_initialized(&sc->regwin_lock))
+ mtx_destroy(&sc->regwin_lock);
bzero(sc, sizeof(*sc));
@@ -1073,6 +1079,7 @@ cxgbe_attach(device_t dev)
ifp->if_ioctl = cxgbe_ioctl;
ifp->if_transmit = cxgbe_transmit;
ifp->if_qflush = cxgbe_qflush;
+ ifp->if_get_counter = cxgbe_get_counter;
ifp->if_capabilities = T4_CAP;
#ifdef TCP_OFFLOAD
@@ -1083,6 +1090,10 @@ cxgbe_attach(device_t dev)
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
CSUM_UDP_IPV6 | CSUM_TCP_IPV6;
+ ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN);
+ ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS;
+ ifp->if_hw_tsomaxsegsize = 65536;
+
/* Initialize ifmedia for this port */
ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change,
cxgbe_media_status);
@@ -1500,6 +1511,67 @@ cxgbe_qflush(struct ifnet *ifp)
if_qflush(ifp);
}
+static uint64_t
+cxgbe_get_counter(struct ifnet *ifp, ift_counter c)
+{
+ struct port_info *pi = ifp->if_softc;
+ struct adapter *sc = pi->adapter;
+ struct port_stats *s = &pi->stats;
+
+ cxgbe_refresh_stats(sc, pi);
+
+ switch (c) {
+ case IFCOUNTER_IPACKETS:
+ return (s->rx_frames - s->rx_pause);
+
+ case IFCOUNTER_IERRORS:
+ return (s->rx_jabber + s->rx_runt + s->rx_too_long +
+ s->rx_fcs_err + s->rx_len_err);
+
+ case IFCOUNTER_OPACKETS:
+ return (s->tx_frames - s->tx_pause);
+
+ case IFCOUNTER_OERRORS:
+ return (s->tx_error_frames);
+
+ case IFCOUNTER_IBYTES:
+ return (s->rx_octets - s->rx_pause * 64);
+
+ case IFCOUNTER_OBYTES:
+ return (s->tx_octets - s->tx_pause * 64);
+
+ case IFCOUNTER_IMCASTS:
+ return (s->rx_mcast_frames - s->rx_pause);
+
+ case IFCOUNTER_OMCASTS:
+ return (s->tx_mcast_frames - s->tx_pause);
+
+ case IFCOUNTER_IQDROPS:
+ return (s->rx_ovflow0 + s->rx_ovflow1 + s->rx_ovflow2 +
+ s->rx_ovflow3 + s->rx_trunc0 + s->rx_trunc1 + s->rx_trunc2 +
+ s->rx_trunc3 + pi->tnl_cong_drops);
+
+ case IFCOUNTER_OQDROPS: {
+ uint64_t drops;
+
+ drops = s->tx_drop;
+ if (pi->flags & PORT_INIT_DONE) {
+ int i;
+ struct sge_txq *txq;
+
+ for_each_txq(pi, i, txq)
+ drops += txq->br->br_drops;
+ }
+
+ return (drops);
+
+ }
+
+ default:
+ return (if_get_counter_default(ifp, c));
+ }
+}
+
static int
cxgbe_media_change(struct ifnet *ifp)
{
@@ -4273,14 +4345,39 @@ t4_get_regs(struct adapter *sc, struct t4_regdump *regs, uint8_t *buf)
}
static void
+cxgbe_refresh_stats(struct adapter *sc, struct port_info *pi)
+{
+ int i;
+ u_int v, tnl_cong_drops;
+ struct timeval tv;
+ const struct timeval interval = {0, 250000}; /* 250ms */
+
+ getmicrotime(&tv);
+ timevalsub(&tv, &interval);
+ if (timevalcmp(&tv, &pi->last_refreshed, <))
+ return;
+
+ tnl_cong_drops = 0;
+ t4_get_port_stats(sc, pi->tx_chan, &pi->stats);
+ for (i = 0; i < NCHAN; i++) {
+ if (pi->rx_chan_map & (1 << i)) {
+ mtx_lock(&sc->regwin_lock);
+ t4_read_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v,
+ 1, A_TP_MIB_TNL_CNG_DROP_0 + i);
+ mtx_unlock(&sc->regwin_lock);
+ tnl_cong_drops += v;
+ }
+ }
+ pi->tnl_cong_drops = tnl_cong_drops;
+ getmicrotime(&pi->last_refreshed);
+}
+
+static void
cxgbe_tick(void *arg)
{
struct port_info *pi = arg;
struct adapter *sc = pi->adapter;
struct ifnet *ifp = pi->ifp;
- struct sge_txq *txq;
- int i, drops;
- struct port_stats *s = &pi->stats;
PORT_LOCK(pi);
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
@@ -4288,39 +4385,7 @@ cxgbe_tick(void *arg)
return; /* without scheduling another callout */
}
- t4_get_port_stats(sc, pi->tx_chan, s);
-
- ifp->if_opackets = s->tx_frames - s->tx_pause;
- ifp->if_ipackets = s->rx_frames - s->rx_pause;
- ifp->if_obytes = s->tx_octets - s->tx_pause * 64;
- ifp->if_ibytes = s->rx_octets - s->rx_pause * 64;
- ifp->if_omcasts = s->tx_mcast_frames - s->tx_pause;
- ifp->if_imcasts = s->rx_mcast_frames - s->rx_pause;
- ifp->if_iqdrops = s->rx_ovflow0 + s->rx_ovflow1 + s->rx_ovflow2 +
- s->rx_ovflow3 + s->rx_trunc0 + s->rx_trunc1 + s->rx_trunc2 +
- s->rx_trunc3;
- for (i = 0; i < 4; i++) {
- if (pi->rx_chan_map & (1 << i)) {
- uint32_t v;
-
- /*
- * XXX: indirect reads from the same ADDR/DATA pair can
- * race with each other.
- */
- t4_read_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v,
- 1, A_TP_MIB_TNL_CNG_DROP_0 + i);
- ifp->if_iqdrops += v;
- }
- }
-
- drops = s->tx_drop;
- for_each_txq(pi, i, txq)
- drops += txq->br->br_drops;
- ifp->if_oqdrops = drops;
-
- ifp->if_oerrors = s->tx_error_frames;
- ifp->if_ierrors = s->rx_jabber + s->rx_runt + s->rx_too_long +
- s->rx_fcs_err + s->rx_len_err;
+ cxgbe_refresh_stats(sc, pi);
callout_schedule(&pi->tick, hz);
PORT_UNLOCK(pi);
diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
index f07832c..aeb98e9 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -799,7 +799,7 @@ dwc_rxfinish_locked(struct dwc_softc *sc)
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = len;
m->m_len = len;
- ifp->if_ipackets++;
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
DWC_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index d8fc23e..070bb5b 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -307,7 +307,7 @@ static int em_sysctl_eee(SYSCTL_HANDLER_ARGS);
static __inline void em_rx_discard(struct rx_ring *, int);
#ifdef DEVICE_POLLING
-static poll_handler_drv_t em_poll;
+static poll_handler_t em_poll;
#endif /* POLLING */
/*********************************************************************
@@ -787,7 +787,7 @@ em_detach(device_t dev)
#ifdef DEVICE_POLLING
if (if_getcapenable(ifp) & IFCAP_POLLING)
- ether_poll_deregister_drv(ifp);
+ ether_poll_deregister(ifp);
#endif
if (adapter->led_dev != NULL)
@@ -1208,7 +1208,7 @@ em_ioctl(if_t ifp, u_long command, caddr_t data)
#ifdef DEVICE_POLLING
if (mask & IFCAP_POLLING) {
if (ifr->ifr_reqcap & IFCAP_POLLING) {
- error = ether_poll_register_drv(em_poll, ifp);
+ error = ether_poll_register(em_poll, ifp);
if (error)
return (error);
EM_CORE_LOCK(adapter);
@@ -1216,7 +1216,7 @@ em_ioctl(if_t ifp, u_long command, caddr_t data)
if_setcapenablebit(ifp, IFCAP_POLLING, 0);
EM_CORE_UNLOCK(adapter);
} else {
- error = ether_poll_deregister_drv(ifp);
+ error = ether_poll_deregister(ifp);
/* Enable interrupt even in error case */
EM_CORE_LOCK(adapter);
em_enable_intr(adapter);
diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c
index 3639318..d29c7f1 100644
--- a/sys/dev/e1000/if_lem.c
+++ b/sys/dev/e1000/if_lem.c
@@ -260,7 +260,7 @@ static void lem_add_rx_process_limit(struct adapter *, const char *,
const char *, int *, int);
#ifdef DEVICE_POLLING
-static poll_handler_drv_t lem_poll;
+static poll_handler_t lem_poll;
#endif /* POLLING */
/*********************************************************************
@@ -789,7 +789,7 @@ lem_detach(device_t dev)
#ifdef DEVICE_POLLING
if (if_getcapenable(ifp) & IFCAP_POLLING)
- ether_poll_deregister_drv(ifp);
+ ether_poll_deregister(ifp);
#endif
if (adapter->led_dev != NULL)
@@ -1119,7 +1119,7 @@ lem_ioctl(if_t ifp, u_long command, caddr_t data)
#ifdef DEVICE_POLLING
if (mask & IFCAP_POLLING) {
if (ifr->ifr_reqcap & IFCAP_POLLING) {
- error = ether_poll_register_drv(lem_poll, ifp);
+ error = ether_poll_register(lem_poll, ifp);
if (error)
return (error);
EM_CORE_LOCK(adapter);
@@ -1127,7 +1127,7 @@ lem_ioctl(if_t ifp, u_long command, caddr_t data)
if_setcapenablebit(ifp, IFCAP_POLLING, 0);
EM_CORE_UNLOCK(adapter);
} else {
- error = ether_poll_deregister_drv(ifp);
+ error = ether_poll_deregister(ifp);
/* Enable interrupt even in error case */
EM_CORE_LOCK(adapter);
lem_enable_intr(adapter);
diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c
index ef4758c..c5f5dba 100644
--- a/sys/dev/firewire/firewire.c
+++ b/sys/dev/firewire/firewire.c
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <sys/kthread.h>
#include <sys/kdb.h>
-
#include <sys/bus.h> /* used by smbus and newbus */
#include <machine/bus.h>
@@ -65,7 +64,7 @@ struct crom_src_buf {
struct crom_chunk hw;
};
-int firewire_debug=0, try_bmr=1, hold_count=0;
+int firewire_debug = 0, try_bmr = 1, hold_count = 0;
SYSCTL_INT(_debug, OID_AUTO, firewire_debug, CTLFLAG_RW, &firewire_debug, 0,
"FireWire driver debug flag");
SYSCTL_NODE(_hw, OID_AUTO, firewire, CTLFLAG_RD, 0, "FireWire Subsystem");
@@ -81,19 +80,19 @@ MALLOC_DEFINE(M_FWXFER, "fw_xfer", "XFER/FireWire");
devclass_t firewire_devclass;
-static void firewire_identify (driver_t *, device_t);
-static int firewire_probe (device_t);
-static int firewire_attach (device_t);
-static int firewire_detach (device_t);
-static int firewire_resume (device_t);
+static void firewire_identify(driver_t *, device_t);
+static int firewire_probe(device_t);
+static int firewire_attach(device_t);
+static int firewire_detach(device_t);
+static int firewire_resume(device_t);
static void firewire_xfer_timeout(void *, int);
static device_t firewire_add_child(device_t, u_int, const char *, int);
-static void fw_try_bmr (void *);
-static void fw_try_bmr_callback (struct fw_xfer *);
-static void fw_asystart (struct fw_xfer *);
-static int fw_get_tlabel (struct firewire_comm *, struct fw_xfer *);
-static void fw_bus_probe (struct firewire_comm *);
-static void fw_attach_dev (struct firewire_comm *);
+static void fw_try_bmr(void *);
+static void fw_try_bmr_callback(struct fw_xfer *);
+static void fw_asystart(struct fw_xfer *);
+static int fw_get_tlabel(struct firewire_comm *, struct fw_xfer *);
+static void fw_bus_probe(void *);
+static void fw_attach_dev(struct firewire_comm *);
static void fw_bus_probe_thread(void *);
#ifdef FW_VMACCESS
static void fw_vmaccess (struct fw_xfer *);
@@ -116,6 +115,7 @@ static device_method_t firewire_methods[] = {
DEVMETHOD_END
};
+
char *linkspeed[] = {
"S100", "S200", "S400", "S800",
"S1600", "S3200", "undef", "undef"
@@ -174,8 +174,10 @@ fw_noderesolve_eui64(struct firewire_comm *fc, struct fw_eui64 *eui)
FW_GUNLOCK(fc);
splx(s);
- if(fwdev == NULL) return NULL;
- if(fwdev->status == FWDEVINVAL) return NULL;
+ if (fwdev == NULL)
+ return NULL;
+ if (fwdev->status == FWDEVINVAL)
+ return NULL;
return fwdev;
}
@@ -192,8 +194,9 @@ fw_asyreq(struct firewire_comm *fc, int sub, struct fw_xfer *xfer)
int tcode;
struct tcode_info *info;
- if(xfer == NULL) return EINVAL;
- if(xfer->hand == NULL){
+ if (xfer == NULL)
+ return EINVAL;
+ if (xfer->hand == NULL) {
printf("hand == NULL\n");
return EINVAL;
}
@@ -231,17 +234,17 @@ fw_asyreq(struct firewire_comm *fc, int sub, struct fw_xfer *xfer)
len = fp->mode.rresb.len;
else
len = 0;
- if (len != xfer->send.pay_len){
+ if (len != xfer->send.pay_len) {
printf("len(%d) != send.pay_len(%d) %s(%x)\n",
len, xfer->send.pay_len, tcode_str[tcode], tcode);
- return EINVAL;
+ return EINVAL;
}
- if(xferq->start == NULL){
+ if (xferq->start == NULL) {
printf("xferq->start == NULL\n");
return EINVAL;
}
- if(!(xferq->queued < xferq->maxq)){
+ if (!(xferq->queued < xferq->maxq)) {
device_printf(fc->bdev, "Discard a packet (queued=%d)\n",
xferq->queued);
return EAGAIN;
@@ -260,6 +263,7 @@ fw_asyreq(struct firewire_comm *fc, int sub, struct fw_xfer *xfer)
fw_asystart(xfer);
return err;
}
+
/*
* Wakeup blocked process.
*/
@@ -283,8 +287,8 @@ fw_xferwait(struct fw_xfer *xfer)
int err = 0;
mtx_lock(lock);
- if ((xfer->flag & FWXF_WAKE) == 0)
- err = msleep((void *)xfer, lock, PWAIT|PCATCH, "fw_xferwait", 0);
+ while ((xfer->flag & FWXF_WAKE) == 0)
+ err = msleep(xfer, lock, PWAIT|PCATCH, "fw_xferwait", 0);
mtx_unlock(lock);
return (err);
@@ -298,13 +302,14 @@ fw_asystart(struct fw_xfer *xfer)
{
struct firewire_comm *fc = xfer->fc;
int s;
+
s = splfw();
/* Protect from interrupt/timeout */
FW_GLOCK(fc);
xfer->flag = FWXF_INQ;
STAILQ_INSERT_TAIL(&xfer->q->q, xfer, link);
#if 0
- xfer->q->queued ++;
+ xfer->q->queued++;
#endif
FW_GUNLOCK(fc);
splx(s);
@@ -346,7 +351,7 @@ firewire_xfer_timeout(void *arg, int pending)
s = splfw();
mtx_lock(&fc->tlabel_lock);
- for (i = 0; i < 0x40; i ++) {
+ for (i = 0; i < 0x40; i++) {
while ((xfer = STAILQ_FIRST(&fc->tlabels[i])) != NULL) {
if ((xfer->flag & FWXF_SENT) == 0)
/* not sent yet */
@@ -355,8 +360,8 @@ firewire_xfer_timeout(void *arg, int pending)
/* the rests are newer than this */
break;
device_printf(fc->bdev,
- "split transaction timeout: "
- "tl=0x%x flag=0x%02x\n", i, xfer->flag);
+ "split transaction timeout: tl=0x%x flag=0x%02x\n",
+ i, xfer->flag);
fw_dump_hdr(&xfer->send.hdr, "send");
xfer->resp = ETIMEDOUT;
xfer->tl = -1;
@@ -369,7 +374,7 @@ firewire_xfer_timeout(void *arg, int pending)
fc->timeout(fc);
STAILQ_FOREACH_SAFE(xfer, &xfer_timeout, tlabel, txfer)
- xfer->hand(xfer);
+ xfer->hand(xfer);
}
#define WATCHDOG_HZ 10
@@ -379,7 +384,7 @@ firewire_watchdog(void *arg)
struct firewire_comm *fc;
static int watchdog_clock = 0;
- fc = (struct firewire_comm *)arg;
+ fc = arg;
/*
* At boot stage, the device interrupt is disabled and
@@ -389,10 +394,10 @@ firewire_watchdog(void *arg)
if (watchdog_clock > WATCHDOG_HZ * 15)
taskqueue_enqueue(fc->taskqueue, &fc->task_timeout);
else
- watchdog_clock ++;
+ watchdog_clock++;
callout_reset(&fc->timeout_callout, hz / WATCHDOG_HZ,
- (void *)firewire_watchdog, (void *)fc);
+ firewire_watchdog, fc);
}
/*
@@ -406,35 +411,36 @@ firewire_attach(device_t dev)
device_t pa = device_get_parent(dev);
struct firewire_comm *fc;
- fc = (struct firewire_comm *)device_get_softc(pa);
+ fc = device_get_softc(pa);
sc->fc = fc;
fc->status = FWBUSNOTREADY;
unit = device_get_unit(dev);
- if( fc->nisodma > FWMAXNDMA) fc->nisodma = FWMAXNDMA;
+ if (fc->nisodma > FWMAXNDMA)
+ fc->nisodma = FWMAXNDMA;
fwdev_makedev(sc);
- fc->crom_src_buf = (struct crom_src_buf *)malloc(
- sizeof(struct crom_src_buf),
- M_FW, M_NOWAIT | M_ZERO);
+ fc->crom_src_buf = malloc(sizeof(struct crom_src_buf),
+ M_FW, M_NOWAIT | M_ZERO);
if (fc->crom_src_buf == NULL) {
- device_printf(fc->dev, "%s: Malloc Failure crom src buff\n", __func__);
+ device_printf(fc->dev,
+ "%s: unable to allocate crom src buffer\n", __func__);
return ENOMEM;
}
- fc->topology_map = (struct fw_topology_map *)malloc(
- sizeof(struct fw_topology_map),
- M_FW, M_NOWAIT | M_ZERO);
+ fc->topology_map = malloc(sizeof(struct fw_topology_map),
+ M_FW, M_NOWAIT | M_ZERO);
if (fc->topology_map == NULL) {
- device_printf(fc->dev, "%s: Malloc Failure topology map\n", __func__);
+ device_printf(fc->dev, "%s: unable to allocate topology map\n",
+ __func__);
free(fc->crom_src_buf, M_FW);
return ENOMEM;
}
- fc->speed_map = (struct fw_speed_map *)malloc(
- sizeof(struct fw_speed_map),
- M_FW, M_NOWAIT | M_ZERO);
+ fc->speed_map = malloc(sizeof(struct fw_speed_map),
+ M_FW, M_NOWAIT | M_ZERO);
if (fc->speed_map == NULL) {
- device_printf(fc->dev, "%s: Malloc Failure speed map\n", __func__);
+ device_printf(fc->dev, "%s: unable to allocate speed map\n",
+ __func__);
free(fc->crom_src_buf, M_FW);
free(fc->topology_map, M_FW);
return ENOMEM;
@@ -445,14 +451,14 @@ firewire_attach(device_t dev)
CALLOUT_INIT(&fc->timeout_callout);
CALLOUT_INIT(&fc->bmr_callout);
CALLOUT_INIT(&fc->busprobe_callout);
- TASK_INIT(&fc->task_timeout, 0, firewire_xfer_timeout, (void *)fc);
+ TASK_INIT(&fc->task_timeout, 0, firewire_xfer_timeout, fc);
callout_reset(&sc->fc->timeout_callout, hz,
- (void *)firewire_watchdog, (void *)sc->fc);
+ firewire_watchdog, sc->fc);
/* create thread */
- kproc_create(fw_bus_probe_thread, (void *)fc, &fc->probe_thread,
- 0, 0, "fw%d_probe", unit);
+ kproc_create(fw_bus_probe_thread, fc, &fc->probe_thread,
+ 0, 0, "fw%d_probe", unit);
/* Locate our children */
bus_generic_probe(dev);
@@ -475,10 +481,10 @@ firewire_attach(device_t dev)
static device_t
firewire_add_child(device_t dev, u_int order, const char *name, int unit)
{
- device_t child;
+ device_t child;
struct firewire_softc *sc;
- sc = (struct firewire_softc *)device_get_softc(dev);
+ sc = device_get_softc(dev);
child = device_add_child(dev, name, unit);
if (child) {
device_set_ivars(child, sc->fc);
@@ -493,16 +499,16 @@ firewire_resume(device_t dev)
{
struct firewire_softc *sc;
- sc = (struct firewire_softc *)device_get_softc(dev);
+ sc = device_get_softc(dev);
sc->fc->status = FWBUSNOTREADY;
-
+
bus_generic_resume(dev);
- return(0);
+ return (0);
}
/*
- * Dettach it.
+ * Detach it.
*/
static int
firewire_detach(device_t dev)
@@ -512,7 +518,7 @@ firewire_detach(device_t dev)
struct fw_device *fwdev, *fwdev_next;
int err;
- sc = (struct firewire_softc *)device_get_softc(dev);
+ sc = device_get_softc(dev);
fc = sc->fc;
mtx_lock(&fc->wait_lock);
fc->status = FWBUSDETACH;
@@ -521,7 +527,7 @@ firewire_detach(device_t dev)
printf("firewire probe thread didn't die\n");
mtx_unlock(&fc->wait_lock);
- if (fc->arq !=0 && fc->arq->maxq > 0)
+ if (fc->arq != 0 && fc->arq->maxq > 0)
fw_drain_txq(fc);
if ((err = fwdev_destroydev(sc)) != 0)
@@ -536,7 +542,7 @@ firewire_detach(device_t dev)
/* XXX xfer_free and untimeout on all xfers */
for (fwdev = STAILQ_FIRST(&fc->devices); fwdev != NULL;
- fwdev = fwdev_next) {
+ fwdev = fwdev_next) {
fwdev_next = STAILQ_NEXT(fwdev, link);
free(fwdev, M_FW);
}
@@ -546,7 +552,7 @@ firewire_detach(device_t dev)
mtx_destroy(&fc->tlabel_lock);
mtx_destroy(&fc->wait_lock);
- return(0);
+ return (0);
}
static void
@@ -557,7 +563,7 @@ fw_xferq_drain(struct fw_xferq *xferq)
while ((xfer = STAILQ_FIRST(&xferq->q)) != NULL) {
STAILQ_REMOVE_HEAD(&xferq->q, link);
#if 0
- xferq->queued --;
+ xferq->queued--;
#endif
xfer->resp = EAGAIN;
xfer->flag = FWXF_SENTERR;
@@ -577,12 +583,12 @@ fw_drain_txq(struct firewire_comm *fc)
FW_GLOCK(fc);
fw_xferq_drain(fc->atq);
fw_xferq_drain(fc->ats);
- for(i = 0; i < fc->nisodma; i++)
+ for (i = 0; i < fc->nisodma; i++)
fw_xferq_drain(fc->it[i]);
FW_GUNLOCK(fc);
mtx_lock(&fc->tlabel_lock);
- for (i = 0; i < 0x40; i ++)
+ for (i = 0; i < 0x40; i++)
while ((xfer = STAILQ_FIRST(&fc->tlabels[i])) != NULL) {
if (firewire_debug)
printf("tl=%d flag=%d\n", i, xfer->flag);
@@ -594,7 +600,7 @@ fw_drain_txq(struct firewire_comm *fc)
mtx_unlock(&fc->tlabel_lock);
STAILQ_FOREACH_SAFE(xfer, &xfer_drain, tlabel, txfer)
- xfer->hand(xfer);
+ xfer->hand(xfer);
}
static void
@@ -603,7 +609,7 @@ fw_reset_csr(struct firewire_comm *fc)
int i;
CSRARC(fc, STATE_CLEAR)
- = 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14 ;
+ = 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14;
CSRARC(fc, STATE_SET) = CSRARC(fc, STATE_CLEAR);
CSRARC(fc, NODE_IDS) = 0x3f;
@@ -612,10 +618,10 @@ fw_reset_csr(struct firewire_comm *fc)
fc->max_node = -1;
- for(i = 2; i < 0x100/4 - 2 ; i++){
+ for (i = 2; i < 0x100 / 4 - 2; i++) {
CSRARC(fc, SPED_MAP + i * 4) = 0;
}
- CSRARC(fc, STATE_CLEAR) = 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14 ;
+ CSRARC(fc, STATE_CLEAR) = 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14;
CSRARC(fc, STATE_SET) = CSRARC(fc, STATE_CLEAR);
CSRARC(fc, RESET_START) = 0;
CSRARC(fc, SPLIT_TIMEOUT_HI) = 0;
@@ -631,14 +637,14 @@ fw_reset_csr(struct firewire_comm *fc)
CSRARC(fc, CONF_ROM) = 0x04 << 24;
CSRARC(fc, CONF_ROM + 4) = 0x31333934; /* means strings 1394 */
CSRARC(fc, CONF_ROM + 8) = 1 << 31 | 1 << 30 | 1 << 29 |
- 1 << 28 | 0xff << 16 | 0x09 << 8;
+ 1 << 28 | 0xff << 16 | 0x09 << 8;
CSRARC(fc, CONF_ROM + 0xc) = 0;
-/* DV depend CSRs see blue book */
- CSRARC(fc, oPCR) &= ~DV_BROADCAST_ON;
- CSRARC(fc, iPCR) &= ~DV_BROADCAST_ON;
+ /* DV depend CSRs see blue book */
+ CSRARC(fc, oPCR) &= ~DV_BROADCAST_ON;
+ CSRARC(fc, iPCR) &= ~DV_BROADCAST_ON;
- CSRARC(fc, STATE_CLEAR) &= ~(1 << 23 | 1 << 15 | 1 << 14 );
+ CSRARC(fc, STATE_CLEAR) &= ~(1 << 23 | 1 << 15 | 1 << 14);
CSRARC(fc, STATE_SET) = CSRARC(fc, STATE_CLEAR);
}
@@ -694,13 +700,8 @@ fw_reset_crom(struct firewire_comm *fc)
crom_add_entry(root, CSRKEY_NCAP, 0x0083c0); /* XXX */
/* private company_id */
crom_add_entry(root, CSRKEY_VENDOR, CSRVAL_VENDOR_PRIVATE);
-#ifdef __DragonFly__
- crom_add_simple_text(src, root, &buf->vendor, "DragonFly Project");
- crom_add_entry(root, CSRKEY_HW, __DragonFly_cc_version);
-#else
crom_add_simple_text(src, root, &buf->vendor, "FreeBSD Project");
crom_add_entry(root, CSRKEY_HW, __FreeBSD_version);
-#endif
mtx_lock(&prison0.pr_mtx);
crom_add_simple_text(src, root, &buf->hw, prison0.pr_hostname);
mtx_unlock(&prison0.pr_mtx);
@@ -731,8 +732,8 @@ fw_busreset(struct firewire_comm *fc, uint32_t new_status)
fw_reset_crom(fc);
if (device_get_children(fc->bdev, &devlistp, &devcnt) == 0) {
- for( i = 0 ; i < devcnt ; i++)
- if (device_get_state(devlistp[i]) >= DS_ATTACHED) {
+ for (i = 0; i < devcnt; i++)
+ if (device_get_state(devlistp[i]) >= DS_ATTACHED) {
fdc = device_get_softc(devlistp[i]);
if (fdc->post_busreset != NULL)
fdc->post_busreset(fdc);
@@ -741,31 +742,30 @@ fw_busreset(struct firewire_comm *fc, uint32_t new_status)
}
src = &fc->crom_src_buf->src;
- /*
- * If the old config rom needs to be overwritten,
- * bump the businfo.generation indicator to
- * indicate that we need to be reprobed
- * See 1394a-2000 8.3.2.5.4 for more details.
- * generation starts at 2 and rolls over at 0xF
- * back to 2.
- *
- * A generation of 0 indicates a device
- * that is not 1394a-2000 compliant.
- * A generation of 1 indicates a device that
- * does not change it's Bus Info Block or
- * Configuration ROM.
- */
+ /*
+ * If the old config rom needs to be overwritten,
+ * bump the businfo.generation indicator to
+ * indicate that we need to be reprobed
+ * See 1394a-2000 8.3.2.5.4 for more details.
+ * generation starts at 2 and rolls over at 0xF
+ * back to 2.
+ *
+ * A generation of 0 indicates a device
+ * that is not 1394a-2000 compliant.
+ * A generation of 1 indicates a device that
+ * does not change it's Bus Info Block or
+ * Configuration ROM.
+ */
#define FW_MAX_GENERATION 0xF
newrom = malloc(CROMSIZE, M_FW, M_NOWAIT | M_ZERO);
src = &fc->crom_src_buf->src;
crom_load(src, newrom, CROMSIZE);
if (bcmp(newrom, fc->config_rom, CROMSIZE) != 0) {
- if ( src->businfo.generation++ > FW_MAX_GENERATION )
+ if (src->businfo.generation++ > FW_MAX_GENERATION)
src->businfo.generation = FW_GENERATION_CHANGEABLE;
- bcopy(newrom, (void *)fc->config_rom, CROMSIZE);
+ bcopy(newrom, fc->config_rom, CROMSIZE);
}
free(newrom, M_FW);
-
}
/* Call once after reboot */
@@ -795,7 +795,7 @@ void fw_init(struct firewire_comm *fc)
STAILQ_INIT(&fc->atq->q);
STAILQ_INIT(&fc->ats->q);
- for( i = 0 ; i < fc->nisodma ; i ++ ){
+ for (i = 0; i < fc->nisodma; i++) {
fc->it[i]->queued = 0;
fc->ir[i]->queued = 0;
@@ -817,7 +817,7 @@ void fw_init(struct firewire_comm *fc)
fc->atq->maxq = FWMAXQUEUE;
fc->ats->maxq = FWMAXQUEUE;
- for( i = 0 ; i < fc->nisodma ; i++){
+ for (i = 0; i < fc->nisodma; i++) {
fc->ir[i]->maxq = FWMAXQUEUE;
fc->it[i]->maxq = FWMAXQUEUE;
}
@@ -829,9 +829,9 @@ void fw_init(struct firewire_comm *fc)
STAILQ_INIT(&fc->devices);
-/* Initialize Async handlers */
+ /* Initialize Async handlers */
STAILQ_INIT(&fc->binds);
- for( i = 0 ; i < 0x40 ; i++){
+ for (i = 0; i < 0x40; i++) {
STAILQ_INIT(&fc->tlabels[i]);
}
@@ -839,14 +839,14 @@ void fw_init(struct firewire_comm *fc)
#if 0
CSRARC(fc, oMPR) = 0x3fff0001; /* # output channel = 1 */
CSRARC(fc, oPCR) = 0x8000007a;
- for(i = 4 ; i < 0x7c/4 ; i+=4){
- CSRARC(fc, i + oPCR) = 0x8000007a;
+ for (i = 4; i < 0x7c/4; i += 4) {
+ CSRARC(fc, i + oPCR) = 0x8000007a;
}
-
+
CSRARC(fc, iMPR) = 0x00ff0001; /* # input channel = 1 */
CSRARC(fc, iPCR) = 0x803f0000;
- for(i = 4 ; i < 0x7c/4 ; i+=4){
- CSRARC(fc, i + iPCR) = 0x0;
+ for (i = 4; i < 0x7c/4; i += 4) {
+ CSRARC(fc, i + iPCR) = 0x0;
}
#endif
@@ -854,10 +854,11 @@ void fw_init(struct firewire_comm *fc)
#ifdef FW_VMACCESS
xfer = fw_xfer_alloc();
- if(xfer == NULL) return;
+ if (xfer == NULL)
+ return;
- fwb = (struct fw_bind *)malloc(sizeof (struct fw_bind), M_FW, M_NOWAIT);
- if(fwb == NULL){
+ fwb = malloc(sizeof(struct fw_bind), M_FW, M_NOWAIT);
+ if (fwb == NULL) {
fw_xfer_free(xfer);
return;
}
@@ -873,8 +874,8 @@ void fw_init(struct firewire_comm *fc)
#endif
}
-#define BIND_CMP(addr, fwb) (((addr) < (fwb)->start)?-1:\
- ((fwb)->end < (addr))?1:0)
+#define BIND_CMP(addr, fwb) (((addr) < (fwb)->start)? -1 : \
+ ((fwb)->end < (addr)) ? 1 : 0)
/*
* To lookup bound process from IEEE1394 address.
@@ -893,7 +894,7 @@ fw_bindlookup(struct firewire_comm *fc, uint16_t dest_hi, uint32_t dest_lo)
break;
}
FW_GUNLOCK(fc);
- return(r);
+ return (r);
}
/*
@@ -978,7 +979,7 @@ fw_xferlist_add(struct fw_xferlist *q, struct malloc_type *type,
for (i = 0; i < n; i++) {
xfer = fw_xfer_alloc_buf(type, slen, rlen);
if (xfer == NULL)
- return (n);
+ return (i);
xfer->fc = fc;
xfer->sc = sc;
xfer->hand = hand;
@@ -995,10 +996,10 @@ fw_xferlist_remove(struct fw_xferlist *q)
struct fw_xfer *xfer, *next;
for (xfer = STAILQ_FIRST(q); xfer != NULL; xfer = next) {
- next = STAILQ_NEXT(xfer, link);
- fw_xfer_free_buf(xfer);
- }
- STAILQ_INIT(q);
+ next = STAILQ_NEXT(xfer, link);
+ fw_xfer_free_buf(xfer);
+ }
+ STAILQ_INIT(q);
}
/*
* dump packet header
@@ -1031,7 +1032,7 @@ fw_tl_free(struct firewire_comm *fc, struct fw_xfer *xfer)
}
/* make sure the label is allocated */
STAILQ_FOREACH(txfer, &fc->tlabels[xfer->tl], tlabel)
- if(txfer == xfer)
+ if (txfer == xfer)
break;
if (txfer == NULL) {
printf("%s: the xfer is not in the queue "
@@ -1064,7 +1065,7 @@ fw_tl2xfer(struct firewire_comm *fc, int node, int tlabel, int tcode)
mtx_lock(&fc->tlabel_lock);
STAILQ_FOREACH(xfer, &fc->tlabels[tlabel], tlabel)
- if(xfer->send.hdr.mode.hdr.dst == node) {
+ if (xfer->send.hdr.mode.hdr.dst == node) {
mtx_unlock(&fc->tlabel_lock);
splx(s);
KASSERT(xfer->tl == tlabel,
@@ -1075,18 +1076,18 @@ fw_tl2xfer(struct firewire_comm *fc, int node, int tlabel, int tcode)
printf("%s: invalid response tcode "
"(0x%x for 0x%x)\n", __FUNCTION__,
tcode, req);
- return(NULL);
+ return (NULL);
}
-
+
if (firewire_debug > 2)
printf("fw_tl2xfer: found tl=%d\n", tlabel);
- return(xfer);
+ return (xfer);
}
mtx_unlock(&fc->tlabel_lock);
if (firewire_debug > 1)
printf("fw_tl2xfer: not found tl=%d\n", tlabel);
splx(s);
- return(NULL);
+ return (NULL);
}
/*
@@ -1113,14 +1114,14 @@ fw_xfer_alloc_buf(struct malloc_type *type, int send_len, int recv_len)
xfer = fw_xfer_alloc(type);
if (xfer == NULL)
- return(NULL);
+ return (NULL);
xfer->send.pay_len = send_len;
xfer->recv.pay_len = recv_len;
if (send_len > 0) {
xfer->send.payload = malloc(send_len, type, M_NOWAIT | M_ZERO);
if (xfer->send.payload == NULL) {
fw_xfer_free(xfer);
- return(NULL);
+ return (NULL);
}
}
if (recv_len > 0) {
@@ -1129,10 +1130,10 @@ fw_xfer_alloc_buf(struct malloc_type *type, int send_len, int recv_len)
if (xfer->send.payload != NULL)
free(xfer->send.payload, type);
fw_xfer_free(xfer);
- return(NULL);
+ return (NULL);
}
}
- return(xfer);
+ return (xfer);
}
/*
@@ -1154,18 +1155,19 @@ fw_xfer_done(struct fw_xfer *xfer)
}
void
-fw_xfer_unload(struct fw_xfer* xfer)
+fw_xfer_unload(struct fw_xfer *xfer)
{
int s;
- if(xfer == NULL ) return;
- if(xfer->flag & FWXF_INQ){
+ if (xfer == NULL)
+ return;
+ if (xfer->flag & FWXF_INQ) {
printf("fw_xfer_free FWXF_INQ\n");
s = splfw();
FW_GLOCK(xfer->fc);
STAILQ_REMOVE(&xfer->q->q, xfer, fw_xfer, link);
#if 0
- xfer->q->queued --;
+ xfer->q->queued--;
#endif
FW_GUNLOCK(xfer->fc);
splx(s);
@@ -1177,7 +1179,7 @@ fw_xfer_unload(struct fw_xfer* xfer)
*/
fw_tl_free(xfer->fc, xfer);
#if 1
- if(xfer->flag & FWXF_START)
+ if (xfer->flag & FWXF_START)
/*
* This could happen if:
* 1. We call fwohci_arcv() before fwohci_txd().
@@ -1189,28 +1191,27 @@ fw_xfer_unload(struct fw_xfer* xfer)
xfer->flag = FWXF_INIT;
xfer->resp = 0;
}
+
/*
- * To free IEEE1394 XFER structure.
+ * To free IEEE1394 XFER structure.
*/
void
-fw_xfer_free_buf( struct fw_xfer* xfer)
+fw_xfer_free_buf(struct fw_xfer *xfer)
{
if (xfer == NULL) {
printf("%s: xfer == NULL\n", __func__);
return;
}
fw_xfer_unload(xfer);
- if(xfer->send.payload != NULL){
+ if (xfer->send.payload != NULL)
free(xfer->send.payload, xfer->malloc);
- }
- if(xfer->recv.payload != NULL){
+ if (xfer->recv.payload != NULL)
free(xfer->recv.payload, xfer->malloc);
- }
free(xfer, xfer->malloc);
}
void
-fw_xfer_free( struct fw_xfer* xfer)
+fw_xfer_free(struct fw_xfer *xfer)
{
if (xfer == NULL) {
printf("%s: xfer == NULL\n", __func__);
@@ -1231,7 +1232,7 @@ fw_asy_callback_free(struct fw_xfer *xfer)
}
/*
- * To configure PHY.
+ * To configure PHY.
*/
static void
fw_phy_config(struct firewire_comm *fc, int root_node, int gap_count)
@@ -1250,9 +1251,9 @@ fw_phy_config(struct firewire_comm *fc, int root_node, int gap_count)
fp = &xfer->send.hdr;
fp->mode.ld[1] = 0;
if (root_node >= 0)
- fp->mode.ld[1] |= (root_node & 0x3f) << 24 | 1 << 23;
+ fp->mode.ld[1] |= (1 << 23) | (root_node & 0x3f) << 24;
if (gap_count >= 0)
- fp->mode.ld[1] |= 1 << 22 | (gap_count & 0x3f) << 16;
+ fp->mode.ld[1] |= (1 << 22) | (gap_count & 0x3f) << 16;
fp->mode.ld[2] = ~fp->mode.ld[1];
/* XXX Dangerous, how to pass PHY packet to device driver */
fp->mode.common.tcode |= FWTCODE_PHY;
@@ -1264,113 +1265,107 @@ fw_phy_config(struct firewire_comm *fc, int root_node, int gap_count)
}
/*
- * Dump self ID.
+ * Dump self ID.
*/
static void
fw_print_sid(uint32_t sid)
{
union fw_self_id *s;
s = (union fw_self_id *) &sid;
- if ( s->p0.sequel ) {
- if ( s->p1.sequence_num == FW_SELF_ID_PAGE0 ) {
+ if (s->p0.sequel) {
+ if (s->p1.sequence_num == FW_SELF_ID_PAGE0) {
printf("node:%d p3:%d p4:%d p5:%d p6:%d p7:%d"
- "p8:%d p9:%d p10:%d\n",
- s->p1.phy_id, s->p1.port3, s->p1.port4,
- s->p1.port5, s->p1.port6, s->p1.port7,
- s->p1.port8, s->p1.port9, s->p1.port10);
- } else if (s->p2.sequence_num == FW_SELF_ID_PAGE1 ){
+ "p8:%d p9:%d p10:%d\n",
+ s->p1.phy_id, s->p1.port3, s->p1.port4,
+ s->p1.port5, s->p1.port6, s->p1.port7,
+ s->p1.port8, s->p1.port9, s->p1.port10);
+ } else if (s->p2.sequence_num == FW_SELF_ID_PAGE1) {
printf("node:%d p11:%d p12:%d p13:%d p14:%d p15:%d\n",
- s->p2.phy_id, s->p2.port11, s->p2.port12,
- s->p2.port13, s->p2.port14, s->p2.port15);
+ s->p2.phy_id, s->p2.port11, s->p2.port12,
+ s->p2.port13, s->p2.port14, s->p2.port15);
} else {
printf("node:%d Unknown Self ID Page number %d\n",
- s->p1.phy_id, s->p1.sequence_num);
+ s->p1.phy_id, s->p1.sequence_num);
}
} else {
printf("node:%d link:%d gap:%d spd:%d con:%d pwr:%d"
- " p0:%d p1:%d p2:%d i:%d m:%d\n",
- s->p0.phy_id, s->p0.link_active, s->p0.gap_count,
- s->p0.phy_speed, s->p0.contender,
- s->p0.power_class, s->p0.port0, s->p0.port1,
- s->p0.port2, s->p0.initiated_reset, s->p0.more_packets);
+ " p0:%d p1:%d p2:%d i:%d m:%d\n",
+ s->p0.phy_id, s->p0.link_active, s->p0.gap_count,
+ s->p0.phy_speed, s->p0.contender,
+ s->p0.power_class, s->p0.port0, s->p0.port1,
+ s->p0.port2, s->p0.initiated_reset, s->p0.more_packets);
}
}
/*
- * To receive self ID.
+ * To receive self ID.
*/
-void fw_sidrcv(struct firewire_comm* fc, uint32_t *sid, u_int len)
+void fw_sidrcv(struct firewire_comm *fc, uint32_t *sid, u_int len)
{
uint32_t *p;
union fw_self_id *self_id;
u_int i, j, node, c_port = 0, i_branch = 0;
- fc->sid_cnt = len /(sizeof(uint32_t) * 2);
+ fc->sid_cnt = len / (sizeof(uint32_t) * 2);
fc->max_node = fc->nodeid & 0x3f;
CSRARC(fc, NODE_IDS) = ((uint32_t)fc->nodeid) << 16;
fc->status = FWBUSCYMELECT;
fc->topology_map->crc_len = 2;
- fc->topology_map->generation ++;
+ fc->topology_map->generation++;
fc->topology_map->self_id_count = 0;
- fc->topology_map->node_count = 0;
- fc->speed_map->generation ++;
- fc->speed_map->crc_len = 1 + (64*64 + 3) / 4;
+ fc->topology_map->node_count= 0;
+ fc->speed_map->generation++;
+ fc->speed_map->crc_len = 1 + (64 * 64 + 3) / 4;
self_id = &fc->topology_map->self_id[0];
- for(i = 0; i < fc->sid_cnt; i ++){
+ for (i = 0; i < fc->sid_cnt; i++) {
if (sid[1] != ~sid[0]) {
- device_printf(fc->bdev, "%s: ERROR invalid self-id packet\n",
- __func__);
+ device_printf(fc->bdev,
+ "%s: ERROR invalid self-id packet\n", __func__);
sid += 2;
continue;
}
*self_id = *((union fw_self_id *)sid);
fc->topology_map->crc_len++;
- if(self_id->p0.sequel == 0){
- fc->topology_map->node_count ++;
+ if (self_id->p0.sequel == 0) {
+ fc->topology_map->node_count++;
c_port = 0;
if (firewire_debug)
fw_print_sid(sid[0]);
node = self_id->p0.phy_id;
- if(fc->max_node < node){
+ if (fc->max_node < node)
fc->max_node = self_id->p0.phy_id;
- }
/* XXX I'm not sure this is the right speed_map */
- fc->speed_map->speed[node][node]
- = self_id->p0.phy_speed;
- for (j = 0; j < node; j ++) {
- fc->speed_map->speed[j][node]
- = fc->speed_map->speed[node][j]
- = min(fc->speed_map->speed[j][j],
- self_id->p0.phy_speed);
+ fc->speed_map->speed[node][node] =
+ self_id->p0.phy_speed;
+ for (j = 0; j < node; j++) {
+ fc->speed_map->speed[j][node] =
+ fc->speed_map->speed[node][j] =
+ min(fc->speed_map->speed[j][j],
+ self_id->p0.phy_speed);
}
if ((fc->irm == -1 || self_id->p0.phy_id > fc->irm) &&
- (self_id->p0.link_active && self_id->p0.contender)) {
+ (self_id->p0.link_active && self_id->p0.contender))
fc->irm = self_id->p0.phy_id;
- }
- if(self_id->p0.port0 >= 0x2){
+ if (self_id->p0.port0 >= 0x2)
c_port++;
- }
- if(self_id->p0.port1 >= 0x2){
+ if (self_id->p0.port1 >= 0x2)
c_port++;
- }
- if(self_id->p0.port2 >= 0x2){
+ if (self_id->p0.port2 >= 0x2)
c_port++;
- }
}
- if(c_port > 2){
+ if (c_port > 2)
i_branch += (c_port - 2);
- }
sid += 2;
self_id++;
- fc->topology_map->self_id_count ++;
+ fc->topology_map->self_id_count++;
}
/* CRC */
fc->topology_map->crc = fw_crc16(
- (uint32_t *)&fc->topology_map->generation,
- fc->topology_map->crc_len * 4);
+ (uint32_t *)&fc->topology_map->generation,
+ fc->topology_map->crc_len * 4);
fc->speed_map->crc = fw_crc16(
- (uint32_t *)&fc->speed_map->generation,
- fc->speed_map->crc_len * 4);
+ (uint32_t *)&fc->speed_map->generation,
+ fc->speed_map->crc_len * 4);
/* byteswap and copy to CSR */
p = (uint32_t *)fc->topology_map;
for (i = 0; i <= fc->topology_map->crc_len; i++)
@@ -1379,14 +1374,13 @@ void fw_sidrcv(struct firewire_comm* fc, uint32_t *sid, u_int len)
CSRARC(fc, SPED_MAP) = htonl(*p++);
CSRARC(fc, SPED_MAP + 4) = htonl(*p++);
/* don't byte-swap uint8_t array */
- bcopy(p, &CSRARC(fc, SPED_MAP + 8), (fc->speed_map->crc_len - 1)*4);
+ bcopy(p, &CSRARC(fc, SPED_MAP + 8), (fc->speed_map->crc_len - 1) * 4);
fc->max_hop = fc->max_node - i_branch;
device_printf(fc->bdev, "%d nodes, maxhop <= %d %s irm(%d) %s\n",
- fc->max_node + 1, fc->max_hop,
- (fc->irm == -1) ? "Not IRM capable" : "cable IRM",
- fc->irm,
- (fc->irm == fc->nodeid) ? " (me) " : "");
+ fc->max_node + 1, fc->max_hop,
+ (fc->irm == -1) ? "Not IRM capable" : "cable IRM",
+ fc->irm, (fc->irm == fc->nodeid) ? " (me) " : "");
if (try_bmr && (fc->irm != -1) && (CSRARC(fc, BUS_MGR_ID) == 0x3f)) {
if (fc->irm == fc->nodeid) {
@@ -1395,26 +1389,27 @@ void fw_sidrcv(struct firewire_comm* fc, uint32_t *sid, u_int len)
fw_bmr(fc);
} else {
fc->status = FWBUSMGRELECT;
- callout_reset(&fc->bmr_callout, hz/8,
- (void *)fw_try_bmr, (void *)fc);
+ callout_reset(&fc->bmr_callout, hz / 8,
+ fw_try_bmr, fc);
}
} else
fc->status = FWBUSMGRDONE;
- callout_reset(&fc->busprobe_callout, hz/4,
- (void *)fw_bus_probe, (void *)fc);
+ callout_reset(&fc->busprobe_callout, hz / 4, fw_bus_probe, fc);
}
/*
- * To probe devices on the IEEE1394 bus.
+ * To probe devices on the IEEE1394 bus.
*/
static void
-fw_bus_probe(struct firewire_comm *fc)
+fw_bus_probe(void *arg)
{
- int s;
+ struct firewire_comm *fc;
struct fw_device *fwdev;
+ int s;
s = splfw();
+ fc = arg;
fc->status = FWBUSEXPLORE;
/* Invalidate all devices, just after bus reset. */
@@ -1438,7 +1433,7 @@ fw_bus_probe(struct firewire_comm *fc)
}
splx(s);
- wakeup((void *)fc);
+ wakeup(fc);
}
static int
@@ -1449,10 +1444,9 @@ fw_explore_read_quads(struct fw_device *fwdev, int offset,
uint32_t tmp;
int i, error;
- for (i = 0; i < length; i ++, offset += sizeof(uint32_t)) {
- xfer = fwmem_read_quad(fwdev, NULL, -1,
- 0xffff, 0xf0000000 | offset, (void *)&tmp,
- fw_xferwake);
+ for (i = 0; i < length; i++, offset += sizeof(uint32_t)) {
+ xfer = fwmem_read_quad(fwdev, NULL, -1, 0xffff,
+ 0xf0000000 | offset, &tmp, fw_xferwake);
if (xfer == NULL)
return (-1);
fw_xferwait(xfer);
@@ -1476,14 +1470,14 @@ fw_explore_csrblock(struct fw_device *fwdev, int offset, int recur)
struct csrdirectory *dir;
struct csrreg *reg;
- dir = (struct csrdirectory *)&fwdev->csrrom[offset/sizeof(uint32_t)];
+ dir = (struct csrdirectory *)&fwdev->csrrom[offset / sizeof(uint32_t)];
err = fw_explore_read_quads(fwdev, CSRROMOFF + offset,
(uint32_t *)dir, 1);
if (err)
return (-1);
offset += sizeof(uint32_t);
- reg = (struct csrreg *)&fwdev->csrrom[offset/sizeof(uint32_t)];
+ reg = (struct csrreg *)&fwdev->csrrom[offset / sizeof(uint32_t)];
err = fw_explore_read_quads(fwdev, CSRROMOFF + offset,
(uint32_t *)reg, dir->crc_len);
if (err)
@@ -1498,7 +1492,7 @@ fw_explore_csrblock(struct fw_device *fwdev, int offset, int recur)
if (recur == 0)
return (0);
- for (i = 0; i < dir->crc_len; i ++, offset += sizeof(uint32_t)) {
+ for (i = 0; i < dir->crc_len; i++, offset += sizeof(uint32_t)) {
if ((reg[i].key & CSRTYPE_MASK) == CSRTYPE_D)
recur = 1;
else if ((reg[i].key & CSRTYPE_MASK) == CSRTYPE_L)
@@ -1509,7 +1503,7 @@ fw_explore_csrblock(struct fw_device *fwdev, int offset, int recur)
off = offset + reg[i].val * sizeof(uint32_t);
if (off > CROMSIZE) {
printf("%s: invalid offset %d\n", __FUNCTION__, off);
- return(-1);
+ return (-1);
}
err = fw_explore_csrblock(fwdev, off, recur);
if (err)
@@ -1542,7 +1536,8 @@ fw_explore_node(struct fw_device *dfwdev)
hdr = (struct csrhdr *)&csr[0];
if (hdr->info_len != 4) {
if (firewire_debug)
- device_printf(fc->bdev, "%s: node%d: wrong bus info len(%d)\n",
+ device_printf(fc->bdev,
+ "%s: node%d: wrong bus info len(%d)\n",
__func__, node, hdr->info_len);
dfwdev->status = FWDEVINVAL;
return (-1);
@@ -1562,14 +1557,14 @@ fw_explore_node(struct fw_device *dfwdev)
if (firewire_debug)
device_printf(fc->bdev, "%s: node(%d) BUS INFO BLOCK:\n"
- "irmc(%d) cmc(%d) isc(%d) bmc(%d) pmc(%d) "
- "cyc_clk_acc(%d) max_rec(%d) max_rom(%d) "
- "generation(%d) link_spd(%d)\n",
- __func__, node,
- binfo->irmc, binfo->cmc, binfo->isc,
- binfo->bmc, binfo->pmc, binfo->cyc_clk_acc,
- binfo->max_rec, binfo->max_rom,
- binfo->generation, binfo->link_spd);
+ "irmc(%d) cmc(%d) isc(%d) bmc(%d) pmc(%d) "
+ "cyc_clk_acc(%d) max_rec(%d) max_rom(%d) "
+ "generation(%d) link_spd(%d)\n",
+ __func__, node,
+ binfo->irmc, binfo->cmc, binfo->isc,
+ binfo->bmc, binfo->pmc, binfo->cyc_clk_acc,
+ binfo->max_rec, binfo->max_rom,
+ binfo->generation, binfo->link_spd);
STAILQ_FOREACH(fwdev, &fc->devices, link)
if (FW_EUI64_EQUAL(fwdev->eui, binfo->eui64))
@@ -1577,7 +1572,7 @@ fw_explore_node(struct fw_device *dfwdev)
if (fwdev == NULL) {
/* new device */
fwdev = malloc(sizeof(struct fw_device), M_FW,
- M_NOWAIT | M_ZERO);
+ M_NOWAIT | M_ZERO);
if (fwdev == NULL) {
device_printf(fc->bdev, "%s: node%d: no memory\n",
__func__, node);
@@ -1591,16 +1586,15 @@ fw_explore_node(struct fw_device *dfwdev)
/*
* Pre-1394a-2000 didn't have link_spd in
- * the Bus Info block, so try and use the
+ * the Bus Info block, so try and use the
* speed map value.
* 1394a-2000 compliant devices only use
* the Bus Info Block link spd value, so
* ignore the speed map alltogether. SWB
*/
- if ( binfo->link_spd == FWSPD_S100 /* 0 */) {
+ if (binfo->link_spd == FWSPD_S100 /* 0 */) {
device_printf(fc->bdev, "%s: "
- "Pre 1394a-2000 detected\n",
- __func__);
+ "Pre 1394a-2000 detected\n", __func__);
fwdev->speed = fc->speed_map->speed[fc->nodeid][node];
} else
fwdev->speed = binfo->link_spd;
@@ -1610,20 +1604,19 @@ fw_explore_node(struct fw_device *dfwdev)
*/
while (fwdev->speed > FWSPD_S100 /* 0 */) {
err = fw_explore_read_quads(fwdev, CSRROMOFF,
- &speed_test, 1);
+ &speed_test, 1);
if (err) {
- device_printf(fc->bdev, "%s: fwdev->speed(%s)"
- " decremented due to negotiation\n",
- __func__,
- linkspeed[fwdev->speed]);
+ device_printf(fc->bdev,
+ "%s: fwdev->speed(%s) decremented due to negotiation\n",
+ __func__, linkspeed[fwdev->speed]);
fwdev->speed--;
} else
break;
-
+
}
/*
- * If the fwdev is not found in the
+ * If the fwdev is not found in the
* fc->devices TAILQ, then we will add it.
*/
pfwdev = NULL;
@@ -1644,7 +1637,8 @@ fw_explore_node(struct fw_device *dfwdev)
/* unchanged ? */
if (bcmp(&csr[0], &fwdev->csrrom[0], sizeof(uint32_t) * 5) == 0) {
if (firewire_debug)
- device_printf(fc->dev, "node%d: crom unchanged\n", node);
+ device_printf(fc->dev,
+ "node%d: crom unchanged\n", node);
return (0);
}
}
@@ -1702,53 +1696,54 @@ fw_explore(struct firewire_comm *fc)
dfwdev.maxrec = 8; /* 512 */
dfwdev.status = FWDEVINIT;
- for (node = 0; node <= fc->max_node; node ++) {
+ for (node = 0; node <= fc->max_node; node++) {
/* We don't probe myself and linkdown nodes */
if (node == fc->nodeid) {
if (firewire_debug)
device_printf(fc->bdev, "%s:"
- "found myself node(%d) fc->nodeid(%d) fc->max_node(%d)\n",
- __func__, node, fc->nodeid, fc->max_node);
+ "found myself node(%d) fc->nodeid(%d) fc->max_node(%d)\n",
+ __func__, node, fc->nodeid, fc->max_node);
continue;
} else if (firewire_debug) {
device_printf(fc->bdev, "%s:"
- "node(%d) fc->max_node(%d) found\n",
- __func__, node, fc->max_node);
+ "node(%d) fc->max_node(%d) found\n",
+ __func__, node, fc->max_node);
}
fwsid = fw_find_self_id(fc, node);
if (!fwsid || !fwsid->p0.link_active) {
if (firewire_debug)
- device_printf(fc->bdev, "%s: node%d: link down\n",
- __func__, node);
+ device_printf(fc->bdev,
+ "%s: node%d: link down\n",
+ __func__, node);
continue;
}
nodes[todo++] = node;
}
s = splfw();
- for (trys = 0; todo > 0 && trys < 3; trys ++) {
+ for (trys = 0; todo > 0 && trys < 3; trys++) {
todo2 = 0;
- for (i = 0; i < todo; i ++) {
+ for (i = 0; i < todo; i++) {
dfwdev.dst = nodes[i];
err = fw_explore_node(&dfwdev);
if (err)
nodes[todo2++] = nodes[i];
if (firewire_debug)
- device_printf(fc->bdev, "%s: node %d, err = %d\n",
- __func__, node, err);
+ device_printf(fc->bdev,
+ "%s: node %d, err = %d\n",
+ __func__, node, err);
}
todo = todo2;
}
splx(s);
}
-
static void
fw_bus_probe_thread(void *arg)
{
struct firewire_comm *fc;
- fc = (struct firewire_comm *)arg;
+ fc = arg;
mtx_lock(&fc->wait_lock);
while (fc->status != FWBUSDETACH) {
@@ -1784,11 +1779,11 @@ fw_attach_dev(struct firewire_comm *fc)
if (fwdev->status == FWDEVINIT) {
fwdev->status = FWDEVATTACHED;
} else if (fwdev->status == FWDEVINVAL) {
- fwdev->rcnt ++;
+ fwdev->rcnt++;
if (firewire_debug)
device_printf(fc->bdev, "%s:"
- "fwdev->rcnt(%d), hold_count(%d)\n",
- __func__, fwdev->rcnt, hold_count);
+ "fwdev->rcnt(%d), hold_count(%d)\n",
+ __func__, fwdev->rcnt, hold_count);
if (fwdev->rcnt > hold_count) {
/*
* Remove devices which have not been seen
@@ -1802,9 +1797,9 @@ fw_attach_dev(struct firewire_comm *fc)
}
err = device_get_children(fc->bdev, &devlistp, &devcnt);
- if( err == 0 ) {
- for( i = 0 ; i < devcnt ; i++){
- if (device_get_state(devlistp[i]) >= DS_ATTACHED) {
+ if (err == 0) {
+ for (i = 0; i < devcnt; i++) {
+ if (device_get_state(devlistp[i]) >= DS_ATTACHED) {
fdc = device_get_softc(devlistp[i]);
if (fdc->post_explore != NULL)
fdc->post_explore(fdc);
@@ -1832,8 +1827,8 @@ fw_get_tlabel(struct firewire_comm *fc, struct fw_xfer *xfer)
new_tlabel = (fc->last_tlabel[dst] + 1) & 0x3f;
STAILQ_FOREACH(txfer, &fc->tlabels[new_tlabel], tlabel)
if ((txfer->send.hdr.mode.hdr.dst & 0x3f) == dst)
- break;
- if(txfer == NULL) {
+ break;
+ if (txfer == NULL) {
fc->last_tlabel[dst] = new_tlabel;
STAILQ_INSERT_TAIL(&fc->tlabels[new_tlabel], xfer, tlabel);
mtx_unlock(&fc->tlabel_lock);
@@ -1865,7 +1860,7 @@ fw_rcv_copy(struct fw_rcv_buf *rb)
pkt = (struct fw_pkt *)rb->vec->iov_base;
tinfo = &rb->fc->tcode[pkt->mode.hdr.tcode];
- /* Copy header */
+ /* Copy header */
p = (u_char *)&rb->xfer->recv.hdr;
bcopy(rb->vec->iov_base, p, tinfo->hdr_len);
rb->vec->iov_base = (u_char *)rb->vec->iov_base + tinfo->hdr_len;
@@ -1904,7 +1899,6 @@ fw_rcv_copy(struct fw_rcv_buf *rb)
break;
}
rb->xfer->recv.pay_len -= res;
-
}
/*
@@ -1923,11 +1917,11 @@ fw_rcv(struct fw_rcv_buf *rb)
int i;
qld = (uint32_t *)buf;
printf("spd %d len:%d\n", spd, len);
- for( i = 0 ; i <= len && i < 32; i+= 4){
+ for (i = 0; i <= len && i < 32; i+= 4) {
printf("0x%08x ", ntohl(qld[i/4]));
- if((i % 16) == 15) printf("\n");
+ if ((i % 16) == 15) printf("\n");
}
- if((i % 16) != 15) printf("\n");
+ if ((i % 16) != 15) printf("\n");
}
#endif
fp = (struct fw_pkt *)rb->vec[0].iov_base;
@@ -1939,20 +1933,19 @@ fw_rcv(struct fw_rcv_buf *rb)
case FWTCODE_LRES:
rb->xfer = fw_tl2xfer(rb->fc, fp->mode.hdr.src,
fp->mode.hdr.tlrt >> 2, fp->mode.hdr.tcode);
- if(rb->xfer == NULL) {
- device_printf(rb->fc->bdev, "%s: "
- "unknown response "
- "%s(%x) src=0x%x tl=0x%x rt=%d data=0x%x\n",
- __func__,
- tcode_str[tcode], tcode,
- fp->mode.hdr.src,
- fp->mode.hdr.tlrt >> 2,
- fp->mode.hdr.tlrt & 3,
- fp->mode.rresq.data);
+ if (rb->xfer == NULL) {
+ device_printf(rb->fc->bdev, "%s: unknown response "
+ "%s(%x) src=0x%x tl=0x%x rt=%d data=0x%x\n",
+ __func__,
+ tcode_str[tcode], tcode,
+ fp->mode.hdr.src,
+ fp->mode.hdr.tlrt >> 2,
+ fp->mode.hdr.tlrt & 3,
+ fp->mode.rresq.data);
#if 0
printf("try ad-hoc work around!!\n");
rb->xfer = fw_tl2xfer(rb->fc, fp->mode.hdr.src,
- (fp->mode.hdr.tlrt >> 2)^3);
+ (fp->mode.hdr.tlrt >> 2)^3);
if (rb->xfer == NULL) {
printf("no use...\n");
return;
@@ -1981,7 +1974,8 @@ fw_rcv(struct fw_rcv_buf *rb)
break;
default:
device_printf(rb->fc->bdev, "%s: "
- "unexpected flag 0x%02x\n", __func__, rb->xfer->flag);
+ "unexpected flag 0x%02x\n", __func__,
+ rb->xfer->flag);
}
return;
case FWTCODE_WREQQ:
@@ -1990,29 +1984,26 @@ fw_rcv(struct fw_rcv_buf *rb)
case FWTCODE_RREQB:
case FWTCODE_LREQ:
bind = fw_bindlookup(rb->fc, fp->mode.rreqq.dest_hi,
- fp->mode.rreqq.dest_lo);
- if(bind == NULL){
+ fp->mode.rreqq.dest_lo);
+ if (bind == NULL) {
device_printf(rb->fc->bdev, "%s: "
- "Unknown service addr 0x%04x:0x%08x %s(%x)"
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
- " src=0x%x data=%lx\n",
-#else
- " src=0x%x data=%x\n",
-#endif
- __func__,
- fp->mode.wreqq.dest_hi,
- fp->mode.wreqq.dest_lo,
- tcode_str[tcode], tcode,
- fp->mode.hdr.src,
- ntohl(fp->mode.wreqq.data));
+ "Unknown service addr 0x%04x:0x%08x %s(%x)"
+ " src=0x%x data=%x\n",
+ __func__,
+ fp->mode.wreqq.dest_hi,
+ fp->mode.wreqq.dest_lo,
+ tcode_str[tcode], tcode,
+ fp->mode.hdr.src,
+ ntohl(fp->mode.wreqq.data));
if (rb->fc->status == FWBUSINIT) {
- device_printf(rb->fc->bdev, "%s: cannot respond(bus reset)!\n",
- __func__);
+ device_printf(rb->fc->bdev,
+ "%s: cannot respond(bus reset)!\n",
+ __func__);
return;
}
rb->xfer = fw_xfer_alloc(M_FWXFER);
- if(rb->xfer == NULL){
+ if (rb->xfer == NULL) {
return;
}
rb->xfer->send.spd = rb->spd;
@@ -2043,20 +2034,16 @@ fw_rcv(struct fw_rcv_buf *rb)
rb->xfer->hand = fw_xferwake;
*/
rb->xfer->hand = fw_xfer_free;
- if(fw_asyreq(rb->fc, -1, rb->xfer)){
+ if (fw_asyreq(rb->fc, -1, rb->xfer))
fw_xfer_free(rb->xfer);
- return;
- }
- return;
}
len = 0;
- for (i = 0; i < rb->nvec; i ++)
+ for (i = 0; i < rb->nvec; i++)
len += rb->vec[i].iov_len;
rb->xfer = STAILQ_FIRST(&bind->xferlist);
if (rb->xfer == NULL) {
device_printf(rb->fc->bdev, "%s: "
- "Discard a packet for this bind.\n",
- __func__);
+ "Discard a packet for this bind.\n", __func__);
return;
}
STAILQ_REMOVE_HEAD(&bind->xferlist, link);
@@ -2073,11 +2060,11 @@ fw_rcv(struct fw_rcv_buf *rb)
printf("stream rcv dma %d len %d off %d spd %d\n",
sub, len, off, spd);
#endif
- if(xferq->queued >= xferq->maxq) {
+ if (xferq->queued >= xferq->maxq) {
printf("receive queue is full\n");
return;
}
- /* XXX get xfer from xfer queue, we don't need copy for
+ /* XXX get xfer from xfer queue, we don't need copy for
per packet mode */
rb->xfer = fw_xfer_alloc_buf(M_FWXFER, 0, /* XXX */
vec[0].iov_len);
@@ -2089,11 +2076,7 @@ fw_rcv(struct fw_rcv_buf *rb)
STAILQ_INSERT_TAIL(&xferq->q, rb->xfer, link);
splx(s);
sc = device_get_softc(rb->fc->bdev);
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
- if (&xferq->rsel.si_pid != 0)
-#else
if (SEL_WAITING(&xferq->rsel))
-#endif
selwakeuppri(&xferq->rsel, FWPRI);
if (xferq->flag & FWXFERQ_WAKEUP) {
xferq->flag &= ~FWXFERQ_WAKEUP;
@@ -2108,7 +2091,7 @@ fw_rcv(struct fw_rcv_buf *rb)
#endif
default:
device_printf(rb->fc->bdev,"%s: unknown tcode %d\n",
- __func__, tcode);
+ __func__, tcode);
break;
}
}
@@ -2154,14 +2137,13 @@ static void
fw_try_bmr(void *arg)
{
struct fw_xfer *xfer;
- struct firewire_comm *fc = (struct firewire_comm *)arg;
+ struct firewire_comm *fc = arg;
struct fw_pkt *fp;
int err = 0;
xfer = fw_xfer_alloc_buf(M_FWXFER, 8, 4);
- if(xfer == NULL){
+ if (xfer == NULL)
return;
- }
xfer->send.spd = 0;
fc->status = FWBUSMGRELECT;
@@ -2180,7 +2162,7 @@ fw_try_bmr(void *arg)
xfer->hand = fw_try_bmr_callback;
err = fw_asyreq(fc, -1, xfer);
- if(err){
+ if (err) {
fw_xfer_free_buf(xfer);
return;
}
@@ -2190,33 +2172,37 @@ fw_try_bmr(void *arg)
#ifdef FW_VMACCESS
/*
* Software implementation for physical memory block access.
- * XXX:Too slow, usef for debug purpose only.
+ * XXX:Too slow, useful for debug purpose only.
*/
static void
-fw_vmaccess(struct fw_xfer *xfer){
+fw_vmaccess(struct fw_xfer *xfer)
+{
struct fw_pkt *rfp, *sfp = NULL;
uint32_t *ld = (uint32_t *)xfer->recv.buf;
printf("vmaccess spd:%2x len:%03x data:%08x %08x %08x %08x\n",
- xfer->spd, xfer->recv.len, ntohl(ld[0]), ntohl(ld[1]), ntohl(ld[2]), ntohl(ld[3]));
- printf("vmaccess data:%08x %08x %08x %08x\n", ntohl(ld[4]), ntohl(ld[5]), ntohl(ld[6]), ntohl(ld[7]));
- if(xfer->resp != 0){
- fw_xfer_free( xfer);
+ xfer->spd, xfer->recv.len, ntohl(ld[0]), ntohl(ld[1]), ntohl(ld[2]),
+ ntohl(ld[3]));
+ printf("vmaccess data:%08x %08x %08x %08x\n", ntohl(ld[4]),
+ ntohl(ld[5]), ntohl(ld[6]), ntohl(ld[7]));
+ if (xfer->resp != 0) {
+ fw_xfer_free(xfer);
return;
}
- if(xfer->recv.buf == NULL){
- fw_xfer_free( xfer);
+ if (xfer->recv.buf == NULL) {
+ fw_xfer_free(xfer);
return;
}
rfp = (struct fw_pkt *)xfer->recv.buf;
- switch(rfp->mode.hdr.tcode){
+ switch (rfp->mode.hdr.tcode) {
/* XXX need fix for 64bit arch */
case FWTCODE_WREQB:
xfer->send.buf = malloc(12, M_FW, M_NOWAIT);
xfer->send.len = 12;
sfp = (struct fw_pkt *)xfer->send.buf;
bcopy(rfp->mode.wreqb.payload,
- (caddr_t)ntohl(rfp->mode.wreqb.dest_lo), ntohs(rfp->mode.wreqb.len));
+ (caddr_t)ntohl(rfp->mode.wreqb.dest_lo),s
+ ntohs(rfp->mode.wreqb.len));
sfp->mode.wres.tcode = FWTCODE_WRES;
sfp->mode.wres.rtcode = 0;
break;
@@ -2224,15 +2210,18 @@ fw_vmaccess(struct fw_xfer *xfer){
xfer->send.buf = malloc(12, M_FW, M_NOWAIT);
xfer->send.len = 12;
sfp->mode.wres.tcode = FWTCODE_WRES;
- *((uint32_t *)(ntohl(rfp->mode.wreqb.dest_lo))) = rfp->mode.wreqq.data;
+ *((uint32_t *)(ntohl(rfp->mode.wreqb.dest_lo))) =
+ rfp->mode.wreqq.data;
sfp->mode.wres.rtcode = 0;
break;
case FWTCODE_RREQB:
- xfer->send.buf = malloc(16 + rfp->mode.rreqb.len, M_FW, M_NOWAIT);
+ xfer->send.buf = malloc(16 + rfp->mode.rreqb.len,
+ M_FW, M_NOWAIT);
xfer->send.len = 16 + ntohs(rfp->mode.rreqb.len);
sfp = (struct fw_pkt *)xfer->send.buf;
bcopy((caddr_t)ntohl(rfp->mode.rreqb.dest_lo),
- sfp->mode.rresb.payload, (uint16_t)ntohs(rfp->mode.rreqb.len));
+ sfp->mode.rresb.payload,
+ ntohs(rfp->mode.rreqb.len));
sfp->mode.rresb.tcode = FWTCODE_RRESB;
sfp->mode.rresb.len = rfp->mode.rreqb.len;
sfp->mode.rresb.rtcode = 0;
@@ -2242,12 +2231,13 @@ fw_vmaccess(struct fw_xfer *xfer){
xfer->send.buf = malloc(16, M_FW, M_NOWAIT);
xfer->send.len = 16;
sfp = (struct fw_pkt *)xfer->send.buf;
- sfp->mode.rresq.data = *(uint32_t *)(ntohl(rfp->mode.rreqq.dest_lo));
+ sfp->mode.rresq.data =
+ *(uint32_t *)(ntohl(rfp->mode.rreqq.dest_lo));
sfp->mode.wres.tcode = FWTCODE_RRESQ;
sfp->mode.rresb.rtcode = 0;
break;
default:
- fw_xfer_free( xfer);
+ fw_xfer_free(xfer);
return;
}
sfp->mode.hdr.dst = rfp->mode.hdr.src;
@@ -2261,24 +2251,25 @@ fw_vmaccess(struct fw_xfer *xfer){
/**/
return;
}
-#endif
+#endif
/*
* CRC16 check-sum for IEEE1394 register blocks.
*/
uint16_t
-fw_crc16(uint32_t *ptr, uint32_t len){
+fw_crc16(uint32_t *ptr, uint32_t len)
+{
uint32_t i, sum, crc = 0;
int shift;
len = (len + 3) & ~3;
- for(i = 0 ; i < len ; i+= 4){
- for( shift = 28 ; shift >= 0 ; shift -= 4){
+ for (i = 0; i < len; i += 4) {
+ for (shift = 28; shift >= 0; shift -= 4) {
sum = ((crc >> 12) ^ (ptr[i/4] >> shift)) & 0xf;
- crc = (crc << 4) ^ ( sum << 12 ) ^ ( sum << 5) ^ sum;
+ crc = (crc << 4) ^ (sum << 12) ^ (sum << 5) ^ sum;
}
crc &= 0xffff;
}
- return((uint16_t) crc);
+ return ((uint16_t) crc);
}
/*
@@ -2303,7 +2294,7 @@ fw_bmr(struct firewire_comm *fc)
cmstr = fc->max_node;
else {
device_printf(fc->bdev,
- "root node is not cycle master capable\n");
+ "root node is not cycle master capable\n");
/* XXX shall we be the cycle master? */
cmstr = fc->nodeid;
/* XXX need bus reset */
@@ -2314,13 +2305,13 @@ fw_bmr(struct firewire_comm *fc)
device_printf(fc->bdev, "bus manager %d %s\n",
CSRARC(fc, BUS_MGR_ID),
(CSRARC(fc, BUS_MGR_ID) != fc->nodeid) ? "(me)" : "");
- if(CSRARC(fc, BUS_MGR_ID) != fc->nodeid) {
+ if (CSRARC(fc, BUS_MGR_ID) != fc->nodeid) {
/* We are not the bus manager */
- return(0);
+ return (0);
}
/* Optimize gapcount */
- if(fc->max_hop <= MAX_GAPHOP )
+ if (fc->max_hop <= MAX_GAPHOP)
fw_phy_config(fc, cmstr, gap_cnt[fc->max_hop]);
/* If we are the cycle master, nothing to do */
if (cmstr == fc->nodeid || cmstr == -1)
@@ -2335,7 +2326,7 @@ fw_bmr(struct firewire_comm *fc)
/* Set cmstr bit on the cycle master */
quad = htonl(1 << 8);
fwmem_write_quad(&fwdev, NULL, 0/*spd*/,
- 0xffff, 0xf0000000 | STATE_SET, &quad, fw_asy_callback_free);
+ 0xffff, 0xf0000000 | STATE_SET, &quad, fw_asy_callback_free);
return 0;
}
@@ -2353,7 +2344,7 @@ fw_open_isodma(struct firewire_comm *fc, int tx)
xferqa = &fc->ir[0];
FW_GLOCK(fc);
- for (i = 0; i < fc->nisodma; i ++) {
+ for (i = 0; i < fc->nisodma; i++) {
xferq = xferqa[i];
if ((xferq->flag & FWXFERQ_OPEN) == 0) {
xferq->flag |= FWXFERQ_OPEN;
@@ -2372,22 +2363,16 @@ static int
fw_modevent(module_t mode, int type, void *data)
{
int err = 0;
-#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
static eventhandler_tag fwdev_ehtag = NULL;
-#endif
switch (type) {
case MOD_LOAD:
-#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
fwdev_ehtag = EVENTHANDLER_REGISTER(dev_clone,
- fwdev_clone, 0, 1000);
-#endif
+ fwdev_clone, 0, 1000);
break;
case MOD_UNLOAD:
-#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
if (fwdev_ehtag != NULL)
EVENTHANDLER_DEREGISTER(dev_clone, fwdev_ehtag);
-#endif
break;
case MOD_SHUTDOWN:
break;
@@ -2398,8 +2383,6 @@ fw_modevent(module_t mode, int type, void *data)
}
-#ifdef __DragonFly__
-DECLARE_DUMMY_MODULE(firewire);
-#endif
-DRIVER_MODULE(firewire,fwohci,firewire_driver,firewire_devclass,fw_modevent,0);
+DRIVER_MODULE(firewire, fwohci, firewire_driver, firewire_devclass,
+ fw_modevent,0);
MODULE_VERSION(firewire, 1);
diff --git a/sys/dev/firewire/firewire.h b/sys/dev/firewire/firewire.h
index 0a512e1..442fd6f 100644
--- a/sys/dev/firewire/firewire.h
+++ b/sys/dev/firewire/firewire.h
@@ -30,7 +30,7 @@
* STRICT LIABILITY, OR TORT (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$
*
*/
@@ -42,8 +42,8 @@
#define DEV_DV 2
struct fw_isochreq {
- unsigned char ch:6,
- tag:2;
+ unsigned char ch:6;
+ unsigned char tag:2;
};
struct fw_isobufreq {
@@ -247,15 +247,15 @@ struct fw_eui64 {
uint32_t hi, lo;
};
#define FW_EUI64_BYTE(eui, x) \
- ((((x)<4)? \
- ((eui)->hi >> (8*(3-(x)))): \
- ((eui)->lo >> (8*(7-(x)))) \
+ ((((x) < 4)? \
+ ((eui)->hi >> (8 * (3 - (x)))): \
+ ((eui)->lo >> (8 * (7 - (x)))) \
) & 0xff)
#define FW_EUI64_EQUAL(x, y) \
((x).hi == (y).hi && (x).lo == (y).lo)
struct fw_asyreq {
- struct fw_asyreq_t{
+ struct fw_asyreq_t {
unsigned char sped;
unsigned int type;
#define FWASREQNODE 0
@@ -265,8 +265,8 @@ struct fw_asyreq {
unsigned short len;
union {
struct fw_eui64 eui;
- }dst;
- }req;
+ } dst;
+ } req;
struct fw_pkt pkt;
uint32_t data[512];
};
@@ -406,7 +406,7 @@ struct fw_topology_map {
uint32_t generation;
uint32_t self_id_count:16,
node_count:16;
- union fw_self_id self_id[4*64];
+ union fw_self_id self_id[4 * 64];
};
struct fw_speed_map {
diff --git a/sys/dev/firewire/firewire_phy.h b/sys/dev/firewire/firewire_phy.h
index 42feff2..a420a4a 100644
--- a/sys/dev/firewire/firewire_phy.h
+++ b/sys/dev/firewire/firewire_phy.h
@@ -29,7 +29,7 @@
* STRICT LIABILITY, OR TORT (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$
*
*/
diff --git a/sys/dev/firewire/firewirereg.h b/sys/dev/firewire/firewirereg.h
index ba58f28..e9a8606 100644
--- a/sys/dev/firewire/firewirereg.h
+++ b/sys/dev/firewire/firewirereg.h
@@ -30,21 +30,13 @@
* STRICT LIABILITY, OR TORT (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$
*
*/
-#ifdef __DragonFly__
-typedef d_thread_t fw_proc;
-#include <sys/select.h>
-#elif __FreeBSD_version >= 500000
typedef struct thread fw_proc;
#include <sys/selinfo.h>
-#else
-typedef struct proc fw_proc;
-#include <sys/select.h>
-#endif
#include <sys/uio.h>
#include <sys/mutex.h>
@@ -54,7 +46,7 @@ typedef struct proc fw_proc;
STAILQ_HEAD(fw_xferlist, fw_xfer);
-struct fw_device{
+struct fw_device {
uint16_t dst;
struct fw_eui64 eui;
uint8_t speed;
@@ -64,7 +56,7 @@ struct fw_device{
#define CSRROMOFF 0x400
#define CSRROMSIZE 0x400
int rommax; /* offset from 0xffff f000 0000 */
- uint32_t csrrom[CSRROMSIZE/4];
+ uint32_t csrrom[CSRROMSIZE / 4];
int rcnt;
struct firewire_comm *fc;
uint32_t status;
@@ -101,11 +93,11 @@ struct tcode_info {
u_char valid_res;
};
-struct firewire_comm{
+struct firewire_comm {
device_t dev;
device_t bdev;
uint16_t busid:10,
- nodeid:6;
+ nodeid:6;
u_int mode;
u_int nport;
u_int speed;
@@ -137,7 +129,7 @@ struct firewire_comm{
STAILQ_HEAD(, fw_device) devices;
u_int sid_cnt;
#define CSRSIZE 0x4000
- uint32_t csr_arc[CSRSIZE/4];
+ uint32_t csr_arc[CSRSIZE / 4];
#define CROMSIZE 0x400
uint32_t *config_rom;
struct crom_src_buf *crom_src_buf;
@@ -149,7 +141,7 @@ struct firewire_comm{
struct callout bmr_callout;
struct callout timeout_callout;
struct task task_timeout;
- uint32_t (*cyctimer) (struct firewire_comm *);
+ uint32_t (*cyctimer) (struct firewire_comm *);
void (*ibr) (struct firewire_comm *);
uint32_t (*set_bmr) (struct firewire_comm *, uint32_t);
int (*ioctl) (struct cdev *, u_long, caddr_t, int, fw_proc *);
@@ -169,7 +161,7 @@ struct firewire_comm{
struct taskqueue *taskqueue;
struct proc *probe_thread;
};
-#define CSRARC(sc, offset) ((sc)->csr_arc[(offset)/4])
+#define CSRARC(sc, offset) ((sc)->csr_arc[(offset) / 4])
#define FW_GMTX(fc) (&(fc)->mtx)
#define FW_GLOCK(fc) mtx_lock(FW_GMTX(fc))
@@ -190,7 +182,7 @@ struct fw_xferq {
#define FWXFERQ_HANDLER (1 << 16)
#define FWXFERQ_WAKEUP (1 << 17)
- void (*start) (struct firewire_comm*);
+ void (*start) (struct firewire_comm *);
int dmach;
struct fw_xferlist q;
u_int queued;
@@ -209,7 +201,7 @@ struct fw_xferq {
void (*hand) (struct fw_xferq *);
};
-struct fw_bulkxfer{
+struct fw_bulkxfer {
int poffset;
struct mbuf *mbuf;
STAILQ_ENTRY(fw_bulkxfer) link;
@@ -218,7 +210,7 @@ struct fw_bulkxfer{
int resp;
};
-struct fw_bind{
+struct fw_bind {
u_int64_t start;
u_int64_t end;
struct fw_xferlist xferlist;
@@ -227,7 +219,7 @@ struct fw_bind{
void *sc;
};
-struct fw_xfer{
+struct fw_xfer {
caddr_t sc;
struct firewire_comm *fc;
struct fw_xferq *q;
@@ -267,9 +259,9 @@ struct fw_rcv_buf {
void fw_sidrcv (struct firewire_comm *, uint32_t *, u_int);
void fw_rcv (struct fw_rcv_buf *);
-void fw_xfer_unload ( struct fw_xfer*);
-void fw_xfer_free_buf ( struct fw_xfer*);
-void fw_xfer_free ( struct fw_xfer*);
+void fw_xfer_unload (struct fw_xfer *);
+void fw_xfer_free_buf (struct fw_xfer *);
+void fw_xfer_free (struct fw_xfer*);
struct fw_xfer *fw_xfer_alloc (struct malloc_type *);
struct fw_xfer *fw_xfer_alloc_buf (struct malloc_type *, int, int);
void fw_init (struct firewire_comm *);
@@ -280,7 +272,7 @@ int fw_bindremove (struct firewire_comm *, struct fw_bind *);
int fw_xferlist_add (struct fw_xferlist *, struct malloc_type *, int, int, int,
struct firewire_comm *, void *, void (*)(struct fw_xfer *));
void fw_xferlist_remove (struct fw_xferlist *);
-int fw_asyreq (struct firewire_comm *, int, struct fw_xfer*);
+int fw_asyreq (struct firewire_comm *, int, struct fw_xfer *);
void fw_busreset (struct firewire_comm *, uint32_t);
uint16_t fw_crc16 (uint32_t *, uint32_t);
void fw_xfer_timeout (void *);
@@ -301,7 +293,7 @@ extern int firewire_debug;
extern devclass_t firewire_devclass;
extern int firewire_phydma_enable;
-#define FWPRI ((PZERO+8)|PCATCH)
+#define FWPRI ((PZERO + 8) | PCATCH)
#define CALLOUT_INIT(x) callout_init(x, 1 /* mpsafe */)
diff --git a/sys/dev/firewire/fwcrom.c b/sys/dev/firewire/fwcrom.c
index 4ee0f11..e53d3b6 100644
--- a/sys/dev/firewire/fwcrom.c
+++ b/sys/dev/firewire/fwcrom.c
@@ -59,13 +59,8 @@ __FBSDID("$FreeBSD$");
#endif
#endif
-#ifdef __DragonFly__
-#include "firewire.h"
-#include "iec13213.h"
-#else
#include <dev/firewire/firewire.h>
#include <dev/firewire/iec13213.h>
-#endif
#define MAX_ROM (1024 - sizeof(uint32_t) * 5)
#define CROM_END(cc) ((vm_offset_t)(cc)->stack[0].dir + MAX_ROM - 1)
@@ -116,7 +111,7 @@ crom_next(struct crom_context *cc)
printf("crom_next: too deep\n");
goto again;
}
- cc->depth ++;
+ cc->depth++;
ptr = &cc->stack[cc->depth];
ptr->dir = (struct csrdirectory *) (reg + reg->val);
@@ -125,10 +120,10 @@ crom_next(struct crom_context *cc)
}
again:
ptr = &cc->stack[cc->depth];
- ptr->index ++;
+ ptr->index++;
check:
if (ptr->index < ptr->dir->crc_len &&
- (vm_offset_t)crom_get(cc) <= CROM_END(cc))
+ (vm_offset_t)crom_get(cc) <= CROM_END(cc))
return;
if (ptr->index < ptr->dir->crc_len)
@@ -148,7 +143,7 @@ crom_search_key(struct crom_context *cc, uint8_t key)
{
struct csrreg *reg;
- while(cc->depth >= 0) {
+ while (cc->depth >= 0) {
reg = crom_get(cc);
if (reg->key == key)
return reg;
@@ -166,7 +161,7 @@ crom_has_specver(uint32_t *p, uint32_t spec, uint32_t ver)
cc = &c;
crom_init_context(cc, p);
- while(cc->depth >= 0) {
+ while (cc->depth >= 0) {
reg = crom_get(cc);
if (state == 0) {
if (reg->key == CSRKEY_SPEC && reg->val == spec)
@@ -198,7 +193,7 @@ crom_parse_text(struct crom_context *cc, char *buf, int len)
reg = crom_get(cc);
if (reg->key != CROM_TEXTLEAF ||
- (vm_offset_t)(reg + reg->val) > CROM_END(cc)) {
+ (vm_offset_t)(reg + reg->val) > CROM_END(cc)) {
strncpy(buf, nullstr, len);
return;
}
@@ -215,7 +210,7 @@ crom_parse_text(struct crom_context *cc, char *buf, int len)
qlen = textleaf->crc_len - 2;
if (len < qlen * 4)
qlen = len/4;
- for (i = 0; i < qlen; i ++)
+ for (i = 0; i < qlen; i++)
*bp++ = ntohl(textleaf->text[i]);
/* make sure to terminate the string */
if (len <= qlen * 4)
@@ -238,7 +233,7 @@ crom_crc(uint32_t *ptr, int len)
}
crc &= 0xffff;
}
- return((uint16_t) crc);
+ return ((uint16_t) crc);
}
#if !defined(_KERNEL) && !defined(_BOOT)
@@ -315,17 +310,17 @@ crom_desc(struct crom_context *cc, char *buf, int len)
break;
case CSRTYPE_C:
len -= snprintf(buf, len, "offset=0x%04x(%d)",
- reg->val, reg->val);
+ reg->val, reg->val);
buf += strlen(buf);
break;
case CSRTYPE_L:
/* XXX fall through */
case CSRTYPE_D:
- dir = (struct csrdirectory *) (reg + reg->val);
+ dir = (struct csrdirectory *)(reg + reg->val);
crc = crom_crc((uint32_t *)&dir->entry[0], dir->crc_len);
len -= snprintf(buf, len, "len=%d crc=0x%04x(%s) ",
- dir->crc_len, dir->crc,
- (crc == dir->crc) ? "OK" : "NG");
+ dir->crc_len, dir->crc,
+ (crc == dir->crc) ? "OK" : "NG");
buf += strlen(buf);
}
switch (reg->key) {
@@ -399,11 +394,11 @@ crom_add_quad(struct crom_chunk *chunk, uint32_t entry)
index = chunk->data.crc_len;
if (index >= CROM_MAX_CHUNK_LEN - 1) {
printf("too large chunk %d\n", index);
- return(-1);
+ return (-1);
}
chunk->data.buf[index] = entry;
chunk->data.crc_len++;
- return(index);
+ return (index);
}
int
@@ -414,7 +409,7 @@ crom_add_entry(struct crom_chunk *chunk, int key, int val)
struct csrreg reg;
uint32_t i;
} foo;
-
+
foo.reg.key = key;
foo.reg.val = val;
return (crom_add_quad(chunk, foo.i));
@@ -422,29 +417,29 @@ crom_add_entry(struct crom_chunk *chunk, int key, int val)
int
crom_add_chunk(struct crom_src *src, struct crom_chunk *parent,
- struct crom_chunk *child, int key)
+ struct crom_chunk *child, int key)
{
int index;
if (parent == NULL) {
STAILQ_INSERT_TAIL(&src->chunk_list, child, link);
- return(0);
+ return (0);
}
index = crom_add_entry(parent, key, 0);
if (index < 0) {
- return(-1);
+ return (-1);
}
child->ref_chunk = parent;
child->ref_index = index;
STAILQ_INSERT_TAIL(&src->chunk_list, child, link);
- return(index);
+ return (index);
}
#define MAX_TEXT ((CROM_MAX_CHUNK_LEN + 1) * 4 - sizeof(struct csrtext))
int
crom_add_simple_text(struct crom_src *src, struct crom_chunk *parent,
- struct crom_chunk *chunk, char *buf)
+ struct crom_chunk *chunk, char *buf)
{
struct csrtext *tl;
uint32_t *p;
@@ -453,7 +448,7 @@ crom_add_simple_text(struct crom_src *src, struct crom_chunk *parent,
len = strlen(buf);
if (len > MAX_TEXT) {
- printf("text(%d) trancated to %td.\n", len, MAX_TEXT);
+ printf("text(%d) truncated to %td.\n", len, MAX_TEXT);
len = MAX_TEXT;
}
@@ -465,7 +460,7 @@ crom_add_simple_text(struct crom_src *src, struct crom_chunk *parent,
bzero(&t[0], roundup2(len, sizeof(uint32_t)));
bcopy(buf, &t[0], len);
p = (uint32_t *)&t[0];
- for (i = 0; i < howmany(len, sizeof(uint32_t)); i ++)
+ for (i = 0; i < howmany(len, sizeof(uint32_t)); i++)
tl->text[i] = ntohl(*p++);
return (crom_add_chunk(src, parent, chunk, CROM_TEXTLEAF));
}
@@ -475,11 +470,11 @@ crom_copy(uint32_t *src, uint32_t *dst, int *offset, int len, int maxlen)
{
if (*offset + len > maxlen) {
printf("Config. ROM is too large for the buffer\n");
- return(-1);
+ return (-1);
}
bcopy(src, (char *)(dst + *offset), len * sizeof(uint32_t));
*offset += len;
- return(0);
+ return (0);
}
int
@@ -503,9 +498,9 @@ crom_load(struct crom_src *src, uint32_t *buf, int maxlen)
if (parent != NULL) {
struct csrreg *reg;
reg = (struct csrreg *)
- &parent->data.buf[chunk->ref_index];
+ &parent->data.buf[chunk->ref_index];
reg->val = offset -
- (parent->offset + 1 + chunk->ref_index);
+ (parent->offset + 1 + chunk->ref_index);
}
offset += 1 + chunk->data.crc_len;
}
@@ -514,15 +509,15 @@ crom_load(struct crom_src *src, uint32_t *buf, int maxlen)
len = 1 + src->hdr.info_len;
count = 0;
if (crom_copy((uint32_t *)&src->hdr, buf, &count, len, maxlen) < 0)
- return(-1);
+ return (-1);
STAILQ_FOREACH(chunk, &src->chunk_list, link) {
chunk->data.crc =
- crom_crc(&chunk->data.buf[0], chunk->data.crc_len);
+ crom_crc(&chunk->data.buf[0], chunk->data.crc_len);
len = 1 + chunk->data.crc_len;
if (crom_copy((uint32_t *)&chunk->data, buf,
- &count, len, maxlen) < 0)
- return(-1);
+ &count, len, maxlen) < 0)
+ return (-1);
}
hdr = (struct csrhdr *)buf;
hdr->crc_len = count - 1;
@@ -531,19 +526,20 @@ crom_load(struct crom_src *src, uint32_t *buf, int maxlen)
#if defined(_KERNEL) || defined(_BOOT)
/* byte swap */
ptr = buf;
- for (i = 0; i < count; i ++) {
+ for (i = 0; i < count; i++) {
*ptr = htonl(*ptr);
ptr++;
}
#endif
- return(count);
+ return (count);
}
#endif
#ifdef TEST
int
-main () {
+main()
+{
struct crom_src src;
struct crom_chunk root,unit1,unit2,unit3;
struct crom_chunk text1,text2,text3,text4,text5,text6,text7;
@@ -587,15 +583,9 @@ main () {
/* private company_id */
crom_add_entry(&root, CSRKEY_VENDOR, 0xacde48);
-#ifdef __DragonFly__
- crom_add_simple_text(&src, &root, &text1, "DragonFly");
- crom_add_entry(&root, CSRKEY_HW, __DragonFly_cc_version);
- crom_add_simple_text(&src, &root, &text2, "DragonFly-1");
-#else
crom_add_simple_text(&src, &root, &text1, "FreeBSD");
crom_add_entry(&root, CSRKEY_HW, __FreeBSD_version);
crom_add_simple_text(&src, &root, &text2, "FreeBSD-5");
-#endif
/* SBP unit directory */
crom_add_chunk(&src, &root, &unit1, CROM_UDIR);
@@ -628,11 +618,11 @@ main () {
crom_load(&src, buf, 256);
p = buf;
#define DUMP_FORMAT "%08x %08x %08x %08x %08x %08x %08x %08x\n"
- for (i = 0; i < 256/8; i ++) {
+ for (i = 0; i < 256/8; i++) {
printf(DUMP_FORMAT,
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
p += 8;
}
- return(0);
+ return (0);
}
#endif
diff --git a/sys/dev/firewire/fwdev.c b/sys/dev/firewire/fwdev.c
index 20d89a4..e09ce2c 100644
--- a/sys/dev/firewire/fwdev.c
+++ b/sys/dev/firewire/fwdev.c
@@ -30,7 +30,7 @@
* STRICT LIABILITY, OR TORT (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$
*
*/
@@ -52,19 +52,11 @@
#include <sys/ioccom.h>
-#ifdef __DragonFly__
-#include "firewire.h"
-#include "firewirereg.h"
-#include "fwdma.h"
-#include "fwmem.h"
-#include "iec68113.h"
-#else
#include <dev/firewire/firewire.h>
#include <dev/firewire/firewirereg.h>
#include <dev/firewire/fwdma.h>
#include <dev/firewire/fwmem.h>
#include <dev/firewire/iec68113.h>
-#endif
#define FWNODE_INVAL 0xffff
@@ -78,12 +70,6 @@ static d_mmap_t fw_mmap;
static d_strategy_t fw_strategy;
struct cdevsw firewire_cdevsw = {
-#ifdef __DragonFly__
-#define CDEV_MAJOR 127
- "fw", CDEV_MAJOR, D_MEM, NULL, 0,
- fw_open, fw_close, fw_read, fw_write, fw_ioctl,
- fw_poll, fw_mmap, fw_strategy, nodump, nopsize,
-#elif __FreeBSD_version >= 500104
.d_version = D_VERSION,
.d_open = fw_open,
.d_close = fw_close,
@@ -95,12 +81,6 @@ struct cdevsw firewire_cdevsw = {
.d_strategy = fw_strategy,
.d_name = "fw",
.d_flags = D_MEM
-#else
-#define CDEV_MAJOR 127
- fw_open, fw_close, fw_read, fw_write, fw_ioctl,
- fw_poll, fw_mmap, fw_strategy, "fw", CDEV_MAJOR,
- nodump, nopsize, D_MEM, -1
-#endif
};
struct fw_drv1 {
@@ -119,22 +99,21 @@ fwdev_allocbuf(struct firewire_comm *fc, struct fw_xferq *q,
int i;
if (q->flag & (FWXFERQ_RUNNING | FWXFERQ_EXTBUF))
- return(EBUSY);
+ return (EBUSY);
- q->bulkxfer = (struct fw_bulkxfer *) malloc(
- sizeof(struct fw_bulkxfer) * b->nchunk,
- M_FW, M_WAITOK);
+ q->bulkxfer = malloc(sizeof(struct fw_bulkxfer) * b->nchunk,
+ M_FW, M_WAITOK);
if (q->bulkxfer == NULL)
- return(ENOMEM);
+ return (ENOMEM);
b->psize = roundup2(b->psize, sizeof(uint32_t));
q->buf = fwdma_malloc_multiseg(fc, sizeof(uint32_t),
- b->psize, b->nchunk * b->npacket, BUS_DMA_WAITOK);
+ b->psize, b->nchunk * b->npacket, BUS_DMA_WAITOK);
if (q->buf == NULL) {
free(q->bulkxfer, M_FW);
q->bulkxfer = NULL;
- return(ENOMEM);
+ return (ENOMEM);
}
q->bnchunk = b->nchunk;
q->bnpacket = b->npacket;
@@ -146,7 +125,7 @@ fwdev_allocbuf(struct firewire_comm *fc, struct fw_xferq *q,
STAILQ_INIT(&q->stdma);
q->stproc = NULL;
- for(i = 0 ; i < q->bnchunk; i++){
+ for (i = 0; i < q->bnchunk; i++) {
q->bulkxfer[i].poffset = i * q->bnpacket;
q->bulkxfer[i].mbuf = NULL;
STAILQ_INSERT_TAIL(&q->stfree, &q->bulkxfer[i], link);
@@ -177,7 +156,7 @@ fwdev_freebuf(struct fw_xferq *q)
static int
-fw_open (struct cdev *dev, int flags, int fmt, fw_proc *td)
+fw_open(struct cdev *dev, int flags, int fmt, fw_proc *td)
{
int err = 0;
int unit = DEV2UNIT(dev);
@@ -209,10 +188,10 @@ fw_open (struct cdev *dev, int flags, int fmt, fw_proc *td)
int sub = DEV2SUB(dev);
make_dev(&firewire_cdevsw, dev2unit(dev),
- UID_ROOT, GID_OPERATOR, 0660,
- "fw%d.%d", unit, sub);
+ UID_ROOT, GID_OPERATOR, 0660, "fw%d.%d", unit, sub);
}
- d = (struct fw_drv1 *)dev->si_drv1;
+
+ d = dev->si_drv1;
d->fc = sc->fc;
STAILQ_INIT(&d->binds);
STAILQ_INIT(&d->rq);
@@ -221,7 +200,7 @@ fw_open (struct cdev *dev, int flags, int fmt, fw_proc *td)
}
static int
-fw_close (struct cdev *dev, int flags, int fmt, fw_proc *td)
+fw_close(struct cdev *dev, int flags, int fmt, fw_proc *td)
{
struct firewire_comm *fc;
struct fw_drv1 *d;
@@ -232,12 +211,12 @@ fw_close (struct cdev *dev, int flags, int fmt, fw_proc *td)
if (DEV_FWMEM(dev))
return fwmem_close(dev, flags, fmt, td);
- d = (struct fw_drv1 *)dev->si_drv1;
+ d = dev->si_drv1;
fc = d->fc;
/* remove binding */
for (fwb = STAILQ_FIRST(&d->binds); fwb != NULL;
- fwb = STAILQ_FIRST(&d->binds)) {
+ fwb = STAILQ_FIRST(&d->binds)) {
fw_bindremove(fc, fwb);
STAILQ_REMOVE_HEAD(&d->binds, chlist);
fw_xferlist_remove(&fwb->xferlist);
@@ -256,15 +235,15 @@ fw_close (struct cdev *dev, int flags, int fmt, fw_proc *td)
fwdev_freebuf(ir);
/* drain receiving buffer */
for (xfer = STAILQ_FIRST(&ir->q);
- xfer != NULL; xfer = STAILQ_FIRST(&ir->q)) {
- ir->queued --;
+ xfer != NULL; xfer = STAILQ_FIRST(&ir->q)) {
+ ir->queued--;
STAILQ_REMOVE_HEAD(&ir->q, link);
xfer->resp = 0;
fw_xfer_done(xfer);
}
- ir->flag &= ~(FWXFERQ_OPEN |
- FWXFERQ_MODEMASK | FWXFERQ_CHTAGMASK);
+ ir->flag &= ~(FWXFERQ_OPEN | FWXFERQ_MODEMASK |
+ FWXFERQ_CHTAGMASK);
d->ir = NULL;
}
@@ -280,7 +259,7 @@ fw_close (struct cdev *dev, int flags, int fmt, fw_proc *td)
/* free extbuf */
fwdev_freebuf(it);
it->flag &= ~(FWXFERQ_OPEN |
- FWXFERQ_MODEMASK | FWXFERQ_CHTAGMASK);
+ FWXFERQ_MODEMASK | FWXFERQ_CHTAGMASK);
d->it = NULL;
}
free(dev->si_drv1, M_FW);
@@ -317,10 +296,10 @@ fw_read_async(struct fw_drv1 *d, struct uio *uio, int ioflag)
fc->irx_post(fc, fp->mode.ld);
#endif
tinfo = &xfer->fc->tcode[fp->mode.hdr.tcode];
- err = uiomove((void *)fp, tinfo->hdr_len, uio);
+ err = uiomove(fp, tinfo->hdr_len, uio);
if (err)
goto out;
- err = uiomove((void *)xfer->recv.payload, xfer->recv.pay_len, uio);
+ err = uiomove(xfer->recv.payload, xfer->recv.pay_len, uio);
out:
/* recycle this xfer */
@@ -337,7 +316,7 @@ out:
* read request.
*/
static int
-fw_read (struct cdev *dev, struct uio *uio, int ioflag)
+fw_read(struct cdev *dev, struct uio *uio, int ioflag)
{
struct fw_drv1 *d;
struct fw_xferq *ir;
@@ -348,7 +327,7 @@ fw_read (struct cdev *dev, struct uio *uio, int ioflag)
if (DEV_FWMEM(dev))
return (physio(dev, uio, ioflag));
- d = (struct fw_drv1 *)dev->si_drv1;
+ d = dev->si_drv1;
fc = d->fc;
ir = d->ir;
@@ -383,21 +362,21 @@ readloop:
err = EIO;
FW_GUNLOCK(fc);
return err;
- } else if(ir->stproc != NULL) {
+ } else if (ir->stproc != NULL) {
/* iso bulkxfer */
FW_GUNLOCK(fc);
- fp = (struct fw_pkt *)fwdma_v_addr(ir->buf,
- ir->stproc->poffset + ir->queued);
- if(fc->irx_post != NULL)
+ fp = (struct fw_pkt *)fwdma_v_addr(ir->buf,
+ ir->stproc->poffset + ir->queued);
+ if (fc->irx_post != NULL)
fc->irx_post(fc, fp->mode.ld);
- if(fp->mode.stream.len == 0){
+ if (fp->mode.stream.len == 0) {
err = EIO;
return err;
}
err = uiomove((caddr_t)fp,
fp->mode.stream.len + sizeof(uint32_t), uio);
- ir->queued ++;
- if(ir->queued >= ir->bnpacket){
+ ir->queued++;
+ if (ir->queued >= ir->bnpacket) {
s = splfw();
STAILQ_INSERT_TAIL(&ir->stfree, ir->stproc, link);
splx(s);
@@ -470,7 +449,7 @@ out:
}
static int
-fw_write (struct cdev *dev, struct uio *uio, int ioflag)
+fw_write(struct cdev *dev, struct uio *uio, int ioflag)
{
int err = 0;
int s, slept = 0;
@@ -482,7 +461,7 @@ fw_write (struct cdev *dev, struct uio *uio, int ioflag)
if (DEV_FWMEM(dev))
return (physio(dev, uio, ioflag));
- d = (struct fw_drv1 *)dev->si_drv1;
+ d = dev->si_drv1;
fc = d->fc;
it = d->it;
@@ -523,7 +502,7 @@ isoloop:
err = uiomove((caddr_t)fp, sizeof(struct fw_isohdr), uio);
err = uiomove((caddr_t)fp->mode.stream.payload,
fp->mode.stream.len, uio);
- it->queued ++;
+ it->queued++;
if (it->queued >= it->bnpacket) {
s = splfw();
STAILQ_INSERT_TAIL(&it->stvalid, it->stproc, link);
@@ -550,7 +529,7 @@ fw_hand(struct fw_xfer *xfer)
struct fw_drv1 *d;
fwb = (struct fw_bind *)xfer->sc;
- d = (struct fw_drv1 *)fwb->sc;
+ d = fwb->sc;
FW_GLOCK(xfer->fc);
STAILQ_INSERT_TAIL(&d->rq, xfer, link);
FW_GUNLOCK(xfer->fc);
@@ -561,7 +540,7 @@ fw_hand(struct fw_xfer *xfer)
* ioctl support.
*/
int
-fw_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
+fw_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
{
struct firewire_comm *fc;
struct fw_drv1 *d;
@@ -585,9 +564,9 @@ fw_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
return fwmem_ioctl(dev, cmd, data, flag, td);
if (!data)
- return(EINVAL);
+ return (EINVAL);
- d = (struct fw_drv1 *)dev->si_drv1;
+ d = dev->si_drv1;
fc = d->fc;
ir = d->ir;
it = d->it;
@@ -703,7 +682,7 @@ fw_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
bcopy(fp, (void *)&xfer->send.hdr, tinfo->hdr_len);
if (pay_len > 0)
bcopy((char *)fp + tinfo->hdr_len,
- (void *)xfer->send.payload, pay_len);
+ xfer->send.payload, pay_len);
xfer->send.spd = asyreq->req.sped;
xfer->hand = fw_xferwake;
@@ -725,7 +704,7 @@ fw_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
pay_len = xfer->recv.pay_len;
if (asyreq->req.len >= xfer->recv.pay_len + tinfo->hdr_len) {
asyreq->req.len = xfer->recv.pay_len +
- tinfo->hdr_len;
+ tinfo->hdr_len;
} else {
err = EINVAL;
pay_len = 0;
@@ -745,7 +724,7 @@ out:
case FW_CBINDADDR:
fwb = fw_bindlookup(fc,
bindreq->start.hi, bindreq->start.lo);
- if(fwb == NULL){
+ if (fwb == NULL) {
err = EINVAL;
break;
}
@@ -755,30 +734,30 @@ out:
free(fwb, M_FW);
break;
case FW_SBINDADDR:
- if(bindreq->len <= 0 ){
+ if (bindreq->len <= 0) {
err = EINVAL;
break;
}
- if(bindreq->start.hi > 0xffff ){
+ if (bindreq->start.hi > 0xffff) {
err = EINVAL;
break;
}
- fwb = (struct fw_bind *)malloc(sizeof (struct fw_bind), M_FW, M_WAITOK);
- if(fwb == NULL){
+ fwb = malloc(sizeof(struct fw_bind), M_FW, M_WAITOK);
+ if (fwb == NULL) {
err = ENOMEM;
break;
}
fwb->start = ((u_int64_t)bindreq->start.hi << 32) |
bindreq->start.lo;
fwb->end = fwb->start + bindreq->len;
- fwb->sc = (void *)d;
+ fwb->sc = d;
STAILQ_INIT(&fwb->xferlist);
err = fw_bindadd(fc, fwb);
if (err == 0) {
fw_xferlist_add(&fwb->xferlist, M_FWXFER,
/* XXX */
PAGE_SIZE, PAGE_SIZE, 5,
- fc, (void *)fwb, fw_hand);
+ fc, fwb, fw_hand);
STAILQ_INSERT_TAIL(&d->binds, fwb, chlist);
}
break;
@@ -791,11 +770,11 @@ out:
devinfo->eui.hi = fc->eui.hi;
devinfo->eui.lo = fc->eui.lo;
STAILQ_FOREACH(fwdev, &fc->devices, link) {
- if(len < FW_MAX_DEVLST){
+ if (len < FW_MAX_DEVLST) {
devinfo = &fwdevlst->dev[len++];
devinfo->dst = fwdev->dst;
- devinfo->status =
- (fwdev->status == FWDEVINVAL)?0:1;
+ devinfo->status =
+ (fwdev->status == FWDEVINVAL) ? 0 : 1;
devinfo->eui.hi = fwdev->eui.hi;
devinfo->eui.lo = fwdev->eui.lo;
}
@@ -806,7 +785,7 @@ out:
break;
case FW_GTPMAP:
bcopy(fc->topology_map, data,
- (fc->topology_map->crc_len + 1) * 4);
+ (fc->topology_map->crc_len + 1) * 4);
break;
case FW_GCROM:
STAILQ_FOREACH(fwdev, &fc->devices, link)
@@ -841,7 +820,7 @@ out:
free(ptr, M_FW);
break;
default:
- fc->ioctl (dev, cmd, data, flag, td);
+ fc->ioctl(dev, cmd, data, flag, td);
break;
}
return err;
@@ -867,7 +846,7 @@ fw_poll(struct cdev *dev, int events, fw_proc *td)
}
tmp = POLLOUT | POLLWRNORM;
if (events & tmp) {
- /* XXX should be fixed */
+ /* XXX should be fixed */
revents |= tmp;
}
@@ -877,7 +856,7 @@ fw_poll(struct cdev *dev, int events, fw_proc *td)
static int
fw_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
int nproto, vm_memattr_t *memattr)
-{
+{
if (DEV_FWMEM(dev))
return fwmem_mmap(dev, offset, paddr, nproto, memattr);
@@ -912,12 +891,9 @@ fwdev_makedev(struct firewire_softc *sc)
unit = device_get_unit(sc->fc->bdev);
sc->dev = make_dev(&firewire_cdevsw, MAKEMINOR(0, unit, 0),
- UID_ROOT, GID_OPERATOR, 0660,
- "fw%d.%d", unit, 0);
- d = make_dev(&firewire_cdevsw,
- MAKEMINOR(FWMEM_FLAG, unit, 0),
- UID_ROOT, GID_OPERATOR, 0660,
- "fwmem%d.%d", unit, 0);
+ UID_ROOT, GID_OPERATOR, 0660, "fw%d.%d", unit, 0);
+ d = make_dev(&firewire_cdevsw, MAKEMINOR(FWMEM_FLAG, unit, 0),
+ UID_ROOT, GID_OPERATOR, 0660, "fwmem%d.%d", unit, 0);
dev_depends(sc->dev, d);
make_dev_alias(sc->dev, "fw%d", unit);
make_dev_alias(d, "fwmem%d", unit);
diff --git a/sys/dev/firewire/fwdma.c b/sys/dev/firewire/fwdma.c
index d63966d..c8378f0 100644
--- a/sys/dev/firewire/fwdma.c
+++ b/sys/dev/firewire/fwdma.c
@@ -1,7 +1,7 @@
/*-
* Copyright (c) 2003
* Hidetoshi Shimokawa. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -18,7 +18,7 @@
* 4. Neither the name of the author 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
@@ -30,7 +30,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
*/
#ifdef __FreeBSD__
@@ -87,7 +87,7 @@ fwdma_malloc(struct firewire_comm *fc, int alignment, bus_size_t size,
&dma->dma_tag);
if (err) {
printf("fwdma_malloc: failed(1)\n");
- return(NULL);
+ return (NULL);
}
err = bus_dmamem_alloc(dma->dma_tag, &dma->v_addr,
@@ -95,13 +95,13 @@ fwdma_malloc(struct firewire_comm *fc, int alignment, bus_size_t size,
if (err) {
printf("fwdma_malloc: failed(2)\n");
/* XXX destroy tag */
- return(NULL);
+ return (NULL);
}
bus_dmamap_load(dma->dma_tag, dma->dma_map, dma->v_addr,
size, fwdma_map_cb, &dma->bus_addr, /*flags*/0);
- return(dma->v_addr);
+ return (dma->v_addr);
}
void
@@ -121,11 +121,11 @@ fwdma_malloc_size(bus_dma_tag_t dmat, bus_dmamap_t *dmamap,
if (bus_dmamem_alloc(dmat, &v_addr, flag, dmamap)) {
printf("fwdma_malloc_size: failed(1)\n");
- return(NULL);
+ return (NULL);
}
bus_dmamap_load(dmat, *dmamap, v_addr, size,
fwdma_map_cb, bus_addr, /*flags*/0);
- return(v_addr);
+ return (v_addr);
}
void
@@ -134,7 +134,7 @@ fwdma_free_size(bus_dma_tag_t dmat, bus_dmamap_t dmamap,
{
bus_dmamap_unload(dmat, dmamap);
bus_dmamem_free(dmat, vaddr, dmamap);
-}
+}
/*
* Allocate multisegment dma buffers
@@ -162,7 +162,7 @@ fwdma_malloc_multiseg(struct firewire_comm *fc, int alignment,
+ sizeof(struct fwdma_seg)*nseg, M_FW, M_WAITOK);
if (am == NULL) {
printf("fwdma_malloc_multiseg: malloc failed\n");
- return(NULL);
+ return (NULL);
}
am->ssize = ssize;
am->esize = esize;
@@ -183,21 +183,21 @@ fwdma_malloc_multiseg(struct firewire_comm *fc, int alignment,
&am->dma_tag)) {
printf("fwdma_malloc_multiseg: tag_create failed\n");
free(am, M_FW);
- return(NULL);
+ return (NULL);
}
- for (seg = &am->seg[0]; nseg --; seg ++) {
+ for (seg = &am->seg[0]; nseg--; seg++) {
seg->v_addr = fwdma_malloc_size(am->dma_tag, &seg->dma_map,
ssize, &seg->bus_addr, flag);
if (seg->v_addr == NULL) {
printf("fwdma_malloc_multi: malloc_size failed %d\n",
am->nseg);
fwdma_free_multiseg(am);
- return(NULL);
+ return (NULL);
}
am->nseg++;
}
- return(am);
+ return (am);
}
void
@@ -205,7 +205,7 @@ fwdma_free_multiseg(struct fwdma_alloc_multi *am)
{
struct fwdma_seg *seg;
- for (seg = &am->seg[0]; am->nseg --; seg ++) {
+ for (seg = &am->seg[0]; am->nseg--; seg++) {
fwdma_free_size(am->dma_tag, seg->dma_map,
seg->v_addr, am->ssize);
}
diff --git a/sys/dev/firewire/fwdma.h b/sys/dev/firewire/fwdma.h
index 3a8278c..ec67971 100644
--- a/sys/dev/firewire/fwdma.h
+++ b/sys/dev/firewire/fwdma.h
@@ -1,7 +1,7 @@
/*-
* Copyright (C) 2003
* Hidetoshi Shimokawa. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -18,7 +18,7 @@
* 4. Neither the name of the author 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
@@ -30,20 +30,20 @@
* LIABILITY, OR TORT (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$
*/
struct fwdma_alloc {
bus_dma_tag_t dma_tag;
bus_dmamap_t dma_map;
- void * v_addr;
+ void *v_addr;
bus_addr_t bus_addr;
};
struct fwdma_seg {
bus_dmamap_t dma_map;
- void * v_addr;
+ void *v_addr;
bus_addr_t bus_addr;
};
@@ -74,20 +74,20 @@ fwdma_bus_addr(struct fwdma_alloc_multi *am, int index)
}
static __inline void
-fwdma_sync(struct fwdma_alloc *dma, bus_dmasync_op_t op)
+fwdma_sync(struct fwdma_alloc *dma, bus_dmasync_op_t op)
{
bus_dmamap_sync(dma->dma_tag, dma->dma_map, op);
}
static __inline void
fwdma_sync_multiseg(struct fwdma_alloc_multi *am,
- int start, int end, bus_dmasync_op_t op)
+ int start, int end, bus_dmasync_op_t op)
{
struct fwdma_seg *seg, *eseg;
seg = &am->seg[am->esize * start / am->ssize];
eseg = &am->seg[am->esize * end / am->ssize];
- for (; seg <= eseg; seg ++)
+ for (; seg <= eseg; seg++)
bus_dmamap_sync(am->dma_tag, seg->dma_map, op);
}
diff --git a/sys/dev/firewire/fwmem.c b/sys/dev/firewire/fwmem.c
index 4cd24d0..182fc8a 100644
--- a/sys/dev/firewire/fwmem.c
+++ b/sys/dev/firewire/fwmem.c
@@ -1,7 +1,7 @@
/*-
* Copyright (c) 2002-2003
* Hidetoshi Shimokawa. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -18,7 +18,7 @@
* 4. Neither the name of the author 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
@@ -30,7 +30,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
*/
#ifdef __FreeBSD__
@@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
#include <dev/firewire/firewirereg.h>
#include <dev/firewire/fwmem.h>
-static int fwmem_speed=2, fwmem_debug=0;
+static int fwmem_speed = 2, fwmem_debug = 0;
static struct fw_eui64 fwmem_eui64;
SYSCTL_DECL(_hw_firewire);
static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwmem, CTLFLAG_RD, 0,
@@ -126,7 +126,7 @@ fwmem_read_quad(
struct fw_xfer *xfer;
struct fw_pkt *fp;
- xfer = fwmem_xfer_req(fwdev, (void *)sc, spd, 0, 4, hand);
+ xfer = fwmem_xfer_req(fwdev, sc, spd, 0, 4, hand);
if (xfer == NULL) {
return NULL;
}
@@ -141,7 +141,7 @@ fwmem_read_quad(
if (fwmem_debug)
printf("fwmem_read_quad: %d %04x:%08x\n", fwdev->dst,
- dst_hi, dst_lo);
+ dst_hi, dst_lo);
if (fw_asyreq(xfer->fc, -1, xfer) == 0)
return xfer;
@@ -177,7 +177,7 @@ fwmem_write_quad(
if (fwmem_debug)
printf("fwmem_write_quad: %d %04x:%08x %08x\n", fwdev->dst,
- dst_hi, dst_lo, *(uint32_t *)data);
+ dst_hi, dst_lo, *(uint32_t *)data);
if (fw_asyreq(xfer->fc, -1, xfer) == 0)
return xfer;
@@ -199,7 +199,7 @@ fwmem_read_block(
{
struct fw_xfer *xfer;
struct fw_pkt *fp;
-
+
xfer = fwmem_xfer_req(fwdev, sc, spd, 0, roundup2(len, 4), hand);
if (xfer == NULL)
return NULL;
@@ -216,7 +216,7 @@ fwmem_read_block(
if (fwmem_debug)
printf("fwmem_read_block: %d %04x:%08x %d\n", fwdev->dst,
- dst_hi, dst_lo, len);
+ dst_hi, dst_lo, len);
if (fw_asyreq(xfer->fc, -1, xfer) == 0)
return xfer;
@@ -262,9 +262,8 @@ fwmem_write_block(
return NULL;
}
-
int
-fwmem_open (struct cdev *dev, int flags, int fmt, fw_proc *td)
+fwmem_open(struct cdev *dev, int flags, int fmt, fw_proc *td)
{
struct fwmem_softc *fms;
struct firewire_softc *sc;
@@ -278,20 +277,20 @@ fwmem_open (struct cdev *dev, int flags, int fmt, fw_proc *td)
if (dev->si_drv1 != NULL) {
if ((flags & FWRITE) != 0) {
FW_GUNLOCK(sc->fc);
- return(EBUSY);
+ return (EBUSY);
}
FW_GUNLOCK(sc->fc);
- fms = (struct fwmem_softc *)dev->si_drv1;
- fms->refcount ++;
+ fms = dev->si_drv1;
+ fms->refcount++;
} else {
dev->si_drv1 = (void *)-1;
FW_GUNLOCK(sc->fc);
dev->si_drv1 = malloc(sizeof(struct fwmem_softc),
- M_FWMEM, M_WAITOK);
+ M_FWMEM, M_WAITOK);
if (dev->si_drv1 == NULL)
- return(ENOMEM);
+ return (ENOMEM);
dev->si_iosize_max = DFLTPHYS;
- fms = (struct fwmem_softc *)dev->si_drv1;
+ fms = dev->si_drv1;
bcopy(&fwmem_eui64, &fms->eui, sizeof(struct fw_eui64));
fms->sc = sc;
fms->refcount = 1;
@@ -307,10 +306,10 @@ fwmem_close (struct cdev *dev, int flags, int fmt, fw_proc *td)
{
struct fwmem_softc *fms;
- fms = (struct fwmem_softc *)dev->si_drv1;
+ fms = dev->si_drv1;
FW_GLOCK(fms->sc->fc);
- fms->refcount --;
+ fms->refcount--;
FW_GUNLOCK(fms->sc->fc);
if (fwmem_debug)
printf("%s: refcount=%d\n", __func__, fms->refcount);
@@ -349,18 +348,18 @@ fwmem_strategy(struct bio *bp)
struct fw_device *fwdev;
struct fw_xfer *xfer;
struct cdev *dev;
- int err=0, s, iolen;
+ int err = 0, s, iolen;
dev = bp->bio_dev;
/* XXX check request length */
s = splfw();
- fms = (struct fwmem_softc *)dev->si_drv1;
+ fms = dev->si_drv1;
fwdev = fw_noderesolve_eui64(fms->sc->fc, &fms->eui);
if (fwdev == NULL) {
if (fwmem_debug)
printf("fwmem: no such device ID:%08x%08x\n",
- fms->eui.hi, fms->eui.lo);
+ fms->eui.hi, fms->eui.lo);
err = EINVAL;
goto error;
}
@@ -369,12 +368,12 @@ fwmem_strategy(struct bio *bp)
if ((bp->bio_cmd & BIO_READ) == BIO_READ) {
if (iolen == 4 && (bp->bio_offset & 3) == 0)
xfer = fwmem_read_quad(fwdev,
- (void *) bp, fwmem_speed,
+ (void *)bp, fwmem_speed,
bp->bio_offset >> 32, bp->bio_offset & 0xffffffff,
bp->bio_data, fwmem_biodone);
else
xfer = fwmem_read_block(fwdev,
- (void *) bp, fwmem_speed,
+ (void *)bp, fwmem_speed,
bp->bio_offset >> 32, bp->bio_offset & 0xffffffff,
iolen, bp->bio_data, fwmem_biodone);
} else {
@@ -408,12 +407,12 @@ error:
}
int
-fwmem_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
+fwmem_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
{
struct fwmem_softc *fms;
int err = 0;
- fms = (struct fwmem_softc *)dev->si_drv1;
+ fms = dev->si_drv1;
switch (cmd) {
case FW_SDEUI64:
bcopy(data, &fms->eui, sizeof(struct fw_eui64));
@@ -424,16 +423,18 @@ fwmem_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
default:
err = EINVAL;
}
- return(err);
+ return (err);
}
+
int
-fwmem_poll (struct cdev *dev, int events, fw_proc *td)
-{
+fwmem_poll(struct cdev *dev, int events, fw_proc *td)
+{
return EINVAL;
}
+
int
-fwmem_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+fwmem_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
int nproto, vm_memattr_t *memattr)
-{
+{
return EINVAL;
}
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c
index 06321f0..00a54e2 100644
--- a/sys/dev/firewire/fwohci.c
+++ b/sys/dev/firewire/fwohci.c
@@ -30,18 +30,11 @@
* STRICT LIABILITY, OR TORT (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$
*
*/
-#define ATRQ_CH 0
-#define ATRS_CH 1
-#define ARRQ_CH 2
-#define ARRS_CH 3
-#define ITX_CH 4
-#define IRX_CH 0x24
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
@@ -73,25 +66,25 @@ SYSCTL_INT(_hw_firewire, OID_AUTO, nocyclemaster, CTLFLAG_RWTUN,
SYSCTL_INT(_hw_firewire, OID_AUTO, phydma_enable, CTLFLAG_RWTUN,
&firewire_phydma_enable, 0, "Allow physical request DMA from firewire");
-static char dbcode[16][0x10]={"OUTM", "OUTL","INPM","INPL",
- "STOR","LOAD","NOP ","STOP",};
-
-static char dbkey[8][0x10]={"ST0", "ST1","ST2","ST3",
- "UNDEF","REG","SYS","DEV"};
-static char dbcond[4][0x10]={"NEV","C=1", "C=0", "ALL"};
-char fwohcicode[32][0x20]={
- "No stat","Undef","long","miss Ack err",
- "FIFO underrun","FIFO overrun","desc err", "data read err",
- "data write err","bus reset","timeout","tcode err",
- "Undef","Undef","unknown event","flushed",
- "Undef","ack complete","ack pend","Undef",
- "ack busy_X","ack busy_A","ack busy_B","Undef",
- "Undef","Undef","Undef","ack tardy",
- "Undef","ack data_err","ack type_err",""};
+static char dbcode[16][0x10] = {"OUTM", "OUTL", "INPM", "INPL",
+ "STOR", "LOAD", "NOP ", "STOP",};
+
+static char dbkey[8][0x10] = {"ST0", "ST1", "ST2", "ST3",
+ "UNDEF", "REG", "SYS", "DEV"};
+static char dbcond[4][0x10] = {"NEV", "C=1", "C=0", "ALL"};
+char fwohcicode[32][0x20]= {
+ "No stat", "Undef", "long", "miss Ack err",
+ "FIFO underrun", "FIFO overrun", "desc err", "data read err",
+ "data write err", "bus reset", "timeout", "tcode err",
+ "Undef", "Undef", "unknown event", "flushed",
+ "Undef" ,"ack complete", "ack pend", "Undef",
+ "ack busy_X", "ack busy_A", "ack busy_B", "Undef",
+ "Undef", "Undef", "Undef", "ack tardy",
+ "Undef", "ack data_err", "ack type_err", ""};
#define MAX_SPEED 3
extern char *linkspeed[];
-uint32_t tagbit[4] = { 1 << 28, 1 << 29, 1 << 30, 1 << 31};
+uint32_t tagbit[4] = {1 << 28, 1 << 29, 1 << 30, 1 << 31};
static struct tcode_info tinfo[] = {
/* hdr_len block flag valid_response */
@@ -113,6 +106,13 @@ static struct tcode_info tinfo[] = {
/* f XXX */ { 0, 0, 0xff}
};
+#define ATRQ_CH 0
+#define ATRS_CH 1
+#define ARRQ_CH 2
+#define ARRS_CH 3
+#define ITX_CH 4
+#define IRX_CH 0x24
+
#define OHCI_WRITE_SIGMASK 0xffff0000
#define OHCI_READ_SIGMASK 0xffff0000
@@ -127,8 +127,8 @@ static void fwohci_txd (struct fwohci_softc *, struct fwohci_dbch *);
static void fwohci_start_atq (struct firewire_comm *);
static void fwohci_start_ats (struct firewire_comm *);
static void fwohci_start (struct fwohci_softc *, struct fwohci_dbch *);
-static uint32_t fwphy_wrdata ( struct fwohci_softc *, uint32_t, uint32_t);
-static uint32_t fwphy_rddata ( struct fwohci_softc *, uint32_t);
+static uint32_t fwphy_wrdata (struct fwohci_softc *, uint32_t, uint32_t);
+static uint32_t fwphy_rddata (struct fwohci_softc *, uint32_t);
static int fwohci_rx_enable (struct fwohci_softc *, struct fwohci_dbch *);
static int fwohci_tx_enable (struct fwohci_softc *, struct fwohci_dbch *);
static int fwohci_irx_enable (struct firewire_comm *, int);
@@ -143,9 +143,9 @@ static void fwohci_set_intr (struct firewire_comm *, int);
static int fwohci_add_rx_buf (struct fwohci_dbch *, struct fwohcidb_tr *, int, struct fwdma_alloc *);
static int fwohci_add_tx_buf (struct fwohci_dbch *, struct fwohcidb_tr *, int);
-static void dump_db (struct fwohci_softc *, uint32_t);
-static void print_db (struct fwohcidb_tr *, struct fwohcidb *, uint32_t , uint32_t);
-static void dump_dma (struct fwohci_softc *, uint32_t);
+static void dump_db (struct fwohci_softc *, uint32_t);
+static void print_db (struct fwohcidb_tr *, struct fwohcidb *, uint32_t , uint32_t);
+static void dump_dma (struct fwohci_softc *, uint32_t);
static uint32_t fwohci_cyctimer (struct firewire_comm *);
static void fwohci_rbuf_update (struct fwohci_softc *, int);
static void fwohci_tbuf_update (struct fwohci_softc *, int);
@@ -257,18 +257,19 @@ d_ioctl_t fwohci_ioctl;
*/
/* XXX need lock for phy access */
static uint32_t
-fwphy_wrdata( struct fwohci_softc *sc, uint32_t addr, uint32_t data)
+fwphy_wrdata(struct fwohci_softc *sc, uint32_t addr, uint32_t data)
{
uint32_t fun;
addr &= 0xf;
data &= 0xff;
- fun = (PHYDEV_WRCMD | (addr << PHYDEV_REGADDR) | (data << PHYDEV_WRDATA));
+ fun = (PHYDEV_WRCMD | (addr << PHYDEV_REGADDR) |
+ (data << PHYDEV_WRDATA));
OWRITE(sc, OHCI_PHYACCESS, fun);
DELAY(100);
- return(fwphy_rddata( sc, addr));
+ return (fwphy_rddata(sc, addr));
}
static uint32_t
@@ -289,17 +290,16 @@ fwohci_set_bus_manager(struct firewire_comm *fc, u_int node)
for (i = 0; !(OREAD(sc, OHCI_CSR_CONT) & (1<<31)) && (i < 1000); i++)
DELAY(10);
bm = OREAD(sc, OHCI_CSR_DATA);
- if((bm & 0x3f) == 0x3f)
+ if ((bm & 0x3f) == 0x3f)
bm = node;
if (firewire_debug)
device_printf(sc->fc.dev, "%s: %d->%d (loop=%d)\n",
__func__, bm, node, i);
-
- return(bm);
+ return (bm);
}
static uint32_t
-fwphy_rddata(struct fwohci_softc *sc, u_int addr)
+fwphy_rddata(struct fwohci_softc *sc, u_int addr)
{
uint32_t fun, stat;
u_int i, retry = 0;
@@ -310,13 +310,13 @@ again:
OWRITE(sc, FWOHCI_INTSTATCLR, OHCI_INT_REG_FAIL);
fun = PHYDEV_RDCMD | (addr << PHYDEV_REGADDR);
OWRITE(sc, OHCI_PHYACCESS, fun);
- for ( i = 0 ; i < MAX_RETRY ; i ++ ){
+ for (i = 0; i < MAX_RETRY; i++) {
fun = OREAD(sc, OHCI_PHYACCESS);
if ((fun & PHYDEV_RDCMD) == 0 && (fun & PHYDEV_RDDONE) != 0)
break;
DELAY(100);
}
- if(i >= MAX_RETRY) {
+ if (i >= MAX_RETRY) {
if (firewire_debug)
device_printf(sc->fc.dev, "%s: failed(1).\n", __func__);
if (++retry < MAX_RETRY) {
@@ -336,12 +336,13 @@ again:
}
}
if (firewire_debug > 1 || retry >= MAX_RETRY)
- device_printf(sc->fc.dev,
+ device_printf(sc->fc.dev,
"%s:: 0x%x loop=%d, retry=%d\n",
__func__, addr, i, retry);
#undef MAX_RETRY
- return((fun >> PHYDEV_RDDATA )& 0xff);
+ return ((fun >> PHYDEV_RDDATA) & 0xff);
}
+
/* Device specific ioctl. */
int
fwohci_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
@@ -350,41 +351,41 @@ fwohci_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
struct fwohci_softc *fc;
int unit = DEV2UNIT(dev);
int err = 0;
- struct fw_reg_req_t *reg = (struct fw_reg_req_t *) data;
+ struct fw_reg_req_t *reg = (struct fw_reg_req_t *) data;
uint32_t *dmach = (uint32_t *) data;
sc = devclass_get_softc(firewire_devclass, unit);
- if(sc == NULL){
- return(EINVAL);
- }
+ if (sc == NULL)
+ return (EINVAL);
+
fc = (struct fwohci_softc *)sc->fc;
if (!data)
- return(EINVAL);
+ return (EINVAL);
switch (cmd) {
case FWOHCI_WRREG:
#define OHCI_MAX_REG 0x800
- if(reg->addr <= OHCI_MAX_REG){
+ if (reg->addr <= OHCI_MAX_REG) {
OWRITE(fc, reg->addr, reg->data);
reg->data = OREAD(fc, reg->addr);
- }else{
+ } else {
err = EINVAL;
}
break;
case FWOHCI_RDREG:
- if(reg->addr <= OHCI_MAX_REG){
+ if (reg->addr <= OHCI_MAX_REG) {
reg->data = OREAD(fc, reg->addr);
- }else{
+ } else {
err = EINVAL;
}
break;
/* Read DMA descriptors for debug */
case DUMPDMA:
- if(*dmach <= OHCI_MAX_DMA_CH ){
+ if (*dmach <= OHCI_MAX_DMA_CH) {
dump_dma(fc, *dmach);
dump_db(fc, *dmach);
- }else{
+ } else {
err = EINVAL;
}
break;
@@ -414,19 +415,20 @@ fwohci_probe_phy(struct fwohci_softc *sc, device_t dev)
{
uint32_t reg, reg2;
int e1394a = 1;
-/*
- * probe PHY parameters
- * 0. to prove PHY version, whether compliance of 1394a.
- * 1. to probe maximum speed supported by the PHY and
- * number of port supported by core-logic.
- * It is not actually available port on your PC .
- */
+
+ /*
+ * probe PHY parameters
+ * 0. to prove PHY version, whether compliance of 1394a.
+ * 1. to probe maximum speed supported by the PHY and
+ * number of port supported by core-logic.
+ * It is not actually available port on your PC .
+ */
OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LPS);
DELAY(500);
reg = fwphy_rddata(sc, FW_PHY_SPD_REG);
- if((reg >> 5) != 7 ){
+ if ((reg >> 5) != 7) {
sc->fc.mode &= ~FWPHYASYST;
sc->fc.nport = reg & FW_PHY_NP;
sc->fc.speed = reg & FW_PHY_SPD >> 6;
@@ -438,7 +440,7 @@ fwohci_probe_phy(struct fwohci_softc *sc, device_t dev)
device_printf(dev,
"Phy 1394 only %s, %d ports.\n",
linkspeed[sc->fc.speed], sc->fc.nport);
- }else{
+ } else {
reg2 = fwphy_rddata(sc, FW_PHY_ESPD_REG);
sc->fc.mode |= FWPHYASYST;
sc->fc.nport = reg & FW_PHY_NP;
@@ -475,7 +477,7 @@ fwohci_probe_phy(struct fwohci_softc *sc, device_t dev)
}
reg = fwphy_rddata(sc, FW_PHY_SPD_REG);
- if((reg >> 5) == 7 ){
+ if ((reg >> 5) == 7) {
reg = fwphy_rddata(sc, 4);
reg |= 1 << 6;
fwphy_wrdata(sc, 4, reg);
@@ -492,19 +494,19 @@ fwohci_reset(struct fwohci_softc *sc, device_t dev)
uint32_t reg, reg2;
struct fwohcidb_tr *db_tr;
- /* Disable interrupts */
+ /* Disable interrupts */
OWRITE(sc, FWOHCI_INTMASKCLR, ~0);
/* Now stopping all DMA channels */
- OWRITE(sc, OHCI_ARQCTLCLR, OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_ARSCTLCLR, OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_ATQCTLCLR, OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_ATSCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ARQCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ARSCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ATQCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ATSCTLCLR, OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_IR_MASKCLR, ~0);
- for( i = 0 ; i < sc->fc.nisodma ; i ++ ){
- OWRITE(sc, OHCI_IRCTLCLR(i), OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_ITCTLCLR(i), OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_IR_MASKCLR, ~0);
+ for (i = 0; i < sc->fc.nisodma; i++) {
+ OWRITE(sc, OHCI_IRCTLCLR(i), OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ITCTLCLR(i), OHCI_CNTL_DMA_RUN);
}
/* FLUSH FIFO and reset Transmitter/Reciever */
@@ -512,7 +514,7 @@ fwohci_reset(struct fwohci_softc *sc, device_t dev)
if (firewire_debug)
device_printf(dev, "resetting OHCI...");
i = 0;
- while(OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_RESET) {
+ while (OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_RESET) {
if (i++ > 100) break;
DELAY(1000);
}
@@ -523,7 +525,7 @@ fwohci_reset(struct fwohci_softc *sc, device_t dev)
fwohci_probe_phy(sc, dev);
/* Probe link */
- reg = OREAD(sc, OHCI_BUS_OPT);
+ reg = OREAD(sc, OHCI_BUS_OPT);
reg2 = reg | OHCI_BUSFNC;
max_rec = (reg & 0x0000f000) >> 12;
speed = (reg & 0x00000007);
@@ -538,7 +540,7 @@ fwohci_reset(struct fwohci_softc *sc, device_t dev)
}
if (firewire_debug)
device_printf(dev, "BUS_OPT 0x%x -> 0x%x\n", reg, reg2);
- OWRITE(sc, OHCI_BUS_OPT, reg2);
+ OWRITE(sc, OHCI_BUS_OPT, reg2);
/* Initialize registers */
OWRITE(sc, OHCI_CROMHDR, sc->fc.config_rom[0]);
@@ -564,33 +566,31 @@ fwohci_reset(struct fwohci_softc *sc, device_t dev)
/* AT Retries */
OWRITE(sc, FWOHCI_RETRY,
/* CycleLimit PhyRespRetries ATRespRetries ATReqRetries */
- (0xffff << 16 ) | (0x0f << 8) | (0x0f << 4) | 0x0f) ;
+ (0xffff << 16) | (0x0f << 8) | (0x0f << 4) | 0x0f);
sc->atrq.top = STAILQ_FIRST(&sc->atrq.db_trq);
sc->atrs.top = STAILQ_FIRST(&sc->atrs.db_trq);
sc->atrq.bottom = sc->atrq.top;
sc->atrs.bottom = sc->atrs.top;
- for( i = 0, db_tr = sc->atrq.top; i < sc->atrq.ndb ;
- i ++, db_tr = STAILQ_NEXT(db_tr, link)){
+ for (i = 0, db_tr = sc->atrq.top; i < sc->atrq.ndb;
+ i++, db_tr = STAILQ_NEXT(db_tr, link)) {
db_tr->xfer = NULL;
}
- for( i = 0, db_tr = sc->atrs.top; i < sc->atrs.ndb ;
- i ++, db_tr = STAILQ_NEXT(db_tr, link)){
+ for (i = 0, db_tr = sc->atrs.top; i < sc->atrs.ndb;
+ i++, db_tr = STAILQ_NEXT(db_tr, link)) {
db_tr->xfer = NULL;
}
-
/* Enable interrupts */
sc->intmask = (OHCI_INT_ERR | OHCI_INT_PHY_SID
- | OHCI_INT_DMA_ATRQ | OHCI_INT_DMA_ATRS
+ | OHCI_INT_DMA_ATRQ | OHCI_INT_DMA_ATRS
| OHCI_INT_DMA_PRRQ | OHCI_INT_DMA_PRRS
| OHCI_INT_PHY_BUS_R | OHCI_INT_PW_ERR);
sc->intmask |= OHCI_INT_DMA_IR | OHCI_INT_DMA_IT;
sc->intmask |= OHCI_INT_CYC_LOST | OHCI_INT_PHY_INT;
OWRITE(sc, FWOHCI_INTMASK, sc->intmask);
fwohci_set_intr(&sc->fc, 1);
-
}
int
@@ -604,7 +604,7 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
reg = OREAD(sc, OHCI_VERSION);
mver = (reg >> 16) & 0xff;
device_printf(dev, "OHCI version %x.%x (ROM=%d)\n",
- mver, reg & 0xff, (reg>>24) & 1);
+ mver, reg & 0xff, (reg >> 24) & 1);
if (mver < 1 || mver > 9) {
device_printf(dev, "invalid OHCI version\n");
return (ENXIO);
@@ -659,7 +659,7 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
sc->atrq.ndb = NDB;
sc->atrs.ndb = NDB / 2;
- for( i = 0 ; i < sc->fc.nisodma ; i ++ ){
+ for (i = 0; i < sc->fc.nisodma; i++) {
sc->fc.it[i] = &sc->it[i].xferq;
sc->fc.ir[i] = &sc->ir[i].xferq;
sc->it[i].xferq.dmach = i;
@@ -673,7 +673,7 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
sc->fc.config_rom = fwdma_malloc(&sc->fc, CROMSIZE, CROMSIZE,
&sc->crom_dma, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
- if(sc->fc.config_rom == NULL){
+ if (sc->fc.config_rom == NULL) {
device_printf(dev, "config_rom alloc failed.");
return ENOMEM;
}
@@ -690,7 +690,6 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
sc->fc.config_rom[0] |= fw_crc16(&sc->fc.config_rom[1], 5*4);
#endif
-
/* SID recieve buffer must align 2^11 */
#define OHCI_SIDSIZE (1 << 11)
sc->sid_buf = fwdma_malloc(&sc->fc, OHCI_SIDSIZE, OHCI_SIDSIZE,
@@ -701,7 +700,7 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
}
fwdma_malloc(&sc->fc, sizeof(uint32_t), sizeof(uint32_t),
- &sc->dummy_dma, BUS_DMA_WAITOK);
+ &sc->dummy_dma, BUS_DMA_WAITOK);
if (sc->dummy_dma.v_addr == NULL) {
device_printf(dev, "dummy_dma alloc failed.");
@@ -726,7 +725,7 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
sc->fc.eui.hi = OREAD(sc, FWOHCIGUID_H);
sc->fc.eui.lo = OREAD(sc, FWOHCIGUID_L);
- for( i = 0 ; i < 8 ; i ++)
+ for (i = 0; i < 8; i++)
ui[i] = FW_EUI64_BYTE(&sc->fc.eui,i);
device_printf(dev, "EUI64 %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
ui[0], ui[1], ui[2], ui[3], ui[4], ui[5], ui[6], ui[7]);
@@ -756,7 +755,7 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
sc->fc.taskqueue = taskqueue_create_fast("fw_taskq", M_WAITOK,
taskqueue_thread_enqueue, &sc->fc.taskqueue);
taskqueue_start_threads(&sc->fc.taskqueue, 1, PI_NET, "fw%d_taskq",
- device_get_unit(dev));
+ device_get_unit(dev));
TASK_INIT(&sc->fwohci_task_busreset, 2, fwohci_task_busreset, sc);
TASK_INIT(&sc->fwohci_task_sid, 1, fwohci_task_sid, sc);
TASK_INIT(&sc->fwohci_task_dma, 0, fwohci_task_dma, sc);
@@ -779,7 +778,7 @@ uint32_t
fwohci_cyctimer(struct firewire_comm *fc)
{
struct fwohci_softc *sc = (struct fwohci_softc *)fc;
- return(OREAD(sc, OHCI_CYCLETIMER));
+ return (OREAD(sc, OHCI_CYCLETIMER));
}
int
@@ -798,7 +797,7 @@ fwohci_detach(struct fwohci_softc *sc, device_t dev)
fwohci_db_free(&sc->atrq);
fwohci_db_free(&sc->atrs);
- for( i = 0 ; i < sc->fc.nisodma ; i ++ ){
+ for (i = 0; i < sc->fc.nisodma; i++) {
fwohci_db_free(&sc->it[i]);
fwohci_db_free(&sc->ir[i]);
}
@@ -819,7 +818,7 @@ fwohci_detach(struct fwohci_softc *sc, device_t dev)
int _cnt = _dbtr->dbcnt; \
db = &_dbtr->db[ (_cnt > 2) ? (_cnt -1) : 0]; \
} while (0)
-
+
static void
fwohci_execute_db(void *arg, bus_dma_segment_t *segs, int nseg, int error)
{
@@ -847,7 +846,7 @@ fwohci_execute_db(void *arg, bus_dma_segment_t *segs, int nseg, int error)
static void
fwohci_execute_db2(void *arg, bus_dma_segment_t *segs, int nseg,
- bus_size_t size, int error)
+ bus_size_t size, int error)
{
fwohci_execute_db(arg, segs, nseg, error);
}
@@ -870,11 +869,11 @@ fwohci_start(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
FW_GLOCK_ASSERT(&sc->fc);
- if(&sc->atrq == dbch){
+ if (&sc->atrq == dbch) {
off = OHCI_ATQOFF;
- }else if(&sc->atrs == dbch){
+ } else if (&sc->atrs == dbch) {
off = OHCI_ATSOFF;
- }else{
+ } else {
return;
}
@@ -885,11 +884,11 @@ fwohci_start(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
db_tr = dbch->top;
txloop:
xfer = STAILQ_FIRST(&dbch->xferq.q);
- if(xfer == NULL){
+ if (xfer == NULL) {
goto kick;
}
#if 0
- if(dbch->xferq.queued == 0 ){
+ if (dbch->xferq.queued == 0) {
device_printf(sc->fc.dev, "TX queue empty\n");
}
#endif
@@ -906,11 +905,11 @@ txloop:
ld = &ohcifp->mode.ld[0];
ld[0] = ld[1] = ld[2] = ld[3] = 0;
- for( i = 0 ; i < pl_off ; i+= 4)
+ for (i = 0; i < pl_off; i+= 4)
ld[i/4] = fp->mode.ld[i/4];
ohcifp->mode.common.spd = xfer->send.spd & 0x7;
- if (tcode == FWTCODE_STREAM ){
+ if (tcode == FWTCODE_STREAM) {
hdr_len = 8;
ohcifp->mode.stream.len = fp->mode.stream.len;
} else if (tcode == FWTCODE_PHY) {
@@ -930,14 +929,14 @@ txloop:
FWOHCI_DMA_WRITE(db->db.desc.addr, 0);
FWOHCI_DMA_WRITE(db->db.desc.res, 0);
/* Specify bound timer of asy. responce */
- if(&sc->atrs == dbch){
+ if (&sc->atrs == dbch) {
FWOHCI_DMA_WRITE(db->db.desc.res,
(OREAD(sc, OHCI_CYCLETIMER) >> 12) + (1 << 13));
}
#if BYTE_ORDER == BIG_ENDIAN
if (tcode == FWTCODE_WREQQ || tcode == FWTCODE_RRESQ)
hdr_len = 12;
- for (i = 0; i < hdr_len/4; i ++)
+ for (i = 0; i < hdr_len/4; i++)
FWOHCI_DMA_WRITE(ld[i], ld[i]);
#endif
@@ -968,7 +967,7 @@ again:
m_copydata(xfer->mbuf, 0,
xfer->mbuf->m_pkthdr.len,
mtod(m0, caddr_t));
- m0->m_len = m0->m_pkthdr.len =
+ m0->m_len = m0->m_pkthdr.len =
xfer->mbuf->m_pkthdr.len;
m_freem(xfer->mbuf);
xfer->mbuf = m0;
@@ -999,16 +998,16 @@ again:
FWOHCI_DMA_WRITE(db->db.desc.depend,
STAILQ_NEXT(db_tr, link)->bus_addr);
- if(fsegment == -1 )
+ if (fsegment == -1)
fsegment = db_tr->dbcnt;
if (dbch->pdb_tr != NULL) {
LAST_DB(dbch->pdb_tr, db);
FWOHCI_DMA_SET(db->db.desc.depend, db_tr->dbcnt);
}
- dbch->xferq.queued ++;
+ dbch->xferq.queued++;
dbch->pdb_tr = db_tr;
db_tr = STAILQ_NEXT(db_tr, link);
- if(db_tr != dbch->bottom){
+ if (db_tr != dbch->bottom) {
goto txloop;
} else {
device_printf(sc->fc.dev, "fwohci_start: lack of db_trq\n");
@@ -1019,7 +1018,7 @@ kick:
fwdma_sync_multiseg_all(dbch->am, BUS_DMASYNC_PREREAD);
fwdma_sync_multiseg_all(dbch->am, BUS_DMASYNC_PREWRITE);
- if(dbch->xferq.flag & FWXFERQ_RUNNING) {
+ if (dbch->xferq.flag & FWXFERQ_RUNNING) {
OWRITE(sc, OHCI_DMACTL(off), OHCI_CNTL_DMA_WAKE);
} else {
if (firewire_debug)
@@ -1040,7 +1039,7 @@ fwohci_start_atq(struct firewire_comm *fc)
{
struct fwohci_softc *sc = (struct fwohci_softc *)fc;
FW_GLOCK(&sc->fc);
- fwohci_start( sc, &(sc->atrq));
+ fwohci_start(sc, &(sc->atrq));
FW_GUNLOCK(&sc->fc);
return;
}
@@ -1050,7 +1049,7 @@ fwohci_start_ats(struct firewire_comm *fc)
{
struct fwohci_softc *sc = (struct fwohci_softc *)fc;
FW_GLOCK(&sc->fc);
- fwohci_start( sc, &(sc->atrs));
+ fwohci_start(sc, &(sc->atrs));
FW_GUNLOCK(&sc->fc);
return;
}
@@ -1067,13 +1066,13 @@ fwohci_txd(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
int packets;
struct firewire_comm *fc = (struct firewire_comm *)sc;
- if(&sc->atrq == dbch){
+ if (&sc->atrq == dbch) {
off = OHCI_ATQOFF;
ch = ATRQ_CH;
- }else if(&sc->atrs == dbch){
+ } else if (&sc->atrs == dbch) {
off = OHCI_ATSOFF;
ch = ATRS_CH;
- }else{
+ } else {
return;
}
s = splfw();
@@ -1081,11 +1080,11 @@ fwohci_txd(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
packets = 0;
fwdma_sync_multiseg_all(dbch->am, BUS_DMASYNC_POSTREAD);
fwdma_sync_multiseg_all(dbch->am, BUS_DMASYNC_POSTWRITE);
- while(dbch->xferq.queued > 0){
+ while (dbch->xferq.queued > 0) {
LAST_DB(tr, db);
status = FWOHCI_DMA_READ(db->db.desc.res) >> OHCI_STATUS_SHIFT;
- if(!(status & OHCI_CNTL_DMA_ACTIVE)){
- if (fc->status != FWBUSINIT)
+ if (!(status & OHCI_CNTL_DMA_ACTIVE)) {
+ if (fc->status != FWBUSINIT)
/* maybe out of order?? */
goto out;
}
@@ -1096,7 +1095,7 @@ fwohci_txd(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
if (firewire_debug > 1)
dump_db(sc, ch);
#endif
- if(status & OHCI_CNTL_DMA_DEAD) {
+ if (status & OHCI_CNTL_DMA_DEAD) {
/* Stop DMA */
OWRITE(sc, OHCI_DMACTLCLR(off), OHCI_CNTL_DMA_RUN);
device_printf(sc->fc.dev, "force reset AT FIFO\n");
@@ -1105,7 +1104,7 @@ fwohci_txd(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
OWRITE(sc, OHCI_DMACTLCLR(off), OHCI_CNTL_DMA_RUN);
}
stat = status & FWOHCIEV_MASK;
- switch(stat){
+ switch (stat) {
case FWOHCIEV_ACKPEND:
case FWOHCIEV_ACKCOMPL:
err = 0;
@@ -1159,17 +1158,17 @@ fwohci_txd(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
}
/*
* The watchdog timer takes care of split
- * transcation timeout for ACKPEND case.
+ * transaction timeout for ACKPEND case.
*/
} else {
printf("this shouldn't happen\n");
}
FW_GLOCK(fc);
- dbch->xferq.queued --;
+ dbch->xferq.queued--;
FW_GUNLOCK(fc);
tr->xfer = NULL;
- packets ++;
+ packets++;
tr = STAILQ_NEXT(tr, link);
dbch->bottom = tr;
if (dbch->bottom == dbch->top) {
@@ -1199,10 +1198,10 @@ fwohci_db_free(struct fwohci_dbch *dbch)
if ((dbch->flags & FWOHCI_DBCH_INIT) == 0)
return;
- for(db_tr = STAILQ_FIRST(&dbch->db_trq), idb = 0; idb < dbch->ndb;
- db_tr = STAILQ_NEXT(db_tr, link), idb++){
+ for (db_tr = STAILQ_FIRST(&dbch->db_trq), idb = 0; idb < dbch->ndb;
+ db_tr = STAILQ_NEXT(db_tr, link), idb++) {
if ((dbch->xferq.flag & FWXFERQ_EXTBUF) == 0 &&
- db_tr->buf != NULL) {
+ db_tr->buf != NULL) {
fwdma_free_size(dbch->dmat, db_tr->dma_map,
db_tr->buf, dbch->xferq.psize);
db_tr->buf = NULL;
@@ -1237,10 +1236,8 @@ fwohci_db_init(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
/*nsegments*/ dbch->ndesc > 3 ? dbch->ndesc - 2 : 1,
/*maxsegsz*/ MAX_REQCOUNT,
/*flags*/ 0,
-#if defined(__FreeBSD__) && __FreeBSD_version >= 501102
/*lockfunc*/busdma_lock_mutex,
/*lockarg*/FW_GMTX(&sc->fc),
-#endif
&dbch->dmat))
return;
@@ -1250,13 +1247,13 @@ fwohci_db_init(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
db_tr = (struct fwohcidb_tr *)
malloc(sizeof(struct fwohcidb_tr) * dbch->ndb,
M_FW, M_WAITOK | M_ZERO);
- if(db_tr == NULL){
+ if (db_tr == NULL) {
printf("fwohci_db_init: malloc(1) failed\n");
return;
}
#define DB_SIZE(x) (sizeof(struct fwohcidb) * (x)->ndesc)
- dbch->am = fwdma_malloc_multiseg(&sc->fc, DB_SIZE(dbch),
+ dbch->am = fwdma_malloc_multiseg(&sc->fc, sizeof(struct fwohcidb),
DB_SIZE(dbch), dbch->ndb, BUS_DMA_WAITOK);
if (dbch->am == NULL) {
printf("fwohci_db_init: fwdma_malloc_multiseg failed\n");
@@ -1264,7 +1261,7 @@ fwohci_db_init(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
return;
}
/* Attach DB to DMA ch. */
- for(idb = 0 ; idb < dbch->ndb ; idb++){
+ for (idb = 0; idb < dbch->ndb; idb++) {
db_tr->dbcnt = 0;
db_tr->db = (struct fwohcidb *)fwdma_v_addr(dbch->am, idb);
db_tr->bus_addr = fwdma_bus_addr(dbch->am, idb);
@@ -1303,7 +1300,7 @@ fwohci_itx_disable(struct firewire_comm *fc, int dmach)
{
struct fwohci_softc *sc = (struct fwohci_softc *)fc;
- OWRITE(sc, OHCI_ITCTLCLR(dmach),
+ OWRITE(sc, OHCI_ITCTLCLR(dmach),
OHCI_CNTL_DMA_RUN | OHCI_CNTL_CYCMATCH_S);
OWRITE(sc, OHCI_IT_MASKCLR, 1 << dmach);
OWRITE(sc, OHCI_IT_STATCLR, 1 << dmach);
@@ -1347,31 +1344,31 @@ fwohci_tx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
struct fwohcidb_tr *db_tr;
struct fwohcidb *db;
- if(!(dbch->xferq.flag & FWXFERQ_EXTBUF)){
+ if (!(dbch->xferq.flag & FWXFERQ_EXTBUF)) {
err = EINVAL;
return err;
}
z = dbch->ndesc;
- for(dmach = 0 ; dmach < sc->fc.nisodma ; dmach++){
- if( &sc->it[dmach] == dbch){
+ for (dmach = 0; dmach < sc->fc.nisodma; dmach++) {
+ if (&sc->it[dmach] == dbch) {
off = OHCI_ITOFF(dmach);
break;
}
}
- if(off == 0){
+ if (off == 0) {
err = EINVAL;
return err;
}
- if(dbch->xferq.flag & FWXFERQ_RUNNING)
+ if (dbch->xferq.flag & FWXFERQ_RUNNING)
return err;
dbch->xferq.flag |= FWXFERQ_RUNNING;
- for( i = 0, dbch->bottom = dbch->top; i < (dbch->ndb - 1); i++){
+ for (i = 0, dbch->bottom = dbch->top; i < (dbch->ndb - 1); i++) {
dbch->bottom = STAILQ_NEXT(dbch->bottom, link);
}
db_tr = dbch->top;
- for (idb = 0; idb < dbch->ndb; idb ++) {
+ for (idb = 0; idb < dbch->ndb; idb++) {
fwohci_add_tx_buf(dbch, db_tr, idb);
- if(STAILQ_NEXT(db_tr, link) == NULL){
+ if (STAILQ_NEXT(db_tr, link) == NULL) {
break;
}
db = db_tr->db;
@@ -1379,8 +1376,8 @@ fwohci_tx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
FWOHCI_DMA_WRITE(db[0].db.desc.depend,
STAILQ_NEXT(db_tr, link)->bus_addr | z);
db[ldesc].db.desc.depend = db[0].db.desc.depend;
- if(dbch->xferq.flag & FWXFERQ_EXTBUF){
- if(((idb + 1 ) % dbch->xferq.bnpacket) == 0){
+ if (dbch->xferq.flag & FWXFERQ_EXTBUF) {
+ if (((idb + 1) % dbch->xferq.bnpacket) == 0) {
FWOHCI_DMA_SET(
db[ldesc].db.desc.cmd,
OHCI_INTERRUPT_ALWAYS);
@@ -1407,38 +1404,38 @@ fwohci_rx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
struct fwohcidb *db;
z = dbch->ndesc;
- if(&sc->arrq == dbch){
+ if (&sc->arrq == dbch) {
off = OHCI_ARQOFF;
- }else if(&sc->arrs == dbch){
+ } else if (&sc->arrs == dbch) {
off = OHCI_ARSOFF;
- }else{
- for(dmach = 0 ; dmach < sc->fc.nisodma ; dmach++){
- if( &sc->ir[dmach] == dbch){
+ } else {
+ for (dmach = 0; dmach < sc->fc.nisodma; dmach++) {
+ if (&sc->ir[dmach] == dbch) {
off = OHCI_IROFF(dmach);
break;
}
}
}
- if(off == 0){
+ if (off == 0) {
err = EINVAL;
return err;
}
- if(dbch->xferq.flag & FWXFERQ_STREAM){
- if(dbch->xferq.flag & FWXFERQ_RUNNING)
+ if (dbch->xferq.flag & FWXFERQ_STREAM) {
+ if (dbch->xferq.flag & FWXFERQ_RUNNING)
return err;
- }else{
- if(dbch->xferq.flag & FWXFERQ_RUNNING){
+ } else {
+ if (dbch->xferq.flag & FWXFERQ_RUNNING) {
err = EBUSY;
return err;
}
}
dbch->xferq.flag |= FWXFERQ_RUNNING;
dbch->top = STAILQ_FIRST(&dbch->db_trq);
- for( i = 0, dbch->bottom = dbch->top; i < (dbch->ndb - 1); i++){
+ for (i = 0, dbch->bottom = dbch->top; i < (dbch->ndb - 1); i++) {
dbch->bottom = STAILQ_NEXT(dbch->bottom, link);
}
db_tr = dbch->top;
- for (idb = 0; idb < dbch->ndb; idb ++) {
+ for (idb = 0; idb < dbch->ndb; idb++) {
fwohci_add_rx_buf(dbch, db_tr, idb, &sc->dummy_dma);
if (STAILQ_NEXT(db_tr, link) == NULL)
break;
@@ -1446,8 +1443,8 @@ fwohci_rx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
ldesc = db_tr->dbcnt - 1;
FWOHCI_DMA_WRITE(db[ldesc].db.desc.depend,
STAILQ_NEXT(db_tr, link)->bus_addr | z);
- if(dbch->xferq.flag & FWXFERQ_EXTBUF){
- if(((idb + 1 ) % dbch->xferq.bnpacket) == 0){
+ if (dbch->xferq.flag & FWXFERQ_EXTBUF) {
+ if (((idb + 1) % dbch->xferq.bnpacket) == 0) {
FWOHCI_DMA_SET(
db[ldesc].db.desc.cmd,
OHCI_INTERRUPT_ALWAYS);
@@ -1463,9 +1460,9 @@ fwohci_rx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
dbch->buf_offset = 0;
fwdma_sync_multiseg_all(dbch->am, BUS_DMASYNC_PREREAD);
fwdma_sync_multiseg_all(dbch->am, BUS_DMASYNC_PREWRITE);
- if(dbch->xferq.flag & FWXFERQ_STREAM){
+ if (dbch->xferq.flag & FWXFERQ_STREAM) {
return err;
- }else{
+ } else {
OWRITE(sc, OHCI_DMACMD(off), dbch->top->bus_addr | z);
}
OWRITE(sc, OHCI_DMACTL(off), OHCI_CNTL_DMA_RUN);
@@ -1487,12 +1484,12 @@ fwohci_next_cycle(struct firewire_comm *fc, int cycle_now)
#endif
cycle = cycle + CYCLE_DELAY;
if (cycle >= 8000) {
- sec ++;
+ sec++;
cycle -= 8000;
}
cycle = roundup2(cycle, CYCLE_MOD);
if (cycle >= 8000) {
- sec ++;
+ sec++;
if (cycle == 8000)
cycle = 0;
else
@@ -1500,7 +1497,7 @@ fwohci_next_cycle(struct firewire_comm *fc, int cycle_now)
}
cycle_match = ((sec << 13) | cycle) & 0x7ffff;
- return(cycle_match);
+ return (cycle_match);
}
static int
@@ -1529,7 +1526,7 @@ fwohci_itxbuf_enable(struct firewire_comm *fc, int dmach)
err = fwohci_tx_enable(sc, dbch);
}
- if(err)
+ if (err)
return err;
ldesc = dbch->ndesc - 1;
@@ -1549,7 +1546,7 @@ fwohci_itxbuf_enable(struct firewire_comm *fc, int dmach)
OHCI_BRANCH_ALWAYS);
#endif
#if 0 /* if bulkxfer->npacket changes */
- db[ldesc].db.desc.depend = db[0].db.desc.depend =
+ db[ldesc].db.desc.depend = db[0].db.desc.depend =
((struct fwohcidb_tr *)
(chunk->start))->bus_addr | dbch->ndesc;
#else
@@ -1652,7 +1649,7 @@ fwohci_irx_enable(struct firewire_comm *fc, int dmach)
return ENOMEM;
err = fwohci_rx_enable(sc, dbch);
}
- if(err)
+ if (err)
return err;
first = STAILQ_FIRST(&ir->stfree);
@@ -1731,28 +1728,28 @@ fwohci_stop(struct fwohci_softc *sc, device_t dev)
fwohci_set_intr(&sc->fc, 0);
/* Now stopping all DMA channel */
- OWRITE(sc, OHCI_ARQCTLCLR, OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_ARSCTLCLR, OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_ATQCTLCLR, OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_ATSCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ARQCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ARSCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ATQCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ATSCTLCLR, OHCI_CNTL_DMA_RUN);
- for( i = 0 ; i < sc->fc.nisodma ; i ++ ){
- OWRITE(sc, OHCI_IRCTLCLR(i), OHCI_CNTL_DMA_RUN);
- OWRITE(sc, OHCI_ITCTLCLR(i), OHCI_CNTL_DMA_RUN);
+ for (i = 0; i < sc->fc.nisodma; i++) {
+ OWRITE(sc, OHCI_IRCTLCLR(i), OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ITCTLCLR(i), OHCI_CNTL_DMA_RUN);
}
-#if 0 /* Let dcons(4) be accessed */
+#if 0 /* Let dcons(4) be accessed */
/* Stop interrupt */
OWRITE(sc, FWOHCI_INTMASKCLR,
OHCI_INT_EN | OHCI_INT_ERR | OHCI_INT_PHY_SID
| OHCI_INT_PHY_INT
- | OHCI_INT_DMA_ATRQ | OHCI_INT_DMA_ATRS
+ | OHCI_INT_DMA_ATRQ | OHCI_INT_DMA_ATRS
| OHCI_INT_DMA_PRRQ | OHCI_INT_DMA_PRRS
- | OHCI_INT_DMA_ARRQ | OHCI_INT_DMA_ARRS
+ | OHCI_INT_DMA_ARRQ | OHCI_INT_DMA_ARRS
| OHCI_INT_PHY_BUS_R);
/* FLUSH FIFO and reset Transmitter/Reciever */
- OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET);
+ OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET);
#endif
/* XXX Link down? Bus reset? */
@@ -1768,14 +1765,14 @@ fwohci_resume(struct fwohci_softc *sc, device_t dev)
fwohci_reset(sc, dev);
/* XXX resume isochronous receive automatically. (how about TX?) */
- for(i = 0; i < sc->fc.nisodma; i ++) {
+ for (i = 0; i < sc->fc.nisodma; i++) {
ir = &sc->ir[i].xferq;
- if((ir->flag & FWXFERQ_RUNNING) != 0) {
+ if ((ir->flag & FWXFERQ_RUNNING) != 0) {
device_printf(sc->fc.dev,
"resume iso receive ch: %d\n", i);
ir->flag &= ~FWXFERQ_RUNNING;
/* requeue stdma to stfree */
- while((chunk = STAILQ_FIRST(&ir->stdma)) != NULL) {
+ while ((chunk = STAILQ_FIRST(&ir->stdma)) != NULL) {
STAILQ_REMOVE_HEAD(&ir->stdma, link);
STAILQ_INSERT_TAIL(&ir->stfree, chunk, link);
}
@@ -1792,7 +1789,7 @@ fwohci_resume(struct fwohci_softc *sc, device_t dev)
static void
fwohci_dump_intr(struct fwohci_softc *sc, uint32_t stat)
{
- if(stat & OREAD(sc, FWOHCI_INTMASK))
+ if (stat & OREAD(sc, FWOHCI_INTMASK))
device_printf(fc->dev, "INTERRUPT < %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s> 0x%08x, 0x%08x\n",
stat & OHCI_INT_EN ? "DMA_EN ":"",
stat & OHCI_INT_PHY_REG ? "PHY_REG ":"",
@@ -1815,10 +1812,11 @@ fwohci_dump_intr(struct fwohci_softc *sc, uint32_t stat)
stat & OHCI_INT_DMA_ARRQ ? "DMA_ARRQ " :"",
stat & OHCI_INT_DMA_ATRS ? "DMA_ATRS " :"",
stat & OHCI_INT_DMA_ATRQ ? "DMA_ATRQ " :"",
- stat, OREAD(sc, FWOHCI_INTMASK)
+ stat, OREAD(sc, FWOHCI_INTMASK)
);
}
#endif
+
static void
fwohci_intr_core(struct fwohci_softc *sc, uint32_t stat, int count)
{
@@ -1829,15 +1827,15 @@ fwohci_intr_core(struct fwohci_softc *sc, uint32_t stat, int count)
if ((stat & OHCI_INT_PHY_BUS_R) && (fc->status != FWBUSRESET)) {
fc->status = FWBUSRESET;
/* Disable bus reset interrupt until sid recv. */
- OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_PHY_BUS_R);
-
+ OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_PHY_BUS_R);
+
device_printf(fc->dev, "%s: BUS reset\n", __func__);
- OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST);
+ OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST);
OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCSRC);
- OWRITE(sc, OHCI_ATQCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ATQCTLCLR, OHCI_CNTL_DMA_RUN);
sc->atrq.xferq.flag &= ~FWXFERQ_RUNNING;
- OWRITE(sc, OHCI_ATSCTLCLR, OHCI_CNTL_DMA_RUN);
+ OWRITE(sc, OHCI_ATSCTLCLR, OHCI_CNTL_DMA_RUN);
sc->atrs.xferq.flag &= ~FWXFERQ_RUNNING;
if (!kdb_active)
@@ -1858,10 +1856,10 @@ fwohci_intr_core(struct fwohci_softc *sc, uint32_t stat, int count)
OWRITE(sc, OHCI_PREQUPPER, 0x10000);
}
/* Set ATRetries register */
- OWRITE(sc, OHCI_ATRETRY, 1<<(13+16) | 0xfff);
+ OWRITE(sc, OHCI_ATRETRY, 1<<(13 + 16) | 0xfff);
/*
- * Checking whether the node is root or not. If root, turn on
+ * Checking whether the node is root or not. If root, turn on
* cycle master.
*/
node_id = OREAD(sc, FWOHCI_NODEID);
@@ -1878,7 +1876,7 @@ fwohci_intr_core(struct fwohci_softc *sc, uint32_t stat, int count)
/* cycle timer */
sc->cycle_lost = 0;
- OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_CYC_LOST);
+ OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_CYC_LOST);
if ((node_id & OHCI_NODE_ROOT) && !nocyclemaster) {
printf("CYCLEMASTER mode\n");
OWRITE(sc, OHCI_LNKCTL,
@@ -1908,10 +1906,10 @@ fwohci_intr_dma(struct fwohci_softc *sc, uint32_t stat, int count)
if (stat & OHCI_INT_DMA_IR) {
irstat = atomic_readandclear_int(&sc->irstat);
- for(i = 0; i < fc->nisodma ; i++){
+ for (i = 0; i < fc->nisodma; i++) {
struct fwohci_dbch *dbch;
- if((irstat & (1 << i)) != 0){
+ if ((irstat & (1 << i)) != 0) {
dbch = &sc->ir[i];
if ((dbch->xferq.flag & FWXFERQ_OPEN) == 0) {
device_printf(sc->fc.dev,
@@ -1924,8 +1922,8 @@ fwohci_intr_dma(struct fwohci_softc *sc, uint32_t stat, int count)
}
if (stat & OHCI_INT_DMA_IT) {
itstat = atomic_readandclear_int(&sc->itstat);
- for(i = 0; i < fc->nisodma ; i++){
- if((itstat & (1 << i)) != 0){
+ for (i = 0; i < fc->nisodma; i++) {
+ if ((itstat & (1 << i)) != 0) {
fwohci_tbuf_update(sc, i);
}
}
@@ -1946,13 +1944,13 @@ fwohci_intr_dma(struct fwohci_softc *sc, uint32_t stat, int count)
}
if (stat & OHCI_INT_CYC_LOST) {
if (sc->cycle_lost >= 0)
- sc->cycle_lost ++;
+ sc->cycle_lost++;
if (sc->cycle_lost > 10) {
sc->cycle_lost = -1;
#if 0
OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCTIMER);
#endif
- OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST);
+ OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST);
device_printf(fc->dev, "too many cycles lost, "
"no cycle master present?\n");
}
@@ -1972,8 +1970,6 @@ fwohci_intr_dma(struct fwohci_softc *sc, uint32_t stat, int count)
if (stat & OHCI_INT_PHY_INT) {
device_printf(fc->dev, "phy int\n");
}
-
- return;
}
static void
@@ -2018,8 +2014,8 @@ fwohci_task_sid(void *arg, int pending)
device_printf(fc->dev, "malloc failed\n");
return;
}
- for (i = 0; i < plen / 4; i ++)
- buf[i] = FWOHCI_DMA_READ(sc->sid_buf[i+1]);
+ for (i = 0; i < plen / 4; i++)
+ buf[i] = FWOHCI_DMA_READ(sc->sid_buf[i + 1]);
/* pending all pre-bus_reset packets */
fwohci_txd(sc, &sc->atrq);
@@ -2138,7 +2134,7 @@ fwohci_tbuf_update(struct fwohci_softc *sc, int dmach)
dump_db(sc, ITX_CH + dmach);
while ((chunk = STAILQ_FIRST(&it->stdma)) != NULL) {
db = ((struct fwohcidb_tr *)(chunk->end))->db;
- stat = FWOHCI_DMA_READ(db[ldesc].db.desc.res)
+ stat = FWOHCI_DMA_READ(db[ldesc].db.desc.res)
>> OHCI_STATUS_SHIFT;
db = ((struct fwohcidb_tr *)(chunk->start))->db;
/* timestamp */
@@ -2147,7 +2143,7 @@ fwohci_tbuf_update(struct fwohci_softc *sc, int dmach)
if (stat == 0)
break;
STAILQ_REMOVE_HEAD(&it->stdma, link);
- switch (stat & FWOHCIEV_MASK){
+ switch (stat & FWOHCIEV_MASK) {
case FWOHCIEV_ACKCOMPL:
#if 0
device_printf(fc->dev, "0x%08x\n", count);
@@ -2226,7 +2222,7 @@ fwohci_rbuf_update(struct fwohci_softc *sc, int dmach)
if (w == 0)
return;
- if (ir->flag & FWXFERQ_HANDLER)
+ if (ir->flag & FWXFERQ_HANDLER)
ir->hand(ir);
else
wakeup(ir);
@@ -2237,17 +2233,17 @@ dump_dma(struct fwohci_softc *sc, uint32_t ch)
{
uint32_t off, cntl, stat, cmd, match;
- if(ch == 0){
+ if (ch == 0) {
off = OHCI_ATQOFF;
- }else if(ch == 1){
+ } else if (ch == 1) {
off = OHCI_ATSOFF;
- }else if(ch == 2){
+ } else if (ch == 2) {
off = OHCI_ARQOFF;
- }else if(ch == 3){
+ } else if (ch == 3) {
off = OHCI_ARSOFF;
- }else if(ch < IRX_CH){
+ } else if (ch < IRX_CH) {
off = OHCI_ITCTL(ch - ITX_CH);
- }else{
+ } else {
off = OHCI_IRCTL(ch - IRX_CH);
}
cntl = stat = OREAD(sc, off);
@@ -2256,10 +2252,10 @@ dump_dma(struct fwohci_softc *sc, uint32_t ch)
device_printf(sc->fc.dev, "ch %1x cntl:0x%08x cmd:0x%08x match:0x%08x\n",
ch,
- cntl,
- cmd,
+ cntl,
+ cmd,
match);
- stat &= 0xffff ;
+ stat &= 0xffff;
if (stat) {
device_printf(sc->fc.dev, "dma %d ch:%s%s%s%s%s%s %s(%x)\n",
ch,
@@ -2272,7 +2268,7 @@ dump_dma(struct fwohci_softc *sc, uint32_t ch)
fwohcicode[stat & 0x1f],
stat & 0x1f
);
- }else{
+ } else {
device_printf(sc->fc.dev, "dma %d ch: Nostat\n", ch);
}
}
@@ -2285,60 +2281,61 @@ dump_db(struct fwohci_softc *sc, uint32_t ch)
struct fwohcidb *curr = NULL, *prev, *next = NULL;
int idb, jdb;
uint32_t cmd, off;
- if(ch == 0){
+
+ if (ch == 0) {
off = OHCI_ATQOFF;
dbch = &sc->atrq;
- }else if(ch == 1){
+ } else if (ch == 1) {
off = OHCI_ATSOFF;
dbch = &sc->atrs;
- }else if(ch == 2){
+ } else if (ch == 2) {
off = OHCI_ARQOFF;
dbch = &sc->arrq;
- }else if(ch == 3){
+ } else if (ch == 3) {
off = OHCI_ARSOFF;
dbch = &sc->arrs;
- }else if(ch < IRX_CH){
+ } else if (ch < IRX_CH) {
off = OHCI_ITCTL(ch - ITX_CH);
dbch = &sc->it[ch - ITX_CH];
- }else {
+ } else {
off = OHCI_IRCTL(ch - IRX_CH);
dbch = &sc->ir[ch - IRX_CH];
}
cmd = OREAD(sc, off + 0xc);
- if( dbch->ndb == 0 ){
+ if (dbch->ndb == 0) {
device_printf(sc->fc.dev, "No DB is attached ch=%d\n", ch);
return;
}
pp = dbch->top;
prev = pp->db;
- for(idb = 0 ; idb < dbch->ndb ; idb ++ ){
+ for (idb = 0; idb < dbch->ndb; idb++) {
cp = STAILQ_NEXT(pp, link);
- if(cp == NULL){
+ if (cp == NULL) {
curr = NULL;
goto outdb;
}
np = STAILQ_NEXT(cp, link);
- for(jdb = 0 ; jdb < dbch->ndesc ; jdb ++ ){
+ for (jdb = 0; jdb < dbch->ndesc; jdb++) {
if ((cmd & 0xfffffff0) == cp->bus_addr) {
curr = cp->db;
- if(np != NULL){
+ if (np != NULL) {
next = np->db;
- }else{
+ } else {
next = NULL;
}
goto outdb;
}
}
pp = STAILQ_NEXT(pp, link);
- if(pp == NULL){
+ if (pp == NULL) {
curr = NULL;
goto outdb;
}
prev = pp->db;
}
outdb:
- if( curr != NULL){
+ if (curr != NULL) {
#if 0
printf("Prev DB %d\n", ch);
print_db(pp, prev, ch, dbch->ndesc);
@@ -2349,7 +2346,7 @@ outdb:
printf("Next DB %d\n", ch);
print_db(np, next, ch, dbch->ndesc);
#endif
- }else{
+ } else {
printf("dbdump err ch = %d cmd = 0x%08x\n", ch, cmd);
}
return;
@@ -2363,7 +2360,7 @@ print_db(struct fwohcidb_tr *db_tr, struct fwohcidb *db,
int i, key;
uint32_t cmd, res;
- if(db == NULL){
+ if (db == NULL) {
printf("No Descriptor is found\n");
return;
}
@@ -2380,18 +2377,13 @@ print_db(struct fwohcidb_tr *db_tr, struct fwohcidb *db,
"Depend",
"Stat",
"Cnt");
- for( i = 0 ; i <= max ; i ++){
+ for (i = 0; i <= max; i++) {
cmd = FWOHCI_DMA_READ(db[i].db.desc.cmd);
res = FWOHCI_DMA_READ(db[i].db.desc.res);
key = cmd & OHCI_KEY_MASK;
stat = res >> OHCI_STATUS_SHIFT;
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
- printf("%08x %s %s %s %s %5d %08x %08x %04x:%04x",
- db_tr->bus_addr,
-#else
printf("%08jx %s %s %s %s %5d %08x %08x %04x:%04x",
(uintmax_t)db_tr->bus_addr,
-#endif
dbcode[(cmd >> 28) & 0xf],
dbkey[(cmd >> 24) & 0x7],
dbcond[(cmd >> 20) & 0x3],
@@ -2401,7 +2393,7 @@ print_db(struct fwohcidb_tr *db_tr, struct fwohcidb *db,
FWOHCI_DMA_READ(db[i].db.desc.depend),
stat,
res & OHCI_COUNT_MASK);
- if(stat & 0xff00){
+ if (stat & 0xff00) {
printf(" %s%s%s%s%s%s %s(%x)\n",
stat & OHCI_CNTL_DMA_RUN ? "RUN," : "",
stat & OHCI_CNTL_DMA_WAKE ? "WAKE," : "",
@@ -2412,32 +2404,32 @@ print_db(struct fwohcidb_tr *db_tr, struct fwohcidb *db,
fwohcicode[stat & 0x1f],
stat & 0x1f
);
- }else{
+ } else {
printf(" Nostat\n");
}
- if(key == OHCI_KEY_ST2 ){
- printf("0x%08x 0x%08x 0x%08x 0x%08x\n",
- FWOHCI_DMA_READ(db[i+1].db.immed[0]),
- FWOHCI_DMA_READ(db[i+1].db.immed[1]),
- FWOHCI_DMA_READ(db[i+1].db.immed[2]),
- FWOHCI_DMA_READ(db[i+1].db.immed[3]));
+ if (key == OHCI_KEY_ST2) {
+ printf("0x%08x 0x%08x 0x%08x 0x%08x\n",
+ FWOHCI_DMA_READ(db[i + 1].db.immed[0]),
+ FWOHCI_DMA_READ(db[i + 1].db.immed[1]),
+ FWOHCI_DMA_READ(db[i + 1].db.immed[2]),
+ FWOHCI_DMA_READ(db[i + 1].db.immed[3]));
}
- if(key == OHCI_KEY_DEVICE){
+ if (key == OHCI_KEY_DEVICE) {
return;
}
- if((cmd & OHCI_BRANCH_MASK)
- == OHCI_BRANCH_ALWAYS){
+ if ((cmd & OHCI_BRANCH_MASK)
+ == OHCI_BRANCH_ALWAYS) {
return;
}
- if((cmd & OHCI_CMD_MASK)
- == OHCI_OUTPUT_LAST){
+ if ((cmd & OHCI_CMD_MASK)
+ == OHCI_OUTPUT_LAST) {
return;
}
- if((cmd & OHCI_CMD_MASK)
- == OHCI_INPUT_LAST){
+ if ((cmd & OHCI_CMD_MASK)
+ == OHCI_INPUT_LAST) {
return;
}
- if(key == OHCI_KEY_ST2 ){
+ if (key == OHCI_KEY_ST2) {
i++;
}
}
@@ -2498,7 +2490,7 @@ fwohci_txbufdb(struct fwohci_softc *sc, int dmach, struct fw_bulkxfer *bulkxfer)
/*
device_printf(sc->fc.dev, "DB %08x %08x %08x\n", bulkxfer, db_tr->bus_addr, fdb_tr->bus_addr);
*/
- for (idb = 0; idb < dbch->xferq.bnpacket; idb ++) {
+ for (idb = 0; idb < dbch->xferq.bnpacket; idb++) {
db = db_tr->db;
fp = (struct fw_pkt *)db_tr->buf;
ohcifp = (struct fwohci_txpkthdr *) db[1].db.immed;
@@ -2508,8 +2500,8 @@ device_printf(sc->fc.dev, "DB %08x %08x %08x\n", bulkxfer, db_tr->bus_addr, fdb_
ohcifp->mode.stream.chtag = chtag;
ohcifp->mode.stream.tcode = 0xa;
#if BYTE_ORDER == BIG_ENDIAN
- FWOHCI_DMA_WRITE(db[1].db.immed[0], db[1].db.immed[0]);
- FWOHCI_DMA_WRITE(db[1].db.immed[1], db[1].db.immed[1]);
+ FWOHCI_DMA_WRITE(db[1].db.immed[0], db[1].db.immed[0]);
+ FWOHCI_DMA_WRITE(db[1].db.immed[1], db[1].db.immed[1]);
#endif
FWOHCI_DMA_CLEAR(db[2].db.desc.cmd, OHCI_COUNT_MASK);
@@ -2554,7 +2546,7 @@ fwohci_add_tx_buf(struct fwohci_dbch *dbch, struct fwohcidb_tr *db_tr,
int err = 0;
it = &dbch->xferq;
- if(it->buf == 0){
+ if (it->buf == 0) {
err = EINVAL;
return err;
}
@@ -2594,7 +2586,7 @@ fwohci_add_rx_buf(struct fwohci_dbch *dbch, struct fwohcidb_tr *db_tr,
&db_tr->dma_map, ir->psize, &dbuf[0],
BUS_DMA_NOWAIT);
if (db_tr->buf == NULL)
- return(ENOMEM);
+ return (ENOMEM);
}
db_tr->dbcnt = 1;
dsiz[0] = ir->psize;
@@ -2609,11 +2601,11 @@ fwohci_add_rx_buf(struct fwohci_dbch *dbch, struct fwohcidb_tr *db_tr,
dsiz[db_tr->dbcnt] = ir->psize;
if (ir->buf != NULL) {
db_tr->buf = fwdma_v_addr(ir->buf, poffset);
- dbuf[db_tr->dbcnt] = fwdma_bus_addr( ir->buf, poffset);
+ dbuf[db_tr->dbcnt] = fwdma_bus_addr(ir->buf, poffset);
}
db_tr->dbcnt++;
}
- for(i = 0 ; i < db_tr->dbcnt ; i++){
+ for (i = 0; i < db_tr->dbcnt; i++) {
FWOHCI_DMA_WRITE(db[i].db.desc.addr, dbuf[i]);
FWOHCI_DMA_WRITE(db[i].db.desc.cmd, OHCI_INPUT_MORE | dsiz[i]);
if (ir->flag & FWXFERQ_STREAM) {
@@ -2663,19 +2655,19 @@ fwohci_arcv_swap(struct fw_pkt *fp, int len)
break;
default:
printf("Unknown tcode %d\n", fp0->mode.common.tcode);
- return(0);
+ return (0);
}
hlen = tinfo[fp0->mode.common.tcode].hdr_len;
if (hlen > len) {
if (firewire_debug)
printf("splitted header\n");
- return(-hlen);
+ return (-hlen);
}
#if BYTE_ORDER == BIG_ENDIAN
- for(i = 0; i < slen/4; i ++)
+ for (i = 0; i < slen/4; i++)
fp->mode.ld[i] = FWOHCI_DMA_READ(fp->mode.ld[i]);
#endif
- return(hlen);
+ return (hlen);
}
static int
@@ -2737,11 +2729,11 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count)
caddr_t buf;
int resCount;
- if(&sc->arrq == dbch){
+ if (&sc->arrq == dbch) {
off = OHCI_ARQOFF;
- }else if(&sc->arrs == dbch){
+ } else if (&sc->arrs == dbch) {
off = OHCI_ARSOFF;
- }else{
+ } else {
return;
}
@@ -2769,10 +2761,10 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count)
if (len > 0)
bus_dmamap_sync(dbch->dmat, db_tr->dma_map,
BUS_DMASYNC_POSTREAD);
- while (len > 0 ) {
+ while (len > 0) {
if (count >= 0 && count-- == 0)
goto out;
- if(dbch->pdb_tr != NULL){
+ if (dbch->pdb_tr != NULL) {
/* we have a fragment in previous buffer */
int rlen;
@@ -2824,7 +2816,7 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count)
dbch->pdb_tr = db_tr;
dbch->buf_offset = - dbch->buf_offset;
/* sanity check */
- if (resCount != 0) {
+ if (resCount != 0) {
printf("resCount=%d hlen=%d\n",
resCount, hlen);
goto err;
@@ -2849,7 +2841,7 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count)
if (firewire_debug)
printf("splitted payload\n");
/* sanity check */
- if (resCount != 0) {
+ if (resCount != 0) {
printf("resCount=%d plen=%d"
" len=%d\n",
resCount, plen, len);
@@ -2859,7 +2851,7 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count)
}
vec[nvec].iov_base = ld;
vec[nvec].iov_len = plen;
- nvec ++;
+ nvec++;
ld += plen;
}
dbch->buf_offset = ld - (uint8_t *)db_tr->buf;
@@ -2886,7 +2878,7 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count)
if ((vec[nvec-1].iov_len -=
sizeof(struct fwohci_trailer)) == 0)
- nvec--;
+ nvec--;
rb.fc = &sc->fc;
rb.vec = vec;
rb.nvec = nvec;
@@ -2913,7 +2905,7 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count)
#endif
break;
}
- pcnt ++;
+ pcnt++;
if (dbch->pdb_tr != NULL) {
fwohci_arcv_free_buf(sc, dbch, dbch->pdb_tr,
off, 1);
diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c
index 77cb586..7523f2c 100644
--- a/sys/dev/firewire/fwohci_pci.c
+++ b/sys/dev/firewire/fwohci_pci.c
@@ -67,7 +67,7 @@ static int fwohci_pci_detach(device_t self);
* The probe routine.
*/
static int
-fwohci_pci_probe( device_t dev )
+fwohci_pci_probe(device_t dev)
{
uint32_t id;
@@ -211,7 +211,7 @@ fwohci_pci_init(device_t self)
cmd = pci_read_config(self, PCIR_COMMAND, 2);
cmd |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN;
#if 1 /* for broken hardware */
- cmd &= ~PCIM_CMD_MWRICEN;
+ cmd &= ~PCIM_CMD_MWRICEN;
#endif
pci_write_config(self, PCIR_COMMAND, cmd, 2);
@@ -311,14 +311,15 @@ fwohci_pci_attach(device_t self)
/*lockarg*/FW_GMTX(&sc->fc),
&sc->fc.dmat);
if (err != 0) {
- printf("fwohci_pci_attach: Could not allocate DMA tag "
- "- error %d\n", err);
- return (ENOMEM);
+ device_printf(self, "fwohci_pci_attach: Could not allocate DMA "
+ "tag - error %d\n", err);
+ fwohci_pci_detach(self);
+ return (ENOMEM);
}
err = fwohci_init(sc, self);
- if (err) {
+ if (err != 0) {
device_printf(self, "fwohci_init failed with err=%d\n", err);
fwohci_pci_detach(self);
return EIO;
@@ -337,13 +338,13 @@ fwohci_pci_detach(device_t self)
fwohci_softc_t *sc = device_get_softc(self);
int s;
-
s = splfw();
if (sc->bsr)
fwohci_stop(sc, self);
bus_generic_detach(self);
+
if (sc->fc.bdev) {
device_delete_child(self, sc->fc.bdev);
sc->fc.bdev = NULL;
@@ -368,7 +369,7 @@ fwohci_pci_detach(device_t self)
}
if (sc->bsr) {
- bus_release_resource(self, SYS_RES_MEMORY,PCI_CBMEM,sc->bsr);
+ bus_release_resource(self, SYS_RES_MEMORY, PCI_CBMEM, sc->bsr);
sc->bsr = NULL;
sc->bst = 0;
sc->bsh = 0;
@@ -428,7 +429,7 @@ fwohci_pci_add_child(device_t dev, u_int order, const char *name, int unit)
return (child);
sc->fc.bdev = child;
- device_set_ivars(child, (void *)&sc->fc);
+ device_set_ivars(child, &sc->fc);
err = device_probe_and_attach(child);
if (err) {
@@ -447,7 +448,7 @@ fwohci_pci_add_child(device_t dev, u_int order, const char *name, int unit)
int s;
DELAY(250); /* 2 cycles */
s = splfw();
- fwohci_poll((void *)sc, 0, -1);
+ fwohci_poll(&sc->fc, 0, -1);
splx(s);
}
diff --git a/sys/dev/firewire/fwohcireg.h b/sys/dev/firewire/fwohcireg.h
index d8deca8..95fe26e 100644
--- a/sys/dev/firewire/fwohcireg.h
+++ b/sys/dev/firewire/fwohcireg.h
@@ -184,7 +184,7 @@ struct fwohcidb {
#define FWOHCIEV_MASK 0x1f
-struct ohci_dma{
+struct ohci_dma {
fwohcireg_t cntl;
#define OHCI_CNTL_CYCMATCH_S (0x1 << 31)
@@ -211,7 +211,7 @@ struct ohci_dma{
fwohcireg_t dummy3;
};
-struct ohci_itdma{
+struct ohci_itdma {
fwohcireg_t cntl;
fwohcireg_t cntl_clr;
fwohcireg_t dummy0;
@@ -237,7 +237,7 @@ struct ohci_registers {
fwohcireg_t config_rom; /* config ROM map 0x34 */
fwohcireg_t post_wr_lo; /* post write addr lo 0x38 */
fwohcireg_t post_wr_hi; /* post write addr hi 0x3c */
- fwohcireg_t vender; /* vender ID 0x40 */
+ fwohcireg_t vendor; /* vendor ID 0x40 */
fwohcireg_t dummy1[3]; /* dummy 0x44-0x4c */
fwohcireg_t hcc_cntl_set; /* HCC control set 0x50 */
fwohcireg_t hcc_cntl_clr; /* HCC control clr 0x54 */
@@ -308,7 +308,7 @@ struct ohci_registers {
fwohcireg_t pys_upper; /* Physical Upper bound 0x120 */
fwohcireg_t dummy7[23]; /* dummy 0x124-0x17c */
-
+
/* 0x180, 0x184, 0x188, 0x18c */
/* 0x190, 0x194, 0x198, 0x19c */
/* 0x1a0, 0x1a4, 0x1a8, 0x1ac */
@@ -328,7 +328,7 @@ struct ohci_registers {
struct ohci_dma dma_irch[0x20];
};
-struct fwohcidb_tr{
+struct fwohcidb_tr {
STAILQ_ENTRY(fwohcidb_tr) link;
struct fw_xfer *xfer;
struct fwohcidb *db;
@@ -341,8 +341,8 @@ struct fwohcidb_tr{
/*
* OHCI info structure.
*/
-struct fwohci_txpkthdr{
- union{
+struct fwohci_txpkthdr {
+ union {
uint32_t ld[4];
struct {
#if BYTE_ORDER == BIG_ENDIAN
@@ -376,7 +376,7 @@ struct fwohci_txpkthdr{
:8;
#endif
BIT16x2(dst, );
- }asycomm;
+ } asycomm;
struct {
#if BYTE_ORDER == BIG_ENDIAN
uint32_t :13,
@@ -392,16 +392,17 @@ struct fwohci_txpkthdr{
:13;
#endif
BIT16x2(len, );
- }stream;
- }mode;
+ } stream;
+ } mode;
};
-struct fwohci_trailer{
+
+struct fwohci_trailer {
#if BYTE_ORDER == BIG_ENDIAN
uint32_t stat:16,
- time:16;
+ time:16;
#else
uint32_t time:16,
- stat:16;
+ stat:16;
#endif
};
@@ -412,7 +413,7 @@ struct fwohci_trailer{
#define OHCI_CNTL_SID (0x1 << 9)
/*
- * defined in OHCI 1.1
+ * defined in OHCI 1.1
* chapter 6.1
*/
#define OHCI_INT_DMA_ATRQ (0x1 << 0)
diff --git a/sys/dev/firewire/fwohcivar.h b/sys/dev/firewire/fwohcivar.h
index 3c9b242..985bc6a 100644
--- a/sys/dev/firewire/fwohcivar.h
+++ b/sys/dev/firewire/fwohcivar.h
@@ -44,7 +44,7 @@ typedef struct fwohci_softc {
void *ih;
struct resource *bsr;
struct resource *irq_res;
- struct fwohci_dbch{
+ struct fwohci_dbch {
u_int ndb;
u_int ndesc;
STAILQ_HEAD(, fwohcidb_tr) db_trq;
diff --git a/sys/dev/firewire/iec68113.h b/sys/dev/firewire/iec68113.h
index 11f3042..393d931 100644
--- a/sys/dev/firewire/iec68113.h
+++ b/sys/dev/firewire/iec68113.h
@@ -97,7 +97,7 @@ struct ciphdr {
} fdf;
};
-struct dvdbc{
+struct dvdbc {
#if BYTE_ORDER == BIG_ENDIAN
uint8_t sct:3, /* Section type */
:1, /* Reserved */
diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c
index f43fccb..5d15ead 100644
--- a/sys/dev/firewire/if_fwe.c
+++ b/sys/dev/firewire/if_fwe.c
@@ -1,7 +1,7 @@
/*-
* Copyright (c) 2002-2003
* Hidetoshi Shimokawa. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -18,7 +18,7 @@
* 4. Neither the name of the author 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
@@ -30,7 +30,7 @@
* LIABILITY, OR TORT (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$
*/
@@ -123,8 +123,8 @@ fwe_probe(device_t dev)
device_t pa;
pa = device_get_parent(dev);
- if(device_get_unit(dev) != device_get_unit(pa)){
- return(ENXIO);
+ if (device_get_unit(dev) != device_get_unit(pa)) {
+ return (ENXIO);
}
device_set_desc(dev, "Ethernet over FireWire");
@@ -176,7 +176,7 @@ fwe_attach(device_t dev)
"%02x:%02x:%02x:%02x:%02x:%02x\n", unit,
eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]);
- /* fill the rest and attach interface */
+ /* fill the rest and attach interface */
ifp = fwe->eth_softc.ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
device_printf(dev, "can not if_alloc()\n");
@@ -220,12 +220,12 @@ fwe_stop(struct fwe_softc *fwe)
if (xferq->flag & FWXFERQ_RUNNING)
fc->irx_disable(fc, fwe->dma_ch);
- xferq->flag &=
+ xferq->flag &=
~(FWXFERQ_MODEMASK | FWXFERQ_OPEN | FWXFERQ_STREAM |
FWXFERQ_EXTBUF | FWXFERQ_HANDLER | FWXFERQ_CHTAGMASK);
xferq->hand = NULL;
- for (i = 0; i < xferq->bnchunk; i ++)
+ for (i = 0; i < xferq->bnchunk; i++)
m_freem(xferq->bulkxfer[i].mbuf);
free(xferq->bulkxfer, M_FWE);
@@ -315,7 +315,7 @@ fwe_init(void *arg)
STAILQ_INIT(&xferq->stfree);
STAILQ_INIT(&xferq->stdma);
xferq->stproc = NULL;
- for (i = 0; i < xferq->bnchunk; i ++) {
+ for (i = 0; i < xferq->bnchunk; i++) {
m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR);
xferq->bulkxfer[i].mbuf = m;
m->m_len = m->m_pkthdr.len = m->m_ext.ext_size;
@@ -393,7 +393,7 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
!(ifp->if_capenable & IFCAP_POLLING)) {
error = ether_poll_register(fwe_poll, ifp);
if (error)
- return(error);
+ return (error);
/* Disable interrupts */
fc->set_intr(fc, 0);
ifp->if_capenable |= IFCAP_POLLING;
@@ -435,7 +435,6 @@ fwe_output_callback(struct fw_xfer *xfer)
FWEDEBUG(ifp, "resp = %d\n", xfer->resp);
if (xfer->resp != 0)
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
-
m_freem(xfer->mbuf);
fw_xfer_unload(xfer);
@@ -604,7 +603,7 @@ fwe_as_input(struct fw_xferq *xferq)
c[16], c[17], c[18], c[19],
c[20], c[21], c[22], c[23],
c[20], c[21], c[22], c[23]
- );
+ );
#endif
(*ifp->if_input)(ifp, m);
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c
index b88bf77..0617a9c 100644
--- a/sys/dev/firewire/if_fwip.c
+++ b/sys/dev/firewire/if_fwip.c
@@ -60,16 +60,10 @@
#include <net/firewire.h>
#include <net/if_arp.h>
#include <net/if_types.h>
-#ifdef __DragonFly__
-#include <bus/firewire/firewire.h>
-#include <bus/firewire/firewirereg.h>
-#include "if_fwipvar.h"
-#else
#include <dev/firewire/firewire.h>
#include <dev/firewire/firewirereg.h>
#include <dev/firewire/iec13213.h>
#include <dev/firewire/if_fwipvar.h>
-#endif
/*
* We really need a mechanism for allocating regions in the FIFO
@@ -139,8 +133,8 @@ fwip_probe(device_t dev)
device_t pa;
pa = device_get_parent(dev);
- if(device_get_unit(dev) != device_get_unit(pa)){
- return(ENXIO);
+ if (device_get_unit(dev) != device_get_unit(pa)) {
+ return (ENXIO);
}
device_set_desc(dev, "IP over FireWire");
@@ -228,7 +222,7 @@ fwip_stop(struct fwip_softc *fwip)
FWXFERQ_EXTBUF | FWXFERQ_HANDLER | FWXFERQ_CHTAGMASK);
xferq->hand = NULL;
- for (i = 0; i < xferq->bnchunk; i ++)
+ for (i = 0; i < xferq->bnchunk; i++)
m_freem(xferq->bulkxfer[i].mbuf);
free(xferq->bulkxfer, M_FWIP);
@@ -322,7 +316,7 @@ fwip_init(void *arg)
STAILQ_INIT(&xferq->stfree);
STAILQ_INIT(&xferq->stdma);
xferq->stproc = NULL;
- for (i = 0; i < xferq->bnchunk; i ++) {
+ for (i = 0; i < xferq->bnchunk; i++) {
m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR);
xferq->bulkxfer[i].mbuf = m;
m->m_len = m->m_pkthdr.len = m->m_ext.ext_size;
@@ -335,7 +329,7 @@ fwip_init(void *arg)
/* pre-allocate xfer */
STAILQ_INIT(&fwip->fwb.xferlist);
- for (i = 0; i < rx_queue_len; i ++) {
+ for (i = 0; i < rx_queue_len; i++) {
xfer = fw_xfer_alloc(M_FWIP);
if (xfer == NULL)
break;
@@ -411,13 +405,12 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
!(ifp->if_capenable & IFCAP_POLLING)) {
error = ether_poll_register(fwip_poll, ifp);
if (error)
- return(error);
+ return (error);
/* Disable interrupts */
fc->set_intr(fc, 0);
ifp->if_capenable |= IFCAP_POLLING |
IFCAP_POLLING_NOCOUNT;
return (error);
-
}
if (!(ifr->ifr_reqcap & IFCAP_POLLING) &&
ifp->if_capenable & IFCAP_POLLING) {
@@ -485,7 +478,6 @@ fwip_output_callback(struct fw_xfer *xfer)
FWIPDEBUG(ifp, "resp = %d\n", xfer->resp);
if (xfer->resp != 0)
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
-
m_freem(xfer->mbuf);
fw_xfer_unload(xfer);
@@ -937,9 +929,6 @@ static driver_t fwip_driver = {
};
-#ifdef __DragonFly__
-DECLARE_DUMMY_MODULE(fwip);
-#endif
DRIVER_MODULE(fwip, firewire, fwip_driver, fwip_devclass, 0, 0);
MODULE_VERSION(fwip, 1);
MODULE_DEPEND(fwip, firewire, 1, 1, 1);
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index d66933a..69e83c4 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -30,7 +30,7 @@
* STRICT LIABILITY, OR TORT (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$
*
*/
@@ -75,16 +75,16 @@
#define SBP_QUEUE_LEN ((SBP_DMA_SIZE - SBP_LOGIN_SIZE) / sizeof(struct sbp_ocb))
#define SBP_NUM_OCB (SBP_QUEUE_LEN * SBP_NUM_TARGETS)
-/*
+/*
* STATUS FIFO addressing
* bit
- * -----------------------
+ *-----------------------
* 0- 1( 2): 0 (alignment)
* 2- 7( 6): target
* 8-15( 8): lun
* 16-31( 8): reserved
- * 32-47(16): SBP_BIND_HI
- * 48-64(16): bus_id, node_id
+ * 32-47(16): SBP_BIND_HI
+ * 48-64(16): bus_id, node_id
*/
#define SBP_BIND_HI 0x1
#define SBP_DEV2ADDR(t, l) \
@@ -154,7 +154,7 @@ struct sbp_ocb {
#define OCB_ACT_CMD 1
#define OCB_MATCH(o,s) ((o)->bus_addr == ntohl((s)->orb_lo))
-struct sbp_dev{
+struct sbp_dev {
#define SBP_DEV_RESET 0 /* accept login */
#define SBP_DEV_LOGIN 1 /* to login */
#if 0
@@ -232,7 +232,7 @@ static void sbp_cmd_callback (struct fw_xfer *);
#endif
static void sbp_orb_pointer (struct sbp_dev *, struct sbp_ocb *);
static void sbp_doorbell(struct sbp_dev *);
-static void sbp_execute_ocb (void *, bus_dma_segment_t *, int, int);
+static void sbp_execute_ocb (void *, bus_dma_segment_t *, int, int);
static void sbp_free_ocb (struct sbp_dev *, struct sbp_ocb *);
static void sbp_abort_ocb (struct sbp_ocb *, int);
static void sbp_abort_all_ocbs (struct sbp_dev *, int);
@@ -388,7 +388,7 @@ sbp_new_target(struct sbp_softc *sbp, struct fw_device *fwdev)
/* XXX wired-down configuration should be gotten from
tunable or device hint */
- for (i = 0; wired[i].bus >= 0; i ++) {
+ for (i = 0; wired[i].bus >= 0; i++) {
if (wired[i].bus == bus) {
w[wired[i].target] = 1;
if (wired[i].eui.hi == fwdev->eui.hi &&
@@ -397,16 +397,16 @@ sbp_new_target(struct sbp_softc *sbp, struct fw_device *fwdev)
}
}
if (target >= 0) {
- if(target < SBP_NUM_TARGETS &&
+ if (target < SBP_NUM_TARGETS &&
sbp->targets[target].fwdev == NULL)
- return(target);
+ return (target);
device_printf(sbp->fd.dev,
- "target %d is not free for %08x:%08x\n",
+ "target %d is not free for %08x:%08x\n",
target, fwdev->eui.hi, fwdev->eui.lo);
target = -1;
}
/* non-wired target */
- for (i = 0; i < SBP_NUM_TARGETS; i ++)
+ for (i = 0; i < SBP_NUM_TARGETS; i++)
if (sbp->targets[i].fwdev == NULL && w[i] == 0) {
target = i;
break;
@@ -445,12 +445,12 @@ END_DEBUG
device_printf(target->sbp->fd.dev, "%d no LUN found\n",
target->target_id);
- maxlun ++;
+ maxlun++;
if (maxlun >= SBP_NUM_LUNS)
maxlun = SBP_NUM_LUNS;
/* Invalidiate stale devices */
- for (lun = 0; lun < target->num_lun; lun ++) {
+ for (lun = 0; lun < target->num_lun; lun++) {
sdev = target->luns[lun];
if (sdev == NULL)
continue;
@@ -468,7 +468,7 @@ END_DEBUG
newluns = (struct sbp_dev **) realloc(target->luns,
sizeof(struct sbp_dev *) * maxlun,
M_SBP, M_NOWAIT | M_ZERO);
-
+
if (newluns == NULL) {
printf("%s: realloc failed\n", __func__);
newluns = target->luns;
@@ -527,7 +527,7 @@ END_DEBUG
if (new == 0)
goto next;
- fwdma_malloc(sbp->fd.fc,
+ fwdma_malloc(sbp->fd.fc,
/* alignment */ sizeof(uint32_t),
SBP_DMA_SIZE, &sdev->dma, BUS_DMA_NOWAIT |
BUS_DMA_COHERENT);
@@ -542,7 +542,7 @@ END_DEBUG
sdev->ocb = (struct sbp_ocb *)
((char *)sdev->dma.v_addr + SBP_LOGIN_SIZE);
bzero((char *)sdev->ocb,
- sizeof (struct sbp_ocb) * SBP_QUEUE_LEN);
+ sizeof(struct sbp_ocb) * SBP_QUEUE_LEN);
STAILQ_INIT(&sdev->free_ocbs);
for (i = 0; i < SBP_QUEUE_LEN; i++) {
@@ -564,7 +564,7 @@ next:
crom_next(&cc);
}
- for (lun = 0; lun < target->num_lun; lun ++) {
+ for (lun = 0; lun < target->num_lun; lun++) {
sdev = target->luns[lun];
if (sdev != NULL && (sdev->flags & VALID_LUN) == 0) {
sbp_cam_detach_sdev(sdev);
@@ -713,7 +713,7 @@ END_DEBUG
if (alive && (sdev->status != SBP_DEV_DEAD)) {
if (sdev->path != NULL) {
xpt_freeze_devq(sdev->path, 1);
- sdev->freeze ++;
+ sdev->freeze++;
}
sbp_probe_lun(sdev);
sbp_show_sdev_info(sdev);
@@ -743,7 +743,7 @@ SBP_DEBUG(0)
END_DEBUG
if (sdev->path) {
xpt_freeze_devq(sdev->path, 1);
- sdev->freeze ++;
+ sdev->freeze++;
}
sdev->status = SBP_DEV_RETRY;
sbp_cam_detach_sdev(sdev);
@@ -797,7 +797,7 @@ END_DEBUG
return;
if (sbp_cold > 0)
- sbp_cold --;
+ sbp_cold--;
SBP_LOCK(sbp);
#if 0
@@ -809,7 +809,7 @@ END_DEBUG
#endif
/* Garbage Collection */
- for(i = 0 ; i < SBP_NUM_TARGETS ; i ++){
+ for (i = 0; i < SBP_NUM_TARGETS; i++) {
target = &sbp->targets[i];
STAILQ_FOREACH(fwdev, &sbp->fd.fc->devices, link)
if (target->fwdev == NULL || target->fwdev == fwdev)
@@ -829,14 +829,14 @@ SBP_DEBUG(0)
fwdev->status);
END_DEBUG
alive = SBP_FWDEV_ALIVE(fwdev);
- for(i = 0 ; i < SBP_NUM_TARGETS ; i ++){
+ for (i = 0; i < SBP_NUM_TARGETS; i++) {
target = &sbp->targets[i];
- if(target->fwdev == fwdev ) {
+ if (target->fwdev == fwdev) {
/* known target */
break;
}
}
- if(i == SBP_NUM_TARGETS){
+ if (i == SBP_NUM_TARGETS) {
if (alive) {
/* new target */
target = sbp_alloc_target(sbp, fwdev);
@@ -857,7 +857,8 @@ END_DEBUG
#if NEED_RESPONSE
static void
-sbp_loginres_callback(struct fw_xfer *xfer){
+sbp_loginres_callback(struct fw_xfer *xfer)
+{
struct sbp_dev *sdev;
sdev = (struct sbp_dev *)xfer->sc;
SBP_DEBUG(1)
@@ -950,8 +951,8 @@ sbp_next_dev(struct sbp_target *target, int lun)
for (i = lun, sdevp = &target->luns[lun]; i < target->num_lun;
i++, sdevp++)
if (*sdevp != NULL && (*sdevp)->status == SBP_DEV_PROBE)
- return(*sdevp);
- return(NULL);
+ return (*sdevp);
+ return (NULL);
}
#define SCAN_PRI 1
@@ -1147,7 +1148,7 @@ END_DEBUG
fp = &xfer->send.hdr;
fp->mode.wreqq.dest_hi = 0xffff;
fp->mode.wreqq.dest_lo = 0xf0000000 | BUSY_TIMEOUT;
- fp->mode.wreqq.data = htonl((1 << (13+12)) | 0xf);
+ fp->mode.wreqq.data = htonl((1 << (13 + 12)) | 0xf);
fw_asyreq(xfer->fc, -1, xfer);
}
@@ -1213,8 +1214,8 @@ END_DEBUG
fp = &xfer->send.hdr;
fp->mode.wreqb.len = 8;
fp->mode.wreqb.extcode = 0;
- xfer->send.payload[0] =
- htonl(((sdev->target->sbp->fd.fc->nodeid | FWLOCALBUS )<< 16));
+ xfer->send.payload[0] =
+ htonl(((sdev->target->sbp->fd.fc->nodeid | FWLOCALBUS) << 16));
xfer->send.payload[1] = htonl((uint32_t)ocb->bus_addr);
if (fw_asyreq(xfer->fc, -1, xfer) != 0) {
@@ -1288,14 +1289,14 @@ sbp_write_cmd(struct sbp_dev *sdev, int tcode, int offset)
if (xfer == NULL) {
if (target->n_xfer > 5 /* XXX */) {
printf("sbp: no more xfer for this target\n");
- return(NULL);
+ return (NULL);
}
xfer = fw_xfer_alloc_buf(M_SBP, 8, 0);
- if(xfer == NULL){
+ if (xfer == NULL) {
printf("sbp: fw_xfer_alloc_buf failed\n");
return NULL;
}
- target->n_xfer ++;
+ target->n_xfer++;
if (debug)
printf("sbp: alloc %d xfer\n", target->n_xfer);
new = 1;
@@ -1362,7 +1363,7 @@ SBP_DEBUG(0)
device_printf(sdev->target->sbp->fd.dev,
"%s:%s %s\n",
__func__,sdev->bustgtlun,
- orb_fun_name[(func>>16)&0xf]);
+ orb_fun_name[(func >> 16) & 0xf]);
END_DEBUG
switch (func) {
case ORB_FUN_LGI:
@@ -1399,7 +1400,7 @@ start:
callout_reset(&target->mgm_ocb_timeout, 5*hz,
sbp_mgm_timeout, (caddr_t)ocb);
xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0);
- if(xfer == NULL){
+ if (xfer == NULL) {
return;
}
xfer->hand = sbp_mgm_callback;
@@ -1470,25 +1471,25 @@ END_DEBUG
case SCSI_STATUS_CHECK_COND:
case SCSI_STATUS_BUSY:
case SCSI_STATUS_CMD_TERMINATED:
- if(sbp_cmd_status->sfmt == SBP_SFMT_CURR){
+ if (sbp_cmd_status->sfmt == SBP_SFMT_CURR) {
sense->error_code = SSD_CURRENT_ERROR;
- }else{
+ } else {
sense->error_code = SSD_DEFERRED_ERROR;
}
- if(sbp_cmd_status->valid)
+ if (sbp_cmd_status->valid)
sense->error_code |= SSD_ERRCODE_VALID;
sense->flags = sbp_cmd_status->s_key;
- if(sbp_cmd_status->mark)
+ if (sbp_cmd_status->mark)
sense->flags |= SSD_FILEMARK;
- if(sbp_cmd_status->eom)
+ if (sbp_cmd_status->eom)
sense->flags |= SSD_EOM;
- if(sbp_cmd_status->ill_len)
+ if (sbp_cmd_status->ill_len)
sense->flags |= SSD_ILI;
bcopy(&sbp_cmd_status->info, &sense->info[0], 4);
if (sbp_status->len <= 1)
- /* XXX not scsi status. shouldn't be happened */
+ /* XXX not scsi status. shouldn't be happened */
sense->extra_len = 0;
else if (sbp_status->len <= 4)
/* add_sense_code(_qual), info, cmd_spec_info */
@@ -1513,10 +1514,10 @@ END_DEBUG
{
uint8_t j, *tmp;
tmp = sense;
- for( j = 0 ; j < 32 ; j+=8){
- printf("sense %02x%02x %02x%02x %02x%02x %02x%02x\n",
- tmp[j], tmp[j+1], tmp[j+2], tmp[j+3],
- tmp[j+4], tmp[j+5], tmp[j+6], tmp[j+7]);
+ for (j = 0; j < 32; j += 8) {
+ printf("sense %02x%02x %02x%02x %02x%02x %02x%02x\n",
+ tmp[j], tmp[j + 1], tmp[j + 2], tmp[j + 3],
+ tmp[j + 4], tmp[j + 5], tmp[j + 6], tmp[j + 7]);
}
}
@@ -1550,7 +1551,7 @@ END_DEBUG
switch (SID_TYPE(inq)) {
case T_DIRECT:
#if 0
- /*
+ /*
* XXX Convert Direct Access device to RBC.
* I've never seen FireWire DA devices which support READ_6.
*/
@@ -1566,7 +1567,7 @@ END_DEBUG
#if 1
bcopy(sdev->vendor, inq->vendor, sizeof(inq->vendor));
bcopy(sdev->product, inq->product, sizeof(inq->product));
- bcopy(sdev->revision+2, inq->revision, sizeof(inq->revision));
+ bcopy(sdev->revision + 2, inq->revision, sizeof(inq->revision));
#endif
break;
}
@@ -1606,16 +1607,16 @@ printf("sbp %08x %08x %08x %08x\n", ntohl(ld[8]), ntohl(ld[9]), ntohl(ld[10]), n
*/
sbp = (struct sbp_softc *)xfer->sc;
SBP_LOCK_ASSERT(sbp);
- if (xfer->resp != 0){
+ if (xfer->resp != 0) {
printf("sbp_recv: xfer->resp = %d\n", xfer->resp);
goto done0;
}
- if (xfer->recv.payload == NULL){
+ if (xfer->recv.payload == NULL) {
printf("sbp_recv: xfer->recv.payload == NULL\n");
goto done0;
}
rfp = &xfer->recv.hdr;
- if(rfp->mode.wreqb.tcode != FWTCODE_WREQB){
+ if (rfp->mode.wreqb.tcode != FWTCODE_WREQB) {
printf("sbp_recv: tcode = %d\n", rfp->mode.wreqb.tcode);
goto done0;
}
@@ -1677,7 +1678,7 @@ END_DEBUG
&& sbp_status->dead == 0);
status_valid = (status_valid0 && sbp_status->status == 0);
- if (!status_valid0 || debug > 2){
+ if (!status_valid0 || debug > 2) {
int status;
SBP_DEBUG(0)
device_printf(sdev->target->sbp->fd.dev,
@@ -1691,7 +1692,7 @@ END_DEBUG
device_printf(sdev->target->sbp->fd.dev,
"%s\n", sdev->bustgtlun);
status = sbp_status->status;
- switch(sbp_status->resp) {
+ switch (sbp_status->resp) {
case 0:
if (status > MAX_ORB_STATUS0)
printf("%s\n", orb_status0[MAX_ORB_STATUS0]);
@@ -1700,7 +1701,7 @@ END_DEBUG
break;
case 1:
printf("Obj: %s, Error: %s\n",
- orb_status1_object[(status>>6) & 3],
+ orb_status1_object[(status >> 6) & 3],
orb_status1_serial_bus_error[status & 0xf]);
break;
case 2:
@@ -1718,7 +1719,7 @@ END_DEBUG
if (sbp_status->dead) {
if (sdev->path) {
xpt_freeze_devq(sdev->path, 1);
- sdev->freeze ++;
+ sdev->freeze++;
}
reset_agent = 1;
}
@@ -1726,17 +1727,17 @@ END_DEBUG
if (ocb == NULL)
goto done;
- switch(ntohl(ocb->orb[4]) & ORB_FMT_MSK){
+ switch (ntohl(ocb->orb[4]) & ORB_FMT_MSK) {
case ORB_FMT_NOP:
break;
case ORB_FMT_VED:
break;
case ORB_FMT_STD:
- switch(ocb->flags) {
+ switch (ocb->flags) {
case OCB_ACT_MGM:
orb_fun = ntohl(ocb->orb[4]) & ORB_FUN_MSK;
reset_agent = 0;
- switch(orb_fun) {
+ switch (orb_fun) {
case ORB_FUN_LGI:
fwdma_sync(&sdev->dma, BUS_DMASYNC_POSTREAD);
login_res = sdev->login;
@@ -1807,16 +1808,16 @@ END_DEBUG
break;
case OCB_ACT_CMD:
sdev->timeout = 0;
- if(ocb->ccb != NULL){
+ if (ocb->ccb != NULL) {
union ccb *ccb;
ccb = ocb->ccb;
- if(sbp_status->len > 1){
+ if (sbp_status->len > 1) {
sbp_scsi_status(sbp_status, ocb);
- }else{
- if(sbp_status->resp != ORB_RES_CMPL){
+ } else {
+ if (sbp_status->resp != ORB_RES_CMPL) {
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
- }else{
+ } else {
ccb->ccb_h.status = CAM_REQ_CMP;
}
}
@@ -1843,7 +1844,7 @@ done0:
* the buffer. In that case, the controller return ack_complete and
* no respose is necessary.
*
- * XXX fwohci.c and firewire.c should inform event_code such as
+ * XXX fwohci.c and firewire.c should inform event_code such as
* ack_complete or ack_pending to upper driver.
*/
#if NEED_RESPONSE
@@ -1900,7 +1901,7 @@ SBP_DEBUG(0)
END_DEBUG
if (cold)
- sbp_cold ++;
+ sbp_cold++;
sbp = device_get_softc(dev);
sbp->fd.dev = dev;
sbp->fd.fc = fc = device_get_ivars(dev);
@@ -1932,7 +1933,7 @@ END_DEBUG
if (devq == NULL)
return (ENXIO);
- for( i = 0 ; i < SBP_NUM_TARGETS ; i++){
+ for (i = 0; i < SBP_NUM_TARGETS; i++) {
sbp->targets[i].fwdev = NULL;
sbp->targets[i].luns = NULL;
sbp->targets[i].sbp = sbp;
@@ -2001,7 +2002,7 @@ SBP_DEBUG(0)
printf("sbp_logout_all\n");
END_DEBUG
SBP_LOCK_ASSERT(sbp);
- for (i = 0 ; i < SBP_NUM_TARGETS ; i ++) {
+ for (i = 0; i < SBP_NUM_TARGETS; i++) {
target = &sbp->targets[i];
if (target->luns == NULL)
continue;
@@ -2090,7 +2091,7 @@ SBP_DEBUG(0)
END_DEBUG
SBP_LOCK(sbp);
- for (i = 0; i < SBP_NUM_TARGETS; i ++)
+ for (i = 0; i < SBP_NUM_TARGETS; i++)
sbp_cam_detach_target(&sbp->targets[i]);
xpt_async(AC_LOST_DEVICE, sbp->path, NULL);
@@ -2105,7 +2106,7 @@ END_DEBUG
pause("sbpdtc", hz/2);
SBP_LOCK(sbp);
- for (i = 0 ; i < SBP_NUM_TARGETS ; i ++)
+ for (i = 0; i < SBP_NUM_TARGETS; i++)
sbp_free_target(&sbp->targets[i]);
SBP_UNLOCK(sbp);
@@ -2172,12 +2173,12 @@ sbp_target_reset(struct sbp_dev *sdev, int method)
if (tsdev->status == SBP_DEV_RESET)
continue;
xpt_freeze_devq(tsdev->path, 1);
- tsdev->freeze ++;
+ tsdev->freeze++;
sbp_abort_all_ocbs(tsdev, CAM_CMD_TIMEOUT);
if (method == 2)
tsdev->status = SBP_DEV_LOGIN;
}
- switch(method) {
+ switch (method) {
case 1:
printf("target reset\n");
sbp_mgm_orb(sdev, ORB_FUN_RST, NULL);
@@ -2187,7 +2188,7 @@ sbp_target_reset(struct sbp_dev *sdev, int method)
sbp_reset_start(sdev);
break;
}
-
+
}
static void
@@ -2225,12 +2226,12 @@ sbp_timeout(void *arg)
__func__, sdev->bustgtlun, (uint32_t)ocb->bus_addr);
SBP_LOCK_ASSERT(sdev->target->sbp);
- sdev->timeout ++;
- switch(sdev->timeout) {
+ sdev->timeout++;
+ switch (sdev->timeout) {
case 1:
printf("agent reset\n");
xpt_freeze_devq(sdev->path, 1);
- sdev->freeze ++;
+ sdev->freeze++;
sbp_abort_all_ocbs(sdev, CAM_CMD_TIMEOUT);
sbp_agent_reset(sdev);
break;
@@ -2309,7 +2310,7 @@ END_DEBUG
* sometimes aimed at the SIM (sc is invalid and target is
* CAM_TARGET_WILDCARD)
*/
- if (sbp == NULL &&
+ if (sbp == NULL &&
ccb->ccb_h.target_id != CAM_TARGET_WILDCARD) {
SBP_DEBUG(0)
printf("%s:%d:%jx func_code 0x%04x: "
@@ -2361,7 +2362,7 @@ SBP_DEBUG(2)
csio->cdb_len, csio->dxfer_len,
csio->sense_len);
END_DEBUG
- if(sdev == NULL){
+ if (sdev == NULL) {
ccb->ccb_h.status = CAM_DEV_NOT_THERE;
xpt_done(ccb);
return;
@@ -2383,7 +2384,7 @@ END_DEBUG
ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
if (sdev->freeze == 0) {
xpt_freeze_devq(sdev->path, 1);
- sdev->freeze ++;
+ sdev->freeze++;
}
xpt_done(ccb);
return;
@@ -2395,12 +2396,12 @@ END_DEBUG
ccb->ccb_h.ccb_sdev_ptr = sdev;
ocb->orb[0] = htonl(1U << 31);
ocb->orb[1] = 0;
- ocb->orb[2] = htonl(((sbp->fd.fc->nodeid | FWLOCALBUS )<< 16) );
+ ocb->orb[2] = htonl(((sbp->fd.fc->nodeid | FWLOCALBUS) << 16));
ocb->orb[3] = htonl(ocb->bus_addr + IND_PTR_OFFSET);
speed = min(target->fwdev->speed, max_speed);
ocb->orb[4] = htonl(ORB_NOTIFY | ORB_CMD_SPD(speed)
| ORB_CMD_MAXP(speed + 7));
- if((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN){
+ if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
ocb->orb[4] |= htonl(ORB_CMD_IN);
}
@@ -2467,7 +2468,7 @@ END_DEBUG
case XPT_PATH_INQ: /* Path routing inquiry */
{
struct ccb_pathinq *cpi = &ccb->cpi;
-
+
SBP_DEBUG(1)
printf("%s:%d:%jx XPT_PATH_INQ:.\n",
device_get_nameunit(sbp->fd.dev),
@@ -2536,7 +2537,7 @@ END_DEBUG
}
static void
-sbp_execute_ocb(void *arg, bus_dma_segment_t *segments, int seg, int error)
+sbp_execute_ocb(void *arg, bus_dma_segment_t *segments, int seg, int error)
{
int i;
struct sbp_ocb *ocb;
@@ -2563,7 +2564,7 @@ END_DEBUG
panic("ds_len > SBP_SEG_MAX, fix busdma code");
ocb->orb[3] = htonl(s->ds_addr);
ocb->orb[4] |= htonl(s->ds_len);
- } else if(seg > 1) {
+ } else if (seg > 1) {
/* page table */
for (i = 0; i < seg; i++) {
s = &segments[i];
@@ -2572,7 +2573,7 @@ SBP_DEBUG(0)
if (s->ds_len < 16)
printf("sbp_execute_ocb: warning, "
"segment length(%zd) is less than 16."
- "(seg=%d/%d)\n", (size_t)s->ds_len, i+1, seg);
+ "(seg=%d/%d)\n", (size_t)s->ds_len, i + 1, seg);
END_DEBUG
if (s->ds_len > SBP_SEG_MAX)
panic("ds_len > SBP_SEG_MAX, fix busdma code");
@@ -2581,7 +2582,7 @@ END_DEBUG
}
ocb->orb[4] |= htonl(ORB_CMD_PTBL | seg);
}
-
+
if (seg > 0)
bus_dmamap_sync(ocb->sdev->target->sbp->dmat, ocb->dmamap,
(ntohl(ocb->orb[4]) & ORB_CMD_IN) ?
@@ -2593,19 +2594,19 @@ END_DEBUG
if (ocb->sdev->last_ocb != NULL)
sbp_doorbell(ocb->sdev);
else
- sbp_orb_pointer(ocb->sdev, ocb);
+ sbp_orb_pointer(ocb->sdev, ocb);
}
} else {
if (prev == NULL || (ocb->sdev->flags & ORB_LINK_DEAD) != 0) {
ocb->sdev->flags &= ~ORB_LINK_DEAD;
- sbp_orb_pointer(ocb->sdev, ocb);
+ sbp_orb_pointer(ocb->sdev, ocb);
}
}
}
static void
sbp_poll(struct cam_sim *sim)
-{
+{
struct sbp_softc *sbp;
struct firewire_comm *fc;
@@ -2648,7 +2649,7 @@ END_DEBUG
if (!use_doorbell) {
if (sbp_status->src == SRC_NO_NEXT) {
if (next != NULL)
- sbp_orb_pointer(sdev, next);
+ sbp_orb_pointer(sdev, next);
else if (order > 0) {
/*
* Unordered execution
@@ -2661,7 +2662,7 @@ END_DEBUG
} else {
/*
* XXX this is not correct for unordered
- * execution.
+ * execution.
*/
if (sdev->last_ocb != NULL) {
sbp_free_ocb(sdev, sdev->last_ocb);
@@ -2673,7 +2674,7 @@ END_DEBUG
}
break;
} else
- order ++;
+ order++;
}
SBP_DEBUG(0)
if (ocb && order > 0) {
diff --git a/sys/dev/firewire/sbp.h b/sys/dev/firewire/sbp.h
index 84d522a..79f2e28 100644
--- a/sys/dev/firewire/sbp.h
+++ b/sys/dev/firewire/sbp.h
@@ -76,7 +76,7 @@ struct ind_ptr {
#define SBP_RECV_LEN 32
-struct sbp_login_res{
+struct sbp_login_res {
uint16_t len;
uint16_t id;
uint16_t res0;
@@ -86,7 +86,7 @@ struct sbp_login_res{
uint16_t recon_hold;
};
-struct sbp_status{
+struct sbp_status {
#if BYTE_ORDER == BIG_ENDIAN
uint8_t src:2,
resp:2,
@@ -155,7 +155,7 @@ struct sbp_status{
/* F: Address error */
-struct sbp_cmd_status{
+struct sbp_cmd_status {
#define SBP_SFMT_CURR 0
#define SBP_SFMT_DEFER 1
#if BYTE_ORDER == BIG_ENDIAN
diff --git a/sys/dev/firewire/sbp_targ.c b/sys/dev/firewire/sbp_targ.c
index f8f3063..0d78e9f 100644
--- a/sys/dev/firewire/sbp_targ.c
+++ b/sys/dev/firewire/sbp_targ.c
@@ -1,7 +1,7 @@
/*-
* Copyright (C) 2003
* Hidetoshi Shimokawa. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -18,7 +18,7 @@
* 4. Neither the name of the author 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
@@ -30,7 +30,7 @@
* LIABILITY, OR TORT (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$
*/
@@ -104,16 +104,16 @@ struct sbp_targ_login {
struct sbp_targ_lstate *lstate;
struct fw_device *fwdev;
struct sbp_login_res loginres;
- uint16_t fifo_hi;
+ uint16_t fifo_hi;
uint16_t last_hi;
- uint32_t fifo_lo;
+ uint32_t fifo_lo;
uint32_t last_lo;
STAILQ_HEAD(, orb_info) orbs;
STAILQ_ENTRY(sbp_targ_login) link;
uint16_t hold_sec;
uint16_t id;
- uint8_t flags;
- uint8_t spd;
+ uint8_t flags;
+ uint8_t spd;
struct callout hold_callout;
};
@@ -124,7 +124,7 @@ struct sbp_targ_lstate {
struct ccb_hdr_slist accept_tios;
struct ccb_hdr_slist immed_notifies;
struct crom_chunk model;
- uint32_t flags;
+ uint32_t flags;
STAILQ_HEAD(, sbp_targ_login) logins;
};
@@ -205,7 +205,7 @@ struct orb_info {
struct sbp_targ_login *login;
union ccb *ccb;
struct ccb_accept_tio *atio;
- uint8_t state;
+ uint8_t state;
#define ORBI_STATUS_NONE 0
#define ORBI_STATUS_FETCH 1
#define ORBI_STATUS_ATIO 2
@@ -213,7 +213,7 @@ struct orb_info {
#define ORBI_STATUS_STATUS 4
#define ORBI_STATUS_POINTER 5
#define ORBI_STATUS_ABORTED 7
- uint8_t refcount;
+ uint8_t refcount;
uint16_t orb_hi;
uint32_t orb_lo;
uint32_t data_hi;
@@ -250,8 +250,8 @@ sbp_targ_probe(device_t dev)
device_t pa;
pa = device_get_parent(dev);
- if(device_get_unit(dev) != device_get_unit(pa)){
- return(ENXIO);
+ if (device_get_unit(dev) != device_get_unit(pa)) {
+ return (ENXIO);
}
device_set_desc(dev, "SBP-2/SCSI over FireWire target mode");
@@ -336,7 +336,7 @@ sbp_targ_post_busreset(void *arg)
crom_add_entry(unit, CROM_MGM, SBP_TARG_MGM >> 2);
crom_add_entry(unit, CSRKEY_UNIT_CH, (10<<8) | 8);
- for (i = 0; i < MAX_LUN; i ++) {
+ for (i = 0; i < MAX_LUN; i++) {
lstate = sc->lstate[i];
if (lstate == NULL)
continue;
@@ -347,7 +347,7 @@ sbp_targ_post_busreset(void *arg)
}
/* Process for reconnection hold time */
- for (i = 0; i < MAX_LOGINS; i ++) {
+ for (i = 0; i < MAX_LOGINS; i++) {
login = sc->logins[i];
if (login == NULL)
continue;
@@ -355,7 +355,7 @@ sbp_targ_post_busreset(void *arg)
if (login->flags & F_LOGIN) {
login->flags |= F_HOLD;
callout_reset(&login->hold_callout,
- hz * login->hold_sec,
+ hz * login->hold_sec,
sbp_targ_hold_expire, (void *)login);
}
}
@@ -392,7 +392,7 @@ sbp_targ_find_devs(struct sbp_targ_softc *sc, union ccb *ccb,
lun = ccb->ccb_h.target_lun;
if (lun >= MAX_LUN)
return (CAM_LUN_INVALID);
-
+
*lstate = sc->lstate[lun];
if (notfound_failure != 0 && *lstate == NULL) {
@@ -840,7 +840,7 @@ sbp_targ_cam_done(struct fw_xfer *xfer)
sbp_targ_abort(orbi->sc, STAILQ_NEXT(orbi, link));
}
- orbi->refcount --;
+ orbi->refcount--;
ccb = orbi->ccb;
if (orbi->refcount == 0) {
@@ -916,7 +916,7 @@ sbp_targ_abort_ccb(struct sbp_targ_softc *sc, union ccb *ccb)
found = 1;
SLIST_REMOVE_HEAD(list, sim_links.sle);
} else {
- while(curelm != NULL) {
+ while (curelm != NULL) {
struct ccb_hdr *nextelm;
nextelm = SLIST_NEXT(curelm, sim_links.sle);
@@ -982,7 +982,7 @@ sbp_targ_xfer_buf(struct orb_info *orbi, u_int offset,
if (xfer == NULL) {
printf("%s: xfer == NULL", __func__);
/* XXX what should we do?? */
- orbi->refcount --;
+ orbi->refcount--;
}
off += len;
}
@@ -1354,7 +1354,7 @@ sbp_targ_action1(struct cam_sim *sim, union ccb *ccb)
ccb->ccb_h.status = CAM_UA_ABORT;
break;
default:
- printf("%s: aborting unknown function %d\n",
+ printf("%s: aborting unknown function %d\n",
__func__, accb->ccb_h.func_code);
ccb->ccb_h.status = CAM_REQ_INVALID;
break;
@@ -1464,7 +1464,7 @@ sbp_targ_cmd_handler(struct fw_xfer *xfer)
orb = orbi->orb;
/* swap payload except SCSI command */
- for (i = 0; i < 5; i ++)
+ for (i = 0; i < 5; i++)
orb[i] = ntohl(orb[i]);
orb4 = (struct corb4 *)&orb[4];
@@ -1545,12 +1545,12 @@ sbp_targ_get_login(struct sbp_targ_softc *sc, struct fw_device *fwdev, int lun)
int i;
lstate = sc->lstate[lun];
-
+
STAILQ_FOREACH(login, &lstate->logins, link)
if (login->fwdev == fwdev)
return (login);
- for (i = 0; i < MAX_LOGINS; i ++)
+ for (i = 0; i < MAX_LOGINS; i++)
if (sc->logins[i] == NULL)
goto found;
@@ -1607,7 +1607,7 @@ sbp_targ_mgm_handler(struct fw_xfer *xfer)
orb = orbi->orb;
/* swap payload */
- for (i = 0; i < 8; i ++) {
+ for (i = 0; i < 8; i++) {
orb[i] = ntohl(orb[i]);
}
orb4 = (struct morb4 *)&orb[4];
@@ -1628,10 +1628,10 @@ sbp_targ_mgm_handler(struct fw_xfer *xfer)
lstate = orbi->sc->lstate[lun];
if (lun >= MAX_LUN || lstate == NULL ||
- (exclusive &&
+ (exclusive &&
STAILQ_FIRST(&lstate->logins) != NULL &&
STAILQ_FIRST(&lstate->logins)->fwdev != orbi->fwdev)
- ) {
+ ) {
/* error */
orbi->status.dead = 1;
orbi->status.status = STATUS_ACCESS_DENY;
@@ -1819,16 +1819,16 @@ sbp_targ_cmd(struct fw_xfer *xfer, struct fw_device *fwdev, int login_id,
int rtcode = 0;
if (login_id < 0 || login_id >= MAX_LOGINS)
- return(RESP_ADDRESS_ERROR);
+ return (RESP_ADDRESS_ERROR);
sc = (struct sbp_targ_softc *)xfer->sc;
login = sc->logins[login_id];
if (login == NULL)
- return(RESP_ADDRESS_ERROR);
+ return (RESP_ADDRESS_ERROR);
if (login->fwdev != fwdev) {
/* XXX */
- return(RESP_ADDRESS_ERROR);
+ return (RESP_ADDRESS_ERROR);
}
switch (reg) {
@@ -1895,17 +1895,17 @@ sbp_targ_mgm(struct fw_xfer *xfer, struct fw_device *fwdev)
sc = (struct sbp_targ_softc *)xfer->sc;
fp = &xfer->recv.hdr;
- if (fp->mode.wreqb.tcode != FWTCODE_WREQB){
+ if (fp->mode.wreqb.tcode != FWTCODE_WREQB) {
printf("%s: tcode = %d\n", __func__, fp->mode.wreqb.tcode);
- return(RESP_TYPE_ERROR);
+ return (RESP_TYPE_ERROR);
}
sbp_targ_fetch_orb(sc, fwdev,
ntohl(xfer->recv.payload[0]),
ntohl(xfer->recv.payload[1]),
NULL, FETCH_MGM);
-
- return(0);
+
+ return (0);
}
static void
@@ -2023,9 +2023,9 @@ sbp_targ_detach(device_t dev)
xpt_free_path(sc->path);
xpt_bus_deregister(cam_sim_path(sc->sim));
SBP_UNLOCK(sc);
- cam_sim_free(sc->sim, /*free_devq*/TRUE);
+ cam_sim_free(sc->sim, /*free_devq*/TRUE);
- for (i = 0; i < MAX_LUN; i ++) {
+ for (i = 0; i < MAX_LUN; i++) {
lstate = sc->lstate[i];
if (lstate != NULL) {
xpt_free_path(lstate->path);
@@ -2036,7 +2036,7 @@ sbp_targ_detach(device_t dev)
xpt_free_path(sc->black_hole->path);
free(sc->black_hole, M_SBP_TARG);
}
-
+
fw_bindremove(sc->fd.fc, &sc->fwb);
fw_xferlist_remove(&sc->fwb.xferlist);
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 48bf8e9..947f057 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -1008,7 +1008,7 @@ fxp_detach(device_t dev)
#ifdef DEVICE_POLLING
if (if_getcapenable(sc->ifp) & IFCAP_POLLING)
- ether_poll_deregister_drv(sc->ifp);
+ ether_poll_deregister(sc->ifp);
#endif
FXP_LOCK(sc);
@@ -1670,7 +1670,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head)
}
#ifdef DEVICE_POLLING
-static poll_handler_drv_t fxp_poll;
+static poll_handler_t fxp_poll;
static int
fxp_poll(if_t ifp, enum poll_cmd cmd, int count)
@@ -2890,7 +2890,7 @@ fxp_ioctl(if_t ifp, u_long command, caddr_t data)
#ifdef DEVICE_POLLING
if (mask & IFCAP_POLLING) {
if (ifr->ifr_reqcap & IFCAP_POLLING) {
- error = ether_poll_register_drv(fxp_poll, ifp);
+ error = ether_poll_register(fxp_poll, ifp);
if (error)
return(error);
FXP_LOCK(sc);
@@ -2899,7 +2899,7 @@ fxp_ioctl(if_t ifp, u_long command, caddr_t data)
if_setcapenablebit(ifp, IFCAP_POLLING, 0);
FXP_UNLOCK(sc);
} else {
- error = ether_poll_deregister_drv(ifp);
+ error = ether_poll_deregister(ifp);
/* Enable interrupts in any case */
FXP_LOCK(sc);
CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, 0);
diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c
index eceac6c..72e2559 100644
--- a/sys/dev/ie/if_ie.c
+++ b/sys/dev/ie/if_ie.c
@@ -949,6 +949,8 @@ iestart_locked(struct ifnet *ifp)
if (!m)
break;
+ BPF_MTAP(ifp, m);
+
buffer = sc->xmit_cbuffs[sc->xmit_count];
len = 0;
@@ -961,13 +963,6 @@ iestart_locked(struct ifnet *ifp)
m_freem(m0);
len = max(len, ETHER_MIN_LEN);
- /*
- * See if bpf is listening on this interface, let it see the
- * packet before we commit it to the wire.
- */
- BPF_TAP(sc->ifp,
- (void *)sc->xmit_cbuffs[sc->xmit_count], len);
-
sc->xmit_buffs[sc->xmit_count]->ie_xmit_flags =
IE_XMIT_LAST|len;
sc->xmit_buffs[sc->xmit_count]->ie_xmit_next = 0xffff;
diff --git a/sys/dev/iscsi_initiator/isc_cam.c b/sys/dev/iscsi_initiator/isc_cam.c
index 8f8bd64..6089694 100644
--- a/sys/dev/iscsi_initiator/isc_cam.c
+++ b/sys/dev/iscsi_initiator/isc_cam.c
@@ -125,7 +125,7 @@ scan_callback(struct cam_periph *periph, union ccb *ccb)
debug_called(8);
- free(ccb, M_TEMP);
+ xpt_free_ccb(ccb);
if(sp->flags & ISC_SCANWAIT) {
sp->flags &= ~ISC_SCANWAIT;
@@ -141,30 +141,15 @@ ic_scan(isc_session_t *sp)
debug_called(8);
sdebug(2, "scanning sid=%d", sp->sid);
- if((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO)) == NULL) {
- xdebug("scan failed (can't allocate CCB)");
- return ENOMEM; // XXX
- }
-
sp->flags &= ~ISC_CAMDEVS;
sp->flags |= ISC_SCANWAIT;
- CAM_LOCK(sp);
- if(xpt_create_path(&sp->cam_path, NULL, cam_sim_path(sp->cam_sim),
- 0, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
- xdebug("can't create cam path");
- CAM_UNLOCK(sp);
- free(ccb, M_TEMP);
- return ENODEV; // XXX
- }
- xpt_setup_ccb(&ccb->ccb_h, sp->cam_path, 5/*priority (low)*/);
- ccb->ccb_h.func_code = XPT_SCAN_BUS;
+ ccb = xpt_alloc_ccb();
+ ccb->ccb_h.path = sp->cam_path;
ccb->ccb_h.cbfcnp = scan_callback;
- ccb->crcn.flags = CAM_FLAG_NONE;
ccb->ccb_h.spriv_ptr0 = sp;
- xpt_action(ccb);
- CAM_UNLOCK(sp);
+ xpt_rescan(ccb);
while(sp->flags & ISC_SCANWAIT)
tsleep(sp, PRIBIO, "ffp", 5*hz); // the timeout time should
@@ -374,6 +359,16 @@ ic_init(isc_session_t *sp)
return ENXIO;
}
sp->cam_sim = sim;
+ if(xpt_create_path(&sp->cam_path, NULL, cam_sim_path(sp->cam_sim),
+ CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+ xpt_bus_deregister(cam_sim_path(sp->cam_sim));
+ cam_sim_free(sim, /*free_devq*/TRUE);
+ CAM_UNLOCK(sp);
+#if __FreeBSD_version >= 700000
+ mtx_destroy(&sp->cam_mtx);
+#endif
+ return ENXIO;
+ }
CAM_UNLOCK(sp);
sdebug(1, "cam subsystem initialized");
diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c
index 9b4555d..6f25c0a 100644
--- a/sys/dev/ixgb/if_ixgb.c
+++ b/sys/dev/ixgb/if_ixgb.c
@@ -97,6 +97,7 @@ static void ixgb_intr(void *);
static void ixgb_start(struct ifnet *);
static void ixgb_start_locked(struct ifnet *);
static int ixgb_ioctl(struct ifnet *, IOCTL_CMD_TYPE, caddr_t);
+static uint64_t ixgb_get_counter(struct ifnet *, ift_counter);
static void ixgb_watchdog(struct adapter *);
static void ixgb_init(void *);
static void ixgb_init_locked(struct adapter *);
@@ -643,7 +644,7 @@ ixgb_watchdog(struct adapter *adapter)
ixgb_init_locked(adapter);
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
return;
}
@@ -1355,6 +1356,7 @@ ixgb_setup_interface(device_t dev, struct adapter * adapter)
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = ixgb_ioctl;
ifp->if_start = ixgb_start;
+ ifp->if_get_counter = ixgb_get_counter;
ifp->if_snd.ifq_maxlen = adapter->num_tx_desc - 1;
#if __FreeBSD_version < 500000
@@ -2326,7 +2328,6 @@ ixgb_write_pci_cfg(struct ixgb_hw * hw,
static void
ixgb_update_stats_counters(struct adapter * adapter)
{
- struct ifnet *ifp;
adapter->stats.crcerrs += IXGB_READ_REG(&adapter->hw, CRCERRS);
adapter->stats.gprcl += IXGB_READ_REG(&adapter->hw, GPRCL);
@@ -2389,29 +2390,37 @@ ixgb_update_stats_counters(struct adapter * adapter)
adapter->stats.pfrc += IXGB_READ_REG(&adapter->hw, PFRC);
adapter->stats.pftc += IXGB_READ_REG(&adapter->hw, PFTC);
adapter->stats.mcfrc += IXGB_READ_REG(&adapter->hw, MCFRC);
+}
- ifp = adapter->ifp;
-
- /* Fill out the OS statistics structure */
- ifp->if_ipackets = adapter->stats.gprcl;
- ifp->if_opackets = adapter->stats.gptcl;
- ifp->if_ibytes = adapter->stats.gorcl;
- ifp->if_obytes = adapter->stats.gotcl;
- ifp->if_imcasts = adapter->stats.mprcl;
- ifp->if_collisions = 0;
-
- /* Rx Errors */
- ifp->if_ierrors =
- adapter->dropped_pkts +
- adapter->stats.crcerrs +
- adapter->stats.rnbc +
- adapter->stats.mpc +
- adapter->stats.rlec;
-
+static uint64_t
+ixgb_get_counter(struct ifnet *ifp, ift_counter cnt)
+{
+ struct adapter *adapter;
+ adapter = if_getsoftc(ifp);
+
+ switch (cnt) {
+ case IFCOUNTER_IPACKETS:
+ return (adapter->stats.gprcl);
+ case IFCOUNTER_OPACKETS:
+ return ( adapter->stats.gptcl);
+ case IFCOUNTER_IBYTES:
+ return (adapter->stats.gorcl);
+ case IFCOUNTER_OBYTES:
+ return (adapter->stats.gotcl);
+ case IFCOUNTER_IMCASTS:
+ return ( adapter->stats.mprcl);
+ case IFCOUNTER_COLLISIONS:
+ return (0);
+ case IFCOUNTER_IERRORS:
+ return (adapter->dropped_pkts + adapter->stats.crcerrs +
+ adapter->stats.rnbc + adapter->stats.mpc +
+ adapter->stats.rlec);
+ default:
+ return (if_get_counter_default(ifp, cnt));
+ }
}
-
/**********************************************************************
*
* This routine is called only when ixgb_display_debug_stats is enabled.
diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c
index 279dac2..d7371a8 100644
--- a/sys/dev/ixgbe/ixgbe.c
+++ b/sys/dev/ixgbe/ixgbe.c
@@ -120,6 +120,7 @@ static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t);
static void ixgbe_init(void *);
static void ixgbe_init_locked(struct adapter *);
static void ixgbe_stop(void *);
+static uint64_t ixgbe_get_counter(struct ifnet *, ift_counter);
static void ixgbe_media_status(struct ifnet *, struct ifmediareq *);
static int ixgbe_media_change(struct ifnet *);
static void ixgbe_identify_hardware(struct adapter *);
@@ -2721,6 +2722,7 @@ ixgbe_setup_interface(device_t dev, struct adapter *adapter)
ifp->if_softc = adapter;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = ixgbe_ioctl;
+ ifp->if_get_counter = ixgbe_get_counter;
#ifndef IXGBE_LEGACY_TX
ifp->if_transmit = ixgbe_mq_start;
ifp->if_qflush = ixgbe_qflush;
@@ -5364,10 +5366,8 @@ ixgbe_reinit_fdir(void *context, int pending)
static void
ixgbe_update_stats_counters(struct adapter *adapter)
{
- struct ifnet *ifp = adapter->ifp;
struct ixgbe_hw *hw = &adapter->hw;
u32 missed_rx = 0, bprc, lxon, lxoff, total;
- u64 total_missed_rx = 0;
adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
adapter->stats.illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC);
@@ -5386,8 +5386,6 @@ ixgbe_update_stats_counters(struct adapter *adapter)
missed_rx += mp;
/* global total per queue */
adapter->stats.mpc[i] += mp;
- /* Running comprehensive total for stats display */
- total_missed_rx += adapter->stats.mpc[i];
if (hw->mac.type == ixgbe_mac_82598EB) {
adapter->stats.rnbc[i] +=
IXGBE_READ_REG(hw, IXGBE_RNBC(i));
@@ -5497,19 +5495,41 @@ ixgbe_update_stats_counters(struct adapter *adapter)
adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC);
adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC);
}
+}
- /* Fill out the OS statistics structure */
- ifp->if_ipackets = adapter->stats.gprc;
- ifp->if_opackets = adapter->stats.gptc;
- ifp->if_ibytes = adapter->stats.gorc;
- ifp->if_obytes = adapter->stats.gotc;
- ifp->if_imcasts = adapter->stats.mprc;
- ifp->if_omcasts = adapter->stats.mptc;
- ifp->if_collisions = 0;
-
- /* Rx Errors */
- ifp->if_iqdrops = total_missed_rx;
- ifp->if_ierrors = adapter->stats.crcerrs + adapter->stats.rlec;
+static uint64_t
+ixgbe_get_counter(struct ifnet *ifp, ift_counter cnt)
+{
+ struct adapter *adapter;
+ uint64_t rv;
+
+ adapter = if_getsoftc(ifp);
+
+ switch (cnt) {
+ case IFCOUNTER_IPACKETS:
+ return (adapter->stats.gprc);
+ case IFCOUNTER_OPACKETS:
+ return (adapter->stats.gptc);
+ case IFCOUNTER_IBYTES:
+ return (adapter->stats.gorc);
+ case IFCOUNTER_OBYTES:
+ return (adapter->stats.gotc);
+ case IFCOUNTER_IMCASTS:
+ return (adapter->stats.mprc);
+ case IFCOUNTER_OMCASTS:
+ return (adapter->stats.mptc);
+ case IFCOUNTER_COLLISIONS:
+ return (0);
+ case IFCOUNTER_IQDROPS:
+ rv = 0;
+ for (int i = 0; i < 8; i++)
+ rv += adapter->stats.mpc[i];
+ return (rv);
+ case IFCOUNTER_IERRORS:
+ return (adapter->stats.crcerrs + adapter->stats.rlec);
+ default:
+ return (if_get_counter_default(ifp, cnt));
+ }
}
/** ixgbe_sysctl_tdh_handler - Handler function
diff --git a/sys/dev/ixgbe/ixv.c b/sys/dev/ixgbe/ixv.c
index ed137f51..296138e 100644
--- a/sys/dev/ixgbe/ixv.c
+++ b/sys/dev/ixgbe/ixv.c
@@ -634,9 +634,9 @@ ixv_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr, struct mbuf *m)
}
drbr_advance(ifp, txr->br);
enqueued++;
- ifp->if_obytes += next->m_pkthdr.len;
+ if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len);
if (next->m_flags & M_MCAST)
- ifp->if_omcasts++;
+ if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
/* Send a copy of the frame to the BPF listener */
ETHER_BPF_MTAP(ifp, next);
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
@@ -2651,7 +2651,7 @@ ixv_txeof(struct tx_ring *txr)
tx_desc =
(struct ixgbe_legacy_tx_desc *)&txr->tx_base[first];
}
- ++ifp->if_opackets;
+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
/* See if there is more work now */
last = tx_buffer->eop_index;
if (last != -1) {
@@ -3341,7 +3341,7 @@ ixv_rxeof(struct ix_queue *que, int count)
/* Make sure all parts of a bad packet are discarded */
if (((staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) ||
(rxr->discard)) {
- ifp->if_ierrors++;
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
rxr->rx_discarded++;
if (!eop)
rxr->discard = TRUE;
@@ -3455,7 +3455,7 @@ ixv_rxeof(struct ix_queue *que, int count)
/* Sending this frame? */
if (eop) {
sendmp->m_pkthdr.rcvif = ifp;
- ifp->if_ipackets++;
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
rxr->rx_packets++;
/* capture data for AIM */
rxr->bytes += sendmp->m_pkthdr.len;
diff --git a/sys/dev/ixl/i40e_osdep.h b/sys/dev/ixl/i40e_osdep.h
index 97908ba..895bf83 100755
--- a/sys/dev/ixl/i40e_osdep.h
+++ b/sys/dev/ixl/i40e_osdep.h
@@ -152,6 +152,7 @@ struct i40e_osdep
bus_space_tag_t mem_bus_space_tag;
bus_space_handle_t mem_bus_space_handle;
bus_size_t mem_bus_space_size;
+ uint32_t flush_reg;
struct device *dev;
};
@@ -208,6 +209,13 @@ wr32_osdep(struct i40e_osdep *osdep, uint32_t reg, uint32_t value)
osdep->mem_bus_space_handle, reg, value);
}
+static __inline void
+ixl_flush_osdep(struct i40e_osdep *osdep)
+{
+
+ rd32_osdep(osdep, osdep->flush_reg);
+}
+
#define rd32(a, reg) rd32_osdep((a)->back, (reg))
#define wr32(a, reg, value) wr32_osdep((a)->back, (reg), (value))
@@ -221,9 +229,6 @@ wr32_osdep(struct i40e_osdep *osdep, uint32_t reg, uint32_t value)
((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \
reg, value))
-#define ixl_flush(a) (\
- bus_space_read_4( ((struct i40e_osdep *)(a)->back)->mem_bus_space_tag, \
- ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \
- I40E_GLGEN_STAT))
+#define ixl_flush(a) ixl_flush_osdep((a)->back)
#endif /* _I40E_OSDEP_H_ */
diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c
index abae7a5..8d1100c 100755
--- a/sys/dev/ixl/if_ixl.c
+++ b/sys/dev/ixl/if_ixl.c
@@ -2177,6 +2177,7 @@ ixl_allocate_pci_resources(struct ixl_pf *pf)
pf->osdep.mem_bus_space_handle =
rman_get_bushandle(pf->pci_mem);
pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem);
+ pf->osdep.flush_reg = I40E_GLGEN_STAT;
pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle;
pf->hw.back = &pf->osdep;
@@ -2275,6 +2276,10 @@ ixl_setup_interface(device_t dev, struct ixl_vsi *vsi)
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = ixl_ioctl;
+#if __FreeBSD_version >= 1100000
+ if_setgetcounterfn(ifp, ixl_get_counter);
+#endif
+
ifp->if_transmit = ixl_mq_start;
ifp->if_qflush = ixl_qflush;
@@ -3700,7 +3705,6 @@ ixl_update_stats_counters(struct ixl_pf *pf)
{
struct i40e_hw *hw = &pf->hw;
struct ixl_vsi *vsi = &pf->vsi;
- struct ifnet *ifp = vsi->ifp;
struct i40e_hw_port_stats *nsd = &pf->stats;
struct i40e_hw_port_stats *osd = &pf->stats_offsets;
@@ -3893,7 +3897,7 @@ ixl_update_stats_counters(struct ixl_pf *pf)
/* OS statistics */
// ERJ - these are per-port, update all vsis?
- ifp->if_ierrors = nsd->crc_errors + nsd->illegal_bytes;
+ IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes);
}
/*
@@ -4027,13 +4031,16 @@ void ixl_update_eth_stats(struct ixl_vsi *vsi)
{
struct ixl_pf *pf = (struct ixl_pf *)vsi->back;
struct i40e_hw *hw = &pf->hw;
- struct ifnet *ifp = vsi->ifp;
struct i40e_eth_stats *es;
struct i40e_eth_stats *oes;
+ int i;
+ uint64_t tx_discards;
+ struct i40e_hw_port_stats *nsd;
u16 stat_idx = vsi->info.stat_counter_idx;
es = &vsi->eth_stats;
oes = &vsi->eth_stats_offsets;
+ nsd = &pf->stats;
/* Gather up the stats that the hw collects */
ixl_stat_update32(hw, I40E_GLV_TEPC(stat_idx),
@@ -4078,22 +4085,27 @@ void ixl_update_eth_stats(struct ixl_vsi *vsi)
&oes->tx_broadcast, &es->tx_broadcast);
vsi->stat_offsets_loaded = true;
+ tx_discards = es->tx_discards + nsd->tx_dropped_link_down;
+ for (i = 0; i < vsi->num_queues; i++)
+ tx_discards += vsi->queues[i].txr.br->br_drops;
+
/* Update ifnet stats */
- ifp->if_ipackets = es->rx_unicast +
+ IXL_SET_IPACKETS(vsi, es->rx_unicast +
es->rx_multicast +
- es->rx_broadcast;
- ifp->if_opackets = es->tx_unicast +
+ es->rx_broadcast);
+ IXL_SET_OPACKETS(vsi, es->tx_unicast +
es->tx_multicast +
- es->tx_broadcast;
- ifp->if_ibytes = es->rx_bytes;
- ifp->if_obytes = es->tx_bytes;
- ifp->if_imcasts = es->rx_multicast;
- ifp->if_omcasts = es->tx_multicast;
-
- ifp->if_oerrors = es->tx_errors;
- ifp->if_iqdrops = es->rx_discards;
- ifp->if_noproto = es->rx_unknown_protocol;
- ifp->if_collisions = 0;
+ es->tx_broadcast);
+ IXL_SET_IBYTES(vsi, es->rx_bytes);
+ IXL_SET_OBYTES(vsi, es->tx_bytes);
+ IXL_SET_IMCASTS(vsi, es->rx_multicast);
+ IXL_SET_OMCASTS(vsi, es->tx_multicast);
+
+ IXL_SET_OERRORS(vsi, es->tx_errors);
+ IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards);
+ IXL_SET_OQDROPS(vsi, tx_discards);
+ IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol);
+ IXL_SET_COLLISIONS(vsi, 0);
}
/**
diff --git a/sys/dev/ixl/if_ixlv.c b/sys/dev/ixl/if_ixlv.c
index a29d669..bd3c202 100644
--- a/sys/dev/ixl/if_ixlv.c
+++ b/sys/dev/ixl/if_ixlv.c
@@ -1137,6 +1137,7 @@ ixlv_allocate_pci_resources(struct ixlv_sc *sc)
sc->osdep.mem_bus_space_handle =
rman_get_bushandle(sc->pci_mem);
sc->osdep.mem_bus_space_size = rman_get_size(sc->pci_mem);
+ sc->osdep.flush_reg = I40E_VFGEN_RSTAT;
sc->hw.hw_addr = (u8 *) &sc->osdep.mem_bus_space_handle;
sc->hw.back = &sc->osdep;
@@ -1355,6 +1356,10 @@ ixlv_setup_interface(device_t dev, struct ixlv_sc *sc)
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = ixlv_ioctl;
+#if __FreeBSD_version >= 1100000
+ if_setgetcounterfn(ifp, ixl_get_counter);
+#endif
+
ifp->if_transmit = ixl_mq_start;
ifp->if_qflush = ixl_qflush;
diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h
index 69be008..c240b02 100644
--- a/sys/dev/ixl/ixl.h
+++ b/sys/dev/ixl/ixl.h
@@ -264,6 +264,35 @@
#define IXL_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx)
#define IXL_RX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx)
+#if __FreeBSD_version >= 1100000
+#define IXL_SET_IPACKETS(vsi, count) (vsi)->ipackets = (count)
+#define IXL_SET_IERRORS(vsi, count) (vsi)->ierrors = (count)
+#define IXL_SET_OPACKETS(vsi, count) (vsi)->opackets = (count)
+#define IXL_SET_OERRORS(vsi, count) (vsi)->oerrors = (count)
+#define IXL_SET_COLLISIONS(vsi, count) /* Do nothing; collisions is always 0. */
+#define IXL_SET_IBYTES(vsi, count) (vsi)->ibytes = (count)
+#define IXL_SET_OBYTES(vsi, count) (vsi)->obytes = (count)
+#define IXL_SET_IMCASTS(vsi, count) (vsi)->imcasts = (count)
+#define IXL_SET_OMCASTS(vsi, count) (vsi)->omcasts = (count)
+#define IXL_SET_IQDROPS(vsi, count) (vsi)->iqdrops = (count)
+#define IXL_SET_OQDROPS(vsi, count) (vsi)->iqdrops = (count)
+#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count)
+#else
+#define IXL_SET_IPACKETS(vsi, count) (vsi)->ifp->if_ipackets = (count)
+#define IXL_SET_IERRORS(vsi, count) (vsi)->ifp->if_ierrors = (count)
+#define IXL_SET_OPACKETS(vsi, count) (vsi)->ifp->if_opackets = (count)
+#define IXL_SET_OERRORS(vsi, count) (vsi)->ifp->if_oerrors = (count)
+#define IXL_SET_COLLISIONS(vsi, count) (vsi)->ifp->if_collisions = (count)
+#define IXL_SET_IBYTES(vsi, count) (vsi)->ifp->if_ibytes = (count)
+#define IXL_SET_OBYTES(vsi, count) (vsi)->ifp->if_obytes = (count)
+#define IXL_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count)
+#define IXL_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count)
+#define IXL_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count)
+#define IXL_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops)
+#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count)
+#endif
+
+
/*
*****************************************************************************
* vendor_info_array
@@ -447,6 +476,17 @@ struct ixl_vsi {
struct i40e_eth_stats eth_stats;
struct i40e_eth_stats eth_stats_offsets;
bool stat_offsets_loaded;
+ u64 ipackets;
+ u64 ierrors;
+ u64 opackets;
+ u64 oerrors;
+ u64 ibytes;
+ u64 obytes;
+ u64 imcasts;
+ u64 omcasts;
+ u64 iqdrops;
+ u64 oqdrops;
+ u64 noproto;
/* Driver statistics */
u64 hw_filters_del;
@@ -554,5 +594,8 @@ void ixl_free_que_rx(struct ixl_queue *);
#ifdef IXL_FDIR
void ixl_atr(struct ixl_queue *, struct tcphdr *, int);
#endif
+#if __FreeBSD_version >= 1100000
+uint64_t ixl_get_counter(if_t ifp, ift_counter cnt);
+#endif
#endif /* _IXL_H_ */
diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c
index 306d4ec..b804c76 100755
--- a/sys/dev/ixl/ixl_txrx.c
+++ b/sys/dev/ixl/ixl_txrx.c
@@ -783,8 +783,6 @@ ixl_get_tx_head(struct ixl_queue *que)
bool
ixl_txeof(struct ixl_queue *que)
{
- struct ixl_vsi *vsi = que->vsi;
- struct ifnet *ifp = vsi->ifp;
struct tx_ring *txr = &que->txr;
u32 first, last, head, done, processed;
struct ixl_tx_buf *buf;
@@ -857,7 +855,6 @@ ixl_txeof(struct ixl_queue *que)
tx_desc = &txr->base[first];
}
++txr->packets;
- ++ifp->if_opackets;
/* See if there is more work now */
last = buf->eop_index;
if (last != -1) {
@@ -1420,7 +1417,6 @@ ixl_rxeof(struct ixl_queue *que, int count)
** error results.
*/
if (eop && (error & (1 << I40E_RX_DESC_ERROR_RXE_SHIFT))) {
- ifp->if_ierrors++;
rxr->discarded++;
ixl_rx_discard(rxr, i);
goto next_desc;
@@ -1529,7 +1525,6 @@ ixl_rxeof(struct ixl_queue *que, int count)
if (eop) {
sendmp->m_pkthdr.rcvif = ifp;
/* gather stats */
- ifp->if_ipackets++;
rxr->rx_packets++;
rxr->rx_bytes += sendmp->m_pkthdr.len;
/* capture data for dynamic ITR adjustment */
@@ -1625,3 +1620,43 @@ ixl_rx_checksum(struct mbuf * mp, u32 status, u32 error, u8 ptype)
}
return;
}
+
+#if __FreeBSD_version >= 1100000
+uint64_t
+ixl_get_counter(if_t ifp, ift_counter cnt)
+{
+ struct ixl_vsi *vsi;
+
+ vsi = if_getsoftc(ifp);
+
+ switch (cnt) {
+ case IFCOUNTER_IPACKETS:
+ return (vsi->ipackets);
+ case IFCOUNTER_IERRORS:
+ return (vsi->ierrors);
+ case IFCOUNTER_OPACKETS:
+ return (vsi->opackets);
+ case IFCOUNTER_OERRORS:
+ return (vsi->oerrors);
+ case IFCOUNTER_COLLISIONS:
+ /* Collisions are by standard impossible in 40G/10G Ethernet */
+ return (0);
+ case IFCOUNTER_IBYTES:
+ return (vsi->ibytes);
+ case IFCOUNTER_OBYTES:
+ return (vsi->obytes);
+ case IFCOUNTER_IMCASTS:
+ return (vsi->imcasts);
+ case IFCOUNTER_OMCASTS:
+ return (vsi->omcasts);
+ case IFCOUNTER_IQDROPS:
+ return (vsi->iqdrops);
+ case IFCOUNTER_OQDROPS:
+ return (vsi->oqdrops);
+ case IFCOUNTER_NOPROTO:
+ return (vsi->noproto);
+ default:
+ return (if_get_counter_default(ifp, cnt));
+ }
+}
+#endif
diff --git a/sys/dev/ixl/ixlvc.c b/sys/dev/ixl/ixlvc.c
index 1f912b5..ef69a82 100644
--- a/sys/dev/ixl/ixlvc.c
+++ b/sys/dev/ixl/ixlvc.c
@@ -837,22 +837,33 @@ ixlv_request_stats(struct ixlv_sc *sc)
void
ixlv_update_stats_counters(struct ixlv_sc *sc, struct i40e_eth_stats *es)
{
- struct ifnet *ifp = sc->vsi.ifp;
+ struct ixl_vsi *vsi;
+ uint64_t tx_discards;
+ int i;
- ifp->if_ipackets = es->rx_unicast +
+ vsi = &sc->vsi;
+
+ tx_discards = es->tx_discards;
+ for (i = 0; i < sc->vsi.num_queues; i++)
+ tx_discards += sc->vsi.queues[i].txr.br->br_drops;
+
+ /* Update ifnet stats */
+ IXL_SET_IPACKETS(vsi, es->rx_unicast +
es->rx_multicast +
- es->rx_broadcast;
- ifp->if_opackets = es->tx_unicast +
+ es->rx_broadcast);
+ IXL_SET_OPACKETS(vsi, es->tx_unicast +
es->tx_multicast +
- es->tx_broadcast;
- ifp->if_ibytes = es->rx_bytes;
- ifp->if_obytes = es->tx_bytes;
- ifp->if_imcasts = es->rx_multicast;
- ifp->if_omcasts = es->tx_multicast;
-
- ifp->if_oerrors = es->tx_errors;
- ifp->if_iqdrops = es->rx_discards;
- ifp->if_noproto = es->rx_unknown_protocol;
+ es->tx_broadcast);
+ IXL_SET_IBYTES(vsi, es->rx_bytes);
+ IXL_SET_OBYTES(vsi, es->tx_bytes);
+ IXL_SET_IMCASTS(vsi, es->rx_multicast);
+ IXL_SET_OMCASTS(vsi, es->tx_multicast);
+
+ IXL_SET_OERRORS(vsi, es->tx_errors);
+ IXL_SET_IQDROPS(vsi, es->rx_discards);
+ IXL_SET_OQDROPS(vsi, tx_discards);
+ IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol);
+ IXL_SET_COLLISIONS(vsi, 0);
sc->vsi.eth_stats = *es;
}
diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c
index fda21c0..1675f03 100644
--- a/sys/dev/nfe/if_nfe.c
+++ b/sys/dev/nfe/if_nfe.c
@@ -1630,7 +1630,7 @@ nfe_free_tx_ring(struct nfe_softc *sc, struct nfe_tx_ring *ring)
}
#ifdef DEVICE_POLLING
-static poll_handler_drv_t nfe_poll;
+static poll_handler_t nfe_poll;
static int
@@ -1782,7 +1782,7 @@ nfe_ioctl(if_t ifp, u_long cmd, caddr_t data)
#ifdef DEVICE_POLLING
if ((mask & IFCAP_POLLING) != 0) {
if ((ifr->ifr_reqcap & IFCAP_POLLING) != 0) {
- error = ether_poll_register_drv(nfe_poll, ifp);
+ error = ether_poll_register(nfe_poll, ifp);
if (error)
break;
NFE_LOCK(sc);
diff --git a/sys/dev/sfxge/common/efsys.h b/sys/dev/sfxge/common/efsys.h
index 8fd1267..433c40b 100644
--- a/sys/dev/sfxge/common/efsys.h
+++ b/sys/dev/sfxge/common/efsys.h
@@ -53,44 +53,44 @@ extern "C" {
#define EFSYS_HAS_UINT64 1
#define EFSYS_USE_UINT64 0
#if _BYTE_ORDER == _BIG_ENDIAN
-#define EFSYS_IS_BIG_ENDIAN 1
-#define EFSYS_IS_LITTLE_ENDIAN 0
+#define EFSYS_IS_BIG_ENDIAN 1
+#define EFSYS_IS_LITTLE_ENDIAN 0
#elif _BYTE_ORDER == _LITTLE_ENDIAN
-#define EFSYS_IS_BIG_ENDIAN 0
-#define EFSYS_IS_LITTLE_ENDIAN 1
+#define EFSYS_IS_BIG_ENDIAN 0
+#define EFSYS_IS_LITTLE_ENDIAN 1
#endif
#include "efx_types.h"
/* Common code requires this */
#if __FreeBSD_version < 800068
-#define memmove(d, s, l) bcopy(s, d, l)
+#define memmove(d, s, l) bcopy(s, d, l)
#endif
-
+
/* FreeBSD equivalents of Solaris things */
#ifndef _NOTE
-#define _NOTE(s)
+#define _NOTE(s)
#endif
#ifndef B_FALSE
-#define B_FALSE FALSE
+#define B_FALSE FALSE
#endif
#ifndef B_TRUE
-#define B_TRUE TRUE
+#define B_TRUE TRUE
#endif
#ifndef IS_P2ALIGNED
-#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
+#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
#endif
#ifndef P2ROUNDUP
-#define P2ROUNDUP(x, align) (-(-(x) & -(align)))
+#define P2ROUNDUP(x, align) (-(-(x) & -(align)))
#endif
#ifndef IS2P
-#define ISP2(x) (((x) & ((x) - 1)) == 0)
+#define ISP2(x) (((x) & ((x) - 1)) == 0)
#endif
-#define ENOTACTIVE EINVAL
+#define ENOTACTIVE EINVAL
/* Memory type to use on FreeBSD */
MALLOC_DECLARE(M_SFXGE);
@@ -242,7 +242,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#define EFSYS_OPT_PHY_PROPS 0
#define EFSYS_OPT_PHY_BIST 1
#define EFSYS_OPT_PHY_LED_CONTROL 1
-#define EFSYS_OPT_PHY_FLAGS 0
+#define EFSYS_OPT_PHY_FLAGS 0
#define EFSYS_OPT_VPD 1
#define EFSYS_OPT_NVRAM 1
@@ -256,8 +256,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#define EFSYS_OPT_WOL 1
#define EFSYS_OPT_RX_SCALE 1
#define EFSYS_OPT_QSTATS 1
-#define EFSYS_OPT_FILTER 0
-#define EFSYS_OPT_RX_SCATTER 0
+#define EFSYS_OPT_FILTER 0
+#define EFSYS_OPT_RX_SCATTER 0
#define EFSYS_OPT_RX_HDR_SPLIT 0
#define EFSYS_OPT_EV_PREFETCH 0
@@ -272,7 +272,7 @@ typedef struct __efsys_identifier_s efsys_identifier_t;
#ifndef DTRACE_PROBE
-#define EFSYS_PROBE(_name)
+#define EFSYS_PROBE(_name)
#define EFSYS_PROBE1(_name, _type1, _arg1)
@@ -815,16 +815,16 @@ extern void sfxge_err(efsys_identifier_t *, unsigned int,
panic(#_exp); \
} while (0)
-#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \
+#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \
const _t __x = (_t)(_x); \
const _t __y = (_t)(_y); \
if (!(__x _op __y)) \
- panic("assertion failed at %s:%u", __FILE__, __LINE__); \
+ panic("assertion failed at %s:%u", __FILE__, __LINE__); \
} while(0)
-#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t)
-#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t)
-#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t)
+#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t)
+#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t)
+#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t)
#ifdef __cplusplus
}
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c
index 8f2c7bb..c0850ec 100644
--- a/sys/dev/sfxge/sfxge.c
+++ b/sys/dev/sfxge/sfxge.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/taskqueue.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
+#include <sys/syslog.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
@@ -57,16 +58,35 @@ __FBSDID("$FreeBSD$");
#include "sfxge.h"
#include "sfxge_rx.h"
-#define SFXGE_CAP (IFCAP_VLAN_MTU | \
+#define SFXGE_CAP (IFCAP_VLAN_MTU | \
IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | \
IFCAP_JUMBO_MTU | IFCAP_LRO | \
IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE)
-#define SFXGE_CAP_ENABLE SFXGE_CAP
-#define SFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \
+#define SFXGE_CAP_ENABLE SFXGE_CAP
+#define SFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \
IFCAP_JUMBO_MTU | IFCAP_LINKSTATE)
MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver");
+
+SYSCTL_NODE(_hw, OID_AUTO, sfxge, CTLFLAG_RD, 0,
+ "SFXGE driver parameters");
+
+#define SFXGE_PARAM_RX_RING SFXGE_PARAM(rx_ring)
+static int sfxge_rx_ring_entries = SFXGE_NDESCS;
+TUNABLE_INT(SFXGE_PARAM_RX_RING, &sfxge_rx_ring_entries);
+SYSCTL_INT(_hw_sfxge, OID_AUTO, rx_ring, CTLFLAG_RDTUN,
+ &sfxge_rx_ring_entries, 0,
+ "Maximum number of descriptors in a receive ring");
+
+#define SFXGE_PARAM_TX_RING SFXGE_PARAM(tx_ring)
+static int sfxge_tx_ring_entries = SFXGE_NDESCS;
+TUNABLE_INT(SFXGE_PARAM_TX_RING, &sfxge_tx_ring_entries);
+SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, CTLFLAG_RDTUN,
+ &sfxge_tx_ring_entries, 0,
+ "Maximum number of descriptors in a transmit ring");
+
+
static void
sfxge_reset(void *arg, int npending);
@@ -78,7 +98,7 @@ sfxge_start(struct sfxge_softc *sc)
sx_assert(&sc->softc_lock, LA_XLOCKED);
if (sc->init_state == SFXGE_STARTED)
- return 0;
+ return (0);
if (sc->init_state != SFXGE_REGISTERED) {
rc = EINVAL;
@@ -223,7 +243,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
ifp->if_mtu = ifr->ifr_mtu;
error = sfxge_start(sc);
sx_xunlock(&sc->softc_lock);
- if (error) {
+ if (error != 0) {
ifp->if_flags &= ~IFF_UP;
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
if_down(ifp);
@@ -287,7 +307,7 @@ sfxge_ifnet_fini(struct ifnet *ifp)
if_free(ifp);
}
-static int
+static int
sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc)
{
const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp);
@@ -314,8 +334,8 @@ sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc)
ifp->if_qflush = sfxge_if_qflush;
#else
ifp->if_start = sfxge_if_start;
- IFQ_SET_MAXLEN(&ifp->if_snd, SFXGE_NDESCS - 1);
- ifp->if_snd.ifq_drv_maxlen = SFXGE_NDESCS - 1;
+ IFQ_SET_MAXLEN(&ifp->if_snd, sc->txq_entries - 1);
+ ifp->if_snd.ifq_drv_maxlen = sc->txq_entries - 1;
IFQ_SET_READY(&ifp->if_snd);
mtx_init(&sc->tx_lock, "txq", NULL, MTX_DEF);
@@ -324,11 +344,11 @@ sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc)
if ((rc = sfxge_port_ifmedia_init(sc)) != 0)
goto fail;
- return 0;
+ return (0);
fail:
ether_ifdetach(sc->ifnet);
- return rc;
+ return (rc);
}
void
@@ -347,7 +367,7 @@ sfxge_bar_init(struct sfxge_softc *sc)
{
efsys_bar_t *esbp = &sc->bar;
- esbp->esb_rid = PCIR_BAR(EFX_MEM_BAR);
+ esbp->esb_rid = PCIR_BAR(EFX_MEM_BAR);
if ((esbp->esb_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY,
&esbp->esb_rid, RF_ACTIVE)) == NULL) {
device_printf(sc->dev, "Cannot allocate BAR region %d\n",
@@ -386,7 +406,7 @@ sfxge_create(struct sfxge_softc *sc)
device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "stats", CTLFLAG_RD, NULL, "Statistics");
- if (!sc->stats_node) {
+ if (sc->stats_node == NULL) {
error = ENOMEM;
goto fail;
}
@@ -414,6 +434,26 @@ sfxge_create(struct sfxge_softc *sc)
goto fail3;
sc->enp = enp;
+ if (!ISP2(sfxge_rx_ring_entries) ||
+ !(sfxge_rx_ring_entries & EFX_RXQ_NDESCS_MASK)) {
+ log(LOG_ERR, "%s=%d must be power of 2 from %u to %u",
+ SFXGE_PARAM_RX_RING, sfxge_rx_ring_entries,
+ EFX_RXQ_MINNDESCS, EFX_RXQ_MAXNDESCS);
+ error = EINVAL;
+ goto fail_rx_ring_entries;
+ }
+ sc->rxq_entries = sfxge_rx_ring_entries;
+
+ if (!ISP2(sfxge_tx_ring_entries) ||
+ !(sfxge_tx_ring_entries & EFX_TXQ_NDESCS_MASK)) {
+ log(LOG_ERR, "%s=%d must be power of 2 from %u to %u",
+ SFXGE_PARAM_TX_RING, sfxge_tx_ring_entries,
+ EFX_TXQ_MINNDESCS, EFX_TXQ_MAXNDESCS);
+ error = EINVAL;
+ goto fail_tx_ring_entries;
+ }
+ sc->txq_entries = sfxge_tx_ring_entries;
+
/* Initialize MCDI to talk to the microcontroller. */
if ((error = sfxge_mcdi_init(sc)) != 0)
goto fail4;
@@ -486,6 +526,8 @@ fail5:
sfxge_mcdi_fini(sc);
fail4:
+fail_tx_ring_entries:
+fail_rx_ring_entries:
sc->enp = NULL;
efx_nic_destroy(enp);
mtx_destroy(&sc->enp_lock);
@@ -554,14 +596,14 @@ sfxge_vpd_handler(SYSCTL_HANDLER_ARGS)
struct sfxge_softc *sc = arg1;
efx_vpd_value_t value;
int rc;
-
+
value.evv_tag = arg2 >> 16;
value.evv_keyword = arg2 & 0xffff;
if ((rc = efx_vpd_get(sc->enp, sc->vpd_data, sc->vpd_size, &value))
!= 0)
- return rc;
+ return (rc);
- return SYSCTL_OUT(req, value.evv_value, value.evv_length);
+ return (SYSCTL_OUT(req, value.evv_value, value.evv_length));
}
static void
@@ -623,12 +665,12 @@ sfxge_vpd_init(struct sfxge_softc *sc)
for (keyword[1] = 'A'; keyword[1] <= 'Z'; keyword[1]++)
sfxge_vpd_try_add(sc, vpd_list, EFX_VPD_RO, keyword);
- return 0;
-
+ return (0);
+
fail2:
free(sc->vpd_data, M_SFXGE);
fail:
- return rc;
+ return (rc);
}
static void
@@ -745,12 +787,12 @@ sfxge_probe(device_t dev)
pci_device_id = pci_get_device(dev);
rc = efx_family(pci_vendor_id, pci_device_id, &family);
- if (rc)
- return ENXIO;
+ if (rc != 0)
+ return (ENXIO);
KASSERT(family == EFX_FAMILY_SIENA, ("impossible controller family"));
device_set_desc(dev, "Solarflare SFC9000 family");
- return 0;
+ return (0);
}
static device_method_t sfxge_methods[] = {
diff --git a/sys/dev/sfxge/sfxge.h b/sys/dev/sfxge/sfxge.h
index d73d150..69b062a 100644
--- a/sys/dev/sfxge/sfxge.h
+++ b/sys/dev/sfxge/sfxge.h
@@ -30,7 +30,7 @@
*/
#ifndef _SFXGE_H
-#define _SFXGE_H
+#define _SFXGE_H
#include <sys/param.h>
#include <sys/kernel.h>
@@ -53,43 +53,45 @@
/* This should be right on most machines the driver will be used on, and
* we needn't care too much about wasting a few KB per interface.
*/
-#define CACHE_LINE_SIZE 128
+#define CACHE_LINE_SIZE 128
#endif
#ifndef IFCAP_LINKSTATE
-#define IFCAP_LINKSTATE 0
+#define IFCAP_LINKSTATE 0
#endif
#ifndef IFCAP_VLAN_HWTSO
-#define IFCAP_VLAN_HWTSO 0
+#define IFCAP_VLAN_HWTSO 0
#endif
#ifndef IFM_10G_T
-#define IFM_10G_T IFM_UNKNOWN
+#define IFM_10G_T IFM_UNKNOWN
#endif
#ifndef IFM_10G_KX4
-#define IFM_10G_KX4 IFM_10G_CX4
+#define IFM_10G_KX4 IFM_10G_CX4
#endif
#if __FreeBSD_version >= 800054
/* Networking core is multiqueue aware. We can manage our own TX
* queues and use m_pkthdr.flowid.
*/
-#define SFXGE_HAVE_MQ
+#define SFXGE_HAVE_MQ
#endif
#if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \
__FreeBSD_version >= 900003
-#define SFXGE_HAVE_DESCRIBE_INTR
+#define SFXGE_HAVE_DESCRIBE_INTR
#endif
#ifdef IFM_ETH_RXPAUSE
-#define SFXGE_HAVE_PAUSE_MEDIAOPTS
+#define SFXGE_HAVE_PAUSE_MEDIAOPTS
#endif
#ifndef CTLTYPE_U64
-#define CTLTYPE_U64 CTLTYPE_QUAD
+#define CTLTYPE_U64 CTLTYPE_QUAD
#endif
#include "sfxge_rx.h"
#include "sfxge_tx.h"
-#define SFXGE_IP_ALIGN 2
+#define ROUNDUP_POW_OF_TWO(_n) (1ULL << flsl((_n) - 1))
-#define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */
+#define SFXGE_IP_ALIGN 2
+
+#define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */
enum sfxge_evq_state {
SFXGE_EVQ_UNINITIALIZED = 0,
@@ -106,6 +108,7 @@ struct sfxge_evq {
enum sfxge_evq_state init_state;
unsigned int index;
+ unsigned int entries;
efsys_mem_t mem;
unsigned int buf_base_id;
@@ -121,7 +124,6 @@ struct sfxge_evq {
struct sfxge_txq **txqs;
};
-#define SFXGE_NEVS 4096
#define SFXGE_NDESCS 1024
#define SFXGE_MODERATION 30
@@ -133,9 +135,9 @@ enum sfxge_intr_state {
};
struct sfxge_intr_hdl {
- int eih_rid;
- void *eih_tag;
- struct resource *eih_res;
+ int eih_rid;
+ void *eih_tag;
+ struct resource *eih_res;
};
struct sfxge_intr {
@@ -197,9 +199,10 @@ struct sfxge_softc {
device_t dev;
struct sx softc_lock;
enum sfxge_softc_state init_state;
- struct ifnet *ifnet;
+ struct ifnet *ifnet;
unsigned int if_flags;
struct sysctl_oid *stats_node;
+ struct sysctl_oid *txqs_node;
struct task task_reset;
@@ -209,7 +212,10 @@ struct sfxge_softc {
efx_nic_t *enp;
struct mtx enp_lock;
- bus_dma_tag_t parent_dma_tag;
+ unsigned int rxq_entries;
+ unsigned int txq_entries;
+
+ bus_dma_tag_t parent_dma_tag;
efsys_bar_t bar;
struct sfxge_intr intr;
@@ -243,8 +249,12 @@ struct sfxge_softc {
#endif
};
-#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN)
-#define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING)
+#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN)
+#define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING)
+
+#define SFXGE_PARAM(_name) "hw.sfxge." #_name
+
+SYSCTL_DECL(_hw_sfxge);
/*
* From sfxge.c.
@@ -299,6 +309,6 @@ extern void sfxge_mac_link_update(struct sfxge_softc *sc,
extern int sfxge_mac_filter_set(struct sfxge_softc *sc);
extern int sfxge_port_ifmedia_init(struct sfxge_softc *sc);
-#define SFXGE_MAX_MTU (9 * 1024)
+#define SFXGE_MAX_MTU (9 * 1024)
#endif /* _SFXGE_H */
diff --git a/sys/dev/sfxge/sfxge_dma.c b/sys/dev/sfxge/sfxge_dma.c
index 48d02d5..e2bf171 100644
--- a/sys/dev/sfxge/sfxge_dma.c
+++ b/sys/dev/sfxge/sfxge_dma.c
@@ -50,7 +50,7 @@ sfxge_dma_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error)
addr = arg;
- if (error) {
+ if (error != 0) {
*addr = 0;
return;
}
@@ -82,7 +82,7 @@ retry:
return (0);
}
#if defined(__i386__) || defined(__amd64__)
- while (m && seg_count < maxsegs) {
+ while (m != NULL && seg_count < maxsegs) {
/*
* firmware doesn't like empty segments
*/
@@ -164,11 +164,14 @@ sfxge_dma_alloc(struct sfxge_softc *sc, bus_size_t len, efsys_mem_t *esmp)
/*
* The callback gets error information about the mapping
- * and will have set our vaddr to NULL if something went
+ * and will have set esm_addr to 0 if something went
* wrong.
*/
- if (vaddr == NULL)
+ if (esmp->esm_addr == 0) {
+ bus_dmamem_free(esmp->esm_tag, esmp->esm_base, esmp->esm_map);
+ bus_dma_tag_destroy(esmp->esm_tag);
return (ENOMEM);
+ }
esmp->esm_base = vaddr;
@@ -197,7 +200,7 @@ sfxge_dma_init(struct sfxge_softc *sc)
BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
0, /* flags */
NULL, NULL, /* lock, lockarg */
- &sc->parent_dma_tag)) {
+ &sc->parent_dma_tag) != 0) {
device_printf(sc->dev, "Cannot allocate parent DMA tag\n");
return (ENOMEM);
}
diff --git a/sys/dev/sfxge/sfxge_ev.c b/sys/dev/sfxge/sfxge_ev.c
index 77f0a74..7c0aa7f 100644
--- a/sys/dev/sfxge/sfxge_ev.c
+++ b/sys/dev/sfxge/sfxge_ev.c
@@ -102,7 +102,7 @@ sfxge_ev_rx(void *arg, uint32_t label, uint32_t id, uint32_t size,
if (rxq->init_state != SFXGE_RXQ_STARTED)
goto done;
- expected = rxq->pending++ & (SFXGE_NDESCS - 1);
+ expected = rxq->pending++ & rxq->ptr_mask;
if (id != expected) {
evq->exception = B_TRUE;
@@ -226,7 +226,7 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfxge_txq_type label)
KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
(label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label"));
index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES);
- return evq->sc->txq[index];
+ return (evq->sc->txq[index]);
}
static boolean_t
@@ -247,10 +247,10 @@ sfxge_ev_tx(void *arg, uint32_t label, uint32_t id)
if (txq->init_state != SFXGE_TXQ_STARTED)
goto done;
- stop = (id + 1) & (SFXGE_NDESCS - 1);
- id = txq->pending & (SFXGE_NDESCS - 1);
+ stop = (id + 1) & txq->ptr_mask;
+ id = txq->pending & txq->ptr_mask;
- delta = (stop >= id) ? (stop - id) : (SFXGE_NDESCS - id + stop);
+ delta = (stop >= id) ? (stop - id) : (txq->entries - id + stop);
txq->pending += delta;
evq->tx_done++;
@@ -443,7 +443,7 @@ sfxge_ev_stat_handler(SYSCTL_HANDLER_ARGS)
sfxge_ev_stat_update(sc);
- return SYSCTL_OUT(req, &sc->ev_stats[id], sizeof(sc->ev_stats[id]));
+ return (SYSCTL_OUT(req, &sc->ev_stats[id], sizeof(sc->ev_stats[id])));
}
static void
@@ -493,7 +493,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARGS)
sx_xlock(&sc->softc_lock);
- if (req->newptr) {
+ if (req->newptr != NULL) {
if ((error = SYSCTL_IN(req, &moderation, sizeof(moderation)))
!= 0)
goto out;
@@ -520,14 +520,14 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARGS)
out:
sx_xunlock(&sc->softc_lock);
- return error;
+ return (error);
}
static boolean_t
sfxge_ev_initialized(void *arg)
{
struct sfxge_evq *evq;
-
+
evq = (struct sfxge_evq *)arg;
KASSERT(evq->init_state == SFXGE_EVQ_STARTING,
@@ -635,7 +635,7 @@ sfxge_ev_qstop(struct sfxge_softc *sc, unsigned int index)
efx_ev_qdestroy(evq->common);
efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id,
- EFX_EVQ_NBUFS(SFXGE_NEVS));
+ EFX_EVQ_NBUFS(evq->entries));
mtx_unlock(&evq->lock);
}
@@ -654,15 +654,15 @@ sfxge_ev_qstart(struct sfxge_softc *sc, unsigned int index)
("evq->init_state != SFXGE_EVQ_INITIALIZED"));
/* Clear all events. */
- (void)memset(esmp->esm_base, 0xff, EFX_EVQ_SIZE(SFXGE_NEVS));
+ (void)memset(esmp->esm_base, 0xff, EFX_EVQ_SIZE(evq->entries));
/* Program the buffer table. */
if ((rc = efx_sram_buf_tbl_set(sc->enp, evq->buf_base_id, esmp,
- EFX_EVQ_NBUFS(SFXGE_NEVS))) != 0)
- return rc;
+ EFX_EVQ_NBUFS(evq->entries))) != 0)
+ return (rc);
/* Create the common code event queue. */
- if ((rc = efx_ev_qcreate(sc->enp, index, esmp, SFXGE_NEVS,
+ if ((rc = efx_ev_qcreate(sc->enp, index, esmp, evq->entries,
evq->buf_base_id, &evq->common)) != 0)
goto fail;
@@ -705,7 +705,7 @@ fail2:
efx_ev_qdestroy(evq->common);
fail:
efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id,
- EFX_EVQ_NBUFS(SFXGE_NEVS));
+ EFX_EVQ_NBUFS(evq->entries));
return (rc);
}
@@ -746,7 +746,7 @@ sfxge_ev_start(struct sfxge_softc *sc)
/* Initialize the event module */
if ((rc = efx_ev_init(sc->enp)) != 0)
- return rc;
+ return (rc);
/* Start the event queues */
for (index = 0; index < intr->n_alloc; index++) {
@@ -802,15 +802,31 @@ sfxge_ev_qinit(struct sfxge_softc *sc, unsigned int index)
sc->evq[index] = evq;
esmp = &evq->mem;
+ /* Build an event queue with room for one event per tx and rx buffer,
+ * plus some extra for link state events and MCDI completions.
+ * There are three tx queues in the first event queue and one in
+ * other.
+ */
+ if (index == 0)
+ evq->entries =
+ ROUNDUP_POW_OF_TWO(sc->rxq_entries +
+ 3 * sc->txq_entries +
+ 128);
+ else
+ evq->entries =
+ ROUNDUP_POW_OF_TWO(sc->rxq_entries +
+ sc->txq_entries +
+ 128);
+
/* Initialise TX completion list */
evq->txqs = &evq->txq;
/* Allocate DMA space. */
- if ((rc = sfxge_dma_alloc(sc, EFX_EVQ_SIZE(SFXGE_NEVS), esmp)) != 0)
+ if ((rc = sfxge_dma_alloc(sc, EFX_EVQ_SIZE(evq->entries), esmp)) != 0)
return (rc);
/* Allocate buffer table entries. */
- sfxge_sram_buf_tbl_alloc(sc, EFX_EVQ_NBUFS(SFXGE_NEVS),
+ sfxge_sram_buf_tbl_alloc(sc, EFX_EVQ_NBUFS(evq->entries),
&evq->buf_base_id);
mtx_init(&evq->lock, "evq", NULL, MTX_DEF);
diff --git a/sys/dev/sfxge/sfxge_intr.c b/sys/dev/sfxge/sfxge_intr.c
index 17f5fcd..2f40603 100644
--- a/sys/dev/sfxge/sfxge_intr.c
+++ b/sys/dev/sfxge/sfxge_intr.c
@@ -70,19 +70,19 @@ sfxge_intr_line_filter(void *arg)
("intr->type != EFX_INTR_LINE"));
if (intr->state != SFXGE_INTR_STARTED)
- return FILTER_STRAY;
+ return (FILTER_STRAY);
(void)efx_intr_status_line(enp, &fatal, &qmask);
if (fatal) {
(void) efx_intr_disable(enp);
(void) efx_intr_fatal(enp);
- return FILTER_HANDLED;
+ return (FILTER_HANDLED);
}
if (qmask != 0) {
intr->zero_count = 0;
- return FILTER_SCHEDULE_THREAD;
+ return (FILTER_SCHEDULE_THREAD);
}
/* SF bug 15783: If the function is not asserting its IRQ and
@@ -97,13 +97,13 @@ sfxge_intr_line_filter(void *arg)
if (intr->zero_count++ == 0) {
if (evq->init_state == SFXGE_EVQ_STARTED) {
if (efx_ev_qpending(evq->common, evq->read_ptr))
- return FILTER_SCHEDULE_THREAD;
+ return (FILTER_SCHEDULE_THREAD);
efx_ev_qprime(evq->common, evq->read_ptr);
- return FILTER_HANDLED;
+ return (FILTER_HANDLED);
}
}
- return FILTER_STRAY;
+ return (FILTER_STRAY);
}
static void
@@ -175,7 +175,7 @@ sfxge_intr_bus_enable(struct sfxge_softc *sc)
default:
KASSERT(0, ("Invalid interrupt type"));
- return EINVAL;
+ return (EINVAL);
}
/* Try to add the handlers */
@@ -254,7 +254,7 @@ sfxge_intr_alloc(struct sfxge_softc *sc, int count)
table[i].eih_res = res;
}
- if (error) {
+ if (error != 0) {
count = i - 1;
for (i = 0; i < count; i++)
bus_release_resource(dev, SYS_RES_IRQ,
@@ -349,7 +349,7 @@ sfxge_intr_setup_msi(struct sfxge_softc *sc)
if (count == 0)
return (EINVAL);
- if ((error = pci_alloc_msi(dev, &count)) != 0)
+ if ((error = pci_alloc_msi(dev, &count)) != 0)
return (ENOMEM);
/* Allocate interrupt handler. */
@@ -424,7 +424,7 @@ void
sfxge_intr_stop(struct sfxge_softc *sc)
{
struct sfxge_intr *intr;
-
+
intr = &sc->intr;
KASSERT(intr->state == SFXGE_INTR_STARTED,
diff --git a/sys/dev/sfxge/sfxge_port.c b/sys/dev/sfxge/sfxge_port.c
index abd2924..6e28d7c 100644
--- a/sys/dev/sfxge/sfxge_port.c
+++ b/sys/dev/sfxge/sfxge_port.c
@@ -74,7 +74,7 @@ sfxge_mac_stat_update(struct sfxge_softc *sc)
/* Try to update the cached counters */
if ((rc = efx_mac_stats_update(sc->enp, esmp,
- port->mac_stats.decode_buf, NULL)) != EAGAIN)
+ port->mac_stats.decode_buf, NULL)) != EAGAIN)
goto out;
DELAY(100);
@@ -83,7 +83,7 @@ sfxge_mac_stat_update(struct sfxge_softc *sc)
rc = ETIMEDOUT;
out:
mtx_unlock(&port->lock);
- return rc;
+ return (rc);
}
static int
@@ -94,11 +94,11 @@ sfxge_mac_stat_handler(SYSCTL_HANDLER_ARGS)
int rc;
if ((rc = sfxge_mac_stat_update(sc)) != 0)
- return rc;
+ return (rc);
- return SYSCTL_OUT(req,
+ return (SYSCTL_OUT(req,
(uint64_t *)sc->port.mac_stats.decode_buf + id,
- sizeof(uint64_t));
+ sizeof(uint64_t)));
}
static void
@@ -130,9 +130,9 @@ sfxge_port_wanted_fc(struct sfxge_softc *sc)
struct ifmedia_entry *ifm = sc->media.ifm_cur;
if (ifm->ifm_media == (IFM_ETHER | IFM_AUTO))
- return EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE;
- return ((ifm->ifm_media & IFM_ETH_RXPAUSE) ? EFX_FCNTL_RESPOND : 0) |
- ((ifm->ifm_media & IFM_ETH_TXPAUSE) ? EFX_FCNTL_GENERATE : 0);
+ return (EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE);
+ return (((ifm->ifm_media & IFM_ETH_RXPAUSE) ? EFX_FCNTL_RESPOND : 0) |
+ ((ifm->ifm_media & IFM_ETH_TXPAUSE) ? EFX_FCNTL_GENERATE : 0));
}
static unsigned int
@@ -150,13 +150,13 @@ sfxge_port_link_fc_ifm(struct sfxge_softc *sc)
static unsigned int
sfxge_port_wanted_fc(struct sfxge_softc *sc)
{
- return sc->port.wanted_fc;
+ return (sc->port.wanted_fc);
}
static unsigned int
sfxge_port_link_fc_ifm(struct sfxge_softc *sc)
{
- return 0;
+ return (0);
}
static int
@@ -172,7 +172,7 @@ sfxge_port_wanted_fc_handler(SYSCTL_HANDLER_ARGS)
mtx_lock(&port->lock);
- if (req->newptr) {
+ if (req->newptr != NULL) {
if ((error = SYSCTL_IN(req, &fcntl, sizeof(fcntl))) != 0)
goto out;
@@ -220,14 +220,14 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLER_ARGS)
#endif /* SFXGE_HAVE_PAUSE_MEDIAOPTS */
-static const u_long sfxge_link_baudrate[EFX_LINK_NMODES] = {
+static const uint64_t sfxge_link_baudrate[EFX_LINK_NMODES] = {
[EFX_LINK_10HDX] = IF_Mbps(10),
[EFX_LINK_10FDX] = IF_Mbps(10),
[EFX_LINK_100HDX] = IF_Mbps(100),
[EFX_LINK_100FDX] = IF_Mbps(100),
[EFX_LINK_1000HDX] = IF_Gbps(1),
[EFX_LINK_1000FDX] = IF_Gbps(1),
- [EFX_LINK_10000FDX] = MIN(IF_Gbps(10ULL), ULONG_MAX),
+ [EFX_LINK_10000FDX] = IF_Gbps(10),
};
void
@@ -235,7 +235,7 @@ sfxge_mac_link_update(struct sfxge_softc *sc, efx_link_mode_t mode)
{
struct sfxge_port *port;
int link_state;
-
+
port = &sc->port;
if (port->link_mode == mode)
@@ -289,7 +289,7 @@ sfxge_mac_filter_set_locked(struct sfxge_softc *sc)
/* Set promisc-unicast and broadcast filter bits */
if ((rc = efx_mac_filter_set(enp, !!(ifp->if_flags & IFF_PROMISC),
B_TRUE)) != 0)
- return rc;
+ return (rc);
/* Set multicast hash filter */
if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) {
@@ -311,7 +311,7 @@ sfxge_mac_filter_set_locked(struct sfxge_softc *sc)
}
if_maddr_runlock(ifp);
}
- return efx_mac_hash_set(enp, bucket);
+ return (efx_mac_hash_set(enp, bucket));
}
int
@@ -336,7 +336,7 @@ sfxge_mac_filter_set(struct sfxge_softc *sc)
else
rc = 0;
mtx_unlock(&port->lock);
- return rc;
+ return (rc);
}
void
@@ -413,7 +413,7 @@ sfxge_port_start(struct sfxge_softc *sc)
/* Update MAC stats by DMA every second */
if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf,
- 1000, B_FALSE)) != 0)
+ 1000, B_FALSE)) != 0)
goto fail2;
if ((rc = efx_mac_drain(enp, B_FALSE)) != 0)
@@ -435,7 +435,7 @@ fail4:
(void)efx_mac_drain(enp, B_TRUE);
fail3:
(void)efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf,
- 0, B_FALSE);
+ 0, B_FALSE);
fail2:
efx_port_fini(sc->enp);
fail:
@@ -488,7 +488,7 @@ sfxge_phy_stat_update(struct sfxge_softc *sc)
rc = ETIMEDOUT;
out:
mtx_unlock(&port->lock);
- return rc;
+ return (rc);
}
static int
@@ -499,11 +499,11 @@ sfxge_phy_stat_handler(SYSCTL_HANDLER_ARGS)
int rc;
if ((rc = sfxge_phy_stat_update(sc)) != 0)
- return rc;
+ return (rc);
- return SYSCTL_OUT(req,
+ return (SYSCTL_OUT(req,
(uint32_t *)sc->port.phy_stats.decode_buf + id,
- sizeof(uint32_t));
+ sizeof(uint32_t)));
}
static void
@@ -619,7 +619,7 @@ fail:
free(port->phy_stats.decode_buf, M_SFXGE);
(void)mtx_destroy(&port->lock);
port->sc = NULL;
- return rc;
+ return (rc);
}
static int sfxge_link_mode[EFX_PHY_MEDIA_NTYPES][EFX_LINK_NMODES] = {
@@ -697,9 +697,9 @@ sfxge_media_change(struct ifnet *ifp)
rc = efx_phy_adv_cap_set(sc->enp, ifm->ifm_data);
out:
- sx_xunlock(&sc->softc_lock);
+ sx_xunlock(&sc->softc_lock);
- return rc;
+ return (rc);
}
int sfxge_port_ifmedia_init(struct sfxge_softc *sc)
@@ -788,7 +788,7 @@ int sfxge_port_ifmedia_init(struct sfxge_softc *sc)
best_mode_ifm = mode_ifm;
}
- if (best_mode_ifm)
+ if (best_mode_ifm != 0)
ifmedia_set(&sc->media, best_mode_ifm);
/* Now discard port state until interface is started. */
@@ -796,5 +796,5 @@ int sfxge_port_ifmedia_init(struct sfxge_softc *sc)
out2:
efx_nic_fini(sc->enp);
out:
- return rc;
+ return (rc);
}
diff --git a/sys/dev/sfxge/sfxge_rx.c b/sys/dev/sfxge/sfxge_rx.c
index 7209c38..66083d8 100644
--- a/sys/dev/sfxge/sfxge_rx.c
+++ b/sys/dev/sfxge/sfxge_rx.c
@@ -54,8 +54,7 @@ __FBSDID("$FreeBSD$");
#include "sfxge.h"
#include "sfxge_rx.h"
-#define RX_REFILL_THRESHOLD (EFX_RXQ_LIMIT(SFXGE_NDESCS) * 9 / 10)
-#define RX_REFILL_THRESHOLD_2 (RX_REFILL_THRESHOLD / 2)
+#define RX_REFILL_THRESHOLD(_entries) (EFX_RXQ_LIMIT(_entries) * 9 / 10)
/* Size of the LRO hash table. Must be a power of 2. A larger table
* means we can accelerate a larger number of streams.
@@ -87,10 +86,10 @@ static int lro_slow_start_packets = 2000;
static int lro_loss_packets = 20;
/* Flags for sfxge_lro_conn::l2_id; must not collide with EVL_VLID_MASK */
-#define SFXGE_LRO_L2_ID_VLAN 0x4000
-#define SFXGE_LRO_L2_ID_IPV6 0x8000
-#define SFXGE_LRO_CONN_IS_VLAN_ENCAP(c) ((c)->l2_id & SFXGE_LRO_L2_ID_VLAN)
-#define SFXGE_LRO_CONN_IS_TCPIPV4(c) (!((c)->l2_id & SFXGE_LRO_L2_ID_IPV6))
+#define SFXGE_LRO_L2_ID_VLAN 0x4000
+#define SFXGE_LRO_L2_ID_IPV6 0x8000
+#define SFXGE_LRO_CONN_IS_VLAN_ENCAP(c) ((c)->l2_id & SFXGE_LRO_L2_ID_VLAN)
+#define SFXGE_LRO_CONN_IS_TCPIPV4(c) (!((c)->l2_id & SFXGE_LRO_L2_ID_IPV6))
/* Compare IPv6 addresses, avoiding conditional branches */
static __inline unsigned long ipv6_addr_cmp(const struct in6_addr *left,
@@ -179,12 +178,12 @@ static inline struct mbuf *sfxge_rx_alloc_mbuf(struct sfxge_softc *sc)
m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, M_NOWAIT);
/* Allocate (and attach) packet buffer */
- if (m && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) {
+ if (m != NULL && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) {
uma_zfree(zone_mbuf, m);
m = NULL;
}
- return m;
+ return (m);
}
#define SFXGE_REFILL_BATCH 64
@@ -214,11 +213,11 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, unsigned int target, boolean_t retrying)
return;
rxfill = rxq->added - rxq->completed;
- KASSERT(rxfill <= EFX_RXQ_LIMIT(SFXGE_NDESCS),
- ("rxfill > EFX_RXQ_LIMIT(SFXGE_NDESCS)"));
- ntodo = min(EFX_RXQ_LIMIT(SFXGE_NDESCS) - rxfill, target);
- KASSERT(ntodo <= EFX_RXQ_LIMIT(SFXGE_NDESCS),
- ("ntodo > EFX_RQX_LIMIT(SFXGE_NDESCS)"));
+ KASSERT(rxfill <= EFX_RXQ_LIMIT(rxq->entries),
+ ("rxfill > EFX_RXQ_LIMIT(rxq->entries)"));
+ ntodo = min(EFX_RXQ_LIMIT(rxq->entries) - rxfill, target);
+ KASSERT(ntodo <= EFX_RXQ_LIMIT(rxq->entries),
+ ("ntodo > EFX_RQX_LIMIT(rxq->entries)"));
if (ntodo == 0)
return;
@@ -231,7 +230,7 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, unsigned int target, boolean_t retrying)
bus_dma_segment_t seg;
struct mbuf *m;
- id = (rxq->added + batch) & (SFXGE_NDESCS - 1);
+ id = (rxq->added + batch) & rxq->ptr_mask;
rx_desc = &rxq->queue[id];
KASSERT(rx_desc->mbuf == NULL, ("rx_desc->mbuf != NULL"));
@@ -274,7 +273,7 @@ sfxge_rx_qrefill(struct sfxge_rxq *rxq)
return;
/* Make sure the queue is full */
- sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_TRUE);
+ sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(rxq->entries), B_TRUE);
}
static void __sfxge_rx_deliver(struct sfxge_softc *sc, struct mbuf *m)
@@ -370,7 +369,7 @@ static void sfxge_lro_drop(struct sfxge_rxq *rxq, struct sfxge_lro_conn *c)
KASSERT(!c->mbuf, ("found orphaned mbuf"));
- if (c->next_buf.mbuf) {
+ if (c->next_buf.mbuf != NULL) {
sfxge_rx_deliver(rxq->sc, &c->next_buf);
LIST_REMOVE(c, active_link);
}
@@ -510,7 +509,7 @@ sfxge_lro_try_merge(struct sfxge_rxq *rxq, struct sfxge_lro_conn *c)
if (__predict_false(th_seq != c->next_seq)) {
/* Out-of-order, so start counting again. */
- if (c->mbuf)
+ if (c->mbuf != NULL)
sfxge_lro_deliver(&rxq->lro, c);
c->n_in_order_pkts -= lro_loss_packets;
c->next_seq = th_seq + data_length;
@@ -522,10 +521,10 @@ sfxge_lro_try_merge(struct sfxge_rxq *rxq, struct sfxge_lro_conn *c)
now = ticks;
if (now - c->last_pkt_ticks > lro_idle_ticks) {
++rxq->lro.n_drop_idle;
- if (c->mbuf)
+ if (c->mbuf != NULL)
sfxge_lro_deliver(&rxq->lro, c);
sfxge_lro_drop(rxq, c);
- return 0;
+ return (0);
}
c->last_pkt_ticks = ticks;
@@ -537,12 +536,12 @@ sfxge_lro_try_merge(struct sfxge_rxq *rxq, struct sfxge_lro_conn *c)
}
if (__predict_false(dont_merge)) {
- if (c->mbuf)
+ if (c->mbuf != NULL)
sfxge_lro_deliver(&rxq->lro, c);
if (th->th_flags & (TH_FIN | TH_RST)) {
++rxq->lro.n_drop_closed;
sfxge_lro_drop(rxq, c);
- return 0;
+ return (0);
}
goto deliver_buf_out;
}
@@ -563,11 +562,11 @@ sfxge_lro_try_merge(struct sfxge_rxq *rxq, struct sfxge_lro_conn *c)
}
rx_buf->mbuf = NULL;
- return 1;
+ return (1);
deliver_buf_out:
sfxge_rx_deliver(rxq->sc, rx_buf);
- return 1;
+ return (1);
}
static void sfxge_lro_new_conn(struct sfxge_lro_state *st, uint32_t conn_hash,
@@ -621,7 +620,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct sfxge_rx_sw_desc *rx_buf)
struct sfxge_lro_conn *c;
uint16_t l2_id;
uint16_t l3_proto;
- void *nh;
+ void *nh;
struct tcphdr *th;
uint32_t conn_hash;
unsigned bucket;
@@ -671,7 +670,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct sfxge_rx_sw_desc *rx_buf)
continue;
if ((c->source - th->th_sport) | (c->dest - th->th_dport))
continue;
- if (c->mbuf) {
+ if (c->mbuf != NULL) {
if (SFXGE_LRO_CONN_IS_TCPIPV4(c)) {
struct ip *c_iph, *iph = nh;
c_iph = c->nh;
@@ -691,7 +690,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct sfxge_rx_sw_desc *rx_buf)
TAILQ_REMOVE(&rxq->lro.conns[bucket], c, link);
TAILQ_INSERT_HEAD(&rxq->lro.conns[bucket], c, link);
- if (c->next_buf.mbuf) {
+ if (c->next_buf.mbuf != NULL) {
if (!sfxge_lro_try_merge(rxq, c))
goto deliver_now;
} else {
@@ -720,10 +719,10 @@ static void sfxge_lro_end_of_burst(struct sfxge_rxq *rxq)
while (!LIST_EMPTY(&st->active_conns)) {
c = LIST_FIRST(&st->active_conns);
- if (!c->delivered && c->mbuf)
+ if (!c->delivered && c->mbuf != NULL)
sfxge_lro_deliver(st, c);
if (sfxge_lro_try_merge(rxq, c)) {
- if (c->mbuf)
+ if (c->mbuf != NULL)
sfxge_lro_deliver(st, c);
LIST_REMOVE(c, active_link);
}
@@ -757,7 +756,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq, boolean_t eop)
unsigned int id;
struct sfxge_rx_sw_desc *rx_desc;
- id = completed++ & (SFXGE_NDESCS - 1);
+ id = completed++ & rxq->ptr_mask;
rx_desc = &rxq->queue[id];
m = rx_desc->mbuf;
@@ -821,8 +820,8 @@ discard:
sfxge_lro_end_of_burst(rxq);
/* Top up the queue if necessary */
- if (level < RX_REFILL_THRESHOLD)
- sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_FALSE);
+ if (level < rxq->refill_threshold)
+ sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(rxq->entries), B_FALSE);
}
static void
@@ -836,7 +835,7 @@ sfxge_rx_qstop(struct sfxge_softc *sc, unsigned int index)
evq = sc->evq[index];
mtx_lock(&evq->lock);
-
+
KASSERT(rxq->init_state == SFXGE_RXQ_STARTED,
("rxq not started"));
@@ -881,10 +880,10 @@ again:
rxq->loopback = 0;
/* Destroy the common code receive queue. */
- efx_rx_qdestroy(rxq->common);
+ efx_rx_qdestroy(rxq->common);
efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id,
- EFX_RXQ_NBUFS(SFXGE_NDESCS));
+ EFX_RXQ_NBUFS(sc->rxq_entries));
mtx_unlock(&evq->lock);
}
@@ -908,12 +907,12 @@ sfxge_rx_qstart(struct sfxge_softc *sc, unsigned int index)
/* Program the buffer table. */
if ((rc = efx_sram_buf_tbl_set(sc->enp, rxq->buf_base_id, esmp,
- EFX_RXQ_NBUFS(SFXGE_NDESCS))) != 0)
- return rc;
+ EFX_RXQ_NBUFS(sc->rxq_entries))) != 0)
+ return (rc);
/* Create the common code receive queue. */
if ((rc = efx_rx_qcreate(sc->enp, index, index, EFX_RXQ_TYPE_DEFAULT,
- esmp, SFXGE_NDESCS, rxq->buf_base_id, evq->common,
+ esmp, sc->rxq_entries, rxq->buf_base_id, evq->common,
&rxq->common)) != 0)
goto fail;
@@ -925,7 +924,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, unsigned int index)
rxq->init_state = SFXGE_RXQ_STARTED;
/* Try to fill the queue from the pool. */
- sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_FALSE);
+ sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(sc->rxq_entries), B_FALSE);
mtx_unlock(&evq->lock);
@@ -933,8 +932,8 @@ sfxge_rx_qstart(struct sfxge_softc *sc, unsigned int index)
fail:
efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id,
- EFX_RXQ_NBUFS(SFXGE_NDESCS));
- return rc;
+ EFX_RXQ_NBUFS(sc->rxq_entries));
+ return (rc);
}
void
@@ -1105,6 +1104,9 @@ sfxge_rx_qinit(struct sfxge_softc *sc, unsigned int index)
rxq = malloc(sizeof(struct sfxge_rxq), M_SFXGE, M_ZERO | M_WAITOK);
rxq->sc = sc;
rxq->index = index;
+ rxq->entries = sc->rxq_entries;
+ rxq->ptr_mask = rxq->entries - 1;
+ rxq->refill_threshold = RX_REFILL_THRESHOLD(rxq->entries);
sc->rxq[index] = rxq;
esmp = &rxq->mem;
@@ -1112,16 +1114,16 @@ sfxge_rx_qinit(struct sfxge_softc *sc, unsigned int index)
evq = sc->evq[index];
/* Allocate and zero DMA space. */
- if ((rc = sfxge_dma_alloc(sc, EFX_RXQ_SIZE(SFXGE_NDESCS), esmp)) != 0)
+ if ((rc = sfxge_dma_alloc(sc, EFX_RXQ_SIZE(sc->rxq_entries), esmp)) != 0)
return (rc);
- (void)memset(esmp->esm_base, 0, EFX_RXQ_SIZE(SFXGE_NDESCS));
+ (void)memset(esmp->esm_base, 0, EFX_RXQ_SIZE(sc->rxq_entries));
/* Allocate buffer table entries. */
- sfxge_sram_buf_tbl_alloc(sc, EFX_RXQ_NBUFS(SFXGE_NDESCS),
+ sfxge_sram_buf_tbl_alloc(sc, EFX_RXQ_NBUFS(sc->rxq_entries),
&rxq->buf_base_id);
/* Allocate the context array and the flow table. */
- rxq->queue = malloc(sizeof(struct sfxge_rx_sw_desc) * SFXGE_NDESCS,
+ rxq->queue = malloc(sizeof(struct sfxge_rx_sw_desc) * sc->rxq_entries,
M_SFXGE, M_WAITOK | M_ZERO);
sfxge_lro_init(rxq);
@@ -1136,7 +1138,7 @@ static const struct {
const char *name;
size_t offset;
} sfxge_rx_stats[] = {
-#define SFXGE_RX_STAT(name, member) \
+#define SFXGE_RX_STAT(name, member) \
{ #name, offsetof(struct sfxge_rxq, member) }
SFXGE_RX_STAT(lro_merges, lro.n_merges),
SFXGE_RX_STAT(lro_bursts, lro.n_bursts),
@@ -1161,7 +1163,7 @@ sfxge_rx_stat_handler(SYSCTL_HANDLER_ARGS)
sum += *(unsigned int *)((caddr_t)sc->rxq[index] +
sfxge_rx_stats[id].offset);
- return SYSCTL_OUT(req, &sum, sizeof(sum));
+ return (SYSCTL_OUT(req, &sum, sizeof(sum)));
}
static void
diff --git a/sys/dev/sfxge/sfxge_rx.h b/sys/dev/sfxge/sfxge_rx.h
index 5a80fdb..4b3e73a 100644
--- a/sys/dev/sfxge/sfxge_rx.h
+++ b/sys/dev/sfxge/sfxge_rx.h
@@ -30,25 +30,25 @@
*/
#ifndef _SFXGE_RX_H
-#define _SFXGE_RX_H
+#define _SFXGE_RX_H
-#define SFXGE_MAGIC_RESERVED 0x8000
+#define SFXGE_MAGIC_RESERVED 0x8000
-#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6
-#define SFXGE_MAGIC_DMAQ_LABEL_MASK \
- ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1)
+#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6
+#define SFXGE_MAGIC_DMAQ_LABEL_MASK \
+ ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1)
-#define SFXGE_MAGIC_RX_QFLUSH_DONE \
- (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+#define SFXGE_MAGIC_RX_QFLUSH_DONE \
+ (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-#define SFXGE_MAGIC_RX_QFLUSH_FAILED \
- (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+#define SFXGE_MAGIC_RX_QFLUSH_FAILED \
+ (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-#define SFXGE_MAGIC_RX_QREFILL \
- (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+#define SFXGE_MAGIC_RX_QREFILL \
+ (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-#define SFXGE_MAGIC_TX_QFLUSH_DONE \
- (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+#define SFXGE_MAGIC_TX_QFLUSH_DONE \
+ (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
#define SFXGE_RX_SCALE_MAX EFX_MAXRSS
@@ -159,6 +159,8 @@ struct sfxge_rxq {
efsys_mem_t mem;
unsigned int buf_base_id;
enum sfxge_rxq_state init_state;
+ unsigned int entries;
+ unsigned int ptr_mask;
struct sfxge_rx_sw_desc *queue __aligned(CACHE_LINE_SIZE);
unsigned int added;
@@ -166,6 +168,7 @@ struct sfxge_rxq {
unsigned int completed;
unsigned int loopback;
struct sfxge_lro_state lro;
+ unsigned int refill_threshold;
struct callout refill_callout;
unsigned int refill_delay;
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c
index 20f6f87..a12c747 100644
--- a/sys/dev/sfxge/sfxge_tx.c
+++ b/sys/dev/sfxge/sfxge_tx.c
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
+#include <sys/syslog.h>
#include <net/bpf.h>
#include <net/ethernet.h>
@@ -74,8 +75,27 @@ __FBSDID("$FreeBSD$");
* the output at a packet boundary. Allow for a reasonable
* minimum MSS of 512.
*/
-#define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1)
-#define SFXGE_TXQ_BLOCK_LEVEL (SFXGE_NDESCS - SFXGE_TSO_MAX_DESC)
+#define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1)
+#define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - SFXGE_TSO_MAX_DESC)
+
+#ifdef SFXGE_HAVE_MQ
+
+#define SFXGE_PARAM_TX_DPL_GET_MAX SFXGE_PARAM(tx_dpl_get_max)
+static int sfxge_tx_dpl_get_max = SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT;
+TUNABLE_INT(SFXGE_PARAM_TX_DPL_GET_MAX, &sfxge_tx_dpl_get_max);
+SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_get_max, CTLFLAG_RDTUN,
+ &sfxge_tx_dpl_get_max, 0,
+ "Maximum number of packets in deferred packet get-list");
+
+#define SFXGE_PARAM_TX_DPL_PUT_MAX SFXGE_PARAM(tx_dpl_put_max)
+static int sfxge_tx_dpl_put_max = SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT;
+TUNABLE_INT(SFXGE_PARAM_TX_DPL_PUT_MAX, &sfxge_tx_dpl_put_max);
+SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_put_max, CTLFLAG_RDTUN,
+ &sfxge_tx_dpl_put_max, 0,
+ "Maximum number of packets in deferred packet put-list");
+
+#endif
+
/* Forward declarations. */
static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq);
@@ -101,7 +121,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq)
struct sfxge_tx_mapping *stmp;
unsigned int id;
- id = completed++ & (SFXGE_NDESCS - 1);
+ id = completed++ & txq->ptr_mask;
stmp = &txq->stmp[id];
if (stmp->flags & TX_BUF_UNMAP) {
@@ -125,7 +145,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq)
unsigned int level;
level = txq->added - txq->completed;
- if (level <= SFXGE_TXQ_UNBLOCK_LEVEL)
+ if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries))
sfxge_tx_qunblock(txq);
}
}
@@ -176,7 +196,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq *txq)
KASSERT(*get_tailp == NULL, ("*get_tailp != NULL"));
*stdp->std_getp = get_next;
stdp->std_getp = get_tailp;
- stdp->std_count += count;
+ stdp->std_get_count += count;
}
#endif /* SFXGE_HAVE_MQ */
@@ -218,19 +238,19 @@ sfxge_tx_qlist_post(struct sfxge_txq *txq)
("efx_tx_qpost() refragmented descriptors"));
level = txq->added - txq->reaped;
- KASSERT(level <= SFXGE_NDESCS, ("overfilled TX queue"));
+ KASSERT(level <= txq->entries, ("overfilled TX queue"));
/* Clear the fragment list. */
txq->n_pend_desc = 0;
/* Have we reached the block level? */
- if (level < SFXGE_TXQ_BLOCK_LEVEL)
+ if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries))
return;
/* Reap, and check again */
sfxge_tx_qreap(txq);
level = txq->added - txq->reaped;
- if (level < SFXGE_TXQ_BLOCK_LEVEL)
+ if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries))
return;
txq->blocked = 1;
@@ -242,7 +262,7 @@ sfxge_tx_qlist_post(struct sfxge_txq *txq)
mb();
sfxge_tx_qreap(txq);
level = txq->added - txq->reaped;
- if (level < SFXGE_TXQ_BLOCK_LEVEL) {
+ if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries)) {
mb();
txq->blocked = 0;
}
@@ -271,7 +291,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, struct mbuf *mbuf)
}
/* Load the packet for DMA. */
- id = txq->added & (SFXGE_NDESCS - 1);
+ id = txq->added & txq->ptr_mask;
stmp = &txq->stmp[id];
rc = bus_dmamap_load_mbuf_sg(txq->packet_dma_tag, stmp->map,
mbuf, dma_seg, &n_dma_seg, 0);
@@ -318,7 +338,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, struct mbuf *mbuf)
stmp->flags = 0;
if (__predict_false(stmp ==
- &txq->stmp[SFXGE_NDESCS - 1]))
+ &txq->stmp[txq->ptr_mask]))
stmp = &txq->stmp[0];
else
stmp++;
@@ -343,7 +363,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, struct mbuf *mbuf)
/* Post the fragment list. */
sfxge_tx_qlist_post(txq);
- return 0;
+ return (0);
reject_mapped:
bus_dmamap_unload(txq->packet_dma_tag, *used_map);
@@ -352,7 +372,7 @@ reject:
m_freem(mbuf);
++txq->drops;
- return rc;
+ return (rc);
}
#ifdef SFXGE_HAVE_MQ
@@ -380,7 +400,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *txq)
prefetch_read_many(txq->common);
mbuf = stdp->std_get;
- count = stdp->std_count;
+ count = stdp->std_get_count;
while (count != 0) {
KASSERT(mbuf != NULL, ("mbuf == NULL"));
@@ -412,22 +432,22 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *txq)
if (count == 0) {
KASSERT(mbuf == NULL, ("mbuf != NULL"));
stdp->std_get = NULL;
- stdp->std_count = 0;
+ stdp->std_get_count = 0;
stdp->std_getp = &stdp->std_get;
} else {
stdp->std_get = mbuf;
- stdp->std_count = count;
+ stdp->std_get_count = count;
}
if (txq->added != pushed)
efx_tx_qpush(txq->common, txq->added);
- KASSERT(txq->blocked || stdp->std_count == 0,
+ KASSERT(txq->blocked || stdp->std_get_count == 0,
("queue unblocked but count is non-zero"));
}
-#define SFXGE_TX_QDPL_PENDING(_txq) \
- ((_txq)->dpl.std_put != 0)
+#define SFXGE_TX_QDPL_PENDING(_txq) \
+ ((_txq)->dpl.std_put != 0)
/*
* Service the deferred packet list.
@@ -476,12 +496,12 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, struct mbuf *mbuf, int locked)
sfxge_tx_qdpl_swizzle(txq);
- if (stdp->std_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT)
+ if (stdp->std_get_count >= stdp->std_get_max)
return (ENOBUFS);
*(stdp->std_getp) = mbuf;
stdp->std_getp = &mbuf->m_nextpkt;
- stdp->std_count++;
+ stdp->std_get_count++;
} else {
volatile uintptr_t *putp;
uintptr_t old;
@@ -493,12 +513,12 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, struct mbuf *mbuf, int locked)
do {
old = *putp;
- if (old) {
+ if (old != 0) {
struct mbuf *mp = (struct mbuf *)old;
old_len = mp->m_pkthdr.csum_data;
} else
old_len = 0;
- if (old_len >= SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT)
+ if (old_len >= stdp->std_put_max)
return (ENOBUFS);
mbuf->m_pkthdr.csum_data = old_len + 1;
mbuf->m_nextpkt = (void *)old;
@@ -559,7 +579,6 @@ fail:
m_freem(m);
atomic_add_long(&txq->early_drops, 1);
return (rc);
-
}
static void
@@ -576,8 +595,8 @@ sfxge_tx_qdpl_flush(struct sfxge_txq *txq)
m_freem(mbuf);
}
stdp->std_get = NULL;
- stdp->std_count = 0;
- stdp->std_getp = &stdp->std_get;
+ stdp->std_get_count = 0;
+ stdp->std_getp = &stdp->std_get;
mtx_unlock(&txq->lock);
}
@@ -599,7 +618,7 @@ sfxge_if_qflush(struct ifnet *ifp)
*/
int
sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m)
-{
+{
struct sfxge_softc *sc;
struct sfxge_txq *txq;
int rc;
@@ -652,7 +671,7 @@ static void sfxge_if_start_locked(struct ifnet *ifp)
}
while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
- IFQ_DRV_DEQUEUE(&ifp->if_snd, mbuf);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, mbuf);
if (mbuf == NULL)
break;
@@ -757,47 +776,49 @@ static inline const struct tcphdr *tso_tcph(const struct sfxge_tso_state *tso)
/* Size of preallocated TSO header buffers. Larger blocks must be
* allocated from the heap.
*/
-#define TSOH_STD_SIZE 128
+#define TSOH_STD_SIZE 128
/* At most half the descriptors in the queue at any time will refer to
* a TSO header buffer, since they must always be followed by a
* payload descriptor referring to an mbuf.
*/
-#define TSOH_COUNT (SFXGE_NDESCS / 2u)
-#define TSOH_PER_PAGE (PAGE_SIZE / TSOH_STD_SIZE)
-#define TSOH_PAGE_COUNT ((TSOH_COUNT + TSOH_PER_PAGE - 1) / TSOH_PER_PAGE)
+#define TSOH_COUNT(_txq_entries) ((_txq_entries) / 2u)
+#define TSOH_PER_PAGE (PAGE_SIZE / TSOH_STD_SIZE)
+#define TSOH_PAGE_COUNT(_txq_entries) \
+ ((TSOH_COUNT(_txq_entries) + TSOH_PER_PAGE - 1) / TSOH_PER_PAGE)
static int tso_init(struct sfxge_txq *txq)
{
struct sfxge_softc *sc = txq->sc;
+ unsigned int tsoh_page_count = TSOH_PAGE_COUNT(sc->txq_entries);
int i, rc;
/* Allocate TSO header buffers */
- txq->tsoh_buffer = malloc(TSOH_PAGE_COUNT * sizeof(txq->tsoh_buffer[0]),
+ txq->tsoh_buffer = malloc(tsoh_page_count * sizeof(txq->tsoh_buffer[0]),
M_SFXGE, M_WAITOK);
- for (i = 0; i < TSOH_PAGE_COUNT; i++) {
+ for (i = 0; i < tsoh_page_count; i++) {
rc = sfxge_dma_alloc(sc, PAGE_SIZE, &txq->tsoh_buffer[i]);
- if (rc)
+ if (rc != 0)
goto fail;
}
- return 0;
+ return (0);
fail:
while (i-- > 0)
sfxge_dma_free(&txq->tsoh_buffer[i]);
free(txq->tsoh_buffer, M_SFXGE);
txq->tsoh_buffer = NULL;
- return rc;
+ return (rc);
}
static void tso_fini(struct sfxge_txq *txq)
{
int i;
- if (txq->tsoh_buffer) {
- for (i = 0; i < TSOH_PAGE_COUNT; i++)
+ if (txq->tsoh_buffer != NULL) {
+ for (i = 0; i < TSOH_PAGE_COUNT(txq->sc->txq_entries); i++)
sfxge_dma_free(&txq->tsoh_buffer[i]);
free(txq->tsoh_buffer, M_SFXGE);
}
@@ -925,7 +946,7 @@ static int tso_start_new_packet(struct sfxge_txq *txq,
/* We cannot use bus_dmamem_alloc() as that may sleep */
header = malloc(tso->header_len, M_SFXGE, M_NOWAIT);
if (__predict_false(!header))
- return ENOMEM;
+ return (ENOMEM);
rc = bus_dmamap_load(txq->packet_dma_tag, stmp->map,
header, tso->header_len,
tso_map_long_header, &dma_addr,
@@ -938,7 +959,7 @@ static int tso_start_new_packet(struct sfxge_txq *txq,
rc = EINVAL;
}
free(header, M_SFXGE);
- return rc;
+ return (rc);
}
map = stmp->map;
@@ -987,7 +1008,7 @@ static int tso_start_new_packet(struct sfxge_txq *txq,
desc->eb_size = tso->header_len;
desc->eb_eop = 0;
- return 0;
+ return (0);
}
static int
@@ -1011,12 +1032,12 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
tso.dma_addr = dma_seg->ds_addr + tso.header_len;
}
- id = txq->added & (SFXGE_NDESCS - 1);
+ id = txq->added & txq->ptr_mask;
if (__predict_false(tso_start_new_packet(txq, &tso, id)))
- return -1;
+ return (-1);
while (1) {
- id = (id + 1) & (SFXGE_NDESCS - 1);
+ id = (id + 1) & txq->ptr_mask;
tso_fill_packet_with_fragment(txq, &tso);
/* Move onto the next fragment? */
@@ -1039,7 +1060,7 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
if (txq->n_pend_desc >
SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG))
break;
- next_id = (id + 1) & (SFXGE_NDESCS - 1);
+ next_id = (id + 1) & txq->ptr_mask;
if (__predict_false(tso_start_new_packet(txq, &tso,
next_id)))
break;
@@ -1048,7 +1069,7 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
}
txq->tso_bursts++;
- return id;
+ return (id);
}
static void
@@ -1071,7 +1092,7 @@ sfxge_tx_qunblock(struct sfxge_txq *txq)
unsigned int level;
level = txq->added - txq->completed;
- if (level <= SFXGE_TXQ_UNBLOCK_LEVEL)
+ if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries))
txq->blocked = 0;
}
@@ -1147,7 +1168,7 @@ sfxge_tx_qstop(struct sfxge_softc *sc, unsigned int index)
txq->common = NULL;
efx_sram_buf_tbl_clear(sc->enp, txq->buf_base_id,
- EFX_TXQ_NBUFS(SFXGE_NDESCS));
+ EFX_TXQ_NBUFS(sc->txq_entries));
mtx_unlock(&evq->lock);
mtx_unlock(SFXGE_TXQ_LOCK(txq));
@@ -1173,8 +1194,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
/* Program the buffer table. */
if ((rc = efx_sram_buf_tbl_set(sc->enp, txq->buf_base_id, esmp,
- EFX_TXQ_NBUFS(SFXGE_NDESCS))) != 0)
- return rc;
+ EFX_TXQ_NBUFS(sc->txq_entries))) != 0)
+ return (rc);
/* Determine the kind of queue we are creating. */
switch (txq->type) {
@@ -1195,12 +1216,12 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
/* Create the common code transmit queue. */
if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp,
- SFXGE_NDESCS, txq->buf_base_id, flags, evq->common,
+ sc->txq_entries, txq->buf_base_id, flags, evq->common,
&txq->common)) != 0)
goto fail;
mtx_lock(SFXGE_TXQ_LOCK(txq));
-
+
/* Enable the transmit queue. */
efx_tx_qenable(txq->common);
@@ -1212,8 +1233,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
fail:
efx_sram_buf_tbl_clear(sc->enp, txq->buf_base_id,
- EFX_TXQ_NBUFS(SFXGE_NDESCS));
- return rc;
+ EFX_TXQ_NBUFS(sc->txq_entries));
+ return (rc);
}
void
@@ -1229,7 +1250,7 @@ sfxge_tx_stop(struct sfxge_softc *sc)
sfxge_tx_qstop(sc, SFXGE_TXQ_IP_CKSUM);
encp = efx_nic_cfg_get(sc->enp);
- sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM);
+ sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM);
/* Tear down the transmit module */
efx_tx_fini(sc->enp);
@@ -1266,7 +1287,7 @@ fail3:
sfxge_tx_qstop(sc, SFXGE_TXQ_IP_CKSUM);
fail2:
- sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM);
+ sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM);
fail:
efx_tx_fini(sc->enp);
@@ -1281,7 +1302,7 @@ static void
sfxge_tx_qfini(struct sfxge_softc *sc, unsigned int index)
{
struct sfxge_txq *txq;
- unsigned int nmaps = SFXGE_NDESCS;
+ unsigned int nmaps;
txq = sc->txq[index];
@@ -1293,7 +1314,8 @@ sfxge_tx_qfini(struct sfxge_softc *sc, unsigned int index)
/* Free the context arrays. */
free(txq->pend_desc, M_SFXGE);
- while (nmaps--)
+ nmaps = sc->txq_entries;
+ while (nmaps-- != 0)
bus_dmamap_destroy(txq->packet_dma_tag, txq->stmp[nmaps].map);
free(txq->stmp, M_SFXGE);
@@ -1313,6 +1335,8 @@ static int
sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
enum sfxge_txq_type type, unsigned int evq_index)
{
+ char name[16];
+ struct sysctl_oid *txq_node;
struct sfxge_txq *txq;
struct sfxge_evq *evq;
#ifdef SFXGE_HAVE_MQ
@@ -1324,6 +1348,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
txq = malloc(sizeof(struct sfxge_txq), M_SFXGE, M_ZERO | M_WAITOK);
txq->sc = sc;
+ txq->entries = sc->txq_entries;
+ txq->ptr_mask = txq->entries - 1;
sc->txq[txq_index] = txq;
esmp = &txq->mem;
@@ -1331,12 +1357,12 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
evq = sc->evq[evq_index];
/* Allocate and zero DMA space for the descriptor ring. */
- if ((rc = sfxge_dma_alloc(sc, EFX_TXQ_SIZE(SFXGE_NDESCS), esmp)) != 0)
+ if ((rc = sfxge_dma_alloc(sc, EFX_TXQ_SIZE(sc->txq_entries), esmp)) != 0)
return (rc);
- (void)memset(esmp->esm_base, 0, EFX_TXQ_SIZE(SFXGE_NDESCS));
+ (void)memset(esmp->esm_base, 0, EFX_TXQ_SIZE(sc->txq_entries));
/* Allocate buffer table entries. */
- sfxge_sram_buf_tbl_alloc(sc, EFX_TXQ_NBUFS(SFXGE_NDESCS),
+ sfxge_sram_buf_tbl_alloc(sc, EFX_TXQ_NBUFS(sc->txq_entries),
&txq->buf_base_id);
/* Create a DMA tag for packet mappings. */
@@ -1350,29 +1376,59 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
}
/* Allocate pending descriptor array for batching writes. */
- txq->pend_desc = malloc(sizeof(efx_buffer_t) * SFXGE_NDESCS,
+ txq->pend_desc = malloc(sizeof(efx_buffer_t) * sc->txq_entries,
M_SFXGE, M_ZERO | M_WAITOK);
/* Allocate and initialise mbuf DMA mapping array. */
- txq->stmp = malloc(sizeof(struct sfxge_tx_mapping) * SFXGE_NDESCS,
+ txq->stmp = malloc(sizeof(struct sfxge_tx_mapping) * sc->txq_entries,
M_SFXGE, M_ZERO | M_WAITOK);
- for (nmaps = 0; nmaps < SFXGE_NDESCS; nmaps++) {
+ for (nmaps = 0; nmaps < sc->txq_entries; nmaps++) {
rc = bus_dmamap_create(txq->packet_dma_tag, 0,
&txq->stmp[nmaps].map);
if (rc != 0)
goto fail2;
}
+ snprintf(name, sizeof(name), "%u", txq_index);
+ txq_node = SYSCTL_ADD_NODE(
+ device_get_sysctl_ctx(sc->dev),
+ SYSCTL_CHILDREN(sc->txqs_node),
+ OID_AUTO, name, CTLFLAG_RD, NULL, "");
+ if (txq_node == NULL) {
+ rc = ENOMEM;
+ goto fail_txq_node;
+ }
+
if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM &&
(rc = tso_init(txq)) != 0)
goto fail3;
#ifdef SFXGE_HAVE_MQ
+ if (sfxge_tx_dpl_get_max <= 0) {
+ log(LOG_ERR, "%s=%d must be greater than 0",
+ SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max);
+ rc = EINVAL;
+ goto fail_tx_dpl_get_max;
+ }
+ if (sfxge_tx_dpl_put_max < 0) {
+ log(LOG_ERR, "%s=%d must be greater or equal to 0",
+ SFXGE_PARAM_TX_DPL_PUT_MAX, sfxge_tx_dpl_put_max);
+ rc = EINVAL;
+ goto fail_tx_dpl_put_max;
+ }
+
/* Initialize the deferred packet list. */
stdp = &txq->dpl;
+ stdp->std_put_max = sfxge_tx_dpl_put_max;
+ stdp->std_get_max = sfxge_tx_dpl_get_max;
stdp->std_getp = &stdp->std_get;
mtx_init(&txq->lock, "txq", NULL, MTX_DEF);
+
+ SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev),
+ SYSCTL_CHILDREN(txq_node), OID_AUTO,
+ "dpl_get_count", CTLFLAG_RD | CTLFLAG_STATS,
+ &stdp->std_get_count, 0, "");
#endif
txq->type = type;
@@ -1382,10 +1438,13 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
return (0);
+fail_tx_dpl_put_max:
+fail_tx_dpl_get_max:
fail3:
+fail_txq_node:
free(txq->pend_desc, M_SFXGE);
fail2:
- while (nmaps--)
+ while (nmaps-- != 0)
bus_dmamap_destroy(txq->packet_dma_tag, txq->stmp[nmaps].map);
free(txq->stmp, M_SFXGE);
bus_dma_tag_destroy(txq->packet_dma_tag);
@@ -1400,7 +1459,7 @@ static const struct {
const char *name;
size_t offset;
} sfxge_tx_stats[] = {
-#define SFXGE_TX_STAT(name, member) \
+#define SFXGE_TX_STAT(name, member) \
{ #name, offsetof(struct sfxge_txq, member) }
SFXGE_TX_STAT(tso_bursts, tso_bursts),
SFXGE_TX_STAT(tso_packets, tso_packets),
@@ -1426,7 +1485,7 @@ sfxge_tx_stat_handler(SYSCTL_HANDLER_ARGS)
sum += *(unsigned long *)((caddr_t)sc->txq[index] +
sfxge_tx_stats[id].offset);
- return SYSCTL_OUT(req, &sum, sizeof(sum));
+ return (SYSCTL_OUT(req, &sum, sizeof(sum)));
}
static void
@@ -1460,7 +1519,7 @@ sfxge_tx_fini(struct sfxge_softc *sc)
sfxge_tx_qfini(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index);
sfxge_tx_qfini(sc, SFXGE_TXQ_IP_CKSUM);
- sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM);
+ sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM);
}
@@ -1476,6 +1535,15 @@ sfxge_tx_init(struct sfxge_softc *sc)
KASSERT(intr->state == SFXGE_INTR_INITIALIZED,
("intr->state != SFXGE_INTR_INITIALIZED"));
+ sc->txqs_node = SYSCTL_ADD_NODE(
+ device_get_sysctl_ctx(sc->dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)),
+ OID_AUTO, "txq", CTLFLAG_RD, NULL, "Tx queues");
+ if (sc->txqs_node == NULL) {
+ rc = ENOMEM;
+ goto fail_txq_node;
+ }
+
/* Initialize the transmit queues */
if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NON_CKSUM,
SFXGE_TXQ_NON_CKSUM, 0)) != 0)
@@ -1505,5 +1573,6 @@ fail2:
sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM);
fail:
+fail_txq_node:
return (rc);
}
diff --git a/sys/dev/sfxge/sfxge_tx.h b/sys/dev/sfxge/sfxge_tx.h
index 33ce8b9..67dea0c 100644
--- a/sys/dev/sfxge/sfxge_tx.h
+++ b/sys/dev/sfxge/sfxge_tx.h
@@ -30,7 +30,7 @@
*/
#ifndef _SFXGE_TX_H
-#define _SFXGE_TX_H
+#define _SFXGE_TX_H
#include <netinet/in.h>
#include <netinet/ip.h>
@@ -47,7 +47,7 @@
* could overlap all mbufs in the chain and also require an extra
* segment for a TSO header.
*/
-#define SFXGE_TX_PACKET_MAX_SEG (SFXGE_TX_MAPPING_MAX_SEG + 1)
+#define SFXGE_TX_PACKET_MAX_SEG (SFXGE_TX_MAPPING_MAX_SEG + 1)
/*
* Buffer mapping flags.
@@ -75,17 +75,21 @@ struct sfxge_tx_mapping {
enum sfxge_tx_buf_flags flags;
};
-#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 64
+#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 1024
#define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 64
/*
* Deferred packet list.
*/
struct sfxge_tx_dpl {
- uintptr_t std_put; /* Head of put list. */
- struct mbuf *std_get; /* Head of get list. */
- struct mbuf **std_getp; /* Tail of get list. */
- unsigned int std_count; /* Count of packets. */
+ unsigned int std_get_max; /* Maximum number of packets
+ * in get list */
+ unsigned int std_put_max; /* Maximum number of packets
+ * in put list */
+ uintptr_t std_put; /* Head of put list. */
+ struct mbuf *std_get; /* Head of get list. */
+ struct mbuf **std_getp; /* Tail of get list. */
+ unsigned int std_get_count; /* Packets in get list. */
};
@@ -106,16 +110,16 @@ enum sfxge_txq_type {
SFXGE_TXQ_NTYPES
};
-#define SFXGE_TXQ_UNBLOCK_LEVEL (EFX_TXQ_LIMIT(SFXGE_NDESCS) / 4)
+#define SFXGE_TXQ_UNBLOCK_LEVEL(_entries) (EFX_TXQ_LIMIT(_entries) / 4)
#define SFXGE_TX_BATCH 64
#ifdef SFXGE_HAVE_MQ
-#define SFXGE_TXQ_LOCK(txq) (&(txq)->lock)
-#define SFXGE_TX_SCALE(sc) ((sc)->intr.n_alloc)
+#define SFXGE_TXQ_LOCK(txq) (&(txq)->lock)
+#define SFXGE_TX_SCALE(sc) ((sc)->intr.n_alloc)
#else
-#define SFXGE_TXQ_LOCK(txq) (&(txq)->sc->tx_lock)
-#define SFXGE_TX_SCALE(sc) 1
+#define SFXGE_TXQ_LOCK(txq) (&(txq)->sc->tx_lock)
+#define SFXGE_TX_SCALE(sc) 1
#endif
struct sfxge_txq {
@@ -128,6 +132,8 @@ struct sfxge_txq {
unsigned int evq_index;
efsys_mem_t mem;
unsigned int buf_base_id;
+ unsigned int entries;
+ unsigned int ptr_mask;
struct sfxge_tx_mapping *stmp; /* Packets in flight. */
bus_dma_tag_t packet_dma_tag;
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index b24a639..3d48abc 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -232,7 +232,7 @@ struct uaudio_chan {
#define UAUDIO_SYNC_LESS 2
};
-#define UMIDI_CABLES_MAX 16 /* units */
+#define UMIDI_EMB_JACK_MAX 16 /* units */
#define UMIDI_TX_FRAMES 256 /* units */
#define UMIDI_TX_BUFFER (UMIDI_TX_FRAMES * 4) /* bytes */
@@ -263,7 +263,7 @@ struct umidi_sub_chan {
struct umidi_chan {
- struct umidi_sub_chan sub[UMIDI_CABLES_MAX];
+ struct umidi_sub_chan sub[UMIDI_EMB_JACK_MAX];
struct mtx mtx;
struct usb_xfer *xfer[UMIDI_N_TRANSFER];
@@ -275,7 +275,7 @@ struct umidi_chan {
uint8_t write_open_refcount;
uint8_t curr_cable;
- uint8_t max_cable;
+ uint8_t max_emb_jack;
uint8_t valid;
uint8_t single_command;
};
@@ -1481,6 +1481,7 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
union uaudio_asid asid = { NULL };
union uaudio_asf1d asf1d = { NULL };
union uaudio_sed sed = { NULL };
+ struct usb_midi_streaming_endpoint_descriptor *msid = NULL;
usb_endpoint_descriptor_audio_t *ed1 = NULL;
const struct usb_audio_control_descriptor *acdp = NULL;
struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev);
@@ -1498,6 +1499,7 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
uint8_t bChannels;
uint8_t bBitResolution;
uint8_t audio_if = 0;
+ uint8_t midi_if = 0;
uint8_t uma_if_class;
while ((desc = usb_desc_foreach(cd, desc))) {
@@ -1533,7 +1535,8 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
((id->bInterfaceClass == UICLASS_VENDOR) &&
(sc->sc_uq_au_vendor_class != 0)));
- if ((uma_if_class != 0) && (id->bInterfaceSubClass == UISUBCLASS_AUDIOSTREAM)) {
+ if ((uma_if_class != 0) &&
+ (id->bInterfaceSubClass == UISUBCLASS_AUDIOSTREAM)) {
audio_if = 1;
} else {
audio_if = 0;
@@ -1545,13 +1548,16 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
/*
* XXX could allow multiple MIDI interfaces
*/
+ midi_if = 1;
if ((sc->sc_midi_chan.valid == 0) &&
- usbd_get_iface(udev, curidx)) {
+ (usbd_get_iface(udev, curidx) != NULL)) {
sc->sc_midi_chan.iface_index = curidx;
sc->sc_midi_chan.iface_alt_index = alt_index;
sc->sc_midi_chan.valid = 1;
}
+ } else {
+ midi_if = 0;
}
asid.v1 = NULL;
asf1d.v1 = NULL;
@@ -1560,14 +1566,25 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
}
if (audio_if == 0) {
- if ((acdp == NULL) &&
- (desc->bDescriptorType == UDESC_CS_INTERFACE) &&
- (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) &&
- (desc->bLength >= sizeof(*acdp))) {
- acdp = (void *)desc;
- audio_rev = UGETW(acdp->bcdADC);
+ if (midi_if == 0) {
+ if ((acdp == NULL) &&
+ (desc->bDescriptorType == UDESC_CS_INTERFACE) &&
+ (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) &&
+ (desc->bLength >= sizeof(*acdp))) {
+ acdp = (void *)desc;
+ audio_rev = UGETW(acdp->bcdADC);
+ }
+ } else {
+ msid = (void *)desc;
+
+ /* get the maximum number of embedded jacks in use, if any */
+ if (msid->bLength >= sizeof(*msid) &&
+ msid->bDescriptorType == UDESC_CS_ENDPOINT &&
+ msid->bDescriptorSubtype == MS_GENERAL &&
+ msid->bNumEmbMIDIJack > sc->sc_midi_chan.max_emb_jack) {
+ sc->sc_midi_chan.max_emb_jack = msid->bNumEmbMIDIJack;
+ }
}
-
/*
* Don't collect any USB audio descriptors if
* this is not an USB audio stream interface.
@@ -5219,8 +5236,7 @@ umidi_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
*/
sub = &chan->sub[cn];
- if ((cmd_len != 0) &&
- (cn < chan->max_cable) &&
+ if ((cmd_len != 0) && (cn < chan->max_emb_jack) &&
(sub->read_open != 0)) {
/* Send data to the application */
@@ -5456,7 +5472,7 @@ tr_setup:
}
chan->curr_cable++;
- if (chan->curr_cable >= chan->max_cable)
+ if (chan->curr_cable >= chan->max_emb_jack)
chan->curr_cable = 0;
if (chan->curr_cable == start_cable) {
@@ -5493,7 +5509,7 @@ umidi_sub_by_fifo(struct usb_fifo *fifo)
struct umidi_sub_chan *sub;
uint32_t n;
- for (n = 0; n < UMIDI_CABLES_MAX; n++) {
+ for (n = 0; n < UMIDI_EMB_JACK_MAX; n++) {
sub = &chan->sub[n];
if ((sub->fifo.fp[USB_FIFO_RX] == fifo) ||
(sub->fifo.fp[USB_FIFO_TX] == fifo)) {
@@ -5676,12 +5692,12 @@ umidi_probe(device_t dev)
if (chan->single_command != 0)
device_printf(dev, "Single command MIDI quirk enabled\n");
- if ((chan->max_cable > UMIDI_CABLES_MAX) ||
- (chan->max_cable == 0)) {
- chan->max_cable = UMIDI_CABLES_MAX;
+ if ((chan->max_emb_jack == 0) ||
+ (chan->max_emb_jack > UMIDI_EMB_JACK_MAX)) {
+ chan->max_emb_jack = UMIDI_EMB_JACK_MAX;
}
- for (n = 0; n < chan->max_cable; n++) {
+ for (n = 0; n < chan->max_emb_jack; n++) {
sub = &chan->sub[n];
@@ -5719,9 +5735,8 @@ umidi_detach(device_t dev)
struct umidi_chan *chan = &sc->sc_midi_chan;
uint32_t n;
- for (n = 0; n < UMIDI_CABLES_MAX; n++) {
+ for (n = 0; n < UMIDI_EMB_JACK_MAX; n++)
usb_fifo_detach(&chan->sub[n].fifo);
- }
mtx_lock(&chan->mtx);
diff --git a/sys/dev/sound/usb/uaudioreg.h b/sys/dev/sound/usb/uaudioreg.h
index c2c1ad4..637b5b1 100644
--- a/sys/dev/sound/usb/uaudioreg.h
+++ b/sys/dev/sound/usb/uaudioreg.h
@@ -119,6 +119,13 @@ struct usb_audio_streaming_endpoint_descriptor {
uWord wLockDelay;
} __packed;
+struct usb_midi_streaming_endpoint_descriptor {
+ uByte bLength;
+ uByte bDescriptorType;
+ uByte bDescriptorSubtype;
+ uByte bNumEmbMIDIJack;
+} __packed;
+
struct usb_audio_streaming_type1_descriptor {
uByte bLength;
uByte bDescriptorType;
@@ -378,6 +385,7 @@ struct usb_audio_extension_unit_1 {
#define MASTER_CHAN 0
+#define MS_GENERAL 1
#define AS_GENERAL 1
#define FORMAT_TYPE 2
#define FORMAT_SPECIFIC 3
diff --git a/sys/dev/uart/uart.h b/sys/dev/uart/uart.h
index 0bcedde..8ab5022 100644
--- a/sys/dev/uart/uart.h
+++ b/sys/dev/uart/uart.h
@@ -65,6 +65,7 @@ struct uart_bas {
struct uart_class;
extern struct uart_class uart_imx_class __attribute__((weak));
+extern struct uart_class uart_msm_class __attribute__((weak));
extern struct uart_class uart_ns8250_class __attribute__((weak));
extern struct uart_class uart_quicc_class __attribute__((weak));
extern struct uart_class uart_s3c2410_class __attribute__((weak));
diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c
index 92e155b..f52fec1 100644
--- a/sys/dev/uart/uart_bus_fdt.c
+++ b/sys/dev/uart/uart_bus_fdt.c
@@ -84,6 +84,7 @@ static struct ofw_compat_data compat_data[] = {
{"fsl,imx21-uart", (uintptr_t)&uart_imx_class},
{"fsl,mvf600-uart", (uintptr_t)&uart_vybrid_class},
{"lpc,uart", (uintptr_t)&uart_lpc_class},
+ {"qcom,uart-dm", (uintptr_t)&uart_msm_class},
{"ti,ns16550", (uintptr_t)&uart_ti8250_class},
{"ns16550", (uintptr_t)&uart_ns8250_class},
{NULL, (uintptr_t)NULL},
diff --git a/sys/dev/uart/uart_dev_imx.c b/sys/dev/uart/uart_dev_imx.c
index 43338fe..2def18c 100644
--- a/sys/dev/uart/uart_dev_imx.c
+++ b/sys/dev/uart/uart_dev_imx.c
@@ -90,6 +90,45 @@ imx_uart_probe(struct uart_bas *bas)
return (0);
}
+static u_int
+imx_uart_getbaud(struct uart_bas *bas)
+{
+ uint32_t rate, ubir, ubmr;
+ u_int baud, blo, bhi, i;
+ static const u_int predivs[] = {6, 5, 4, 3, 2, 1, 7, 1};
+ static const u_int std_rates[] = {
+ 9600, 14400, 19200, 38400, 57600, 115200, 230400, 460800, 921600
+ };
+
+ /*
+ * Get the baud rate the hardware is programmed for, then search the
+ * table of standard baud rates for a number that's within 3% of the
+ * actual rate the hardware is programmed for. It's more comforting to
+ * see that your console is running at 115200 than 114942. Note that
+ * here we cannot make a simplifying assumption that the predivider and
+ * numerator are 1 (like we do when setting the baud rate), because we
+ * don't know what u-boot might have set up.
+ */
+ i = (GETREG(bas, REG(UFCR)) & IMXUART_UFCR_RFDIV_MASK) >>
+ IMXUART_UFCR_RFDIV_SHIFT;
+ rate = imx_ccm_uart_hz() / predivs[i];
+ ubir = GETREG(bas, REG(UBIR)) + 1;
+ ubmr = GETREG(bas, REG(UBMR)) + 1;
+ baud = ((rate / 16 ) * ubir) / ubmr;
+
+ blo = (baud * 100) / 103;
+ bhi = (baud * 100) / 97;
+ for (i = 0; i < nitems(std_rates); i++) {
+ rate = std_rates[i];
+ if (rate >= blo && rate <= bhi) {
+ baud = rate;
+ break;
+ }
+ }
+
+ return (baud);
+}
+
static void
imx_uart_init(struct uart_bas *bas, int baudrate, int databits,
int stopbits, int parity)
@@ -348,8 +387,7 @@ imx_uart_bus_ioctl(struct uart_softc *sc, int request, intptr_t data)
/* TODO */
break;
case UART_IOCTL_BAUD:
- /* TODO */
- *(int*)data = 115200;
+ *(u_int*)data = imx_uart_getbaud(bas);
break;
default:
error = EINVAL;
diff --git a/sys/dev/uart/uart_dev_msm.c b/sys/dev/uart/uart_dev_msm.c
new file mode 100644
index 0000000..12dc8a7
--- /dev/null
+++ b/sys/dev/uart/uart_dev_msm.c
@@ -0,0 +1,568 @@
+/*-
+ * Copyright (c) 2014 Ganbold Tsagaankhuu <ganbold@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Qualcomm MSM7K/8K uart driver */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_ddb.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/kdb.h>
+#include <machine/bus.h>
+#include <machine/fdt.h>
+
+#include <dev/uart/uart.h>
+#include <dev/uart/uart_cpu.h>
+#include <dev/uart/uart_bus.h>
+#include <dev/uart/uart_dev_msm.h>
+
+#include "uart_if.h"
+
+#define DEF_CLK 7372800
+
+#define GETREG(bas, reg) \
+ bus_space_read_4((bas)->bst, (bas)->bsh, (reg))
+#define SETREG(bas, reg, value) \
+ bus_space_write_4((bas)->bst, (bas)->bsh, (reg), (value))
+
+static int msm_uart_param(struct uart_bas *, int, int, int, int);
+
+/*
+ * Low-level UART interface.
+ */
+static int msm_probe(struct uart_bas *bas);
+static void msm_init(struct uart_bas *bas, int, int, int, int);
+static void msm_term(struct uart_bas *bas);
+static void msm_putc(struct uart_bas *bas, int);
+static int msm_rxready(struct uart_bas *bas);
+static int msm_getc(struct uart_bas *bas, struct mtx *mtx);
+
+extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
+
+static int
+msm_uart_param(struct uart_bas *bas, int baudrate, int databits,
+ int stopbits, int parity)
+{
+ int ulcon;
+
+ ulcon = 0;
+
+ switch (databits) {
+ case 5:
+ ulcon |= (UART_DM_5_BPS << 4);
+ break;
+ case 6:
+ ulcon |= (UART_DM_6_BPS << 4);
+ break;
+ case 7:
+ ulcon |= (UART_DM_7_BPS << 4);
+ break;
+ case 8:
+ ulcon |= (UART_DM_8_BPS << 4);
+ break;
+ default:
+ return (EINVAL);
+ }
+
+ switch (parity) {
+ case UART_PARITY_NONE:
+ ulcon |= UART_DM_NO_PARITY;
+ break;
+ case UART_PARITY_ODD:
+ ulcon |= UART_DM_ODD_PARITY;
+ break;
+ case UART_PARITY_EVEN:
+ ulcon |= UART_DM_EVEN_PARITY;
+ break;
+ case UART_PARITY_SPACE:
+ ulcon |= UART_DM_SPACE_PARITY;
+ break;
+ case UART_PARITY_MARK:
+ default:
+ return (EINVAL);
+ }
+
+ switch (stopbits) {
+ case 1:
+ ulcon |= (UART_DM_SBL_1 << 2);
+ break;
+ case 2:
+ ulcon |= (UART_DM_SBL_2 << 2);
+ break;
+ default:
+ return (EINVAL);
+ }
+ uart_setreg(bas, UART_DM_MR2, ulcon);
+
+ /* Set 115200 for both TX and RX. */;
+ uart_setreg(bas, UART_DM_CSR, UART_DM_CSR_115200);
+ uart_barrier(bas);
+
+ return (0);
+}
+
+struct uart_ops uart_msm_ops = {
+ .probe = msm_probe,
+ .init = msm_init,
+ .term = msm_term,
+ .putc = msm_putc,
+ .rxready = msm_rxready,
+ .getc = msm_getc,
+};
+
+static int
+msm_probe(struct uart_bas *bas)
+{
+
+ return (0);
+}
+
+static void
+msm_init(struct uart_bas *bas, int baudrate, int databits, int stopbits,
+ int parity)
+{
+
+ if (bas->rclk == 0)
+ bas->rclk = DEF_CLK;
+
+ KASSERT(bas->rclk != 0, ("msm_init: Invalid rclk"));
+
+ /* Set default parameters */
+ msm_uart_param(bas, baudrate, databits, stopbits, parity);
+
+ /*
+ * Configure UART mode registers MR1 and MR2.
+ * Hardware flow control isn't supported.
+ */
+ uart_setreg(bas, UART_DM_MR1, 0x0);
+
+ /* Reset interrupt mask register. */
+ uart_setreg(bas, UART_DM_IMR, 0);
+
+ /*
+ * Configure Tx and Rx watermarks configuration registers.
+ * TX watermark value is set to 0 - interrupt is generated when
+ * FIFO level is less than or equal to 0.
+ */
+ uart_setreg(bas, UART_DM_TFWR, UART_DM_TFW_VALUE);
+
+ /* Set RX watermark value */
+ uart_setreg(bas, UART_DM_RFWR, UART_DM_RFW_VALUE);
+
+ /*
+ * Configure Interrupt Programming Register.
+ * Set initial Stale timeout value.
+ */
+ uart_setreg(bas, UART_DM_IPR, UART_DM_STALE_TIMEOUT_LSB);
+
+ /* Disable IRDA mode */
+ uart_setreg(bas, UART_DM_IRDA, 0x0);
+
+ /*
+ * Configure and enable sim interface if required.
+ * Configure hunt character value in HCR register.
+ * Keep it in reset state.
+ */
+ uart_setreg(bas, UART_DM_HCR, 0x0);
+
+ /* Issue soft reset command */
+ SETREG(bas, UART_DM_CR, UART_DM_RESET_TX);
+ SETREG(bas, UART_DM_CR, UART_DM_RESET_RX);
+ SETREG(bas, UART_DM_CR, UART_DM_RESET_ERROR_STATUS);
+ SETREG(bas, UART_DM_CR, UART_DM_RESET_BREAK_INT);
+ SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT);
+
+ /* Enable/Disable Rx/Tx DM interfaces */
+ /* Disable Data Mover for now. */
+ uart_setreg(bas, UART_DM_DMEN, 0x0);
+
+ /* Enable transmitter and receiver */
+ uart_setreg(bas, UART_DM_CR, UART_DM_CR_RX_ENABLE);
+ uart_setreg(bas, UART_DM_CR, UART_DM_CR_TX_ENABLE);
+
+ uart_barrier(bas);
+}
+
+static void
+msm_term(struct uart_bas *bas)
+{
+
+ /* XXX */
+}
+
+static void
+msm_putc(struct uart_bas *bas, int c)
+{
+ int limit;
+
+ /*
+ * Write to NO_CHARS_FOR_TX register the number of characters
+ * to be transmitted. However, before writing TX_FIFO must
+ * be empty as indicated by TX_READY interrupt in IMR register
+ */
+
+ /*
+ * Check if transmit FIFO is empty.
+ * If not wait for TX_READY interrupt.
+ */
+ limit = 1000;
+ if (!(uart_getreg(bas, UART_DM_SR) & UART_DM_SR_TXEMT)) {
+ while ((uart_getreg(bas, UART_DM_ISR) & UART_DM_TX_READY) == 0
+ && --limit)
+ DELAY(4);
+ }
+ /* FIFO is ready, write number of characters to be written */
+ uart_setreg(bas, UART_DM_NO_CHARS_FOR_TX, 1);
+
+ /* Wait till TX FIFO has space */
+ while ((uart_getreg(bas, UART_DM_SR) & UART_DM_SR_TXRDY) == 0)
+ DELAY(4);
+
+ /* TX FIFO has space. Write char */
+ SETREG(bas, UART_DM_TF(0), (c & 0xff));
+}
+
+static int
+msm_rxready(struct uart_bas *bas)
+{
+
+ /* Wait for a character to come ready */
+ return ((uart_getreg(bas, UART_DM_SR) & UART_DM_SR_RXRDY) ==
+ UART_DM_SR_RXRDY);
+}
+
+static int
+msm_getc(struct uart_bas *bas, struct mtx *mtx)
+{
+ int c;
+
+ uart_lock(mtx);
+
+ /* Wait for a character to come ready */
+ while ((uart_getreg(bas, UART_DM_SR) & UART_DM_SR_RXRDY) !=
+ UART_DM_SR_RXRDY)
+ DELAY(4);
+
+ /* Check for Overrun error. If so reset Error Status */
+ if (uart_getreg(bas, UART_DM_SR) & UART_DM_SR_UART_OVERRUN)
+ uart_setreg(bas, UART_DM_CR, UART_DM_RESET_ERROR_STATUS);
+
+ /* Read char */
+ c = uart_getreg(bas, UART_DM_RF(0));
+
+ uart_unlock(mtx);
+
+ return (c);
+}
+
+/*
+ * High-level UART interface.
+ */
+struct msm_uart_softc {
+ struct uart_softc base;
+ uint32_t ier;
+};
+
+static int msm_bus_probe(struct uart_softc *sc);
+static int msm_bus_attach(struct uart_softc *sc);
+static int msm_bus_flush(struct uart_softc *, int);
+static int msm_bus_getsig(struct uart_softc *);
+static int msm_bus_ioctl(struct uart_softc *, int, intptr_t);
+static int msm_bus_ipend(struct uart_softc *);
+static int msm_bus_param(struct uart_softc *, int, int, int, int);
+static int msm_bus_receive(struct uart_softc *);
+static int msm_bus_setsig(struct uart_softc *, int);
+static int msm_bus_transmit(struct uart_softc *);
+static void msm_bus_grab(struct uart_softc *);
+static void msm_bus_ungrab(struct uart_softc *);
+
+static kobj_method_t msm_methods[] = {
+ KOBJMETHOD(uart_probe, msm_bus_probe),
+ KOBJMETHOD(uart_attach, msm_bus_attach),
+ KOBJMETHOD(uart_flush, msm_bus_flush),
+ KOBJMETHOD(uart_getsig, msm_bus_getsig),
+ KOBJMETHOD(uart_ioctl, msm_bus_ioctl),
+ KOBJMETHOD(uart_ipend, msm_bus_ipend),
+ KOBJMETHOD(uart_param, msm_bus_param),
+ KOBJMETHOD(uart_receive, msm_bus_receive),
+ KOBJMETHOD(uart_setsig, msm_bus_setsig),
+ KOBJMETHOD(uart_transmit, msm_bus_transmit),
+ KOBJMETHOD(uart_grab, msm_bus_grab),
+ KOBJMETHOD(uart_ungrab, msm_bus_ungrab),
+ {0, 0 }
+};
+
+int
+msm_bus_probe(struct uart_softc *sc)
+{
+
+ sc->sc_txfifosz = 64;
+ sc->sc_rxfifosz = 64;
+
+ device_set_desc(sc->sc_dev, "Qualcomm HSUART");
+
+ return (0);
+}
+
+static int
+msm_bus_attach(struct uart_softc *sc)
+{
+ struct msm_uart_softc *u = (struct msm_uart_softc *)sc;
+ struct uart_bas *bas = &sc->sc_bas;
+
+ sc->sc_hwiflow = 0;
+ sc->sc_hwoflow = 0;
+
+ /* Set TX_READY, TXLEV, RXLEV, RXSTALE */
+ u->ier = UART_DM_IMR_ENABLED;
+
+ /* Configure Interrupt Mask register IMR */
+ uart_setreg(bas, UART_DM_IMR, u->ier);
+
+ return (0);
+}
+
+/*
+ * Write the current transmit buffer to the TX FIFO.
+ */
+static int
+msm_bus_transmit(struct uart_softc *sc)
+{
+ struct msm_uart_softc *u = (struct msm_uart_softc *)sc;
+ struct uart_bas *bas = &sc->sc_bas;
+ int i;
+
+ uart_lock(sc->sc_hwmtx);
+
+ /* Write some data */
+ for (i = 0; i < sc->sc_txdatasz; i++) {
+ /* Write TX data */
+ msm_putc(bas, sc->sc_txbuf[i]);
+ uart_barrier(bas);
+ }
+
+ /* TX FIFO is empty now, enable TX_READY interrupt */
+ u->ier |= UART_DM_TX_READY;
+ SETREG(bas, UART_DM_IMR, u->ier);
+ uart_barrier(bas);
+
+ /*
+ * Inform upper layer that it is transmitting data to hardware,
+ * this will be cleared when TXIDLE interrupt occurs.
+ */
+ sc->sc_txbusy = 1;
+ uart_unlock(sc->sc_hwmtx);
+
+ return (0);
+}
+
+static int
+msm_bus_setsig(struct uart_softc *sc, int sig)
+{
+
+ return (0);
+}
+
+static int
+msm_bus_receive(struct uart_softc *sc)
+{
+ struct msm_uart_softc *u = (struct msm_uart_softc *)sc;
+ struct uart_bas *bas;
+ int c;
+
+ bas = &sc->sc_bas;
+ uart_lock(sc->sc_hwmtx);
+
+ /* Initialize Receive Path and interrupt */
+ SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT);
+ SETREG(bas, UART_DM_CR, UART_DM_STALE_EVENT_ENABLE);
+ u->ier |= UART_DM_RXLEV;
+ SETREG(bas, UART_DM_IMR, u->ier);
+
+ /* Loop over until we are full, or no data is available */
+ while (uart_getreg(bas, UART_DM_SR) & UART_DM_SR_RXRDY) {
+ if (uart_rx_full(sc)) {
+ /* No space left in input buffer */
+ sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN;
+ break;
+ }
+
+ /* Read RX FIFO */
+ c = uart_getreg(bas, UART_DM_RF(0));
+ uart_barrier(bas);
+
+ uart_rx_put(sc, c);
+ }
+
+ uart_unlock(sc->sc_hwmtx);
+
+ return (0);
+}
+
+static int
+msm_bus_param(struct uart_softc *sc, int baudrate, int databits,
+ int stopbits, int parity)
+{
+ int error;
+
+ if (sc->sc_bas.rclk == 0)
+ sc->sc_bas.rclk = DEF_CLK;
+
+ KASSERT(sc->sc_bas.rclk != 0, ("msm_init: Invalid rclk"));
+
+ uart_lock(sc->sc_hwmtx);
+ error = msm_uart_param(&sc->sc_bas, baudrate, databits, stopbits,
+ parity);
+ uart_unlock(sc->sc_hwmtx);
+
+ return (error);
+}
+
+static int
+msm_bus_ipend(struct uart_softc *sc)
+{
+ struct msm_uart_softc *u = (struct msm_uart_softc *)sc;
+ struct uart_bas *bas = &sc->sc_bas;
+ uint32_t isr;
+ int ipend;
+
+ uart_lock(sc->sc_hwmtx);
+
+ /* Get ISR status */
+ isr = GETREG(bas, UART_DM_MISR);
+
+ ipend = 0;
+
+ /* Uart RX starting, notify upper layer */
+ if (isr & UART_DM_RXLEV) {
+ u->ier &= ~UART_DM_RXLEV;
+ SETREG(bas, UART_DM_IMR, u->ier);
+ uart_barrier(bas);
+ ipend |= SER_INT_RXREADY;
+ }
+
+ /* Stale RX interrupt */
+ if (isr & UART_DM_RXSTALE) {
+ /* Disable and reset it */
+ SETREG(bas, UART_DM_CR, UART_DM_STALE_EVENT_DISABLE);
+ SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT);
+ uart_barrier(bas);
+ ipend |= SER_INT_RXREADY;
+ }
+
+ /* TX READY interrupt */
+ if (isr & UART_DM_TX_READY) {
+ /* Clear TX Ready */
+ SETREG(bas, UART_DM_CR, UART_DM_CLEAR_TX_READY);
+
+ /* Disable TX_READY */
+ u->ier &= ~UART_DM_TX_READY;
+ SETREG(bas, UART_DM_IMR, u->ier);
+ uart_barrier(bas);
+
+ if (sc->sc_txbusy != 0)
+ ipend |= SER_INT_TXIDLE;
+ }
+
+ if (isr & UART_DM_TXLEV) {
+ /* TX FIFO is empty */
+ u->ier &= ~UART_DM_TXLEV;
+ SETREG(bas, UART_DM_IMR, u->ier);
+ uart_barrier(bas);
+
+ if (sc->sc_txbusy != 0)
+ ipend |= SER_INT_TXIDLE;
+ }
+
+ uart_unlock(sc->sc_hwmtx);
+ return (ipend);
+}
+
+static int
+msm_bus_flush(struct uart_softc *sc, int what)
+{
+
+ return (0);
+}
+
+static int
+msm_bus_getsig(struct uart_softc *sc)
+{
+
+ return (0);
+}
+
+static int
+msm_bus_ioctl(struct uart_softc *sc, int request, intptr_t data)
+{
+
+ return (EINVAL);
+}
+
+static void
+msm_bus_grab(struct uart_softc *sc)
+{
+ struct uart_bas *bas = &sc->sc_bas;
+
+ /*
+ * XXX: Turn off all interrupts to enter polling mode. Leave the
+ * saved mask alone. We'll restore whatever it was in ungrab.
+ */
+ uart_lock(sc->sc_hwmtx);
+ SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT);
+ SETREG(bas, UART_DM_IMR, 0);
+ uart_barrier(bas);
+ uart_unlock(sc->sc_hwmtx);
+}
+
+static void
+msm_bus_ungrab(struct uart_softc *sc)
+{
+ struct msm_uart_softc *u = (struct msm_uart_softc *)sc;
+ struct uart_bas *bas = &sc->sc_bas;
+
+ /*
+ * Restore previous interrupt mask
+ */
+ uart_lock(sc->sc_hwmtx);
+ SETREG(bas, UART_DM_IMR, u->ier);
+ uart_barrier(bas);
+ uart_unlock(sc->sc_hwmtx);
+}
+
+struct uart_class uart_msm_class = {
+ "msm",
+ msm_methods,
+ sizeof(struct msm_uart_softc),
+ .uc_ops = &uart_msm_ops,
+ .uc_range = 8,
+ .uc_rclk = DEF_CLK,
+};
diff --git a/sys/dev/uart/uart_dev_msm.h b/sys/dev/uart/uart_dev_msm.h
new file mode 100644
index 0000000..89a7f19
--- /dev/null
+++ b/sys/dev/uart/uart_dev_msm.h
@@ -0,0 +1,229 @@
+/*-
+ * Copyright (c) 2014 Ganbold Tsagaankhuu <ganbold@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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _UART_DM_H_
+#define _UART_DM_H_
+
+#define UART_DM_EXTR_BITS(value, start_pos, end_pos) \
+ ((value << (32 - end_pos)) >> (32 - (end_pos - start_pos)))
+
+/* UART Parity Mode */
+enum UART_DM_PARITY_MODE {
+ UART_DM_NO_PARITY,
+ UART_DM_ODD_PARITY,
+ UART_DM_EVEN_PARITY,
+ UART_DM_SPACE_PARITY
+};
+
+/* UART Stop Bit Length */
+enum UART_DM_STOP_BIT_LEN {
+ UART_DM_SBL_9_16,
+ UART_DM_SBL_1,
+ UART_DM_SBL_1_9_16,
+ UART_DM_SBL_2
+};
+
+/* UART Bits per Char */
+enum UART_DM_BITS_PER_CHAR {
+ UART_DM_5_BPS,
+ UART_DM_6_BPS,
+ UART_DM_7_BPS,
+ UART_DM_8_BPS
+};
+
+/* 8-N-1 Configuration */
+#define UART_DM_8_N_1_MODE (UART_DM_NO_PARITY | \
+ (UART_DM_SBL_1 << 2) | \
+ (UART_DM_8_BPS << 4))
+
+/* UART_DM Registers */
+
+/* UART Operational Mode Registers (HSUART) */
+#define UART_DM_MR1 0x00
+#define UART_DM_MR1_AUTO_RFR_LEVEL1_BMSK 0xffffff00
+#define UART_DM_MR1_AUTO_RFR_LEVEL0_BMSK 0x3f
+#define UART_DM_MR1_CTS_CTL_BMSK 0x40
+#define UART_DM_MR1_RX_RDY_CTL_BMSK 0x80
+
+#define UART_DM_MR2 0x04
+#define UART_DM_MR2_ERROR_MODE_BMSK 0x40
+#define UART_DM_MR2_BITS_PER_CHAR_BMSK 0x30
+#define UART_DM_MR2_STOP_BIT_LEN_BMSK 0x0c
+#define UART_DM_MR2_PARITY_MODE_BMSK 0x03
+#define UART_DM_RXBRK_ZERO_CHAR_OFF (1 << 8)
+#define UART_DM_LOOPBACK (1 << 7)
+
+/* UART Clock Selection Register, write only */
+#define UART_DM_CSR 0x08
+#define UART_DM_CSR_115200 0xff
+#define UART_DM_CSR_57600 0xee
+#define UART_DM_CSR_38400 0xdd
+#define UART_DM_CSR_28800 0xcc
+#define UART_DM_CSR_19200 0xbb
+#define UART_DM_CSR_14400 0xaa
+#define UART_DM_CSR_9600 0x99
+#define UART_DM_CSR_7200 0x88
+#define UART_DM_CSR_4800 0x77
+#define UART_DM_CSR_3600 0x66
+#define UART_DM_CSR_2400 0x55
+#define UART_DM_CSR_1200 0x44
+#define UART_DM_CSR_600 0x33
+#define UART_DM_CSR_300 0x22
+#define UART_DM_CSR_150 0x11
+#define UART_DM_CSR_75 0x00
+
+/* UART DM TX FIFO Registers - 4, write only */
+#define UART_DM_TF(x) (0x70 + (4 * (x)))
+
+/* UART Command Register, write only */
+#define UART_DM_CR 0x10
+#define UART_DM_CR_RX_ENABLE (1 << 0)
+#define UART_DM_CR_RX_DISABLE (1 << 1)
+#define UART_DM_CR_TX_ENABLE (1 << 2)
+#define UART_DM_CR_TX_DISABLE (1 << 3)
+
+/* UART_DM_CR channel command bit value (register field is bits 8:4) */
+#define UART_DM_RESET_RX 0x10
+#define UART_DM_RESET_TX 0x20
+#define UART_DM_RESET_ERROR_STATUS 0x30
+#define UART_DM_RESET_BREAK_INT 0x40
+#define UART_DM_START_BREAK 0x50
+#define UART_DM_STOP_BREAK 0x60
+#define UART_DM_RESET_CTS 0x70
+#define UART_DM_RESET_STALE_INT 0x80
+#define UART_DM_RFR_LOW 0xD0
+#define UART_DM_RFR_HIGH 0xE0
+#define UART_DM_CR_PROTECTION_EN 0x100
+#define UART_DM_STALE_EVENT_ENABLE 0x500
+#define UART_DM_STALE_EVENT_DISABLE 0x600
+#define UART_DM_FORCE_STALE_EVENT 0x400
+#define UART_DM_CLEAR_TX_READY 0x300
+#define UART_DM_RESET_TX_ERROR 0x800
+#define UART_DM_RESET_TX_DONE 0x810
+
+/* UART Interrupt Mask Register */
+#define UART_DM_IMR 0x14
+/* these can be used for both ISR and IMR registers */
+#define UART_DM_TXLEV (1 << 0)
+#define UART_DM_RXHUNT (1 << 1)
+#define UART_DM_RXBRK_CHNG (1 << 2)
+#define UART_DM_RXSTALE (1 << 3)
+#define UART_DM_RXLEV (1 << 4)
+#define UART_DM_DELTA_CTS (1 << 5)
+#define UART_DM_CURRENT_CTS (1 << 6)
+#define UART_DM_TX_READY (1 << 7)
+#define UART_DM_TX_ERROR (1 << 8)
+#define UART_DM_TX_DONE (1 << 9)
+#define UART_DM_RXBREAK_START (1 << 10)
+#define UART_DM_RXBREAK_END (1 << 11)
+#define UART_DM_PAR_FRAME_ERR_IRQ (1 << 12)
+
+#define UART_DM_IMR_ENABLED (UART_DM_TX_READY | \
+ UART_DM_TXLEV | \
+ UART_DM_RXLEV | \
+ UART_DM_RXSTALE)
+
+/* UART Interrupt Programming Register */
+#define UART_DM_IPR 0x18
+#define UART_DM_STALE_TIMEOUT_LSB 0x0f
+#define UART_DM_STALE_TIMEOUT_MSB 0x00
+#define UART_DM_IPR_STALE_TIMEOUT_MSB_BMSK 0xffffff80
+#define UART_DM_IPR_STALE_LSB_BMSK 0x1f
+
+/* UART Transmit/Receive FIFO Watermark Register */
+#define UART_DM_TFWR 0x1c
+/* Interrupt is generated when FIFO level is less than or equal to this value */
+#define UART_DM_TFW_VALUE 0
+
+#define UART_DM_RFWR 0x20
+/* Interrupt generated when no of words in RX FIFO is greater than this value */
+#define UART_DM_RFW_VALUE 0
+
+/* UART Hunt Character Register */
+#define UART_DM_HCR 0x24
+
+/* Used for RX transfer initialization */
+#define UART_DM_DMRX 0x34
+/* Default DMRX value - any value bigger than FIFO size would be fine */
+#define UART_DM_DMRX_DEF_VALUE 0x220
+
+/* Register to enable IRDA function */
+#define UART_DM_IRDA 0x38
+
+/* UART Data Mover Enable Register */
+#define UART_DM_DMEN 0x3c
+
+/* Number of characters for Transmission */
+#define UART_DM_NO_CHARS_FOR_TX 0x40
+
+/* UART RX FIFO Base Address */
+#define UART_DM_BADR 0x44
+
+#define UART_DM_SIM_CFG_ADDR 0x80
+
+/* Read only registers */
+/* UART Status Register */
+#define UART_DM_SR 0x08
+/* register field mask mapping */
+#define UART_DM_SR_RXRDY (1 << 0)
+#define UART_DM_SR_RXFULL (1 << 1)
+#define UART_DM_SR_TXRDY (1 << 2)
+#define UART_DM_SR_TXEMT (1 << 3)
+#define UART_DM_SR_UART_OVERRUN (1 << 4)
+#define UART_DM_SR_PAR_FRAME_ERR (1 << 5)
+#define UART_DM_RX_BREAK (1 << 6)
+#define UART_DM_HUNT_CHAR (1 << 7)
+#define UART_DM_RX_BRK_START_LAST (1 << 8)
+
+/* UART Receive FIFO Registers - 4 in numbers */
+#define UART_DM_RF(x) (0x70 + (4 * (x)))
+
+/* UART Masked Interrupt Status Register */
+#define UART_DM_MISR 0x10
+
+/* UART Interrupt Status Register */
+#define UART_DM_ISR 0x14
+
+/* Number of characters received since the end of last RX transfer */
+#define UART_DM_RX_TOTAL_SNAP 0x38
+
+/* UART TX FIFO Status Register */
+#define UART_DM_TXFS 0x4c
+#define UART_DM_TXFS_STATE_LSB(x) UART_DM_EXTR_BITS(x,0,6)
+#define UART_DM_TXFS_STATE_MSB(x) UART_DM_EXTR_BITS(x,14,31)
+#define UART_DM_TXFS_BUF_STATE(x) UART_DM_EXTR_BITS(x,7,9)
+#define UART_DM_TXFS_ASYNC_STATE(x) UART_DM_EXTR_BITS(x,10,13)
+
+/* UART RX FIFO Status Register */
+#define UART_DM_RXFS 0x50
+#define UART_DM_RXFS_STATE_LSB(x) UART_DM_EXTR_BITS(x,0,6)
+#define UART_DM_RXFS_STATE_MSB(x) UART_DM_EXTR_BITS(x,14,31)
+#define UART_DM_RXFS_BUF_STATE(x) UART_DM_EXTR_BITS(x,7,9)
+#define UART_DM_RXFS_ASYNC_STATE(x) UART_DM_EXTR_BITS(x,10,13)
+
+#endif /* _UART_DM_H_ */
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index f06964e..8676c0f 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -614,6 +614,10 @@ xhci_init(struct xhci_softc *sc, device_t self)
sc->sc_bus.devices = sc->sc_devices;
sc->sc_bus.devices_max = XHCI_MAX_DEVICES;
+ /* set default cycle state in case of early interrupts */
+ sc->sc_event_ccs = 1;
+ sc->sc_command_ccs = 1;
+
/* setup command queue mutex and condition varible */
cv_init(&sc->sc_cmd_cv, "CMDQ");
sx_init(&sc->sc_cmd_sx, "CMDQ lock");
@@ -2267,14 +2271,17 @@ xhci_configure_mask(struct usb_device *udev, uint32_t mask, uint8_t drop)
/* adjust */
x--;
- /* figure out maximum */
- if (x > sc->sc_hw.devs[index].context_num) {
+ /* figure out the maximum number of contexts */
+ if (x > sc->sc_hw.devs[index].context_num)
sc->sc_hw.devs[index].context_num = x;
- temp = xhci_ctx_get_le32(sc, &pinp->ctx_slot.dwSctx0);
- temp &= ~XHCI_SCTX_0_CTX_NUM_SET(31);
- temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1);
- xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp);
- }
+ else
+ x = sc->sc_hw.devs[index].context_num;
+
+ /* update number of contexts */
+ temp = xhci_ctx_get_le32(sc, &pinp->ctx_slot.dwSctx0);
+ temp &= ~XHCI_SCTX_0_CTX_NUM_SET(31);
+ temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1);
+ xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp);
}
return (0);
}
diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h
index 408b429..7352e9c 100644
--- a/sys/dev/usb/controller/xhci.h
+++ b/sys/dev/usb/controller/xhci.h
@@ -493,7 +493,8 @@ struct xhci_softc {
uint8_t sc_noscratch;
/* root HUB device configuration */
uint8_t sc_conf;
- uint8_t sc_hub_idata[2];
+ /* root HUB port event bitmap, max 256 ports */
+ uint8_t sc_hub_idata[32];
/* size of context */
uint8_t sc_ctx_is_64_byte;
diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c
index 3960673..2dad2bd 100644
--- a/sys/dev/usb/usb_dev.c
+++ b/sys/dev/usb/usb_dev.c
@@ -298,6 +298,10 @@ error:
}
mtx_unlock(&usb_ref_lock);
DPRINTFN(2, "fail\n");
+
+ /* clear all refs */
+ memset(crd, 0, sizeof(*crd));
+
return (USB_ERR_INVAL);
}
@@ -1093,8 +1097,8 @@ usb_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, struct thread*
goto done;
if (usb_usb_ref_device(cpd, &refs)) {
- err = ENXIO;
- goto done;
+ /* we lost the reference */
+ return (ENXIO);
}
err = (f->methods->f_ioctl_post) (f, cmd, addr, fflags);
@@ -1117,9 +1121,8 @@ usb_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, struct thread*
while (usb_ref_device(cpd, &refs, 1 /* need uref */)) {
if (usb_ref_device(cpd, &refs, 0)) {
- /* device no longer exits */
- err = ENXIO;
- goto done;
+ /* device no longer exists */
+ return (ENXIO);
}
usb_unref_device(cpd, &refs);
usb_pause_mtx(NULL, hz / 128);
@@ -1411,9 +1414,9 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag)
return (err);
err = usb_ref_device(cpd, &refs, 0 /* no uref */ );
- if (err) {
+ if (err)
return (ENXIO);
- }
+
fflags = cpd->fflags;
f = refs.rxfifo;
@@ -1537,9 +1540,9 @@ usb_write(struct cdev *dev, struct uio *uio, int ioflag)
return (err);
err = usb_ref_device(cpd, &refs, 0 /* no uref */ );
- if (err) {
+ if (err)
return (ENXIO);
- }
+
fflags = cpd->fflags;
f = refs.txfifo;
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 330abbb..17a8806 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -3717,6 +3717,7 @@ product REALTEK RTL8191CU 0x8177 RTL8191CU
product REALTEK RTL8192CU 0x8178 RTL8192CU
product REALTEK RTL8192CE 0x817c RTL8192CE
product REALTEK RTL8188RU_1 0x817d RTL8188RU
+product REALTEK RTL8188RU_3 0x817f RTL8188RU
product REALTEK RTL8712 0x8712 RTL8712
product REALTEK RTL8713 0x8712 RTL8713
product REALTEK RTL8188RU_2 0x317f RTL8188RU
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c
index 676ad39..1f728d4 100644
--- a/sys/dev/usb/wlan/if_urtwn.c
+++ b/sys/dev/usb/wlan/if_urtwn.c
@@ -141,6 +141,7 @@ static const STRUCT_USB_HOST_ID urtwn_devs[] = {
URTWN_DEV(REALTEK, RTL8188CUS),
URTWN_DEV(REALTEK, RTL8188RU_1),
URTWN_DEV(REALTEK, RTL8188RU_2),
+ URTWN_DEV(REALTEK, RTL8188RU_3),
URTWN_DEV(REALTEK, RTL8191CU),
URTWN_DEV(REALTEK, RTL8192CE),
URTWN_DEV(REALTEK, RTL8192CU),
diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h
index f384a60..578f1a8 100644
--- a/sys/dev/vt/vt.h
+++ b/sys/dev/vt/vt.h
@@ -260,6 +260,7 @@ struct vt_window {
unsigned int vw_number; /* (c) Window number. */
int vw_kbdmode; /* (?) Keyboard mode. */
int vw_prev_kbdmode;/* (?) Previous mode. */
+ int vw_kbdstate; /* (?) Keyboard state. */
int vw_grabbed; /* (?) Grab count. */
char *vw_kbdsq; /* Escape sequence queue*/
unsigned int vw_flags; /* (d) Per-window flags. */
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index 4e8d19b..2dd7e3f 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -298,6 +298,97 @@ vt_switch_timer(void *arg)
}
static int
+vt_save_kbd_mode(struct vt_window *vw, keyboard_t *kbd)
+{
+ int mode, ret;
+
+ mode = 0;
+ ret = kbdd_ioctl(kbd, KDGKBMODE, (caddr_t)&mode);
+ if (ret == ENOIOCTL)
+ ret = ENODEV;
+ if (ret != 0)
+ return (ret);
+
+ vw->vw_kbdmode = mode;
+
+ return (0);
+}
+
+static int
+vt_update_kbd_mode(struct vt_window *vw, keyboard_t *kbd)
+{
+ int ret;
+
+ ret = kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode);
+ if (ret == ENOIOCTL)
+ ret = ENODEV;
+
+ return (ret);
+}
+
+static int
+vt_save_kbd_state(struct vt_window *vw, keyboard_t *kbd)
+{
+ int state, ret;
+
+ state = 0;
+ ret = kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
+ if (ret == ENOIOCTL)
+ ret = ENODEV;
+ if (ret != 0)
+ return (ret);
+
+ vw->vw_kbdstate &= ~LOCK_MASK;
+ vw->vw_kbdstate |= state & LOCK_MASK;
+
+ return (0);
+}
+
+static int
+vt_update_kbd_state(struct vt_window *vw, keyboard_t *kbd)
+{
+ int state, ret;
+
+ state = vw->vw_kbdstate & LOCK_MASK;
+ ret = kbdd_ioctl(kbd, KDSKBSTATE, (caddr_t)&state);
+ if (ret == ENOIOCTL)
+ ret = ENODEV;
+
+ return (ret);
+}
+
+static int
+vt_save_kbd_leds(struct vt_window *vw, keyboard_t *kbd)
+{
+ int leds, ret;
+
+ leds = 0;
+ ret = kbdd_ioctl(kbd, KDGETLED, (caddr_t)&leds);
+ if (ret == ENOIOCTL)
+ ret = ENODEV;
+ if (ret != 0)
+ return (ret);
+
+ vw->vw_kbdstate &= ~LED_MASK;
+ vw->vw_kbdstate |= leds & LED_MASK;
+
+ return (0);
+}
+
+static int
+vt_update_kbd_leds(struct vt_window *vw, keyboard_t *kbd)
+{
+ int leds, ret;
+
+ leds = vw->vw_kbdstate & LED_MASK;
+ ret = kbdd_ioctl(kbd, KDSETLED, (caddr_t)&leds);
+ if (ret == ENOIOCTL)
+ ret = ENODEV;
+
+ return (ret);
+}
+
+static int
vt_window_preswitch(struct vt_window *vw, struct vt_window *curvw)
{
@@ -409,7 +500,11 @@ vt_window_switch(struct vt_window *vw)
mtx_lock(&Giant);
kbd = kbd_get_keyboard(vd->vd_keyboard);
if (kbd != NULL) {
- kbdd_ioctl(kbd, KDSKBMODE, (void *)&vw->vw_kbdmode);
+ if (curvw->vw_kbdmode == K_XLATE)
+ vt_save_kbd_state(curvw, kbd);
+
+ vt_update_kbd_mode(vw, kbd);
+ vt_update_kbd_state(vw, kbd);
}
mtx_unlock(&Giant);
DPRINTF(10, "%s(ttyv%d) done\n", __func__, vw->vw_number);
@@ -602,7 +697,6 @@ static int
vt_processkey(keyboard_t *kbd, struct vt_device *vd, int c)
{
struct vt_window *vw = vd->vd_curwindow;
- int state = 0;
#if VT_ALT_TO_ESC_HACK
if (c & RELKEY) {
@@ -665,10 +759,9 @@ vt_processkey(keyboard_t *kbd, struct vt_device *vd, int c)
vt_proc_window_switch(vw);
return (0);
case SLK: {
-
- kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
+ vt_save_kbd_state(vw, kbd);
VT_LOCK(vd);
- if (state & SLKED) {
+ if (vw->vw_kbdstate & SLKED) {
/* Turn scrolling on. */
vw->vw_flags |= VWF_SCROLL;
VTBUF_SLCK_ENABLE(&vw->vw_buf);
@@ -1201,13 +1294,11 @@ vtterm_cngetc(struct terminal *tm)
struct vt_window *vw = tm->tm_softc;
struct vt_device *vd = vw->vw_device;
keyboard_t *kbd;
- int state;
u_int c;
if (vw->vw_kbdsq && *vw->vw_kbdsq)
return (*vw->vw_kbdsq++);
- state = 0;
/* Make sure the splash screen is not there. */
if (vd->vd_flags & VDF_SPLASH) {
/* Remove splash */
@@ -1223,8 +1314,8 @@ vtterm_cngetc(struct terminal *tm)
return (-1);
/* Force keyboard input mode to K_XLATE */
- c = K_XLATE;
- kbdd_ioctl(kbd, KDSKBMODE, (void *)&c);
+ vw->vw_kbdmode = K_XLATE;
+ vt_update_kbd_mode(vw, kbd);
/* Switch the keyboard to polling to make it work here. */
kbdd_poll(kbd, TRUE);
@@ -1243,8 +1334,8 @@ vtterm_cngetc(struct terminal *tm)
if (c & SPCLKEY) {
switch (c) {
case SPCLKEY | SLK:
- kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (state & SLKED) {
+ vt_save_kbd_state(vw, kbd);
+ if (vw->vw_kbdstate & SLKED) {
/* Turn scrolling on. */
vw->vw_flags |= VWF_SCROLL;
VTBUF_SLCK_ENABLE(&vw->vw_buf);
@@ -1311,7 +1402,7 @@ vtterm_cngrab(struct terminal *tm)
/* We shall always use the keyboard in the XLATE mode here. */
vw->vw_prev_kbdmode = vw->vw_kbdmode;
vw->vw_kbdmode = K_XLATE;
- (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode);
+ vt_update_kbd_mode(vw, kbd);
kbdd_poll(kbd, TRUE);
}
@@ -1336,7 +1427,7 @@ vtterm_cnungrab(struct terminal *tm)
kbdd_poll(kbd, FALSE);
vw->vw_kbdmode = vw->vw_prev_kbdmode;
- (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode);
+ vt_update_kbd_mode(vw, kbd);
kbdd_disable(kbd);
}
@@ -1890,12 +1981,8 @@ skip_thunk:
case SETFKEY:
case KDGKBINFO:
case KDGKBTYPE:
- case KDSKBSTATE: /* set keyboard state (locks) */
- case KDGKBSTATE: /* get keyboard state (locks) */
case KDGETREPEAT: /* get keyboard repeat & delay rates */
case KDSETREPEAT: /* set keyboard repeat & delay rates (new) */
- case KDSETLED: /* set keyboard LED status */
- case KDGETLED: /* get keyboard LED status */
case KBADDKBD: /* add/remove keyboard to/from mux */
case KBRELKBD: {
error = 0;
@@ -1915,18 +2002,101 @@ skip_thunk:
}
return (error);
}
+ case KDGKBSTATE: { /* get keyboard state (locks) */
+ error = 0;
+
+ if (vw == vd->vd_curwindow) {
+ mtx_lock(&Giant);
+ kbd = kbd_get_keyboard(vd->vd_keyboard);
+ if (kbd != NULL)
+ error = vt_save_kbd_state(vw, kbd);
+ mtx_unlock(&Giant);
+
+ if (error != 0)
+ return (error);
+ }
+
+ *(int *)data = vw->vw_kbdstate & LOCK_MASK;
+
+ return (error);
+ }
+ case KDSKBSTATE: { /* set keyboard state (locks) */
+ int state;
+
+ state = *(int *)data;
+ if (state & ~LOCK_MASK)
+ return (EINVAL);
+
+ vw->vw_kbdstate &= ~LOCK_MASK;
+ vw->vw_kbdstate |= state;
+
+ error = 0;
+ if (vw == vd->vd_curwindow) {
+ mtx_lock(&Giant);
+ kbd = kbd_get_keyboard(vd->vd_keyboard);
+ if (kbd != NULL)
+ error = vt_update_kbd_state(vw, kbd);
+ mtx_unlock(&Giant);
+ }
+
+ return (error);
+ }
+ case KDGETLED: { /* get keyboard LED status */
+ error = 0;
+
+ if (vw == vd->vd_curwindow) {
+ mtx_lock(&Giant);
+ kbd = kbd_get_keyboard(vd->vd_keyboard);
+ if (kbd != NULL)
+ error = vt_save_kbd_leds(vw, kbd);
+ mtx_unlock(&Giant);
+
+ if (error != 0)
+ return (error);
+ }
+
+ *(int *)data = vw->vw_kbdstate & LED_MASK;
+
+ return (error);
+ }
+ case KDSETLED: { /* set keyboard LED status */
+ int leds;
+
+ leds = *(int *)data;
+ if (leds & ~LED_MASK)
+ return (EINVAL);
+
+ vw->vw_kbdstate &= ~LED_MASK;
+ vw->vw_kbdstate |= leds;
+
+ error = 0;
+ if (vw == vd->vd_curwindow) {
+ mtx_lock(&Giant);
+ kbd = kbd_get_keyboard(vd->vd_keyboard);
+ if (kbd != NULL)
+ error = vt_update_kbd_leds(vw, kbd);
+ mtx_unlock(&Giant);
+ }
+
+ return (error);
+ }
case KDGKBMODE: {
- int mode = -1;
+ error = 0;
- mtx_lock(&Giant);
- kbd = kbd_get_keyboard(vd->vd_keyboard);
- if (kbd != NULL) {
- kbdd_ioctl(kbd, KDGKBMODE, (void *)&mode);
+ if (vw == vd->vd_curwindow) {
+ mtx_lock(&Giant);
+ kbd = kbd_get_keyboard(vd->vd_keyboard);
+ if (kbd != NULL)
+ error = vt_save_kbd_mode(vw, kbd);
+ mtx_unlock(&Giant);
+
+ if (error != 0)
+ return (error);
}
- mtx_unlock(&Giant);
- DPRINTF(20, "mode %d, vw_kbdmode %d\n", mode, vw->vw_kbdmode);
- *(int *)data = mode;
- return (0);
+
+ *(int *)data = vw->vw_kbdmode;
+
+ return (error);
}
case KDSKBMODE: {
int mode;
@@ -1937,19 +2107,17 @@ skip_thunk:
case K_RAW:
case K_CODE:
vw->vw_kbdmode = mode;
- if (vw == vd->vd_curwindow) {
- keyboard_t *kbd;
- error = 0;
+ error = 0;
+ if (vw == vd->vd_curwindow) {
mtx_lock(&Giant);
kbd = kbd_get_keyboard(vd->vd_keyboard);
- if (kbd != NULL) {
- error = kbdd_ioctl(kbd, KDSKBMODE,
- (void *)&mode);
- }
+ if (kbd != NULL)
+ error = vt_update_kbd_mode(vw, kbd);
mtx_unlock(&Giant);
}
- return (0);
+
+ return (error);
default:
return (EINVAL);
}
@@ -1977,8 +2145,17 @@ skip_thunk:
return (0);
case CONS_GETINFO: {
vid_info_t *vi = (vid_info_t *)data;
+ if (vi->size != sizeof(struct vid_info))
+ return (EINVAL);
+
+ if (vw == vd->vd_curwindow) {
+ kbd = kbd_get_keyboard(vd->vd_keyboard);
+ if (kbd != NULL)
+ vt_save_kbd_state(vw, kbd);
+ }
vi->m_num = vd->vd_curwindow->vw_number + 1;
+ vi->mk_keylock = vw->vw_kbdstate & LOCK_MASK;
/* XXX: other fields! */
return (0);
}
@@ -2093,13 +2270,14 @@ skip_thunk:
(void *)vd, vt_kbdevent, vd);
if (i >= 0) {
if (vd->vd_keyboard != -1) {
+ vt_save_kbd_state(vd->vd_curwindow, kbd);
kbd_release(kbd, (void *)vd);
}
kbd = kbd_get_keyboard(i);
vd->vd_keyboard = i;
- (void)kbdd_ioctl(kbd, KDSKBMODE,
- (caddr_t)&vd->vd_curwindow->vw_kbdmode);
+ vt_update_kbd_mode(vd->vd_curwindow, kbd);
+ vt_update_kbd_state(vd->vd_curwindow, kbd);
} else {
error = EPERM; /* XXX */
}
@@ -2115,6 +2293,7 @@ skip_thunk:
mtx_unlock(&Giant);
return (EINVAL);
}
+ vt_save_kbd_state(vd->vd_curwindow, kbd);
error = kbd_release(kbd, (void *)vd);
if (error == 0) {
vd->vd_keyboard = -1;
diff --git a/sys/dev/xen/balloon/balloon.c b/sys/dev/xen/balloon/balloon.c
index 6503a00..e113e2c 100644
--- a/sys/dev/xen/balloon/balloon.c
+++ b/sys/dev/xen/balloon/balloon.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
+#include <sys/module.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
@@ -348,25 +349,50 @@ watch_target(struct xs_watch *watch,
set_new_target(new_target >> KB_TO_PAGE_SHIFT);
}
-static void
-balloon_init_watcher(void *arg)
+/*------------------ Private Device Attachment Functions --------------------*/
+/**
+ * \brief Identify instances of this device type in the system.
+ *
+ * \param driver The driver performing this identify action.
+ * \param parent The NewBus parent device for any devices this method adds.
+ */
+static void
+xenballoon_identify(driver_t *driver __unused, device_t parent)
{
- int err;
-
- if (!is_running_on_xen())
- return;
+ /*
+ * A single device instance for our driver is always present
+ * in a system operating under Xen.
+ */
+ BUS_ADD_CHILD(parent, 0, driver->name, 0);
+}
- err = xs_register_watch(&target_watch);
- if (err)
- printf("Failed to set balloon watcher\n");
+/**
+ * \brief Probe for the existance of the Xen Balloon device
+ *
+ * \param dev NewBus device_t for this Xen control instance.
+ *
+ * \return Always returns 0 indicating success.
+ */
+static int
+xenballoon_probe(device_t dev)
+{
+ device_set_desc(dev, "Xen Balloon Device");
+ return (0);
}
-SYSINIT(balloon_init_watcher, SI_SUB_PSEUDO, SI_ORDER_ANY,
- balloon_init_watcher, NULL);
-static void
-balloon_init(void *arg)
+/**
+ * \brief Attach the Xen Balloon device.
+ *
+ * \param dev NewBus device_t for this Xen control instance.
+ *
+ * \return On success, 0. Otherwise an errno value indicating the
+ * type of failure.
+ */
+static int
+xenballoon_attach(device_t dev)
{
+ int err;
#ifndef XENHVM
vm_page_t page;
unsigned long pfn;
@@ -374,15 +400,13 @@ balloon_init(void *arg)
#define max_pfn HYPERVISOR_shared_info->arch.max_pfn
#endif
- if (!is_running_on_xen())
- return;
-
mtx_init(&balloon_mutex, "balloon_mutex", NULL, MTX_DEF);
#ifndef XENHVM
bs.current_pages = min(xen_start_info->nr_pages, max_pfn);
#else
- bs.current_pages = realmem;
+ bs.current_pages = xen_pv_domain() ?
+ HYPERVISOR_start_info->nr_pages : realmem;
#endif
bs.target_pages = bs.current_pages;
bs.balloon_low = 0;
@@ -403,17 +427,27 @@ balloon_init(void *arg)
#endif
target_watch.callback = watch_target;
-
- return;
-}
-SYSINIT(balloon_init, SI_SUB_PSEUDO, SI_ORDER_ANY, balloon_init, NULL);
-void balloon_update_driver_allowance(long delta);
+ err = xs_register_watch(&target_watch);
+ if (err)
+ device_printf(dev,
+ "xenballon: failed to set balloon watcher\n");
-void
-balloon_update_driver_allowance(long delta)
-{
- mtx_lock(&balloon_mutex);
- bs.driver_pages += delta;
- mtx_unlock(&balloon_mutex);
+ return (err);
}
+
+/*-------------------- Private Device Attachment Data -----------------------*/
+static device_method_t xenballoon_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, xenballoon_identify),
+ DEVMETHOD(device_probe, xenballoon_probe),
+ DEVMETHOD(device_attach, xenballoon_attach),
+
+ DEVMETHOD_END
+};
+
+DEFINE_CLASS_0(xenballoon, xenballoon_driver, xenballoon_methods, 0);
+devclass_t xenballoon_devclass;
+
+DRIVER_MODULE(xenballoon, xenstore, xenballoon_driver, xenballoon_devclass,
+ NULL, NULL);
diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c
index 654f307..1273961 100644
--- a/sys/dev/xen/blkback/blkback.c
+++ b/sys/dev/xen/blkback/blkback.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2009-2011 Spectra Logic Corporation
+ * Copyright (c) 2009-2012 Spectra Logic Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -784,6 +784,12 @@ struct xbb_softc {
/** Number of requests we have completed*/
uint64_t reqs_completed;
+ /** Number of requests we queued but not pushed*/
+ uint64_t reqs_queued_for_completion;
+
+ /** Number of requests we completed with an error status*/
+ uint64_t reqs_completed_with_error;
+
/** How many forced dispatches (i.e. without coalescing) have happend */
uint64_t forced_dispatch;
@@ -1143,7 +1149,7 @@ xbb_release_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist,
int wakeup)
{
- mtx_lock(&xbb->lock);
+ mtx_assert(&xbb->lock, MA_OWNED);
if (wakeup) {
wakeup = xbb->flags & XBBF_RESOURCE_SHORTAGE;
@@ -1167,8 +1173,6 @@ xbb_release_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist,
xbb_shutdown(xbb);
}
- mtx_unlock(&xbb->lock);
-
if (wakeup != 0)
taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task);
}
@@ -1261,16 +1265,16 @@ bailout_error:
if (nreq != NULL)
xbb_release_req(xbb, nreq);
- mtx_unlock(&xbb->lock);
-
if (nreqlist != NULL)
xbb_release_reqlist(xbb, nreqlist, /*wakeup*/ 0);
+ mtx_unlock(&xbb->lock);
+
return (1);
}
/**
- * Create and transmit a response to a blkif request.
+ * Create and queue a response to a blkif request.
*
* \param xbb Per-instance xbb configuration structure.
* \param req The request structure to which to respond.
@@ -1278,20 +1282,28 @@ bailout_error:
* in sys/xen/interface/io/blkif.h.
*/
static void
-xbb_send_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status)
+xbb_queue_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status)
{
blkif_response_t *resp;
- int more_to_do;
- int notify;
- more_to_do = 0;
+ /*
+ * The mutex is required here, and should be held across this call
+ * until after the subsequent call to xbb_push_responses(). This
+ * is to guarantee that another context won't queue responses and
+ * push them while we're active.
+ *
+ * That could lead to the other end being notified of responses
+ * before the resources have been freed on this end. The other end
+ * would then be able to queue additional I/O, and we may run out
+ * of resources because we haven't freed them all yet.
+ */
+ mtx_assert(&xbb->lock, MA_OWNED);
/*
* Place on the response ring for the relevant domain.
* For now, only the spacing between entries is different
* in the different ABIs, not the response entry layout.
*/
- mtx_lock(&xbb->lock);
switch (xbb->abi) {
case BLKIF_PROTOCOL_NATIVE:
resp = RING_GET_RESPONSE(&xbb->rings.native,
@@ -1315,8 +1327,38 @@ xbb_send_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status)
resp->operation = req->operation;
resp->status = status;
+ if (status != BLKIF_RSP_OKAY)
+ xbb->reqs_completed_with_error++;
+
xbb->rings.common.rsp_prod_pvt += BLKIF_SEGS_TO_BLOCKS(req->nr_pages);
- RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&xbb->rings.common, notify);
+
+ xbb->reqs_queued_for_completion++;
+
+}
+
+/**
+ * Send queued responses to blkif requests.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ * \param run_taskqueue Flag that is set to 1 if the taskqueue
+ * should be run, 0 if it does not need to be run.
+ * \param notify Flag that is set to 1 if the other end should be
+ * notified via irq, 0 if the other end should not be
+ * notified.
+ */
+static void
+xbb_push_responses(struct xbb_softc *xbb, int *run_taskqueue, int *notify)
+{
+ int more_to_do;
+
+ /*
+ * The mutex is required here.
+ */
+ mtx_assert(&xbb->lock, MA_OWNED);
+
+ more_to_do = 0;
+
+ RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&xbb->rings.common, *notify);
if (xbb->rings.common.rsp_prod_pvt == xbb->rings.common.req_cons) {
@@ -1331,15 +1373,10 @@ xbb_send_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status)
more_to_do = 1;
}
- xbb->reqs_completed++;
+ xbb->reqs_completed += xbb->reqs_queued_for_completion;
+ xbb->reqs_queued_for_completion = 0;
- mtx_unlock(&xbb->lock);
-
- if (more_to_do)
- taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task);
-
- if (notify)
- xen_intr_signal(xbb->xen_intr_handle);
+ *run_taskqueue = more_to_do;
}
/**
@@ -1353,23 +1390,29 @@ xbb_complete_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist)
{
struct xbb_xen_req *nreq;
off_t sectors_sent;
+ int notify, run_taskqueue;
sectors_sent = 0;
if (reqlist->flags & XBB_REQLIST_MAPPED)
xbb_unmap_reqlist(reqlist);
+ mtx_lock(&xbb->lock);
+
/*
- * All I/O is done, send the response. A lock should not be
- * necessary here because the request list is complete, and
- * therefore this is the only context accessing this request
- * right now. The functions we call do their own locking if
- * necessary.
+ * All I/O is done, send the response. A lock is not necessary
+ * to protect the request list, because all requests have
+ * completed. Therefore this is the only context accessing this
+ * reqlist right now. However, in order to make sure that no one
+ * else queues responses onto the queue or pushes them to the other
+ * side while we're active, we need to hold the lock across the
+ * calls to xbb_queue_response() and xbb_push_responses().
*/
STAILQ_FOREACH(nreq, &reqlist->contig_req_list, links) {
off_t cur_sectors_sent;
- xbb_send_response(xbb, nreq, reqlist->status);
+ /* Put this response on the ring, but don't push yet */
+ xbb_queue_response(xbb, nreq, reqlist->status);
/* We don't report bytes sent if there is an error. */
if (reqlist->status == BLKIF_RSP_OKAY)
@@ -1404,6 +1447,16 @@ xbb_complete_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist)
/*then*/&reqlist->ds_t0);
xbb_release_reqlist(xbb, reqlist, /*wakeup*/ 1);
+
+ xbb_push_responses(xbb, &run_taskqueue, &notify);
+
+ mtx_unlock(&xbb->lock);
+
+ if (run_taskqueue)
+ taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task);
+
+ if (notify)
+ xen_intr_signal(xbb->xen_intr_handle);
}
/**
@@ -3589,6 +3642,16 @@ xbb_setup_sysctl(struct xbb_softc *xbb)
"how many I/O requests have been completed");
SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "reqs_queued_for_completion", CTLFLAG_RW,
+ &xbb->reqs_queued_for_completion,
+ "how many I/O requests queued but not yet pushed");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "reqs_completed_with_error", CTLFLAG_RW,
+ &xbb->reqs_completed_with_error,
+ "how many I/O requests completed with error status");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
"forced_dispatch", CTLFLAG_RW, &xbb->forced_dispatch,
"how many I/O dispatches were forced");
diff --git a/sys/xen/xenstore/xenstore.c b/sys/dev/xen/xenstore/xenstore.c
index f7425da..4cf985a 100644
--- a/sys/xen/xenstore/xenstore.c
+++ b/sys/dev/xen/xenstore/xenstore.c
@@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/uio.h>
#include <sys/unistd.h>
+#include <sys/queue.h>
+#include <sys/taskqueue.h>
#include <machine/stdarg.h>
@@ -249,6 +251,20 @@ struct xs_softc {
* with the XenStore service) are available.
*/
struct intr_config_hook xs_attachcb;
+
+ /**
+ * Xenstore is a user-space process that usually runs in Dom0,
+ * so if this domain is booting as Dom0, xenstore wont we accessible,
+ * and we have to defer the initialization of xenstore related
+ * devices to later (when xenstore is started).
+ */
+ bool initialized;
+
+ /**
+ * Task to run when xenstore is initialized (Dom0 only), will
+ * take care of attaching xenstore related devices.
+ */
+ struct task xs_late_init;
};
/*-------------------------------- Global Data ------------------------------*/
@@ -352,6 +368,16 @@ static void
xs_intr(void * arg __unused /*__attribute__((unused))*/)
{
+ /* If xenstore has not been initialized, initialize it now */
+ if (!xs.initialized) {
+ xs.initialized = true;
+ /*
+ * Since this task is probing and attaching devices we
+ * have to hold the Giant lock.
+ */
+ taskqueue_enqueue(taskqueue_swi_giant, &xs.xs_late_init);
+ }
+
/*
* Hold ring lock across wakeup so that clients
* cannot miss a wakeup.
@@ -1104,7 +1130,6 @@ xs_probe(device_t dev)
static void
xs_attach_deferred(void *arg)
{
- xs_dev_init();
bus_generic_probe(xs.xs_dev);
bus_generic_attach(xs.xs_dev);
@@ -1112,6 +1137,15 @@ xs_attach_deferred(void *arg)
config_intrhook_disestablish(&xs.xs_attachcb);
}
+static void
+xs_attach_late(void *arg, int pending)
+{
+
+ KASSERT((pending == 1), ("xs late attach queued several times"));
+ bus_generic_probe(xs.xs_dev);
+ bus_generic_attach(xs.xs_dev);
+}
+
/**
* Attach to the XenStore.
*
@@ -1130,12 +1164,37 @@ xs_attach(device_t dev)
/* Initialize the interface to xenstore. */
struct proc *p;
+ xs.initialized = false;
if (xen_hvm_domain()) {
xs.evtchn = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN);
xs.gpfn = hvm_get_parameter(HVM_PARAM_STORE_PFN);
xen_store = pmap_mapdev(xs.gpfn * PAGE_SIZE, PAGE_SIZE);
+ xs.initialized = true;
} else if (xen_pv_domain()) {
- xs.evtchn = HYPERVISOR_start_info->store_evtchn;
+ if (HYPERVISOR_start_info->store_evtchn == 0) {
+ struct evtchn_alloc_unbound alloc_unbound;
+
+ /* Allocate a local event channel for xenstore */
+ alloc_unbound.dom = DOMID_SELF;
+ alloc_unbound.remote_dom = DOMID_SELF;
+ error = HYPERVISOR_event_channel_op(
+ EVTCHNOP_alloc_unbound, &alloc_unbound);
+ if (error != 0)
+ panic(
+ "unable to alloc event channel for Dom0: %d",
+ error);
+
+ HYPERVISOR_start_info->store_evtchn =
+ alloc_unbound.port;
+ xs.evtchn = alloc_unbound.port;
+
+ /* Allocate memory for the xs shared ring */
+ xen_store = malloc(PAGE_SIZE, M_XENSTORE,
+ M_WAITOK | M_ZERO);
+ } else {
+ xs.evtchn = HYPERVISOR_start_info->store_evtchn;
+ xs.initialized = true;
+ }
} else {
panic("Unknown domain type, cannot initialize xenstore.");
}
@@ -1167,7 +1226,11 @@ xs_attach(device_t dev)
xs.xs_attachcb.ich_func = xs_attach_deferred;
xs.xs_attachcb.ich_arg = NULL;
- config_intrhook_establish(&xs.xs_attachcb);
+ if (xs.initialized) {
+ config_intrhook_establish(&xs.xs_attachcb);
+ } else {
+ TASK_INIT(&xs.xs_late_init, 0, xs_attach_late, NULL);
+ }
return (error);
}
diff --git a/sys/xen/xenstore/xenstore_dev.c b/sys/dev/xen/xenstore/xenstore_dev.c
index e1b40914..54b5e82 100644
--- a/sys/xen/xenstore/xenstore_dev.c
+++ b/sys/dev/xen/xenstore/xenstore_dev.c
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/conf.h>
+#include <sys/module.h>
#include <xen/xen-os.h>
@@ -216,9 +217,71 @@ static struct cdevsw xs_dev_cdevsw = {
.d_name = "xs_dev",
};
-void
-xs_dev_init()
+/*------------------ Private Device Attachment Functions --------------------*/
+/**
+ * \brief Identify instances of this device type in the system.
+ *
+ * \param driver The driver performing this identify action.
+ * \param parent The NewBus parent device for any devices this method adds.
+ */
+static void
+xs_dev_identify(driver_t *driver __unused, device_t parent)
+{
+ /*
+ * A single device instance for our driver is always present
+ * in a system operating under Xen.
+ */
+ BUS_ADD_CHILD(parent, 0, driver->name, 0);
+}
+
+/**
+ * \brief Probe for the existance of the Xenstore device
+ *
+ * \param dev NewBus device_t for this instance.
+ *
+ * \return Always returns 0 indicating success.
+ */
+static int
+xs_dev_probe(device_t dev)
{
- make_dev(&xs_dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400,
+
+ device_set_desc(dev, "Xenstore user-space device");
+ return (0);
+}
+
+/**
+ * \brief Attach the Xenstore device.
+ *
+ * \param dev NewBus device_t for this instance.
+ *
+ * \return On success, 0. Otherwise an errno value indicating the
+ * type of failure.
+ */
+static int
+xs_dev_attach(device_t dev)
+{
+ struct cdev *xs_cdev;
+
+ xs_cdev = make_dev(&xs_dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400,
"xen/xenstore");
+ if (xs_cdev == NULL)
+ return (EINVAL);
+
+ return (0);
}
+
+/*-------------------- Private Device Attachment Data -----------------------*/
+static device_method_t xs_dev_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, xs_dev_identify),
+ DEVMETHOD(device_probe, xs_dev_probe),
+ DEVMETHOD(device_attach, xs_dev_attach),
+
+ DEVMETHOD_END
+};
+
+DEFINE_CLASS_0(xs_dev, xs_dev_driver, xs_dev_methods, 0);
+devclass_t xs_dev_devclass;
+
+DRIVER_MODULE(xs_dev, xenstore, xs_dev_driver, xs_dev_devclass,
+ NULL, NULL);
diff --git a/sys/dev/xen/xenstore/xenstored_dev.c b/sys/dev/xen/xenstore/xenstored_dev.c
new file mode 100644
index 0000000..ae24085
--- /dev/null
+++ b/sys/dev/xen/xenstore/xenstored_dev.c
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2014 Roger Pau Monné <roger.pau@citrix.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+#include <sys/errno.h>
+#include <sys/uio.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/conf.h>
+#include <sys/module.h>
+
+#include <xen/xen-os.h>
+
+#include <xen/hypervisor.h>
+#include <xen/xenstore/xenstorevar.h>
+#include <xen/xenstore/xenstore_internal.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#define XSD_READ_SIZE 20
+
+static int xsd_dev_read(struct cdev *dev, struct uio *uio, int ioflag);
+static int xsd_dev_mmap(struct cdev *dev, vm_ooffset_t offset,
+ vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr);
+
+
+static struct cdevsw xsd_dev_cdevsw = {
+ .d_version = D_VERSION,
+ .d_read = xsd_dev_read,
+ .d_mmap = xsd_dev_mmap,
+ .d_name = "xsd_dev",
+};
+
+static int
+xsd_dev_read(struct cdev *dev, struct uio *uio, int ioflag)
+{
+ char evtchn[XSD_READ_SIZE];
+ int error, len;
+
+ len = snprintf(evtchn, sizeof(evtchn), "%u",
+ HYPERVISOR_start_info->store_evtchn);
+ if (len < 0 || len > uio->uio_resid)
+ return (EINVAL);
+
+ error = uiomove(evtchn, len, uio);
+ if (error)
+ return (error);
+
+ return (0);
+}
+
+static int
+xsd_dev_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+ int nprot, vm_memattr_t *memattr)
+{
+
+ if (offset != 0)
+ return (EINVAL);
+
+ *paddr = pmap_kextract((vm_offset_t)xen_store);
+
+ return (0);
+}
+
+/*------------------ Private Device Attachment Functions --------------------*/
+/**
+ * \brief Identify instances of this device type in the system.
+ *
+ * \param driver The driver performing this identify action.
+ * \param parent The NewBus parent device for any devices this method adds.
+ */
+static void
+xsd_dev_identify(driver_t *driver __unused, device_t parent)
+{
+
+ if (!xen_pv_domain())
+ return;
+ if (HYPERVISOR_start_info->store_mfn != 0)
+ return;
+
+ /*
+ * Only attach if xenstore is not available, because we are the
+ * domain that's supposed to run it.
+ */
+ BUS_ADD_CHILD(parent, 0, driver->name, 0);
+}
+
+/**
+ * \brief Probe for the existence of the Xenstored device
+ *
+ * \param dev NewBus device_t for this instance.
+ *
+ * \return Always returns 0 indicating success.
+ */
+static int
+xsd_dev_probe(device_t dev)
+{
+
+ device_set_desc(dev, "Xenstored user-space device");
+ return (BUS_PROBE_NOWILDCARD);
+}
+
+/**
+ * \brief Attach the Xenstored device.
+ *
+ * \param dev NewBus device_t for this instance.
+ *
+ * \return On success, 0. Otherwise an errno value indicating the
+ * type of failure.
+ */
+static int
+xsd_dev_attach(device_t dev)
+{
+ struct cdev *xsd_cdev;
+
+ xsd_cdev = make_dev(&xsd_dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400,
+ "xen/xenstored");
+ if (xsd_cdev == NULL)
+ return (EINVAL);
+
+ return (0);
+}
+
+/*-------------------- Private Device Attachment Data -----------------------*/
+static device_method_t xsd_dev_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, xsd_dev_identify),
+ DEVMETHOD(device_probe, xsd_dev_probe),
+ DEVMETHOD(device_attach, xsd_dev_attach),
+
+ DEVMETHOD_END
+};
+
+DEFINE_CLASS_0(xsd_dev, xsd_dev_driver, xsd_dev_methods, 0);
+devclass_t xsd_dev_devclass;
+
+DRIVER_MODULE(xsd_dev, xenpv, xsd_dev_driver, xsd_dev_devclass,
+ NULL, NULL);
diff --git a/sys/fs/autofs/autofs.c b/sys/fs/autofs/autofs.c
index 5a247b4..719a2c5 100644
--- a/sys/fs/autofs/autofs.c
+++ b/sys/fs/autofs/autofs.c
@@ -76,6 +76,7 @@
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/syscallsubr.h>
+#include <sys/taskqueue.h>
#include <sys/vnode.h>
#include <machine/atomic.h>
#include <vm/uma.h>
@@ -260,7 +261,7 @@ autofs_path(struct autofs_node *anp)
}
static void
-autofs_callout(void *context)
+autofs_task(void *context, int pending)
{
struct autofs_request *ar;
@@ -296,9 +297,9 @@ autofs_cached(struct autofs_node *anp, const char *component, int componentlen)
* is necessary for wildcard indirect map keys to work.
*/
if (anp->an_parent == NULL && componentlen != 0) {
- AUTOFS_LOCK(amp);
+ AUTOFS_SLOCK(amp);
error = autofs_node_find(anp, component, componentlen, NULL);
- AUTOFS_UNLOCK(amp);
+ AUTOFS_SUNLOCK(amp);
if (error != 0)
return (false);
}
@@ -414,9 +415,14 @@ autofs_trigger_one(struct autofs_node *anp,
strlcpy(ar->ar_options,
amp->am_options, sizeof(ar->ar_options));
- callout_init(&ar->ar_callout, 1);
- callout_reset(&ar->ar_callout,
- autofs_timeout * hz, autofs_callout, ar);
+ TIMEOUT_TASK_INIT(taskqueue_thread, &ar->ar_task, 0,
+ autofs_task, ar);
+ error = taskqueue_enqueue_timeout(taskqueue_thread,
+ &ar->ar_task, autofs_timeout * hz);
+ if (error != 0) {
+ AUTOFS_WARN("taskqueue_enqueue_timeout() failed "
+ "with error %d", error);
+ }
refcount_init(&ar->ar_refcount, 1);
TAILQ_INSERT_TAIL(&autofs_softc->sc_requests, ar, ar_next);
}
@@ -448,12 +454,13 @@ autofs_trigger_one(struct autofs_node *anp,
if (last) {
TAILQ_REMOVE(&autofs_softc->sc_requests, ar, ar_next);
/*
- * XXX: Is it safe?
+ * Unlock the sc_lock, so that autofs_task() can complete.
*/
sx_xunlock(&autofs_softc->sc_lock);
- callout_drain(&ar->ar_callout);
- sx_xlock(&autofs_softc->sc_lock);
+ taskqueue_cancel_timeout(taskqueue_thread, &ar->ar_task, NULL);
+ taskqueue_drain_timeout(taskqueue_thread, &ar->ar_task);
uma_zfree(autofs_request_zone, ar);
+ sx_xlock(&autofs_softc->sc_lock);
}
/*
diff --git a/sys/fs/autofs/autofs.h b/sys/fs/autofs/autofs.h
index 2c72645..0713307 100644
--- a/sys/fs/autofs/autofs.h
+++ b/sys/fs/autofs/autofs.h
@@ -42,20 +42,26 @@ extern uma_zone_t autofs_node_zone;
extern int autofs_debug;
extern int autofs_mount_on_stat;
-#define AUTOFS_DEBUG(X, ...) \
- if (autofs_debug > 1) { \
- printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
+#define AUTOFS_DEBUG(X, ...) \
+ do { \
+ if (autofs_debug > 1) \
+ printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
} while (0)
-#define AUTOFS_WARN(X, ...) \
- if (autofs_debug > 0) { \
- printf("WARNING: %s: " X "\n", \
- __func__, ## __VA_ARGS__); \
+#define AUTOFS_WARN(X, ...) \
+ do { \
+ if (autofs_debug > 0) { \
+ printf("WARNING: %s: " X "\n", \
+ __func__, ## __VA_ARGS__); \
+ } \
} while (0)
-#define AUTOFS_LOCK(X) sx_xlock(&X->am_lock)
-#define AUTOFS_UNLOCK(X) sx_xunlock(&X->am_lock)
-#define AUTOFS_ASSERT_LOCKED(X) sx_assert(&X->am_lock, SA_XLOCKED)
+#define AUTOFS_SLOCK(X) sx_slock(&X->am_lock)
+#define AUTOFS_XLOCK(X) sx_xlock(&X->am_lock)
+#define AUTOFS_SUNLOCK(X) sx_sunlock(&X->am_lock)
+#define AUTOFS_XUNLOCK(X) sx_xunlock(&X->am_lock)
+#define AUTOFS_ASSERT_LOCKED(X) sx_assert(&X->am_lock, SA_LOCKED)
+#define AUTOFS_ASSERT_XLOCKED(X) sx_assert(&X->am_lock, SA_XLOCKED)
#define AUTOFS_ASSERT_UNLOCKED(X) sx_assert(&X->am_lock, SA_UNLOCKED)
struct autofs_node {
@@ -97,7 +103,7 @@ struct autofs_request {
char ar_prefix[MAXPATHLEN];
char ar_key[MAXPATHLEN];
char ar_options[MAXPATHLEN];
- struct callout ar_callout;
+ struct timeout_task ar_task;
volatile u_int ar_refcount;
};
diff --git a/sys/fs/autofs/autofs_vfsops.c b/sys/fs/autofs/autofs_vfsops.c
index b289cad..21a49d9 100644
--- a/sys/fs/autofs/autofs_vfsops.c
+++ b/sys/fs/autofs/autofs_vfsops.c
@@ -40,6 +40,7 @@
#include <sys/module.h>
#include <sys/mount.h>
#include <sys/sx.h>
+#include <sys/taskqueue.h>
#include <sys/vnode.h>
#include <fs/autofs/autofs.h>
@@ -87,14 +88,14 @@ autofs_mount(struct mount *mp)
vfs_getnewfsid(mp);
- AUTOFS_LOCK(amp);
+ AUTOFS_XLOCK(amp);
error = autofs_node_new(NULL, amp, ".", -1, &amp->am_root);
if (error != 0) {
- AUTOFS_UNLOCK(amp);
+ AUTOFS_XUNLOCK(amp);
free(amp, M_AUTOFS);
return (error);
}
- AUTOFS_UNLOCK(amp);
+ AUTOFS_XUNLOCK(amp);
vfs_mountedfrom(mp, from);
@@ -145,7 +146,7 @@ autofs_unmount(struct mount *mp, int mntflags)
pause("autofs_umount", 1);
}
- AUTOFS_LOCK(amp);
+ AUTOFS_XLOCK(amp);
/*
* Not terribly efficient, but at least not recursive.
@@ -159,7 +160,7 @@ autofs_unmount(struct mount *mp, int mntflags)
autofs_node_delete(amp->am_root);
mp->mnt_data = NULL;
- AUTOFS_UNLOCK(amp);
+ AUTOFS_XUNLOCK(amp);
sx_destroy(&amp->am_lock);
diff --git a/sys/fs/autofs/autofs_vnops.c b/sys/fs/autofs/autofs_vnops.c
index 392c253..53490b3 100644
--- a/sys/fs/autofs/autofs_vnops.c
+++ b/sys/fs/autofs/autofs_vnops.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/namei.h>
#include <sys/signalvar.h>
#include <sys/systm.h>
+#include <sys/taskqueue.h>
#include <sys/vnode.h>
#include <machine/atomic.h>
#include <vm/uma.h>
@@ -276,22 +277,22 @@ autofs_lookup(struct vop_lookup_args *ap)
}
}
- AUTOFS_LOCK(amp);
+ AUTOFS_SLOCK(amp);
error = autofs_node_find(anp, cnp->cn_nameptr, cnp->cn_namelen, &child);
if (error != 0) {
if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE) {
- AUTOFS_UNLOCK(amp);
+ AUTOFS_SUNLOCK(amp);
return (EJUSTRETURN);
}
- AUTOFS_UNLOCK(amp);
+ AUTOFS_SUNLOCK(amp);
return (ENOENT);
}
/*
* XXX: Dropping the node here is ok, because we never remove nodes.
*/
- AUTOFS_UNLOCK(amp);
+ AUTOFS_SUNLOCK(amp);
error = autofs_node_vn(child, mp, vpp);
if (error != 0) {
@@ -324,14 +325,14 @@ autofs_mkdir(struct vop_mkdir_args *ap)
if (autofs_ignore_thread(curthread) == false)
return (EPERM);
- AUTOFS_LOCK(amp);
+ AUTOFS_XLOCK(amp);
error = autofs_node_new(anp, amp, ap->a_cnp->cn_nameptr,
ap->a_cnp->cn_namelen, &child);
if (error != 0) {
- AUTOFS_UNLOCK(amp);
+ AUTOFS_XUNLOCK(amp);
return (error);
}
- AUTOFS_UNLOCK(amp);
+ AUTOFS_XUNLOCK(amp);
error = autofs_node_vn(child, vp->v_mount, ap->a_vpp);
@@ -426,7 +427,7 @@ autofs_readdir(struct vop_readdir_args *ap)
}
i = 2; /* Account for "." and "..". */
- AUTOFS_LOCK(amp);
+ AUTOFS_SLOCK(amp);
TAILQ_FOREACH(child, &anp->an_children, an_next) {
if (resid < AUTOFS_DELEN) {
if (ap->a_eofflag != NULL)
@@ -444,14 +445,14 @@ autofs_readdir(struct vop_readdir_args *ap)
error = autofs_readdir_one(uio, child->an_name,
child->an_fileno);
if (error != 0) {
- AUTOFS_UNLOCK(amp);
+ AUTOFS_SUNLOCK(amp);
return (error);
}
offset += AUTOFS_DELEN;
resid -= AUTOFS_DELEN;
}
- AUTOFS_UNLOCK(amp);
+ AUTOFS_SUNLOCK(amp);
return (0);
}
@@ -504,7 +505,7 @@ autofs_node_new(struct autofs_node *parent, struct autofs_mount *amp,
struct autofs_node *anp;
if (parent != NULL)
- AUTOFS_ASSERT_LOCKED(parent->an_mount);
+ AUTOFS_ASSERT_XLOCKED(parent->an_mount);
anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO);
if (namelen >= 0)
@@ -566,7 +567,7 @@ autofs_node_delete(struct autofs_node *anp)
{
struct autofs_node *parent;
- AUTOFS_ASSERT_LOCKED(anp->an_mount);
+ AUTOFS_ASSERT_XLOCKED(anp->an_mount);
KASSERT(TAILQ_EMPTY(&anp->an_children), ("have children"));
callout_drain(&anp->an_callout);
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index b94091c..d9f8436 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -820,7 +820,6 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
struct dqblk dqb;
uid_t savuid;
#endif
-
if (compare) {
retnotsup = 0;
error = nfsrv_getattrbits(nd, &attrbits, NULL, &retnotsup);
@@ -902,6 +901,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
goto nfsmout;
if (compare && !(*retcmpp)) {
NFSSETSUPP_ATTRBIT(&checkattrbits);
+
+ /* Some filesystem do not support NFSv4ACL */
+ if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) {
+ NFSCLRBIT_ATTRBIT(&checkattrbits, NFSATTRBIT_ACL);
+ NFSCLRBIT_ATTRBIT(&checkattrbits, NFSATTRBIT_ACLSUPPORT);
+ }
if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits)
|| retnotsup)
*retcmpp = NFSERR_NOTSAME;
@@ -1052,7 +1057,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
case NFSATTRBIT_ACL:
if (compare) {
if (!(*retcmpp)) {
- if (nfsrv_useacl) {
+ if (nfsrv_useacl && nfs_supportsnfsv4acls(vp)) {
NFSACL_T *naclp;
naclp = acl_alloc(M_WAITOK);
@@ -1073,21 +1078,22 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
}
}
} else {
- if (vp != NULL && aclp != NULL)
- error = nfsrv_dissectacl(nd, aclp, &aceerr,
- &cnt, p);
- else
- error = nfsrv_dissectacl(nd, NULL, &aceerr,
- &cnt, p);
- if (error)
- goto nfsmout;
+ if (vp != NULL && aclp != NULL)
+ error = nfsrv_dissectacl(nd, aclp, &aceerr,
+ &cnt, p);
+ else
+ error = nfsrv_dissectacl(nd, NULL, &aceerr,
+ &cnt, p);
+ if (error)
+ goto nfsmout;
}
+
attrsum += cnt;
break;
case NFSATTRBIT_ACLSUPPORT:
NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
if (compare && !(*retcmpp)) {
- if (nfsrv_useacl) {
+ if (nfsrv_useacl && nfs_supportsnfsv4acls(vp)) {
if (fxdr_unsigned(u_int32_t, *tl) !=
NFSV4ACE_SUPTYPES)
*retcmpp = NFSERR_NOTSAME;
@@ -2090,6 +2096,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp,
}
}
}
+
/*
* Put out the attribute bitmap for the ones being filled in
* and get the field for the number of attributes returned.
diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h
index 2abd7e4..ef15a1d 100644
--- a/sys/fs/nfs/nfs_var.h
+++ b/sys/fs/nfs/nfs_var.h
@@ -644,9 +644,9 @@ int nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct ucred *,
int nfsvno_fillattr(struct nfsrv_descript *, struct mount *, vnode_t,
struct nfsvattr *, fhandle_t *, int, nfsattrbit_t *,
struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t);
-int nfsrv_sattr(struct nfsrv_descript *, struct nfsvattr *, nfsattrbit_t *,
+int nfsrv_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *,
NFSACL_T *, NFSPROC_T *);
-int nfsv4_sattr(struct nfsrv_descript *, struct nfsvattr *, nfsattrbit_t *,
+int nfsv4_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *,
NFSACL_T *, NFSPROC_T *);
int nfsvno_checkexp(mount_t, NFSSOCKADDR_T, struct nfsexstuff *,
struct ucred **);
diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h
index 731be07..768dfcb 100644
--- a/sys/fs/nfs/nfsproto.h
+++ b/sys/fs/nfs/nfsproto.h
@@ -996,7 +996,11 @@ struct nfsv3_sattr {
NFSATTRBM_TIMEDELTA | \
NFSATTRBM_TIMEMETADATA | \
NFSATTRBM_TIMEMODIFY | \
- NFSATTRBM_MOUNTEDONFILEID)
+ NFSATTRBM_MOUNTEDONFILEID | \
+ NFSATTRBM_QUOTAHARD | \
+ NFSATTRBM_QUOTASOFT | \
+ NFSATTRBM_QUOTAUSED)
+
#ifdef QUOTA
/*
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 1973c14..5bd4538 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -1008,7 +1008,7 @@ nfsvno_getsymlink(struct nfsrv_descript *nd, struct nfsvattr *nvap,
*pathcpp = NULL;
*lenp = 0;
if ((nd->nd_flag & ND_NFSV3) &&
- (error = nfsrv_sattr(nd, nvap, NULL, NULL, p)))
+ (error = nfsrv_sattr(nd, NULL, nvap, NULL, NULL, p)))
goto nfsmout;
NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
len = fxdr_unsigned(int, *tl);
@@ -2298,7 +2298,7 @@ nfsmout:
* (Return 0 or EBADRPC)
*/
int
-nfsrv_sattr(struct nfsrv_descript *nd, struct nfsvattr *nvap,
+nfsrv_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap,
nfsattrbit_t *attrbitp, NFSACL_T *aclp, struct thread *p)
{
u_int32_t *tl;
@@ -2380,7 +2380,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, struct nfsvattr *nvap,
};
break;
case ND_NFSV4:
- error = nfsv4_sattr(nd, nvap, attrbitp, aclp, p);
+ error = nfsv4_sattr(nd, vp, nvap, attrbitp, aclp, p);
};
nfsmout:
NFSEXITCODE2(error, nd);
@@ -2392,7 +2392,7 @@ nfsmout:
* Returns NFSERR_BADXDR if it can't be parsed, 0 otherwise.
*/
int
-nfsv4_sattr(struct nfsrv_descript *nd, struct nfsvattr *nvap,
+nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap,
nfsattrbit_t *attrbitp, NFSACL_T *aclp, struct thread *p)
{
u_int32_t *tl;
@@ -2429,6 +2429,11 @@ nfsv4_sattr(struct nfsrv_descript *nd, struct nfsvattr *nvap,
switch (bitpos) {
case NFSATTRBIT_SIZE:
NFSM_DISSECT(tl, u_int32_t *, NFSX_HYPER);
+ if (vp != NULL && vp->v_type != VREG) {
+ error = (vp->v_type == VDIR) ? NFSERR_ISDIR :
+ NFSERR_INVAL;
+ goto nfsmout;
+ }
nvap->na_size = fxdr_hyper(tl);
attrsum += NFSX_HYPER;
break;
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
index 0d3ff76..9bf43c3 100644
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -210,6 +210,17 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram,
if (nd->nd_repstat == 0) {
accmode = 0;
NFSSET_ATTRBIT(&tmpbits, &attrbits);
+
+ /*
+ * GETATTR with write-only attr time_access_set and time_modify_set
+ * should return NFS4ERR_INVAL.
+ */
+ if (NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_TIMEACCESSSET) ||
+ NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_TIMEMODIFYSET)){
+ error = NFSERR_INVAL;
+ vput(vp);
+ goto out;
+ }
if (NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_ACL)) {
NFSCLRBIT_ATTRBIT(&tmpbits, NFSATTRBIT_ACL);
accmode |= VREAD_ACL;
@@ -315,7 +326,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram,
stateid.seqid = fxdr_unsigned(u_int32_t, *tl++);
NFSBCOPY((caddr_t)tl,(caddr_t)stateid.other,NFSX_STATEIDOTHER);
}
- error = nfsrv_sattr(nd, &nva, &attrbits, aclp, p);
+ error = nfsrv_sattr(nd, vp, &nva, &attrbits, aclp, p);
if (error)
goto nfsmout;
preat_ret = nfsvno_getattr(vp, &nva2, nd->nd_cred, p, 1);
@@ -1019,7 +1030,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram,
switch (how) {
case NFSCREATE_GUARDED:
case NFSCREATE_UNCHECKED:
- error = nfsrv_sattr(nd, &nva, NULL, NULL, p);
+ error = nfsrv_sattr(nd, NULL, &nva, NULL, NULL, p);
if (error)
goto nfsmout;
break;
@@ -1204,7 +1215,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram,
NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
vtyp = nfsv34tov_type(*tl);
}
- error = nfsrv_sattr(nd, &nva, &attrbits, aclp, p);
+ error = nfsrv_sattr(nd, NULL, &nva, &attrbits, aclp, p);
if (error)
goto nfsmout;
nva.na_type = vtyp;
@@ -1850,7 +1861,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, __unused int isdgram,
if (!nd->nd_repstat) {
NFSVNO_ATTRINIT(&nva);
if (nd->nd_flag & ND_NFSV3) {
- error = nfsrv_sattr(nd, &nva, NULL, NULL, p);
+ error = nfsrv_sattr(nd, NULL, &nva, NULL, NULL, p);
if (error)
goto nfsmout;
} else {
@@ -1967,11 +1978,21 @@ nfsrvd_commit(struct nfsrv_descript *nd, __unused int isdgram,
int error = 0, for_ret = 1, aft_ret = 1, cnt;
u_int64_t off;
- if (nd->nd_repstat) {
+ if (nd->nd_repstat) {
nfsrv_wcc(nd, for_ret, &bfor, aft_ret, &aft);
goto out;
}
+
+ /* Return NFSERR_ISDIR in NFSv4 when commit on a directory. */
+ if (vp->v_type != VREG) {
+ if (nd->nd_flag & ND_NFSV3)
+ error = NFSERR_NOTSUPP;
+ else
+ error = (vp->v_type == VDIR) ? NFSERR_ISDIR : NFSERR_INVAL;
+ goto nfsmout;
+ }
NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+
/*
* XXX At this time VOP_FSYNC() does not accept offset and byte
* count parameters, so these arguments are useless (someday maybe).
@@ -2683,7 +2704,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
switch (how) {
case NFSCREATE_UNCHECKED:
case NFSCREATE_GUARDED:
- error = nfsv4_sattr(nd, &nva, &attrbits, aclp, p);
+ error = nfsv4_sattr(nd, NULL, &nva, &attrbits, aclp, p);
if (error)
goto nfsmout;
/*
@@ -2707,7 +2728,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF);
cverf[0] = *tl++;
cverf[1] = *tl;
- error = nfsv4_sattr(nd, &nva, &attrbits, aclp, p);
+ error = nfsv4_sattr(nd, vp, &nva, &attrbits, aclp, p);
if (error != 0)
goto nfsmout;
if (NFSISSET_ATTRBIT(&attrbits,
@@ -2858,7 +2879,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
* The IETF working group decided that this is the correct
* error return for all non-regular files.
*/
- nd->nd_repstat = NFSERR_SYMLINK;
+ nd->nd_repstat = (vp->v_type == VDIR) ? NFSERR_ISDIR : NFSERR_SYMLINK;
}
if (!nd->nd_repstat && (stp->ls_flags & NFSLCK_WRITEACCESS))
nd->nd_repstat = nfsvno_accchk(vp, VWRITE, nd->nd_cred,
@@ -3197,6 +3218,11 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unused int isdgram,
nfsv4stateid_t stateid;
nfsquad_t clientid;
+ /* opendowngrade can only work on a file object.*/
+ if (vp->v_type != VREG) {
+ error = NFSERR_INVAL;
+ goto nfsmout;
+ }
NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED);
stp->ls_ownerlen = 0;
stp->ls_op = nd->nd_rp;
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index 2faf064..97f8fff 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -1628,9 +1628,17 @@ tryagain:
*/
if (error == 0 && (stp->ls_flags & NFSLCK_OPEN) &&
((stp->ls_openowner->ls_flags & NFSLCK_NEEDSCONFIRM) ||
- (getlckret == 0 && stp->ls_lfp != lfp)))
- error = NFSERR_BADSTATEID;
- if (error == 0 &&
+ (getlckret == 0 && stp->ls_lfp != lfp))){
+ /*
+ * NFSLCK_SETATTR should return OK rather than NFSERR_BADSTATEID
+ * The only exception is using SETATTR with SIZE.
+ * */
+ if ((new_stp->ls_flags &
+ (NFSLCK_SETATTR | NFSLCK_CHECK)) != NFSLCK_SETATTR)
+ error = NFSERR_BADSTATEID;
+ }
+
+ if (error == 0 &&
(stp->ls_flags & (NFSLCK_DELEGREAD | NFSLCK_DELEGWRITE)) &&
getlckret == 0 && stp->ls_lfp != lfp)
error = NFSERR_BADSTATEID;
@@ -4909,12 +4917,17 @@ tryagain:
* Now, look for a conflicting open share.
*/
if (remove) {
- LIST_FOREACH(stp, &lfp->lf_open, ls_file) {
- if (stp->ls_flags & NFSLCK_WRITEDENY) {
- error = NFSERR_FILEOPEN;
- break;
+ /*
+ * If the entry in the directory was the last reference to the
+ * corresponding filesystem object, the object can be destroyed
+ * */
+ if(lfp->lf_usecount>1)
+ LIST_FOREACH(stp, &lfp->lf_open, ls_file) {
+ if (stp->ls_flags & NFSLCK_WRITEDENY) {
+ error = NFSERR_FILEOPEN;
+ break;
+ }
}
- }
}
NFSUNLOCKSTATE();
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index a2034d3..c7104d8 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -281,7 +281,7 @@ g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
cp = dev->si_drv2;
if (cp == NULL)
- return(ENXIO); /* g_dev_taste() not done yet */
+ return (ENXIO); /* g_dev_taste() not done yet */
g_trace(G_T_ACCESS, "g_dev_open(%s, %d, %d, %p)",
cp->geom->name, flags, fmt, td);
@@ -312,7 +312,7 @@ g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
sc->sc_open += r + w + e;
mtx_unlock(&sc->sc_mtx);
}
- return(error);
+ return (error);
}
static int
@@ -324,10 +324,10 @@ g_dev_close(struct cdev *dev, int flags, int fmt, struct thread *td)
cp = dev->si_drv2;
if (cp == NULL)
- return(ENXIO);
+ return (ENXIO);
g_trace(G_T_ACCESS, "g_dev_close(%s, %d, %d, %p)",
cp->geom->name, flags, fmt, td);
-
+
r = flags & FREAD ? -1 : 0;
w = flags & FWRITE ? -1 : 0;
#ifdef notyet
@@ -361,7 +361,6 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
struct g_kerneldump kd;
off_t offset, length, chunk;
int i, error;
- u_int u;
cp = dev->si_drv2;
pp = cp->provider;
@@ -396,19 +395,17 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
error = g_io_getattr("GEOM::frontstuff", cp, &i, data);
break;
case DIOCSKERNELDUMP:
- u = *((u_int *)data);
- if (!u) {
- set_dumper(NULL, NULL);
- error = 0;
+ if (*(u_int *)data == 0) {
+ error = set_dumper(NULL, NULL);
break;
}
kd.offset = 0;
kd.length = OFF_MAX;
i = sizeof kd;
error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd);
- if (!error) {
+ if (error == 0) {
error = set_dumper(&kd.di, devtoname(dev));
- if (!error)
+ if (error == 0)
dev->si_flags |= SI_DUMPDEV;
}
break;
@@ -425,7 +422,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
error = EINVAL;
break;
}
- while (length > 0) {
+ while (length > 0) {
chunk = length;
if (g_dev_del_max_sectors != 0 && chunk >
g_dev_del_max_sectors * cp->provider->sectorsize) {
@@ -618,7 +615,7 @@ g_dev_orphan(struct g_consumer *cp)
/* Reset any dump-area set on this device */
if (dev->si_flags & SI_DUMPDEV)
- set_dumper(NULL, NULL);
+ (void)set_dumper(NULL, NULL);
/* Destroy the struct cdev *so we get no more requests */
destroy_dev_sched_cb(dev, g_dev_callback, cp);
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index a3990ed..8892c56 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -248,6 +248,9 @@ struct mem_range_softc mem_range_softc;
struct init_ops init_ops = {
.early_clock_source_init = i8254_init,
.early_delay = i8254_delay,
+#ifdef DEV_APIC
+ .msi_init = msi_init,
+#endif
};
static void
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 8ef0821..fd1e214 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -379,29 +379,10 @@ do_execve(td, args, mac_p)
/*
* Initialize part of the common data
*/
+ bzero(imgp, sizeof(*imgp));
imgp->proc = p;
- imgp->execlabel = NULL;
imgp->attr = &attr;
- imgp->entry_addr = 0;
- imgp->reloc_base = 0;
- imgp->vmspace_destroyed = 0;
- imgp->interpreted = 0;
- imgp->opened = 0;
- imgp->interpreter_name = NULL;
- imgp->auxargs = NULL;
- imgp->vp = NULL;
- imgp->object = NULL;
- imgp->firstpage = NULL;
- imgp->ps_strings = 0;
- imgp->auxarg_size = 0;
imgp->args = args;
- imgp->execpath = imgp->freepath = NULL;
- imgp->execpathp = 0;
- imgp->canary = 0;
- imgp->canarylen = 0;
- imgp->pagesizes = 0;
- imgp->pagesizeslen = 0;
- imgp->stack_prot = 0;
#ifdef MAC
error = mac_execve_enter(imgp, mac_p);
@@ -409,8 +390,6 @@ do_execve(td, args, mac_p)
goto exec_fail;
#endif
- imgp->image_header = NULL;
-
/*
* Translate the file name. namei() returns a vnode pointer
* in ni_vp amoung other things.
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c
index 00cc932..7ab6509 100644
--- a/sys/kern/kern_mbuf.c
+++ b/sys/kern/kern_mbuf.c
@@ -447,9 +447,9 @@ mb_dtor_mbuf(void *mem, int size, void *arg)
m = (struct mbuf *)mem;
flags = (unsigned long)arg;
+ KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__));
if ((m->m_flags & M_PKTHDR) && !SLIST_EMPTY(&m->m_pkthdr.tags))
m_tag_delete_chain(m, NULL);
- KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__));
#ifdef INVARIANTS
trash_dtor(mem, size, arg);
#endif
diff --git a/sys/kern/kern_poll.c b/sys/kern/kern_poll.c
index f8bc800..04b4e79 100644
--- a/sys/kern/kern_poll.c
+++ b/sys/kern/kern_poll.c
@@ -451,19 +451,6 @@ netisr_poll(void)
mtx_unlock(&poll_mtx);
}
-/* The following should be temporary, till all drivers use the driver API */
-int
-ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh)
-{
- return (ether_poll_register((poll_handler_t *)h, (struct ifnet *)ifh));
-}
-
-int
-ether_poll_deregister_drv(if_t ifh)
-{
- return (ether_poll_deregister((struct ifnet *)ifh));
-}
-
/*
* Try to register routine for polling. Returns 0 if successful
* (and polling should be enabled), error code otherwise.
@@ -472,7 +459,7 @@ ether_poll_deregister_drv(if_t ifh)
* This is called from within the *_ioctl() functions.
*/
int
-ether_poll_register(poll_handler_t *h, struct ifnet *ifp)
+ether_poll_register(poll_handler_t *h, if_t ifp)
{
int i;
@@ -519,7 +506,7 @@ ether_poll_register(poll_handler_t *h, struct ifnet *ifp)
* Remove interface from the polling list. Called from *_ioctl(), too.
*/
int
-ether_poll_deregister(struct ifnet *ifp)
+ether_poll_deregister(if_t ifp)
{
int i;
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index b30e12a..d97b583 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1240,7 +1240,7 @@ protect_setchild(struct thread *td, struct proc *p, int flags)
{
PROC_LOCK_ASSERT(p, MA_OWNED);
- if (p->p_flag & P_SYSTEM || p_cansee(td, p) != 0)
+ if (p->p_flag & P_SYSTEM || p_cansched(td, p) != 0)
return (0);
if (flags & PPROT_SET) {
p->p_flag |= P_PROTECTED;
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index e918d1c..e2a0fa3 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1055,13 +1055,13 @@ tty_rel_free(struct tty *tp)
tp->t_dev = NULL;
tty_unlock(tp);
- sx_xlock(&tty_list_sx);
- TAILQ_REMOVE(&tty_list, tp, t_list);
- tty_list_count--;
- sx_xunlock(&tty_list_sx);
-
- if (dev != NULL)
+ if (dev != NULL) {
+ sx_xlock(&tty_list_sx);
+ TAILQ_REMOVE(&tty_list, tp, t_list);
+ tty_list_count--;
+ sx_xunlock(&tty_list_sx);
destroy_dev_sched_cb(dev, tty_dealloc, tp);
+ }
}
void
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 9289e6a..8d2e07e 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1863,8 +1863,15 @@ sched_sync(void)
continue;
}
- if (first_printf == 0)
+ if (first_printf == 0) {
+ /*
+ * Drop the sync mutex, because some watchdog
+ * drivers need to sleep while patting
+ */
+ mtx_unlock(&sync_mtx);
wdog_kern_pat(WD_LASTVAL);
+ mtx_lock(&sync_mtx);
+ }
}
if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0)
diff --git a/sys/mips/atheros/ar724x_pci.c b/sys/mips/atheros/ar724x_pci.c
index 0ce9177..854cd65 100644
--- a/sys/mips/atheros/ar724x_pci.c
+++ b/sys/mips/atheros/ar724x_pci.c
@@ -122,8 +122,12 @@ ar724x_pci_read_config(device_t dev, u_int bus, u_int slot, u_int func,
/* Register access is 32-bit aligned */
shift = (reg & 3) * 8;
- if (shift)
- mask = (1 << shift) - 1;
+
+ /* Create a mask based on the width, post-shift */
+ if (bytes == 2)
+ mask = 0xffff;
+ else if (bytes == 1)
+ mask = 0xff;
else
mask = 0xffffffff;
@@ -155,10 +159,18 @@ ar724x_pci_write_config(device_t dev, u_int bus, u_int slot, u_int func,
return;
/*
- * WAR for BAR issue on AR7240 - We are unable to access the PCI device
- * space if we set the BAR with proper base address.
+ * WAR for BAR issue on AR7240 - We are unable to access the PCI
+ * device space if we set the BAR with proper base address.
+ *
+ * However, we _do_ want to allow programming in the probe value
+ * (0xffffffff) so the PCI code can find out how big the memory
+ * map is for this device. Without it, it'll think the memory
+ * map is 32 bits wide, the PCI code will then end up thinking
+ * the register window is '0' and fail to allocate resources.
*/
- if (reg == PCIR_BAR(0) && bytes == 4 && ar71xx_soc == AR71XX_SOC_AR7240)
+ if (reg == PCIR_BAR(0) && bytes == 4
+ && ar71xx_soc == AR71XX_SOC_AR7240
+ && data != 0xffffffff)
ar724x_pci_write(AR724X_PCI_CFG_BASE, reg, 0xffff, bytes);
else
ar724x_pci_write(AR724X_PCI_CFG_BASE, reg, data, bytes);
@@ -337,7 +349,6 @@ ar724x_pci_slot_fixup(device_t dev)
return;
}
-
device_printf(dev, "found EEPROM at 0x%lx on %d.%d.%d\n",
flash_addr, 0, 0, 0);
ar724x_pci_fixup(dev, flash_addr, size);
@@ -486,7 +497,6 @@ ar724x_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
}
}
-
return (rv);
}
diff --git a/sys/mips/conf/TP-MR3020 b/sys/mips/conf/TP-MR3020
new file mode 100644
index 0000000..f0ecb4b
--- /dev/null
+++ b/sys/mips/conf/TP-MR3020
@@ -0,0 +1,65 @@
+#
+# TP Link MR3020 - an AR9331 based SoC wifi device.
+#
+# This is for the 32 RAM/4 flash part. There is little to no
+# chance that this will ever boot FreeBSD directly from the 3.5MB
+# of flash. The kernel can fit into the space, but userland is just
+# too big even when stripped down to its limits.
+#
+# * AR9331 SoC
+# * 32MB RAM
+# * 4MB flash
+# * Integrated 1x1 2GHz wifi and 10/100 bridge
+# * USB powered
+# * USB storage
+#
+# $FreeBSD$
+#
+
+# Include the default AR933x parameters
+include "AR933X_BASE"
+
+ident TP-MR3020
+
+# Override hints with board values
+hints "TP-MR3020.hints"
+
+# Board memory - 32MB
+options AR71XX_REALMEM=(32*1024*1024)
+
+# i2c GPIO bus
+device gpioiic
+device iicbb
+device iicbus
+device iic
+
+# Options required for miiproxy and mdiobus
+options ARGE_MDIO # Export an MDIO bus separate from arge
+device miiproxy # MDIO bus <-> MII PHY rendezvous
+
+device etherswitch
+device arswitch
+
+# Enable the uboot environment stuff rather then the
+# redboot stuff.
+options AR71XX_ENV_UBOOT
+
+# uzip - to boot natively from flash
+device geom_uncompress
+
+# Used for the static uboot partition map
+device geom_map
+
+# Boot off of the rootfs, as defined in the geom_map setup.
+# Probably, this should be a USB device as the memory available
+# compressed rootfs is simply too small for FreeBSD
+#options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\"
+
+# Boot off of a uboot tftp ramdisk kernel image. Because the flash
+# on this unit is so small, this is the only way to do dev work.
+# For full deployment, you will *have* to use a usb storage device
+# as a rootfs and use the flash to hold the kernel only.
+options MD_ROOT # md device usable as a potential root device
+options MD_ROOT_SIZE=10240
+#makeoptions MFS_IMAGE=/tftpboot/mfsroot-tl-mr3020.img.ulzma
+options ROOTDEVNAME=\"ufs:md0.uncompress\"
diff --git a/sys/mips/conf/TP-MR3020.hints b/sys/mips/conf/TP-MR3020.hints
new file mode 100644
index 0000000..dfabb42
--- /dev/null
+++ b/sys/mips/conf/TP-MR3020.hints
@@ -0,0 +1,101 @@
+#
+# This file adds to the values in AR933X_BASE.hints
+#
+# $FreeBSD$
+
+# mdiobus on arge1
+hint.argemdio.0.at="nexus0"
+hint.argemdio.0.maddr=0x1a000000
+hint.argemdio.0.msize=0x1000
+hint.argemdio.0.order=0
+
+# There's no need to set the ar933x GMAC configuration bits.
+# This just creates a switch instance and correctly uses it.
+
+# Embedded Atheros Switch
+hint.arswitch.0.at="mdio0"
+
+# XXX this should really say it's an AR933x switch, as there
+# are some vlan specific differences here!
+hint.arswitch.0.is_7240=1
+hint.arswitch.0.numphys=4
+hint.arswitch.0.phy4cpu=1 # phy 4 is a "CPU" separate PHY
+hint.arswitch.0.is_rgmii=0
+hint.arswitch.0.is_gmii=1 # arge1 <-> switch PHY is GMII
+
+# arge0 - MII, autoneg, phy(4)
+hint.arge.0.phymask=0x10 # PHY4
+hint.arge.0.mdio=mdioproxy1 # .. off of the switch mdiobus
+
+# arge1 - GMII, 1000/full
+hint.arge.1.phymask=0x0 # No directly mapped PHYs
+hint.arge.1.media=1000
+hint.arge.1.fduplex=1
+
+# Where the ART is - last 64k in the flash
+# 0x9fff1000 ?
+hint.ath.0.eepromaddr=0x1fff0000
+hint.ath.0.eepromsize=16384
+
+# The board 16MiB flash layout in uboot env:
+#
+# 256k(u-boot),64k(u-boot-env),2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART)
+
+# However, it boots from 0x9f050000, which is the front of the flsah!
+# Thus the kernel/rootfs are switched around.
+
+# 256KB
+hint.map.0.at="flash/spi0"
+hint.map.0.start=0x00000000
+hint.map.0.end=0x00040000
+hint.map.0.name="uboot"
+hint.map.0.readonly=1
+
+# 64KB
+hint.map.1.at="flash/spi0"
+hint.map.1.start=0x00040000
+hint.map.1.end=0x00050000
+hint.map.1.name="uboot-env"
+hint.map.1.readonly=0
+
+# 2752KB
+hint.map.2.at="flash/spi0"
+hint.map.2.start=0x00050000
+hint.map.2.end="search:0x00100000:0x10000:.!/bin/sh"
+hint.map.2.name="kernel"
+hint.map.2.readonly=0
+
+# 896KB
+hint.map.3.at="flash/spi0"
+hint.map.3.start="search:0x00100000:0x10000:.!/bin/sh"
+hint.map.3.end=0x003e0000
+hint.map.3.name="rootfs"
+hint.map.3.readonly=0
+
+# 64K NVRAM
+hint.map.4.at="flash/spi0"
+hint.map.4.start=0x003e0000
+hint.map.4.end=0x003f0000
+hint.map.4.name="cfg"
+hint.map.4.readonly=0
+
+# 64K ART
+hint.map.5.at="flash/spi0"
+hint.map.5.start=0x003f0000
+hint.map.5.end=0x00400000
+hint.map.5.name="art"
+hint.map.5.readonly=1
+
+# GPIO specific configuration block
+
+# Don't flip on anything that isn't already enabled.
+# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
+# not used here.
+hint.gpio.0.function_set=0x00000000
+hint.gpio.0.function_clear=0x00000000
+
+# These are the GPIO LEDs and buttons which can be software controlled.
+#hint.gpio.0.pinmask=0x001c02ae
+#hint.gpio.0.pinmask=0x00001803
+
+# XXX TODO: the button and LEDs!
diff --git a/sys/modules/acpi/acpi/Makefile b/sys/modules/acpi/acpi/Makefile
deleted file mode 100644
index 5722692..0000000
--- a/sys/modules/acpi/acpi/Makefile
+++ /dev/null
@@ -1,129 +0,0 @@
-# $FreeBSD$
-
-.if !defined(FORCE_BUILD)
-.error "The ACPI module is deprecated, set FORCE_BUILD to force it"
-.endif
-
-.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
-.error "The ACPI module is only for amd64 and i386"
-.endif
-
-.PATH: ${.CURDIR}/../../../contrib/dev/acpica/components/debugger \
- ${.CURDIR}/../../../contrib/dev/acpica/components/disassembler \
- ${.CURDIR}/../../../contrib/dev/acpica/components/dispatcher \
- ${.CURDIR}/../../../contrib/dev/acpica/components/events \
- ${.CURDIR}/../../../contrib/dev/acpica/components/executer \
- ${.CURDIR}/../../../contrib/dev/acpica/components/hardware \
- ${.CURDIR}/../../../contrib/dev/acpica/components/namespace \
- ${.CURDIR}/../../../contrib/dev/acpica/components/parser \
- ${.CURDIR}/../../../contrib/dev/acpica/components/resources \
- ${.CURDIR}/../../../contrib/dev/acpica/components/tables \
- ${.CURDIR}/../../../contrib/dev/acpica/components/utilities \
- ${.CURDIR}/../../../pci \
- ${.CURDIR}/../../../dev/acpica \
- ${.CURDIR}/../../../dev/acpica/Osd \
- ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica \
- ${.CURDIR}/../../../x86/acpica
-
-KMOD= acpi
-
-# ACPI CA sources
-SRCS= dbcmds.c dbconvert.c dbdisply.c dbexec.c dbfileio.c dbhistry.c
-SRCS+= dbinput.c dbmethod.c dbnames.c dbstats.c dbutils.c dbxface.c
-SRCS+= dmbuffer.c dmdeferred.c dmnames.c dmopcode.c dmobject.c dmresrc.c
-SRCS+= dmresrcl.c dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c
-SRCS+= dsargs.c dscontrol.c dsfield.c dsinit.c dsmethod.c dsmthdat.c
-SRCS+= dsobject.c dsopcode.c dsutils.c dswexec.c dswload.c dswload2.c
-SRCS+= dswscope.c dswstate.c
-SRCS+= evevent.c evglock.c evgpe.c evgpeblk.c evgpeinit.c evgpeutil.c
-SRCS+= evhandler.c evmisc.c evregion.c evrgnini.c evsci.c evxface.c
-SRCS+= evxfevnt.c evxfgpe.c evxfregn.c
-SRCS+= exconfig.c exconvrt.c excreate.c exdebug.c exdump.c exfield.c
-SRCS+= exfldio.c exmisc.c exmutex.c exnames.c exoparg1.c exoparg2.c
-SRCS+= exoparg3.c exoparg6.c exprep.c exregion.c exresnte.c exresolv.c
-SRCS+= exresop.c exstore.c exstoren.c exstorob.c exsystem.c exutils.c
-SRCS+= hwacpi.c hwesleep.c hwgpe.c hwpci.c hwregs.c hwsleep.c hwtimer.c
-SRCS+= hwvalid.c hwxface.c hwxfsleep.c
-SRCS+= nsaccess.c nsalloc.c nsarguments.c nsconvert.c nsdump.c nseval.c
-SRCS+= nsinit.c nsload.c nsnames.c nsobject.c nsparse.c nspredef.c nsprepkg.c
-SRCS+= nsrepair.c nsrepair2.c nssearch.c nsutils.c nswalk.c nsxfeval.c
-SRCS+= nsxfname.c nsxfobj.c
-SRCS+= psargs.c psloop.c psobject.c psopcode.c psopinfo.c psparse.c
-SRCS+= psscope.c pstree.c psutils.c pswalk.c psxface.c
-SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsdumpinfo.c rsinfo.c rsio.c
-SRCS+= rsirq.c rslist.c rsmemory.c rsmisc.c rsserial.c rsutils.c rsxface.c
-SRCS+= tbfadt.c tbfind.c tbinstal.c tbprint.c tbutils.c tbxface.c tbxfload.c
-SRCS+= tbxfroot.c
-SRCS+= utaddress.c utalloc.c utbuffer.c utcache.c utcopy.c utdebug.c
-SRCS+= utdecode.c utdelete.c uterror.c uteval.c utexcep.c utglobal.c utids.c
-SRCS+= utinit.c utlock.c utmath.c utmisc.c utmutex.c utobject.c utosi.c
-SRCS+= utownerid.c utpredef.c utresrc.c utstate.c utstring.c utxface.c
-SRCS+= utxferror.c utxfinit.c
-#SRCS+= utxfmutex.c
-
-# OSPM layer and core hardware drivers
-SRCS+= acpi.c acpi_button.c acpi_isab.c acpi_package.c acpi_pci.c acpi_pcib.c
-SRCS+= acpi_pcib_acpi.c acpi_pcib_pci.c acpi_powerres.c acpi_quirk.c
-SRCS+= acpi_resource.c acpi_timer.c acpi_pci_link.c acpi_thermal.c
-
-# ACPI hardware drivers, mostly used for mobile systems.
-SRCS+= acpi_acad.c acpi_battery.c acpi_cmbat.c acpi_cpu.c acpi_ec.c
-SRCS+= acpi_hpet.c acpi_lid.c acpi_perf.c acpi_smbat.c acpi_throttle.c
-
-# OSD layer
-SRCS+= OsdDebug.c
-SRCS+= OsdHardware.c OsdInterrupt.c OsdMemory.c OsdSchedule.c OsdStream.c
-SRCS+= OsdSynch.c OsdTable.c OsdEnvironment.c
-SRCS+= opt_acpi.h opt_bus.h opt_ddb.h acpi_if.h acpi_quirks.h bus_if.h
-SRCS+= cpufreq_if.h device_if.h isa_if.h pci_if.h pcib_if.h
-
-# XXX ACPI should not depend on the following headers but this is currently
-# needed for the build of assym.s.
-# This obviously needs a better and more structural fix.
-SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h
-
-.if !defined(KERNBUILDDIR)
-.if KTR
-CFLAGS+=-DKTR
-.endif
-.if SMP
-CFLAGS+=-DSMP
-.endif
-.if ACPI_MAX_TASKS
-CFLAGS+=-DACPI_MAX_TASKS=${ACPI_MAX_TASKS}
-.endif
-.if ACPI_MAX_THREADS
-CFLAGS+=-DACPI_MAX_THREADS=${ACPI_MAX_THREADS}
-.endif
-.if ACPI_DEBUG
-CFLAGS+=-DACPI_DEBUG
-opt_ddb.h: Makefile
- echo "#define DDB 1" > ${.TARGET}
-.else
-opt_ddb.h: Makefile
- echo -n > ${.TARGET}
-.endif
-.endif
-
-# Machine-specific code such as sleep/wakeup
-SRCS+= acpi_apm.c acpi_machdep.c acpi_wakecode.h acpi_wakedata.h acpi_wakeup.c
-SRCS+= assym.s madt.c
-CLEANFILES+=acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o acpi_wakedata.h
-
-SRCS+= opt_global.h
-
-.include <bsd.kmod.mk>
-
-acpi_wakecode.o: acpi_wakecode.S assym.s
- ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} ${CLANG_NO_IAS} \
- ${WERROR} ${.IMPSRC}
-acpi_wakecode.bin: acpi_wakecode.o
- objcopy -S -O binary acpi_wakecode.o ${.TARGET}
-acpi_wakecode.h: acpi_wakecode.bin
- file2c -sx 'static char wakecode[] = {' '};' < acpi_wakecode.bin > \
- ${.TARGET}
-acpi_wakedata.h: acpi_wakecode.o
- ${NM} -n --defined-only acpi_wakecode.o | \
- while read offset dummy what; do \
- echo "#define $${what} 0x$${offset}"; \
- done > ${.TARGET}
diff --git a/sys/modules/ncr/Makefile b/sys/modules/ncr/Makefile
index 52fd88e..7ba6c68 100644
--- a/sys/modules/ncr/Makefile
+++ b/sys/modules/ncr/Makefile
@@ -7,5 +7,3 @@ SRCS= ncr.c
SRCS+= device_if.h bus_if.h pci_if.h opt_ncr.h opt_cam.h
.include <bsd.kmod.mk>
-
-CFLAGS+=-Wno-error=unused-const-variable
diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile
index 319b46f..ad9f398 100644
--- a/sys/modules/zfs/Makefile
+++ b/sys/modules/zfs/Makefile
@@ -94,8 +94,10 @@ CFLAGS+=-DBUILDING_ZFS
CFLAGS+=-mminimal-toc
.endif
-#CFLAGS+=-DDEBUG=1
-#DEBUG_FLAGS=-g
+.ifdef ZFS_DEBUG
+CFLAGS+=-DDEBUG=1
+DEBUG_FLAGS=-g
+.endif
.include <bsd.kmod.mk>
diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index 90ed6e0..548e81b 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -190,14 +190,15 @@ static const char *lacp_format_portid(const struct lacp_portid *, char *,
static void lacp_dprintf(const struct lacp_port *, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
-static int lacp_debug = 0;
+static VNET_DEFINE(int, lacp_debug);
+#define V_lacp_debug VNET(lacp_debug)
SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD, 0, "ieee802.3ad");
-SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN,
- &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)");
+SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN | CTLFLAG_VNET,
+ &VNET_NAME(lacp_debug), 0, "Enable LACP debug logging (1=debug, 2=trace)");
-#define LACP_DPRINTF(a) if (lacp_debug & 0x01) { lacp_dprintf a ; }
-#define LACP_TRACE(a) if (lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); }
-#define LACP_TPRINTF(a) if (lacp_debug & 0x04) { lacp_dprintf a ; }
+#define LACP_DPRINTF(a) if (V_lacp_debug & 0x01) { lacp_dprintf a ; }
+#define LACP_TRACE(a) if (V_lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); }
+#define LACP_TPRINTF(a) if (V_lacp_debug & 0x04) { lacp_dprintf a ; }
/*
* partner administration variables.
@@ -300,7 +301,7 @@ lacp_pdu_input(struct lacp_port *lp, struct mbuf *m)
goto bad;
}
- if (lacp_debug > 0) {
+ if (V_lacp_debug > 0) {
lacp_dprintf(lp, "lacpdu receive\n");
lacp_dump_lacpdu(du);
}
@@ -385,7 +386,7 @@ lacp_xmit_lacpdu(struct lacp_port *lp)
sizeof(du->ldu_collector));
du->ldu_collector.lci_maxdelay = 0;
- if (lacp_debug > 0) {
+ if (V_lacp_debug > 0) {
lacp_dprintf(lp, "lacpdu transmit\n");
lacp_dump_lacpdu(du);
}
@@ -497,12 +498,14 @@ lacp_tick(void *arg)
if ((lp->lp_state & LACP_STATE_AGGREGATION) == 0)
continue;
+ CURVNET_SET(lp->lp_ifp->if_vnet);
lacp_run_timers(lp);
lacp_select(lp);
lacp_sm_mux(lp);
lacp_sm_tx(lp);
lacp_sm_ptx_tx_schedule(lp);
+ CURVNET_RESTORE();
}
callout_reset(&lsc->lsc_callout, hz, lacp_tick, lsc);
}
@@ -747,48 +750,10 @@ lacp_transit_expire(void *vp)
lsc->lsc_suppress_distributing = FALSE;
}
-static void
-lacp_attach_sysctl(struct lacp_softc *lsc, struct sysctl_oid *p_oid)
-{
- struct lagg_softc *sc = lsc->lsc_softc;
-
- SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(p_oid), OID_AUTO,
- "lacp_strict_mode",
- CTLFLAG_RW,
- &lsc->lsc_strict_mode,
- lsc->lsc_strict_mode,
- "Enable LACP strict mode");
-}
-
-static void
-lacp_attach_sysctl_debug(struct lacp_softc *lsc, struct sysctl_oid *p_oid)
-{
- struct lagg_softc *sc = lsc->lsc_softc;
- struct sysctl_oid *oid;
-
- /* Create a child of the parent lagg interface */
- oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(p_oid),
- OID_AUTO, "debug", CTLFLAG_RD, NULL, "DEBUG");
-
- SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
- "rx_test",
- CTLFLAG_RW,
- &lsc->lsc_debug.lsc_rx_test,
- lsc->lsc_debug.lsc_rx_test,
- "Bitmap of if_dunit entries to drop RX frames for");
- SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
- "tx_test",
- CTLFLAG_RW,
- &lsc->lsc_debug.lsc_tx_test,
- lsc->lsc_debug.lsc_tx_test,
- "Bitmap of if_dunit entries to drop TX frames for");
-}
-
void
lacp_attach(struct lagg_softc *sc)
{
struct lacp_softc *lsc;
- struct sysctl_oid *oid;
lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_WAITOK | M_ZERO);
@@ -802,14 +767,6 @@ lacp_attach(struct lagg_softc *sc)
TAILQ_INIT(&lsc->lsc_aggregators);
LIST_INIT(&lsc->lsc_ports);
- /* Create a child of the parent lagg interface */
- oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(sc->sc_oid),
- OID_AUTO, "lacp", CTLFLAG_RD, NULL, "LACP");
-
- /* Attach sysctl nodes */
- lacp_attach_sysctl(lsc, oid);
- lacp_attach_sysctl_debug(lsc, oid);
-
callout_init_mtx(&lsc->lsc_transit_callout, &lsc->lsc_mtx, 0);
callout_init_mtx(&lsc->lsc_callout, &lsc->lsc_mtx, 0);
@@ -875,7 +832,7 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf *m)
return (NULL);
}
- if (sc->use_flowid && (m->m_flags & M_FLOWID))
+ if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && (m->m_flags & M_FLOWID))
hash = m->m_pkthdr.flowid >> sc->flowid_shift;
else
hash = lagg_hashmbuf(sc, m, lsc->lsc_hashkey);
@@ -1374,7 +1331,7 @@ lacp_sm_mux(struct lacp_port *lp)
enum lacp_selected selected = lp->lp_selected;
struct lacp_aggregator *la;
- if (lacp_debug > 1)
+ if (V_lacp_debug > 1)
lacp_dprintf(lp, "%s: state= 0x%x, selected= 0x%x, "
"p_sync= 0x%x, p_collecting= 0x%x\n", __func__,
lp->lp_mux_state, selected, p_sync, p_collecting);
diff --git a/sys/net/if.c b/sys/net/if.c
index 831dc3f..a7fb2a9 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -468,6 +468,10 @@ if_alloc(u_char type)
refcount_init(&ifp->if_refcount, 1); /* Index reference. */
ifnet_setbyindex(ifp->if_index, ifp);
+
+ for (int i = 0; i < IFCOUNTERS; i++)
+ ifp->if_counters[i] = counter_u64_alloc(M_WAITOK);
+
return (ifp);
}
@@ -495,6 +499,10 @@ if_free_internal(struct ifnet *ifp)
IF_AFDATA_DESTROY(ifp);
IF_ADDR_LOCK_DESTROY(ifp);
ifq_delete(&ifp->if_snd);
+
+ for (int i = 0; i < IFCOUNTERS; i++)
+ counter_u64_free(ifp->if_counters[i]);
+
free(ifp, M_IFNET);
}
@@ -1460,39 +1468,15 @@ if_rtdel(struct radix_node *rn, void *arg)
}
/*
- * Return counter values from old racy non-pcpu counters.
+ * Return counter values from counter(9)s stored in ifnet.
*/
uint64_t
if_get_counter_default(struct ifnet *ifp, ift_counter cnt)
{
- switch (cnt) {
- case IFCOUNTER_IPACKETS:
- return (ifp->if_ipackets);
- case IFCOUNTER_IERRORS:
- return (ifp->if_ierrors);
- case IFCOUNTER_OPACKETS:
- return (ifp->if_opackets);
- case IFCOUNTER_OERRORS:
- return (ifp->if_oerrors);
- case IFCOUNTER_COLLISIONS:
- return (ifp->if_collisions);
- case IFCOUNTER_IBYTES:
- return (ifp->if_ibytes);
- case IFCOUNTER_OBYTES:
- return (ifp->if_obytes);
- case IFCOUNTER_IMCASTS:
- return (ifp->if_imcasts);
- case IFCOUNTER_OMCASTS:
- return (ifp->if_omcasts);
- case IFCOUNTER_IQDROPS:
- return (ifp->if_iqdrops);
- case IFCOUNTER_OQDROPS:
- return (ifp->if_oqdrops);
- case IFCOUNTER_NOPROTO:
- return (ifp->if_noproto);
- }
- panic("%s: unknown counter %d", __func__, cnt);
+ KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt));
+
+ return (counter_u64_fetch(ifp->if_counters[cnt]));
}
/*
@@ -1503,46 +1487,9 @@ void
if_inc_counter(struct ifnet *ifp, ift_counter cnt, int64_t inc)
{
- switch (cnt) {
- case IFCOUNTER_IPACKETS:
- ifp->if_ipackets += inc;
- break;
- case IFCOUNTER_IERRORS:
- ifp->if_ierrors += inc;
- break;
- case IFCOUNTER_OPACKETS:
- ifp->if_opackets += inc;
- break;
- case IFCOUNTER_OERRORS:
- ifp->if_oerrors += inc;
- break;
- case IFCOUNTER_COLLISIONS:
- ifp->if_collisions += inc;
- break;
- case IFCOUNTER_IBYTES:
- ifp->if_ibytes += inc;
- break;
- case IFCOUNTER_OBYTES:
- ifp->if_obytes += inc;
- break;
- case IFCOUNTER_IMCASTS:
- ifp->if_imcasts += inc;
- break;
- case IFCOUNTER_OMCASTS:
- ifp->if_omcasts += inc;
- break;
- case IFCOUNTER_IQDROPS:
- ifp->if_iqdrops += inc;
- break;
- case IFCOUNTER_OQDROPS:
- ifp->if_oqdrops += inc;
- break;
- case IFCOUNTER_NOPROTO:
- ifp->if_noproto += inc;
- break;
- default:
- panic("%s: unknown counter %d", __func__, cnt);
- }
+ KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt));
+
+ counter_u64_add(ifp->if_counters[cnt], inc);
}
/*
@@ -3596,14 +3543,14 @@ if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust)
IF_LOCK(ifq);
if (_IF_QFULL(ifq)) {
IF_UNLOCK(ifq);
- ifp->if_oqdrops++;
+ if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1);
m_freem(m);
return (0);
}
if (ifp != NULL) {
- ifp->if_obytes += m->m_pkthdr.len + adjust;
+ if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len + adjust);
if (m->m_flags & (M_BCAST|M_MCAST))
- ifp->if_omcasts++;
+ if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
active = ifp->if_drv_flags & IFF_DRV_OACTIVE;
}
_IF_ENQUEUE(ifq, m);
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index a6e27ae..67895de 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_types.h>
#include <net/if_var.h>
#include <net/bpf.h>
+#include <net/vnet.h>
#if defined(INET) || defined(INET6)
#include <netinet/in.h>
@@ -81,13 +82,21 @@ static struct {
{0, NULL}
};
-SLIST_HEAD(__trhead, lagg_softc) lagg_list; /* list of laggs */
-static struct mtx lagg_list_mtx;
+VNET_DEFINE(SLIST_HEAD(__trhead, lagg_softc), lagg_list); /* list of laggs */
+#define V_lagg_list VNET(lagg_list)
+static VNET_DEFINE(struct mtx, lagg_list_mtx);
+#define V_lagg_list_mtx VNET(lagg_list_mtx)
+#define LAGG_LIST_LOCK_INIT(x) mtx_init(&V_lagg_list_mtx, \
+ "if_lagg list", NULL, MTX_DEF)
+#define LAGG_LIST_LOCK_DESTROY(x) mtx_destroy(&V_lagg_list_mtx)
+#define LAGG_LIST_LOCK(x) mtx_lock(&V_lagg_list_mtx)
+#define LAGG_LIST_UNLOCK(x) mtx_unlock(&V_lagg_list_mtx)
eventhandler_tag lagg_detach_cookie = NULL;
static int lagg_clone_create(struct if_clone *, int, caddr_t);
static void lagg_clone_destroy(struct ifnet *);
-static struct if_clone *lagg_cloner;
+static VNET_DEFINE(struct if_clone *, lagg_cloner);
+#define V_lagg_cloner VNET(lagg_cloner)
static const char laggname[] = "lagg";
static void lagg_lladdr(struct lagg_softc *, uint8_t *);
@@ -115,6 +124,7 @@ static int lagg_ether_cmdmulti(struct lagg_port *, int);
static int lagg_setflag(struct lagg_port *, int, int,
int (*func)(struct ifnet *, int));
static int lagg_setflags(struct lagg_port *, int status);
+static uint64_t lagg_get_counter(struct ifnet *ifp, ift_counter cnt);
static int lagg_transmit(struct ifnet *, struct mbuf *);
static void lagg_qflush(struct ifnet *);
static int lagg_media_change(struct ifnet *);
@@ -122,7 +132,6 @@ static void lagg_media_status(struct ifnet *, struct ifmediareq *);
static struct lagg_port *lagg_link_active(struct lagg_softc *,
struct lagg_port *);
static const void *lagg_gethdr(struct mbuf *, u_int, u_int, void *);
-static int lagg_sysctl_active(SYSCTL_HANDLER_ARGS);
/* Simple round robin */
static void lagg_rr_attach(struct lagg_softc *);
@@ -158,8 +167,6 @@ static struct mbuf *lagg_lacp_input(struct lagg_softc *, struct lagg_port *,
struct mbuf *);
static void lagg_lacp_lladdr(struct lagg_softc *);
-static void lagg_callout(void *);
-
/* lagg protocol table */
static const struct lagg_proto {
lagg_proto pr_num;
@@ -233,29 +240,55 @@ SYSCTL_DECL(_net_link);
SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW, 0,
"Link Aggregation");
-static int lagg_failover_rx_all = 0; /* Allow input on any failover links */
-SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW,
- &lagg_failover_rx_all, 0,
+/* Allow input on any failover links */
+static VNET_DEFINE(int, lagg_failover_rx_all);
+#define V_lagg_failover_rx_all VNET(lagg_failover_rx_all)
+SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW | CTLFLAG_VNET,
+ &VNET_NAME(lagg_failover_rx_all), 0,
"Accept input from any interface in a failover lagg");
-static int def_use_flowid = 1; /* Default value for using M_FLOWID */
+
+/* Default value for using M_FLOWID */
+static VNET_DEFINE(int, def_use_flowid) = 1;
+#define V_def_use_flowid VNET(def_use_flowid)
SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN,
- &def_use_flowid, 0,
+ &VNET_NAME(def_use_flowid), 0,
"Default setting for using flow id for load sharing");
-static int def_flowid_shift = 16; /* Default value for using M_FLOWID */
+
+/* Default value for using M_FLOWID */
+static VNET_DEFINE(int, def_flowid_shift) = 16;
+#define V_def_flowid_shift VNET(def_flowid_shift)
SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift, CTLFLAG_RWTUN,
- &def_flowid_shift, 0,
+ &VNET_NAME(def_flowid_shift), 0,
"Default setting for flowid shift for load sharing");
+static void
+vnet_lagg_init(const void *unused __unused)
+{
+
+ LAGG_LIST_LOCK_INIT();
+ SLIST_INIT(&V_lagg_list);
+ V_lagg_cloner = if_clone_simple(laggname, lagg_clone_create,
+ lagg_clone_destroy, 0);
+}
+VNET_SYSINIT(vnet_lagg_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
+ vnet_lagg_init, NULL);
+
+static void
+vnet_lagg_uninit(const void *unused __unused)
+{
+
+ if_clone_detach(V_lagg_cloner);
+ LAGG_LIST_LOCK_DESTROY();
+}
+VNET_SYSUNINIT(vnet_lagg_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
+ vnet_lagg_uninit, NULL);
+
static int
lagg_modevent(module_t mod, int type, void *data)
{
switch (type) {
case MOD_LOAD:
- mtx_init(&lagg_list_mtx, "if_lagg list", NULL, MTX_DEF);
- SLIST_INIT(&lagg_list);
- lagg_cloner = if_clone_simple(laggname, lagg_clone_create,
- lagg_clone_destroy, 0);
lagg_input_p = lagg_input;
lagg_linkstate_p = lagg_port_state;
lagg_detach_cookie = EVENTHANDLER_REGISTER(
@@ -265,10 +298,8 @@ lagg_modevent(module_t mod, int type, void *data)
case MOD_UNLOAD:
EVENTHANDLER_DEREGISTER(ifnet_departure_event,
lagg_detach_cookie);
- if_clone_detach(lagg_cloner);
lagg_input_p = NULL;
lagg_linkstate_p = NULL;
- mtx_destroy(&lagg_list_mtx);
break;
default:
return (EOPNOTSUPP);
@@ -446,8 +477,6 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
struct lagg_softc *sc;
struct ifnet *ifp;
static const u_char eaddr[6]; /* 00:00:00:00:00:00 */
- struct sysctl_oid *oid;
- char num[14]; /* sufficient for 32 bits */
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = sc->sc_ifp = if_alloc(IFT_ETHER);
@@ -456,50 +485,19 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
return (ENOSPC);
}
- sc->sc_ipackets = counter_u64_alloc(M_WAITOK);
- sc->sc_opackets = counter_u64_alloc(M_WAITOK);
- sc->sc_ibytes = counter_u64_alloc(M_WAITOK);
- sc->sc_obytes = counter_u64_alloc(M_WAITOK);
-
- sysctl_ctx_init(&sc->ctx);
- snprintf(num, sizeof(num), "%u", unit);
- sc->use_flowid = def_use_flowid;
- sc->flowid_shift = def_flowid_shift;
- sc->sc_oid = oid = SYSCTL_ADD_NODE(&sc->ctx,
- &SYSCTL_NODE_CHILDREN(_net_link, lagg),
- OID_AUTO, num, CTLFLAG_RD, NULL, "");
- SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
- "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid,
- sc->use_flowid, "Use flow id for load sharing");
- SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
- "flowid_shift", CTLTYPE_INT|CTLFLAG_RW, &sc->flowid_shift,
- sc->flowid_shift,
- "Shift flowid bits to prevent multiqueue collisions");
- SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
- "count", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_count, sc->sc_count,
- "Total number of ports");
- SYSCTL_ADD_PROC(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
- "active", CTLTYPE_INT|CTLFLAG_RD, sc, 0, lagg_sysctl_active,
- "I", "Total number of active ports");
- SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
- "flapping", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_flapping,
- sc->sc_flapping, "Total number of port change events");
+ if (V_def_use_flowid)
+ sc->sc_opts |= LAGG_OPT_USE_FLOWID;
+ sc->flowid_shift = V_def_flowid_shift;
+
/* Hash all layers by default */
sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4;
lagg_proto_attach(sc, LAGG_PROTO_DEFAULT);
LAGG_LOCK_INIT(sc);
- LAGG_CALLOUT_LOCK_INIT(sc);
SLIST_INIT(&sc->sc_ports);
TASK_INIT(&sc->sc_lladdr_task, 0, lagg_port_setlladdr, sc);
- /*
- * This uses the callout lock rather than the rmlock; one can't
- * hold said rmlock during SWI.
- */
- callout_init_mtx(&sc->sc_callout, &sc->sc_call_mtx, 0);
-
/* Initialise pseudo media types */
ifmedia_init(&sc->sc_media, 0, lagg_media_change,
lagg_media_status);
@@ -512,6 +510,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
ifp->if_qflush = lagg_qflush;
ifp->if_init = lagg_init;
ifp->if_ioctl = lagg_ioctl;
+ ifp->if_get_counter = lagg_get_counter;
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS;
@@ -527,11 +526,9 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
lagg_unregister_vlan, sc, EVENTHANDLER_PRI_FIRST);
/* Insert into the global list of laggs */
- mtx_lock(&lagg_list_mtx);
- SLIST_INSERT_HEAD(&lagg_list, sc, sc_entries);
- mtx_unlock(&lagg_list_mtx);
-
- callout_reset(&sc->sc_callout, hz, lagg_callout, sc);
+ LAGG_LIST_LOCK();
+ SLIST_INSERT_HEAD(&V_lagg_list, sc, sc_entries);
+ LAGG_LIST_UNLOCK();
return (0);
}
@@ -556,27 +553,16 @@ lagg_clone_destroy(struct ifnet *ifp)
/* Unhook the aggregation protocol */
lagg_proto_detach(sc);
- sysctl_ctx_free(&sc->ctx);
ifmedia_removeall(&sc->sc_media);
ether_ifdetach(ifp);
if_free(ifp);
- /* This grabs sc_callout_mtx, serialising it correctly */
- callout_drain(&sc->sc_callout);
-
- /* At this point it's drained; we can free this */
- counter_u64_free(sc->sc_ipackets);
- counter_u64_free(sc->sc_opackets);
- counter_u64_free(sc->sc_ibytes);
- counter_u64_free(sc->sc_obytes);
-
- mtx_lock(&lagg_list_mtx);
- SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries);
- mtx_unlock(&lagg_list_mtx);
+ LAGG_LIST_LOCK();
+ SLIST_REMOVE(&V_lagg_list, sc, lagg_softc, sc_entries);
+ LAGG_LIST_UNLOCK();
taskqueue_drain(taskqueue_swi, &sc->sc_lladdr_task);
LAGG_LOCK_DESTROY(sc);
- LAGG_CALLOUT_LOCK_DESTROY(sc);
free(sc, M_DEVBUF);
}
@@ -712,7 +698,8 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
{
struct lagg_softc *sc_ptr;
struct lagg_port *lp, *tlp;
- int error;
+ int error, i;
+ uint64_t *pval;
LAGG_WLOCK_ASSERT(sc);
@@ -775,10 +762,10 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
return (ENOMEM);
/* Check if port is a stacked lagg */
- mtx_lock(&lagg_list_mtx);
- SLIST_FOREACH(sc_ptr, &lagg_list, sc_entries) {
+ LAGG_LIST_LOCK();
+ SLIST_FOREACH(sc_ptr, &V_lagg_list, sc_entries) {
if (ifp == sc_ptr->sc_ifp) {
- mtx_unlock(&lagg_list_mtx);
+ LAGG_LIST_UNLOCK();
free(lp, M_DEVBUF);
return (EINVAL);
/* XXX disable stacking for the moment, its untested */
@@ -786,14 +773,14 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
lp->lp_flags |= LAGG_PORT_STACK;
if (lagg_port_checkstacking(sc_ptr) >=
LAGG_MAX_STACKING) {
- mtx_unlock(&lagg_list_mtx);
+ LAGG_LIST_UNLOCK();
free(lp, M_DEVBUF);
return (E2BIG);
}
#endif
}
}
- mtx_unlock(&lagg_list_mtx);
+ LAGG_LIST_UNLOCK();
/* Change the interface type */
lp->lp_iftype = ifp->if_type;
@@ -836,6 +823,10 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
lagg_capabilities(sc);
lagg_linkstate(sc);
+ /* Read port counters */
+ pval = lp->port_counters.val;
+ for (i = 0; i < IFCOUNTERS; i++, pval++)
+ *pval = ifp->if_get_counter(ifp, i);
/* Add multicast addresses and interface flags to this port */
lagg_ether_cmdmulti(lp, 1);
lagg_setflags(lp, 1);
@@ -877,6 +868,8 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport)
struct lagg_port *lp_ptr;
struct lagg_llq *llq;
struct ifnet *ifp = lp->lp_ifp;
+ uint64_t *pval, vdiff;
+ int i;
LAGG_WLOCK_ASSERT(sc);
@@ -899,6 +892,13 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport)
ifp->if_output = lp->lp_output;
ifp->if_lagg = NULL;
+ /* Update detached port counters */
+ pval = lp->port_counters.val;
+ for (i = 0; i < IFCOUNTERS; i++, pval++) {
+ vdiff = ifp->if_get_counter(ifp, i) - *pval;
+ sc->detached_counters.val[i] += vdiff;
+ }
+
/* Finally, remove the port from the lagg */
SLIST_REMOVE(&sc->sc_ports, lp, lagg_port, lp_entries);
sc->sc_count--;
@@ -1012,6 +1012,61 @@ fallback:
}
/*
+ * Requests counter @cnt data.
+ *
+ * Counter value is calculated the following way:
+ * 1) for each port, sum difference between current and "initial" measurements.
+ * 2) add lagg logical interface counters.
+ * 3) add data from detached_counters array.
+ *
+ * We also do the following things on ports attach/detach:
+ * 1) On port attach we store all counters it has into port_counter array.
+ * 2) On port detach we add the different between "initial" and
+ * current counters data to detached_counters array.
+ */
+static uint64_t
+lagg_get_counter(struct ifnet *ifp, ift_counter cnt)
+{
+ struct lagg_softc *sc;
+ struct lagg_port *lp;
+ struct ifnet *lpifp;
+ struct rm_priotracker tracker;
+ uint64_t newval, oldval, vsum;
+
+ /* Revise this when we've got non-generic counters. */
+ KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt));
+
+ sc = (struct lagg_softc *)ifp->if_softc;
+ LAGG_RLOCK(sc, &tracker);
+
+ vsum = 0;
+ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
+ /* Saved attached value */
+ oldval = lp->port_counters.val[cnt];
+ /* current value */
+ lpifp = lp->lp_ifp;
+ newval = lpifp->if_get_counter(lpifp, cnt);
+ /* Calculate diff and save new */
+ vsum += newval - oldval;
+ }
+
+ /*
+ * Add counter data which might be added by upper
+ * layer protocols operating on logical interface.
+ */
+ vsum += if_get_counter_default(ifp, cnt);
+
+ /*
+ * Add counter data from detached ports counters
+ */
+ vsum += sc->detached_counters.val[cnt];
+
+ LAGG_RUNLOCK(sc, &tracker);
+
+ return (vsum);
+}
+
+/*
* For direct output to child ports.
*/
static int
@@ -1134,6 +1189,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc;
struct lagg_reqall *ra = (struct lagg_reqall *)data;
+ struct lagg_reqopts *ro = (struct lagg_reqopts *)data;
struct lagg_reqport *rp = (struct lagg_reqport *)data, rpbuf;
struct lagg_reqflags *rf = (struct lagg_reqflags *)data;
struct ifreq *ifr = (struct ifreq *)data;
@@ -1192,6 +1248,107 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
lagg_proto_detach(sc);
lagg_proto_attach(sc, ra->ra_proto);
break;
+ case SIOCGLAGGOPTS:
+ ro->ro_opts = sc->sc_opts;
+ if (sc->sc_proto == LAGG_PROTO_LACP) {
+ struct lacp_softc *lsc;
+
+ lsc = (struct lacp_softc *)sc->sc_psc;
+ if (lsc->lsc_debug.lsc_tx_test != 0)
+ ro->ro_opts |= LAGG_OPT_LACP_TXTEST;
+ if (lsc->lsc_debug.lsc_rx_test != 0)
+ ro->ro_opts |= LAGG_OPT_LACP_RXTEST;
+ if (lsc->lsc_strict_mode != 0)
+ ro->ro_opts |= LAGG_OPT_LACP_STRICT;
+
+ ro->ro_active = sc->sc_active;
+ } else {
+ ro->ro_active = 0;
+ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
+ ro->ro_active += LAGG_PORTACTIVE(lp);
+ }
+ ro->ro_flapping = sc->sc_flapping;
+ ro->ro_flowid_shift = sc->flowid_shift;
+ break;
+ case SIOCSLAGGOPTS:
+ error = priv_check(td, PRIV_NET_LAGG);
+ if (error)
+ break;
+ if (ro->ro_opts == 0)
+ break;
+ /*
+ * Set options. LACP options are stored in sc->sc_psc,
+ * not in sc_opts.
+ */
+ int valid, lacp;
+
+ switch (ro->ro_opts) {
+ case LAGG_OPT_USE_FLOWID:
+ case -LAGG_OPT_USE_FLOWID:
+ case LAGG_OPT_FLOWIDSHIFT:
+ valid = 1;
+ lacp = 0;
+ break;
+ case LAGG_OPT_LACP_TXTEST:
+ case -LAGG_OPT_LACP_TXTEST:
+ case LAGG_OPT_LACP_RXTEST:
+ case -LAGG_OPT_LACP_RXTEST:
+ case LAGG_OPT_LACP_STRICT:
+ case -LAGG_OPT_LACP_STRICT:
+ valid = lacp = 1;
+ break;
+ default:
+ valid = lacp = 0;
+ break;
+ }
+
+ LAGG_WLOCK(sc);
+ if (valid == 0 ||
+ (lacp == 1 && sc->sc_proto != LAGG_PROTO_LACP)) {
+ /* Invalid combination of options specified. */
+ error = EINVAL;
+ LAGG_WUNLOCK(sc);
+ break; /* Return from SIOCSLAGGOPTS. */
+ }
+ /*
+ * Store new options into sc->sc_opts except for
+ * FLOWIDSHIFT and LACP options.
+ */
+ if (lacp == 0) {
+ if (ro->ro_opts == LAGG_OPT_FLOWIDSHIFT)
+ sc->flowid_shift = ro->ro_flowid_shift;
+ else if (ro->ro_opts > 0)
+ sc->sc_opts |= ro->ro_opts;
+ else
+ sc->sc_opts &= ~ro->ro_opts;
+ } else {
+ struct lacp_softc *lsc;
+
+ lsc = (struct lacp_softc *)sc->sc_psc;
+
+ switch (ro->ro_opts) {
+ case LAGG_OPT_LACP_TXTEST:
+ lsc->lsc_debug.lsc_tx_test = 1;
+ break;
+ case -LAGG_OPT_LACP_TXTEST:
+ lsc->lsc_debug.lsc_tx_test = 0;
+ break;
+ case LAGG_OPT_LACP_RXTEST:
+ lsc->lsc_debug.lsc_rx_test = 1;
+ break;
+ case -LAGG_OPT_LACP_RXTEST:
+ lsc->lsc_debug.lsc_rx_test = 0;
+ break;
+ case LAGG_OPT_LACP_STRICT:
+ lsc->lsc_strict_mode = 1;
+ break;
+ case -LAGG_OPT_LACP_STRICT:
+ lsc->lsc_strict_mode = 0;
+ break;
+ }
+ }
+ LAGG_WUNLOCK(sc);
+ break;
case SIOCGLAGGFLAGS:
rf->rf_flags = sc->sc_flags;
break;
@@ -1440,7 +1597,7 @@ lagg_transmit(struct ifnet *ifp, struct mbuf *m)
if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) {
LAGG_RUNLOCK(sc, &tracker);
m_freem(m);
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
return (ENXIO);
}
@@ -1449,12 +1606,8 @@ lagg_transmit(struct ifnet *ifp, struct mbuf *m)
error = lagg_proto_start(sc, m);
LAGG_RUNLOCK(sc, &tracker);
- if (error == 0) {
- counter_u64_add(sc->sc_opackets, 1);
- counter_u64_add(sc->sc_obytes, len);
- ifp->if_omcasts += mcast;
- } else
- ifp->if_oerrors++;
+ if (error != 0)
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
return (error);
}
@@ -1489,9 +1642,6 @@ lagg_input(struct ifnet *ifp, struct mbuf *m)
m = lagg_proto_input(sc, lp, m);
if (m != NULL) {
- counter_u64_add(sc->sc_ipackets, 1);
- counter_u64_add(sc->sc_ibytes, m->m_pkthdr.len);
-
if (scifp->if_flags & IFF_MONITOR) {
m_freem(m);
m = NULL;
@@ -1649,27 +1799,6 @@ lagg_gethdr(struct mbuf *m, u_int off, u_int len, void *buf)
return (mtod(m, char *) + off);
}
-static int
-lagg_sysctl_active(SYSCTL_HANDLER_ARGS)
-{
- struct lagg_softc *sc = (struct lagg_softc *)arg1;
- struct lagg_port *lp;
- int error;
-
- /* LACP tracks active links automatically, the others do not */
- if (sc->sc_proto != LAGG_PROTO_LACP) {
- sc->sc_active = 0;
- SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
- sc->sc_active += LAGG_PORTACTIVE(lp);
- }
-
- error = sysctl_handle_int(oidp, &sc->sc_active, 0, req);
- if ((error) || (req->newptr == NULL))
- return (error);
-
- return (0);
-}
-
uint32_t
lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key)
{
@@ -1910,7 +2039,7 @@ lagg_fail_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m)
struct ifnet *ifp = sc->sc_ifp;
struct lagg_port *tmp_tp;
- if (lp == sc->sc_primary || lagg_failover_rx_all) {
+ if (lp == sc->sc_primary || V_lagg_failover_rx_all) {
m->m_pkthdr.rcvif = ifp;
return (m);
}
@@ -2005,7 +2134,7 @@ lagg_lb_start(struct lagg_softc *sc, struct mbuf *m)
struct lagg_port *lp = NULL;
uint32_t p = 0;
- if (sc->use_flowid && (m->m_flags & M_FLOWID))
+ if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && (m->m_flags & M_FLOWID))
p = m->m_pkthdr.flowid >> sc->flowid_shift;
else
p = lagg_hashmbuf(sc, m, lb->lb_key);
@@ -2124,16 +2253,3 @@ lagg_lacp_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m)
return (m);
}
-static void
-lagg_callout(void *arg)
-{
- struct lagg_softc *sc = (struct lagg_softc *)arg;
- struct ifnet *ifp = sc->sc_ifp;
-
- ifp->if_ipackets = counter_u64_fetch(sc->sc_ipackets);
- ifp->if_opackets = counter_u64_fetch(sc->sc_opackets);
- ifp->if_ibytes = counter_u64_fetch(sc->sc_ibytes);
- ifp->if_obytes = counter_u64_fetch(sc->sc_obytes);
-
- callout_reset(&sc->sc_callout, hz, lagg_callout, sc);
-}
diff --git a/sys/net/if_lagg.h b/sys/net/if_lagg.h
index 1b07f7b..bbb3497 100644
--- a/sys/net/if_lagg.h
+++ b/sys/net/if_lagg.h
@@ -138,9 +138,28 @@ struct lagg_reqflags {
#define SIOCGLAGGFLAGS _IOWR('i', 145, struct lagg_reqflags)
#define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags)
-#ifdef _KERNEL
+struct lagg_reqopts {
+ char ro_ifname[IFNAMSIZ]; /* name of the lagg */
+
+ int ro_opts; /* Option bitmap */
+#define LAGG_OPT_NONE 0x00
+#define LAGG_OPT_USE_FLOWID 0x01 /* use M_FLOWID */
+/* Pseudo flags which are used in ro_opts but not stored into sc_opts. */
+#define LAGG_OPT_FLOWIDSHIFT 0x02 /* Set flowid */
+#define LAGG_OPT_FLOWIDSHIFT_MASK 0x1f /* flowid is uint32_t */
+#define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */
+#define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */
+#define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */
+ u_int ro_count; /* number of ports */
+ u_int ro_active; /* active port count */
+ u_int ro_flapping; /* number of flapping */
+ int ro_flowid_shift; /* shift the flowid */
+};
-#include <sys/counter.h>
+#define SIOCGLAGGOPTS _IOWR('i', 152, struct lagg_reqopts)
+#define SIOCSLAGGOPTS _IOW('i', 153, struct lagg_reqopts)
+
+#ifdef _KERNEL
/*
* Internal kernel part
@@ -187,10 +206,13 @@ struct lagg_llq {
SLIST_ENTRY(lagg_llq) llq_entries;
};
+struct lagg_counters {
+ uint64_t val[IFCOUNTERS];
+};
+
struct lagg_softc {
struct ifnet *sc_ifp; /* virtual interface */
struct rmlock sc_mtx;
- struct mtx sc_call_mtx;
int sc_proto; /* lagg protocol */
u_int sc_count; /* number of ports */
u_int sc_active; /* active port count */
@@ -202,11 +224,6 @@ struct lagg_softc {
uint32_t sc_seq; /* sequence counter */
uint32_t sc_flags;
- counter_u64_t sc_ipackets;
- counter_u64_t sc_opackets;
- counter_u64_t sc_ibytes;
- counter_u64_t sc_obytes;
-
SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */
SLIST_ENTRY(lagg_softc) sc_entries;
@@ -216,10 +233,9 @@ struct lagg_softc {
eventhandler_tag vlan_attach;
eventhandler_tag vlan_detach;
struct callout sc_callout;
- struct sysctl_ctx_list ctx; /* sysctl variables */
- struct sysctl_oid *sc_oid; /* sysctl tree oid */
- int use_flowid; /* use M_FLOWID */
+ u_int sc_opts;
int flowid_shift; /* shift the flowid */
+ struct lagg_counters detached_counters; /* detached ports sum */
};
struct lagg_port {
@@ -241,6 +257,7 @@ struct lagg_port {
int (*lp_ioctl)(struct ifnet *, u_long, caddr_t);
int (*lp_output)(struct ifnet *, struct mbuf *,
const struct sockaddr *, struct route *);
+ struct lagg_counters port_counters; /* ifp counters copy */
SLIST_ENTRY(lagg_port) lp_entries;
};
@@ -254,11 +271,6 @@ struct lagg_port {
#define LAGG_RLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_RLOCKED)
#define LAGG_WLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_WLOCKED)
-#define LAGG_CALLOUT_LOCK_INIT(_sc) \
- mtx_init(&(_sc)->sc_call_mtx, "if_lagg callout mutex", NULL,\
- MTX_DEF)
-#define LAGG_CALLOUT_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_call_mtx)
-
extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *);
extern void (*lagg_linkstate_p)(struct ifnet *, int );
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 53bac32..f043717 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -96,7 +96,7 @@ VNET_DECLARE(struct pfil_head, link_pfil_hook); /* packet filter hooks */
#endif /* _KERNEL */
typedef enum {
- IFCOUNTER_IPACKETS = 1,
+ IFCOUNTER_IPACKETS = 0,
IFCOUNTER_IERRORS,
IFCOUNTER_OPACKETS,
IFCOUNTER_OERRORS,
@@ -108,6 +108,7 @@ typedef enum {
IFCOUNTER_IQDROPS,
IFCOUNTER_OQDROPS,
IFCOUNTER_NOPROTO,
+ IFCOUNTERS /* Array size. */
} ift_counter;
typedef struct ifnet * if_t;
@@ -227,28 +228,15 @@ struct ifnet {
(struct ifnet *, struct vnet *, char *);
if_get_counter_t if_get_counter; /* get counter values */
+ /* Statistics. */
+ counter_u64_t if_counters[IFCOUNTERS];
+
/* Stuff that's only temporary and doesn't belong here. */
u_int if_hw_tsomax; /* TSO total burst length
* limit in bytes. A value of
* zero means no limit. Have
* to find a better place for
* it eventually. */
- /*
- * Old, racy and expensive statistics, should not be used in
- * new drivers.
- */
- uint64_t if_ipackets; /* packets received on interface */
- uint64_t if_ierrors; /* input errors on interface */
- uint64_t if_opackets; /* packets sent on interface */
- uint64_t if_oerrors; /* output errors on interface */
- uint64_t if_collisions; /* collisions on csma interfaces */
- uint64_t if_ibytes; /* total number of octets received */
- uint64_t if_obytes; /* total number of octets sent */
- uint64_t if_imcasts; /* packets received via multicast */
- uint64_t if_omcasts; /* packets sent via multicast */
- uint64_t if_iqdrops; /* dropped on input */
- uint64_t if_oqdrops; /* dropped on output */
- uint64_t if_noproto; /* destined for unsupported protocol */
/* TSO fields for segment limits. If a field is zero below, there is no limit. */
u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */
@@ -261,8 +249,6 @@ struct ifnet {
*/
};
-#include <net/ifq.h> /* XXXAO: temporary unconditional include */
-
/* for compatibility with other BSDs */
#define if_addrlist if_addrhead
#define if_list if_link
@@ -611,5 +597,16 @@ int drbr_enqueue_drv(if_t ifp, struct buf_ring *br, struct mbuf *m);
void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *);
int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *);
+#ifdef DEVICE_POLLING
+enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS };
+
+typedef int poll_handler_t(if_t ifp, enum poll_cmd cmd, int count);
+int ether_poll_register(poll_handler_t *h, if_t ifp);
+int ether_poll_deregister(if_t ifp);
+#endif /* DEVICE_POLLING */
+
#endif /* _KERNEL */
+
+#include <net/ifq.h> /* XXXAO: temporary unconditional include */
+
#endif /* !_NET_IF_VAR_H_ */
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 926afa0..1be2888 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -148,9 +148,10 @@ static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW, 0,
static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0,
"for consistency");
-static int soft_pad = 0;
-SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW, &soft_pad, 0,
- "pad short frames before tagging");
+static VNET_DEFINE(int, soft_pad);
+#define V_soft_pad VNET(soft_pad)
+SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET,
+ &VNET_NAME(soft_pad), 0, "pad short frames before tagging");
static const char vlanname[] = "vlan";
static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface");
@@ -1082,7 +1083,7 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m)
* devices that just discard such runts instead or mishandle
* them somehow.
*/
- if (soft_pad && p->if_type == IFT_ETHER) {
+ if (V_soft_pad && p->if_type == IFT_ETHER) {
static char pad[8]; /* just zeros */
int n;
diff --git a/sys/net/ifq.h b/sys/net/ifq.h
index b787ea1..d1fc3fe 100644
--- a/sys/net/ifq.h
+++ b/sys/net/ifq.h
@@ -41,6 +41,10 @@
#include <sys/lock.h> /* XXX */
#include <sys/mutex.h> /* struct ifqueue */
+/*
+ * Couple of ugly extra definitions that are required since ifq.h
+ * is splitted from if_var.h.
+ */
#define IF_DUNIT_NONE -1
#include <altq/if_altq.h>
@@ -245,13 +249,13 @@ do { \
mflags = (m)->m_flags; \
IFQ_ENQUEUE(&(ifp)->if_snd, m, err); \
if ((err) == 0) { \
- (ifp)->if_obytes += len + (adj); \
+ if_inc_counter((ifp), IFCOUNTER_OBYTES, len + (adj)); \
if (mflags & M_MCAST) \
- (ifp)->if_omcasts++; \
+ if_inc_counter((ifp), IFCOUNTER_OMCASTS, 1); \
if (((ifp)->if_drv_flags & IFF_DRV_OACTIVE) == 0) \
if_start(ifp); \
} else \
- ifp->if_oqdrops++; \
+ if_inc_counter((ifp), IFCOUNTER_OQDROPS, 1); \
} while (0)
#define IFQ_HANDOFF(ifp, m, err) \
@@ -318,7 +322,7 @@ drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m)
if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
IFQ_ENQUEUE(&ifp->if_snd, m, error);
if (error)
- ifp->if_oqdrops++;
+ if_inc_counter((ifp), IFCOUNTER_OQDROPS, 1);
return (error);
}
#endif
@@ -476,17 +480,5 @@ void if_qflush(struct ifnet *);
void ifq_init(struct ifaltq *, struct ifnet *ifp);
void ifq_delete(struct ifaltq *);
-#ifdef DEVICE_POLLING
-enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS };
-
-typedef int poll_handler_t(struct ifnet *ifp, enum poll_cmd cmd, int count);
-int ether_poll_register(poll_handler_t *h, struct ifnet *ifp);
-int ether_poll_deregister(struct ifnet *ifp);
-/* The following should be temporary, till all drivers use the driver API */
-typedef int poll_handler_drv_t(if_t ifh, enum poll_cmd cmd, int count);
-int ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh);
-int ether_poll_deregister_drv(if_t ifh);
-#endif /* DEVICE_POLLING */
-
#endif /* _KERNEL */
#endif /* !_NET_IFQ_H_ */
diff --git a/sys/net/radix.c b/sys/net/radix.c
index 62f57f8..0447cba 100644
--- a/sys/net/radix.c
+++ b/sys/net/radix.c
@@ -1122,9 +1122,6 @@ rn_inithead_internal(void **head, int off)
R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh));
if (rnh == 0)
return (0);
-#ifdef _KERNEL
- RADIX_NODE_HEAD_LOCK_INIT(rnh);
-#endif
*head = rnh;
t = rn_newpair(rn_zeros, off, rnh->rnh_nodes);
ttt = rnh->rnh_nodes + 2;
@@ -1181,6 +1178,18 @@ rn_inithead(void **head, int off)
return (1);
}
+static int
+rn_freeentry(struct radix_node *rn, void *arg)
+{
+ struct radix_node_head * const rnh = arg;
+ struct radix_node *x;
+
+ x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh);
+ if (x != NULL)
+ Free(x);
+ return (0);
+}
+
int
rn_detachhead(void **head)
{
@@ -1191,6 +1200,7 @@ rn_detachhead(void **head)
rnh = *head;
+ rn_walktree(rnh->rnh_masks, rn_freeentry, rnh->rnh_masks);
rn_detachhead_internal((void **)&rnh->rnh_masks);
rn_detachhead_internal(head);
return (1);
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
index 26d4e8e..c377e49 100644
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -2928,7 +2928,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_ARGS)
return (retval);
}
-#ifdef KTR
+#if defined(KTR) && (KTR_COMPILE & KTR_IGMPV3)
static const char *inm_modestrs[] = { "un", "in", "ex" };
@@ -3000,7 +3000,7 @@ inm_print(const struct in_multi *inm)
printf("%s: --- end inm %p ---\n", __func__, inm);
}
-#else /* !KTR */
+#else /* !KTR || !(KTR_COMPILE & KTR_IGMPV3) */
void
inm_print(const struct in_multi *inm)
@@ -3008,6 +3008,6 @@ inm_print(const struct in_multi *inm)
}
-#endif /* KTR */
+#endif /* KTR && (KTR_COMPILE & KTR_IGMPV3) */
RB_GENERATE(ip_msource_tree, ip_msource, ims_link, ip_msource_cmp);
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index bd5835e..09669e6 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -352,10 +352,12 @@ in_inithead(void **head, int off)
if (!rn_inithead(head, 32))
return 0;
+ rnh = *head;
+ RADIX_NODE_HEAD_LOCK_INIT(rnh);
+
if (off == 0) /* XXX MRT see above */
return 1; /* only do the rest for a real routing table */
- rnh = *head;
rnh->rnh_addaddr = in_addroute;
in_setmatchfunc(rnh, V_drop_redirect);
rnh->rnh_close = in_clsroute;
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 0073643..e5d32f0 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -149,6 +149,10 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW,
&VNET_NAME(icmpbmcastecho), 0,
"");
+static VNET_DEFINE(int, icmptstamprepl) = 1;
+#define V_icmptstamprepl VNET(icmptstamprepl)
+SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW,
+ &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets");
#ifdef ICMPPRINTFS
int icmpprintfs = 0;
@@ -545,6 +549,8 @@ icmp_input(struct mbuf **mp, int *offp, int proto)
goto reflect;
case ICMP_TSTAMP:
+ if (V_icmptstamprepl == 0)
+ break;
if (!V_icmpbmcastecho
&& (m->m_flags & (M_MCAST | M_BCAST)) != 0) {
ICMPSTAT_INC(icps_bmcasttstamp);
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index e7e74a4..01a4756 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1222,9 +1222,7 @@ found:
M_HASHTYPE_SET(m, rss_type);
m->m_flags |= M_FLOWID;
}
-#endif
-#ifdef RSS
/*
* Queue/dispatch for reprocessing.
*
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index f4ce7ec..827d25a 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -136,7 +136,9 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
struct rtentry *rte; /* cache for ro->ro_rt */
struct in_addr odst;
struct m_tag *fwd_tag = NULL;
+ uint32_t fibnum;
int have_ia_ref;
+ int needfiblookup;
#ifdef IPSEC
int no_route_but_check_spd = 0;
#endif
@@ -202,6 +204,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
* therefore we need restore gw if we're redoing lookup.
*/
gw = dst = (struct sockaddr_in *)&ro->ro_dst;
+ fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m);
again:
ia = NULL;
have_ia_ref = 0;
@@ -283,10 +286,9 @@ again:
#ifdef RADIX_MPATH
rtalloc_mpath_fib(ro,
ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr),
- inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m));
+ fibnum);
#else
- in_rtalloc_ign(ro, 0,
- inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m));
+ in_rtalloc_ign(ro, 0, fibnum);
#endif
rte = ro->ro_rt;
}
@@ -504,6 +506,7 @@ sendit:
goto done;
ip = mtod(m, struct ip *);
+ needfiblookup = 0;
/* See if destination IP address was changed by packet filter. */
if (odst.s_addr != ip->ip_dst.s_addr) {
@@ -529,9 +532,18 @@ sendit:
} else {
if (have_ia_ref)
ifa_free(&ia->ia_ifa);
- goto again; /* Redo the routing table lookup. */
+ needfiblookup = 1; /* Redo the routing table lookup. */
}
}
+ /* See if fib was changed by packet filter. */
+ if (fibnum != M_GETFIB(m)) {
+ m->m_flags |= M_SKIP_FIREWALL;
+ fibnum = M_GETFIB(m);
+ RO_RTFREE(ro);
+ needfiblookup = 1;
+ }
+ if (needfiblookup)
+ goto again;
/* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */
if (m->m_flags & M_FASTFWD_OURS) {
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 7adda33..65346f1 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1928,55 +1928,20 @@ tcp_signature_apply(void *fstate, void *data, u_int len)
}
/*
- * Compute TCP-MD5 hash of a TCP segment. (RFC2385)
- *
- * Parameters:
- * m pointer to head of mbuf chain
- * _unused
- * len length of TCP segment data, excluding options
- * optlen length of TCP segment options
- * buf pointer to storage for computed MD5 digest
- * direction direction of flow (IPSEC_DIR_INBOUND or OUTBOUND)
- *
- * We do this over ip, tcphdr, segment data, and the key in the SADB.
- * When called from tcp_input(), we can be sure that th_sum has been
- * zeroed out and verified already.
- *
- * Return 0 if successful, otherwise return -1.
- *
* XXX The key is retrieved from the system's PF_KEY SADB, by keying a
* search with the destination IP address, and a 'magic SPI' to be
* determined by the application. This is hardcoded elsewhere to 1179
- * right now. Another branch of this code exists which uses the SPD to
- * specify per-application flows but it is unstable.
- */
-int
-tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen,
- u_char *buf, u_int direction)
+*/
+struct secasvar *
+tcp_get_sav(struct mbuf *m, u_int direction)
{
union sockaddr_union dst;
-#ifdef INET
- struct ippseudo ippseudo;
-#endif
- MD5_CTX ctx;
- int doff;
- struct ip *ip;
-#ifdef INET
- struct ipovly *ipovly;
-#endif
struct secasvar *sav;
- struct tcphdr *th;
+ struct ip *ip;
#ifdef INET6
struct ip6_hdr *ip6;
- struct in6_addr in6;
char ip6buf[INET6_ADDRSTRLEN];
- uint32_t plen;
- uint16_t nhdr;
#endif
- u_short savecsum;
-
- KASSERT(m != NULL, ("NULL mbuf chain"));
- KASSERT(buf != NULL, ("NULL signature pointer"));
/* Extract the destination from the IP header in the mbuf. */
bzero(&dst, sizeof(union sockaddr_union));
@@ -2003,7 +1968,7 @@ tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen,
break;
#endif
default:
- return (EINVAL);
+ return (NULL);
/* NOTREACHED */
break;
}
@@ -2018,9 +1983,61 @@ tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen,
ip6_sprintf(ip6buf, &dst.sin6.sin6_addr) :
#endif
"(unsupported)"));
- return (EINVAL);
}
+ return (sav);
+}
+
+/*
+ * Compute TCP-MD5 hash of a TCP segment. (RFC2385)
+ *
+ * Parameters:
+ * m pointer to head of mbuf chain
+ * len length of TCP segment data, excluding options
+ * optlen length of TCP segment options
+ * buf pointer to storage for computed MD5 digest
+ * sav pointer to security assosiation
+ *
+ * We do this over ip, tcphdr, segment data, and the key in the SADB.
+ * When called from tcp_input(), we can be sure that th_sum has been
+ * zeroed out and verified already.
+ *
+ * Releases reference to SADB key before return.
+ *
+ * Return 0 if successful, otherwise return -1.
+ *
+ */
+int
+tcp_signature_do_compute(struct mbuf *m, int len, int optlen,
+ u_char *buf, struct secasvar *sav)
+{
+#ifdef INET
+ struct ippseudo ippseudo;
+#endif
+ MD5_CTX ctx;
+ int doff;
+ struct ip *ip;
+#ifdef INET
+ struct ipovly *ipovly;
+#endif
+ struct tcphdr *th;
+#ifdef INET6
+ struct ip6_hdr *ip6;
+ struct in6_addr in6;
+ uint32_t plen;
+ uint16_t nhdr;
+#endif
+ u_short savecsum;
+
+ KASSERT(m != NULL, ("NULL mbuf chain"));
+ KASSERT(buf != NULL, ("NULL signature pointer"));
+
+ /* Extract the destination from the IP header in the mbuf. */
+ ip = mtod(m, struct ip *);
+#ifdef INET6
+ ip6 = NULL; /* Make the compiler happy. */
+#endif
+
MD5Init(&ctx);
/*
* Step 1: Update MD5 hash with IP(v6) pseudo-header.
@@ -2077,7 +2094,7 @@ tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen,
break;
#endif
default:
- return (EINVAL);
+ return (-1);
/* NOTREACHED */
break;
}
@@ -2111,6 +2128,23 @@ tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen,
}
/*
+ * Compute TCP-MD5 hash of a TCP segment. (RFC2385)
+ *
+ * Return 0 if successful, otherwise return -1.
+ */
+int
+tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen,
+ u_char *buf, u_int direction)
+{
+ struct secasvar *sav;
+
+ if ((sav = tcp_get_sav(m, direction)) == NULL)
+ return (-1);
+
+ return (tcp_signature_do_compute(m, len, optlen, buf, sav));
+}
+
+/*
* Verify the TCP-MD5 hash of a TCP segment. (RFC2385)
*
* Parameters:
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 55a5044..17f85ed 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -122,7 +122,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, syncookies_only, CTLFLAG_RW,
static void syncache_drop(struct syncache *, struct syncache_head *);
static void syncache_free(struct syncache *);
static void syncache_insert(struct syncache *, struct syncache_head *);
-static int syncache_respond(struct syncache *);
+static int syncache_respond(struct syncache *, struct syncache_head *, int);
static struct socket *syncache_socket(struct syncache *, struct socket *,
struct mbuf *m);
static void syncache_timeout(struct syncache *sc, struct syncache_head *sch,
@@ -467,7 +467,7 @@ syncache_timer(void *xsch)
free(s, M_TCPLOG);
}
- (void) syncache_respond(sc);
+ syncache_respond(sc, sch, 1);
TCPSTAT_INC(tcps_sc_retransmitted);
syncache_timeout(sc, sch, 0);
}
@@ -1213,7 +1213,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
s, __func__);
free(s, M_TCPLOG);
}
- if (syncache_respond(sc) == 0) {
+ if (syncache_respond(sc, sch, 1) == 0) {
sc->sc_rxmits = 0;
syncache_timeout(sc, sch, 1);
TCPSTAT_INC(tcps_sndacks);
@@ -1325,11 +1325,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
}
#ifdef TCP_SIGNATURE
/*
- * If listening socket requested TCP digests, and received SYN
+ * If listening socket requested TCP digests, OR received SYN
* contains the option, flag this in the syncache so that
* syncache_respond() will do the right thing with the SYN+ACK.
- * XXX: Currently we always record the option by default and will
- * attempt to use it in syncache_respond().
*/
if (to->to_flags & TOF_SIGNATURE || ltflags & TF_SIGNATURE)
sc->sc_flags |= SCF_SIGNATURE;
@@ -1359,7 +1357,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
/*
* Do a standard 3-way handshake.
*/
- if (syncache_respond(sc) == 0) {
+ if (syncache_respond(sc, sch, 0) == 0) {
if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs)
syncache_free(sc);
else if (sc != &scs)
@@ -1387,7 +1385,7 @@ done:
}
static int
-syncache_respond(struct syncache *sc)
+syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked)
{
struct ip *ip = NULL;
struct mbuf *m;
@@ -1398,6 +1396,9 @@ syncache_respond(struct syncache *sc)
#ifdef INET6
struct ip6_hdr *ip6 = NULL;
#endif
+#ifdef TCP_SIGNATURE
+ struct secasvar *sav;
+#endif
hlen =
#ifdef INET6
@@ -1508,8 +1509,29 @@ syncache_respond(struct syncache *sc)
if (sc->sc_flags & SCF_SACK)
to.to_flags |= TOF_SACKPERM;
#ifdef TCP_SIGNATURE
- if (sc->sc_flags & SCF_SIGNATURE)
- to.to_flags |= TOF_SIGNATURE;
+ sav = NULL;
+ if (sc->sc_flags & SCF_SIGNATURE) {
+ sav = tcp_get_sav(m, IPSEC_DIR_OUTBOUND);
+ if (sav != NULL)
+ to.to_flags |= TOF_SIGNATURE;
+ else {
+
+ /*
+ * We've got SCF_SIGNATURE flag
+ * inherited from listening socket,
+ * but to SADB key for given source
+ * address. Assume signature is not
+ * required and remove signature flag
+ * instead of silently dropping
+ * connection.
+ */
+ if (locked == 0)
+ SCH_LOCK(sch);
+ sc->sc_flags &= ~SCF_SIGNATURE;
+ if (locked == 0)
+ SCH_UNLOCK(sch);
+ }
+ }
#endif
optlen = tcp_addoptions(&to, (u_char *)(th + 1));
@@ -1520,8 +1542,8 @@ syncache_respond(struct syncache *sc)
#ifdef TCP_SIGNATURE
if (sc->sc_flags & SCF_SIGNATURE)
- tcp_signature_compute(m, 0, 0, optlen,
- to.to_signature, IPSEC_DIR_OUTBOUND);
+ tcp_signature_do_compute(m, 0, optlen,
+ to.to_signature, sav);
#endif
#ifdef INET6
if (sc->sc_inc.inc_flags & INC_ISIPV6)
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index c2298fc..ac87f88 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -685,9 +685,15 @@ int tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *,
struct mbuf *, int);
void tcp_setpersist(struct tcpcb *);
#ifdef TCP_SIGNATURE
+struct secasvar;
+struct secasvar *tcp_get_sav(struct mbuf *, u_int);
+int tcp_signature_do_compute(struct mbuf *, int, int, u_char *,
+ struct secasvar *);
int tcp_signature_compute(struct mbuf *, int, int, int, u_char *, u_int);
int tcp_signature_verify(struct mbuf *, int, int, int, struct tcpopt *,
struct tcphdr *, u_int);
+int tcp_signature_check(struct mbuf *m, int off0, int tlen, int optlen,
+ struct tcpopt *to, struct tcphdr *th, u_int tcpbflag);
#endif
void tcp_slowtimo(void);
struct tcptemp *
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 584f390..92edcd1 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -444,9 +444,10 @@ udp_input(struct mbuf **mp, int *offp, int proto)
*/
len = ntohs((u_short)uh->uh_ulen);
ip_len = ntohs(ip->ip_len) - iphlen;
- if (proto == IPPROTO_UDPLITE && len == 0) {
+ if (proto == IPPROTO_UDPLITE && (len == 0 || len == ip_len)) {
/* Zero means checksum over the complete packet. */
- len = ip_len;
+ if (len == 0)
+ len = ip_len;
cscov_partial = 0;
}
if (ip_len != len) {
@@ -497,8 +498,16 @@ udp_input(struct mbuf **mp, int *offp, int proto)
m_freem(m);
return (IPPROTO_DONE);
}
- } else
- UDPSTAT_INC(udps_nosum);
+ } else {
+ if (proto == IPPROTO_UDP) {
+ UDPSTAT_INC(udps_nosum);
+ } else {
+ /* UDPLite requires a checksum */
+ /* XXX: What is the right UDPLite MIB counter here? */
+ m_freem(m);
+ return (IPPROTO_DONE);
+ }
+ }
pcbinfo = get_inpcbinfo(proto);
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
@@ -680,7 +689,7 @@ udp_input(struct mbuf **mp, int *offp, int proto)
struct udpcb *up;
up = intoudpcb(inp);
- if (up->u_rxcslen > len) {
+ if (up->u_rxcslen == 0 || up->u_rxcslen > len) {
INP_RUNLOCK(inp);
m_freem(m);
return (IPPROTO_DONE);
@@ -1017,7 +1026,7 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt)
INP_WLOCK(inp);
up = intoudpcb(inp);
KASSERT(up != NULL, ("%s: up == NULL", __func__));
- if (optval != 0 && optval < 8) {
+ if ((optval != 0 && optval < 8) || (optval > 65535)) {
INP_WUNLOCK(inp);
error = EINVAL;
break;
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 8fa4d95..5fbcf5f 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -647,6 +647,8 @@ struct ip6_hdr;
int in6_cksum_pseudo(struct ip6_hdr *, uint32_t, uint8_t, uint16_t);
int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t);
+int in6_cksum_partial(struct mbuf *, u_int8_t, u_int32_t, u_int32_t,
+ u_int32_t);
int in6_localaddr(struct in6_addr *);
int in6_localip(struct in6_addr *);
int in6_addrscope(const struct in6_addr *);
diff --git a/sys/netinet6/in6_cksum.c b/sys/netinet6/in6_cksum.c
index da8a2e6..ce1961a 100644
--- a/sys/netinet6/in6_cksum.c
+++ b/sys/netinet6/in6_cksum.c
@@ -145,9 +145,11 @@ in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t csum)
* off is an offset where TCP/UDP/ICMP6 header starts.
* len is a total length of a transport segment.
* (e.g. TCP header + TCP payload)
+ * cov is the number of bytes to be taken into account for the checksum
*/
int
-in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
+in6_cksum_partial(struct mbuf *m, u_int8_t nxt, u_int32_t off,
+ u_int32_t len, u_int32_t cov)
{
struct ip6_hdr *ip6;
u_int16_t *w, scope;
@@ -215,9 +217,9 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
}
w = (u_int16_t *)(mtod(m, u_char *) + off);
mlen = m->m_len - off;
- if (len < mlen)
- mlen = len;
- len -= mlen;
+ if (cov < mlen)
+ mlen = cov;
+ cov -= mlen;
/*
* Force to even boundary.
*/
@@ -273,7 +275,7 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
* Lastly calculate a summary of the rest of mbufs.
*/
- for (;m && len; m = m->m_next) {
+ for (;m && cov; m = m->m_next) {
if (m->m_len == 0)
continue;
w = mtod(m, u_int16_t *);
@@ -290,12 +292,12 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
sum += s_util.s;
w = (u_int16_t *)((char *)w + 1);
mlen = m->m_len - 1;
- len--;
+ cov--;
} else
mlen = m->m_len;
- if (len < mlen)
- mlen = len;
- len -= mlen;
+ if (cov < mlen)
+ mlen = cov;
+ cov -= mlen;
/*
* Force to even boundary.
*/
@@ -343,7 +345,7 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
} else if (mlen == -1)
s_util.c[0] = *(char *)w;
}
- if (len)
+ if (cov)
panic("in6_cksum: out of data");
if (mlen == -1) {
/* The last mbuf has odd # of bytes. Follow the
@@ -355,3 +357,9 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
REDUCE;
return (~sum & 0xffff);
}
+
+int
+in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
+{
+ return (in6_cksum_partial(m, nxt, off, len, len));
+}
diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
index 10e833a..c1caf2c 100644
--- a/sys/netinet6/in6_rmx.c
+++ b/sys/netinet6/in6_rmx.c
@@ -270,10 +270,12 @@ in6_inithead(void **head, int off)
if (!rn_inithead(head, offsetof(struct sockaddr_in6, sin6_addr) << 3))
return 0; /* See above */
+ rnh = *head;
+ RADIX_NODE_HEAD_LOCK_INIT(rnh);
+
if (off == 0) /* See above */
return 1; /* only do the rest for the real thing */
- rnh = *head;
rnh->rnh_addaddr = in6_addroute;
if (V__in6_rt_was_here == 0) {
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index fb8cedd..1b1b9d0 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -422,8 +422,6 @@ again2:
if (mcopy) {
u_long mtu;
#ifdef IPSEC
- struct secpolicy *sp;
- int ipsecerror;
size_t ipsechdrsiz;
#endif /* IPSEC */
@@ -436,15 +434,10 @@ again2:
* case, as we have the outgoing interface for
* encapsulated packet as "rt->rt_ifp".
*/
- sp = ipsec_getpolicybyaddr(mcopy, IPSEC_DIR_OUTBOUND,
- IP_FORWARDING, &ipsecerror);
- if (sp) {
- ipsechdrsiz = ipsec_hdrsiz(mcopy,
- IPSEC_DIR_OUTBOUND, NULL);
- if (ipsechdrsiz < mtu)
- mtu -= ipsechdrsiz;
- }
-
+ ipsechdrsiz = ipsec_hdrsiz(mcopy, IPSEC_DIR_OUTBOUND,
+ NULL);
+ if (ipsechdrsiz < mtu)
+ mtu -= ipsechdrsiz;
/*
* if mtu becomes less than minimum MTU,
* tell minimum MTU (and I'll need to fragment it).
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index c3e9501..298a0d3 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -255,6 +255,8 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
struct route_in6 *ro_pmtu = NULL;
int hdrsplit = 0;
int sw_csum, tso;
+ int needfiblookup;
+ uint32_t fibnum;
struct m_tag *fwd_tag = NULL;
ip6 = mtod(m, struct ip6_hdr *);
@@ -448,6 +450,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
if (ro->ro_rt == NULL)
(void )flowtable_lookup(AF_INET6, m, (struct route *)ro);
#endif
+ fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m);
again:
/*
* if specified, try to fill in the traffic class field.
@@ -489,7 +492,7 @@ again:
dst_sa.sin6_addr = ip6->ip6_dst;
}
error = in6_selectroute_fib(&dst_sa, opt, im6o, ro, &ifp,
- &rt, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m));
+ &rt, fibnum);
if (error != 0) {
if (ifp != NULL)
in6_ifstat_inc(ifp, ifs6_out_discard);
@@ -649,7 +652,7 @@ again:
/* Determine path MTU. */
if ((error = ip6_getpmtu(ro_pmtu, ro, ifp, &finaldst, &mtu,
- &alwaysfrag, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m))) != 0)
+ &alwaysfrag, fibnum)) != 0)
goto bad;
/*
@@ -727,6 +730,7 @@ again:
goto done;
ip6 = mtod(m, struct ip6_hdr *);
+ needfiblookup = 0;
/* See if destination IP address was changed by packet filter. */
if (!IN6_ARE_ADDR_EQUAL(&odst, &ip6->ip6_dst)) {
m->m_flags |= M_SKIP_FIREWALL;
@@ -747,8 +751,17 @@ again:
error = netisr_queue(NETISR_IPV6, m);
goto done;
} else
- goto again; /* Redo the routing table lookup. */
+ needfiblookup = 1; /* Redo the routing table lookup. */
}
+ /* See if fib was changed by packet filter. */
+ if (fibnum != M_GETFIB(m)) {
+ m->m_flags |= M_SKIP_FIREWALL;
+ fibnum = M_GETFIB(m);
+ RO_RTFREE(ro);
+ needfiblookup = 1;
+ }
+ if (needfiblookup)
+ goto again;
/* See if local, if yes, send it to netisr. */
if (m->m_flags & M_FASTFWD_OURS) {
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 14feb73..e36f778 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -227,21 +227,26 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
nxt = ip6->ip6_nxt;
cscov_partial = (nxt == IPPROTO_UDPLITE) ? 1 : 0;
- if (nxt == IPPROTO_UDPLITE && ulen == 0) {
+ if (nxt == IPPROTO_UDPLITE) {
/* Zero means checksum over the complete packet. */
- ulen = plen;
- cscov_partial = 0;
- }
- if (plen != ulen) {
- UDPSTAT_INC(udps_badlen);
- goto badunlocked;
- }
-
- /*
- * Checksum extended UDP header and data.
- */
- if (uh->uh_sum == 0) {
- if (ulen > plen || ulen < sizeof(struct udphdr)) {
+ if (ulen == 0)
+ ulen = plen;
+ if (ulen == plen)
+ cscov_partial = 0;
+ if ((ulen < sizeof(struct udphdr)) || (ulen > plen)) {
+ /* XXX: What is the right UDPLite MIB counter? */
+ goto badunlocked;
+ }
+ if (uh->uh_sum == 0) {
+ /* XXX: What is the right UDPLite MIB counter? */
+ goto badunlocked;
+ }
+ } else {
+ if ((ulen < sizeof(struct udphdr)) || (plen != ulen)) {
+ UDPSTAT_INC(udps_badlen);
+ goto badunlocked;
+ }
+ if (uh->uh_sum == 0) {
UDPSTAT_INC(udps_nosum);
goto badunlocked;
}
@@ -256,11 +261,11 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
m->m_pkthdr.csum_data);
uh_sum ^= 0xffff;
} else
- uh_sum = in6_cksum(m, nxt, off, ulen);
+ uh_sum = in6_cksum_partial(m, nxt, off, plen, ulen);
if (uh_sum != 0) {
UDPSTAT_INC(udps_badsum);
- goto badunlocked;
+ /*goto badunlocked;*/
}
/*
@@ -480,7 +485,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
INP_RLOCK_ASSERT(inp);
up = intoudpcb(inp);
if (cscov_partial) {
- if (up->u_rxcslen > ulen) {
+ if (up->u_rxcslen == 0 || up->u_rxcslen > ulen) {
INP_RUNLOCK(inp);
m_freem(m);
return (IPPROTO_DONE);
@@ -843,8 +848,8 @@ udp6_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr6,
ip6->ip6_dst = *faddr;
if (cscov_partial) {
- if ((udp6->uh_sum = in6_cksum(m, 0,
- sizeof(struct ip6_hdr), cscov)) == 0)
+ if ((udp6->uh_sum = in6_cksum_partial(m, nxt,
+ sizeof(struct ip6_hdr), plen, cscov)) == 0)
udp6->uh_sum = 0xffff;
} else {
udp6->uh_sum = in6_cksum_pseudo(ip6, plen, nxt, 0);
diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c
index a305bb6..b778fe5 100644
--- a/sys/netipsec/ipsec_input.c
+++ b/sys/netipsec/ipsec_input.c
@@ -391,7 +391,8 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav,
#endif /* DEV_ENC */
/* IP-in-IP encapsulation */
- if (prot == IPPROTO_IPIP) {
+ if (prot == IPPROTO_IPIP &&
+ saidx->mode != IPSEC_MODE_TRANSPORT) {
if (m->m_pkthdr.len - skip < sizeof(struct ip)) {
IPSEC_ISTAT(sproto, hdrops);
@@ -431,7 +432,8 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav,
}
#ifdef INET6
/* IPv6-in-IP encapsulation. */
- if (prot == IPPROTO_IPV6) {
+ if (prot == IPPROTO_IPV6 &&
+ saidx->mode != IPSEC_MODE_TRANSPORT) {
if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) {
IPSEC_ISTAT(sproto, hdrops);
@@ -502,6 +504,12 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav,
key_sa_recordxfer(sav, m); /* record data transfer */
+ /*
+ * In transport mode requeue decrypted mbuf back to IPv4 protocol
+ * handler. This is necessary to correctly expose rcvif.
+ */
+ if (saidx->mode == IPSEC_MODE_TRANSPORT)
+ prot = IPPROTO_IPIP;
#ifdef DEV_ENC
/*
* Pass the mbuf to enc0 for bpf and pfil.
diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c
index d88a761..b9f13b9 100644
--- a/sys/netpfil/pf/pf_table.c
+++ b/sys/netpfil/pf/pf_table.c
@@ -1853,14 +1853,10 @@ pfr_destroy_ktable(struct pfr_ktable *kt, int flushaddr)
pfr_clean_node_mask(kt, &addrq);
pfr_destroy_kentries(&addrq);
}
- if (kt->pfrkt_ip4 != NULL) {
- RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip4);
- free((caddr_t)kt->pfrkt_ip4, M_RTABLE);
- }
- if (kt->pfrkt_ip6 != NULL) {
- RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip6);
- free((caddr_t)kt->pfrkt_ip6, M_RTABLE);
- }
+ if (kt->pfrkt_ip4 != NULL)
+ rn_detachhead((void **)&kt->pfrkt_ip4);
+ if (kt->pfrkt_ip6 != NULL)
+ rn_detachhead((void **)&kt->pfrkt_ip6);
if (kt->pfrkt_shadow != NULL)
pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr);
if (kt->pfrkt_rs != NULL) {
diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 2a93269..7763493 100644
--- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -510,7 +510,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc)
ipoib_dbg(priv, "cm recv error "
"(status=%d, wrid=%d vend_err %x)\n",
wc->status, wr_id, wc->vendor_err);
- ++dev->if_ierrors;
+ if_inc_counter(dev, IFCOUNTER_IERRORS, 1);
if (has_srq)
goto repost;
else {
@@ -542,7 +542,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc)
* this packet and reuse the old buffer.
*/
ipoib_dbg(priv, "failed to allocate receive buffer %d\n", wr_id);
- ++dev->if_ierrors;
+ if_inc_counter(dev, IFCOUNTER_IERRORS, 1);
memcpy(&rx_ring[wr_id], &saverx, sizeof(saverx));
goto repost;
}
@@ -554,8 +554,8 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc)
ipoib_dma_mb(priv, mb, wc->byte_len);
- ++dev->if_ipackets;
- dev->if_ibytes += mb->m_pkthdr.len;
+ if_inc_counter(dev, IFCOUNTER_IPACKETS, 1);
+ if_inc_counter(dev, IFCOUNTER_IBYTES, mb->m_pkthdr.len);
mb->m_pkthdr.rcvif = dev;
proto = *mtod(mb, uint16_t *);
@@ -615,7 +615,7 @@ void ipoib_cm_send(struct ipoib_dev_priv *priv, struct mbuf *mb, struct ipoib_cm
if (unlikely(mb->m_pkthdr.len > tx->mtu)) {
ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
mb->m_pkthdr.len, tx->mtu);
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
ipoib_cm_mb_too_long(priv, mb, IPOIB_CM_MTU(tx->mtu));
return;
}
@@ -635,7 +635,7 @@ void ipoib_cm_send(struct ipoib_dev_priv *priv, struct mbuf *mb, struct ipoib_cm
tx_req->mb = mb;
if (unlikely(ipoib_dma_map_tx(priv->ca, (struct ipoib_tx_buf *)tx_req,
priv->cm.num_frags))) {
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
if (tx_req->mb)
m_freem(tx_req->mb);
return;
@@ -643,7 +643,7 @@ void ipoib_cm_send(struct ipoib_dev_priv *priv, struct mbuf *mb, struct ipoib_cm
if (unlikely(post_send(priv, tx, tx_req, tx->tx_head & (ipoib_sendq_size - 1)))) {
ipoib_warn(priv, "post_send failed\n");
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
ipoib_dma_unmap_tx(priv->ca, (struct ipoib_tx_buf *)tx_req);
m_freem(mb);
} else {
@@ -681,7 +681,7 @@ void ipoib_cm_handle_tx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc)
ipoib_dma_unmap_tx(priv->ca, (struct ipoib_tx_buf *)tx_req);
/* FIXME: is this right? Shouldn't we only increment on success? */
- ++dev->if_opackets;
+ if_inc_counter(dev, IFCOUNTER_OPACKETS, 1);
m_freem(tx_req->mb);
diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 10ac933..6005a39 100644
--- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -250,8 +250,8 @@ ipoib_ib_handle_rx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc)
ipoib_dma_unmap_rx(priv, &saverx);
ipoib_dma_mb(priv, mb, wc->byte_len);
- ++dev->if_ipackets;
- dev->if_ibytes += mb->m_pkthdr.len;
+ if_inc_counter(dev, IFCOUNTER_IPACKETS, 1);
+ if_inc_counter(dev, IFCOUNTER_IBYTES, mb->m_pkthdr.len);
mb->m_pkthdr.rcvif = dev;
m_adj(mb, sizeof(struct ib_grh) - INFINIBAND_ALEN);
eh = mtod(mb, struct ipoib_header *);
@@ -344,7 +344,7 @@ static void ipoib_ib_handle_tx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc)
ipoib_dma_unmap_tx(priv->ca, tx_req);
- ++dev->if_opackets;
+ if_inc_counter(dev, IFCOUNTER_OPACKETS, 1);
m_freem(tx_req->mb);
@@ -487,7 +487,7 @@ ipoib_send(struct ipoib_dev_priv *priv, struct mbuf *mb,
phead = mtod(mb, void *);
if (mb->m_len < hlen) {
ipoib_warn(priv, "linear data too small\n");
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
m_freem(mb);
return;
}
@@ -496,7 +496,7 @@ ipoib_send(struct ipoib_dev_priv *priv, struct mbuf *mb,
if (unlikely(mb->m_pkthdr.len - IPOIB_ENCAP_LEN > priv->mcast_mtu)) {
ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
mb->m_pkthdr.len, priv->mcast_mtu);
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
ipoib_cm_mb_too_long(priv, mb, priv->mcast_mtu);
return;
}
@@ -517,7 +517,7 @@ ipoib_send(struct ipoib_dev_priv *priv, struct mbuf *mb,
tx_req = &priv->tx_ring[priv->tx_head & (ipoib_sendq_size - 1)];
tx_req->mb = mb;
if (unlikely(ipoib_dma_map_tx(priv->ca, tx_req, IPOIB_UD_TX_SG))) {
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
if (tx_req->mb)
m_freem(tx_req->mb);
return;
@@ -539,7 +539,7 @@ ipoib_send(struct ipoib_dev_priv *priv, struct mbuf *mb,
priv->tx_head & (ipoib_sendq_size - 1), address->ah, qpn,
tx_req, phead, hlen))) {
ipoib_warn(priv, "post_send failed\n");
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
--priv->tx_outstanding;
ipoib_dma_unmap_tx(priv->ca, tx_req);
m_freem(mb);
diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 9f33797..5cd3441 100644
--- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -665,7 +665,7 @@ ipoib_unicast_send(struct mbuf *mb, struct ipoib_dev_priv *priv, struct ipoib_he
} else
__path_add(priv, path);
} else {
- ++priv->dev->if_oerrors;
+ if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1);
m_freem(mb);
}
@@ -680,7 +680,7 @@ ipoib_unicast_send(struct mbuf *mb, struct ipoib_dev_priv *priv, struct ipoib_he
path->queue.ifq_len < IPOIB_MAX_PATH_REC_QUEUE) {
_IF_ENQUEUE(&path->queue, mb);
} else {
- ++priv->dev->if_oerrors;
+ if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1);
m_freem(mb);
}
}
diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index e5c40bf..9c7bcec 100644
--- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -70,7 +70,7 @@ static void ipoib_mcast_free(struct ipoib_mcast *mcast)
tx_dropped = mcast->pkt_queue.ifq_len;
_IF_DRAIN(&mcast->pkt_queue); /* XXX Locking. */
- dev->if_oerrors += tx_dropped;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, tx_dropped);
kfree(mcast);
}
@@ -255,7 +255,7 @@ ipoib_mcast_sendonly_join_complete(int status,
mcast->mcmember.mgid.raw, ":", status);
/* Flush out any queued packets */
- priv->dev->if_oerrors += mcast->pkt_queue.ifq_len;
+ if_inc_counter(priv->dev, IFCOUNTER_OERRORS, mcast->pkt_queue.ifq_len);
_IF_DRAIN(&mcast->pkt_queue);
/* Clear the busy flag so we try again */
@@ -617,7 +617,7 @@ ipoib_mcast_send(struct ipoib_dev_priv *priv, void *mgid, struct mbuf *mb)
if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags) ||
!priv->broadcast ||
!test_bit(IPOIB_MCAST_FLAG_ATTACHED, &priv->broadcast->flags)) {
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
m_freem(mb);
return;
}
@@ -632,7 +632,7 @@ ipoib_mcast_send(struct ipoib_dev_priv *priv, void *mgid, struct mbuf *mb)
if (!mcast) {
ipoib_warn(priv, "unable to allocate memory for "
"multicast structure\n");
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
m_freem(mb);
goto out;
}
@@ -647,7 +647,7 @@ ipoib_mcast_send(struct ipoib_dev_priv *priv, void *mgid, struct mbuf *mb)
if (mcast->pkt_queue.ifq_len < IPOIB_MAX_MCAST_QUEUE) {
_IF_ENQUEUE(&mcast->pkt_queue, mb);
} else {
- ++dev->if_oerrors;
+ if_inc_counter(dev, IFCOUNTER_OERRORS, 1);
m_freem(mb);
}
diff --git a/sys/pc98/conf/GENERIC b/sys/pc98/conf/GENERIC
index 7386c1f..9882bc4 100644
--- a/sys/pc98/conf/GENERIC
+++ b/sys/pc98/conf/GENERIC
@@ -35,6 +35,7 @@ options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists
options UFS_DIRHASH # Improve performance on big directories
options UFS_GJOURNAL # Enable gjournal-based UFS journaling
+options QUOTA # Enable disk quotas for UFS
options MD_ROOT # MD is a potential root device
options NFSCL # New Network Filesystem Client
options NFSD # New Network Filesystem Server
@@ -60,15 +61,18 @@ options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
+options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed.
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
options AUDIT # Security event auditing
options CAPABILITY_MODE # Capsicum capability mode
options CAPABILITIES # Capsicum capabilities
options MAC # TrustedBSD MAC Framework
-options INCLUDE_CONFIG_FILE # Include this file in kernel
-options KDB # Kernel debugger related code
-options KDB_TRACE # Print a stack trace for a panic
+options INCLUDE_CONFIG_FILE # Include this file in kernel
+
+# Debugging support. Always need this:
+options KDB # Enable kernel debugger support.
+options KDB_TRACE # Print a stack trace for a panic.
# To make an SMP kernel, the next two lines are needed
#options SMP # Symmetric MultiProcessor Kernel
@@ -81,47 +85,48 @@ device pci
device fdc
# ATA controllers
-device ahci # AHCI-compatible SATA controllers
-device ata # Legacy ATA/SATA controllers
-options ATA_STATIC_ID # Static device numbering
-device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
-device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA
+device ahci # AHCI-compatible SATA controllers
+device ata # Legacy ATA/SATA controllers
+options ATA_STATIC_ID # Static device numbering
+device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
+device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA
# SCSI Controllers
-device adv # Advansys SCSI adapters
-device ahc # AHA2940 and onboard AIC7xxx devices
-device esp # AMD Am53C974 (Tekram DC-390(T))
-device isp # Qlogic family
-#device ncr # NCR/Symbios Logic
-device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
+device ahc # AHA2940 and onboard AIC7xxx devices
+device esp # AMD Am53C974 (Tekram DC-390(T))
+device isp # Qlogic family
+#device ncr # NCR/Symbios Logic
+device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
-device aic # PC-9801-100
-device ct # host adapter using WD33C93[ABC] chip (C bus)
+device adv # Advansys SCSI adapters
+device aic # PC-9801-100
+device ct # host adapter using WD33C93[ABC] chip
-device ncv # NCR 53C500
-device nsp # Workbit Ninja SCSI-3
-device stg # TMC 18C30/18C50
+device ncv # NCR 53C500
+device nsp # Workbit Ninja SCSI-3
+device stg # TMC 18C30/18C50
# ATA/SCSI peripherals
-device scbus # SCSI bus (required for ATA/SCSI)
-device ch # SCSI media changers
-device da # Direct Access (disks)
-device sa # Sequential Access (tape etc)
-device cd # CD
-device pass # Passthrough device (direct ATA/SCSI access)
-device ses # Enclosure Services (SES and SAF-TE)
+device scbus # SCSI bus (required for ATA/SCSI)
+device ch # SCSI media changers
+device da # Direct Access (disks)
+device sa # Sequential Access (tape etc)
+device cd # CD
+device pass # Passthrough device (direct ATA/SCSI access)
+device ses # Enclosure Services (SES and SAF-TE)
+#device ctl # CAM Target Layer
# keyboard driver
-device pckbd # PC98 keyboard
+device pckbd # PC98 keyboard
-device gdc # GDC screen
+device gdc # GDC screen
-device splash # Splash screen and screen saver support
+device splash # Splash screen and screen saver support
# syscons is the default console driver, resembling an SCO console
device sc
-#device agp # support several AGP chipsets
+#device agp # support several AGP chipsets
# Power management support (see NOTES for more options)
#device apm
@@ -133,114 +138,116 @@ device sc
# PCCARD (PCMCIA) support
# PCMCIA and cardbus bridge support
-device cbb # cardbus (yenta) bridge
-device pccard # PC Card (16-bit) bus
-device cardbus # CardBus (32-bit) bus
+device cbb # cardbus (yenta) bridge
+device pccard # PC Card (16-bit) bus
+device cardbus # CardBus (32-bit) bus
# Serial (COM) ports
#options COM_MULTIPORT
-#options COM_ESP # ESP98
-#device sio # 8250, 16[45]50, 8251 based serial ports
-device uart # Generic UART driver
+#options COM_ESP # ESP98
+#device sio # 8250, 16[45]50, 8251 based serial ports
+device uart # Generic UART driver
device mse
#device joy
-# NEW Parallel port
+# Parallel port
device ppc
-device ppbus # Parallel port bus (required)
-device lpt # Printer
-device ppi # Parallel port interface device
-#device vpo # Requires scbus and da
+device ppbus # Parallel port bus (required)
+device lpt # Printer
+device ppi # Parallel port interface device
+#device vpo # Requires scbus and da
# OLD Parallel port
#device olpt
+device puc # Multi I/O cards and multi-channel UARTs
+
# PCI Ethernet NICs.
-device de # DEC/Intel DC21x4x (``Tulip'')
-#device em # Intel PRO/1000 adapter Gigabit Ethernet Card
-device le # AMD Am7900 LANCE and Am79C9xx PCnet
-#device ti # Alteon Networks Tigon I/II gigabit Ethernet
-device txp # 3Com 3cR990 (``Typhoon'')
-device vx # 3Com 3c590, 3c595 (``Vortex'')
+device de # DEC/Intel DC21x4x (``Tulip'')
+#device em # Intel PRO/1000 Gigabit Ethernet Family
+device le # AMD Am7900 LANCE and Am79C9xx PCnet
+#device ti # Alteon Networks Tigon I/II gigabit Ethernet
+device txp # 3Com 3cR990 (``Typhoon'')
+device vx # 3Com 3c590, 3c595 (``Vortex'')
# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
-device miibus # MII bus support
-device bfe # Broadcom BCM440x 10/100 Ethernet
-#device bge # Broadcom BCM570xx Gigabit Ethernet
-device dc # DEC/Intel 21143 and various workalikes
-device fxp # Intel EtherExpress PRO/100B (82557, 82558)
-#device lge # Level 1 LXT1001 gigabit Ethernet
-#device nge # NatSemi DP83820 gigabit Ethernet
-device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le')
-device re # RealTek 8139C+/8169/8169S/8110S
-device rl # RealTek 8129/8139
-device sf # Adaptec AIC-6915 (``Starfire'')
-device sis # Silicon Integrated Systems SiS 900/SiS 7016
-#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
-device ste # Sundance ST201 (D-Link DFE-550TX)
-device tl # Texas Instruments ThunderLAN
-device tx # SMC EtherPower II (83c170 ``EPIC'')
-#device vge # VIA VT612x gigabit Ethernet
-device vr # VIA Rhine, Rhine II
-device wb # Winbond W89C840F
-device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
+device miibus # MII bus support
+device bfe # Broadcom BCM440x 10/100 Ethernet
+#device bge # Broadcom BCM570xx Gigabit Ethernet
+device dc # DEC/Intel 21143 and various workalikes
+device fxp # Intel EtherExpress PRO/100B (82557, 82558)
+#device lge # Level 1 LXT1001 gigabit Ethernet
+#device nge # NatSemi DP83820 gigabit Ethernet
+device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le')
+device re # RealTek 8139C+/8169/8169S/8110S
+device rl # RealTek 8129/8139
+device sf # Adaptec AIC-6915 (``Starfire'')
+device sis # Silicon Integrated Systems SiS 900/SiS 7016
+#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
+device ste # Sundance ST201 (D-Link DFE-550TX)
+device tl # Texas Instruments ThunderLAN
+device tx # SMC EtherPower II (83c170 ``EPIC'')
+#device vge # VIA VT612x gigabit Ethernet
+device vr # VIA Rhine, Rhine II
+device wb # Winbond W89C840F
+device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# ISA Ethernet NICs. pccard NICs included.
# 'device ed' requires 'device miibus'
-device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
-device ep # Etherlink III based cards
-device fe # Fujitsu MB8696x based cards
-device sn # SMC's 9000 series of Ethernet chips
+device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
+device ep # Etherlink III based cards
+device fe # Fujitsu MB8696x based cards
+device sn # SMC's 9000 series of Ethernet chips
device snc
-device xe # Xircom pccard Ethernet
+device xe # Xircom pccard Ethernet
# Wireless NIC cards
-#device wlan # 802.11 support
-#options IEEE80211_DEBUG # enable debug msgs
+#device wlan # 802.11 support
+#options IEEE80211_DEBUG # enable debug msgs
#options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
options IEEE80211_SUPPORT_MESH # enable 802.11s draft support
-#device wlan_wep # 802.11 WEP support
-#device wlan_ccmp # 802.11 CCMP support
-#device wlan_tkip # 802.11 TKIP support
-#device wlan_amrr # AMRR transmit rate control algorithm
-#device an # Aironet 4500/4800 802.11 wireless NICs.
-#device ath # Atheros NICs
-#device ath_pci # Atheros pci/cardbus glue
-#device ath_hal # pci/cardbus chip support
+#device wlan_wep # 802.11 WEP support
+#device wlan_ccmp # 802.11 CCMP support
+#device wlan_tkip # 802.11 TKIP support
+#device wlan_amrr # AMRR transmit rate control algorithm
+#device an # Aironet 4500/4800 802.11 wireless NICs.
+#device ath # Atheros NICs
+#device ath_pci # Atheros pci/cardbus glue
+#device ath_hal # pci/cardbus chip support
options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
-#device ath_rate_sample # SampleRate tx rate control for ath
-#device ral # Ralink Technology RT2500 wireless NICs.
-#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
-#device wl # Older non 802.11 Wavelan wireless NIC.
+#device ath_rate_sample # SampleRate tx rate control for ath
+#device ral # Ralink Technology RT2500 wireless NICs.
+#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
+#device wl # Older non 802.11 Wavelan wireless NIC.
# Pseudo devices.
-device loop # Network loopback
-device random # Entropy device
-device ether # Ethernet support
-device vlan # 802.1Q VLAN support
-device tun # Packet tunnel.
-device md # Memory "disks"
-device gif # IPv6 and IPv4 tunneling
-device faith # IPv6-to-IPv4 relaying (translation)
-device firmware # firmware assist module
+device loop # Network loopback
+device random # Entropy device
+device ether # Ethernet support
+device vlan # 802.1Q VLAN support
+device tun # Packet tunnel.
+device md # Memory "disks"
+device gif # IPv6 and IPv4 tunneling
+device faith # IPv6-to-IPv4 relaying (translation)
+device firmware # firmware assist module
# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
-device bpf # Berkeley packet filter
+device bpf # Berkeley packet filter
# USB support
-#options USB_DEBUG # enable debug msgs
-#device uhci # UHCI PCI->USB interface
-#device ohci # OHCI PCI->USB interface
-#device ehci # EHCI PCI->USB interface (USB 2.0)
-#device usb # USB Bus (required)
-#device ukbd # Keyboard
-#device umass # Disks/Mass storage - Requires scbus and da
+#options USB_DEBUG # enable debug msgs
+#device uhci # UHCI PCI->USB interface
+#device ohci # OHCI PCI->USB interface
+#device ehci # EHCI PCI->USB interface (USB 2.0)
+#device usb # USB Bus (required)
+#device ukbd # Keyboard
+#device umass # Disks/Mass storage - Requires scbus and da
# Sound support
-#device sound # Generic sound driver (required)
-#device snd_mss # Microsoft Sound System
-#device "snd_sb16" # Sound Blaster 16
-#device snd_sbc # Sound Blaster
+#device sound # Generic sound driver (required)
+#device snd_mss # Microsoft Sound System
+#device "snd_sb16" # Sound Blaster 16
+#device snd_sbc # Sound Blaster
diff --git a/sys/sys/fdcio.h b/sys/sys/fdcio.h
index e3ffc24..c4d39c2 100644
--- a/sys/sys/fdcio.h
+++ b/sys/sys/fdcio.h
@@ -181,27 +181,17 @@ enum fd_drivetype {
* XXX: should have been done 20 years ago to make sense.
*/
#ifdef PC98
-#define FDF_3_1722 21,2,0xFF,0x04,82,0,2,2,0x0C,2,0,FL_MFM
-#define FDF_3_1476 18,2,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM
#define FDF_3_1440 18,2,0xFF,0x1B,80,0,2,2,0x54,1,0,FL_MFM
#define FDF_3_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM
-#define FDF_3_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM
-#define FDF_3_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM
#define FDF_3_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM
#define FDF_3_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP
#define FDF_3_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM
#define FDF_3_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM
-#define FDF_3_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM
-#define FDF_3_1480 9,3,0xFF,0x35,82,0,0,2,0x47,1,0,FL_MFM
-#define FDF_3_1640 10,3,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM
#define FDF_5_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM
-#define FDF_5_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM
-#define FDF_5_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM
#define FDF_5_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM
#define FDF_5_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP
#define FDF_5_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM
#define FDF_5_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM
-#define FDF_5_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM
#else /* PC98 */
#define FDF_3_2880 36,2,0xFF,0x1B,80,0,FDC_1MBPS,002,0x4C,1,1,FL_MFM|FL_PERPND
#define FDF_3_1722 21,2,0xFF,0x04,82,0,FDC_500KBPS,2,0x0C,2,0,FL_MFM
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index acddfc0..6b07295 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -503,7 +503,9 @@ extern struct vnodeop_desc *vnodeop_descs[];
* reliable since if the thread sleeps between changing the lock
* state and checking it with the assert, some other thread could
* change the state. They are good enough for debugging a single
- * filesystem using a single-threaded test.
+ * filesystem using a single-threaded test. Note that the unreliability is
+ * limited to false negatives; efforts were made to ensure that false
+ * positives cannot occur.
*/
void assert_vi_locked(struct vnode *vp, const char *str);
void assert_vi_unlocked(struct vnode *vp, const char *str);
diff --git a/sys/x86/include/init.h b/sys/x86/include/init.h
index 47dc4f5..7cc6798 100644
--- a/sys/x86/include/init.h
+++ b/sys/x86/include/init.h
@@ -41,6 +41,7 @@ struct init_ops {
void (*parse_memmap)(caddr_t, vm_paddr_t *, int *);
u_int (*mp_bootaddress)(u_int);
int (*start_all_aps)(void);
+ void (*msi_init)(void);
};
extern struct init_ops init_ops;
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index 50f00d0..2aa18f5 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
#include <machine/smp.h>
#include <machine/specialreg.h>
+#include <x86/init.h>
#ifdef DDB
#include <sys/interrupt.h>
@@ -1438,7 +1439,7 @@ apic_setup_io(void *dummy __unused)
lapic_dump("BSP");
/* Enable the MSI "pic". */
- msi_init();
+ init_ops.msi_init();
}
SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL);
diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c
index ee2cd6b..140d13f 100644
--- a/sys/x86/xen/pv.c
+++ b/sys/x86/xen/pv.c
@@ -60,11 +60,13 @@ __FBSDID("$FreeBSD$");
#include <x86/init.h>
#include <machine/pc/bios.h>
#include <machine/smp.h>
+#include <machine/intr_machdep.h>
#include <xen/xen-os.h>
#include <xen/hypervisor.h>
#include <xen/xenstore/xenstorevar.h>
#include <xen/xen_pv.h>
+#include <xen/xen_msi.h>
#include <xen/interface/vcpu.h>
@@ -117,6 +119,7 @@ struct init_ops xen_init_ops = {
#ifdef SMP
.start_all_aps = xen_pv_start_all_aps,
#endif
+ .msi_init = xen_msi_init,
};
static struct bios_smap xen_smap[MAX_E820_ENTRIES];
diff --git a/sys/x86/xen/xen_intr.c b/sys/x86/xen/xen_intr.c
index 40b65f7..83f1db3 100644
--- a/sys/x86/xen/xen_intr.c
+++ b/sys/x86/xen/xen_intr.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <machine/intr_machdep.h>
#include <x86/apicvar.h>
+#include <x86/apicreg.h>
#include <machine/smp.h>
#include <machine/stdarg.h>
@@ -63,6 +64,7 @@ __FBSDID("$FreeBSD$");
#include <xen/evtchn/evtchnvar.h>
#include <dev/xen/xenpci/xenpcivar.h>
+#include <dev/pci/pcivar.h>
#ifdef DDB
#include <ddb/ddb.h>
@@ -1373,6 +1375,64 @@ xen_register_pirq(int vector, enum intr_trigger trig, enum intr_polarity pol)
}
int
+xen_register_msi(device_t dev, int vector, int count)
+{
+ struct physdev_map_pirq msi_irq;
+ struct xenisrc *isrc;
+ int ret;
+
+ memset(&msi_irq, 0, sizeof(msi_irq));
+ msi_irq.domid = DOMID_SELF;
+ msi_irq.type = count == 1 ?
+ MAP_PIRQ_TYPE_MSI_SEG : MAP_PIRQ_TYPE_MULTI_MSI;
+ msi_irq.index = -1;
+ msi_irq.pirq = -1;
+ msi_irq.bus = pci_get_bus(dev) | (pci_get_domain(dev) << 16);
+ msi_irq.devfn = (pci_get_slot(dev) << 3) | pci_get_function(dev);
+ msi_irq.entry_nr = count;
+
+ ret = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &msi_irq);
+ if (ret != 0)
+ return (ret);
+ if (count != msi_irq.entry_nr) {
+ panic("unable to setup all requested MSI vectors "
+ "(expected %d got %d)", count, msi_irq.entry_nr);
+ }
+
+ mtx_lock(&xen_intr_isrc_lock);
+ for (int i = 0; i < count; i++) {
+ isrc = xen_intr_alloc_isrc(EVTCHN_TYPE_PIRQ, vector + i);
+ KASSERT(isrc != NULL,
+ ("xen: unable to allocate isrc for interrupt"));
+ isrc->xi_pirq = msi_irq.pirq + i;
+ }
+ mtx_unlock(&xen_intr_isrc_lock);
+
+ return (0);
+}
+
+int
+xen_release_msi(int vector)
+{
+ struct physdev_unmap_pirq unmap;
+ struct xenisrc *isrc;
+ int ret;
+
+ isrc = (struct xenisrc *)intr_lookup_source(vector);
+ if (isrc == NULL)
+ return (ENXIO);
+
+ unmap.pirq = isrc->xi_pirq;
+ ret = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap);
+ if (ret != 0)
+ return (ret);
+
+ xen_intr_release_isrc(isrc);
+
+ return (0);
+}
+
+int
xen_intr_describe(xen_intr_handle_t port_handle, const char *fmt, ...)
{
char descr[MAXCOMLEN + 1];
diff --git a/sys/x86/xen/xen_msi.c b/sys/x86/xen/xen_msi.c
new file mode 100644
index 0000000..0f678b1
--- /dev/null
+++ b/sys/x86/xen/xen_msi.c
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2014 Roger Pau Monné <roger.pau@citrix.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/sx.h>
+#include <sys/systm.h>
+#include <x86/apicreg.h>
+#include <machine/cputypes.h>
+#include <machine/md_var.h>
+#include <machine/frame.h>
+#include <machine/intr_machdep.h>
+#include <x86/apicvar.h>
+#include <machine/specialreg.h>
+#include <dev/pci/pcivar.h>
+
+#include <xen/xen_intr.h>
+#include <xen/xen_msi.h>
+
+static struct mtx msi_lock;
+static int msi_last_irq;
+
+void
+xen_msi_init(void)
+{
+
+ mtx_init(&msi_lock, "msi", NULL, MTX_DEF);
+}
+
+/*
+ * Try to allocate 'count' interrupt sources with contiguous IDT values.
+ */
+int
+xen_msi_alloc(device_t dev, int count, int maxcount, int *irqs)
+{
+ int i, ret = 0;
+
+ mtx_lock(&msi_lock);
+
+ /* If we would exceed the max, give up. */
+ if ((msi_last_irq + count) > NUM_MSI_INTS) {
+ mtx_unlock(&msi_lock);
+ return (ENXIO);
+ }
+
+ /* Allocate MSI vectors */
+ for (i = 0; i < count; i++)
+ irqs[i] = FIRST_MSI_INT + msi_last_irq++;
+
+ mtx_unlock(&msi_lock);
+
+ ret = xen_register_msi(dev, irqs[0], count);
+ if (ret != 0)
+ return (ret);
+
+ for (i = 0; i < count; i++)
+ nexus_add_irq(irqs[i]);
+
+ return (0);
+}
+
+int
+xen_msi_release(int *irqs, int count)
+{
+ int i, ret;
+
+ for (i = 0; i < count; i++) {
+ ret = xen_release_msi(irqs[i]);
+ if (ret != 0)
+ return (ret);
+ }
+
+ return (0);
+}
+
+int
+xen_msi_map(int irq, uint64_t *addr, uint32_t *data)
+{
+
+ return (0);
+}
+
+int
+xen_msix_alloc(device_t dev, int *irq)
+{
+
+ return (ENXIO);
+}
+
+int
+xen_msix_release(int irq)
+{
+
+ return (ENOENT);
+}
diff --git a/sys/x86/xen/xen_nexus.c b/sys/x86/xen/xen_nexus.c
index e4634f9..1baeb7d 100644
--- a/sys/x86/xen/xen_nexus.c
+++ b/sys/x86/xen/xen_nexus.c
@@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$");
#include <xen/xen-os.h>
#include <xen/xen_intr.h>
+#include <xen/xen_msi.h>
+
+#include "pcib_if.h"
/*
* Xen nexus(4) driver.
@@ -111,6 +114,41 @@ nexus_xen_config_intr(device_t dev, int irq, enum intr_trigger trig,
return (intr_config_intr(irq, trig, pol));
}
+static int
+nexus_xen_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+
+ return (xen_msix_alloc(dev, irq));
+}
+
+static int
+nexus_xen_release_msix(device_t pcib, device_t dev, int irq)
+{
+
+ return (xen_msix_release(irq));
+}
+
+static int
+nexus_xen_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs)
+{
+
+ return (xen_msi_alloc(dev, count, maxcount, irqs));
+}
+
+static int
+nexus_xen_release_msi(device_t pcib, device_t dev, int count, int *irqs)
+{
+
+ return (xen_msi_release(irqs, count));
+}
+
+static int
+nexus_xen_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data)
+{
+
+ return (xen_msi_map(irq, addr, data));
+}
+
static device_method_t nexus_xen_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, nexus_xen_probe),
@@ -119,6 +157,13 @@ static device_method_t nexus_xen_methods[] = {
/* INTR */
DEVMETHOD(bus_config_intr, nexus_xen_config_intr),
+ /* MSI */
+ DEVMETHOD(pcib_alloc_msi, nexus_xen_alloc_msi),
+ DEVMETHOD(pcib_release_msi, nexus_xen_release_msi),
+ DEVMETHOD(pcib_alloc_msix, nexus_xen_alloc_msix),
+ DEVMETHOD(pcib_release_msix, nexus_xen_release_msix),
+ DEVMETHOD(pcib_map_msi, nexus_xen_map_msi),
+
{ 0, 0 }
};
diff --git a/sys/x86/xen/xen_pci.c b/sys/x86/xen/xen_pci.c
new file mode 100644
index 0000000..d4a427d
--- /dev/null
+++ b/sys/x86/xen/xen_pci.c
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2014 Roger Pau Monné <roger.pau@citrix.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+
+#include <sys/pciio.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pci_private.h>
+
+#include <xen/xen-os.h>
+#include <xen/hypervisor.h>
+
+#include "pcib_if.h"
+#include "pci_if.h"
+
+static int xen_pci_probe(device_t dev);
+
+static void xen_pci_enable_msi_method(device_t dev, device_t child,
+ uint64_t address, uint16_t data);
+static void xen_pci_disable_msi_method(device_t dev, device_t child);
+static void xen_pci_child_added_method(device_t dev, device_t child);
+
+static device_method_t xen_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, xen_pci_probe),
+
+ /* PCI interface overwrites */
+ DEVMETHOD(pci_enable_msi, xen_pci_enable_msi_method),
+ DEVMETHOD(pci_disable_msi, xen_pci_disable_msi_method),
+ DEVMETHOD(pci_child_added, xen_pci_child_added_method),
+
+ DEVMETHOD_END
+};
+
+static devclass_t pci_devclass;
+
+DECLARE_CLASS(acpi_pci_driver);
+DEFINE_CLASS_1(pci, xen_pci_driver, xen_pci_methods, sizeof(struct pci_softc),
+ acpi_pci_driver);
+DRIVER_MODULE(xen_pci, pcib, xen_pci_driver, pci_devclass, 0, 0);
+MODULE_DEPEND(xen_pci, pci, 1, 1, 1);
+MODULE_DEPEND(xen_pci, acpi, 1, 1, 1);
+MODULE_VERSION(xen_pci, 1);
+
+static int
+xen_pci_probe(device_t dev)
+{
+
+ device_set_desc(dev, "Xen PCI bus");
+
+ if (!xen_pv_domain())
+ return (ENXIO);
+
+ return (BUS_PROBE_SPECIFIC);
+}
+
+static void
+xen_pci_enable_msi_method(device_t dev, device_t child, uint64_t address,
+ uint16_t data)
+{
+ struct pci_devinfo *dinfo = device_get_ivars(child);
+ struct pcicfg_msi *msi = &dinfo->cfg.msi;
+
+ /* Enable MSI in the control register. */
+ msi->msi_ctrl |= PCIM_MSICTRL_MSI_ENABLE;
+ pci_write_config(child, msi->msi_location + PCIR_MSI_CTRL,
+ msi->msi_ctrl, 2);
+}
+
+static void
+xen_pci_disable_msi_method(device_t dev, device_t child)
+{
+ struct pci_devinfo *dinfo = device_get_ivars(child);
+ struct pcicfg_msi *msi = &dinfo->cfg.msi;
+
+ msi->msi_ctrl &= ~PCIM_MSICTRL_MSI_ENABLE;
+ pci_write_config(child, msi->msi_location + PCIR_MSI_CTRL,
+ msi->msi_ctrl, 2);
+}
+
+static void
+xen_pci_child_added_method(device_t dev, device_t child)
+{
+ struct pci_devinfo *dinfo;
+ struct physdev_pci_device_add add_pci;
+ int error;
+
+ dinfo = device_get_ivars(child);
+ KASSERT((dinfo != NULL),
+ ("xen_pci_add_child_method called with NULL dinfo"));
+
+ bzero(&add_pci, sizeof(add_pci));
+ add_pci.seg = dinfo->cfg.domain;
+ add_pci.bus = dinfo->cfg.bus;
+ add_pci.devfn = (dinfo->cfg.slot << 3) | dinfo->cfg.func;
+ error = HYPERVISOR_physdev_op(PHYSDEVOP_pci_device_add, &add_pci);
+ if (error)
+ panic("unable to add device bus %u devfn %u error: %d\n",
+ add_pci.bus, add_pci.devfn, error);
+}
diff --git a/sys/xen/interface/physdev.h b/sys/xen/interface/physdev.h
index b78eeba..56b8be0 100644
--- a/sys/xen/interface/physdev.h
+++ b/sys/xen/interface/physdev.h
@@ -151,6 +151,7 @@ DEFINE_XEN_GUEST_HANDLE(physdev_irq_t);
#define MAP_PIRQ_TYPE_GSI 0x1
#define MAP_PIRQ_TYPE_UNKNOWN 0x2
#define MAP_PIRQ_TYPE_MSI_SEG 0x3
+#define MAP_PIRQ_TYPE_MULTI_MSI 0x4
#define PHYSDEVOP_map_pirq 13
struct physdev_map_pirq {
diff --git a/sys/xen/xen_intr.h b/sys/xen/xen_intr.h
index a1ff666..a29414d 100644
--- a/sys/xen/xen_intr.h
+++ b/sys/xen/xen_intr.h
@@ -224,4 +224,26 @@ void xen_intr_signal(xen_intr_handle_t handle);
*/
evtchn_port_t xen_intr_port(xen_intr_handle_t handle);
+/**
+ * Setup MSI vector interrupt(s).
+ *
+ * \param dev The device that requests the binding.
+ *
+ * \param vector Requested initial vector to bind the MSI interrupt(s) to.
+ *
+ * \param count Number of vectors to allocate.
+ *
+ * \returns 0 on success, otherwise an errno.
+ */
+int xen_register_msi(device_t dev, int vector, int count);
+
+/**
+ * Teardown a MSI vector interrupt.
+ *
+ * \param vector Requested vector to release.
+ *
+ * \returns 0 on success, otherwise an errno.
+ */
+int xen_release_msi(int vector);
+
#endif /* _XEN_INTR_H_ */
diff --git a/sys/xen/xen_msi.h b/sys/xen/xen_msi.h
new file mode 100644
index 0000000..baec4c1a
--- /dev/null
+++ b/sys/xen/xen_msi.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014 Roger Pau Monné <roger.pau@citrix.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __XEN_MSI_H__
+#define __XEN_MSI_H__
+
+void xen_msi_init(void);
+int xen_msi_map(int irq, uint64_t *addr, uint32_t *data);
+int xen_msi_alloc(device_t dev, int count, int maxcount, int *irqs);
+int xen_msi_release(int *irqs, int count);
+int xen_msix_alloc(device_t dev, int *irq);
+int xen_msix_release(int irq);
+
+#endif /* !__XEN_MSI_H__ */ \ No newline at end of file
diff --git a/sys/xen/xenstore/xenstore_internal.h b/sys/xen/xenstore/xenstore_internal.h
index 0398aef..3355c27 100644
--- a/sys/xen/xenstore/xenstore_internal.h
+++ b/sys/xen/xenstore/xenstore_internal.h
@@ -32,8 +32,5 @@
* $FreeBSD$
*/
-/* Initialize support for userspace access to the XenStore. */
-void xs_dev_init(void);
-
/* Used by the XenStore character device to borrow kernel's store connection. */
int xs_dev_request_and_reply(struct xsd_sockmsg *msg, void **result);
diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py
index 4335574..e592514 100644
--- a/tools/sched/schedgraph.py
+++ b/tools/sched/schedgraph.py
@@ -856,7 +856,7 @@ class EventSource:
return (Y_EVENTSOURCE)
def eventat(self, i):
- if (i >= len(self.events)):
+ if (i >= len(self.events) or i < 0):
return (None)
event = self.events[i]
return (event)
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index 5f4500b..6e072d6 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -367,6 +367,7 @@ writefile(time_t runtimer, char queue)
if (export)
{
+ (void)fputs("export ", fp);
fwrite(*atenv, sizeof(char), eqp-*atenv, fp);
for(ap = eqp;*ap != '\0'; ap++)
{
@@ -389,8 +390,6 @@ writefile(time_t runtimer, char queue)
fputc(*ap, fp);
}
}
- fputs("; export ", fp);
- fwrite(*atenv, sizeof(char), eqp-*atenv -1, fp);
fputc('\n', fp);
}
diff --git a/usr.bin/mkimg/Makefile b/usr.bin/mkimg/Makefile
index 1152ce3..563ca58 100644
--- a/usr.bin/mkimg/Makefile
+++ b/usr.bin/mkimg/Makefile
@@ -6,6 +6,8 @@ PROG= mkimg
SRCS= format.c image.c mkimg.c scheme.c
MAN= mkimg.1
+MKIMG_VERSION=20141001
+CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION}
CFLAGS+=-DSPARSE_WRITE
# List of formats to support
diff --git a/usr.bin/mkimg/image.c b/usr.bin/mkimg/image.c
index f448d98..3e7c7d2 100644
--- a/usr.bin/mkimg/image.c
+++ b/usr.bin/mkimg/image.c
@@ -27,71 +27,462 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/mman.h>
+#include <sys/queue.h>
+#include <sys/stat.h>
#include <sys/types.h>
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <paths.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include "image.h"
#include "mkimg.h"
-#define BUFFER_SIZE (1024*1024)
+struct chunk {
+ STAILQ_ENTRY(chunk) ch_list;
+ size_t ch_size; /* Size of chunk in bytes. */
+ lba_t ch_block; /* Block address in image. */
+ union {
+ struct {
+ off_t ofs; /* Offset in backing file. */
+ int fd; /* FD of backing file. */
+ } file;
+ struct {
+ void *ptr; /* Pointer to data in memory */
+ } mem;
+ } ch_u;
+ u_int ch_type;
+#define CH_TYPE_ZEROES 0 /* Chunk is a gap (no data). */
+#define CH_TYPE_FILE 1 /* File-backed chunk. */
+#define CH_TYPE_MEMORY 2 /* Memory-backed chunk */
+};
+
+static STAILQ_HEAD(chunk_head, chunk) image_chunks;
+static u_int image_nchunks;
+
+static char image_swap_file[PATH_MAX];
+static int image_swap_fd = -1;
+static u_int image_swap_pgsz;
+static off_t image_swap_size;
-static char image_tmpfile[PATH_MAX];
-static int image_fd = -1;
static lba_t image_size;
-static void
-cleanup(void)
+static int
+is_empty_sector(void *buf)
{
+ uint64_t *p = buf;
+ size_t n, max;
+
+ assert(((uintptr_t)p & 3) == 0);
- if (image_fd != -1)
- close(image_fd);
- unlink(image_tmpfile);
+ max = secsz / sizeof(uint64_t);
+ for (n = 0; n < max; n++) {
+ if (p[n] != 0UL)
+ return (0);
+ }
+ return (1);
}
-int
-image_copyin(lba_t blk, int fd, uint64_t *sizep)
+/*
+ * Swap file handlng.
+ */
+
+static off_t
+image_swap_alloc(size_t size)
+{
+ off_t ofs;
+ size_t unit;
+
+ unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz;
+ assert((unit & (unit - 1)) == 0);
+
+ size = (size + unit - 1) & ~(unit - 1);
+
+ ofs = image_swap_size;
+ image_swap_size += size;
+ if (ftruncate(image_swap_fd, image_swap_size) == -1) {
+ image_swap_size = ofs;
+ ofs = -1LL;
+ }
+ return (ofs);
+}
+
+/*
+ * Image chunk handling.
+ */
+
+static struct chunk *
+image_chunk_find(lba_t blk)
+{
+ static struct chunk *last = NULL;
+ struct chunk *ch;
+
+ ch = (last != NULL && last->ch_block <= blk)
+ ? last : STAILQ_FIRST(&image_chunks);
+ while (ch != NULL) {
+ if (ch->ch_block <= blk &&
+ (lba_t)(ch->ch_block + (ch->ch_size / secsz)) > blk) {
+ last = ch;
+ break;
+ }
+ ch = STAILQ_NEXT(ch, ch_list);
+ }
+ return (ch);
+}
+
+static size_t
+image_chunk_grow(struct chunk *ch, size_t sz)
+{
+ size_t dsz, newsz;
+
+ newsz = ch->ch_size + sz;
+ if (newsz > ch->ch_size) {
+ ch->ch_size = newsz;
+ return (0);
+ }
+ /* We would overflow -- create new chunk for remainder. */
+ dsz = SIZE_MAX - ch->ch_size;
+ assert(dsz < sz);
+ ch->ch_size = SIZE_MAX;
+ return (sz - dsz);
+}
+
+static struct chunk *
+image_chunk_memory(struct chunk *ch, lba_t blk)
+{
+ struct chunk *new;
+ void *ptr;
+
+ ptr = calloc(1, secsz);
+ if (ptr == NULL)
+ return (NULL);
+
+ if (ch->ch_block < blk) {
+ new = malloc(sizeof(*new));
+ if (new == NULL) {
+ free(ptr);
+ return (NULL);
+ }
+ memcpy(new, ch, sizeof(*new));
+ ch->ch_size = (blk - ch->ch_block) * secsz;
+ new->ch_block = blk;
+ new->ch_size -= ch->ch_size;
+ STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list);
+ image_nchunks++;
+ ch = new;
+ }
+
+ if (ch->ch_size > secsz) {
+ new = malloc(sizeof(*new));
+ if (new == NULL) {
+ free(ptr);
+ return (NULL);
+ }
+ memcpy(new, ch, sizeof(*new));
+ ch->ch_size = secsz;
+ new->ch_block++;
+ new->ch_size -= secsz;
+ STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list);
+ image_nchunks++;
+ }
+
+ ch->ch_type = CH_TYPE_MEMORY;
+ ch->ch_u.mem.ptr = ptr;
+ return (ch);
+}
+
+static int
+image_chunk_skipto(lba_t to)
+{
+ struct chunk *ch;
+ lba_t from;
+ size_t sz;
+
+ ch = STAILQ_LAST(&image_chunks, chunk, ch_list);
+ from = (ch != NULL) ? ch->ch_block + (ch->ch_size / secsz) : 0LL;
+
+ assert(from <= to);
+
+ /* Nothing to do? */
+ if (from == to)
+ return (0);
+ /* Avoid bugs due to overflows. */
+ if ((uintmax_t)(to - from) > (uintmax_t)(SIZE_MAX / secsz))
+ return (EFBIG);
+ sz = (to - from) * secsz;
+ if (ch != NULL && ch->ch_type == CH_TYPE_ZEROES) {
+ sz = image_chunk_grow(ch, sz);
+ if (sz == 0)
+ return (0);
+ from = ch->ch_block + (ch->ch_size / secsz);
+ }
+ ch = malloc(sizeof(*ch));
+ if (ch == NULL)
+ return (ENOMEM);
+ memset(ch, 0, sizeof(*ch));
+ ch->ch_block = from;
+ ch->ch_size = sz;
+ ch->ch_type = CH_TYPE_ZEROES;
+ STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list);
+ image_nchunks++;
+ return (0);
+}
+
+static int
+image_chunk_append(lba_t blk, size_t sz, off_t ofs, int fd)
+{
+ struct chunk *ch;
+
+ ch = STAILQ_LAST(&image_chunks, chunk, ch_list);
+ if (ch != NULL && ch->ch_type == CH_TYPE_FILE) {
+ if (fd == ch->ch_u.file.fd &&
+ blk == (lba_t)(ch->ch_block + (ch->ch_size / secsz)) &&
+ ofs == (off_t)(ch->ch_u.file.ofs + ch->ch_size)) {
+ sz = image_chunk_grow(ch, sz);
+ if (sz == 0)
+ return (0);
+ blk = ch->ch_block + (ch->ch_size / secsz);
+ ofs = ch->ch_u.file.ofs + ch->ch_size;
+ }
+ }
+ ch = malloc(sizeof(*ch));
+ if (ch == NULL)
+ return (ENOMEM);
+ memset(ch, 0, sizeof(*ch));
+ ch->ch_block = blk;
+ ch->ch_size = sz;
+ ch->ch_type = CH_TYPE_FILE;
+ ch->ch_u.file.ofs = ofs;
+ ch->ch_u.file.fd = fd;
+ STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list);
+ image_nchunks++;
+ return (0);
+}
+
+static int
+image_chunk_copyin(lba_t blk, void *buf, size_t sz, off_t ofs, int fd)
+{
+ uint8_t *p = buf;
+ int error;
+
+ error = 0;
+ sz = (sz + secsz - 1) & ~(secsz - 1);
+ while (!error && sz > 0) {
+ if (is_empty_sector(p))
+ error = image_chunk_skipto(blk + 1);
+ else
+ error = image_chunk_append(blk, secsz, ofs, fd);
+ blk++;
+ p += secsz;
+ sz -= secsz;
+ ofs += secsz;
+ }
+ return (error);
+}
+
+/*
+ * File mapping support.
+ */
+
+static void *
+image_file_map(int fd, off_t ofs, size_t sz)
+{
+ void *ptr;
+ size_t unit;
+ int flags, prot;
+
+ unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz;
+ assert((unit & (unit - 1)) == 0);
+
+ flags = MAP_NOCORE | MAP_NOSYNC | MAP_SHARED;
+ /* Allow writing to our swap file only. */
+ prot = PROT_READ | ((fd == image_swap_fd) ? PROT_WRITE : 0);
+ sz = (sz + unit - 1) & ~(unit - 1);
+ ptr = mmap(NULL, sz, prot, flags, fd, ofs);
+ return ((ptr == MAP_FAILED) ? NULL : ptr);
+}
+
+static int
+image_file_unmap(void *buffer, size_t sz)
+{
+ size_t unit;
+
+ unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz;
+ sz = (sz + unit - 1) & ~(unit - 1);
+ munmap(buffer, sz);
+ return (0);
+}
+
+/*
+ * Input/source file handling.
+ */
+
+static int
+image_copyin_stream(lba_t blk, int fd, uint64_t *sizep)
{
char *buffer;
uint64_t bytesize;
- ssize_t bcnt, rdsz;
- int error, partial;
+ off_t swofs;
+ size_t iosz;
+ ssize_t rdsz;
+ int error;
- assert(BUFFER_SIZE % secsz == 0);
+ /*
+ * This makes sure we're doing I/O in multiples of the page
+ * size as well as of the sector size. 2MB is the minimum
+ * by virtue of secsz at least 512 bytes and the page size
+ * at least 4K bytes.
+ */
+ iosz = secsz * image_swap_pgsz;
- buffer = malloc(BUFFER_SIZE);
- if (buffer == NULL)
- return (ENOMEM);
bytesize = 0;
- partial = 0;
- while (1) {
- rdsz = read(fd, buffer, BUFFER_SIZE);
- if (rdsz <= 0) {
- error = (rdsz < 0) ? errno : 0;
- break;
- }
- if (partial)
- abort();
- bytesize += rdsz;
- bcnt = (rdsz + secsz - 1) / secsz;
- error = image_write(blk, buffer, bcnt);
+ do {
+ swofs = image_swap_alloc(iosz);
+ if (swofs == -1LL)
+ return (errno);
+ buffer = image_file_map(image_swap_fd, swofs, iosz);
+ if (buffer == NULL)
+ return (errno);
+ rdsz = read(fd, buffer, iosz);
+ if (rdsz > 0)
+ error = image_chunk_copyin(blk, buffer, rdsz, swofs,
+ image_swap_fd);
+ else if (rdsz < 0)
+ error = errno;
+ else
+ error = 0;
+ image_file_unmap(buffer, iosz);
+ /* XXX should we relinguish unused swap space? */
if (error)
+ return (error);
+
+ bytesize += rdsz;
+ blk += (rdsz + secsz - 1) / secsz;
+ } while (rdsz > 0);
+
+ if (sizep != NULL)
+ *sizep = bytesize;
+ return (0);
+}
+
+static int
+image_copyin_mapped(lba_t blk, int fd, uint64_t *sizep)
+{
+ off_t cur, data, end, hole, pos;
+ void *buf;
+ uint64_t bytesize;
+ size_t iosz, sz;
+ int error;
+
+ /*
+ * We'd like to know the size of the file and we must
+ * be able to seek in order to mmap(2). If this isn't
+ * possible, then treat the file as a stream/pipe.
+ */
+ end = lseek(fd, 0L, SEEK_END);
+ if (end == -1L)
+ return (image_copyin_stream(blk, fd, sizep));
+
+ /*
+ * We need the file opened for the duration and our
+ * caller is going to close the file. Make a dup(2)
+ * so that control the faith of the descriptor.
+ */
+ fd = dup(fd);
+ if (fd == -1)
+ return (errno);
+
+ iosz = secsz * image_swap_pgsz;
+
+ bytesize = 0;
+ cur = pos = 0;
+ error = 0;
+ while (!error && cur < end) {
+ hole = lseek(fd, cur, SEEK_HOLE);
+ data = lseek(fd, cur, SEEK_DATA);
+
+ /*
+ * Treat the entire file as data if sparse files
+ * are not supported by the underlying file system.
+ */
+ if (hole == -1 && data == -1) {
+ data = cur;
+ hole = end;
+ }
+
+ if (cur == hole && data > hole) {
+ hole = pos;
+ pos = data & ~((uint64_t)secsz - 1);
+
+ blk += (pos - hole) / secsz;
+ error = image_chunk_skipto(blk);
+
+ bytesize += pos - hole;
+ cur = data;
+ } else if (cur == data && hole > data) {
+ data = pos;
+ pos = (hole + secsz - 1) & ~((uint64_t)secsz - 1);
+
+ while (data < pos) {
+ sz = (pos - data > (off_t)iosz)
+ ? iosz : (size_t)(pos - data);
+
+ buf = image_file_map(fd, data, sz);
+ if (buf != NULL) {
+ error = image_chunk_copyin(blk, buf,
+ sz, data, fd);
+ image_file_unmap(buf, sz);
+ } else
+ error = errno;
+
+ blk += sz / secsz;
+ bytesize += sz;
+ data += sz;
+ }
+ cur = hole;
+ } else {
+ /*
+ * I don't know what this means or whether it
+ * can happen at all...
+ */
+ error = EDOOFUS;
break;
- blk += bcnt;
- partial = ((ssize_t)(bcnt * secsz) != rdsz) ? 1 : 0;
+ }
}
- free(buffer);
- if (sizep != NULL)
+ if (error)
+ close(fd);
+ if (!error && sizep != NULL)
*sizep = bytesize;
return (error);
}
int
+image_copyin(lba_t blk, int fd, uint64_t *sizep)
+{
+ struct stat sb;
+ int error;
+
+ error = image_chunk_skipto(blk);
+ if (!error) {
+ if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode))
+ error = image_copyin_stream(blk, fd, sizep);
+ else
+ error = image_copyin_mapped(blk, fd, sizep);
+ }
+ return (error);
+}
+
+/*
+ * Output/sink file handling.
+ */
+
+int
image_copyout(int fd)
{
int error;
@@ -115,71 +506,124 @@ image_copyout_done(int fd)
return (error);
}
-int
-image_copyout_region(int fd, lba_t blk, lba_t size)
+static int
+image_copyout_memory(int fd, size_t size, void *ptr)
{
- char *buffer;
- off_t ofs;
+
+ if (write(fd, ptr, size) == -1)
+ return (errno);
+ return (0);
+}
+
+static int
+image_copyout_zeroes(int fd, size_t size)
+{
+ static uint8_t *zeroes = NULL;
size_t sz;
- ssize_t rdsz, wrsz;
int error;
- ofs = lseek(fd, 0L, SEEK_CUR);
+ if (lseek(fd, (off_t)size, SEEK_CUR) != -1)
+ return (0);
+
+ /*
+ * If we can't seek, we must write.
+ */
+
+ if (zeroes == NULL) {
+ zeroes = calloc(1, secsz);
+ if (zeroes == NULL)
+ return (ENOMEM);
+ }
+
+ while (size > 0) {
+ sz = (size > secsz) ? secsz : size;
+ error = image_copyout_memory(fd, sz, zeroes);
+ if (error)
+ return (error);
+ size -= sz;
+ }
+ return (0);
+}
+
+static int
+image_copyout_file(int fd, size_t size, int ifd, off_t iofs)
+{
+ void *buf;
+ size_t iosz, sz;
+ int error;
+
+ iosz = secsz * image_swap_pgsz;
+
+ while (size > 0) {
+ sz = (size > iosz) ? iosz : size;
+ buf = image_file_map(ifd, iofs, sz);
+ if (buf == NULL)
+ return (errno);
+ error = image_copyout_memory(fd, sz, buf);
+ image_file_unmap(buf, sz);
+ if (error)
+ return (error);
+ size -= sz;
+ iofs += sz;
+ }
+ return (0);
+}
+
+int
+image_copyout_region(int fd, lba_t blk, lba_t size)
+{
+ struct chunk *ch;
+ size_t ofs, sz;
+ int error;
- blk *= secsz;
- if (lseek(image_fd, blk, SEEK_SET) != blk)
- return (errno);
- buffer = malloc(BUFFER_SIZE);
- if (buffer == NULL)
- return (errno);
- error = 0;
size *= secsz;
+
while (size > 0) {
- sz = (BUFFER_SIZE < size) ? BUFFER_SIZE : size;
- rdsz = read(image_fd, buffer, sz);
- if (rdsz <= 0) {
- error = (rdsz < 0) ? errno : 0;
+ ch = image_chunk_find(blk);
+ if (ch == NULL)
+ return (EINVAL);
+ ofs = (blk - ch->ch_block) * secsz;
+ sz = ch->ch_size - ofs;
+ sz = ((lba_t)sz < size) ? sz : (size_t)size;
+ switch (ch->ch_type) {
+ case CH_TYPE_ZEROES:
+ error = image_copyout_zeroes(fd, sz);
break;
- }
- wrsz = (ofs == -1) ?
- write(fd, buffer, rdsz) :
- sparse_write(fd, buffer, rdsz);
- if (wrsz < 0) {
- error = errno;
+ case CH_TYPE_FILE:
+ error = image_copyout_file(fd, sz, ch->ch_u.file.fd,
+ ch->ch_u.file.ofs + ofs);
+ break;
+ case CH_TYPE_MEMORY:
+ error = image_copyout_memory(fd, sz, ch->ch_u.mem.ptr);
break;
+ default:
+ return (EDOOFUS);
}
- assert(wrsz == rdsz);
- size -= rdsz;
+ size -= sz;
+ blk += sz / secsz;
}
- free(buffer);
- return (error);
+ return (0);
}
int
image_data(lba_t blk, lba_t size)
{
- char *buffer, *p;
-
- blk *= secsz;
- if (lseek(image_fd, blk, SEEK_SET) != blk)
- return (1);
-
- size *= secsz;
- buffer = malloc(size);
- if (buffer == NULL)
- return (1);
+ struct chunk *ch;
+ lba_t lim;
- if (read(image_fd, buffer, size) != (ssize_t)size) {
- free(buffer);
- return (1);
+ while (1) {
+ ch = image_chunk_find(blk);
+ if (ch == NULL)
+ return (0);
+ if (ch->ch_type != CH_TYPE_ZEROES)
+ return (1);
+ lim = ch->ch_block + (ch->ch_size / secsz);
+ if (lim >= blk + size)
+ return (0);
+ size -= lim - blk;
+ blk = lim;
}
-
- p = buffer;
- while (size > 0 && *p == '\0')
- size--, p++;
-
- free(buffer);
- return ((size == 0) ? 0 : 1);
+ /*NOTREACHED*/
}
lba_t
@@ -192,39 +636,87 @@ image_get_size(void)
int
image_set_size(lba_t blk)
{
+ int error;
- image_size = blk;
- if (ftruncate(image_fd, blk * secsz) == -1)
- return (errno);
- return (0);
+ error = image_chunk_skipto(blk);
+ if (!error)
+ image_size = blk;
+ return (error);
}
int
image_write(lba_t blk, void *buf, ssize_t len)
{
+ struct chunk *ch;
- blk *= secsz;
- if (lseek(image_fd, blk, SEEK_SET) != blk)
- return (errno);
- len *= secsz;
- if (sparse_write(image_fd, buf, len) != len)
- return (errno);
+ while (len > 0) {
+ if (!is_empty_sector(buf)) {
+ ch = image_chunk_find(blk);
+ if (ch == NULL)
+ return (ENXIO);
+ /* We may not be able to write to files. */
+ if (ch->ch_type == CH_TYPE_FILE)
+ return (EINVAL);
+ if (ch->ch_type == CH_TYPE_ZEROES) {
+ ch = image_chunk_memory(ch, blk);
+ if (ch == NULL)
+ return (ENOMEM);
+ }
+ assert(ch->ch_type == CH_TYPE_MEMORY);
+ memcpy(ch->ch_u.mem.ptr, buf, secsz);
+ }
+ blk++;
+ buf = (char *)buf + secsz;
+ len--;
+ }
return (0);
}
+static void
+image_cleanup(void)
+{
+ struct chunk *ch;
+
+ while ((ch = STAILQ_FIRST(&image_chunks)) != NULL) {
+ switch (ch->ch_type) {
+ case CH_TYPE_FILE:
+ /* We may be closing the same file multiple times. */
+ if (ch->ch_u.file.fd != -1)
+ close(ch->ch_u.file.fd);
+ break;
+ case CH_TYPE_MEMORY:
+ free(ch->ch_u.mem.ptr);
+ break;
+ default:
+ break;
+ }
+ STAILQ_REMOVE_HEAD(&image_chunks, ch_list);
+ free(ch);
+ }
+ if (image_swap_fd != -1)
+ close(image_swap_fd);
+ unlink(image_swap_file);
+}
+
int
image_init(void)
{
const char *tmpdir;
- if (atexit(cleanup) == -1)
+ STAILQ_INIT(&image_chunks);
+ image_nchunks = 0;
+
+ image_swap_size = 0;
+ image_swap_pgsz = getpagesize();
+
+ if (atexit(image_cleanup) == -1)
return (errno);
if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0')
tmpdir = _PATH_TMP;
- snprintf(image_tmpfile, sizeof(image_tmpfile), "%s/mkimg-XXXXXX",
+ snprintf(image_swap_file, sizeof(image_swap_file), "%s/mkimg-XXXXXX",
tmpdir);
- image_fd = mkstemp(image_tmpfile);
- if (image_fd == -1)
+ image_swap_fd = mkstemp(image_swap_file);
+ if (image_swap_fd == -1)
return (errno);
return (0);
}
diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1
index db492ed..bfe05c0 100644
--- a/usr.bin/mkimg/mkimg.1
+++ b/usr.bin/mkimg/mkimg.1
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 12, 2014
+.Dd September 27, 2014
.Dt MKIMG 1
.Os
.Sh NAME
@@ -44,6 +44,8 @@
.Fl s Ar scheme
.Fl p Ar partition
.Op Fl p Ar partition ...
+.Nm
+.Ar --formats | --schemes | --version
.Sh DESCRIPTION
The
.Nm
@@ -122,10 +124,32 @@ utility will generate predictable values for Universally Unique Identifiers
.Nm
utility will create images that are identical.
.Pp
-For a complete list of supported partitioning schemes or supported output
-format, or for a detailed description of how to specify partitions, run the
+A set of long options exist to query about the
+.Nm
+utilty itself.
+Options in this set should be given by themselves because the
+.Nm
+utility exits immediately after providing the requested information.
+The version of the
+.Nm
+utility is printed when the
+.Ar --version
+option is given.
+The list of supported output formats is printed when the
+.Ar --formats
+option is given and the list of supported partitioning schemes is printed
+when the
+.Ar --schemes
+option is given.
+Both the format and scheme lists a space-separated lists for easy handling
+in scripts.
+.Pp
+For a more descriptive list of supported partitioning schemes or supported
+output format, or for a detailed description of how to specify partitions,
+run the
.Nm
utility without any arguments.
+This will print a usage message with all the necessary details.
.Sh ENVIRONMENT
.Bl -tag -width "TMPDIR" -compact
.It Ev TMPDIR
diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c
index ab95d94..d054423 100644
--- a/usr.bin/mkimg/mkimg.c
+++ b/usr.bin/mkimg/mkimg.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <err.h>
#include <fcntl.h>
+#include <getopt.h>
#include <libutil.h>
#include <limits.h>
#include <stdio.h>
@@ -48,6 +49,17 @@ __FBSDID("$FreeBSD$");
#include "mkimg.h"
#include "scheme.h"
+#define LONGOPT_FORMATS 0x01000001
+#define LONGOPT_SCHEMES 0x01000002
+#define LONGOPT_VERSION 0x01000003
+
+static struct option longopts[] = {
+ { "formats", no_argument, NULL, LONGOPT_FORMATS },
+ { "schemes", no_argument, NULL, LONGOPT_SCHEMES },
+ { "version", no_argument, NULL, LONGOPT_VERSION },
+ { NULL, 0, NULL, 0 }
+};
+
struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist);
u_int nparts = 0;
@@ -61,15 +73,79 @@ u_int secsz = 512;
u_int blksz = 0;
static void
-usage(const char *why)
+print_formats(int usage)
{
struct mkimg_format *f, **f_iter;
+ const char *sep;
+
+ if (usage) {
+ fprintf(stderr, " formats:\n");
+ SET_FOREACH(f_iter, formats) {
+ f = *f_iter;
+ fprintf(stderr, "\t%s\t- %s\n", f->name,
+ f->description);
+ }
+ } else {
+ sep = "";
+ SET_FOREACH(f_iter, formats) {
+ f = *f_iter;
+ printf("%s%s", sep, f->name);
+ sep = " ";
+ }
+ putchar('\n');
+ }
+}
+
+static void
+print_schemes(int usage)
+{
struct mkimg_scheme *s, **s_iter;
+ const char *sep;
+
+ if (usage) {
+ fprintf(stderr, " schemes:\n");
+ SET_FOREACH(s_iter, schemes) {
+ s = *s_iter;
+ fprintf(stderr, "\t%s\t- %s\n", s->name,
+ s->description);
+ }
+ } else {
+ sep = "";
+ SET_FOREACH(s_iter, schemes) {
+ s = *s_iter;
+ printf("%s%s", sep, s->name);
+ sep = " ";
+ }
+ putchar('\n');
+ }
+}
+
+static void
+print_version(void)
+{
+ u_int width;
+
+#ifdef __LP64__
+ width = 64;
+#else
+ width = 32;
+#endif
+ printf("mkimg %u (%u-bit)\n", MKIMG_VERSION, width);
+}
+
+static void
+usage(const char *why)
+{
warnx("error: %s", why);
- fprintf(stderr, "\nusage: %s <options>\n", getprogname());
+ fputc('\n', stderr);
+ fprintf(stderr, "usage: %s <options>\n", getprogname());
fprintf(stderr, " options:\n");
+ fprintf(stderr, "\t--formats\t- list image formats\n");
+ fprintf(stderr, "\t--schemes\t- list partition schemes\n");
+ fprintf(stderr, "\t--version\t- show version information\n");
+ fputc('\n', stderr);
fprintf(stderr, "\t-b <file>\t- file containing boot code\n");
fprintf(stderr, "\t-f <format>\n");
fprintf(stderr, "\t-o <file>\t- file to write image into\n");
@@ -81,20 +157,12 @@ usage(const char *why)
fprintf(stderr, "\t-P <num>\t- physical sector size\n");
fprintf(stderr, "\t-S <num>\t- logical sector size\n");
fprintf(stderr, "\t-T <num>\t- number of tracks to simulate\n");
-
- fprintf(stderr, "\n formats:\n");
- SET_FOREACH(f_iter, formats) {
- f = *f_iter;
- fprintf(stderr, "\t%s\t- %s\n", f->name, f->description);
- }
-
- fprintf(stderr, "\n schemes:\n");
- SET_FOREACH(s_iter, schemes) {
- s = *s_iter;
- fprintf(stderr, "\t%s\t- %s\n", s->name, s->description);
- }
-
- fprintf(stderr, "\n partition specification:\n");
+ fputc('\n', stderr);
+ print_formats(1);
+ fputc('\n', stderr);
+ print_schemes(1);
+ fputc('\n', stderr);
+ fprintf(stderr, " partition specification:\n");
fprintf(stderr, "\t<t>[/<l>]::<size>\t- empty partition of given "
"size\n");
fprintf(stderr, "\t<t>[/<l>]:=<file>\t- partition content and size "
@@ -366,7 +434,8 @@ main(int argc, char *argv[])
bcfd = -1;
outfd = 1; /* Write to stdout by default */
- while ((c = getopt(argc, argv, "b:f:o:p:s:vyH:P:S:T:")) != -1) {
+ while ((c = getopt_long(argc, argv, "b:f:o:p:s:vyH:P:S:T:",
+ longopts, NULL)) != -1) {
switch (c) {
case 'b': /* BOOT CODE */
if (bcfd != -1)
@@ -432,6 +501,18 @@ main(int argc, char *argv[])
if (error)
errc(EX_DATAERR, error, "track size");
break;
+ case LONGOPT_FORMATS:
+ print_formats(0);
+ exit(EX_OK);
+ /*NOTREACHED*/
+ case LONGOPT_SCHEMES:
+ print_schemes(0);
+ exit(EX_OK);
+ /*NOTREACHED*/
+ case LONGOPT_VERSION:
+ print_version();
+ exit(EX_OK);
+ /*NOTREACHED*/
default:
usage("unknown option");
}
diff --git a/usr.bin/mkimg/vhd.c b/usr.bin/mkimg/vhd.c
index af3d95e..6b9d6a0 100644
--- a/usr.bin/mkimg/vhd.c
+++ b/usr.bin/mkimg/vhd.c
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
struct vhd_footer {
uint64_t cookie;
-#define VHD_FOOTER_COOKIE 0x636f6e6563746978
+#define VHD_FOOTER_COOKIE 0x636f6e6563746978ULL
uint32_t features;
#define VHD_FEATURES_TEMPORARY 0x01
#define VHD_FEATURES_RESERVED 0x02
@@ -236,7 +236,7 @@ vhd_resize(lba_t imgsz)
struct vhd_dyn_header {
uint64_t cookie;
-#define VHD_HEADER_COOKIE 0x6378737061727365
+#define VHD_HEADER_COOKIE 0x6378737061727365ULL
uint64_t data_offset;
uint64_t table_offset;
uint32_t version;
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index d811a86..372c661 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -897,7 +897,7 @@ fix_obsolete_keys(int *argc, char **argv)
}
}
}
- sprintf(sopt, "-k%d.%d", f1, c1);
+ sprintf(sopt, "-k%d.%d%s", f1, c1, sopts1);
argv[i] = sort_strdup(sopt);
}
}
diff --git a/usr.bin/systat/ifstat.c b/usr.bin/systat/ifstat.c
index 4cfe01c..35e5756 100644
--- a/usr.bin/systat/ifstat.c
+++ b/usr.bin/systat/ifstat.c
@@ -68,14 +68,14 @@ struct if_stat {
struct ifmibdata if_mib;
struct timeval tv;
struct timeval tv_lastchanged;
- u_long if_in_curtraffic;
- u_long if_out_curtraffic;
- u_long if_in_traffic_peak;
- u_long if_out_traffic_peak;
- u_long if_in_curpps;
- u_long if_out_curpps;
- u_long if_in_pps_peak;
- u_long if_out_pps_peak;
+ uint64_t if_in_curtraffic;
+ uint64_t if_out_curtraffic;
+ uint64_t if_in_traffic_peak;
+ uint64_t if_out_traffic_peak;
+ uint64_t if_in_curpps;
+ uint64_t if_out_curpps;
+ uint64_t if_in_pps_peak;
+ uint64_t if_out_pps_peak;
u_int if_row; /* Index into ifmib sysctl */
int if_ypos; /* -1 if not being displayed */
u_int display;
@@ -269,8 +269,8 @@ fetchifstat(void)
struct if_stat *ifp = NULL;
struct timeval tv, new_tv, old_tv;
double elapsed = 0.0;
- u_int new_inb, new_outb, old_inb, old_outb = 0;
- u_int new_inp, new_outp, old_inp, old_outp = 0;
+ uint64_t new_inb, new_outb, old_inb, old_outb = 0;
+ uint64_t new_inp, new_outp, old_inp, old_outp = 0;
SLIST_FOREACH(ifp, &curlist, link) {
/*
diff --git a/usr.sbin/acpi/acpiconf/Makefile b/usr.sbin/acpi/acpiconf/Makefile
index 5f862a2..0bbadc1 100644
--- a/usr.sbin/acpi/acpiconf/Makefile
+++ b/usr.sbin/acpi/acpiconf/Makefile
@@ -3,5 +3,6 @@
PROG= acpiconf
MAN= acpiconf.8
+WARNS?= 3
.include <bsd.prog.mk>
diff --git a/usr.sbin/acpi/acpidb/Makefile b/usr.sbin/acpi/acpidb/Makefile
index c08c70b..15d114d 100644
--- a/usr.sbin/acpi/acpidb/Makefile
+++ b/usr.sbin/acpi/acpidb/Makefile
@@ -3,10 +3,13 @@
PROG= acpidb
SRCS= acpidb.c
+# common
+SRCS+= acgetline.c ahids.c ahuuids.c cmfsize.c
+
# components/debugger
SRCS+= dbcmds.c dbconvert.c dbdisply.c dbexec.c dbfileio.c \
dbhistry.c dbinput.c dbmethod.c dbnames.c dbstats.c \
- dbutils.c dbxface.c
+ dbtest.c dbutils.c dbxface.c
# components/disassembler
SRCS+= dmbuffer.c dmdeferred.c dmnames.c dmobject.c dmopcode.c \
@@ -46,26 +49,27 @@ SRCS+= psargs.c psloop.c psobject.c psopcode.c psopinfo.c \
psparse.c psscope.c pstree.c psutils.c pswalk.c \
psxface.c
-# components/os_specific/service_layers
-SRCS+= osunixxf.c
-
# components/resources
SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsdumpinfo.c \
rsinfo.c rsio.c rsirq.c rslist.c rsmemory.c rsmisc.c \
rsserial.c rsutils.c rsxface.c
# components/tables
-SRCS+= tbfadt.c tbfind.c tbinstal.c tbprint.c tbutils.c \
- tbxface.c tbxfload.c
+SRCS+= tbdata.c tbfadt.c tbfind.c tbinstal.c tbprint.c \
+ tbutils.c tbxface.c tbxfload.c
# components/utilities
SRCS+= utaddress.c utalloc.c utbuffer.c utcache.c utcopy.c \
utdebug.c utdecode.c utdelete.c uterror.c uteval.c \
- utexcep.c utglobal.c utids.c utinit.c utlock.c utmath.c \
- utmisc.c utmutex.c utobject.c utosi.c utownerid.c \
- utpredef.c utresrc.c utstate.c utstring.c uttrack.c \
+ utexcep.c utfileio.c utglobal.c uthex.c utids.c \
+ utinit.c utlock.c utmath.c utmisc.c utmutex.c \
+ utobject.c utosi.c utownerid.c utpredef.c utprint.c \
+ utresrc.c utstate.c utstring.c uttrack.c utuuid.c \
utxface.c utxferror.c utxfinit.c
+# os_specific/service_layers
+SRCS+= oslibcfs.c osunixxf.c
+
MAN= acpidb.8
WARNS?= 3
diff --git a/usr.sbin/acpi/acpidb/acpidb.c b/usr.sbin/acpi/acpidb/acpidb.c
index 3cd8d3f..3688caf 100644
--- a/usr.sbin/acpi/acpidb/acpidb.c
+++ b/usr.sbin/acpi/acpidb/acpidb.c
@@ -45,6 +45,7 @@
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
+#include <contrib/dev/acpica/include/amlresrc.h>
/*
* Dummy DSDT Table Header
@@ -89,9 +90,9 @@ static UINT64 aml_simulate_prompt(char *msg, UINT64 def_val);
static void aml_simulation_regload(const char *dumpfile);
static void aml_simulation_regdump(const char *dumpfile);
-/* Stubs to simplify linkage to the ACPI CA core subsystem. */
+/* Stubs to simplify linkage to the ACPICA core subsystem. */
ACPI_PHYSICAL_ADDRESS
-AeLocalGetRootPointer(void)
+AcpiOsGetRootPointer(void)
{
return (0);
@@ -102,6 +103,18 @@ AeTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable)
{
}
+void
+MpSaveGpioInfo(ACPI_PARSE_OBJECT *Op, AML_RESOURCE *Resource,
+ UINT32 PinCount, UINT16 *PinList, char *DeviceName)
+{
+}
+
+void
+MpSaveSerialInfo(ACPI_PARSE_OBJECT *Op, AML_RESOURCE *Resource,
+ char *DeviceName)
+{
+}
+
static void
aml_simulation_init(void)
{
diff --git a/usr.sbin/acpi/acpidump/Makefile b/usr.sbin/acpi/acpidump/Makefile
index e004500..e258f8e 100644
--- a/usr.sbin/acpi/acpidump/Makefile
+++ b/usr.sbin/acpi/acpidump/Makefile
@@ -3,5 +3,6 @@
PROG= acpidump
MAN= acpidump.8
SRCS= acpi.c acpi_user.c acpidump.c
+WARNS?= 3
.include <bsd.prog.mk>
diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c
index 66cd7bd..ae7ebf2 100644
--- a/usr.sbin/acpi/acpidump/acpi.c
+++ b/usr.sbin/acpi/acpidump/acpi.c
@@ -934,10 +934,10 @@ acpi_handle_dmar_remapping_structure(void *addr, int remaining)
case ACPI_DMAR_TYPE_RESERVED_MEMORY:
acpi_handle_dmar_rmrr(addr);
break;
- case ACPI_DMAR_TYPE_ATSR:
+ case ACPI_DMAR_TYPE_ROOT_ATS:
acpi_handle_dmar_atsr(addr);
break;
- case ACPI_DMAR_HARDWARE_AFFINITY:
+ case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
acpi_handle_dmar_rhsa(addr);
break;
default:
diff --git a/usr.sbin/acpi/iasl/Makefile b/usr.sbin/acpi/iasl/Makefile
index 161b2f4..8f021a3 100644
--- a/usr.sbin/acpi/iasl/Makefile
+++ b/usr.sbin/acpi/iasl/Makefile
@@ -1,29 +1,31 @@
# $FreeBSD$
PROG= iasl
-SRCS= adfile.c adisasm.c adwalk.c
# common
-SRCS+= ahpredef.c dmextern.c dmrestag.c dmtable.c dmtbdump.c \
- dmtbinfo.c getopt.c
+SRCS= adfile.c adisasm.c adwalk.c ahids.c ahpredef.c \
+ ahuuids.c cmfsize.c dmextern.c dmrestag.c dmtable.c \
+ dmtbdump.c dmtbinfo.c getopt.c
# compiler
-SRCS+= aslanalyze.c aslbtypes.c aslcodegen.c aslcompile.c \
- aslcompiler.y.h aslcompilerlex.c aslcompilerparse.c \
- aslerror.c aslfileio.c aslfiles.c aslfold.c aslhex.c \
- asllength.c asllisting.c asllistsup.c aslload.c \
- asllookup.c aslmain.c aslmap.c aslmethod.c aslnamesp.c \
- asloffset.c aslopcodes.c asloperands.c aslopt.c \
- asloptions.c aslpredef.c aslprepkg.c aslresource.c \
- aslrestype1.c aslrestype1i.c aslrestype2.c \
- aslrestype2d.c aslrestype2e.c aslrestype2q.c \
- aslrestype2s.c aslrestype2w.c aslstartup.c aslstubs.c \
- asltransform.c asltree.c aslutils.c asluuid.c \
- aslwalks.c aslxref.c dtcompile.c dtexpress.c dtfield.c \
- dtio.c dtparser.y.h dtparserlex.c dtparserparse.c \
- dtsubtable.c dttable.c dttemplate.c dtutils.c \
- prexpress.c prmacros.c prparser.y.h prparserlex.c \
- prparserparse.c prscan.c prutils.c
+SRCS+= aslanalyze.c aslascii.c aslbtypes.c aslcodegen.c \
+ aslcompile.c aslcompiler.y.h aslcompilerlex.c \
+ aslcompilerparse.c aslerror.c aslfileio.c aslfiles.c \
+ aslfold.c aslhex.c asllength.c asllisting.c \
+ asllistsup.c aslload.c asllookup.c aslmain.c aslmap.c \
+ aslmapenter.c aslmapoutput.c aslmaputils.c \
+ aslmessages.c aslmethod.c aslnamesp.c asloffset.c \
+ aslopcodes.c asloperands.c aslopt.c asloptions.c \
+ aslpredef.c aslprepkg.c aslresource.c aslrestype1.c \
+ aslrestype1i.c aslrestype2.c aslrestype2d.c \
+ aslrestype2e.c aslrestype2q.c aslrestype2s.c \
+ aslrestype2w.c aslstartup.c aslstubs.c asltransform.c \
+ asltree.c aslutils.c asluuid.c aslwalks.c aslxref.c \
+ dtcompile.c dtexpress.c dtfield.c dtio.c dtparser.y.h \
+ dtparserlex.c dtparserparse.c dtsubtable.c dttable.c \
+ dttemplate.c dtutils.c prexpress.c prmacros.c \
+ prparser.y.h prparserlex.c prparserparse.c prscan.c \
+ prutils.c
# components/debugger
SRCS+= dbfileio.c
@@ -52,17 +54,19 @@ SRCS+= nsaccess.c nsalloc.c nsdump.c nsnames.c nsobject.c \
nsparse.c nssearch.c nsutils.c nswalk.c
# components/tables
-SRCS+= tbfadt.c tbinstal.c tbprint.c tbutils.c tbxface.c
+SRCS+= tbdata.c tbfadt.c tbinstal.c tbprint.c tbutils.c \
+ tbxface.c
# components/utilities
SRCS+= utaddress.c utalloc.c utbuffer.c utcache.c utcopy.c \
utdebug.c utdecode.c utdelete.c uterror.c utexcep.c \
- utglobal.c utinit.c utlock.c utmath.c utmisc.c \
- utmutex.c utobject.c utownerid.c utpredef.c utresrc.c \
- utstate.c utstring.c utxface.c utxferror.c
+ utfileio.c utglobal.c uthex.c utinit.c utlock.c \
+ utmath.c utmisc.c utmutex.c utobject.c utownerid.c \
+ utpredef.c utprint.c utresrc.c utstate.c utstring.c \
+ utuuid.c utxface.c utxferror.c
# os_specific/service_layers
-SRCS+= osunixxf.c
+SRCS+= oslibcfs.c osunixxf.c
WARNS?= 2
@@ -72,15 +76,20 @@ CFLAGS+= -DACPI_ASL_COMPILER -I.
LFLAGS= -i -s
YFLAGS= -d
-CLEANFILES= aslcompiler.y.h aslcompilerlex.c aslcompilerparse.c \
- aslcompilerparse.h dtparser.y.h dtparserlex.c \
- dtparserparse.c dtparserparse.h prparser.y.h \
- prparserlex.c prparserparse.c prparserparse.h
+CLEANFILES= aslcompiler.y aslcompiler.y.h aslcompilerlex.c \
+ aslcompilerparse.c aslcompilerparse.h dtparser.y.h \
+ dtparserlex.c dtparserparse.c dtparserparse.h \
+ prparser.y.h prparserlex.c prparserparse.c \
+ prparserparse.h
aslcompilerlex.c: aslcompiler.l aslsupport.l
${LEX} ${LFLAGS} -PAslCompiler -o${.TARGET} \
${ACPICA_DIR}/compiler/aslcompiler.l
+aslcompiler.y: aslparser.y aslrules.y aslsupport.y asltokens.y asltypes.y
+ m4 -P -I${ACPICA_DIR}/compiler \
+ ${ACPICA_DIR}/compiler/aslparser.y > ${.TARGET}
+
.ORDER: aslcompilerparse.c aslcompilerparse.h
aslcompilerparse.c aslcompilerparse.h: aslcompiler.y
${YACC} ${YFLAGS} -pAslCompiler -oaslcompilerparse.c ${.ALLSRC}
diff --git a/usr.sbin/bhyve/acpi.c b/usr.sbin/bhyve/acpi.c
index 5dea300..b955ecc 100644
--- a/usr.sbin/bhyve/acpi.c
+++ b/usr.sbin/bhyve/acpi.c
@@ -430,7 +430,10 @@ basl_fwrite_fadt(FILE *fp)
EFPRINTF(fp, "\n");
EFPRINTF(fp, "[0001]\t\tValue to cause reset : 06\n");
- EFPRINTF(fp, "[0003]\t\tReserved : 000000\n");
+ EFPRINTF(fp, "[0002]\t\tARM Flags (decoded below): 0000\n");
+ EFPRINTF(fp, "\t\t\tPSCI Compliant : 0\n");
+ EFPRINTF(fp, "\t\t\tMust use HVC for PSCI : 0\n");
+ EFPRINTF(fp, "[0001]\t\tFADT Minor Revision : 01\n");
EFPRINTF(fp, "[0008]\t\tFACS Address : 00000000%08X\n",
basl_acpi_base + FACS_OFFSET);
EFPRINTF(fp, "[0008]\t\tDSDT Address : 00000000%08X\n",
diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
index b6006b7..f5e50d3 100644
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -309,7 +309,7 @@ dump_vmcs_msr_bitmap(int vcpu, u_long addr)
if (fd < 0)
goto done;
- bitmap = mmap(NULL, PAGE_SIZE, PROT_READ, 0, fd, addr);
+ bitmap = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, addr);
if (bitmap == MAP_FAILED)
goto done;
diff --git a/usr.sbin/bsdinstall/distextract/distextract.c b/usr.sbin/bsdinstall/distextract/distextract.c
index a35dbd6..54e0171 100644
--- a/usr.sbin/bsdinstall/distextract/distextract.c
+++ b/usr.sbin/bsdinstall/distextract/distextract.c
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2011 Nathan Whitehorn
+ * Copyright (c) 2014 Devin Teske <dteske@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,114 +23,199 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
-#include <stdio.h>
-#include <errno.h>
-#include <limits.h>
#include <archive.h>
+#include <ctype.h>
#include <dialog.h>
-
-static int extract_files(int nfiles, const char **files);
+#include <err.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/* Data to process */
+static char *distdir = NULL;
+struct file_node {
+ char *path;
+ char *name;
+ int length;
+ struct file_node *next;
+};
+static struct file_node *dists = NULL;
+
+/* Function prototypes */
+static int count_files(const char *file);
+static int extract_files(int nfiles, struct file_node *files);
+
+#if __FreeBSD_version <= 1000008 /* r232154: bump for libarchive update */
+#define archive_read_support_filter_all(x) \
+ archive_read_support_compression_all(x)
+#endif
+
+#define _errx(...) (end_dialog(), errx(__VA_ARGS__))
int
main(void)
{
- char *diststring;
- const char **dists;
- int i, retval, ndists = 0;
-
- if (getenv("DISTRIBUTIONS") == NULL) {
- fprintf(stderr, "DISTRIBUTIONS variable is not set\n");
- return (1);
- }
-
- diststring = strdup(getenv("DISTRIBUTIONS"));
- for (i = 0; diststring[i] != 0; i++)
- if (isspace(diststring[i]) && !isspace(diststring[i+1]))
- ndists++;
- ndists++; /* Last one */
-
- dists = calloc(ndists, sizeof(const char *));
- if (dists == NULL) {
- fprintf(stderr, "Out of memory!\n");
- free(diststring);
- return (1);
- }
-
- for (i = 0; i < ndists; i++)
- dists[i] = strsep(&diststring, " \t");
-
+ char *chrootdir;
+ char *distributions;
+ int ndists = 0;
+ int retval;
+ size_t file_node_size = sizeof(struct file_node);
+ size_t span;
+ struct file_node *dist = dists;
+ char error[PATH_MAX + 512];
+
+ if ((distributions = getenv("DISTRIBUTIONS")) == NULL)
+ errx(EXIT_FAILURE, "DISTRIBUTIONS variable is not set");
+ if ((distdir = getenv("BSDINSTALL_DISTDIR")) == NULL)
+ distdir = __DECONST(char *, "");
+
+ /* Initialize dialog(3) */
init_dialog(stdin, stdout);
dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer");
dlg_put_backtitle();
- if (chdir(getenv("BSDINSTALL_CHROOT")) != 0) {
- char error[512];
- sprintf(error, "Could could change to directory %s: %s\n",
- getenv("BSDINSTALL_DISTDIR"), strerror(errno));
+ dialog_msgbox("",
+ "Checking distribution archives.\nPlease wait...", 4, 35, FALSE);
+
+ /*
+ * Parse $DISTRIBUTIONS into linked-list
+ */
+ while (*distributions != '\0') {
+ span = strcspn(distributions, "\t\n\v\f\r ");
+ if (span < 1) { /* currently on whitespace */
+ distributions++;
+ continue;
+ }
+ ndists++;
+
+ /* Allocate a new struct for the distribution */
+ if (dist == NULL) {
+ if ((dist = calloc(1, file_node_size)) == NULL)
+ _errx(EXIT_FAILURE, "Out of memory!");
+ dists = dist;
+ } else {
+ dist->next = calloc(1, file_node_size);
+ if (dist->next == NULL)
+ _errx(EXIT_FAILURE, "Out of memory!");
+ dist = dist->next;
+ }
+
+ /* Set path */
+ if ((dist->path = malloc(span + 1)) == NULL)
+ _errx(EXIT_FAILURE, "Out of memory!");
+ snprintf(dist->path, span + 1, "%s", distributions);
+ dist->path[span] = '\0';
+
+ /* Set display name */
+ dist->name = strrchr(dist->path, '/');
+ if (dist->name == NULL)
+ dist->name = dist->path;
+
+ /* Set initial length in files (-1 == error) */
+ dist->length = count_files(dist->path);
+ if (dist->length < 0) {
+ end_dialog();
+ return (EXIT_FAILURE);
+ }
+
+ distributions += span;
+ }
+
+ /* Optionally chdir(2) into $BSDINSTALL_CHROOT */
+ chrootdir = getenv("BSDINSTALL_CHROOT");
+ if (chrootdir != NULL && chdir(chrootdir) != 0) {
+ snprintf(error, sizeof(error),
+ "Could not change to directory %s: %s\n",
+ chrootdir, strerror(errno));
dialog_msgbox("Error", error, 0, 0, TRUE);
end_dialog();
- return (1);
+ return (EXIT_FAILURE);
}
retval = extract_files(ndists, dists);
end_dialog();
- free(diststring);
- free(dists);
+ while ((dist = dists) != NULL) {
+ dists = dist->next;
+ if (dist->path != NULL)
+ free(dist->path);
+ free(dist);
+ }
return (retval);
}
+/*
+ * Returns number of files in archive file. Parses $BSDINSTALL_DISTDIR/MANIFEST
+ * if it exists, otherwise uses archive(3) to read the archive file.
+ */
static int
count_files(const char *file)
{
+ static FILE *manifest = NULL;
+ char *p;
+ int file_count;
+ int retval;
+ size_t span;
struct archive *archive;
struct archive_entry *entry;
- static FILE *manifest = NULL;
- char path[MAXPATHLEN];
- char errormsg[512];
- int file_count, err;
+ char line[512];
+ char path[PATH_MAX];
+ char errormsg[PATH_MAX + 512];
if (manifest == NULL) {
- sprintf(path, "%s/MANIFEST", getenv("BSDINSTALL_DISTDIR"));
+ snprintf(path, sizeof(path), "%s/MANIFEST", distdir);
manifest = fopen(path, "r");
}
if (manifest != NULL) {
- char line[512];
- char *tok1, *tok2;
-
rewind(manifest);
while (fgets(line, sizeof(line), manifest) != NULL) {
- tok2 = line;
- tok1 = strsep(&tok2, "\t");
- if (tok1 == NULL || strcmp(tok1, file) != 0)
+ p = &line[0];
+ span = strcspn(p, "\t") ;
+ if (span < 1 || strncmp(p, file, span) != 0)
continue;
/*
* We're at the right manifest line. The file count is
* in the third element
*/
- tok1 = strsep(&tok2, "\t");
- tok1 = strsep(&tok2, "\t");
- if (tok1 != NULL)
- return atoi(tok1);
+ span = strcspn(p += span + (*p != '\0' ? 1 : 0), "\t");
+ span = strcspn(p += span + (*p != '\0' ? 1 : 0), "\t");
+ if (span > 0) {
+ file_count = (int)strtol(p, (char **)NULL, 10);
+ if (file_count == 0 && errno == EINVAL)
+ continue;
+ return (file_count);
+ }
}
}
- /* Either we didn't have a manifest, or this archive wasn't there */
- archive = archive_read_new();
+ /*
+ * Either no manifest, or manifest didn't mention this archive.
+ * Use archive(3) to read the archive, counting files within.
+ */
+ if ((archive = archive_read_new()) == NULL) {
+ snprintf(errormsg, sizeof(errormsg),
+ "Error: %s\n", archive_error_string(NULL));
+ dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE);
+ return (-1);
+ }
archive_read_support_format_all(archive);
archive_read_support_filter_all(archive);
- sprintf(path, "%s/%s", getenv("BSDINSTALL_DISTDIR"), file);
- err = archive_read_open_filename(archive, path, 4096);
- if (err != ARCHIVE_OK) {
+ snprintf(path, sizeof(path), "%s/%s", distdir, file);
+ retval = archive_read_open_filename(archive, path, 4096);
+ if (retval != ARCHIVE_OK) {
snprintf(errormsg, sizeof(errormsg),
"Error while extracting %s: %s\n", file,
archive_error_string(archive));
@@ -146,76 +232,83 @@ count_files(const char *file)
}
static int
-extract_files(int nfiles, const char **files)
+extract_files(int nfiles, struct file_node *files)
{
- const char *items[nfiles*2];
- char path[PATH_MAX];
+ int archive_file;
int archive_files[nfiles];
- int total_files, current_files, archive_file;
+ int current_files = 0;
+ int i;
+ int last_progress;
+ int progress = 0;
+ int retval;
+ int total_files = 0;
struct archive *archive;
struct archive_entry *entry;
- char errormsg[512];
+ struct file_node *file;
char status[8];
- int i, err, progress, last_progress;
+ static char title[] = "Archive Extraction";
+ static char pprompt[] = "Extracting distribution files...\n";
+ char path[PATH_MAX];
+ char errormsg[PATH_MAX + 512];
+ const char *items[nfiles*2];
- err = 0;
- progress = 0;
-
/* Make the transfer list for dialog */
- for (i = 0; i < nfiles; i++) {
- items[i*2] = strrchr(files[i], '/');
- if (items[i*2] != NULL)
- items[i*2]++;
- else
- items[i*2] = files[i];
+ i = 0;
+ for (file = files; file != NULL; file = file->next) {
+ items[i*2] = file->name;
items[i*2 + 1] = "Pending";
- }
+ archive_files[i] = file->length;
- dialog_msgbox("",
- "Checking distribution archives.\nPlease wait...", 0, 0, FALSE);
-
- /* Count all the files */
- total_files = 0;
- for (i = 0; i < nfiles; i++) {
- archive_files[i] = count_files(files[i]);
- if (archive_files[i] < 0)
- return (-1);
- total_files += archive_files[i];
+ total_files += file->length;
+ i++;
}
- current_files = 0;
-
- for (i = 0; i < nfiles; i++) {
- archive = archive_read_new();
+ i = 0;
+ for (file = files; file != NULL; file = file->next) {
+ if ((archive = archive_read_new()) == NULL) {
+ snprintf(errormsg, sizeof(errormsg),
+ "Error: %s\n", archive_error_string(NULL));
+ dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE);
+ return (EXIT_FAILURE);
+ }
archive_read_support_format_all(archive);
archive_read_support_filter_all(archive);
- sprintf(path, "%s/%s", getenv("BSDINSTALL_DISTDIR"), files[i]);
- err = archive_read_open_filename(archive, path, 4096);
+ snprintf(path, sizeof(path), "%s/%s", distdir, file->path);
+ retval = archive_read_open_filename(archive, path, 4096);
+ if (retval != 0) {
+ snprintf(errormsg, sizeof(errormsg),
+ "Error opening %s: %s\n", file->name,
+ archive_error_string(archive));
+ dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE);
+ return (EXIT_FAILURE);
+ }
items[i*2 + 1] = "In Progress";
archive_file = 0;
- while ((err = archive_read_next_header(archive, &entry)) ==
+ dialog_mixedgauge(title, pprompt, 0, 0, progress, nfiles,
+ __DECONST(char **, items));
+
+ while ((retval = archive_read_next_header(archive, &entry)) ==
ARCHIVE_OK) {
last_progress = progress;
progress = (current_files*100)/total_files;
- sprintf(status, "-%d",
+ snprintf(status, sizeof(status), "-%d",
(archive_file*100)/archive_files[i]);
items[i*2 + 1] = status;
if (progress > last_progress)
- dialog_mixedgauge("Archive Extraction",
- "Extracting distribution files...", 0, 0,
+ dialog_mixedgauge(title, pprompt, 0, 0,
progress, nfiles,
__DECONST(char **, items));
- err = archive_read_extract(archive, entry,
+ retval = archive_read_extract(archive, entry,
ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_OWNER |
ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL |
ARCHIVE_EXTRACT_XATTR | ARCHIVE_EXTRACT_FFLAGS);
- if (err != ARCHIVE_OK)
+ if (retval != ARCHIVE_OK)
break;
archive_file++;
@@ -224,18 +317,22 @@ extract_files(int nfiles, const char **files)
items[i*2 + 1] = "Done";
- if (err != ARCHIVE_EOF) {
+ if (retval != ARCHIVE_EOF) {
snprintf(errormsg, sizeof(errormsg),
"Error while extracting %s: %s\n", items[i*2],
archive_error_string(archive));
items[i*2 + 1] = "Failed";
- dialog_msgbox("Extract Error", errormsg, 0, 0,
- TRUE);
- return (err);
+ dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE);
+ return (retval);
}
+ progress = (current_files*100)/total_files;
+ dialog_mixedgauge(title, pprompt, 0, 0, progress, nfiles,
+ __DECONST(char **, items));
+
archive_read_free(archive);
+ i++;
}
- return (0);
+ return (EXIT_SUCCESS);
}
diff --git a/usr.sbin/bsdinstall/distfetch/distfetch.c b/usr.sbin/bsdinstall/distfetch/distfetch.c
index ae5766c..4e870c8 100644
--- a/usr.sbin/bsdinstall/distfetch/distfetch.c
+++ b/usr.sbin/bsdinstall/distfetch/distfetch.c
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2011 Nathan Whitehorn
+ * Copyright (c) 2014 Devin Teske <dteske@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,15 +23,21 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
-#include <stdio.h>
+#include <ctype.h>
+#include <err.h>
+#include <dialog.h>
#include <errno.h>
#include <fetch.h>
-#include <dialog.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
static int fetch_files(int nfiles, char **urls);
@@ -39,12 +46,13 @@ main(void)
{
char *diststring;
char **urls;
- int i, nfetched, ndists = 0;
+ int i;
+ int ndists = 0;
+ int nfetched;
+ char error[PATH_MAX + 512];
- if (getenv("DISTRIBUTIONS") == NULL) {
- fprintf(stderr, "DISTRIBUTIONS variable is not set\n");
- return (1);
- }
+ if (getenv("DISTRIBUTIONS") == NULL)
+ errx(EXIT_FAILURE, "DISTRIBUTIONS variable is not set");
diststring = strdup(getenv("DISTRIBUTIONS"));
for (i = 0; diststring[i] != 0; i++)
@@ -54,9 +62,8 @@ main(void)
urls = calloc(ndists, sizeof(const char *));
if (urls == NULL) {
- fprintf(stderr, "Out of memory!\n");
free(diststring);
- return (1);
+ errx(EXIT_FAILURE, "Out of memory!");
}
init_dialog(stdin, stdout);
@@ -65,17 +72,17 @@ main(void)
for (i = 0; i < ndists; i++) {
urls[i] = malloc(PATH_MAX);
- sprintf(urls[i], "%s/%s", getenv("BSDINSTALL_DISTSITE"),
- strsep(&diststring, " \t"));
+ snprintf(urls[i], PATH_MAX, "%s/%s",
+ getenv("BSDINSTALL_DISTSITE"), strsep(&diststring, " \t"));
}
if (chdir(getenv("BSDINSTALL_DISTDIR")) != 0) {
- char error[512];
- sprintf(error, "Could could change to directory %s: %s\n",
+ snprintf(error, sizeof(error),
+ "Could could change to directory %s: %s\n",
getenv("BSDINSTALL_DISTDIR"), strerror(errno));
dialog_msgbox("Error", error, 0, 0, TRUE);
end_dialog();
- return (1);
+ return (EXIT_FAILURE);
}
nfetched = fetch_files(ndists, urls);
@@ -87,31 +94,32 @@ main(void)
free(urls[i]);
free(urls);
- return ((nfetched == ndists) ? 0 : 1);
+ return ((nfetched == ndists) ? EXIT_SUCCESS : EXIT_FAILURE);
}
static int
fetch_files(int nfiles, char **urls)
{
+ FILE *fetch_out;
+ FILE *file_out;
const char **items;
- FILE *fetch_out, *file_out;
- struct url_stat ustat;
- off_t total_bytes, current_bytes, fsize;
+ int i;
+ int last_progress;
+ int nsuccess = 0; /* Number of files successfully downloaded */
+ int progress = 0;
+ size_t chunk;
+ off_t current_bytes;
+ off_t fsize;
+ off_t total_bytes;
char status[8];
- char errormsg[512];
+ struct url_stat ustat;
+ char errormsg[PATH_MAX + 512];
uint8_t block[4096];
- size_t chunk;
- int i, progress, last_progress;
- int nsuccess = 0; /* Number of files successfully downloaded */
- progress = 0;
-
/* Make the transfer list for dialog */
items = calloc(sizeof(char *), nfiles * 2);
- if (items == NULL) {
- fprintf(stderr, "Out of memory!\n");
- return (-1);
- }
+ if (items == NULL)
+ errx(EXIT_FAILURE, "Out of memory!");
for (i = 0; i < nfiles; i++) {
items[i*2] = strrchr(urls[i], '/');
@@ -177,7 +185,8 @@ fetch_files(int nfiles, char **urls)
}
if (ustat.size > 0) {
- sprintf(status, "-%jd", (fsize*100)/ustat.size);
+ snprintf(status, sizeof(status), "-%jd",
+ (fsize*100)/ustat.size);
items[i*2 + 1] = status;
}
@@ -212,4 +221,3 @@ fetch_files(int nfiles, char **urls)
free(items);
return (nsuccess);
}
-
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index d139b77..2b01dea 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -156,7 +156,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS="
/usr/src
# Create /var and friends
- /var mountpoint=/var
+ /var mountpoint=/var,canmount=off
/var/crash exec=off,setuid=off
/var/log exec=off,setuid=off
/var/mail atime=on
diff --git a/usr.sbin/fdread/fdutil.c b/usr.sbin/fdread/fdutil.c
index c1f4d8f..c66b0c1 100644
--- a/usr.sbin/fdread/fdutil.c
+++ b/usr.sbin/fdread/fdutil.c
@@ -92,6 +92,7 @@ static struct fd_type fd_types_auto[1] =
static struct fd_type fd_types_288m[] = {
+#ifndef PC98
#if 0
{ FDF_3_2880 },
#endif
@@ -102,30 +103,18 @@ static struct fd_type fd_types_288m[] = {
{ FDF_3_820 },
{ FDF_3_800 },
{ FDF_3_720 },
+#endif /* !PC98 */
{ 0,0,0,0,0,0,0,0,0,0,0,0 }
};
static struct fd_type fd_types_144m[] = {
#ifdef PC98
-#if 0
- { FDF_3_1722 },
- { FDF_3_1476 },
-#endif
{ FDF_3_1440 },
{ FDF_3_1200 },
-#if 0
- { FDF_3_820 },
- { FDF_3_800 },
-#endif
{ FDF_3_720 },
{ FDF_3_360 },
{ FDF_3_640 },
{ FDF_3_1230 },
-#if 0
- { FDF_3_1280 },
- { FDF_3_1480 },
- { FDF_3_1640 },
-#endif
{ 0,0,0,0,0,0,0,0,0,0,0,0 }
#else
{ FDF_3_1722 },
@@ -142,17 +131,10 @@ static struct fd_type fd_types_144m[] = {
static struct fd_type fd_types_12m[] = {
#ifdef PC98
{ FDF_5_1200 },
-#if 0
- { FDF_5_820 },
- { FDF_5_800 },
-#endif
{ FDF_5_720 },
{ FDF_5_360 },
{ FDF_5_640 },
{ FDF_5_1230 },
-#if 0
- { FDF_5_1280 },
-#endif
{ 0,0,0,0,0,0,0,0,0,0,0,0 }
#else
{ FDF_5_1200 },
@@ -170,13 +152,17 @@ static struct fd_type fd_types_12m[] = {
static struct fd_type fd_types_720k[] =
{
+#ifndef PC98
{ FDF_3_720 },
+#endif
{ 0,0,0,0,0,0,0,0,0,0,0,0 }
};
static struct fd_type fd_types_360k[] =
{
+#ifndef PC98
{ FDF_5_360 },
+#endif
{ 0,0,0,0,0,0,0,0,0,0,0,0 }
};
diff --git a/usr.sbin/pw/Makefile b/usr.sbin/pw/Makefile
index eae0b87..8c5acf9 100644
--- a/usr.sbin/pw/Makefile
+++ b/usr.sbin/pw/Makefile
@@ -11,4 +11,10 @@ WARNS?= 2
DPADD= ${LIBCRYPT} ${LIBUTIL}
LDADD= -lcrypt -lutil
+.include <src.opts.mk>
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/pw/tests/Makefile b/usr.sbin/pw/tests/Makefile
new file mode 100644
index 0000000..577ea93
--- /dev/null
+++ b/usr.sbin/pw/tests/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.sbin/pw
+
+ATF_TESTS_SH= pw_delete
+
+FILES= group helper_functions.shin master.passwd
+FILESDIR= ${TESTSDIR}
+
+.include <bsd.test.mk>
diff --git a/usr.sbin/pw/tests/group b/usr.sbin/pw/tests/group
new file mode 100644
index 0000000..620c588
--- /dev/null
+++ b/usr.sbin/pw/tests/group
@@ -0,0 +1,3 @@
+# $FreeBSD$
+#
+wheel:*:0:root
diff --git a/usr.sbin/pw/tests/helper_functions.shin b/usr.sbin/pw/tests/helper_functions.shin
new file mode 100755
index 0000000..f87b1e7
--- /dev/null
+++ b/usr.sbin/pw/tests/helper_functions.shin
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+# Workdir to run tests in
+TESTDIR=$(atf_get_srcdir)
+
+# Populate the files pw needs to use into $HOME/etc
+populate_etc_skel() {
+ cp ${TESTDIR}/master.passwd ${HOME} || \
+ atf_fail "Populating master.passwd in ${HOME}"
+ cp ${TESTDIR}/group ${HOME} || atf_fail "Populating group in ${HOME}"
+
+ # Generate the passwd file
+ pwd_mkdb -p -d ${HOME} ${HOME}/master.passwd || \
+ atf_fail "generate passwd from master.passwd"
+}
diff --git a/usr.sbin/pw/tests/master.passwd b/usr.sbin/pw/tests/master.passwd
new file mode 100644
index 0000000..f7dc837
--- /dev/null
+++ b/usr.sbin/pw/tests/master.passwd
@@ -0,0 +1,4 @@
+# $FreeBSD$
+#
+root:*:0:0::0:0:Charlie &:/root:/bin/csh
+toor:*:0:0::0:0:Bourne-again Superuser:/root:
diff --git a/usr.sbin/pw/tests/pw_delete.sh b/usr.sbin/pw/tests/pw_delete.sh
new file mode 100755
index 0000000..0636629
--- /dev/null
+++ b/usr.sbin/pw/tests/pw_delete.sh
@@ -0,0 +1,24 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+# Test that a user can be deleted when another user is part of this
+# user's default group and does not go into an infinate loop.
+# PR: 191427
+atf_test_case rmuser_seperate_group cleanup
+rmuser_seperate_group_head() {
+ atf_set "timeout" "30"
+}
+rmuser_seperate_group_body() {
+ populate_etc_skel
+ pw -V ${HOME} useradd test || atf_fail "Creating test user"
+ pw -V ${HOME} groupmod test -M 'test,root' || \
+ atf_fail "Modifying the group"
+ pw -V ${HOME} userdel test || atf_fail "delete the user"
+}
+
+
+atf_init_test_cases() {
+ atf_add_test_case rmuser_seperate_group
+}
OpenPOWER on IntegriCloud