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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [proc-armo/] [mm-init-flat.h] - Blame information for rev 1777

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

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * linux/include/asm-arm/proc-armo/mmap.h
3
 *
4
 * Copyright (C) 1996 Russell King
5
 *
6
 * This contains the code to setup the memory map on an ARM2/ARM250/ARM3
7
 * machine. This is both processor & architecture specific, and requires
8
 * some more work to get it to fit into our separate processor and
9
 * architecture structure.
10
 */
11
 
12
static unsigned long phys_screen_end;
13
int page_nr;
14
 
15
#define setup_processor_functions()
16
 
17
/*
18
 * This routine needs more work to make it dynamically release/allocate mem!
19
 */
20
unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update)
21
{
22
        static int updated = 0;
23
        unsigned long address = SCREEN_START, i;
24
        pgd_t *pg_dir;
25
        pmd_t *pm_dir;
26
        pte_t *pt_entry;
27
 
28
        if (updated)
29
                return 0;
30
        updated = update;
31
 
32
        pg_dir = swapper_pg_dir + (SCREEN1_BASE >> PGDIR_SHIFT);
33
        pm_dir = pmd_offset(pg_dir, SCREEN1_BASE);
34
        pt_entry = pte_offset(pm_dir, SCREEN1_BASE);
35
 
36
        for (i = SCREEN1_BASE; i < SCREEN1_END; i += PAGE_SIZE) {
37
                if (i >= log_start) {
38
                        *pt_entry = mk_pte(address, __pgprot(_PAGE_PRESENT));
39
                        address += PAGE_SIZE;
40
                } else
41
                        *pt_entry = mk_pte(0, __pgprot(0));
42
                pt_entry++;
43
        }
44
        phys_screen_end = address;
45
        if (update)
46
                flush_tlb_all ();
47
        return kmem;
48
}
49
 
50
static inline unsigned long setup_pagetables(unsigned long start_mem, unsigned long end_mem)
51
{
52
        unsigned long address;
53
        unsigned int spi;
54
 
55
        page_nr = MAP_NR(end_mem);
56
 
57
        /* Allocate zero page */
58
        address = PAGE_OFFSET + 480*1024;
59
        for (spi = 0; spi < 32768 >> PAGE_SHIFT; spi++) {
60
                pgd_val(swapper_pg_dir[spi]) = pte_val(mk_pte(address, PAGE_READONLY));
61
                address += PAGE_SIZE;
62
        }
63
 
64
        while (spi < (PAGE_OFFSET >> PGDIR_SHIFT))
65
                pgd_val(swapper_pg_dir[spi++]) = 0;
66
 
67
        map_screen_mem (SCREEN1_END - 480*1024, 0, 0);
68
        return start_mem;
69
}
70
 
71
static inline void mark_usable_memory_areas(unsigned long *start_mem, unsigned long end_mem)
72
{
73
        unsigned long smem = PAGE_ALIGN(*start_mem);
74
 
75
        while (smem < end_mem) {
76
                clear_bit(PG_reserved, &mem_map[MAP_NR(smem)].flags);
77
                smem += PAGE_SIZE;
78
        }
79
 
80
        for (smem = phys_screen_end; smem < SCREEN2_END; smem += PAGE_SIZE)
81
                clear_bit(PG_reserved, &mem_map[MAP_NR(smem)].flags);
82
}

powered by: WebSVN 2.1.0

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