Subversion Repositories HelenOS

Rev

Rev 2131 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2131 Rev 2182
Line 33... Line 33...
33
 */
33
 */
34
 
34
 
35
#include <arch/mm/page.h>
35
#include <arch/mm/page.h>
36
#include <genarch/mm/page_pt.h>
36
#include <genarch/mm/page_pt.h>
37
#include <mm/page.h>
37
#include <mm/page.h>
-
 
38
#include <align.h>
-
 
39
#include <config.h>
-
 
40
#include "../aux_print/printf.h"
38
 
41
 
39
void page_arch_init(void)
42
void page_arch_init(void)
40
{
43
{
-
 
44
    aux_printf("page_arch_init\n");
-
 
45
 
-
 
46
    uintptr_t cur;
-
 
47
    int flags;
-
 
48
 
41
    page_mapping_operations = &pt_mapping_operations;
49
    page_mapping_operations = &pt_mapping_operations;
-
 
50
 
-
 
51
    flags = PAGE_CACHEABLE;
-
 
52
    const unsigned maxmem = ALIGN_DOWN(config.memory_size, FRAME_SIZE);
-
 
53
   
-
 
54
    for (cur = 0; cur < maxmem; cur += FRAME_SIZE) {
-
 
55
        page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
-
 
56
    }    
-
 
57
    //TODO set page fault routines
-
 
58
    // no problem no ... kernel doesn't do page faults
-
 
59
   
-
 
60
   
-
 
61
    asm volatile (
-
 
62
    "ldr r0, =0x55555555       \n"
-
 
63
    "mrc p15, 0, r0, c3, c0, 0 \n" //set domain acces rights to client <==> take rights from page tables
-
 
64
    "mcr p15, 0, r0, c1, c0, 0 \n" // get current setting of system ... register 1 isn't only for memmory management
-
 
65
    "ldr r1, =0xFFFFFE8D       \n" // mask to disable aligment checks, System, Rom bit disable 
-
 
66
    "and r0, r0, r1            \n"
-
 
67
    "ldr r1, =0x00000001       \n" // mask to enable paging
-
 
68
    "orr r0, r0, r1            \n"
-
 
69
    "mrc p15, 0, r0, c1, c0, 0 \n" // store setting
-
 
70
    :
-
 
71
    :
-
 
72
    : "r0", "r1"
-
 
73
    );
42
}
74
}
43
 
75
 
44
/** Map device into kernel space. */
76
/** Map device into kernel space. */
45
uintptr_t hw_map(uintptr_t physaddr, size_t size)
77
uintptr_t hw_map(uintptr_t physaddr, size_t size)
46
{
78
{
Line 48... Line 80...
48
    return NULL;
80
    return NULL;
49
}
81
}
50
 
82
 
51
/** @}
83
/** @}
52
 */
84
 */
-
 
85