OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-i386/] [page.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _I386_PAGE_H
2
#define _I386_PAGE_H
3
 
4
/* PAGE_SHIFT determines the page size */
5
#define PAGE_SHIFT      12
6
#define PAGE_SIZE       (1UL << PAGE_SHIFT)
7
#define PAGE_MASK       (~(PAGE_SIZE-1))
8
 
9
#ifdef __KERNEL__
10
#ifndef __ASSEMBLY__
11
 
12
#define STRICT_MM_TYPECHECKS
13
 
14
#ifdef STRICT_MM_TYPECHECKS
15
/*
16
 * These are used to make use of C type-checking..
17
 */
18
typedef struct { unsigned long pte; } pte_t;
19
typedef struct { unsigned long pmd; } pmd_t;
20
typedef struct { unsigned long pgd; } pgd_t;
21
typedef struct { unsigned long pgprot; } pgprot_t;
22
 
23
#define pte_val(x)      ((x).pte)
24
#define pmd_val(x)      ((x).pmd)
25
#define pgd_val(x)      ((x).pgd)
26
#define pgprot_val(x)   ((x).pgprot)
27
 
28
#define __pte(x)        ((pte_t) { (x) } )
29
#define __pmd(x)        ((pmd_t) { (x) } )
30
#define __pgd(x)        ((pgd_t) { (x) } )
31
#define __pgprot(x)     ((pgprot_t) { (x) } )
32
 
33
#else
34
/*
35
 * .. while these make it easier on the compiler
36
 */
37
typedef unsigned long pte_t;
38
typedef unsigned long pmd_t;
39
typedef unsigned long pgd_t;
40
typedef unsigned long pgprot_t;
41
 
42
#define pte_val(x)      (x)
43
#define pmd_val(x)      (x)
44
#define pgd_val(x)      (x)
45
#define pgprot_val(x)   (x)
46
 
47
#define __pte(x)        (x)
48
#define __pmd(x)        (x)
49
#define __pgd(x)        (x)
50
#define __pgprot(x)     (x)
51
 
52
#endif
53
#endif /* !__ASSEMBLY__ */
54
 
55
/* to align the pointer to the (next) page boundary */
56
#define PAGE_ALIGN(addr)        (((addr)+PAGE_SIZE-1)&PAGE_MASK)
57
 
58
/* This handles the memory map.. */
59
#define __PAGE_OFFSET           ((0x1000-CONFIG_MAX_MEMSIZE)<<20)
60
#define PAGE_OFFSET             (0)
61
#define MAP_NR(addr)            (((unsigned long)(addr)) >> PAGE_SHIFT)
62
 
63
#endif /* __KERNEL__ */
64
 
65
#endif /* _I386_PAGE_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.