pkgsrc-wip/arla-3.99.14/patches/patch-aa
Ola Eriksson bcbd6defb0 Please see pkgsrc/net/arla for more details on the Arla-project.
Since NetBSD 3.99.14 when the ktrace-lwp branch was merged with HEAD, the
lkm-part of Arla broke and would not compile.

This is an attempt to adapt the Arla package to work with NetBSD 3.99.14
and beyond. If everything works out with this package, I will send-pr fixes
to have these patches included in pkgsrc/net/arla within a near future!

Please report any errors or problems to ola<-at->mreriksson.net!
2006-01-13 15:51:47 +00:00

53 lines
2 KiB
Text

$NetBSD: patch-aa,v 1.1.1.1 2006/01/13 15:51:47 mreriksson Exp $
--- nnpfs/bsd/nnpfs/nnpfs_locl.h.orig 2006-01-11 23:00:32.000000000 +0100
+++ nnpfs/bsd/nnpfs/nnpfs_locl.h
@@ -215,14 +215,21 @@ typedef struct thread d_thread_t;
typedef d_thread_t syscall_d_thread_t;
#define syscall_thread_to_thread(x) (x)
#else /* !__FreeBSD_version || __DragonFly__ */
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 106130000
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 399001400 /* NetBSD 3.99.14 */
+typedef struct lwp syscall_d_thread_t;
+#define syscall_thread_to_thread(x) ((x))
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 106130000
typedef struct lwp syscall_d_thread_t;
#define syscall_thread_to_thread(x) ((x)->l_proc)
#else
typedef struct proc syscall_d_thread_t;
#define syscall_thread_to_thread(x) (x)
#endif
+#if __NetBSD_Version__ >= 399001400 /* NetBSD 3.99.14 */
+typedef struct lwp d_thread_t;
+#else /* __NetBSD_Version__ >= 399001400 */
typedef struct proc d_thread_t;
+#endif /* __NetBSD_Version__ >= 399001400 */
#endif /* !__FreeBSD_version || __DragonFly__ */
#ifdef VV_ROOT
@@ -254,6 +261,11 @@ struct genfs_ops nnpfs_genfsops;
#define nnpfs_cnp_to_proc(cnp) ((cnp)->cn_proc)
#define nnpfs_proc_to_cred(p) proc_ucred(p)
#define nnpfs_proc_to_euid(p) XXX
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400 /* 3.99.14 */
+#define nnpfs_uio_to_proc(uiop) ((uiop)->uio_lwp)
+#define nnpfs_cnp_to_proc(cnp) ((cnp)->cn_lwp)
+#define nnpfs_proc_to_cred(p) ((p)->l_proc->p_ucred)
+#define nnpfs_proc_to_euid(p) ((p)->l_proc->p_ucred->cr_uid)
#else
#define nnpfs_uio_to_proc(uiop) ((uiop)->uio_procp)
#define nnpfs_cnp_to_proc(cnp) ((cnp)->cn_proc)
@@ -300,9 +312,13 @@ typedef int nnpfs_malloc_type;
#if defined(HAVE_FREEBSD_THREAD)
#define nnpfs_curproc() (curthread)
#else
+#if __NetBSD_Version__ >= 399001400 /* 3.99.14 */
+#define nnpfs_curproc() (curlwp)
+#else
#define nnpfs_curproc() (curproc)
#endif
#endif
+#endif
void nnpfs_pushdirty(struct vnode *vp);