linux-libc-headers: include/asm-arm26/page.h, include/asm-ia64/pag...
Jakub Bogusz
qboosh w pld-linux.org
Nie, 29 Sie 2004, 16:44:34 CEST
On Sat, Aug 28, 2004 at 11:36:49PM +0000, mmazur wrote:
> Author: mmazur Date: Sat Aug 28 23:36:49 2004 GMT
> Module: linux-libc-headers Tag: HEAD
> ---- Log message:
> - on archs that have varying PAGE_SIZEs we use a dynamic call to
> getpagesize() as suggested by Albert Cahalan; probably will need some code
> modified
>
> ---- Files affected:
> linux-libc-headers/include/asm-arm26:
> page.h (1.3 -> 1.4)
> linux-libc-headers/include/asm-ia64:
> page.h (1.7 -> 1.8)
> linux-libc-headers/include/asm-m68k:
> page.h (1.3 -> 1.4)
> linux-libc-headers/include/asm-mips:
> page.h (1.6 -> 1.7)
> linux-libc-headers/include/asm-sparc:
> page.h (1.5 -> 1.6)
>
> ---- Diffs:
>
> ================================================================
> Index: linux-libc-headers/include/asm-arm26/page.h
> diff -u linux-libc-headers/include/asm-arm26/page.h:1.3 linux-libc-headers/include/asm-arm26/page.h:1.4
> --- linux-libc-headers/include/asm-arm26/page.h:1.3 Wed Jan 21 16:55:28 2004
> +++ linux-libc-headers/include/asm-arm26/page.h Sat Aug 28 23:36:43 2004
> @@ -2,16 +2,11 @@
> #define _ASMARM_PAGE_H
>
>
> -/* PAGE_SHIFT determines the page size. This is configurable. */
> -#if defined(CONFIG_PAGESIZE_16)
> -#define PAGE_SHIFT 14 /* 16K */
> -#else /* default */
> -#define PAGE_SHIFT 15 /* 32K */
> -#endif
> -
> #define EXEC_PAGESIZE 32768
>
> -#define PAGE_SIZE (1UL << PAGE_SHIFT)
> +extern int getpagesize(void);
> +#define PAGE_SIZE ((unsigned long)getpagesize())
> +#define PAGE_SHIFT ((unsigned long[]){12,13,14,-1,15,-1,-1,-1,16}[PAGE_SIZE>>13])
> #define PAGE_MASK (~(PAGE_SIZE-1))
Wersja z ?: trochę brzydziej wyglądała, ale chyba jej wolałbym użyć...
przynajmniej sensownie by zareagowała na zwrócenie nieoczekiwanej
wartości przez getpagesize() - bo to powyższe... można się domyślić.
--
Jakub Bogusz http://cyber.cs.net.pl/~qboosh/
Więcej informacji o liście dyskusyjnej pld-devel-pl