diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/arg.c | 2 | ||||
-rw-r--r-- | kern/assert.h | 43 | ||||
-rw-r--r-- | kern/cbuf.c | 3 | ||||
-rw-r--r-- | kern/condition.c | 2 | ||||
-rw-r--r-- | kern/console.c | 2 | ||||
-rw-r--r-- | kern/hash.h | 3 | ||||
-rw-r--r-- | kern/kmem.c | 2 | ||||
-rw-r--r-- | kern/llsync.c | 2 | ||||
-rw-r--r-- | kern/llsync_i.h | 3 | ||||
-rw-r--r-- | kern/log2.h | 3 | ||||
-rw-r--r-- | kern/mutex.h | 3 | ||||
-rw-r--r-- | kern/mutex_i.h | 3 | ||||
-rw-r--r-- | kern/percpu.c | 2 | ||||
-rw-r--r-- | kern/percpu.h | 2 | ||||
-rw-r--r-- | kern/rbtree.c | 2 | ||||
-rw-r--r-- | kern/rbtree.h | 2 | ||||
-rw-r--r-- | kern/rbtree_i.h | 2 | ||||
-rw-r--r-- | kern/rdxtree.c | 2 | ||||
-rw-r--r-- | kern/rtmutex.c | 2 | ||||
-rw-r--r-- | kern/rtmutex.h | 2 | ||||
-rw-r--r-- | kern/rtmutex_i.h | 2 | ||||
-rw-r--r-- | kern/semaphore.h | 3 | ||||
-rw-r--r-- | kern/semaphore_i.h | 3 | ||||
-rw-r--r-- | kern/sleepq.c | 2 | ||||
-rw-r--r-- | kern/spinlock.c | 2 | ||||
-rw-r--r-- | kern/spinlock_i.h | 2 | ||||
-rw-r--r-- | kern/sref.c | 2 | ||||
-rw-r--r-- | kern/thread.c | 2 | ||||
-rw-r--r-- | kern/thread.h | 2 | ||||
-rw-r--r-- | kern/turnstile.c | 2 | ||||
-rw-r--r-- | kern/work.c | 2 | ||||
-rw-r--r-- | kern/xcall.c | 2 |
32 files changed, 38 insertions, 75 deletions
@@ -15,13 +15,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <string.h> #include <kern/arg.h> -#include <kern/assert.h> #include <kern/init.h> #include <kern/macros.h> #include <kern/panic.h> diff --git a/kern/assert.h b/kern/assert.h deleted file mode 100644 index cc8b80e..0000000 --- a/kern/assert.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010 Richard Braun. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef _KERN_ASSERT_H -#define _KERN_ASSERT_H - -#define static_assert _Static_assert - -#ifdef NDEBUG -#define assert(expression) ((void)(expression)) -#else /* NDEBUG */ - -#include <kern/macros.h> -#include <kern/panic.h> - -/* - * Panic if the given expression is false. - */ -#define assert(expression) \ -MACRO_BEGIN \ - if (unlikely(!(expression))) { \ - panic("assertion (%s) failed in %s:%d, function %s()", \ - __QUOTE(expression), __FILE__, __LINE__, __func__); \ - } \ -MACRO_END - -#endif /* NDEBUG */ - -#endif /* _KERN_ASSERT_H */ diff --git a/kern/cbuf.c b/kern/cbuf.c index 17369af..5c636e5 100644 --- a/kern/cbuf.c +++ b/kern/cbuf.c @@ -15,7 +15,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <kern/assert.h> +#include <assert.h> + #include <kern/cbuf.h> #include <kern/error.h> #include <kern/macros.h> diff --git a/kern/condition.c b/kern/condition.c index 4a837f4..c8ea5f3 100644 --- a/kern/condition.c +++ b/kern/condition.c @@ -18,10 +18,10 @@ * Locking order : mutex -> sleep queue */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> -#include <kern/assert.h> #include <kern/condition.h> #include <kern/condition_types.h> #include <kern/mutex.h> diff --git a/kern/console.c b/kern/console.c index c82e7dc..e8c0c28 100644 --- a/kern/console.c +++ b/kern/console.c @@ -15,13 +15,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <string.h> #include <kern/arg.h> -#include <kern/assert.h> #include <kern/error.h> #include <kern/init.h> #include <kern/console.h> diff --git a/kern/hash.h b/kern/hash.h index 108d4b4..db39996 100644 --- a/kern/hash.h +++ b/kern/hash.h @@ -39,11 +39,10 @@ #ifndef _KERN_HASH_H #define _KERN_HASH_H +#include <assert.h> #include <stdint.h> #include <string.h> -#include <kern/assert.h> - #ifdef __LP64__ #define HASH_ALLBITS 64 #define hash_long(n, bits) hash_int64(n, bits) diff --git a/kern/kmem.c b/kern/kmem.c index 5cce558..1f822b8 100644 --- a/kern/kmem.c +++ b/kern/kmem.c @@ -41,13 +41,13 @@ * TODO Rework the CPU pool layer to use the SLQB algorithm by Nick Piggin. */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <string.h> -#include <kern/assert.h> #include <kern/init.h> #include <kern/limits.h> #include <kern/list.h> diff --git a/kern/llsync.c b/kern/llsync.c index 1942576..1c5086f 100644 --- a/kern/llsync.c +++ b/kern/llsync.c @@ -32,11 +32,11 @@ * TODO Gracefully handle large amounts of deferred works. */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> -#include <kern/assert.h> #include <kern/condition.h> #include <kern/cpumap.h> #include <kern/init.h> diff --git a/kern/llsync_i.h b/kern/llsync_i.h index 6bc1bf1..12e2861 100644 --- a/kern/llsync_i.h +++ b/kern/llsync_i.h @@ -18,7 +18,8 @@ #ifndef _KERN_LLSYNC_I_H #define _KERN_LLSYNC_I_H -#include <kern/assert.h> +#include <assert.h> + #include <kern/cpumap.h> #include <kern/macros.h> #include <kern/param.h> diff --git a/kern/log2.h b/kern/log2.h index 0a3768a..ebcf2f3 100644 --- a/kern/log2.h +++ b/kern/log2.h @@ -21,7 +21,8 @@ #ifndef _KERN_LOG2_H #define _KERN_LOG2_H -#include <kern/assert.h> +#include <assert.h> + #include <kern/limits.h> static inline unsigned int diff --git a/kern/mutex.h b/kern/mutex.h index 1100b77..d09a7bb 100644 --- a/kern/mutex.h +++ b/kern/mutex.h @@ -68,7 +68,8 @@ mutex_unlock(struct mutex *mutex) #else /* X15_MUTEX_PI */ -#include <kern/assert.h> +#include <assert.h> + #include <kern/error.h> #include <kern/macros.h> #include <kern/mutex_i.h> diff --git a/kern/mutex_i.h b/kern/mutex_i.h index a4a40eb..3b36dcd 100644 --- a/kern/mutex_i.h +++ b/kern/mutex_i.h @@ -20,7 +20,8 @@ #ifndef X15_MUTEX_PI -#include <kern/assert.h> +#include <assert.h> + #include <kern/atomic.h> #include <kern/mutex_types.h> diff --git a/kern/percpu.c b/kern/percpu.c index 5e4ff82..a1f7df1 100644 --- a/kern/percpu.c +++ b/kern/percpu.c @@ -15,12 +15,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <string.h> -#include <kern/assert.h> #include <kern/error.h> #include <kern/init.h> #include <kern/macros.h> diff --git a/kern/percpu.h b/kern/percpu.h index 5995951..d6a8d1a 100644 --- a/kern/percpu.h +++ b/kern/percpu.h @@ -53,9 +53,9 @@ #ifndef _KERN_PERCPU_H #define _KERN_PERCPU_H +#include <assert.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/macros.h> #define PERCPU_SECTION .percpu diff --git a/kern/rbtree.c b/kern/rbtree.c index e2ea54a..adce033 100644 --- a/kern/rbtree.c +++ b/kern/rbtree.c @@ -15,10 +15,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/macros.h> #include <kern/rbtree.h> #include <kern/rbtree_i.h> diff --git a/kern/rbtree.h b/kern/rbtree.h index 3808342..4ae8353 100644 --- a/kern/rbtree.h +++ b/kern/rbtree.h @@ -21,10 +21,10 @@ #ifndef _KERN_RBTREE_H #define _KERN_RBTREE_H +#include <assert.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/macros.h> /* diff --git a/kern/rbtree_i.h b/kern/rbtree_i.h index 9972297..944148e 100644 --- a/kern/rbtree_i.h +++ b/kern/rbtree_i.h @@ -18,10 +18,10 @@ #ifndef _KERN_RBTREE_I_H #define _KERN_RBTREE_I_H +#include <assert.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/macros.h> /* diff --git a/kern/rdxtree.c b/kern/rdxtree.c index 788f3ba..b518c7f 100644 --- a/kern/rdxtree.c +++ b/kern/rdxtree.c @@ -15,12 +15,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <string.h> -#include <kern/assert.h> #include <kern/error.h> #include <kern/kmem.h> #include <kern/limits.h> diff --git a/kern/rtmutex.c b/kern/rtmutex.c index 6f639dd..09f011c 100644 --- a/kern/rtmutex.c +++ b/kern/rtmutex.c @@ -15,10 +15,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/atomic.h> #include <kern/rtmutex.h> #include <kern/rtmutex_i.h> diff --git a/kern/rtmutex.h b/kern/rtmutex.h index f64274d..ec79afa 100644 --- a/kern/rtmutex.h +++ b/kern/rtmutex.h @@ -24,9 +24,9 @@ #ifndef _KERN_RTMUTEX_H #define _KERN_RTMUTEX_H +#include <assert.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/error.h> #include <kern/macros.h> #include <kern/rtmutex_i.h> diff --git a/kern/rtmutex_i.h b/kern/rtmutex_i.h index 2f2cc17..984cfd1 100644 --- a/kern/rtmutex_i.h +++ b/kern/rtmutex_i.h @@ -18,10 +18,10 @@ #ifndef _KERN_RTMUTEX_I_H #define _KERN_RTMUTEX_I_H +#include <assert.h> #include <stdbool.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/atomic.h> #include <kern/rtmutex_types.h> #include <kern/thread.h> diff --git a/kern/semaphore.h b/kern/semaphore.h index d7219b4..e08927e 100644 --- a/kern/semaphore.h +++ b/kern/semaphore.h @@ -32,7 +32,8 @@ #ifndef _KERN_SEMAPHORE_H #define _KERN_SEMAPHORE_H -#include <kern/assert.h> +#include <assert.h> + #include <kern/atomic.h> #include <kern/error.h> #include <kern/macros.h> diff --git a/kern/semaphore_i.h b/kern/semaphore_i.h index 5498506..acd7cd4 100644 --- a/kern/semaphore_i.h +++ b/kern/semaphore_i.h @@ -18,7 +18,8 @@ #ifndef _KERN_SEMAPHORE_I_H #define _KERN_SEMAPHORE_I_H -#include <kern/assert.h> +#include <assert.h> + #include <kern/atomic.h> struct semaphore { diff --git a/kern/sleepq.c b/kern/sleepq.c index 09548db..f5fa672 100644 --- a/kern/sleepq.c +++ b/kern/sleepq.c @@ -18,11 +18,11 @@ * TODO Analyse hash parameters. */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/init.h> #include <kern/kmem.h> #include <kern/list.h> diff --git a/kern/spinlock.c b/kern/spinlock.c index 3ec36b3..6b9f278 100644 --- a/kern/spinlock.c +++ b/kern/spinlock.c @@ -53,9 +53,9 @@ * more contention, an operation called downgrading. */ +#include <assert.h> #include <stddef.h> -#include <kern/assert.h> #include <kern/atomic.h> #include <kern/error.h> #include <kern/macros.h> diff --git a/kern/spinlock_i.h b/kern/spinlock_i.h index 4501803..c9dcdd1 100644 --- a/kern/spinlock_i.h +++ b/kern/spinlock_i.h @@ -18,10 +18,10 @@ #ifndef _KERN_SPINLOCK_I_H #define _KERN_SPINLOCK_I_H +#include <assert.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/atomic.h> #include <kern/error.h> #include <kern/macros.h> diff --git a/kern/sref.c b/kern/sref.c index 3f399a3..95e697a 100644 --- a/kern/sref.c +++ b/kern/sref.c @@ -41,11 +41,11 @@ * TODO Reconsider whether it's possible to bring back local review queues. */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> -#include <kern/assert.h> #include <kern/condition.h> #include <kern/cpumap.h> #include <kern/error.h> diff --git a/kern/thread.c b/kern/thread.c index e687558..68aa728 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -81,13 +81,13 @@ * weights in a smoother way than a raw scaling). */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <string.h> -#include <kern/assert.h> #include <kern/atomic.h> #include <kern/condition.h> #include <kern/cpumap.h> diff --git a/kern/thread.h b/kern/thread.h index 6270826..e348fe3 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -33,10 +33,10 @@ #ifndef _KERN_THREAD_H #define _KERN_THREAD_H +#include <assert.h> #include <stdbool.h> #include <stddef.h> -#include <kern/assert.h> #include <kern/atomic.h> #include <kern/condition.h> #include <kern/cpumap.h> diff --git a/kern/turnstile.c b/kern/turnstile.c index 7b27d84..78532fb 100644 --- a/kern/turnstile.c +++ b/kern/turnstile.c @@ -43,11 +43,11 @@ * TODO Analyse hash parameters. */ +#include <assert.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/init.h> #include <kern/kmem.h> #include <kern/list.h> diff --git a/kern/work.c b/kern/work.c index 714af35..738ab8b 100644 --- a/kern/work.c +++ b/kern/work.c @@ -15,10 +15,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stddef.h> #include <stdio.h> -#include <kern/assert.h> #include <kern/bitmap.h> #include <kern/error.h> #include <kern/init.h> diff --git a/kern/xcall.c b/kern/xcall.c index 364ad0b..ce22aa0 100644 --- a/kern/xcall.c +++ b/kern/xcall.c @@ -15,9 +15,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stddef.h> -#include <kern/assert.h> #include <kern/atomic.h> #include <kern/macros.h> #include <kern/param.h> |