source: GPL/trunk/include/asm/page.h@ 367

Last change on this file since 367 was 367, checked in by Brendan Oakley, 17 years ago

Reverse mistake in changeset:1

File size: 2.1 KB
Line 
1
2#ifndef _I386_PAGE_H
3#define _I386_PAGE_H
4
5/* PAGE_SHIFT determines the page size */
6#define PAGE_SHIFT 12
7#define PAGE_SIZE (1UL << PAGE_SHIFT)
8#define PAGE_MASK (~(PAGE_SIZE-1))
9
10#ifdef __KERNEL__
11#ifndef __ASSEMBLY__
12
13//#include <linux/config.h>
14
15/*
16 * On older X86 processors its not a win to use MMX here it seems.
17 * Maybe the K6-III ?
18 */
19
20#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
21#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
22
23/*
24 * These are used to make use of C type-checking..
25 */
26#if CONFIG_X86_PAE
27typedef struct { unsigned long long pte; } pte_t;
28typedef struct { unsigned long long pmd; } pmd_t;
29typedef struct { unsigned long long pgd; } pgd_t;
30#else
31typedef struct { unsigned long pte; } pte_t;
32typedef struct { unsigned long pmd; } pmd_t;
33typedef struct { unsigned long pgd; } pgd_t;
34#endif
35
36typedef struct { unsigned long pgprot; } pgprot_t;
37
38#define pte_val(x) ((x).pte)
39#define pmd_val(x) ((x).pmd)
40#define pgd_val(x) ((x).pgd)
41#define pgprot_val(x) ((x).pgprot)
42
43#define __pgprot(x) ((pgprot_t) { (x) } )
44
45#endif /* !__ASSEMBLY__ */
46
47/* to align the pointer to the (next) page boundary */
48#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
49
50/*
51 * This handles the memory map.. We could make this a config
52 * option, but too many people screw it up, and too few need
53 * it.
54 *
55 * A __PAGE_OFFSET of 0xC0000000 means that the kernel has
56 * a virtual address space of one gigabyte, which limits the
57 * amount of physical memory you can use to about 950MB.
58 *
59 * If you want more physical memory than this then see the CONFIG_BIGMEM
60 * option in the kernel configuration.
61 */
62
63#define __PAGE_OFFSET (0xC0000000)
64
65#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
66#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
67#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
68#define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT)
69#define PHYSMAP_NR(addr) ((unsigned long)(addr) >> PAGE_SHIFT)
70#ifndef virt_to_page
71#define virt_to_page(x) (&mem_map[MAP_NR(x)])
72#endif
73
74#endif /* __KERNEL__ */
75
76#endif /* _I386_PAGE_H */
Note: See TracBrowser for help on using the repository browser.