diff options
48 files changed, 59 insertions, 51 deletions
diff --git a/Makefrag.am b/Makefrag.am index e9d4e63..0fabdc2 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 bba2b8c..0af1ae7 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 65329a0..bfa22af 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 eaa43ae..7c60849 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 66178b3..d48cc30 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 6bd1d72..148a2a9 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 9084abc..52f9461 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 bf53ee1..c31c7e0 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 1de9b09..1aab9cc 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 5f45585..914ec9d 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 3de4fd2..e033b35 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 82b6c83..24fcace 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 cc8b80e..8fdc2fe 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 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> diff --git a/vm/vm_kmem.c b/vm/vm_kmem.c index 8a7272c..a9ba842 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 657f4b5..f506d3b 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 284964a..edf213e 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 139f1bf..fa018a0 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> |