summaryrefslogtreecommitdiff
path: root/kern/intr.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-06-25 20:44:44 +0200
committerRichard Braun <rbraun@sceen.net>2017-06-25 20:50:25 +0200
commit9ded7917da06dea7f7284648281fd5d827f8a9a4 (patch)
tree75ab1d8d1b4d89ceb6d17563367c40446c865521 /kern/intr.c
parent5ee8402d3746e1e7831f6094aa07d29c5306b416 (diff)
Use the C11 alignas and noreturn macros
Diffstat (limited to 'kern/intr.c')
-rw-r--r--kern/intr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kern/intr.c b/kern/intr.c
index 6590fca0..769f4d93 100644
--- a/kern/intr.c
+++ b/kern/intr.c
@@ -22,6 +22,7 @@
* Shared interrupts are supported.
*/
+#include <stdalign.h>
#include <stdbool.h>
#include <stddef.h>
@@ -39,10 +40,10 @@
#include <machine/trap.h>
struct intr_handler {
- struct list node;
+ alignas(CPU_L1_SIZE) struct list node;
intr_handler_fn_t fn;
void *arg;
-} __aligned(CPU_L1_SIZE);
+};
/*
* Interrupt controller.
@@ -67,11 +68,11 @@ struct intr_ctl {
* span a cache line to avoid false sharing.
*/
struct intr_entry {
- struct spinlock lock;
+ alignas(CPU_L1_SIZE) struct spinlock lock;
struct intr_ctl *ctl;
unsigned int cpu;
struct list handlers;
-} __aligned(CPU_L1_SIZE);
+};
/*
* Interrupt table.