Rev 113 | Rev 116 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 113 | Rev 115 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | map_page_to_frame(i * PAGE_SIZE, i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba)); |
67 | map_page_to_frame(i * PAGE_SIZE, i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba)); |
68 | map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba)); |
68 | map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba)); |
69 | } |
69 | } |
70 | 70 | ||
71 | trap_register(14, page_fault); |
71 | trap_register(14, page_fault); |
72 | cpu_write_dba(KA2PA(dba)); |
72 | write_cr3(KA2PA(dba)); |
73 | } |
73 | } |
74 | else { |
74 | else { |
75 | /* |
75 | /* |
76 | * Application processors need to create their own view of the |
76 | * Application processors need to create their own view of the |
77 | * virtual address space. Because of that, each AP copies |
77 | * virtual address space. Because of that, each AP copies |
Line 79... | Line 79... | ||
79 | * processor and adjusts it to fulfill its needs. |
79 | * processor and adjusts it to fulfill its needs. |
80 | */ |
80 | */ |
81 | 81 | ||
82 | dba = frame_alloc(FRAME_KA | FRAME_PANIC); |
82 | dba = frame_alloc(FRAME_KA | FRAME_PANIC); |
83 | memcopy(bootstrap_dba, dba, PAGE_SIZE); |
83 | memcopy(bootstrap_dba, dba, PAGE_SIZE); |
84 | cpu_write_dba(KA2PA(dba)); |
84 | write_cr3(KA2PA(dba)); |
85 | } |
85 | } |
86 | 86 | ||
87 | paging_on(); |
87 | paging_on(); |
88 | } |
88 | } |
89 | 89 | ||
Line 105... | Line 105... | ||
105 | struct page_specifier *pd, *pt; |
105 | struct page_specifier *pd, *pt; |
106 | __address dba, newpt; |
106 | __address dba, newpt; |
107 | int pde, pte; |
107 | int pde, pte; |
108 | 108 | ||
109 | if (root) dba = root; |
109 | if (root) dba = root; |
110 | else dba = cpu_read_dba(); |
110 | else dba = read_cr3(); |
111 | 111 | ||
112 | pde = page >> 22; /* page directory entry */ |
112 | pde = page >> 22; /* page directory entry */ |
113 | pte = (page >> 12) & 0x3ff; /* page table entry */ |
113 | pte = (page >> 12) & 0x3ff; /* page table entry */ |
114 | 114 | ||
115 | pd = (struct page_specifier *) PA2KA(dba); |
115 | pd = (struct page_specifier *) PA2KA(dba); |