Rev 548 | Rev 576 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 548 | Rev 566 | ||
|---|---|---|---|
| Line 33... | Line 33... | ||
| 33 | #include <arch/interrupt.h> |
33 | #include <arch/interrupt.h> |
| 34 | #include <arch/asm.h> |
34 | #include <arch/asm.h> |
| 35 | #include <config.h> |
35 | #include <config.h> |
| 36 | #include <memstr.h> |
36 | #include <memstr.h> |
| 37 | 37 | ||
| 38 | __address bootstrap_dba; |
38 | static __address bootstrap_dba; |
| 39 | 39 | ||
| 40 | void page_arch_init(void) |
40 | void page_arch_init(void) |
| 41 | { |
41 | { |
| 42 | __address dba; |
42 | __address dba; |
| 43 | __address cur; |
43 | __address cur; |
| Line 57... | Line 57... | ||
| 57 | 57 | ||
| 58 | trap_register(14, page_fault); |
58 | trap_register(14, page_fault); |
| 59 | write_cr3(KA2PA(dba)); |
59 | write_cr3(KA2PA(dba)); |
| 60 | } |
60 | } |
| 61 | else { |
61 | else { |
| 62 | /* |
- | |
| 63 | * Application processors need to create their own view of the |
- | |
| 64 | * virtual address space. Because of that, each AP copies |
- | |
| 65 | * already-initialized paging information from the bootstrap |
- | |
| 66 | * processor and adjusts it to fulfill its needs. |
- | |
| 67 | */ |
- | |
| 68 | - | ||
| 69 | dba = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME); |
- | |
| 70 | memcpy((void *)dba, (void *)bootstrap_dba , PAGE_SIZE); |
- | |
| 71 | write_cr3(KA2PA(dba)); |
62 | write_cr3(KA2PA(bootstrap_dba)); |
| 72 | } |
63 | } |
| 73 | } |
64 | } |