mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle McMartin <kyle@parisc-linux.org>
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Move read_mostly definition to asm/cache.h
Date: Wed, 11 Jan 2006 12:33:21 -0500	[thread overview]
Message-ID: <20060111173321.GC28018@quicksilver.road.mcmartin.ca> (raw)

From: Kyle McMartin <kyle@parisc-linux.org>

Seems like needless clutter having a bunch of #if
defined(CONFIG_$ARCH) in include/linux/cache.h. Move the per
architecture section definition to asm/cache.h, and keep the
if-not-defined dummy case in linux/cache.h to catch architectures
which don't implement the section.

Verified that symbols still go in .data.read_mostly on parisc,
and the compile doesn't break.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>

---

I accidently committed this to an up-to-date master branch, as
I forgot to check out the temporary branch I was going to commit
it on. Swapping the sums from .git/refs/heads/{master,read_mostly}
wouldn't break anything, if the only different between the two was
this commit, right?

 include/asm-i386/cache.h    |    2 ++
 include/asm-ia64/cache.h    |    2 ++
 include/asm-parisc/cache.h  |    2 ++
 include/asm-sparc64/cache.h |    2 ++
 include/asm-x86_64/cache.h  |    2 ++
 include/linux/cache.h       |    4 +---
 6 files changed, 11 insertions(+), 3 deletions(-)

b7b3d524ba7fae865789ecc49b8ff660f5ef928b
diff --git a/include/asm-i386/cache.h b/include/asm-i386/cache.h
index 615911e..ca15c9c 100644
--- a/include/asm-i386/cache.h
+++ b/include/asm-i386/cache.h
@@ -10,4 +10,6 @@
 #define L1_CACHE_SHIFT	(CONFIG_X86_L1_CACHE_SHIFT)
 #define L1_CACHE_BYTES	(1 << L1_CACHE_SHIFT)
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 #endif
diff --git a/include/asm-ia64/cache.h b/include/asm-ia64/cache.h
index 40dd251..f0a104d 100644
--- a/include/asm-ia64/cache.h
+++ b/include/asm-ia64/cache.h
@@ -25,4 +25,6 @@
 # define SMP_CACHE_BYTES	(1 << 3)
 #endif
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 #endif /* _ASM_IA64_CACHE_H */
diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h
index 93f179f..ae50f8e 100644
--- a/include/asm-parisc/cache.h
+++ b/include/asm-parisc/cache.h
@@ -29,6 +29,8 @@
 
 #define SMP_CACHE_BYTES L1_CACHE_BYTES
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 extern void flush_data_cache_local(void *);  /* flushes local data-cache only */
 extern void flush_instruction_cache_local(void *); /* flushes local code-cache only */
 #ifdef CONFIG_SMP
diff --git a/include/asm-sparc64/cache.h b/include/asm-sparc64/cache.h
index f7d35a2..e9df17a 100644
--- a/include/asm-sparc64/cache.h
+++ b/include/asm-sparc64/cache.h
@@ -13,4 +13,6 @@
 #define        SMP_CACHE_BYTES_SHIFT	6
 #define        SMP_CACHE_BYTES		(1 << SMP_CACHE_BYTES_SHIFT) /* L2 cache line size. */
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 #endif
diff --git a/include/asm-x86_64/cache.h b/include/asm-x86_64/cache.h
index b4a2401..f06f33a 100644
--- a/include/asm-x86_64/cache.h
+++ b/include/asm-x86_64/cache.h
@@ -10,4 +10,6 @@
 #define L1_CACHE_SHIFT	(CONFIG_X86_L1_CACHE_SHIFT)
 #define L1_CACHE_BYTES	(1 << L1_CACHE_SHIFT)
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 #endif
diff --git a/include/linux/cache.h b/include/linux/cache.h
index d22e632..cc4b3aa 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,9 +13,7 @@
 #define SMP_CACHE_BYTES L1_CACHE_BYTES
 #endif
 
-#if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) || defined(CONFIG_PARISC)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
-#else
+#ifndef __read_mostly
 #define __read_mostly
 #endif
 
-- 
1.0.GIT

             reply	other threads:[~2006-01-11 17:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-11 17:33 Kyle McMartin [this message]
2006-01-11 17:52 ` Linus Torvalds
2006-01-11 21:20   ` Junio C Hamano
2006-01-12  5:36     ` Kyle McMartin
2006-01-15  9:48       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060111173321.GC28018@quicksilver.road.mcmartin.ca \
    --to=kyle@parisc-linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®