sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 1 | |
| 2 | /*---------------------------------------------------------------*/ |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 3 | /*--- begin libvex_emnote.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 | 89ae847 | 2013-10-18 14:12:58 +0000 | [diff] [blame] | 10 | Copyright (C) 2004-2013 OpenWorks LLP |
sewardj | 752f906 | 2010-05-03 21:38:49 +0000 | [diff] [blame] | 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 | |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 36 | #ifndef __LIBVEX_EMNOTE_H |
| 37 | #define __LIBVEX_EMNOTE_H |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 38 | |
florian | 58a637b | 2012-09-30 20:30:17 +0000 | [diff] [blame] | 39 | #include "libvex_basictypes.h" |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 40 | |
| 41 | /* VEX can sometimes generate code which returns to the dispatcher |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 42 | with the guest state pointer set to VEX_TRC_JMP_EMWARN or |
| 43 | VEX_TRC_JMP_EMFAIL. This means that VEX is trying to tell Valgrind |
| 44 | something noteworthy about emulation progress. For example, that Valgrind |
| 45 | is doing imprecise emulation in some sense. The guest's pseudo-register |
| 46 | "guest_EMNOTE" will hold a value of type VexEmNote, which describes |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 47 | the nature of the warning. Currently the limitations that are |
| 48 | warned about apply primarily to floating point support. |
| 49 | |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 50 | All guest states must have a 32-bit (UInt) guest_EMNOTE pseudo- |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 51 | register, that emulation warnings can be written in to. |
| 52 | |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 53 | Note that guest_EMNOTE only carries a valid value at the jump |
| 54 | marked as VEX_TRC_JMP_EMWARN / VEX_TRC_JMP_EMFAIL. You can't assume |
| 55 | it will continue to carry a valid value from any amount of time after |
| 56 | the jump. |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 57 | */ |
| 58 | |
| 59 | typedef |
| 60 | enum { |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 61 | /* no note indicated */ |
| 62 | EmNote_NONE=0, |
sewardj | d01a963 | 2004-11-30 13:18:37 +0000 | [diff] [blame] | 63 | |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 64 | /* unmasking x87 FP exceptions is not supported */ |
| 65 | EmWarn_X86_x87exns, |
sewardj | d01a963 | 2004-11-30 13:18:37 +0000 | [diff] [blame] | 66 | |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 67 | /* change of x87 FP precision away from 64-bit (mantissa) */ |
| 68 | EmWarn_X86_x87precision, |
sewardj | d01a963 | 2004-11-30 13:18:37 +0000 | [diff] [blame] | 69 | |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 70 | /* unmasking SSE FP exceptions is not supported */ |
| 71 | EmWarn_X86_sseExns, |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 72 | |
sewardj | 5edfc26 | 2004-12-15 12:13:52 +0000 | [diff] [blame] | 73 | /* setting mxcsr.fz is not supported */ |
| 74 | EmWarn_X86_fz, |
| 75 | |
| 76 | /* setting mxcsr.daz is not supported */ |
| 77 | EmWarn_X86_daz, |
sewardj | 6d26984 | 2005-08-06 11:45:02 +0000 | [diff] [blame] | 78 | |
| 79 | /* settings to %eflags.ac (alignment check) are noted but ignored */ |
| 80 | EmWarn_X86_acFlag, |
sewardj | 7df596b | 2004-12-06 14:29:12 +0000 | [diff] [blame] | 81 | |
sewardj | 9dd9cf1 | 2006-01-20 14:13:55 +0000 | [diff] [blame] | 82 | /* unmasking PPC32/64 FP exceptions is not supported */ |
| 83 | EmWarn_PPCexns, |
| 84 | |
| 85 | /* overflow/underflow of the PPC64 _REDIR stack (ppc64 only) */ |
| 86 | EmWarn_PPC64_redir_overflow, |
| 87 | EmWarn_PPC64_redir_underflow, |
cerion | 094d139 | 2005-06-20 13:45:57 +0000 | [diff] [blame] | 88 | |
florian | 4b8efad | 2012-09-02 18:07:08 +0000 | [diff] [blame] | 89 | /* insn specifies a rounding mode other than "according to FPC" |
| 90 | which requires the floating point extension facility. But that |
| 91 | facility is not available on this host */ |
| 92 | EmWarn_S390X_fpext_rounding, |
| 93 | |
florian | f0fa1be | 2012-09-18 20:24:38 +0000 | [diff] [blame] | 94 | /* insn (e.g. srnmb) specifies an invalid rounding mode */ |
| 95 | EmWarn_S390X_invalid_rounding, |
| 96 | |
florian | 4e0083e | 2012-08-26 03:41:56 +0000 | [diff] [blame] | 97 | /* stfle insn is not supported on this host */ |
| 98 | EmFail_S390X_stfle, |
| 99 | |
florian | c5c669b | 2012-08-26 14:32:28 +0000 | [diff] [blame] | 100 | /* stckf insn is not supported on this host */ |
| 101 | EmFail_S390X_stckf, |
| 102 | |
florian | 8c88cb6 | 2012-08-26 18:58:13 +0000 | [diff] [blame] | 103 | /* ecag insn is not supported on this host */ |
| 104 | EmFail_S390X_ecag, |
| 105 | |
florian | e75dafa | 2012-09-01 17:54:09 +0000 | [diff] [blame] | 106 | /* insn needs floating point extension facility which is not |
| 107 | available on this host */ |
| 108 | EmFail_S390X_fpext, |
| 109 | |
florian | 78d5ef7 | 2013-05-11 15:02:58 +0000 | [diff] [blame] | 110 | /* GPR 0 contains invalid rounding mode for PFPO instruction */ |
| 111 | EmFail_S390X_invalid_PFPO_rounding_mode, |
| 112 | |
| 113 | /* The function code specified in GPR 0 executed by PFPO |
| 114 | instruction is invalid */ |
| 115 | EmFail_S390X_invalid_PFPO_function, |
| 116 | |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 117 | EmNote_NUMBER |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 118 | } |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 119 | VexEmNote; |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 120 | |
| 121 | |
| 122 | /* Produces a short string describing the warning. */ |
florian | 1ff4756 | 2012-10-21 02:09:51 +0000 | [diff] [blame] | 123 | extern const HChar* LibVEX_EmNote_string ( VexEmNote ); |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 124 | |
| 125 | |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 126 | #endif /* ndef __LIBVEX_EMNOTE_H */ |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 127 | |
| 128 | /*---------------------------------------------------------------*/ |
florian | 6ef84be | 2012-08-26 03:20:07 +0000 | [diff] [blame] | 129 | /*--- libvex_emnote.h ---*/ |
sewardj | 893aada | 2004-11-29 19:57:54 +0000 | [diff] [blame] | 130 | /*---------------------------------------------------------------*/ |