summaryrefslogtreecommitdiff
path: root/include/linux/cache.h
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2016-09-26 12:54:41 -0700
committerDmitry Shmidt <dimitrysh@google.com>2016-09-26 14:58:53 -0700
commit8760f8e3d9806a940d759c9e12fff7eb7130b9ab (patch)
tree3471f2a1dd633efdda95765f905ff2f3d4455175 /include/linux/cache.h
parent734bcf32c23442e81891641ae05e08108a4010d5 (diff)
parent4055d6b56ac1de5b900ce6f0b484996aa357ee66 (diff)
Merge remote-tracking branch 'common/android-4.4' into android-4.4.y
Change-Id: I6c4e7f9f47392d4b334f71e2b20f2ccf33827632
Diffstat (limited to 'include/linux/cache.h')
-rw-r--r--include/linux/cache.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/cache.h b/include/linux/cache.h
index 17e7e82d2aa7..1be04f8c563a 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -12,10 +12,24 @@
#define SMP_CACHE_BYTES L1_CACHE_BYTES
#endif
+/*
+ * __read_mostly is used to keep rarely changing variables out of frequently
+ * updated cachelines. If an architecture doesn't support it, ignore the
+ * hint.
+ */
#ifndef __read_mostly
#define __read_mostly
#endif
+/*
+ * __ro_after_init is used to mark things that are read-only after init (i.e.
+ * after mark_rodata_ro() has been called). These are effectively read-only,
+ * but may get written to during init, so can't live in .rodata (via "const").
+ */
+#ifndef __ro_after_init
+#define __ro_after_init __attribute__((__section__(".data..ro_after_init")))
+#endif
+
#ifndef ____cacheline_aligned
#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
#endif