CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: mrg Date: Sat Mar 9 09:55:52 UTC 2024 Modified Files: src/sys/external/bsd/common/include/linux: printk.h Log Message: drm(4): make pr_debug equivalent to aprint_debug significantly reduces the default spam from amdgpu(4). To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/common/include/linux/printk.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/printk.h diff -u src/sys/external/bsd/common/include/linux/printk.h:1.13 src/sys/external/bsd/common/include/linux/printk.h:1.14 --- src/sys/external/bsd/common/include/linux/printk.h:1.13 Fri Jul 29 23:50:44 2022 +++ src/sys/external/bsd/common/include/linux/printk.h Sat Mar 9 09:55:52 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: printk.h,v 1.13 2022/07/29 23:50:44 riastradh Exp $ */ +/* $NetBSD: printk.h,v 1.14 2024/03/09 09:55:52 mrg Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -47,7 +47,7 @@ #define pr_warn printf /* XXX */ #define pr_warn_once printf /* XXX */ #define pr_notice printf /* XXX */ -#define pr_debug printf /* XXX */ +#define pr_debug aprint_debug #define KERN_EMERG "emerg: " #define KERN_ALERT "alert: " #define KERN_CRIT "crit: "
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: mrg Date: Sat Mar 9 09:55:52 UTC 2024 Modified Files: src/sys/external/bsd/common/include/linux: printk.h Log Message: drm(4): make pr_debug equivalent to aprint_debug significantly reduces the default spam from amdgpu(4). To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/common/include/linux/printk.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Tue Oct 25 23:37:36 UTC 2022 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: linux/kernel.h: S16_MIN, S32_MIN, S64_MIN To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.45 src/sys/external/bsd/common/include/linux/kernel.h:1.46 --- src/sys/external/bsd/common/include/linux/kernel.h:1.45 Sun Dec 19 12:02:13 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Tue Oct 25 23:37:36 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.45 2021/12/19 12:02:13 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.46 2022/10/25 23:37:36 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -53,8 +53,11 @@ #define U64_MAX UINT64_MAX #define S16_MAX INT16_MAX +#define S16_MIN INT16_MIN #define S32_MAX INT32_MAX +#define S32_MIN INT32_MIN #define S64_MAX INT64_MAX +#define S64_MIN INT64_MIN #define oops_in_progress (panicstr != NULL)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Tue Oct 25 23:37:36 UTC 2022 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: linux/kernel.h: S16_MIN, S32_MIN, S64_MIN To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Tue Oct 25 23:31:27 UTC 2022 Modified Files: src/sys/external/bsd/common/include/linux: export.h Log Message: linux/export.h: Side-load linux/stringify.h. Expected by some users. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/export.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/export.h diff -u src/sys/external/bsd/common/include/linux/export.h:1.1 src/sys/external/bsd/common/include/linux/export.h:1.2 --- src/sys/external/bsd/common/include/linux/export.h:1.1 Sun Dec 19 09:42:27 2021 +++ src/sys/external/bsd/common/include/linux/export.h Tue Oct 25 23:31:27 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: export.h,v 1.1 2021/12/19 09:42:27 riastradh Exp $ */ +/* $NetBSD: export.h,v 1.2 2022/10/25 23:31:27 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -32,6 +32,8 @@ #ifndef _LINUX_EXPORT_H_ #define _LINUX_EXPORT_H_ +#include + #define EXPORT_SYMBOL(name) /* XXX Provisional -- this shouldn't happen in sources we use. */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Tue Oct 25 23:31:27 UTC 2022 Modified Files: src/sys/external/bsd/common/include/linux: export.h Log Message: linux/export.h: Side-load linux/stringify.h. Expected by some users. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/export.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Jul 17 08:34:00 UTC 2022 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h Log Message: linux/compiler.h: Add missing barriers in READ_ONCE, WRITE_ONCE. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/common/include/linux/compiler.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/compiler.h diff -u src/sys/external/bsd/common/include/linux/compiler.h:1.8 src/sys/external/bsd/common/include/linux/compiler.h:1.9 --- src/sys/external/bsd/common/include/linux/compiler.h:1.8 Sat Apr 9 23:43:31 2022 +++ src/sys/external/bsd/common/include/linux/compiler.h Sun Jul 17 08:34:00 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: compiler.h,v 1.8 2022/04/09 23:43:31 riastradh Exp $ */ +/* $NetBSD: compiler.h,v 1.9 2022/07/17 08:34:00 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -62,6 +62,7 @@ BUILD_BUG_ON_ZERO(__same_type((X), &(X)[0])) #define READ_ONCE(X) ({ \ + __insn_barrier(); \ typeof(X) __read_once_tmp = (X); \ membar_datadep_consumer(); \ __read_once_tmp; \ @@ -69,7 +70,9 @@ #define WRITE_ONCE(X, V) ({ \ typeof(X) __write_once_tmp = (V); \ + __insn_barrier(); \ (X) = __write_once_tmp; \ + __insn_barrier(); \ __write_once_tmp; \ })
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Jul 17 08:34:00 UTC 2022 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h Log Message: linux/compiler.h: Add missing barriers in READ_ONCE, WRITE_ONCE. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/common/include/linux/compiler.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: thorpej Date: Wed Dec 22 18:04:54 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: Reduce code duplication: kmem_cache_create() is now exactly the same as kmem_cache_create_dtor() except for the dtor argument, so implement the former in terms of the latter. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/slab.h diff -u src/sys/external/bsd/common/include/linux/slab.h:1.12 src/sys/external/bsd/common/include/linux/slab.h:1.13 --- src/sys/external/bsd/common/include/linux/slab.h:1.12 Wed Dec 22 16:57:29 2021 +++ src/sys/external/bsd/common/include/linux/slab.h Wed Dec 22 18:04:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: slab.h,v 1.12 2021/12/22 16:57:29 thorpej Exp $ */ +/* $NetBSD: slab.h,v 1.13 2021/12/22 18:04:53 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -194,27 +194,6 @@ kmem_cache_dtor(void *cookie, void *ptr) (*kc->kc_dtor)(ptr); } -static inline struct kmem_cache * -kmem_cache_create(const char *name, size_t size, size_t align, -unsigned long flags, void (*ctor)(void *)) -{ - struct kmem_cache *kc; - int pcflags = 0; - - if (ISSET(flags, SLAB_HWCACHE_ALIGN)) - align = roundup(MAX(1, align), CACHE_LINE_SIZE); - if (ISSET(flags, SLAB_TYPESAFE_BY_RCU)) - pcflags |= PR_PSERIALIZE; - - kc = kmem_alloc(sizeof(*kc), KM_SLEEP); - kc->kc_pool_cache = pool_cache_init(size, align, 0, pcflags, name, NULL, - IPL_VM, _cache_ctor, NULL, kc); - kc->kc_size = size; - kc->kc_ctor = ctor; - - return kc; -} - /* XXX extension */ static inline struct kmem_cache * kmem_cache_create_dtor(const char *name, size_t size, size_t align, @@ -230,7 +209,8 @@ kmem_cache_create_dtor(const char *name, kc = kmem_alloc(sizeof(*kc), KM_SLEEP); kc->kc_pool_cache = pool_cache_init(size, align, 0, pcflags, name, NULL, - IPL_VM, _cache_ctor, _cache_dtor, kc); + IPL_VM, _cache_ctor, dtor != NULL ? _cache_dtor : NULL, + kc); kc->kc_size = size; kc->kc_ctor = ctor; kc->kc_dtor = dtor; @@ -238,6 +218,13 @@ kmem_cache_create_dtor(const char *name, return kc; } +static inline struct kmem_cache * +kmem_cache_create(const char *name, size_t size, size_t align, +unsigned long flags, void (*ctor)(void *)) +{ + return kmem_cache_create_dtor(name, size, align, flags, ctor, NULL); +} + #define KMEM_CACHE(T, F) \ kmem_cache_create(#T, sizeof(struct T), __alignof__(struct T), \ (F), NULL)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: thorpej Date: Wed Dec 22 18:04:54 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: Reduce code duplication: kmem_cache_create() is now exactly the same as kmem_cache_create_dtor() except for the dtor argument, so implement the former in terms of the latter. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:35:37 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: linux: Timeout audit -- linux/completion.h. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/completion.h diff -u src/sys/external/bsd/common/include/linux/completion.h:1.11 src/sys/external/bsd/common/include/linux/completion.h:1.12 --- src/sys/external/bsd/common/include/linux/completion.h:1.11 Sun Dec 19 12:22:56 2021 +++ src/sys/external/bsd/common/include/linux/completion.h Sun Dec 19 12:35:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: completion.h,v 1.11 2021/12/19 12:22:56 riastradh Exp $ */ +/* $NetBSD: completion.h,v 1.12 2021/12/19 12:35:37 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -198,18 +198,18 @@ wait_for_completion_interruptible_timeou mutex_enter(>c_lock); - /* Wait until c_done is nonzero. */ + /* Wait until c_done is nonzero, timeout, or signal. */ while (completion->c_done == 0) { - error = cv_timedwait_sig(>c_cv, - >c_lock, ticks); - if (error) - goto out; - now = getticks(); - if (ticks < (now - start)) { + if (ticks == 0) { error = EWOULDBLOCK; goto out; } - ticks -= (now - start); + error = cv_timedwait_sig(>c_cv, + >c_lock, MIN(ticks, INT_MAX/2)); + now = getticks(); + if (error) + goto out; + ticks -= MIN(ticks, (now - start)); start = now; } @@ -224,7 +224,7 @@ out: mutex_exit(>c_lock); return -ERESTARTSYS; } else { KASSERTMSG((error == 0), "error = %d", error); - return ticks; + return MAX(1, MIN(ticks, INT_MAX/2)); } } @@ -232,23 +232,23 @@ static inline int wait_for_completion_timeout(struct completion *completion, unsigned long ticks) { /* XXX Arithmetic overflow...? */ - unsigned int start = hardclock_ticks, now; + unsigned int start = getticks(), now; int error; mutex_enter(>c_lock); - /* Wait until c_done is nonzero. */ + /* Wait until c_done is nonzero or timeout. */ while (completion->c_done == 0) { - error = cv_timedwait(>c_cv, >c_lock, - ticks); - if (error) - goto out; - now = hardclock_ticks; - if (ticks < (now - start)) { + if (ticks == 0) { error = EWOULDBLOCK; goto out; } - ticks -= (now - start); + error = cv_timedwait(>c_cv, >c_lock, + MIN(ticks, INT_MAX/2)); + now = getticks(); + if (error) + goto out; + ticks -= MIN(ticks, (now - start)); start = now; } @@ -261,7 +261,7 @@ out: mutex_exit(>c_lock); return 0; } else { KASSERTMSG((error == 0), "error = %d", error); - return ticks; + return MAX(1, MIN(ticks, INT_MAX/2)); } } @@ -275,7 +275,7 @@ wait_for_completion_interruptible(struct mutex_enter(>c_lock); - /* Wait until c_done is nonzero. */ + /* Wait until c_done is nonzero or signal. */ while (completion->c_done == 0) { error = cv_wait_sig(>c_cv, >c_lock); if (error) @@ -287,9 +287,12 @@ wait_for_completion_interruptible(struct error = 0; out: mutex_exit(>c_lock); - if ((error == EINTR) || (error == ERESTART)) - error = -ERESTARTSYS; - return error; + if ((error == EINTR) || (error == ERESTART)) { + return -ERESTARTSYS; + } else { + KASSERTMSG((error == 0), "error = %d", error); + return 0; + } } /*
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:35:37 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: linux: Timeout audit -- linux/completion.h. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:22:57 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: linux: wait_for_completion To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/completion.h diff -u src/sys/external/bsd/common/include/linux/completion.h:1.10 src/sys/external/bsd/common/include/linux/completion.h:1.11 --- src/sys/external/bsd/common/include/linux/completion.h:1.10 Sun Dec 19 01:57:42 2021 +++ src/sys/external/bsd/common/include/linux/completion.h Sun Dec 19 12:22:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: completion.h,v 1.10 2021/12/19 01:57:42 riastradh Exp $ */ +/* $NetBSD: completion.h,v 1.11 2021/12/19 12:22:56 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -306,6 +306,17 @@ wait_for_completion_killable(struct comp return wait_for_completion_interruptible(completion); } +static inline void +wait_for_completion(struct completion *completion) +{ + + mutex_enter(>c_lock); + while (completion->c_done == 0) + cv_wait(>c_cv, >c_lock); + _completion_claim(completion); + mutex_exit(>c_lock); +} + /* * Try to claim a completion immediately. Return true on success, false * if it would block.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:22:57 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: linux: wait_for_completion To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:20:53 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: overflow.h Log Message: linux: Allow non-VLA structs in struct_size. Upstream sometimes uses struct foo { int x; short y[1]; }; instead of short y[] with struct_size. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/overflow.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/overflow.h diff -u src/sys/external/bsd/common/include/linux/overflow.h:1.1 src/sys/external/bsd/common/include/linux/overflow.h:1.2 --- src/sys/external/bsd/common/include/linux/overflow.h:1.1 Sun Dec 19 12:20:21 2021 +++ src/sys/external/bsd/common/include/linux/overflow.h Sun Dec 19 12:20:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: overflow.h,v 1.1 2021/12/19 12:20:21 riastradh Exp $ */ +/* $NetBSD: overflow.h,v 1.2 2021/12/19 12:20:53 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -79,7 +79,7 @@ __struct_size(size_t basesize, size_t el #define struct_size(p, member, n) \ ({ \ - CTASSERT(sizeof(*(p)) == offsetof(__typeof__(*(p)), member)); \ + CTASSERT(sizeof(*(p)) >= offsetof(__typeof__(*(p)), member)); \ __struct_size(sizeof(*(p)), sizeof((p)->member[0]), (n)); \ })
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:20:53 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: overflow.h Log Message: linux: Allow non-VLA structs in struct_size. Upstream sometimes uses struct foo { int x; short y[1]; }; instead of short y[] with struct_size. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/overflow.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:20:46 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: linux: Side-load linux/overflow.h in linux/slab.h. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/slab.h diff -u src/sys/external/bsd/common/include/linux/slab.h:1.9 src/sys/external/bsd/common/include/linux/slab.h:1.10 --- src/sys/external/bsd/common/include/linux/slab.h:1.9 Sun Dec 19 12:12:23 2021 +++ src/sys/external/bsd/common/include/linux/slab.h Sun Dec 19 12:20:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: slab.h,v 1.9 2021/12/19 12:12:23 riastradh Exp $ */ +/* $NetBSD: slab.h,v 1.10 2021/12/19 12:20:46 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -39,6 +39,7 @@ #include /* For PAGE_SIZE. */ #include +#include #include #define ARCH_KMALLOC_MINALIGN 4 /* XXX ??? */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:20:46 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: linux: Side-load linux/overflow.h in linux/slab.h. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:12:23 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: linux: Allow GFP_NOWAIT too. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/slab.h diff -u src/sys/external/bsd/common/include/linux/slab.h:1.8 src/sys/external/bsd/common/include/linux/slab.h:1.9 --- src/sys/external/bsd/common/include/linux/slab.h:1.8 Sun Dec 19 12:07:55 2021 +++ src/sys/external/bsd/common/include/linux/slab.h Sun Dec 19 12:12:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: slab.h,v 1.8 2021/12/19 12:07:55 riastradh Exp $ */ +/* $NetBSD: slab.h,v 1.9 2021/12/19 12:12:23 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ linux_gfp_to_kmem(gfp_t gfp) * rather than allocate memory without respecting parameters we * don't understand. */ - KASSERT((gfp == GFP_ATOMIC) || + KASSERT((gfp == GFP_ATOMIC) || (gfp == GFP_NOWAIT) || ((gfp & ~__GFP_WAIT) == (GFP_KERNEL & ~__GFP_WAIT))); if (ISSET(gfp, __GFP_WAIT)) {
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 12:12:23 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: linux: Allow GFP_NOWAIT too. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:58:09 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: kmem_cache is used at IPL_VM Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:58:09 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: kmem_cache is used at IPL_VM Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/slab.h diff -u src/sys/external/bsd/common/include/linux/slab.h:1.5 src/sys/external/bsd/common/include/linux/slab.h:1.6 --- src/sys/external/bsd/common/include/linux/slab.h:1.5 Sun Dec 19 11:58:02 2021 +++ src/sys/external/bsd/common/include/linux/slab.h Sun Dec 19 11:58:09 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: slab.h,v 1.5 2021/12/19 11:58:02 riastradh Exp $ */ +/* $NetBSD: slab.h,v 1.6 2021/12/19 11:58:09 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -182,7 +182,7 @@ kmem_cache_create(const char *name, size kc = kmem_alloc(sizeof(*kc), KM_SLEEP); kc->kc_pool_cache = pool_cache_init(size, align, 0, 0, name, palloc, - IPL_NONE, _cache_ctor, NULL, kc); + IPL_VM, _cache_ctor, NULL, kc); kc->kc_size = size; kc->kc_ctor = ctor;
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:58:02 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: Fix inverted notion of whether to wait for allocation Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/slab.h diff -u src/sys/external/bsd/common/include/linux/slab.h:1.4 src/sys/external/bsd/common/include/linux/slab.h:1.5 --- src/sys/external/bsd/common/include/linux/slab.h:1.4 Sun Dec 19 01:39:05 2021 +++ src/sys/external/bsd/common/include/linux/slab.h Sun Dec 19 11:58:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: slab.h,v 1.4 2021/12/19 01:39:05 riastradh Exp $ */ +/* $NetBSD: slab.h,v 1.5 2021/12/19 11:58:02 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -208,9 +208,9 @@ kmem_cache_alloc(struct kmem_cache *kc, void *ptr; if (gfp & __GFP_WAIT) - flags |= PR_NOWAIT; - else flags |= PR_WAITOK; + else + flags |= PR_NOWAIT; ptr = pool_cache_get(kc->kc_pool_cache, flags); if (ptr == NULL)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:58:02 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: Fix inverted notion of whether to wait for allocation Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:36:32 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: linux/list.h: Add list_safe_reset_next. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.28 src/sys/external/bsd/common/include/linux/list.h:1.29 --- src/sys/external/bsd/common/include/linux/list.h:1.28 Sun Dec 19 11:32:08 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 11:36:32 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.28 2021/12/19 11:32:08 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.29 2021/12/19 11:36:32 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -107,7 +107,6 @@ static inline bool list_is_first(const struct list_head *entry, const struct list_head *head) { return head == entry->prev; - } static inline bool @@ -273,6 +272,9 @@ list_del_init(struct list_head *node) ((VAR) != (HEAD)) && ((NEXT) = list_next((VAR)), 1); \ (VAR) = (NEXT)) +#define list_safe_reset_next(VAR, NEXT, FIELD)\ + (NEXT) = list_next_entry(VAR, FIELD) + #define list_for_each_entry(VAR, HEAD, FIELD)\ for ((VAR) = list_entry(list_first((HEAD)), typeof(*(VAR)), FIELD); \ &(VAR)->FIELD != (HEAD);\
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:36:32 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: linux/list.h: Add list_safe_reset_next. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:35:36 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: linux: might_sleep_if To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.43 src/sys/external/bsd/common/include/linux/kernel.h:1.44 --- src/sys/external/bsd/common/include/linux/kernel.h:1.43 Sun Dec 19 11:33:49 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Sun Dec 19 11:35:36 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.43 2021/12/19 11:33:49 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.44 2021/12/19 11:35:36 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -63,6 +63,11 @@ #define IS_REACHABLE(option) (option) #define might_sleep ASSERT_SLEEPABLE +#define might_sleep_if(C) do \ +{ \ + if (C) \ + might_sleep(); \ +} while (0) #define DEFINE_STATIC_KEY_FALSE(N) bool N __unused = false
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:35:36 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: linux: might_sleep_if To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:33:17 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: rcupdate.h Log Message: linux: rcu_replace_pointer To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/rcupdate.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/rcupdate.h diff -u src/sys/external/bsd/common/include/linux/rcupdate.h:1.5 src/sys/external/bsd/common/include/linux/rcupdate.h:1.6 --- src/sys/external/bsd/common/include/linux/rcupdate.h:1.5 Sun Dec 19 11:31:04 2021 +++ src/sys/external/bsd/common/include/linux/rcupdate.h Sun Dec 19 11:33:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rcupdate.h,v 1.5 2021/12/19 11:31:04 riastradh Exp $ */ +/* $NetBSD: rcupdate.h,v 1.6 2021/12/19 11:33:17 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -53,6 +53,14 @@ (P); \ }) +#define rcu_replace_pointer(PTRP, NEWPTR, C) ({ \ + __typeof__(PTRP) __rrp_ptrp = (PTRP); \ + __typeof__(PTRP) __rrp_oldptr = \ + rcu_dereference_protected(__rrp_ptrp, C); \ + rcu_assign_pointer(__rrp_ptrp, NEWPTR); \ + __rrp_oldptr; \ +}) + /* kill_dependency */ #define rcu_pointer_handoff(P) (P)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:33:17 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: rcupdate.h Log Message: linux: rcu_replace_pointer To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/rcupdate.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:33:09 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: linux: S16_MAX, S32_MAX, S64_MAX To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.41 src/sys/external/bsd/common/include/linux/kernel.h:1.42 --- src/sys/external/bsd/common/include/linux/kernel.h:1.41 Sun Dec 19 11:14:42 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Sun Dec 19 11:33:09 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.41 2021/12/19 11:14:42 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.42 2021/12/19 11:33:09 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -52,6 +52,10 @@ #define U32_MAX UINT32_MAX #define U64_MAX UINT64_MAX +#define S16_MAX INT16_MAX +#define S32_MAX INT32_MAX +#define S64_MAX INT64_MAX + #define oops_in_progress (panicstr != NULL) #define IS_BUILTIN(option) (1) /* Probably... */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:33:09 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: linux: S16_MAX, S32_MAX, S64_MAX To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:32:09 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: Provide list_for_each_entry_safe_reverse and reorder for consistency Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.27 src/sys/external/bsd/common/include/linux/list.h:1.28 --- src/sys/external/bsd/common/include/linux/list.h:1.27 Sun Dec 19 10:51:09 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 11:32:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.27 2021/12/19 10:51:09 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.28 2021/12/19 11:32:08 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -279,12 +279,6 @@ list_del_init(struct list_head *node) (VAR) = list_entry(list_next(&(VAR)->FIELD), typeof(*(VAR)), \ FIELD)) -#define list_for_each_entry_reverse(VAR, HEAD, FIELD) \ - for ((VAR) = list_entry(list_last((HEAD)), typeof(*(VAR)), FIELD); \ - &(VAR)->FIELD != (HEAD);\ - (VAR) = list_entry(list_prev(&(VAR)->FIELD), typeof(*(VAR)), \ - FIELD)) - #define list_for_each_entry_safe(VAR, NEXT, HEAD, FIELD) \ for ((VAR) = list_entry(list_first((HEAD)), typeof(*(VAR)), FIELD); \ (&(VAR)->FIELD != (HEAD)) &&\ @@ -292,6 +286,19 @@ list_del_init(struct list_head *node) typeof(*(VAR)), FIELD), 1); \ (VAR) = (NEXT)) +#define list_for_each_entry_safe_reverse(VAR, NEXT, HEAD, FIELD) \ + for ((VAR) = list_entry(list_last((HEAD)), typeof(*(VAR)), FIELD); \ + (&(VAR)->FIELD != (HEAD)) &&\ + ((NEXT) = list_entry(list_prev(&(VAR)->FIELD), \ + typeof(*(VAR)), FIELD), 1); \ + (VAR) = (NEXT)) + +#define list_for_each_entry_reverse(VAR, HEAD, FIELD) \ + for ((VAR) = list_entry(list_last((HEAD)), typeof(*(VAR)), FIELD); \ + &(VAR)->FIELD != (HEAD);\ + (VAR) = list_entry(list_prev(&(VAR)->FIELD), typeof(*(VAR)), \ + FIELD)) + #define list_for_each_entry_continue(VAR, HEAD, FIELD) \ for ((VAR) = list_next_entry((VAR), FIELD); \ &(VAR)->FIELD != (HEAD);\
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:32:09 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: Provide list_for_each_entry_safe_reverse and reorder for consistency Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:57 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h Log Message: linux: Add __same_type and __must_be_array. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/compiler.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:57 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h Log Message: linux: Add __same_type and __must_be_array. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/compiler.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/compiler.h diff -u src/sys/external/bsd/common/include/linux/compiler.h:1.5 src/sys/external/bsd/common/include/linux/compiler.h:1.6 --- src/sys/external/bsd/common/include/linux/compiler.h:1.5 Sun Dec 19 11:10:01 2021 +++ src/sys/external/bsd/common/include/linux/compiler.h Sun Dec 19 11:26:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: compiler.h,v 1.5 2021/12/19 11:10:01 riastradh Exp $ */ +/* $NetBSD: compiler.h,v 1.6 2021/12/19 11:26:57 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -54,6 +54,10 @@ #define barrier() __insn_barrier() #define likely(X) __predict_true(X) #define unlikely(X) __predict_false(X) +#define __same_type(X,Y) \ + __builtin_types_compatible_p(__typeof__(X), __typeof__(Y)) +#define __must_be_array(X) \ + BUILD_BUG_ON_ZERO(__same_type((X), &(X)[0])) #define READ_ONCE(X) ({ \ typeof(X) __read_once_tmp = (X); \
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:14:42 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: drm: Add __is_constexpr. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.40 src/sys/external/bsd/common/include/linux/kernel.h:1.41 --- src/sys/external/bsd/common/include/linux/kernel.h:1.40 Sun Dec 19 10:56:30 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Sun Dec 19 11:14:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.40 2021/12/19 10:56:30 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.41 2021/12/19 11:14:42 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -123,6 +123,8 @@ #define ARRAY_SIZE(ARRAY) __arraycount(ARRAY) +#define __is_constexpr(x) __builtin_constant_p(x) + #define swap(X, Y) do \ { \ /* XXX Kludge for type-safety. */\
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:14:42 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: drm: Add __is_constexpr. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:14:34 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: build_bug.h Log Message: drm: Make BUILD_BUG_ON_ZERO do something. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/common/include/linux/build_bug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/build_bug.h diff -u src/sys/external/bsd/common/include/linux/build_bug.h:1.3 src/sys/external/bsd/common/include/linux/build_bug.h:1.4 --- src/sys/external/bsd/common/include/linux/build_bug.h:1.3 Sun Dec 19 11:14:26 2021 +++ src/sys/external/bsd/common/include/linux/build_bug.h Sun Dec 19 11:14:34 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: build_bug.h,v 1.3 2021/12/19 11:14:26 riastradh Exp $ */ +/* $NetBSD: build_bug.h,v 1.4 2021/12/19 11:14:34 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -41,6 +41,6 @@ #define BUILD_BUG() do {} while (0) #define BUILD_BUG_ON_MSG(EXPR,MSG) BUILD_BUG_ON(EXPR) #define BUILD_BUG_ON_INVALID(EXPR) ((void)sizeof((long)(EXPR))) -#define BUILD_BUG_ON_ZERO(EXPR) 0 +#define BUILD_BUG_ON_ZERO(EXPR) ((int)(0*sizeof(int[(EXPR) ? -1 : 1]))) #endif /* _LINUX_BUILD_BUG_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:14:34 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: build_bug.h Log Message: drm: Make BUILD_BUG_ON_ZERO do something. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/common/include/linux/build_bug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:14:27 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: build_bug.h Log Message: stub BUILD_BUG_ON_ZERO, from openbsd. This is a dual purpose macro that asserts but can also be used in expressions. Provide the expression implementation. Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/common/include/linux/build_bug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/build_bug.h diff -u src/sys/external/bsd/common/include/linux/build_bug.h:1.2 src/sys/external/bsd/common/include/linux/build_bug.h:1.3 --- src/sys/external/bsd/common/include/linux/build_bug.h:1.2 Sun Dec 19 11:10:48 2021 +++ src/sys/external/bsd/common/include/linux/build_bug.h Sun Dec 19 11:14:26 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: build_bug.h,v 1.2 2021/12/19 11:10:48 riastradh Exp $ */ +/* $NetBSD: build_bug.h,v 1.3 2021/12/19 11:14:26 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -41,5 +41,6 @@ #define BUILD_BUG() do {} while (0) #define BUILD_BUG_ON_MSG(EXPR,MSG) BUILD_BUG_ON(EXPR) #define BUILD_BUG_ON_INVALID(EXPR) ((void)sizeof((long)(EXPR))) +#define BUILD_BUG_ON_ZERO(EXPR) 0 #endif /* _LINUX_BUILD_BUG_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:14:27 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: build_bug.h Log Message: stub BUILD_BUG_ON_ZERO, from openbsd. This is a dual purpose macro that asserts but can also be used in expressions. Provide the expression implementation. Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/common/include/linux/build_bug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:48 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: build_bug.h Log Message: linux: Simplify build_bug.h and add static_assert. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/external/bsd/common/include/linux/build_bug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/build_bug.h diff -u src/sys/external/bsd/common/include/linux/build_bug.h:1.1 src/sys/external/bsd/common/include/linux/build_bug.h:1.2 --- src/sys/external/bsd/common/include/linux/build_bug.h:1.1 Sun Dec 19 11:10:41 2021 +++ src/sys/external/bsd/common/include/linux/build_bug.h Sun Dec 19 11:10:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: build_bug.h,v 1.1 2021/12/19 11:10:41 riastradh Exp $ */ +/* $NetBSD: build_bug.h,v 1.2 2021/12/19 11:10:48 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -31,17 +31,15 @@ #include -/* - * static_assert is violated with runtime-only compiler semantics in a few - * places. Instead of breaking the build, stop asserting these corner cases. - */ +/* Required to be false _or_ nonconstant. */ +#define BUILD_BUG_ON(EXPR) \ + CTASSERT(__builtin_choose_expr(__builtin_constant_p(EXPR), !(EXPR), 1)) -#define DRMCTASSERT(x) CTASSERT((__builtin_choose_expr( \ - __builtin_constant_p(x), (x), 1))) +/* Required to be constant _and_ true. XXX Should take optional message. */ +#define static_assert(EXPR) CTASSERT(EXPR) -#define BUILD_BUG() do {} while (0) -#define BUILD_BUG_ON(CONDITION) DRMCTASSERT(!(CONDITION)) -#define BUILD_BUG_ON_MSG(CONDITION,MSG) DRMCTASSERT(!(CONDITION)) +#define BUILD_BUG() do {} while (0) +#define BUILD_BUG_ON_MSG(EXPR,MSG) BUILD_BUG_ON(EXPR) #define BUILD_BUG_ON_INVALID(EXPR) ((void)sizeof((long)(EXPR))) #endif /* _LINUX_BUILD_BUG_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:48 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: build_bug.h Log Message: linux: Simplify build_bug.h and add static_assert. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/external/bsd/common/include/linux/build_bug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:18 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: workqueue.h Log Message: stub struct rcu_work Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 \ src/sys/external/bsd/common/include/linux/workqueue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/workqueue.h diff -u src/sys/external/bsd/common/include/linux/workqueue.h:1.22 src/sys/external/bsd/common/include/linux/workqueue.h:1.23 --- src/sys/external/bsd/common/include/linux/workqueue.h:1.22 Sun Dec 19 11:03:49 2021 +++ src/sys/external/bsd/common/include/linux/workqueue.h Sun Dec 19 11:10:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: workqueue.h,v 1.22 2021/12/19 11:03:49 riastradh Exp $ */ +/* $NetBSD: workqueue.h,v 1.23 2021/12/19 11:10:17 riastradh Exp $ */ /*- * Copyright (c) 2013, 2018 The NetBSD Foundation, Inc. @@ -87,6 +87,9 @@ struct delayed_work { }dw_state; }; +struct rcu_work { +}; + #define WQ_FREEZABLE __BIT(0) #define WQ_HIGHPRI __BIT(1) #define WQ_MEM_RECLAIM __BIT(2)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:18 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: workqueue.h Log Message: stub struct rcu_work Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 \ src/sys/external/bsd/common/include/linux/workqueue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:01 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h Added Files: src/sys/external/bsd/common/include/linux: stddef.h Log Message: linux: Add offsetofend. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/common/include/linux/compiler.h cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/linux/stddef.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/compiler.h diff -u src/sys/external/bsd/common/include/linux/compiler.h:1.4 src/sys/external/bsd/common/include/linux/compiler.h:1.5 --- src/sys/external/bsd/common/include/linux/compiler.h:1.4 Sun Dec 19 01:41:21 2021 +++ src/sys/external/bsd/common/include/linux/compiler.h Sun Dec 19 11:10:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: compiler.h,v 1.4 2021/12/19 01:41:21 riastradh Exp $ */ +/* $NetBSD: compiler.h,v 1.5 2021/12/19 11:10:01 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -35,6 +35,8 @@ #include #include +#include + #include #define __printf __printflike Added files: Index: src/sys/external/bsd/common/include/linux/stddef.h diff -u /dev/null src/sys/external/bsd/common/include/linux/stddef.h:1.1 --- /dev/null Sun Dec 19 11:10:01 2021 +++ src/sys/external/bsd/common/include/linux/stddef.h Sun Dec 19 11:10:01 2021 @@ -0,0 +1,37 @@ +/* $NetBSD: stddef.h,v 1.1 2021/12/19 11:10:01 riastradh Exp $ */ + +/*- + * Copyright (c) 2020 The NetBSD Foundation, Inc. + * All rights reserved. + * + * 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. + * + * 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. + */ + +#ifndef _LINUX_STDDEF_H_ +#define _LINUX_STDDEF_H_ + +#include + +#define sizeof_field(T, F) sizeof(((T *)0)->F) +#define offsetofend(T, F) (offsetof(T, F) + sizeof_field(T, F)) + +#endif /* _LINUX_STDDEF_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:01 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h Added Files: src/sys/external/bsd/common/include/linux: stddef.h Log Message: linux: Add offsetofend. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/common/include/linux/compiler.h cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/linux/stddef.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:03:49 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: workqueue.h Log Message: Side-load linux/stringify.h in linux/workqueue.h. (via linux/timer.h upstream) To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 \ src/sys/external/bsd/common/include/linux/workqueue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/workqueue.h diff -u src/sys/external/bsd/common/include/linux/workqueue.h:1.21 src/sys/external/bsd/common/include/linux/workqueue.h:1.22 --- src/sys/external/bsd/common/include/linux/workqueue.h:1.21 Sun Dec 19 01:51:02 2021 +++ src/sys/external/bsd/common/include/linux/workqueue.h Sun Dec 19 11:03:49 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: workqueue.h,v 1.21 2021/12/19 01:51:02 riastradh Exp $ */ +/* $NetBSD: workqueue.h,v 1.22 2021/12/19 11:03:49 riastradh Exp $ */ /*- * Copyright (c) 2013, 2018 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ #include #include /* container_of */ +#include #define INIT_DELAYED_WORK linux_INIT_DELAYED_WORK #define INIT_WORK linux_INIT_WORK
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:03:49 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: workqueue.h Log Message: Side-load linux/stringify.h in linux/workqueue.h. (via linux/timer.h upstream) To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 \ src/sys/external/bsd/common/include/linux/workqueue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:03:32 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: gfp.h Log Message: gfpflags_allow_blocking To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/common/include/linux/gfp.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/gfp.h diff -u src/sys/external/bsd/common/include/linux/gfp.h:1.2 src/sys/external/bsd/common/include/linux/gfp.h:1.3 --- src/sys/external/bsd/common/include/linux/gfp.h:1.2 Sun Dec 19 01:24:43 2021 +++ src/sys/external/bsd/common/include/linux/gfp.h Sun Dec 19 11:03:32 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gfp.h,v 1.2 2021/12/19 01:24:43 riastradh Exp $ */ +/* $NetBSD: gfp.h,v 1.3 2021/12/19 11:03:32 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -78,4 +78,10 @@ typedef int gfp_t; struct page; +static inline bool +gfpflags_allow_blocking(gfp_t gfp) +{ + return (gfp & (__GFP_WAIT|__GFP_NORETRY)) == __GFP_WAIT; +} + #endif /* _LINUX_GFP_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:03:32 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: gfp.h Log Message: gfpflags_allow_blocking To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/common/include/linux/gfp.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:59:27 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: errno.h Log Message: EHWPOISON To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/common/include/linux/errno.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/errno.h diff -u src/sys/external/bsd/common/include/linux/errno.h:1.4 src/sys/external/bsd/common/include/linux/errno.h:1.5 --- src/sys/external/bsd/common/include/linux/errno.h:1.4 Tue Apr 16 10:00:04 2019 +++ src/sys/external/bsd/common/include/linux/errno.h Sun Dec 19 10:59:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: errno.h,v 1.4 2019/04/16 10:00:04 mrg Exp $ */ +/* $NetBSD: errno.h,v 1.5 2021/12/19 10:59:27 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -50,5 +50,6 @@ #define ENOTSUPP ENOTSUP /* XXX ??? */ #define EREMOTEIO EIO /* XXX Urk... */ #define ECHRNG ERANGE /* XXX ??? */ +#define EHWPOISON EIO #endif /* _LINUX_ERRNO_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:59:27 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: errno.h Log Message: EHWPOISON To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/common/include/linux/errno.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:57:05 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: printk.h Log Message: pr_info_ratelimited, not really To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/common/include/linux/printk.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/printk.h diff -u src/sys/external/bsd/common/include/linux/printk.h:1.9 src/sys/external/bsd/common/include/linux/printk.h:1.10 --- src/sys/external/bsd/common/include/linux/printk.h:1.9 Sun Dec 19 09:42:27 2021 +++ src/sys/external/bsd/common/include/linux/printk.h Sun Dec 19 10:57:05 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: printk.h,v 1.9 2021/12/19 09:42:27 riastradh Exp $ */ +/* $NetBSD: printk.h,v 1.10 2021/12/19 10:57:05 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -43,6 +43,7 @@ #define pr_cont printf /* XXX */ #define pr_info printf /* XXX */ #define pr_info_once printf /* XXX */ +#define pr_info_ratelimited printf /* XXX */ #define pr_warn printf /* XXX */ #define pr_warn_once printf /* XXX */ #define pr_notice printf /* XXX */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:57:05 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: printk.h Log Message: pr_info_ratelimited, not really To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/common/include/linux/printk.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:51:17 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: ALIGN_DOWN seems to be an alias for round_down. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.38 src/sys/external/bsd/common/include/linux/kernel.h:1.39 --- src/sys/external/bsd/common/include/linux/kernel.h:1.38 Sun Dec 19 01:41:21 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Sun Dec 19 10:51:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.38 2021/12/19 01:41:21 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.39 2021/12/19 10:51:17 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -117,6 +117,8 @@ #define IS_ALIGNED(X, N) (((X) & ((N) - 1)) == 0) +#define ALIGN_DOWN(X, N) round_down(X, N) + /* * These select 32-bit halves of what may be 32- or 64-bit quantities, * for which straight 32-bit shifts may be undefined behaviour (and do
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:51:17 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: ALIGN_DOWN seems to be an alias for round_down. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:51:09 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: list_for_each_entry_from_reverse To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.26 src/sys/external/bsd/common/include/linux/list.h:1.27 --- src/sys/external/bsd/common/include/linux/list.h:1.26 Sun Dec 19 10:39:35 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 10:51:09 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.26 2021/12/19 10:39:35 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.27 2021/12/19 10:51:09 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -307,6 +307,11 @@ list_del_init(struct list_head *node) (&(VAR)->FIELD != (HEAD));\ (VAR) = list_next_entry((VAR), FIELD)) +#define list_for_each_entry_from_reverse(VAR, HEAD, FIELD) \ + for (;\ + (&(VAR)->FIELD != (HEAD));\ + (VAR) = list_prev_entry((VAR), FIELD)) + #define list_for_each_entry_safe_from(VAR, NEXT, HEAD, FIELD) \ for (;\ (&(VAR)->FIELD != (HEAD)) &&\
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:51:09 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: list_for_each_entry_from_reverse To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:47:19 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: rcupdate.h Log Message: Simplify rcu_* definitions with atomic_load/store_*. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/common/include/linux/rcupdate.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/rcupdate.h diff -u src/sys/external/bsd/common/include/linux/rcupdate.h:1.3 src/sys/external/bsd/common/include/linux/rcupdate.h:1.4 --- src/sys/external/bsd/common/include/linux/rcupdate.h:1.3 Sun Dec 19 09:48:29 2021 +++ src/sys/external/bsd/common/include/linux/rcupdate.h Sun Dec 19 10:47:19 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rcupdate.h,v 1.3 2021/12/19 09:48:29 riastradh Exp $ */ +/* $NetBSD: rcupdate.h,v 1.4 2021/12/19 10:47:19 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -42,17 +42,9 @@ #define RCU_INIT_POINTER(P, V) ((P) = (V)) -#define rcu_assign_pointer(P, V) do { \ - __typeof__(*(P)) *__rcu_assign_pointer_tmp = (V); \ - membar_exit(); \ - (P) = __rcu_assign_pointer_tmp; \ -} while (0) - -#define rcu_dereference(P) ({ \ - __typeof__(*(P)) *__rcu_dereference_tmp = (P); \ - membar_datadep_consumer(); \ - __rcu_dereference_tmp; \ -}) +#define rcu_assign_pointer(P,V) atomic_store_release(&(P), (V)) +#define rcu_dereference(P) atomic_load_consume(&(P)) +#define rcu_access_pointer(P) atomic_load_relaxed(&(P)) #define rcu_dereference_raw rcu_dereference @@ -61,11 +53,6 @@ (P); \ }) -#define rcu_access_pointer(P) ({ \ - __typeof__(*(P)) *__rcu_access_pointer_tmp = (P); \ - __insn_barrier(); \ - __rcu_access_pointer_tmp; \ -}) /* kill_dependency */ #define rcu_pointer_handoff(P) (P)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:47:19 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: rcupdate.h Log Message: Simplify rcu_* definitions with atomic_load/store_*. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/common/include/linux/rcupdate.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:35 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: list_bulk_move_tail To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.25 src/sys/external/bsd/common/include/linux/list.h:1.26 --- src/sys/external/bsd/common/include/linux/list.h:1.25 Sun Dec 19 10:39:28 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 10:39:35 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.25 2021/12/19 10:39:28 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.26 2021/12/19 10:39:35 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -214,6 +214,21 @@ list_move_tail(struct list_head *node, s } static inline void +list_bulk_move_tail(struct list_head *head, struct list_head *first, +struct list_head *last) +{ + + first->prev->next = last->next; + last->next->prev = first->prev; + + head->prev->next = first; + first->prev = head->prev; + + last->next = head; + head->prev = last; +} + +static inline void list_replace(struct list_head *old, struct list_head *new) { new->prev = old->prev;
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:35 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: list_bulk_move_tail To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:28 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: Omit outdated comment. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.24 src/sys/external/bsd/common/include/linux/list.h:1.25 --- src/sys/external/bsd/common/include/linux/list.h:1.24 Sun Dec 19 01:58:55 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 10:39:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.24 2021/12/19 01:58:55 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.25 2021/12/19 10:39:28 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -35,10 +35,6 @@ * - LIST_HEAD(x) means a declaration `struct list_head x = * LIST_HEAD_INIT(x)' in Linux, but something else in NetBSD. * Replace by the expansion. - * - * - The `_rcu' routines here are not actually pserialize(9)-safe. - * They need dependent read memory barriers added. Please fix this - * if you need to use them with pserialize(9). */ #ifndef _LINUX_LIST_H_
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:28 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: Omit outdated comment. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 09:49:47 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: bitops.h Log Message: provide BITS_PER_TYPE Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/common/include/linux/bitops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/bitops.h diff -u src/sys/external/bsd/common/include/linux/bitops.h:1.14 src/sys/external/bsd/common/include/linux/bitops.h:1.15 --- src/sys/external/bsd/common/include/linux/bitops.h:1.14 Sun Dec 19 09:44:27 2021 +++ src/sys/external/bsd/common/include/linux/bitops.h Sun Dec 19 09:49:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bitops.h,v 1.14 2021/12/19 09:44:27 riastradh Exp $ */ +/* $NetBSD: bitops.h,v 1.15 2021/12/19 09:49:47 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -106,8 +106,9 @@ sign_extend64(uint64_t x, unsigned n) #define BITS_TO_LONGS(n) \ roundup2((n), (sizeof(unsigned long) * CHAR_BIT)) -#define BITS_PER_BYTE NBBY -#define BITS_PER_LONG (__SIZEOF_LONG__ * CHAR_BIT) +#define BITS_PER_TYPE(type) (sizeof(type) * NBBY) +#define BITS_PER_BYTE NBBY +#define BITS_PER_LONG (__SIZEOF_LONG__ * CHAR_BIT) #define BIT(n) ((unsigned long)__BIT(n)) #define BIT_ULL(n) ((unsigned long long)__BIT(n))
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 09:49:47 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: bitops.h Log Message: provide BITS_PER_TYPE Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/common/include/linux/bitops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 09:48:29 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: rcupdate.h Log Message: linux/bug.h for WARN_ON Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/common/include/linux/rcupdate.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/rcupdate.h diff -u src/sys/external/bsd/common/include/linux/rcupdate.h:1.2 src/sys/external/bsd/common/include/linux/rcupdate.h:1.3 --- src/sys/external/bsd/common/include/linux/rcupdate.h:1.2 Sun Dec 19 01:46:01 2021 +++ src/sys/external/bsd/common/include/linux/rcupdate.h Sun Dec 19 09:48:29 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rcupdate.h,v 1.2 2021/12/19 01:46:01 riastradh Exp $ */ +/* $NetBSD: rcupdate.h,v 1.3 2021/12/19 09:48:29 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -36,6 +36,8 @@ #include #include +#include + #define __rcu #define RCU_INIT_POINTER(P, V) ((P) = (V))
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 09:48:29 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: rcupdate.h Log Message: linux/bug.h for WARN_ON Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/common/include/linux/rcupdate.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:59:55 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: bitops.h Log Message: define BITS_PER_LONG. use compiler-defined macro instead of sizeof. Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/common/include/linux/bitops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/bitops.h diff -u src/sys/external/bsd/common/include/linux/bitops.h:1.12 src/sys/external/bsd/common/include/linux/bitops.h:1.13 --- src/sys/external/bsd/common/include/linux/bitops.h:1.12 Sun Dec 19 01:54:12 2021 +++ src/sys/external/bsd/common/include/linux/bitops.h Sun Dec 19 01:59:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bitops.h,v 1.12 2021/12/19 01:54:12 riastradh Exp $ */ +/* $NetBSD: bitops.h,v 1.13 2021/12/19 01:59:55 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -102,16 +102,11 @@ sign_extend64(uint64_t x, unsigned n) return (int64_t)(x << (63 - n)) >> (63 - n); } -/* - * XXX Don't define BITS_PER_LONG as sizeof(unsigned long)*CHAR_BIT - * because that won't work in preprocessor conditionals, where it often - * turns up. - */ - #define BITS_TO_LONGS(n) \ roundup2((n), (sizeof(unsigned long) * CHAR_BIT)) #define BITS_PER_BYTE NBBY +#define BITS_PER_LONG (__SIZEOF_LONG__ * CHAR_BIT) #define BIT(n) ((unsigned long)__BIT(n)) #define BIT_ULL(n) ((unsigned long long)__BIT(n))
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:59:55 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: bitops.h Log Message: define BITS_PER_LONG. use compiler-defined macro instead of sizeof. Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/common/include/linux/bitops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:58:55 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: provide list_for_each_entry_from (XXX needs review) Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.23 src/sys/external/bsd/common/include/linux/list.h:1.24 --- src/sys/external/bsd/common/include/linux/list.h:1.23 Sun Dec 19 01:57:57 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 01:58:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.23 2021/12/19 01:57:57 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.24 2021/12/19 01:58:55 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -291,6 +291,11 @@ list_del_init(struct list_head *node) &(VAR)->FIELD != (HEAD);\ (VAR) = list_prev_entry((VAR), FIELD)) +#define list_for_each_entry_from(VAR, HEAD, FIELD) \ + for (;\ + (&(VAR)->FIELD != (HEAD));\ + (VAR) = list_next_entry((VAR), FIELD)) + #define list_for_each_entry_safe_from(VAR, NEXT, HEAD, FIELD) \ for (;\ (&(VAR)->FIELD != (HEAD)) &&\
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:58:55 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: provide list_for_each_entry_from (XXX needs review) Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:57:57 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: provide list_is_first Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.22 src/sys/external/bsd/common/include/linux/list.h:1.23 --- src/sys/external/bsd/common/include/linux/list.h:1.22 Sun Dec 19 01:46:23 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 01:57:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.22 2021/12/19 01:46:23 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.23 2021/12/19 01:57:57 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -108,6 +108,13 @@ list_is_singular(const struct list_head } static inline bool +list_is_first(const struct list_head *entry, const struct list_head *head) +{ + return head == entry->prev; + +} + +static inline bool list_is_last(const struct list_head *entry, const struct list_head *head) { return head == entry->next;
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:57:57 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: provide list_is_first Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:57:42 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: sys/kernel.h for hardclock_ticks Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/completion.h diff -u src/sys/external/bsd/common/include/linux/completion.h:1.9 src/sys/external/bsd/common/include/linux/completion.h:1.10 --- src/sys/external/bsd/common/include/linux/completion.h:1.9 Sun Dec 19 01:57:27 2021 +++ src/sys/external/bsd/common/include/linux/completion.h Sun Dec 19 01:57:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: completion.h,v 1.9 2021/12/19 01:57:27 riastradh Exp $ */ +/* $NetBSD: completion.h,v 1.10 2021/12/19 01:57:42 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -48,6 +48,7 @@ #include #include +#include #include #include
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:57:42 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: sys/kernel.h for hardclock_ticks Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:57:27 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: sys/param.h for KASSERT etc Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/completion.h diff -u src/sys/external/bsd/common/include/linux/completion.h:1.8 src/sys/external/bsd/common/include/linux/completion.h:1.9 --- src/sys/external/bsd/common/include/linux/completion.h:1.8 Sun Dec 19 00:56:25 2021 +++ src/sys/external/bsd/common/include/linux/completion.h Sun Dec 19 01:57:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: completion.h,v 1.8 2021/12/19 00:56:25 riastradh Exp $ */ +/* $NetBSD: completion.h,v 1.9 2021/12/19 01:57:27 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -47,6 +47,7 @@ #define _LINUX_COMPLETION_H_ #include +#include #include #include
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:57:27 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: sys/param.h for KASSERT etc Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:54:12 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: bitops.h Log Message: Remove duplicate definition of BITS_PER_BYTE Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/common/include/linux/bitops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/bitops.h diff -u src/sys/external/bsd/common/include/linux/bitops.h:1.11 src/sys/external/bsd/common/include/linux/bitops.h:1.12 --- src/sys/external/bsd/common/include/linux/bitops.h:1.11 Sun Dec 19 01:33:59 2021 +++ src/sys/external/bsd/common/include/linux/bitops.h Sun Dec 19 01:54:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bitops.h,v 1.11 2021/12/19 01:33:59 riastradh Exp $ */ +/* $NetBSD: bitops.h,v 1.12 2021/12/19 01:54:12 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -108,7 +108,6 @@ sign_extend64(uint64_t x, unsigned n) * turns up. */ -#define BITS_PER_BYTE 8 #define BITS_TO_LONGS(n) \ roundup2((n), (sizeof(unsigned long) * CHAR_BIT))
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:54:12 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: bitops.h Log Message: Remove duplicate definition of BITS_PER_BYTE Author: Maya Rashish To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/common/include/linux/bitops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:46:23 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: list_is_last To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.21 src/sys/external/bsd/common/include/linux/list.h:1.22 --- src/sys/external/bsd/common/include/linux/list.h:1.21 Sun Dec 19 01:44:41 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 01:46:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.21 2021/12/19 01:44:41 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.22 2021/12/19 01:46:23 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -107,6 +107,12 @@ list_is_singular(const struct list_head return true; } +static inline bool +list_is_last(const struct list_head *entry, const struct list_head *head) +{ + return head == entry->next; +} + static inline void __list_add_between(struct list_head *prev, struct list_head *node, struct list_head *next)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:46:23 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: list_is_last To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:44:41 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: __list_del_entry, and poison list_del. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/list.h diff -u src/sys/external/bsd/common/include/linux/list.h:1.20 src/sys/external/bsd/common/include/linux/list.h:1.21 --- src/sys/external/bsd/common/include/linux/list.h:1.20 Sun Dec 19 01:19:37 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 01:44:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.20 2021/12/19 01:19:37 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.21 2021/12/19 01:44:41 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -130,13 +130,21 @@ list_add_tail(struct list_head *node, st } static inline void -list_del(struct list_head *entry) +__list_del_entry(struct list_head *entry) { entry->prev->next = entry->next; entry->next->prev = entry->prev; } static inline void +list_del(struct list_head *entry) +{ + __list_del_entry(entry); + entry->next = (void *)(uintptr_t)1; + entry->prev = (void *)(uintptr_t)2; +} + +static inline void __list_splice_between(struct list_head *prev, const struct list_head *list, struct list_head *next) {
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:44:41 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: __list_del_entry, and poison list_del. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/common/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:41:21 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h kernel.h Log Message: Move attributes, barrier(), and likely/unlikely to linux/compiler.h. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/common/include/linux/compiler.h cvs rdiff -u -r1.37 -r1.38 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/compiler.h diff -u src/sys/external/bsd/common/include/linux/compiler.h:1.3 src/sys/external/bsd/common/include/linux/compiler.h:1.4 --- src/sys/external/bsd/common/include/linux/compiler.h:1.3 Sun Dec 19 01:24:36 2021 +++ src/sys/external/bsd/common/include/linux/compiler.h Sun Dec 19 01:41:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: compiler.h,v 1.3 2021/12/19 01:24:36 riastradh Exp $ */ +/* $NetBSD: compiler.h,v 1.4 2021/12/19 01:41:21 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -33,9 +33,26 @@ #define _LINUX_COMPILER_H_ #include +#include #include +#define __printf __printflike +#define __user +#if __GNUC_PREREQ__(4,0) /* not sure when but this will work */ +#define __must_check __attribute__((warn_unused_result)) +#else +#define __must_check /* nothing */ +#endif +#define __always_unused __unused +#define __maybe_unused __unused +#define noinline __noinline +#define __deprecated /* nothing */ + +#define barrier() __insn_barrier() +#define likely(X) __predict_true(X) +#define unlikely(X) __predict_false(X) + #define READ_ONCE(X) ({ \ typeof(X) __read_once_tmp = (X); \ membar_datadep_consumer(); \ Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.37 src/sys/external/bsd/common/include/linux/kernel.h:1.38 --- src/sys/external/bsd/common/include/linux/kernel.h:1.37 Sun Dec 19 01:40:20 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Sun Dec 19 01:41:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.37 2021/12/19 01:40:20 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.38 2021/12/19 01:41:21 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -65,22 +65,6 @@ #define IS_ENABLED(option) (option) #define IS_REACHABLE(option) (option) -#define __printf __printflike -#define __user -#if __GNUC_PREREQ__(4,0) /* not sure when but this will work */ -#define __must_check __attribute__((warn_unused_result)) -#else -#define __must_check /* nothing */ -#endif -#define __always_unused __unused -#define __maybe_unused __unused -#define noinline __noinline -#define __deprecated /* nothing */ - -#define barrier() __insn_barrier() -#define likely(X) __predict_true(X) -#define unlikely(X) __predict_false(X) - #define might_sleep ASSERT_SLEEPABLE #define DEFINE_STATIC_KEY_FALSE(N) bool N __unused = false
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:41:21 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h kernel.h Log Message: Move attributes, barrier(), and likely/unlikely to linux/compiler.h. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/common/include/linux/compiler.h cvs rdiff -u -r1.37 -r1.38 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:41:12 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: workqueue.h Log Message: Stubs for init/destroy delayed work on stack. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 \ src/sys/external/bsd/common/include/linux/workqueue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/workqueue.h diff -u src/sys/external/bsd/common/include/linux/workqueue.h:1.19 src/sys/external/bsd/common/include/linux/workqueue.h:1.20 --- src/sys/external/bsd/common/include/linux/workqueue.h:1.19 Sun Dec 19 01:24:13 2021 +++ src/sys/external/bsd/common/include/linux/workqueue.h Sun Dec 19 01:41:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: workqueue.h,v 1.19 2021/12/19 01:24:13 riastradh Exp $ */ +/* $NetBSD: workqueue.h,v 1.20 2021/12/19 01:41:12 riastradh Exp $ */ /*- * Copyright (c) 2013, 2018 The NetBSD Foundation, Inc. @@ -133,6 +133,8 @@ struct work_struct * current_work(void); #define INIT_WORK_ONSTACK INIT_WORK +#define INIT_DELAYED_WORK_ONSTACK INIT_DELAYED_WORK +#define destroy_delayed_work_on_stack(dw) __nothing static inline void destroy_work_on_stack(struct work_struct *work)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:41:12 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: workqueue.h Log Message: Stubs for init/destroy delayed work on stack. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 \ src/sys/external/bsd/common/include/linux/workqueue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:41:04 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: srcu.h Log Message: Linux namespace for srcu. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/srcu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/srcu.h diff -u src/sys/external/bsd/common/include/linux/srcu.h:1.1 src/sys/external/bsd/common/include/linux/srcu.h:1.2 --- src/sys/external/bsd/common/include/linux/srcu.h:1.1 Sun Dec 19 01:37:27 2021 +++ src/sys/external/bsd/common/include/linux/srcu.h Sun Dec 19 01:41:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: srcu.h,v 1.1 2021/12/19 01:37:27 riastradh Exp $ */ +/* $NetBSD: srcu.h,v 1.2 2021/12/19 01:41:03 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -36,6 +36,13 @@ #include #include +/* namespace */ +#define srcu_fini linux_srcu_fini +#define srcu_init linux_srcu_init +#define srcu_read_lock linux_srcu_read_lock +#define srcu_read_unlock linux_srcu_read_unlock +#define synchronize_srcu linux_synchronize_srcu + struct lwp; struct percpu;
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:41:04 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: srcu.h Log Message: Linux namespace for srcu. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/srcu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:40:20 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: DEFINE_STATIC_KEY_FALSE To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.36 src/sys/external/bsd/common/include/linux/kernel.h:1.37 --- src/sys/external/bsd/common/include/linux/kernel.h:1.36 Sun Dec 19 01:39:12 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Sun Dec 19 01:40:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.36 2021/12/19 01:39:12 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.37 2021/12/19 01:40:20 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -83,6 +83,8 @@ #define might_sleep ASSERT_SLEEPABLE +#define DEFINE_STATIC_KEY_FALSE(N) bool N __unused = false + /* * XXX Linux kludge to work around GCC uninitialized variable warning. * Linux does `x = x', which is bollocks.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:40:20 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: DEFINE_STATIC_KEY_FALSE To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:39:12 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: __maybe_unused, typecheck To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.35 src/sys/external/bsd/common/include/linux/kernel.h:1.36 --- src/sys/external/bsd/common/include/linux/kernel.h:1.35 Sun Dec 19 01:24:57 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Sun Dec 19 01:39:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.35 2021/12/19 01:24:57 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.36 2021/12/19 01:39:12 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -73,6 +73,7 @@ #define __must_check /* nothing */ #endif #define __always_unused __unused +#define __maybe_unused __unused #define noinline __noinline #define __deprecated /* nothing */ @@ -88,6 +89,8 @@ */ #define uninitialized_var(x) x = 0 +#define typecheck(T, X) ({(1 + 0*sizeof((T *)0 - &(X)));}) + /* XXX These will multiply evaluate their arguments. */ #define min(X, Y) MIN(X, Y) #define max(X, Y) MAX(X, Y)
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:39:12 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: __maybe_unused, typecheck To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:39:06 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: Define kinda bogus ARCH_KMALLOC_MINALIGN that's probably enough. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/slab.h diff -u src/sys/external/bsd/common/include/linux/slab.h:1.3 src/sys/external/bsd/common/include/linux/slab.h:1.4 --- src/sys/external/bsd/common/include/linux/slab.h:1.3 Sun Dec 19 01:33:44 2021 +++ src/sys/external/bsd/common/include/linux/slab.h Sun Dec 19 01:39:05 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: slab.h,v 1.3 2021/12/19 01:33:44 riastradh Exp $ */ +/* $NetBSD: slab.h,v 1.4 2021/12/19 01:39:05 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -42,6 +42,8 @@ #include #include +#define ARCH_KMALLOC_MINALIGN 4 /* XXX ??? */ + /* XXX Should use kmem, but Linux kfree doesn't take the size. */ static inline int
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:39:06 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: slab.h Log Message: Define kinda bogus ARCH_KMALLOC_MINALIGN that's probably enough. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/common/include/linux/slab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:33:59 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: bitops.h Log Message: sign_extend64, GENMASK_ULL, for_each_clear_bit To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/common/include/linux/bitops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/bitops.h diff -u src/sys/external/bsd/common/include/linux/bitops.h:1.10 src/sys/external/bsd/common/include/linux/bitops.h:1.11 --- src/sys/external/bsd/common/include/linux/bitops.h:1.10 Sun Dec 19 01:04:12 2021 +++ src/sys/external/bsd/common/include/linux/bitops.h Sun Dec 19 01:33:59 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bitops.h,v 1.10 2021/12/19 01:04:12 riastradh Exp $ */ +/* $NetBSD: bitops.h,v 1.11 2021/12/19 01:33:59 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -96,6 +96,12 @@ hweight64(uint64_t n) return popcount64(n); } +static inline int64_t +sign_extend64(uint64_t x, unsigned n) +{ + return (int64_t)(x << (63 - n)) >> (63 - n); +} + /* * XXX Don't define BITS_PER_LONG as sizeof(unsigned long)*CHAR_BIT * because that won't work in preprocessor conditionals, where it often @@ -110,7 +116,8 @@ hweight64(uint64_t n) #define BIT(n) ((unsigned long)__BIT(n)) #define BIT_ULL(n) ((unsigned long long)__BIT(n)) -#define GENMASK(h,l) __BITS(h,l) +#define GENMASK(h,l) ((unsigned long)__BITS(h,l)) +#define GENMASK_ULL(h,l)((unsigned long long)__BITS(h,l)) static inline int test_bit(unsigned int n, const volatile unsigned long *p) @@ -275,4 +282,9 @@ find_first_zero_bit(const unsigned long (BIT) < (NBITS); \ (BIT) = find_next_bit((PTR), (NBITS), (BIT) + 1)) +#define for_each_clear_bit(BIT, PTR, NBITS) \ + for ((BIT) = find_first_zero_bit((PTR), (NBITS)); \ + (BIT) < (NBITS); \ + (BIT) = find_next_zero_bit((PTR), (NBITS), (BIT) + 1)) + #endif /* _LINUX_BITOPS_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 01:33:59 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: bitops.h Log Message: sign_extend64, GENMASK_ULL, for_each_clear_bit To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/common/include/linux/bitops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.