VirtualBox

Ignore:
Timestamp:
Feb 28, 2017 3:25:30 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113695
Message:

bs3-cpu-generated-1: updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h

    r65893 r65903  
    8686} BS3CG1INSTR;
    8787AssertCompileSize(BS3CG1INSTR, 16);
    88 /** Pointer to a const test. */
     88/** Pointer to a const instruction. */
    8989typedef BS3CG1INSTR const BS3_FAR *PCBS3CG1INSTR;
    9090
     
    9696
    9797
     98/**
     99 * Test header.
     100 */
    98101typedef struct BS3CG1TESTHDR
    99102{
    100     /** Number of tests left for this instruction. */
    101     uint16_t    cLeft;
    102     /** The size of this test. */
    103     uint16_t    cbTest;
     103    /** The size of the selector program in bytes.
     104     * This is also the offset of the input context modification program.  */
     105    uint32_t    cbSelector : 9;
     106    /** The size of the input context modification program in bytes.
     107     * This immediately follows the selector program.  */
     108    uint32_t    cbInput    : 11;
     109    /** The size of the output context modification program in bytes.
     110     * This immediately follows the input context modification program.  The
     111     * program takes the result of the input program as starting point. */
     112    uint32_t    cbOutput   : 11;
     113    /** Indicates whether this is the last test or not. */
     114    uint32_t    fLast      : 1;
    104115} BS3CG1TESTHDR;
    105 
     116AssertCompileSize(BS3CG1TESTHDR, 4);
     117/** Pointer to a const test header. */
     118typedef BS3CG1TESTHDR const BS3_FAR *PCBS3CG1TESTHDR;
     119
     120/** @name Opcode format for the BS3CG1 context modifier.
     121 *
     122 * Used by both the input and output context programs.
     123 *
     124 * The most common operations are encoded as a single byte opcode followed by
     125 * one or more immediate bytes with data.
     126 *
     127 * @{ */
     128#define BS3CG1_CTXOP_SIZE_MASK      UINT8_C(0x07)
     129#define BS3CG1_CTXOP_1_BYTE         UINT8_C(0x00)
     130#define BS3CG1_CTXOP_2_BYTE         UINT8_C(0x01)
     131#define BS3CG1_CTXOP_4_BYTE         UINT8_C(0x02)
     132#define BS3CG1_CTXOP_8_BYTE         UINT8_C(0x03)
     133#define BS3CG1_CTXOP_16_BYTE        UINT8_C(0x04)
     134#define BS3CG1_CTXOP_32_BYTE        UINT8_C(0x05)
     135#define BS3CG1_CTXOP_12_BYTE        UINT8_C(0x06)
     136#define BS3CG1_CTXOP_SIZE_ESC       UINT8_C(0x07)   /**< Separate byte encoding the value size follows immediately. */
     137
     138#define BS3CG1_CTXOP_DST_MASK       UINT8_C(0x18)
     139#define BS3CG1_CTXOP_OP1            UINT8_C(0x00)
     140#define BS3CG1_CTXOP_OP2            UINT8_C(0x08)
     141#define BS3CG1_CTXOP_EFL            UINT8_C(0x10)
     142#define BS3CG1_CTXOP_DST_ESC        UINT8_C(0x18)   /**< Separate byte giving the destination follows after any size byte.*/
     143
     144#define BS3CG1_CTXOP_SIGN_EXT       UINT8_C(0x20)   /**< Whether to sign-extend (set) the immediate value. */
     145
     146#define BS3CG1_CTXOP_OPERATOR_MASK  UINT8_C(0xc0)
     147#define BS3CG1_CTXOP_ASSIGN         UINT8_C(0x00)   /**< Simple assignment operator (=) */
     148#define BS3CG1_CTXOP_OR             UINT8_C(0x40)   /**< OR assignment operator (|=). */
     149#define BS3CG1_CTXOP_AND            UINT8_C(0x80)   /**< AND assignment operator (&=). */
     150#define BS3CG1_CTXOP_AND_INV        UINT8_C(0xc0)   /**< AND assignment operator of the inverted value (&~=). */
     151/** @} */
     152
     153/**
     154 * Escaped destination values
     155 *
     156 * These are just uppercased versions of TestInOut.kdFields, where dots are
     157 * replaced by underscores.
     158 */
     159enum BS3CG1DST
     160{
     161    BS3CG1DST_INVALID = 0,
     162    /* Operands. */
     163    BS3CG1DST_OP1,
     164    BS3CG1DST_OP2,
     165    BS3CG1DST_OP3,
     166    BS3CG1DST_OP4,
     167    /* Flags. */
     168    BS3CG1DST_EFL,
     169    /* 8-bit GPRs. */
     170    BS3CG1DST_AL,
     171    BS3CG1DST_CL,
     172    BS3CG1DST_DL,
     173    BS3CG1DST_BL,
     174    BS3CG1DST_AH,
     175    BS3CG1DST_CH,
     176    BS3CG1DST_DH,
     177    BS3CG1DST_BH,
     178    BS3CG1DST_R8L,
     179    BS3CG1DST_R9L,
     180    BS3CG1DST_R10L,
     181    BS3CG1DST_R11L,
     182    BS3CG1DST_R12L,
     183    BS3CG1DST_R13L,
     184    BS3CG1DST_R14L,
     185    BS3CG1DST_R15L,
     186    /* 16-bit GPRs. */
     187    BS3CG1DST_AX,
     188    BS3CG1DST_DX,
     189    BS3CG1DST_CX,
     190    BS3CG1DST_BX,
     191    BS3CG1DST_SP,
     192    BS3CG1DST_BP,
     193    BS3CG1DST_SI,
     194    BS3CG1DST_DI,
     195    BS3CG1DST_R8W,
     196    BS3CG1DST_R9W,
     197    BS3CG1DST_R10W,
     198    BS3CG1DST_R11W,
     199    BS3CG1DST_R12W,
     200    BS3CG1DST_R13W,
     201    BS3CG1DST_R14W,
     202    BS3CG1DST_R15W,
     203    /* 32-bit GPRs. */
     204    BS3CG1DST_EAX,
     205    BS3CG1DST_EDX,
     206    BS3CG1DST_ECX,
     207    BS3CG1DST_EBX,
     208    BS3CG1DST_ESP,
     209    BS3CG1DST_EBP,
     210    BS3CG1DST_ESI,
     211    BS3CG1DST_EDI,
     212    BS3CG1DST_R8D,
     213    BS3CG1DST_R9D,
     214    BS3CG1DST_R10D,
     215    BS3CG1DST_R11D,
     216    BS3CG1DST_R12D,
     217    BS3CG1DST_R13D,
     218    BS3CG1DST_R14D,
     219    BS3CG1DST_R15D,
     220    /* 64-bit GPRs. */
     221    BS3CG1DST_RAX,
     222    BS3CG1DST_RDX,
     223    BS3CG1DST_RCX,
     224    BS3CG1DST_RBX,
     225    BS3CG1DST_RSP,
     226    BS3CG1DST_RBP,
     227    BS3CG1DST_RSI,
     228    BS3CG1DST_RDI,
     229    BS3CG1DST_R8,
     230    BS3CG1DST_R9,
     231    BS3CG1DST_R10,
     232    BS3CG1DST_R11,
     233    BS3CG1DST_R12,
     234    BS3CG1DST_R13,
     235    BS3CG1DST_R14,
     236    BS3CG1DST_R15,
     237    /* 16-bit, 32-bit or 64-bit registers according to operand size. */
     238    BS3CG1DST_OZ_RAX,
     239    BS3CG1DST_OZ_RDX,
     240    BS3CG1DST_OZ_RCX,
     241    BS3CG1DST_OZ_RBX,
     242    BS3CG1DST_OZ_RSP,
     243    BS3CG1DST_OZ_RBP,
     244    BS3CG1DST_OZ_RSI,
     245    BS3CG1DST_OZ_RDI,
     246    BS3CG1DST_OZ_R8,
     247    BS3CG1DST_OZ_R9,
     248    BS3CG1DST_OZ_R10,
     249    BS3CG1DST_OZ_R11,
     250    BS3CG1DST_OZ_R12,
     251    BS3CG1DST_OZ_R13,
     252    BS3CG1DST_OZ_R14,
     253    BS3CG1DST_OZ_R15,
     254
     255    BS3CG1DST_END
     256} BS3CG1DST;
     257
     258/** @name Selector opcode definitions.
     259 *
     260 * Selector programs are very simple, they are zero or more predicate tests
     261 * that are ANDed together.  If a predicate test fails, the test is skipped.
     262 *
     263 * One instruction is encoded as byte, where the first bit indicates what kind
     264 * of test and the 7 remaining bits indicates which predicate to check.
     265 *
     266 * @{ */
     267#define BS3CG1SEL_OP_KIND_MASK  UINT8_C(0x01)   /**< The operator part (put in lower bit to reduce switch value range). */
     268#define BS3CG1SEL_OP_IS_TRUE    UINT8_C(0x00)   /**< Check that the predicate is true. */
     269#define BS3CG1SEL_OP_IS_FALSE   UINT8_C(0x01)   /**< Check that the predicate is false. */
     270#define BS3CG1SEL_OP_PRED_SHIFT 1               /**< Shift factor for getting/putting a BS3CG1PRED value into/from a byte. */
     271/** @} */
     272
     273/**
     274 * Test selector predicates (values are shifted by BS3CG1SEL_OP_PRED_SHIFT).
     275 */
     276typedef enum BS3CG1PRED
     277{
     278     BS3CG1PRED_INVALID = 0,
     279
     280     /* Operand size. */
     281     BS3CG1PRED_SIZE_O16,
     282     BS3CG1PRED_SIZE_O32,
     283     BS3CG1PRED_SIZE_O64,
     284     /* Execution ring. */
     285     BS3CG1PRED_RING_0,
     286     BS3CG1PRED_RING_1,
     287     BS3CG1PRED_RING_2,
     288     BS3CG1PRED_RING_3,
     289     BS3CG1PRED_RING_0_THRU_2,
     290     BS3CG1PRED_RING_1_THRU_3,
     291     /* Basic code mode. */
     292     BS3CG1PRED_CODE_64BIT,
     293     BS3CG1PRED_CODE_32BIT,
     294     BS3CG1PRED_CODE_16BIT,
     295     /* CPU modes. */
     296     BS3CG1PRED_MODE_REAL,
     297     BS3CG1PRED_MODE_PROT,
     298     BS3CG1PRED_MODE_LONG,
     299     BS3CG1PRED_MODE_V86,
     300     BS3CG1PRED_MODE_SMM,
     301     BS3CG1PRED_MODE_VMX,
     302     BS3CG1PRED_MODE_SVM,
     303     /* Paging on/off */
     304     BS3CG1PRED_PAGING_ON,
     305     BS3CG1PRED_PAGING_OFF,
     306
     307     BS3CG1PRED_END
     308} BS3CG1PRED;
    106309
    107310
Note: See TracChangeset for help on using the changeset viewer.

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