Commit 21e230ab authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k update (part 44)

M68k fault handling updates
  - Fix incorrect page alignment
  - Merge related inline asm statements to avoid .chip confusion
  - Add Sun-3 bus mapping test code
  - Kill warning
parent 91b60437
...@@ -224,7 +224,7 @@ static inline void access_error060 (struct frame *fp) ...@@ -224,7 +224,7 @@ static inline void access_error060 (struct frame *fp)
unsigned long addr = fp->un.fmt4.effaddr; unsigned long addr = fp->un.fmt4.effaddr;
if (fslw & MMU060_MA) if (fslw & MMU060_MA)
addr = (addr + 7) & -8; addr = (addr + PAGE_SIZE - 1) & PAGE_MASK;
errorcode = 1; errorcode = 1;
if (fslw & MMU060_DESC_ERR) { if (fslw & MMU060_DESC_ERR) {
...@@ -258,16 +258,12 @@ static inline unsigned long probe040(int iswrite, unsigned long addr, int wbs) ...@@ -258,16 +258,12 @@ static inline unsigned long probe040(int iswrite, unsigned long addr, int wbs)
set_fs(MAKE_MM_SEG(wbs)); set_fs(MAKE_MM_SEG(wbs));
asm volatile (".chip 68040");
if (iswrite) if (iswrite)
asm volatile ("ptestw (%0)" : : "a" (addr)); asm volatile (".chip 68040; ptestw (%0); .chip 68k" : : "a" (addr));
else else
asm volatile ("ptestr (%0)" : : "a" (addr)); asm volatile (".chip 68040; ptestr (%0); .chip 68k" : : "a" (addr));
asm volatile ("movec %%mmusr,%0" : "=r" (mmusr));
asm volatile (".chip 68k"); asm volatile (".chip 68040; movec %%mmusr,%0; .chip 68k" : "=r" (mmusr));
set_fs(old_fs); set_fs(old_fs);
...@@ -455,6 +451,7 @@ extern inline void bus_error030 (struct frame *fp) ...@@ -455,6 +451,7 @@ extern inline void bus_error030 (struct frame *fp)
unsigned char buserr_type = sun3_get_buserr (); unsigned char buserr_type = sun3_get_buserr ();
unsigned long addr, errorcode; unsigned long addr, errorcode;
unsigned short ssw = fp->un.fmtb.ssw; unsigned short ssw = fp->un.fmtb.ssw;
extern unsigned long _sun3_map_test_start, _sun3_map_test_end;
#if DEBUG #if DEBUG
if (ssw & (FC | FB)) if (ssw & (FC | FB))
...@@ -494,6 +491,13 @@ extern inline void bus_error030 (struct frame *fp) ...@@ -494,6 +491,13 @@ extern inline void bus_error030 (struct frame *fp)
printk ("Instruction fault at %#010lx\n", printk ("Instruction fault at %#010lx\n",
fp->ptregs.pc); fp->ptregs.pc);
if (ssw & DF) { if (ssw & DF) {
/* was this fault incurred testing bus mappings? */
if((fp->ptregs.pc >= (unsigned long)&_sun3_map_test_start) &&
(fp->ptregs.pc <= (unsigned long)&_sun3_map_test_end)) {
send_fault_sig(&fp->ptregs);
return;
}
printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n", printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
ssw & RW ? "read" : "write", ssw & RW ? "read" : "write",
fp->un.fmtb.daddr, fp->un.fmtb.daddr,
...@@ -820,8 +824,9 @@ extern struct module kernel_module; ...@@ -820,8 +824,9 @@ extern struct module kernel_module;
static inline int kernel_text_address(unsigned long addr) static inline int kernel_text_address(unsigned long addr)
{ {
#ifdef CONFIG_MODULES
struct module *mod; struct module *mod;
int retval = 0; #endif
extern char _stext, _etext; extern char _stext, _etext;
if (addr >= (unsigned long) &_stext && if (addr >= (unsigned long) &_stext &&
...@@ -833,14 +838,12 @@ static inline int kernel_text_address(unsigned long addr) ...@@ -833,14 +838,12 @@ static inline int kernel_text_address(unsigned long addr)
/* mod_bound tests for addr being inside the vmalloc'ed /* mod_bound tests for addr being inside the vmalloc'ed
* module area. Of course it'd be better to test only * module area. Of course it'd be better to test only
* for the .text subset... */ * for the .text subset... */
if (mod_bound(addr, 0, mod)) { if (mod_bound(addr, 0, mod))
retval = 1; return 1;
break;
}
} }
#endif #endif
return retval; return 0;
} }
void show_trace(unsigned long *stack) void show_trace(unsigned long *stack)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment