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,23 +301,6 @@ static void print_buserr(const struct pt_regs *regs)
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,7 +315,7 @@ static int check_microtlb(u32 hi, u32 lo, unsigned long vaddr)
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*
0 commit comments