0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _EXCEPTION_H_
0011 #define _EXCEPTION_H_
0012
0013 #ifdef __ASSEMBLY__
0014 #define Const_(x) $##x
0015 #else
0016 #define Const_(x) x
0017 #endif
0018
0019 #ifndef SW_C1
0020 #include "fpu_emu.h"
0021 #endif
0022
0023 #define FPU_BUSY Const_(0x8000)
0024 #define EX_ErrorSummary Const_(0x0080)
0025
0026 #define EX_INTERNAL Const_(0x8000)
0027 #define EX_StackOver Const_(0x0041|SW_C1)
0028 #define EX_StackUnder Const_(0x0041)
0029
0030 #define EX_Precision Const_(0x0020)
0031 #define EX_Underflow Const_(0x0010)
0032 #define EX_Overflow Const_(0x0008)
0033 #define EX_ZeroDiv Const_(0x0004)
0034 #define EX_Denormal Const_(0x0002)
0035 #define EX_Invalid Const_(0x0001)
0036
0037 #define PRECISION_LOST_UP Const_((EX_Precision | SW_C1))
0038 #define PRECISION_LOST_DOWN Const_(EX_Precision)
0039
0040 #ifndef __ASSEMBLY__
0041
0042 #ifdef DEBUG
0043 #define EXCEPTION(x) { printk("exception in %s at line %d\n", \
0044 __FILE__, __LINE__); FPU_exception(x); }
0045 #else
0046 #define EXCEPTION(x) FPU_exception(x)
0047 #endif
0048
0049 #endif
0050
0051 #endif