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

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [glue/] [arm/] [memory.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * ARM virtual memory implementation
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
#include <l4/lib/list.h>
7
#include <l4/lib/string.h>
8
#include <l4/lib/printk.h>
9
#include <l4/generic/space.h>
10
#include <l4/generic/tcb.h>
11
#include <l4/generic/platform.h>
12
#include INC_SUBARCH(mm.h)
13
#include INC_GLUE(memlayout.h)
14
#include INC_GLUE(memory.h)
15
#include INC_GLUE(mapping.h)
16
#include INC_PLAT(offsets.h)
17
#include INC_ARCH(linker.h)
18
#include INC_ARCH(asm.h)
19
 
20
/*
21
 * Return arch-specific pte flags from generic space flags.
22
 */
23
unsigned int space_flags_to_ptflags(unsigned int flags)
24
{
25
        switch (flags) {
26
        case MAP_FAULT:
27
                return __MAP_FAULT;
28
        case MAP_USR_RW:
29
                return __MAP_USR_RW;
30
        case MAP_USR_RO:
31
                return __MAP_USR_RO;
32
        case MAP_KERN_RW:
33
                return __MAP_KERN_RW;
34
        case MAP_USR_IO:
35
                return __MAP_USR_IO;
36
        case MAP_KERN_IO:
37
                return __MAP_KERN_IO;
38
        case MAP_USR_RWX:
39
                return __MAP_USR_RWX;
40
        case MAP_KERN_RWX:
41
                return __MAP_KERN_RWX;
42
        case MAP_USR_RX:
43
                return __MAP_USR_RX;
44
        case MAP_KERN_RX:
45
                return __MAP_KERN_RX;
46
        /*
47
         * Don't remove this, if a flag with
48
         * same value is introduced, compiler will warn us
49
         */
50
        case MAP_INVALID_FLAGS:
51
        default:
52
                return MAP_INVALID_FLAGS;
53
        }
54
 
55
        return 0;
56
}
57
 
58
void task_init_registers(struct ktcb *task, unsigned long pc)
59
{
60
        task->context.pc = (u32)pc;
61
        task->context.spsr = ARM_MODE_USR;
62
}
63
 
64
 
65
/*
66
 * Copies all global kernel entries that a user process
67
 * should have in its pgd. In split page table setups
68
 * this is a noop.
69
 */
70
void copy_pgd_kernel_entries(pgd_table_t *to)
71
{
72
        arch_copy_pgd_kernel_entries(to);
73
}
74
 

powered by: WebSVN 2.1.0

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