Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet Add NetBSD build glue to build new zfs v...
details: https://anonhg.NetBSD.org/src/rev/f1eee3c6c393
branches: trunk
changeset: 752517:f1eee3c6c393
user: haad <haad%NetBSD.org@localhost>
date: Sun Feb 28 14:45:47 2010 +0000
description:
Add NetBSD build glue to build new zfs version 22 sources.
diffstat:
external/cddl/osnet/include/unistd.h | 4 +-
external/cddl/osnet/sbin/zfs/Makefile | 7 +-
external/cddl/osnet/sbin/zpool/Makefile | 12 ++-
external/cddl/osnet/sys/kern/ddi.c | 15 ++++
external/cddl/osnet/sys/kern/misc.c | 24 ++++++-
external/cddl/osnet/sys/kern/taskq.c | 4 +-
external/cddl/osnet/sys/machine/endian.h | 2 -
external/cddl/osnet/sys/sys/acl/acl_common.h | 2 -
external/cddl/osnet/sys/sys/byteorder.h | 25 ++++++-
external/cddl/osnet/sys/sys/cpuvar.h | 92 +++++++-------------------
external/cddl/osnet/sys/sys/elf.h | 37 ++++++---
external/cddl/osnet/sys/sys/idmap.h | 2 -
external/cddl/osnet/sys/sys/modctl.h | 7 +-
external/cddl/osnet/sys/sys/mount.h | 4 +-
external/cddl/osnet/sys/sys/policy.h | 6 +-
external/cddl/osnet/sys/sys/proc.h | 10 ++-
external/cddl/osnet/sys/sys/types.h | 3 +-
external/cddl/osnet/sys/sys/uio.h | 60 +++++++++++++++++-
external/cddl/osnet/sys/sys/vfs.h | 4 +-
external/cddl/osnet/sys/sys/vnode.h | 24 ++++++-
external/cddl/osnet/sys/sys/zfs_context.h | 97 +++++++++++++++++++++++----
21 files changed, 310 insertions(+), 131 deletions(-)
diffs (truncated from 924 to 300 lines):
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/include/unistd.h
--- a/external/cddl/osnet/include/unistd.h Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/include/unistd.h Sun Feb 28 14:45:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: unistd.h,v 1.3 2010/02/21 01:46:34 darran Exp $ */
+/* $NetBSD: unistd.h,v 1.4 2010/02/28 14:45:47 haad Exp $ */
/*
* Copyright (C) 2007 John Birrell <jb%freebsd.org@localhost>
@@ -38,4 +38,6 @@
#define ftruncate64 ftruncate
#define pread64 pread
+#define _SC_PHYS_PAGES 500
+
#endif
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sbin/zfs/Makefile
--- a/external/cddl/osnet/sbin/zfs/Makefile Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sbin/zfs/Makefile Sun Feb 28 14:45:47 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2009/10/21 22:31:19 joerg Exp $
+# $NetBSD: Makefile,v 1.3 2010/02/28 14:45:47 haad Exp $
.include "../../Makefile.zfs"
@@ -18,7 +18,10 @@
LIBZFS_OBJDIR!= cd ${LIBZFS_SRCDIR} && ${PRINTOBJDIR}
LDADD+= -L${LIBZFS_OBJDIR} -lzfs
-LDADD+= -lm -lutil
+LIBUMEM_OBJDIR!= cd ${LIBUMEM_SRCDIR} && ${PRINTOBJDIR}
+LDADD+= -L${LIBUMEM_OBJDIR} -lumem
+
+LDADD+= -lm -lutil -lpthread
.PATH: ${ZFSDIR}/dist/cmd/zfs
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sbin/zpool/Makefile
--- a/external/cddl/osnet/sbin/zpool/Makefile Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sbin/zpool/Makefile Sun Feb 28 14:45:47 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2009/10/21 22:32:20 joerg Exp $
+# $NetBSD: Makefile,v 1.3 2010/02/28 14:45:47 haad Exp $
.include "../../Makefile.zfs"
@@ -7,7 +7,7 @@
USETBL= yes
SRCS= zpool_main.c zpool_iter.c zpool_util.c zpool_vdev.c
-DPADD= ${LIBAVL} ${LIBZFS} ${LIBM} ${LIBNVPAIR} ${LIBUUTIL} ${LIBUTIL}
+DPADD= ${LIBAVL} ${LIBZFS} ${LIBM} ${LIBNVPAIR} ${LIBUUTIL} ${LIBUTIL} ${LIBUMEM}
LIBAVL_OBJDIR!= cd ${LIBAVL_SRCDIR} && ${PRINTOBJDIR}
LDADD+= -L${LIBAVL_OBJDIR} -lavl
@@ -21,7 +21,13 @@
LIBZFS_OBJDIR!= cd ${LIBZFS_SRCDIR} && ${PRINTOBJDIR}
LDADD+= -L${LIBZFS_OBJDIR} -lzfs
-LDADD+= -lm -lutil
+LIBUMEM_OBJDIR!= cd ${LIBUMEM_SRCDIR} && ${PRINTOBJDIR}
+LDADD+= -L${LIBUMEM_OBJDIR} -lumem
+
+LIBZPOOL_OBJDIR!= cd ${LIBZPOOL_SRCDIR} && ${PRINTOBJDIR}
+LDADD+= -L${LIBZPOOL_OBJDIR} -lzpool
+
+LDADD+= -lm -lutil -lpthread
.PATH: ${ZFSDIR}/dist/cmd/zpool
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sys/kern/ddi.c
--- a/external/cddl/osnet/sys/kern/ddi.c Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sys/kern/ddi.c Sun Feb 28 14:45:47 2010 +0000
@@ -34,6 +34,7 @@
#include <sys/ddi.h>
#include <sys/errno.h>
#include <sys/param.h>
+#include <sys/kernel.h>
#include <sys/kmem.h>
#include <sys/cmn_err.h>
#include <sys/namei.h>
@@ -566,3 +567,17 @@
(void)do_sys_unlink(pn, UIO_SYSSPACE);
PNBUF_PUT(pn);
}
+
+clock_t
+ddi_get_lbolt()
+{
+
+ return hardclock_ticks;
+}
+
+int64_t
+ddi_get_lbolt64()
+{
+
+ return hardclock_ticks;
+}
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sys/kern/misc.c
--- a/external/cddl/osnet/sys/kern/misc.c Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sys/kern/misc.c Sun Feb 28 14:45:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.1 2009/08/07 20:57:57 haad Exp $ */
+/* $NetBSD: misc.c,v 1.2 2010/02/28 14:45:47 haad Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -107,6 +107,28 @@
}
void
+thread_join(uint64_t kid)
+{
+
+ return;
+}
+
+int
+newproc(void (*pc)(), caddr_t arg, id_t cid, int pri, struct contract **ct,
+ pid_t pid)
+{
+ int error;
+
+ ASSERT(cid == PRI_NONE);
+
+ error = kthread_create(pri, KTHREAD_MPSAFE, NULL,
+ pc, arg, NULL, "zfs_proc");
+ KASSERT(error == 0);
+
+ return 0;
+}
+
+void
kmem_reap(void)
{
int bufcnt;
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sys/kern/taskq.c
--- a/external/cddl/osnet/sys/kern/taskq.c Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sys/kern/taskq.c Sun Feb 28 14:45:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: taskq.c,v 1.1 2009/08/07 20:57:57 haad Exp $ */
+/* $NetBSD: taskq.c,v 1.2 2010/02/28 14:45:47 haad Exp $ */
/*
* CDDL HEADER START
@@ -399,6 +399,8 @@
#define SYSTEM_TASKQ_SIZE 1
int system_taskq_size = SYSTEM_TASKQ_SIZE;
+#define TASKQ_ACTIVE 0x00010000
+
/*
* Dynamic task queue threads that don't get any work within
* taskq_thread_timeout destroy themselves
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sys/machine/endian.h
--- a/external/cddl/osnet/sys/machine/endian.h Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sys/machine/endian.h Sun Feb 28 14:45:47 2010 +0000
@@ -1,5 +1,3 @@
-/* $NetBSD: endian.h,v 1.2 2010/02/21 01:46:35 darran Exp $ */
-
/*-
* Copyright (c) 2007 Pawel Jakub Dawidek <pjd%FreeBSD.org@localhost>
* All rights reserved.
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sys/sys/acl/acl_common.h
--- a/external/cddl/osnet/sys/sys/acl/acl_common.h Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sys/sys/acl/acl_common.h Sun Feb 28 14:45:47 2010 +0000
@@ -1,5 +1,3 @@
-/* $NetBSD: acl_common.h,v 1.2 2010/02/21 01:46:36 darran Exp $ */
-
/*
* CDDL HEADER START
*
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sys/sys/byteorder.h
--- a/external/cddl/osnet/sys/sys/byteorder.h Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sys/sys/byteorder.h Sun Feb 28 14:45:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: byteorder.h,v 1.3 2010/02/21 01:46:35 darran Exp $ */
+/* $NetBSD: byteorder.h,v 1.4 2010/02/28 14:45:47 haad Exp $ */
/*
* CDDL HEADER START
@@ -64,4 +64,27 @@
#define LE_64(x) BMASK_64(x)
#endif
+/*
+ * Macros to convert from a specific byte order to/from native byte order
+ */
+#ifdef _BIG_ENDIAN
+#define BE_8(x) BMASK_8(x)
+#define BE_16(x) BMASK_16(x)
+#define BE_32(x) BMASK_32(x)
+#define BE_64(x) BMASK_64(x)
+#define LE_8(x) BSWAP_8(x)
+#define LE_16(x) BSWAP_16(x)
+#define LE_32(x) BSWAP_32(x)
+#define LE_64(x) BSWAP_64(x)
+#else
+#define LE_8(x) BMASK_8(x)
+#define LE_16(x) BMASK_16(x)
+#define LE_32(x) BMASK_32(x)
+#define LE_64(x) BMASK_64(x)
+#define BE_8(x) BSWAP_8(x)
+#define BE_16(x) BSWAP_16(x)
+#define BE_32(x) BSWAP_32(x)
+#define BE_64(x) BSWAP_64(x)
+#endif
+
#endif /* _OPENSOLARIS_SYS_BYTEORDER_H_ */
diff -r 071d528a5d0f -r f1eee3c6c393 external/cddl/osnet/sys/sys/cpuvar.h
--- a/external/cddl/osnet/sys/sys/cpuvar.h Sun Feb 28 13:59:05 2010 +0000
+++ b/external/cddl/osnet/sys/sys/cpuvar.h Sun Feb 28 14:45:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuvar.h,v 1.3 2010/02/21 01:46:35 darran Exp $ */
+/* $NetBSD: cpuvar.h,v 1.4 2010/02/28 14:45:47 haad Exp $ */
/*
* CDDL HEADER START
@@ -19,8 +19,6 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- * $FreeBSD: src/sys/cddl/compat/opensolaris/sys/cpuvar.h,v 1.5.2.1 2009/08/03 08:13:06 kensmith Exp $
*/
/*
@@ -32,30 +30,8 @@
#define _COMPAT_OPENSOLARIS_SYS_CPUVAR_H
#include <sys/mutex.h>
-#include <sys/cpuvar_defs.h>
#ifdef _KERNEL
-
-struct cyc_cpu;
-
-typedef struct {
- int cpuid;
- struct cyc_cpu *cpu_cyclic;
- uint32_t cpu_flags;
- uint_t cpu_intr_actv;
- uintptr_t cpu_profile_pc;
- uintptr_t cpu_profile_upc;
- uintptr_t cpu_dtrace_caller; /* DTrace: caller, if any */
- hrtime_t cpu_dtrace_chillmark; /* DTrace: chill mark time */
- hrtime_t cpu_dtrace_chilled; /* DTrace: total chill time */
-} solaris_cpu_t;
-
-/* Some code may choose to redefine this if pcpu_t would be more useful. */
-#define cpu_t solaris_cpu_t
-#define cpu_id cpuid
-
-extern solaris_cpu_t solaris_cpu[];
-
#define CPU_CACHE_COHERENCE_SIZE 64
/*
@@ -67,8 +43,7 @@
*/
#define CPUC_SIZE (sizeof (uint16_t) + sizeof (uintptr_t) + \
sizeof (kmutex_t))
-#define CPUC_SIZE1 roundup(CPUC_SIZE, CPU_CACHE_COHERENCE_SIZE)
-#define CPUC_PADSIZE CPUC_SIZE1 - CPUC_SIZE
+#define CPUC_PADSIZE CPU_CACHE_COHERENCE_SIZE - CPUC_SIZE
typedef struct cpu_core {
uint16_t cpuc_dtrace_flags; /* DTrace flags */
@@ -78,50 +53,33 @@
} cpu_core_t;
extern cpu_core_t cpu_core[];
-
-extern kmutex_t cpu_lock;
#endif /* _KERNEL */
/*
- * Flags in the CPU structure.
- *
- * These are protected by cpu_lock (except during creation).
- *
- * Offlined-CPUs have three stages of being offline:
- *
- * CPU_ENABLE indicates that the CPU is participating in I/O interrupts
- * that can be directed at a number of different CPUs. If CPU_ENABLE
- * is off, the CPU will not be given interrupts that can be sent elsewhere,
- * but will still get interrupts from devices associated with that CPU only,
- * and from other CPUs.
- *
- * CPU_OFFLINE indicates that the dispatcher should not allow any threads
- * other than interrupt threads to run on that CPU. A CPU will not have
- * CPU_OFFLINE set if there are any bound threads (besides interrupts).
- *
- * CPU_QUIESCED is set if p_offline was able to completely turn idle the
- * CPU and it will not have to run interrupt threads. In this case it'll
- * stay in the idle loop until CPU_QUIESCED is turned off.
- *
- * CPU_FROZEN is used only by CPR to mark CPUs that have been successfully
- * suspended (in the suspend path), or have yet to be resumed (in the resume
Home |
Main Index |
Thread Index |
Old Index