Rev 1382 | Rev 1595 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1382 | Rev 1411 | ||
---|---|---|---|
Line 166... | Line 166... | ||
166 | 166 | ||
167 | 167 | ||
168 | void page_fault(int n, istate_t *istate) |
168 | void page_fault(int n, istate_t *istate) |
169 | { |
169 | { |
170 | __address page; |
170 | __address page; |
- | 171 | pf_access_t access; |
|
171 | 172 | ||
172 | page = read_cr2(); |
173 | page = read_cr2(); |
- | 174 | ||
- | 175 | if (istate->error_word & PFERR_CODE_RSVD) |
|
- | 176 | panic("Reserved bit set in page table entry.\n"); |
|
- | 177 | ||
- | 178 | if (istate->error_word & PFERR_CODE_RW) |
|
- | 179 | access = PF_ACCESS_WRITE; |
|
- | 180 | else if (istate->error_word & PFERR_CODE_ID) |
|
- | 181 | access = PF_ACCESS_EXEC; |
|
- | 182 | else |
|
- | 183 | access = PF_ACCESS_READ; |
|
- | 184 | ||
173 | if (as_page_fault(page, istate) == AS_PF_FAULT) { |
185 | if (as_page_fault(page, access, istate) == AS_PF_FAULT) { |
174 | print_info_errcode(n, istate); |
186 | print_info_errcode(n, istate); |
175 | printf("Page fault address: %llX\n", page); |
187 | printf("Page fault address: %llX\n", page); |
176 | panic("page fault\n"); |
188 | panic("page fault\n"); |
177 | } |
189 | } |
178 | } |
190 | } |