Source-Changes-HG archive

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

[src/trunk]: src/external/cddl/osnet Sync with upstream r315983.



details:   https://anonhg.NetBSD.org/src/rev/7b395a28f311
branches:  trunk
changeset: 452130:7b395a28f311
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Jun 19 08:18:01 2019 +0000

description:
Sync with upstream r315983.

diffstat:

 external/cddl/osnet/include/libintl.h   |  127 ++++-
 external/cddl/osnet/include/stdio_ext.h |   54 +-
 external/cddl/osnet/include/thread.h    |   28 +-
 external/cddl/osnet/sys/sys/isa_defs.h  |  723 ++++++++++++++++++++++++++++++-
 external/cddl/osnet/sys/sys/procset.h   |   47 +-
 external/cddl/osnet/sys/sys/sysmacros.h |   67 +-
 6 files changed, 910 insertions(+), 136 deletions(-)

diffs (truncated from 1275 to 300 lines):

diff -r fb96fbd7c493 -r 7b395a28f311 external/cddl/osnet/include/libintl.h
--- a/external/cddl/osnet/include/libintl.h     Wed Jun 19 06:32:46 2019 +0000
+++ b/external/cddl/osnet/include/libintl.h     Wed Jun 19 08:18:01 2019 +0000
@@ -1,42 +1,107 @@
-/*     $NetBSD: libintl.h,v 1.3 2010/02/21 01:46:34 darran Exp $       */
-
-/*-
- * Copyright (c) 2009 The NetBSD Foundation, Inc.
- * All rights reserved.
+/*
+ * CDDL HEADER START
  *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Andrew Doran.
+ * 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.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
+ * 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]
  *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2014 Garrett D'Amore <garrett%damore.org@localhost>
+ *
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
  */
 
-#ifndef        _LIBINTL_H_
-#define        _LIBINTL_H_
 
-#include <sys/cdefs.h>
-#include <stdio.h>
+#ifndef        _LIBINTL_H
+#define        _LIBINTL_H
+
+#ifdef __NetBSD__
 
 #define        textdomain(domain)      0
 #define        gettext(...)            (__VA_ARGS__)
 #define        dgettext(domain, ...)   (__VA_ARGS__)
 
-#endif /* !_SOLARIS_H_ */
+#else /* __NetBSD__ */
+
+#include <sys/isa_defs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * wchar_t is a built-in type in standard C++ and as such is not
+ * defined here when using standard C++. However, the GNU compiler
+ * fixincludes utility nonetheless creates its own version of this
+ * header for use by gcc and g++. In that version it adds a redundant
+ * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
+ * header we need to include the following magic comment:
+ *
+ * we must use the C++ compiler's type
+ *
+ * The above comment should not be removed or changed until GNU
+ * gcc/fixinc/inclhack.def is updated to bypass this header.
+ */
+#if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__))
+#ifndef _WCHAR_T
+#define        _WCHAR_T
+#if defined(_LP64)
+typedef int    wchar_t;
+#else
+typedef long   wchar_t;
+#endif
+#endif /* !_WCHAR_T */
+#endif /* !defined(__cplusplus) ... */
+
+#define        TEXTDOMAINMAX   256
+
+#define        __GNU_GETTEXT_SUPPORTED_REVISION(m)     \
+       ((((m) == 0) || ((m) == 1)) ? 1 : -1)
+
+extern char *dcgettext(const char *, const char *, const int);
+extern char *dgettext(const char *, const char *);
+extern char *gettext(const char *);
+extern char *textdomain(const char *);
+extern char *bindtextdomain(const char *, const char *);
+
+/*
+ * LI18NUX 2000 Globalization Specification Version 1.0
+ * with Amendment 2
+ */
+extern char *dcngettext(const char *, const char *,
+       const char *, unsigned long int, int);
+extern char *dngettext(const char *, const char *,
+       const char *, unsigned long int);
+extern char *ngettext(const char *, const char *, unsigned long int);
+extern char *bind_textdomain_codeset(const char *, const char *);
+
+/* Word handling functions --- requires dynamic linking */
+/* Warning: these are experimental and subject to change. */
+extern int wdinit(void);
+extern int wdchkind(wchar_t);
+extern int wdbindf(wchar_t, wchar_t, int);
+extern wchar_t *wddelim(wchar_t, wchar_t, int);
+extern wchar_t mcfiller(void);
+extern int mcwrap(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __NetBSD__ */
+
+#endif /* _LIBINTL_H */
diff -r fb96fbd7c493 -r 7b395a28f311 external/cddl/osnet/include/stdio_ext.h
--- a/external/cddl/osnet/include/stdio_ext.h   Wed Jun 19 06:32:46 2019 +0000
+++ b/external/cddl/osnet/include/stdio_ext.h   Wed Jun 19 08:18:01 2019 +0000
@@ -1,32 +1,32 @@
-/*     $NetBSD: stdio_ext.h,v 1.1 2009/08/07 20:57:55 haad Exp $       */
-
-/*-
- * Copyright (c) 2009 The NetBSD Foundation, Inc.
- * All rights reserved.
+/*
+ * CDDL HEADER START
  *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Andrew Doran.
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License").  You may not use this file except in compliance
+ * with the License.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
+ * 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.
  *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * 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 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
  */
 
-#define        enable_extended_FILE_stdio(a, b)                (0)
+#ifndef _STDIO_EXT_H
+#define _STDIO_EXT_H
+
+#define enable_extended_FILE_stdio(x,y) (0)
+
+#endif
diff -r fb96fbd7c493 -r 7b395a28f311 external/cddl/osnet/include/thread.h
--- a/external/cddl/osnet/include/thread.h      Wed Jun 19 06:32:46 2019 +0000
+++ b/external/cddl/osnet/include/thread.h      Wed Jun 19 08:18:01 2019 +0000
@@ -1,5 +1,3 @@
-/*     $NetBSD: thread.h,v 1.4 2018/05/28 21:05:08 chs Exp $   */
-
 /*
  * CDDL HEADER START
  *
@@ -22,6 +20,8 @@
  */
 
 /*
+ * Copyright 2014 Garrett D'Amore <garrett%damore.org@localhost>
+ *
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -29,9 +29,12 @@
 #ifndef        _THREAD_H
 #define        _THREAD_H
 
-#pragma ident  "%Z%%M% %I%     %E% SMI"
+#include <pthread.h>
 
-#include <pthread.h>
+#ifndef __NetBSD__
+#include <pthread_np.h>
+#endif
+
 #include <assert.h>
 
 /*
@@ -49,12 +52,8 @@
 #define        thr_equal(a,b)          pthread_equal(a,b)
 #define        thr_join(t,d,s)         pthread_join(t,s)
 #define        thr_exit(r)             pthread_exit(r)
-#define        thr_main()              (1)
 #define        _mutex_init(l,f,a)      pthread_mutex_init(l,NULL)
 #define        _mutex_destroy(l)       pthread_mutex_destroy(l)
-#if 0
-#define _mutex_held(l)         pthread_mutex_held_np(l)
-#endif
 #define        mutex_lock(l)           pthread_mutex_lock(l)
 #define        mutex_trylock(l)        pthread_mutex_trylock(l)
 #define        mutex_unlock(l)         pthread_mutex_unlock(l)
@@ -81,6 +80,7 @@
 thr_create(void *stack_base, size_t stack_size, void *(*start_func) (void*),
     void *arg, long flags, thread_t *new_thread_ID)
 {
+       pthread_t dummy;
        int ret;
 
        assert(stack_base == NULL);
@@ -90,19 +90,15 @@
        pthread_attr_t attr;
        pthread_attr_init(&attr);
 
-       if(flags & THR_DETACHED)
+       if (flags & THR_DETACHED)
                pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
-       thread_t th_id;
-       thread_t *t_id;
-       if(new_thread_ID != NULL)
-               t_id = new_thread_ID;
-       else
-               t_id = &th_id;
+       if (new_thread_ID == NULL)
+               new_thread_ID = &dummy;
 
        /* This function ignores the THR_BOUND flag, since NPTL doesn't seem to support PTHREAD_SCOPE_PROCESS */
 
-       ret = pthread_create(t_id, &attr, start_func, arg);
+       ret = pthread_create(new_thread_ID, &attr, start_func, arg);
 
        pthread_attr_destroy(&attr);
 
diff -r fb96fbd7c493 -r 7b395a28f311 external/cddl/osnet/sys/sys/isa_defs.h
--- a/external/cddl/osnet/sys/sys/isa_defs.h    Wed Jun 19 06:32:46 2019 +0000
+++ b/external/cddl/osnet/sys/sys/isa_defs.h    Wed Jun 19 08:18:01 2019 +0000
@@ -1,33 +1,220 @@
-/*     $NetBSD: isa_defs.h,v 1.3 2018/11/14 17:09:08 riastradh Exp $   */
-
-/*-
- * Copyright (c) 2018 The NetBSD Foundation, Inc.
- * All rights reserved.
+/*
+ * 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



Home | Main Index | Thread Index | Old Index