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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [or32/] [mm/] [memory.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 666 simons
/*
2
 *  linux/arch/or32/mm/memory.c
3
 *
4
 *  Based on: linux/arch/m68knommu/mm/memory.c
5
 */
6
 
7
#include <linux/config.h>
8
#include <linux/mm.h>
9
#include <linux/kernel.h>
10
#include <linux/string.h>
11
#include <linux/types.h>
12
#include <linux/malloc.h>
13
 
14
#include <asm/segment.h>
15
#include <asm/page.h>
16
#include <asm/pgtable.h>
17
#include <asm/system.h>
18
#include <asm/traps.h>
19
 
20
/*
21
 * The following two routines map from a physical address to a kernel
22
 * virtual address and vice versa.
23
 */
24
unsigned long mm_vtop (unsigned long vaddr)
25
{
26
        return vaddr;
27
}
28
 
29
unsigned long mm_ptov (unsigned long paddr)
30
{
31
        return paddr;
32
}
33
 
34
/*
35
 * cache_clear() semantics: Clear any cache entries for the area in question,
36
 * without writing back dirty entries first. This is useful if the data will
37
 * be overwritten anyway, e.g. by DMA to memory. The range is defined by a
38
 * _physical_ address.
39
 */
40
 
41
void cache_clear (unsigned long paddr, int len)
42
{
43
}
44
 
45
 
46
/*
47
 * cache_push() semantics: Write back any dirty cache data in the given area,
48
 * and invalidate the range in the instruction cache. It needs not (but may)
49
 * invalidate those entries also in the data cache. The range is defined by a
50
 * _physical_ address.
51
 */
52
 
53
void cache_push (unsigned long paddr, int len)
54
{
55
}
56
 
57
 
58
/*
59
 * cache_push_v() semantics: Write back any dirty cache data in the given
60
 * area, and invalidate those entries at least in the instruction cache. This
61
 * is intended to be used after data has been written that can be executed as
62
 * code later. The range is defined by a _user_mode_ _virtual_ address  (or,
63
 * more exactly, the space is defined by the %sfc/%dfc register.)
64
 */
65
 
66
void cache_push_v (unsigned long vaddr, int len)
67
{
68
}
69
 
70
unsigned long mm_phys_to_virt (unsigned long addr)
71
{
72
    return PTOV (addr);
73
}
74
 
75
/* Map some physical address range into the kernel address space. The
76
 * code is copied and adapted from map_chunk().
77
 */
78
 
79
unsigned long kernel_map(unsigned long paddr, unsigned long size,
80
                         int nocacheflag, unsigned long *memavailp )
81
{
82
        return paddr;
83
}
84
 
85
 
86
void kernel_set_cachemode( unsigned long address, unsigned long size,
87
                                                   unsigned cmode )
88
{
89
}
90
 
91
#ifdef MAGIC_ROM_PTR
92 863 simons
#ifdef CONFIG_ROMKERNEL
93 666 simons
int is_in_rom(unsigned long addr) {
94
        extern unsigned long    __rom_start, _flashend;
95
 
96
        /* Anything not in operational RAM is returned as in rom! */
97
        if ((addr >= (unsigned long)&__rom_start) && (addr < (unsigned long)&_flashend))
98
                return(1);
99
        return(0);
100
}
101 863 simons
#else
102
int is_in_rom(unsigned long addr) {
103
        return 0;
104
}
105 666 simons
#endif
106 863 simons
#endif
107 666 simons
 

powered by: WebSVN 2.1.0

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