sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 1 | |
| 2 | /*---------------------------------------------------------------*/ |
sewardj | 752f906 | 2010-05-03 21:38:49 +0000 | [diff] [blame] | 3 | /*--- begin libvex_emwarn.h ---*/ |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 4 | /*---------------------------------------------------------------*/ |
| 5 | |
| 6 | /* |
sewardj | 752f906 | 2010-05-03 21:38:49 +0000 | [diff] [blame] | 7 | This file is part of Valgrind, a dynamic binary instrumentation |
| 8 | framework. |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 9 | |
sewardj | 752f906 | 2010-05-03 21:38:49 +0000 | [diff] [blame] | 10 | Copyright (C) 2004-2010 OpenWorks LLP |
| 11 | info@open-works.net |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 12 | |
sewardj | 752f906 | 2010-05-03 21:38:49 +0000 | [diff] [blame] | 13 | This program is free software; you can redistribute it and/or |
| 14 | modify it under the terms of the GNU General Public License as |
| 15 | published by the Free Software Foundation; either version 2 of the |
| 16 | License, or (at your option) any later version. |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 17 | |
sewardj | 752f906 | 2010-05-03 21:38:49 +0000 | [diff] [blame] | 18 | This program is distributed in the hope that it will be useful, but |
| 19 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | General Public License for more details. |
| 22 | |
| 23 | You should have received a copy of the GNU General Public License |
| 24 | along with this program; if not, write to the Free Software |
| 25 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
sewardj | 7bd6ffe | 2005-08-03 16:07:36 +0000 | [diff] [blame] | 26 | 02110-1301, USA. |
| 27 | |
sewardj | 752f906 | 2010-05-03 21:38:49 +0000 | [diff] [blame] | 28 | The GNU General Public License is contained in the file COPYING. |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 29 | |
| 30 | Neither the names of the U.S. Department of Energy nor the |
| 31 | University of California nor the names of its contributors may be |
| 32 | used to endorse or promote products derived from this software |
| 33 | without prior written permission. |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 34 | */ |
| 35 | |
| 36 | #ifndef __LIBVEX_EMWARN_H |
| 37 | #define __LIBVEX_EMWARN_H |
| 38 | |
| 39 | |
| 40 | /* VEX can sometimes generate code which returns to the dispatcher |
| 41 | with the guest state pointer set to VEX_TRC_JMP_EMWARN. This means |
| 42 | that VEX is trying to warn Valgrind that it is doing imprecise |
| 43 | emulation in some sense. The guest's pseudo-register |
| 44 | "guest_EMWARN" will hold a value of type VexEmWarn, which describes |
| 45 | the nature of the warning. Currently the limitations that are |
| 46 | warned about apply primarily to floating point support. |
| 47 | |
| 48 | All guest states should have a 32-bit (UInt) guest_EMWARN pseudo- |
| 49 | register, that emulation warnings can be written in to. |
| 50 | |
| 51 | Note that guest_EMWARN only carries a valid value at the jump |
| 52 | marked as VEX_TRC_JMP_EMWARN. You can't assume it will continue to |
| 53 | carry a valid value from any amount of time after the jump. |
| 54 | */ |
| 55 | |
| 56 | typedef |
| 57 | enum { |
| 58 | /* no warning indicated */ |
| 59 | EmWarn_NONE=0, |
sewardj | d01a963 | 2004-11-30 13:18:37 +0000 | [diff] [blame] | 60 | |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 61 | /* unmasking x87 FP exceptions is not supported */ |
| 62 | EmWarn_X86_x87exns, |
sewardj | d01a963 | 2004-11-30 13:18:37 +0000 | [diff] [blame] | 63 | |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 64 | /* change of x87 FP precision away from 64-bit (mantissa) */ |
| 65 | EmWarn_X86_x87precision, |
sewardj | d01a963 | 2004-11-30 13:18:37 +0000 | [diff] [blame] | 66 | |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 67 | /* unmasking SSE FP exceptions is not supported */ |
| 68 | EmWarn_X86_sseExns, |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 69 | |
sewardj | 5edfc26 | 2004-12-15 12:13:52 +0000 | [diff] [blame] | 70 | /* setting mxcsr.fz is not supported */ |
| 71 | EmWarn_X86_fz, |
| 72 | |
| 73 | /* setting mxcsr.daz is not supported */ |
| 74 | EmWarn_X86_daz, |
sewardj | 6d26984 | 2005-08-06 11:45:02 +0000 | [diff] [blame] | 75 | |
| 76 | /* settings to %eflags.ac (alignment check) are noted but ignored */ |
| 77 | EmWarn_X86_acFlag, |
sewardj | 7df596b | 2004-12-06 14:29:12 +0000 | [diff] [blame] | 78 | |
sewardj | 9dd9cf1 | 2006-01-20 14:13:55 +0000 | [diff] [blame] | 79 | /* unmasking PPC32/64 FP exceptions is not supported */ |
| 80 | EmWarn_PPCexns, |
| 81 | |
| 82 | /* overflow/underflow of the PPC64 _REDIR stack (ppc64 only) */ |
| 83 | EmWarn_PPC64_redir_overflow, |
| 84 | EmWarn_PPC64_redir_underflow, |
cerion | 094d139 | 2005-06-20 13:45:57 +0000 | [diff] [blame] | 85 | |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 86 | EmWarn_NUMBER |
| 87 | } |
| 88 | VexEmWarn; |
| 89 | |
| 90 | |
| 91 | /* Produces a short string describing the warning. */ |
| 92 | extern HChar* LibVEX_EmWarn_string ( VexEmWarn ); |
| 93 | |
| 94 | |
| 95 | #endif /* ndef __LIBVEX_EMWARN_H */ |
| 96 | |
| 97 | /*---------------------------------------------------------------*/ |
| 98 | /*--- libvex_emwarn.h ---*/ |
| 99 | /*---------------------------------------------------------------*/ |