Home | History | Annotate | Download | only in pub
      1 
      2 /*---------------------------------------------------------------*/
      3 /*--- begin                                   libvex_emwarn.h ---*/
      4 /*---------------------------------------------------------------*/
      5 
      6 /*
      7    This file is part of Valgrind, a dynamic binary instrumentation
      8    framework.
      9 
     10    Copyright (C) 2004-2010 OpenWorks LLP
     11       info (at) open-works.net
     12 
     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.
     17 
     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
     26    02110-1301, USA.
     27 
     28    The GNU General Public License is contained in the file COPYING.
     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.
     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,
     60 
     61       /* unmasking x87 FP exceptions is not supported */
     62       EmWarn_X86_x87exns,
     63 
     64       /* change of x87 FP precision away from 64-bit (mantissa) */
     65       EmWarn_X86_x87precision,
     66 
     67       /* unmasking SSE FP exceptions is not supported */
     68       EmWarn_X86_sseExns,
     69 
     70       /* setting mxcsr.fz is not supported */
     71       EmWarn_X86_fz,
     72 
     73       /* setting mxcsr.daz is not supported */
     74       EmWarn_X86_daz,
     75 
     76       /* settings to %eflags.ac (alignment check) are noted but ignored */
     77       EmWarn_X86_acFlag,
     78 
     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,
     85 
     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 /*---------------------------------------------------------------*/
    100