diff options
author | agc <agc@pkgsrc.org> | 2005-05-04 08:56:49 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 2005-05-04 08:56:49 +0000 |
commit | 4b619e493a636555eae558c968bd885b1cadb9b3 (patch) | |
tree | e607db99d120de7cfd5fb548d2d3631908b65a48 /net | |
parent | e04b9022adaf2ab6e7c8d4497d371484d7a772d8 (diff) | |
download | pkgsrc-4b619e493a636555eae558c968bd885b1cadb9b3.tar.gz |
Initial import of nasd-1.3, a prototype storage implementation, from CMU.
The original tar file has trailing base64 checksums, so I have
repackaged the tar file for just now.
This is release 1.3 of the Parallel Data Laboratory NASD
software prototype. The release includes the NASD drive
prototype, the NASD-NFS filemanager, simple client APIs, a
regression-testing suite, sample programs, a snapshot of
Cheops (which is one implementation of aggregation over
multiple NASDs), and some basic documentation.
Diffstat (limited to 'net')
49 files changed, 4504 insertions, 0 deletions
diff --git a/net/nasd/DESCR b/net/nasd/DESCR new file mode 100644 index 00000000000..8210892ad38 --- /dev/null +++ b/net/nasd/DESCR @@ -0,0 +1,9 @@ +This is release 1.3 of the Parallel Data Laboratory NASD software +prototype. The release includes the NASD drive prototype, the +NASD-NFS filemanager, simple client APIs, a regression-testing suite, +sample programs, a snapshot of Cheops (which is one implementation of +aggregation over multiple NASDs), and some basic documentation. This +release includes ports to run on user-level Linux, user-level Digital +Unix, and in the Digital Unix kernel. A more complete enumeration of +the contents of the release may be found in the ReleaseHistory file at +the root of the distribution. diff --git a/net/nasd/Makefile b/net/nasd/Makefile new file mode 100644 index 00000000000..b1a575cd025 --- /dev/null +++ b/net/nasd/Makefile @@ -0,0 +1,27 @@ +# $NetBSD: Makefile,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +DISTNAME= repackaged-${PKGNAME} +PKGNAME= nasd-1.3 +CATEGORIES= net sysutils +MASTER_SITES= ${MASTER_SITE_LOCAL} # original tar file has some trailing base64 checksums + +MAINTAINER= tech-pkg@NetBSD.org +HOMEPAGE= http://www.pdl.cmu.edu/NASD/Downloads/NASDcode.html +COMMENT= Prototype storage implementation + +ONLY_FOR_PLATFORM= NetBSD-*-* SunOS-*-* Linux-*-* + +USE_IMAKE= yes +USE_PERL5= build +WRKSRC= ${WRKDIR}/${PKGNAME} + +pre-patch: + ${MKDIR} ${WRKSRC}/include/nasd/netbsd + ${MKDIR} ${WRKSRC}/common/netbsd + +do-configure: + cd ${WRKSRC} && ${SETENV} NASD_DESTDIR=${PREFIX}/nasd ./itomf + +.include "../../mk/pthread.buildlink3.mk" + +.include "../../mk/bsd.pkg.mk" diff --git a/net/nasd/PLIST b/net/nasd/PLIST new file mode 100644 index 00000000000..a775130277c --- /dev/null +++ b/net/nasd/PLIST @@ -0,0 +1,217 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ +nasd/bin/cp_nasd +nasd/bin/edrfs_script_client +nasd/bin/edrfs_server +nasd/bin/nasd_edrfs_cat +nasd/bin/nasd_edrfs_dumpattr +nasd/bin/nasd_edrfs_dumpdir +nasd/bin/nasd_edrfs_format +nasd/bin/nasd_edrfs_fsck +nasd/bin/nasd_edrfs_getstats +nasd/bin/nasd_edrfs_remove +nasd/bin/nasd_edrfs_tee +nasd/bin/nasd_script_client +nasd/bin/pcrpart +nasd/bin/pdrive +nasd/bin/pinit +nasd/bin/prshutdown +nasd/bin/psync +nasd/etc/kpbind +nasd/etc/nasd_edrfs_mounts +nasd/include/cryptolib/libcrypt.h +nasd/include/cryptolib/sha.h +nasd/include/cryptolib/sha_locl.h +nasd/include/nasd/dux/nasd_dux_common.h +nasd/include/nasd/dux/nasd_dux_edrfs_mount.h +nasd/include/nasd/dux/nasd_dux_general_simple.h +nasd/include/nasd/dux/nasd_dux_kernel_drive.h +nasd/include/nasd/dux/nasd_dux_mem.h +nasd/include/nasd/dux/nasd_dux_opt.h +nasd/include/nasd/dux/nasd_dux_platform.h +nasd/include/nasd/dux/nasd_dux_sys.h +nasd/include/nasd/dux/nasd_dux_threads_kernel.h +nasd/include/nasd/dux/nasd_dux_timeout_kernel.h +nasd/include/nasd/dux/nasd_edrfs_client_dux.h +nasd/include/nasd/freebsd/nasd_freebsd_general_simple.h +nasd/include/nasd/freebsd/nasd_freebsd_platform.h +nasd/include/nasd/freebsd/nasd_freebsd_sys.h +nasd/include/nasd/generic/nasd_generic_drive.h +nasd/include/nasd/generic/nasd_generic_sock.h +nasd/include/nasd/generic/nasd_generic_srpc.h +nasd/include/nasd/generic/nasd_generic_timer.h +nasd/include/nasd/irix/nasd_irix_common.h +nasd/include/nasd/irix/nasd_irix_general_simple.h +nasd/include/nasd/irix/nasd_irix_platform.h +nasd/include/nasd/irix/nasd_irix_sys.h +nasd/include/nasd/linux/nasd_edrfs_client_linux.h +nasd/include/nasd/linux/nasd_edrfs_client_linux_mount.h +nasd/include/nasd/linux/nasd_linux_common.h +nasd/include/nasd/linux/nasd_linux_general_simple.h +nasd/include/nasd/linux/nasd_linux_kernel_drive.h +nasd/include/nasd/linux/nasd_linux_mem.h +nasd/include/nasd/linux/nasd_linux_platform.h +nasd/include/nasd/linux/nasd_linux_sock.h +nasd/include/nasd/linux/nasd_linux_srpc.h +nasd/include/nasd/linux/nasd_linux_sys.h +nasd/include/nasd/linux/nasd_linux_threads_kernel.h +nasd/include/nasd/linux/nasd_linux_timeout_kernel.h +nasd/include/nasd/mpdrspeed_common.h +nasd/include/nasd/nasd_base_types.h +nasd/include/nasd/nasd_base_types.rpc +nasd/include/nasd/nasd_base_types_marshall.h +nasd/include/nasd/nasd_cache.h +nasd/include/nasd/nasd_cheops_cache.h +nasd/include/nasd/nasd_cheops_client.h +nasd/include/nasd/nasd_cheops_client_internal.h +nasd/include/nasd/nasd_cheops_common.h +nasd/include/nasd/nasd_cheops_ios.h +nasd/include/nasd/nasd_cheops_locks.h +nasd/include/nasd/nasd_cheops_mgr.h +nasd/include/nasd/nasd_cheops_mgr.rpc +nasd/include/nasd/nasd_cheops_mgr_btree.h +nasd/include/nasd/nasd_cheops_mgr_common.h +nasd/include/nasd/nasd_cheops_mgr_cstub.h +nasd/include/nasd/nasd_cheops_mgr_internal.h +nasd/include/nasd/nasd_cheops_mgr_marshall.h +nasd/include/nasd/nasd_cheops_mgr_sst.h +nasd/include/nasd/nasd_cheops_mgr_sstub.h +nasd/include/nasd/nasd_cheops_mgr_structs.h +nasd/include/nasd/nasd_cheops_raidmap.h +nasd/include/nasd/nasd_cheops_types.h +nasd/include/nasd/nasd_cheops_types.rpc +nasd/include/nasd/nasd_cheops_types_marshall.h +nasd/include/nasd/nasd_common.h +nasd/include/nasd/nasd_control.h +nasd/include/nasd/nasd_control.rpc +nasd/include/nasd/nasd_control_marshall.h +nasd/include/nasd/nasd_drive_defaults.h +nasd/include/nasd/nasd_drive_io.h +nasd/include/nasd/nasd_drive_options.h +nasd/include/nasd/nasd_drive_types.h +nasd/include/nasd/nasd_drive_types.rpc +nasd/include/nasd/nasd_drive_types_marshall.h +nasd/include/nasd/nasd_drive_utils.h +nasd/include/nasd/nasd_edrfs_client.h +nasd/include/nasd/nasd_edrfs_client_colocate.h +nasd/include/nasd/nasd_edrfs_client_dce.h +nasd/include/nasd/nasd_edrfs_client_kpdev.h +nasd/include/nasd/nasd_edrfs_client_msgq.h +nasd/include/nasd/nasd_edrfs_client_srpc.h +nasd/include/nasd/nasd_edrfs_error.h +nasd/include/nasd/nasd_edrfs_error.rpc +nasd/include/nasd/nasd_edrfs_error_marshall.h +nasd/include/nasd/nasd_edrfs_internal.h +nasd/include/nasd/nasd_edrfs_mq.h +nasd/include/nasd/nasd_edrfs_pipe.h +nasd/include/nasd/nasd_edrfs_rpc.h +nasd/include/nasd/nasd_edrfs_server.h +nasd/include/nasd/nasd_edrfs_server.rpc +nasd/include/nasd/nasd_edrfs_server_cstub.h +nasd/include/nasd/nasd_edrfs_server_marshall.h +nasd/include/nasd/nasd_edrfs_server_sstub.h +nasd/include/nasd/nasd_edrfs_types.h +nasd/include/nasd/nasd_edrfs_types.rpc +nasd/include/nasd/nasd_edrfs_types_marshall.h +nasd/include/nasd/nasd_error.h +nasd/include/nasd/nasd_error.rpc +nasd/include/nasd/nasd_error_marshall.h +nasd/include/nasd/nasd_freelist.h +nasd/include/nasd/nasd_general.h +nasd/include/nasd/nasd_general_simple.h +nasd/include/nasd/nasd_getopt.h +nasd/include/nasd/nasd_idl_types.h +nasd/include/nasd/nasd_index.h +nasd/include/nasd/nasd_ioqueue.h +nasd/include/nasd/nasd_itypes.h +nasd/include/nasd/nasd_keymgmt_afs.h +nasd/include/nasd/nasd_keymgmt_dr.h +nasd/include/nasd/nasd_layout.h +nasd/include/nasd/nasd_marshall.h +nasd/include/nasd/nasd_marshall_tester.h +nasd/include/nasd/nasd_mem.h +nasd/include/nasd/nasd_mq.h +nasd/include/nasd/nasd_msg.h +nasd/include/nasd/nasd_nonce_mgmt.h +nasd/include/nasd/nasd_od.h +nasd/include/nasd/nasd_od_rpc.h +nasd/include/nasd/nasd_options.h +nasd/include/nasd/nasd_pdev.h +nasd/include/nasd/nasd_pdrive.h +nasd/include/nasd/nasd_pdrive.rpc +nasd/include/nasd/nasd_pdrive_client.h +nasd/include/nasd/nasd_pdrive_client_colocate.h +nasd/include/nasd/nasd_pdrive_client_dce.h +nasd/include/nasd/nasd_pdrive_client_kpdev.h +nasd/include/nasd/nasd_pdrive_client_msgq.h +nasd/include/nasd/nasd_pdrive_client_srpc.h +nasd/include/nasd/nasd_pdrive_cstub.h +nasd/include/nasd/nasd_pdrive_marshall.h +nasd/include/nasd/nasd_pdrive_sstub.h +nasd/include/nasd/nasd_pipe.h +nasd/include/nasd/nasd_pipe_dce.h +nasd/include/nasd/nasd_pipe_shm.h +nasd/include/nasd/nasd_platform.h +nasd/include/nasd/nasd_remote_types.h +nasd/include/nasd/nasd_remote_types.rpc +nasd/include/nasd/nasd_remote_types_marshall.h +nasd/include/nasd/nasd_rpcgen_c.h +nasd/include/nasd/nasd_rpcgen_dceidl.idl +nasd/include/nasd/nasd_rpcgen_glob_param.h +nasd/include/nasd/nasd_security.h +nasd/include/nasd/nasd_security_cl.h +nasd/include/nasd/nasd_security_dr.h +nasd/include/nasd/nasd_shell.h +nasd/include/nasd/nasd_shell_internal.h +nasd/include/nasd/nasd_shutdown.h +nasd/include/nasd/nasd_site.h +nasd/include/nasd/nasd_srpc.h +nasd/include/nasd/nasd_srpc_types.h +nasd/include/nasd/nasd_srpc_types.rpc +nasd/include/nasd/nasd_srpc_types_marshall.h +nasd/include/nasd/nasd_sys.h +nasd/include/nasd/nasd_threads_pthread.h +nasd/include/nasd/nasd_threadstuff.h +nasd/include/nasd/nasd_timeout.h +nasd/include/nasd/nasd_timer.h +nasd/include/nasd/nasd_trace.h +nasd/include/nasd/nasd_trace_dr.h +nasd/include/nasd/nasd_types.h +nasd/include/nasd/nasd_types.rpc +nasd/include/nasd/nasd_types_marshall.h +nasd/include/nasd/nasd_udppipe.h +nasd/include/nasd/nasd_varargs.h +nasd/include/nasd/${LOWER_OPSYS}/nasd_${LOWER_OPSYS}_general_simple.h +nasd/include/nasd/${LOWER_OPSYS}/nasd_${LOWER_OPSYS}_platform.h +nasd/include/nasd/${LOWER_OPSYS}/nasd_${LOWER_OPSYS}_sys.h +nasd/include/nasd/solaris/nasd_solaris_common.h +nasd/include/nasd/solaris/nasd_solaris_general_simple.h +nasd/include/nasd/solaris/nasd_solaris_platform.h +nasd/include/nasd/solaris/nasd_solaris_sys.h +nasd/include/nasd/video/flex-internal.h +nasd/include/nasd/video/merge.h +nasd/include/nasd/video/merge_options.h +nasd/include/nasd/video/mpeg.h +nasd/include/nasd/video/rtsp.h +nasd/include/nasd/vxworks/nasd_vx_threads.h +nasd/lib/libnasd_common.a +nasd/lib/libnasd_crypt.a +nasd/lib/libnasd_drive_client.a +nasd/lib/libnasd_drive_client_sal.a +nasd/lib/libnasd_edrfs_client.a +nasd/lib/libnasd_edrfs_common.a +@dirrm nasd/lib +@dirrm nasd/include/nasd/vxworks +@dirrm nasd/include/nasd/video +@dirrm nasd/include/nasd/solaris +@dirrm nasd/include/nasd/${LOWER_OPSYS} +@dirrm nasd/include/nasd/linux +@dirrm nasd/include/nasd/irix +@dirrm nasd/include/nasd/generic +@dirrm nasd/include/nasd/freebsd +@dirrm nasd/include/nasd/dux +@dirrm nasd/include/nasd +@dirrm nasd/include/cryptolib +@dirrm nasd/include +@dirrm nasd/etc +@dirrm nasd/bin +@dirrm nasd diff --git a/net/nasd/distinfo b/net/nasd/distinfo new file mode 100644 index 00000000000..f723232edab --- /dev/null +++ b/net/nasd/distinfo @@ -0,0 +1,50 @@ +$NetBSD: distinfo,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +SHA1 (repackaged-nasd-1.3.tar.gz) = 8ea5d523cab58bcc6c90ff2b5c1c04c4ff8f3949 +RMD160 (repackaged-nasd-1.3.tar.gz) = a9aaee4722af1e7f1eefe9402c840308a4f95774 +Size (repackaged-nasd-1.3.tar.gz) = 1441892 bytes +SHA1 (patch-aa) = 7da68bff24a20dcfbf0c52794705e0195a7ceb15 +SHA1 (patch-ab) = a564bdd20bb2e7d9944287944e2c758645664357 +SHA1 (patch-ac) = 9dc9d48d4edb63c8b0d5d3711ffe124c92056138 +SHA1 (patch-ad) = c2f25233539ca865eaca0582e0a324c31235cd8b +SHA1 (patch-ae) = ba2fb255cf3de69690c96032a2d9c1d526303fdf +SHA1 (patch-af) = aa13df4f6b277ee40d632ab8fb133da587bdf4de +SHA1 (patch-ag) = 282489b14051332de1fadcdcd7e33e3149f4861b +SHA1 (patch-ah) = e798f6bf29ecbb843683bb682b30702daf5ac650 +SHA1 (patch-ai) = 7bcc3a2b3f39965a66fcc106f1d7ef0de23f1bf3 +SHA1 (patch-aj) = 896cb740a933c1e63aa80d96cdd22522addd868e +SHA1 (patch-ak) = 3a0b8984ab28cb45c5f12eef92eaee38c5d6e466 +SHA1 (patch-al) = 68f8cfa59ff64f5054cabd77b42c74151d951b3f +SHA1 (patch-am) = bf857f131d8761b7ecc85cb92868b6aa2e87f852 +SHA1 (patch-an) = 64a1800990fde4abea27cb5c31b9f611f1ff8106 +SHA1 (patch-ao) = 990215bd2b8e3f5d24535644576d5a9fe9c1551f +SHA1 (patch-ap) = 2365deee966e3875a75bcc4fecc39a6f16e46159 +SHA1 (patch-aq) = 3ef44117e51d822f86d3bd2e22cd17adb32a0875 +SHA1 (patch-ar) = f68e33d00c03a78f0704eea768a05fb5fbe1e234 +SHA1 (patch-as) = fce8cdbac4c6ea7be5e19996cbab0ad2456f3edc +SHA1 (patch-at) = e32cc4d8de875a85afe64e4f02227d65e1407494 +SHA1 (patch-au) = 0e71c4f6fc4c8d6738778674768d68ccd3470b55 +SHA1 (patch-av) = 9cb91b69d51d2405475f82da52dd6a4cd70cf06d +SHA1 (patch-aw) = 80c6972ee555e5082b49b913c82f9d354a8a9ada +SHA1 (patch-ax) = e90ed25da1eed313d1e74a85039e14ed0f831c6a +SHA1 (patch-ay) = 2e1cca1629a7074ed75f06b444b864cbc9f38186 +SHA1 (patch-az) = 977d1114a653d9736ffc72258f1ef8091236a8ed +SHA1 (patch-ba) = 790c5e21999513aeb3f289173ec713d5eb1d68e2 +SHA1 (patch-bb) = 762a89d6d6046f08980b86ee5e5fe9a26cc2a6a4 +SHA1 (patch-bc) = a45305187f6225f138e1f3f75ae45271106aceb7 +SHA1 (patch-bd) = 511c52b9957c703dddbad5c60900f26891fa1ad8 +SHA1 (patch-be) = c09d62108e2a44ac6c81eb8b73a249d47d7d0c0b +SHA1 (patch-bf) = b887cbbfc0b7bd529e5ed9513f9b82d5badce1a0 +SHA1 (patch-bg) = 6d9eee1e06a81adf1b60c7d718fb8b05e8540eaf +SHA1 (patch-bh) = bb5d6c03dbb5235ee410dd36073109825ac4e7ea +SHA1 (patch-bi) = 011ee7d0dc3ebc41937d7369ce4117486941db38 +SHA1 (patch-bj) = a7d25f140acd12019ab5c7cc4dcb2f826e26a035 +SHA1 (patch-bk) = 713ad5458ab83d1e84560ab3d0a03649ec28cf26 +SHA1 (patch-bl) = 0e718e716646bb22a9067880852ed6e3d30a00b5 +SHA1 (patch-bm) = 4af1977a6cb23eccf5336954b98841a80c897ef4 +SHA1 (patch-bn) = 6b340dcef664d13db816730de93209aedbe8a722 +SHA1 (patch-bo) = 438049b1d854789c4d9d5d82d093f1b4d9a34f5b +SHA1 (patch-bp) = 07d965c0a5b52c3dad54b26ae79a15f8fd39c29c +SHA1 (patch-bq) = aa8c03f2899feae06d6e7c79d10ceb7371029b28 +SHA1 (patch-br) = 6dd71a647bb99f2facd3ed139bc55dd23d22836e +SHA1 (patch-bs) = 2244ca43d405cbbd2b2224260d4377b4c6c6a318 diff --git a/net/nasd/patches/patch-aa b/net/nasd/patches/patch-aa new file mode 100644 index 00000000000..d4f2ac25c49 --- /dev/null +++ b/net/nasd/patches/patch-aa @@ -0,0 +1,12 @@ +$NetBSD: patch-aa,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +--- client/nasd_pdrive_client_kpdev.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ client/nasd_pdrive_client_kpdev.c 21 Mar 2005 17:07:17 -0000 1.2 +@@ -37,6 +37,7 @@ + #include <unistd.h> + #include <ctype.h> + #include <string.h> ++#include <errno.h> + + #define KEYCPY(_src_,_dest_) bcopy((char *)(_src_), (char *)(_dest_), NASD_KEY_SZ) + diff --git a/net/nasd/patches/patch-ab b/net/nasd/patches/patch-ab new file mode 100644 index 00000000000..e4f71c8ffa6 --- /dev/null +++ b/net/nasd/patches/patch-ab @@ -0,0 +1,26 @@ +$NetBSD: patch-ab,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +diff -u -r1.1.1.1 -r1.2 +Index: client/nasd_pdrive_client_srpc.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/client/nasd_pdrive_client_srpc.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- client/nasd_pdrive_client_srpc.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ client/nasd_pdrive_client_srpc.c 21 Mar 2005 17:07:17 -0000 1.2 +@@ -1091,10 +1091,10 @@ + mem_list.next = NULL; + + if(sec_param->actual_protection != NASD_NO_PROTECTION) { +- nasd_printf("Security is not enabled for this. To enable security, you would want to: +- 1. Factor out the code to set up a secure pipe write from nasd_cl_srpc_range_write_dr +- 2. put a call to that factored-out code here. +- 3. put appropriate cleanup code at the end of this function\n"); ++ nasd_printf("Security is not enabled for this. To enable security, you would want to:\n" ++ "1. Factor out the code to set up a secure pipe write from nasd_cl_srpc_range_write_dr\n" ++ "2. put a call to that factored-out code here.\n" ++ "3. put appropriate cleanup code at the end of this function\n"); + NASD_ASSERT(0); + } else { + pull_func = nasd_srpc_client_run_serverpull; diff --git a/net/nasd/patches/patch-ac b/net/nasd/patches/patch-ac new file mode 100644 index 00000000000..b19f4226488 --- /dev/null +++ b/net/nasd/patches/patch-ac @@ -0,0 +1,38 @@ +$NetBSD: patch-ac,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/Imakefile +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/common/Imakefile,v +retrieving revision 1.1.1.1 +retrieving revision 1.3 +diff -u -r1.1.1.1 -r1.3 +--- common/Imakefile 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ common/Imakefile 21 Mar 2005 17:07:18 -0000 1.3 +@@ -76,6 +76,19 @@ + i386/nasd_rpcc.o + #endif /* FreeBSDArchitecture */ + ++#ifdef NetBSDArchitecture ++ARCHOBJS = \ ++ generic/incstat.o \ ++ generic/nasd_generic_addts.o \ ++ generic/nasd_generic_timeout.o \ ++ generic/nasd_pthread_support.o \ ++ generic/nasd_generic_gethostbyname.o \ ++ netbsd/nasd_netbsd_basic.o \ ++ netbsd/nasd_netbsd_lseek.o \ ++ netbsd/nasd_netbsd_srv.o \ ++ i386/nasd_rpcc.o ++#endif /* NetBSDArchitecture */ ++ + #ifdef SolarisArchitecture + + #ifdef i386Architecture +@@ -112,6 +125,7 @@ + i386 \ + irix \ + linux \ ++ netbsd \ + solaris \ + vxworks + diff --git a/net/nasd/patches/patch-ad b/net/nasd/patches/patch-ad new file mode 100644 index 00000000000..7d10eab35f7 --- /dev/null +++ b/net/nasd/patches/patch-ad @@ -0,0 +1,21 @@ +$NetBSD: patch-ad,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/nasd_common.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/common/nasd_common.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- common/nasd_common.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ common/nasd_common.c 21 Mar 2005 17:07:18 -0000 1.2 +@@ -35,6 +35,10 @@ + #include <dce/rpc.h> + #endif /* NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE */ + ++#ifdef NETBSD ++#include <errno.h> ++#endif ++ + /* external utility routines */ + extern char* nasd_error_string(nasd_status_t error); + diff --git a/net/nasd/patches/patch-ae b/net/nasd/patches/patch-ae new file mode 100644 index 00000000000..149a5f9ecb8 --- /dev/null +++ b/net/nasd/patches/patch-ae @@ -0,0 +1,19 @@ +$NetBSD: patch-ae,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/nasd_threadstuff.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/common/nasd_threadstuff.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- common/nasd_threadstuff.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ common/nasd_threadstuff.c 21 Mar 2005 17:07:18 -0000 1.2 +@@ -39,7 +39,7 @@ + NASD_SYS_DECLARE_MUTEX(nasd_threads_use_counter_lock) + int nasd_threads_use_counter; + +-#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(IRIX) ++#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) + #define NASD_ATOMIC_GLOBAL_MUTEX 1 + NASD_SYS_DECLARE_MUTEX(nasd_atomic_global_mutex) + #endif /* LINUX || FREEBSD || SOLARIS || IRIX */ diff --git a/net/nasd/patches/patch-af b/net/nasd/patches/patch-af new file mode 100644 index 00000000000..ce9ee1e9df7 --- /dev/null +++ b/net/nasd/patches/patch-af @@ -0,0 +1,39 @@ +$NetBSD: patch-af,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/generic/Imakefile +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/common/generic/Imakefile,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- common/generic/Imakefile 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ common/generic/Imakefile 21 Mar 2005 17:07:19 -0000 1.2 +@@ -32,13 +32,13 @@ + THREAD_SRCS = nasd_pthread_support.c + THREAD_OBJS = nasd_pthread_support.o + +-#if defined(IRIXArchitecture) || defined(FreeBSDArchitecture) ++#if defined(IRIXArchitecture) || defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) + GHBN_SRCS = nasd_generic_gethostbyname.c + GHBN_OBJS = nasd_generic_gethostbyname.o +-#endif /* IRIXArchitecture || FreeBSDArchitecture */ ++#endif /* IRIXArchitecture || FreeBSDArchitecture || NetBSDArchitecture */ + +-GHBN_SRCS := nasd_generic_hostlocal.c +-GHBN_OBJS := nasd_generic_hostlocal.o ++GHLOCAL_SRCS := nasd_generic_hostlocal.c ++GHLOCAL_OBJS := nasd_generic_hostlocal.o + + #if !defined(AlphaArchitecture) + ATOMIC_SRCS = incstat.c nasd_generic_addts.c +@@ -62,8 +62,8 @@ + + #endif /* BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_SRPC */ + +-SRCS = $(ATOMIC_SRCS) $(TIMEOUT_SRCS) $(THREAD_SRCS) $(RPC_SRCS) $(GHBN_SRCS) +-OBJS = $(ATOMIC_OBJS) $(TIMEOUT_OBJS) $(THREAD_OBJS) $(RPC_OBJS) $(GHBN_OBJS) ++SRCS = $(ATOMIC_SRCS) $(TIMEOUT_SRCS) $(THREAD_SRCS) $(RPC_SRCS) $(GHBN_SRCS) $(GHLOCAL_SRCS) ++OBJS = $(ATOMIC_OBJS) $(TIMEOUT_OBJS) $(THREAD_OBJS) $(RPC_OBJS) $(GHBN_OBJS) $(GHLOCAL_OBJS) + + all:: $(OBJS) + diff --git a/net/nasd/patches/patch-ag b/net/nasd/patches/patch-ag new file mode 100644 index 00000000000..9dd955a0a11 --- /dev/null +++ b/net/nasd/patches/patch-ag @@ -0,0 +1,144 @@ +$NetBSD: patch-ag,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/generic/nasd_pthread_support.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/common/generic/nasd_pthread_support.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- common/generic/nasd_pthread_support.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ common/generic/nasd_pthread_support.c 21 Mar 2005 17:07:19 -0000 1.2 +@@ -34,10 +34,10 @@ + pthread_condattr_t nasd_pthread_cond_attr; + int nasd_pthread_mutex_attr_good = 0; + int nasd_pthread_cond_attr_good = 0; +-#ifdef SOLARIS ++#if defined(SOLARIS) || defined(NETBSD) + int nasd_pthread_thread_attr_good = 0; + pthread_attr_t nasd_pthread_thread_attr; +-#endif /* SOLARIS */ ++#endif /* SOLARIS || NETBSD */ + + nasd_status_t + nasd_sys_threads_init() +@@ -65,7 +65,7 @@ + ret = pthread_mutexattr_create(&nasd_pthread_mutex_attr); + if (ret) + return(NASD_FAIL); +-#if !defined(FREEBSD) && !defined(SOLARIS) && !defined(IRIX) && !defined(LINUX) ++#if !defined(FREEBSD) && !defined(SOLARIS) && !defined(IRIX) && !defined(LINUX) && !defined(NETBSD) + /* XXX - RH61 port */ + /* not supported by FreeBSD's threads library */ + ret = pthread_mutexattr_setkind_np(&nasd_pthread_mutex_attr, MUTEX_FAST_NP); +@@ -73,7 +73,7 @@ + pthread_mutexattr_delete(&nasd_pthread_mutex_attr); + return(NASD_FAIL); + } +-#endif /* !FREEBSD && !SOLARIS && !IRIX */ ++#endif /* !FREEBSD && !SOLARIS && !IRIX && !NETBSD */ + ret = pthread_condattr_create(&nasd_pthread_cond_attr); + if (ret) { + pthread_mutexattr_delete(&nasd_pthread_mutex_attr); +@@ -127,13 +127,13 @@ + if (rc) + return(NASD_FAIL); + #else /* DEC_OSF || (LINUX && (NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE)) */ +-#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(IRIX) ++#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) + if (nasd_pthread_mutex_attr_good == 0) + return(NASD_FAIL); + rc = pthread_mutex_init(m, &nasd_pthread_mutex_attr); + if (rc) + return(NASD_FAIL); +-#else /* LINUX || FREEBSD || SOLARIS || IRIX */ ++#else /* LINUX || FREEBSD || SOLARIS || IRIX || NETBSD */ + #ifdef AIX + rc = pthread_mutex_init(m, &pthread_mutexattr_default); + if (rc) +@@ -141,7 +141,7 @@ + #else + #error "don't know how to call pthread_mutex_init on your platform" + #endif /* AIX */ +-#endif /* LINUX || FREEBSD || SOLARIS || IRIX */ ++#endif /* LINUX || FREEBSD || SOLARIS || IRIX || NETBSD */ + #endif /* DEC_OSF || (LINUX && (NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE)) */ + #endif /* PTHREAD_EXC */ + return(NASD_SUCCESS); +@@ -180,7 +180,7 @@ + #ifdef DEC_OSF + rc = pthread_cond_init(c, pthread_condattr_default); + #else /* DEC_OSF */ +-#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(IRIX) ++#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) + if (nasd_pthread_cond_attr_good == 0) + return(NASD_FAIL); + #if NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE +@@ -188,13 +188,13 @@ + #else /* NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE */ + rc = pthread_cond_init(c, &nasd_pthread_cond_attr); + #endif /* NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE */ +-#else /* LINUX || FREEBSD || SOLARIS || IRIX */ ++#else /* LINUX || FREEBSD || SOLARIS || IRIX || NETBSD */ + #ifdef AIX + rc = pthread_cond_init(c, &pthread_condattr_default); + #else /* AIX */ + #error "don't know how to call pthread_cond_init on your platform" + #endif /* AIX */ +-#endif /* LINUX || FREEBSD || SOLARIS || IRIX*/ ++#endif /* LINUX || FREEBSD || SOLARIS || IRIX || NETBSD */ + #endif /* DEC_OSF */ + if (rc) + return(NASD_FAIL); +@@ -335,14 +335,14 @@ + *sizep = size; + return(NASD_SUCCESS); + #else /* IRIX */ +-#if defined(FREEBSD) || defined(SOLARIS) ++#if defined(FREEBSD) || defined(SOLARIS) || defined(NETBSD) + int ret; + + ret = pthread_attr_getstacksize(attrp, sizep); + if (ret != 0) + return NASD_FAIL; + return NASD_SUCCESS; +-#else /* FREEBSD || SOLARIS */ ++#else /* FREEBSD || SOLARIS || NETBSD */ + long size; + + size = pthread_attr_getstacksize(*attrp); +@@ -350,7 +350,7 @@ + return(NASD_FAIL); + *sizep = (int)size; + return(NASD_SUCCESS); +-#endif /* FREEBSD || SOLARIS */ ++#endif /* FREEBSD || SOLARIS || NETBSD */ + #endif /* IRIX */ + } + +@@ -387,20 +387,20 @@ + ret = pthread_create(threadp, NULL, + (pthread_startroutine_t)func, arg); + #else /* LINUX && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE) */ +-#ifdef SOLARIS ++# if defined(SOLARIS) || defined(NETBSD) + if (nasd_pthread_thread_attr_good == 0) + return(NASD_FAIL); + ret = pthread_create(threadp, &nasd_pthread_thread_attr, + (pthread_startroutine_t)func, arg); +-#else /* SOLARIS */ +-#ifdef IRIX ++# else /* SOLARIS || NETBSD */ ++# ifdef IRIX + ret = pthread_create(threadp, NULL, + (pthread_startroutine_t)func, arg); +-#else /* IRIX */ ++# else /* IRIX */ + ret = pthread_create(threadp, pthread_attr_default, + (pthread_startroutine_t)func, arg); +-#endif /* IRIX */ +-#endif /* SOLARIS */ ++# endif /* IRIX */ ++# endif /* SOLARIS || NETBSD */ + #endif /* LINUX && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE) */ + if (ret) + return(NASD_FAIL); diff --git a/net/nasd/patches/patch-ah b/net/nasd/patches/patch-ah new file mode 100644 index 00000000000..77d4ab1701d --- /dev/null +++ b/net/nasd/patches/patch-ah @@ -0,0 +1,57 @@ +$NetBSD: patch-ah,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/netbsd/Imakefile +=================================================================== +RCS file: common/netbsd/Imakefile +diff -N common/netbsd/Imakefile +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ common/netbsd/Imakefile 21 Mar 2005 17:07:21 -0000 1.2 +@@ -0,0 +1,48 @@ ++/* ++ * Imakefile ++ * ++ * Author: Marc Unangst ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1998,1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++#include "NASD.tmpl" ++ ++#if defined(NetBSDArchitecture) ++ ++SRCS = \ ++ nasd_netbsd_basic.c \ ++ nasd_netbsd_lseek.c \ ++ nasd_netbsd_srv.c ++ ++OBJS = \ ++ nasd_netbsd_basic.o \ ++ nasd_netbsd_lseek.o \ ++ nasd_netbsd_srv.o ++ ++all:: ${OBJS} ++ ++NASD_Depend() ++ ++#endif /* NetBSDArchitecture */ ++ ++/* ++ * Don't put anything after this ++ */ ++#include "NASD.trailer" diff --git a/net/nasd/patches/patch-ai b/net/nasd/patches/patch-ai new file mode 100644 index 00000000000..4b98a14ca19 --- /dev/null +++ b/net/nasd/patches/patch-ai @@ -0,0 +1,105 @@ +$NetBSD: patch-ai,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/netbsd/nasd_netbsd_basic.c +=================================================================== +RCS file: common/netbsd/nasd_netbsd_basic.c +diff -N common/netbsd/nasd_netbsd_basic.c +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ common/netbsd/nasd_netbsd_basic.c 21 Mar 2005 08:55:38 -0000 1.1 +@@ -0,0 +1,96 @@ ++/* ++ * nasd_netbsd_basic.c ++ * ++ * Basic system support stuff ++ * ++ * Authors: Marc Unangst, Jim Zelenka, Sean Levy ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1998,1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++ ++#include <nasd/nasd_options.h> ++#include <nasd/nasd_types.h> ++#include <nasd/nasd_mem.h> ++#include <nasd/nasd_threadstuff.h> ++#include <nasd/nasd_timer.h> ++#include <nasd/nasd_common.h> ++#include <nasd/nasd_sys.h> ++#include <sys/time.h> ++#include <fcntl.h> ++#include <netdb.h> ++#include <netinet/in.h> ++#include <arpa/inet.h> ++#include <unistd.h> ++#include <ctype.h> ++ ++static nasd_timespec_t nasd_netbsd_last_time = {0,0}; ++static nasd_timespec_t nasd_netbsd_uniq_time = {0,0}; ++ ++NASD_DECLARE_MUTEX(nasd_netbsd_dns_lock); ++ ++void ++nasd_gettime( ++ nasd_timespec_t *tm) ++{ ++ struct timeval tv; ++ ++ gettimeofday(&tv, NULL); ++ ++ tm->ts_sec = tv.tv_sec; ++ tm->ts_nsec = tv.tv_usec*1000; ++ if ((tm->ts_sec == nasd_netbsd_last_time.ts_sec) ++ && (tm->ts_nsec == nasd_netbsd_last_time.ts_nsec)) ++ { ++ nasd_netbsd_uniq_time.ts_nsec++; ++ if (nasd_netbsd_uniq_time.ts_nsec >= NASD_NSEC_PER_SEC) { ++ nasd_netbsd_uniq_time.ts_nsec -= NASD_NSEC_PER_SEC; ++ nasd_netbsd_uniq_time.ts_sec++; ++ } ++ *tm = nasd_netbsd_uniq_time; ++ } ++ else { ++ nasd_netbsd_last_time = *tm; ++ nasd_netbsd_uniq_time = nasd_netbsd_last_time; ++ } ++} ++ ++nasd_status_t ++nasd_sys_init() ++{ ++ nasd_status_t rc; ++ ++ nasd_get_clock_speed(&nasd_ctimer_ticks); ++ rc = pthread_mutex_init(&nasd_netbsd_dns_lock, NULL); ++ if(rc) ++ return NASD_FAIL; ++ ++ return(NASD_SUCCESS); ++} ++ ++void ++nasd_sys_shutdown(void) ++{ ++ return; ++} ++ ++/* Local Variables: */ ++/* indent-tabs-mode: nil */ ++/* tab-width: 2 */ ++/* End: */ diff --git a/net/nasd/patches/patch-aj b/net/nasd/patches/patch-aj new file mode 100644 index 00000000000..e75ace3582b --- /dev/null +++ b/net/nasd/patches/patch-aj @@ -0,0 +1,53 @@ +$NetBSD: patch-aj,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/netbsd/nasd_netbsd_lseek.c +=================================================================== +RCS file: common/netbsd/nasd_netbsd_lseek.c +diff -N common/netbsd/nasd_netbsd_lseek.c +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ common/netbsd/nasd_netbsd_lseek.c 21 Mar 2005 22:29:37 -0000 1.1 +@@ -0,0 +1,44 @@ ++/* nasd_netbsd_lseek.c ++ * ++ * lseek() front-end for NetBSD userland ++ * ++ * Author: Nat Lanza ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++#include <nasd/nasd_options.h> ++#include <nasd/nasd_types.h> ++#include <nasd/nasd_common.h> ++#include <nasd/nasd_sys.h> ++#include <nasd/nasd_general.h> ++ ++#include <errno.h> ++#include <unistd.h> ++ ++nasd_uint64 ++nasd_lseek(int fd, nasd_uint64 offset, int whence, int *err) ++{ ++ off_t result; ++ ++ errno = 0; ++ result = lseek(fd, offset, whence); ++ *err = errno; ++ return result; ++} diff --git a/net/nasd/patches/patch-ak b/net/nasd/patches/patch-ak new file mode 100644 index 00000000000..4d71ab3a0bc --- /dev/null +++ b/net/nasd/patches/patch-ak @@ -0,0 +1,49 @@ +$NetBSD: patch-ak,v 1.1.1.1 2005/05/04 08:56:49 agc Exp $ + +Index: common/netbsd/nasd_netbsd_srv.c +=================================================================== +RCS file: common/netbsd/nasd_netbsd_srv.c +diff -N common/netbsd/nasd_netbsd_srv.c +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ common/netbsd/nasd_netbsd_srv.c 21 Mar 2005 08:55:38 -0000 1.1 +@@ -0,0 +1,40 @@ ++/* ++ * nasd_freebsd_srv.c ++ * ++ * nasd_srv() for NetBSD ++ * ++ * Author: Marc Unangst ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1998,1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++ ++#include <nasd/nasd_options.h> ++#include <nasd/nasd_sys.h> ++ ++int ++nasd_srv(int cmd, void *arg) ++{ ++ return ENOSYS; ++} ++ ++/* Local Variables: */ ++/* indent-tabs-mode: nil */ ++/* tab-width: 2 */ ++/* End: */ diff --git a/net/nasd/patches/patch-al b/net/nasd/patches/patch-al new file mode 100644 index 00000000000..c78faee05f2 --- /dev/null +++ b/net/nasd/patches/patch-al @@ -0,0 +1,56 @@ +$NetBSD: patch-al,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: config/NASD.tmpl +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/config/NASD.tmpl,v +retrieving revision 1.1.1.1 +retrieving revision 1.3 +diff -u -r1.1.1.1 -r1.3 +--- config/NASD.tmpl 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ config/NASD.tmpl 21 Mar 2005 22:36:25 -0000 1.3 +@@ -167,7 +167,7 @@ + */ + #define NASD_MakeSubdirs(_dirs_) NamedTargetSubdirs(all,_dirs_,"Making",PassCDebugFlags,all) + #else /* AIXArchitecture && (NASD_OSMajorVersion == 4) */ +-#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) ++#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) + /* + * The XFree86 NamedTargetSubdirs macro was written by + * some weeder who just didn't grasp the beauty of +@@ -188,7 +188,7 @@ + exit $$status; \ @@\ + fi \ @@\ + done +-#endif /* LinuxArchitecture || FreeBSDArchitecture */ ++#endif /* LinuxArchitecture || FreeBSDArchitecture || NetBSDArchitecture */ + /* + * Everything else + */ +@@ -407,7 +407,7 @@ + PULLINSYMS = -include ${NASD_KMOD_INCDIR}/nasd/nasd_linux_common_syms.ver.h + + .c.o: +- $(CC) -c $(CFLAGS) $(NASD_DEFAULTCFLAGS) $(PULLINSYMS) $(NASD_LCFLAGS) $< ++ $(CC) -c $(CFLAGS) -pthread $(NASD_DEFAULTCFLAGS) $(PULLINSYMS) $(NASD_LCFLAGS) $< + + #ifndef NASD_OverrideCOTarget + #define NASD_OverrideCOTarget +@@ -432,7 +432,7 @@ + program: objects deplibs @@\ + RemoveTargetProgram($@) @@\ + RemoveTargetProgram(a.out) @@\ +- $(CC) -o a.out objects $(LDOPTIONS) locallibs $(LDLIBS) syslibs $(ARCHLIBS) $(EXTRA_LOAD_FLAGS) @@\ ++ $(CC) -o a.out objects $(LDOPTIONS) locallibs $(LDLIBS) syslibs $(ARCHLIBS) -lpthread $(EXTRA_LOAD_FLAGS) @@\ + $(MV) a.out $@ @@\ + @@\ + clean:: @@\ +@@ -821,7 +821,8 @@ + NASD_SayVar(NASD_RPC_PACKAGE_DEFINES) + NASD_SayVar(NASD_CMU_PDLDEFINES) + +-#ifdef FreeBSDArchitecture ++ ++#if defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) + /* FreeBSD's make automatically looks for .depend, but gmake doesn't. */ + #undef IncludeMakefile + #define IncludeMakefile(file) @@-include file diff --git a/net/nasd/patches/patch-am b/net/nasd/patches/patch-am new file mode 100644 index 00000000000..520cd1595ab --- /dev/null +++ b/net/nasd/patches/patch-am @@ -0,0 +1,45 @@ +$NetBSD: patch-am,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: drive/nasd_cbasic.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/drive/nasd_cbasic.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- drive/nasd_cbasic.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ drive/nasd_cbasic.c 21 Mar 2005 17:07:23 -0000 1.2 +@@ -399,7 +399,7 @@ + return(rc); + } + +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_unusedq,ent,l); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_unusedq,ent,lnext,lprev); + } + + nasd_printf("DRIVE: allocated cache\n"); +@@ -487,7 +487,7 @@ + + for(i=0;i<NASD_ODC_NLRUS;i++) { + while(NASD_ODC_Q_SIZE(&nasd_odc_lru[i])) { +- NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_lru[i],ent,l); ++ NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_lru[i],ent,lnext,lprev); + nasd_odc_free_ent(ent); + } + NASD_ASSERT(nasd_odc_lru[i].head.lprev == &nasd_odc_lru[i].head); +@@ -495,14 +495,14 @@ + } + + while(NASD_ODC_Q_SIZE(&nasd_odc_unusedq)) { +- NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_unusedq,ent,l); ++ NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_unusedq,ent,lnext,lprev); + nasd_odc_free_ent(ent); + } + NASD_ASSERT(nasd_odc_unusedq.head.lprev == &nasd_odc_unusedq.head); + NASD_ASSERT(nasd_odc_unusedq.head.lnext == &nasd_odc_unusedq.head); + + while(NASD_ODC_Q_SIZE(&nasd_odc_wireq)) { +- NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + nasd_odc_free_ent(ent); + } + NASD_ASSERT(nasd_odc_wireq.head.lprev == &nasd_odc_wireq.head); diff --git a/net/nasd/patches/patch-an b/net/nasd/patches/patch-an new file mode 100644 index 00000000000..d984e2ce3c9 --- /dev/null +++ b/net/nasd/patches/patch-an @@ -0,0 +1,355 @@ +$NetBSD: patch-an,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: drive/nasd_cblock.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/drive/nasd_cblock.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- drive/nasd_cblock.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ drive/nasd_cblock.c 21 Mar 2005 17:07:23 -0000 1.2 +@@ -72,7 +72,7 @@ + + #define NASD_ODC_LOGICAL_INDEX_DEL(_ent_) { \ + NASD_ASSERT((_ent_)->lru_flags&NASD_CL_LINDEX); \ +- NASD_ODC_Q_DEQ_NOLOCK(ent,lh); \ ++ NASD_ODC_Q_DEQ_NOLOCK(ent,lhnext,lhprev); \ + (_ent_)->lru_flags &= ~NASD_CL_LINDEX; \ + } + +@@ -103,7 +103,7 @@ + NASD_ASSERT(!((_ne_)->dirty_flags&NASD_CR_DIRTY_Q)); \ + NASD_ASSERT((_ne_)->refcnt == 1); \ + (_ne_)->lru_flags &= ~NASD_CL_LRU_Q; \ +- NASD_ODC_Q_DEQ_NOLOCK((_ne_),l); \ ++ NASD_ODC_Q_DEQ_NOLOCK((_ne_),lnext,lprev); \ + nasd_odc_lru[(_ne_)->lru_num].size--; \ + (_ne_)->lru_num = NASD_ODC_LRU_NONE; \ + } \ +@@ -194,7 +194,7 @@ + } + else { + /* protected by LRU lock */ +- NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_unusedq,ent,l); ++ NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_unusedq,ent,lnext,lprev); + *entp = ent; + NASD_ODC_CSINC(alloc_succeed); + rc = NASD_SUCCESS; +@@ -278,7 +278,7 @@ + if (NASD_ODC_Q_SIZE(&nasd_odc_lru[lru_num]) == 0) + continue; + /* found an entry, dequeue it into ent */ +- NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_lru[lru_num],ent,l); ++ NASD_ODC_Q_DEQ_TAIL_NOLOCK(&nasd_odc_lru[lru_num],ent,lnext,lprev); + ent->chances++; + #if NASD_DRIVE_BLOCK_REPLACEMENT == 1 + /* +@@ -287,7 +287,7 @@ + * because it's in the LRU. + */ + if (ent->chances < nasd_odc_chances[ent->type]) { +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_lru[lru_num],ent,l); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_lru[lru_num],ent,lnext,lprev); + goto find_block; + } + #endif /* NASD_DRIVE_BLOCK_REPLACEMENT == 1 */ +@@ -310,14 +310,14 @@ + /* node block with child blocks in cache (or deleting) */ + NASD_ASSERT(ent->type == NASD_ODC_T_NODE); + ent->lru_num = lru_num; +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_lru[lru_num],ent,l); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_lru[lru_num],ent,lnext,lprev); + ent->lru_flags |= NASD_CL_LRU_Q; + NASD_ODC_CSINC(grab_stillref); + goto find_block; + } + ent->chances = 0; + /* remove from hash bucket */ +- NASD_ODC_Q_DEQ_NOLOCK(ent,h); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,hnext,hprev); + ent->hbucket->size--; + ent->hbucket = NULL; + *entp = ent; +@@ -332,7 +332,7 @@ + } + /* remove from node-member list if applicable */ + if (ent->node_ent) { +- NASD_ODC_Q_DEQ_NOLOCK(ent,o); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,onext,oprev); + ne = ent->node_ent; + ent->node_ent = NULL; + LOSE_IREF(ne); +@@ -527,7 +527,7 @@ + NASD_ASSERT(!(ent->lru_flags&NASD_CL_LRU_Q)); + ent->lru_num = lru_num; + ent->chances = 0; +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_lru[lru_num],ent,l); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_lru[lru_num],ent,lnext,lprev); + ent->lru_flags |= NASD_CL_LRU_Q; + /* + * We used to only broadcast this when the queue size went +@@ -737,7 +737,7 @@ + ent->lru_flags &= ~NASD_CL_REMOVING; + if (ent->node_ent) { + NASD_ODC_CHECK_NODE_ENT(ent->node_ent); +- NASD_ODC_Q_DEQ_NOLOCK(ent,o); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,onext,oprev); + LOSE_IREF(ent->node_ent); + ent->node_ent = NULL; + } +@@ -782,7 +782,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_NPT == 1 */ + #if NASD_DRIVE_WIRE_NPT == 2 +@@ -790,7 +790,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_NPT == 2 */ + #if NASD_DRIVE_WIRE_REFCNT > 0 +@@ -798,7 +798,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_REFCNT > 0 */ + if (node_ent) { +@@ -823,7 +823,7 @@ + NASD_ASSERT(!(ent->dirty_flags&NASD_CR_DIRTY_Q)); + NASD_ASSERT(ent->refcnt == 1); + ent->lru_flags &= ~NASD_CL_LRU_Q; +- NASD_ODC_Q_DEQ_NOLOCK(ent,l); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,lnext,lprev); + nasd_odc_lru[ent->lru_num].size--; + ent->lru_num = NASD_ODC_LRU_NONE; + } +@@ -832,7 +832,7 @@ + NASD_ASSERT(!(ent->lru_flags&NASD_CL_LRU_Q)); + NASD_ASSERT(ent->refcnt == 2); + ent->dirty_flags &= ~NASD_CR_DIRTY_Q; +- NASD_ODC_Q_DEQ_NOLOCK(ent,d); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,dnext,dprev); + ent->refcnt--; + } + } +@@ -885,7 +885,7 @@ + nasd_nl_reg_init_ent(e); + #endif /* NASD_NL_REG_SCOREBOARD > 0 */ + e->hbucket = bucket; +- NASD_ODC_Q_INS_NOLOCK(bucket,e,h); ++ NASD_ODC_Q_INS_NOLOCK(bucket,e,hnext,hprev); + unghost_lookup: + /* try to alloc an entry */ + rc = nasd_odc_block_grab(&ent, ((flags&NASD_ODC_L_BLOCK) ? 1 : 0)); +@@ -925,7 +925,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_NPT == 1 */ + #if NASD_DRIVE_WIRE_NPT == 2 +@@ -933,7 +933,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_NPT == 2 */ + } +@@ -971,7 +971,7 @@ + we_give_up: + NASD_ASSERT(e->refcnt == 1); + e->refcnt = 0; +- NASD_ODC_Q_DEQ_NOLOCK(e,h); ++ NASD_ODC_Q_DEQ_NOLOCK(e,hnext,hprev); + e->hbucket->size--; + e->hbucket = NULL; + otype = e->type; +@@ -1087,7 +1087,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_NPT == 1 */ + #if NASD_DRIVE_WIRE_NPT == 2 +@@ -1095,7 +1095,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_NPT == 2 */ + return(NASD_SUCCESS); +@@ -1172,7 +1172,7 @@ + ent->lru_flags &= ~NASD_CL_REMOVING; + if (ent->node_ent && (ent->node_ent != node_ent)) { + NASD_ODC_CHECK_NODE_ENT(ent->node_ent); +- NASD_ODC_Q_DEQ_NOLOCK(ent,o); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,onext,oprev); + LOSE_IREF(ent->node_ent); + ent->node_ent = NULL; + if (node_ent) { +@@ -1195,7 +1195,7 @@ + NASD_ASSERT(!(ent->dirty_flags&NASD_CR_DIRTY_Q)); + NASD_ASSERT(ent->refcnt == 1); + ent->lru_flags &= ~NASD_CL_LRU_Q; +- NASD_ODC_Q_DEQ_NOLOCK(ent,l); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,lnext,lprev); + nasd_odc_lru[ent->lru_num].size--; + ent->lru_num = NASD_ODC_LRU_NONE; + } +@@ -1204,7 +1204,7 @@ + NASD_ASSERT(!(ent->lru_flags&NASD_CL_LRU_Q)); + NASD_ASSERT(ent->refcnt == 2); + ent->dirty_flags &= ~NASD_CR_DIRTY_Q; +- NASD_ODC_Q_DEQ_NOLOCK(ent,d); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,dnext,dprev); + ent->refcnt--; + } + } +@@ -1256,7 +1256,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_NPT == 1 */ + #if NASD_DRIVE_WIRE_NPT == 2 +@@ -1264,7 +1264,7 @@ + /* mark it wired */ + ent->lru_flags |= NASD_CL_WIRED; + /* record in wireq (list of wired blocks) */ +- NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,w); ++ NASD_ODC_Q_INS_NOLOCK(&nasd_odc_wireq,ent,wnext,wprev); + } + #endif /* NASD_DRIVE_WIRE_NPT == 2 */ + } +@@ -1346,7 +1346,7 @@ + NASD_WAIT_COND(ent->cond,nasd_odc_lru_mutex); + } + ent->refcnt = 0; +- NASD_ODC_Q_DEQ_NOLOCK(ent,h); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,hnext,hprev); + ent->hbucket->size--; + ent->hbucket = NULL; + nasd_odc_put_ent(ent); +@@ -1453,7 +1453,7 @@ + NASD_WAIT_COND(ent->cond,nasd_odc_lru_mutex); + } + ent->refcnt = 0; +- NASD_ODC_Q_DEQ_NOLOCK(ent,h); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,hnext,hprev); + ent->hbucket->size--; + ent->hbucket = NULL; + otype = ent->type; +@@ -1989,10 +1989,10 @@ + NASD_DIRTY_UNLOCK(); + ent->data_flags |= NASD_CD_INVALID; + ent->type = NASD_ODC_T_FREE; +- NASD_ODC_Q_INS(&nasd_odc_unusedq,ent,l); ++ NASD_ODC_Q_INS(&nasd_odc_unusedq,ent,lnext,lprev); + ent->lru_flags &= ~NASD_CL_REMOVING; + /* remove from hash bucket */ +- NASD_ODC_Q_DEQ_NOLOCK(ent,h); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,hnext,hprev); + ent->hbucket->size--; + ent->hbucket = NULL; + /* remove from identity hash */ +@@ -2004,7 +2004,7 @@ + } + /* remove from node-member list iff applicable */ + if (ent->node_ent) { +- NASD_ODC_Q_DEQ_NOLOCK(ent,o); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,onext,oprev); + ne = ent->node_ent; + ent->node_ent = NULL; + LOSE_IREF(ne); +@@ -2075,7 +2075,7 @@ + */ + NASD_ASSERT(e->lru_flags&NASD_CL_LRU_Q); + e->lru_flags &= ~NASD_CL_LRU_Q; +- NASD_ODC_Q_DEQ_NOLOCK(e,l); ++ NASD_ODC_Q_DEQ_NOLOCK(e,lnext,lprev); + irefonly: + NASD_ASSERT((e->lru_num >= 0) && (e->lru_num < NASD_ODC_NLRUS)); + nasd_odc_lru[e->lru_num].size--; +@@ -2086,7 +2086,7 @@ + else { + NASD_ASSERT(e->lru_flags&NASD_CL_LRU_Q); + e->lru_flags &= ~NASD_CL_LRU_Q; +- NASD_ODC_Q_DEQ_NOLOCK(e,l); ++ NASD_ODC_Q_DEQ_NOLOCK(e,lnext,lprev); + nasd_odc_lru[e->lru_num].size--; + e->lru_num = NASD_ODC_LRU_NONE; + noref: +@@ -2113,7 +2113,7 @@ + NASD_ODC_LRU_LOCK(); + + ent->hbucket = bucket; +- NASD_ODC_Q_INS_NOLOCK(bucket,ent,h); ++ NASD_ODC_Q_INS_NOLOCK(bucket,ent,hnext,hprev); + + NASD_ODC_LRU_UNLOCK(); + } +@@ -2172,7 +2172,7 @@ + NASD_ASSERT(!(e->dirty_flags&NASD_CR_DIRTY_Q)); + NASD_ASSERT(e->refcnt == 0); + e->lru_flags &= ~NASD_CL_LRU_Q; +- NASD_ODC_Q_DEQ_NOLOCK(e,l); ++ NASD_ODC_Q_DEQ_NOLOCK(e,lnext,lprev); + nasd_odc_lru[e->lru_num].size--; + e->lru_num = NASD_ODC_LRU_NONE; + } +@@ -2181,7 +2181,7 @@ + NASD_ASSERT(!(e->lru_flags&NASD_CL_LRU_Q)); + NASD_ASSERT(e->refcnt == 1); + e->dirty_flags &= ~NASD_CR_DIRTY_Q; +- NASD_ODC_Q_DEQ_NOLOCK(e,d); ++ NASD_ODC_Q_DEQ_NOLOCK(e,dnext,dprev); + /* we now "own" the ref on this block */ + wait_ent = e; + goto check_complete; +@@ -2298,7 +2298,7 @@ + NASD_ASSERT(!(e->dirty_flags&NASD_CR_DIRTY_Q)); + NASD_ASSERT(e->refcnt == 0); + e->lru_flags &= ~NASD_CL_LRU_Q; +- NASD_ODC_Q_DEQ_NOLOCK(e,l); ++ NASD_ODC_Q_DEQ_NOLOCK(e,lnext,lprev); + nasd_odc_lru[e->lru_num].size--; + e->lru_num = NASD_ODC_LRU_NONE; + } +@@ -2307,7 +2307,7 @@ + NASD_ASSERT(!(e->lru_flags&NASD_CL_LRU_Q)); + NASD_ASSERT(e->refcnt == 1); + e->dirty_flags &= ~NASD_CR_DIRTY_Q; +- NASD_ODC_Q_DEQ_NOLOCK(e,d); ++ NASD_ODC_Q_DEQ_NOLOCK(e,dnext,dprev); + /* we now "own" the ref on this block */ + wait_ent = e; + goto check_complete; +@@ -2402,7 +2402,7 @@ + for(e=ne->onext;e!=ne;e=next) { + next = e->onext; + NASD_ASSERT(e->node_ent == ne); +- NASD_ODC_Q_DEQ_NOLOCK(e,o); ++ NASD_ODC_Q_DEQ_NOLOCK(e,onext,oprev); + LOSE_IREF(ne); + e->node_ent = NULL; + } diff --git a/net/nasd/patches/patch-ao b/net/nasd/patches/patch-ao new file mode 100644 index 00000000000..974e7a1e32f --- /dev/null +++ b/net/nasd/patches/patch-ao @@ -0,0 +1,28 @@ +$NetBSD: patch-ao,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: drive/nasd_dirty.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/drive/nasd_dirty.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- drive/nasd_dirty.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ drive/nasd_dirty.c 21 Mar 2005 17:07:23 -0000 1.2 +@@ -302,7 +302,7 @@ + nasd_odc_dirty_cleaned_done(); + } + if (ent->dirty_flags&NASD_CR_DIRTY_Q) { +- NASD_ODC_Q_DEQ_NOLOCK(ent,d); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,dnext,dprev); + } + ent->dirty_flags &= ~(NASD_CR_DIRTY|NASD_CR_DIRTY_Q);; + +@@ -625,7 +625,7 @@ + next = ent->dnext; + if ((ent != node_ent) && (ent->node_ent != node_ent)) + continue; +- NASD_ODC_Q_DEQ_NOLOCK(ent,d); ++ NASD_ODC_Q_DEQ_NOLOCK(ent,dnext,dprev); + nasd_odc_dirty_cur_global_flush->refcnt++; + nasd_odc_dirty_cur_global_flush->counter++; + ent->dt_flushcp = nasd_odc_dirty_cur_global_flush; diff --git a/net/nasd/patches/patch-ap b/net/nasd/patches/patch-ap new file mode 100644 index 00000000000..1a49b73a34e --- /dev/null +++ b/net/nasd/patches/patch-ap @@ -0,0 +1,184 @@ +$NetBSD: patch-ap,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: drive/nasd_layout.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/drive/nasd_layout.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.3 +diff -u -r1.1.1.1 -r1.3 +--- drive/nasd_layout.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ drive/nasd_layout.c 21 Mar 2005 23:26:12 -0000 1.3 +@@ -118,10 +118,10 @@ + \ + NASD_TM_START(&tm); + +-#define LAYOUT_TIMING_DONE(_func_) \ ++#define LAYOUT_TIMING_DONE(_functime_) \ + NASD_TM_STOP(&tm); \ + NASD_TM_ELAPSED_TS(&tm, &ts); \ +- NASD_ATOMIC_TIMESPEC_ADD(&nasd_drive_layout_stats.##_func_##_time, &ts); ++ NASD_ATOMIC_TIMESPEC_ADD(&nasd_drive_layout_stats._functime_, &ts); + + nasd_status_t + nasd_od_layout_init( +@@ -179,14 +179,14 @@ + + want_blocks = prealloc_blocks + 1; + if (want_blocks > (part->part_size - part->blocks_allocated)) { +- LAYOUT_TIMING_DONE(get_node_block); ++ LAYOUT_TIMING_DONE(get_node_block_time); + return(NASD_NO_SPACE); + } + + rc = nasd_nl_cur->nl_get_node_block(partnum, prealloc_blocks, + layout_hint, &exle, &pre_exle); + if (rc) { +- LAYOUT_TIMING_DONE(get_node_block); ++ LAYOUT_TIMING_DONE(get_node_block_time); + return(rc); + } + +@@ -204,7 +204,7 @@ + *exle_p = exle; + *pre_exle_p = pre_exle; + +- LAYOUT_TIMING_DONE(get_node_block); ++ LAYOUT_TIMING_DONE(get_node_block_time); + return(rc); + } + +@@ -233,7 +233,7 @@ + + rc = nasd_nl_cur->nl_node_fail_create(partnum, exle, pre_exle); + +- LAYOUT_TIMING_DONE(node_fail_create); ++ LAYOUT_TIMING_DONE(node_fail_create_time); + return(rc); + } + +@@ -262,7 +262,7 @@ + + rc = nasd_nl_cur->nl_release_oneblock(partnum, blknum, layout_handle); + +- LAYOUT_TIMING_DONE(release_oneblock); ++ LAYOUT_TIMING_DONE(release_oneblock_time); + return(rc); + } + +@@ -288,7 +288,7 @@ + rc = nasd_nl_cur->nl_release_blocks(partnum, exle, &blocks_released, + layout_handle); + if (rc) { +- LAYOUT_TIMING_DONE(release_blocks); ++ LAYOUT_TIMING_DONE(release_blocks_time); + return(rc); + } + +@@ -297,7 +297,7 @@ + + nasd_part_modified(partnum); + +- LAYOUT_TIMING_DONE(release_blocks); ++ LAYOUT_TIMING_DONE(release_blocks_time); + return(NASD_SUCCESS); + } + +@@ -335,7 +335,7 @@ + pb_avail = part->part_size - part->blocks_allocated; + if (pah->pb_need > pb_avail) { + NASD_ODC_ICPART_UNLOCK_WRITE(icp); +- LAYOUT_TIMING_DONE(init_adj_prealloc); ++ LAYOUT_TIMING_DONE(init_adj_prealloc_time); + return(NASD_NO_SPACE); + } + part->blocks_allocated += pah->pb_need; +@@ -347,7 +347,7 @@ + pah->pb_need = 0; + } + +- LAYOUT_TIMING_DONE(init_adj_prealloc); ++ LAYOUT_TIMING_DONE(init_adj_prealloc_time); + return(NASD_SUCCESS); + } + +@@ -381,7 +381,7 @@ + NASD_ODC_ICPART_UNLOCK_WRITE(icp); + } + +- LAYOUT_TIMING_DONE(cancel_adj_prealloc); ++ LAYOUT_TIMING_DONE(cancel_adj_prealloc_time); + return(NASD_SUCCESS); + } + +@@ -424,7 +424,7 @@ + + NASD_ODC_ICPART_UNLOCK_WRITE(icp); + +- LAYOUT_TIMING_DONE(adj_prealloc); ++ LAYOUT_TIMING_DONE(adj_prealloc_time); + return(rc); + } + +@@ -448,7 +448,7 @@ + + rc = nasd_nl_cur->nl_surrender_prealloc(partnum, ne); + +- LAYOUT_TIMING_DONE(surrender_prealloc); ++ LAYOUT_TIMING_DONE(surrender_prealloc_time); + return(rc); + } + +@@ -468,7 +468,7 @@ + + rc = nasd_odc_obj_disassoc(ne); + if (rc) { +- LAYOUT_TIMING_DONE(node_deleting); ++ LAYOUT_TIMING_DONE(node_deleting_time); + return(rc); + } + +@@ -476,7 +476,7 @@ + + rc = nasd_nl_cur->nl_node_deleting(partnum, ne); + +- LAYOUT_TIMING_DONE(node_deleting); ++ LAYOUT_TIMING_DONE(node_deleting_time); + return(rc); + } + +@@ -510,7 +510,7 @@ + exle_p, &blocks_allocated); + if (rc) { + *blocks_allocated_p = 0; +- LAYOUT_TIMING_DONE(alloc_blocks); ++ LAYOUT_TIMING_DONE(alloc_blocks_time); + return(rc); + } + +@@ -520,7 +520,7 @@ + + *blocks_allocated_p = blocks_allocated; + +- LAYOUT_TIMING_DONE(alloc_blocks); ++ LAYOUT_TIMING_DONE(alloc_blocks_time); + return(NASD_SUCCESS); + } + +@@ -568,7 +568,7 @@ + pbs_got = NASD_MIN(preallocblks_used, pbs_avail); + rc = nasd_odc_get_extent_list(&pre_exle); + if (rc != NASD_SUCCESS) { +- LAYOUT_TIMING_DONE(get_prealloc); ++ LAYOUT_TIMING_DONE(get_prealloc_time); + return(rc); + } + pre_exle->range.first = np->prealloc_ex.first; +@@ -599,7 +599,7 @@ + + part->blocks_used += preallocblks_used; + +- LAYOUT_TIMING_DONE(get_prealloc); ++ LAYOUT_TIMING_DONE(get_prealloc_time); + return(NASD_SUCCESS); + } + diff --git a/net/nasd/patches/patch-aq b/net/nasd/patches/patch-aq new file mode 100644 index 00000000000..5c7a082c29f --- /dev/null +++ b/net/nasd/patches/patch-aq @@ -0,0 +1,37 @@ +$NetBSD: patch-aq,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: drive/nasd_obj.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/drive/nasd_obj.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- drive/nasd_obj.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ drive/nasd_obj.c 21 Mar 2005 17:07:23 -0000 1.2 +@@ -1688,7 +1688,7 @@ + g = 0; + + if(protection & NASD_INTEGRITY_DATA) { +- NASD_ODC_Q_INS_NOLOCK(&commit_queue, ents[i], s); ++ NASD_ODC_Q_INS_NOLOCK(&commit_queue, ents[i], snext, sprev); + #if NASD_OD_EXT_PTR > 0 + digestp = ents[i]->digest; + digest_valid = 0; +@@ -1799,7 +1799,7 @@ + be trusted. usually this will happen because we got a bad + digest in the middle of the stream. clean up. */ + while(NASD_ODC_Q_SIZE(&commit_queue) > 0) { +- NASD_ODC_Q_DEQ_TAIL_NOLOCK(&commit_queue, ne, s); ++ NASD_ODC_Q_DEQ_TAIL_NOLOCK(&commit_queue, ne, snext, sprev); + NASD_ODC_LOCK_BLOCK(ne); + /* XXX the cache will need to be fixed before this will work */ + nasd_printf("write_simple: invalidating nid 0x%" NASD_ID_FMT +@@ -1838,7 +1838,7 @@ + cq = (nasd_odc_oq_t *) commit_rock; + + do { +- NASD_ODC_Q_DEQ_TAIL_NOLOCK(cq, ent, s); ++ NASD_ODC_Q_DEQ_TAIL_NOLOCK(cq, ent, snext, sprev); + + /* head of the queue should be the correct block */ + NASD_ASSERT(ent->offset <= start); diff --git a/net/nasd/patches/patch-ar b/net/nasd/patches/patch-ar new file mode 100644 index 00000000000..b09e954c0a1 --- /dev/null +++ b/net/nasd/patches/patch-ar @@ -0,0 +1,21 @@ +$NetBSD: patch-ar,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: drive/nasd_od_ops.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/drive/nasd_od_ops.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- drive/nasd_od_ops.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ drive/nasd_od_ops.c 21 Mar 2005 17:07:23 -0000 1.2 +@@ -52,6 +52,10 @@ + #include <nasd/nasd_udppipe.h> + #endif /* !KERNEL */ + ++#ifdef NETBSD ++#include <errno.h> ++#endif ++ + + nasd_uint64 nasd_od_threads_in_rpc = 0; + nasd_uint64 nasd_od_shutdown_timeouts = 0; diff --git a/net/nasd/patches/patch-as b/net/nasd/patches/patch-as new file mode 100644 index 00000000000..1956cbb0e8a --- /dev/null +++ b/net/nasd/patches/patch-as @@ -0,0 +1,75 @@ +$NetBSD: patch-as,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: drive/nasd_security_dr.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/drive/nasd_security_dr.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- drive/nasd_security_dr.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ drive/nasd_security_dr.c 21 Mar 2005 17:07:23 -0000 1.2 +@@ -465,8 +465,8 @@ + NASD_KC_LOCK(); + for(kp = bucket->head.cnext; kp != &bucket->head; kp = kp->cnext) { + if(bcmp(capability, &kp->capability, sizeof(nasd_capability_t)) == 0) { +- NASD_KCQ_DEQ(kp, l); +- NASD_KCQ_INS(&nasd_sec_kc_lru, kp, l); ++ NASD_KCQ_DEQ(kp, lnext, lprev); ++ NASD_KCQ_INS(&nasd_sec_kc_lru, kp, lnext, lprev); + bcopy(kp, ke, sizeof(nasd_sec_kc_ent_t)); + rc = NASD_SUCCESS; + break; +@@ -494,16 +494,16 @@ + + /* try to get an unused buf first */ + if(NASD_KCQ_SIZE(&nasd_sec_kc_free) > 0) { +- NASD_KCQ_DEQ_TAIL(&nasd_sec_kc_free, ke, f); ++ NASD_KCQ_DEQ_TAIL(&nasd_sec_kc_free, ke, fnext, fprev); + } + + if(!ke) { + /* need to steal from LRU */ + NASD_ASSERT(NASD_KCQ_SIZE(&nasd_sec_kc_lru) > 0); +- NASD_KCQ_DEQ_TAIL(&nasd_sec_kc_lru, ke, l); ++ NASD_KCQ_DEQ_TAIL(&nasd_sec_kc_lru, ke, lnext, lprev); + NASD_ASSERT(ke->cnext != NULL); + /* remove from old bucket */ +- NASD_KCQ_DEQ(ke, c); ++ NASD_KCQ_DEQ(ke, cnext, cprev); + } + + bcopy(capability, &ke->capability, sizeof(nasd_capability_t)); +@@ -513,10 +513,10 @@ + + /* put in new bucket */ + bucket = &nasd_sec_kc_bucket_ents[NASD_KC_BUCKET(capability->ni)]; +- NASD_KCQ_INS(bucket, ke, c); ++ NASD_KCQ_INS(bucket, ke, cnext, cprev); + + /* put on LRU queue */ +- NASD_KCQ_INS(&nasd_sec_kc_lru, ke, l); ++ NASD_KCQ_INS(&nasd_sec_kc_lru, ke, lnext, lprev); + + NASD_KC_UNLOCK(); + return NASD_SUCCESS; +@@ -535,9 +535,9 @@ + for(ke = bucket->head.cnext; ke != &bucket->head; ke = ke->cnext) { + if(ke->capability.ni == identifier) { + /* remove from bucket */ +- NASD_KCQ_DEQ(ke, c); ++ NASD_KCQ_DEQ(ke, cnext, cprev); + /* add to free queue */ +- NASD_KCQ_INS(&nasd_sec_kc_free, ke, f); ++ NASD_KCQ_INS(&nasd_sec_kc_free, ke, fnext, fprev); + } + } + +@@ -581,7 +581,7 @@ + NASD_Free(ke, sizeof(nasd_sec_kc_ent_t)); + return rc; + } +- NASD_KCQ_INS(&nasd_sec_kc_free, ke, f); ++ NASD_KCQ_INS(&nasd_sec_kc_free, ke, fnext, fprev); + } + + rc = nasd_mutex_init(&nasd_sec_kc_lock); diff --git a/net/nasd/patches/patch-at b/net/nasd/patches/patch-at new file mode 100644 index 00000000000..1de52b99a6d --- /dev/null +++ b/net/nasd/patches/patch-at @@ -0,0 +1,289 @@ +$NetBSD: patch-at,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: edrfs/client/nasd_edrfs_client_mq.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/edrfs/client/nasd_edrfs_client_mq.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- edrfs/client/nasd_edrfs_client_mq.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ edrfs/client/nasd_edrfs_client_mq.c 21 Mar 2005 17:07:25 -0000 1.2 +@@ -39,13 +39,13 @@ + + /* I am, in all likelihood, going to go to hell for these macros. */ + +-#define NASD_EDRFSMQ_DEFINE_VARS(n) \ +- nasd_edrfs_mq_buf_t mb;\ +- NASDMQ_edrfs_##n##_msg_t *msg = &(mb.un.##n##_msg);\ +- NASDMQ_edrfs_##n##_rep_t *rep = &(mb.un.##n##_rep);\ +- nasd_edrfscli_handle_msgq_t *rpch =\ +- (nasd_edrfscli_handle_msgq_t *)handle->rpc_specific_handle;\ +- int seqnum;\ ++#define NASD_EDRFSMQ_DEFINE_VARS(msgtype, msgfield, reptype, repfield) \ ++ nasd_edrfs_mq_buf_t mb; \ ++ msgtype *msg = &(mb.un.msgfield); \ ++ reptype *rep = &(mb.un.repfield); \ ++ nasd_edrfscli_handle_msgq_t *rpch = \ ++ (nasd_edrfscli_handle_msgq_t *)handle->rpc_specific_handle; \ ++ int seqnum; \ + int rc; + + #define NASD_EDRFSMQ_INC_SEQNUM() \ +@@ -70,8 +70,8 @@ + }\ + *op_status = rep->op_status; + +-#define NASD_EDRFSMQ_MARSHALL(n) bcopy(args, &mb.un.##n##_msg.args, sizeof(nasd_edrfs_##n##_args_t)) +-#define NASD_EDRFSMQ_UNMARSHALL(n) bcopy(&mb.un.##n##_rep.res, res, sizeof(nasd_edrfs_##n##_res_t)) ++#define NASD_EDRFSMQ_MARSHALL(msgfield, argstype) bcopy(args, &mb.un.msgfield.args, sizeof(argstype)) ++#define NASD_EDRFSMQ_UNMARSHALL(repfield, restype) bcopy(&mb.un.repfield.res, res, sizeof(restype)) + + nasd_status_t + nasd_edrfsmq_bind( +@@ -129,7 +129,7 @@ + nasd_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(null); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_null_msg_t, null_msg, NASDMQ_edrfs_null_rep_t, null_rep); + NASD_EDRFSMQ_INC_SEQNUM(); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_NULL); + res->nasd_status = mb.un.null_rep.nasd_status; +@@ -143,11 +143,11 @@ + nasd_edrfs_mount_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(mount); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_mount_msg_t, mount_msg, NASDMQ_edrfs_mount_rep_t, mount_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(mount); ++ NASD_EDRFSMQ_MARSHALL(mount_msg, nasd_edrfs_mount_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_MOUNT); +- NASD_EDRFSMQ_UNMARSHALL(mount); ++ NASD_EDRFSMQ_UNMARSHALL(mount_rep, nasd_edrfs_mount_res_t); + } + + +@@ -158,11 +158,11 @@ + nasd_edrfs_fsstat_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(fsstat); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_fsstat_msg_t, fsstat_msg, NASDMQ_edrfs_fsstat_rep_t, fsstat_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(fsstat); ++ NASD_EDRFSMQ_MARSHALL(fsstat_msg, nasd_edrfs_fsstat_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_FSSTAT); +- NASD_EDRFSMQ_UNMARSHALL(fsstat); ++ NASD_EDRFSMQ_UNMARSHALL(fsstat_rep, nasd_edrfs_fsstat_res_t); + } + + +@@ -173,11 +173,11 @@ + nasd_edrfs_fsinfo_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(fsinfo); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_fsinfo_msg_t, fsinfo_msg, NASDMQ_edrfs_fsinfo_rep_t, fsinfo_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(fsinfo); ++ NASD_EDRFSMQ_MARSHALL(fsinfo_msg, nasd_edrfs_fsinfo_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_FSINFO); +- NASD_EDRFSMQ_UNMARSHALL(fsinfo); ++ NASD_EDRFSMQ_UNMARSHALL(fsinfo_rep, nasd_edrfs_fsinfo_res_t); + } + + +@@ -188,11 +188,11 @@ + nasd_edrfs_lookup_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(lookup); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_lookup_msg_t, lookup_msg, NASDMQ_edrfs_lookup_rep_t, lookup_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(lookup); ++ NASD_EDRFSMQ_MARSHALL(lookup_msg, nasd_edrfs_lookup_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_LOOKUP); +- NASD_EDRFSMQ_UNMARSHALL(lookup); ++ NASD_EDRFSMQ_UNMARSHALL(lookup_rep, nasd_edrfs_lookup_res_t); + } + + +@@ -217,7 +217,7 @@ + nasd_edrfs_readdir_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(readdir) ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_readdir_msg_t, readdir_msg, NASDMQ_edrfs_readdir_rep_t, readdir_rep); + nasd_byte_t *shmbuf; + int shmid; + nasd_len_t len; +@@ -240,9 +240,9 @@ + } + + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(readdir); ++ NASD_EDRFSMQ_MARSHALL(readdir_msg, nasd_edrfs_readdir_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_READDIR); +- NASD_EDRFSMQ_UNMARSHALL(readdir); ++ NASD_EDRFSMQ_UNMARSHALL(readdir_rep, nasd_edrfs_readdir_res_t); + bcopy(shmbuf, out_entries, len); + rc = nasd_shmpipe_complete_cs(shmid, shmbuf, op_status); + if(rc) +@@ -257,11 +257,11 @@ + nasd_edrfs_access_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(access); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_access_msg_t, access_msg, NASDMQ_edrfs_access_rep_t, access_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(access); ++ NASD_EDRFSMQ_MARSHALL(access_msg, nasd_edrfs_access_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_ACCESS); +- NASD_EDRFSMQ_UNMARSHALL(access); ++ NASD_EDRFSMQ_UNMARSHALL(access_rep, nasd_edrfs_access_res_t); + } + + +@@ -272,11 +272,11 @@ + nasd_edrfs_setattr_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(setattr); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_setattr_msg_t, setattr_msg, NASDMQ_edrfs_setattr_rep_t, setattr_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(setattr); ++ NASD_EDRFSMQ_MARSHALL(setattr_msg, nasd_edrfs_setattr_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_SETATTR); +- NASD_EDRFSMQ_UNMARSHALL(setattr); ++ NASD_EDRFSMQ_UNMARSHALL(setattr_rep, nasd_edrfs_setattr_res_t); + } + + +@@ -287,11 +287,11 @@ + nasd_edrfs_create_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(create); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_create_msg_t, create_msg, NASDMQ_edrfs_create_rep_t, create_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(create); ++ NASD_EDRFSMQ_MARSHALL(create_msg, nasd_edrfs_create_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_CREATE); +- NASD_EDRFSMQ_UNMARSHALL(create); ++ NASD_EDRFSMQ_UNMARSHALL(create_rep, nasd_edrfs_create_res_t); + } + + +@@ -315,11 +315,11 @@ + nasd_edrfs_symlink_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(symlink); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_symlink_msg_t, symlink_msg, NASDMQ_edrfs_symlink_rep_t, symlink_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(symlink); ++ NASD_EDRFSMQ_MARSHALL(symlink_msg, nasd_edrfs_symlink_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_SYMLINK); +- NASD_EDRFSMQ_UNMARSHALL(symlink); ++ NASD_EDRFSMQ_UNMARSHALL(symlink_rep, nasd_edrfs_symlink_res_t); + } + + +@@ -330,11 +330,11 @@ + nasd_edrfs_remove_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(remove); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_remove_msg_t, remove_msg, NASDMQ_edrfs_remove_rep_t, remove_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(remove); ++ NASD_EDRFSMQ_MARSHALL(remove_msg, nasd_edrfs_remove_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_REMOVE); +- NASD_EDRFSMQ_UNMARSHALL(remove); ++ NASD_EDRFSMQ_UNMARSHALL(remove_rep, nasd_edrfs_remove_res_t); + } + + +@@ -345,11 +345,11 @@ + nasd_edrfs_mkdir_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(mkdir); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_mkdir_msg_t, mkdir_msg, NASDMQ_edrfs_mkdir_rep_t, mkdir_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(mkdir); ++ NASD_EDRFSMQ_MARSHALL(mkdir_msg, nasd_edrfs_mkdir_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_MKDIR); +- NASD_EDRFSMQ_UNMARSHALL(mkdir); ++ NASD_EDRFSMQ_UNMARSHALL(mkdir_rep, nasd_edrfs_mkdir_res_t); + } + + +@@ -360,11 +360,11 @@ + nasd_edrfs_rmdir_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(rmdir); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_rmdir_msg_t, rmdir_msg, NASDMQ_edrfs_rmdir_rep_t, rmdir_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(rmdir); ++ NASD_EDRFSMQ_MARSHALL(rmdir_msg, nasd_edrfs_rmdir_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_RMDIR); +- NASD_EDRFSMQ_UNMARSHALL(rmdir); ++ NASD_EDRFSMQ_UNMARSHALL(rmdir_rep, nasd_edrfs_rmdir_res_t); + } + + +@@ -375,11 +375,11 @@ + nasd_edrfs_newcookie_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(newcookie); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_newcookie_msg_t, newcookie_msg, NASDMQ_edrfs_newcookie_rep_t, newcookie_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(newcookie); ++ NASD_EDRFSMQ_MARSHALL(newcookie_msg, nasd_edrfs_newcookie_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_NEWCOOKIE); +- NASD_EDRFSMQ_UNMARSHALL(newcookie); ++ NASD_EDRFSMQ_UNMARSHALL(newcookie_rep, nasd_edrfs_newcookie_res_t); + } + + +@@ -390,11 +390,11 @@ + nasd_edrfs_rename_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(rename); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_rename_msg_t, rename_msg, NASDMQ_edrfs_rename_rep_t, rename_rep); + NASD_EDRFSMQ_INC_SEQNUM(); +- NASD_EDRFSMQ_MARSHALL(rename); ++ NASD_EDRFSMQ_MARSHALL(rename_msg, nasd_edrfs_rename_args_t); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_RENAME); +- NASD_EDRFSMQ_UNMARSHALL(rename); ++ NASD_EDRFSMQ_UNMARSHALL(rename_rep, nasd_edrfs_rename_res_t); + } + + +@@ -404,10 +404,10 @@ + nasd_edrfs_getstats_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(getstats); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_getstats_msg_t, getstats_msg, NASDMQ_edrfs_getstats_rep_t, getstats_rep); + NASD_EDRFSMQ_INC_SEQNUM(); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_GETSTATS); +- NASD_EDRFSMQ_UNMARSHALL(getstats); ++ NASD_EDRFSMQ_UNMARSHALL(getstats_rep, nasd_edrfs_getstats_res_t); + } + + void +@@ -416,7 +416,7 @@ + nasd_res_t *res, + nasd_rpc_status_t *op_status) + { +- NASD_EDRFSMQ_DEFINE_VARS(resetstats); ++ NASD_EDRFSMQ_DEFINE_VARS(NASDMQ_edrfs_resetstats_msg_t, resetstats_msg, NASDMQ_edrfs_resetstats_rep_t, resetstats_rep); + NASD_EDRFSMQ_INC_SEQNUM(); + NASD_EDRFSMQ_DOCALL(NASD_EDRFS_MQ_RESETSTATS); + res->nasd_status = mb.un.resetstats_rep.nasd_status; diff --git a/net/nasd/patches/patch-au b/net/nasd/patches/patch-au new file mode 100644 index 00000000000..86a79b72401 --- /dev/null +++ b/net/nasd/patches/patch-au @@ -0,0 +1,159 @@ +$NetBSD: patch-au,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: edrfs/server/nasd_edrfs_mq.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/edrfs/server/nasd_edrfs_mq.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- edrfs/server/nasd_edrfs_mq.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ edrfs/server/nasd_edrfs_mq.c 21 Mar 2005 17:07:26 -0000 1.2 +@@ -623,10 +623,10 @@ + return(NASD_OP_NOT_SUPPORTED); + } + +-#define DECLARE_VARS(_opname_) \ +- NASDMQ_edrfs_##_opname_##_msg_t *msg = &(mb.un.##_opname_##_msg);\ +- NASDMQ_edrfs_##_opname_##_rep_t *rep = &(mr.un.##_opname_##_rep); +-#define DO_CALL(_opname_) nasd_edrfs_mq_op_##_opname_##(&msg->args, &rep->res, &rep->op_status) ++#define DECLARE_VARS(msgtype, msgfield, reptype, repfield) \ ++ msgtype *msg = &(mb.un.msgfield);\ ++ reptype *rep = &(mr.un.repfield); ++#define DO_CALL(callname) callname(&msg->args, &rep->res, &rep->op_status) + #define SETUP_REPLY() mr.mtype = msg->seqnum; replyq = msg->replyq; + + void +@@ -665,103 +665,103 @@ + break; + + case NASD_EDRFS_MQ_NULL: { +- DECLARE_VARS(null); ++ DECLARE_VARS(NASDMQ_edrfs_null_msg_t, null_msg, NASDMQ_edrfs_null_rep_t, null_rep); + nasd_edrfs_mq_op_null(&rep->nasd_status, &rep->op_status); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_MOUNT: { +- DECLARE_VARS(mount); +- DO_CALL(mount); ++ DECLARE_VARS(NASDMQ_edrfs_mount_msg_t, mount_msg, NASDMQ_edrfs_mount_rep_t, mount_rep); ++ DO_CALL(nasd_edrfs_mq_op_mount); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_FSSTAT: { +- DECLARE_VARS(fsstat); +- DO_CALL(fsstat); ++ DECLARE_VARS(NASDMQ_edrfs_fsstat_msg_t, fsstat_msg, NASDMQ_edrfs_fsstat_rep_t, fsstat_rep); ++ DO_CALL(nasd_edrfs_mq_op_fsstat); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_FSINFO: { +- DECLARE_VARS(fsinfo); +- DO_CALL(fsinfo); ++ DECLARE_VARS(NASDMQ_edrfs_fsinfo_msg_t, fsinfo_msg, NASDMQ_edrfs_fsinfo_rep_t, fsinfo_rep); ++ DO_CALL(nasd_edrfs_mq_op_fsinfo); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_LOOKUP: { +- DECLARE_VARS(lookup); +- DO_CALL(lookup); ++ DECLARE_VARS(NASDMQ_edrfs_lookup_msg_t, lookup_msg, NASDMQ_edrfs_lookup_rep_t, lookup_rep); ++ DO_CALL(nasd_edrfs_mq_op_lookup); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_READDIR: { +- DECLARE_VARS(readdir); ++ DECLARE_VARS(NASDMQ_edrfs_readdir_msg_t, readdir_msg, NASDMQ_edrfs_readdir_rep_t, readdir_rep); + nasd_edrfs_mq_op_readdir(msg->shmid, &msg->args, &rep->res, &rep->op_status); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_ACCESS: { +- DECLARE_VARS(access); +- DO_CALL(access); ++ DECLARE_VARS(NASDMQ_edrfs_access_msg_t, access_msg, NASDMQ_edrfs_access_rep_t, access_rep); ++ DO_CALL(nasd_edrfs_mq_op_access); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_SETATTR: { +- DECLARE_VARS(setattr); +- DO_CALL(setattr); ++ DECLARE_VARS(NASDMQ_edrfs_setattr_msg_t, setattr_msg, NASDMQ_edrfs_setattr_rep_t, setattr_rep); ++ DO_CALL(nasd_edrfs_mq_op_setattr); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_CREATE: { +- DECLARE_VARS(create); +- DO_CALL(create); ++ DECLARE_VARS(NASDMQ_edrfs_create_msg_t, create_msg, NASDMQ_edrfs_create_rep_t, create_rep); ++ DO_CALL(nasd_edrfs_mq_op_create); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_SYMLINK: { +- DECLARE_VARS(symlink); +- DO_CALL(symlink); ++ DECLARE_VARS(NASDMQ_edrfs_symlink_msg_t, symlink_msg, NASDMQ_edrfs_symlink_rep_t, symlink_rep); ++ DO_CALL(nasd_edrfs_mq_op_symlink); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_REMOVE: { +- DECLARE_VARS(remove); +- DO_CALL(remove); ++ DECLARE_VARS(NASDMQ_edrfs_remove_msg_t, remove_msg, NASDMQ_edrfs_remove_rep_t, remove_rep); ++ DO_CALL(nasd_edrfs_mq_op_remove); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_MKDIR: { +- DECLARE_VARS(mkdir); +- DO_CALL(mkdir); ++ DECLARE_VARS(NASDMQ_edrfs_mkdir_msg_t, mkdir_msg, NASDMQ_edrfs_mkdir_rep_t, mkdir_rep); ++ DO_CALL(nasd_edrfs_mq_op_mkdir); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_RMDIR: { +- DECLARE_VARS(rmdir); +- DO_CALL(rmdir); ++ DECLARE_VARS(NASDMQ_edrfs_rmdir_msg_t, rmdir_msg, NASDMQ_edrfs_rmdir_rep_t, rmdir_rep); ++ DO_CALL(nasd_edrfs_mq_op_rmdir); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_NEWCOOKIE: { +- DECLARE_VARS(newcookie); +- DO_CALL(newcookie); ++ DECLARE_VARS(NASDMQ_edrfs_newcookie_msg_t, newcookie_msg, NASDMQ_edrfs_newcookie_rep_t, newcookie_rep); ++ DO_CALL(nasd_edrfs_mq_op_newcookie); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_RENAME: { +- DECLARE_VARS(rename); +- DO_CALL(rename); ++ DECLARE_VARS(NASDMQ_edrfs_rename_msg_t, rename_msg, NASDMQ_edrfs_rename_rep_t, rename_rep); ++ DO_CALL(nasd_edrfs_mq_op_rename); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_GETSTATS: { +- DECLARE_VARS(getstats); ++ DECLARE_VARS(NASDMQ_edrfs_getstats_msg_t, getstats_msg, NASDMQ_edrfs_getstats_rep_t, getstats_rep); + nasd_edrfs_mq_op_getstats(&rep->res, &rep->op_status); + SETUP_REPLY(); + break; } + + case NASD_EDRFS_MQ_RESETSTATS: { +- DECLARE_VARS(resetstats); ++ DECLARE_VARS(NASDMQ_edrfs_resetstats_msg_t, resetstats_msg, NASDMQ_edrfs_resetstats_rep_t, resetstats_rep); + nasd_edrfs_mq_op_resetstats(&rep->nasd_status, &rep->op_status); + SETUP_REPLY(); + break; } diff --git a/net/nasd/patches/patch-av b/net/nasd/patches/patch-av new file mode 100644 index 00000000000..d4b5db55ee6 --- /dev/null +++ b/net/nasd/patches/patch-av @@ -0,0 +1,54 @@ +$NetBSD: patch-av,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: edrfs/tests/nasd_edrfs_test_functions.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/edrfs/tests/nasd_edrfs_test_functions.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- edrfs/tests/nasd_edrfs_test_functions.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ edrfs/tests/nasd_edrfs_test_functions.c 21 Mar 2005 23:01:23 -0000 1.2 +@@ -82,13 +82,13 @@ + */ + + #define SCAN_EDRFS_ID(_F_, _D_) sscanf(_F_, "0x%" NASD_ID_FMT ",%hx,%hx\n",\ +- &(_D_ ## .nasd_identifier), &(_D_ ## .disk_identifier), \ +- &(_D_ ## .partnum)); ++ &(_D_.nasd_identifier), &(_D_.disk_identifier), \ ++ &(_D_.partnum)); + + #define PRINT_EDRFS_ID(_F_) printf("id 0x%" NASD_ID_FMT ",0x%hx,0x%hx\n", \ +- _F_ ## .nasd_identifier, \ +- _F_ ## .disk_identifier, \ +- _F_ ## .partnum); ++ _F_.nasd_identifier, \ ++ _F_.disk_identifier, \ ++ _F_.partnum); + + /* + * +@@ -783,17 +783,17 @@ + NASD_64u_FMT "\t%10" NASD_64u_FMT "\t%10" \ + NASD_64u_FMT "\n", \ + NASD_STRING(_D_), \ +- op-> ## _D_ ## .num_ops, \ +- op-> ## _D_ ## .op_nsecs, \ +- op-> ## _D_ ## .invalid, \ +- op-> ## _D_ ## .in_flight); ++ op->_D_.num_ops, \ ++ op->_D_.op_nsecs, \ ++ op->_D_.invalid, \ ++ op->_D_.in_flight); + + #define PRINT_CACHE(_A_, _B_, _C_) printf("%-22s%3" NASD_64u_FMT \ + " %-22s%3" NASD_64u_FMT \ + " %-22s%3" NASD_64u_FMT "\n", \ +- NASD_STRING(_A_), cache-> ## _A_, \ +- NASD_STRING(_B_), cache-> ## _B_, \ +- NASD_STRING(_C_), cache-> ## _C_); ++ NASD_STRING(_A_), cache->_A_, \ ++ NASD_STRING(_B_), cache->_B_, \ ++ NASD_STRING(_C_), cache->_C_); + + nasd_status_t nasd_edrfs_test_getstats_printres(void *res){ + nasd_edrfs_getstats_res_t *r = (nasd_edrfs_getstats_res_t *) res; diff --git a/net/nasd/patches/patch-aw b/net/nasd/patches/patch-aw new file mode 100644 index 00000000000..3432210189b --- /dev/null +++ b/net/nasd/patches/patch-aw @@ -0,0 +1,18 @@ +$NetBSD: patch-aw,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: edrfs/utils/nasd_edrfs_cat.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/edrfs/utils/nasd_edrfs_cat.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- edrfs/utils/nasd_edrfs_cat.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ edrfs/utils/nasd_edrfs_cat.c 21 Mar 2005 23:03:51 -0000 1.2 +@@ -24,6 +24,7 @@ + */ + + ++#include <errno.h> + #include <string.h> + #include <libgen.h> + diff --git a/net/nasd/patches/patch-ax b/net/nasd/patches/patch-ax new file mode 100644 index 00000000000..1c4ecd3e37f --- /dev/null +++ b/net/nasd/patches/patch-ax @@ -0,0 +1,18 @@ +$NetBSD: patch-ax,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: edrfs/utils/nasd_edrfs_tee.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/edrfs/utils/nasd_edrfs_tee.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- edrfs/utils/nasd_edrfs_tee.c 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ edrfs/utils/nasd_edrfs_tee.c 21 Mar 2005 23:03:51 -0000 1.2 +@@ -27,6 +27,7 @@ + + + #include <string.h> ++#include <errno.h> + #include <libgen.h> + + #include <sys/socket.h> diff --git a/net/nasd/patches/patch-ay b/net/nasd/patches/patch-ay new file mode 100644 index 00000000000..a9ccf4bdf30 --- /dev/null +++ b/net/nasd/patches/patch-ay @@ -0,0 +1,18 @@ +$NetBSD: patch-ay,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/Imakefile +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/Imakefile,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/Imakefile 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/Imakefile 21 Mar 2005 08:57:43 -0000 1.2 +@@ -33,6 +33,7 @@ + generic \ + irix \ + linux \ ++ netbsd \ + solaris \ + video \ + vxworks diff --git a/net/nasd/patches/patch-az b/net/nasd/patches/patch-az new file mode 100644 index 00000000000..53f8094abac --- /dev/null +++ b/net/nasd/patches/patch-az @@ -0,0 +1,67 @@ +$NetBSD: patch-az,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_cache.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_cache.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.3 +diff -u -r1.1.1.1 -r1.3 +--- include/nasd/nasd_cache.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_cache.h 21 Mar 2005 17:12:47 -0000 1.3 +@@ -523,40 +523,40 @@ + * head->prev is oldest entry + */ + +-#define NASD_ODC_Q_INS_NOLOCK(_q_,_ent_,_list_) { \ +- (_ent_)->##_list_##next = (_q_)->head.##_list_##next; \ +- (_ent_)->##_list_##prev = &((_q_)->head); \ +- (_ent_)->##_list_##next->##_list_##prev = (_ent_); \ +- (_ent_)->##_list_##prev->##_list_##next = (_ent_); \ ++#define NASD_ODC_Q_INS_NOLOCK(_q_,_ent_,_nxt_,_prv_) { \ ++ (_ent_)->_nxt_ = (_q_)->head._nxt_; \ ++ (_ent_)->_prv_ = &((_q_)->head); \ ++ (_ent_)->_nxt_->_prv_ = (_ent_); \ ++ (_ent_)->_prv_->_nxt_ = (_ent_); \ + (_q_)->size++; \ + } + +-#define NASD_ODC_Q_INS(_q_,_ent_,_list_) { \ ++#define NASD_ODC_Q_INS(_q_,_ent_,_nxt_,_prv_) { \ + NASD_ODC_Q_LOCK(_q_); \ +- NASD_ODC_Q_INS_NOLOCK(_q_,_ent_,_list_); \ ++ NASD_ODC_Q_INS_NOLOCK(_q_,_ent_,_nxt_,_prv_); \ + NASD_ODC_Q_UNLOCK(_q_); \ + } + +-#define NASD_ODC_Q_DEQ_NOLOCK(_ent_,_list_) { \ +- (_ent_)->##_list_##next->##_list_##prev = (_ent_)->##_list_##prev; \ +- (_ent_)->##_list_##prev->##_list_##next = (_ent_)->##_list_##next; \ +- (_ent_)->##_list_##prev = (_ent_)->##_list_##next = NULL; \ ++#define NASD_ODC_Q_DEQ_NOLOCK(_ent_,_nxt_,_prv_) { \ ++ (_ent_)->_nxt_->_prv_ = (_ent_)->_prv_; \ ++ (_ent_)->_prv_->_nxt_ = (_ent_)->_nxt_; \ ++ (_ent_)->_prv_ = (_ent_)->_nxt_ = NULL; \ + } + + /* + * The tail (oldest) entry in queue is assigned to _ent_ + * and removed from the queue + */ +-#define NASD_ODC_Q_DEQ_TAIL_NOLOCK(_q_,_ent_,_list_) { \ +- _ent_ = (_q_)->head.##_list_##prev; \ ++#define NASD_ODC_Q_DEQ_TAIL_NOLOCK(_q_,_ent_,_nxt_,_prv_) { \ ++ _ent_ = (_q_)->head._prv_; \ + NASD_ASSERT((_ent_) != (&((_q_)->head))); \ +- NASD_ODC_Q_DEQ_NOLOCK(_ent_,_list_); \ ++ NASD_ODC_Q_DEQ_NOLOCK(_ent_,_nxt_,_prv_); \ + (_q_)->size--; \ + } + +-#define NASD_ODC_Q_DEQ_TAIL(_q_,_ent_,_list_) { \ ++#define NASD_ODC_Q_DEQ_TAIL(_q_,_ent_,_nxt_,_prv_) { \ + NASD_ODC_Q_LOCK(_q_); \ +- NASD_ODC_Q_DEQ_TAIL_NOLOCK(_q_,_ent_,_list_); \ ++ NASD_ODC_Q_DEQ_TAIL_NOLOCK(_q_,_ent_,_nxt_,_prv_); \ + NASD_ODC_Q_UNLOCK(_q_); \ + } + diff --git a/net/nasd/patches/patch-ba b/net/nasd/patches/patch-ba new file mode 100644 index 00000000000..1a8cd983bf1 --- /dev/null +++ b/net/nasd/patches/patch-ba @@ -0,0 +1,21 @@ +$NetBSD: patch-ba,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_common.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_common.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_common.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_common.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -54,6 +54,10 @@ + #include <nasd/freebsd/nasd_freebsd_common.h> + #endif /* FREEBSD */ + ++#ifdef NETBSD ++#include <nasd/netbsd/nasd_netbsd_common.h> ++#endif /* NETBSD */ ++ + extern char *nasd_error_string(nasd_status_t err); + extern void nasd_printstat(nasd_attribute_t *attr); + extern nasd_status_t nasd_str_to_nasd_id(char *str, diff --git a/net/nasd/patches/patch-bb b/net/nasd/patches/patch-bb new file mode 100644 index 00000000000..c5aaafe36d8 --- /dev/null +++ b/net/nasd/patches/patch-bb @@ -0,0 +1,16 @@ +$NetBSD: patch-bb,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_edrfs_dir.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_edrfs_dir.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_edrfs_dir.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_edrfs_dir.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -220,4 +220,4 @@ + + void nasd_edrfs_dir_dump_dirslot(nasd_edrfs_dirpage_t *page, int slot); + +-#endif _NASD__NASD_EDRFS_DIR_H_ ++#endif /* _NASD__NASD_EDRFS_DIR_H_ */ diff --git a/net/nasd/patches/patch-bc b/net/nasd/patches/patch-bc new file mode 100644 index 00000000000..bc96e1952a9 --- /dev/null +++ b/net/nasd/patches/patch-bc @@ -0,0 +1,21 @@ +$NetBSD: patch-bc,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_general_simple.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_general_simple.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_general_simple.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_general_simple.h 21 Mar 2005 08:57:43 -0000 1.2 +@@ -50,6 +50,10 @@ + #include <nasd/freebsd/nasd_freebsd_general_simple.h> + #endif /* FREEBSD */ + ++#ifdef NETBSD ++#include <nasd/netbsd/nasd_netbsd_general_simple.h> ++#endif /* NETBSD */ ++ + #ifdef __STDC__ + #define NASD_STRING(_str_) #_str_ + #define NASD_CONCAT(_a_,_b_) _a_##_b_ diff --git a/net/nasd/patches/patch-bd b/net/nasd/patches/patch-bd new file mode 100644 index 00000000000..fdce9031a22 --- /dev/null +++ b/net/nasd/patches/patch-bd @@ -0,0 +1,28 @@ +$NetBSD: patch-bd,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_getopt.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_getopt.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_getopt.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_getopt.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -32,13 +32,13 @@ + + #include <stdlib.h> + +-#if !defined(SOLARIS) && !defined(FREEBSD) ++#if !defined(SOLARIS) && !defined(FREEBSD) && !defined(NETBSD) + #include <getopt.h> +-#endif /* !SOLARIS && !FREEBSD */ ++#endif /* !SOLARIS && !FREEBSD && !NETBSD */ + +-#ifdef FREEBSD ++#if defined(FREEBSD) || defined(NETBSD) + #include <unistd.h> +-#endif /* FREEBSD */ ++#endif /* FREEBSD || NETBSD */ + + extern char *nasd_optarg; + extern int nasd_optind; diff --git a/net/nasd/patches/patch-be b/net/nasd/patches/patch-be new file mode 100644 index 00000000000..e300aaab4cd --- /dev/null +++ b/net/nasd/patches/patch-be @@ -0,0 +1,22 @@ +$NetBSD: patch-be,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_mem.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_mem.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_mem.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_mem.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -42,9 +42,9 @@ + #endif /* KERNEL */ + #endif /* LINUX */ + +-#if defined(FREEBSD) || defined(SOLARIS) ++#if defined(FREEBSD) || defined(SOLARIS) || defined(NETBSD) + #include <stdlib.h> +-#endif /* FREEBSD || SOLARIS */ ++#endif /* FREEBSD || SOLARIS || NETBSD */ + + /* This should be correct on all platforms, but just in case it isn't, + you can override it from the platform-specific nasd_blah_mem.h diff --git a/net/nasd/patches/patch-bf b/net/nasd/patches/patch-bf new file mode 100644 index 00000000000..b900959ae6f --- /dev/null +++ b/net/nasd/patches/patch-bf @@ -0,0 +1,21 @@ +$NetBSD: patch-bf,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_options.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_options.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_options.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_options.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -151,6 +151,10 @@ + #endif /* !LINUX */ + #endif /* __linux__ */ + ++#if defined(__NetBSD__) && !defined(NETBSD) ++#define NETBSD 1 ++#endif ++ + #if defined(VXWORKS) + #define NASD_WIND_THREADS 1 + #endif /* VXWORKS */ diff --git a/net/nasd/patches/patch-bg b/net/nasd/patches/patch-bg new file mode 100644 index 00000000000..93fdbf139b3 --- /dev/null +++ b/net/nasd/patches/patch-bg @@ -0,0 +1,21 @@ +$NetBSD: patch-bg,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_platform.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_platform.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_platform.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_platform.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -48,6 +48,10 @@ + #include <nasd/freebsd/nasd_freebsd_platform.h> + #endif /* FREEBSD */ + ++#ifdef NETBSD ++#include <nasd/netbsd/nasd_netbsd_platform.h> ++#endif /* NETBSD */ ++ + #if __GNUC__ && !defined(KERNEL) + /* This is necessary because parts of Cheops use "asm" as a variable + name. That conflicts with gcc's use of "asm" as a reserved word. diff --git a/net/nasd/patches/patch-bh b/net/nasd/patches/patch-bh new file mode 100644 index 00000000000..8cb6ef2e93e --- /dev/null +++ b/net/nasd/patches/patch-bh @@ -0,0 +1,32 @@ +$NetBSD: patch-bh,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_rpcgen_c.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_rpcgen_c.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.3 +diff -u -r1.1.1.1 -r1.3 +--- include/nasd/nasd_rpcgen_c.h 21 Mar 2005 08:52:02 -0000 1.1.1.1 ++++ include/nasd/nasd_rpcgen_c.h 21 Mar 2005 17:07:28 -0000 1.3 +@@ -101,6 +101,21 @@ + typedef unusitll nasd_rpcgen_uint64; + #endif /* FREEBSD */ + ++#ifdef NETBSD ++#include <sys/types.h> ++#define NASD_CPP_LOC "/usr/bin/cpp" ++typedef int8_t nasd_rpcgen_int8; ++typedef uint8_t nasd_rpcgen_uint8; ++typedef int16_t nasd_rpcgen_int16; ++typedef uint16_t nasd_rpcgen_uint16; ++typedef int32_t nasd_rpcgen_int32; ++typedef uint32_t nasd_rpcgen_uint32; ++typedef int64_t usitll; ++typedef uint64_t unusitll; ++typedef usitll nasd_rpcgen_int64; ++typedef unusitll nasd_rpcgen_uint64; ++#endif ++ + + #ifndef _NASD_SRPC_GENTYPE_DEFINED + typedef void *nasd_srpc_handle_t; diff --git a/net/nasd/patches/patch-bi b/net/nasd/patches/patch-bi new file mode 100644 index 00000000000..3f3e01baf0d --- /dev/null +++ b/net/nasd/patches/patch-bi @@ -0,0 +1,23 @@ +$NetBSD: patch-bi,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_security_dr.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_security_dr.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_security_dr.h 21 Mar 2005 08:52:03 -0000 1.1.1.1 ++++ include/nasd/nasd_security_dr.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -66,9 +66,9 @@ + #define NASD_KC_BUCKET(_nid_) NASD_ABS((int)((_nid_)%nasd_sec_kc_buckets)) + + /* here we shamelessly steal the queue-manipulation macros from the ODC. */ +-#define NASD_KCQ_INS(_q_,_ent_,_list_) NASD_ODC_Q_INS_NOLOCK(_q_,_ent_,_list_) +-#define NASD_KCQ_DEQ(_ent_,_list_) NASD_ODC_Q_DEQ_NOLOCK(_ent_,_list_) +-#define NASD_KCQ_DEQ_TAIL(_q_,_ent_,_list_) NASD_ODC_Q_DEQ_TAIL_NOLOCK(_q_,_ent_,_list_) ++#define NASD_KCQ_INS(_q_,_ent_,_nxt_,_prv_) NASD_ODC_Q_INS_NOLOCK(_q_,_ent_,_nxt_,_prv_) ++#define NASD_KCQ_DEQ(_ent_,_nxt_,_prv_) NASD_ODC_Q_DEQ_NOLOCK(_ent_,_nxt_,_prv_) ++#define NASD_KCQ_DEQ_TAIL(_q_,_ent_,_nxt_,_prv_) NASD_ODC_Q_DEQ_TAIL_NOLOCK(_q_,_ent_,_nxt_,_prv_) + #define NASD_KCQ_SIZE(_q_) ((_q_)->size) + + #define NASD_KC_LOCK() NASD_LOCK_MUTEX(nasd_sec_kc_lock) diff --git a/net/nasd/patches/patch-bj b/net/nasd/patches/patch-bj new file mode 100644 index 00000000000..c02c19b6043 --- /dev/null +++ b/net/nasd/patches/patch-bj @@ -0,0 +1,21 @@ +$NetBSD: patch-bj,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_sys.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_sys.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_sys.h 21 Mar 2005 08:52:03 -0000 1.1.1.1 ++++ include/nasd/nasd_sys.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -49,6 +49,10 @@ + #include <nasd/freebsd/nasd_freebsd_sys.h> + #endif /* FREEBSD */ + ++#ifdef NETBSD ++#include <nasd/netbsd/nasd_netbsd_sys.h> ++#endif /* NETBSD */ ++ + #ifdef SOLARIS + #include <nasd/solaris/nasd_solaris_sys.h> + #endif /* SOLARIS */ diff --git a/net/nasd/patches/patch-bk b/net/nasd/patches/patch-bk new file mode 100644 index 00000000000..b54ad7ccf27 --- /dev/null +++ b/net/nasd/patches/patch-bk @@ -0,0 +1,73 @@ +$NetBSD: patch-bk,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_threads_pthread.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_threads_pthread.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_threads_pthread.h 21 Mar 2005 08:52:03 -0000 1.1.1.1 ++++ include/nasd/nasd_threads_pthread.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -52,15 +52,16 @@ + typedef void * (*pthread_startroutine_t)(void *); + #endif /* LINUX && !LINUX__NASD_PTHREAD_EXTRAS_DEFINED */ + +-#ifdef FREEBSD ++#if defined(FREEBSD) || defined(NETBSD) + typedef void (*pthread_initroutine_t)(void); ++typedef void * (*pthread_startroutine_t)(void *); + #define pthread_mutexattr_create(_attrp_) pthread_mutexattr_init(_attrp_) + #define pthread_mutexattr_delete(_attrp_) pthread_mutexattr_destroy(_attrp_) + #define pthread_condattr_create(_attrp_) pthread_condattr_init(_attrp_) + #define pthread_condattr_delete(_attrp_) pthread_condattr_destroy(_attrp_) + #define pthread_attr_create(_attrp_) pthread_attr_init(_attrp_) + #define pthread_attr_delete(_attrp_) pthread_attr_destroy(_attrp_) +-#endif /* FREEBSD */ ++#endif /* FREEBSD || NETBSD */ + + #ifdef SOLARIS + typedef void (*pthread_initroutine_t)(void); +@@ -164,11 +165,11 @@ + #define NASD_SYS_SIGNAL_COND(_c_) pthread_cond_signal( &(_c_) ) + #define NASD_SYS_BROADCAST_COND(_c_) pthread_cond_broadcast(&(_c_)) + +-#if defined(LINUX) || defined(FREEBSD) || defined(IRIX) ++#if defined(LINUX) || defined(FREEBSD) || defined(NETBSD) || defined(IRIX) + #define NASD_DECLARE_ONCE(_o_) pthread_once_t _o_ = PTHREAD_ONCE_INIT; +-#else /* LINUX || FREEBSD || IRIX */ ++#else /* LINUX || FREEBSD || NETBSD || IRIX */ + #define NASD_DECLARE_ONCE(_o_) pthread_once_t _o_ = {0,0,0}; +-#endif /* LINUX || FREEBSD || IRIX */ ++#endif /* LINUX || FREEBSD || NETBSD || IRIX */ + + extern int _nasd_once(pthread_once_t *once_block, + pthread_initroutine_t init_routine, char *file, int line); +@@ -188,14 +189,14 @@ + #define NASD_EXIT_THREAD(_status_) pthread_exit( (void *) (_status_) ) + #endif /* DEC_OSF */ + +-#if (defined(LINUX) && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE)) || defined(FREEBSD) ++#if (defined(LINUX) && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE)) || defined(FREEBSD) || defined(NETBSD) + #define NASD_DELAY_THREAD(_secs_,_nsecs_) { \ + struct timeval _interval; \ + _interval.tv_sec = (_secs_); \ + _interval.tv_usec = (_nsecs_) / 1000; \ + select(1, NULL, NULL, NULL, &_interval); \ + } +-#else /* (LINUX && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE)) || FREEBSD */ ++#else /* (LINUX && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE)) || FREEBSD || NETBSD */ + #define NASD_DELAY_THREAD(_secs_,_nsecs_) { \ + struct timespec _interval; \ + _interval.tv_sec = (_secs_); \ +@@ -212,9 +213,9 @@ + #define nasd_thread_self() ((nasd_thread_id_t)(pthread_self().field1)) + #endif /* DEC_OSF */ + +-#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(IRIX) ++#if defined(LINUX) || defined(FREEBSD) || defined(NETBSD) || defined(SOLARIS) || defined(IRIX) + #define nasd_thread_self() ((nasd_thread_id_t)(pthread_self())) +-#endif /* LINUX || FREEBSD || SOLARIS || IRIX */ ++#endif /* LINUX || FREEBSD || NETBSD || SOLARIS || IRIX */ + + #if defined(LINUX) && (NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE) + /* pthreads forgets to prototype these, so we do so here (to avoid warnings) */ diff --git a/net/nasd/patches/patch-bl b/net/nasd/patches/patch-bl new file mode 100644 index 00000000000..668f50e25a3 --- /dev/null +++ b/net/nasd/patches/patch-bl @@ -0,0 +1,23 @@ +$NetBSD: patch-bl,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/nasd_threadstuff.h +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_threadstuff.h,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- include/nasd/nasd_threadstuff.h 21 Mar 2005 08:52:03 -0000 1.1.1.1 ++++ include/nasd/nasd_threadstuff.h 21 Mar 2005 17:07:28 -0000 1.2 +@@ -77,6 +77,12 @@ + #define NASD_SYS_THREADS_DEFINED 1 + #endif /* FREEBSD */ + ++#ifdef NETBSD ++#include <pthread.h> ++#include <nasd/nasd_threads_pthread.h> ++#define NASD_SYS_THREADS_DEFINED 1 ++#endif /* NETBSD */ ++ + #ifdef IRIX + #include <pthread.h> + #include <nasd/nasd_threads_pthread.h> diff --git a/net/nasd/patches/patch-bm b/net/nasd/patches/patch-bm new file mode 100644 index 00000000000..5ad8d975fcc --- /dev/null +++ b/net/nasd/patches/patch-bm @@ -0,0 +1,48 @@ +$NetBSD: patch-bm,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/netbsd/Imakefile +=================================================================== +RCS file: include/nasd/netbsd/Imakefile +diff -N include/nasd/netbsd/Imakefile +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ include/nasd/netbsd/Imakefile 21 Mar 2005 08:56:24 -0000 1.1 +@@ -0,0 +1,39 @@ ++/* ++ * Imakefile ++ * ++ * Author: Marc Unangst ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++#include "NASD.tmpl" ++ ++FILES = \ ++ nasd_netbsd_general_simple.h \ ++ nasd_netbsd_platform.h \ ++ nasd_netbsd_sys.h ++ ++NDEST = $(NASD_DESTINC)/nasd/netbsd ++ ++InstallMultiple($(FILES),$(NDEST)) ++ ++/* ++ * Don't put anything after this ++ */ ++#include "NASD.trailer" diff --git a/net/nasd/patches/patch-bn b/net/nasd/patches/patch-bn new file mode 100644 index 00000000000..513f5fe9d3b --- /dev/null +++ b/net/nasd/patches/patch-bn @@ -0,0 +1,53 @@ +$NetBSD: patch-bn,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/netbsd/nasd_netbsd_common.h +=================================================================== +RCS file: include/nasd/netbsd/nasd_netbsd_common.h +diff -N include/nasd/netbsd/nasd_netbsd_common.h +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ include/nasd/netbsd/nasd_netbsd_common.h 21 Mar 2005 17:07:29 -0000 1.2 +@@ -0,0 +1,44 @@ ++/* ++ * nasd_netbsd_common.h ++ * ++ * NetBSD-specific shared header file for NASD entities - basic ++ * prototypes for library functions ++ * ++ * Authors: Jim Zelenka, Marc Unangst ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++ ++#ifndef _NASD__NASD_NETBSD_COMMON_H_ ++#define _NASD__NASD_NETBSD_COMMON_H_ ++ ++#include <sys/param.h> ++ ++#define nasd_hton16(_v_) htons(_v_) ++#define nasd_ntoh16(_v_) ntohs(_v_) ++#define nasd_hton32(_v_) htonl(_v_) ++#define nasd_ntoh32(_v_) ntohl(_v_) ++ ++#endif /* !_NASD__NASD_NETBSD_COMMON_H_ */ ++ ++/* Local Variables: */ ++/* indent-tabs-mode: nil */ ++/* tab-width: 2 */ ++/* End: */ diff --git a/net/nasd/patches/patch-bo b/net/nasd/patches/patch-bo new file mode 100644 index 00000000000..533977941cc --- /dev/null +++ b/net/nasd/patches/patch-bo @@ -0,0 +1,92 @@ +$NetBSD: patch-bo,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/netbsd/nasd_netbsd_general_simple.h +=================================================================== +RCS file: include/nasd/netbsd/nasd_netbsd_general_simple.h +diff -N include/nasd/netbsd/nasd_netbsd_general_simple.h +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ include/nasd/netbsd/nasd_netbsd_general_simple.h 21 Mar 2005 17:07:29 -0000 1.2 +@@ -0,0 +1,83 @@ ++/* ++ * nasd_netbsd_general_simple.h ++ * ++ * Generic definitions useful to pretty much all NASD code ++ * ++ * Authors: Jim Zelenka, Marc Unangst ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++ ++#ifndef _NASD__NASD_NETBSD_GENERAL_SIMPLE_H_ ++#define _NASD__NASD_NETBSD_GENERAL_SIMPLE_H_ ++ ++#if !defined(KERNEL) && (NASD_NOASSERT == 0) ++#include <assert.h> ++#endif /* !KERNEL && (NASD_NOASSERT == 0) */ ++ ++#ifndef KERNEL ++#include <stdio.h> ++#include <limits.h> ++#include <string.h> ++#include <unistd.h> ++#endif /* !KERNEL */ ++ ++#include <sys/time.h> ++#include <sys/types.h> ++#include <sys/param.h> ++ ++#ifndef KERNEL ++ ++#include <stdio.h> ++ ++#if NASD_NOASSERT == 0 ++#define NASD_ASSERT(_x_) { \ ++ if (!(_x_)) { \ ++ printf("Assertion check at file %s line %d\n", __FILE__, __LINE__); \ ++ printf("Assertion failed: %s\n", NASD_STRING(_x_)); \ ++ fflush(stdout); \ ++ abort(); \ ++ exit(1); \ ++ } \ ++} ++#else /* NASD_NOASSERT == 0 */ ++#define NASD_ASSERT(x) {/*noop*/} ++#endif /* NASD_NOASSERT == 0 */ ++#define NASD_PANIC() { \ ++ printf("D'oh! Fatal error file %s line %d\n", __FILE__, __LINE__); \ ++ fflush(stdout); \ ++ fprintf(stderr, "D'oh! Fatal error file %s line %d\n", __FILE__, __LINE__); \ ++ fflush(stderr); \ ++ abort(); \ ++ exit(1); \ ++} ++ ++#endif /* !KERNEL */ ++ ++#define NASD_MAXPATHLEN MAXPATHLEN ++ ++#define NASD_UIO_MAXIOV 1024 ++ ++#endif /* !_NASD__NASD_NETBSD_GENERAL_SIMPLE_H_ */ ++ ++/* Local Variables: */ ++/* indent-tabs-mode: nil */ ++/* tab-width: 2 */ ++/* End: */ diff --git a/net/nasd/patches/patch-bp b/net/nasd/patches/patch-bp new file mode 100644 index 00000000000..2a15d36caf4 --- /dev/null +++ b/net/nasd/patches/patch-bp @@ -0,0 +1,59 @@ +$NetBSD: patch-bp,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/netbsd/nasd_netbsd_platform.h +=================================================================== +RCS file: include/nasd/netbsd/nasd_netbsd_platform.h +diff -N include/nasd/netbsd/nasd_netbsd_platform.h +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ include/nasd/netbsd/nasd_netbsd_platform.h 21 Mar 2005 17:07:29 -0000 1.2 +@@ -0,0 +1,50 @@ ++/* ++ * nasd_netbsd_platform.h ++ * ++ * Authors: Jim Zelenka, Sean Levy, Marc Unangst ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1998,1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++ ++#ifndef _NASD__NASD_NETBSD_PLATFORM_H_ ++#define _NASD__NASD_NETBSD_PLATFORM_H_ ++ ++#ifdef __LANGUAGE_C__ ++#define nasd_printf printf ++#endif /* __LANGUAGE_C__ */ ++ ++#define nasd_int64cast(_n_) _n_##LL ++#define nasd_uint64cast(_n_) _n_##ULL ++#define NASD_64s_FMT "qd" ++#define NASD_64u_FMT "qu" ++#define NASD_64x_FMT "qx" ++#define NASD_64X_FMT "qX" ++#define NASD_ID_FMT "016qx" ++ ++typedef const void * nasd_qsort_arg_type_t; ++ ++#define NASD_INLINE __inline ++ ++#endif /* !_NASD__NASD_NETBSD_PLATFORM_H_ */ ++ ++/* Local Variables: */ ++/* indent-tabs-mode: nil */ ++/* tab-width: 2 */ ++/* End: */ diff --git a/net/nasd/patches/patch-bq b/net/nasd/patches/patch-bq new file mode 100644 index 00000000000..acb447c32cb --- /dev/null +++ b/net/nasd/patches/patch-bq @@ -0,0 +1,55 @@ +$NetBSD: patch-bq,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: include/nasd/netbsd/nasd_netbsd_sys.h +=================================================================== +RCS file: include/nasd/netbsd/nasd_netbsd_sys.h +diff -N include/nasd/netbsd/nasd_netbsd_sys.h +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ include/nasd/netbsd/nasd_netbsd_sys.h 21 Mar 2005 17:07:29 -0000 1.2 +@@ -0,0 +1,46 @@ ++/* ++ * nasd_netbsd_sys.h ++ * ++ * NetBSD-specific defines for system interface ++ * ++ * Author: Jim Zelenka ++ */ ++/* ++ * Copyright (c) of Carnegie Mellon University, 1999. ++ * ++ * Permission to reproduce, use, and prepare derivative works of ++ * this software for internal use is granted provided the copyright ++ * and "No Warranty" statements are included with all reproductions ++ * and derivative works. This software may also be redistributed ++ * without charge provided that the copyright and "No Warranty" ++ * statements are included in all redistributions. ++ * ++ * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. ++ * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ++ * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED ++ * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY ++ * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE ++ * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT ++ * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. ++ */ ++ ++ ++#ifndef _NASD__NASD_NETBSD_SYS_H_ ++#define _NASD__NASD_NETBSD_SYS_H_ ++ ++#ifndef KERNEL ++#include <sys/errno.h> ++#include <sys/ioctl.h> ++#include <sys/param.h> ++#endif /* !KERNEL */ ++ ++typedef nasd_uint64 nasd_sys_dev_t; ++ ++#define NASD_MAX_IOCTL_SIZE ((1<<_IOC_SIZEBITS)-1) ++ ++#endif /* !_NASD__NASD_NETBSD_SYS_H_ */ ++ ++/* Local Variables: */ ++/* indent-tabs-mode: nil */ ++/* tab-width: 2 */ ++/* End: */ diff --git a/net/nasd/patches/patch-br b/net/nasd/patches/patch-br new file mode 100644 index 00000000000..dcda6aae91f --- /dev/null +++ b/net/nasd/patches/patch-br @@ -0,0 +1,18 @@ +$NetBSD: patch-br,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ + +Index: kernel_generate/Imakefile +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/kernel_generate/Imakefile,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- kernel_generate/Imakefile 21 Mar 2005 08:52:03 -0000 1.1.1.1 ++++ kernel_generate/Imakefile 21 Mar 2005 17:07:31 -0000 1.2 +@@ -33,6 +33,7 @@ + #define NASD_dosubdirs 1 + #endif /* LinuxArchitecture */ + ++ + #include "NASD.tmpl" + + #if NASD_dosubdirs == 1 diff --git a/net/nasd/patches/patch-bs b/net/nasd/patches/patch-bs new file mode 100644 index 00000000000..cce1a150670 --- /dev/null +++ b/net/nasd/patches/patch-bs @@ -0,0 +1,1567 @@ +$NetBSD: patch-bs,v 1.1.1.1 2005/05/04 08:56:51 agc Exp $ + +Index: tests/premote_string.c +=================================================================== +RCS file: /usr/cvsroot/nasd/nasd-1.3/tests/premote_string.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- tests/premote_string.c 21 Mar 2005 08:52:03 -0000 1.1.1.1 ++++ tests/premote_string.c 21 Mar 2005 17:07:32 -0000 1.2 +@@ -1,781 +1,781 @@ + /* Constants for the rot13 "encryption" active disk test */ + +-char nasd_premote_plaintext[]="<h2>The compilation environment</h2> ++char nasd_premote_plaintext[]="<h2>The compilation environment</h2>\n" ++"\n" ++" <p>\n" ++" The compilation environment of the NASD tree itself uses\n" ++" <kbd>imake</kbd>. To generate Makefiles, run the <kbd>itomf</kbd>\n" ++" script at the top of the NASD tree. On some platforms, this may\n" ++" require platform-specific arguments. Additional arguments may be\n" ++" specified to instruct the system that it should also build\n" ++" portions of the tree which are not built by default.\n" ++" <p>\n" ++" After the Makefiles are generated, a <kbd>make depend</kbd> from\n" ++" the top of the tree will create all automatically-generated source\n" ++" files, and add dependencies to all of the Makefiles.\n" ++"\n" ++" <p>\n" ++" Finally, <kbd>make</kbd> from the top of the tree will build all\n" ++" default components, and whatever non-default components were\n" ++" specified to <kbd>itomf</kbd> as well.\n" ++"\n" ++" <p>\n" ++" At any time, <kbd>make Makefile</kbd> in a directory will\n" ++" regenerate the Makefile from its corresponding\n" ++" <code>Imakefile</code>. Note that this new <code>Makefile</code>\n" ++" will not include dependencies; another <kbd>make depend</kbd> is\n" ++" necessary for that. <kbd>make Makefiles</kbd> will regenerate\n" ++" Makefiles in all subdirectories of the current directory, but not\n" ++" in the directory itself. <kbd>make depend</kbd> will regenerate\n" ++" dependencies for all subdirectories as well as the current\n" ++" directory.\n" ++"\n" ++" <p>\n" ++" The <kbd>make clean</kbd> production will remove any generated\n" ++" objects and executables, most editor backup files, and\n" ++" locally-generated source files in the current directory and all\n" ++" subdirectories. The <kbd>make sterile</kbd> production will remove\n" ++" all generated files (including Makefiles) in the current directory\n" ++" and all subdirectories, along with most editor backup files.\n" ++"\n" ++" <h2>Configuring the compilation environment for your system</h2>\n" ++"\n" ++" Names, locations, and arguments of system-local executables are\n" ++" specified in <code>config/NASD_site.def</code>. For instance, if\n" ++" your platform has located <kbd>sed</kbd> in a nonstandard\n" ++" location, the path to find it is specified by setting the\n" ++" <code>SED</code> variable in this file. All system-specific\n" ++" compilation options should be handled here, such as compiler\n" ++" flags, locations of executables, library paths, extra libraries to\n" ++" link against, et cetera. Modifications to this file will not take\n" ++" effect until the relevant Makefiles are regenerated (see above).\n" ++"\n" ++"<h3>Introduction</h3>\n" ++"<p>\n" ++"Many applications and subsystems within the NASD tree have a need to\n" ++"dynamically allocate and deallocate fixed-size structures. The preferred\n" ++"mechanism for doing so is the <i>freelist</i> mechanism. This set of\n" ++"interfaces provides support for maintaining pools of fixed-size chunks\n" ++"of memory, which may require explicit initialization and deinitialization\n" ++"to use.\n" ++"\n" ++"<p>\n" ++"If a programmer wishes to maintain caches of allocated\n" ++"but unused memory, the freelist mechanism should be used. There are\n" ++"several reasons for this. One is that using a consistent set of interfaces\n" ++"to do so helps others to read code they are unfamiliar with and identify\n" ++"what it does. Another is that the freelist mechanism is capable of collecting\n" ++"and reporting statistics on how each pool of memory was used, allowing\n" ++"better tuning of the system. A third is that by using a common, unified\n" ++"mechanism for managing allocated but currently unused chunks of memory,\n" ++"the NASD system is capable of reclaiming chunks of memory which are currently\n" ++"unused. This is especially useful in low-memory environments.\n" ++"\n" ++"<h3>Using freelists</h3>\n" ++"<p>\n" ++"To use freelists, be sure the <a href=memory.html>memory</a>\n" ++"module is properly initialized, and include <code>nasd/nasd_freelist.h</code>.\n" ++"Freelists have type <code>nasd_freelist_t</code>.\n" ++"The freelist interface is implemented as a set of macros for efficiency.\n" ++"To minimize overhead and debugging complexity, the freelist mechanism does\n" ++"not maintain additional data for individual allocations. Instead, it requires\n" ++"that users of the freelist interface provide for it typing and dereferencing\n" ++"information for the items in the freelist. This means that many of the\n" ++"freelist macros take as arguments the cast of the item type maintained in\n" ++"the list. The name of the structure or union element within this cast type\n" ++"is a pointer to the item type itself. For example, if one were\n" ++"maintaining a list of <code>nasd_foo_t</code>, that could mean that:\n" ++"<menu>\n" ++"Given<br>\n" ++"<code>\n" ++"typedef struct nasd_foo_s nasd_foo_t;<br>\n" ++"struct nasd_foo_s {<br>\n" ++" /* actual data for nasd_foo_t here */<br>\n" ++" nasd_foo_t *another_foo;<br>\n" ++"};<br>\n" ++"<p>\n" ++"</code></menu>\n" ++"The cast for items in the freelist is <code>(nasd_foo_t *)</code>. The\n" ++"pointer to the item type, henceforth referred to as the <i>next</i>\n" ++"pointer, is <code>another_foo</code>. To minimize overhead, the freelist\n" ++"mechanism allows users to set the next pointer arbitrarily whenever\n" ++"items are <b>not</b> in the freelist. This is handy for items which are\n" ++"maintained in lists when they are allocated - the list pointer can then\n" ++"be reused as the next pointer.\n" ++"\n" ++"<p>\n" ++"Sometimes, it is desirable to maintain freelists of items which do not\n" ++"naturally contain fields which are correctly-formed next pointers.\n" ++"If there is a void pointer in the item type, it is acceptable to use\n" ++"this in place of the next pointer. The preferred mechanism for dealing\n" ++"with this is to create a <code>union</code>. For instance, to\n" ++"maintain a freelist of arrays of eight kilobytes of memory:<br>\n" ++"<menu><code>\n" ++"typedef union nasd_foo_u nasd_foo_t;<br>\n" ++"union nasd_foo_u {<br>\n" ++" char data[8192];<br>\n" ++" nasd_foo_t *next;<br>\n" ++"};<br>\n" ++"</code></menu>\n" ++"In this example, <code>next</code> is a valid next pointer for the freelist\n" ++"mechanism, and the data field of <code>nasd_foo_t</code> is an eight kilobyte\n" ++"array.\n" ++"\n" ++"<h3>Basic freelists</h3>\n" ++"<p>\n" ++"The most basic kind of freelist is one which maintains chunks of data whose\n" ++"contents may be arbitrary, but require no special initialization or\n" ++"deinitialization. To use such a freelist, first declare a pointer to\n" ++"type <code>nasd_freelist_t</code>. Create the empty freelist by calling\n" ++"<code>NASD_FREELIST_CREATE()</code>. This takes four arguments. The\n" ++"first is the freelist pointer. The second is the maximum number of these\n" ++"items which should ever reside in the freelist at a particular time (extras will be\n" ++"returned to the system immediately). The third is how many additional\n" ++"items to allocate whenever the freelist is empty and an allocation is\n" ++"desired. The final argument is the size of the item. If the freelist\n" ++"pointer is <code>NULL</code> after evaluating <code>NASD_FREELIST_CREATE()</code>,\n" ++"the list itself could not be created.\n" ++"\n" ++"<p>\n" ++"It is often desirable at this point to make this newly-created freelist\n" ++"be non-empty, so that when the code begins executing, initial trips through\n" ++"not-yet-executed codepaths do not incur tremendous allocation costs. Do\n" ++"this by calling <code>NASD_FREELIST_PRIME()</code>, which takes four\n" ++"arguments. The first argument is the freelist pointer. The second is the\n" ++"number of items to create and add to the list. The third is the next\n" ++"pointer, and the fourth is the item cast.\n" ++"\n" ++"<p>\n" ++"To retrieve an item from the freelist, call <code>NASD_FREELIST_GET()</code>.\n" ++"This takes four arguments. The first is the freelist pointer. The second\n" ++"is a pointer to be assigned with the address of the object retrieved from\n" ++"the freelist. The third is the next pointer, and the fourth is the item\n" ++"cast.\n" ++"\n" ++"<p>\n" ++"To return an item to a freelist, call <code>NASD_FREELIST_FREE()</code>.\n" ++"This takes three arguments. The first is the freelist pointer. The\n" ++"second is the address of the item to return. The third is the next\n" ++"pointer.\n" ++"\n" ++"<p>\n" ++"When a freelist is no longer needed, it (along with its current contents)\n" ++"may be deallocated with <code>NASD_FREELIST_DESTROY()</code>. This\n" ++"macro takes three arguments. The first is the freelist pointer. The\n" ++"second is the next pointer. The third is the item cast.\n" ++"\n" ++"<p>\n" ++"<b>Example:</b> Let's say we have a type <code>nasd_foo_t</code>, for which we\n" ++"wish to maintain a freelist. We might have something like:<br>\n" ++"<menu><pre><code>\n" ++"typedef struct nasd_foo_s nasd_foo_t;\n" ++"struct nasd_foo_s {\n" ++" /* actual data for nasd_foo_t here */\n" ++" nasd_foo_t *another_foo;\n" ++"};\n" ++"<p>\n" ++"nasd_freelist_t *nasd_foo_freelist;\n" ++"#define NASD_MAX_FREE_FOO 1024 /* Maximum number of foos\n" ++" * to have in the freelist\n" ++" * at a time\n" ++" */\n" ++"#define NASD_FOO_INC 64 /* How many foos to add to\n" ++" * the freelist at a time\n" ++" * when we run out\n" ++" */\n" ++"#define NASD_FOO_INITIAL 32 /* How many foos to create\n" ++" * at start of day\n" ++" */\n" ++"<p>\n" ++"nasd_status_t\n" ++"nasd_init_foo_freelist()\n" ++"{\n" ++" NASD_FREELIST_CREATE(nasd_foo_freelist, NASD_MAX_FREE_FOO,\n" ++" NASD_FOO_INC, sizeof(nasd_foo_t));\n" ++" if (nasd_foo_freelist == NULL) {\n" ++" return(NASD_NO_MEM);\n" ++" }\n" ++"\n" ++" NASD_FREELIST_PRIME(nasd_foo_freelist, NASD_FOO_INITIAL,next,\n" ++" (nasd_foo_t *));\n" ++"\n" ++" return(NASD_SUCCESS);\n" ++"}\n" ++"<p>\n" ++"nasd_status_t\n" ++"nasd_get_foo(\n" ++" nasd_foo_t **foo_p)\n" ++"{\n" ++" NASD_FREELIST_GET(nasd_foo_freelist,*foo_p,next,(nasd_foo_t *));\n" ++" if (*foo_p == NULL)\n" ++" return(NASD_NO_MEM);\n" ++" return(NASD_SUCCESS);\n" ++"}\n" ++"<p>\n" ++"void\n" ++"nasd_free_foo(\n" ++" nasd_foo_t *foo)\n" ++"{\n" ++" NASD_FREELIST_FREE(nasd_foo_freelist,foo,next);\n" ++"}\n" ++"<p>\n" ++"void\n" ++"nasd_shutdown_foo_freelist()\n" ++"{\n" ++" NASD_FREELIST_DESTROY(nasd_foo_freelist,next,(nasd_foo_t *));\n" ++"}\n" ++"</code></pre></menu>\n" ++"\n" ++"<br>\n" ++"<p>\n" ++"<h3>Freelists with initialized items</h3>\n" ++"\n" ++"Sometimes, it is desirable to have the items in a freelist maintain\n" ++"state across allocate and free operations. For instance, each item\n" ++"might contain a mutex. Rather than initialize and destroy a mutex\n" ++"each time an item is allocated from or freed to the freelist, it is\n" ++"more desirable to initialize a mutex each time an item is created for\n" ++"the freelist, and deinitialize it whenever the item is returned to\n" ++"the system. To that end, the freelist mechanism provides variants\n" ++"on the above interfaces: <code>NASD_FREELIST_PRIME_INIT()</code>,\n" ++"<code>NASD_FREELIST_GET_INIT()</code>, <code>NASD_FREELIST_FREE_CLEAN()</code>,\n" ++"and <code>NASD_FREELIST_DESTROY_CLEAN()</code>.\n" ++"\n" ++"<p>\n" ++"<code>NASD_FREELIST_PRIME_INIT()</code> and <code>NASD_FREELIST_GET_INIT()</code>\n" ++"are very similar to <code>NASD_FREELIST_PRIME()</code> and <code>NASD_FREELIST_GET()</code>,\n" ++"respectively. Each takes an additional argument, however, which is an\n" ++"initialization function. This function should take a pointer to\n" ++"the item type as its sole argument, and return <code>nasd_status_t</code>.\n" ++"If the initialization is successful, it should return <code>NASD_SUCCESS</code>.\n" ++"Otherwise, it should return a meaningful error code. Likewise,\n" ++"<code>NASD_FREELIST_FREE_CLEAN()</code>, and <code>NASD_FREELIST_DESTROY_CLEAN()</code>\n" ++"take an additional argument which is a function returning void that takes\n" ++"a pointer to the item type as its sole argument. This function is responsible\n" ++"for reversing the action of the init function. For example, if we added a mutex\n" ++"and a condition variable to <code>nasd_foo_t</code> in our earlier example, we would\n" ++"get:\n" ++"<menu><pre><code>\n" ++"typedef struct nasd_foo_s nasd_foo_t;\n" ++"struct nasd_foo_s {\n" ++" NASD_DECLARE_MUTEX(mutex)\n" ++" NASD_DECLARE_COND(cond)\n" ++" /* other data for nasd_foo_t here */\n" ++" nasd_foo_t *another_foo;\n" ++"};\n" ++"<p>\n" ++"nasd_freelist_t *nasd_foo_freelist;\n" ++"#define NASD_MAX_FREE_FOO 1024 /* Maximum number of foos\n" ++" * to have in the freelist\n" ++" * at a time\n" ++" */\n" ++"#define NASD_FOO_INC 64 /* How many foos to add to\n" ++" * the freelist at a time\n" ++" * when we run out\n" ++" */\n" ++"#define NASD_FOO_INITIAL 32 /* How many foos to create\n" ++" * at start of day\n" ++" */\n" ++"<p>\n" ++"static nasd_status_t\n" ++"init_foo(\n" ++" nasd_foo_t *foo)\n" ++"{\n" ++" nasd_status_t rc;\n" ++"\n" ++" rc = nasd_mutex_init(&foo->lock);\n" ++" if (rc)\n" ++" return(rc);\n" ++" rc = nasd_cond_init(&foo->cond);\n" ++" if (rc) {\n" ++" nasd_mutex_destroy(&foo->lock);\n" ++" return(rc);\n" ++" }\n" ++" return(NASD_SUCCESS);\n" ++"}\n" ++"\n" ++"static void\n" ++"clean_foo(\n" ++" nasd_foo_t *foo)\n" ++"{\n" ++" nasd_status_t rc;\n" ++"\n" ++" rc = nasd_mutex_destroy(&foo->lock);\n" ++" if (rc) {\n" ++" printf(WARNING: got 0x%x (%s) destroying foo lockn,\n" ++" rc, nasd_error_string(rc));\n" ++" }\n" ++" rc = nasd_cond_destroy(&foo->cond);\n" ++" if (rc) {\n" ++" printf(WARNING: got 0x%x (%s) destroying foo condn,\n" ++" rc, nasd_error_string(rc));\n" ++" }\n" ++"}\n" ++"\n" ++"nasd_status_t\n" ++"nasd_init_foo_freelist()\n" ++"{\n" ++" NASD_FREELIST_CREATE(nasd_foo_freelist, NASD_MAX_FREE_FOO,\n" ++" NASD_FOO_INC, sizeof(nasd_foo_t));\n" ++" if (nasd_foo_freelist == NULL) {\n" ++" return(NASD_NO_MEM);\n" ++" }\n" ++"\n" ++" NASD_FREELIST_PRIME_INIT(nasd_foo_freelist, NASD_FOO_INITIAL, next,\n" ++" (nasd_foo_t *), init_foo);\n" ++"\n" ++" return(NASD_SUCCESS);\n" ++"}\n" ++"<p>\n" ++"nasd_status_t\n" ++"nasd_get_foo(\n" ++" nasd_foo_t **foo_p)\n" ++"{\n" ++" NASD_FREELIST_GET_INIT(nasd_foo_freelist, *foo_p,\n" ++" next, (nasd_foo_t *), init_foo);\n" ++" if (*foo_p == NULL)\n" ++" return(NASD_NO_MEM);\n" ++" return(NASD_SUCCESS);\n" ++"}\n" ++"<p>\n" ++"void\n" ++"nasd_free_foo(\n" ++" nasd_foo_t *foo)\n" ++"{\n" ++" NASD_FREELIST_FREE_CLEAN(nasd_foo_freelist, foo, next, clean_foo);\n" ++"}\n" ++"<p>\n" ++"void\n" ++"nasd_shutdown_foo_freelist()\n" ++"{\n" ++" NASD_FREELIST_DESTROY(nasd_foo_freelist, next, (nasd_foo_t *), clean_foo);\n" ++"}\n" ++"</code></pre></menu>\n" ++"\n" ++"Now every <code>nasd_foo_t</code> resulting from a call to <code>nasd_get_foo()</code>\n" ++"contains validly-initialized mutex and condition variables.\n" ++"\n" ++"<br><p>\n" ++"<h3>Advanced topics</h3>\n" ++"\n" ++"Sometimes item initialization and cleanup functions might desire additional\n" ++"out-of-band data. For this reason, the <code>_INIT</code> and <code>_CLEAN</code>\n" ++"macros also have <code>_INIT_ARG</code> and <code>_CLEAN_ARG</code> variants.\n" ++"These variants take an additional argument after the init or clean function\n" ++"which is passed as a second argument to the init or clean functions themselves.\n" ++"Because the freelist interface is entirely macroized, these arguments may have\n" ++"any type.\n" ++"\n" ++"<p>\n" ++"Freelists protect against accesses by multiple threads by using internal\n" ++"mutexes. These mutexes may be accessed directly by operationg on\n" ++"<code>NASD_FREELIST_MUTEX_OF(<i>freelist_pointer</i>)</code>. To lock\n" ++"this mutex, use <code>NASD_FREELIST_DO_LOCK(<i>freelist_pointer</i>)</code>.\n" ++"To unlock it, use <code>NASD_FREELIST_DO_UNLOCK(<i>freelist_pointer</i>)</code>.\n" ++"The header file <code>nasd_freelist.h</code> provides variants of many of\n" ++"the freelist interfaces which do not take or release locks themselves. If\n" ++"you use this, you are responsible for correctly synchronizing access to the\n" ++"freelist. This has the opportunity for providing greater efficiency when\n" ++"batching operations, or when performing operations already protected by\n" ++"other locks.\n" ++"\n" ++"<p>\n" ++"If <code>NASD_FREELIST_STATS</code> is defined nonzero in <code>nasd_options.h</code>,\n" ++"when each freelist is destroyed, statistics about operations performed on it\n" ++"are printed, including the number of times items were allocated and freed\n" ++"from the list, how many times the list ran empty and how many more items had to be\n" ++"allocated, the largest number of unused items that was ever in the list, and\n" ++"the largest number of items that was ever allocated at a time, among others.\n" ++; ++ ++char nasd_premote_ciphertext[] = "<u2>Gur pbzcvyngvba raivebazrag</u2>\n" ++"\n" ++" <c>\n" ++" Gur pbzcvyngvba raivebazrag bs gur ANFQ gerr vgfrys hfrf\n" ++" <xoq>vznxr</xoq>. Gb trarengr Znxrsvyrf, eha gur <xoq>vgbzs</xoq>\n" ++" fpevcg ng gur gbc bs gur ANFQ gerr. Ba fbzr cyngsbezf, guvf znl\n" ++" erdhver cyngsbez-fcrpvsvp nethzragf. Nqqvgvbany nethzragf znl or\n" ++" fcrpvsvrq gb vafgehpg gur flfgrz gung vg fubhyq nyfb ohvyq\n" ++" cbegvbaf bs gur gerr juvpu ner abg ohvyg ol qrsnhyg.\n" ++" <c>\n" ++" Nsgre gur Znxrsvyrf ner trarengrq, n <xoq>znxr qrcraq</xoq> sebz\n" ++" gur gbc bs gur gerr jvyy perngr nyy nhgbzngvpnyyl-trarengrq fbhepr\n" ++" svyrf, naq nqq qrcraqrapvrf gb nyy bs gur Znxrsvyrf.\n" ++"\n" ++" <c>\n" ++" Svanyyl, <xoq>znxr</xoq> sebz gur gbc bs gur gerr jvyy ohvyq nyy\n" ++" qrsnhyg pbzcbaragf, naq jungrire aba-qrsnhyg pbzcbaragf jrer\n" ++" fcrpvsvrq gb <xoq>vgbzs</xoq> nf jryy.\n" ++"\n" ++" <c>\n" ++" Ng nal gvzr, <xoq>znxr Znxrsvyr</xoq> va n qverpgbel jvyy\n" ++" ertrarengr gur Znxrsvyr sebz vgf pbeerfcbaqvat\n" ++" <pbqr>Vznxrsvyr</pbqr>. Abgr gung guvf arj <pbqr>Znxrsvyr</pbqr>\n" ++" jvyy abg vapyhqr qrcraqrapvrf; nabgure <xoq>znxr qrcraq</xoq> vf\n" ++" arprffnel sbe gung. <xoq>znxr Znxrsvyrf</xoq> jvyy ertrarengr\n" ++" Znxrsvyrf va nyy fhoqverpgbevrf bs gur pheerag qverpgbel, ohg abg\n" ++" va gur qverpgbel vgfrys. <xoq>znxr qrcraq</xoq> jvyy ertrarengr\n" ++" qrcraqrapvrf sbe nyy fhoqverpgbevrf nf jryy nf gur pheerag\n" ++" qverpgbel.\n" ++"\n" ++" <c>\n" ++" Gur <xoq>znxr pyrna</xoq> cebqhpgvba jvyy erzbir nal trarengrq\n" ++" bowrpgf naq rkrphgnoyrf, zbfg rqvgbe onpxhc svyrf, naq\n" ++" ybpnyyl-trarengrq fbhepr svyrf va gur pheerag qverpgbel naq nyy\n" ++" fhoqverpgbevrf. Gur <xoq>znxr fgrevyr</xoq> cebqhpgvba jvyy erzbir\n" ++" nyy trarengrq svyrf (vapyhqvat Znxrsvyrf) va gur pheerag qverpgbel\n" ++" naq nyy fhoqverpgbevrf, nybat jvgu zbfg rqvgbe onpxhc svyrf.\n" ++"\n" ++" <u2>Pbasvthevat gur pbzcvyngvba raivebazrag sbe lbhe flfgrz</u2>\n" ++"\n" ++" Anzrf, ybpngvbaf, naq nethzragf bs flfgrz-ybpny rkrphgnoyrf ner\n" ++" fcrpvsvrq va <pbqr>pbasvt/ANFQ_fvgr.qrs</pbqr>. Sbe vafgnapr, vs\n" ++" lbhe cyngsbez unf ybpngrq <xoq>frq</xoq> va n abafgnaqneq\n" ++" ybpngvba, gur cngu gb svaq vg vf fcrpvsvrq ol frggvat gur\n" ++" <pbqr>FRQ</pbqr> inevnoyr va guvf svyr. Nyy flfgrz-fcrpvsvp\n" ++" pbzcvyngvba bcgvbaf fubhyq or unaqyrq urer, fhpu nf pbzcvyre\n" ++" syntf, ybpngvbaf bs rkrphgnoyrf, yvoenel cnguf, rkgen yvoenevrf gb\n" ++" yvax ntnvafg, rg prgren. Zbqvsvpngvbaf gb guvf svyr jvyy abg gnxr\n" ++" rssrpg hagvy gur eryrinag Znxrsvyrf ner ertrarengrq (frr nobir).\n" ++"\n" ++"<u3>Vagebqhpgvba</u3>\n" ++"<c>\n" ++"Znal nccyvpngvbaf naq fhoflfgrzf jvguva gur ANFQ gerr unir n arrq gb\n" ++"qlanzvpnyyl nyybpngr naq qrnyybpngr svkrq-fvmr fgehpgherf. Gur cersreerq\n" ++"zrpunavfz sbe qbvat fb vf gur <v>serryvfg</v> zrpunavfz. Guvf frg bs\n" ++"vagresnprf cebivqrf fhccbeg sbe znvagnvavat cbbyf bs svkrq-fvmr puhaxf\n" ++"bs zrzbel, juvpu znl erdhver rkcyvpvg vavgvnyvmngvba naq qrvavgvnyvmngvba\n" ++"gb hfr.\n" ++"\n" ++"<c>\n" ++"Vs n cebtenzzre jvfurf gb znvagnva pnpurf bs nyybpngrq\n" ++"ohg hahfrq zrzbel, gur serryvfg zrpunavfz fubhyq or hfrq. Gurer ner\n" ++"frireny ernfbaf sbe guvf. Bar vf gung hfvat n pbafvfgrag frg bs vagresnprf\n" ++"gb qb fb urycf bguref gb ernq pbqr gurl ner hasnzvyvne jvgu naq vqragvsl\n" ++"jung vg qbrf. Nabgure vf gung gur serryvfg zrpunavfz vf pncnoyr bs pbyyrpgvat\n" ++"naq ercbegvat fgngvfgvpf ba ubj rnpu cbby bs zrzbel jnf hfrq, nyybjvat\n" ++"orggre ghavat bs gur flfgrz. N guveq vf gung ol hfvat n pbzzba, havsvrq\n" ++"zrpunavfz sbe znantvat nyybpngrq ohg pheeragyl hahfrq puhaxf bs zrzbel,\n" ++"gur ANFQ flfgrz vf pncnoyr bs erpynvzvat puhaxf bs zrzbel juvpu ner pheeragyl\n" ++"hahfrq. Guvf vf rfcrpvnyyl hfrshy va ybj-zrzbel raivebazragf.\n" ++"\n" ++"<u3>Hfvat serryvfgf</u3>\n" ++"<c>\n" ++"Gb hfr serryvfgf, or fher gur <n uers=zrzbel.ugzy>zrzbel</n>\n" ++"zbqhyr vf cebcreyl vavgvnyvmrq, naq vapyhqr <pbqr>anfq/anfq_serryvfg.u</pbqr>.\n" ++"Serryvfgf unir glcr <pbqr>anfq_serryvfg_g</pbqr>.\n" ++"Gur serryvfg vagresnpr vf vzcyrzragrq nf n frg bs znpebf sbe rssvpvrapl.\n" ++"Gb zvavzvmr bireurnq naq qrohttvat pbzcyrkvgl, gur serryvfg zrpunavfz qbrf\n" ++"abg znvagnva nqqvgvbany qngn sbe vaqvivqhny nyybpngvbaf. Vafgrnq, vg erdhverf\n" ++"gung hfref bs gur serryvfg vagresnpr cebivqr sbe vg glcvat naq qrersrerapvat\n" ++"vasbezngvba sbe gur vgrzf va gur serryvfg. Guvf zrnaf gung znal bs gur\n" ++"serryvfg znpebf gnxr nf nethzragf gur pnfg bs gur vgrz glcr znvagnvarq va\n" ++"gur yvfg. Gur anzr bs gur fgehpgher be havba ryrzrag jvguva guvf pnfg glcr\n" ++"vf n cbvagre gb gur vgrz glcr vgfrys. Sbe rknzcyr, vs bar jrer\n" ++"znvagnvavat n yvfg bs <pbqr>anfq_sbb_g</pbqr>, gung pbhyq zrna gung:\n" ++"<zrah>\n" ++"Tvira<oe>\n" ++"<pbqr>\n" ++"glcrqrs fgehpg anfq_sbb_f anfq_sbb_g;<oe>\n" ++"fgehpg anfq_sbb_f {<oe>\n" ++"&aofc;&aofc;/* npghny qngn sbe anfq_sbb_g urer */<oe>\n" ++"&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*nabgure_sbb;<oe>\n" ++"};<oe>\n" ++"<c>\n" ++"</pbqr></zrah>\n" ++"Gur pnfg sbe vgrzf va gur serryvfg vf <pbqr>(anfq_sbb_g *)</pbqr>. Gur\n" ++"cbvagre gb gur vgrz glcr, uraprsbegu ersreerq gb nf gur <v>arkg</v>\n" ++"cbvagre, vf <pbqr>nabgure_sbb</pbqr>. Gb zvavzvmr bireurnq, gur serryvfg\n" ++"zrpunavfz nyybjf hfref gb frg gur arkg cbvagre neovgenevyl jurarire\n" ++"vgrzf ner <o>abg</o> va gur serryvfg. Guvf vf unaql sbe vgrzf juvpu ner\n" ++"znvagnvarq va yvfgf jura gurl ner nyybpngrq - gur yvfg cbvagre pna gura\n" ++"or erhfrq nf gur arkg cbvagre.\n" ++"\n" ++"<c>\n" ++"Fbzrgvzrf, vg vf qrfvenoyr gb znvagnva serryvfgf bs vgrzf juvpu qb abg\n" ++"anghenyyl pbagnva svryqf juvpu ner pbeerpgyl-sbezrq arkg cbvagref.\n" ++"Vs gurer vf n ibvq cbvagre va gur vgrz glcr, vg vf npprcgnoyr gb hfr\n" ++"guvf va cynpr bs gur arkg cbvagre. Gur cersreerq zrpunavfz sbe qrnyvat\n" ++"jvgu guvf vf gb perngr n <pbqr>havba</pbqr>. Sbe vafgnapr, gb\n" ++"znvagnva n serryvfg bs neenlf bs rvtug xvybolgrf bs zrzbel:<oe>\n" ++"<zrah><pbqr>\n" ++"glcrqrs havba anfq_sbb_h anfq_sbb_g;<oe>\n" ++"havba anfq_sbb_h {<oe>\n" ++"&aofc;&aofc;pune&aofc;&aofc;&aofc;&aofc;&aofc;&aofc;&aofc;&aofc;&aofc;qngn[8192];<oe>\n" ++"&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*arkg;<oe>\n" ++"};<oe>\n" ++"</pbqr></zrah>\n" ++"Va guvf rknzcyr, <pbqr>arkg</pbqr> vf n inyvq arkg cbvagre sbe gur serryvfg\n" ++"zrpunavfz, naq gur qngn svryq bs <pbqr>anfq_sbb_g</pbqr> vf na rvtug xvybolgr\n" ++"neenl.\n" ++"\n" ++"<u3>Onfvp serryvfgf</u3>\n" ++"<c>\n" ++"Gur zbfg onfvp xvaq bs serryvfg vf bar juvpu znvagnvaf puhaxf bs qngn jubfr\n" ++"pbagragf znl or neovgenel, ohg erdhver ab fcrpvny vavgvnyvmngvba be\n" ++"qrvavgvnyvmngvba. Gb hfr fhpu n serryvfg, svefg qrpyner n cbvagre gb\n" ++"glcr <pbqr>anfq_serryvfg_g</pbqr>. Perngr gur rzcgl serryvfg ol pnyyvat\n" ++"<pbqr>ANFQ_SERRYVFG_PERNGR()</pbqr>. Guvf gnxrf sbhe nethzragf. Gur\n" ++"svefg vf gur serryvfg cbvagre. Gur frpbaq vf gur znkvzhz ahzore bs gurfr\n" ++"vgrzf juvpu fubhyq rire erfvqr va gur serryvfg ng n cnegvphyne gvzr (rkgenf jvyy or\n" ++"erghearq gb gur flfgrz vzzrqvngryl). Gur guveq vf ubj znal nqqvgvbany\n" ++"vgrzf gb nyybpngr jurarire gur serryvfg vf rzcgl naq na nyybpngvba vf\n" ++"qrfverq. Gur svany nethzrag vf gur fvmr bs gur vgrz. Vs gur serryvfg\n" ++"cbvagre vf <pbqr>AHYY</pbqr> nsgre rinyhngvat <pbqr>ANFQ_SERRYVFG_PERNGR()</pbqr>,\n" ++"gur yvfg vgfrys pbhyq abg or perngrq.\n" ++"\n" ++"<c>\n" ++"Vg vf bsgra qrfvenoyr ng guvf cbvag gb znxr guvf arjyl-perngrq serryvfg\n" ++"or aba-rzcgl, fb gung jura gur pbqr ortvaf rkrphgvat, vavgvny gevcf guebhtu\n" ++"abg-lrg-rkrphgrq pbqrcnguf qb abg vaphe gerzraqbhf nyybpngvba pbfgf. Qb\n" ++"guvf ol pnyyvat <pbqr>ANFQ_SERRYVFG_CEVZR()</pbqr>, juvpu gnxrf sbhe\n" ++"nethzragf. Gur svefg nethzrag vf gur serryvfg cbvagre. Gur frpbaq vf gur\n" ++"ahzore bs vgrzf gb perngr naq nqq gb gur yvfg. Gur guveq vf gur arkg\n" ++"cbvagre, naq gur sbhegu vf gur vgrz pnfg.\n" ++"\n" ++"<c>\n" ++"Gb ergevrir na vgrz sebz gur serryvfg, pnyy <pbqr>ANFQ_SERRYVFG_TRG()</pbqr>.\n" ++"Guvf gnxrf sbhe nethzragf. Gur svefg vf gur serryvfg cbvagre. Gur frpbaq\n" ++"vf n cbvagre gb or nffvtarq jvgu gur nqqerff bs gur bowrpg ergevrirq sebz\n" ++"gur serryvfg. Gur guveq vf gur arkg cbvagre, naq gur sbhegu vf gur vgrz\n" ++"pnfg.\n" ++"\n" ++"<c>\n" ++"Gb erghea na vgrz gb n serryvfg, pnyy <pbqr>ANFQ_SERRYVFG_SERR()</pbqr>.\n" ++"Guvf gnxrf guerr nethzragf. Gur svefg vf gur serryvfg cbvagre. Gur\n" ++"frpbaq vf gur nqqerff bs gur vgrz gb erghea. Gur guveq vf gur arkg\n" ++"cbvagre.\n" ++"\n" ++"<c>\n" ++"Jura n serryvfg vf ab ybatre arrqrq, vg (nybat jvgu vgf pheerag pbagragf)\n" ++"znl or qrnyybpngrq jvgu <pbqr>ANFQ_SERRYVFG_QRFGEBL()</pbqr>. Guvf\n" ++"znpeb gnxrf guerr nethzragf. Gur svefg vf gur serryvfg cbvagre. Gur\n" ++"frpbaq vf gur arkg cbvagre. Gur guveq vf gur vgrz pnfg.\n" ++"\n" ++"<c>\n" ++"<o>Rknzcyr:</o> Yrg'f fnl jr unir n glcr <pbqr>anfq_sbb_g</pbqr>, sbe juvpu jr\n" ++"jvfu gb znvagnva n serryvfg. Jr zvtug unir fbzrguvat yvxr:<oe>\n" ++"<zrah><cer><pbqr>\n" ++"glcrqrs fgehpg anfq_sbb_f anfq_sbb_g;\n" ++"fgehpg anfq_sbb_f {\n" ++"&aofc;&aofc;/* npghny qngn sbe anfq_sbb_g urer */\n" ++"&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*nabgure_sbb;\n" ++"};\n" ++"<c>\n" ++"anfq_serryvfg_g *anfq_sbb_serryvfg;\n" ++"#qrsvar ANFQ_ZNK_SERR_SBB 1024 /* Znkvzhz ahzore bs sbbf\n" ++" * gb unir va gur serryvfg\n" ++" * ng n gvzr\n" ++" */\n" ++"#qrsvar ANFQ_SBB_VAP 64 /* Ubj znal sbbf gb nqq gb\n" ++" * gur serryvfg ng n gvzr\n" ++" * jura jr eha bhg\n" ++" */\n" ++"#qrsvar ANFQ_SBB_VAVGVNY 32 /* Ubj znal sbbf gb perngr\n" ++" * ng fgneg bs qnl\n" ++" */\n" ++"<c>\n" ++"anfq_fgnghf_g\n" ++"anfq_vavg_sbb_serryvfg()\n" ++"{\n" ++" ANFQ_SERRYVFG_PERNGR(anfq_sbb_serryvfg, ANFQ_ZNK_SERR_SBB,\n" ++" ANFQ_SBB_VAP, fvmrbs(anfq_sbb_g));\n" ++" vs (anfq_sbb_serryvfg == AHYY) {\n" ++" erghea(ANFQ_AB_ZRZ);\n" ++" }\n" ++"\n" ++" ANFQ_SERRYVFG_CEVZR(anfq_sbb_serryvfg, ANFQ_SBB_VAVGVNY,arkg,\n" ++" (anfq_sbb_g *));\n" ++"\n" ++" erghea(ANFQ_FHPPRFF);\n" ++"}\n" ++"<c>\n" ++"anfq_fgnghf_g\n" ++"anfq_trg_sbb(\n" ++"&aofc;&aofc;anfq_sbb_g&aofc;&aofc;**sbb_c)\n" ++"{\n" ++" ANFQ_SERRYVFG_TRG(anfq_sbb_serryvfg,*sbb_c,arkg,(anfq_sbb_g *));\n" ++" vs (*sbb_c == AHYY)\n" ++" erghea(ANFQ_AB_ZRZ);\n" ++" erghea(ANFQ_FHPPRFF);\n" ++"}\n" ++"<c>\n" ++"ibvq\n" ++"anfq_serr_sbb(\n" ++"&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*sbb)\n" ++"{\n" ++" ANFQ_SERRYVFG_SERR(anfq_sbb_serryvfg,sbb,arkg);\n" ++"}\n" ++"<c>\n" ++"ibvq\n" ++"anfq_fuhgqbja_sbb_serryvfg()\n" ++"{\n" ++" ANFQ_SERRYVFG_QRFGEBL(anfq_sbb_serryvfg,arkg,(anfq_sbb_g *));\n" ++"}\n" ++"</pbqr></cer></zrah>\n" ++"\n" ++"<oe>\n" ++"<c>\n" ++"<u3>Serryvfgf jvgu vavgvnyvmrq vgrzf</u3>\n" ++"\n" ++"Fbzrgvzrf, vg vf qrfvenoyr gb unir gur vgrzf va n serryvfg znvagnva\n" ++"fgngr npebff nyybpngr naq serr bcrengvbaf. Sbe vafgnapr, rnpu vgrz\n" ++"zvtug pbagnva n zhgrk. Engure guna vavgvnyvmr naq qrfgebl n zhgrk\n" ++"rnpu gvzr na vgrz vf nyybpngrq sebz be serrq gb gur serryvfg, vg vf\n" ++"zber qrfvenoyr gb vavgvnyvmr n zhgrk rnpu gvzr na vgrz vf perngrq sbe\n" ++"gur serryvfg, naq qrvavgvnyvmr vg jurarire gur vgrz vf erghearq gb\n" ++"gur flfgrz. Gb gung raq, gur serryvfg zrpunavfz cebivqrf inevnagf\n" ++"ba gur nobir vagresnprf: <pbqr>ANFQ_SERRYVFG_CEVZR_VAVG()</pbqr>,\n" ++"<pbqr>ANFQ_SERRYVFG_TRG_VAVG()</pbqr>, <pbqr>ANFQ_SERRYVFG_SERR_PYRNA()</pbqr>,\n" ++"naq <pbqr>ANFQ_SERRYVFG_QRFGEBL_PYRNA()</pbqr>.\n" ++"\n" ++"<c>\n" ++"<pbqr>ANFQ_SERRYVFG_CEVZR_VAVG()</pbqr> naq <pbqr>ANFQ_SERRYVFG_TRG_VAVG()</pbqr>\n" ++"ner irel fvzvyne gb <pbqr>ANFQ_SERRYVFG_CEVZR()</pbqr> naq <pbqr>ANFQ_SERRYVFG_TRG()</pbqr>,\n" ++"erfcrpgviryl. Rnpu gnxrf na nqqvgvbany nethzrag, ubjrire, juvpu vf na\n" ++"vavgvnyvmngvba shapgvba. Guvf shapgvba fubhyq gnxr n cbvagre gb\n" ++"gur vgrz glcr nf vgf fbyr nethzrag, naq erghea <pbqr>anfq_fgnghf_g</pbqr>.\n" ++"Vs gur vavgvnyvmngvba vf fhpprffshy, vg fubhyq erghea <pbqr>ANFQ_FHPPRFF</pbqr>.\n" ++"Bgurejvfr, vg fubhyq erghea n zrnavatshy reebe pbqr. Yvxrjvfr,\n" ++"<pbqr>ANFQ_SERRYVFG_SERR_PYRNA()</pbqr>, naq <pbqr>ANFQ_SERRYVFG_QRFGEBL_PYRNA()</pbqr>\n" ++"gnxr na nqqvgvbany nethzrag juvpu vf n shapgvba ergheavat ibvq gung gnxrf\n" ++"n cbvagre gb gur vgrz glcr nf vgf fbyr nethzrag. Guvf shapgvba vf erfcbafvoyr\n" ++"sbe erirefvat gur npgvba bs gur vavg shapgvba. Sbe rknzcyr, vs jr nqqrq n zhgrk\n" ++"naq n pbaqvgvba inevnoyr gb <pbqr>anfq_sbb_g</pbqr> va bhe rneyvre rknzcyr, jr jbhyq\n" ++"trg:\n" ++"<zrah><cer><pbqr>\n" ++"glcrqrs fgehpg anfq_sbb_f anfq_sbb_g;\n" ++"fgehpg anfq_sbb_f {\n" ++"&aofc;&aofc;ANFQ_QRPYNER_ZHGRK(zhgrk)\n" ++"&aofc;&aofc;ANFQ_QRPYNER_PBAQ(pbaq)\n" ++"&aofc;&aofc;/* bgure qngn sbe anfq_sbb_g urer */\n" ++"&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*nabgure_sbb;\n" ++"};\n" ++"<c>\n" ++"anfq_serryvfg_g *anfq_sbb_serryvfg;\n" ++"#qrsvar ANFQ_ZNK_SERR_SBB 1024 /* Znkvzhz ahzore bs sbbf\n" ++" * gb unir va gur serryvfg\n" ++" * ng n gvzr\n" ++" */\n" ++"#qrsvar ANFQ_SBB_VAP 64 /* Ubj znal sbbf gb nqq gb\n" ++" * gur serryvfg ng n gvzr\n" ++" * jura jr eha bhg\n" ++" */\n" ++"#qrsvar ANFQ_SBB_VAVGVNY 32 /* Ubj znal sbbf gb perngr\n" ++" * ng fgneg bs qnl\n" ++" */\n" ++"<c>\n" ++"fgngvp anfq_fgnghf_g\n" ++"vavg_sbb(\n" ++" anfq_sbb_g *sbb)\n" ++"{\n" ++" anfq_fgnghf_g ep;\n" ++"\n" ++" ep = anfq_zhgrk_vavg(&sbb->ybpx);\n" ++" vs (ep)\n" ++" erghea(ep);\n" ++" ep = anfq_pbaq_vavg(&sbb->pbaq);\n" ++" vs (ep) {\n" ++" anfq_zhgrk_qrfgebl(&sbb->ybpx);\n" ++" erghea(ep);\n" ++" }\n" ++" erghea(ANFQ_FHPPRFF);\n" ++"}\n" ++"\n" ++"fgngvp ibvq\n" ++"pyrna_sbb(\n" ++" anfq_sbb_g *sbb)\n" ++"{\n" ++" anfq_fgnghf_g ep;\n" ++"\n" ++" ep = anfq_zhgrk_qrfgebl(&sbb->ybpx);\n" ++" vs (ep) {\n" ++" cevags(JNEAVAT: tbg 0k%k (%f) qrfgeblvat sbb ybpxa,\n" ++" ep, anfq_reebe_fgevat(ep));\n" ++" }\n" ++" ep = anfq_pbaq_qrfgebl(&sbb->pbaq);\n" ++" vs (ep) {\n" ++" cevags(JNEAVAT: tbg 0k%k (%f) qrfgeblvat sbb pbaqa,\n" ++" ep, anfq_reebe_fgevat(ep));\n" ++" }\n" ++"}\n" ++"\n" ++"anfq_fgnghf_g\n" ++"anfq_vavg_sbb_serryvfg()\n" ++"{\n" ++" ANFQ_SERRYVFG_PERNGR(anfq_sbb_serryvfg, ANFQ_ZNK_SERR_SBB,\n" ++" ANFQ_SBB_VAP, fvmrbs(anfq_sbb_g));\n" ++" vs (anfq_sbb_serryvfg == AHYY) {\n" ++" erghea(ANFQ_AB_ZRZ);\n" ++" }\n" ++"\n" ++" ANFQ_SERRYVFG_CEVZR_VAVG(anfq_sbb_serryvfg, ANFQ_SBB_VAVGVNY, arkg,\n" ++" (anfq_sbb_g *), vavg_sbb);\n" ++"\n" ++" erghea(ANFQ_FHPPRFF);\n" ++"}\n" ++"<c>\n" ++"anfq_fgnghf_g\n" ++"anfq_trg_sbb(\n" ++"&aofc;&aofc;anfq_sbb_g&aofc;&aofc;**sbb_c)\n" ++"{\n" ++" ANFQ_SERRYVFG_TRG_VAVG(anfq_sbb_serryvfg, *sbb_c,\n" ++" arkg, (anfq_sbb_g *), vavg_sbb);\n" ++" vs (*sbb_c == AHYY)\n" ++" erghea(ANFQ_AB_ZRZ);\n" ++" erghea(ANFQ_FHPPRFF);\n" ++"}\n" ++"<c>\n" ++"ibvq\n" ++"anfq_serr_sbb(\n" ++"&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*sbb)\n" ++"{\n" ++" ANFQ_SERRYVFG_SERR_PYRNA(anfq_sbb_serryvfg, sbb, arkg, pyrna_sbb);\n" ++"}\n" ++"<c>\n" ++"ibvq\n" ++"anfq_fuhgqbja_sbb_serryvfg()\n" ++"{\n" ++" ANFQ_SERRYVFG_QRFGEBL(anfq_sbb_serryvfg, arkg, (anfq_sbb_g *), pyrna_sbb);\n" ++"}\n" ++"</pbqr></cer></zrah>\n" ++"\n" ++"Abj rirel <pbqr>anfq_sbb_g</pbqr> erfhygvat sebz n pnyy gb <pbqr>anfq_trg_sbb()</pbqr>\n" ++"pbagnvaf inyvqyl-vavgvnyvmrq zhgrk naq pbaqvgvba inevnoyrf.\n" ++"\n" ++"<oe><c>\n" ++"<u3>Nqinaprq gbcvpf</u3>\n" ++"\n" ++"Fbzrgvzrf vgrz vavgvnyvmngvba naq pyrnahc shapgvbaf zvtug qrfver nqqvgvbany\n" ++"bhg-bs-onaq qngn. Sbe guvf ernfba, gur <pbqr>_VAVG</pbqr> naq <pbqr>_PYRNA</pbqr>\n" ++"znpebf nyfb unir <pbqr>_VAVG_NET</pbqr> naq <pbqr>_PYRNA_NET</pbqr> inevnagf.\n" ++"Gurfr inevnagf gnxr na nqqvgvbany nethzrag nsgre gur vavg be pyrna shapgvba\n" ++"juvpu vf cnffrq nf n frpbaq nethzrag gb gur vavg be pyrna shapgvbaf gurzfryirf.\n" ++"Orpnhfr gur serryvfg vagresnpr vf ragveryl znpebvmrq, gurfr nethzragf znl unir\n" ++"nal glcr.\n" ++"\n" ++"<c>\n" ++"Serryvfgf cebgrpg ntnvafg npprffrf ol zhygvcyr guernqf ol hfvat vagreany\n" ++"zhgrkrf. Gurfr zhgrkrf znl or npprffrq qverpgyl ol bcrengvbat ba\n" ++"<pbqr>ANFQ_SERRYVFG_ZHGRK_BS(<v>serryvfg_cbvagre</v>)</pbqr>. Gb ybpx\n" ++"guvf zhgrk, hfr <pbqr>ANFQ_SERRYVFG_QB_YBPX(<v>serryvfg_cbvagre</v>)</pbqr>.\n" ++"Gb haybpx vg, hfr <pbqr>ANFQ_SERRYVFG_QB_HAYBPX(<v>serryvfg_cbvagre</v>)</pbqr>.\n" ++"Gur urnqre svyr <pbqr>anfq_serryvfg.u</pbqr> cebivqrf inevnagf bs znal bs\n" ++"gur serryvfg vagresnprf juvpu qb abg gnxr be eryrnfr ybpxf gurzfryirf. Vs\n" ++"lbh hfr guvf, lbh ner erfcbafvoyr sbe pbeerpgyl flapuebavmvat npprff gb gur\n" ++"serryvfg. Guvf unf gur bccbeghavgl sbe cebivqvat terngre rssvpvrapl jura\n" ++"ongpuvat bcrengvbaf, be jura cresbezvat bcrengvbaf nyernql cebgrpgrq ol\n" ++"bgure ybpxf.\n" ++"\n" ++"<c>\n" ++"Vs <pbqr>ANFQ_SERRYVFG_FGNGF</pbqr> vf qrsvarq abamreb va <pbqr>anfq_bcgvbaf.u</pbqr>,\n" ++"jura rnpu serryvfg vf qrfgeblrq, fgngvfgvpf nobhg bcrengvbaf cresbezrq ba vg\n" ++"ner cevagrq, vapyhqvat gur ahzore bs gvzrf vgrzf jrer nyybpngrq naq serrq\n" ++"sebz gur yvfg, ubj znal gvzrf gur yvfg ena rzcgl naq ubj znal zber vgrzf unq gb or\n" ++"nyybpngrq, gur ynetrfg ahzore bs hahfrq vgrzf gung jnf rire va gur yvfg, naq\n" ++"gur ynetrfg ahzore bs vgrzf gung jnf rire nyybpngrq ng n gvzr, nzbat bguref.\n" ++; + +- <p> +- The compilation environment of the NASD tree itself uses +- <kbd>imake</kbd>. To generate Makefiles, run the <kbd>itomf</kbd> +- script at the top of the NASD tree. On some platforms, this may +- require platform-specific arguments. Additional arguments may be +- specified to instruct the system that it should also build +- portions of the tree which are not built by default. +- <p> +- After the Makefiles are generated, a <kbd>make depend</kbd> from +- the top of the tree will create all automatically-generated source +- files, and add dependencies to all of the Makefiles. + +- <p> +- Finally, <kbd>make</kbd> from the top of the tree will build all +- default components, and whatever non-default components were +- specified to <kbd>itomf</kbd> as well. + +- <p> +- At any time, <kbd>make Makefile</kbd> in a directory will +- regenerate the Makefile from its corresponding +- <code>Imakefile</code>. Note that this new <code>Makefile</code> +- will not include dependencies; another <kbd>make depend</kbd> is +- necessary for that. <kbd>make Makefiles</kbd> will regenerate +- Makefiles in all subdirectories of the current directory, but not +- in the directory itself. <kbd>make depend</kbd> will regenerate +- dependencies for all subdirectories as well as the current +- directory. + +- <p> +- The <kbd>make clean</kbd> production will remove any generated +- objects and executables, most editor backup files, and +- locally-generated source files in the current directory and all +- subdirectories. The <kbd>make sterile</kbd> production will remove +- all generated files (including Makefiles) in the current directory +- and all subdirectories, along with most editor backup files. +- +- <h2>Configuring the compilation environment for your system</h2> +- +- Names, locations, and arguments of system-local executables are +- specified in <code>config/NASD_site.def</code>. For instance, if +- your platform has located <kbd>sed</kbd> in a nonstandard +- location, the path to find it is specified by setting the +- <code>SED</code> variable in this file. All system-specific +- compilation options should be handled here, such as compiler +- flags, locations of executables, library paths, extra libraries to +- link against, et cetera. Modifications to this file will not take +- effect until the relevant Makefiles are regenerated (see above). +- +-<h3>Introduction</h3> +-<p> +-Many applications and subsystems within the NASD tree have a need to +-dynamically allocate and deallocate fixed-size structures. The preferred +-mechanism for doing so is the <i>freelist</i> mechanism. This set of +-interfaces provides support for maintaining pools of fixed-size chunks +-of memory, which may require explicit initialization and deinitialization +-to use. +- +-<p> +-If a programmer wishes to maintain caches of allocated +-but unused memory, the freelist mechanism should be used. There are +-several reasons for this. One is that using a consistent set of interfaces +-to do so helps others to read code they are unfamiliar with and identify +-what it does. Another is that the freelist mechanism is capable of collecting +-and reporting statistics on how each pool of memory was used, allowing +-better tuning of the system. A third is that by using a common, unified +-mechanism for managing allocated but currently unused chunks of memory, +-the NASD system is capable of reclaiming chunks of memory which are currently +-unused. This is especially useful in low-memory environments. +- +-<h3>Using freelists</h3> +-<p> +-To use freelists, be sure the <a href=memory.html>memory</a> +-module is properly initialized, and include <code>nasd/nasd_freelist.h</code>. +-Freelists have type <code>nasd_freelist_t</code>. +-The freelist interface is implemented as a set of macros for efficiency. +-To minimize overhead and debugging complexity, the freelist mechanism does +-not maintain additional data for individual allocations. Instead, it requires +-that users of the freelist interface provide for it typing and dereferencing +-information for the items in the freelist. This means that many of the +-freelist macros take as arguments the cast of the item type maintained in +-the list. The name of the structure or union element within this cast type +-is a pointer to the item type itself. For example, if one were +-maintaining a list of <code>nasd_foo_t</code>, that could mean that: +-<menu> +-Given<br> +-<code> +-typedef struct nasd_foo_s nasd_foo_t;<br> +-struct nasd_foo_s {<br> +- /* actual data for nasd_foo_t here */<br> +- nasd_foo_t *another_foo;<br> +-};<br> +-<p> +-</code></menu> +-The cast for items in the freelist is <code>(nasd_foo_t *)</code>. The +-pointer to the item type, henceforth referred to as the <i>next</i> +-pointer, is <code>another_foo</code>. To minimize overhead, the freelist +-mechanism allows users to set the next pointer arbitrarily whenever +-items are <b>not</b> in the freelist. This is handy for items which are +-maintained in lists when they are allocated - the list pointer can then +-be reused as the next pointer. +- +-<p> +-Sometimes, it is desirable to maintain freelists of items which do not +-naturally contain fields which are correctly-formed next pointers. +-If there is a void pointer in the item type, it is acceptable to use +-this in place of the next pointer. The preferred mechanism for dealing +-with this is to create a <code>union</code>. For instance, to +-maintain a freelist of arrays of eight kilobytes of memory:<br> +-<menu><code> +-typedef union nasd_foo_u nasd_foo_t;<br> +-union nasd_foo_u {<br> +- char data[8192];<br> +- nasd_foo_t *next;<br> +-};<br> +-</code></menu> +-In this example, <code>next</code> is a valid next pointer for the freelist +-mechanism, and the data field of <code>nasd_foo_t</code> is an eight kilobyte +-array. +- +-<h3>Basic freelists</h3> +-<p> +-The most basic kind of freelist is one which maintains chunks of data whose +-contents may be arbitrary, but require no special initialization or +-deinitialization. To use such a freelist, first declare a pointer to +-type <code>nasd_freelist_t</code>. Create the empty freelist by calling +-<code>NASD_FREELIST_CREATE()</code>. This takes four arguments. The +-first is the freelist pointer. The second is the maximum number of these +-items which should ever reside in the freelist at a particular time (extras will be +-returned to the system immediately). The third is how many additional +-items to allocate whenever the freelist is empty and an allocation is +-desired. The final argument is the size of the item. If the freelist +-pointer is <code>NULL</code> after evaluating <code>NASD_FREELIST_CREATE()</code>, +-the list itself could not be created. +- +-<p> +-It is often desirable at this point to make this newly-created freelist +-be non-empty, so that when the code begins executing, initial trips through +-not-yet-executed codepaths do not incur tremendous allocation costs. Do +-this by calling <code>NASD_FREELIST_PRIME()</code>, which takes four +-arguments. The first argument is the freelist pointer. The second is the +-number of items to create and add to the list. The third is the next +-pointer, and the fourth is the item cast. +- +-<p> +-To retrieve an item from the freelist, call <code>NASD_FREELIST_GET()</code>. +-This takes four arguments. The first is the freelist pointer. The second +-is a pointer to be assigned with the address of the object retrieved from +-the freelist. The third is the next pointer, and the fourth is the item +-cast. +- +-<p> +-To return an item to a freelist, call <code>NASD_FREELIST_FREE()</code>. +-This takes three arguments. The first is the freelist pointer. The +-second is the address of the item to return. The third is the next +-pointer. +- +-<p> +-When a freelist is no longer needed, it (along with its current contents) +-may be deallocated with <code>NASD_FREELIST_DESTROY()</code>. This +-macro takes three arguments. The first is the freelist pointer. The +-second is the next pointer. The third is the item cast. +- +-<p> +-<b>Example:</b> Let's say we have a type <code>nasd_foo_t</code>, for which we +-wish to maintain a freelist. We might have something like:<br> +-<menu><pre><code> +-typedef struct nasd_foo_s nasd_foo_t; +-struct nasd_foo_s { +- /* actual data for nasd_foo_t here */ +- nasd_foo_t *another_foo; +-}; +-<p> +-nasd_freelist_t *nasd_foo_freelist; +-#define NASD_MAX_FREE_FOO 1024 /* Maximum number of foos +- * to have in the freelist +- * at a time +- */ +-#define NASD_FOO_INC 64 /* How many foos to add to +- * the freelist at a time +- * when we run out +- */ +-#define NASD_FOO_INITIAL 32 /* How many foos to create +- * at start of day +- */ +-<p> +-nasd_status_t +-nasd_init_foo_freelist() +-{ +- NASD_FREELIST_CREATE(nasd_foo_freelist, NASD_MAX_FREE_FOO, +- NASD_FOO_INC, sizeof(nasd_foo_t)); +- if (nasd_foo_freelist == NULL) { +- return(NASD_NO_MEM); +- } +- +- NASD_FREELIST_PRIME(nasd_foo_freelist, NASD_FOO_INITIAL,next, +- (nasd_foo_t *)); +- +- return(NASD_SUCCESS); +-} +-<p> +-nasd_status_t +-nasd_get_foo( +- nasd_foo_t **foo_p) +-{ +- NASD_FREELIST_GET(nasd_foo_freelist,*foo_p,next,(nasd_foo_t *)); +- if (*foo_p == NULL) +- return(NASD_NO_MEM); +- return(NASD_SUCCESS); +-} +-<p> +-void +-nasd_free_foo( +- nasd_foo_t *foo) +-{ +- NASD_FREELIST_FREE(nasd_foo_freelist,foo,next); +-} +-<p> +-void +-nasd_shutdown_foo_freelist() +-{ +- NASD_FREELIST_DESTROY(nasd_foo_freelist,next,(nasd_foo_t *)); +-} +-</code></pre></menu> +- +-<br> +-<p> +-<h3>Freelists with initialized items</h3> +- +-Sometimes, it is desirable to have the items in a freelist maintain +-state across allocate and free operations. For instance, each item +-might contain a mutex. Rather than initialize and destroy a mutex +-each time an item is allocated from or freed to the freelist, it is +-more desirable to initialize a mutex each time an item is created for +-the freelist, and deinitialize it whenever the item is returned to +-the system. To that end, the freelist mechanism provides variants +-on the above interfaces: <code>NASD_FREELIST_PRIME_INIT()</code>, +-<code>NASD_FREELIST_GET_INIT()</code>, <code>NASD_FREELIST_FREE_CLEAN()</code>, +-and <code>NASD_FREELIST_DESTROY_CLEAN()</code>. +- +-<p> +-<code>NASD_FREELIST_PRIME_INIT()</code> and <code>NASD_FREELIST_GET_INIT()</code> +-are very similar to <code>NASD_FREELIST_PRIME()</code> and <code>NASD_FREELIST_GET()</code>, +-respectively. Each takes an additional argument, however, which is an +-initialization function. This function should take a pointer to +-the item type as its sole argument, and return <code>nasd_status_t</code>. +-If the initialization is successful, it should return <code>NASD_SUCCESS</code>. +-Otherwise, it should return a meaningful error code. Likewise, +-<code>NASD_FREELIST_FREE_CLEAN()</code>, and <code>NASD_FREELIST_DESTROY_CLEAN()</code> +-take an additional argument which is a function returning void that takes +-a pointer to the item type as its sole argument. This function is responsible +-for reversing the action of the init function. For example, if we added a mutex +-and a condition variable to <code>nasd_foo_t</code> in our earlier example, we would +-get: +-<menu><pre><code> +-typedef struct nasd_foo_s nasd_foo_t; +-struct nasd_foo_s { +- NASD_DECLARE_MUTEX(mutex) +- NASD_DECLARE_COND(cond) +- /* other data for nasd_foo_t here */ +- nasd_foo_t *another_foo; +-}; +-<p> +-nasd_freelist_t *nasd_foo_freelist; +-#define NASD_MAX_FREE_FOO 1024 /* Maximum number of foos +- * to have in the freelist +- * at a time +- */ +-#define NASD_FOO_INC 64 /* How many foos to add to +- * the freelist at a time +- * when we run out +- */ +-#define NASD_FOO_INITIAL 32 /* How many foos to create +- * at start of day +- */ +-<p> +-static nasd_status_t +-init_foo( +- nasd_foo_t *foo) +-{ +- nasd_status_t rc; +- +- rc = nasd_mutex_init(&foo->lock); +- if (rc) +- return(rc); +- rc = nasd_cond_init(&foo->cond); +- if (rc) { +- nasd_mutex_destroy(&foo->lock); +- return(rc); +- } +- return(NASD_SUCCESS); +-} +- +-static void +-clean_foo( +- nasd_foo_t *foo) +-{ +- nasd_status_t rc; +- +- rc = nasd_mutex_destroy(&foo->lock); +- if (rc) { +- printf(WARNING: got 0x%x (%s) destroying foo lockn, +- rc, nasd_error_string(rc)); +- } +- rc = nasd_cond_destroy(&foo->cond); +- if (rc) { +- printf(WARNING: got 0x%x (%s) destroying foo condn, +- rc, nasd_error_string(rc)); +- } +-} +- +-nasd_status_t +-nasd_init_foo_freelist() +-{ +- NASD_FREELIST_CREATE(nasd_foo_freelist, NASD_MAX_FREE_FOO, +- NASD_FOO_INC, sizeof(nasd_foo_t)); +- if (nasd_foo_freelist == NULL) { +- return(NASD_NO_MEM); +- } +- +- NASD_FREELIST_PRIME_INIT(nasd_foo_freelist, NASD_FOO_INITIAL, next, +- (nasd_foo_t *), init_foo); +- +- return(NASD_SUCCESS); +-} +-<p> +-nasd_status_t +-nasd_get_foo( +- nasd_foo_t **foo_p) +-{ +- NASD_FREELIST_GET_INIT(nasd_foo_freelist, *foo_p, +- next, (nasd_foo_t *), init_foo); +- if (*foo_p == NULL) +- return(NASD_NO_MEM); +- return(NASD_SUCCESS); +-} +-<p> +-void +-nasd_free_foo( +- nasd_foo_t *foo) +-{ +- NASD_FREELIST_FREE_CLEAN(nasd_foo_freelist, foo, next, clean_foo); +-} +-<p> +-void +-nasd_shutdown_foo_freelist() +-{ +- NASD_FREELIST_DESTROY(nasd_foo_freelist, next, (nasd_foo_t *), clean_foo); +-} +-</code></pre></menu> +- +-Now every <code>nasd_foo_t</code> resulting from a call to <code>nasd_get_foo()</code> +-contains validly-initialized mutex and condition variables. +- +-<br><p> +-<h3>Advanced topics</h3> +- +-Sometimes item initialization and cleanup functions might desire additional +-out-of-band data. For this reason, the <code>_INIT</code> and <code>_CLEAN</code> +-macros also have <code>_INIT_ARG</code> and <code>_CLEAN_ARG</code> variants. +-These variants take an additional argument after the init or clean function +-which is passed as a second argument to the init or clean functions themselves. +-Because the freelist interface is entirely macroized, these arguments may have +-any type. +- +-<p> +-Freelists protect against accesses by multiple threads by using internal +-mutexes. These mutexes may be accessed directly by operationg on +-<code>NASD_FREELIST_MUTEX_OF(<i>freelist_pointer</i>)</code>. To lock +-this mutex, use <code>NASD_FREELIST_DO_LOCK(<i>freelist_pointer</i>)</code>. +-To unlock it, use <code>NASD_FREELIST_DO_UNLOCK(<i>freelist_pointer</i>)</code>. +-The header file <code>nasd_freelist.h</code> provides variants of many of +-the freelist interfaces which do not take or release locks themselves. If +-you use this, you are responsible for correctly synchronizing access to the +-freelist. This has the opportunity for providing greater efficiency when +-batching operations, or when performing operations already protected by +-other locks. +- +-<p> +-If <code>NASD_FREELIST_STATS</code> is defined nonzero in <code>nasd_options.h</code>, +-when each freelist is destroyed, statistics about operations performed on it +-are printed, including the number of times items were allocated and freed +-from the list, how many times the list ran empty and how many more items had to be +-allocated, the largest number of unused items that was ever in the list, and +-the largest number of items that was ever allocated at a time, among others. +-"; +- +-char nasd_premote_ciphertext[] = "<u2>Gur pbzcvyngvba raivebazrag</u2> +- +- <c> +- Gur pbzcvyngvba raivebazrag bs gur ANFQ gerr vgfrys hfrf +- <xoq>vznxr</xoq>. Gb trarengr Znxrsvyrf, eha gur <xoq>vgbzs</xoq> +- fpevcg ng gur gbc bs gur ANFQ gerr. Ba fbzr cyngsbezf, guvf znl +- erdhver cyngsbez-fcrpvsvp nethzragf. Nqqvgvbany nethzragf znl or +- fcrpvsvrq gb vafgehpg gur flfgrz gung vg fubhyq nyfb ohvyq +- cbegvbaf bs gur gerr juvpu ner abg ohvyg ol qrsnhyg. +- <c> +- Nsgre gur Znxrsvyrf ner trarengrq, n <xoq>znxr qrcraq</xoq> sebz +- gur gbc bs gur gerr jvyy perngr nyy nhgbzngvpnyyl-trarengrq fbhepr +- svyrf, naq nqq qrcraqrapvrf gb nyy bs gur Znxrsvyrf. +- +- <c> +- Svanyyl, <xoq>znxr</xoq> sebz gur gbc bs gur gerr jvyy ohvyq nyy +- qrsnhyg pbzcbaragf, naq jungrire aba-qrsnhyg pbzcbaragf jrer +- fcrpvsvrq gb <xoq>vgbzs</xoq> nf jryy. +- +- <c> +- Ng nal gvzr, <xoq>znxr Znxrsvyr</xoq> va n qverpgbel jvyy +- ertrarengr gur Znxrsvyr sebz vgf pbeerfcbaqvat +- <pbqr>Vznxrsvyr</pbqr>. Abgr gung guvf arj <pbqr>Znxrsvyr</pbqr> +- jvyy abg vapyhqr qrcraqrapvrf; nabgure <xoq>znxr qrcraq</xoq> vf +- arprffnel sbe gung. <xoq>znxr Znxrsvyrf</xoq> jvyy ertrarengr +- Znxrsvyrf va nyy fhoqverpgbevrf bs gur pheerag qverpgbel, ohg abg +- va gur qverpgbel vgfrys. <xoq>znxr qrcraq</xoq> jvyy ertrarengr +- qrcraqrapvrf sbe nyy fhoqverpgbevrf nf jryy nf gur pheerag +- qverpgbel. +- +- <c> +- Gur <xoq>znxr pyrna</xoq> cebqhpgvba jvyy erzbir nal trarengrq +- bowrpgf naq rkrphgnoyrf, zbfg rqvgbe onpxhc svyrf, naq +- ybpnyyl-trarengrq fbhepr svyrf va gur pheerag qverpgbel naq nyy +- fhoqverpgbevrf. Gur <xoq>znxr fgrevyr</xoq> cebqhpgvba jvyy erzbir +- nyy trarengrq svyrf (vapyhqvat Znxrsvyrf) va gur pheerag qverpgbel +- naq nyy fhoqverpgbevrf, nybat jvgu zbfg rqvgbe onpxhc svyrf. +- +- <u2>Pbasvthevat gur pbzcvyngvba raivebazrag sbe lbhe flfgrz</u2> +- +- Anzrf, ybpngvbaf, naq nethzragf bs flfgrz-ybpny rkrphgnoyrf ner +- fcrpvsvrq va <pbqr>pbasvt/ANFQ_fvgr.qrs</pbqr>. Sbe vafgnapr, vs +- lbhe cyngsbez unf ybpngrq <xoq>frq</xoq> va n abafgnaqneq +- ybpngvba, gur cngu gb svaq vg vf fcrpvsvrq ol frggvat gur +- <pbqr>FRQ</pbqr> inevnoyr va guvf svyr. Nyy flfgrz-fcrpvsvp +- pbzcvyngvba bcgvbaf fubhyq or unaqyrq urer, fhpu nf pbzcvyre +- syntf, ybpngvbaf bs rkrphgnoyrf, yvoenel cnguf, rkgen yvoenevrf gb +- yvax ntnvafg, rg prgren. Zbqvsvpngvbaf gb guvf svyr jvyy abg gnxr +- rssrpg hagvy gur eryrinag Znxrsvyrf ner ertrarengrq (frr nobir). +- +-<u3>Vagebqhpgvba</u3> +-<c> +-Znal nccyvpngvbaf naq fhoflfgrzf jvguva gur ANFQ gerr unir n arrq gb +-qlanzvpnyyl nyybpngr naq qrnyybpngr svkrq-fvmr fgehpgherf. Gur cersreerq +-zrpunavfz sbe qbvat fb vf gur <v>serryvfg</v> zrpunavfz. Guvf frg bs +-vagresnprf cebivqrf fhccbeg sbe znvagnvavat cbbyf bs svkrq-fvmr puhaxf +-bs zrzbel, juvpu znl erdhver rkcyvpvg vavgvnyvmngvba naq qrvavgvnyvmngvba +-gb hfr. +- +-<c> +-Vs n cebtenzzre jvfurf gb znvagnva pnpurf bs nyybpngrq +-ohg hahfrq zrzbel, gur serryvfg zrpunavfz fubhyq or hfrq. Gurer ner +-frireny ernfbaf sbe guvf. Bar vf gung hfvat n pbafvfgrag frg bs vagresnprf +-gb qb fb urycf bguref gb ernq pbqr gurl ner hasnzvyvne jvgu naq vqragvsl +-jung vg qbrf. Nabgure vf gung gur serryvfg zrpunavfz vf pncnoyr bs pbyyrpgvat +-naq ercbegvat fgngvfgvpf ba ubj rnpu cbby bs zrzbel jnf hfrq, nyybjvat +-orggre ghavat bs gur flfgrz. N guveq vf gung ol hfvat n pbzzba, havsvrq +-zrpunavfz sbe znantvat nyybpngrq ohg pheeragyl hahfrq puhaxf bs zrzbel, +-gur ANFQ flfgrz vf pncnoyr bs erpynvzvat puhaxf bs zrzbel juvpu ner pheeragyl +-hahfrq. Guvf vf rfcrpvnyyl hfrshy va ybj-zrzbel raivebazragf. +- +-<u3>Hfvat serryvfgf</u3> +-<c> +-Gb hfr serryvfgf, or fher gur <n uers=zrzbel.ugzy>zrzbel</n> +-zbqhyr vf cebcreyl vavgvnyvmrq, naq vapyhqr <pbqr>anfq/anfq_serryvfg.u</pbqr>. +-Serryvfgf unir glcr <pbqr>anfq_serryvfg_g</pbqr>. +-Gur serryvfg vagresnpr vf vzcyrzragrq nf n frg bs znpebf sbe rssvpvrapl. +-Gb zvavzvmr bireurnq naq qrohttvat pbzcyrkvgl, gur serryvfg zrpunavfz qbrf +-abg znvagnva nqqvgvbany qngn sbe vaqvivqhny nyybpngvbaf. Vafgrnq, vg erdhverf +-gung hfref bs gur serryvfg vagresnpr cebivqr sbe vg glcvat naq qrersrerapvat +-vasbezngvba sbe gur vgrzf va gur serryvfg. Guvf zrnaf gung znal bs gur +-serryvfg znpebf gnxr nf nethzragf gur pnfg bs gur vgrz glcr znvagnvarq va +-gur yvfg. Gur anzr bs gur fgehpgher be havba ryrzrag jvguva guvf pnfg glcr +-vf n cbvagre gb gur vgrz glcr vgfrys. Sbe rknzcyr, vs bar jrer +-znvagnvavat n yvfg bs <pbqr>anfq_sbb_g</pbqr>, gung pbhyq zrna gung: +-<zrah> +-Tvira<oe> +-<pbqr> +-glcrqrs fgehpg anfq_sbb_f anfq_sbb_g;<oe> +-fgehpg anfq_sbb_f {<oe> +-&aofc;&aofc;/* npghny qngn sbe anfq_sbb_g urer */<oe> +-&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*nabgure_sbb;<oe> +-};<oe> +-<c> +-</pbqr></zrah> +-Gur pnfg sbe vgrzf va gur serryvfg vf <pbqr>(anfq_sbb_g *)</pbqr>. Gur +-cbvagre gb gur vgrz glcr, uraprsbegu ersreerq gb nf gur <v>arkg</v> +-cbvagre, vf <pbqr>nabgure_sbb</pbqr>. Gb zvavzvmr bireurnq, gur serryvfg +-zrpunavfz nyybjf hfref gb frg gur arkg cbvagre neovgenevyl jurarire +-vgrzf ner <o>abg</o> va gur serryvfg. Guvf vf unaql sbe vgrzf juvpu ner +-znvagnvarq va yvfgf jura gurl ner nyybpngrq - gur yvfg cbvagre pna gura +-or erhfrq nf gur arkg cbvagre. +- +-<c> +-Fbzrgvzrf, vg vf qrfvenoyr gb znvagnva serryvfgf bs vgrzf juvpu qb abg +-anghenyyl pbagnva svryqf juvpu ner pbeerpgyl-sbezrq arkg cbvagref. +-Vs gurer vf n ibvq cbvagre va gur vgrz glcr, vg vf npprcgnoyr gb hfr +-guvf va cynpr bs gur arkg cbvagre. Gur cersreerq zrpunavfz sbe qrnyvat +-jvgu guvf vf gb perngr n <pbqr>havba</pbqr>. Sbe vafgnapr, gb +-znvagnva n serryvfg bs neenlf bs rvtug xvybolgrf bs zrzbel:<oe> +-<zrah><pbqr> +-glcrqrs havba anfq_sbb_h anfq_sbb_g;<oe> +-havba anfq_sbb_h {<oe> +-&aofc;&aofc;pune&aofc;&aofc;&aofc;&aofc;&aofc;&aofc;&aofc;&aofc;&aofc;qngn[8192];<oe> +-&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*arkg;<oe> +-};<oe> +-</pbqr></zrah> +-Va guvf rknzcyr, <pbqr>arkg</pbqr> vf n inyvq arkg cbvagre sbe gur serryvfg +-zrpunavfz, naq gur qngn svryq bs <pbqr>anfq_sbb_g</pbqr> vf na rvtug xvybolgr +-neenl. +- +-<u3>Onfvp serryvfgf</u3> +-<c> +-Gur zbfg onfvp xvaq bs serryvfg vf bar juvpu znvagnvaf puhaxf bs qngn jubfr +-pbagragf znl or neovgenel, ohg erdhver ab fcrpvny vavgvnyvmngvba be +-qrvavgvnyvmngvba. Gb hfr fhpu n serryvfg, svefg qrpyner n cbvagre gb +-glcr <pbqr>anfq_serryvfg_g</pbqr>. Perngr gur rzcgl serryvfg ol pnyyvat +-<pbqr>ANFQ_SERRYVFG_PERNGR()</pbqr>. Guvf gnxrf sbhe nethzragf. Gur +-svefg vf gur serryvfg cbvagre. Gur frpbaq vf gur znkvzhz ahzore bs gurfr +-vgrzf juvpu fubhyq rire erfvqr va gur serryvfg ng n cnegvphyne gvzr (rkgenf jvyy or +-erghearq gb gur flfgrz vzzrqvngryl). Gur guveq vf ubj znal nqqvgvbany +-vgrzf gb nyybpngr jurarire gur serryvfg vf rzcgl naq na nyybpngvba vf +-qrfverq. Gur svany nethzrag vf gur fvmr bs gur vgrz. Vs gur serryvfg +-cbvagre vf <pbqr>AHYY</pbqr> nsgre rinyhngvat <pbqr>ANFQ_SERRYVFG_PERNGR()</pbqr>, +-gur yvfg vgfrys pbhyq abg or perngrq. +- +-<c> +-Vg vf bsgra qrfvenoyr ng guvf cbvag gb znxr guvf arjyl-perngrq serryvfg +-or aba-rzcgl, fb gung jura gur pbqr ortvaf rkrphgvat, vavgvny gevcf guebhtu +-abg-lrg-rkrphgrq pbqrcnguf qb abg vaphe gerzraqbhf nyybpngvba pbfgf. Qb +-guvf ol pnyyvat <pbqr>ANFQ_SERRYVFG_CEVZR()</pbqr>, juvpu gnxrf sbhe +-nethzragf. Gur svefg nethzrag vf gur serryvfg cbvagre. Gur frpbaq vf gur +-ahzore bs vgrzf gb perngr naq nqq gb gur yvfg. Gur guveq vf gur arkg +-cbvagre, naq gur sbhegu vf gur vgrz pnfg. +- +-<c> +-Gb ergevrir na vgrz sebz gur serryvfg, pnyy <pbqr>ANFQ_SERRYVFG_TRG()</pbqr>. +-Guvf gnxrf sbhe nethzragf. Gur svefg vf gur serryvfg cbvagre. Gur frpbaq +-vf n cbvagre gb or nffvtarq jvgu gur nqqerff bs gur bowrpg ergevrirq sebz +-gur serryvfg. Gur guveq vf gur arkg cbvagre, naq gur sbhegu vf gur vgrz +-pnfg. +- +-<c> +-Gb erghea na vgrz gb n serryvfg, pnyy <pbqr>ANFQ_SERRYVFG_SERR()</pbqr>. +-Guvf gnxrf guerr nethzragf. Gur svefg vf gur serryvfg cbvagre. Gur +-frpbaq vf gur nqqerff bs gur vgrz gb erghea. Gur guveq vf gur arkg +-cbvagre. +- +-<c> +-Jura n serryvfg vf ab ybatre arrqrq, vg (nybat jvgu vgf pheerag pbagragf) +-znl or qrnyybpngrq jvgu <pbqr>ANFQ_SERRYVFG_QRFGEBL()</pbqr>. Guvf +-znpeb gnxrf guerr nethzragf. Gur svefg vf gur serryvfg cbvagre. Gur +-frpbaq vf gur arkg cbvagre. Gur guveq vf gur vgrz pnfg. +- +-<c> +-<o>Rknzcyr:</o> Yrg'f fnl jr unir n glcr <pbqr>anfq_sbb_g</pbqr>, sbe juvpu jr +-jvfu gb znvagnva n serryvfg. Jr zvtug unir fbzrguvat yvxr:<oe> +-<zrah><cer><pbqr> +-glcrqrs fgehpg anfq_sbb_f anfq_sbb_g; +-fgehpg anfq_sbb_f { +-&aofc;&aofc;/* npghny qngn sbe anfq_sbb_g urer */ +-&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*nabgure_sbb; +-}; +-<c> +-anfq_serryvfg_g *anfq_sbb_serryvfg; +-#qrsvar ANFQ_ZNK_SERR_SBB 1024 /* Znkvzhz ahzore bs sbbf +- * gb unir va gur serryvfg +- * ng n gvzr +- */ +-#qrsvar ANFQ_SBB_VAP 64 /* Ubj znal sbbf gb nqq gb +- * gur serryvfg ng n gvzr +- * jura jr eha bhg +- */ +-#qrsvar ANFQ_SBB_VAVGVNY 32 /* Ubj znal sbbf gb perngr +- * ng fgneg bs qnl +- */ +-<c> +-anfq_fgnghf_g +-anfq_vavg_sbb_serryvfg() +-{ +- ANFQ_SERRYVFG_PERNGR(anfq_sbb_serryvfg, ANFQ_ZNK_SERR_SBB, +- ANFQ_SBB_VAP, fvmrbs(anfq_sbb_g)); +- vs (anfq_sbb_serryvfg == AHYY) { +- erghea(ANFQ_AB_ZRZ); +- } +- +- ANFQ_SERRYVFG_CEVZR(anfq_sbb_serryvfg, ANFQ_SBB_VAVGVNY,arkg, +- (anfq_sbb_g *)); +- +- erghea(ANFQ_FHPPRFF); +-} +-<c> +-anfq_fgnghf_g +-anfq_trg_sbb( +-&aofc;&aofc;anfq_sbb_g&aofc;&aofc;**sbb_c) +-{ +- ANFQ_SERRYVFG_TRG(anfq_sbb_serryvfg,*sbb_c,arkg,(anfq_sbb_g *)); +- vs (*sbb_c == AHYY) +- erghea(ANFQ_AB_ZRZ); +- erghea(ANFQ_FHPPRFF); +-} +-<c> +-ibvq +-anfq_serr_sbb( +-&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*sbb) +-{ +- ANFQ_SERRYVFG_SERR(anfq_sbb_serryvfg,sbb,arkg); +-} +-<c> +-ibvq +-anfq_fuhgqbja_sbb_serryvfg() +-{ +- ANFQ_SERRYVFG_QRFGEBL(anfq_sbb_serryvfg,arkg,(anfq_sbb_g *)); +-} +-</pbqr></cer></zrah> +- +-<oe> +-<c> +-<u3>Serryvfgf jvgu vavgvnyvmrq vgrzf</u3> +- +-Fbzrgvzrf, vg vf qrfvenoyr gb unir gur vgrzf va n serryvfg znvagnva +-fgngr npebff nyybpngr naq serr bcrengvbaf. Sbe vafgnapr, rnpu vgrz +-zvtug pbagnva n zhgrk. Engure guna vavgvnyvmr naq qrfgebl n zhgrk +-rnpu gvzr na vgrz vf nyybpngrq sebz be serrq gb gur serryvfg, vg vf +-zber qrfvenoyr gb vavgvnyvmr n zhgrk rnpu gvzr na vgrz vf perngrq sbe +-gur serryvfg, naq qrvavgvnyvmr vg jurarire gur vgrz vf erghearq gb +-gur flfgrz. Gb gung raq, gur serryvfg zrpunavfz cebivqrf inevnagf +-ba gur nobir vagresnprf: <pbqr>ANFQ_SERRYVFG_CEVZR_VAVG()</pbqr>, +-<pbqr>ANFQ_SERRYVFG_TRG_VAVG()</pbqr>, <pbqr>ANFQ_SERRYVFG_SERR_PYRNA()</pbqr>, +-naq <pbqr>ANFQ_SERRYVFG_QRFGEBL_PYRNA()</pbqr>. +- +-<c> +-<pbqr>ANFQ_SERRYVFG_CEVZR_VAVG()</pbqr> naq <pbqr>ANFQ_SERRYVFG_TRG_VAVG()</pbqr> +-ner irel fvzvyne gb <pbqr>ANFQ_SERRYVFG_CEVZR()</pbqr> naq <pbqr>ANFQ_SERRYVFG_TRG()</pbqr>, +-erfcrpgviryl. Rnpu gnxrf na nqqvgvbany nethzrag, ubjrire, juvpu vf na +-vavgvnyvmngvba shapgvba. Guvf shapgvba fubhyq gnxr n cbvagre gb +-gur vgrz glcr nf vgf fbyr nethzrag, naq erghea <pbqr>anfq_fgnghf_g</pbqr>. +-Vs gur vavgvnyvmngvba vf fhpprffshy, vg fubhyq erghea <pbqr>ANFQ_FHPPRFF</pbqr>. +-Bgurejvfr, vg fubhyq erghea n zrnavatshy reebe pbqr. Yvxrjvfr, +-<pbqr>ANFQ_SERRYVFG_SERR_PYRNA()</pbqr>, naq <pbqr>ANFQ_SERRYVFG_QRFGEBL_PYRNA()</pbqr> +-gnxr na nqqvgvbany nethzrag juvpu vf n shapgvba ergheavat ibvq gung gnxrf +-n cbvagre gb gur vgrz glcr nf vgf fbyr nethzrag. Guvf shapgvba vf erfcbafvoyr +-sbe erirefvat gur npgvba bs gur vavg shapgvba. Sbe rknzcyr, vs jr nqqrq n zhgrk +-naq n pbaqvgvba inevnoyr gb <pbqr>anfq_sbb_g</pbqr> va bhe rneyvre rknzcyr, jr jbhyq +-trg: +-<zrah><cer><pbqr> +-glcrqrs fgehpg anfq_sbb_f anfq_sbb_g; +-fgehpg anfq_sbb_f { +-&aofc;&aofc;ANFQ_QRPYNER_ZHGRK(zhgrk) +-&aofc;&aofc;ANFQ_QRPYNER_PBAQ(pbaq) +-&aofc;&aofc;/* bgure qngn sbe anfq_sbb_g urer */ +-&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*nabgure_sbb; +-}; +-<c> +-anfq_serryvfg_g *anfq_sbb_serryvfg; +-#qrsvar ANFQ_ZNK_SERR_SBB 1024 /* Znkvzhz ahzore bs sbbf +- * gb unir va gur serryvfg +- * ng n gvzr +- */ +-#qrsvar ANFQ_SBB_VAP 64 /* Ubj znal sbbf gb nqq gb +- * gur serryvfg ng n gvzr +- * jura jr eha bhg +- */ +-#qrsvar ANFQ_SBB_VAVGVNY 32 /* Ubj znal sbbf gb perngr +- * ng fgneg bs qnl +- */ +-<c> +-fgngvp anfq_fgnghf_g +-vavg_sbb( +- anfq_sbb_g *sbb) +-{ +- anfq_fgnghf_g ep; +- +- ep = anfq_zhgrk_vavg(&sbb->ybpx); +- vs (ep) +- erghea(ep); +- ep = anfq_pbaq_vavg(&sbb->pbaq); +- vs (ep) { +- anfq_zhgrk_qrfgebl(&sbb->ybpx); +- erghea(ep); +- } +- erghea(ANFQ_FHPPRFF); +-} +- +-fgngvp ibvq +-pyrna_sbb( +- anfq_sbb_g *sbb) +-{ +- anfq_fgnghf_g ep; +- +- ep = anfq_zhgrk_qrfgebl(&sbb->ybpx); +- vs (ep) { +- cevags(JNEAVAT: tbg 0k%k (%f) qrfgeblvat sbb ybpxa, +- ep, anfq_reebe_fgevat(ep)); +- } +- ep = anfq_pbaq_qrfgebl(&sbb->pbaq); +- vs (ep) { +- cevags(JNEAVAT: tbg 0k%k (%f) qrfgeblvat sbb pbaqa, +- ep, anfq_reebe_fgevat(ep)); +- } +-} +- +-anfq_fgnghf_g +-anfq_vavg_sbb_serryvfg() +-{ +- ANFQ_SERRYVFG_PERNGR(anfq_sbb_serryvfg, ANFQ_ZNK_SERR_SBB, +- ANFQ_SBB_VAP, fvmrbs(anfq_sbb_g)); +- vs (anfq_sbb_serryvfg == AHYY) { +- erghea(ANFQ_AB_ZRZ); +- } +- +- ANFQ_SERRYVFG_CEVZR_VAVG(anfq_sbb_serryvfg, ANFQ_SBB_VAVGVNY, arkg, +- (anfq_sbb_g *), vavg_sbb); +- +- erghea(ANFQ_FHPPRFF); +-} +-<c> +-anfq_fgnghf_g +-anfq_trg_sbb( +-&aofc;&aofc;anfq_sbb_g&aofc;&aofc;**sbb_c) +-{ +- ANFQ_SERRYVFG_TRG_VAVG(anfq_sbb_serryvfg, *sbb_c, +- arkg, (anfq_sbb_g *), vavg_sbb); +- vs (*sbb_c == AHYY) +- erghea(ANFQ_AB_ZRZ); +- erghea(ANFQ_FHPPRFF); +-} +-<c> +-ibvq +-anfq_serr_sbb( +-&aofc;&aofc;anfq_sbb_g&aofc;&aofc;*sbb) +-{ +- ANFQ_SERRYVFG_SERR_PYRNA(anfq_sbb_serryvfg, sbb, arkg, pyrna_sbb); +-} +-<c> +-ibvq +-anfq_fuhgqbja_sbb_serryvfg() +-{ +- ANFQ_SERRYVFG_QRFGEBL(anfq_sbb_serryvfg, arkg, (anfq_sbb_g *), pyrna_sbb); +-} +-</pbqr></cer></zrah> +- +-Abj rirel <pbqr>anfq_sbb_g</pbqr> erfhygvat sebz n pnyy gb <pbqr>anfq_trg_sbb()</pbqr> +-pbagnvaf inyvqyl-vavgvnyvmrq zhgrk naq pbaqvgvba inevnoyrf. +- +-<oe><c> +-<u3>Nqinaprq gbcvpf</u3> +- +-Fbzrgvzrf vgrz vavgvnyvmngvba naq pyrnahc shapgvbaf zvtug qrfver nqqvgvbany +-bhg-bs-onaq qngn. Sbe guvf ernfba, gur <pbqr>_VAVG</pbqr> naq <pbqr>_PYRNA</pbqr> +-znpebf nyfb unir <pbqr>_VAVG_NET</pbqr> naq <pbqr>_PYRNA_NET</pbqr> inevnagf. +-Gurfr inevnagf gnxr na nqqvgvbany nethzrag nsgre gur vavg be pyrna shapgvba +-juvpu vf cnffrq nf n frpbaq nethzrag gb gur vavg be pyrna shapgvbaf gurzfryirf. +-Orpnhfr gur serryvfg vagresnpr vf ragveryl znpebvmrq, gurfr nethzragf znl unir +-nal glcr. +- +-<c> +-Serryvfgf cebgrpg ntnvafg npprffrf ol zhygvcyr guernqf ol hfvat vagreany +-zhgrkrf. Gurfr zhgrkrf znl or npprffrq qverpgyl ol bcrengvbat ba +-<pbqr>ANFQ_SERRYVFG_ZHGRK_BS(<v>serryvfg_cbvagre</v>)</pbqr>. Gb ybpx +-guvf zhgrk, hfr <pbqr>ANFQ_SERRYVFG_QB_YBPX(<v>serryvfg_cbvagre</v>)</pbqr>. +-Gb haybpx vg, hfr <pbqr>ANFQ_SERRYVFG_QB_HAYBPX(<v>serryvfg_cbvagre</v>)</pbqr>. +-Gur urnqre svyr <pbqr>anfq_serryvfg.u</pbqr> cebivqrf inevnagf bs znal bs +-gur serryvfg vagresnprf juvpu qb abg gnxr be eryrnfr ybpxf gurzfryirf. Vs +-lbh hfr guvf, lbh ner erfcbafvoyr sbe pbeerpgyl flapuebavmvat npprff gb gur +-serryvfg. Guvf unf gur bccbeghavgl sbe cebivqvat terngre rssvpvrapl jura +-ongpuvat bcrengvbaf, be jura cresbezvat bcrengvbaf nyernql cebgrpgrq ol +-bgure ybpxf. +- +-<c> +-Vs <pbqr>ANFQ_SERRYVFG_FGNGF</pbqr> vf qrsvarq abamreb va <pbqr>anfq_bcgvbaf.u</pbqr>, +-jura rnpu serryvfg vf qrfgeblrq, fgngvfgvpf nobhg bcrengvbaf cresbezrq ba vg +-ner cevagrq, vapyhqvat gur ahzore bs gvzrf vgrzf jrer nyybpngrq naq serrq +-sebz gur yvfg, ubj znal gvzrf gur yvfg ena rzcgl naq ubj znal zber vgrzf unq gb or +-nyybpngrq, gur ynetrfg ahzore bs hahfrq vgrzf gung jnf rire va gur yvfg, naq +-gur ynetrfg ahzore bs vgrzf gung jnf rire nyybpngrq ng n gvzr, nzbat bguref. +-"; +- +- +- +- |