diff options
author | Richard Braun <rbraun@sceen.net> | 2017-06-25 20:44:44 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-06-25 20:50:25 +0200 |
commit | 9ded7917da06dea7f7284648281fd5d827f8a9a4 (patch) | |
tree | 75ab1d8d1b4d89ceb6d17563367c40446c865521 /kern/work.c | |
parent | 5ee8402d3746e1e7831f6094aa07d29c5306b416 (diff) |
Use the C11 alignas and noreturn macros
Diffstat (limited to 'kern/work.c')
-rw-r--r-- | kern/work.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kern/work.c b/kern/work.c index 9925c198..5021d6f8 100644 --- a/kern/work.c +++ b/kern/work.c @@ -16,6 +16,7 @@ */ #include <assert.h> +#include <stdalign.h> #include <stddef.h> #include <kern/bitmap.h> @@ -84,7 +85,7 @@ struct work_thread { * only use one queue. */ struct work_pool { - struct spinlock lock; + alignas(CPU_L1_SIZE) struct spinlock lock; int flags; struct work_queue queue0; struct work_queue queue1; @@ -97,7 +98,7 @@ struct work_pool { struct list available_threads; struct list dead_threads; BITMAP_DECLARE(bitmap, WORK_MAX_THREADS); -} __aligned(CPU_L1_SIZE); +}; static int work_thread_create(struct work_pool *pool, unsigned int id); static void work_thread_destroy(struct work_thread *worker); |