Changes for OpenBSD 3.8 and 3.9.
Based on ports by ober@linbsd.org and todd@fries.net.
Untested.
vm=${v#*.}
AFS_SYSNAME="i386_obsd${vM}${vm}"
;;
+ sparc64-*-openbsd?.?)
+ v=${host#*openbsd}
+ vM=${v%.*}
+ vm=${v#*.}
+ AFS_SYSNAME="sparc64_obsd${vM}${vm}"
+ ;;
i?86-*-freebsd?.*)
v=${host#*freebsd}
vM=${v%.*}
fi
PTHREAD_LIBS=error
-AC_CHECK_LIB(pthread, pthread_attr_init,
- PTHREAD_LIBS="-lpthread")
+if test "x$MKAFS_OSTYPE" = OBSD; then
+ PTHREAD_LIBS="-pthread"
+fi
+if test "x$PTHREAD_LIBS" = xerror; then
+ AC_CHECK_LIB(pthread, pthread_attr_init,
+ PTHREAD_LIBS="-lpthread")
+fi
if test "x$PTHREAD_LIBS" = xerror; then
AC_CHECK_LIB(pthreads, pthread_attr_init,
PTHREAD_LIBS="-lpthreads")
}
VOP_UNLOCK(vp, 0, curproc);
afile->vnode = vp;
+#ifdef AFS_OBSD39_ENV
+ afile->size = VTOI(vp)->i_ffs1_size;
+#else
afile->size = VTOI(vp)->i_ffs_size;
+#endif
afile->offset = 0;
afile->proc = NULL;
afile->inum = ainode; /* for hint validity checking */
#define gop_lookupname(fnamep, segflg, followlink, compvpp) \
afs_nbsd_lookupname((fnamep), (segflg), (followlink), (compvpp))
+#ifdef AFS_OBSD39_ENV
+#define afs_osi_lockmgr(l, f, i, p) lockmgr((l), (f), (i))
+#else
+#define afs_osi_lockmgr(l, f, i, p) lockmgr((l), (f), (i), (p))
+#endif
+
#ifdef KERNEL
#ifdef AFS_GLOBAL_SUNLOCK
#define AFS_GLOCK() \
do { \
osi_Assert(curproc); \
- lockmgr(&afs_global_lock, LK_EXCLUSIVE, 0, curproc); \
+ afs_osi_lockmgr(&afs_global_lock, LK_EXCLUSIVE, 0, curproc); \
osi_Assert(afs_global_owner == NULL); \
afs_global_owner = curproc; \
} while (0)
osi_Assert(curproc); \
osi_Assert(afs_global_owner == curproc); \
afs_global_owner = NULL; \
- lockmgr(&afs_global_lock, LK_RELEASE, 0, curproc); \
+ afs_osi_lockmgr(&afs_global_lock, LK_RELEASE, 0, curproc); \
} while(0)
#define ISAFS_GLOCK() (afs_global_owner == curproc && curproc)
#else
if (!vc)
panic("afs_nbsd_lock: null vcache");
- return lockmgr(&vc->rwlock, ap->a_flags | LK_CANRECURSE, &vp->v_interlock,
+ return afs_osi_lockmgr(&vc->rwlock, ap->a_flags | LK_CANRECURSE, &vp->v_interlock,
ap->a_p);
}
if (!vc)
panic("afs_nbsd_unlock: null vcache");
- return lockmgr(&vc->rwlock, ap->a_flags | LK_RELEASE, &vp->v_interlock,
+ return afs_osi_lockmgr(&vc->rwlock, ap->a_flags | LK_RELEASE, &vp->v_interlock,
ap->a_p);
}
#define SYS_NAME_ID_i386_obsd36 2605
#define SYS_NAME_ID_i386_obsd37 2606
#define SYS_NAME_ID_i386_obsd38 2607
+#define SYS_NAME_ID_i386_obsd39 2608
#define SYS_NAME_ID_amd64_linux2 2700
#define SYS_NAME_ID_amd64_linux22 2701
--- /dev/null
+/*
+ * Jim Rees, University of Michigan CITI
+ */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+#ifndef IGNORE_STDS_H
+#include <sys/param.h>
+#endif
+
+#define SYS_NAME "i386_obsd39"
+#define SYS_NAME_ID SYS_NAME_ID_i386_obsd39
+
+#define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */
+#define AFS_X86_XBSD_ENV 1
+
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#define AFS_64BIT_ENV 1
+#define AFS_64BIT_CLIENT 1
+#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
+#define AFS_OBSD_ENV 1
+#define AFS_OBSD34_ENV 1
+#define AFS_OBSD35_ENV 1
+#define AFS_OBSD36_ENV 1
+#define AFS_OBSD37_ENV 1
+#define AFS_OBSD38_ENV 1
+#define AFS_OBSD39_ENV 1
+#define AFS_NONFSTRANS 1
+#define AFS_VM_RDWR_ENV 1
+#define AFS_VFS_ENV 1
+#define AFS_VFSINCL_ENV 1
+
+#define FTRUNC O_TRUNC
+
+#define AFS_SYSCALL 208
+#define AFS_MOUNT_AFS "afs"
+
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
+
+#define AFSLITTLE_ENDIAN 1
+
+#ifndef IGNORE_STDS_H
+#include <afs/afs_sysnames.h>
+#endif
+
+/* Extra kernel definitions (from kdefs file) */
+#ifdef _KERNEL
+#ifdef MULTIPROCESSOR
+#define AFS_GLOBAL_SUNLOCK 1
+#endif
+#define AFS_SHORTGID 0 /* are group id's short? */
+
+#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+enum vcexcl { NONEXCL, EXCL };
+
+#ifndef MIN
+#define MIN(A,B) ((A) < (B) ? (A) : (B))
+#endif
+#ifndef MAX
+#define MAX(A,B) ((A) > (B) ? (A) : (B))
+#endif
+
+#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+#endif /* _KERNEL */
+
+#endif /* AFS_PARAM_H */
} \
rxkad_stats->stats_elem--; \
END
+#ifndef AFS_OBSD38_ENV
#define ADD_RXKAD_STATS(stats_elem, inc_value) \
BEGIN \
rxkad_stats_t * rxkad_stats; \
} \
rxkad_stats->stats_elem -= dec_value; \
END
+#else /* AFS_OBSD38_ENV */
+/* segfaults but we don't know why */
+#define ADD_RXKAD_STATS(stats_elem, inc_value)
+#define SUB_RXKAD_STATS(stats_elem, dec_value)
+#endif /* AFS_OBSD38_ENV */
#else /* AFS_PTHREAD_ENV */
#define INC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem++
#define DEC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem--