VirtualBox

source: vbox/trunk/src/VBox/Disassembler/DisasmInternal.h@ 41668

Last change on this file since 41668 was 41668, checked in by vboxsync, 12 years ago

DIS,DIS-users: Drop the operand/parameter formatting during instruction parsing. The desired formatter can do this afterwards if desired. Should save time + size. (DISCPUSTATE is now 256 bytes here on 64-bit linux, was ~406 yesterday.)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/* $Id: DisasmInternal.h 41668 2012-06-12 13:15:51Z vboxsync $ */
2/** @file
3 * VBox disassembler - Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2012 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
18#ifndef ___DisasmInternal_h___
19#define ___DisasmInternal_h___
20
21#include <VBox/types.h>
22#include <VBox/dis.h>
23
24#define ExceptionMemRead 0x666
25#define ExceptionInvalidModRM 0x667
26#define ExceptionInvalidParameter 0x668
27
28#define IDX_ParseNop 0
29#define IDX_ParseModRM 1
30#define IDX_UseModRM 2
31#define IDX_ParseImmByte 3
32#define IDX_ParseImmBRel 4
33#define IDX_ParseImmUshort 5
34#define IDX_ParseImmV 6
35#define IDX_ParseImmVRel 7
36#define IDX_ParseImmAddr 8
37#define IDX_ParseFixedReg 9
38#define IDX_ParseImmUlong 10
39#define IDX_ParseImmQword 11
40#define IDX_ParseTwoByteEsc 12
41#define IDX_ParseImmGrpl 13
42#define IDX_ParseShiftGrp2 14
43#define IDX_ParseGrp3 15
44#define IDX_ParseGrp4 16
45#define IDX_ParseGrp5 17
46#define IDX_Parse3DNow 18
47#define IDX_ParseGrp6 19
48#define IDX_ParseGrp7 20
49#define IDX_ParseGrp8 21
50#define IDX_ParseGrp9 22
51#define IDX_ParseGrp10 23
52#define IDX_ParseGrp12 24
53#define IDX_ParseGrp13 25
54#define IDX_ParseGrp14 26
55#define IDX_ParseGrp15 27
56#define IDX_ParseGrp16 28
57#define IDX_ParseModFence 29
58#define IDX_ParseYv 30
59#define IDX_ParseYb 31
60#define IDX_ParseXv 32
61#define IDX_ParseXb 33
62#define IDX_ParseEscFP 34
63#define IDX_ParseNopPause 35
64#define IDX_ParseImmByteSX 36
65#define IDX_ParseImmZ 37
66#define IDX_ParseThreeByteEsc4 38
67#define IDX_ParseThreeByteEsc5 39
68#define IDX_ParseImmAddrF 40
69#define IDX_ParseMax (IDX_ParseImmAddrF+1)
70
71
72extern PFNDISPARSE g_apfnFullDisasm[IDX_ParseMax];
73extern PFNDISPARSE g_apfnCalcSize[IDX_ParseMax];
74
75unsigned ParseInstruction(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, PDISCPUSTATE pCpu);
76void disValidateLockSequence(PDISCPUSTATE pCpu);
77
78/* Read functions */
79DECLCALLBACK(int) disReadBytesDefault(PDISCPUSTATE pCpu, uint8_t *pbDst, RTUINTPTR uSrcAddr, uint32_t cbToRead);
80uint8_t DISReadByte(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
81uint16_t DISReadWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
82uint32_t DISReadDWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
83uint64_t DISReadQWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
84
85size_t disFormatBytes(PCDISCPUSTATE pCpu, char *pszDst, size_t cchDst, uint32_t fFlags);
86
87#endif
88
Note: See TracBrowser for help on using the repository browser.

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