From: James S. <jsi...@us...> - 2002-02-26 17:08:35
|
Update of /cvsroot/linux-mips/linux/include/asm-mips64 In directory usw-pr-cvs1:/tmp/cvs-serv14866/asm-mips64 Modified Files: mipsregs.h Log Message: Implement {get,set}_errorepc() to access the c0_errorepc register. Index: mipsregs.h =================================================================== RCS file: /cvsroot/linux-mips/linux/include/asm-mips64/mipsregs.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- mipsregs.h 19 Feb 2002 17:25:25 -0000 1.10 +++ mipsregs.h 26 Feb 2002 17:08:29 -0000 1.11 @@ -793,6 +793,30 @@ : : "Jr" (val)); } +static inline unsigned long get_errorepc(void) +{ + unsigned long val; + + __asm__ __volatile__( + ".set push\n\t" + ".set reorder\n\t" + "dmfc0 %0, $30\n\t" + ".set pop" + : "=r" (val)); + + return val; +} + +static inline void set_errorepc(unsigned long val) +{ + __asm__ __volatile__( + ".set push\n\t" + ".set reorder\n\t" + "dmtc0 %z0, $30\n\t" + ".set pop" + : : "Jr" (val)); +} + /* * Manipulate the status register. * Mostly used to access the interrupt bits. |