source: GPL/include/asm/page.h@ 1

Last change on this file since 1 was 1, checked in by vladest, 20 years ago

initial import

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