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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [include/] [asm-armnommu/] [arch-rpc/] [mmap.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 * linux/include/asm-arm/arch-rpc/mmap.h
3
 *
4
 * Copyright (C) 1996 Russell King
5
 */
6
 
7
#define HAVE_MAP_VID_MEM
8
#define SAFE_ADDR 0x00000000    /* ROM */
9
 
10
unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update)
11
{
12
        static int updated = 0;
13
        unsigned long address;
14
        pgd_t *pgd;
15
 
16
        if (updated)
17
                return 0;
18
        updated = update;
19
 
20
        address = SCREEN_START | PMD_TYPE_SECT | PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE;
21
        pgd = swapper_pg_dir + (SCREEN2_BASE >> PGDIR_SHIFT);
22
        pgd_val(pgd[0]) = address;
23
        pgd_val(pgd[1]) = address + (1 << PGDIR_SHIFT);
24
 
25
        if (update) {
26
                unsigned long pgtable = PAGE_ALIGN(kmem), *p;
27
                int i;
28
 
29
                memzero ((void *)pgtable, 4096);
30
 
31
                pgd_val(pgd[-2]) = __virt_to_phys(pgtable) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL);
32
                pgd_val(pgd[-1]) = __virt_to_phys(pgtable + PTRS_PER_PTE*4) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL);
33
                p = (unsigned long *)pgtable;
34
 
35
                i = PTRS_PER_PTE * 2 - ((SCREEN1_END - log_start) >> PAGE_SHIFT);
36
                address = SCREEN_START | PTE_TYPE_SMALL | PTE_AP_WRITE;
37
 
38
                while (i < PTRS_PER_PTE * 2) {
39
                        p[i++] = address;
40
                        address += PAGE_SIZE;
41
                }
42
 
43
                flush_page_to_ram(pgtable);
44
 
45
                kmem = pgtable + PAGE_SIZE;
46
        }
47
        return kmem;
48
}

powered by: WebSVN 2.1.0

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