On Mon, 28 Apr 2008 20:06:51 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:How about this? 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. Signed-off-by: Andres Salomon <dilinger@debian.org> --- arch/x86/kernel/geode_32.c | 19 +++++++++++++++++++ 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..1cb8225 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); +static int has_vsa2 = -1; + +int geode_has_vsa2(void) +{ + 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 */ -- 1.5.5 --
| Jesse Barnes | Re: 2.6.25-rc2 System no longer powers off after suspend-to-disk. Screen becomes g... |
| Mark Lord | Re: [Bug #10391] 2.6.25-rc7/8: Another resume regression |
| Jeremy Fitzhardinge | [PATCH 02 of 36] x86: add memory clobber to save/loadsegment |
| David Miller | Slow DOWN, please!!! |
git: | |
| Sam Vilain | [PATCH] git-mergetool: add support for ediff |
| Linus Torvalds | Re: Errors GITtifying GCC and Binutils |
| Bill Lear | Meaning of "fatal: protocol error: bad line length character"? |
| Johannes Schindelin | Re: A tour of git: the basics (and notes on some unfriendly messages) |
| Stephen Pierce | SLS |
| Rob Coleman | S3 |
| Tall Cool One | A few questions about Linux, in general. |
| Tony Gale | Re: UserAdd won't make home directory? |
| Richard Stallman | Real men don't attack straw men |
| Todd Pytel | IDE or SCSI virtual disks for VMWare image? |
| Amarendra Godbole | Anyone from this list at BlackHat or DefCon? And a query... |
| Karthik Kumar | Re: Ethernet jumbo frames? |
| magical mounts | 13 hours ago | Linux kernel |
| Problem in scim in Fedora 9 | 14 hours ago | Linux general |
| The new Western Digital power saving drives | 14 hours ago | Hardware |
| Battery Maximizer Software | 1 day ago | Linux kernel |
| windows folder creation surprise | 1 day ago | Windows |
| Firewall | 2 days ago | OpenBSD |
| IP layer send packet | 2 days ago | Linux kernel |
| dtrace for linux available | 3 days ago | Linux kernel |
| Unable to mount ramdisk image using UBoot while upgrading to 2.6.15 kernel for a MPC8540 based target | 3 days ago | Linux kernel |
| RealTek RTL8169 - can't connect | 3 days ago | NetBSD |
