Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet Move local changes to files below "exter...



details:   https://anonhg.NetBSD.org/src/rev/8ed0ff6bb971
branches:  trunk
changeset: 457843:8ed0ff6bb971
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Jul 23 07:46:22 2019 +0000

description:
Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/spa.c |    2 +
 external/cddl/osnet/dist/uts/common/sys/bitmap.h |    9 +
 external/cddl/osnet/dist/uts/common/sys/callb.h  |   16 +
 external/cddl/osnet/sys/sys/bitmap.h             |  118 ------------
 external/cddl/osnet/sys/sys/callb.h              |  219 -----------------------
 external/cddl/osnet/sys/sys/cpupart.h            |   38 ---
 external/cddl/osnet/sys/sys/cyclic.h             |    4 +-
 7 files changed, 30 insertions(+), 376 deletions(-)

diffs (truncated from 485 to 300 lines):

diff -r 13447203170a -r 8ed0ff6bb971 external/cddl/osnet/dist/uts/common/fs/zfs/spa.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c  Tue Jul 23 06:36:36 2019 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c  Tue Jul 23 07:46:22 2019 +0000
@@ -77,7 +77,9 @@
 
 #ifdef _KERNEL
 #include <sys/callb.h>
+#ifndef __NetBSD__
 #include <sys/cpupart.h>
+#endif
 #include <sys/zone.h>
 #endif /* _KERNEL */
 
diff -r 13447203170a -r 8ed0ff6bb971 external/cddl/osnet/dist/uts/common/sys/bitmap.h
--- a/external/cddl/osnet/dist/uts/common/sys/bitmap.h  Tue Jul 23 06:36:36 2019 +0000
+++ b/external/cddl/osnet/dist/uts/common/sys/bitmap.h  Tue Jul 23 07:46:22 2019 +0000
@@ -126,6 +126,12 @@
 #endif /* _LP64 */
 
 
+#ifdef __NetBSD__
+
+#include <sys/atomic.h>
+
+#else /*__NetBSD__ */
+
 /*
  * BIT_ONLYONESET is a private macro not designed for bitmaps of
  * arbitrary size.  u must be an unsigned integer/long.  It returns
@@ -190,6 +196,9 @@
 
 #endif /* _KERNEL && !_ASM */
 
+#endif /*__NetBSD__ */
+
+
 #ifdef __cplusplus
 }
 #endif
diff -r 13447203170a -r 8ed0ff6bb971 external/cddl/osnet/dist/uts/common/sys/callb.h
--- a/external/cddl/osnet/dist/uts/common/sys/callb.h   Tue Jul 23 06:36:36 2019 +0000
+++ b/external/cddl/osnet/dist/uts/common/sys/callb.h   Tue Jul 23 07:46:22 2019 +0000
@@ -130,6 +130,17 @@
  * Note: lockp is the lock to protect the callb_cpr_t (cp) structure
  * later on.  No lock held is needed for this initialization.
  */
+#ifdef __NetBSD__
+#define        CALLB_CPR_INIT(cp, lockp, func, name)   {                       \
+               /* XXXNETBSD set thread name */                         \
+               bzero((caddr_t)(cp), sizeof (callb_cpr_t));             \
+               (cp)->cc_lockp = lockp;                                 \
+               (cp)->cc_id = callb_add(func, (void *)(cp),             \
+                       CB_CL_CPR_DAEMON, name);                        \
+               cv_init(&(cp)->cc_callb_cv, NULL, CV_DEFAULT, NULL);    \
+               cv_init(&(cp)->cc_stop_cv, NULL, CV_DEFAULT, NULL);     \
+       }
+#else
 #define        CALLB_CPR_INIT(cp, lockp, func, name)   {                       \
                strlcpy(curthread->td_name, (name),                     \
                    sizeof(curthread->td_name));                        \
@@ -140,6 +151,7 @@
                cv_init(&(cp)->cc_callb_cv, NULL, CV_DEFAULT, NULL);    \
                cv_init(&(cp)->cc_stop_cv, NULL, CV_DEFAULT, NULL);     \
        }
+#endif
 
 #ifndef __lock_lint
 #define        CALLB_CPR_ASSERT(cp)    ASSERT(MUTEX_HELD((cp)->cc_lockp));
@@ -206,6 +218,10 @@
 extern boolean_t callb_is_stopped(kthread_id_t, caddr_t *);
 extern void    callb_lock_table(void);
 extern void    callb_unlock_table(void);
+#ifdef __NetBSD__
+extern void    callb_init(void *);
+extern void    callb_fini(void *);
+#endif
 #endif
 
 #ifdef __cplusplus
diff -r 13447203170a -r 8ed0ff6bb971 external/cddl/osnet/sys/sys/bitmap.h
--- a/external/cddl/osnet/sys/sys/bitmap.h      Tue Jul 23 06:36:36 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*     $NetBSD: bitmap.h,v 1.3 2010/02/21 01:46:35 darran Exp $        */
-
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-
-#ifndef _COMPAT_OPENSOLARIS_SYS_BITMAP_H
-#define        _COMPAT_OPENSOLARIS_SYS_BITMAP_H
-
-#include <sys/atomic.h>
-
-/*
- * Operations on bitmaps of arbitrary size
- * A bitmap is a vector of 1 or more ulong_t's.
- * The user of the package is responsible for range checks and keeping
- * track of sizes.
- */
-
-#ifdef _LP64
-#define        BT_ULSHIFT      6 /* log base 2 of BT_NBIPUL, to extract word index */
-#define        BT_ULSHIFT32    5 /* log base 2 of BT_NBIPUL, to extract word index */
-#else
-#define        BT_ULSHIFT      5 /* log base 2 of BT_NBIPUL, to extract word index */
-#endif
-
-#define        BT_NBIPUL       (1 << BT_ULSHIFT)       /* n bits per ulong_t */
-#define        BT_ULMASK       (BT_NBIPUL - 1)         /* to extract bit index */
-
-#ifdef _LP64
-#define        BT_NBIPUL32     (1 << BT_ULSHIFT32)     /* n bits per ulong_t */
-#define        BT_ULMASK32     (BT_NBIPUL32 - 1)       /* to extract bit index */
-#define        BT_ULMAXMASK    0xffffffffffffffff      /* used by bt_getlowbit */
-#else
-#define        BT_ULMAXMASK    0xffffffff
-#endif
-
-/*
- * bitmap is a ulong_t *, bitindex an index_t
- *
- * The macros BT_WIM and BT_BIW internal; there is no need
- * for users of this package to use them.
- */
-
-/*
- * word in map
- */
-#define        BT_WIM(bitmap, bitindex) \
-       ((bitmap)[(bitindex) >> BT_ULSHIFT])
-/*
- * bit in word
- */
-#define        BT_BIW(bitindex) \
-       (1UL << ((bitindex) & BT_ULMASK))
-
-#ifdef _LP64
-#define        BT_WIM32(bitmap, bitindex) \
-       ((bitmap)[(bitindex) >> BT_ULSHIFT32])
-
-#define        BT_BIW32(bitindex) \
-       (1UL << ((bitindex) & BT_ULMASK32))
-#endif
-
-/*
- * These are public macros
- *
- * BT_BITOUL == n bits to n ulong_t's
- */
-#define        BT_BITOUL(nbits) \
-       (((nbits) + BT_NBIPUL - 1l) / BT_NBIPUL)
-#define        BT_SIZEOFMAP(nbits) \
-       (BT_BITOUL(nbits) * sizeof (ulong_t))
-#define        BT_TEST(bitmap, bitindex) \
-       ((BT_WIM((bitmap), (bitindex)) & BT_BIW(bitindex)) ? 1 : 0)
-#define        BT_SET(bitmap, bitindex) \
-       { BT_WIM((bitmap), (bitindex)) |= BT_BIW(bitindex); }
-#define        BT_CLEAR(bitmap, bitindex) \
-       { BT_WIM((bitmap), (bitindex)) &= ~BT_BIW(bitindex); }
-
-#ifdef _LP64
-#define        BT_BITOUL32(nbits) \
-       (((nbits) + BT_NBIPUL32 - 1l) / BT_NBIPUL32)
-#define        BT_SIZEOFMAP32(nbits) \
-       (BT_BITOUL32(nbits) * sizeof (uint_t))
-#define        BT_TEST32(bitmap, bitindex) \
-       ((BT_WIM32((bitmap), (bitindex)) & BT_BIW32(bitindex)) ? 1 : 0)
-#define        BT_SET32(bitmap, bitindex) \
-       { BT_WIM32((bitmap), (bitindex)) |= BT_BIW32(bitindex); }
-#define        BT_CLEAR32(bitmap, bitindex) \
-       { BT_WIM32((bitmap), (bitindex)) &= ~BT_BIW32(bitindex); }
-#endif /* _LP64 */
-
-#endif /* _COMPAT_OPENSOLARIS_SYS_BITMAP_H */
diff -r 13447203170a -r 8ed0ff6bb971 external/cddl/osnet/sys/sys/callb.h
--- a/external/cddl/osnet/sys/sys/callb.h       Tue Jul 23 06:36:36 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*     $NetBSD: callb.h,v 1.2 2018/05/28 21:05:10 chs Exp $    */
-
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef        _SYS_CALLB_H
-#define        _SYS_CALLB_H
-
-#include <sys/kcondvar.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * definitions of callback classes (c_class)
- *
- * Callbacks belong in the same class if (1) their callback routines
- * do the same kind of processing (ideally, using the same callback function)
- * and (2) they can/should be executed at the same time in a cpr
- * suspend/resume operation.
- *
- * Note: The DAEMON class, in particular, is for stopping kernel threads
- * and nothing else.  The CALLB_* macros below should be used to deal
- * with kernel threads, and the callback function should be callb_generic_cpr.
- * Another idiosyncrasy of the DAEMON class is that if a suspend operation
- * fails, some of the callback functions may be called with the RESUME
- * code which were never called with SUSPEND.  Not a problem currently,
- * but see bug 4201851.
- */
-#define        CB_CL_CPR_DAEMON        0
-#define        CB_CL_CPR_VM            1
-#define        CB_CL_CPR_CALLOUT       2
-#define        CB_CL_CPR_OBP           3
-#define        CB_CL_CPR_FB            4
-#define        CB_CL_PANIC             5
-#define        CB_CL_CPR_RPC           6
-#define        CB_CL_CPR_PROMPRINTF    7
-#define        CB_CL_UADMIN            8
-#define        CB_CL_CPR_PM            9
-#define        CB_CL_HALT              10
-#define        CB_CL_CPR_DMA           11
-#define        CB_CL_CPR_POST_USER     12
-#define        CB_CL_UADMIN_PRE_VFS    13
-#define        CB_CL_MDBOOT            CB_CL_UADMIN
-#define        CB_CL_ENTER_DEBUGGER    14
-#define        CB_CL_CPR_POST_KERNEL   15
-#define        CB_CL_CPU_DEEP_IDLE     16
-#define        NCBCLASS                17 /* CHANGE ME if classes are added/removed */
-
-/*
- * CB_CL_CPR_DAEMON class specific definitions are given below:
- */
-
-/*
- * code for CPR callb_execute_class
- */
-#define        CB_CODE_CPR_CHKPT       0
-#define        CB_CODE_CPR_RESUME      1
-
-typedef        void *          callb_id_t;
-/*
- * Per kernel thread structure for CPR daemon callbacks.
- * Must be protected by either a existing lock in the daemon or
- * a new lock created for such a purpose.
- */
-typedef struct callb_cpr {
-       kmutex_t        *cc_lockp;      /* lock to protect this struct */
-       char            cc_events;      /* various events for CPR */
-       callb_id_t      cc_id;          /* callb id address */
-       kcondvar_t      cc_callb_cv;    /* cv for callback waiting */
-       kcondvar_t      cc_stop_cv;     /* cv to checkpoint block */
-} callb_cpr_t;



Home | Main Index | Thread Index | Old Index