diff options
author | Andres Salomon <dilinger@queued.net> | 2008-05-07 13:07:37 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-05-08 15:43:50 +0200 |
commit | 547acec7ecc32b14c2740de3f32ce7d1b36a0f69 (patch) | |
tree | c51565daaff629d6cdb1e8ddd5eb02158b59f6ec | |
parent | ac44cc96fbc8f44c056fa37573e8447eec512b10 (diff) | |
download | op-kernel-dev-547acec7ecc32b14c2740de3f32ce7d1b36a0f69.zip op-kernel-dev-547acec7ecc32b14c2740de3f32ce7d1b36a0f69.tar.gz |
x86: GEODE: cache results from geode_has_vsa2() and uninline
This moves geode_has_vsa2 into a .c file, caches the result we get from
the VSA virtual registers, and causes the function to no longer be inline.
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Andres Salomon <dilinger@debian.org>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/geode_32.c | 19 | ||||
-rw-r--r-- | include/asm-x86/geode.h | 11 |
2 files changed, 20 insertions, 10 deletions
diff --git a/arch/x86/kernel/geode_32.c b/arch/x86/kernel/geode_32.c index 9dad6ca..e8edd63 100644 --- a/arch/x86/kernel/geode_32.c +++ b/arch/x86/kernel/geode_32.c @@ -161,6 +161,25 @@ void geode_gpio_setup_event(unsigned int gpio, int pair, int pme) } EXPORT_SYMBOL_GPL(geode_gpio_setup_event); +int geode_has_vsa2(void) +{ + static int has_vsa2 = -1; + + if (has_vsa2 == -1) { + /* + * The VSA has virtual registers that we can query for a + * signature. + */ + outw(VSA_VR_UNLOCK, VSA_VRC_INDEX); + outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX); + + has_vsa2 = (inw(VSA_VRC_DATA) == VSA_SIG); + } + + return has_vsa2; +} +EXPORT_SYMBOL_GPL(geode_has_vsa2); + static int __init geode_southbridge_init(void) { if (!is_geode()) diff --git a/include/asm-x86/geode.h b/include/asm-x86/geode.h index 7154dc4..8a53bc8 100644 --- a/include/asm-x86/geode.h +++ b/include/asm-x86/geode.h @@ -185,16 +185,7 @@ static inline int is_geode(void) return (is_geode_gx() || is_geode_lx()); } -/* - * The VSA has virtual registers that we can query for a signature. - */ -static inline int geode_has_vsa2(void) -{ - outw(VSA_VR_UNLOCK, VSA_VRC_INDEX); - outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX); - - return (inw(VSA_VRC_DATA) == VSA_SIG); -} +extern int geode_has_vsa2(void); /* MFGPTs */ |