diff options
author | Richard Braun <rbraun@sceen.net> | 2017-05-30 22:16:59 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-05-30 22:16:59 +0200 |
commit | 436fe6cb9711401fcc1f1d8fc29025f1aec5b774 (patch) | |
tree | 521e9c563f161e8faa6370372af26b3a4f5623ae | |
parent | 4eaa58c85eec654eb8bf8e002b3f3a419f5ce16b (diff) |
Move assert.h to the include directory
This turns assert.h into a standard header.
48 files changed, 59 insertions, 51 deletions
diff --git a/Makefrag.am b/Makefrag.am index e9d4e63e..0fabdc2d 100644 --- a/Makefrag.am +++ b/Makefrag.am @@ -4,13 +4,13 @@ include doc/Makefrag.am EXTRA_DIST += tools/qemu.sh x15_SOURCES += \ + include/assert.h \ include/stdio.h \ include/string.h x15_SOURCES += \ kern/arg.c \ kern/arg.h \ - kern/assert.h \ kern/atomic.h \ kern/bitmap.c \ kern/bitmap.h \ diff --git a/arch/x86/machine/acpimp.c b/arch/x86/machine/acpimp.c index bba2b8ca..0af1ae76 100644 --- a/arch/x86/machine/acpimp.c +++ b/arch/x86/machine/acpimp.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/init.h> #include <kern/kmem.h> #include <kern/macros.h> diff --git a/arch/x86/machine/biosmem.c b/arch/x86/machine/biosmem.c index 65329a06..bfa22afd 100644 --- a/arch/x86/machine/biosmem.c +++ b/arch/x86/machine/biosmem.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 <stdint.h> #include <stdio.h> #include <string.h> -#include <kern/assert.h> #include <kern/init.h> #include <kern/macros.h> #include <kern/panic.h> diff --git a/arch/x86/machine/cpu.c b/arch/x86/machine/cpu.c index eaa43ae7..7c608499 100644 --- a/arch/x86/machine/cpu.c +++ b/arch/x86/machine/cpu.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/init.h> #include <kern/macros.h> #include <kern/panic.h> diff --git a/arch/x86/machine/ioapic.c b/arch/x86/machine/ioapic.c index 66178b3a..d48cc307 100644 --- a/arch/x86/machine/ioapic.c +++ b/arch/x86/machine/ioapic.c @@ -15,11 +15,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> -#include <kern/assert.h> #include <kern/error.h> #include <kern/init.h> #include <kern/intr.h> diff --git a/arch/x86/machine/lapic.c b/arch/x86/machine/lapic.c index 6bd1d723..148a2a93 100644 --- a/arch/x86/machine/lapic.c +++ b/arch/x86/machine/lapic.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 <stdio.h> -#include <kern/assert.h> #include <kern/init.h> #include <kern/macros.h> #include <kern/panic.h> diff --git a/arch/x86/machine/pic.c b/arch/x86/machine/pic.c index 9084abce..52f9461a 100644 --- a/arch/x86/machine/pic.c +++ b/arch/x86/machine/pic.c @@ -15,9 +15,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/error.h> #include <kern/init.h> #include <kern/intr.h> diff --git a/arch/x86/machine/pit.c b/arch/x86/machine/pit.c index bf53ee11..c31c7e0b 100644 --- a/arch/x86/machine/pit.c +++ b/arch/x86/machine/pit.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/init.h> #include <machine/io.h> #include <machine/pit.h> diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c index 1de9b093..1aab9cc8 100644 --- a/arch/x86/machine/pmap.c +++ b/arch/x86/machine/pmap.c @@ -18,11 +18,11 @@ * TODO Review locking. */ +#include <assert.h> #include <stddef.h> #include <stdio.h> #include <string.h> -#include <kern/assert.h> #include <kern/cpumap.h> #include <kern/error.h> #include <kern/init.h> diff --git a/arch/x86/machine/tcb.h b/arch/x86/machine/tcb.h index 5f455850..914ec9d7 100644 --- a/arch/x86/machine/tcb.h +++ b/arch/x86/machine/tcb.h @@ -21,7 +21,8 @@ #ifndef _X86_TCB_H #define _X86_TCB_H -#include <kern/assert.h> +#include <assert.h> + #include <kern/macros.h> #include <machine/cpu.h> diff --git a/arch/x86/machine/trap.c b/arch/x86/machine/trap.c index 3de4fd26..e033b352 100644 --- a/arch/x86/machine/trap.c +++ b/arch/x86/machine/trap.c @@ -19,10 +19,10 @@ * additional configuration and resources to be properly handled. */ +#include <assert.h> #include <stdint.h> #include <stdio.h> -#include <kern/assert.h> #include <kern/atomic.h> #include <kern/init.h> #include <kern/macros.h> diff --git a/arch/x86/machine/uart.c b/arch/x86/machine/uart.c index 82b6c83b..24fcace4 100644 --- a/arch/x86/machine/uart.c +++ b/arch/x86/machine/uart.c @@ -18,10 +18,10 @@ * TODO Make serial line parameters configurable. */ +#include <assert.h> #include <stdint.h> #include <stdio.h> -#include <kern/assert.h> #include <kern/console.h> #include <kern/error.h> #include <kern/init.h> diff --git a/kern/assert.h b/include/assert.h index cc8b80ea..8fdc2fe2 100644 --- a/kern/assert.h +++ b/include/assert.h @@ -15,8 +15,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _KERN_ASSERT_H -#define _KERN_ASSERT_H +#ifndef _ASSERT_H +#define _ASSERT_H #define static_assert _Static_assert @@ -40,4 +40,4 @@ MACRO_END #endif /* NDEBUG */ -#endif /* _KERN_ASSERT_H */ +#endif /* _ASSERT_H */ @@ -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/cbuf.c b/kern/cbuf.c index 17369afe..5c636e56 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 4a837f4e..c8ea5f39 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 c82e7dc9..e8c0c28a 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 108d4b46..db399960 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 5cce5589..1f822b8a 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 1942576d..1c5086f3 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 6bc1bf1d..12e2861c 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 0a3768a7..ebcf2f38 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 1100b77d..d09a7bbe 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 a4a40eb5..3b36dcde 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 5e4ff827..a1f7df15 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 59959518..d6a8d1ab 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 e2ea54ad..adce033a 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 38083427..4ae8353f 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 99722977..944148e0 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 788f3ba8..b518c7f6 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 6f639ddf..09f011c4 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 f64274d7..ec79afa9 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 2f2cc17f..984cfd16 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 d7219b4f..e08927ec 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 54985062..acd7cd48 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 09548db6..f5fa6729 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 3ec36b36..6b9f2788 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 45018033..c9dcdd10 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 3f399a30..95e697a4 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 e6875586..68aa7285 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 62708268..e348fe39 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 7b27d841..78532fb5 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 714af35c..738ab8b6 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 364ad0be..ce22aa0f 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> diff --git a/vm/vm_kmem.c b/vm/vm_kmem.c index 8a7272cb..a9ba842d 100644 --- a/vm/vm_kmem.c +++ b/vm/vm_kmem.c @@ -18,10 +18,10 @@ * TODO Rework so that pmap update errors can be handled. */ +#include <assert.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/cpumap.h> #include <kern/init.h> #include <kern/panic.h> diff --git a/vm/vm_map.c b/vm/vm_map.c index 657f4b59..f506d3ba 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -19,11 +19,11 @@ * needed for kernel allocation. */ +#include <assert.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> -#include <kern/assert.h> #include <kern/error.h> #include <kern/init.h> #include <kern/kmem.h> diff --git a/vm/vm_page.c b/vm/vm_page.c index 284964a4..edf213ef 100644 --- a/vm/vm_page.c +++ b/vm/vm_page.c @@ -29,13 +29,13 @@ * The symmetric case is handled likewise. */ +#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/list.h> #include <kern/macros.h> diff --git a/vm/vm_page.h b/vm/vm_page.h index 139f1bff..fa018a05 100644 --- a/vm/vm_page.h +++ b/vm/vm_page.h @@ -21,10 +21,10 @@ #ifndef _VM_VM_PAGE_H #define _VM_VM_PAGE_H +#include <assert.h> #include <stddef.h> #include <stdint.h> -#include <kern/assert.h> #include <kern/list.h> #include <kern/log2.h> #include <kern/macros.h> |