Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*---------------------------------------------------------------------------+
0003  |  exception.h                                                              |
0004  |                                                                           |
0005  | Copyright (C) 1992    W. Metzenthen, 22 Parker St, Ormond, Vic 3163,      |
0006  |                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au    |
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 /* SW_C1 */
0022 
0023 #define FPU_BUSY        Const_(0x8000)  /* FPU busy bit (8087 compatibility) */
0024 #define EX_ErrorSummary Const_(0x0080)  /* Error summary status */
0025 /* Special exceptions: */
0026 #define EX_INTERNAL Const_(0x8000)  /* Internal error in wm-FPU-emu */
0027 #define EX_StackOver    Const_(0x0041|SW_C1)    /* stack overflow */
0028 #define EX_StackUnder   Const_(0x0041)  /* stack underflow */
0029 /* Exception flags: */
0030 #define EX_Precision    Const_(0x0020)  /* loss of precision */
0031 #define EX_Underflow    Const_(0x0010)  /* underflow */
0032 #define EX_Overflow Const_(0x0008)  /* overflow */
0033 #define EX_ZeroDiv  Const_(0x0004)  /* divide by zero */
0034 #define EX_Denormal Const_(0x0002)  /* denormalized operand */
0035 #define EX_Invalid  Const_(0x0001)  /* invalid operation */
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 /* __ASSEMBLY__ */
0050 
0051 #endif /* _EXCEPTION_H_ */