Hello,

I'm experiencing several illegal instruction errors during execution of some 
programs. Using a BDM debugger I got until the parsing of the exception stack 
inside trap_c() (arch/m68knommu/kernel/traps.c) where I stumbled.
The exception vector is extracted as followed:
> switch ((fp->ptregs.vector) >> 2)
The reference manual for Coldfire 5208 chapter 3.3.3.1 describe the following:
> SSP Format(bits 31-28), FS[3:2](bits 27, 26), Vector(bits 25:18), FS[1:0]
(bits 17, 16), Status Register (bits 15-0)
> SSP + 0x4 Prgram Counter (bits 31-0)

In my opinion the vector extraction is wrong, because the vector is defined 
with 12 Bits in size (see include/asm-m68knommu/ptrace.h) including the Fault 
Status bits at each end of those 12 bits. By just shifting 2 bits to the 
right you will still have FS[3:2] at the upper end of ptregs.vector resulting 
in a wrong exception vector, if a bit is set in FS[3:2]
So I think the vector extraction has to be changed to something like that:
> switch (((fp->ptregs.vector) >> 2) & 0xff)

With that change (at every occurrence) I get at least a bus error instead (the 
kernel want to execute at address 0xffffffff, but that's another problem) of 
illegal instruction, which seems to be a default exception handler.

I used uClinux-dist-20080808, but I noticed this lines of code didn't change 
in uClinux-dist-20090520 and even linux-2.6. AFAIK the exception stack is the 
same on Coldfire 5484 (V4e core with MMU).

Any comments, questions, suggestions?

Regards
Alexander
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to