1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/xlat/xlatdasm.h Tue Mar 06 12:42:33 2012 +1000
1.7 + * Wrapper around i386-dis to supply the same behaviour as the other
1.8 + * disassembly functions.
1.10 + * Copyright (c) 2005 Nathan Keynes.
1.12 + * This program is free software; you can redistribute it and/or modify
1.13 + * it under the terms of the GNU General Public License as published by
1.14 + * the Free Software Foundation; either version 2 of the License, or
1.15 + * (at your option) any later version.
1.17 + * This program is distributed in the hope that it will be useful,
1.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.20 + * GNU General Public License for more details.
1.26 +extern const struct cpu_desc_struct xlat_cpu_desc;
1.28 +typedef struct xlat_symbol {
1.36 + * Dump the disassembly of the specified code block to a stream
1.37 + * (primarily for debugging purposes)
1.38 + * @param out The stream to write the output to
1.39 + * @param code a translated block
1.41 +void xlat_disasm_block( FILE *out, void *code );
1.44 + * Disassemble one host instruction
1.45 + * @param pc Instruction to disassemble
1.46 + * @param buf buffer to hold the disassembled instruction
1.47 + * @param len sizeof buf
1.48 + * @param opcode buffer to hold the raw opcodes for the instruction (must be at least
1.49 + * 3 * maximum number of instruction bytes)
1.50 + * @return next pc after the current instruction
1.52 +uintptr_t xlat_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode );
1.54 +void xlat_disasm_region( FILE *out, void *block, uint32_t len );
1.55 +void xlat_disasm_init( xlat_symbol *symtab, int num_symbols );
1.56 +uintptr_t xlat_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode );
1.58 +void xlat_print_symbolic_operand( char *buf, int hex, uintptr_t disp );