diff options
author | Richard Braun <rbraun@sceen.net> | 2017-06-22 23:57:51 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-06-22 23:57:51 +0200 |
commit | 49f414edfa049023b5f68f272a1f2e512be4a598 (patch) | |
tree | 5a10faebffc3914c931fced056bc85e1257a9f79 /kern | |
parent | 71b302e2c41f7bfb92beda8961a6d57bef2bd14e (diff) |
kern/macros: move the __read_mostly macro here
Diffstat (limited to 'kern')
-rw-r--r-- | kern/cpumap.c | 2 | ||||
-rw-r--r-- | kern/llsync.c | 1 | ||||
-rw-r--r-- | kern/macros.h | 5 | ||||
-rw-r--r-- | kern/percpu.c | 1 | ||||
-rw-r--r-- | kern/task.c | 2 |
5 files changed, 7 insertions, 4 deletions
diff --git a/kern/cpumap.c b/kern/cpumap.c index 5582e681..e4ae864e 100644 --- a/kern/cpumap.c +++ b/kern/cpumap.c @@ -21,7 +21,7 @@ #include <kern/cpumap.h> #include <kern/error.h> #include <kern/kmem.h> -#include <kern/param.h> +#include <kern/macros.h> #include <machine/cpu.h> static struct cpumap cpumap_active_cpus __read_mostly = { { 1 } }; diff --git a/kern/llsync.c b/kern/llsync.c index 4704e806..e3398693 100644 --- a/kern/llsync.c +++ b/kern/llsync.c @@ -45,7 +45,6 @@ #include <kern/llsync_i.h> #include <kern/macros.h> #include <kern/mutex.h> -#include <kern/param.h> #include <kern/percpu.h> #include <kern/spinlock.h> #include <kern/syscnt.h> diff --git a/kern/macros.h b/kern/macros.h index 8f0d10ca..63ded053 100644 --- a/kern/macros.h +++ b/kern/macros.h @@ -25,6 +25,11 @@ #include <stddef.h> #endif /* __ASSEMBLER__ */ +/* + * Attributes for variables that are mostly read and seldom changed. + */ +#define __read_mostly __section(".data.read_mostly") + #define MACRO_BEGIN ({ #define MACRO_END }) diff --git a/kern/percpu.c b/kern/percpu.c index 805825a8..c21376f1 100644 --- a/kern/percpu.c +++ b/kern/percpu.c @@ -25,7 +25,6 @@ #include <kern/log.h> #include <kern/macros.h> #include <kern/panic.h> -#include <kern/param.h> #include <kern/percpu.h> #include <machine/cpu.h> #include <vm/vm_kmem.h> diff --git a/kern/task.c b/kern/task.c index a5281994..af3cb4c4 100644 --- a/kern/task.c +++ b/kern/task.c @@ -23,7 +23,7 @@ #include <kern/init.h> #include <kern/kmem.h> #include <kern/list.h> -#include <kern/param.h> +#include <kern/macros.h> #include <kern/shell.h> #include <kern/spinlock.h> #include <kern/task.h> |