Rev 1817 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1817 | Rev 1821 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup xen32mm |
29 | /** @addtogroup xen32mm |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | /** @file |
32 | /** @file |
33 | */ |
33 | */ |
34 | 34 | ||
Line 49... | Line 49... | ||
49 | #include <print.h> |
49 | #include <print.h> |
50 | #include <interrupt.h> |
50 | #include <interrupt.h> |
51 | 51 | ||
52 | void page_arch_init(void) |
52 | void page_arch_init(void) |
53 | { |
53 | { |
54 | uintptr_t cur; |
- | |
55 | int flags; |
- | |
56 | - | ||
57 | if (config.cpu_active == 1) { |
54 | if (config.cpu_active == 1) { |
58 | page_mapping_operations = &pt_mapping_operations; |
55 | page_mapping_operations = &pt_mapping_operations; |
59 | - | ||
60 | /* |
- | |
61 | * PA2KA(identity) mapping for all frames until last_frame. |
- | |
62 | */ |
- | |
63 | for (cur = 0; cur < last_frame; cur += FRAME_SIZE) { |
- | |
64 | flags = PAGE_CACHEABLE; |
- | |
65 | if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size)) |
- | |
66 | flags |= PAGE_GLOBAL; |
- | |
67 | page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); |
- | |
68 | } |
- | |
69 | - | ||
70 | exc_register(14, "page_fault", (iroutine) page_fault); |
56 | AS_KERNEL->page_table = (pte_t *) KA2PA(start_info.ptl0); |
71 | // write_cr3((uintptr_t) AS_KERNEL->page_table); |
- | |
72 | } |
- | |
73 | else { |
57 | } else |
74 | // write_cr3((uintptr_t) AS_KERNEL->page_table); |
58 | SET_PTL0_ADDRESS_ARCH(AS_KERNEL->page_table); |
75 | } |
- | |
76 | - | ||
77 | // paging_on(); |
- | |
78 | } |
59 | } |
79 | 60 | ||
80 | void page_fault(int n, istate_t *istate) |
61 | void page_fault(int n, istate_t *istate) |
81 | { |
62 | { |
82 | uintptr_t page; |
63 | uintptr_t page; |