diff options
author | Jon Loeliger <jdl@freescale.com> | 2007-11-20 14:34:57 -0600 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-11-20 14:34:57 -0600 |
commit | 890e9413c0af74a3d74f37d9ab6d19784990fa0c (patch) | |
tree | 0e802d5d143e09751f85c76bf02f94aca023d077 /include/asm-mips/io.h | |
parent | 1d8a49eca1c7bdc8db1c47a92f9014a29ead03ae (diff) | |
parent | 9a337ddc154a10a26f117fd147b009abcdeba75a (diff) |
Merge commit 'remotes/wd/master'
Diffstat (limited to 'include/asm-mips/io.h')
-rw-r--r-- | include/asm-mips/io.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index cd4d5dc9d9..1e060f7c31 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h @@ -71,7 +71,21 @@ * instruction, so the lower 16 bits must be zero. Should be true on * on any sane architecture; generic code does not use this assumption. */ -extern unsigned long mips_io_port_base; +extern const unsigned long mips_io_port_base; + +/* + * Gcc will generate code to load the value of mips_io_port_base after each + * function call which may be fairly wasteful in some cases. So we don't + * play quite by the book. We tell gcc mips_io_port_base is a long variable + * which solves the code generation issue. Now we need to violate the + * aliasing rules a little to make initialization possible and finally we + * will need the barrier() to fight side effects of the aliasing chat. + * This trickery will eventually collapse under gcc's optimizer. Oh well. + */ +static inline void set_io_port_base(unsigned long base) +{ + * (unsigned long *) &mips_io_port_base = base; +} /* * Thanks to James van Artsdalen for a better timing-fix than |