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

Subversion Repositories or1k

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _PPC_PAGE_H
2
#define _PPC_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
void invalidate(void);
10
 
11
#ifdef __KERNEL__
12
 
13
#define STRICT_MM_TYPECHECKS
14
 
15
#ifdef STRICT_MM_TYPECHECKS
16
/*
17
 * These are used to make use of C type-checking..
18
 */
19
typedef struct { unsigned long pte; } pte_t;
20
typedef struct { unsigned long pmd; } pmd_t;
21
typedef struct { unsigned long pgd; } pgd_t;
22
typedef struct { unsigned long pgprot; } pgprot_t;
23
 
24
#define pte_val(x)      ((x).pte)
25
#define pmd_val(x)      ((x).pmd)
26
#define pgd_val(x)      ((x).pgd)
27
#define pgprot_val(x)   ((x).pgprot)
28
 
29
#define __pte(x)        ((pte_t) { (x) } )
30
#define __pmd(x)        ((pmd_t) { (x) } )
31
#define __pgd(x)        ((pgd_t) { (x) } )
32
#define __pgprot(x)     ((pgprot_t) { (x) } )
33
 
34
#else
35
/*
36
 * .. while these make it easier on the compiler
37
 */
38
typedef unsigned long pte_t;
39
typedef unsigned long pmd_t;
40
typedef unsigned long pgd_t;
41
typedef unsigned long pgprot_t;
42
 
43
#define pte_val(x)      (x)
44
#define pmd_val(x)      (x)
45
#define pgd_val(x)      (x)
46
#define pgprot_val(x)   (x)
47
 
48
#define __pte(x)        (x)
49
#define __pmd(x)        (x)
50
#define __pgd(x)        (x)
51
#define __pgprot(x)     (x)
52
 
53
#endif
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
 
60
#define KERNELBASE      0x90000000
61
#define PAGE_OFFSET     KERNELBASE
62
#define MAP_NR(addr)    ((((unsigned long)addr) - PAGE_OFFSET) >> PAGE_SHIFT)
63
#define MAP_PAGE_RESERVED       (1<<15)
64
 
65
 
66
#if 0  /* Now defined in "mm.h" */
67
/*
68
 * This used to be an unsigned short...
69
 *
70
 *                         -- Cort
71
 */
72
/*typedef unsigned short mem_map_t;*/
73
 
74
typedef struct {
75
        unsigned count:30,
76
                 dirty:1,
77
                 reserved:1;
78
} mem_map_t;
79
#endif
80
 
81
/* Certain architectures need to do special things when pte's
82
 * within a page table are directly modified.  Thus, the following
83
 * hook is made available.
84
 */
85
#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
86
 
87
 
88
#endif /* __KERNEL__ */
89
 
90
#endif /* _PPC_PAGE_H */

powered by: WebSVN 2.1.0

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