lkml.org 
[lkml]   [2001]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectFault Address from sigcontext for the various archs
From
Date

Greetings! I'm trying to assist in porting gcl to the various Linux
archs, and the code as is needs the fault address from struct
sigcontext. i386 and m68k work, with solutions shown below. What
about the other archs? Where can I find the fault address around this
struct?

Thanks!

=============================================================================
i386
=============================================================================
#define GET_FAULT_ADDR(sig,code,sv,a) \
((void *)(((struct sigcontext_struct *)(&code))->cr2))
=============================================================================
m68k
=============================================================================
#define GET_FAULT_ADDR(sig,code,sv,a) \
({ \
struct sigcontext *scp = (struct sigcontext *)(sv);\
int format = (scp->sc_formatvec >> 12) & 0xf;\
unsigned long *framedata = (unsigned long *)(scp + 1);\
unsigned long ea;\
if (format == 0xa || format == 0xb)\
/* 68020/030 */\
ea = framedata[2];\
else if (format == 7)\
/* 68040 */\
ea = framedata[3];\
else if (format == 4) {\
/* 68060 */\
ea = framedata[0];\
if (framedata[1] & 0x08000000)\
/* correct addr on misaligned access */\
ea = (ea+4095)&(~4095);\
}\
ea;\
})
=============================================================================

--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.210 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site