source: svn/trunk/newcon3bcm2_21bu/toolchain/mipsel-linux-uclibc/include/asm/page.h @ 2

Last change on this file since 2 was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 810 bytes
Line 
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License.  See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1994 - 1999, 2000, 03 Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_PAGE_H
10#define _ASM_PAGE_H
11
12#include <unistd.h>
13
14#define PAGE_SIZE (getpagesize())
15static __inline__ int getpageshift()
16{
17    int pagesize = getpagesize();
18#if (__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
19    return (__builtin_clz(pagesize) ^ 31);
20#else
21    register int pageshift = -1;
22    while (pagesize) { pagesize >>= 1; pageshift++; }
23    return pageshift;
24#endif
25}
26#define PAGE_SHIFT (getpageshift())
27
28#endif /* _ASM_PAGE_H */
29#ifdef CONFIG_LIMITED_DMA
30#define WANT_PAGE_VIRTUAL
31#endif
32
Note: See TracBrowser for help on using the repository browser.