Signed-off-by: Cyrill Gorcunov <[email protected]>
---
page.h | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
Index: linux-2.6.git/include/asm-avr32/page.h
===================================================================
--- linux-2.6.git.orig/include/asm-avr32/page.h 2008-01-21 19:35:27.000000000 +0300
+++ linux-2.6.git/include/asm-avr32/page.h 2008-02-03 12:42:51.000000000 +0300
@@ -10,13 +10,11 @@
#ifdef __KERNEL__
+#include <linux/const.h>
+
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
-#ifdef __ASSEMBLY__
-#define PAGE_SIZE (1 << PAGE_SHIFT)
-#else
-#define PAGE_SIZE (1UL << PAGE_SHIFT)
-#endif
+#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#define PTE_MASK PAGE_MASK
--
[removed bogus @atmel.co address from Cc]
On Sun, 03 Feb 2008 14:22:18 +0300
Cyrill Gorcunov <[email protected]> wrote:
> Signed-off-by: Cyrill Gorcunov <[email protected]>
Applied, thanks.
I found myself having to grep through include/linux to figure out what
this _AC macro was really all about, so I added this to the description:
PAGE_SIZE is used both from assembly and C code. We want to have type
specifiers when using it from C, but this will make the assembler
confused, so we need to make it conditional.
This is exactly what the _AC macro is for, so using it allows us to
get rid of a few lines of cpp noise.
My first thought was "Autoconf", and it sent shivers down my spine ;-)
Haavard
[Haavard Skinnemoen - Sun, Feb 03, 2008 at 02:25:06PM +0100]
| [removed bogus @atmel.co address from Cc]
|
| On Sun, 03 Feb 2008 14:22:18 +0300
| Cyrill Gorcunov <[email protected]> wrote:
|
| > Signed-off-by: Cyrill Gorcunov <[email protected]>
|
| Applied, thanks.
|
| I found myself having to grep through include/linux to figure out what
| this _AC macro was really all about, so I added this to the description:
|
| PAGE_SIZE is used both from assembly and C code. We want to have type
| specifiers when using it from C, but this will make the assembler
| confused, so we need to make it conditional.
|
| This is exactly what the _AC macro is for, so using it allows us to
| get rid of a few lines of cpp noise.
|
| My first thought was "Autoconf", and it sent shivers down my spine ;-)
|
| Haavard
|
Thanks, Haavard. (btw, really good joke about Autoconf ;-)
- Cyrill -