1 | /* $Id: bs3-cpu-generated-1.h 65893 2017-02-28 09:38:29Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * BS3Kit - bs3-cpu-generated-1, common header file.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2007-2016 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 |
|
---|
28 | #ifndef ___bs3_cpu_generated_1_h___
|
---|
29 | #define ___bs3_cpu_generated_1_h___
|
---|
30 |
|
---|
31 | #include <bs3kit.h>
|
---|
32 | #include <iprt/assert.h>
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 | /** Instruction encoding format. */
|
---|
37 | typedef enum BS3CG1ENC
|
---|
38 | {
|
---|
39 | BS3CG1ENC_INVALID = 0,
|
---|
40 | BS3CG1ENC_FIXED,
|
---|
41 | BS3CG1ENC_MODRM,
|
---|
42 | BS3CG1ENC_END
|
---|
43 | } BS3CG1ENC;
|
---|
44 |
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * Operand details.
|
---|
48 | *
|
---|
49 | * Currently simply using the encoding from the reference manuals.
|
---|
50 | */
|
---|
51 | typedef enum BS3CG1OP
|
---|
52 | {
|
---|
53 | BS3CG1OP_INVALID = 0,
|
---|
54 |
|
---|
55 | BS3CG1OP_Eb,
|
---|
56 | BS3CG1OP_Ev,
|
---|
57 |
|
---|
58 | BS3CG1OP_Gb,
|
---|
59 | BS3CG1OP_Gv,
|
---|
60 |
|
---|
61 | BS3CG1OP_END
|
---|
62 | } BS3CG1OP;
|
---|
63 |
|
---|
64 |
|
---|
65 | /**
|
---|
66 | * Generated instruction info.
|
---|
67 | */
|
---|
68 | typedef struct BS3CG1INSTR
|
---|
69 | {
|
---|
70 | /** Opcode bytes. */
|
---|
71 | uint8_t abOpcode[4];
|
---|
72 | /** BS3CG1OP values for each operand. */
|
---|
73 | uint8_t aenmOperands[4];
|
---|
74 | /** The opcode size. */
|
---|
75 | uint32_t cbOpcode : 2;
|
---|
76 | /** The number of operands. */
|
---|
77 | uint32_t cOperands : 2;
|
---|
78 | /** BS3CG1ENC values. */
|
---|
79 | uint32_t enmEncoding : 5;
|
---|
80 | /** The length of the mnemonic. */
|
---|
81 | uint32_t cchMnemonic : 4;
|
---|
82 | /** Index of the test header into g_aBs3Cg1Tests */
|
---|
83 | uint32_t idxTestHdr : 19;
|
---|
84 | /** BS3CG1INSTR_F_XXX. */
|
---|
85 | uint32_t fFlags;
|
---|
86 | } BS3CG1INSTR;
|
---|
87 | AssertCompileSize(BS3CG1INSTR, 16);
|
---|
88 | /** Pointer to a const test. */
|
---|
89 | typedef BS3CG1INSTR const BS3_FAR *PCBS3CG1INSTR;
|
---|
90 |
|
---|
91 |
|
---|
92 | /** @name BS3CG1INSTR_F_XXX
|
---|
93 | * @{ */
|
---|
94 | #define BS3CG1INSTR_F_ UINT32_C(0x00000000)
|
---|
95 | /** @} */
|
---|
96 |
|
---|
97 |
|
---|
98 | typedef struct BS3CG1TESTHDR
|
---|
99 | {
|
---|
100 | /** Number of tests left for this instruction. */
|
---|
101 | uint16_t cLeft;
|
---|
102 | /** The size of this test. */
|
---|
103 | uint16_t cbTest;
|
---|
104 | } BS3CG1TESTHDR;
|
---|
105 |
|
---|
106 |
|
---|
107 |
|
---|
108 | /** The number of test instructions (generated). */
|
---|
109 | extern uint16_t BS3_FAR_DATA g_cBs3Cg1Instructions;
|
---|
110 | /** The test instructions (generated). */
|
---|
111 | extern const char BS3_FAR_DATA g_aBs3Cg1Instructions[];
|
---|
112 | /** The test data that BS3CG1INSTR. */
|
---|
113 | extern BS3CG1TESTHDR BS3_FAR_DATA g_aBs3Cg1Tests[];
|
---|
114 | /** The mnemonics (generated).
|
---|
115 | * Variable length sequence of mnemonics that runs in parallel to
|
---|
116 | * g_aBs3Cg1Instructions. */
|
---|
117 | extern const char BS3_FAR_DATA g_achBs3Cg1Mnemonics[];
|
---|
118 |
|
---|
119 |
|
---|
120 | #endif
|
---|
121 |
|
---|