| .. | .. |
|---|
| 8 | 8 | |
|---|
| 9 | 9 | #include <linux/init.h> |
|---|
| 10 | 10 | #include <linux/kernel.h> |
|---|
| 11 | +#include <linux/mm.h> |
|---|
| 11 | 12 | #include <linux/sched.h> |
|---|
| 12 | 13 | #include <linux/sched/debug.h> |
|---|
| 13 | 14 | #include <linux/sched/signal.h> |
|---|
| .. | .. |
|---|
| 300 | 301 | field, regs->cp0_epc, field, regs->regs[31]); |
|---|
| 301 | 302 | } |
|---|
| 302 | 303 | |
|---|
| 303 | | -/* |
|---|
| 304 | | - * Check, whether MC's (virtual) DMA address caused the bus error. |
|---|
| 305 | | - * See "Virtual DMA Specification", Draft 1.5, Feb 13 1992, SGI |
|---|
| 306 | | - */ |
|---|
| 307 | | - |
|---|
| 308 | | -static int addr_is_ram(unsigned long addr, unsigned sz) |
|---|
| 309 | | -{ |
|---|
| 310 | | - int i; |
|---|
| 311 | | - |
|---|
| 312 | | - for (i = 0; i < boot_mem_map.nr_map; i++) { |
|---|
| 313 | | - unsigned long a = boot_mem_map.map[i].addr; |
|---|
| 314 | | - if (a <= addr && addr+sz <= a+boot_mem_map.map[i].size) |
|---|
| 315 | | - return 1; |
|---|
| 316 | | - } |
|---|
| 317 | | - return 0; |
|---|
| 318 | | -} |
|---|
| 319 | | - |
|---|
| 320 | 304 | static int check_microtlb(u32 hi, u32 lo, unsigned long vaddr) |
|---|
| 321 | 305 | { |
|---|
| 322 | 306 | /* This is likely rather similar to correct code ;-) */ |
|---|
| .. | .. |
|---|
| 331 | 315 | /* PTEIndex is VPN-low (bits [22:14]/[20:12] ?) */ |
|---|
| 332 | 316 | unsigned long pte = (lo >> 6) << 12; /* PTEBase */ |
|---|
| 333 | 317 | pte += 8*((vaddr >> pgsz) & 0x1ff); |
|---|
| 334 | | - if (addr_is_ram(pte, 8)) { |
|---|
| 318 | + if (page_is_ram(PFN_DOWN(pte))) { |
|---|
| 335 | 319 | /* |
|---|
| 336 | 320 | * Note: Since DMA hardware does look up |
|---|
| 337 | 321 | * translation on its own, this PTE *must* |
|---|
| .. | .. |
|---|
| 462 | 446 | if (ip28_be_interrupt(regs) != MIPS_BE_DISCARD) { |
|---|
| 463 | 447 | /* Assume it would be too dangerous to continue ... */ |
|---|
| 464 | 448 | die_if_kernel("Oops", regs); |
|---|
| 465 | | - force_sig(SIGBUS, current); |
|---|
| 449 | + force_sig(SIGBUS); |
|---|
| 466 | 450 | } else if (debug_be_interrupt) |
|---|
| 467 | | - show_regs((struct pt_regs *)regs); |
|---|
| 451 | + show_regs(regs); |
|---|
| 468 | 452 | } |
|---|
| 469 | 453 | |
|---|
| 470 | 454 | static int ip28_be_handler(struct pt_regs *regs, int is_fixup) |
|---|