Rev 2182 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2182 | Rev 2199 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | #include <config.h> |
39 | #include <config.h> |
40 | #include "../aux_print/printf.h" |
40 | #include "../aux_print/printf.h" |
41 | 41 | ||
42 | void page_arch_init(void) |
42 | void page_arch_init(void) |
43 | { |
43 | { |
44 | aux_printf("page_arch_init\n"); |
- | |
45 | 44 | ||
46 | uintptr_t cur; |
45 | uintptr_t cur; |
47 | int flags; |
46 | int flags; |
48 | 47 | ||
49 | page_mapping_operations = &pt_mapping_operations; |
48 | page_mapping_operations = &pt_mapping_operations; |
50 | 49 | ||
51 | flags = PAGE_CACHEABLE; |
50 | flags = PAGE_CACHEABLE; |
52 | const unsigned maxmem = ALIGN_DOWN(config.memory_size, FRAME_SIZE); |
51 | const unsigned maxmem = ALIGN_DOWN(config.memory_size, FRAME_SIZE); |
53 | 52 | ||
54 | for (cur = 0; cur < maxmem; cur += FRAME_SIZE) { |
53 | for (cur = 0; cur < maxmem; cur += FRAME_SIZE) { |
55 | page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); |
54 | // page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); |
56 | } |
55 | } |
57 | //TODO set page fault routines |
56 | //TODO set page fault routines |
58 | // no problem no ... kernel doesn't do page faults |
57 | // no problem no ... kernel doesn't do page faults |
59 | 58 | ||
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 | ); |
- | |
74 | } |
59 | } |
75 | 60 | ||
76 | /** Map device into kernel space. */ |
61 | /** Map device into kernel space. */ |
77 | uintptr_t hw_map(uintptr_t physaddr, size_t size) |
62 | uintptr_t hw_map(uintptr_t physaddr, size_t size) |
78 | { |
63 | { |