VirtualBox

Changeset 80071 in vbox for trunk/src


Ignore:
Timestamp:
Jul 31, 2019 11:43:16 AM (5 years ago)
Author:
vboxsync
Message:

VMM: Kicking out raw-mode and 32-bit hosts - CPUM. [disasm fixes] bugref:9517 bugref:9511

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/DisasmReg.cpp

    r76553 r80071  
    2525#include <iprt/errcore.h>
    2626#include <VBox/log.h>
    27 #include <VBox/vmm/cpum.h>
     27#ifdef RT_ARCH_AMD64
     28# include <VBox/vmm/cpum.h>
     29#endif
    2830#include <iprt/assert.h>
    2931#include <iprt/string.h>
     
    3537*   Global Variables                                                                                                             *
    3638*********************************************************************************************************************************/
     39#ifdef RT_ARCH_AMD64
    3740
    3841/**
     
    6366 * Macro for accessing 64-bit general purpose registers in CPUMCTXCORE structure.
    6467 */
    65 #define DIS_READ_REG64(p, idx)       (*(uint64_t *)((char *)(p) + g_aReg64Index[idx]))
    66 #define DIS_WRITE_REG64(p, idx, val) (*(uint64_t *)((char *)(p) + g_aReg64Index[idx]) = val)
    67 #define DIS_PTR_REG64(p, idx)        ( (uint64_t *)((char *)(p) + g_aReg64Index[idx]))
     68# define DIS_READ_REG64(p, idx)       (*(uint64_t *)((char *)(p) + g_aReg64Index[idx]))
     69# define DIS_WRITE_REG64(p, idx, val) (*(uint64_t *)((char *)(p) + g_aReg64Index[idx]) = val)
     70# define DIS_PTR_REG64(p, idx)        ( (uint64_t *)((char *)(p) + g_aReg64Index[idx]))
    6871
    6972/**
     
    9497 * Macro for accessing 32-bit general purpose registers in CPUMCTXCORE structure.
    9598 */
    96 #define DIS_READ_REG32(p, idx)       (*(uint32_t *)((char *)(p) + g_aReg32Index[idx]))
     99# define DIS_READ_REG32(p, idx)       (*(uint32_t *)((char *)(p) + g_aReg32Index[idx]))
    97100/* From http://www.cs.cmu.edu/~fp/courses/15213-s06/misc/asm64-handout.pdf:
    98101 * ``Perhaps unexpectedly, instructions that move or generate 32-bit register
     
    100103 *   there is no need for an instruction movzlq.''
    101104 */
    102 #define DIS_WRITE_REG32(p, idx, val) (*(uint64_t *)((char *)(p) + g_aReg32Index[idx]) = (uint32_t)val)
    103 #define DIS_PTR_REG32(p, idx)        ( (uint32_t *)((char *)(p) + g_aReg32Index[idx]))
     105# define DIS_WRITE_REG32(p, idx, val) (*(uint64_t *)((char *)(p) + g_aReg32Index[idx]) = (uint32_t)val)
     106# define DIS_PTR_REG32(p, idx)        ( (uint32_t *)((char *)(p) + g_aReg32Index[idx]))
    104107
    105108/**
     
    130133 * Macro for accessing 16-bit general purpose registers in CPUMCTXCORE structure.
    131134 */
    132 #define DIS_READ_REG16(p, idx)          (*(uint16_t *)((char *)(p) + g_aReg16Index[idx]))
    133 #define DIS_WRITE_REG16(p, idx, val)    (*(uint16_t *)((char *)(p) + g_aReg16Index[idx]) = val)
    134 #define DIS_PTR_REG16(p, idx)           ( (uint16_t *)((char *)(p) + g_aReg16Index[idx]))
     135# define DIS_READ_REG16(p, idx)          (*(uint16_t *)((char *)(p) + g_aReg16Index[idx]))
     136# define DIS_WRITE_REG16(p, idx, val)    (*(uint16_t *)((char *)(p) + g_aReg16Index[idx]) = val)
     137# define DIS_PTR_REG16(p, idx)           ( (uint16_t *)((char *)(p) + g_aReg16Index[idx]))
    135138
    136139/**
     
    165168 * Macro for accessing 8-bit general purpose registers in CPUMCTXCORE structure.
    166169 */
    167 #define DIS_READ_REG8(p, idx)           (*(uint8_t *)((char *)(p) + g_aReg8Index[idx]))
    168 #define DIS_WRITE_REG8(p, idx, val)     (*(uint8_t *)((char *)(p) + g_aReg8Index[idx]) = val)
    169 #define DIS_PTR_REG8(p, idx)            ( (uint8_t *)((char *)(p) + g_aReg8Index[idx]))
     170# define DIS_READ_REG8(p, idx)           (*(uint8_t *)((char *)(p) + g_aReg8Index[idx]))
     171# define DIS_WRITE_REG8(p, idx, val)     (*(uint8_t *)((char *)(p) + g_aReg8Index[idx]) = val)
     172# define DIS_PTR_REG8(p, idx)            ( (uint8_t *)((char *)(p) + g_aReg8Index[idx]))
    170173
    171174/**
     
    196199 * Macro for accessing segment registers in CPUMCTXCORE structure.
    197200 */
    198 #define DIS_READ_REGSEG(p, idx)         (*((uint16_t *)((char *)(p) + g_aRegSegIndex[idx])))
    199 #define DIS_WRITE_REGSEG(p, idx, val)   (*((uint16_t *)((char *)(p) + g_aRegSegIndex[idx])) = val)
     201# define DIS_READ_REGSEG(p, idx)         (*((uint16_t *)((char *)(p) + g_aRegSegIndex[idx])))
     202# define DIS_WRITE_REGSEG(p, idx, val)   (*((uint16_t *)((char *)(p) + g_aRegSegIndex[idx])) = val)
     203
     204#endif /* RT_ARCH_AMD64 */
     205
    200206
    201207//*****************************************************************************
     
    334340
    335341
     342#ifdef RT_ARCH_AMD64
     343
    336344/**
    337345 * Returns the value of the specified 8 bits general purpose register
     
    835843}
    836844
     845#endif /* RT_ARCH_AMD64 */
     846
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette