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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-i386/] [pgtable-2level.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#ifndef _I386_PGTABLE_2LEVEL_H
2
#define _I386_PGTABLE_2LEVEL_H
3
 
4
/*
5
 * traditional i386 two-level paging structure:
6
 */
7
 
8
#define PGDIR_SHIFT     22
9
#define PTRS_PER_PGD    1024
10
 
11
/*
12
 * the i386 is two-level, so we don't really have any
13
 * PMD directory physically.
14
 */
15
#define PMD_SHIFT       22
16
#define PTRS_PER_PMD    1
17
 
18
#define PTRS_PER_PTE    1024
19
 
20
#define pte_ERROR(e) \
21
        printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low)
22
#define pmd_ERROR(e) \
23
        printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
24
#define pgd_ERROR(e) \
25
        printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
26
 
27
/*
28
 * The "pgd_xxx()" functions here are trivial for a folded two-level
29
 * setup: the pgd is never bad, and a pmd always exists (as it's folded
30
 * into the pgd entry)
31
 */
32
static inline int pgd_none(pgd_t pgd)           { return 0; }
33
static inline int pgd_bad(pgd_t pgd)            { return 0; }
34
static inline int pgd_present(pgd_t pgd)        { return 1; }
35
#define pgd_clear(xp)                           do { } while (0)
36
 
37
/*
38
 * Certain architectures need to do special things when PTEs
39
 * within a page table are directly modified.  Thus, the following
40
 * hook is made available.
41
 */
42
#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
43
#define set_pte_atomic(pteptr, pteval) (*(pteptr) = pteval)
44
 
45
/*
46
 * (pmds are folded into pgds so this doesnt get actually called,
47
 * but the define is needed for a generic inline function.)
48
 */
49
#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
50
#define set_pgd(pgdptr, pgdval) (*(pgdptr) = pgdval)
51
 
52
#define pgd_page(pgd) \
53
((unsigned long) __va(pgd_val(pgd) & PAGE_MASK))
54
 
55
static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
56
{
57
        return (pmd_t *) dir;
58
}
59
#define ptep_get_and_clear(xp)  __pte(xchg(&(xp)->pte_low, 0))
60
#define pte_same(a, b)          ((a).pte_low == (b).pte_low)
61
#define pte_page(x)             (mem_map+((unsigned long)(((x).pte_low >> PAGE_SHIFT))))
62
#define pte_none(x)             (!(x).pte_low)
63
#define __mk_pte(page_nr,pgprot) __pte(((page_nr) << PAGE_SHIFT) | pgprot_val(pgprot))
64
 
65
#endif /* _I386_PGTABLE_2LEVEL_H */

powered by: WebSVN 2.1.0

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