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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libcpu/] [powerpc/] [shared/] [page.h] - Blame information for rev 507

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

Line No. Rev Author Line
1 30 unneback
/*
2
 * page.h
3
 *
4
 *      PowerPC memory management structures
5
 *
6
 * It is a stripped down version of linux ppc file...
7
 *
8
 * Copyright (C) 1999  Eric Valette (valette@crf.canon.fr)
9
 *                     Canon Centre Recherche France.
10
 *
11
 *  The license and distribution terms for this file may be
12
 *  found in found in the file LICENSE in this distribution or at
13
 *  http://www.OARcorp.com/rtems/license.html.
14
 *
15
 *  $Id: page.h,v 1.2 2001-09-27 12:01:30 chris Exp $
16
 */
17
 
18
#ifndef _PPC_PAGE_H
19
#define _PPC_PAGE_H
20
 
21
/* PAGE_SHIFT determines the page size */
22
#define PAGE_SHIFT      12
23
#define PAGE_SIZE       (1UL << PAGE_SHIFT)
24
#define PAGE_MASK       (~(PAGE_SIZE-1))
25
 
26
#define PAGE_OFFSET     0xc0000000
27
 
28
 
29
#ifndef ASM
30
/*
31
 * .. while these make it easier on the compiler
32
 */
33
typedef unsigned long pte_t;
34
typedef unsigned long pmd_t;
35
typedef unsigned long pgd_t;
36
typedef unsigned long pgprot_t;
37
 
38
#define pte_val(x)      (x)
39
#define pmd_val(x)      (x)
40
#define pgd_val(x)      (x)
41
#define pgprot_val(x)   (x)
42
 
43
#define __pte(x)        (x)
44
#define __pmd(x)        (x)
45
#define __pgd(x)        (x)
46
#define __pgprot(x)     (x)
47
 
48
 
49
/* align addr on a size boundry - adjust address up if needed -- Cort */
50
#define _ALIGN(addr,size)       (((addr)+size-1)&(~(size-1)))
51
 
52
/* to align the pointer to the (next) page boundary */
53
#define PAGE_ALIGN(addr)        (((addr)+PAGE_SIZE-1)&PAGE_MASK)
54
 
55
 
56
#define clear_page(page)        memset((void *)(page), 0, PAGE_SIZE)
57
#define copy_page(to,from)      memcpy((void *)(to), (void *)(from), PAGE_SIZE)
58
/* map phys->virtual and virtual->phys for RAM pages */
59
 
60
#define __pa(x)                 ((unsigned long)(x)-PAGE_OFFSET)
61
#define __va(x)                 ((void *)((unsigned long)(x)+PAGE_OFFSET))
62
 
63
#define MAP_NR(addr)            (((unsigned long)addr-PAGE_OFFSET) >> PAGE_SHIFT)
64
#define MAP_PAGE_RESERVED       (1<<15)
65
 
66
extern unsigned long get_zero_page_fast(void);
67
#endif /* ASM */
68
#endif /* _PPC_PAGE_H */

powered by: WebSVN 2.1.0

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